-
Item textures for subitems not showing
What do you expect to get passed to ModelResourceLocation if id is solar:rune ? I think I get it now, I am just confused as to why its working with my blocks and not with my rune item. BaseBlocks: BlockRegistry:
-
Item textures for subitems not showing
Thats before the : and the id = solar.rune for some reason. I think I really screwed up. As you see it works totally fine with the blocks I have, and with the item without the sub items it also worked. But with the itemrune it seems to add another "solar:" https://gyazo.com/73f1fed1d58d2ecc1d834b9c57156e79
-
Item textures for subitems not showing
I really can't figure out where I am doing it. This are the lines involved: In the item (extends Item), this is in the constructor: setRegistryName("itemrune"); registry: public static ItemRune itemRune; public static void init() { itemRune = register(new ItemRune()); } private static <T extends Item> T register(T item) { GameRegistry.register(item); if (item instanceof ItemBase) { ((ItemBase)item).registerItemModel(); } else{ Solar.proxy.registerItemRenderer(item, 0, item.getRegistryName().toString()); } return item; } registerItemRenderer: @Override public void registerItemRenderer(Item item, int meta, String id) { ModelLoader.setCustomModelResourceLocation(item, meta, new ModelResourceLocation(Solar.MODID + ":" + id, "inventory")); }
-
Item textures for subitems not showing
Errors you say? Post 'em With getRegistryName().toString():
-
Item textures for subitems not showing
I hope im supposed to use getResourcePath() after that? Because .toString generates errors. Im not getting an error but my item has a blank texture. And my second item has the broken texture. (black pink)
-
Item textures for subitems not showing
This is my Item class: The json i have for the item called "ItemRune.json": { "forge_marker": 1, "defaults": { "model": "builtin/generated", "transform": "forge:default-item" }, "variants": { "type": { "runedefault": { "textures": { "layer0": "solar:items/runeDefault" } }, "runeFire": { "textures": { "layer0": "solar:items/runeDefault" } } } } } How I register the item: package com.mart.solar.registry; import com.mart.solar.Solar; import com.mart.solar.items.ItemBase; import com.mart.solar.items.ItemRune; import net.minecraft.item.Item; import net.minecraftforge.fml.common.registry.GameRegistry; public class ModItems { public static ItemRune itemRune; public static void init() { itemRune = register(new ItemRune()); } private static <T extends Item> T register(T item) { GameRegistry.register(item); if (item instanceof ItemBase) { ((ItemBase)item).registerItemModel(); } else{ Solar.proxy.registerItemRenderer(item, 0, item.getRegistryName().getResourcePath()); } return item; } } And These are the errors I get:
-
[SOLVED]TileRender not rendering item. Returning null on value retrieving.
Ive been trying but I have no idea how it works. Are there some examples maybe?
-
[SOLVED]TileRender not rendering item. Returning null on value retrieving.
So I have a render class for my tileentity that is supposed to render the item put in the tileEntity. The item is there but the function to retrieve the item doesnt seem to work right. Heres my TileEntity Class: My render class: Block class: Blockstate: The item is set because I can also retrieve it, but it returns null to the Render class.. any idea on whats causing this?
-
addItemStackToInventory stops working after calling it 1 time.
Thanks, problem found!
-
addItemStackToInventory stops working after calling it 1 time.
This is the class that this topic is about: So this is how it goes. I add an rune. It gets placed in the rune variable. I add a modifier like a diamond and it will get placed in the modifier variable. This all works with rightclicking Then it looks for the recipe having the modifier and it finds it. It sets the rune value to null and the modifier to the item. I rightclick again and extract the item via the extractItem function and get the output. Then when I do this all over again it does not seem to work. The item doesnt get added to my inventory anymore. It gives all the right information with the println's but just doesnt add the itemstack to the inventory. Does anybody know a fix?
-
[SOLVED]Adding item to inventory makes existing stack size 0
1) What is rune 2) What the hell are you doing here? Oh sorry, rune is an ItemStack and I removed the last rune.writeToNBT. That was a mistake I left in. If you were wondering if that was the cause its not but that would have been clear
-
[SOLVED]Adding item to inventory makes existing stack size 0
When I get the ItemStack from the nbt tag it returns an ItemStack with the stacksize of 0. This is the code: is anything wrong with it? I may be blind but it looks fine to me. @Override public NBTTagCompound writeToNBT(NBTTagCompound compound) { super.writeToNBT(compound); NBTTagList tagList = new NBTTagList(); NBTTagCompound itemCompound = new NBTTagCompound(); rune.writeToNBT(itemCompound); tagList.appendTag(itemCompound); compound.setTag("rune", tagList); return compound; } @Override public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); NBTTagList tagList = (NBTTagList) compound.getTag("rune"); NBTTagCompound tagCompound = tagList.getCompoundTagAt(0); rune = ItemStack.loadItemStackFromNBT(tagCompound); } Adding the itemstack to the inventory: player.inventory.addItemStackToInventory(rune); What is weird is, if I ask for the itemstack size it displays the right size. But adding it to the inventory makes the itemstack go 0. Only if I do not have the item in my inventory it seems to give the the right item.
-
[Solved]Update the sky
WorldSavedData Thanks! And I did it with sending packets all going smooth now
-
[Solved]Update the sky
Thanks, will do! And yes I just thought about it too. I need to find a way of doing it on the world specified. I do
-
[Solved]Update the sky
There
IPS spam blocked by CleanTalk.