Jump to content

Recommended Posts

Posted
38 minutes ago, Merthew said:

Not sure what i did wrong here.

You didn't... do anything? I see no mentions of property overrides in your ItemSyringe.

ModItem, ItemBase, etc is an anti-pattern. Don't use it.

Oh also anything like IHasModel is stupid. All items need models and there is nothing about model registration that requires access to something private/protected in the item. And yes, your ModItem is basically a fancy IHasModel. Don't use it. Register your models in the ModelRegistryEvent.

 

Quote

ItemInit.ITEMS.add(this);

Instantinate your items directly in the RegistryEvent. Not anywhere else. Not in pre init. If you need a reference to the item later use ObjectHolders.

 

Quote

private int blood = 0;

There is no reason for this to exist.

 

if(blood == cap || blood == cap - 1 || blood == cap - 2) {
	blood = cap;
}
else {
	blood += 3;
}

=>

blood = Math.min(this.cap, blood + 3);

 

Quote

nbt.setInteger("cap", cap);

Any reason you are storing the cap in the NBT? You are only referencing the one declared by your Item instance.

 

Posted
Quote

stack.getTagCompound().getInteger("blood")/stack.getTagCompound().getInteger("cap")

What is 10 divided by 100? It's 0. 99 / 100 is also 0. Only 100 / 100 is 1. Dividing anything that doesn't have decimal points will just discard anything beyond them. You need to cast one of these to something that has a decimal point, like a float.

 

 

Posted
29 minutes ago, Merthew said:

How would i register the items/blocks in the registry event? would i create them in the registryhandler class?

You can store a static field in a class and initialize it in the registry event and then register 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.

Posted

No one thought about CustomMeshDefinitions? Property overrides only work for number values.

 

https://github.com/Draco18s/ReasonableRealism/blob/master/src/main/java/com/draco18s/industry/item/ItemCastingMold.java#L80

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.

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.