mirror of
https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git
synced 2025-04-08 16:24:33 +00:00
60 lines
4.4 KiB
Diff
60 lines
4.4 KiB
Diff
--- a/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
|
+++ b/net/minecraft/world/entity/animal/axolotl/Axolotl.java
|
|
@@ -73,10 +73,17 @@
|
|
|
|
public class Axolotl extends EntityAnimal implements Bucketable {
|
|
|
|
+ // CraftBukkit start - SPIGOT-6907: re-implement LivingEntity#setMaximumAir()
|
|
+ @Override
|
|
+ public int getDefaultMaxAirSupply() {
|
|
+ return AXOLOTL_TOTAL_AIR_SUPPLY;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
public static final int TOTAL_PLAYDEAD_TIME = 200;
|
|
private static final int POSE_ANIMATION_TICKS = 10;
|
|
protected static final ImmutableList<? extends SensorType<? extends Sensor<? super Axolotl>>> SENSOR_TYPES = ImmutableList.of(SensorType.NEAREST_LIVING_ENTITIES, SensorType.NEAREST_ADULT, SensorType.HURT_BY, SensorType.AXOLOTL_ATTACKABLES, SensorType.AXOLOTL_TEMPTATIONS);
|
|
- protected static final ImmutableList<? extends MemoryModuleType<?>> MEMORY_TYPES = ImmutableList.of(MemoryModuleType.BREED_TARGET, MemoryModuleType.NEAREST_LIVING_ENTITIES, MemoryModuleType.NEAREST_VISIBLE_LIVING_ENTITIES, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_ATTACKABLE_PLAYER, MemoryModuleType.LOOK_TARGET, MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.PATH, MemoryModuleType.ATTACK_TARGET, MemoryModuleType.ATTACK_COOLING_DOWN, MemoryModuleType.NEAREST_VISIBLE_ADULT, new MemoryModuleType[]{MemoryModuleType.HURT_BY_ENTITY, MemoryModuleType.PLAY_DEAD_TICKS, MemoryModuleType.NEAREST_ATTACKABLE, MemoryModuleType.TEMPTING_PLAYER, MemoryModuleType.TEMPTATION_COOLDOWN_TICKS, MemoryModuleType.IS_TEMPTED, MemoryModuleType.HAS_HUNTING_COOLDOWN, MemoryModuleType.IS_PANICKING});
|
|
+ // CraftBukkit - decompile error
|
|
+ protected static final ImmutableList<? extends MemoryModuleType<?>> MEMORY_TYPES = ImmutableList.<MemoryModuleType<?>>of(MemoryModuleType.BREED_TARGET, MemoryModuleType.NEAREST_LIVING_ENTITIES, MemoryModuleType.NEAREST_VISIBLE_LIVING_ENTITIES, MemoryModuleType.NEAREST_VISIBLE_PLAYER, MemoryModuleType.NEAREST_VISIBLE_ATTACKABLE_PLAYER, MemoryModuleType.LOOK_TARGET, MemoryModuleType.WALK_TARGET, MemoryModuleType.CANT_REACH_WALK_TARGET_SINCE, MemoryModuleType.PATH, MemoryModuleType.ATTACK_TARGET, MemoryModuleType.ATTACK_COOLING_DOWN, MemoryModuleType.NEAREST_VISIBLE_ADULT, new MemoryModuleType[]{MemoryModuleType.HURT_BY_ENTITY, MemoryModuleType.PLAY_DEAD_TICKS, MemoryModuleType.NEAREST_ATTACKABLE, MemoryModuleType.TEMPTING_PLAYER, MemoryModuleType.TEMPTATION_COOLDOWN_TICKS, MemoryModuleType.IS_TEMPTED, MemoryModuleType.HAS_HUNTING_COOLDOWN, MemoryModuleType.IS_PANICKING});
|
|
private static final DataWatcherObject<Integer> DATA_VARIANT = DataWatcher.<Integer>defineId(Axolotl.class, DataWatcherRegistry.INT);
|
|
private static final DataWatcherObject<Boolean> DATA_PLAYING_DEAD = DataWatcher.<Boolean>defineId(Axolotl.class, DataWatcherRegistry.BOOLEAN);
|
|
private static final DataWatcherObject<Boolean> FROM_BUCKET = DataWatcher.<Boolean>defineId(Axolotl.class, DataWatcherRegistry.BOOLEAN);
|
|
@@ -223,7 +230,7 @@
|
|
|
|
@Override
|
|
public int getMaxAirSupply() {
|
|
- return 6000;
|
|
+ return maxAirTicks; // CraftBukkit - SPIGOT-6907: re-implement LivingEntity#setMaximumAir()
|
|
}
|
|
|
|
public Axolotl.Variant getVariant() {
|
|
@@ -445,7 +452,7 @@
|
|
int i = mobeffect != null ? mobeffect.getDuration() : 0;
|
|
int j = Math.min(2400, 100 + i);
|
|
|
|
- entityhuman.addEffect(new MobEffect(MobEffects.REGENERATION, j, 0), this);
|
|
+ entityhuman.addEffect(new MobEffect(MobEffects.REGENERATION, j, 0), this, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.AXOLOTL); // CraftBukkit
|
|
}
|
|
|
|
entityhuman.removeEffect(MobEffects.MINING_FATIGUE);
|
|
@@ -495,7 +502,7 @@
|
|
|
|
@Override
|
|
public BehaviorController<Axolotl> getBrain() {
|
|
- return super.getBrain();
|
|
+ return (BehaviorController<Axolotl>) super.getBrain(); // CraftBukkit - decompile error
|
|
}
|
|
|
|
@Override
|
|
@@ -598,8 +605,8 @@
|
|
}
|
|
|
|
static {
|
|
- PrimitiveCodec primitivecodec = Codec.INT;
|
|
- IntFunction intfunction = Axolotl.Variant.BY_ID;
|
|
+ PrimitiveCodec<Integer> primitivecodec = Codec.INT; // CraftBukkit - decompile error
|
|
+ IntFunction<Axolotl.Variant> intfunction = Axolotl.Variant.BY_ID; // CraftBukkit - decompile error
|
|
|
|
Objects.requireNonNull(intfunction);
|
|
LEGACY_CODEC = primitivecodec.xmap(intfunction::apply, Axolotl.Variant::getId);
|