Jump to content

TheMajorN

Members
  • Posts

    70
  • Joined

  • Last visited

Everything posted by TheMajorN

  1. Heya, so I'm making a cutting board for turning meat into sliced meat and all that. I have everything set up: The container, tile entity, gui, etc. Everything is working fine, except for the fact that when I put beef into the first slot, nothing happens and nothing outputs. I double and triple checked all the code and everything seems to be in line and I'm sure this is just a stupid error, but I'm not sure what to do about it. Here's my the relevant files in my github (Containers, tile entities, serializers, recipes, etc) : https://github.com/TheMajorN/sculleryProject/tree/main/src/main/java/com/thamajorn/scullery/util https://github.com/TheMajorN/sculleryProject/tree/main/src/main/java/com/thamajorn/scullery/tileentities https://github.com/TheMajorN/sculleryProject/tree/main/src/main/java/com/thamajorn/scullery/container https://github.com/TheMajorN/sculleryProject/tree/main/src/main/java/com/thamajorn/scullery/gui https://github.com/TheMajorN/sculleryProject/tree/main/src/main/java/com/thamajorn/scullery/recipes https://github.com/TheMajorN/sculleryProject/tree/main/src/main/resources/data/scullery/recipes/cuttingboardrecipes Sorry for pretty much having someone look over my work but maybe an extra set of eyes is just what I need. Edit: You'll see some files not using upper camel case, sorry about that but it's not really my priority rn to fix it rn but I'll get around to organization once I get this problem sorted.
  2. Oh my god thank you so much. I changed super to this and it worked just fine.
  3. Heya, I just made a GUI and am attempting to test it in game, but whenever I tap the block with said GUI, I get this error and my game crashes: [17:19:15] [Server thread/FATAL] [minecraft/ThreadTaskExecutor]: Error executing task on Server java.lang.NullPointerException: null at net.minecraftforge.items.SlotItemHandler.getStack(SlotItemHandler.java:54) ~[forge:?] {re:classloading} at net.minecraft.inventory.container.Container.getInventory(Container.java:121) ~[forge:?] {re:classloading} at net.minecraft.inventory.container.Container.addListener(Container.java:101) ~[forge:?] {re:classloading} at net.minecraftforge.fml.network.NetworkHooks.openGui(NetworkHooks.java:228) ~[forge:?] {re:classloading} at net.minecraftforge.fml.network.NetworkHooks.openGui(NetworkHooks.java:188) ~[forge:?] {re:classloading} at com.thamajorn.scullery.blocks.Cuttingboard.onBlockActivated(Cuttingboard.java:121) ~[?:?] {re:classloading} at net.minecraft.block.AbstractBlock$AbstractBlockState.onBlockActivated(AbstractBlock.java:730) ~[forge:?] {re:classloading} at net.minecraft.server.management.PlayerInteractionManager.func_219441_a(PlayerInteractionManager.java:347) ~[forge:?] {re:classloading} at net.minecraft.network.play.ServerPlayNetHandler.processTryUseItemOnBlock(ServerPlayNetHandler.java:986) ~[forge:?] {re:classloading} at net.minecraft.network.play.client.CPlayerTryUseItemOnBlockPacket.processPacket(CPlayerTryUseItemOnBlockPacket.java:45) ~[forge:?] {re:classloading} at net.minecraft.network.play.client.CPlayerTryUseItemOnBlockPacket.processPacket(CPlayerTryUseItemOnBlockPacket.java:12) ~[forge:?] {re:classloading} at net.minecraft.network.PacketThreadUtil.lambda$checkThreadAndEnqueue$0(PacketThreadUtil.java:19) ~[forge:?] {re:classloading} at net.minecraft.util.concurrent.TickDelayedTask.run(TickDelayedTask.java:20) ~[forge:?] {re:classloading} at net.minecraft.util.concurrent.ThreadTaskExecutor.run(ThreadTaskExecutor.java:139) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.util.concurrent.RecursiveEventLoop.run(RecursiveEventLoop.java:22) ~[forge:?] {re:classloading} at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:758) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:159) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.util.concurrent.ThreadTaskExecutor.driveOne(ThreadTaskExecutor.java:109) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.driveOneInternal(MinecraftServer.java:741) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.driveOne(MinecraftServer.java:735) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.util.concurrent.ThreadTaskExecutor.driveUntil(ThreadTaskExecutor.java:122) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.runScheduledTasks(MinecraftServer.java:721) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:667) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.lambda$startServer$0(MinecraftServer.java:233) ~[forge:?] {re:classloading,pl:accesstransformer:B} at java.lang.Thread.run(Thread.java:748) [?:1.8.0_261] {} [17:19:15] [Server thread/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID 03ce1766-0f70-44d1-a1e0-bd03f5bb8d8e [17:19:15] [Server thread/ERROR] [minecraft/MinecraftServer]: Encountered an unexpected exception net.minecraft.crash.ReportedException: Ticking entity at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:888) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:820) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:84) ~[forge:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:663) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.lambda$startServer$0(MinecraftServer.java:233) ~[forge:?] {re:classloading,pl:accesstransformer:B} at java.lang.Thread.run(Thread.java:748) [?:1.8.0_261] {} Caused by: java.lang.NullPointerException at net.minecraftforge.items.SlotItemHandler.getStack(SlotItemHandler.java:54) ~[forge:?] {re:classloading} at net.minecraft.inventory.container.Container.detectAndSendChanges(Container.java:132) ~[forge:?] {re:classloading} at net.minecraft.entity.player.ServerPlayerEntity.tick(ServerPlayerEntity.java:378) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.world.server.ServerWorld.updateEntity(ServerWorld.java:623) ~[forge:?] {re:classloading} at net.minecraft.world.World.guardEntityTick(World.java:601) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.world.server.ServerWorld.tick(ServerWorld.java:407) ~[forge:?] {re:classloading} at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:884) ~[forge:?] {re:classloading,pl:accesstransformer:B} ... 5 more I'll be checking around for a solution myself, but if not, if anyone can point me in the right direction, that would be much appreciated. Here's my github on the project: https://github.com/TheMajorN/sculleryProject/tree/main/src/main/java/com/thamajorn/scullery (And yes, I'm in the process of fixing the file names to UpperCamelCase)
  4. Heya, So I'm working on a mod at the moment and prior to adding a certain element of the mod, I was able to run it just fine. Now that I wrote up the classes and try to start Minecraft, I'm greeted with this error (The text below was ran in Debug mode): Connected to the target VM, address: '127.0.0.1:58424', transport: 'socket' Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.NoClassDefFoundError: com/mojang/authlib/exceptions/AuthenticationException at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) at java.lang.Class.privateGetMethodRecursive(Class.java:3048) at java.lang.Class.getMethod0(Class.java:3018) at java.lang.Class.getMethod(Class.java:1784) at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:650) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:632) Caused by: java.lang.ClassNotFoundException: com.mojang.authlib.exceptions.AuthenticationException at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:418) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355) at java.lang.ClassLoader.loadClass(ClassLoader.java:351) ... 7 more Disconnected from the target VM, address: '127.0.0.1:58424', transport: 'socket' Process finished with exit code 1 If anyone can tell me what's wrong and perhaps even how to fix it, that would be much appreciated! Until then, I'll be searching up possible fixes. EDIT: Yeah so I'm just dumb and had to update my IDE. We good now!
  5. Sorry for the late reply; thank you very much for the help. Also yeah I'm still trying to break the bad habit that I developed when I started java coding with the naming conventions lol. Workin on it though!
  6. Heya, So I'm having trouble registering my tile entity on my 1.16.4 version. The previous tutorials I looked up have the tile entities registered in 1.15 and I believe it's registered differently now. My current registry for my Tile Entity looks like this: public static final RegistryObject<TileEntityType<cuttingBoardTileEntity>> CUTTINGBOARD_TILE = TILE_ENTITIES.register("cuttingboard", () -> TileEntityType.Builder.create(cuttingBoardTileEntity::new, registryHandler.CUTTINGBOARD)); but I'm getting an error at "new" where it says that it cannot resolve constructor despite me having one in my cuttingBoardTileEntity class. Here is the full class on github in case you wanna take a peek: https://github.com/TheMajorN/sculleryProject/blob/main/src/main/java/com/thamajorn/scullery/util/registryHandler.java Any help would be appreciated!
  7. Thank you so much
  8. Do I do this in the block class?
  9. Hello, I set up a GUI without a Container because it's going to be completely client side. Is there a way I can open it without the Container or do I have to set one up?
  10. I'll check this out, thanks!
  11. Hey, So I'm making a mod that adds a block that keeps track of inventory in a specific range. It's meant to be put in a storage room and keeps an index of the contents of the chests in that storage room. My problem at the moment is making the GUI with a search bar for that item. I'm not sure what I should use to make that search bar. I don't think blaze3d can do search bars(?). I'm also unsure if I should make the GUI class itself extend a ContainerScreen because it's technically not going to be containing anything. Any help or points in the right direction will be greatly appreciated!
  12. Heya, So I'm making a salt evaporator, which essentially takes the water that you put in it, and "ages" until you can harvest the salt at the bottom. It works by filling the evaporator with water via right clicking on it with the water bucket, then it works like a crop until it reaches "max age" at which point you can harvest the salt. Thing is, at the moment, it ages the moment I place the block. How would I make it only start to age when I fill it with water? Any help would be appreciated! Here is the class in my github https://github.com/TheMajorN/sculleryProject/blob/main/src/main/java/com/thamajorn/scullery/blocks/SaltEvaporator.java
  13. Thanks fellas, I'll give those a look
  14. Heya, So, I'm in the middle of making a Salt evaporator block, where you place water inside of it and it fills with water like a cauldron. I would like, over time, for the blockstate to change so the water level decreases until it is empty with salt at the bottom. I have no experience using a ticker, so any point in the right direction would be much appreciated! To put in perspective, I have the blockstates of the salt evaporator set to models for when it's full, water level 3, water level 2, empty, etc. But I'm not sure where to go from there. Here's my github in case you wanna have a look: https://github.com/TheMajorN/sculleryProject/tree/main/src/main Anything labeled "saltevaporator" is what I'm currently working with.
  15. Oh thank you, I'll deffo give this a look
  16. Alright, thanks, I'll look into that. You've been a great help.
  17. Thank you so much for the tips, so I should move the init method to after the container type register? Also, how should I better adhere to the separation of concerns? Sorry for all the questions, I'm still fairly new to this. Thanks again!
  18. Hey, sorry for the late reply, here is the repository: https://github.com/TheMajorN/sculleryProject.git
  19. Heya, So, I tried making a GUI in minecraft, and everything was going smoothly, it all compiled, and Minecraft ran without a problem. However, when I actually tried to right click the block, instead of opening the GUI, nothing happened and the debug console greeted me with this message: [15:30:04] [Server thread/FATAL] [minecraft/ThreadTaskExecutor]: Error executing task on Server java.lang.UnsupportedOperationException: Unable to construct this menu by type at net.minecraft.inventory.container.Container.getType(Container.java:56) ~[forge:?] {re:classloading} at net.minecraftforge.fml.network.NetworkHooks.openGui(NetworkHooks.java:223) ~[forge:?] {re:classloading} at net.minecraftforge.fml.network.NetworkHooks.openGui(NetworkHooks.java:188) ~[forge:?] {re:classloading} at com.thamajorn.scullery.procedures.OpenProcedure.executeProcedure(OpenProcedure.java:63) ~[?:?] {re:classloading} at com.thamajorn.scullery.blocks.Cuttingboard.onBlockActivated(Cuttingboard.java:103) ~[?:?] {re:classloading} at net.minecraft.block.AbstractBlock$AbstractBlockState.onBlockActivated(AbstractBlock.java:730) ~[forge:?] {re:classloading} at net.minecraft.server.management.PlayerInteractionManager.func_219441_a(PlayerInteractionManager.java:347) ~[forge:?] {re:classloading} at net.minecraft.network.play.ServerPlayNetHandler.processTryUseItemOnBlock(ServerPlayNetHandler.java:986) ~[forge:?] {re:classloading} at net.minecraft.network.play.client.CPlayerTryUseItemOnBlockPacket.processPacket(CPlayerTryUseItemOnBlockPacket.java:45) ~[forge:?] {re:classloading} at net.minecraft.network.play.client.CPlayerTryUseItemOnBlockPacket.processPacket(CPlayerTryUseItemOnBlockPacket.java:12) ~[forge:?] {re:classloading} at net.minecraft.network.PacketThreadUtil.lambda$checkThreadAndEnqueue$0(PacketThreadUtil.java:19) ~[forge:?] {re:classloading} at net.minecraft.util.concurrent.TickDelayedTask.run(TickDelayedTask.java:20) ~[forge:?] {re:classloading} at net.minecraft.util.concurrent.ThreadTaskExecutor.run(ThreadTaskExecutor.java:139) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.util.concurrent.RecursiveEventLoop.run(RecursiveEventLoop.java:22) ~[forge:?] {re:classloading} at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:758) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:159) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.util.concurrent.ThreadTaskExecutor.driveOne(ThreadTaskExecutor.java:109) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.driveOneInternal(MinecraftServer.java:741) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.driveOne(MinecraftServer.java:735) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.util.concurrent.ThreadTaskExecutor.driveUntil(ThreadTaskExecutor.java:122) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.runScheduledTasks(MinecraftServer.java:721) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:667) ~[forge:?] {re:classloading,pl:accesstransformer:B} at net.minecraft.server.MinecraftServer.lambda$startServer$0(MinecraftServer.java:233) ~[forge:?] {re:classloading,pl:accesstransformer:B} at java.lang.Thread.run(Thread.java:748) [?:1.8.0_261] {} The game never crashed or anything, it would just give that message whenever I right clicked the block. If anyone can help or at least point me in the right direction, that would be much appreciated!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.