Add /npc collidable --fluids and backport fluid pushable to <1.13.

This commit is contained in:
fullwall 2024-07-08 00:35:03 +08:00
parent 4143097d05
commit ad6b47348c
466 changed files with 2564 additions and 1106 deletions

View File

@ -505,14 +505,21 @@ public class NPCCommands {
@Command(
aliases = { "npc" },
usage = "collidable",
usage = "collidable --fluids [true|false]",
desc = "",
modifiers = { "collidable", "pushable" },
min = 1,
max = 1,
permission = "citizens.npc.collidable")
@Requirements(ownership = true, selected = true)
public void collidable(CommandContext args, CommandSender sender, NPC npc) throws CommandException {
public void collidable(CommandContext args, CommandSender sender, NPC npc, @Flag("fluids") Boolean fluids)
throws CommandException {
if (fluids != null) {
npc.data().setPersistent(NPC.Metadata.FLUID_PUSHABLE, fluids);
Messaging.sendTr(sender, fluids ? Messages.FLUID_PUSHABLE_SET : Messages.FLUID_PUSHABLE_UNSET,
npc.getName());
return;
}
npc.data().setPersistent(NPC.Metadata.COLLIDABLE, !npc.data().get(NPC.Metadata.COLLIDABLE, !npc.isProtected()));
Messaging.sendTr(sender,
npc.data().<Boolean> get(NPC.Metadata.COLLIDABLE) ? Messages.COLLIDABLE_SET : Messages.COLLIDABLE_UNSET,

View File

@ -121,6 +121,8 @@ public class Messages {
public static final String FAILED_TO_MOUNT_NPC = "citizens.commands.npc.mount.failed";
public static final String FAILED_TO_REMOVE = "citizens.commands.trait.failed-to-remove";
public static final String FETCHING_SKIN = "citizens.commands.npc.skin.fetching";
public static final String FLUID_PUSHABLE_SET = "citizens.commands.npc.collidable.fluid-set";
public static final String FLUID_PUSHABLE_UNSET = "citizens.commands.npc.collidable.fluid-unset";
public static final String FLYABLE_SET = "citizens.commands.npc.flyable.set";
public static final String FLYABLE_UNSET = "citizens.commands.npc.flyable.unset";
public static final String FOLLOW_MARGIN_SET = "citizens.commands.npc.follow.margin-set";

View File

@ -99,6 +99,8 @@
"citizens.commands.npc.chunkload.unset" : "[[{0}]] will no longer force chunks to be loaded.",
"citizens.commands.npc.collidable.description" : "Toggles an NPC''s collidability",
"citizens.commands.npc.collidable.help" : "",
"citizens.commands.npc.collidable.fluid-set" : "[[{0}]] will now be pushable by fluids.",
"citizens.commands.npc.collidable.fluid-unset" : "[[{0}]] will no longer be pushable by fluids.",
"citizens.commands.npc.collidable.set" : "[[{0}]] will now collide with entities.",
"citizens.commands.npc.collidable.unset" : "[[{0}]] will no longer collide with entities.",
"citizens.commands.npc.command.all-errors-cleared" : "[[{0}]] cleared all [[{1}]] errors.",

View File

@ -76,6 +76,11 @@ public class ArmorStandController extends MobEntityController {
return event.isCancelled() ? EnumInteractionResult.FAIL : EnumInteractionResult.SUCCESS;
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -76,6 +76,11 @@ public class BatController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -73,6 +73,11 @@ public class BlazeController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -82,6 +82,11 @@ public class CaveSpiderController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -91,6 +91,11 @@ public class ChickenController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -105,6 +105,11 @@ public class CowController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -93,6 +93,11 @@ public class CreeperController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -79,6 +79,11 @@ public class EnderDragonController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -82,6 +82,11 @@ public class EndermanController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -82,6 +82,11 @@ public class EndermiteController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -108,6 +108,11 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
this.bz.put(pathtype, f);
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);
@ -395,7 +400,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
for (EnumItemSlot slot : EnumItemSlot.values()) {
ItemStack equipment = getEquipment(slot);
ItemStack cache = equipmentCache.get(slot);
if (((cache != null) || (equipment != null))
if ((cache != null || equipment != null)
&& (cache == null ^ equipment == null || !ItemStack.equals(cache, equipment))) {
itemChanged = true;
if (cache != null) {

View File

@ -59,6 +59,11 @@ public class GhastController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -68,6 +68,11 @@ public class GiantController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -68,6 +68,11 @@ public class GuardianController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -49,8 +49,8 @@ public class HorseController extends MobEntityController {
private double baseMovementSpeed;
private final CitizensNPC npc;
private boolean riding;
private boolean riding;
public EntityHorseNPC(World world) {
this(world, null);
}
@ -96,6 +96,11 @@ public class HorseController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -68,6 +68,11 @@ public class IronGolemController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -74,6 +74,11 @@ public class MagmaCubeController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -87,6 +87,11 @@ public class MushroomCowController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -77,6 +77,11 @@ public class OcelotController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -78,6 +78,11 @@ public class PigController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -68,6 +68,11 @@ public class PigZombieController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -68,6 +68,11 @@ public class PolarBearController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -78,6 +78,11 @@ public class RabbitController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -77,6 +77,11 @@ public class SheepController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -69,6 +69,11 @@ public class ShulkerController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -68,6 +68,11 @@ public class SilverfishController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -68,6 +68,11 @@ public class SkeletonController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -74,6 +74,11 @@ public class SlimeController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -68,6 +68,11 @@ public class SnowmanController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -68,6 +68,11 @@ public class SpiderController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -68,6 +68,11 @@ public class SquidController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -91,6 +91,11 @@ public class VillagerController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -68,6 +68,11 @@ public class WitchController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -59,6 +59,11 @@ public class WitherController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -79,6 +79,11 @@ public class WolfController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -68,6 +68,11 @@ public class ZombieController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bV() {
return NMSImpl.getSoundEffect(npc, super.bV(), NPC.Metadata.DEATH_SOUND);

View File

@ -59,6 +59,11 @@ public class AreaEffectCloudController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -60,6 +60,11 @@ public class BoatController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -60,6 +60,11 @@ public class DragonFireballController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -75,6 +75,11 @@ public class EggController extends AbstractEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -59,6 +59,11 @@ public class EnderCrystalController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -59,6 +59,11 @@ public class EnderPearlController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -59,6 +59,11 @@ public class EnderSignalController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -45,6 +45,11 @@ public class ExperienceOrbController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -67,6 +67,11 @@ public class FallingBlockController extends AbstractEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -45,6 +45,11 @@ public class FireworkController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -45,6 +45,11 @@ public class FishingHookController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -58,6 +58,11 @@ public class ItemController extends AbstractEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -58,6 +58,11 @@ public class ItemFrameController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -46,6 +46,11 @@ public class LargeFireballController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -45,6 +45,11 @@ public class LeashController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -46,6 +46,11 @@ public class MinecartChestController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -46,6 +46,11 @@ public class MinecartCommandController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -46,6 +46,11 @@ public class MinecartFurnaceController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -42,6 +42,11 @@ public class MinecartHopperController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -46,6 +46,11 @@ public class MinecartRideableController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -42,6 +42,11 @@ public class MinecartSpawnerController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -42,6 +42,11 @@ public class MinecartTNTController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -45,6 +45,11 @@ public class PaintingController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -45,6 +45,11 @@ public class ShulkerBulletController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -45,6 +45,11 @@ public class SmallFireballController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -45,6 +45,11 @@ public class SnowballController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -45,6 +45,11 @@ public class SpectralArrowController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -45,6 +45,11 @@ public class TNTPrimedController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -45,6 +45,11 @@ public class ThrownExpBottleController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -46,6 +46,11 @@ public class ThrownPotionController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -45,6 +45,11 @@ public class TippedArrowController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -45,6 +45,11 @@ public class WitherSkullController extends MobEntityController {
super.a(NMSBoundingBox.makeBB(npc, bb));
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_10_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -2,9 +2,11 @@ package net.citizensnpcs.nms.v1_10_R1.util;
import java.lang.reflect.Field;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
@ -99,7 +101,7 @@ public class PlayerlistTrackerEntry extends EntityTrackerEntry {
}
public static Set<org.bukkit.entity.Player> getSeenBy(EntityTrackerEntry tracker) {
return tracker.trackedPlayers.stream().map(p -> p.getBukkitEntity()).collect(Collectors.toSet());
return tracker.trackedPlayers.stream().map((Function<? super EntityPlayer, ? extends CraftPlayer>) EntityPlayer::getBukkitEntity).collect(Collectors.toSet());
}
private static Entity getTracker(EntityTrackerEntry entry) {

View File

@ -82,6 +82,11 @@ public class ArmorStandController extends MobEntityController {
}
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
public void collide(net.minecraft.server.v1_11_R1.Entity entity) {
// this method is called by both the entities involved - cancelling

View File

@ -76,6 +76,11 @@ public class BatController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);

View File

@ -73,6 +73,11 @@ public class BlazeController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);

View File

@ -82,6 +82,11 @@ public class CaveSpiderController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);

View File

@ -91,6 +91,11 @@ public class ChickenController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);

View File

@ -105,6 +105,11 @@ public class CowController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);

View File

@ -85,6 +85,11 @@ public class CreeperController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);

View File

@ -80,6 +80,11 @@ public class EnderDragonController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);

View File

@ -82,6 +82,11 @@ public class EndermanController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);

View File

@ -82,6 +82,11 @@ public class EndermiteController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);

View File

@ -123,6 +123,11 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
npc.update();
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);
@ -413,7 +418,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
for (EnumItemSlot slot : EnumItemSlot.values()) {
ItemStack equipment = getEquipment(slot);
ItemStack cache = equipmentCache.get(slot);
if (((cache != null) || (equipment != null))
if ((cache != null || equipment != null)
&& (cache == null ^ equipment == null || !ItemStack.equals(cache, equipment))) {
itemChanged = true;
if (cache != null && !cache.isEmpty()) {

View File

@ -68,6 +68,11 @@ public class EvokerController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);

View File

@ -59,6 +59,11 @@ public class GhastController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);

View File

@ -68,6 +68,11 @@ public class GiantController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);

View File

@ -68,6 +68,11 @@ public class GuardianController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);

View File

@ -68,6 +68,11 @@ public class GuardianElderController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);

View File

@ -47,8 +47,8 @@ public class HorseController extends MobEntityController {
private double baseMovementSpeed;
private final CitizensNPC npc;
private boolean riding;
private boolean riding;
public EntityHorseNPC(World world) {
this(world, null);
}
@ -94,6 +94,11 @@ public class HorseController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);

View File

@ -48,8 +48,8 @@ public class HorseDonkeyController extends MobEntityController {
private double baseMovementSpeed;
private final CitizensNPC npc;
private boolean riding;
private boolean riding;
public EntityHorseDonkeyNPC(World world) {
this(world, null);
}
@ -96,6 +96,11 @@ public class HorseDonkeyController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);

View File

@ -48,8 +48,8 @@ public class HorseMuleController extends MobEntityController {
private double baseMovementSpeed;
private final CitizensNPC npc;
private boolean riding;
private boolean riding;
public EntityHorseMuleNPC(World world) {
this(world, null);
}
@ -96,6 +96,11 @@ public class HorseMuleController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);

View File

@ -48,8 +48,8 @@ public class HorseSkeletonController extends MobEntityController {
private double baseMovementSpeed;
private final CitizensNPC npc;
private boolean riding;
private boolean riding;
public EntityHorseSkeletonNPC(World world) {
this(world, null);
}
@ -96,6 +96,11 @@ public class HorseSkeletonController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);

View File

@ -48,8 +48,8 @@ public class HorseZombieController extends MobEntityController {
private double baseMovementSpeed;
private final CitizensNPC npc;
private boolean riding;
private boolean riding;
public EntityHorseZombieNPC(World world) {
this(world, null);
}
@ -96,6 +96,11 @@ public class HorseZombieController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);

View File

@ -68,6 +68,11 @@ public class IronGolemController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);

View File

@ -88,6 +88,11 @@ public class LlamaController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);

View File

@ -82,6 +82,11 @@ public class MagmaCubeController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);

View File

@ -86,6 +86,11 @@ public class MushroomCowController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);

View File

@ -77,6 +77,11 @@ public class OcelotController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);

View File

@ -78,6 +78,11 @@ public class PigController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);

View File

@ -68,6 +68,11 @@ public class PigZombieController extends MobEntityController {
return NMS.getFallDistance(npc, super.aY());
}
@Override
public boolean bg() {
return npc == null ? super.bg() : npc.isPushableByFluids();
}
@Override
protected SoundEffect bW() {
return NMSImpl.getSoundEffect(npc, super.bW(), NPC.Metadata.DEATH_SOUND);

Some files were not shown because too many files have changed in this diff Show More