mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 15:00:13 +01:00
warden AI
This commit is contained in:
parent
f73e864f18
commit
c6a426beda
4 changed files with 22 additions and 33 deletions
|
@ -0,0 +1,11 @@
|
|||
--- a/net/minecraft/world/entity/ai/behavior/warden/Digging.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/warden/Digging.java
|
||||
@@ -39,7 +_,7 @@
|
||||
@Override
|
||||
protected void stop(ServerLevel level, E entity, long gameTime) {
|
||||
if (entity.getRemovalReason() == null) {
|
||||
- entity.remove(Entity.RemovalReason.DISCARDED);
|
||||
+ entity.remove(Entity.RemovalReason.DISCARDED, org.bukkit.event.entity.EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - Add bukkit remove cause
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
--- a/net/minecraft/world/entity/ai/behavior/warden/SonicBoom.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/warden/SonicBoom.java
|
||||
@@ -83,7 +_,7 @@
|
||||
if (livingEntity.hurtServer(level, level.damageSources().sonicBoom(owner), 10.0F)) {
|
||||
double d = 0.5 * (1.0 - livingEntity.getAttributeValue(Attributes.KNOCKBACK_RESISTANCE));
|
||||
double d1 = 2.5 * (1.0 - livingEntity.getAttributeValue(Attributes.KNOCKBACK_RESISTANCE));
|
||||
- livingEntity.push(vec32.x() * d1, vec32.y() * d, vec32.z() * d1);
|
||||
+ livingEntity.push(vec32.x() * d1, vec32.y() * d, vec32.z() * d1, owner); // Paper - Add EntityKnockbackByEntityEvent and EntityPushedByEntityAttackEvent
|
||||
}
|
||||
});
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
--- a/net/minecraft/world/entity/ai/behavior/warden/Digging.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/warden/Digging.java
|
||||
@@ -10,6 +10,10 @@
|
||||
import net.minecraft.world.entity.ai.memory.MemoryStatus;
|
||||
import net.minecraft.world.entity.monster.warden.Warden;
|
||||
|
||||
+// CraftBukkit start - imports
|
||||
+import org.bukkit.event.entity.EntityRemoveEvent;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class Digging<E extends Warden> extends Behavior<E> {
|
||||
|
||||
public Digging(int duration) {
|
||||
@@ -37,7 +41,7 @@
|
||||
|
||||
protected void stop(ServerLevel worldserver, E e0, long i) {
|
||||
if (e0.getRemovalReason() == null) {
|
||||
- e0.remove(Entity.RemovalReason.DISCARDED);
|
||||
+ e0.remove(Entity.RemovalReason.DISCARDED, EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - Add bukkit remove cause
|
||||
}
|
||||
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
--- a/net/minecraft/world/entity/ai/behavior/warden/SonicBoom.java
|
||||
+++ b/net/minecraft/world/entity/ai/behavior/warden/SonicBoom.java
|
||||
@@ -83,7 +83,7 @@
|
||||
if (target.hurtServer(world, world.damageSources().sonicBoom(entity), 10.0F)) {
|
||||
double d = 0.5 * (1.0 - target.getAttributeValue(Attributes.KNOCKBACK_RESISTANCE));
|
||||
double e = 2.5 * (1.0 - target.getAttributeValue(Attributes.KNOCKBACK_RESISTANCE));
|
||||
- target.push(vec33.x() * e, vec33.y() * d, vec33.z() * e);
|
||||
+ target.push(vec33.x() * e, vec33.y() * d, vec33.z() * e, entity); // Paper - Add EntityKnockbackByEntityEvent and EntityPushedByEntityAttackEvent
|
||||
}
|
||||
});
|
||||
}
|
Loading…
Reference in a new issue