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: b8020379c Extract Adventure Version into a variable, add reminder to update the linked JD on the homepage (#5422) Airplane Changes: f5fb02447 Temporarily revert patch 3c728a7a9 Oops, these 2 too 37a93e561 Your daily dose of 1-3% optimization patches bbd689a77 Remove useless check
97 lines
5.3 KiB
Diff
97 lines
5.3 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 armor 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/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
index 4d64fb19c3c9cce41e89ba4d702e687b34620b7e..2545b0891a299301a8d9e194e795b0f3856f2178 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
|
@@ -1500,7 +1500,7 @@ public abstract class Entity implements INamableTileEntity, ICommandListener, ne
|
|
return this.isInWater() || flag;
|
|
}
|
|
|
|
- void aL() {
|
|
+ public void aL() { updateInWaterStateAndDoWaterCurrentPushing(); } public void updateInWaterStateAndDoWaterCurrentPushing() { // Purpur
|
|
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/world/entity/decoration/EntityArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java
|
|
index 43dc0925887e2e9e86445cccff57be7994ca0d58..ecb797e67554d30e35b3aca4d0fc9b0e3f6c1a50 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/decoration/EntityArmorStand.java
|
|
@@ -36,6 +36,7 @@ import net.minecraft.world.item.ItemStack;
|
|
import net.minecraft.world.item.Items;
|
|
import net.minecraft.world.level.World;
|
|
import net.minecraft.world.level.block.Block;
|
|
+import net.minecraft.world.level.block.BlockFence;
|
|
import net.minecraft.world.level.block.Blocks;
|
|
import net.minecraft.world.level.material.EnumPistonReaction;
|
|
import net.minecraft.world.phys.Vec3D;
|
|
@@ -87,10 +88,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;
|
|
@@ -932,4 +935,18 @@ public class EntityArmorStand extends EntityLiving {
|
|
return true;
|
|
}
|
|
// Paper end
|
|
+
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ public void updateInWaterStateAndDoWaterCurrentPushing() {
|
|
+ if (this.world.purpurConfig.armorstandWaterMovement &&
|
|
+ (this.world.purpurConfig.armorstandWaterFence || !(world.getType(getBlockLocation().down()).getBlock() instanceof BlockFence)))
|
|
+ super.updateInWaterStateAndDoWaterCurrentPushing();
|
|
+ }
|
|
+
|
|
+ @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 4343e7536fa5320579496f6c116fb93c938b34e5..a3e6844602b8baea643ec1ae65ef7161789cac6c 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;
|