Files
Purpur/patches/server/0039-FEAT-Option-to-set-armorstand-step-height.patch
2021-09-16 15:17:30 -07:00

47 lines
2.1 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Sun, 6 Oct 2019 12:46:35 -0500
Subject: [PATCH] |FEAT| Option to set armorstand step height
Adjust the step-height of armorstands to make them walk up blocks when pushed against them.
Useful for plugins that make armorstands movable, like Vehicles.
$-----------------------------$
gameplay-mechanics:
armorstand:
step-height:
default: 0.0
description: |-
The step height of armorstands.
Useful for plugins that utilize armorstands as vehicles and allows them to drive over blocks without jumping, etc
$-----------------------------$
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 5fc66d7096afcfe63eba774e1dc330ac3263e4b0..7a3a364f5e3b025cc0a5694401cb9298c80cb733 100644
--- a/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
+++ b/src/main/java/net/minecraft/world/entity/decoration/ArmorStand.java
@@ -669,6 +669,7 @@ public class ArmorStand extends LivingEntity {
@Override
public void tick() {
+ maxUpStep = level.purpurConfig.armorstandStepHeight;
// Paper start
if (!this.canTick) {
if (this.noTickPoseDirty) {
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
index 8692ca2751ba6ed6ad989843261b13d2eeba669e..7eead3ef93dd4e8d912809a2c47062b95cb80168 100644
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
@@ -94,6 +94,11 @@ public class PurpurWorldConfig {
return value.isEmpty() ? fallback : value;
}
+ public float armorstandStepHeight = 0.0F;
+ private void armorstandSettings() {
+ armorstandStepHeight = (float) getDouble("gameplay-mechanics.armorstand.step-height", armorstandStepHeight);
+ }
+
public boolean idleTimeoutKick = true;
public boolean idleTimeoutTickNearbyEntities = true;
public boolean idleTimeoutCountAsSleeping = false;