fix endermen projectile issues

This commit is contained in:
Ben
2023-03-18 18:52:36 -04:00
parent 389fb6bc02
commit 95ad375dd3
2 changed files with 12 additions and 10 deletions

View File

@@ -5,20 +5,19 @@ Subject: [PATCH] Config to disable Enderman teleport on projectile hit
diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
index 2ac667ec7bdc59363af0bd2209f6e456372d73e7..5e2b7b4caf6d6d823943e2d56288758265f0d506 100644
index 60720f0bad840d35c9d0f1fc327f6069b348a41a..9e5f6666cbc4303d095a4f95db9acd0bbc38f825 100644
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
@@ -428,7 +428,7 @@ public class EnderMan extends Monster implements NeutralMob {
boolean flag = source.getDirectEntity() instanceof ThrownPotion;
boolean flag1;
@@ -438,6 +438,7 @@ public class EnderMan extends Monster implements NeutralMob {
} else {
flag1 = flag && this.hurtWithCleanWater(source, (ThrownPotion) source.getDirectEntity(), amount);
- if (!source.is(DamageTypeTags.IS_PROJECTILE) && !flag) {
+ if (!(this.level.purpurConfig.endermanIgnoreProjectiles && source.is(DamageTypeTags.IS_PROJECTILE)) && !flag) {
flag1 = super.hurt(source, amount);
if (!this.level.isClientSide() && !(source.getEntity() instanceof LivingEntity) && this.random.nextInt(10) != 0) {
this.teleport();
+ if (!flag1 && this.level.purpurConfig.endermanIgnoreProjectiles) return super.hurt(source, amount); // Purpur
if (this.tryEscape(com.destroystokyo.paper.event.entity.EndermanEscapeEvent.Reason.INDIRECT)) { // Paper start
for (int i = 0; i < 64; ++i) {
if (this.teleport()) {
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 8c420d6710d3dd97ed488f5a0e00f7c8fbc13b6d..8f43f33e86e012c9e6c199ec159ce34b4e45cdef 100644
index 967f131637618e03f119c05aadaefa0dc3a6b6fa..4a7b01606a2fe7aad5ecaf515e2ba8d4fa328539 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -1334,6 +1334,7 @@ public class PurpurWorldConfig {

3
todo.txt Normal file
View File

@@ -0,0 +1,3 @@
- fix ridables around water
- test player ridable underwater
- maybe custom damage type instead of magic