Jump to content

[1.7.2] [UNSOLVED] MetaData Block|Item drop & Metadata block crash


Recommended Posts

Posted

Hello.

 

I've created a metadata based block, but now I have a problem. This block drops everytime itself, but I want that this block drops an Item and that the same block with an other metadata drops an other item or more of the same item.

 

Here is my code:

 

  Reveal hidden contents

 

 

So what must I change, that the block with metadata 0 drops as an example two sticks and the block with metadata 1 drops 6 coal?

Second problem can be found here: http://www.minecraftforge.net/forum/index.php/topic,20990.msg106490.html#msg106490

 

Bektor

Developer of Primeval Forest.

Posted
  On 7/7/2014 at 11:53 AM, diesieben07 said:

Use the getDrops method, you have full control over what is dropped in which circumstance if you use it.

Ok, thanks. So how need I to use this method? (adding the different items/block that should be dropped and the quantityDropped)

Developer of Primeval Forest.

Posted

Thanks. But it seems to be, that sometimes I get an crash by the Icon (in 3 from 7 world, that I created happend it...)

 

So here is my code:

 

  Reveal hidden contents

 

 

and here is the crash:

 

  Reveal hidden contents

 

 

And yes, I know that this is a different class, then  the class with the getDrops method (well, exact the same classes, only one method is different and the sub-blocks...)

 

Bektor

Developer of Primeval Forest.

Posted

Yes, I understand my code and no, I'm didn't know how to fix this. (The String types has a size of 2, I've 4 images, 2 for the side and 2 for the top, because I have 2 blocks and the getSubBlocks methods creates 2 sub blocks...)

And well, the error is very obvious for you, but not for me (I hate ArrayIndexOutOfBoundsException, thats the error where I'm failing really often by fixing it and most time I give up after a few hours....and mostly I getting this error by 2D-Java Games by the screen rendering...but thats an other story...)

Developer of Primeval Forest.

Posted
  On 7/7/2014 at 2:50 PM, diesieben07 said:

You have 2 icons. But somehow you have a block that has a metadata which makes your code access the 3 element (index 2).

Ok, but how could I fix it (tried it with the getTypeFromMeta method, but didn't work)

Developer of Primeval Forest.

Posted
  On 7/8/2014 at 1:17 PM, diesieben07 said:

Do you know what the "&" operator does?

Yes. The "&" operator means "and".

And/But why is it working if I have more then 3 different wood blocks?

Developer of Primeval Forest.

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.