mirror of
https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git
synced 2025-07-16 14:45:45 +00:00
68 lines
2.8 KiB
Diff
68 lines
2.8 KiB
Diff
--- a/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
|
+++ b/net/minecraft/world/entity/animal/armadillo/Armadillo.java
|
|
@@ -50,6 +50,10 @@
|
|
import net.minecraft.world.level.storage.ValueOutput;
|
|
import net.minecraft.world.level.storage.loot.LootTables;
|
|
|
|
+// CraftBukkit start
|
|
+import org.bukkit.event.entity.EntityDamageEvent;
|
|
+// CraftBukkit end
|
|
+
|
|
public class Armadillo extends EntityAnimal {
|
|
|
|
public static final float BABY_SCALE = 0.6F;
|
|
@@ -137,16 +141,18 @@
|
|
GameProfilerFiller gameprofilerfiller = Profiler.get();
|
|
|
|
gameprofilerfiller.push("armadilloBrain");
|
|
- this.brain.tick(worldserver, this);
|
|
+ ((BehaviorController<Armadillo>) this.brain).tick(worldserver, this); // CraftBukkit - decompile error
|
|
gameprofilerfiller.pop();
|
|
gameprofilerfiller.push("armadilloActivityUpdate");
|
|
ArmadilloAi.updateActivity(this);
|
|
gameprofilerfiller.pop();
|
|
if (this.isAlive() && !this.isBaby() && --this.scuteTime <= 0) {
|
|
+ this.forceDrops = true; // CraftBukkit
|
|
if (this.dropFromGiftLootTable(worldserver, LootTables.ARMADILLO_SHED, this::spawnAtLocation)) {
|
|
this.playSound(SoundEffects.ARMADILLO_SCUTE_DROP, 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
|
|
this.gameEvent(GameEvent.ENTITY_PLACE);
|
|
}
|
|
+ this.forceDrops = false; // CraftBukkit
|
|
|
|
this.scuteTime = this.pickNextScuteDropTime();
|
|
}
|
|
@@ -292,8 +298,13 @@
|
|
}
|
|
|
|
@Override
|
|
- protected void actuallyHurt(WorldServer worldserver, DamageSource damagesource, float f) {
|
|
- super.actuallyHurt(worldserver, damagesource, f);
|
|
+ // CraftBukkit start - void -> boolean
|
|
+ public boolean actuallyHurt(WorldServer worldserver, DamageSource damagesource, float f, EntityDamageEvent event) {
|
|
+ boolean damageResult = super.actuallyHurt(worldserver, damagesource, f, event);
|
|
+ if (!damageResult) {
|
|
+ return false;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
if (!this.isNoAi() && !this.isDeadOrDying()) {
|
|
if (damagesource.getEntity() instanceof EntityLiving) {
|
|
this.getBrain().setMemoryWithExpiry(MemoryModuleType.DANGER_DETECTED_RECENTLY, true, 80L);
|
|
@@ -305,6 +316,7 @@
|
|
}
|
|
|
|
}
|
|
+ return true; // CraftBukkit
|
|
}
|
|
|
|
@Override
|
|
@@ -328,7 +340,9 @@
|
|
if (world instanceof WorldServer) {
|
|
WorldServer worldserver = (WorldServer) world;
|
|
|
|
+ this.forceDrops = true; // CraftBukkit
|
|
this.spawnAtLocation(worldserver, new ItemStack(Items.ARMADILLO_SCUTE));
|
|
+ this.forceDrops = false; // CraftBukkit
|
|
this.gameEvent(GameEvent.ENTITY_INTERACT);
|
|
this.playSound(SoundEffects.ARMADILLO_BRUSH);
|
|
}
|