Set hover in place to true for parrot npcs

This commit is contained in:
fullwall 2024-09-09 17:05:45 +08:00
parent 5d1a1ad642
commit fa4ea79606
8 changed files with 29 additions and 0 deletions

View File

@ -16,6 +16,7 @@ import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_15_R1.AxisAlignedBB;
import net.minecraft.server.v1_15_R1.ControllerMoveFlying;
import net.minecraft.server.v1_15_R1.DamageSource;
import net.minecraft.server.v1_15_R1.Entity;
import net.minecraft.server.v1_15_R1.EntityBoat;
@ -53,6 +54,9 @@ public class ParrotController extends MobEntityController {
public EntityParrotNPC(EntityTypes<? extends EntityParrot> types, World world, NPC npc) {
super(types, world);
this.npc = (CitizensNPC) npc;
if (npc != null) {
this.moveController = new ControllerMoveFlying(this, 10, true);
}
}
@Override

View File

@ -16,6 +16,7 @@ import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_16_R3.AxisAlignedBB;
import net.minecraft.server.v1_16_R3.ControllerMoveFlying;
import net.minecraft.server.v1_16_R3.DamageSource;
import net.minecraft.server.v1_16_R3.Entity;
import net.minecraft.server.v1_16_R3.EntityBoat;
@ -54,6 +55,9 @@ public class ParrotController extends MobEntityController {
public EntityParrotNPC(EntityTypes<? extends EntityParrot> types, World world, NPC npc) {
super(types, world);
this.npc = (CitizensNPC) npc;
if (npc != null) {
this.moveController = new ControllerMoveFlying(this, 10, true);
}
}
@Override

View File

@ -23,6 +23,7 @@ import net.minecraft.world.InteractionResult;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.ai.control.FlyingMoveControl;
import net.minecraft.world.entity.animal.Parrot;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.vehicle.AbstractMinecart;
@ -53,6 +54,9 @@ public class ParrotController extends MobEntityController {
public EntityParrotNPC(EntityType<? extends Parrot> types, Level level, NPC npc) {
super(types, level);
this.npc = (CitizensNPC) npc;
if (npc != null) {
this.moveControl = new FlyingMoveControl(this, 10, true);
}
}
@Override

View File

@ -25,6 +25,7 @@ import net.minecraft.world.InteractionResult;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.ai.control.FlyingMoveControl;
import net.minecraft.world.entity.animal.Parrot;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.vehicle.AbstractMinecart;
@ -55,6 +56,9 @@ public class ParrotController extends MobEntityController {
public EntityParrotNPC(EntityType<? extends Parrot> types, Level level, NPC npc) {
super(types, level);
this.npc = (CitizensNPC) npc;
if (npc != null) {
this.moveControl = new FlyingMoveControl(this, 10, true);
}
}
@Override

View File

@ -25,6 +25,7 @@ import net.minecraft.world.InteractionResult;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.ai.control.FlyingMoveControl;
import net.minecraft.world.entity.animal.Parrot;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.vehicle.AbstractMinecart;
@ -55,6 +56,9 @@ public class ParrotController extends MobEntityController {
public EntityParrotNPC(EntityType<? extends Parrot> types, Level level, NPC npc) {
super(types, level);
this.npc = (CitizensNPC) npc;
if (npc != null) {
this.moveControl = new FlyingMoveControl(this, 10, true);
}
}
@Override

View File

@ -2541,6 +2541,7 @@ public class NMSImpl implements NMSBridge {
}
private static final MethodHandle ATTRIBUTE_PROVIDER_MAP = NMS.getFirstGetter(AttributeSupplier.class, Map.class);
private static final MethodHandle ATTRIBUTE_PROVIDER_MAP_SETTER = NMS.getFirstFinalSetter(AttributeSupplier.class,
Map.class);
private static final MethodHandle ATTRIBUTE_SUPPLIER = NMS.getFirstGetter(AttributeMap.class,

View File

@ -23,6 +23,7 @@ import net.minecraft.world.InteractionResult;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.ai.control.FlyingMoveControl;
import net.minecraft.world.entity.animal.Parrot;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.vehicle.AbstractMinecart;
@ -53,6 +54,9 @@ public class ParrotController extends MobEntityController {
public EntityParrotNPC(EntityType<? extends Parrot> types, Level level, NPC npc) {
super(types, level);
this.npc = (CitizensNPC) npc;
if (npc != null) {
this.moveControl = new FlyingMoveControl(this, 10, true);
}
}
@Override

View File

@ -22,6 +22,7 @@ import net.minecraft.world.InteractionResult;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.ai.control.FlyingMoveControl;
import net.minecraft.world.entity.animal.Parrot;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.vehicle.AbstractMinecart;
@ -53,6 +54,9 @@ public class ParrotController extends MobEntityController {
public EntityParrotNPC(EntityType<? extends Parrot> types, Level level, NPC npc) {
super(types, level);
this.npc = (CitizensNPC) npc;
if (npc != null) {
this.moveControl = new FlyingMoveControl(this, 10, true);
}
}
@Override