mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 12dec20 Bump paerweight to 1.1.7 e33ed89 Get short commit ref using a more proper method 7d6147d Remove now unneeded patch due to paperweight 1.1.7 e72fa41 Update task dependency for includeMappings so the new task isn't skipped 0ad5526 Trim whitspace off of git hash (oops) Tuinity Changes: e878ba9 Update paper 2bd2849 Bring back fix codec spam patch
59 lines
3.6 KiB
Diff
59 lines
3.6 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/EntityType.java b/src/main/java/net/minecraft/world/entity/EntityType.java
|
|
index 500d4494db3c9663e02f6ce02c2104a9b08d6dc4..00b6243977a318f81e9524968f21a7f0e24f425d 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/EntityType.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/EntityType.java
|
|
@@ -280,7 +280,8 @@ public class EntityType<T extends Entity> implements EntityTypeTest<Entity, T> {
|
|
private Component description;
|
|
@Nullable
|
|
private ResourceLocation lootTable;
|
|
- private final EntityDimensions dimensions;
|
|
+ private EntityDimensions dimensions; // Purpur - remove final
|
|
+ public void setDimensions(EntityDimensions dimensions) { this.dimensions = dimensions; } // Purpur
|
|
|
|
private static <T extends Entity> EntityType<T> register(String id, EntityType.Builder type) { // CraftBukkit - decompile error
|
|
return (EntityType) Registry.register((Registry) Registry.ENTITY_TYPE, id, (Object) type.build(id));
|
|
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 6e0b5fbf5b0d216b6b7c647d45ef37cd6b591717..5ebedd6a156b06e98aded57c817f63429a1ae380 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
|
@@ -393,6 +393,7 @@ public class EnderMan extends Monster implements NeutralMob {
|
|
if (this.isInvulnerableTo(source)) {
|
|
return false;
|
|
} else if (getRider() != null) { return super.hurt(source, amount); // Purpur - no teleporting on damage
|
|
+ } else if (net.pl3x.purpur.PurpurConfig.endermanShortHeight && source == DamageSource.IN_WALL) { return false; // Purpur - no suffocation damage if short height
|
|
} else if (source instanceof IndirectEntityDamageSource) {
|
|
if (this.tryEscape(com.destroystokyo.paper.event.entity.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 d7cce288e6eeef6d63325a4d30a03acf36933b9b..dcc1548a3ca7afab671ede65a8ef265e4a80772a 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
@@ -3,6 +3,8 @@ package net.pl3x.purpur;
|
|
import co.aikar.timings.TimingsManager;
|
|
import com.google.common.base.Throwables;
|
|
import net.minecraft.server.MinecraftServer;
|
|
+import net.minecraft.world.entity.EntityDimensions;
|
|
+import net.minecraft.world.entity.EntityType;
|
|
import net.pl3x.purpur.command.PurpurCommand;
|
|
import org.bukkit.Bukkit;
|
|
import org.bukkit.command.Command;
|
|
@@ -310,6 +312,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) EntityType.ENDERMAN.setDimensions(EntityDimensions.scalable(0.6F, 1.9F));
|
|
+ }
|
|
+
|
|
public static boolean dontSendUselessEntityPackets = false;
|
|
private static void dontSendUselessEntityPackets() {
|
|
dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets);
|