mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +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
|
--- 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() {
|
||||||
+ {
|
+ {
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue