Files
Purpur/patches/server/0126-Movement-options-for-armor-stands.patch
granny b53946bebb Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@cc491a3 Finish updating chunk system patch
PaperMC/Paper@619d7c9 Add in some patches
PaperMC/Paper@902691b Apply last patch
PaperMC/Paper@efb4197 Fix final compilation issues
PaperMC/Paper@57a5924 Fix boot errors
PaperMC/Paper@c1def9d Updated Upstream (CraftBukkit/Spigot)
PaperMC/Paper@a0a2e72 fix sculk npe
PaperMC/Paper@318a08c add missing block entity type to CraftBlockStates
PaperMC/Paper@aed9ef0 Update adventure
PaperMC/Paper@9d42879 Fix breaking pots throwing exception
PaperMC/Paper@59060aa fix some failing tests
PaperMC/Paper@e325e37 add missing call to EntityInsideBlockEvent
PaperMC/Paper@8ce5219 Fix inconsistent chunk sending with vanilla
PaperMC/Paper@04509f0 Fix crash relating to "Already sent chunk"
PaperMC/Paper@c9eb393 Updated Upstream (Bukkit)
PaperMC/Paper@21f2d15 Avoid duplicate poi entries from the first section (#9235)
PaperMC/Paper@3621d76 Fix collision between AABB and a dot (#8733)
PaperMC/Paper@ccb194b Move block farther away for Player#setRotation (#8514)
PaperMC/Paper@03c3587 fix not editable sign after openSign
PaperMC/Paper@6d74ad1 Finish tests & bad calls
PaperMC/Paper@e829a9d Fix javadoc
PaperMC/Paper@82c6479 Add back Anti-Xray patch (#9283)
PaperMC/Paper@0d969f0 comment out update logic from build.gradle.kts
PaperMC/Paper@ea9fdc3 Ignore inline definitions of trim material & pattern
PaperMC/Paper@9ada4bd Prevent the rcon thread from attempting connections after shutdown
PaperMC/Paper@c9e125f Fix setListenerRange for calibrated sculk sensors
PaperMC/Paper@9ebf75d fix some more 1.20 tracking issues
PaperMC/Paper@f9fc44f add side to PlayerSignCommandPreprocessEvent
PaperMC/Paper@4e3febb fix missing trigger entity for xp orb from breeding
PaperMC/Paper@4b5f847 Minimise EntityFertilizeEggEvent and add sniffer (#9280)
2023-06-09 05:22:52 -07:00

89 lines
4.8 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 54b1404fed0df43795c24f2f84306fe7aceb7c6d..c3311e8d49b874323afa28e4f4891fe7d312334c 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1828,7 +1828,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
return this.isInWater() || flag;
}
- void updateInWaterStateAndDoWaterCurrentPushing() {
+ public void updateInWaterStateAndDoWaterCurrentPushing() { // Purpur - package-private -> public
Entity entity = this.getVehicle();
if (entity instanceof Boat) {
diff --git a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
index 9eb196ee4061bb4c5713f33e8b16d91ec52711cd..ffb3ae1d36dda5f521cf3b292d819cb354844806 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
@@ -99,10 +99,12 @@ public class ArmorStand extends LivingEntity {
private boolean noTickPoseDirty = false;
private boolean noTickEquipmentDirty = false;
// Paper end
+ public boolean canMovementTick = true; // Purpur
public ArmorStand(EntityType<? extends ArmorStand> type, Level world) {
super(type, world);
if (world != null) this.canTick = world.paperConfig().entities.armorStands.tick; // Paper - armour stand ticking
+ if (world != null) this.canMovementTick = world.purpurConfig.armorstandMovement; // Purpur
this.handItems = NonNullList.withSize(2, ItemStack.EMPTY);
this.armorItems = NonNullList.withSize(4, ItemStack.EMPTY);
this.headPose = ArmorStand.DEFAULT_HEAD_POSE;
@@ -1006,4 +1008,18 @@ public class ArmorStand extends LivingEntity {
}
// Paper end
// Paper end
+
+ // Purpur start
+ @Override
+ public void updateInWaterStateAndDoWaterCurrentPushing() {
+ if (this.level().purpurConfig.armorstandWaterMovement &&
+ (this.level().purpurConfig.armorstandWaterFence || !(level().getBlockState(blockPosition().below()).getBlock() instanceof net.minecraft.world.level.block.FenceBlock)))
+ super.updateInWaterStateAndDoWaterCurrentPushing();
+ }
+
+ @Override
+ public void aiStep() {
+ if (this.canMovementTick && this.canMove) super.aiStep();
+ }
+ // Purpur end
}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 2f8a7e1ea33e1dae5390a5ee42fe74ce56e952d7..0b4147b270f5683661686873a662df04347a702d 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -101,10 +101,16 @@ public class PurpurWorldConfig {
public float armorstandStepHeight = 0.0F;
public boolean armorstandSetNameVisible = true;
public boolean armorstandFixNametags = false;
+ public boolean armorstandMovement = true;
+ public boolean armorstandWaterMovement = true;
+ public boolean armorstandWaterFence = true;
private void armorstandSettings() {
armorstandStepHeight = (float) getDouble("gameplay-mechanics.armorstand.step-height", armorstandStepHeight);
armorstandSetNameVisible = getBoolean("gameplay-mechanics.armorstand.set-name-visible-when-placing-with-custom-name", armorstandSetNameVisible);
armorstandFixNametags = getBoolean("gameplay-mechanics.armorstand.fix-nametags", armorstandFixNametags);
+ 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 arrowMovementResetsDespawnCounter = true;