mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 23:38:25 +01:00
Patches!!! MORE
This commit is contained in:
parent
2633e8f90d
commit
0087658702
147 changed files with 137 additions and 158 deletions
|
@ -1027,7 +1027,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Retrieve the {@link alternate.current.wire.Node Node} that represents the
|
||||
+ * Retrieve the {@link Node Node} that represents the
|
||||
+ * block at the given position in the level.
|
||||
+ */
|
||||
+ private Node getOrAddNode(BlockPos pos) {
|
||||
|
@ -1046,7 +1046,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Remove and return the {@link alternate.current.wire.Node Node} at the given
|
||||
+ * Remove and return the {@link Node Node} at the given
|
||||
+ * position.
|
||||
+ */
|
||||
+ private Node removeNode(BlockPos pos) {
|
||||
|
@ -1054,7 +1054,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ }
|
||||
+
|
||||
+ /**
|
||||
+ * Return a {@link alternate.current.wire.Node Node} that represents the block
|
||||
+ * Return a {@link Node Node} that represents the block
|
||||
+ * at the given position.
|
||||
+ */
|
||||
+ private Node getNextNode(BlockPos pos) {
|
||||
|
@ -1063,8 +1063,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+
|
||||
+ /**
|
||||
+ * Return a node that represents the given position and block state. If it is a
|
||||
+ * wire, then create a new {@link alternate.current.wire.WireNode WireNode}.
|
||||
+ * Otherwise, grab the next {@link alternate.current.wire.Node Node} from the
|
||||
+ * wire, then create a new {@link WireNode WireNode}.
|
||||
+ * Otherwise, grab the next {@link Node Node} from the
|
||||
+ * cache and update it.
|
||||
+ */
|
||||
+ private Node getNextNode(BlockPos pos, BlockState state) {
|
||||
|
@ -2020,7 +2020,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
final Throwable thr = new Throwable(entity + " Added to world at " + new java.util.Date());
|
||||
io.papermc.paper.util.StacktraceDeobfuscator.INSTANCE.deobfuscateThrowable(thr);
|
||||
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
return this.randomSequences;
|
||||
return crashreportsystemdetails;
|
||||
}
|
||||
|
||||
+ // Paper start - optimize redstone (Alternate Current)
|
|
@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
if (true && !this.isPassenger() && this.portalTime++ >= i) { // CraftBukkit
|
||||
this.level().getProfiler().push("portal");
|
||||
this.portalTime = i;
|
||||
|
@ -22,7 +22,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
this.setPortalCooldown();
|
||||
// CraftBukkit start
|
||||
if (this instanceof ServerPlayer) {
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
} else {
|
||||
this.changeDimension(worldserver1);
|
||||
}
|
|
@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@javax.annotation.Nullable
|
||||
private UUID originWorld;
|
||||
public boolean freezeLocked = false; // Paper - Freeze Tick Lock API
|
||||
|
@ -16,7 +16,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
public void setOrigin(@javax.annotation.Nonnull Location location) {
|
||||
this.origin = location.toVector();
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
null, null
|
||||
);
|
||||
|
|
@ -46,12 +46,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
|
||||
@@ -0,0 +0,0 @@ public class Explosion {
|
||||
bukkitBlocks = event.blockList();
|
||||
yield = event.getYield();
|
||||
this.yield = event.getYield();
|
||||
} else {
|
||||
- BlockExplodeEvent event = new BlockExplodeEvent(location.getBlock(), blockList, this.blockInteraction == Explosion.BlockInteraction.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F);
|
||||
+ BlockExplodeEvent event = new BlockExplodeEvent(location.getBlock(), blockList, this.blockInteraction == Explosion.BlockInteraction.DESTROY_WITH_DECAY ? 1.0F / this.radius : 1.0F, this.damageSource.explodedBlockState); // Paper - exploded block state
|
||||
- BlockExplodeEvent event = new BlockExplodeEvent(location.getBlock(), blockList, this.yield);
|
||||
+ BlockExplodeEvent event = new BlockExplodeEvent(location.getBlock(), blockList, this.yield, this.damageSource.explodedBlockState); // Paper - exploded block state
|
||||
this.level.getCraftServer().getPluginManager().callEvent(event);
|
||||
cancelled = event.isCancelled();
|
||||
this.wasCanceled = event.isCancelled();
|
||||
bukkitBlocks = event.blockList();
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BedBlock.java b/src/main/java/net/minecraft/world/level/block/BedBlock.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
|
@ -8,11 +8,11 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
stack.setCount(0); // Paper - destroy this item - if this ever leaks due to game bugs, ensure it doesn't dupe
|
||||
|
||||
entityitem.setDefaultPickUpDelay();
|
||||
+ // Paper start
|
||||
+ // Paper start
|
||||
+ return this.spawnAtLocation(entityitem);
|
||||
+ }
|
||||
+ }
|
||||
|
@ -42,7 +42,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+++ b/src/main/java/net/minecraft/world/entity/animal/Fox.java
|
||||
@@ -0,0 +0,0 @@ public class Fox extends Animal implements VariantHolder<Fox.Type> {
|
||||
entityitem.setPickUpDelay(40);
|
||||
entityitem.setThrower(this.getUUID());
|
||||
entityitem.setThrower(this);
|
||||
this.playSound(SoundEvents.FOX_SPIT, 1.0F, 1.0F);
|
||||
- this.level().addFreshEntity(entityitem);
|
||||
+ this.spawnAtLocation(entityitem); // Paper - call EntityDropItemEvent
|
|
@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+++ b/src/main/java/net/minecraft/world/entity/ExperienceOrb.java
|
||||
@@ -0,0 +0,0 @@ public class ExperienceOrb extends Entity {
|
||||
ItemStack itemstack = (ItemStack) entry.getValue();
|
||||
int j = Math.min(this.xpToDurability(this.value), itemstack.getDamageValue());
|
||||
int j = Math.min(this.xpToDurability(amount), itemstack.getDamageValue());
|
||||
// CraftBukkit start
|
||||
- org.bukkit.event.player.PlayerItemMendEvent event = CraftEventFactory.callPlayerItemMendEvent(player, this, itemstack, entry.getKey(), j);
|
||||
+ org.bukkit.event.player.PlayerItemMendEvent event = CraftEventFactory.callPlayerItemMendEvent(player, this, itemstack, entry.getKey(), j, this::durabilityToXp); // Paper
|
|
@ -9,7 +9,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
}
|
||||
|
||||
if (!bl.getType().isAir()) {
|
|
@ -100,11 +100,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- a/src/main/java/net/minecraft/world/item/AxeItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/AxeItem.java
|
||||
@@ -0,0 +0,0 @@ public class AxeItem extends DiggerItem {
|
||||
}
|
||||
|
||||
if (optional4.isPresent()) {
|
||||
return InteractionResult.PASS;
|
||||
} else {
|
||||
ItemStack itemStack = context.getItemInHand();
|
||||
+ // Paper start - EntityChangeBlockEvent
|
||||
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(player, blockPos, optional4.get())) {
|
||||
+ if (!org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(player, blockPos, optional.get())) {
|
||||
+ return InteractionResult.PASS;
|
||||
+ }
|
||||
+ // Paper end
|
|
@ -9,7 +9,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
pluginManager.callEvent(entityCombustEvent);
|
||||
if (!entityCombustEvent.isCancelled()) {
|
||||
this.setSecondsOnFire(entityCombustEvent.getDuration(), false);
|
|
@ -9,9 +9,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSpawnEgg.java
|
||||
@@ -0,0 +0,0 @@ public class CraftMetaSpawnEgg extends CraftMetaItem implements SpawnEggMeta {
|
||||
public void setSpawnedType(EntityType type) {
|
||||
throw new UnsupportedOperationException("Must change item type to set spawned type");
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
+ @Override
|
||||
+ public EntityType getCustomSpawnedType() {
|
||||
|
@ -36,7 +36,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ }
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
|
||||
@Override
|
||||
boolean equalsCommon(CraftMetaItem meta) {
|
||||
if (!super.equalsCommon(meta)) {
|
||||
public EntitySnapshot getSpawnedEntity() {
|
|
@ -66,9 +66,6 @@ https://bugs.mojang.com/browse/MC-174630
|
|||
https://bugs.mojang.com/browse/MC-153086
|
||||
Fix the beacon deactivation sound always playing when broken
|
||||
|
||||
https://bugs.mojang.com/browse/MC-259321
|
||||
Fix spawners checking max nearby entities with correct type
|
||||
|
||||
https://bugs.mojang.com/browse/MC-200092
|
||||
Fix yaw being ignored for a player's first spawn pos
|
||||
|
||||
|
@ -135,7 +132,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -0,0 +0,0 @@ public class ServerLevel extends Level implements WorldGenLevel {
|
||||
} else {
|
||||
AABB axisalignedbb = (new AABB(blockposition1, new BlockPos(blockposition1.getX(), this.getMaxBuildHeight(), blockposition1.getZ()))).inflate(3.0D);
|
||||
AABB axisalignedbb = AABB.encapsulatingFullBlocks(blockposition1, new BlockPos(blockposition1.atY(this.getMaxBuildHeight()))).inflate(3.0D);
|
||||
List<LivingEntity> list = this.getEntitiesOfClass(LivingEntity.class, axisalignedbb, (entityliving) -> {
|
||||
- return entityliving != null && entityliving.isAlive() && this.canSeeSky(entityliving.blockPosition());
|
||||
+ return entityliving != null && entityliving.isAlive() && this.canSeeSky(entityliving.blockPosition()) && !entityliving.isSpectator(); // Paper - Fix lightning being able to hit spectators (MC-262422)
|
||||
|
@ -422,49 +419,13 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
entity.level().gameEvent(entity, GameEvent.EQUIP, entity.position());
|
||||
stack.shrink(1);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
|
||||
@@ -0,0 +0,0 @@ public abstract class BaseSpawner {
|
||||
public int requiredPlayerRange = 16;
|
||||
public int spawnRange = 4;
|
||||
private int tickDelay = 0; // Paper
|
||||
+ // Paper start - ported from 1.20.3 Fix MC-259321
|
||||
+ static <B, T extends B> net.minecraft.world.level.entity.EntityTypeTest<B, T> forExactClass(Class<T> clazz) {
|
||||
+ return new net.minecraft.world.level.entity.EntityTypeTest<>() {
|
||||
+ @Nullable
|
||||
+ @Override
|
||||
+ public T tryCast(B entity) {
|
||||
+ return (T)(clazz.equals(entity.getClass()) ? entity : null);
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public Class<? extends B> getBaseClass() {
|
||||
+ return clazz;
|
||||
+ }
|
||||
+ };
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
||||
public BaseSpawner() {}
|
||||
|
||||
@@ -0,0 +0,0 @@ public abstract class BaseSpawner {
|
||||
return;
|
||||
}
|
||||
|
||||
- int k = world.getEntitiesOfClass(entity.getClass(), (new AABB((double) pos.getX(), (double) pos.getY(), (double) pos.getZ(), (double) (pos.getX() + 1), (double) (pos.getY() + 1), (double) (pos.getZ() + 1))).inflate((double) this.spawnRange)).size();
|
||||
+ int k = world.getEntities(forExactClass(entity.getClass()), (new AABB((double) pos.getX(), (double) pos.getY(), (double) pos.getZ(), (double) (pos.getX() + 1), (double) (pos.getY() + 1), (double) (pos.getZ() + 1))).inflate((double) this.spawnRange), net.minecraft.world.entity.EntitySelector.NO_SPECTATORS).size(); // Paper - Fix MC-259321 (only count exact entity types for nearby checks)
|
||||
|
||||
if (k >= this.maxNearbyEntities) {
|
||||
this.delay(world, pos);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java b/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/AzaleaBlock.java
|
||||
@@ -0,0 +0,0 @@ public class AzaleaBlock extends BushBlock implements BonemealableBlock {
|
||||
public void performBonemeal(ServerLevel world, RandomSource random, BlockPos pos, BlockState state) {
|
||||
TREE_GROWER.growTree(world, world.getChunkSource().getGenerator(), pos, state, random);
|
||||
TreeGrower.AZALEA.growTree(world, world.getChunkSource().getGenerator(), pos, state, random);
|
||||
}
|
||||
+
|
||||
+ // Paper start - Fix MC-224454
|
|
@ -35,8 +35,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
- record.setCount(1);
|
||||
- }
|
||||
-
|
||||
- tileentityjukebox.setFirstItem(record);
|
||||
+ tileentityjukebox.setFirstItem(this.copy()); // Paper - sync this with record item, jukebox has now an inventory
|
||||
- tileentityjukebox.setTheItem(record);
|
||||
+ tileentityjukebox.setTheItem(this.copy()); // Paper - sync this with record item, jukebox has now an inventory
|
||||
world.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, GameEvent.Context.of(entityhuman, world.getBlockState(blockposition)));
|
||||
}
|
||||
|
|
@ -76,7 +76,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem());
|
||||
@@ -0,0 +0,0 @@ public class BoatDispenseItemBehavior extends DefaultDispenseItemBehavior {
|
||||
|
||||
EntityType.createDefaultStackConfig(worldserver, stack, (Player) null).accept(object);
|
||||
((Boat) object).setVariant(this.type);
|
||||
((Boat) object).setYRot(enumdirection.toYRot());
|
||||
- if (!worldserver.addFreshEntity((Entity) object)) stack.grow(1); // CraftBukkit
|
||||
|
@ -334,6 +334,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(x, y, z));
|
||||
if (!DispenserBlock.eventFired) {
|
||||
@@ -0,0 +0,0 @@ public interface DispenseItemBehavior {
|
||||
return stack;
|
||||
}
|
||||
|
||||
+ boolean shrink = true; // Paper
|
||||
if (!event.getItem().equals(craftItem)) {
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
@@ -0,0 +0,0 @@ public interface DispenseItemBehavior {
|
||||
|
||||
// CraftBukkit start
|
||||
org.bukkit.block.Block bukkitBlock = CraftBlock.at(worldserver, pointer.pos());
|
||||
|
@ -342,6 +350,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
||||
if (!DispenserBlock.eventFired) {
|
||||
@@ -0,0 +0,0 @@ public interface DispenseItemBehavior {
|
||||
return stack;
|
||||
}
|
||||
|
||||
+ boolean shrink = true; // Paper
|
||||
if (!event.getItem().equals(craftItem)) {
|
||||
+ shrink = false; // Paper - shrink below (this was actually missing and should be here, added it commented out just for less confusion)
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem());
|
||||
@@ -0,0 +0,0 @@ public interface DispenseItemBehavior {
|
||||
BlockPos blockposition = pointer.pos().relative((Direction) pointer.state().getValue(DispenserBlock.FACING));
|
||||
// CraftBukkit start
|
||||
|
@ -351,6 +369,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(0, 0, 0));
|
||||
if (!DispenserBlock.eventFired) {
|
||||
@@ -0,0 +0,0 @@ public interface DispenseItemBehavior {
|
||||
return stack;
|
||||
}
|
||||
|
||||
+ boolean shrink = true; // Paper
|
||||
if (!event.getItem().equals(craftItem)) {
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
@@ -0,0 +0,0 @@ public interface DispenseItemBehavior {
|
||||
// CraftBukkit start
|
||||
// EntityTNTPrimed entitytntprimed = new EntityTNTPrimed(worldserver, (double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, (EntityLiving) null);
|
||||
|
@ -395,6 +421,18 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
||||
if (!DispenserBlock.eventFired) {
|
||||
@@ -0,0 +0,0 @@ public interface DispenseItemBehavior {
|
||||
}
|
||||
|
||||
if (event.isCancelled()) {
|
||||
+ // stack.grow(1); // Paper - shrink below (this was actually missing and should be here, added it commented out just for less confusion)
|
||||
return stack;
|
||||
}
|
||||
|
||||
+ boolean shrink = true; // Paper
|
||||
if (!event.getItem().equals(craftItem)) {
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
@@ -0,0 +0,0 @@ public interface DispenseItemBehavior {
|
||||
|
||||
// CraftBukkit start
|
||||
org.bukkit.block.Block bukkitBlock = CraftBlock.at(worldserver, pointer.pos());
|
||||
|
@ -404,6 +442,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
||||
if (!DispenserBlock.eventFired) {
|
||||
@@ -0,0 +0,0 @@ public interface DispenseItemBehavior {
|
||||
return stack;
|
||||
}
|
||||
|
||||
+ boolean shrink = true; // Paper
|
||||
if (!event.getItem().equals(craftItem)) {
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
@@ -0,0 +0,0 @@ public interface DispenseItemBehavior {
|
||||
|
||||
// CraftBukkit start
|
||||
org.bukkit.block.Block bukkitBlock = CraftBlock.at(worldserver, pointer.pos());
|
||||
|
@ -412,6 +458,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
||||
if (!DispenserBlock.eventFired) {
|
||||
@@ -0,0 +0,0 @@ public interface DispenseItemBehavior {
|
||||
return stack;
|
||||
}
|
||||
|
||||
+ boolean shrink = true; // Paper
|
||||
if (!event.getItem().equals(craftItem)) {
|
||||
// Chain to handler for new item
|
||||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
diff --git a/src/main/java/net/minecraft/core/dispenser/ShulkerBoxDispenseBehavior.java b/src/main/java/net/minecraft/core/dispenser/ShulkerBoxDispenseBehavior.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/core/dispenser/ShulkerBoxDispenseBehavior.java
|
||||
|
@ -492,8 +546,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
ItemStack eventStack = CraftItemStack.asNMSCopy(event.getItem());
|
||||
DispenseItemBehavior idispensebehavior = (DispenseItemBehavior) DispenserBlock.DISPENSER_REGISTRY.get(eventStack.getItem());
|
||||
@@ -0,0 +0,0 @@ public class MinecartItem extends Item {
|
||||
entityminecartabstract.setCustomName(stack.getHoverName());
|
||||
}
|
||||
itemstack1 = CraftItemStack.asNMSCopy(event.getItem());
|
||||
AbstractMinecart entityminecartabstract = AbstractMinecart.createMinecart(worldserver, event.getVelocity().getX(), event.getVelocity().getY(), event.getVelocity().getZ(), ((MinecartItem) itemstack1.getItem()).type, itemstack1, (Player) null);
|
||||
|
||||
- if (!worldserver.addFreshEntity(entityminecartabstract)) stack.grow(1);
|
||||
- // itemstack.shrink(1); // CraftBukkit - handled during event processing
|
|
@ -0,0 +1,20 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: chickeneer <emcchickeneer@gmail.com>
|
||||
Date: Mon, 1 Aug 2022 20:13:02 -0500
|
||||
Subject: [PATCH] Fix suggest command message for brigadier syntax exceptions
|
||||
|
||||
This is a bug accidentally introduced in upstream CB
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/commands/Commands.java b/src/main/java/net/minecraft/commands/Commands.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/commands/Commands.java
|
||||
+++ b/src/main/java/net/minecraft/commands/Commands.java
|
||||
@@ -0,0 +0,0 @@ public class Commands {
|
||||
if (commandsyntaxexception.getInput() != null && commandsyntaxexception.getCursor() >= 0) {
|
||||
int i = Math.min(commandsyntaxexception.getInput().length(), commandsyntaxexception.getCursor());
|
||||
MutableComponent ichatmutablecomponent = Component.empty().withStyle(ChatFormatting.GRAY).withStyle((chatmodifier) -> {
|
||||
- return chatmodifier.withClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, label)); // CraftBukkit
|
||||
+ return chatmodifier.withClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, "/" + label)); // CraftBukkit // Paper
|
||||
});
|
||||
|
||||
if (i > 10) {
|
|
@ -91,7 +91,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
nbt.putShort("Age", (short) this.age);
|
||||
nbt.putShort("PickupDelay", (short) this.pickupDelay);
|
||||
@@ -0,0 +0,0 @@ public class ItemEntity extends Entity implements TraceableEntity {
|
||||
this.thrower = nbt.getUUID("Thrower");
|
||||
this.cachedThrower = null;
|
||||
}
|
||||
|
||||
+ // Paper start
|
|
@ -8,7 +8,7 @@ diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/jav
|
|||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
|
||||
@@ -0,0 +0,0 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
Location enter = bukkitEntity.getLocation();
|
||||
Location exit = CraftLocation.toBukkit(exitPosition, exitWorldServer.getWorld());
|
||||
|
|
@ -38,7 +38,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
}
|
||||
|
||||
@@ -0,0 +0,0 @@ public abstract class BlockBehaviour implements FeatureElement {
|
||||
return this.getBlock() == block;
|
||||
return this.getBlock().builtInRegistryHolder().is(key);
|
||||
}
|
||||
|
||||
- public FluidState getFluidState() {
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue