Jump to content

Recommended Posts

Posted (edited)

In my custom crop getSeed() and getCrop() return seed and crop values. quantityDropped() returns 4 if plant if grown up. So i noticed, if my plant is not grown up when i break it, it returns 1 seed ALWAYS, and 0 crops ALWAYS. But when is grown up it returns 4 crops because I return this value in quantityDropped(), but RANDOM seed amount, 0-4 or something. How can I change this amount to be 1-4?

Edited by LavX64
Posted

SOLVED as always, just by the time i ask forum about something it is starting to work.
I used this function to specify amount of drops. So there's only 1 Hemp seed always, and 1 additional + 4 fibers when it is fully grown.
Anyway anyone knows how to short this ugly Property checker? Cause I don't really understand how this values work.

@Override
	public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state,
			int fortune) {
			drops.add(new ItemStack(ItemInit.HEMP_SEEDS));
		if (state.getProperties().toString().charAt(state.getProperties().toString().length() - 2) == '7') {
			drops.add(new ItemStack(ItemInit.HEMP_FIBER, 4));
			drops.add(new ItemStack(ItemInit.HEMP_SEEDS));
		}
	}

 

Posted
26 minutes ago, diesieben07 said:

I don't even... what? What is that thing even trying to do?

Doesn't even matter, it's just this way I organize my mind by putting problem like that and deconstructing it, so forum helps me to realize how to fix the problem.

Posted
Just now, diesieben07 said:

I mean this:

You should not be doing this. What are you trying to achieve with it?

I do not control my ideas, it's just how it happens everytime, u can't do shit for 2 hours, go to forum, and boom u got the idea

Posted
Just now, diesieben07 said:

What idea? I quoted a specific piece of code, which you described as "ugly property checker" that you want to clean up. I want to help you clean up, but I have no idea what it's trying to achieve. Please describe which problem you were trying to solve by writing that code.

Oh, about that xD
Forget about it, I already wrote new code like 20 times already, I don't even remember what I was gonna do

Posted
1 minute ago, diesieben07 said:

iWKad22.jpg?fb

...likewise

Follow these rules when talking to me, and we'll get along fine.

1).I know Java fairly well. I don't know as much about modding. They are not the same, don't compare them.

2). I consider myself to always be learning. I make mistakes, you make mistakes. Who doesn't?

3). Insult me, and I will leave the thread. I have a real life, I don't have time to throw petty insults in a Minecraft Modding forum.

 

ModMCdl - Co-Founder and Director of Design for Artemis Game Studios

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.