mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 11:44:19 +01:00
SPIGOT-1181: Ensure Minecart command updates visually
By: md_5 <git@md-5.net>
This commit is contained in:
parent
d6f72f0b27
commit
4013505f8c
2 changed files with 16 additions and 6 deletions
|
@ -1,7 +1,11 @@
|
|||
--- a/net/minecraft/server/EntityMinecartCommandBlock.java
|
||||
+++ b/net/minecraft/server/EntityMinecartCommandBlock.java
|
||||
@@ -7,6 +7,9 @@
|
||||
private static final DataWatcherObject<String> a = DataWatcher.a(EntityMinecartCommandBlock.class, DataWatcherRegistry.d);
|
||||
@@ -4,9 +4,12 @@
|
||||
|
||||
public class EntityMinecartCommandBlock extends EntityMinecartAbstract {
|
||||
|
||||
- private static final DataWatcherObject<String> a = DataWatcher.a(EntityMinecartCommandBlock.class, DataWatcherRegistry.d);
|
||||
+ public static final DataWatcherObject<String> a = DataWatcher.a(EntityMinecartCommandBlock.class, DataWatcherRegistry.d); // PAIL: private -> public
|
||||
private static final DataWatcherObject<IChatBaseComponent> b = DataWatcher.a(EntityMinecartCommandBlock.class, DataWatcherRegistry.e);
|
||||
private final CommandBlockListenerAbstract c = new CommandBlockListenerAbstract() {
|
||||
+ {
|
||||
|
|
|
@ -22,19 +22,25 @@ public class CraftMinecartCommand extends CraftMinecart implements CommandMineca
|
|||
super(server, entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityMinecartCommandBlock getHandle() {
|
||||
return (EntityMinecartCommandBlock) entity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCommand() {
|
||||
return ((EntityMinecartCommandBlock) getHandle()).getCommandBlock().getCommand();
|
||||
return getHandle().getCommandBlock().getCommand();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCommand(String command) {
|
||||
((EntityMinecartCommandBlock) getHandle()).getCommandBlock().setCommand(command != null ? command : "");
|
||||
getHandle().getCommandBlock().setCommand(command != null ? command : "");
|
||||
getHandle().getDataWatcher().set(EntityMinecartCommandBlock.a, getHandle().getCommandBlock().getCommand()); // PAIL: rename
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setName(String name) {
|
||||
((EntityMinecartCommandBlock) getHandle()).getCommandBlock().setName(name != null ? name : "@");
|
||||
getHandle().getCommandBlock().setName(name != null ? name : "@");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -52,7 +58,7 @@ public class CraftMinecartCommand extends CraftMinecart implements CommandMineca
|
|||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ((EntityMinecartCommandBlock) getHandle()).getCommandBlock().getName();
|
||||
return getHandle().getCommandBlock().getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue