Re-add Spigot's hopper-check feature

This commit is contained in:
Byteflux 2015-08-13 10:36:58 -07:00
parent 6d0a86a9b6
commit a16e54d332

View File

@ -0,0 +1,40 @@
From 995af2343bce99345414b23395d8ae3e88c957f6 Mon Sep 17 00:00:00 2001
From: Byteflux <byte@byteflux.net>
Date: Thu, 13 Aug 2015 10:33:34 -0700
Subject: [PATCH] Re-add Spigot's hopper-check feature
diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java
index cab636a..760a076 100644
--- a/src/main/java/net/minecraft/server/TileEntityHopper.java
+++ b/src/main/java/net/minecraft/server/TileEntityHopper.java
@@ -199,6 +199,11 @@ public class TileEntityHopper extends TileEntityContainer implements IHopper, IU
return true;
}
}
+ // PaperSpigot start
+ if (world.paperSpigotConfig.useHopperCheck && !this.n()) {
+ this.d(world.spigotConfig.hopperCheck);
+ }
+ // PaperSpigot end
return false;
} else {
return false;
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
index 3f8bffc..7d46f2c 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -408,4 +408,10 @@ public class PaperSpigotWorldConfig
{
tntExplosionVolume = getFloat( "tnt-explosion-volume", 4.0F );
}
+
+ public boolean useHopperCheck;
+ private void useHopperCheck()
+ {
+ useHopperCheck = getBoolean( "use-hopper-check", false );
+ }
}
--
2.4.6.windows.1