Files
Purpur/patches/server/0136-Movement-options-for-armor-stands.patch
Ben Kerllenevich 1ba98f8537 Updated Upstream (Paper & Pufferfish)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@a90092e Updated Upstream (CraftBukkit/Spigot) (#7848)
PaperMC/Paper@79e07f3 Fix addPassenger for Marker (#7762)
PaperMC/Paper@182a609 Fix duplicate world keys via createWorld (#7614)
PaperMC/Paper@b6a6544 Provide ComponentSerializer services (#7527)
PaperMC/Paper@3f7fbe3 Fix cb's janky level name in WorldCreator (#7851)
PaperMC/Paper@af3b377 Update ForgeFlower (#7857)
PaperMC/Paper@9667181 Fix OfflinePlayer#getBedSpawnLocation (#7861)
PaperMC/Paper@c123915 Fix FurnaceInventory for smokers and blast furnaces (#7249)
PaperMC/Paper@f7382f5 Remove unneeded UOE when copying biome sources (#7629)
PaperMC/Paper@6b035fd Update default vanilla command perms (#7386)
PaperMC/Paper@f210f67 Update the rewriteForIde for new cb package version (#7242)
PaperMC/Paper@3f7111d Fix EntityEquipment and related javadocs (#7380)
PaperMC/Paper@78e6431 Add default kick msg component (#6886)
PaperMC/Paper@04e1b07 Check HAProxyMessage type is PROXY (#7864)
PaperMC/Paper@00c6ae8 Implement Translatable on CreativeCategory (#7587)
PaperMC/Paper@7602dd2 Sanitize Sent BlockEntity NBT (#7010)
PaperMC/Paper@2d17a50 Add translation keys to GameMode enum (#7081)
PaperMC/Paper@c5caee3 Prevent entity loading causing async lookups (#7553)
PaperMC/Paper@71fe3c6 Add numeric string completion suggestions as int suggestions (#6360)
PaperMC/Paper@b1ac25f Respect x-ray permission in World#refreshChunk (#7214)

Pufferfish Changes:
pufferfish-gg/Pufferfish@6186c1f Updated Upstream (Paper)
pufferfish-gg/Pufferfish@b235d83 Fix regression with SIMD vector sizes not matching 256-bits
pufferfish-gg/Pufferfish@27cb1ac Updated Upstream (Paper)
2022-06-02 10:10:09 -04:00

89 lines
4.9 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 8477b106e7f30711234ac45a26f813753c5bb9f9..ab287a326302d670f0aeabf016b69aed6a43c21b 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -1636,7 +1636,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
return this.isInWater() || flag;
}
- void updateInWaterStateAndDoWaterCurrentPushing() {
+ public void updateInWaterStateAndDoWaterCurrentPushing() { // Purpur - package-private -> public
if (this.getVehicle() instanceof Boat) {
this.wasTouchingWater = false;
} else if (this.updateFluidHeightAndDoFluidPushing(FluidTags.WATER, 0.014D)) {
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 50370dc8697569a4e5cf8ec3714d227a59357d64..e9e24435057cff9c0af758ca2aa822c3b1c3593d 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
@@ -98,10 +98,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.armorStandTick; // 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;
@@ -995,4 +997,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 ee15bf8d8325977d6333e0d83ac2b16f4c78969e..178bb27f204760e4ca3ad919024b4bae74244cbd 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -98,10 +98,16 @@ public class PurpurWorldConfig {
public float armorstandStepHeight = 0.0F;
public boolean armorstandSetNameVisible = false;
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 useBetterMending = false;