diff options
Diffstat (limited to 'patch-remap/mache-vineflower/net/minecraft/world/item/SignItem.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower/net/minecraft/world/item/SignItem.java.patch | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower/net/minecraft/world/item/SignItem.java.patch b/patch-remap/mache-vineflower/net/minecraft/world/item/SignItem.java.patch new file mode 100644 index 0000000000..ccb176dc5c --- /dev/null +++ b/patch-remap/mache-vineflower/net/minecraft/world/item/SignItem.java.patch @@ -0,0 +1,51 @@ +--- a/net/minecraft/world/item/SignItem.java ++++ b/net/minecraft/world/item/SignItem.java +@@ -7,10 +7,14 @@ + import net.minecraft.world.level.Level; + import net.minecraft.world.level.block.Block; + import net.minecraft.world.level.block.SignBlock; ++import net.minecraft.world.level.block.entity.BlockEntity; + import net.minecraft.world.level.block.entity.SignBlockEntity; +-import net.minecraft.world.level.block.state.BlockState; ++import net.minecraft.world.level.block.state.IBlockData; + + public class SignItem extends StandingAndWallBlockItem { ++ ++ public static BlockPos openSign; // CraftBukkit ++ + public SignItem(Item.Properties properties, Block standingBlock, Block wallBlock) { + super(standingBlock, wallBlock, properties, Direction.DOWN); + } +@@ -20,14 +24,25 @@ + } + + @Override +- protected boolean updateCustomBlockEntityTag(BlockPos pos, Level level, @Nullable Player player, ItemStack stack, BlockState state) { ++ protected boolean updateCustomBlockEntityTag(BlockPos pos, Level level, @Nullable Player player, ItemStack stack, IBlockData state) { + boolean flag = super.updateCustomBlockEntityTag(pos, level, player, stack, state); +- if (!level.isClientSide +- && !flag +- && player != null +- && level.getBlockEntity(pos) instanceof SignBlockEntity signBlockEntity +- && level.getBlockState(pos).getBlock() instanceof SignBlock signBlock) { +- signBlock.openTextEdit(player, signBlockEntity, true); ++ ++ if (!level.isClientSide && !flag && player != null) { ++ BlockEntity tileentity = level.getBlockEntity(pos); ++ ++ if (tileentity instanceof SignBlockEntity) { ++ SignBlockEntity tileentitysign = (SignBlockEntity) tileentity; ++ Block block = level.getBlockState(pos).getBlock(); ++ ++ if (block instanceof SignBlock) { ++ SignBlock blocksign = (SignBlock) block; ++ ++ // CraftBukkit start - SPIGOT-4678 ++ // blocksign.openTextEdit(entityhuman, tileentitysign, true); ++ SignItem.openSign = pos; ++ // CraftBukkit end ++ } ++ } + } + + return flag; |