diff options
Diffstat (limited to 'patch-remap/mache-vineflower/net/minecraft/world/entity/vehicle/MinecartCommandBlock.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower/net/minecraft/world/entity/vehicle/MinecartCommandBlock.java.patch | 158 |
1 files changed, 158 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower/net/minecraft/world/entity/vehicle/MinecartCommandBlock.java.patch b/patch-remap/mache-vineflower/net/minecraft/world/entity/vehicle/MinecartCommandBlock.java.patch new file mode 100644 index 0000000000..af317adc3e --- /dev/null +++ b/patch-remap/mache-vineflower/net/minecraft/world/entity/vehicle/MinecartCommandBlock.java.patch @@ -0,0 +1,158 @@ +--- a/net/minecraft/world/entity/vehicle/MinecartCommandBlock.java ++++ b/net/minecraft/world/entity/vehicle/MinecartCommandBlock.java +@@ -8,7 +8,7 @@ + import net.minecraft.network.syncher.EntityDataSerializers; + import net.minecraft.network.syncher.SynchedEntityData; + import net.minecraft.server.level.ServerLevel; +-import net.minecraft.world.InteractionHand; ++import net.minecraft.world.EnumHand; + import net.minecraft.world.InteractionResult; + import net.minecraft.world.entity.EntityType; + import net.minecraft.world.entity.player.Player; +@@ -17,13 +17,14 @@ + import net.minecraft.world.level.BaseCommandBlock; + import net.minecraft.world.level.Level; + import net.minecraft.world.level.block.Blocks; +-import net.minecraft.world.level.block.state.BlockState; ++import net.minecraft.world.level.block.state.IBlockData; + import net.minecraft.world.phys.Vec3; + + public class MinecartCommandBlock extends AbstractMinecart { +- static final EntityDataAccessor<String> DATA_ID_COMMAND_NAME = SynchedEntityData.defineId(MinecartCommandBlock.class, EntityDataSerializers.STRING); ++ ++ public static final EntityDataAccessor<String> DATA_ID_COMMAND_NAME = SynchedEntityData.defineId(MinecartCommandBlock.class, EntityDataSerializers.STRING); + static final EntityDataAccessor<Component> DATA_ID_LAST_OUTPUT = SynchedEntityData.defineId(MinecartCommandBlock.class, EntityDataSerializers.COMPONENT); +- private final BaseCommandBlock commandBlock = new MinecartCommandBlock.MinecartCommandBase(); ++ private final BaseCommandBlock commandBlock = new MinecartCommandBlock.a(); + private static final int ACTIVATION_DELAY = 4; + private int lastActivated; + +@@ -31,8 +32,8 @@ + super(entityType, level); + } + +- public MinecartCommandBlock(Level level, double x, double y, double z) { +- super(EntityType.COMMAND_BLOCK_MINECART, level, x, y, z); ++ public MinecartCommandBlock(Level level, double x, double d1, double y) { ++ super(EntityType.COMMAND_BLOCK_MINECART, level, x, d1, y); + } + + @Override +@@ -43,16 +44,16 @@ + @Override + protected void defineSynchedData() { + super.defineSynchedData(); +- this.getEntityData().define(DATA_ID_COMMAND_NAME, ""); +- this.getEntityData().define(DATA_ID_LAST_OUTPUT, CommonComponents.EMPTY); ++ this.getEntityData().define(MinecartCommandBlock.DATA_ID_COMMAND_NAME, ""); ++ this.getEntityData().define(MinecartCommandBlock.DATA_ID_LAST_OUTPUT, CommonComponents.EMPTY); + } + + @Override + protected void readAdditionalSaveData(CompoundTag compound) { + super.readAdditionalSaveData(compound); + this.commandBlock.load(compound); +- this.getEntityData().set(DATA_ID_COMMAND_NAME, this.getCommandBlock().getCommand()); +- this.getEntityData().set(DATA_ID_LAST_OUTPUT, this.getCommandBlock().getLastOutput()); ++ this.getEntityData().set(MinecartCommandBlock.DATA_ID_COMMAND_NAME, this.getCommandBlock().getCommand()); ++ this.getEntityData().set(MinecartCommandBlock.DATA_ID_LAST_OUTPUT, this.getCommandBlock().getLastOutput()); + } + + @Override +@@ -62,12 +63,12 @@ + } + + @Override +- public AbstractMinecart.Type getMinecartType() { +- return AbstractMinecart.Type.COMMAND_BLOCK; ++ public AbstractMinecart.EnumMinecartType getMinecartType() { ++ return AbstractMinecart.EnumMinecartType.COMMAND_BLOCK; + } + + @Override +- public BlockState getDefaultDisplayBlockState() { ++ public IBlockData getDefaultDisplayBlockState() { + return Blocks.COMMAND_BLOCK.defaultBlockState(); + } + +@@ -81,24 +82,27 @@ + this.getCommandBlock().performCommand(this.level()); + this.lastActivated = this.tickCount; + } ++ + } + + @Override +- public InteractionResult interact(Player player, InteractionHand hand) { ++ public InteractionResult interact(Player player, EnumHand hand) { + return this.commandBlock.usedBy(player); + } + + @Override + public void onSyncedDataUpdated(EntityDataAccessor<?> key) { + super.onSyncedDataUpdated(key); +- if (DATA_ID_LAST_OUTPUT.equals(key)) { ++ if (MinecartCommandBlock.DATA_ID_LAST_OUTPUT.equals(key)) { + try { +- this.commandBlock.setLastOutput(this.getEntityData().get(DATA_ID_LAST_OUTPUT)); +- } catch (Throwable var3) { ++ this.commandBlock.setLastOutput((Component) this.getEntityData().get(MinecartCommandBlock.DATA_ID_LAST_OUTPUT)); ++ } catch (Throwable throwable) { ++ ; + } +- } else if (DATA_ID_COMMAND_NAME.equals(key)) { +- this.commandBlock.setCommand(this.getEntityData().get(DATA_ID_COMMAND_NAME)); ++ } else if (MinecartCommandBlock.DATA_ID_COMMAND_NAME.equals(key)) { ++ this.commandBlock.setCommand((String) this.getEntityData().get(MinecartCommandBlock.DATA_ID_COMMAND_NAME)); + } ++ + } + + @Override +@@ -106,10 +110,13 @@ + return true; + } + +- public class MinecartCommandBase extends BaseCommandBlock { ++ public class a extends BaseCommandBlock { ++ ++ public a() {} ++ + @Override + public ServerLevel getLevel() { +- return (ServerLevel)MinecartCommandBlock.this.level(); ++ return (ServerLevel) MinecartCommandBlock.this.level(); + } + + @Override +@@ -129,22 +136,19 @@ + + @Override + public CommandSourceStack createCommandSourceStack() { +- return new CommandSourceStack( +- this, +- MinecartCommandBlock.this.position(), +- MinecartCommandBlock.this.getRotationVector(), +- this.getLevel(), +- 2, +- this.getName().getString(), +- MinecartCommandBlock.this.getDisplayName(), +- this.getLevel().getServer(), +- MinecartCommandBlock.this +- ); ++ return new CommandSourceStack(this, MinecartCommandBlock.this.position(), MinecartCommandBlock.this.getRotationVector(), this.getLevel(), 2, this.getName().getString(), MinecartCommandBlock.this.getDisplayName(), this.getLevel().getServer(), MinecartCommandBlock.this); + } + + @Override + public boolean isValid() { + return !MinecartCommandBlock.this.isRemoved(); + } ++ ++ // CraftBukkit start ++ @Override ++ public org.bukkit.command.CommandSender getBukkitSender(CommandSourceStack wrapper) { ++ return (org.bukkit.craftbukkit.entity.CraftMinecartCommand) MinecartCommandBlock.this.getBukkitEntity(); ++ } ++ // CraftBukkit end + } + } |