- Tested Minecraft Versions:
- despawningbone, ideas from various places/people
HLR is a simple yet powerful plugin aimed to reduce entity lag by tweaking how hoppers work. Though, it only tweaks specific hoppers as not to completely change the vanilla experience. This plugin is especially helpful if your server has a lot of gigantic farms (including mob farms), such as typical skyblock or factions servers.
How it works
This plugin works by instantaneously moving any item entities found in the item list to specific hopper(s) in a chunk. This essentially eliminates a large amount of physics calculations of the item entities, and reducing overall entity count. It also eliminates bulky water channels, and increases farm efficiency by greatly reducing item loss by either flying out of the collection channels or being destroyed by cactus etc.
- Configurable permission use
- Configurable economy use and fee for /converthopper
- Configurable item whitelist with default items inputted which can be disabled
- Configurable chunk tweaked hopper limit
- Configurable messages
- Configurable cooldown use and time for /converthopper
- Configurable hopper name and lore
- Configurable amount of hoppers that can be converted at once
- Configurable enabled worlds
- Configurable farming tweaks
Commands and permissions
Code (Text):/converthopper - the main command of this plugin. Converts vanilla hoppers into specific hoppers.
/HLR help - shows the help page for this plugin.
/HLR reload - reloads the config file.
/HLR about - about this plugin. Shows author and version.
/HLR give - give an online player tweaked hoppers.
/HLR revert - revert tweaked hoppers back into their vanilla state.Lag testCode (Text):/converthopper - HLR.convert
Bypass fee charge (if set) for using /chopper - HLR.nofee
Bypass cooldown (if set) when using /chopper - HLR.nocooldown
Bypass conversion limit (if set) for converting hoppers - HLR.limitbypass
Bypass chunk hopper limit (if set) - HLR.nochunklimit
/HLR give - HLR.give*
/HLR reload - HLR.reload*
*These permissions cannot be disabled in the config.
[NOTE] This lag test cannot fully represent its function as I cannot replicate a big enough simulation environment to extend the plugin to its full potential.
This lag test is performed in about 60 seconds, with gamerule randomtickspeed set to 60. 2GB RAM was allocated to the server as an effort to increase server load (which failed). Essentials, worldedit, vault, PermissionsEx and the plugin was installed.
Both are with a 23*13*182 cactus farm.
Timings without HLR:
Timings with HLR:
As you can see above, entity count and related events' PCT Ticks are heavily decreased, resulting in a lower server load.
Todo and known bugsCode (YAML):
# HLR v1.3.2 config file
# Created by despawningbone
# Choose which worlds the tweaked hopper will work in.
# Here you can choose what type of items the tweaked hopper will take in.
# This includes all the common crops, i.e. Pumpkin, Cactus, Wheat, Seeds, Carrot,
# Potato(including Poisonous ones), Sugarcane, Red/Brown Mushrooms, Melons and Nether warts.
# This includes all the common mob drops, i.e. Feather, Raw chicken, Raw Beef, Raw Porkchop,
# Raw mutton, Spider eye, Ender pearl, Bone, Arrow, Wool, Iron Ingot, Blaze rod, Gunpowder,
# String, Gold nugget, Slimeball, Ink sack, Leather, Rotten Flesh, Prismarine Shard, Prismarine Crystals and Raw Fish.
# Here you can add the custom items you want to be taken in by the tweaked hopper.
# Please use Bukkit's material list's name.
# For those items with a damage value, please do the item name followed by a colon, as shown in example 2.
# - EXAMPLE_MATERIAL
# - EXAMPLE_MATERIAL:1
# Here you can set how many hoppers can be converted at once.
# e.g. Max-amount: 5, players can't convert a stack of hoppers with more than 5 hoppers in it.
# Use permissions?
# You can set how many tweaked hoppers can be in 1 chunk here.
# set -1 for unlimited tweaked hoppers in one chunk.
# any number is or larger than 16*16 will be the same as unlimited tweaked hoppers.
# Retain the tweaked hopper or drop a new hopper upon tweaked hopper breaking?
# If retain tweaked hoppers, should it only drop when mined with silk touch?
# Should the tweaked hopper drop into the player's inventory upon break or onto the world normally?
# This should fix the problem of tweaked hoppers flying out after being broken.
# Here you can set if player drops would be picked up by the hopper or not.
# To further reduce lag caused by farms, this forces the following types of farms
# to only be able to work when a crop hopper is in the chunk.
# Set to false to disable the farm type.
#This refers to the initial spawning of entities by spawners, not their death.
#This allows specific types of spawners to still work under no crop hoppers.
#This refers to every farms using a piston to break the crop.
#This blacklists the blocks you want pistons to not farm. Default is
#Pumpkin, Melon and Sugarcane.
#This refers to every farms using water to break the crop.
#This blacklists the blocks you want water to not flow and destroy. Default is
#Potato, Carrot, Wheat and Nether warts.
#This refers to the conventional method of cactus breaking by adjacent block.
# Enable /converthopper cooldown?
# You can rename the tweaked hopper here.
Hopper-name: "&3Farming &fHopper"
# You can set the lore of the tweaked hopper here.
- "&7This hopper is special."
- "&7It can find specific items"
- "&7And teleport the items to it instantly."
# Use economy? Vault API required
- Add radius option instead of only one chunk
- Your suggestions
- players with existing hoppers cannot reconvert if the admins changed either the lore or the name only
- when exception handling is fired, the item which fired the handling will not be picked up by the tweaked hoppers even if there is any in that affected chunk.
Source code is now available on GitHub: https://github.com/despawningbone/HLR
HLR (Crop hoppers) 1.3.2
A simple yet powerful hopper tweaker used mainly for lag-reducing purposes.
- Minor features and bug fixes Jul 26, 2018
- Added /hlr give Mar 10, 2018
- Patch - Config options for commands stopped working Dec 26, 2017
Great plugin...really helped reduce alot of lags caused by entities.
But can you add the option to change/tweak to item transfer rate of the hoppers. Even though the hopper transfer rate in my spigot.yml is set to a fast rate, the crop hopper transfer rate is still the same. So can you add this option. THX
Hello i have one problemes [22:17:49] [Server thread/ERROR]: Could not pass event BlockPlaceEvent to HLR v1.2.2
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-1.9.jar:git-Spigot-104c8c8-00d3334]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-1.9.jar:git-Spigot-104c8c8-00d3334]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot-1.9.jar:git-Spigot-104c8c8-00d3334]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot-1.9.jar:git-Spigot-104c8c8-00d3334]
at org.bukkit.craftbukkit.v1_9_R1.event.CraftEventFactory.callBlockPlaceEvent(CraftEventFactory.java:142) [spigot-1.9.jar:git-Spigot-104c8c8-00d3334]
at net.minecraft.server.v1_9_R1.ItemStack.placeItem(ItemStack.java:159) [spigot-1.9.jar:git-Spigot-104c8c8-00d3334]
at net.minecraft.server.v1_9_R1.PlayerInteractManager.a(PlayerInteractManager.java:522) [spigot-1.9.jar:git-Spigot-104c8c8-00d3334]
at net.minecraft.server.v1_9_R1.PlayerConnection.a(PlayerConnection.java:888) [spigot-1.9.jar:git-Spigot-104c8c8-00d3334]
at net.minecraft.server.v1_9_R1.PacketPlayInUseItem.a(SourceFile:55) [spigot-1.9.jar:git-Spigot-104c8c8-00d3334]
at net.minecraft.server.v1_9_R1.PacketPlayInUseItem.a(SourceFile:11) [spigot-1.9.jar:git-Spigot-104c8c8-00d3334]
at net.minecraft.server.v1_9_R1.PlayerConnectionUtils$1.run(SourceFile:13) [spigot-1.9.jar:git-Spigot-104c8c8-00d3334]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_72]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_72]
at net.minecraft.server.v1_9_R1.SystemUtils.a(SourceFile:45) [spigot-1.9.jar:git-Spigot-104c8c8-00d3334]
at net.minecraft.server.v1_9_R1.MinecraftServer.D(MinecraftServer.java:721) [spigot-1.9.jar:git-Spigot-104c8c8-00d3334]
at net.minecraft.server.v1_9_R1.DedicatedServer.D(DedicatedServer.java:400) [spigot-1.9.jar:git-Spigot-104c8c8-00d3334]
at net.minecraft.server.v1_9_R1.MinecraftServer.C(MinecraftServer.java:660) [spigot-1.9.jar:git-Spigot-104c8c8-00d3334]
at net.minecraft.server.v1_9_R1.MinecraftServer.run(MinecraftServer.java:559) [spigot-1.9.jar:git-Spigot-104c8c8-00d3334]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_72]
Caused by: java.lang.NoSuchMethodError: org.bukkit.event.block.BlockPlaceEvent.getHand()Lorg/bukkit/inventory/EquipmentSlot;
at me.despawningbone.HLR.CHlistener.onBlockPlace(CHlistener.java:51) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_72]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_72]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_72]
at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_72]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.9.jar:git-Spigot-104c8c8-00d3334]
... 18 more