aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower/net/minecraft/world/item/SignItem.java.patch
diff options
context:
space:
mode:
authorMiniDigger | Martin <[email protected]>2024-01-14 11:04:49 +0100
committerMiniDigger | Martin <[email protected]>2024-01-14 11:04:49 +0100
commitbee74680e607c2e29b038329f62181238911cd83 (patch)
tree708fd1a4a0227d9071243adf2a42d5e9e96cde4a /patch-remap/mache-vineflower/net/minecraft/world/item/SignItem.java.patch
parent0a44692ef6ff6e255d48eb3ba1bb114166eafda9 (diff)
downloadPaper-softspoon.tar.gz
Paper-softspoon.zip
add remapped patches as a testsoftspoon
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.patch51
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;