Jump to content

Recommended Posts

Posted

Hello,

my container is exhibiting some weird behaviour:
The itemstack inside is not saved if I close the gui, if however my code reaches a certain point (I have marked it with a comment) then the itemstack is saved normally.
My Code:
Container:
 

  Reveal hidden contents

The Gui:
 

  Reveal hidden contents

The Tile Entity(Code is marked here):

  Reveal hidden contents

Thank you for your help!

Posted
  On 5/27/2019 at 2:33 PM, diesieben07 said:

Also, I have no idea what to make of your error description. Please elaborate what is not saved or is saved in what exact circumstances. How are you checking if something "is saved"? 

Expand  

First of all thank you for the advice!

My problem is that when I close the gui the content of the slot is not saved everytime.
It is however sometimes saved, if I wait long enough and I think that has something to do with changing the progress variable, as when I removed the part I marked(in the tile entity class) the itemstack was not saved anymore.

Posted
  On 5/27/2019 at 4:25 PM, diesieben07 said:

package com.gloriousalpaca - You still do not own this domain.

Expand  

Well surely I won't need to buy a domain ? I'll just drop the com then.

  On 5/27/2019 at 4:25 PM, diesieben07 said:

Code-Style, issue 1, 2 and 4.

Expand  

About Issue 1: So I can just safely delete the commonproxy class?

Issue 2: Could you tell me where I did not use @Override ?

  On 5/27/2019 at 4:25 PM, diesieben07 said:

Problematic code, issue 14. 

Expand  

Is the class InitItems as a whole considered static or is it just the registerModels method? Also I can't seem to find the event for registering tile entities.

  On 5/27/2019 at 4:25 PM, diesieben07 said:

Why?

Expand  

I would like to change the blockstate based on whether an item is inserted or not.

  On 5/27/2019 at 4:25 PM, diesieben07 said:
Expand  

Yes I was testing something, originally I was checking for the unlocalized name, but I assume this is bad practice. Should I rather check for the registry name ?

  On 5/27/2019 at 4:25 PM, diesieben07 said:

You are not following the IItemHandler documentation.

Expand  

Okay so I am supposed to first extract the ItemStack, then modify it and lastly insert it again ?

 

Thank you very much for taking your time to help me, this has been incredibely useful and I am very sorry for making such common errors.

 

Posted
  On 5/27/2019 at 5:11 PM, diesieben07 said:

Your "CommonProxy" is like a server proxy. You need to have a client-side proxy, a server-side proxy and an interface that's being implemented by both.

Expand  

Okay so should I just rename it to serverproxy ?

  On 5/27/2019 at 5:11 PM, diesieben07 said:

Uh. Neither. Did you read issue 14? It's about creating item and block instances in static initializers. Not about methods, classes or models.

Expand  

Would this be okay then (I have not removed ItemBase yet):

  Reveal hidden contents

Again thank you very much!

Posted

I am not sure if I have understood this correctly but I tried using the ObjectHolder Annotation:
 

  Reveal hidden contents

This is the ItemHolder class:
 

  Reveal hidden contents

 

Posted
  On 5/27/2019 at 8:54 PM, diesieben07 said:

You are using @EventBusSubscriber to register the event handler LEER.RegistrationHandler. That means it's event handler methods must be static. Some are not.

Expand  

Everything except the soundevents are working now!
This is the crash I get when I register the soundevents:

  Reveal hidden contents

 

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



×
×
  • Create New...

Important Information

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