mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 08:57:44 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 5b20df6bf added PlayerNameEntityEvent ff9c82444 Add worldborder events 616b1f3cd consider enchants for destroy speed aaef1d5cc fix file conversion 674d8f7f7 Make discovered maps config work in treasure maps from loot tables too be1687914 stop firing pressure plate EntityInteractEvent for ignored entities (fixes #4962) 7d56f38ed Do not use the bukkit singleton for the GUI (Fixes #5301) 4c9bdf53a Updated Upstream (Bukkit/CraftBukkit/Spigot) (#5299) 8647bd130 Improve ServerGUI fcc6d3359 Throw proper exception on empty JsonList file 17d2e1291 Fix interact event in adventure mode 964e0bf42 MC-29274: Fix Wither hostility towards players 9e24a5213 Fixed furnace cook-speed multiplier losing precision when calculating cook time c7e42faa3 Do not create unnecessary copies of the passenger list 40881ad67 added tnt minecarts to the tnt height nerf 26be708f4 Remove streams from SensorNearest 5b5989b21 fix nullability of playerlist header/footer, closes #5290 45bc531dd Fix Material#getTranslationKey for Block Materials (#5294)
89 lines
4.7 KiB
Diff
89 lines
4.7 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Mariell Hoversholm <proximyst@proximyst.com>
|
|
Date: Sat, 9 Jan 2021 22:22:59 +0100
|
|
Subject: [PATCH] Movement options for armour stands
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/Entity.java b/src/main/java/net/minecraft/server/Entity.java
|
|
index fd2becb531ec8bd1cb2125f75a2f3a21cf352adb..68e019869c3a5907a63cbed59958b25a028d349e 100644
|
|
--- a/src/main/java/net/minecraft/server/Entity.java
|
|
+++ b/src/main/java/net/minecraft/server/Entity.java
|
|
@@ -1360,7 +1360,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, Ke
|
|
return this.isInWater() || flag;
|
|
}
|
|
|
|
- void aL() {
|
|
+ void aL() { // Purpur - diff on change; this is `updateInWaterStateAndDoWaterCurrentPushing()V`
|
|
if (this.getVehicle() instanceof EntityBoat) {
|
|
this.inWater = false;
|
|
} else if (this.a((Tag) TagsFluid.WATER, 0.014D)) {
|
|
diff --git a/src/main/java/net/minecraft/server/EntityArmorStand.java b/src/main/java/net/minecraft/server/EntityArmorStand.java
|
|
index 759a8f95038778aead2f33a65a2d8f2d6b26a765..74fda434ed7beb6612f46ed75fdccad59f394b60 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityArmorStand.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityArmorStand.java
|
|
@@ -52,10 +52,12 @@ public class EntityArmorStand extends EntityLiving {
|
|
private boolean noTickPoseDirty = false;
|
|
private boolean noTickEquipmentDirty = false;
|
|
// Paper end
|
|
+ public boolean canMovementTick = true; // Purpur
|
|
|
|
public EntityArmorStand(EntityTypes<? extends EntityArmorStand> entitytypes, World world) {
|
|
super(entitytypes, world);
|
|
if (world != null) this.canTick = world.paperConfig.armorStandTick; // Paper - armour stand ticking
|
|
+ if (world != null) this.canMovementTick = world.purpurConfig.armorstandMovement; // Purpur
|
|
this.handItems = NonNullList.a(2, ItemStack.b);
|
|
this.armorItems = NonNullList.a(4, ItemStack.b);
|
|
this.headPose = EntityArmorStand.bj;
|
|
@@ -897,4 +899,18 @@ public class EntityArmorStand extends EntityLiving {
|
|
return true;
|
|
}
|
|
// Paper end
|
|
+
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ void aL() {
|
|
+ if (this.world.purpurConfig.armorstandWaterMovement &&
|
|
+ (this.world.purpurConfig.armorstandWaterFence || !(world.getType(getBlockLocation().down()).getBlock() instanceof BlockFence)))
|
|
+ super.aL();
|
|
+ }
|
|
+
|
|
+ @Override
|
|
+ public void movementTick() {
|
|
+ if (this.canMovementTick && this.canMove) super.movementTick();
|
|
+ }
|
|
+ // Purpur end
|
|
}
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index e248681fc8d1c91077e2135a70347bf4c5282686..a494a9e15456cf684c62957e8563ef06627695f9 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -111,10 +111,16 @@ public class PurpurWorldConfig {
|
|
public boolean armorstandSetNameVisible = false;
|
|
public boolean armorstandFixNametags = false;
|
|
public float armorstandStepHeight = 0.0F;
|
|
+ public boolean armorstandMovement = true;
|
|
+ public boolean armorstandWaterMovement = true;
|
|
+ public boolean armorstandWaterFence = true;
|
|
private void armorstandSettings() {
|
|
armorstandSetNameVisible = getBoolean("gameplay-mechanics.armorstand.set-name-visible-when-placing-with-custom-name", armorstandSetNameVisible);
|
|
armorstandFixNametags = getBoolean("gameplay-mechanics.armorstand.fix-nametags", armorstandFixNametags);
|
|
armorstandStepHeight = (float) getDouble("gameplay-mechanics.armorstand.step-height", armorstandStepHeight);
|
|
+ armorstandMovement = getBoolean("gameplay-mechanics.armorstand.can-movement-tick", armorstandMovement);
|
|
+ armorstandWaterMovement = getBoolean("gameplay-mechanics.armorstand.can-move-in-water", armorstandWaterMovement);
|
|
+ armorstandWaterFence = getBoolean("gameplay-mechanics.armorstand.can-move-in-water-over-fence", armorstandWaterFence);
|
|
}
|
|
|
|
public boolean controllableMinecarts = false;
|