Jump to content

[1.10.2] Loading custom gui for custom block


Messorix

Recommended Posts

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.

Link to comment
Share on other sites

  • Replies 79
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

[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 :P

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements




  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hi Everyone, I'm new to the sub but needed some help figuring out a lot of the server tick issues and errors I have been getting. I run a small 1-3 player 1.19.2 forge minecraft server with around 215 or so mods (mix of QoL, server sided, performance, and client/ui mods). I run a Ryzen 5600x, 48gb of ram, and an Asus tuf 1650s. Current jvm allocation is for 12gb (overkill I know, but thought it would require so for the amount of mods I have). Typically my server had ran <20ms avg. tick, but currently has been going up closer and closer to 50ms, with sky rockets to >100ms up to around even 700ms at times. I assume it has to do with an entity ticking loop or something of the sort butn my knowledge of servers ands mods is very inept. Here is my mod list: https://mclo.gs/Yh3uW9J Here is the link to my latest.log: https://mclo.gs/uXtekkO In addition here is my debug.log: https://mclo.gs/f4zMNQQ I see a lot of errors in both logs, but cannot figure out for the life of me what mod(s) are causing them. If there is anymore info that I can provide that can help me sort this out, I am more than willing to provide it. Just want my server to run nicely lol. edit: i know the current logs show missing content. those are mods that i have already deemed not needed/not working well/as intended so they have been removed. edit #2: i have already tried using spark profiler to find the mod that is using the most resources, but to no avail. here is the link to the latest profiler i ran: https://spark.lucko.me/dIAmpPkGdo Thank you in advance!
    • i recheck the kapenjoe tutorial from another stance and actually manage to make custom trades for the villagers and the trader    seems like the wanderer has 64 normal trades and 6 especial  ### addCustomWandererTrades( generic 64) ### addCustomWandererTrades( rare    6)   ################################################## the problem is that the 3 custome trades i add rarely gets loaded in the wanderer offered item list but are there  if i delete the list whit generic.clear() before adding mi things then only mi things get loaded an a ice cube i dont know where is coming              generic.add((trader, rand) -> new MerchantOffer(                 new ItemStack(Items.EMERALD, 6),                 new ItemStack(BlockInit.POTTED_BLUE_HERB.get().asItem(), 2),                 2, 10, 0.02F)         ); it dont seems to be a weight variable to increase the possibility of mi custom trades ######################### what i want is  to increase the chance of mi custome trades to be vissible  how can i do that....          
    • For Example, Simply swords is a mod that i think looks cool. I've noticed I can use it in a world but friends can't join. Error is "Registry remapping failed: null". Is there a way to fix this or is it not possible to use with friends?
    • You could try using spark (https://www.curseforge.com/minecraft/mc-mods/spark) to see if it gives you any other insight into what is making ticks take too long, perhaps it's a combination of mods. If it's simply the yuushya mod processing that is causing it to hang, the only solution would be removing that mod, or possibly updating/downgrading to a version that doesn't make ticks take too long.
    • Looking for help with reading this crashlog for my server. I can tell yuushya causes it. I want to try to figure out what else causes this crash. I need yuushya but any other mod could get deleted if needed. https://paste.ee/p/eUS38 is the crash log
  • Topics

×
×
  • Create New...

Important Information

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