Paper/nms-patches/EntityPiglin.patch

60 Zeilen
4.1 KiB
Diff

--- a/net/minecraft/server/EntityPiglin.java
+++ b/net/minecraft/server/EntityPiglin.java
@@ -16,9 +16,9 @@
private static final DataWatcherObject<Boolean> bx = DataWatcher.a(EntityPiglin.class, DataWatcherRegistry.i);
private static final UUID by = UUID.fromString("766bfa64-11f3-11ea-8d71-362b9e155667");
private static final AttributeModifier bz = new AttributeModifier(EntityPiglin.by, "Baby speed boost", 0.20000000298023224D, AttributeModifier.Operation.MULTIPLY_BASE);
- private int bA = 0;
+ public int bA = 0; // PAIL private -> public, rename conversionTicks
private final InventorySubcontainer bB = new InventorySubcontainer(8);
- private boolean bC = false;
+ public boolean bC = false; // PAIL private -> public, rename cannotHunt
protected static final ImmutableList<SensorType<? extends Sensor<? super EntityPiglin>>> b = ImmutableList.of(SensorType.c, SensorType.d, SensorType.b, SensorType.g, SensorType.e, SensorType.l);
protected static final ImmutableList<MemoryModuleType<?>> c = ImmutableList.of(MemoryModuleType.LOOK_TARGET, MemoryModuleType.INTERACTABLE_DOORS, MemoryModuleType.OPENED_DOORS, MemoryModuleType.MOBS, MemoryModuleType.VISIBLE_MOBS, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_TARGETABLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_ADULT_PIGLINS, MemoryModuleType.NEAREST_ADULT_PIGLINS, MemoryModuleType.NEAREST_VISIBLE_WANTED_ITEM, MemoryModuleType.HURT_BY, MemoryModuleType.HURT_BY_ENTITY, new MemoryModuleType[]{MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.ATTACK_TARGET, MemoryModuleType.ATTACK_COOLING_DOWN, MemoryModuleType.INTERACTION_TARGET, MemoryModuleType.PATH, MemoryModuleType.ANGRY_AT, MemoryModuleType.UNIVERSAL_ANGER, MemoryModuleType.AVOID_TARGET, MemoryModuleType.ADMIRING_ITEM, MemoryModuleType.ADMIRING_DISABLED, MemoryModuleType.CELEBRATE_LOCATION, MemoryModuleType.DANCING, MemoryModuleType.HUNTED_RECENTLY, MemoryModuleType.NEAREST_VISIBLE_BABY_HOGLIN, MemoryModuleType.NEAREST_VISIBLE_BABY_PIGLIN, MemoryModuleType.NEAREST_VISIBLE_NEMSIS, MemoryModuleType.NEAREST_VISIBLE_ZOMBIFIED, MemoryModuleType.RIDE_TARGET, MemoryModuleType.VISIBLE_ADULT_PIGLIN_COUNT, MemoryModuleType.VISIBLE_ADULT_HOGLIN_COUNT, MemoryModuleType.NEAREST_VISIBLE_HUNTABLE_HOGLIN, MemoryModuleType.NEAREST_TARGETABLE_PLAYER_NOT_WEARING_GOLD, MemoryModuleType.NEAREST_PLAYER_HOLDING_WANTED_ITEM, MemoryModuleType.ATE_RECENTLY, MemoryModuleType.NEAREST_REPELLENT});
@@ -157,7 +157,7 @@
@Override
public BehaviorController<EntityPiglin> getBehaviorController() {
- return super.getBehaviorController();
+ return (BehaviorController<EntityPiglin>) super.getBehaviorController(); // CraftBukkit - decompile error
}
@Override
@@ -217,7 +217,7 @@
this.getDataWatcher().set(EntityPiglin.bv, flag);
}
- private boolean eT() {
+ public boolean eT() { // PAIL private -> public, rename isImmuneToZombification
return (Boolean) this.getDataWatcher().get(EntityPiglin.bv);
}
@@ -236,7 +236,7 @@
@Override
protected void mobTick() {
this.world.getMethodProfiler().enter("piglinBrain");
- this.getBehaviorController().a((WorldServer) this.world, (EntityLiving) this);
+ this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error
this.world.getMethodProfiler().exit();
PiglinAI.b(this);
if (this.eO()) {
@@ -268,7 +268,7 @@
@Nullable
@Override
public EntityLiving getGoalTarget() {
- return (EntityLiving) this.bn.getMemory(MemoryModuleType.ATTACK_TARGET).orElse((Object) null);
+ return (EntityLiving) this.bn.getMemory(MemoryModuleType.ATTACK_TARGET).orElse(null); // CraftBukkit - decompile error
}
private ItemStack eU() {
@@ -396,7 +396,7 @@
@Override
protected SoundEffect getSoundAmbient() {
- return this.world.isClientSide ? null : (SoundEffect) PiglinAI.d(this).orElse((Object) null);
+ return this.world.isClientSide ? null : (SoundEffect) PiglinAI.d(this).orElse(null); // CraftBukkit - decompile error
}
@Override