mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 08:57:44 +01:00
Upstream has released updates that appears to apply and compile correctly Tuinity Changes: 3b008f5 Optimisations 200f825 Actually unload POI data db64f14 Make sure to despawn entities if they are outside the player general 89276ac Fix villagers aggressively looking at people 8830cef Remove streams for poi searching in some zombie pathfinding a17dc2c Attempt to fix incorrect nearest village distance tracker updating ef8cd34 Fix NPE 3e45700Do not return complex parts for entity by class lookup 2110847 Rewrite getClosestEntity 460581d Fix getClosestEntity not working 2cb36ca Optimise non-flush packet sending 784b838 Some fixes e2dcdd1 Correct return value for ChunkCache#getCubes 968512b Add Velocity natives for encryption and compression (#188) 102d60b Rebuild patches 57fed71 Fix decompression with Velocity natives 442890b Fix decompression with Velocity natives (#191) 0179ea8 Re-Add region manager and notify patch cbffdcc Do not mark entities in unloaded chunks as being in blocks f2eef4a Fixup dev branch patches and store reverted patches in revert folder
57 lines
2.9 KiB
Diff
57 lines
2.9 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
Date: Mon, 5 Oct 2020 12:15:14 -0500
|
|
Subject: [PATCH] Stonecutter damage
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockStonecutter.java b/src/main/java/net/minecraft/server/BlockStonecutter.java
|
|
index 3e57abd33e..08ba9e1c4e 100644
|
|
--- a/src/main/java/net/minecraft/server/BlockStonecutter.java
|
|
+++ b/src/main/java/net/minecraft/server/BlockStonecutter.java
|
|
@@ -71,4 +71,16 @@ public class BlockStonecutter extends Block {
|
|
public boolean a(IBlockData iblockdata, IBlockAccess iblockaccess, BlockPosition blockposition, PathMode pathmode) {
|
|
return false;
|
|
}
|
|
+
|
|
+ // Purpur start
|
|
+ @Override
|
|
+ public void stepOn(World world, BlockPosition pos, Entity entity) {
|
|
+ if (world.purpurConfig.stonecutterDamage > 0.0F && entity instanceof EntityLiving) {
|
|
+ org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = world.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ());
|
|
+ entity.damageEntity(DamageSource.CACTUS, world.purpurConfig.stonecutterDamage);
|
|
+ org.bukkit.craftbukkit.event.CraftEventFactory.blockDamage = null;
|
|
+ }
|
|
+ super.stepOn(world, pos, entity);
|
|
+ }
|
|
+ // Purpur end
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/PathfinderNormal.java b/src/main/java/net/minecraft/server/PathfinderNormal.java
|
|
index 33804e6893..fabadcd7a2 100644
|
|
--- a/src/main/java/net/minecraft/server/PathfinderNormal.java
|
|
+++ b/src/main/java/net/minecraft/server/PathfinderNormal.java
|
|
@@ -480,7 +480,7 @@ public class PathfinderNormal extends PathfinderAbstract {
|
|
return iblockdata.neighbourOverridePathType = PathType.DANGER_CACTUS; // Tuinity - reduce pathfinder branching
|
|
}
|
|
|
|
- if (iblockdata.a(Blocks.SWEET_BERRY_BUSH)) {
|
|
+ if (iblockdata.a(Blocks.SWEET_BERRY_BUSH) || iblockdata.a(Blocks.STONECUTTER)) { // Purpur
|
|
return iblockdata.neighbourOverridePathType = PathType.DANGER_OTHER; // Tuinity - reduce pathfinder branching
|
|
}
|
|
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
index 400d793b15..8e97eb92dd 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java
|
|
@@ -376,6 +376,11 @@ public class PurpurWorldConfig {
|
|
spawnerDeactivateByRedstone = getBoolean("blocks.spawner.deactivate-by-redstone", spawnerDeactivateByRedstone);
|
|
}
|
|
|
|
+ public float stonecutterDamage = 0.0F;
|
|
+ private void stonecutterSettings() {
|
|
+ stonecutterDamage = (float) getDouble("blocks.stonecutter.damage", stonecutterDamage);
|
|
+ }
|
|
+
|
|
public boolean turtleEggsBreakFromExpOrbs = true;
|
|
public boolean turtleEggsBreakFromItems = true;
|
|
public boolean turtleEggsBreakFromMinecarts = true;
|