3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 20:40:08 +01:00

SPIGOT-1181: Ensure Minecart command updates visually

Dieser Commit ist enthalten in:
md_5 2016-06-30 13:33:26 +10:00
Ursprung 5f61739cb8
Commit 939423a8f1
2 geänderte Dateien mit 16 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -1,7 +1,11 @@
--- a/net/minecraft/server/EntityMinecartCommandBlock.java --- a/net/minecraft/server/EntityMinecartCommandBlock.java
+++ b/net/minecraft/server/EntityMinecartCommandBlock.java +++ b/net/minecraft/server/EntityMinecartCommandBlock.java
@@ -7,6 +7,9 @@ @@ -4,9 +4,12 @@
private static final DataWatcherObject<String> a = DataWatcher.a(EntityMinecartCommandBlock.class, DataWatcherRegistry.d);
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 static final DataWatcherObject<IChatBaseComponent> b = DataWatcher.a(EntityMinecartCommandBlock.class, DataWatcherRegistry.e);
private final CommandBlockListenerAbstract c = new CommandBlockListenerAbstract() { private final CommandBlockListenerAbstract c = new CommandBlockListenerAbstract() {
+ { + {

Datei anzeigen

@ -22,19 +22,25 @@ public class CraftMinecartCommand extends CraftMinecart implements CommandMineca
super(server, entity); super(server, entity);
} }
@Override
public EntityMinecartCommandBlock getHandle() {
return (EntityMinecartCommandBlock) entity;
}
@Override @Override
public String getCommand() { public String getCommand() {
return ((EntityMinecartCommandBlock) getHandle()).getCommandBlock().getCommand(); return getHandle().getCommandBlock().getCommand();
} }
@Override @Override
public void setCommand(String command) { 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 @Override
public void setName(String name) { public void setName(String name) {
((EntityMinecartCommandBlock) getHandle()).getCommandBlock().setName(name != null ? name : "@"); getHandle().getCommandBlock().setName(name != null ? name : "@");
} }
@Override @Override
@ -52,7 +58,7 @@ public class CraftMinecartCommand extends CraftMinecart implements CommandMineca
@Override @Override
public String getName() { public String getName() {
return ((EntityMinecartCommandBlock) getHandle()).getCommandBlock().getName(); return getHandle().getCommandBlock().getName();
} }
@Override @Override