mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-14 12:11:30 +01:00
Merge pull request #294 from mcmonkey4eva/EntityPatch
Fix guided waypoint markers by blocking the t_ method which allows movement in the NMS
This commit is contained in:
commit
e7b1a69a14
@ -1200,10 +1200,12 @@ public class NPCCommands {
|
|||||||
max = 1,
|
max = 1,
|
||||||
permission = "citizens.npc.sheep")
|
permission = "citizens.npc.sheep")
|
||||||
@Requirements(selected = true, ownership = true, types = { EntityType.SHEEP })
|
@Requirements(selected = true, ownership = true, types = { EntityType.SHEEP })
|
||||||
public void sheep(CommandContext args, CommandSender sender, NPC npc) {
|
public void sheep(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
|
||||||
SheepTrait trait = npc.getTrait(SheepTrait.class);
|
SheepTrait trait = npc.getTrait(SheepTrait.class);
|
||||||
|
boolean hasArg = false;
|
||||||
if (args.hasValueFlag("sheared")) {
|
if (args.hasValueFlag("sheared")) {
|
||||||
trait.setSheared(Boolean.valueOf(args.getFlag("sheared")));
|
trait.setSheared(Boolean.valueOf(args.getFlag("sheared")));
|
||||||
|
hasArg = true;
|
||||||
}
|
}
|
||||||
if (args.hasValueFlag("color")) {
|
if (args.hasValueFlag("color")) {
|
||||||
DyeColor color = Util.matchEnum(DyeColor.values(), args.getFlag("color"));
|
DyeColor color = Util.matchEnum(DyeColor.values(), args.getFlag("color"));
|
||||||
@ -1213,6 +1215,10 @@ public class NPCCommands {
|
|||||||
} else {
|
} else {
|
||||||
Messaging.sendErrorTr(sender, Messages.INVALID_SHEEP_COLOR, Util.listValuesPretty(DyeColor.values()));
|
Messaging.sendErrorTr(sender, Messages.INVALID_SHEEP_COLOR, Util.listValuesPretty(DyeColor.values()));
|
||||||
}
|
}
|
||||||
|
hasArg = true;
|
||||||
|
}
|
||||||
|
if (!hasArg) {
|
||||||
|
throw new CommandException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,9 +11,9 @@ import org.bukkit.event.player.PlayerShearEntityEvent;
|
|||||||
|
|
||||||
public class SheepTrait extends Trait {
|
public class SheepTrait extends Trait {
|
||||||
@Persist("color")
|
@Persist("color")
|
||||||
private DyeColor color;
|
private DyeColor color = DyeColor.WHITE;
|
||||||
@Persist("sheared")
|
@Persist("sheared")
|
||||||
private boolean sheared;
|
private boolean sheared = false;
|
||||||
|
|
||||||
public SheepTrait() {
|
public SheepTrait() {
|
||||||
super("sheeptrait");
|
super("sheeptrait");
|
||||||
|
@ -21,4 +21,8 @@ public class EntityEnderSignalMarker extends EntityEnderSignal {
|
|||||||
@Override
|
@Override
|
||||||
public void h() {
|
public void h() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void t_() {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user