Everything posted by Draco18s
-
Custom armor textures for item
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.
-
Custom armor textures for item
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.
-
Custom armor textures for item
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.
-
Custom armor textures for item
I don't think you can do that.
-
Make item not wearable on offhand
Such as...? Post them.
-
[1.12] Chest with separate Inventories
It's....simulating the insert. If true, the item will not actually be inserted, but the return value will be the same as if it had. It's the "does this fit?" check.
-
[1.12] "Vanilla model can't have non-vanilla parent"
This is disgusting. Do this instead: new ModelResourceLocation(parBlock.getRegistryName(), "inventory")
-
[1.12] "Vanilla model can't have non-vanilla parent"
Block models are loaded automagically.
-
[1.12] "Vanilla model can't have non-vanilla parent"
I presume it's due to lines like these: https://github.com/IceMetalPunk/Placeables/blob/glowstone-placeable/src/main/resources/assets/placeables/models/block/block_glowstone_dust_side0.json#L2 But as to why that error or how to fix it? I have no idea.
-
Compatibility and missing API documentation
ITextComponent (or one of its subclasses, such as TextComponentString) are what you're looking for.
-
Forge [1.11.2] Gradlew build fails on compileJava
Bingo, there we go. Pretty sure you still need to specify that in your build.gradle file, because it's not inside src/main
-
onItemLeftClick?
Uh... This is where that comment goes. The event itself apparently exists in common code (net.minecraftforge.fml.common.gameevent.InputEvent.KeyInputEvent) but it's only FIRED on the client.
-
onItemLeftClick?
What are you front to accomplish? That is, what should happen from the user's perspective, nor how are you trying to code it?
-
[1.12] Copy NBT on crafting
For recipes, there's no reason to reimplement something complicated like reading an item stack, vanilla did that already. Custom achievements though...99% copy-paste for the whole class. You literally go in, modify what data it is that needs to be deserialized and checked against (if any!) and then just fix all the red that shows up until it is gone. You modify like 12 lines total.
-
onUpdate() get player methods
if (entityIn instanceof EntityPlayer)
-
[1.12] Copy NBT on crafting
Those helpers really aren't that hard to understand. Every recipe factory I've created I've done by going "here's a vanilla/forge recipe that's really close to what I want...COPY....PASTE!"
-
Food Item with changing hunger values
Are you using a packet to send the slider value from the GUI back to the server?
-
Centering Sounds to ViewEntity not the player
Nope, just in understanding the problem.
-
Loading a mod midgame
No, this would not be possible.
-
Forge [1.11.2] Gradlew build fails on compileJava
Are you using an API that is external?
-
Centering Sounds to ViewEntity not the player
Other way around. The sounds that are localized are being played at the volume that is local to the player not local to the camera.
-
Centering Sounds to ViewEntity not the player
He's not playing sounds, he's talking about every sound affect being picked up by the player not the remote camera perspective.
-
Problems with nether warts!
That's because the AGE property used by Nether Warts (and Beetroot) isn't the same property as BlockCrops. They are not the same object and you can't use each in place of the other.
-
[1.12] Copy NBT on crafting
You don't: No. Always post crash logs.
-
[1.12] Copy NBT on crafting
isDynamic? I don't see that method in IRecipe. What release # of Forge are you using? Nothing. Once you have an implementation and it's mentioned in your _factories.json your next step is to use it. That's it. You're done.
IPS spam blocked by CleanTalk.