Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[1.10.2] diferent metadata of the same itemstacking together when must'n[SOLVED]

Featured Replies

Posted

good nights

i'm retaken mi mod after long time without work on it

so wanna correct a little trouble from mi mod

 

this are the herbs from resident evil 

4 herbs and there are seed, plant, and plant in pot version of each one

 

at mixing them the item at output is only one item named "hierba" whit eleven meta versions

 

//############################################################################################3
public String getUnlocalizedName(ItemStack stack)
{
  	
int m= stack.getMetadata();
if (m == 0){return "hierbaAmarilla" ;}
if (m == 1){return "hierbaRoja" ;}
if (m == 2){return "hierbaAzul" ;}

if (m == 3){return "hierbaVerde" ;}
if (m == 4){return "hierba2Verdes" ;}
if (m == 5){return "hierba3Verdes" ;}
if (m == 6){return "hierbaVerdeyRoja" ;}
if (m == 7){return "hierba2VerdesyRoja" ;}

if (m == {return "hierba1Verde1Azul" ;}
if (m == 9){return "hierba1Verde1Roja1Azul" ;}

if (m == 10){return "hierba1Verde1Roja1Amarilla" ;}
if (m == 11){return "AidSpray" ;}
return name;

}
//############################################################################################3

 

video

 

soo i already have 2 mixed green + red herb metadata 6

now i just make the mashed red herb  metadata 1

and for some reason this red herb[1] end mixed whit the  two green + red herb [6] 

so i end whit 3  green + red herb[6] and that is wrong, the red herb must not mix in this way

 

then i mash some blue herb[2] but end stacked whit the mashed green herb[3] so now i have 3 green herbs

 

··········································

may im losing some flag at declaring the class hierba.java

can someone point me what im missing please

 

this is hierba.java

https://gist.github.com/anonymous/59409992c5b24d59a0d615e14cb278ff

 

this are the recipes

https://gist.github.com/anonymous/e9cec1c8f34699a2eb453f03e408d192

 

 

 

 

 

this.setHasSubtypes(false);

 

You're telling Minecraft that

hierba

doesn't have any subtypes, so it allows different metadata values to stack with each other. Change

false

to

true

and different metadata values won't be allowed to stack.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

As a matter of style, I would replace that sequence of if statements with a simple switch, or even a reference to a static array.

The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.