August 4, 20169 yr Lets try something instead of re creating the variables public final int fuel_slots = 1; public final int input_slots = 1; public final int output_slots = 2; just initialize them in the constructor. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 4, 20169 yr Has it occurred to anyone in this thread to use Capabilities instead? Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
August 4, 20169 yr Has it occurred to anyone in this thread to use Capabilities instead? Why would he want to use capabilities, he is using a TileEntity, not saving data to the player. Note to self capabilities can be tied to TileEntities. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 4, 20169 yr Author Like this? public ContainerFluxGrinder(InventoryPlayer player, TileEntityFluxGrinder tileentity) { super(player, tileentity); super.fuel_slots = 1; super.input_slots = 1; super.output_slots = 2; tileEntityFluxGrinder = tileentity; } Dev of MoleculeCraft https://github.com/Messorix/MoleculeCraft
August 4, 20169 yr Yes, did that work. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 4, 20169 yr Author It did not Meanwhile I'm reading up on what Capabilities actually is Dev of MoleculeCraft https://github.com/Messorix/MoleculeCraft
August 4, 20169 yr Like this? public ContainerFluxGrinder(InventoryPlayer player, TileEntityFluxGrinder tileentity) { super(player, tileentity); super.fuel_slots = 1; super.input_slots = 1; super.output_slots = 2; tileEntityFluxGrinder = tileentity; } Instead change the variables to not final and call super after changing them. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 4, 20169 yr Author super(player, tileentity); has to be the first line in the constructor... (finals were already removed) Dev of MoleculeCraft https://github.com/Messorix/MoleculeCraft
August 4, 20169 yr Why would super have to be first? VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 4, 20169 yr Author Eclipse says "Constructor call must be the first statement in a constructor" so.... Dev of MoleculeCraft https://github.com/Messorix/MoleculeCraft
August 4, 20169 yr Well then I'm going to say what I think happened since you are using for loops and setting variables that are initially set to 0. The constructor for the previous class gets called before the variables could get set in your ContainerFluxGrinder. Solution add slots in your new Containers atleast the ones that are not required. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 4, 20169 yr Author As far as my knowledge of Java-programming goes, child-constructors get called first and then go up the parent-tree. I'm also not entirely sure how you mean this: Solution add slots in your new Containers atleast the ones that are not required. Dev of MoleculeCraft https://github.com/Messorix/MoleculeCraft
August 4, 20169 yr Sadly it is not so http://stackoverflow.com/questions/1168345/why-does-this-and-super-have-to-be-the-first-statement-in-a-constructor What I mean is if you have something like upgrade slots that will be in all of the containers, you can add them in the main container. And all new ones for that specific TileEntity you add in that TileEntities container. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 4, 20169 yr Author That still doesn't explain how I'm supposed to handle this problem though... Dev of MoleculeCraft https://github.com/Messorix/MoleculeCraft
August 4, 20169 yr Ok you are going to have to add your Slots that are for you TileEntityFluxGrinder, you need to add them in your ContainerFluxGrinder. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 4, 20169 yr Author I never make any custom slots though... Only in the container classes are Slots (as classes/entities) mentioned. So I'm still unsure what you exactlye mean by that Dev of MoleculeCraft https://github.com/Messorix/MoleculeCraft
August 4, 20169 yr addSlotToContainer is being called in your main class. When you call it the number of slots is still = 0 for all of those, and since you stored the number of slots in your TileEntity I don't understand why you don't use those? Instead of creating new variables in your container. *Note make them not final. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 4, 20169 yr Author I got the slots to show up properly and if I shift-click a copper ingot it doesn't crash anymore. However, it doesn't get placed in the input slot nor does fuel end up in the fuel slot... Have I missed some functionality? git is updated Dev of MoleculeCraft https://github.com/Messorix/MoleculeCraft
August 4, 20169 yr What does this line print out now? System.out.println(first_input_index + ", " + input_slots + ", " + (first_input_index + input_slots)); VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 4, 20169 yr Author [10:20:05] [Client thread/INFO] [sTDOUT]: [com.messorix.moleculecraft.base.containers.ContainerFluxGrinder:transferStackInSlot:45]: 37, 1, 38 [10:20:05] [server thread/INFO] [sTDOUT]: [com.messorix.moleculecraft.base.containers.ContainerFluxGrinder:transferStackInSlot:45]: 37, 1, 38 So that works I guess Dev of MoleculeCraft https://github.com/Messorix/MoleculeCraft
August 4, 20169 yr That should be working....but change //This if (!mergeItemStack(sourceStack, first_fuel_index, first_fuel_index + fuel_slots, true)) // To this if (!mergeItemStack(sourceStack, first_fuel_index, first_fuel_index + fuel_slots, false)) VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 4, 20169 yr Author Not sure what should've changed, but it didn't do anything. Everything is exactly the same, even error log Dev of MoleculeCraft https://github.com/Messorix/MoleculeCraft
August 4, 20169 yr There was an error log? VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
August 4, 20169 yr Author I meant the console... My bad Dev of MoleculeCraft https://github.com/Messorix/MoleculeCraft
August 4, 20169 yr Did you check if you could shift click fuel into the inventory? *Ignore what code question was here. VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect. Forge and vanilla BlockState generator.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.