mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-25 12:15:53 +01:00
Fix /npc mushroomcow, increase base player speed
This commit is contained in:
parent
e89cd03cce
commit
e1f749236b
@ -210,7 +210,7 @@ public class Commands {
|
|||||||
min = 1,
|
min = 1,
|
||||||
max = 1,
|
max = 1,
|
||||||
permission = "citizens.npc.mushroomcow")
|
permission = "citizens.npc.mushroomcow")
|
||||||
@Requirements(selected = true, ownership = true, types = { EntityType.SHULKER })
|
@Requirements(selected = true, ownership = true, types = { EntityType.MUSHROOM_COW })
|
||||||
public void mushroomcow(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
|
public void mushroomcow(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
|
||||||
MushroomCowTrait trait = npc.getTrait(MushroomCowTrait.class);
|
MushroomCowTrait trait = npc.getTrait(MushroomCowTrait.class);
|
||||||
boolean hasArg = false;
|
boolean hasArg = false;
|
||||||
@ -375,6 +375,29 @@ public class Commands {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Command(
|
||||||
|
aliases = { "npc" },
|
||||||
|
usage = "snowman (-d[erp])",
|
||||||
|
desc = "Sets snowman modifiers.",
|
||||||
|
modifiers = { "snowman" },
|
||||||
|
min = 1,
|
||||||
|
max = 1,
|
||||||
|
flags = "d",
|
||||||
|
permission = "citizens.npc.snowman")
|
||||||
|
@Requirements(selected = true, ownership = true, types = { EntityType.SNOWMAN })
|
||||||
|
public void snowman(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
|
||||||
|
SnowmanTrait trait = npc.getTrait(SnowmanTrait.class);
|
||||||
|
boolean hasArg = false;
|
||||||
|
if (args.hasFlag('d')) {
|
||||||
|
boolean isDerp = trait.toggleDerp();
|
||||||
|
Messaging.sendTr(sender, isDerp ? Messages.SNOWMAN_DERP_SET : Messages.SNOWMAN_DERP_STOPPED, npc.getName());
|
||||||
|
hasArg = true;
|
||||||
|
}
|
||||||
|
if (!hasArg) {
|
||||||
|
throw new CommandUsageException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Command(
|
@Command(
|
||||||
aliases = { "npc" },
|
aliases = { "npc" },
|
||||||
usage = "tfish (--body color) (--pattern pattern) (--patterncolor color)",
|
usage = "tfish (--body color) (--pattern pattern) (--patterncolor color)",
|
||||||
@ -464,27 +487,4 @@ public class Commands {
|
|||||||
throw new CommandUsageException();
|
throw new CommandUsageException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Command(
|
|
||||||
aliases = { "npc" },
|
|
||||||
usage = "snowman (-d[erp])",
|
|
||||||
desc = "Sets snowman modifiers.",
|
|
||||||
modifiers = { "snowman" },
|
|
||||||
min = 1,
|
|
||||||
max = 1,
|
|
||||||
flags = "d",
|
|
||||||
permission = "citizens.npc.snowman")
|
|
||||||
@Requirements(selected = true, ownership = true, types = { EntityType.SNOWMAN })
|
|
||||||
public void snowman(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
|
|
||||||
SnowmanTrait trait = npc.getTrait(SnowmanTrait.class);
|
|
||||||
boolean hasArg = false;
|
|
||||||
if (args.hasFlag('d')) {
|
|
||||||
boolean isDerp = trait.toggleDerp();
|
|
||||||
Messaging.sendTr(sender, isDerp ? Messages.SNOWMAN_DERP_SET : Messages.SNOWMAN_DERP_STOPPED, npc.getName());
|
|
||||||
hasArg = true;
|
|
||||||
}
|
|
||||||
if (!hasArg) {
|
|
||||||
throw new CommandUsageException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -249,7 +249,7 @@ public class Commands {
|
|||||||
min = 1,
|
min = 1,
|
||||||
max = 1,
|
max = 1,
|
||||||
permission = "citizens.npc.mushroomcow")
|
permission = "citizens.npc.mushroomcow")
|
||||||
@Requirements(selected = true, ownership = true, types = { EntityType.SHULKER })
|
@Requirements(selected = true, ownership = true, types = { EntityType.MUSHROOM_COW })
|
||||||
public void mushroomcow(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
|
public void mushroomcow(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
|
||||||
MushroomCowTrait trait = npc.getTrait(MushroomCowTrait.class);
|
MushroomCowTrait trait = npc.getTrait(MushroomCowTrait.class);
|
||||||
boolean hasArg = false;
|
boolean hasArg = false;
|
||||||
|
@ -51,8 +51,6 @@ public class PlayerControllerMove extends ControllerMove {
|
|||||||
AttributeInstance speed = this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
|
AttributeInstance speed = this.a.getAttributeInstance(GenericAttributes.MOVEMENT_SPEED);
|
||||||
if (this.a instanceof EntitySlime) {
|
if (this.a instanceof EntitySlime) {
|
||||||
speed.setValue(0.3D * this.e);
|
speed.setValue(0.3D * this.e);
|
||||||
} else {
|
|
||||||
speed.setValue(0.2D * this.e);
|
|
||||||
}
|
}
|
||||||
float movement = (float) (this.e * speed.getValue());
|
float movement = (float) (this.e * speed.getValue());
|
||||||
this.a.o(movement);
|
this.a.o(movement);
|
||||||
|
Loading…
Reference in New Issue
Block a user