Coder Social home page Coder Social logo

seanomik / energeticstorage Goto Github PK

View Code? Open in Web Editor NEW
31.0 5.0 10.0 230 KB

Applied Energistics 2 for your SpigotMC server!

License: MIT License

Java 100.00%
spigotmc minecraft minecraft-plugin minecraft-server spigot-plugin spigotmc-plugin applied-energistics spigot-api spigot-server spigot-plugins

energeticstorage's Introduction

Energetic Storage

Applied Energistics 2 for your SpigotMC server

Energetic Storage is a plugin that is heavily inspired by a forge mod named, Applied Energistics 2. If you dont know what Applied Energistics 2 is, its a mod that allows the player to store large amounts of items, sometimes hundreds of thousands, in just a few blocks. If you run into any issues, create a GitHub issue!

Features:

  • Hopper Input
  • Terminal Sorting
  • Player Whitelist
  • Terminal searching
  • Balanced
  • Supports 1.14.X-1.18.X

Items And Blocks:

  • 1k, 4k, 16k, and 64k, drives
    • The drives are needed to store items. 1k can store 1024 items, 4k can store 4096 and so on (1024 * how many thousand).
    • All drives have a type limit set at 128. This means that only 128 different item types can be added to a single drive.
      • Can be changed in config.
  • ES System
    • The ES System is what keeps the drives inside of it and is used to access the items stored on the drives.
    • You can trust players into the system, they will have just as much access as you do.
      • Only the system owner can trust players.
    • Public ES Systems:
      • Anybody will have access to take items from the system.
      • Only trusted players and the owner of the system can destroy it.

Permissions

  • energeticstorage.*: Gives all Energetic Storage permissions. Default: op
  • energeticstorage.reload: Gives permission to reload the Energetic Storage configuration files. Default: op
  • energeticstorage.esgive: Gives permission to give an Energetic Storage item to themselves. Default: op
  • energeticstorage.esgive.others: Gives permission to give an Energetic Storage item to others. Default: op
  • energeticstorage.system.open.untrusted: Gives permission to open an ES System that the player is not trusted on. Default: op
  • energeticstorage.system.create: Gives permission to create an ES System. Default: Everyone
  • energeticstorage.system.destroy.untrusted: Gives permission to destroy a system the player isn't trusted on. Default: op

Commands

  • /esreload
  • /esgive [drive/system] [1k, 4k, 16k, 64k] (player)

Config:

Config.yml:

driveMaxTypes: 128 # Sets the drives max type limit.

Players.yml is where all player data is stored. I would recommend not messing with this file as it will likely cause errors and item loss!

Screenshots

driveGUI

systemDrivesGUI

securitySetPublicGUI

securityTrustPlayerGUI

terminal

terminalAmount;

energeticstorage's People

Contributors

chew avatar seanomik avatar timstewartj avatar toxicfrog avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

energeticstorage's Issues

Suggestions!

Hi! Here are some of my suggestions:

  • Add a button that leads to the settings like here Link (Only do this if you don't change the layout to DSU, that is suggested below)
  • When opening the ES System the start window should be the "Terminal" aka this one Link
  • Remove the Vanilla item amount Display and only do it over the "lores" Examples: current / Better/Cleaner
  • Add a "Back" button to every panel you pretty much have xD below are some panels that lack a back button.
    • ES "Main" Settings menu Link > Back button should lead to the "Terminal" (I know kinda redundant, but makes more sense if the start panel is the "Terminal", so you could remove the "Terminal" button and replace it with a back button)
    • ES System Security Link > Back button goes to the ES "Main" Settings menu.
  • Allowing us to customize the size of the disks. (I know we can edit it in the player.yml, but I don't think that's a good solution to it xD)
  • Allowing us to customize how many ES Drives can fit in one system(currently limited to 5)
    • Maybe some kind of way to expand the storage, like adding another item to expand the ES Drive size :P!
  • Ability to sort Items after Quantity/Name(Alphabedict)/ID
  • Make it so that items in the terminal DONT switch places when they get empty, like forcing them to stick where they currently are until you close it.
  • Maybe try to implement a more performance-friendly solution for saving the ES system, something like SQLITE(Preferable, because it's simple)/MySQL/Redis
  • Add some kind of Wireless System/Interface for the go(idk prob needs Chunk loading so it works on bigger distances/different dimensions) :P
  • Some kind of way to import items via a Hopper(would be cool to automate stuff with this, because it allows to save so much space)
  • Maybe change the layout of the "Terminal" to something similar of the DSU here: Link
  • Annd last but not least, maybe use a real block instead of a player head, something like the Loadstone(or just make it customizable xD)!

Also thank you for updating it so quickly!

Regards

Don't working in 1.17

When I put the ES System on the ground the console gives me this error

[10:22:13] [Craft Scheduler Thread - 0/WARN]: [EnergeticStorage] Plugin EnergeticStorage v0.7.1-SNAPSHOT generated an exception while executing task 26
java.lang.NullPointerException: Cannot invoke "net.seanomik.energeticstorage.objects.ESSystem$SortOrder.toString()" because the return value of "net.seanomik.energeticstorage.objects.ESSystem.getSortOrder()" is null
at net.seanomik.energeticstorage.files.PlayersFile.savePlayerSystem(PlayersFile.java:175) ~[?:?]
at net.seanomik.energeticstorage.listeners.BlockPlaceListener.lambda$onBlockPlace$0(BlockPlaceListener.java:34) ~[?:?]
at net.seanomik.energeticstorage.listeners.BlockPlaceListener$$Lambda$5427/0x000000003d6a6550.run(Unknown Source) ~[?:?]
at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:81) ~[spigot-1.17.jar:3164-Spigot-f773da8-b069f22]
at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) [spigot-1.17.jar:3164-Spigot-f773da8-b069f22]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?]
at java.lang.Thread.run(Thread.java:853) [?:?]

And when will I try to use

local chat: [10:25:00] [Render thread/INFO]: [CHAT] [Energetic Storage] This is an invalid ES System!

[Bug] Cant search

Describe the bug
When ever i try to use the search function, a java exception is thrown and nothing happens ingame

To Reproduce
Steps to reproduce the behavior:

  1. Search for an item

Errors

[20:54:13 ERROR]: Could not pass event InventoryClickEvent to EnergeticStorage v0.7.4-SNAPSHOT                                                                
java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()" because "list" is null                                                              
        at net.seanomik.energeticstorage.utils.Utils.listStringContainsString(Utils.java:125) ~[EnergeticStorage-v0.7.4-SNAPSHOT.jar:?]                       
        at net.seanomik.energeticstorage.gui.ESTerminalGUI.lambda$onInventoryClick$6(ESTerminalGUI.java:327) ~[EnergeticStorage-v0.7.4-SNAPSHOT.jar:?]        
        at net.seanomik.energeticstorage.anvilgui.AnvilGUI$ListenUp.onInventoryClick(AnvilGUI.java:250) ~[EnergeticStorage-v0.7.4-SNAPSHOT.jar:?]             
        at com.destroystokyo.paper.event.executor.MethodHandleEventExecutor.execute(MethodHandleEventExecutor.java:37) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:git-Paper-77]                         
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]                                 
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]                              
        at net.minecraft.server.network.ServerGamePacketListenerImpl.handleContainerClick(ServerGamePacketListenerImpl.java:2817) ~[?:?]                      
        at net.minecraft.network.protocol.game.ServerboundContainerClickPacket.handle(ServerboundContainerClickPacket.java:58) ~[?:?]                         
        at net.minecraft.network.protocol.game.ServerboundContainerClickPacket.handle(ServerboundContainerClickPacket.java:13) ~[?:?]                         
        at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$1(PacketUtils.java:56) ~[?:?]                                          
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.18.1.jar:git-Paper-77]                                                               
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:149) ~[?:?]                                                         
        at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:23) ~[?:?]                                        
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1413) ~[paper-1.18.1.jar:git-Paper-77]                                         
        at net.minecraft.server.MinecraftServer.c(MinecraftServer.java:189) ~[paper-1.18.1.jar:git-Paper-77]                                                  
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:122) ~[?:?]                                                          
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1391) ~[paper-1.18.1.jar:git-Paper-77]                                  
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1384) ~[paper-1.18.1.jar:git-Paper-77]                                          
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:132) ~[?:?]                                                      
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1362) ~[paper-1.18.1.jar:git-Paper-77]                                 
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1268) ~[paper-1.18.1.jar:git-Paper-77]                                         
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317) ~[paper-1.18.1.jar:git-Paper-77]                                      
        at java.lang.Thread.run(Thread.java:833) ~[?:?]  

Versions
MC: 1.18.1
Java: 17.0.1
PaperMC: paper-1.18.1-77

1.16.1 Support?

Im on the latest PaperSpigot 1.16.1.

Whenever I type /esgive system I get the error below: (the crafting recipe does also not work for me Link)

.... [09:28:41 INFO]: Fundryi issued server command: /esgive system
>.... [09:28:41 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'esgive' in plugin EnergeticStorage v0.2-SNAPSHOT
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[patched_1.16.1.jar:git-Paper-92]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.16.1.jar:git-Paper-92]
at org.bukkit.craftbukkit.v1_16_R1.CraftServer.dispatchCommand(CraftServer.java:794) ~[patched_1.16.1.jar:git-Paper-92]
at net.minecraft.server.v1_16_R1.PlayerConnection.handleCommand(PlayerConnection.java:1912) ~[patched_1.16.1.jar:git-Paper-92]
at net.minecraft.server.v1_16_R1.PlayerConnection.a(PlayerConnection.java:1723) ~[patched_1.16.1.jar:git-Paper-92]
at net.minecraft.server.v1_16_R1.PacketPlayInChat.a(PacketPlayInChat.java:47) ~[patched_1.16.1.jar:git-Paper-92]
at net.minecraft.server.v1_16_R1.PacketPlayInChat.a(PacketPlayInChat.java:5) ~[patched_1.16.1.jar:git-Paper-92]
at net.minecraft.server.v1_16_R1.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:23) ~[patched_1.16.1.jar:git-Paper-92]
at net.minecraft.server.v1_16_R1.TickTask.run(SourceFile:18) ~[patched_1.16.1.jar:git-Paper-92]
at net.minecraft.server.v1_16_R1.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.16.1.jar:git-Paper-92]
at net.minecraft.server.v1_16_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.16.1.jar:git-Paper-92]
at net.minecraft.server.v1_16_R1.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.16.1.jar:git-Paper-92]
at net.minecraft.server.v1_16_R1.MinecraftServer.aZ(MinecraftServer.java:1136) ~[patched_1.16.1.jar:git-Paper-92]
at net.minecraft.server.v1_16_R1.MinecraftServer.executeNext(MinecraftServer.java:1129) ~[patched_1.16.1.jar:git-Paper-92]
at net.minecraft.server.v1_16_R1.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.16.1.jar:git-Paper-92]
at net.minecraft.server.v1_16_R1.MinecraftServer.sleepForTick(MinecraftServer.java:1090) ~[patched_1.16.1.jar:git-Paper-92]
at net.minecraft.server.v1_16_R1.MinecraftServer.v(MinecraftServer.java:1004) ~[patched_1.16.1.jar:git-Paper-92]
at net.minecraft.server.v1_16_R1.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.1.jar:git-Paper-92]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_242]
Caused by: de.tr7zw.nbtapi.NbtApiException: Method not loaded! 'ITEMSTACK_NMSCOPY'
at de.tr7zw.nbtapi.utils.nmsmappings.ReflectionMethod.run(ReflectionMethod.java:149) ~[?:?]
at de.tr7zw.nbtapi.NBTItem.getCompound(NBTItem.java:34) ~[?:?]
at de.tr7zw.nbtapi.NBTReflectionUtil.setData(NBTReflectionUtil.java:503) ~[?:?]
at de.tr7zw.nbtapi.NBTCompound.setBoolean(NBTCompound.java:270) ~[?:?]
at net.seanomik.energeticstorage.utils.ItemConstructor.createSystemBlock(ItemConstructor.java:24) ~[?:?]
at net.seanomik.energeticstorage.commands.ESGiveCommand.onCommand(ESGiveCommand.java:97) ~[?:?]
at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched_1.16.1.jar:git-Paper-92]
... 18 more

I guess you just haven't got around to update it to 1.16.1, but it would be cool if you could support it!

Regards

1.16.5 Spigot - ES System is missing texture and throws a null exception. (Partially independently fixed: Still has Issue #11)

Hello,

As mentioned on a few other issues, Snapshot 0.5.1 is not functioning on 1.16.5 Spigot. I was able to get Snapshot 0.5 working on 1.16.5 Spigot, though the previous bugs were still present.

Previously placed ES System player heads from Snapshot 0.5 are still functional with Snapshot 0.5.1, but revert to a normal player head when broken, losing all NBT data.

ES Systems acquired through /esgive do not have a texture, and are non-functional when placed anywhere. Any normally crafted ES Systems also lack the texture, and appear as a normal player head. Advanced tooltips shows in both of these cases that the player head has 3 NBT tags, though ES Systems created in Snapshot 0.5 have 4 NBT tags (presumably the texture being the 4th, and missing, tag).

I looked through the raw code + the error messages, and with as much information as I have I'd guess the issue lies with applying the texture to the Computer skull. It seems that Skulls.java never applies the texture, then Utils.java runs isBlockASystem(), returning null when it compares the texture (as there is no texture applied).

From what I saw looking through the Git Blame / History, I think the fix might be on Line 24 of Skulls.java, as the previous version was:
item = createSkull(texture, name);
while the current version says:
item = createSkull(uuid, name);

It appears that this could lead to the texture not being added. Furthermore, the String url variable is not used in createSkull (except for the check if it is empty), meaning the UUID being passed into the method is not being used - could this be the cause? The previous version of Skulls.java contained this line using the url variable, which is now missing:
gameProfile.getProperties().put("textures", new Property("textures", url));

Could the above be related to line 42 of Skulls.java, ownerNBT.setString("Id", uuid); , and potentially replacing uuid with url so it uses the argument instead of the class variable to fix the issue?

I'm not 100% sure that any of these are the fix, but it's my best guess with the information I have - I've not done any Java in a while. Hopefully some of this information helps get this fixed - I really love this plugin and want it to work! I've also attached the error messages when placing and breaking the ES System.

ES_Break.txt
ES_Place.txt

[Feature] Issues and Fix's to implement ASAP

Really cool Plugin and would love to use this but i have a few issues which i think a lot of other will also run into and agree with.

Would like to be able to disable to ability to craft the Drives/System in the config so that i can use another plugin to create a more expensive recipe other than that its a decent plugin for what it is

Please create 2 separate permissions to be able to create/craft the drives and system and have them set to OP Only by default so that we can disable the ability to craft them for ranks and specifically enable the crafting for certain ranks only as there is currently no way to disable the crafting for players.

Could you also increase the input speed of the hopper into the storage system or have it read the spigot.yml config file for the server as i have increased the hopper speed on my server using the spigot.yml file and it doesn't increase the hopper speed into the Storage system which is bottlenecking my systems and i'm sure others will run into this issue in future also.

And possible add the ability to change the picture of the "Storage Drives" via a .png file in a resource pack or any way your able to add this.

Working in 1.18.2?

I tried installing this on a 1.18.2 papermc server and it's not working.

24.05 20:50:34 [Server] ERROR Error occurred while enabling EnergeticStorage v0.7.5-SNAPSHOT (Is it up to date?)

I'm assuming it's working in 1.18.1, if i'm wrong feel free to correct me, but are you planning an update if so?

Plugin not working

My server is on 1.16.2, which is likely the reason that it is not working, but I can't do anything with it because the main command isn't working. The auto-complete is trying to use our nicknames on the server, and when I use those I get kicked from my own server with the message "Illegal characters in chat" no item was placed in my inventory when I logged back in.

  • If I type out my actual username without the autocomplete in-game, I get the "unexpected error occurred" message.

  • If I type out the command in the server console, I get this error: "Unhandled exception executing command 'esgive' in plugin EnergeticStorage v0.3-SNAPSHOT"

Hopefully you can help with this because I've been having a lot of problems with our current Deep Storage option and was hoping this one would save us! Thanks :D

[Bug] Drive duping

Describe the bug
Drive duping glitch.

To Reproduce
Steps to reproduce the behavior:

  1. Open gui menu with the drives.
  2. Shift + Left Click the drive.
  3. Multiple drives duped in inventory.

Expected behavior
Behavior similar to Bug #38.

Errors
If any errors or stack traces appeared in the console, please link to them here. Please use Pastebin to post stack traces. Don't paste them into the issue.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions
MC: 1.18.2
Java: 1.18.2

Additional context
Add any other context about the problem here.

[Bug] Hopper dupe itens

Describe the bug
System duplicates itens placed by Hoppers when restarting server and gives console error.

To Reproduce
Create a system and place any item via Hopper and restart the server.

Errors
Error only appears when the server finishes opening.
https://pastebin.com/m4d59YMz

Versions
MC: 1.18.1
Java: 17.0.1

I was about to make my own plugin when I found this one, I soon saw that I didn't need to create one anymore, your plugin is amazing but I missed a Wireless Remote... that I ended up programming one later because I really needed it kkkkk congratulations on the plugin. (Sorry for the translations)

issue with the plugin

Hello
I tried using this plugin but whenever I

tried to run the command it says there was an internal issue with executing the command. what would you recommend to fix this issue? was there supposed to be a child/dependent plugin i', suppose to have to run this plugin.

2022-05-08_17 34 45

[Bug] duping drives (items included)

Describe the bug
Drive duping glitch.

To Reproduce
Steps to reproduce the behavior:

Open gui menu with the drives.
Shift + Left Click the drive.
Multiple drives duped in inventory.
Expected behavior
Behavior similar to Bug #38.

Errors
If any errors or stack traces appeared in the console, please link to them here. Please use Pastebin to post stack traces. Don't paste them into the issue.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions
MC: 1.18.2
Java: 1.18.2

Additional context
Add any other context about the problem here.

Cant seem to get hoppers to connect!

would love to use this plugin but i need to know if im crazy or not doing it right when i test but hoppers will not connect to the system in any way please help

[Feature] Itemsadder Support

Describe your feature request.
Adding a support to itemsadder system to let user have the texture with it

Additional context
Add any other context or screenshots about the feature request here.

[Feature]

Hopper export from system

Agreed it would be difficult to export a specific item from a mixed system, however in my case I simply wish to replace a Chest in a mass storage system making the storage capacity substantialy larger for each item, hopper export is more related to item retrial as import function is already available

Game-breaking issues :(

  1. Search function doesn't work.
  2. Taking drives out of the system and putting them back in will make them, and all items in them disappear. Now this is really bad. Lost all my items this way.

Duplication glitch

No one is using it because of the duplication glitche. If this can be fixed. I think everyone will be using it.

Duping drives

When taking out drives from a ES system if you shift click them fast and then close the UI fast sometimes a couple of drives will be duped in your inventory and on the ES system, this includes any items those drives may hold.

Only seems to happen when the ES system has all drive slots full, I believe a quick cheap fix for this would be asking for confirmation every time u remove a drive?

[Bug] "encoded string too long"

Describe the bug
After using Energetic Storage for some time, I wanted to take a look at the drives and got kicked from the server repeatedly.
I was also kicked when I destroyed/mined the head at that point. (The drives then simply disappeared.)
(The server did not crash or restart.)

To Reproduce

  1. fill ES drives with all kinds of items
  2. click on "Drives"

Expected behaviour

  • not getting kicked
  • being able to see the drives and remove them from the head
  • drives should automatically reject items (or additional item types) if tags/strings exceed max length

Errors
https://pastebin.com/jg3m4CV5

Versions
MC: 1.18.1 Paper build 110
Java: 17 (only FTP and server console, no shell access)

[Bug] This is an invalid ES System!

Describe the bug
Placing down an ES System on a fresh Mohist 1.16.5 server running the Pixelmon Reforged modpack presents me with an error saying the system is invalid.

To Reproduce
As said before, Pixelmon Reforged 9.0.0 for MC 1.16.5 on a freshly installed server with the plugin installed,

Versions
MC: 1.16.5

Duplication of drives

When in the drive menu taking a drive out of the system and putting it back in without closing the gui multiple times will cause the drive to duplicate.

Non-stackable items being withdrawn in stacks

I really would like to implement this into my server, but items which should not be stackable are able to be put into an ES System, then withdrawn. images attached are what happens when I deposit 2 identical pickaxes, then withdraw them.
image

image

image

Cannot open system

Hi again!

Thank you so much for helping with the issues we had not being able to use the command last night, I appreciate the fast support! The command is working, but now we aren't able to open the system. I'm able to craft and place the ES System, but can't open it. There are no errors, just nothing happens.

Also, after breaking the ES System, when it is back in an inventory, it's name is "Player Head" instead of "ES System", I'm not sure if that matters or not.

Thanks again for any help.

[Bug] [Major] Hopper Input voiding out items if Max Types is full

Describe the bug
If the first storage cell has the max type of items, if you feed an item that is not among those types into it, it will void it.

To Reproduce
Steps to reproduce the behavior:

  1. Drive Slot 1's drive has max types filled, but item space to spare
  2. (Optional) Have any additional drives that spare room for types and items
  3. Hook a hopper up to the side of the Terminal
  4. Feed a new item that doesn't appear in the first drive's storage.
  5. Item is permanently gone.

Expected behavior
Hoppers shouldn't feed items into the terminal if it detects if Max Types nor Max Items is met by what they contain.

Errors
No errors in the console

Versions
MC: 1.19.3
PaperMC: 445
Java: Unknown, host (Bisect) doesn't provide any info.

Additional context

  1. This was discovered with a 64k drive.

  2. Unable to test it since this is on an active server, but we have modified the hopper settings to be more friendly to the server from the antics of our crazed builders. I do not know if this modification to the spigot.yml config is related to it. But even if it is, this kind of change should be accounted for by plugin makers.

Those settings: image

[Feature] Recipe management/adjustment

I would like to be able to adjust the recipes for all the different pieces of the plugin or disable them all together so that another plugin can handle the crafting of the items.

If this is already a feature then please just let me know where/how I can do that.

[Issue] Console Spamming/Duplication of items

Describe the bug
Was pulling out items and experienced a massive console spam and items were duplicating. Ended up removing the plugin from the server for the time being.

To Reproduce
Place items like signs or cobblestone walls into a system with 5 64k drives. Shift click them to move them back into your inventory. You can even right click them to pull them into your inventory.

Screenshots / Video / Console Log
2020-06-24-3.log.gz

Server Information (please complete the following information):

  • Minecraft Version Spigot 1.15.2
  • Plugin Version 0.1-SNAPSHOT

Incompatible with Spigot 1.16.5

This plugin is just what I was looking for my server. However, I do not manage to make it work.

When I create an ES system and put it on the floor, I get the following log:

[13:21:53] [Server thread/ERROR]: Could not pass event BlockPlaceEvent to EnergeticStorage v0.5.1-SNAPSHOT
org.bukkit.event.EventException: null
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:319) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
at org.bukkit.craftbukkit.v1_16_R3.event.CraftEventFactory.callBlockPlaceEvent(CraftEventFactory.java:364) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
at net.minecraft.server.v1_16_R3.ItemStack.placeItem(ItemStack.java:220) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
at net.minecraft.server.v1_16_R3.PlayerInteractManager.a(PlayerInteractManager.java:497) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
at net.minecraft.server.v1_16_R3.PlayerConnection.a(PlayerConnection.java:1356) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
at net.minecraft.server.v1_16_R3.PacketPlayInUseItem.a(PacketPlayInUseItem.java:27) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
at net.minecraft.server.v1_16_R3.PacketPlayInUseItem.a(PacketPlayInUseItem.java:1) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
at net.minecraft.server.v1_16_R3.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:19) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
at net.minecraft.server.v1_16_R3.TickTask.run(SourceFile:18) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeTask(SourceFile:144) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeNext(SourceFile:118) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
at net.minecraft.server.v1_16_R3.MinecraftServer.bb(MinecraftServer.java:942) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
at net.minecraft.server.v1_16_R3.MinecraftServer.executeNext(MinecraftServer.java:935) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.awaitTasks(SourceFile:127) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
at net.minecraft.server.v1_16_R3.MinecraftServer.sleepForTick(MinecraftServer.java:919) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:851) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_261]
Caused by: java.lang.NullPointerException
at net.seanomik.energeticstorage.utils.Utils.isBlockASystem(Utils.java:144) ~[?:?]
at net.seanomik.energeticstorage.listeners.BlockPlaceListener.onBlockPlace(BlockPlaceListener.java:29) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_261]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_261]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_261]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_261]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:315) ~[spigot.jar:3016-Spigot-73fb609-ea050e6]
... 21 more

I also get similar error messages on the server log when I right click the ES system and when I break the block. Clicking the ES system does nothing and when I break it I get a player head instead of the system.

I am using Spigot 1.16.5 and the 0.51 version of the plugin. I have tried to reinstall the plugin, reload it and installing last version of NBT-API, but nothing fixed the problem. I am a newbie at creating Minecraft servers so maybe I have done anything wrong.

I uploaded the full server log at pastebin: https://pastebin.com/krf0UXRx

Thanks for your assistance

[Feature] Change block, extend storage size

Describe your feature request.
could this system be a chest instead of a head? another thing for it to increase the amount of storage items you could put blocks next to this chest like, each block of netherite increases 10k of space the maximum distance to put 1 block would be 10 blocks.

Additional context
Add any other context or screenshots about the feature request here.

Cannot remove drives from the GUI

As the title says, I cannot left click, right click or shift-click the drives from the GUI into my inventory. Below is the console log I receive when I attempt to remove a drive.
image

This plugin is amazing regardless, and I appreciate the work you put into this!

[Feature] Open Source?

No clue if this is open source or not, but wanted to get access to the code so my team can work on fixing parts of this plugin so it can be used on our server without issues.

Item destroyed when inventory is full

When taking an item from an ES system with full inventory it disappears if taken by shift+click.
Not a very frequent problem but can be pretty expensive if one is not careful.

Loss of items while shifting into Full Inventory

The Items get substractet from the system but they wont get into the Inventory

Steps to reproduce the behavior:

  1. Place Many Items in the System and get a full Inventory
  2. Take Items from the system and watch the Amount left in the system

Expected behavior
The Amount should be the same or the Items will get droped in front of the Player

Versions
MC: 1.18.1
Java 17

Error in Console [Bug]

Describe the bug
Dunno what is wrong just seen it in the console

Errors
Plugin EnergeticStorage v0.7.3-SNAPSHOT generated an exception while executing task 35017
java.lang.NullPointerException: Cannot invoke "org.bukkit.configuration.ConfigurationSection.getKeys(boolean)" because the return value of "net.seanomik.energeticstorage.files.PlayersFile.getConfigurationSection(String)" is null
at net.seanomik.energeticstorage.files.PlayersFile.removePlayerSystem(PlayersFile.java:224) ~[?:?]
at net.seanomik.energeticstorage.listeners.BlockBreakListener.lambda$onBlockBreakListener$0(BlockBreakListener.java:43) ~[?:?]
at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[patched_1.17.1.jar:git-Paper-116]
at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) ~[patched_1.17.1.jar:git-Paper-116]
at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[patched_1.17.1.jar:git-Paper-116]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) ~[?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) ~[?:?]
at java.lang.Thread.run(Thread.java:831) [?:?]

Versions
MC: 1.17.1
Java: 16

1.20.x Support?

Is there any chance the plugin will be updated to support 1.20.x in the near future?

Error when trying to remove drives

We are unable to remove drives from the system without breaking the system. Whenever trying to remove the drive, we receive this error:

.... [15:44:38 ERROR]: Could not pass event InventoryClickEvent to EnergeticStorage v0.4.2-SNAPSHOT
java.lang.NullPointerException: ItemStack can't be null/Air!
at de.tr7zw.nbtapi.energeticstorage.NBTItem.(NBTItem.java:42) ~[?:?]
at de.tr7zw.nbtapi.energeticstorage.NBTItem.(NBTItem.java:28) ~[?:?]
at net.seanomik.energeticstorage.utils.Utils.isItemADrive(Utils.java:145) ~[?:?]
at net.seanomik.energeticstorage.gui.ESDriveGUI.onInventoryClick(ESDriveGUI.java:222) ~[?:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor338.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.16.3.jar:git-Paper-194]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.16.3.jar:git-Paper-194]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.16.3.jar:git-Paper-194]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:607) ~[patched_1.16.3.jar:git-Paper-194]
at net.minecraft.server.v1_16_R2.PlayerConnection.a(PlayerConnection.java:2427) ~[patched_1.16.3.jar:git-Paper-194]
at net.minecraft.server.v1_16_R2.PacketPlayInWindowClick.a(SourceFile:32) ~[patched_1.16.3.jar:git-Paper-194]
at net.minecraft.server.v1_16_R2.PacketPlayInWindowClick.a(SourceFile:10) ~[patched_1.16.3.jar:git-Paper-194]
at net.minecraft.server.v1_16_R2.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:23) ~[patched_1.16.3.jar:git-Paper-194]
at net.minecraft.server.v1_16_R2.TickTask.run(SourceFile:18) ~[patched_1.16.3.jar:git-Paper-194]
at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.16.3.jar:git-Paper-194]
at net.minecraft.server.v1_16_R2.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.16.3.jar:git-Paper-194]
at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.16.3.jar:git-Paper-194]
at net.minecraft.server.v1_16_R2.MinecraftServer.ba(MinecraftServer.java:1135) ~[patched_1.16.3.jar:git-Paper-194]
at net.minecraft.server.v1_16_R2.MinecraftServer.executeNext(MinecraftServer.java:1128) ~[patched_1.16.3.jar:git-Paper-194]
at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.executeAll(IAsyncTaskHandler.java:95) ~[patched_1.16.3.jar:git-Paper-194]
at net.minecraft.server.v1_16_R2.MinecraftServer.a(MinecraftServer.java:1264) ~[patched_1.16.3.jar:git-Paper-194]
at net.minecraft.server.v1_16_R2.MinecraftServer.w(MinecraftServer.java:999) ~[patched_1.16.3.jar:git-Paper-194]
at net.minecraft.server.v1_16_R2.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.3.jar:git-Paper-194]
at java.lang.Thread.run(Thread.java:834) [?:?]

1.16.5 Spigot Not working + Textures not loading -Plugins conflict

On latest 1.16.5 Spigot, i get the same error as others of the BlockPlace being NULL.
I also am using itemadder + Craftory Tech which have custom blocks and items, where it uses a resource pack. Your ES System only shows as a PLAYER head. Assuming this is caused by the resource pack overriding. Any way to split apart your png file and the player_head info so myself and others can merge the resource/textures together? Thank you

[Bug] Spamming of error in console

Recently the console is being constantly spammed by this error;

Energetic Storage has been working fine for months on the server and just recently started throwing errors.

There should not be constant errors in console

The only plugins that have been updated have been Slimefun. Universes is the multiworld handler and I never had a problem until recently.

Console errors;

[00:00:57] [Craft Scheduler Thread - 26 - EnergeticStorage/WARN]: [EnergeticStorage] Plugin EnergeticStorage v0.7.3-SNAPSHOT generated an exception while executing task 13
java.lang.NullPointerException: Cannot invoke "org.bukkit.World.getBlockAt(org.bukkit.Location)" because the return value of "org.bukkit.Location.getWorld()" is null
	at org.bukkit.Location.getBlock(Location.java:133) ~[patched_1.16.5.jar:git-Purpur-1171]
	at net.seanomik.energeticstorage.tasks.HopperTask.run(HopperTask.java:94) ~[?:?]
	at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:100) ~[patched_1.16.5.jar:git-Purpur-1171]
	at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:58) ~[patched_1.16.5.jar:git-Purpur-1171]
	at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[patched_1.16.5.jar:git-Purpur-1171]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) [?:?]
	at java.lang.Thread.run(Thread.java:831) [?:?]

Versions
2021-09-19_12 47 38

[Bug] Taking items out of the GUI

Describe the bug
A clear and concise description of what the bug is.

To Reproduce

  1. Hold down SHIFT
  2. LEFT-CLICK on the glass panes

Expected behavior
You can take the glass panes out of the GUI when pressing SHIFT + LEFT-CLICK

Errors
none

Screenshots
https://youtu.be/xhMz5sRcvfE

Versions
MC: 1.17.1
Java: Java 17

Additional context
none

i cant craft es systems or drives

it says when i type /pl that energetic storage is working so idk what could fix it i tried deleting config i tried restarting the server idk what could be wrong

Items duplicated when user right clicks items into ESTerminal

Describe the bug:
When the user right clicks a stack of items into the ESTerminal, one item is taken from the stack, but the entire stack is placed into the system.

To Reproduce:
Take a stack of items in your cursor and right click the stack into the ESTerminal. One item will be removed but the full stack will be added into the system.

Screenshots / Video / Console Log
N/A

Server Information (please complete the following information):

  • Minecraft Version Spigot 1.15.2
  • Plugin Version 0.2-SNAPSHOT (Un-Released as I'm making this issue.)

Storage System turning into Player Head

When I break an ES System, it doesn't stack with the ones that I get from /esgive, but it still functions as usual. However, when my players (non-op members) break an ES System, it turns into a Player Head. This Error appears in our console.

.... [20:26:29 ERROR]: Could not pass event InventoryClickEvent to EnergeticStorage v0.4-SNAPSHOT
java.lang.NullPointerException: null
at net.seanomik.energeticstorage.gui.ESSystemGUI.initializeItems(ESSystemGUI.java:53) ~[?:?]
at net.seanomik.energeticstorage.gui.ESDriveGUI.onInventoryClick(ESDriveGUI.java:220) ~[?:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor295.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.16.2.jar:git-Paper-161]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.16.2.jar:git-Paper-161]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.16.2.jar:git-Paper-161]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:607) ~[patched_1.16.2.jar:git-Paper-161]
at net.minecraft.server.v1_16_R2.PlayerConnection.a(PlayerConnection.java:2416) ~[patched_1.16.2.jar:git-Paper-161]
at net.minecraft.server.v1_16_R2.PacketPlayInWindowClick.a(SourceFile:32) ~[patched_1.16.2.jar:git-Paper-161]
at net.minecraft.server.v1_16_R2.PacketPlayInWindowClick.a(SourceFile:10) ~[patched_1.16.2.jar:git-Paper-161]
at net.minecraft.server.v1_16_R2.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:23) ~[patched_1.16.2.jar:git-Paper-161]
at net.minecraft.server.v1_16_R2.TickTask.run(SourceFile:18) ~[patched_1.16.2.jar:git-Paper-161]
at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.16.2.jar:git-Paper-161]
at net.minecraft.server.v1_16_R2.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.16.2.jar:git-Paper-161]
at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.16.2.jar:git-Paper-161]
at net.minecraft.server.v1_16_R2.MinecraftServer.ba(MinecraftServer.java:1135) ~[patched_1.16.2.jar:git-Paper-161]
at net.minecraft.server.v1_16_R2.MinecraftServer.executeNext(MinecraftServer.java:1128) ~[patched_1.16.2.jar:git-Paper-161]
at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.16.2.jar:git-Paper-161]
at net.minecraft.server.v1_16_R2.MinecraftServer.sleepForTick(MinecraftServer.java:1089) ~[patched_1.16.2.jar:git-Paper-161]
at net.minecraft.server.v1_16_R2.MinecraftServer.w(MinecraftServer.java:1003) ~[patched_1.16.2.jar:git-Paper-161]
at net.minecraft.server.v1_16_R2.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.2.jar:git-Paper-161]
at java.lang.Thread.run(Thread.java:834) [?:?]

[Bug] Spamming error on console (spigot 1.16.5 -ES 0.7.4)

I don't know why, but after like 5 minutes server open/run, start spamming this error on console:
[07:16:37] [Server thread/ERROR]: Could not pass event WorldSaveEvent to EnergeticStorage v0.7.4-SNAPSHOT
org.bukkit.event.EventException: null
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-1.16.5.jar:3096a-Spigot-9fb885e-af1a232]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[spigot-1.16.5.jar:3096a-Spigot-9fb885e-af1a232]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589) ~[spigot-1.16.5.jar:3096a-Spigot-9fb885e-af1a232]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576) ~[spigot-1.16.5.jar:3096a-Spigot-9fb885e-af1a232]
at net.minecraft.server.v1_16_R3.WorldServer.save(WorldServer.java:866) ~[spigot-1.16.5.jar:3096a-Spigot-9fb885e-af1a232]
at net.minecraft.server.v1_16_R3.MinecraftServer.saveChunks(MinecraftServer.java:794) ~[spigot-1.16.5.jar:3096a-Spigot-9fb885e-af1a232]
at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1147) ~[spigot-1.16.5.jar:3096a-Spigot-9fb885e-af1a232]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:966) ~[spigot-1.16.5.jar:3096a-Spigot-9fb885e-af1a232]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:273) ~[spigot-1.16.5.jar:3096a-Spigot-9fb885e-af1a232]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_311]
Caused by: java.lang.NullPointerException
at net.seanomik.energeticstorage.utils.Utils.convertLocationToString(Utils.java:25) ~[?:?]
at net.seanomik.energeticstorage.files.PlayersFile.savePlayerSystem(PlayersFile.java:178) ~[?:?]
at net.seanomik.energeticstorage.files.PlayersFile.savePlayerSystems(PlayersFile.java:234) ~[?:?]
at net.seanomik.energeticstorage.EnergeticStorage.savePlayerSystems(EnergeticStorage.java:70) ~[?:?]
at net.seanomik.energeticstorage.EnergeticStorage.onWorldSaveEvent(EnergeticStorage.java:77) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_311]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_311]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_311]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_311]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.16.5.jar:3096a-Spigot-9fb885e-af1a232]
... 9 more
if someone know how fix it i'll loved.

Drives are deleted on restart[Bug]

Describe the bug
Dives are disappearing and deleting items that where added when server is rebooted. This is happening in 1.17

To Reproduce
Steps to reproduce the behavior:

  1. Place the controller.
  2. Add drives to the drive GUI and fill with items
  3. reboot the server and the drives disappear.

Expected behavior
Add items to drives restart server and drives are still in tact and haven't been deleted.

Errors
No errors present in log files

Versions
MC: 1.17
Java: "16.0.1" 2021-04-20

Snapshot 0.6.1 - Drives sometimes deleted or duplicated when placed in Drive GUI. Extension of Issue #11

Heyo,

Just found this issue on the latest release. Sorry to always be the bearer of bad news :')

Essentially, whenever a drive is placed in the GUI in any slot other than the next available slot, it may be deleted. Drives should be placed in the first empty inventory slot of the Drive GUI, otherwise they are sometimes merely deleted. This issue has also caused a duplication bug, where I (repeatedly) placed a single 64k drive, and managed to consistently duplicate it.

Upon reading the console errors when these bugs occur, it appears to be throwing null exceptions, as a result of calling out-of-bounds ArrayList indexes in ESDriveGUI.java.

In more detail, for reproduction of this bug - I am able to consistently duplicate Drives by placing them in the first slot, then picking them up and "walking" them through all of the slots - it seemingly duplicates that drive at least once per attempt. Similarly, picking up and replacing a drive in the 5th (last) slot in the GUI repeatedly seems to duplicate it every time, leading to more than 5 drives in the system. I've attached a screenshot of what this looks like.
ESDrives

As for reproducing the bug regarding deletion of a drive, it seems to occur whenever quickly closing the menu after placing (or quickly picking up + placing) a drive in any slot other than the first available slot. It's much less consistent than the duplication issue, but it's still a very dangerous bug - considering you could accidentally delete 64k items in one click :)

Hopefully these can be fixed, though I'm not 100% sure what the fix would be. Personally, I'd only allow shift-click into the GUI - that seems to at least be a functional workaround, as this bug is not reproducible with shift+click, only with the default left click in non-sequential GUI slots.

Edit: Issue closed, old version & new issue opened as similar bug exists on current version.

[Bug] 0.74-SNAPSHOT; Drives deleted if moved or placed non-sequentially (Extension of issues #19 / #11)

Description
TLDR: If an ES Drive is moved repeatedly or placed in any position other than the first, it will get deleted. Client side, the drive will visually appear to be "stuck" in the menu, unable to be picked up or further moved, and when the menu is closed and re-opened, the drive will no longer exist. This includes deletion of ALL items inside the given drive, so this is a potentially very damaging bug (up to 64k+ items deleted at once).

To Reproduce
Steps to reproduce the behavior (seems to occur more than 50% of the time, although not always):

  • Place an empty ES System anywhere.
  1. Place an ES Drive of any size in the menu, in any slot.
  2. The drive should relocate to the first spot in the menu.
  3. Pick up and move the drive to any other slot.

Alternatively,

  1. Place an ES Drive in the first slot of the menu, or shift-click the drive.
  2. Pick up and move the drive to any other slot.

Upon doing either of these processes, the drive will appear to be "stuck" in the menu, and can no longer be retrieved. Upon closing the GUI, the drive is deleted and no longer accessible in any way.

Expected behavior
Normally I'd expect the drive to still exist ๐Ÿ˜… In all seriousness, the drive should automatically be moved to populate the first index in the array, which it does do, once (and only once) if the drive is placed in any spot beyond the first when it is first placed into the system. However, any subsequent attempts will cause this bug instead of relocating it to the first index. Additionally, this bug does not occur at all when using Shift+click to add or remove drives, regardless of how quickly they are clicked (likely because this forces the drive to use the next open index, rather than attempting to force the drive into an index outside the current array bounds).

Possible solutions
Utilizing my personal experience with this sort of bug, as well as having recompiled this exact mod for a previous version to fix the same issue, my possible solutions to fix this bug are:

  1. Rather than a dynamically sized array, create an array of fixed size 5, such that the sequential order no longer matters.
  • This is technically bad practice as the array is then forced to be larger than necessary and may consume additional RAM for each ES System, and is less "efficient" although it prevents this bug.
  1. Restrict user input to Shift+Click only (or override default left-click behavior to function as a shift-click), as this forces the player to place drives sequentially and can no longer accidentally delete a drive by placing it out of bounds.
  • This is an elegant solution as it is equally as accessible to the end user (drives are automatically placed on click), and prevents possible malicious behavior (there is no legitimate reason a player would need to place a drive in any slot other than the first open one, other than to take advantage of this bug and mass delete items), as well as keeps the code relatively efficient.
  1. Validate placement of drives and relocate them to the first empty index in the array, instead of taking the array index based on user input.
  • This is also a relatively elegant solution, but may cause lag as it will require more CPU time to validate each placement; however, this will fix the bug, and prevent malicious behavior, and does not directly prevent the player from moving drives within their inventory (as the second solution does).

Errors
Console error output: https://pastebin.com/bX9jnL4T
TLDR: Index out of bounds, array object placement error.

Screenshots
Reproducing the bug
image
After closing and re-opening the drive menu (no drive ๐Ÿ˜ข)
image

Versions
MC: Currently hosting a server on Paper 1.18.1 (ver. git-Paper-71)

Additional context
This should be an admittedly rare bug in normal gameplay, but an accidental placement of a drive from a misclick could result in up to 60,000+ items being deleted with no in-game fix other than spawning the items back in, which is tedious in its best case scenario, and downright impossible in its worst case.

Removing drives in early indexes (eg. removing the leftmost drive[s] and leaving in the rightmost ones) appears to have no effect on the remaining drives, and said drives are properly relocated to earlier indexes upon re-opening the menu. (This is a good thing; but it is seemingly inconsistent with the behavior the bug presents.)

Another interesting side effect of this bug is that while holding several drives, it is in fact possible to retrieve a stuck drive, by merely adding other drives in the proper sequential order until the "stuck" drive is reached (which will expand the bounds of the array such that the drive is now within a proper index). However, if the player is only holding one or two drives and misclicks their valuables into the wrong spot, they'll all be gone forever ๐Ÿ˜ข

nbtapi error during load

Hello, I think I am doing something wrong here, but loading up the spigotmc.org plugin failed with multiple errors, attempting to compile the plugin required a slight update to the pom to use apache shade dependency version 3.3.1 (3.3.0 is missing from apache's repos) However now during load I am seeing this issue:

[11:06:38] [Server thread/ERROR]: Error occurred while enabling EnergeticStorage v0.7.6-SNAPSHOT (Is it up to date?)
java.lang.NoClassDefFoundError: de/tr7zw/changeme/nbtapi/NBTItem
at net.seanomik.energeticstorage.utils.ItemConstructor.createSystemBlock(ItemConstructor.java:23) ~[energeticstorage-0.7.6-SNAPSHOT.jar:?]
at net.seanomik.energeticstorage.utils.ItemRecipes.registerBlockRecipes(ItemRecipes.java:19) ~[energeticstorage-0.7.6-SNAPSHOT.jar:?]
at net.seanomik.energeticstorage.utils.ItemRecipes.registerRecipes(ItemRecipes.java:12) ~[energeticstorage-0.7.6-SNAPSHOT.jar:?]
at net.seanomik.energeticstorage.EnergeticStorage.onEnable(EnergeticStorage.java:33) ~[energeticstorage-0.7.6-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:541) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugin(CraftServer.java:560) ~[paper-1.18.2.jar:git-Paper-341]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugins(CraftServer.java:474) ~[paper-1.18.2.jar:git-Paper-341]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:664) ~[paper-1.18.2.jar:git-Paper-341]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:431) ~[paper-1.18.2.jar:git-Paper-341]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:316) ~[paper-1.18.2.jar:git-Paper-341]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.18.2.jar:git-Paper-341]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.18.2.jar:git-Paper-341]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.ClassNotFoundException: de.tr7zw.changeme.nbtapi.NBTItem
at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:151) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:103) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:520) ~[?:?]
... 15 more

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.