@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/AbstractCandleBlock.java
|
||||
+++ b/net/minecraft/world/level/block/AbstractCandleBlock.java
|
||||
@@ -37,6 +37,11 @@
|
||||
@@ -38,6 +38,11 @@
|
||||
@Override
|
||||
public void onProjectileHit(World world, IBlockData iblockdata, MovingObjectPositionBlock movingobjectpositionblock, IProjectile iprojectile) {
|
||||
if (!world.isClientSide && iprojectile.isOnFire() && this.canBeLit(iblockdata)) {
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
if (soundeffect != null) {
|
||||
playTiltSound(world, blockposition, soundeffect);
|
||||
}
|
||||
@@ -225,19 +245,27 @@
|
||||
@@ -225,14 +245,21 @@
|
||||
}
|
||||
|
||||
private static void resetTilt(IBlockData iblockdata, World world, BlockPosition blockposition) {
|
||||
@@ -89,9 +89,11 @@
|
||||
+ }
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
Tilt tilt1 = (Tilt) iblockdata.getValue(BigDripleafBlock.TILT);
|
||||
|
||||
world.setBlock(blockposition, (IBlockData) iblockdata.setValue(BigDripleafBlock.TILT, tilt), 2);
|
||||
if (tilt.causesVibration()) {
|
||||
world.gameEvent(GameEvent.BLOCK_CHANGE, blockposition);
|
||||
@@ -240,6 +267,7 @@
|
||||
world.gameEvent((Entity) null, GameEvent.BLOCK_CHANGE, blockposition);
|
||||
}
|
||||
|
||||
+ return true; // CraftBukkit
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/Block.java
|
||||
+++ b/net/minecraft/world/level/block/Block.java
|
||||
@@ -354,7 +354,13 @@
|
||||
@@ -356,7 +356,13 @@
|
||||
EntityItem entityitem = (EntityItem) supplier.get();
|
||||
|
||||
entityitem.setDefaultPickUpDelay();
|
||||
@@ -15,7 +15,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -380,7 +386,7 @@
|
||||
@@ -382,7 +388,7 @@
|
||||
|
||||
public void playerDestroy(World world, EntityHuman entityhuman, BlockPosition blockposition, IBlockData iblockdata, @Nullable TileEntity tileentity, ItemStack itemstack) {
|
||||
entityhuman.awardStat(StatisticList.BLOCK_MINED.get(this));
|
||||
@@ -24,16 +24,30 @@
|
||||
dropResources(iblockdata, world, blockposition, tileentity, entityhuman, itemstack);
|
||||
}
|
||||
|
||||
@@ -520,6 +526,12 @@
|
||||
@@ -522,16 +528,24 @@
|
||||
return this.builtInRegistryHolder;
|
||||
}
|
||||
|
||||
- protected void tryDropExperience(WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack, IntProvider intprovider) {
|
||||
+ // CraftBukkit start
|
||||
+ public int getExpDrop(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack) {
|
||||
+ protected int tryDropExperience(WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack, IntProvider intprovider) {
|
||||
if (EnchantmentManager.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) == 0) {
|
||||
int i = intprovider.sample(worldserver.random);
|
||||
|
||||
if (i > 0) {
|
||||
- this.popExperience(worldserver, blockposition, i);
|
||||
+ // this.popExperience(worldserver, blockposition, i);
|
||||
+ return i;
|
||||
}
|
||||
}
|
||||
|
||||
+ return 0;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
+ public int getExpDrop(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack, boolean flag) {
|
||||
+ return 0;
|
||||
}
|
||||
+ // CraftBukkit end
|
||||
|
||||
public static final class a {
|
||||
|
||||
private final IBlockData first;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockBamboo.java
|
||||
+++ b/net/minecraft/world/level/block/BlockBamboo.java
|
||||
@@ -185,7 +185,7 @@
|
||||
@@ -180,7 +180,7 @@
|
||||
BlockPosition blockposition1 = blockposition.above(i);
|
||||
IBlockData iblockdata1 = worldserver.getBlockState(blockposition1);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -206,14 +206,18 @@
|
||||
@@ -201,14 +201,18 @@
|
||||
BlockPosition blockposition1 = blockposition.below(2);
|
||||
IBlockData iblockdata2 = world.getBlockState(blockposition1);
|
||||
BlockPropertyBambooSize blockpropertybamboosize = BlockPropertyBambooSize.NONE;
|
||||
@@ -30,9 +30,9 @@
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -224,7 +228,14 @@
|
||||
@@ -219,7 +223,14 @@
|
||||
int j = (Integer) iblockdata.getValue(BlockBamboo.AGE) != 1 && !iblockdata2.is(Blocks.BAMBOO) ? 0 : 1;
|
||||
int k = (i < 11 || random.nextFloat() >= 0.25F) && i != 15 ? 0 : 1;
|
||||
int k = (i < 11 || randomsource.nextFloat() >= 0.25F) && i != 15 ? 0 : 1;
|
||||
|
||||
- world.setBlock(blockposition.above(), (IBlockData) ((IBlockData) ((IBlockData) this.defaultBlockState().setValue(BlockBamboo.AGE, j)).setValue(BlockBamboo.LEAVES, blockpropertybamboosize)).setValue(BlockBamboo.STAGE, k), 3);
|
||||
+ // CraftBukkit start
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockBambooSapling.java
|
||||
+++ b/net/minecraft/world/level/block/BlockBambooSapling.java
|
||||
@@ -93,6 +93,6 @@
|
||||
@@ -88,6 +88,6 @@
|
||||
}
|
||||
|
||||
protected void growBamboo(World world, BlockPosition blockposition) {
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
+ this.explodeBed(finaliblockdata, world, finalblockposition);
|
||||
+ } else
|
||||
+ // CraftBukkit end
|
||||
if (entityhuman_enumbedresult != null) {
|
||||
if (entityhuman_enumbedresult.getMessage() != null) {
|
||||
entityhuman.displayClientMessage(entityhuman_enumbedresult.getMessage(), true);
|
||||
}
|
||||
@@ -115,8 +125,27 @@
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
+ // CraftBukkit end
|
||||
this.press(iblockdata, world, blockposition);
|
||||
this.playSound(entityhuman, world, blockposition, true);
|
||||
world.gameEvent(entityhuman, GameEvent.BLOCK_PRESS, blockposition);
|
||||
world.gameEvent((Entity) entityhuman, GameEvent.BLOCK_ACTIVATE, blockposition);
|
||||
@@ -148,6 +166,16 @@
|
||||
if (this.sensitive) {
|
||||
this.checkPressed(iblockdata, worldserver, blockposition);
|
||||
@@ -94,8 +94,8 @@
|
||||
world.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockButtonAbstract.POWERED, flag), 3);
|
||||
this.updateNeighbours(iblockdata, world, blockposition);
|
||||
this.playSound((EntityHuman) null, world, blockposition, flag);
|
||||
- world.gameEvent((Entity) list.stream().findFirst().orElse((Object) null), flag ? GameEvent.BLOCK_PRESS : GameEvent.BLOCK_UNPRESS, blockposition);
|
||||
+ world.gameEvent((Entity) list.stream().findFirst().orElse(null), flag ? GameEvent.BLOCK_PRESS : GameEvent.BLOCK_UNPRESS, blockposition); // CraftBukkit - decompile error
|
||||
- world.gameEvent((Entity) list.stream().findFirst().orElse((Object) null), flag ? GameEvent.BLOCK_ACTIVATE : GameEvent.BLOCK_DEACTIVATE, blockposition);
|
||||
+ world.gameEvent((Entity) list.stream().findFirst().orElse(null), flag ? GameEvent.BLOCK_ACTIVATE : GameEvent.BLOCK_DEACTIVATE, blockposition); // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
if (flag) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockCake.java
|
||||
+++ b/net/minecraft/world/level/block/BlockCake.java
|
||||
@@ -84,7 +84,18 @@
|
||||
@@ -85,7 +85,18 @@
|
||||
return EnumInteractionResult.PASS;
|
||||
} else {
|
||||
entityhuman.awardStat(StatisticList.EAT_CAKE_SLICE);
|
||||
@@ -19,4 +19,4 @@
|
||||
+ // CraftBukkit end
|
||||
int i = (Integer) iblockdata.getValue(BlockCake.BITES);
|
||||
|
||||
generatoraccess.gameEvent(entityhuman, GameEvent.EAT, blockposition);
|
||||
generatoraccess.gameEvent((Entity) entityhuman, GameEvent.EAT, blockposition);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
@@ -91,7 +95,9 @@
|
||||
@Override
|
||||
public void entityInside(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
||||
if (!entity.fireImmune() && (Boolean) iblockdata.getValue(BlockCampfire.LIT) && entity instanceof EntityLiving && !EnchantmentManager.hasFrostWalker((EntityLiving) entity)) {
|
||||
if ((Boolean) iblockdata.getValue(BlockCampfire.LIT) && entity instanceof EntityLiving && !EnchantmentManager.hasFrostWalker((EntityLiving) entity)) {
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = CraftBlock.at(world, blockposition); // CraftBukkit
|
||||
entity.hurt(DamageSource.IN_FIRE, (float) this.fireDamage);
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = null; // CraftBukkit
|
||||
|
||||
@@ -11,17 +11,19 @@
|
||||
public class BlockCauldron extends AbstractCauldronBlock {
|
||||
|
||||
private static final float RAIN_FILL_CHANCE = 0.05F;
|
||||
@@ -51,11 +55,11 @@
|
||||
@Override
|
||||
protected void receiveStalactiteDrip(IBlockData iblockdata, World world, BlockPosition blockposition, FluidType fluidtype) {
|
||||
@@ -54,13 +58,11 @@
|
||||
|
||||
if (fluidtype == FluidTypes.WATER) {
|
||||
- world.setBlockAndUpdate(blockposition, Blocks.WATER_CAULDRON.defaultBlockState());
|
||||
+ LayeredCauldronBlock.changeLevel(iblockdata, world, blockposition, Blocks.WATER_CAULDRON.defaultBlockState(), null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL); // CraftBukkit
|
||||
iblockdata1 = Blocks.WATER_CAULDRON.defaultBlockState();
|
||||
- world.setBlockAndUpdate(blockposition, iblockdata1);
|
||||
- world.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, GameEvent.a.of(iblockdata1));
|
||||
+ LayeredCauldronBlock.changeLevel(iblockdata, world, blockposition, iblockdata1, null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL); // CraftBukkit
|
||||
world.levelEvent(1047, blockposition, 0);
|
||||
world.gameEvent((Entity) null, GameEvent.FLUID_PLACE, blockposition);
|
||||
} else if (fluidtype == FluidTypes.LAVA) {
|
||||
- world.setBlockAndUpdate(blockposition, Blocks.LAVA_CAULDRON.defaultBlockState());
|
||||
+ LayeredCauldronBlock.changeLevel(iblockdata, world, blockposition, Blocks.LAVA_CAULDRON.defaultBlockState(), null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL); // CraftBukkit
|
||||
iblockdata1 = Blocks.LAVA_CAULDRON.defaultBlockState();
|
||||
- world.setBlockAndUpdate(blockposition, iblockdata1);
|
||||
- world.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, GameEvent.a.of(iblockdata1));
|
||||
+ LayeredCauldronBlock.changeLevel(iblockdata, world, blockposition, iblockdata1, null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL); // CraftBukkit
|
||||
world.levelEvent(1046, blockposition, 0);
|
||||
world.gameEvent((Entity) null, GameEvent.FLUID_PLACE, blockposition);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockChest.java
|
||||
+++ b/net/minecraft/world/level/block/BlockChest.java
|
||||
@@ -88,24 +88,7 @@
|
||||
@@ -87,24 +87,7 @@
|
||||
public Optional<ITileInventory> acceptDouble(final TileEntityChest tileentitychest, final TileEntityChest tileentitychest1) {
|
||||
final InventoryLargeChest inventorylargechest = new InventoryLargeChest(tileentitychest, tileentitychest1);
|
||||
|
||||
@@ -19,14 +19,14 @@
|
||||
-
|
||||
- @Override
|
||||
- public IChatBaseComponent getDisplayName() {
|
||||
- return (IChatBaseComponent) (tileentitychest.hasCustomName() ? tileentitychest.getDisplayName() : (tileentitychest1.hasCustomName() ? tileentitychest1.getDisplayName() : new ChatMessage("container.chestDouble")));
|
||||
- return (IChatBaseComponent) (tileentitychest.hasCustomName() ? tileentitychest.getDisplayName() : (tileentitychest1.hasCustomName() ? tileentitychest1.getDisplayName() : IChatBaseComponent.translatable("container.chestDouble")));
|
||||
- }
|
||||
- });
|
||||
+ return Optional.of(new DoubleInventory(tileentitychest, tileentitychest1, inventorylargechest)); // CraftBukkit
|
||||
}
|
||||
|
||||
public Optional<ITileInventory> acceptSingle(TileEntityChest tileentitychest) {
|
||||
@@ -118,6 +101,38 @@
|
||||
@@ -117,6 +100,38 @@
|
||||
}
|
||||
};
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
+
|
||||
+ @Override
|
||||
+ public IChatBaseComponent getDisplayName() {
|
||||
+ return (IChatBaseComponent) (tileentitychest.hasCustomName() ? tileentitychest.getDisplayName() : (tileentitychest1.hasCustomName() ? tileentitychest1.getDisplayName() : new ChatMessage("container.chestDouble")));
|
||||
+ return (IChatBaseComponent) (tileentitychest.hasCustomName() ? tileentitychest.getDisplayName() : (tileentitychest1.hasCustomName() ? tileentitychest1.getDisplayName() : IChatBaseComponent.translatable("container.chestDouble")));
|
||||
+ }
|
||||
+ };
|
||||
+ // CraftBukkit end
|
||||
@@ -65,7 +65,7 @@
|
||||
protected BlockChest(BlockBase.Info blockbase_info, Supplier<TileEntityTypes<? extends TileEntityChest>> supplier) {
|
||||
super(blockbase_info, supplier);
|
||||
this.registerDefaultState((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.stateDefinition.any()).setValue(BlockChest.FACING, EnumDirection.NORTH)).setValue(BlockChest.TYPE, BlockPropertyChestType.SINGLE)).setValue(BlockChest.WATERLOGGED, false));
|
||||
@@ -276,7 +291,7 @@
|
||||
@@ -275,7 +290,7 @@
|
||||
|
||||
@Override
|
||||
public DoubleBlockFinder.Result<? extends TileEntityChest> combine(IBlockData iblockdata, World world, BlockPosition blockposition, boolean flag) {
|
||||
@@ -74,7 +74,7 @@
|
||||
|
||||
if (flag) {
|
||||
bipredicate = (generatoraccess, blockposition1) -> {
|
||||
@@ -292,7 +307,14 @@
|
||||
@@ -291,7 +306,14 @@
|
||||
@Nullable
|
||||
@Override
|
||||
public ITileInventory getMenuProvider(IBlockData iblockdata, World world, BlockPosition blockposition) {
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
} else if (i < 4) {
|
||||
j = random.nextInt(4);
|
||||
j = randomsource.nextInt(4);
|
||||
if (flag1) {
|
||||
@@ -97,18 +103,30 @@
|
||||
BlockPosition blockposition2 = blockposition.relative(enumdirection);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
@@ -124,7 +126,7 @@
|
||||
|
||||
@Override
|
||||
public void performBonemeal(WorldServer worldserver, Random random, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
public void performBonemeal(WorldServer worldserver, RandomSource randomsource, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
- worldserver.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockCocoa.AGE, (Integer) iblockdata.getValue(BlockCocoa.AGE) + 1), 2);
|
||||
+ CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, (IBlockData) iblockdata.setValue(BlockCocoa.AGE, (Integer) iblockdata.getValue(BlockCocoa.AGE) + 1), 2); // CraftBukkit
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
public class BlockComposter extends Block implements IInventoryHolder {
|
||||
|
||||
public static final int READY = 8;
|
||||
@@ -224,18 +230,25 @@
|
||||
@@ -227,18 +233,25 @@
|
||||
|
||||
return EnumInteractionResult.sidedSuccess(world.isClientSide);
|
||||
} else if (i == 8) {
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
itemstack.shrink(1);
|
||||
return iblockdata1;
|
||||
@@ -244,7 +257,15 @@
|
||||
@@ -247,7 +260,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
if (!world.isClientSide) {
|
||||
float f = 0.7F;
|
||||
double d0 = (double) (world.random.nextFloat() * 0.7F) + 0.15000000596046448D;
|
||||
@@ -270,10 +291,16 @@
|
||||
@@ -273,10 +294,16 @@
|
||||
}
|
||||
|
||||
static IBlockData addItem(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition, ItemStack itemstack) {
|
||||
@@ -77,7 +77,7 @@
|
||||
return iblockdata;
|
||||
} else {
|
||||
int j = i + 1;
|
||||
@@ -321,7 +348,8 @@
|
||||
@@ -324,7 +351,8 @@
|
||||
public IWorldInventory getContainer(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
|
||||
int i = (Integer) iblockdata.getValue(BlockComposter.LEVEL);
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
}
|
||||
|
||||
public static class ContainerOutput extends InventorySubcontainer implements IWorldInventory {
|
||||
@@ -336,6 +364,7 @@
|
||||
@@ -339,6 +367,7 @@
|
||||
this.state = iblockdata;
|
||||
this.level = generatoraccess;
|
||||
this.pos = blockposition;
|
||||
@@ -95,7 +95,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -360,8 +389,15 @@
|
||||
@@ -363,8 +392,15 @@
|
||||
|
||||
@Override
|
||||
public void setChanged() {
|
||||
@@ -113,7 +113,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -374,6 +410,7 @@
|
||||
@@ -377,6 +413,7 @@
|
||||
|
||||
public ContainerInput(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
|
||||
super(1);
|
||||
@@ -121,7 +121,7 @@
|
||||
this.state = iblockdata;
|
||||
this.level = generatoraccess;
|
||||
this.pos = blockposition;
|
||||
@@ -416,8 +453,9 @@
|
||||
@@ -419,8 +456,9 @@
|
||||
|
||||
public static class ContainerEmpty extends InventorySubcontainer implements IWorldInventory {
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+++ b/net/minecraft/world/level/block/BlockCoral.java
|
||||
@@ -25,6 +25,11 @@
|
||||
@Override
|
||||
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
|
||||
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, RandomSource randomsource) {
|
||||
if (!this.scanForWater(worldserver, blockposition)) {
|
||||
+ // CraftBukkit start
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, this.deadBlock.defaultBlockState()).isCancelled()) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+++ b/net/minecraft/world/level/block/BlockCoralFan.java
|
||||
@@ -28,6 +28,11 @@
|
||||
@Override
|
||||
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
|
||||
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, RandomSource randomsource) {
|
||||
if (!scanForWater(iblockdata, worldserver, blockposition)) {
|
||||
+ // CraftBukkit start
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, this.deadBlock.defaultBlockState().setValue(BlockCoralFan.WATERLOGGED, false)).isCancelled()) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+++ b/net/minecraft/world/level/block/BlockCoralFanWall.java
|
||||
@@ -28,6 +28,11 @@
|
||||
@Override
|
||||
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
|
||||
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, RandomSource randomsource) {
|
||||
if (!scanForWater(iblockdata, worldserver, blockposition)) {
|
||||
+ // CraftBukkit start
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, this.deadBlock.defaultBlockState().setValue(BlockCoralFanWall.WATERLOGGED, false).setValue(BlockCoralFanWall.FACING, iblockdata.getValue(BlockCoralFanWall.FACING))).isCancelled()) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+++ b/net/minecraft/world/level/block/BlockCoralPlant.java
|
||||
@@ -33,6 +33,11 @@
|
||||
@Override
|
||||
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
|
||||
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, RandomSource randomsource) {
|
||||
if (!scanForWater(iblockdata, worldserver, blockposition)) {
|
||||
+ // CraftBukkit start
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, this.deadBlock.defaultBlockState().setValue(BlockCoralPlant.WATERLOGGED, false)).isCancelled()) {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
@@ -76,7 +78,7 @@
|
||||
float f = getGrowthSpeed(this, worldserver, blockposition);
|
||||
|
||||
if (random.nextInt((int) (25.0F / f) + 1) == 0) {
|
||||
if (randomsource.nextInt((int) (25.0F / f) + 1) == 0) {
|
||||
- worldserver.setBlock(blockposition, this.getStateForAge(i + 1), 2);
|
||||
+ CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, this.getStateForAge(i + 1), 2); // CraftBukkit
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockDaylightDetector.java
|
||||
+++ b/net/minecraft/world/level/block/BlockDaylightDetector.java
|
||||
@@ -66,6 +66,7 @@
|
||||
@@ -67,6 +67,7 @@
|
||||
|
||||
i = MathHelper.clamp(i, (int) 0, (int) 15);
|
||||
if ((Integer) iblockdata.getValue(BlockDaylightDetector.POWER) != i) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+++ b/net/minecraft/world/level/block/BlockDirtSnowSpreadable.java
|
||||
@@ -40,6 +40,11 @@
|
||||
@Override
|
||||
public void randomTick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
|
||||
public void randomTick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, RandomSource randomsource) {
|
||||
if (!canBeGrass(iblockdata, worldserver, blockposition)) {
|
||||
+ // CraftBukkit start
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, Blocks.DIRT.defaultBlockState()).isCancelled()) {
|
||||
@@ -13,7 +13,7 @@
|
||||
} else {
|
||||
if (worldserver.getMaxLocalRawBrightness(blockposition.above()) >= 9) {
|
||||
@@ -49,7 +54,7 @@
|
||||
BlockPosition blockposition1 = blockposition.offset(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1);
|
||||
BlockPosition blockposition1 = blockposition.offset(randomsource.nextInt(3) - 1, randomsource.nextInt(5) - 3, randomsource.nextInt(3) - 1);
|
||||
|
||||
if (worldserver.getBlockState(blockposition1).is(Blocks.DIRT) && canPropagate(iblockdata1, worldserver, blockposition1)) {
|
||||
- worldserver.setBlockAndUpdate(blockposition1, (IBlockData) iblockdata1.setValue(BlockDirtSnowSpreadable.SNOWY, worldserver.getBlockState(blockposition1.above()).is(Blocks.SNOW)));
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockDispenser.java
|
||||
+++ b/net/minecraft/world/level/block/BlockDispenser.java
|
||||
@@ -46,6 +46,7 @@
|
||||
@@ -47,6 +47,7 @@
|
||||
object2objectopenhashmap.defaultReturnValue(new DispenseBehaviorItem());
|
||||
});
|
||||
private static final int TRIGGER_DURATION = 4;
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
public static void registerBehavior(IMaterial imaterial, IDispenseBehavior idispensebehavior) {
|
||||
BlockDispenser.DISPENSER_REGISTRY.put(imaterial.asItem(), idispensebehavior);
|
||||
@@ -89,6 +90,7 @@
|
||||
@@ -90,6 +91,7 @@
|
||||
IDispenseBehavior idispensebehavior = this.getDispenseMethod(itemstack);
|
||||
|
||||
if (idispensebehavior != IDispenseBehavior.NOOP) {
|
||||
|
||||
@@ -35,4 +35,4 @@
|
||||
+ // CraftBukkit end
|
||||
if (flag1 != (Boolean) iblockdata.getValue(BlockDoor.OPEN)) {
|
||||
this.playSound(world, blockposition, flag1);
|
||||
world.gameEvent(flag1 ? GameEvent.BLOCK_OPEN : GameEvent.BLOCK_CLOSE, blockposition);
|
||||
world.gameEvent((Entity) null, flag1 ? GameEvent.BLOCK_OPEN : GameEvent.BLOCK_CLOSE, blockposition);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockFenceGate.java
|
||||
+++ b/net/minecraft/world/level/block/BlockFenceGate.java
|
||||
@@ -128,6 +128,17 @@
|
||||
@@ -129,6 +129,17 @@
|
||||
public void neighborChanged(IBlockData iblockdata, World world, BlockPosition blockposition, Block block, BlockPosition blockposition1, boolean flag) {
|
||||
if (!world.isClientSide) {
|
||||
boolean flag1 = world.hasNeighborSignal(blockposition);
|
||||
|
||||
@@ -53,11 +53,11 @@
|
||||
@@ -149,7 +174,7 @@
|
||||
int i = (Integer) iblockdata.getValue(BlockFire.AGE);
|
||||
|
||||
if (!flag && worldserver.isRaining() && this.isNearRain(worldserver, blockposition) && random.nextFloat() < 0.2F + (float) i * 0.03F) {
|
||||
if (!flag && worldserver.isRaining() && this.isNearRain(worldserver, blockposition) && randomsource.nextFloat() < 0.2F + (float) i * 0.03F) {
|
||||
- worldserver.removeBlock(blockposition, false);
|
||||
+ fireExtinguished(worldserver, blockposition); // CraftBukkit - extinguished by rain
|
||||
} else {
|
||||
int j = Math.min(15, i + random.nextInt(3) / 2);
|
||||
int j = Math.min(15, i + randomsource.nextInt(3) / 2);
|
||||
|
||||
@@ -163,14 +188,14 @@
|
||||
BlockPosition blockposition1 = blockposition.below();
|
||||
@@ -70,7 +70,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (i == 15 && random.nextInt(4) == 0 && !this.canBurn(worldserver.getBlockState(blockposition.below()))) {
|
||||
if (i == 15 && randomsource.nextInt(4) == 0 && !this.canBurn(worldserver.getBlockState(blockposition.below()))) {
|
||||
- worldserver.removeBlock(blockposition, false);
|
||||
+ fireExtinguished(worldserver, blockposition); // CraftBukkit
|
||||
return;
|
||||
@@ -80,26 +80,26 @@
|
||||
boolean flag1 = worldserver.isHumidAt(blockposition);
|
||||
int k = flag1 ? -50 : 0;
|
||||
|
||||
- this.checkBurnOut(worldserver, blockposition.east(), 300 + k, random, i);
|
||||
- this.checkBurnOut(worldserver, blockposition.west(), 300 + k, random, i);
|
||||
- this.checkBurnOut(worldserver, blockposition.below(), 250 + k, random, i);
|
||||
- this.checkBurnOut(worldserver, blockposition.above(), 250 + k, random, i);
|
||||
- this.checkBurnOut(worldserver, blockposition.north(), 300 + k, random, i);
|
||||
- this.checkBurnOut(worldserver, blockposition.south(), 300 + k, random, i);
|
||||
- this.checkBurnOut(worldserver, blockposition.east(), 300 + k, randomsource, i);
|
||||
- this.checkBurnOut(worldserver, blockposition.west(), 300 + k, randomsource, i);
|
||||
- this.checkBurnOut(worldserver, blockposition.below(), 250 + k, randomsource, i);
|
||||
- this.checkBurnOut(worldserver, blockposition.above(), 250 + k, randomsource, i);
|
||||
- this.checkBurnOut(worldserver, blockposition.north(), 300 + k, randomsource, i);
|
||||
- this.checkBurnOut(worldserver, blockposition.south(), 300 + k, randomsource, i);
|
||||
+ // CraftBukkit start - add source blockposition to burn calls
|
||||
+ this.trySpread(worldserver, blockposition.east(), 300 + k, random, i, blockposition);
|
||||
+ this.trySpread(worldserver, blockposition.west(), 300 + k, random, i, blockposition);
|
||||
+ this.trySpread(worldserver, blockposition.below(), 250 + k, random, i, blockposition);
|
||||
+ this.trySpread(worldserver, blockposition.above(), 250 + k, random, i, blockposition);
|
||||
+ this.trySpread(worldserver, blockposition.north(), 300 + k, random, i, blockposition);
|
||||
+ this.trySpread(worldserver, blockposition.south(), 300 + k, random, i, blockposition);
|
||||
+ this.trySpread(worldserver, blockposition.east(), 300 + k, randomsource, i, blockposition);
|
||||
+ this.trySpread(worldserver, blockposition.west(), 300 + k, randomsource, i, blockposition);
|
||||
+ this.trySpread(worldserver, blockposition.below(), 250 + k, randomsource, i, blockposition);
|
||||
+ this.trySpread(worldserver, blockposition.above(), 250 + k, randomsource, i, blockposition);
|
||||
+ this.trySpread(worldserver, blockposition.north(), 300 + k, randomsource, i, blockposition);
|
||||
+ this.trySpread(worldserver, blockposition.south(), 300 + k, randomsource, i, blockposition);
|
||||
+ // CraftBukkit end
|
||||
BlockPosition.MutableBlockPosition blockposition_mutableblockposition = new BlockPosition.MutableBlockPosition();
|
||||
|
||||
for (int l = -1; l <= 1; ++l) {
|
||||
@@ -209,7 +236,15 @@
|
||||
if (i2 > 0 && random.nextInt(k1) <= i2 && (!worldserver.isRaining() || !this.isNearRain(worldserver, blockposition_mutableblockposition))) {
|
||||
int j2 = Math.min(15, i + random.nextInt(5) / 4);
|
||||
if (i2 > 0 && randomsource.nextInt(k1) <= i2 && (!worldserver.isRaining() || !this.isNearRain(worldserver, blockposition_mutableblockposition))) {
|
||||
int j2 = Math.min(15, i + randomsource.nextInt(5) / 4);
|
||||
|
||||
- worldserver.setBlock(blockposition_mutableblockposition, this.getStateWithAge(worldserver, blockposition_mutableblockposition, j2), 3);
|
||||
+ // CraftBukkit start - Call to stop spread of fire
|
||||
@@ -115,14 +115,14 @@
|
||||
}
|
||||
}
|
||||
@@ -233,12 +268,24 @@
|
||||
return iblockdata.hasProperty(BlockProperties.WATERLOGGED) && (Boolean) iblockdata.getValue(BlockProperties.WATERLOGGED) ? 0 : this.flameOdds.getInt(iblockdata.getBlock());
|
||||
return iblockdata.hasProperty(BlockProperties.WATERLOGGED) && (Boolean) iblockdata.getValue(BlockProperties.WATERLOGGED) ? 0 : this.igniteOdds.getInt(iblockdata.getBlock());
|
||||
}
|
||||
|
||||
- private void checkBurnOut(World world, BlockPosition blockposition, int i, Random random, int j) {
|
||||
+ private void trySpread(World world, BlockPosition blockposition, int i, Random random, int j, BlockPosition sourceposition) { // CraftBukkit add sourceposition
|
||||
int k = this.getBurnOdd(world.getBlockState(blockposition));
|
||||
- private void checkBurnOut(World world, BlockPosition blockposition, int i, RandomSource randomsource, int j) {
|
||||
+ private void trySpread(World world, BlockPosition blockposition, int i, RandomSource randomsource, int j, BlockPosition sourceposition) { // CraftBukkit add sourceposition
|
||||
int k = this.getBurnOdds(world.getBlockState(blockposition));
|
||||
|
||||
if (random.nextInt(i) < k) {
|
||||
if (randomsource.nextInt(i) < k) {
|
||||
IBlockData iblockdata = world.getBlockState(blockposition);
|
||||
|
||||
+ // CraftBukkit start
|
||||
@@ -137,6 +137,6 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
if (random.nextInt(j + 10) < 5 && !world.isRainingAt(blockposition)) {
|
||||
int l = Math.min(j + random.nextInt(5) / 4, 15);
|
||||
if (randomsource.nextInt(j + 10) < 5 && !world.isRainingAt(blockposition)) {
|
||||
int l = Math.min(j + randomsource.nextInt(5) / 4, 15);
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
}
|
||||
|
||||
entity.hurt(DamageSource.IN_FIRE, this.fireDamage);
|
||||
@@ -146,14 +153,14 @@
|
||||
@@ -145,14 +152,14 @@
|
||||
}
|
||||
|
||||
if (!iblockdata.canSurvive(world, blockposition)) {
|
||||
@@ -33,7 +33,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -201,4 +208,12 @@
|
||||
@@ -200,4 +207,12 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@@ -51,6 +51,13 @@
|
||||
|
||||
@Override
|
||||
public void performBonemeal(WorldServer worldserver, Random random, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
public void performBonemeal(WorldServer worldserver, RandomSource randomsource, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
+ // CraftBukkit start
|
||||
+ if (this == Blocks.WARPED_FUNGUS) {
|
||||
+ BlockSapling.treeType = org.bukkit.TreeType.WARPED_FUNGUS;
|
||||
@@ -11,6 +11,6 @@
|
||||
+ BlockSapling.treeType = org.bukkit.TreeType.CRIMSON_FUNGUS;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
((WorldGenFeatureConfigured) ((Holder) this.feature.get()).value()).place(worldserver, worldserver.getChunkSource().getGenerator(), random, blockposition);
|
||||
((WorldGenFeatureConfigured) ((Holder) this.feature.get()).value()).place(worldserver, worldserver.getChunkSource().getGenerator(), randomsource, blockposition);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@@ -43,6 +43,11 @@
|
||||
|
||||
@Override
|
||||
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
|
||||
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, RandomSource randomsource) {
|
||||
+ // CraftBukkit start - do not fade if the block is valid here
|
||||
+ if (iblockdata.canSurvive(worldserver, blockposition)) {
|
||||
+ return;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockJukeBox.java
|
||||
+++ b/net/minecraft/world/level/block/BlockJukeBox.java
|
||||
@@ -59,7 +59,13 @@
|
||||
@@ -62,7 +62,13 @@
|
||||
TileEntity tileentity = generatoraccess.getBlockEntity(blockposition);
|
||||
|
||||
if (tileentity instanceof TileEntityJukeBox) {
|
||||
@@ -13,5 +13,5 @@
|
||||
+ ((TileEntityJukeBox) tileentity).setRecord(itemstack);
|
||||
+ // CraftBukkit end
|
||||
generatoraccess.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockJukeBox.HAS_RECORD, true), 2);
|
||||
generatoraccess.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, GameEvent.a.of(entity, iblockdata));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
--- a/net/minecraft/world/level/block/BlockLeaves.java
|
||||
+++ b/net/minecraft/world/level/block/BlockLeaves.java
|
||||
@@ -19,6 +19,8 @@
|
||||
@@ -22,6 +22,8 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapes;
|
||||
|
||||
+import org.bukkit.event.block.LeavesDecayEvent; // CraftBukkit
|
||||
+
|
||||
public class BlockLeaves extends Block {
|
||||
public class BlockLeaves extends Block implements IBlockWaterlogged {
|
||||
|
||||
public static final int DECAY_DISTANCE = 7;
|
||||
@@ -44,6 +46,14 @@
|
||||
@@ -48,6 +50,14 @@
|
||||
@Override
|
||||
public void randomTick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
|
||||
if (!(Boolean) iblockdata.getValue(BlockLeaves.PERSISTENT) && (Integer) iblockdata.getValue(BlockLeaves.DISTANCE) == 7) {
|
||||
public void randomTick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, RandomSource randomsource) {
|
||||
if (this.decaying(iblockdata)) {
|
||||
+ // CraftBukkit start
|
||||
+ LeavesDecayEvent event = new LeavesDecayEvent(worldserver.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
||||
+ worldserver.getCraftServer().getPluginManager().callEvent(event);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockLectern.java
|
||||
+++ b/net/minecraft/world/level/block/BlockLectern.java
|
||||
@@ -197,12 +197,13 @@
|
||||
@@ -198,12 +198,13 @@
|
||||
}
|
||||
|
||||
private void popBook(IBlockData iblockdata, World world, BlockPosition blockposition) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockLever.java
|
||||
+++ b/net/minecraft/world/level/block/BlockLever.java
|
||||
@@ -23,6 +23,8 @@
|
||||
@@ -24,6 +24,8 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
public class BlockLever extends BlockAttachable {
|
||||
|
||||
public static final BlockStateBoolean POWERED = BlockProperties.POWERED;
|
||||
@@ -90,6 +92,20 @@
|
||||
@@ -91,6 +93,20 @@
|
||||
|
||||
return EnumInteractionResult.SUCCESS;
|
||||
} else {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@@ -29,7 +29,9 @@
|
||||
@Override
|
||||
public void stepOn(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) {
|
||||
if (!entity.fireImmune() && entity instanceof EntityLiving && !EnchantmentManager.hasFrostWalker((EntityLiving) entity)) {
|
||||
if (!entity.isSteppingCarefully() && entity instanceof EntityLiving && !EnchantmentManager.hasFrostWalker((EntityLiving) entity)) {
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()); // CraftBukkit
|
||||
entity.hurt(DamageSource.HOT_FLOOR, 1.0F);
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = null; // CraftBukkit
|
||||
|
||||
@@ -1,19 +1,23 @@
|
||||
--- a/net/minecraft/world/level/block/BlockMobSpawner.java
|
||||
+++ b/net/minecraft/world/level/block/BlockMobSpawner.java
|
||||
@@ -33,9 +33,16 @@
|
||||
@@ -33,12 +33,20 @@
|
||||
@Override
|
||||
public void spawnAfterBreak(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack) {
|
||||
super.spawnAfterBreak(iblockdata, worldserver, blockposition, itemstack);
|
||||
public void spawnAfterBreak(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack, boolean flag) {
|
||||
super.spawnAfterBreak(iblockdata, worldserver, blockposition, itemstack, flag);
|
||||
+ // CraftBukkit start - Delegate to getExpDrop
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getExpDrop(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack) {
|
||||
int i = 15 + worldserver.random.nextInt(15) + worldserver.random.nextInt(15);
|
||||
+ public int getExpDrop(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack, boolean flag) {
|
||||
if (flag) {
|
||||
int i = 15 + worldserver.random.nextInt(15) + worldserver.random.nextInt(15);
|
||||
|
||||
- this.popExperience(worldserver, blockposition, i);
|
||||
+ // this.popExperience(worldserver, blockposition, i);
|
||||
+ return i;
|
||||
- this.popExperience(worldserver, blockposition, i);
|
||||
+ // this.popExperience(worldserver, blockposition, i);
|
||||
+ return i;
|
||||
}
|
||||
|
||||
+ return 0;
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockMonsterEggs.java
|
||||
+++ b/net/minecraft/world/level/block/BlockMonsterEggs.java
|
||||
@@ -18,6 +18,8 @@
|
||||
@@ -16,6 +16,8 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.level.block.state.properties.IBlockState;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
public class BlockMonsterEggs extends Block {
|
||||
|
||||
private final Block hostBlock;
|
||||
@@ -43,7 +45,7 @@
|
||||
@@ -41,7 +43,7 @@
|
||||
EntitySilverfish entitysilverfish = (EntitySilverfish) EntityTypes.SILVERFISH.create(worldserver);
|
||||
|
||||
entitysilverfish.moveTo((double) blockposition.getX() + 0.5D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.5D, 0.0F, 0.0F);
|
||||
|
||||
@@ -22,9 +22,9 @@
|
||||
|
||||
@@ -82,6 +86,7 @@
|
||||
|
||||
public boolean growMushroom(WorldServer worldserver, BlockPosition blockposition, IBlockData iblockdata, Random random) {
|
||||
public boolean growMushroom(WorldServer worldserver, BlockPosition blockposition, IBlockData iblockdata, RandomSource randomsource) {
|
||||
worldserver.removeBlock(blockposition, false);
|
||||
+ BlockSapling.treeType = (this == Blocks.BROWN_MUSHROOM) ? TreeType.BROWN_MUSHROOM : TreeType.BROWN_MUSHROOM; // CraftBukkit
|
||||
if (((WorldGenFeatureConfigured) ((Holder) this.featureSupplier.get()).value()).place(worldserver, worldserver.getChunkSource().getGenerator(), random, blockposition)) {
|
||||
if (((WorldGenFeatureConfigured) ((Holder) this.featureSupplier.get()).value()).place(worldserver, worldserver.getChunkSource().getGenerator(), randomsource, blockposition)) {
|
||||
return true;
|
||||
} else {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+++ b/net/minecraft/world/level/block/BlockNetherWart.java
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
if (i < 3 && random.nextInt(10) == 0) {
|
||||
if (i < 3 && randomsource.nextInt(10) == 0) {
|
||||
iblockdata = (IBlockData) iblockdata.setValue(BlockNetherWart.AGE, i + 1);
|
||||
- worldserver.setBlock(blockposition, iblockdata, 2);
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, iblockdata, 2); // CraftBukkit
|
||||
|
||||
@@ -1,47 +1,50 @@
|
||||
--- a/net/minecraft/world/level/block/BlockNote.java
|
||||
+++ b/net/minecraft/world/level/block/BlockNote.java
|
||||
@@ -48,7 +48,8 @@
|
||||
@@ -51,7 +51,8 @@
|
||||
|
||||
if (flag1 != (Boolean) iblockdata.getValue(BlockNote.POWERED)) {
|
||||
if (flag1) {
|
||||
- this.playNote(world, blockposition);
|
||||
+ this.playNote(world, blockposition, iblockdata); // CraftBukkit
|
||||
- this.playNote((Entity) null, world, blockposition);
|
||||
+ this.playNote((Entity) null, world, blockposition, iblockdata); // CraftBukkit
|
||||
+ iblockdata = world.getBlockState(blockposition); // CraftBukkit - SPIGOT-5617: update in case changed in event
|
||||
}
|
||||
|
||||
world.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockNote.POWERED, flag1), 3);
|
||||
@@ -56,9 +57,14 @@
|
||||
@@ -59,11 +60,18 @@
|
||||
|
||||
}
|
||||
|
||||
- private void playNote(World world, BlockPosition blockposition) {
|
||||
+ private void playNote(World world, BlockPosition blockposition, IBlockData data) { // CraftBukkit
|
||||
- private void playNote(@Nullable Entity entity, World world, BlockPosition blockposition) {
|
||||
+ private void playNote(@Nullable Entity entity, World world, BlockPosition blockposition, IBlockData data) { // CraftBukkit
|
||||
if (world.getBlockState(blockposition.above()).isAir()) {
|
||||
- world.blockEvent(blockposition, this, 0, 0);
|
||||
+ // CraftBukkit start
|
||||
+ org.bukkit.event.block.NotePlayEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callNotePlayEvent(world, blockposition, data.getValue(BlockNote.INSTRUMENT), data.getValue(BlockNote.NOTE));
|
||||
+ if (!event.isCancelled()) {
|
||||
+ world.blockEvent(blockposition, this, 0, 0);
|
||||
+ if (event.isCancelled()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
world.blockEvent(blockposition, this, 0, 0);
|
||||
world.gameEvent(entity, GameEvent.NOTE_BLOCK_PLAY, blockposition);
|
||||
}
|
||||
|
||||
+
|
||||
}
|
||||
@@ -70,7 +76,7 @@
|
||||
|
||||
@Override
|
||||
@@ -73,7 +81,7 @@
|
||||
} else {
|
||||
iblockdata = (IBlockData) iblockdata.cycle(BlockNote.NOTE);
|
||||
world.setBlock(blockposition, iblockdata, 3);
|
||||
- this.playNote(world, blockposition);
|
||||
+ this.playNote(world, blockposition, iblockdata); // CraftBukkit
|
||||
- this.playNote(entityhuman, world, blockposition);
|
||||
+ this.playNote(entityhuman, world, blockposition, iblockdata); // CraftBukkit
|
||||
entityhuman.awardStat(StatisticList.TUNE_NOTEBLOCK);
|
||||
return EnumInteractionResult.CONSUME;
|
||||
}
|
||||
@@ -79,7 +85,7 @@
|
||||
@@ -82,7 +90,7 @@
|
||||
@Override
|
||||
public void attack(IBlockData iblockdata, World world, BlockPosition blockposition, EntityHuman entityhuman) {
|
||||
if (!world.isClientSide) {
|
||||
- this.playNote(world, blockposition);
|
||||
+ this.playNote(world, blockposition, iblockdata); // CraftBukkit
|
||||
- this.playNote(entityhuman, world, blockposition);
|
||||
+ this.playNote(entityhuman, world, blockposition, iblockdata); // CraftBukkit
|
||||
entityhuman.awardStat(StatisticList.PLAY_NOTEBLOCK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+++ b/net/minecraft/world/level/block/BlockNylium.java
|
||||
@@ -31,6 +31,11 @@
|
||||
@Override
|
||||
public void randomTick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
|
||||
public void randomTick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, RandomSource randomsource) {
|
||||
if (!canBeNylium(iblockdata, worldserver, blockposition)) {
|
||||
+ // CraftBukkit start
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, Blocks.NETHERRACK.defaultBlockState()).isCancelled()) {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
public static final BlockStateBoolean POWERED = BlockProperties.POWERED;
|
||||
@@ -41,8 +43,18 @@
|
||||
@Override
|
||||
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
|
||||
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, RandomSource randomsource) {
|
||||
if ((Boolean) iblockdata.getValue(BlockObserver.POWERED)) {
|
||||
+ // CraftBukkit start
|
||||
+ if (CraftEventFactory.callRedstoneChange(worldserver, blockposition, 15, 0).getNewCurrent() != 0) {
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
--- a/net/minecraft/world/level/block/BlockOre.java
|
||||
+++ b/net/minecraft/world/level/block/BlockOre.java
|
||||
@@ -25,13 +25,20 @@
|
||||
@Override
|
||||
public void spawnAfterBreak(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack) {
|
||||
super.spawnAfterBreak(iblockdata, worldserver, blockposition, itemstack);
|
||||
+ // CraftBukkit start - Delegated to getExpDrop
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getExpDrop(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack) {
|
||||
+ // CraftBukkit end
|
||||
if (EnchantmentManager.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) == 0) {
|
||||
int i = this.xpRange.sample(worldserver.random);
|
||||
|
||||
if (i > 0) {
|
||||
- this.popExperience(worldserver, blockposition, i);
|
||||
+ return i; // CraftBukkit
|
||||
}
|
||||
}
|
||||
|
||||
+ return 0; // CraftBukkit
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@
|
||||
}
|
||||
@@ -45,6 +52,11 @@
|
||||
@Override
|
||||
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
|
||||
public void tick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, RandomSource randomsource) {
|
||||
if ((Boolean) iblockdata.getValue(BlockRedstoneLamp.LIT) && !worldserver.hasNeighborSignal(blockposition)) {
|
||||
+ // CraftBukkit start
|
||||
+ if (CraftEventFactory.callRedstoneChange(worldserver, blockposition, 15, 0).getNewCurrent() != 0) {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
public class BlockRedstoneOre extends Block {
|
||||
|
||||
public static final BlockStateBoolean LIT = BlockRedstoneTorch.LIT;
|
||||
@@ -32,14 +37,30 @@
|
||||
@@ -32,14 +37,27 @@
|
||||
|
||||
@Override
|
||||
public void attack(IBlockData iblockdata, World world, BlockPosition blockposition, EntityHuman entityhuman) {
|
||||
@@ -23,30 +23,26 @@
|
||||
|
||||
@Override
|
||||
public void stepOn(World world, BlockPosition blockposition, IBlockData iblockdata, Entity entity) {
|
||||
- interact(iblockdata, world, blockposition);
|
||||
- super.stepOn(world, blockposition, iblockdata, entity);
|
||||
+ // CraftBukkit start
|
||||
+ // interact(iblockdata, world, blockposition);
|
||||
+ // super.stepOn(world, blockposition, iblockdata, entity);
|
||||
+ if (entity instanceof EntityHuman) {
|
||||
+ org.bukkit.event.player.PlayerInteractEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent((EntityHuman) entity, org.bukkit.event.block.Action.PHYSICAL, blockposition, null, null, null);
|
||||
+ if (!event.isCancelled()) {
|
||||
+ interact(world.getBlockState(blockposition), world, blockposition, entity); // add entity
|
||||
+ super.stepOn(world, blockposition, iblockdata, entity);
|
||||
if (!entity.isSteppingCarefully()) {
|
||||
- interact(iblockdata, world, blockposition);
|
||||
+ // CraftBukkit start
|
||||
+ if (entity instanceof EntityHuman) {
|
||||
+ org.bukkit.event.player.PlayerInteractEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent((EntityHuman) entity, org.bukkit.event.block.Action.PHYSICAL, blockposition, null, null, null);
|
||||
+ if (!event.isCancelled()) {
|
||||
+ interact(world.getBlockState(blockposition), world, blockposition, entity); // add entity
|
||||
+ }
|
||||
+ } else {
|
||||
+ EntityInteractEvent event = new EntityInteractEvent(entity.getBukkitEntity(), world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
||||
+ world.getCraftServer().getPluginManager().callEvent(event);
|
||||
+ if (!event.isCancelled()) {
|
||||
+ interact(world.getBlockState(blockposition), world, blockposition, entity); // add entity
|
||||
+ }
|
||||
+ }
|
||||
+ } else {
|
||||
+ EntityInteractEvent event = new EntityInteractEvent(entity.getBukkitEntity(), world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ()));
|
||||
+ world.getCraftServer().getPluginManager().callEvent(event);
|
||||
+ if (!event.isCancelled()) {
|
||||
+ interact(world.getBlockState(blockposition), world, blockposition, entity); // add entity
|
||||
+ super.stepOn(world, blockposition, iblockdata, entity);
|
||||
+ }
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -47,7 +68,7 @@
|
||||
super.stepOn(world, blockposition, iblockdata, entity);
|
||||
@@ -50,7 +68,7 @@
|
||||
if (world.isClientSide) {
|
||||
spawnParticles(world, blockposition);
|
||||
} else {
|
||||
@@ -55,7 +51,7 @@
|
||||
}
|
||||
|
||||
ItemStack itemstack = entityhuman.getItemInHand(enumhand);
|
||||
@@ -55,9 +76,14 @@
|
||||
@@ -58,9 +76,14 @@
|
||||
return itemstack.getItem() instanceof ItemBlock && (new BlockActionContext(entityhuman, enumhand, itemstack, movingobjectpositionblock)).canPlace() ? EnumInteractionResult.PASS : EnumInteractionResult.SUCCESS;
|
||||
}
|
||||
|
||||
@@ -71,9 +67,9 @@
|
||||
world.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockRedstoneOre.LIT, true), 3);
|
||||
}
|
||||
|
||||
@@ -71,6 +97,11 @@
|
||||
@@ -74,6 +97,11 @@
|
||||
@Override
|
||||
public void randomTick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
|
||||
public void randomTick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, RandomSource randomsource) {
|
||||
if ((Boolean) iblockdata.getValue(BlockRedstoneOre.LIT)) {
|
||||
+ // CraftBukkit start
|
||||
+ if (CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, iblockdata.setValue(BlockRedstoneOre.LIT, false)).isCancelled()) {
|
||||
@@ -83,16 +79,16 @@
|
||||
worldserver.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockRedstoneOre.LIT, false), 3);
|
||||
}
|
||||
|
||||
@@ -79,12 +110,20 @@
|
||||
@@ -82,12 +110,20 @@
|
||||
@Override
|
||||
public void spawnAfterBreak(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack) {
|
||||
super.spawnAfterBreak(iblockdata, worldserver, blockposition, itemstack);
|
||||
public void spawnAfterBreak(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack, boolean flag) {
|
||||
super.spawnAfterBreak(iblockdata, worldserver, blockposition, itemstack, flag);
|
||||
+ // CraftBukkit start - Delegated to getExpDrop
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getExpDrop(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack) {
|
||||
if (EnchantmentManager.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) == 0) {
|
||||
+ public int getExpDrop(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack, boolean flag) {
|
||||
if (flag && EnchantmentManager.getItemEnchantmentLevel(Enchantments.SILK_TOUCH, itemstack) == 0) {
|
||||
int i = 1 + worldserver.random.nextInt(5);
|
||||
|
||||
- this.popExperience(worldserver, blockposition, i);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
public class BlockRedstoneWire extends Block {
|
||||
|
||||
public static final BlockStateEnum<BlockPropertyRedstoneSide> NORTH = BlockProperties.NORTH_REDSTONE;
|
||||
@@ -257,7 +259,16 @@
|
||||
@@ -255,7 +257,16 @@
|
||||
private void updatePowerStrength(World world, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
int i = this.calculateTargetStrength(world, blockposition);
|
||||
|
||||
|
||||
@@ -23,12 +23,12 @@
|
||||
super(blockbase_info);
|
||||
@@ -35,7 +43,30 @@
|
||||
@Override
|
||||
public void randomTick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
|
||||
if (worldserver.getMaxLocalRawBrightness(blockposition.above()) >= 9 && random.nextInt(7) == 0) {
|
||||
public void randomTick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, RandomSource randomsource) {
|
||||
if (worldserver.getMaxLocalRawBrightness(blockposition.above()) >= 9 && randomsource.nextInt(7) == 0) {
|
||||
+ // CraftBukkit start
|
||||
+ worldserver.captureTreeGeneration = true;
|
||||
+ // CraftBukkit end
|
||||
this.advanceTree(worldserver, blockposition, iblockdata, random);
|
||||
this.advanceTree(worldserver, blockposition, iblockdata, randomsource);
|
||||
+ // CraftBukkit start
|
||||
+ worldserver.captureTreeGeneration = false;
|
||||
+ if (worldserver.capturedBlockStates.size() > 0) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/world/level/block/BlockSnow.java
|
||||
+++ b/net/minecraft/world/level/block/BlockSnow.java
|
||||
@@ -86,6 +86,11 @@
|
||||
@@ -92,6 +92,11 @@
|
||||
@Override
|
||||
public void randomTick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, Random random) {
|
||||
public void randomTick(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, RandomSource randomsource) {
|
||||
if (worldserver.getBrightness(EnumSkyBlock.BLOCK, blockposition) > 11) {
|
||||
+ // CraftBukkit start
|
||||
+ if (org.bukkit.craftbukkit.event.CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, Blocks.AIR.defaultBlockState()).isCancelled()) {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
- worldserver.setBlock(blockposition, iblockdata, 2);
|
||||
+ CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, iblockdata, 2); // CraftBukkit
|
||||
} else {
|
||||
EnumDirection enumdirection = EnumDirection.EnumDirectionLimit.HORIZONTAL.getRandomDirection(random);
|
||||
EnumDirection enumdirection = EnumDirection.EnumDirectionLimit.HORIZONTAL.getRandomDirection(randomsource);
|
||||
BlockPosition blockposition1 = blockposition.relative(enumdirection);
|
||||
IBlockData iblockdata1 = worldserver.getBlockState(blockposition1.below());
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockSweetBerryBush.java
|
||||
+++ b/net/minecraft/world/level/block/BlockSweetBerryBush.java
|
||||
@@ -26,6 +26,14 @@
|
||||
@@ -27,6 +27,14 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
@@ -15,16 +15,16 @@
|
||||
public class BlockSweetBerryBush extends BlockPlant implements IBlockFragilePlantElement {
|
||||
|
||||
private static final float HURT_SPEED_THRESHOLD = 0.003F;
|
||||
@@ -59,7 +67,7 @@
|
||||
int i = (Integer) iblockdata.getValue(BlockSweetBerryBush.AGE);
|
||||
@@ -62,7 +70,7 @@
|
||||
if (i < 3 && randomsource.nextInt(5) == 0 && worldserver.getRawBrightness(blockposition.above(), 0) >= 9) {
|
||||
IBlockData iblockdata1 = (IBlockData) iblockdata.setValue(BlockSweetBerryBush.AGE, i + 1);
|
||||
|
||||
if (i < 3 && random.nextInt(5) == 0 && worldserver.getRawBrightness(blockposition.above(), 0) >= 9) {
|
||||
- worldserver.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockSweetBerryBush.AGE, i + 1), 2);
|
||||
+ CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, (IBlockData) iblockdata.setValue(BlockSweetBerryBush.AGE, i + 1), 2); // CraftBukkit
|
||||
- worldserver.setBlock(blockposition, iblockdata1, 2);
|
||||
+ if (!CraftEventFactory.handleBlockGrowEvent(worldserver, blockposition, iblockdata1, 2)) return; // CraftBukkit
|
||||
worldserver.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, GameEvent.a.of(iblockdata1));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -73,7 +81,9 @@
|
||||
@@ -77,7 +85,9 @@
|
||||
double d1 = Math.abs(entity.getZ() - entity.zOld);
|
||||
|
||||
if (d0 >= 0.003000000026077032D || d1 >= 0.003000000026077032D) {
|
||||
@@ -34,7 +34,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +100,15 @@
|
||||
@@ -94,7 +104,15 @@
|
||||
} else if (i > 1) {
|
||||
int j = 1 + world.random.nextInt(2);
|
||||
|
||||
@@ -49,5 +49,5 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
world.playSound((EntityHuman) null, blockposition, SoundEffects.SWEET_BERRY_BUSH_PICK_BERRIES, SoundCategory.BLOCKS, 1.0F, 0.8F + world.random.nextFloat() * 0.4F);
|
||||
world.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockSweetBerryBush.AGE, 1), 2);
|
||||
return EnumInteractionResult.sidedSuccess(world.isClientSide);
|
||||
IBlockData iblockdata1 = (IBlockData) iblockdata.setValue(BlockSweetBerryBush.AGE, 1);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockTrapdoor.java
|
||||
+++ b/net/minecraft/world/level/block/BlockTrapdoor.java
|
||||
@@ -27,6 +27,8 @@
|
||||
@@ -28,6 +28,8 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
public class BlockTrapdoor extends BlockFacingHorizontal implements IBlockWaterlogged {
|
||||
|
||||
public static final BlockStateBoolean OPEN = BlockProperties.OPEN;
|
||||
@@ -115,6 +117,19 @@
|
||||
@@ -116,6 +118,19 @@
|
||||
boolean flag1 = world.hasNeighborSignal(blockposition);
|
||||
|
||||
if (flag1 != (Boolean) iblockdata.getValue(BlockTrapdoor.POWERED)) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockTripwireHook.java
|
||||
+++ b/net/minecraft/world/level/block/BlockTripwireHook.java
|
||||
@@ -26,6 +26,8 @@
|
||||
@@ -27,6 +27,8 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
public class BlockTripwireHook extends Block {
|
||||
|
||||
public static final BlockStateDirection FACING = BlockFacingHorizontal.FACING;
|
||||
@@ -160,6 +162,17 @@
|
||||
this.playSound(world, blockposition1, flag4, flag5, flag2, flag3);
|
||||
@@ -161,6 +163,17 @@
|
||||
this.emitState(world, blockposition1, flag4, flag5, flag2, flag3);
|
||||
}
|
||||
|
||||
+ // CraftBukkit start
|
||||
@@ -24,6 +24,6 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
this.playSound(world, blockposition, flag4, flag5, flag2, flag3);
|
||||
this.emitState(world, blockposition, flag4, flag5, flag2, flag3);
|
||||
if (!flag) {
|
||||
world.setBlock(blockposition, (IBlockData) iblockdata3.setValue(BlockTripwireHook.FACING, enumdirection), 3);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockTurtleEgg.java
|
||||
+++ b/net/minecraft/world/level/block/BlockTurtleEgg.java
|
||||
@@ -28,6 +28,12 @@
|
||||
@@ -29,6 +29,12 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
public class BlockTurtleEgg extends Block {
|
||||
|
||||
public static final int MAX_HATCH_LEVEL = 2;
|
||||
@@ -61,6 +67,19 @@
|
||||
@@ -65,6 +71,19 @@
|
||||
private void destroyEgg(World world, IBlockData iblockdata, BlockPosition blockposition, Entity entity, int i) {
|
||||
if (this.canDestroyEgg(world, entity)) {
|
||||
if (!world.isClientSide && world.random.nextInt(i) == 0 && iblockdata.is(Blocks.TURTLE_EGG)) {
|
||||
@@ -33,7 +33,7 @@
|
||||
this.decreaseEggs(world, blockposition, iblockdata);
|
||||
}
|
||||
|
||||
@@ -86,9 +105,19 @@
|
||||
@@ -91,9 +110,19 @@
|
||||
int i = (Integer) iblockdata.getValue(BlockTurtleEgg.HATCH);
|
||||
|
||||
if (i < 2) {
|
||||
@@ -42,7 +42,7 @@
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
worldserver.playSound((EntityHuman) null, blockposition, SoundEffects.TURTLE_EGG_CRACK, SoundCategory.BLOCKS, 0.7F, 0.9F + random.nextFloat() * 0.2F);
|
||||
worldserver.playSound((EntityHuman) null, blockposition, SoundEffects.TURTLE_EGG_CRACK, SoundCategory.BLOCKS, 0.7F, 0.9F + randomsource.nextFloat() * 0.2F);
|
||||
- worldserver.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockTurtleEgg.HATCH, i + 1), 2);
|
||||
+ // worldserver.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockTurtleEgg.HATCH, i + 1), 2); // CraftBukkit - handled above
|
||||
} else {
|
||||
@@ -51,10 +51,10 @@
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
worldserver.playSound((EntityHuman) null, blockposition, SoundEffects.TURTLE_EGG_HATCH, SoundCategory.BLOCKS, 0.7F, 0.9F + random.nextFloat() * 0.2F);
|
||||
worldserver.playSound((EntityHuman) null, blockposition, SoundEffects.TURTLE_EGG_HATCH, SoundCategory.BLOCKS, 0.7F, 0.9F + randomsource.nextFloat() * 0.2F);
|
||||
worldserver.removeBlock(blockposition, false);
|
||||
|
||||
@@ -99,7 +128,7 @@
|
||||
@@ -104,7 +133,7 @@
|
||||
entityturtle.setAge(-24000);
|
||||
entityturtle.setHomePos(blockposition);
|
||||
entityturtle.moveTo((double) blockposition.getX() + 0.3D + (double) j * 0.2D, (double) blockposition.getY(), (double) blockposition.getZ() + 0.3D, 0.0F, 0.0F);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
public class BlockVine extends Block {
|
||||
|
||||
public static final BlockStateBoolean UP = BlockSprawling.UP;
|
||||
@@ -196,20 +198,24 @@
|
||||
@@ -194,20 +196,24 @@
|
||||
BlockPosition blockposition3 = blockposition2.relative(enumdirection1);
|
||||
BlockPosition blockposition4 = blockposition2.relative(enumdirection2);
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
} else if (flag1 && worldserver.isEmptyBlock(blockposition4) && isAcceptableNeighbour(worldserver, blockposition.relative(enumdirection2), enumdirection3)) {
|
||||
- worldserver.setBlock(blockposition4, (IBlockData) this.defaultBlockState().setValue(getPropertyForFace(enumdirection3), true), 2);
|
||||
+ CraftEventFactory.handleBlockSpreadEvent(worldserver, source, blockposition4, (IBlockData) this.defaultBlockState().setValue(getPropertyForFace(enumdirection3), true), 2);
|
||||
} else if ((double) random.nextFloat() < 0.05D && isAcceptableNeighbour(worldserver, blockposition2.above(), EnumDirection.UP)) {
|
||||
} else if ((double) randomsource.nextFloat() < 0.05D && isAcceptableNeighbour(worldserver, blockposition2.above(), EnumDirection.UP)) {
|
||||
- worldserver.setBlock(blockposition2, (IBlockData) this.defaultBlockState().setValue(BlockVine.UP, true), 2);
|
||||
+ CraftEventFactory.handleBlockSpreadEvent(worldserver, source, blockposition2, (IBlockData) this.defaultBlockState().setValue(BlockVine.UP, true), 2);
|
||||
}
|
||||
@@ -39,7 +39,7 @@
|
||||
}
|
||||
} else if (isAcceptableNeighbour(worldserver, blockposition2, enumdirection)) {
|
||||
worldserver.setBlock(blockposition, (IBlockData) iblockdata.setValue(getPropertyForFace(enumdirection), true), 2);
|
||||
@@ -239,7 +245,7 @@
|
||||
@@ -237,7 +243,7 @@
|
||||
}
|
||||
|
||||
if (this.hasHorizontalConnection(iblockdata2)) {
|
||||
@@ -48,8 +48,8 @@
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -254,7 +260,7 @@
|
||||
IBlockData iblockdata4 = this.copyRandomFaces(iblockdata, iblockdata3, random);
|
||||
@@ -252,7 +258,7 @@
|
||||
IBlockData iblockdata4 = this.copyRandomFaces(iblockdata, iblockdata3, randomsource);
|
||||
|
||||
if (iblockdata3 != iblockdata4 && this.hasHorizontalConnection(iblockdata4)) {
|
||||
- worldserver.setBlock(blockposition2, iblockdata4, 2);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
+++ b/net/minecraft/world/level/block/ChangeOverTimeBlock.java
|
||||
@@ -69,7 +69,7 @@
|
||||
|
||||
if (random.nextFloat() < f1) {
|
||||
if (randomsource.nextFloat() < f1) {
|
||||
this.getNext(iblockdata).ifPresent((iblockdata2) -> {
|
||||
- worldserver.setBlockAndUpdate(blockposition, iblockdata2);
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockFormEvent(worldserver, blockposition, iblockdata2); // CraftBukkit
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
--- a/net/minecraft/world/level/block/DropExperienceBlock.java
|
||||
+++ b/net/minecraft/world/level/block/DropExperienceBlock.java
|
||||
@@ -24,9 +24,16 @@
|
||||
@Override
|
||||
public void spawnAfterBreak(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack, boolean flag) {
|
||||
super.spawnAfterBreak(iblockdata, worldserver, blockposition, itemstack, flag);
|
||||
+ // CraftBukkit start - Delegate to getExpDrop
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getExpDrop(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack, boolean flag) {
|
||||
if (flag) {
|
||||
- this.tryDropExperience(worldserver, blockposition, itemstack, this.xpRange);
|
||||
+ return this.tryDropExperience(worldserver, blockposition, itemstack, this.xpRange);
|
||||
}
|
||||
|
||||
+ return 0;
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/LayeredCauldronBlock.java
|
||||
+++ b/net/minecraft/world/level/block/LayeredCauldronBlock.java
|
||||
@@ -16,6 +16,12 @@
|
||||
@@ -17,6 +17,12 @@
|
||||
import net.minecraft.world.level.material.FluidType;
|
||||
import net.minecraft.world.level.material.FluidTypes;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
public class LayeredCauldronBlock extends AbstractCauldronBlock {
|
||||
|
||||
public static final int MIN_FILL_LEVEL = 1;
|
||||
@@ -55,10 +61,14 @@
|
||||
@@ -56,10 +62,14 @@
|
||||
@Override
|
||||
public void entityInside(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
||||
if (!world.isClientSide && entity.isOnFire() && this.isEntityInsideContent(iblockdata, blockposition, entity)) {
|
||||
@@ -30,7 +30,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -68,15 +78,38 @@
|
||||
@@ -69,20 +79,42 @@
|
||||
}
|
||||
|
||||
public static void lowerFillLevel(IBlockData iblockdata, World world, BlockPosition blockposition) {
|
||||
@@ -40,9 +40,11 @@
|
||||
+
|
||||
+ public static boolean lowerFillLevel(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity, CauldronLevelChangeEvent.ChangeReason reason) {
|
||||
int i = (Integer) iblockdata.getValue(LayeredCauldronBlock.LEVEL) - 1;
|
||||
IBlockData iblockdata1 = i == 0 ? Blocks.CAULDRON.defaultBlockState() : (IBlockData) iblockdata.setValue(LayeredCauldronBlock.LEVEL, i);
|
||||
|
||||
- world.setBlockAndUpdate(blockposition, i == 0 ? Blocks.CAULDRON.defaultBlockState() : (IBlockData) iblockdata.setValue(LayeredCauldronBlock.LEVEL, i));
|
||||
+ return changeLevel(iblockdata, world, blockposition, i == 0 ? Blocks.CAULDRON.defaultBlockState() : iblockdata.setValue(LayeredCauldronBlock.LEVEL, i), entity, reason);
|
||||
- world.setBlockAndUpdate(blockposition, iblockdata1);
|
||||
- world.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, GameEvent.a.of(iblockdata1));
|
||||
+ return changeLevel(iblockdata, world, blockposition, iblockdata1, entity, reason);
|
||||
}
|
||||
|
||||
+ // CraftBukkit start
|
||||
@@ -59,6 +61,7 @@
|
||||
+ return false;
|
||||
+ }
|
||||
+ newState.update(true);
|
||||
+ world.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, GameEvent.a.of(newBlock));
|
||||
+ return true;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
@@ -66,18 +69,22 @@
|
||||
@Override
|
||||
public void handlePrecipitation(IBlockData iblockdata, World world, BlockPosition blockposition, BiomeBase.Precipitation biomebase_precipitation) {
|
||||
if (BlockCauldron.shouldHandlePrecipitation(world, biomebase_precipitation) && (Integer) iblockdata.getValue(LayeredCauldronBlock.LEVEL) != 3 && this.fillPredicate.test(biomebase_precipitation)) {
|
||||
- world.setBlockAndUpdate(blockposition, (IBlockData) iblockdata.cycle(LayeredCauldronBlock.LEVEL));
|
||||
+ changeLevel(iblockdata, world, blockposition, (IBlockData) iblockdata.cycle(LayeredCauldronBlock.LEVEL), null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL); // CraftBukkit
|
||||
IBlockData iblockdata1 = (IBlockData) iblockdata.cycle(LayeredCauldronBlock.LEVEL);
|
||||
|
||||
- world.setBlockAndUpdate(blockposition, iblockdata1);
|
||||
- world.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, GameEvent.a.of(iblockdata1));
|
||||
+ changeLevel(iblockdata, world, blockposition, iblockdata1, null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL); // CraftBukkit
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,7 +126,11 @@
|
||||
@Override
|
||||
protected void receiveStalactiteDrip(IBlockData iblockdata, World world, BlockPosition blockposition, FluidType fluidtype) {
|
||||
@@ -101,8 +133,11 @@
|
||||
if (!this.isFull(iblockdata)) {
|
||||
- world.setBlockAndUpdate(blockposition, (IBlockData) iblockdata.setValue(LayeredCauldronBlock.LEVEL, (Integer) iblockdata.getValue(LayeredCauldronBlock.LEVEL) + 1));
|
||||
IBlockData iblockdata1 = (IBlockData) iblockdata.setValue(LayeredCauldronBlock.LEVEL, (Integer) iblockdata.getValue(LayeredCauldronBlock.LEVEL) + 1);
|
||||
|
||||
- world.setBlockAndUpdate(blockposition, iblockdata1);
|
||||
- world.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, GameEvent.a.of(iblockdata1));
|
||||
+ // CraftBukkit start
|
||||
+ if (!changeLevel(iblockdata, world, blockposition, (IBlockData) iblockdata.setValue(LayeredCauldronBlock.LEVEL, (Integer) iblockdata.getValue(LayeredCauldronBlock.LEVEL) + 1), null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL)) {
|
||||
+ if (!changeLevel(iblockdata, world, blockposition, iblockdata1, null, CauldronLevelChangeEvent.ChangeReason.NATURAL_FILL)) {
|
||||
+ return;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
--- a/net/minecraft/world/level/block/MultifaceBlock.java
|
||||
+++ b/net/minecraft/world/level/block/MultifaceBlock.java
|
||||
@@ -133,7 +133,7 @@
|
||||
|
||||
return (IBlockData) Arrays.stream(blockactioncontext.getNearestLookingDirections()).map((enumdirection) -> {
|
||||
return this.getStateForPlacement(iblockdata, world, blockposition, enumdirection);
|
||||
- }).filter(Objects::nonNull).findFirst().orElse((Object) null);
|
||||
+ }).filter(Objects::nonNull).findFirst().orElse(null); // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -225,7 +225,7 @@
|
||||
if (optional.isPresent()) {
|
||||
Pair<BlockPosition, EnumDirection> pair = (Pair) optional.get();
|
||||
|
||||
- return this.spreadToFace(generatoraccess, (BlockPosition) pair.getFirst(), (EnumDirection) pair.getSecond(), flag);
|
||||
+ return this.spreadToFace(generatoraccess, (BlockPosition) pair.getFirst(), (EnumDirection) pair.getSecond(), flag, blockposition); // CraftBukkit
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@@ -270,7 +270,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- private boolean spreadToFace(GeneratorAccess generatoraccess, BlockPosition blockposition, EnumDirection enumdirection, boolean flag) {
|
||||
+ private boolean spreadToFace(GeneratorAccess generatoraccess, BlockPosition blockposition, EnumDirection enumdirection, boolean flag, BlockPosition source) { // CraftBukkit
|
||||
IBlockData iblockdata = generatoraccess.getBlockState(blockposition);
|
||||
IBlockData iblockdata1 = this.getStateForPlacement(iblockdata, generatoraccess, blockposition, enumdirection);
|
||||
|
||||
@@ -279,7 +279,7 @@
|
||||
generatoraccess.getChunk(blockposition).markPosForPostprocessing(blockposition);
|
||||
}
|
||||
|
||||
- return generatoraccess.setBlock(blockposition, iblockdata1, 2);
|
||||
+ return org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(generatoraccess, source, blockposition, iblockdata1, 2); // CraftBukkit
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
--- a/net/minecraft/world/level/block/MultifaceSpreader.java
|
||||
+++ b/net/minecraft/world/level/block/MultifaceSpreader.java
|
||||
@@ -156,7 +156,7 @@
|
||||
generatoraccess.getChunk(multifacespreader_c.pos()).markPosForPostprocessing(multifacespreader_c.pos());
|
||||
}
|
||||
|
||||
- return generatoraccess.setBlock(multifacespreader_c.pos(), iblockdata1, 2);
|
||||
+ return org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(generatoraccess, multifacespreader_c.source(), multifacespreader_c.pos(), iblockdata1, 2); // CraftBukkit
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
@@ -174,19 +174,19 @@
|
||||
SAME_POSITION {
|
||||
@Override
|
||||
public MultifaceSpreader.c getSpreadPos(BlockPosition blockposition, EnumDirection enumdirection, EnumDirection enumdirection1) {
|
||||
- return new MultifaceSpreader.c(blockposition, enumdirection);
|
||||
+ return new MultifaceSpreader.c(blockposition, enumdirection, blockposition); // CraftBukkit
|
||||
}
|
||||
},
|
||||
SAME_PLANE {
|
||||
@Override
|
||||
public MultifaceSpreader.c getSpreadPos(BlockPosition blockposition, EnumDirection enumdirection, EnumDirection enumdirection1) {
|
||||
- return new MultifaceSpreader.c(blockposition.relative(enumdirection), enumdirection1);
|
||||
+ return new MultifaceSpreader.c(blockposition.relative(enumdirection), enumdirection1, blockposition); // CraftBukkit
|
||||
}
|
||||
},
|
||||
WRAP_AROUND {
|
||||
@Override
|
||||
public MultifaceSpreader.c getSpreadPos(BlockPosition blockposition, EnumDirection enumdirection, EnumDirection enumdirection1) {
|
||||
- return new MultifaceSpreader.c(blockposition.relative(enumdirection).relative(enumdirection1), enumdirection.getOpposite());
|
||||
+ return new MultifaceSpreader.c(blockposition.relative(enumdirection).relative(enumdirection1), enumdirection.getOpposite(), blockposition); // CraftBukkit
|
||||
}
|
||||
};
|
||||
|
||||
@@ -195,7 +195,7 @@
|
||||
public abstract MultifaceSpreader.c getSpreadPos(BlockPosition blockposition, EnumDirection enumdirection, EnumDirection enumdirection1);
|
||||
}
|
||||
|
||||
- public static record c(BlockPosition pos, EnumDirection face) {
|
||||
+ public static record c(BlockPosition pos, EnumDirection face, BlockPosition source) { // CraftBukkit
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/PointedDripstoneBlock.java
|
||||
+++ b/net/minecraft/world/level/block/PointedDripstoneBlock.java
|
||||
@@ -43,6 +43,11 @@
|
||||
@@ -44,6 +44,11 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapes;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
public class PointedDripstoneBlock extends Block implements Fallable, IBlockWaterlogged {
|
||||
|
||||
public static final BlockStateDirection TIP_DIRECTION = BlockProperties.VERTICAL_DIRECTION;
|
||||
@@ -125,6 +130,11 @@
|
||||
@@ -126,6 +131,11 @@
|
||||
BlockPosition blockposition = movingobjectpositionblock.getBlockPos();
|
||||
|
||||
if (!world.isClientSide && iprojectile.mayInteract(world, blockposition) && iprojectile instanceof EntityThrownTrident && iprojectile.getDeltaMovement().length() > 0.6D) {
|
||||
@@ -24,7 +24,7 @@
|
||||
world.destroyBlock(blockposition, true);
|
||||
}
|
||||
|
||||
@@ -133,7 +143,9 @@
|
||||
@@ -134,7 +144,9 @@
|
||||
@Override
|
||||
public void fallOn(World world, IBlockData iblockdata, BlockPosition blockposition, Entity entity, float f) {
|
||||
if (iblockdata.getValue(PointedDripstoneBlock.TIP_DIRECTION) == EnumDirection.UP && iblockdata.getValue(PointedDripstoneBlock.THICKNESS) == DripstoneThickness.TIP) {
|
||||
@@ -34,7 +34,7 @@
|
||||
} else {
|
||||
super.fallOn(world, iblockdata, blockposition, entity, f);
|
||||
}
|
||||
@@ -380,15 +392,15 @@
|
||||
@@ -389,15 +401,15 @@
|
||||
if (isUnmergedTipWithDirection(iblockdata, enumdirection.getOpposite())) {
|
||||
createMergedTips(iblockdata, worldserver, blockposition1);
|
||||
} else if (iblockdata.isAir() || iblockdata.is(Blocks.WATER)) {
|
||||
@@ -53,7 +53,7 @@
|
||||
}
|
||||
|
||||
private static void createMergedTips(IBlockData iblockdata, GeneratorAccess generatoraccess, BlockPosition blockposition) {
|
||||
@@ -403,8 +415,8 @@
|
||||
@@ -412,8 +424,8 @@
|
||||
blockposition1 = blockposition.below();
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
}
|
||||
|
||||
public static void spawnDripParticle(World world, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
@@ -437,7 +449,7 @@
|
||||
@@ -446,7 +458,7 @@
|
||||
|
||||
return (BlockPosition) findBlockVertical(generatoraccess, blockposition, enumdirection.getAxisDirection(), bipredicate, (iblockdata1) -> {
|
||||
return isTip(iblockdata1, flag);
|
||||
@@ -73,7 +73,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -553,7 +565,7 @@
|
||||
@@ -562,7 +574,7 @@
|
||||
return canDripThrough(world, blockposition1, iblockdata);
|
||||
};
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -562,7 +574,7 @@
|
||||
@@ -571,7 +583,7 @@
|
||||
return canDripThrough(world, blockposition1, iblockdata);
|
||||
};
|
||||
|
||||
@@ -90,4 +90,4 @@
|
||||
+ return (BlockPosition) findBlockVertical(world, blockposition, EnumDirection.UP.getAxisDirection(), bipredicate, PointedDripstoneBlock::canDrip, 11).orElse(null); // CraftBukkit - decompile error
|
||||
}
|
||||
|
||||
public static FluidType getCauldronFillFluidType(World world, BlockPosition blockposition) {
|
||||
public static FluidType getCauldronFillFluidType(WorldServer worldserver, BlockPosition blockposition) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@@ -26,6 +26,6 @@
|
||||
|
||||
@Override
|
||||
public void performBonemeal(WorldServer worldserver, Random random, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
public void performBonemeal(WorldServer worldserver, RandomSource randomsource, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
- worldserver.setBlockAndUpdate(blockposition.below(), Blocks.HANGING_ROOTS.defaultBlockState());
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.handleBlockSpreadEvent(worldserver, blockposition, blockposition.below(), Blocks.HANGING_ROOTS.defaultBlockState()); // CraftBukkit
|
||||
}
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
--- a/net/minecraft/world/level/block/SculkCatalystBlock.java
|
||||
+++ b/net/minecraft/world/level/block/SculkCatalystBlock.java
|
||||
@@ -86,9 +86,16 @@
|
||||
@Override
|
||||
public void spawnAfterBreak(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack, boolean flag) {
|
||||
super.spawnAfterBreak(iblockdata, worldserver, blockposition, itemstack, flag);
|
||||
+ // CraftBukkit start - Delegate to getExpDrop
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getExpDrop(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack, boolean flag) {
|
||||
if (flag) {
|
||||
- this.tryDropExperience(worldserver, blockposition, itemstack, this.xpRange);
|
||||
+ return this.tryDropExperience(worldserver, blockposition, itemstack, this.xpRange);
|
||||
}
|
||||
|
||||
+ return 0;
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/SculkSensorBlock.java
|
||||
+++ b/net/minecraft/world/level/block/SculkSensorBlock.java
|
||||
@@ -38,6 +38,11 @@
|
||||
@@ -42,6 +42,11 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
public class SculkSensorBlock extends BlockTileEntity implements IBlockWaterlogged {
|
||||
|
||||
public static final int ACTIVE_TICKS = 40;
|
||||
@@ -216,6 +221,15 @@
|
||||
@@ -234,6 +239,15 @@
|
||||
}
|
||||
|
||||
public static void deactivate(World world, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
@@ -26,12 +26,12 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
world.setBlock(blockposition, (IBlockData) ((IBlockData) iblockdata.setValue(SculkSensorBlock.PHASE, SculkSensorPhase.COOLDOWN)).setValue(SculkSensorBlock.POWER, 0), 3);
|
||||
world.scheduleTick(new BlockPosition(blockposition), iblockdata.getBlock(), 1);
|
||||
world.scheduleTick(blockposition, iblockdata.getBlock(), 1);
|
||||
if (!(Boolean) iblockdata.getValue(SculkSensorBlock.WATERLOGGED)) {
|
||||
@@ -226,6 +240,15 @@
|
||||
@@ -244,6 +258,15 @@
|
||||
}
|
||||
|
||||
public static void activate(World world, BlockPosition blockposition, IBlockData iblockdata, int i) {
|
||||
public static void activate(@Nullable Entity entity, World world, BlockPosition blockposition, IBlockData iblockdata, int i) {
|
||||
+ // CraftBukkit start
|
||||
+ BlockRedstoneEvent eventRedstone = new BlockRedstoneEvent(CraftBlock.at(world, blockposition), iblockdata.getValue(SculkSensorBlock.POWER), i);
|
||||
+ world.getCraftServer().getPluginManager().callEvent(eventRedstone);
|
||||
@@ -42,5 +42,23 @@
|
||||
+ i = eventRedstone.getNewCurrent();
|
||||
+ // CraftBukkit end
|
||||
world.setBlock(blockposition, (IBlockData) ((IBlockData) iblockdata.setValue(SculkSensorBlock.PHASE, SculkSensorPhase.ACTIVE)).setValue(SculkSensorBlock.POWER, i), 3);
|
||||
world.scheduleTick(new BlockPosition(blockposition), iblockdata.getBlock(), 40);
|
||||
world.scheduleTick(blockposition, iblockdata.getBlock(), 40);
|
||||
updateNeighbours(world, blockposition);
|
||||
@@ -306,9 +329,16 @@
|
||||
@Override
|
||||
public void spawnAfterBreak(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack, boolean flag) {
|
||||
super.spawnAfterBreak(iblockdata, worldserver, blockposition, itemstack, flag);
|
||||
+ // CraftBukkit start - Delegate to getExpDrop
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getExpDrop(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack, boolean flag) {
|
||||
if (flag) {
|
||||
- this.tryDropExperience(worldserver, blockposition, itemstack, ConstantInt.of(5));
|
||||
+ return this.tryDropExperience(worldserver, blockposition, itemstack, ConstantInt.of(5));
|
||||
}
|
||||
|
||||
+ return 0;
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
--- a/net/minecraft/world/level/block/SculkShriekerBlock.java
|
||||
+++ b/net/minecraft/world/level/block/SculkShriekerBlock.java
|
||||
@@ -140,10 +140,17 @@
|
||||
@Override
|
||||
public void spawnAfterBreak(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack, boolean flag) {
|
||||
super.spawnAfterBreak(iblockdata, worldserver, blockposition, itemstack, flag);
|
||||
+ // CraftBukkit start - Delegate to getExpDrop
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public int getExpDrop(IBlockData iblockdata, WorldServer worldserver, BlockPosition blockposition, ItemStack itemstack, boolean flag) {
|
||||
if (flag) {
|
||||
- this.tryDropExperience(worldserver, blockposition, itemstack, ConstantInt.of(5));
|
||||
+ return this.tryDropExperience(worldserver, blockposition, itemstack, ConstantInt.of(5));
|
||||
}
|
||||
|
||||
+ return 0;
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -27,7 +27,7 @@
|
||||
+
|
||||
if (i == 0) {
|
||||
this.onOpen(world, blockposition, iblockdata);
|
||||
world.gameEvent(entityhuman, GameEvent.CONTAINER_OPEN, blockposition);
|
||||
world.gameEvent((Entity) entityhuman, GameEvent.CONTAINER_OPEN, blockposition);
|
||||
@@ -37,8 +49,19 @@
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
+
|
||||
if (this.openCount == 0) {
|
||||
this.onClose(world, blockposition, iblockdata);
|
||||
world.gameEvent(entityhuman, GameEvent.CONTAINER_CLOSE, blockposition);
|
||||
world.gameEvent((Entity) entityhuman, GameEvent.CONTAINER_CLOSE, blockposition);
|
||||
@@ -59,6 +82,7 @@
|
||||
|
||||
public void recheckOpeners(World world, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityBanner.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityBanner.java
|
||||
@@ -101,6 +101,11 @@
|
||||
@@ -102,6 +102,11 @@
|
||||
}
|
||||
|
||||
this.itemPatterns = nbttagcompound.getList("Patterns", 10);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityBarrel.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityBarrel.java
|
||||
@@ -21,8 +21,49 @@
|
||||
@@ -20,8 +20,49 @@
|
||||
import net.minecraft.world.level.block.BlockBarrel;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityBeacon.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityBeacon.java
|
||||
@@ -38,6 +38,11 @@
|
||||
@@ -37,6 +37,11 @@
|
||||
import net.minecraft.world.level.levelgen.HeightMap;
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
public class TileEntityBeacon extends TileEntity implements ITileInventory {
|
||||
|
||||
private static final int MAX_LEVELS = 4;
|
||||
@@ -60,6 +65,15 @@
|
||||
@@ -59,6 +64,15 @@
|
||||
public IChatBaseComponent name;
|
||||
public ChestLock lockKey;
|
||||
private final IContainerProperties dataAccess;
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
public TileEntityBeacon(BlockPosition blockposition, IBlockData iblockdata) {
|
||||
super(TileEntityTypes.BEACON, blockposition, iblockdata);
|
||||
@@ -228,39 +242,78 @@
|
||||
@@ -234,39 +248,78 @@
|
||||
super.setRemoved();
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
public static void playSound(World world, BlockPosition blockposition, SoundEffect soundeffect) {
|
||||
world.playSound((EntityHuman) null, blockposition, soundeffect, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
}
|
||||
@@ -289,8 +342,11 @@
|
||||
@@ -295,8 +348,11 @@
|
||||
@Override
|
||||
public void load(NBTTagCompound nbttagcompound) {
|
||||
super.load(nbttagcompound);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityBeehive.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityBeehive.java
|
||||
@@ -42,6 +42,7 @@
|
||||
@@ -43,6 +43,7 @@
|
||||
private final List<TileEntityBeehive.HiveBee> stored = Lists.newArrayList();
|
||||
@Nullable
|
||||
public BlockPosition savedFlowerPos;
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
public TileEntityBeehive(BlockPosition blockposition, IBlockData iblockdata) {
|
||||
super(TileEntityTypes.BEEHIVE, blockposition, iblockdata);
|
||||
@@ -81,7 +82,7 @@
|
||||
@@ -82,7 +83,7 @@
|
||||
}
|
||||
|
||||
public boolean isFull() {
|
||||
@@ -17,7 +17,7 @@
|
||||
}
|
||||
|
||||
public void emptyAllLivingFromHive(@Nullable EntityHuman entityhuman, IBlockData iblockdata, TileEntityBeehive.ReleaseStatus tileentitybeehive_releasestatus) {
|
||||
@@ -98,7 +99,7 @@
|
||||
@@ -99,7 +100,7 @@
|
||||
|
||||
if (entityhuman.position().distanceToSqr(entity.position()) <= 16.0D) {
|
||||
if (!this.isSedated()) {
|
||||
@@ -26,7 +26,7 @@
|
||||
} else {
|
||||
entitybee.setStayOutOfHiveCountdown(400);
|
||||
}
|
||||
@@ -110,10 +111,16 @@
|
||||
@@ -111,10 +112,16 @@
|
||||
}
|
||||
|
||||
private List<Entity> releaseAllOccupants(IBlockData iblockdata, TileEntityBeehive.ReleaseStatus tileentitybeehive_releasestatus) {
|
||||
@@ -44,7 +44,7 @@
|
||||
});
|
||||
if (!list.isEmpty()) {
|
||||
super.setChanged();
|
||||
@@ -141,7 +148,19 @@
|
||||
@@ -142,7 +149,19 @@
|
||||
}
|
||||
|
||||
public void addOccupantWithPresetTicks(Entity entity, boolean flag, int i) {
|
||||
@@ -65,7 +65,7 @@
|
||||
entity.stopRiding();
|
||||
entity.ejectPassengers();
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
@@ -172,7 +191,13 @@
|
||||
@@ -174,7 +193,13 @@
|
||||
}
|
||||
|
||||
private static boolean releaseOccupant(World world, BlockPosition blockposition, IBlockData iblockdata, TileEntityBeehive.HiveBee tileentitybeehive_hivebee, @Nullable List<Entity> list, TileEntityBeehive.ReleaseStatus tileentitybeehive_releasestatus, @Nullable BlockPosition blockposition1) {
|
||||
@@ -80,7 +80,7 @@
|
||||
return false;
|
||||
} else {
|
||||
NBTTagCompound nbttagcompound = tileentitybeehive_hivebee.entityData.copy();
|
||||
@@ -195,6 +220,18 @@
|
||||
@@ -197,6 +222,18 @@
|
||||
if (!entity.getType().is(TagsEntity.BEEHIVE_INHABITORS)) {
|
||||
return false;
|
||||
} else {
|
||||
@@ -99,7 +99,7 @@
|
||||
if (entity instanceof EntityBee) {
|
||||
EntityBee entitybee = (EntityBee) entity;
|
||||
|
||||
@@ -226,6 +263,7 @@
|
||||
@@ -228,6 +265,7 @@
|
||||
list.add(entitybee);
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
float f = entity.getBbWidth();
|
||||
double d0 = flag ? 0.0D : 0.55D + (double) (f / 2.0F);
|
||||
double d1 = (double) blockposition.getX() + 0.5D + d0 * (double) enumdirection.getStepX();
|
||||
@@ -233,10 +271,11 @@
|
||||
@@ -235,11 +273,12 @@
|
||||
double d3 = (double) blockposition.getZ() + 0.5D + d0 * (double) enumdirection.getStepZ();
|
||||
|
||||
entity.moveTo(d1, d2, d3, entity.getYRot(), entity.getXRot());
|
||||
@@ -115,12 +115,13 @@
|
||||
}
|
||||
|
||||
world.playSound((EntityHuman) null, blockposition, SoundEffects.BEEHIVE_EXIT, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
world.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, GameEvent.a.of(entity, world.getBlockState(blockposition)));
|
||||
- return world.addFreshEntity(entity);
|
||||
+ return true; // return this.world.addFreshEntity(entity); // CraftBukkit - moved up
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
@@ -285,6 +324,10 @@
|
||||
@@ -288,6 +327,10 @@
|
||||
if (releaseOccupant(world, blockposition, iblockdata, tileentitybeehive_hivebee, (List) null, tileentitybeehive_releasestatus, blockposition1)) {
|
||||
flag = true;
|
||||
iterator.remove();
|
||||
@@ -131,7 +132,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -326,6 +369,11 @@
|
||||
@@ -329,6 +372,11 @@
|
||||
this.savedFlowerPos = GameProfileSerializer.readBlockPos(nbttagcompound.getCompound("FlowerPos"));
|
||||
}
|
||||
|
||||
@@ -143,7 +144,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -335,6 +383,7 @@
|
||||
@@ -338,6 +386,7 @@
|
||||
if (this.hasSavedFlowerPos()) {
|
||||
nbttagcompound.put("FlowerPos", GameProfileSerializer.writeBlockPos(this.savedFlowerPos));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityBrewingStand.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityBrewingStand.java
|
||||
@@ -25,6 +25,19 @@
|
||||
@@ -24,6 +24,19 @@
|
||||
import net.minecraft.world.level.block.BlockBrewingStand;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
public class TileEntityBrewingStand extends TileEntityContainer implements IWorldInventory {
|
||||
|
||||
private static final int INGREDIENT_SLOT = 3;
|
||||
@@ -42,6 +55,36 @@
|
||||
@@ -41,6 +54,36 @@
|
||||
private Item ingredient;
|
||||
public int fuel;
|
||||
protected final IContainerProperties dataAccess;
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
public TileEntityBrewingStand(BlockPosition blockposition, IBlockData iblockdata) {
|
||||
super(TileEntityTypes.BREWING_STAND, blockposition, iblockdata);
|
||||
@@ -109,8 +152,19 @@
|
||||
@@ -108,8 +151,19 @@
|
||||
ItemStack itemstack = (ItemStack) tileentitybrewingstand.items.get(4);
|
||||
|
||||
if (tileentitybrewingstand.fuel <= 0 && itemstack.is(Items.BLAZE_POWDER)) {
|
||||
@@ -79,7 +79,7 @@
|
||||
setChanged(world, blockposition, iblockdata);
|
||||
}
|
||||
|
||||
@@ -118,12 +172,17 @@
|
||||
@@ -117,12 +171,17 @@
|
||||
boolean flag1 = tileentitybrewingstand.brewTime > 0;
|
||||
ItemStack itemstack1 = (ItemStack) tileentitybrewingstand.items.get(3);
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
setChanged(world, blockposition, iblockdata);
|
||||
} else if (!flag || !itemstack1.is(tileentitybrewingstand.ingredient)) {
|
||||
tileentitybrewingstand.brewTime = 0;
|
||||
@@ -187,11 +246,33 @@
|
||||
@@ -186,11 +245,33 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityCampfire.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityCampfire.java
|
||||
@@ -20,6 +20,12 @@
|
||||
import net.minecraft.world.level.block.BlockCampfire;
|
||||
@@ -25,6 +25,12 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.level.gameevent.GameEvent;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.block.CraftBlock;
|
||||
@@ -13,7 +13,7 @@
|
||||
public class TileEntityCampfire extends TileEntity implements Clearable {
|
||||
|
||||
private static final int BURN_COOL_SPEED = 2;
|
||||
@@ -51,6 +57,20 @@
|
||||
@@ -58,6 +64,20 @@
|
||||
return recipecampfire.assemble(inventorysubcontainer);
|
||||
}).orElse(itemstack);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityChest.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityChest.java
|
||||
@@ -24,6 +24,12 @@
|
||||
@@ -23,6 +23,12 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.level.block.state.properties.BlockPropertyChestType;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
public class TileEntityChest extends TileEntityLootable implements LidBlockEntity {
|
||||
|
||||
private static final int EVENT_SET_OPEN_COUNT = 1;
|
||||
@@ -31,6 +37,36 @@
|
||||
@@ -30,6 +36,36 @@
|
||||
public final ContainerOpenersCounter openersCounter;
|
||||
private final ChestLidController chestLidController;
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
protected TileEntityChest(TileEntityTypes<?> tileentitytypes, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
super(tileentitytypes, blockposition, iblockdata);
|
||||
this.items = NonNullList.withSize(27, ItemStack.EMPTY);
|
||||
@@ -199,4 +235,11 @@
|
||||
@@ -198,4 +234,11 @@
|
||||
|
||||
world.blockEvent(blockposition, block, 1, j);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityContainer.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityContainer.java
|
||||
@@ -89,4 +89,12 @@
|
||||
@@ -88,4 +88,12 @@
|
||||
}
|
||||
|
||||
protected abstract Container createMenu(int i, PlayerInventory playerinventory);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityDispenser.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityDispenser.java
|
||||
@@ -14,12 +14,48 @@
|
||||
@@ -13,11 +13,47 @@
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
+
|
||||
public class TileEntityDispenser extends TileEntityLootable {
|
||||
|
||||
private static final Random RANDOM = new Random();
|
||||
public static final int CONTAINER_SIZE = 9;
|
||||
private NonNullList<ItemStack> items;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityFurnace.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityFurnace.java
|
||||
@@ -45,6 +45,20 @@
|
||||
@@ -46,6 +46,20 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -21,7 +21,16 @@
|
||||
public abstract class TileEntityFurnace extends TileEntityContainer implements IWorldInventory, RecipeHolder, AutoRecipeOutput {
|
||||
|
||||
protected static final int SLOT_INPUT = 0;
|
||||
@@ -184,6 +198,40 @@
|
||||
@@ -114,7 +128,7 @@
|
||||
}
|
||||
};
|
||||
this.recipesUsed = new Object2IntOpenHashMap();
|
||||
- this.quickCheck = CraftingManager.createCheck(recipes);
|
||||
+ this.quickCheck = CraftingManager.createCheck((Recipes<RecipeCooking>) recipes); // CraftBukkit - decompile error // Eclipse fail
|
||||
}
|
||||
|
||||
public static Map<Item, Integer> getFuel() {
|
||||
@@ -188,6 +202,40 @@
|
||||
return map;
|
||||
}
|
||||
|
||||
@@ -62,12 +71,16 @@
|
||||
private static boolean isNeverAFurnaceFuel(Item item) {
|
||||
return item.builtInRegistryHolder().is(TagsItem.NON_FLAMMABLE_WOOD);
|
||||
}
|
||||
@@ -267,13 +315,24 @@
|
||||
tileentityfurnace.cookingProgress = MathHelper.clamp(tileentityfurnace.cookingProgress - 2, (int) 0, tileentityfurnace.cookingTotalTime);
|
||||
@@ -276,7 +324,7 @@
|
||||
IRecipe irecipe;
|
||||
|
||||
if (flag2) {
|
||||
- irecipe = (IRecipe) tileentityfurnace.quickCheck.getRecipeFor(tileentityfurnace, world).orElse((Object) null);
|
||||
+ irecipe = (IRecipe) tileentityfurnace.quickCheck.getRecipeFor(tileentityfurnace, world).orElse(null); // CraftBukkit - decompile error
|
||||
} else {
|
||||
irecipe = null;
|
||||
}
|
||||
} else {
|
||||
- IRecipe<?> irecipe = (IRecipe) world.getRecipeManager().getRecipeFor(tileentityfurnace.recipeType, tileentityfurnace, world).orElse((Object) null);
|
||||
+ IRecipe<?> irecipe = (IRecipe) world.getRecipeManager().getRecipeFor((Recipes<RecipeCooking>) tileentityfurnace.recipeType, tileentityfurnace, world).orElse(null); // CraftBukkit - decompile error // Eclipse fail
|
||||
@@ -284,9 +332,20 @@
|
||||
int i = tileentityfurnace.getMaxStackSize();
|
||||
|
||||
if (!tileentityfurnace.isLit() && canBurn(irecipe, tileentityfurnace.items, i)) {
|
||||
@@ -88,9 +101,9 @@
|
||||
+ if (tileentityfurnace.isLit() && furnaceBurnEvent.isBurning()) {
|
||||
+ // CraftBukkit end
|
||||
flag1 = true;
|
||||
if (!itemstack.isEmpty()) {
|
||||
if (flag3) {
|
||||
Item item = itemstack.getItem();
|
||||
@@ -289,11 +348,23 @@
|
||||
@@ -302,11 +361,23 @@
|
||||
}
|
||||
|
||||
if (tileentityfurnace.isLit() && canBurn(irecipe, tileentityfurnace.items, i)) {
|
||||
@@ -109,13 +122,13 @@
|
||||
++tileentityfurnace.cookingProgress;
|
||||
if (tileentityfurnace.cookingProgress == tileentityfurnace.cookingTotalTime) {
|
||||
tileentityfurnace.cookingProgress = 0;
|
||||
tileentityfurnace.cookingTotalTime = getTotalCookTime(world, tileentityfurnace.recipeType, tileentityfurnace);
|
||||
tileentityfurnace.cookingTotalTime = getTotalCookTime(world, tileentityfurnace);
|
||||
- if (burn(irecipe, tileentityfurnace.items, i)) {
|
||||
+ if (burn(tileentityfurnace.level, tileentityfurnace.worldPosition, irecipe, tileentityfurnace.items, i)) { // CraftBukkit
|
||||
tileentityfurnace.setRecipeUsed(irecipe);
|
||||
}
|
||||
|
||||
@@ -332,17 +403,44 @@
|
||||
@@ -345,17 +416,44 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,16 +174,16 @@
|
||||
|
||||
if (itemstack.is(Blocks.WET_SPONGE.asItem()) && !((ItemStack) nonnulllist.get(1)).isEmpty() && ((ItemStack) nonnulllist.get(1)).is(Items.BUCKET)) {
|
||||
nonnulllist.set(1, new ItemStack(Items.WATER_BUCKET));
|
||||
@@ -366,7 +464,7 @@
|
||||
@@ -379,7 +477,7 @@
|
||||
}
|
||||
|
||||
private static int getTotalCookTime(World world, Recipes<? extends RecipeCooking> recipes, IInventory iinventory) {
|
||||
- return (Integer) world.getRecipeManager().getRecipeFor(recipes, iinventory, world).map(RecipeCooking::getCookingTime).orElse(200);
|
||||
+ return (world != null) ? (Integer) world.getRecipeManager().getRecipeFor((Recipes<RecipeCooking>) recipes, iinventory, world).map(RecipeCooking::getCookingTime).orElse(200) : 200; // CraftBukkit - SPIGOT-4302 // Eclipse fail
|
||||
private static int getTotalCookTime(World world, TileEntityFurnace tileentityfurnace) {
|
||||
- return (Integer) tileentityfurnace.quickCheck.getRecipeFor(tileentityfurnace, world).map(RecipeCooking::getCookingTime).orElse(200);
|
||||
+ return (world != null) ? (Integer) tileentityfurnace.quickCheck.getRecipeFor(tileentityfurnace, world).map(RecipeCooking::getCookingTime).orElse(200) : 200; // CraftBukkit - SPIGOT-4302
|
||||
}
|
||||
|
||||
public static boolean isFuel(ItemStack itemstack) {
|
||||
@@ -485,14 +583,20 @@
|
||||
@@ -498,14 +596,20 @@
|
||||
@Override
|
||||
public void awardUsedRecipes(EntityHuman entityhuman) {}
|
||||
|
||||
@@ -193,7 +206,7 @@
|
||||
List<IRecipe<?>> list = Lists.newArrayList();
|
||||
ObjectIterator objectiterator = this.recipesUsed.object2IntEntrySet().iterator();
|
||||
|
||||
@@ -501,14 +605,14 @@
|
||||
@@ -514,14 +618,14 @@
|
||||
|
||||
worldserver.getRecipeManager().byKey((MinecraftKey) entry.getKey()).ifPresent((irecipe) -> {
|
||||
list.add(irecipe);
|
||||
@@ -210,7 +223,7 @@
|
||||
int j = MathHelper.floor((float) i * f);
|
||||
float f1 = MathHelper.frac((float) i * f);
|
||||
|
||||
@@ -516,6 +620,17 @@
|
||||
@@ -529,6 +633,17 @@
|
||||
++j;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityHopper.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityHopper.java
|
||||
@@ -33,6 +33,18 @@
|
||||
@@ -32,6 +32,18 @@
|
||||
import net.minecraft.world.phys.shapes.OperatorBoolean;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapes;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
public class TileEntityHopper extends TileEntityLootable implements IHopper {
|
||||
|
||||
public static final int MOVE_ITEM_SPEED = 8;
|
||||
@@ -41,6 +53,36 @@
|
||||
@@ -40,6 +52,36 @@
|
||||
private int cooldownTime;
|
||||
private long tickedGameTime;
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
public TileEntityHopper(BlockPosition blockposition, IBlockData iblockdata) {
|
||||
super(TileEntityTypes.HOPPER, blockposition, iblockdata);
|
||||
this.items = NonNullList.withSize(5, ItemStack.EMPTY);
|
||||
@@ -114,7 +156,7 @@
|
||||
@@ -113,7 +155,7 @@
|
||||
boolean flag = false;
|
||||
|
||||
if (!tileentityhopper.isEmpty()) {
|
||||
@@ -65,7 +65,7 @@
|
||||
}
|
||||
|
||||
if (!tileentityhopper.inventoryFull()) {
|
||||
@@ -148,7 +190,7 @@
|
||||
@@ -147,7 +189,7 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
IInventory iinventory1 = getAttachedContainer(world, blockposition, iblockdata);
|
||||
|
||||
if (iinventory1 == null) {
|
||||
@@ -162,7 +204,28 @@
|
||||
@@ -161,7 +203,28 @@
|
||||
for (int i = 0; i < iinventory.getContainerSize(); ++i) {
|
||||
if (!iinventory.getItem(i).isEmpty()) {
|
||||
ItemStack itemstack = iinventory.getItem(i).copy();
|
||||
@@ -104,7 +104,7 @@
|
||||
|
||||
if (itemstack1.isEmpty()) {
|
||||
iinventory1.setChanged();
|
||||
@@ -227,7 +290,34 @@
|
||||
@@ -226,7 +289,34 @@
|
||||
|
||||
if (!itemstack.isEmpty() && canTakeItemFromContainer(iinventory, itemstack, i, enumdirection)) {
|
||||
ItemStack itemstack1 = itemstack.copy();
|
||||
@@ -140,7 +140,7 @@
|
||||
|
||||
if (itemstack2.isEmpty()) {
|
||||
iinventory.setChanged();
|
||||
@@ -242,6 +332,13 @@
|
||||
@@ -241,6 +331,13 @@
|
||||
|
||||
public static boolean addItem(IInventory iinventory, EntityItem entityitem) {
|
||||
boolean flag = false;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityLectern.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityLectern.java
|
||||
@@ -26,13 +26,71 @@
|
||||
@@ -24,13 +24,71 @@
|
||||
import net.minecraft.world.phys.Vec2F;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
@Override
|
||||
public int getContainerSize() {
|
||||
return 1;
|
||||
@@ -77,11 +135,20 @@
|
||||
@@ -75,11 +133,20 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -97,7 +97,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -161,7 +228,7 @@
|
||||
@@ -159,7 +226,7 @@
|
||||
if (j != this.page) {
|
||||
this.page = j;
|
||||
this.setChanged();
|
||||
@@ -106,13 +106,13 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -184,6 +251,32 @@
|
||||
@@ -182,6 +249,32 @@
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ @Override
|
||||
+ public void sendMessage(IChatBaseComponent ichatbasecomponent, UUID uuid) {
|
||||
+ public void sendSystemMessage(IChatBaseComponent ichatbasecomponent) {
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
@@ -139,7 +139,7 @@
|
||||
private CommandListenerWrapper createCommandSourceStack(@Nullable EntityHuman entityhuman) {
|
||||
String s;
|
||||
Object object;
|
||||
@@ -198,7 +291,8 @@
|
||||
@@ -196,7 +289,8 @@
|
||||
|
||||
Vec3D vec3d = Vec3D.atCenterOf(this.worldPosition);
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -236,7 +330,7 @@
|
||||
@@ -234,7 +328,7 @@
|
||||
|
||||
@Override
|
||||
public Container createMenu(int i, PlayerInventory playerinventory, EntityHuman entityhuman) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityShulkerBox.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityShulkerBox.java
|
||||
@@ -32,6 +32,11 @@
|
||||
@@ -31,6 +31,11 @@
|
||||
import net.minecraft.world.phys.AxisAlignedBB;
|
||||
import net.minecraft.world.phys.Vec3D;
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
public class TileEntityShulkerBox extends TileEntityLootable implements IWorldInventory {
|
||||
|
||||
public static final int COLUMNS = 9;
|
||||
@@ -51,6 +56,37 @@
|
||||
@@ -50,6 +55,37 @@
|
||||
@Nullable
|
||||
private final EnumColor color;
|
||||
|
||||
@@ -50,19 +50,19 @@
|
||||
public TileEntityShulkerBox(@Nullable EnumColor enumcolor, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
super(TileEntityTypes.SHULKER_BOX, blockposition, iblockdata);
|
||||
this.itemStacks = NonNullList.withSize(27, ItemStack.EMPTY);
|
||||
@@ -163,6 +199,7 @@
|
||||
@@ -162,6 +198,7 @@
|
||||
}
|
||||
|
||||
++this.openCount;
|
||||
+ if (opened) return; // CraftBukkit - only animate if the ShulkerBox hasn't been forced open already by an API call.
|
||||
this.level.blockEvent(this.worldPosition, this.getBlockState().getBlock(), 1, this.openCount);
|
||||
if (this.openCount == 1) {
|
||||
this.level.gameEvent(entityhuman, GameEvent.CONTAINER_OPEN, this.worldPosition);
|
||||
@@ -176,6 +213,7 @@
|
||||
this.level.gameEvent((Entity) entityhuman, GameEvent.CONTAINER_OPEN, this.worldPosition);
|
||||
@@ -175,6 +212,7 @@
|
||||
public void stopOpen(EntityHuman entityhuman) {
|
||||
if (!entityhuman.isSpectator()) {
|
||||
--this.openCount;
|
||||
+ if (opened) return; // CraftBukkit - only animate if the ShulkerBox hasn't been forced open already by an API call.
|
||||
this.level.blockEvent(this.worldPosition, this.getBlockState().getBlock(), 1, this.openCount);
|
||||
if (this.openCount <= 0) {
|
||||
this.level.gameEvent(entityhuman, GameEvent.CONTAINER_CLOSE, this.worldPosition);
|
||||
this.level.gameEvent((Entity) entityhuman, GameEvent.CONTAINER_CLOSE, this.worldPosition);
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
}
|
||||
+ // CraftBukkit start
|
||||
+ } catch (com.google.gson.JsonParseException jsonparseexception) {
|
||||
+ return new ChatComponentText(s);
|
||||
+ return IChatBaseComponent.empty();
|
||||
+ // CraftBukkit end
|
||||
} catch (Exception exception) {
|
||||
;
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ @Override
|
||||
+ public void sendMessage(IChatBaseComponent ichatbasecomponent, java.util.UUID uuid) {}
|
||||
+ public void sendSystemMessage(IChatBaseComponent ichatbasecomponent) {}
|
||||
+
|
||||
+ @Override
|
||||
+ public org.bukkit.command.CommandSender getBukkitSender(CommandListenerWrapper wrapper) {
|
||||
@@ -89,7 +89,7 @@
|
||||
+
|
||||
public CommandListenerWrapper createCommandSourceStack(@Nullable EntityPlayer entityplayer) {
|
||||
String s = entityplayer == null ? "Sign" : entityplayer.getName().getString();
|
||||
Object object = entityplayer == null ? new ChatComponentText("Sign") : entityplayer.getDisplayName();
|
||||
Object object = entityplayer == null ? IChatBaseComponent.literal("Sign") : entityplayer.getDisplayName();
|
||||
|
||||
- return new CommandListenerWrapper(ICommandListener.NULL, Vec3D.atCenterOf(this.worldPosition), Vec2F.ZERO, (WorldServer) this.level, 2, s, (IChatBaseComponent) object, this.level.getServer(), entityplayer);
|
||||
+ // CraftBukkit - this
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/grower/WorldGenTreeProvider.java
|
||||
+++ b/net/minecraft/world/level/block/grower/WorldGenTreeProvider.java
|
||||
@@ -13,6 +13,12 @@
|
||||
@@ -12,6 +12,12 @@
|
||||
import net.minecraft.world.level.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.level.levelgen.feature.WorldGenFeatureConfigured;
|
||||
|
||||
@@ -13,15 +13,15 @@
|
||||
public abstract class WorldGenTreeProvider {
|
||||
|
||||
public WorldGenTreeProvider() {}
|
||||
@@ -26,6 +32,7 @@
|
||||
@@ -25,6 +31,7 @@
|
||||
if (holder == null) {
|
||||
return false;
|
||||
} else {
|
||||
+ setTreeType(holder); // CraftBukkit
|
||||
WorldGenFeatureConfigured<?, ?> worldgenfeatureconfigured = (WorldGenFeatureConfigured) holder.value();
|
||||
IBlockData iblockdata1 = worldserver.getFluidState(blockposition).createLegacyBlock();
|
||||
|
||||
worldserver.setBlock(blockposition, Blocks.AIR.defaultBlockState(), 4);
|
||||
@@ -53,4 +60,48 @@
|
||||
@@ -57,4 +64,52 @@
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -64,6 +64,10 @@
|
||||
+ BlockSapling.treeType = TreeType.JUNGLE;
|
||||
+ } else if (worldgentreeabstract == TreeFeatures.AZALEA_TREE) {
|
||||
+ BlockSapling.treeType = TreeType.AZALEA;
|
||||
+ } else if (worldgentreeabstract == TreeFeatures.MANGROVE) {
|
||||
+ BlockSapling.treeType = TreeType.MANGROVE;
|
||||
+ } else if (worldgentreeabstract == TreeFeatures.TALL_MANGROVE) {
|
||||
+ BlockSapling.treeType = TreeType.TALL_MANGROVE;
|
||||
+ } else {
|
||||
+ throw new IllegalArgumentException("Unknown tree generator " + worldgentreeabstract);
|
||||
+ }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/piston/BlockPiston.java
|
||||
+++ b/net/minecraft/world/level/block/piston/BlockPiston.java
|
||||
@@ -37,6 +37,14 @@
|
||||
@@ -38,6 +38,14 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapes;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
public class BlockPiston extends BlockDirectional {
|
||||
|
||||
public static final BlockStateBoolean EXTENDED = BlockProperties.EXTENDED;
|
||||
@@ -137,6 +145,18 @@
|
||||
@@ -138,6 +146,18 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
world.blockEvent(blockposition, this, b0, enumdirection.get3DDataValue());
|
||||
}
|
||||
|
||||
@@ -315,6 +335,48 @@
|
||||
@@ -316,6 +336,48 @@
|
||||
IBlockData[] aiblockdata = new IBlockData[list.size() + list2.size()];
|
||||
EnumDirection enumdirection1 = flag ? enumdirection : enumdirection.getOpposite();
|
||||
int j = 0;
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
--- a/net/minecraft/world/level/block/state/properties/BlockStateInteger.java
|
||||
+++ b/net/minecraft/world/level/block/state/properties/BlockStateInteger.java
|
||||
@@ -9,9 +9,15 @@
|
||||
public class BlockStateInteger extends IBlockState<Integer> {
|
||||
|
||||
private final ImmutableSet<Integer> values;
|
||||
+ // CraftBukkit start
|
||||
+ public final int min;
|
||||
+ public final int max;
|
||||
|
||||
protected BlockStateInteger(String s, int i, int j) {
|
||||
super(s, Integer.class);
|
||||
+ this.min = i;
|
||||
+ this.max = j;
|
||||
+ // CraftBukkit end
|
||||
if (i < 0) {
|
||||
throw new IllegalArgumentException("Min value of " + s + " must be 0 or greater");
|
||||
} else if (j <= i) {
|
||||
Reference in New Issue
Block a user