mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 09:27:43 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 41e6073ce [Auto] Updated Upstream (CraftBukkit) 6f93dc95d Add cause to Weather/ThunderChangeEvents (#4832) 507cf19b3 [CI-SKIP] [Auto] Rebuild Patches afe0785bf Added PlayerPurchaseEvent for standalone Merchant GUIs (#5583) 615df3d8a Fix entity motion tag from mob spawners (#5718) 2d34898b5 Add methods for getting default item attributes (#5593) d9766433e Add EntityInsideBlockEvent (#5596)
46 lines
2.9 KiB
Diff
46 lines
2.9 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: JustDoom <justdoomdev@gmail.com>
|
|
Date: Fri, 5 Mar 2021 14:23:16 -0500
|
|
Subject: [PATCH] Dont run with scissors!
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/network/PlayerConnection.java b/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
|
index 2bf4acf2e08abcfdf8f2529480b48f1eb9b85d27..fda4e5b5c15e9d1fab48006991ec8139907abc74 100644
|
|
--- a/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
|
+++ b/src/main/java/net/minecraft/server/network/PlayerConnection.java
|
|
@@ -1552,6 +1552,12 @@ public class PlayerConnection implements PacketListenerPlayIn {
|
|
this.player.fallDistance = 0.0F;
|
|
}
|
|
|
|
+ // Purpur Start
|
|
+ if (this.player.isSprinting() && this.player.getWorldServer().purpurConfig.dontRunWithScissors && (this.player.getItemInHand(EnumHand.MAIN_HAND).getItem() == Items.SHEARS || this.player.getItemInHand(EnumHand.OFF_HAND).getItem() == Items.SHEARS) && (int) (Math.random() * 10) == 0) {
|
|
+ this.player.damageEntity(net.minecraft.world.damagesource.DamageSource.MAGIC, (float) this.player.getWorldServer().purpurConfig.scissorsRunningDamage);
|
|
+ }
|
|
+ // Purpur End
|
|
+
|
|
this.player.checkMovement(this.player.locX() - d0, this.player.locY() - d1, this.player.locZ() - d2);
|
|
this.o = this.player.locX();
|
|
this.p = this.player.locY();
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index b2d7e4ee4ecef476d633278c960130110c862520..02ebb0fc704b5e77cf508893d67feef036df80ed 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -203,6 +203,8 @@ public class PurpurWorldConfig {
|
|
public List<Item> itemImmuneToExplosion = new ArrayList<>();
|
|
public List<Item> itemImmuneToFire = new ArrayList<>();
|
|
public List<Item> itemImmuneToLightning = new ArrayList<>();
|
|
+ public boolean dontRunWithScissors = false;
|
|
+ public double scissorsRunningDamage = 1D;
|
|
private void itemSettings() {
|
|
itemImmuneToCactus.clear();
|
|
getList("gameplay-mechanics.item.immune.cactus", new ArrayList<>()).forEach(key -> {
|
|
@@ -240,6 +242,8 @@ public class PurpurWorldConfig {
|
|
Item item = IRegistry.ITEM.get(new MinecraftKey(key.toString()));
|
|
if (item != Items.AIR) itemImmuneToLightning.add(item);
|
|
});
|
|
+ dontRunWithScissors = getBoolean("gameplay-mechanics.item.shears.damage-if-sprinting", dontRunWithScissors);
|
|
+ scissorsRunningDamage = getDouble("gameplay-mechanics.item.shears.sprinting-damage", scissorsRunningDamage);
|
|
}
|
|
|
|
public boolean idleTimeoutKick = true;
|