@@ -1,15 +1,15 @@
|
||||
--- a/net/minecraft/world/level/block/BlockBeehive.java
|
||||
+++ b/net/minecraft/world/level/block/BlockBeehive.java
|
||||
@@ -105,7 +105,7 @@
|
||||
EntityBee entitybee = (EntityBee) iterator.next();
|
||||
|
||||
@@ -112,7 +112,7 @@
|
||||
if (entitybee.getTarget() == null) {
|
||||
- entitybee.setTarget((EntityLiving) list1.get(world.random.nextInt(i)));
|
||||
+ entitybee.setTarget((EntityLiving) list1.get(world.random.nextInt(i)), org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER, true); // CraftBukkit
|
||||
EntityHuman entityhuman = (EntityHuman) SystemUtils.getRandom(list1, world.random);
|
||||
|
||||
- entitybee.setTarget(entityhuman);
|
||||
+ entitybee.setTarget(entityhuman, org.bukkit.event.entity.EntityTargetEvent.TargetReason.CLOSEST_PLAYER, true); // CraftBukkit
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -331,4 +331,16 @@
|
||||
@@ -338,4 +338,16 @@
|
||||
|
||||
return super.updateShape(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockCampfire.java
|
||||
+++ b/net/minecraft/world/level/block/BlockCampfire.java
|
||||
@@ -46,6 +46,10 @@
|
||||
@@ -47,6 +47,10 @@
|
||||
import net.minecraft.world.phys.shapes.VoxelShapeCollision;
|
||||
import net.minecraft.world.phys.shapes.VoxelShapes;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
public class BlockCampfire extends BlockTileEntity implements IBlockWaterlogged {
|
||||
|
||||
protected static final VoxelShape SHAPE = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 7.0D, 16.0D);
|
||||
@@ -90,7 +94,9 @@
|
||||
@@ -91,7 +95,9 @@
|
||||
@Override
|
||||
public void entityInside(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
||||
if ((Boolean) iblockdata.getValue(BlockCampfire.LIT) && entity instanceof EntityLiving && !EnchantmentManager.hasFrostWalker((EntityLiving) entity)) {
|
||||
@@ -21,7 +21,7 @@
|
||||
}
|
||||
|
||||
super.entityInside(iblockdata, world, blockposition, entity);
|
||||
@@ -200,6 +206,11 @@
|
||||
@@ -201,6 +207,11 @@
|
||||
BlockPosition blockposition = movingobjectpositionblock.getBlockPos();
|
||||
|
||||
if (!world.isClientSide && iprojectile.isOnFire() && iprojectile.mayInteract(world, blockposition) && !(Boolean) iblockdata.getValue(BlockCampfire.LIT) && !(Boolean) iblockdata.getValue(BlockCampfire.WATERLOGGED)) {
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
--- a/net/minecraft/world/level/block/BlockChorusFlower.java
|
||||
+++ b/net/minecraft/world/level/block/BlockChorusFlower.java
|
||||
@@ -18,6 +18,8 @@
|
||||
import net.minecraft.world.level.block.state.properties.BlockStateInteger;
|
||||
@@ -20,6 +20,8 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
+import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
||||
+
|
||||
public class BlockChorusFlower extends Block {
|
||||
|
||||
public static final int DEAD_AGE = 5;
|
||||
@@ -82,8 +84,12 @@
|
||||
@@ -90,8 +92,12 @@
|
||||
}
|
||||
|
||||
if (flag && allNeighborsEmpty(worldserver, blockposition1, (EnumDirection) null) && worldserver.isEmptyBlock(blockposition.above(2))) {
|
||||
@@ -24,7 +24,7 @@
|
||||
} else if (i < 4) {
|
||||
j = randomsource.nextInt(4);
|
||||
if (flag1) {
|
||||
@@ -97,18 +103,30 @@
|
||||
@@ -105,18 +111,30 @@
|
||||
BlockPosition blockposition2 = blockposition.relative(enumdirection);
|
||||
|
||||
if (worldserver.isEmptyBlock(blockposition2) && worldserver.isEmptyBlock(blockposition2.below()) && allNeighborsEmpty(worldserver, blockposition2, enumdirection.getOpposite())) {
|
||||
@@ -59,7 +59,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -245,6 +263,11 @@
|
||||
@@ -253,6 +271,11 @@
|
||||
BlockPosition blockposition = movingobjectpositionblock.getBlockPos();
|
||||
|
||||
if (!world.isClientSide && iprojectile.mayInteract(world, blockposition) && iprojectile.getType().is(TagsEntity.IMPACT_PROJECTILES)) {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
}
|
||||
|
||||
protected int getBonemealAgeIncrease(World world) {
|
||||
@@ -149,7 +151,7 @@
|
||||
@@ -153,7 +155,7 @@
|
||||
|
||||
@Override
|
||||
public void entityInside(IBlockData iblockdata, World world, BlockPosition blockposition, Entity entity) {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
public abstract class BlockDiodeAbstract extends BlockFacingHorizontal {
|
||||
|
||||
protected static final VoxelShape SHAPE = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 2.0D, 16.0D);
|
||||
@@ -46,8 +48,18 @@
|
||||
@@ -52,8 +54,18 @@
|
||||
boolean flag1 = this.shouldTurnOn(worldserver, blockposition, iblockdata);
|
||||
|
||||
if (flag && !flag1) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockDispenser.java
|
||||
+++ b/net/minecraft/world/level/block/BlockDispenser.java
|
||||
@@ -46,6 +46,7 @@
|
||||
@@ -48,6 +48,7 @@
|
||||
object2objectopenhashmap.defaultReturnValue(new DispenseBehaviorItem());
|
||||
});
|
||||
private static final int TRIGGER_DURATION = 4;
|
||||
@@ -8,11 +8,20 @@
|
||||
|
||||
public static void registerBehavior(IMaterial imaterial, IDispenseBehavior idispensebehavior) {
|
||||
BlockDispenser.DISPENSER_REGISTRY.put(imaterial.asItem(), idispensebehavior);
|
||||
@@ -89,6 +90,7 @@
|
||||
IDispenseBehavior idispensebehavior = this.getDispenseMethod(itemstack);
|
||||
@@ -79,7 +80,7 @@
|
||||
}
|
||||
|
||||
if (idispensebehavior != IDispenseBehavior.NOOP) {
|
||||
+ eventFired = false; // CraftBukkit - reset event status
|
||||
tileentitydispenser.setItem(i, idispensebehavior.dispense(sourceblock, itemstack));
|
||||
}
|
||||
public void dispenseFrom(WorldServer worldserver, IBlockData iblockdata, BlockPosition blockposition) {
|
||||
- TileEntityDispenser tileentitydispenser = (TileEntityDispenser) worldserver.getBlockEntity(blockposition, TileEntityTypes.DISPENSER).orElse((Object) null);
|
||||
+ TileEntityDispenser tileentitydispenser = (TileEntityDispenser) worldserver.getBlockEntity(blockposition, TileEntityTypes.DISPENSER).orElse(null); // CraftBukkit - decompile error
|
||||
|
||||
if (tileentitydispenser == null) {
|
||||
BlockDispenser.LOGGER.warn("Ignoring dispensing attempt for Dispenser without matching block entity at {}", blockposition);
|
||||
@@ -95,6 +96,7 @@
|
||||
IDispenseBehavior idispensebehavior = this.getDispenseMethod(itemstack);
|
||||
|
||||
if (idispensebehavior != IDispenseBehavior.NOOP) {
|
||||
+ eventFired = false; // CraftBukkit - reset event status
|
||||
tileentitydispenser.setItem(i, idispensebehavior.dispense(sourceblock, itemstack));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
--- a/net/minecraft/world/level/block/BlockDropper.java
|
||||
+++ b/net/minecraft/world/level/block/BlockDropper.java
|
||||
@@ -15,9 +15,15 @@
|
||||
import net.minecraft.world.level.block.state.BlockBase;
|
||||
@@ -18,10 +18,16 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.world.InventoryLargeChest;
|
||||
@@ -12,36 +12,46 @@
|
||||
+
|
||||
public class BlockDropper extends BlockDispenser {
|
||||
|
||||
private static final Logger LOGGER = LogUtils.getLogger();
|
||||
- private static final IDispenseBehavior DISPENSE_BEHAVIOUR = new DispenseBehaviorItem();
|
||||
+ private static final IDispenseBehavior DISPENSE_BEHAVIOUR = new DispenseBehaviorItem(true); // CraftBukkit
|
||||
|
||||
public BlockDropper(BlockBase.Info blockbase_info) {
|
||||
super(blockbase_info);
|
||||
@@ -52,8 +58,25 @@
|
||||
if (iinventory == null) {
|
||||
itemstack1 = BlockDropper.DISPENSE_BEHAVIOUR.dispense(sourceblock, itemstack);
|
||||
} else {
|
||||
- itemstack1 = TileEntityHopper.addItem(tileentitydispenser, iinventory, itemstack.copy().split(1), enumdirection.getOpposite());
|
||||
- if (itemstack1.isEmpty()) {
|
||||
+ // CraftBukkit start - Fire event when pushing items into other inventories
|
||||
+ CraftItemStack oitemstack = CraftItemStack.asCraftMirror(itemstack.copy().split(1));
|
||||
+
|
||||
+ org.bukkit.inventory.Inventory destinationInventory;
|
||||
+ // Have to special case large chests as they work oddly
|
||||
+ if (iinventory instanceof InventoryLargeChest) {
|
||||
+ destinationInventory = new org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest((InventoryLargeChest) iinventory);
|
||||
+ } else {
|
||||
+ destinationInventory = iinventory.getOwner().getInventory();
|
||||
+ }
|
||||
+
|
||||
+ InventoryMoveItemEvent event = new InventoryMoveItemEvent(tileentitydispenser.getOwner().getInventory(), oitemstack.clone(), destinationInventory, true);
|
||||
+ worldserver.getCraftServer().getPluginManager().callEvent(event);
|
||||
+ if (event.isCancelled()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ itemstack1 = TileEntityHopper.addItem(tileentitydispenser, iinventory, CraftItemStack.asNMSCopy(event.getItem()), enumdirection.getOpposite());
|
||||
+ if (event.getItem().equals(oitemstack) && itemstack1.isEmpty()) {
|
||||
+ // CraftBukkit end
|
||||
itemstack1 = itemstack.copy();
|
||||
itemstack1.shrink(1);
|
||||
@@ -39,7 +45,7 @@
|
||||
|
||||
@Override
|
||||
public void dispenseFrom(WorldServer worldserver, IBlockData iblockdata, BlockPosition blockposition) {
|
||||
- TileEntityDispenser tileentitydispenser = (TileEntityDispenser) worldserver.getBlockEntity(blockposition, TileEntityTypes.DROPPER).orElse((Object) null);
|
||||
+ TileEntityDispenser tileentitydispenser = (TileEntityDispenser) worldserver.getBlockEntity(blockposition, TileEntityTypes.DROPPER).orElse(null); // CraftBukkit - decompile error
|
||||
|
||||
if (tileentitydispenser == null) {
|
||||
BlockDropper.LOGGER.warn("Ignoring dispensing attempt for Dropper without matching block entity at {}", blockposition);
|
||||
@@ -60,8 +66,25 @@
|
||||
if (iinventory == null) {
|
||||
itemstack1 = BlockDropper.DISPENSE_BEHAVIOUR.dispense(sourceblock, itemstack);
|
||||
} else {
|
||||
- itemstack1 = TileEntityHopper.addItem(tileentitydispenser, iinventory, itemstack.copy().split(1), enumdirection.getOpposite());
|
||||
- if (itemstack1.isEmpty()) {
|
||||
+ // CraftBukkit start - Fire event when pushing items into other inventories
|
||||
+ CraftItemStack oitemstack = CraftItemStack.asCraftMirror(itemstack.copy().split(1));
|
||||
+
|
||||
+ org.bukkit.inventory.Inventory destinationInventory;
|
||||
+ // Have to special case large chests as they work oddly
|
||||
+ if (iinventory instanceof InventoryLargeChest) {
|
||||
+ destinationInventory = new org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest((InventoryLargeChest) iinventory);
|
||||
+ } else {
|
||||
+ destinationInventory = iinventory.getOwner().getInventory();
|
||||
+ }
|
||||
+
|
||||
+ InventoryMoveItemEvent event = new InventoryMoveItemEvent(tileentitydispenser.getOwner().getInventory(), oitemstack.clone(), destinationInventory, true);
|
||||
+ worldserver.getCraftServer().getPluginManager().callEvent(event);
|
||||
+ if (event.isCancelled()) {
|
||||
+ return;
|
||||
+ }
|
||||
+ itemstack1 = TileEntityHopper.addItem(tileentitydispenser, iinventory, CraftItemStack.asNMSCopy(event.getItem()), enumdirection.getOpposite());
|
||||
+ if (event.getItem().equals(oitemstack) && itemstack1.isEmpty()) {
|
||||
+ // CraftBukkit end
|
||||
itemstack1 = itemstack.copy();
|
||||
itemstack1.shrink(1);
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockFluids.java
|
||||
+++ b/net/minecraft/world/level/block/BlockFluids.java
|
||||
@@ -140,14 +140,20 @@
|
||||
@@ -142,14 +142,20 @@
|
||||
if (world.getFluidState(blockposition1).is(TagsFluid.WATER)) {
|
||||
Block block = world.getFluidState(blockposition).isSource() ? Blocks.OBSIDIAN : Blocks.COBBLESTONE;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockRedstoneComparator.java
|
||||
+++ b/net/minecraft/world/level/block/BlockRedstoneComparator.java
|
||||
@@ -26,6 +26,8 @@
|
||||
@@ -27,6 +27,8 @@
|
||||
import net.minecraft.world.phys.MovingObjectPositionBlock;
|
||||
import net.minecraft.world.ticks.TickListPriority;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
public class BlockRedstoneComparator extends BlockDiodeAbstract implements ITileEntity {
|
||||
|
||||
public static final BlockStateEnum<BlockPropertyComparatorMode> MODE = BlockProperties.MODE_COMPARATOR;
|
||||
@@ -97,7 +99,8 @@
|
||||
@@ -103,7 +105,8 @@
|
||||
|
||||
@Nullable
|
||||
private EntityItemFrame getItemFrame(World world, EnumDirection enumdirection, BlockPosition blockposition) {
|
||||
@@ -19,7 +19,7 @@
|
||||
return entityitemframe != null && entityitemframe.getDirection() == enumdirection;
|
||||
});
|
||||
|
||||
@@ -152,8 +155,18 @@
|
||||
@@ -158,8 +161,18 @@
|
||||
boolean flag1 = (Boolean) iblockdata.getValue(BlockRedstoneComparator.POWERED);
|
||||
|
||||
if (flag1 && !flag) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockRedstoneTorch.java
|
||||
+++ b/net/minecraft/world/level/block/BlockRedstoneTorch.java
|
||||
@@ -17,6 +17,8 @@
|
||||
@@ -18,6 +18,8 @@
|
||||
import net.minecraft.world.level.block.state.properties.BlockProperties;
|
||||
import net.minecraft.world.level.block.state.properties.BlockStateBoolean;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
public class BlockRedstoneTorch extends BlockTorch {
|
||||
|
||||
public static final BlockStateBoolean LIT = BlockProperties.LIT;
|
||||
@@ -77,8 +79,24 @@
|
||||
@@ -78,8 +80,24 @@
|
||||
list.remove(0);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
worldserver.setBlock(blockposition, (IBlockData) iblockdata.setValue(BlockRedstoneTorch.LIT, false), 3);
|
||||
if (isToggledTooFrequently(worldserver, blockposition, true)) {
|
||||
worldserver.levelEvent(1502, blockposition, 0);
|
||||
@@ -86,6 +104,15 @@
|
||||
@@ -87,6 +105,15 @@
|
||||
}
|
||||
}
|
||||
} else if (!flag && !isToggledTooFrequently(worldserver, blockposition, false)) {
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
} else if (!this.otherPlayerIsEditingSign(entityhuman, tileentitysign) && entityhuman.mayBuild() && this.hasEditableText(entityhuman, tileentitysign, flag1)) {
|
||||
- this.openTextEdit(entityhuman, tileentitysign, flag1);
|
||||
+ this.openTextEdit(entityhuman, tileentitysign, flag1, org.bukkit.event.player.PlayerSignOpenEvent.Cause.INTERACT); // CraftBukkit
|
||||
return EnumInteractionResult.SUCCESS;
|
||||
return this.getInteractionResult(flag);
|
||||
} else {
|
||||
return EnumInteractionResult.PASS;
|
||||
@@ -164,6 +164,15 @@
|
||||
@@ -168,6 +168,15 @@
|
||||
}
|
||||
|
||||
public void openTextEdit(EntityHuman entityhuman, TileEntitySign tileentitysign, boolean flag) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/BlockSponge.java
|
||||
+++ b/net/minecraft/world/level/block/BlockSponge.java
|
||||
@@ -9,6 +9,13 @@
|
||||
@@ -12,6 +12,13 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.level.material.Fluid;
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
public class BlockSponge extends Block {
|
||||
|
||||
public static final int MAX_DEPTH = 6;
|
||||
@@ -41,7 +48,8 @@
|
||||
@@ -44,7 +51,8 @@
|
||||
}
|
||||
|
||||
private boolean removeWaterBreadthFirstSearch(World world, BlockPosition blockposition) {
|
||||
@@ -24,7 +24,7 @@
|
||||
EnumDirection[] aenumdirection = BlockSponge.ALL_DIRECTIONS;
|
||||
int i = aenumdirection.length;
|
||||
|
||||
@@ -55,8 +63,10 @@
|
||||
@@ -58,8 +66,10 @@
|
||||
if (blockposition1.equals(blockposition)) {
|
||||
return true;
|
||||
} else {
|
||||
@@ -37,12 +37,12 @@
|
||||
|
||||
if (!fluid.is(TagsFluid.WATER)) {
|
||||
return false;
|
||||
@@ -66,27 +76,64 @@
|
||||
@@ -69,27 +79,64 @@
|
||||
if (block instanceof IFluidSource) {
|
||||
IFluidSource ifluidsource = (IFluidSource) block;
|
||||
|
||||
- if (!ifluidsource.pickupBlock(world, blockposition1, iblockdata).isEmpty()) {
|
||||
+ if (!ifluidsource.pickupBlock(blockList, blockposition1, iblockdata).isEmpty()) { // CraftBukkit
|
||||
- if (!ifluidsource.pickupBlock((EntityHuman) null, world, blockposition1, iblockdata).isEmpty()) {
|
||||
+ if (!ifluidsource.pickupBlock((EntityHuman) null, blockList, blockposition1, iblockdata).isEmpty()) { // CraftBukkit
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -89,7 +89,7 @@
|
||||
+ Fluid fluid = world.getFluidState(blockposition1);
|
||||
+
|
||||
+ if (fluid.is(TagsFluid.WATER)) {
|
||||
+ if (iblockdata.getBlock() instanceof IFluidSource && !((IFluidSource) iblockdata.getBlock()).pickupBlock(blockList, blockposition1, iblockdata).isEmpty()) {
|
||||
+ if (iblockdata.getBlock() instanceof IFluidSource && !((IFluidSource) iblockdata.getBlock()).pickupBlock((EntityHuman) null, blockList, blockposition1, iblockdata).isEmpty()) {
|
||||
+ // NOP
|
||||
+ } else if (iblockdata.getBlock() instanceof BlockFluids) {
|
||||
+ // NOP
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
this.decreaseEggs(world, blockposition, iblockdata);
|
||||
}
|
||||
|
||||
@@ -91,9 +110,19 @@
|
||||
@@ -91,10 +110,20 @@
|
||||
int i = (Integer) iblockdata.getValue(BlockTurtleEgg.HATCH);
|
||||
|
||||
if (i < 2) {
|
||||
@@ -45,6 +45,7 @@
|
||||
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
|
||||
worldserver.gameEvent(GameEvent.BLOCK_CHANGE, blockposition, GameEvent.a.of(iblockdata));
|
||||
} else {
|
||||
+ // CraftBukkit start - Call BlockFadeEvent
|
||||
+ if (CraftEventFactory.callBlockFadeEvent(worldserver, blockposition, Blocks.AIR.defaultBlockState()).isCancelled()) {
|
||||
@@ -53,8 +54,8 @@
|
||||
+ // CraftBukkit end
|
||||
worldserver.playSound((EntityHuman) null, blockposition, SoundEffects.TURTLE_EGG_HATCH, SoundCategory.BLOCKS, 0.7F, 0.9F + randomsource.nextFloat() * 0.2F);
|
||||
worldserver.removeBlock(blockposition, false);
|
||||
|
||||
@@ -105,7 +134,7 @@
|
||||
worldserver.gameEvent(GameEvent.BLOCK_DESTROY, blockposition, GameEvent.a.of(iblockdata));
|
||||
@@ -107,7 +136,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);
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
--- a/net/minecraft/world/level/block/ChiseledBookShelfBlock.java
|
||||
+++ b/net/minecraft/world/level/block/ChiseledBookShelfBlock.java
|
||||
@@ -128,7 +128,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
- private static int getHitSlot(Vec2F vec2f) {
|
||||
+ public static int getHitSlot(Vec2F vec2f) { //CraftBukkit - private -> public
|
||||
int i = vec2f.y >= 0.5F ? 0 : 1;
|
||||
int j = getSection(vec2f.x);
|
||||
|
||||
@@ -190,7 +190,7 @@
|
||||
|
||||
Objects.requireNonNull(blockstatelist_a);
|
||||
list.forEach((iblockstate) -> {
|
||||
- blockstatelist_a.add(iblockstate);
|
||||
+ blockstatelist_a.add((BlockStateBoolean) iblockstate); // CraftBukkit - Decompile error
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/PowderSnowBlock.java
|
||||
+++ b/net/minecraft/world/level/block/PowderSnowBlock.java
|
||||
@@ -69,7 +69,12 @@
|
||||
@@ -70,7 +70,12 @@
|
||||
|
||||
entity.setIsInPowderSnow(true);
|
||||
if (!world.isClientSide) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
--- a/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.java
|
||||
+++ b/net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity.java
|
||||
@@ -17,12 +17,54 @@
|
||||
import net.minecraft.world.level.block.state.properties.BlockStateBoolean;
|
||||
@@ -18,12 +18,54 @@
|
||||
import net.minecraft.world.level.gameevent.GameEvent;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
+// CraftBukkit start
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
public ChiseledBookShelfBlockEntity(BlockPosition blockposition, IBlockData iblockdata) {
|
||||
super(TileEntityTypes.CHISELED_BOOKSHELF, blockposition, iblockdata);
|
||||
@@ -50,6 +92,7 @@
|
||||
@@ -52,6 +94,7 @@
|
||||
|
||||
@Override
|
||||
public void load(NBTTagCompound nbttagcompound) {
|
||||
@@ -63,7 +63,7 @@
|
||||
this.items.clear();
|
||||
ContainerUtil.loadAllItems(nbttagcompound, this.items);
|
||||
this.lastInteractedSlot = nbttagcompound.getInt("last_interacted_slot");
|
||||
@@ -91,7 +134,7 @@
|
||||
@@ -93,7 +136,7 @@
|
||||
|
||||
this.items.set(i, ItemStack.EMPTY);
|
||||
if (!itemstack.isEmpty()) {
|
||||
@@ -72,16 +72,16 @@
|
||||
}
|
||||
|
||||
return itemstack;
|
||||
@@ -106,7 +149,7 @@
|
||||
@@ -108,7 +151,7 @@
|
||||
public void setItem(int i, ItemStack itemstack) {
|
||||
if (itemstack.is(TagsItem.BOOKSHELF_BOOKS)) {
|
||||
this.items.set(i, itemstack);
|
||||
- this.updateState(i);
|
||||
+ if (level != null) this.updateState(i); // CraftBukkit - SPIGOT-7381: check for null world
|
||||
} else if (itemstack.isEmpty()) {
|
||||
this.removeItem(i, 1);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -120,7 +163,7 @@
|
||||
@@ -124,7 +167,7 @@
|
||||
|
||||
@Override
|
||||
public int getMaxStackSize() {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@@ -32,14 +32,18 @@
|
||||
public SculkCatalystBlockEntity(BlockPosition blockposition, IBlockData iblockdata) {
|
||||
super(TileEntityTypes.SCULK_CATALYST, blockposition, iblockdata);
|
||||
this.catalystListener = new SculkCatalystBlockEntity.a(iblockdata, new BlockPositionSource(blockposition));
|
||||
this.catalystListener = new SculkCatalystBlockEntity.CatalystListener(iblockdata, new BlockPositionSource(blockposition));
|
||||
+ catalystListener.level = level; // CraftBukkit
|
||||
}
|
||||
|
||||
@@ -25,14 +25,5 @@
|
||||
private final PositionSource positionSource;
|
||||
+ private World level; // CraftBukkit
|
||||
|
||||
public a(IBlockData iblockdata, PositionSource positionsource) {
|
||||
public CatalystListener(IBlockData iblockdata, PositionSource positionsource) {
|
||||
this.blockState = iblockdata;
|
||||
@@ -116,7 +121,7 @@
|
||||
return this.sculkSpreader;
|
||||
}
|
||||
|
||||
- private void bloom(WorldServer worldserver, BlockPosition blockposition, IBlockData iblockdata, RandomSource randomsource) {
|
||||
+ public void bloom(WorldServer worldserver, BlockPosition blockposition, IBlockData iblockdata, RandomSource randomsource) {
|
||||
worldserver.setBlock(blockposition, (IBlockData) iblockdata.setValue(SculkCatalystBlock.PULSE, true), 3);
|
||||
worldserver.scheduleTick(blockposition, iblockdata.getBlock(), 8);
|
||||
worldserver.sendParticles(Particles.SCULK_SOUL, (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 1.15D, (double) blockposition.getZ() + 0.5D, 2, 0.2D, 0.0D, 0.2D, 0.0D);
|
||||
|
||||
@@ -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 @@
|
||||
@@ -40,6 +40,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, INamableTileEntity {
|
||||
|
||||
private static final int MAX_LEVELS = 4;
|
||||
@@ -61,6 +66,15 @@
|
||||
@@ -65,6 +70,15 @@
|
||||
public IChatBaseComponent name;
|
||||
public ChestLock lockKey;
|
||||
private final IContainerProperties dataAccess;
|
||||
@@ -26,9 +26,9 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
||||
public TileEntityBeacon(BlockPosition blockposition, IBlockData iblockdata) {
|
||||
super(TileEntityTypes.BEACON, blockposition, iblockdata);
|
||||
@@ -236,39 +250,78 @@
|
||||
@Nullable
|
||||
static MobEffectList filterEffect(@Nullable MobEffectList mobeffectlist) {
|
||||
@@ -245,39 +259,78 @@
|
||||
super.setRemoved();
|
||||
}
|
||||
|
||||
@@ -117,17 +117,20 @@
|
||||
public static void playSound(World world, BlockPosition blockposition, SoundEffect soundeffect) {
|
||||
world.playSound((EntityHuman) null, blockposition, soundeffect, SoundCategory.BLOCKS, 1.0F, 1.0F);
|
||||
}
|
||||
@@ -297,8 +350,11 @@
|
||||
@Override
|
||||
public void load(NBTTagCompound nbttagcompound) {
|
||||
@@ -312,7 +365,7 @@
|
||||
if (nbttagcompound.contains(s, 8)) {
|
||||
MinecraftKey minecraftkey = MinecraftKey.tryParse(nbttagcompound.getString(s));
|
||||
|
||||
- return filterEffect((MobEffectList) BuiltInRegistries.MOB_EFFECT.get(minecraftkey));
|
||||
+ return (MobEffectList) BuiltInRegistries.MOB_EFFECT.get(minecraftkey); // CraftBukkit - persist manually set non-default beacon effects (SPIGOT-3598)
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
@@ -323,6 +376,7 @@
|
||||
super.load(nbttagcompound);
|
||||
- this.primaryPower = getValidEffectById(nbttagcompound.getInt("Primary"));
|
||||
- this.secondaryPower = getValidEffectById(nbttagcompound.getInt("Secondary"));
|
||||
+ // CraftBukkit start - persist manually set non-default beacon effects (SPIGOT-3598)
|
||||
+ this.primaryPower = MobEffectList.byId(nbttagcompound.getInt("Primary"));
|
||||
+ this.secondaryPower = MobEffectList.byId(nbttagcompound.getInt("Secondary"));
|
||||
+ this.levels = nbttagcompound.getInt("Levels"); // SPIGOT-5053, use where available
|
||||
+ // CraftBukkit end
|
||||
this.primaryPower = loadEffect(nbttagcompound, "primary_effect");
|
||||
this.secondaryPower = loadEffect(nbttagcompound, "secondary_effect");
|
||||
+ this.levels = nbttagcompound.getInt("Levels"); // CraftBukkit - SPIGOT-5053, use where available
|
||||
if (nbttagcompound.contains("CustomName", 8)) {
|
||||
this.name = IChatBaseComponent.ChatSerializer.fromJson(nbttagcompound.getString("CustomName"));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityCampfire.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityCampfire.java
|
||||
@@ -25,6 +25,14 @@
|
||||
@@ -26,6 +26,14 @@
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.level.gameevent.GameEvent;
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
public class TileEntityCampfire extends TileEntity implements Clearable {
|
||||
|
||||
private static final int BURN_COOL_SPEED = 2;
|
||||
@@ -59,6 +67,20 @@
|
||||
@@ -60,6 +68,20 @@
|
||||
}).orElse(itemstack);
|
||||
|
||||
if (itemstack1.isItemEnabled(world.enabledFeatures())) {
|
||||
@@ -36,7 +36,7 @@
|
||||
InventoryUtils.dropItemStack(world, (double) blockposition.getX(), (double) blockposition.getY(), (double) blockposition.getZ(), itemstack1);
|
||||
tileentitycampfire.items.set(i, ItemStack.EMPTY);
|
||||
world.sendBlockUpdated(blockposition, iblockdata, iblockdata, 3);
|
||||
@@ -171,7 +193,11 @@
|
||||
@@ -172,7 +194,11 @@
|
||||
ItemStack itemstack1 = (ItemStack) this.items.get(j);
|
||||
|
||||
if (itemstack1.isEmpty()) {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
+import org.bukkit.inventory.CookingRecipe;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public abstract class TileEntityFurnace extends TileEntityContainer implements IWorldInventory, RecipeHolder, AutoRecipeOutput {
|
||||
public abstract class TileEntityFurnace extends TileEntityContainer implements IWorldInventory, RecipeCraftingHolder, AutoRecipeOutput {
|
||||
|
||||
protected static final int SLOT_INPUT = 0;
|
||||
@@ -115,7 +129,7 @@
|
||||
@@ -72,18 +72,18 @@
|
||||
return item.builtInRegistryHolder().is(TagsItem.NON_FLAMMABLE_WOOD);
|
||||
}
|
||||
@@ -271,7 +319,7 @@
|
||||
IRecipe irecipe;
|
||||
RecipeHolder recipeholder;
|
||||
|
||||
if (flag2) {
|
||||
- irecipe = (IRecipe) tileentityfurnace.quickCheck.getRecipeFor(tileentityfurnace, world).orElse((Object) null);
|
||||
+ irecipe = (IRecipe) tileentityfurnace.quickCheck.getRecipeFor(tileentityfurnace, world).orElse(null); // CraftBukkit - decompile error
|
||||
- recipeholder = (RecipeHolder) tileentityfurnace.quickCheck.getRecipeFor(tileentityfurnace, world).orElse((Object) null);
|
||||
+ recipeholder = (RecipeHolder) tileentityfurnace.quickCheck.getRecipeFor(tileentityfurnace, world).orElse(null); // CraftBukkit - decompile error
|
||||
} else {
|
||||
irecipe = null;
|
||||
recipeholder = null;
|
||||
}
|
||||
@@ -279,9 +327,20 @@
|
||||
int i = tileentityfurnace.getMaxStackSize();
|
||||
|
||||
if (!tileentityfurnace.isLit() && canBurn(world.registryAccess(), irecipe, tileentityfurnace.items, i)) {
|
||||
if (!tileentityfurnace.isLit() && canBurn(world.registryAccess(), recipeholder, tileentityfurnace.items, i)) {
|
||||
- tileentityfurnace.litTime = tileentityfurnace.getBurnDuration(itemstack);
|
||||
+ // CraftBukkit start
|
||||
+ CraftItemStack fuel = CraftItemStack.asCraftMirror(itemstack);
|
||||
@@ -106,11 +106,11 @@
|
||||
@@ -297,11 +356,23 @@
|
||||
}
|
||||
|
||||
if (tileentityfurnace.isLit() && canBurn(world.registryAccess(), irecipe, tileentityfurnace.items, i)) {
|
||||
if (tileentityfurnace.isLit() && canBurn(world.registryAccess(), recipeholder, tileentityfurnace.items, i)) {
|
||||
+ // CraftBukkit start
|
||||
+ if (irecipe != null && tileentityfurnace.cookingProgress == 0) {
|
||||
+ if (recipeholder != null && tileentityfurnace.cookingProgress == 0) {
|
||||
+ CraftItemStack source = CraftItemStack.asCraftMirror(tileentityfurnace.items.get(0));
|
||||
+ CookingRecipe<?> recipe = (CookingRecipe<?>) irecipe.toBukkitRecipe();
|
||||
+ CookingRecipe<?> recipe = (CookingRecipe<?>) recipeholder.toBukkitRecipe();
|
||||
+
|
||||
+ FurnaceStartSmeltEvent event = new FurnaceStartSmeltEvent(CraftBlock.at(world, blockposition), source, recipe);
|
||||
+ world.getCraftServer().getPluginManager().callEvent(event);
|
||||
@@ -123,20 +123,20 @@
|
||||
if (tileentityfurnace.cookingProgress == tileentityfurnace.cookingTotalTime) {
|
||||
tileentityfurnace.cookingProgress = 0;
|
||||
tileentityfurnace.cookingTotalTime = getTotalCookTime(world, tileentityfurnace);
|
||||
- if (burn(world.registryAccess(), irecipe, tileentityfurnace.items, i)) {
|
||||
+ if (burn(tileentityfurnace.level, tileentityfurnace.worldPosition, world.registryAccess(), irecipe, tileentityfurnace.items, i)) { // CraftBukkit
|
||||
tileentityfurnace.setRecipeUsed(irecipe);
|
||||
- if (burn(world.registryAccess(), recipeholder, tileentityfurnace.items, i)) {
|
||||
+ if (burn(tileentityfurnace.level, tileentityfurnace.worldPosition, world.registryAccess(), recipeholder, tileentityfurnace.items, i)) { // CraftBukkit
|
||||
tileentityfurnace.setRecipeUsed(recipeholder);
|
||||
}
|
||||
|
||||
@@ -340,17 +411,44 @@
|
||||
}
|
||||
}
|
||||
|
||||
- private static boolean burn(IRegistryCustom iregistrycustom, @Nullable IRecipe<?> irecipe, NonNullList<ItemStack> nonnulllist, int i) {
|
||||
+ private static boolean burn(World world, BlockPosition blockposition, IRegistryCustom iregistrycustom, @Nullable IRecipe<?> irecipe, NonNullList<ItemStack> nonnulllist, int i) { // CraftBukkit
|
||||
if (irecipe != null && canBurn(iregistrycustom, irecipe, nonnulllist, i)) {
|
||||
- private static boolean burn(IRegistryCustom iregistrycustom, @Nullable RecipeHolder<?> recipeholder, NonNullList<ItemStack> nonnulllist, int i) {
|
||||
+ private static boolean burn(World world, BlockPosition blockposition, IRegistryCustom iregistrycustom, @Nullable RecipeHolder<?> recipeholder, NonNullList<ItemStack> nonnulllist, int i) { // CraftBukkit
|
||||
if (recipeholder != null && canBurn(iregistrycustom, recipeholder, nonnulllist, i)) {
|
||||
ItemStack itemstack = (ItemStack) nonnulllist.get(0);
|
||||
ItemStack itemstack1 = irecipe.getResultItem(iregistrycustom);
|
||||
ItemStack itemstack1 = recipeholder.value().getResultItem(iregistrycustom);
|
||||
ItemStack itemstack2 = (ItemStack) nonnulllist.get(2);
|
||||
|
||||
+ // CraftBukkit start - fire FurnaceSmeltEvent
|
||||
@@ -174,45 +174,44 @@
|
||||
|
||||
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));
|
||||
@@ -374,7 +472,7 @@
|
||||
@@ -374,6 +472,7 @@
|
||||
}
|
||||
|
||||
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) {
|
||||
@@ -493,8 +591,8 @@
|
||||
+ if (world == null) return 200; // CraftBukkit - SPIGOT-4302
|
||||
return (Integer) tileentityfurnace.quickCheck.getRecipeFor(tileentityfurnace, world).map((recipeholder) -> {
|
||||
return ((RecipeCooking) recipeholder.value()).getCookingTime();
|
||||
}).orElse(200);
|
||||
@@ -495,8 +594,8 @@
|
||||
@Override
|
||||
public void awardUsedRecipes(EntityHuman entityhuman, List<ItemStack> list) {}
|
||||
|
||||
- public void awardUsedRecipesAndPopExperience(EntityPlayer entityplayer) {
|
||||
- List<IRecipe<?>> list = this.getRecipesToAwardAndPopExperience(entityplayer.serverLevel(), entityplayer.position());
|
||||
- List<RecipeHolder<?>> list = this.getRecipesToAwardAndPopExperience(entityplayer.serverLevel(), entityplayer.position());
|
||||
+ public void awardUsedRecipesAndPopExperience(EntityPlayer entityplayer, ItemStack itemstack, int amount) { // CraftBukkit
|
||||
+ List<IRecipe<?>> list = this.getRecipesToAwardAndPopExperience(entityplayer.serverLevel(), entityplayer.position(), this.worldPosition, entityplayer, itemstack, amount); // CraftBukkit
|
||||
+ List<RecipeHolder<?>> list = this.getRecipesToAwardAndPopExperience(entityplayer.serverLevel(), entityplayer.position(), this.worldPosition, entityplayer, itemstack, amount); // CraftBukkit
|
||||
|
||||
entityplayer.awardRecipes(list);
|
||||
Iterator iterator = list.iterator();
|
||||
@@ -511,6 +609,12 @@
|
||||
@@ -513,6 +612,12 @@
|
||||
}
|
||||
|
||||
public List<IRecipe<?>> getRecipesToAwardAndPopExperience(WorldServer worldserver, Vec3D vec3d) {
|
||||
public List<RecipeHolder<?>> getRecipesToAwardAndPopExperience(WorldServer worldserver, Vec3D vec3d) {
|
||||
+ // CraftBukkit start
|
||||
+ return this.getRecipesToAwardAndPopExperience(worldserver, vec3d, this.worldPosition, null, null, 0);
|
||||
+ }
|
||||
+
|
||||
+ public List<IRecipe<?>> getRecipesToAwardAndPopExperience(WorldServer worldserver, Vec3D vec3d, BlockPosition blockposition, EntityPlayer entityplayer, ItemStack itemstack, int amount) {
|
||||
+ public List<RecipeHolder<?>> getRecipesToAwardAndPopExperience(WorldServer worldserver, Vec3D vec3d, BlockPosition blockposition, EntityPlayer entityplayer, ItemStack itemstack, int amount) {
|
||||
+ // CraftBukkit end
|
||||
List<IRecipe<?>> list = Lists.newArrayList();
|
||||
List<RecipeHolder<?>> list = Lists.newArrayList();
|
||||
ObjectIterator objectiterator = this.recipesUsed.object2IntEntrySet().iterator();
|
||||
|
||||
@@ -519,14 +623,14 @@
|
||||
@@ -521,14 +626,14 @@
|
||||
|
||||
worldserver.getRecipeManager().byKey((MinecraftKey) entry.getKey()).ifPresent((irecipe) -> {
|
||||
list.add(irecipe);
|
||||
- createExperience(worldserver, vec3d, entry.getIntValue(), ((RecipeCooking) irecipe).getExperience());
|
||||
+ createExperience(worldserver, vec3d, entry.getIntValue(), ((RecipeCooking) irecipe).getExperience(), blockposition, entityplayer, itemstack, amount); // CraftBukkit
|
||||
worldserver.getRecipeManager().byKey((MinecraftKey) entry.getKey()).ifPresent((recipeholder) -> {
|
||||
list.add(recipeholder);
|
||||
- createExperience(worldserver, vec3d, entry.getIntValue(), ((RecipeCooking) recipeholder.value()).getExperience());
|
||||
+ createExperience(worldserver, vec3d, entry.getIntValue(), ((RecipeCooking) recipeholder.value()).getExperience(), blockposition, entityplayer, itemstack, amount); // CraftBukkit
|
||||
});
|
||||
}
|
||||
|
||||
@@ -224,7 +223,7 @@
|
||||
int j = MathHelper.floor((float) i * f);
|
||||
float f1 = MathHelper.frac((float) i * f);
|
||||
|
||||
@@ -534,6 +638,17 @@
|
||||
@@ -536,6 +641,17 @@
|
||||
++j;
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
ItemStack itemstack = entityitem.getItem().copy();
|
||||
ItemStack itemstack1 = addItem((IInventory) null, iinventory, itemstack, (EnumDirection) null);
|
||||
|
||||
@@ -366,16 +468,40 @@
|
||||
@@ -367,16 +469,40 @@
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
|
||||
public TileEntityJukeBox(BlockPosition blockposition, IBlockData iblockdata) {
|
||||
super(TileEntityTypes.JUKEBOX, blockposition, iblockdata);
|
||||
@@ -150,7 +193,7 @@
|
||||
@@ -152,7 +195,7 @@
|
||||
|
||||
@Override
|
||||
public int getMaxStackSize() {
|
||||
@@ -66,7 +66,7 @@
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -203,7 +246,11 @@
|
||||
@@ -205,7 +248,11 @@
|
||||
@VisibleForTesting
|
||||
public void setRecordWithoutPlaying(ItemStack itemstack) {
|
||||
this.items.set(0, itemstack);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntityShulkerBox.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntityShulkerBox.java
|
||||
@@ -31,6 +31,11 @@
|
||||
@@ -32,6 +32,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;
|
||||
@@ -50,6 +55,37 @@
|
||||
@@ -51,6 +56,37 @@
|
||||
@Nullable
|
||||
private final EnumColor color;
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
public TileEntityShulkerBox(@Nullable EnumColor enumcolor, BlockPosition blockposition, IBlockData iblockdata) {
|
||||
super(TileEntityTypes.SHULKER_BOX, blockposition, iblockdata);
|
||||
this.itemStacks = NonNullList.withSize(27, ItemStack.EMPTY);
|
||||
@@ -162,6 +198,7 @@
|
||||
@@ -172,6 +208,7 @@
|
||||
}
|
||||
|
||||
++this.openCount;
|
||||
@@ -58,7 +58,7 @@
|
||||
this.level.blockEvent(this.worldPosition, this.getBlockState().getBlock(), 1, this.openCount);
|
||||
if (this.openCount == 1) {
|
||||
this.level.gameEvent((Entity) entityhuman, GameEvent.CONTAINER_OPEN, this.worldPosition);
|
||||
@@ -175,6 +212,7 @@
|
||||
@@ -185,6 +222,7 @@
|
||||
public void stopOpen(EntityHuman entityhuman) {
|
||||
if (!this.remove && !entityhuman.isSpectator()) {
|
||||
--this.openCount;
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
--- a/net/minecraft/world/level/block/entity/TileEntitySkull.java
|
||||
+++ b/net/minecraft/world/level/block/entity/TileEntitySkull.java
|
||||
@@ -173,6 +173,16 @@
|
||||
|
||||
if (!SystemUtils.isBlank(s)) {
|
||||
resolveGameProfile(nbttagcompound, s);
|
||||
+ // CraftBukkit start
|
||||
+ } else {
|
||||
+ net.minecraft.nbt.NBTTagList textures = nbttagcompound.getCompound("SkullOwner").getCompound("Properties").getList("textures", 10); // Safe due to method contracts
|
||||
+ for (int i = 0; i < textures.size(); i++) {
|
||||
+ if (textures.get(i) instanceof NBTTagCompound && !((NBTTagCompound) textures.get(i)).contains("Signature", 8) && ((NBTTagCompound) textures.get(i)).getString("Value").trim().isEmpty()) {
|
||||
+ nbttagcompound.remove("SkullOwner");
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
}
|
||||
@@ -34,10 +34,10 @@
|
||||
world.blockEvent(blockposition, this, b0, enumdirection.get3DDataValue());
|
||||
}
|
||||
|
||||
@@ -317,6 +337,48 @@
|
||||
@@ -318,6 +338,48 @@
|
||||
IBlockData[] aiblockdata = new IBlockData[list.size() + list2.size()];
|
||||
EnumDirection enumdirection1 = flag ? enumdirection : enumdirection.getOpposite();
|
||||
int j = 0;
|
||||
int i = 0;
|
||||
+ // CraftBukkit start
|
||||
+ final org.bukkit.block.Block bblock = world.getWorld().getBlockAt(blockposition.getX(), blockposition.getY(), blockposition.getZ());
|
||||
+
|
||||
@@ -82,4 +82,4 @@
|
||||
+ // CraftBukkit end
|
||||
|
||||
BlockPosition blockposition3;
|
||||
int k;
|
||||
int j;
|
||||
|
||||
Reference in New Issue
Block a user