mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
59 lines
3.5 KiB
Diff
59 lines
3.5 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
Date: Mon, 10 Aug 2020 21:46:22 -0500
|
|
Subject: [PATCH] Short enderman height
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/EntityTypes.java b/src/main/java/net/minecraft/world/entity/EntityTypes.java
|
|
index acf4cbfd9780f186880c595c8fac8d91b8f56e68..cc963bbc0fa909b3121a25786b511b31ee4b9561 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/EntityTypes.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/EntityTypes.java
|
|
@@ -268,7 +268,8 @@ public class EntityTypes<T extends Entity> {
|
|
private IChatBaseComponent bp;
|
|
@Nullable
|
|
private MinecraftKey bq;
|
|
- private final EntitySize br;
|
|
+ public void setEntitySize(EntitySize entitySize) { this.br = entitySize; } // Purpur - OBFHELPER
|
|
+ private EntitySize br; // Purpur - remove final
|
|
|
|
public java.util.function.Supplier<String> getEntityName = () -> IRegistry.ENTITY_TYPE.getKey(this).toString(); // Airplane - create lambda ones
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java
|
|
index 72142f5c777c6218050bc2b69891072d256ea57d..52aa47036acee2ec21ae2d6f4df634ecbf04b3b0 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/EntityEnderman.java
|
|
@@ -383,6 +383,7 @@ public class EntityEnderman extends EntityMonster implements IEntityAngerable {
|
|
public boolean damageEntity(DamageSource damagesource, float f) {
|
|
if (this.isInvulnerable(damagesource)) {
|
|
return false;
|
|
+ } else if (net.pl3x.purpur.PurpurConfig.endermanShortHeight && damagesource == DamageSource.STUCK) { return false; // Purpur - no suffocation damage if short height
|
|
} else if (damagesource instanceof EntityDamageSourceIndirect) {
|
|
if (this.tryEscape(EndermanEscapeEvent.Reason.INDIRECT)) { // Paper start
|
|
for (int i = 0; i < 64; ++i) {
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
index 1d6da0c0753e822bba9d7847980235ff876e1ee8..76a1f157dc4ae0fdf804f3340b72dfa17ffbbb94 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
@@ -4,6 +4,8 @@ import co.aikar.timings.TimingsManager;
|
|
import com.google.common.base.Throwables;
|
|
import net.minecraft.locale.LocaleLanguage;
|
|
import net.minecraft.server.MinecraftServer;
|
|
+import net.minecraft.world.entity.EntitySize;
|
|
+import net.minecraft.world.entity.EntityTypes;
|
|
import net.pl3x.purpur.command.PurpurCommand;
|
|
import org.bukkit.Bukkit;
|
|
import org.bukkit.command.Command;
|
|
@@ -192,6 +194,12 @@ public class PurpurConfig {
|
|
enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
|
|
}
|
|
|
|
+ public static boolean endermanShortHeight = false;
|
|
+ private static void entitySettings() {
|
|
+ endermanShortHeight = getBoolean("settings.entity.enderman.short-height", endermanShortHeight);
|
|
+ if (endermanShortHeight) EntityTypes.ENDERMAN.setEntitySize(EntitySize.b(0.6F, 1.9F));
|
|
+ }
|
|
+
|
|
public static boolean dontSendUselessEntityPackets = false;
|
|
private static void dontSendUselessEntityPackets() {
|
|
dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
|