Jump to content

Recommended Posts

Posted

I don't think you can do that.

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.

Posted
5 minutes ago, Draco18s said:

I don't think you can do that.

When I asked about quiver I've head same reply, some said I can do it only with custom bow, but I found a way, so.. Don't do such statements if you not sure

Posted

I didn't say "you can't do that" I said "I don't think you can."

As in, I do not know of a way to make the texture dependent on which slot it is in: that information is not available to the Item or ItemStack classes.

 

But sure, if you've accomplished it, good job. I'd be interested to know how.

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.

Posted
Just now, Draco18s said:

I didn't say "you can't do that" I said "I don't think you can."

As in, I do not know of a way to make the texture dependent on which slot it is in: that information is not available to the Item or ItemStack classes.

 

But sure, if you've accomplished it, good job. I'd be interested to know how.

I you really interested check github ItemQuiver and ItemQuiverWithArrows, code is not perfect, a lot of conditional spaghetti, but I have to check for a lot of stuff so..

Posted

The only thing I see you doing is changing from one item to another based on whether or not there are arrows (or not).

Your code for CHEST and LEGS are exactly the same except for a 1 or a 2 (the slot number) and could be replaced with a function call containing said slot number.

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.

Posted (edited)
18 minutes ago, Draco18s said:

The only thing I see you doing is changing from one item to another based on whether or not there are arrows (or not).

Your code for CHEST and LEGS are exactly the same except for a 1 or a 2 (the slot number) and could be replaced with a function call containing said slot number.

take a look at extends parts of both items

Also what's function to replace it better?

Edited by LavX64
Posted
7 minutes ago, LavX64 said:

take a look at extends parts of both items

Item vs. ItemArrow.

That has nothing to do with the texture.

7 minutes ago, LavX64 said:

Also what's function to replace it better?

private void checkEquipSlots(int slotIndex) {
	if (((EntityPlayer) entityIn).inventory.armorItemInSlot(slotIndex).getItem() instanceof ItemArrow) {
		ItemStack newStack = ((EntityPlayer) entityIn).inventory.armorItemInSlot(slotIndex);
		// Set it to normal Quiver if it has no tag, or arrow tag, or arrow <= 0
		if (newStack.hasTagCompound()) {
			NBTTagCompound nbt = newStack.getTagCompound();
			if (nbt.hasKey("Arrows")) {
				if (nbt.getInteger("Arrows") <= 0) {
					((EntityPlayer) entityIn).inventory.armorInventory.set(slotIndex, new ItemStack(ItemInit.QUIVER));
					return;
				}
			} else {
				((EntityPlayer) entityIn).inventory.armorInventory.set(slotIndex, new ItemStack(ItemInit.QUIVER));
				return;
			}
		} else {
			((EntityPlayer) entityIn).inventory.armorInventory.set(slotIndex, new ItemStack(ItemInit.QUIVER));
			return;
		}
	}
}

Then the chunk under // armor slot 2(chest) check gets replaced with checkEquipSlots(2) and // slot 1(legs) gets replaced with checkEquipSlots(1).

Now you have no duplicate code.

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.

Posted
2 minutes ago, Draco18s said:

Item vs. ItemArrow.

That has nothing to do with the texture.


private void checkEquipSlots(int slotIndex) {
	if (((EntityPlayer) entityIn).inventory.armorItemInSlot(slotIndex).getItem() instanceof ItemArrow) {
		ItemStack newStack = ((EntityPlayer) entityIn).inventory.armorItemInSlot(slotIndex);
		// Set it to normal Quiver if it has no tag, or arrow tag, or arrow <= 0
		if (newStack.hasTagCompound()) {
			NBTTagCompound nbt = newStack.getTagCompound();
			if (nbt.hasKey("Arrows")) {
				if (nbt.getInteger("Arrows") <= 0) {
					((EntityPlayer) entityIn).inventory.armorInventory.set(slotIndex, new ItemStack(ItemInit.QUIVER));
					return;
				}
			} else {
				((EntityPlayer) entityIn).inventory.armorInventory.set(slotIndex, new ItemStack(ItemInit.QUIVER));
				return;
			}
		} else {
			((EntityPlayer) entityIn).inventory.armorInventory.set(slotIndex, new ItemStack(ItemInit.QUIVER));
			return;
		}
	}
}

Then the chunk under // armor slot 2(chest) check gets replaced with checkEquipSlots(2) and // slot 1(legs) gets replaced with checkEquipSlots(1).

Now you have no duplicate code.

Yeah, i knew i had to do that, ty.

So u asked how I did my quiver, and told bow to use it, so that's how, my quiver with arrows is ItemArrow with function isInfinite, so bow calls this func everytime it shoots

Posted
1 hour ago, LavX64 said:

So how I add different textures when it's on chest or legs?

 

55 minutes ago, Draco18s said:

I don't think you can do that.

 

49 minutes ago, LavX64 said:

I found a way

 

3 minutes ago, LavX64 said:

So u asked how I did my quiver, and told bow to use it, so that's how

No, no I did not. This thread was about textures for the different slots, I said "I don't think I can do that" you said "I found a way." I asked how and you said "see, extends ItemArrow."

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.

Posted (edited)
54 minutes ago, LavX64 said:

When I asked about quiver I've head same reply, some said I can do it only with custom bow, but I found a way, so.. 

 

52 minutes ago, Draco18s said:

But sure, if you've accomplished it, good job. I'd be interested to know how.

So you meant textures right? Sorry

Edited by LavX64
Posted
18 minutes ago, LavX64 said:

So you meant textures right? Sorry

Yes, I had. If I misread something as well, I apologize.

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.