Paper/Spigot-Server-Patches/0074-Re-add-Spigot-s-hopper-check-feature.patch
Aikar 3faaaab75d Optimize isInvalidYLocation, getType and getBlockData
Some pretty micro optimizations, but this is the hottest method in the server....

This will drastically reduce number of operations to perform getType

the 2 previous patches was squashed into 1
2016-06-22 22:43:02 -04:00

41 lines
1.6 KiB
Diff

From 420cb861f8b6dad37dd2700405637935cd23a682 Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Sat, 12 Mar 2016 13:37:50 -0600
Subject: [PATCH] Re-add Spigot's hopper-check feature
diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
index 308dfdd..48ea25c 100644
--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
+++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java
@@ -269,4 +269,9 @@ public class PaperWorldConfig {
private void nonPlayerEntitiesOnScoreboards() {
nonPlayerEntitiesOnScoreboards = getBoolean("allow-non-player-entities-on-scoreboards", false);
}
+
+ public boolean useHopperCheck;
+ private void useHopperCheck() {
+ useHopperCheck = getBoolean("use-hopper-check", false);
+ }
}
diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java
index d1ce2b9..197bdfe 100644
--- a/src/main/java/net/minecraft/server/TileEntityHopper.java
+++ b/src/main/java/net/minecraft/server/TileEntityHopper.java
@@ -187,6 +187,12 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi
this.update();
return true;
}
+
+ // Paper start
+ if (world.paperConfig.useHopperCheck && !this.o()) {
+ this.setCooldown(world.spigotConfig.hopperCheck);
+ }
+ // Paper end
}
return false;
} else {
--
2.9.0