CivClassic / FactoryMod

Configurable factories for automating item production - Built for Paper 1.16.5
Other
2 stars 17 forks source link

Add configurable factory I/O + fix a few bugs #58

Closed caucow closed 3 years ago

caucow commented 3 years ago

Adds configurable factory IO as described in #54.

Also fixes diode power loop in #51.

Possible fix for #40? Maybe only partial fix? Redstone dust triggers might not be possible with Paper.

Fixes diode triggers activating factories they are not pointing into. Will need additional work if other directional blocks have the same problem.

Updated the main factoryinstance UI, fix for #9? How updated does it all need to be, recipes are in a scroller and other buttons line the bottom.

Depends on CMC PR 101

Diet-Cola commented 3 years ago

On test

Diet-Cola commented 3 years ago

Updated test

Diet-Cola commented 3 years ago
[04:19:23 ERROR]: Could not pass event PlayerInteractEvent to FactoryMod v2.5.2
java.lang.NullPointerException: Cannot invoke "com.github.igotyou.FactoryMod.factories.FurnCraftChestFactory$UiMenuMode.ordinal()" because "curMode" is null
        at com.github.igotyou.FactoryMod.interactionManager.FurnCraftChestInteractionManager.buildMenuModeCycleButton(FurnCraftChestInteractionManager.java:337) ~[?:?]
        at com.github.igotyou.FactoryMod.interactionManager.FurnCraftChestInteractionManager.buildRecipeInventory(FurnCraftChestInteractionManager.java:220) ~[?:?]
        at com.github.igotyou.FactoryMod.interactionManager.FurnCraftChestInteractionManager.leftClick(FurnCraftChestInteractionManager.java:200) ~[?:?]
        at com.github.igotyou.FactoryMod.listeners.FactoryModListener.playerInteract(FactoryModListener.java:163) ~[?:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor318.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69) ~[patched_1.16.5.jar:git-Tuinity-"f7c4249"]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[patched_1.16.5.jar:git-Tuinity-"f7c4249"]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[patched_1.16.5.jar:git-Tuinity-"f7c4249"]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:624) ~[patched_1.16.5.jar:git-Tuinity-"f7c4249"]
        at org.bukkit.craftbukkit.v1_16_R3.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:549) ~[patched_1.16.5.jar:git-Tuinity-"f7c4249"]
        at org.bukkit.craftbukkit.v1_16_R3.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:512) ~[patched_1.16.5.jar:git-Tuinity-"f7c4249"]
        at org.bukkit.craftbukkit.v1_16_R3.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:507) ~[patched_1.16.5.jar:git-Tuinity-"f7c4249"]
        at net.minecraft.server.v1_16_R3.PlayerInteractManager.a(PlayerInteractManager.java:210) ~[patched_1.16.5.jar:git-Tuinity-"f7c4249"]
        at net.minecraft.server.v1_16_R3.PlayerConnection.a(PlayerConnection.java:1732) ~[patched_1.16.5.jar:git-Tuinity-"f7c4249"]
        at net.minecraft.server.v1_16_R3.PacketPlayInBlockDig.a(SourceFile:40) ~[patched_1.16.5.jar:git-Tuinity-"f7c4249"]
        at net.minecraft.server.v1_16_R3.PacketPlayInBlockDig.a(SourceFile:10) ~[patched_1.16.5.jar:git-Tuinity-"f7c4249"]
        at net.minecraft.server.v1_16_R3.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:55) ~[patched_1.16.5.jar:git-Tuinity-"f7c4249"]
        at net.minecraft.server.v1_16_R3.TickTask.run(SourceFile:18) ~[patched_1.16.5.jar:git-Tuinity-"f7c4249"]
        at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.16.5.jar:git-Tuinity-"f7c4249"]
        at net.minecraft.server.v1_16_R3.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.16.5.jar:git-Tuinity-"f7c4249"]
        at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.16.5.jar:git-Tuinity-"f7c4249"]
        at net.minecraft.server.v1_16_R3.MinecraftServer.bb(MinecraftServer.java:1325) ~[patched_1.16.5.jar:git-Tuinity-"f7c4249"]
        at net.minecraft.server.v1_16_R3.MinecraftServer.executeNext(MinecraftServer.java:1318) ~[patched_1.16.5.jar:git-Tuinity-"f7c4249"]
        at net.minecraft.server.v1_16_R3.IAsyncTaskHandler.executeAll(IAsyncTaskHandler.java:95) ~[patched_1.16.5.jar:git-Tuinity-"f7c4249"]
        at net.minecraft.server.v1_16_R3.MinecraftServer.a(MinecraftServer.java:1455) ~[patched_1.16.5.jar:git-Tuinity-"f7c4249"]
        at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:1134) ~[patched_1.16.5.jar:git-Tuinity-"f7c4249"]
        at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$a$0(MinecraftServer.java:292) ~[patched_1.16.5.jar:git-Tuinity-"f7c4249"]
        at java.lang.Thread.run(Thread.java:831) [?:?]
Diet-Cola commented 3 years ago

Updated test

caucow commented 3 years ago

Added configable fuelchests + limit options defaults are

max_input_chests: 10
max_output_chests: 10
max_fuel_chests: 10
max_iof_chests: 15
Diet-Cola commented 3 years ago

Updated test

Diet-Cola commented 3 years ago

Minor note but if you dont mind updating your local paper Shadow and implementing the close() method in the MultiInventoryWrapper with this, same for your CMC PR with ClonedInventory

caucow commented 3 years ago

paper is better than this ffs and why isn't close() just a default method... it can be a default method updated (+cmc)

Convoy20 commented 3 years ago

@caucow is the check below an issue?

caucow commented 3 years ago

@caucow is the check below an issue?

Build fails because Could not find artifact vg.civcraft.mc.civmodcore:CivModCore:jar:1.8.4 because

Depends on CMC PR 101

It's not a problem, CMC just needs its PRs merged before this can build properly. At a bare minimum, https://github.com/CivClassic/CivModCore/pull/101 and https://github.com/CivClassic/CivModCore/pull/102 also needs to be pulled, and CMC's dependencies in jenkins/whatever CI (idk anything about CI rip) need updated so that PR will build.

caucow commented 3 years ago

Needs a lot of testing which I cant really comment on here, otherwise okay except for two minor things.

I spent a lot of time in game testing the new features including chaining a number of the new factories together in different configurations (which lead to me fixing some of the other older bugs since they were interfering, then testing those fixes/discussing behavior in praxis), checking input/output/fuel being consumed (or not) when directions are toggled, making sure factories shut off when the MultiInv doesn't have required mats, some crude performance testing (perf hit scales linearly with number of items/chests in a MultiInv, hard config limits added to prevent compact factory lag machines, next to no extra overhead that wasn't already included), some stability testing (not much because the plugin is barely designed with fail cases and config/storage issues in mind), plus whatever time people on the CC test server spent with it. Is there anything specific you're concerned about?

Latest commit changes should probably get more testing (I'm out of town atm), most I did was make sure it compiled, run, let me make and configure factories, and properly saved/loaded/reloaded factory storage.

Convoy20 commented 3 years ago

Newest build is on test

Maxopoly commented 3 years ago

Might want to also include user friendly behavior for server which decide to not enable this feature. I know that you can just set it to 0 in the config, but mean rather making sure that the GUI and/or help messages aren't confusing and indicating towards something thats disabled. Not terribly important though