Have you tried searching? I've explained this in several threads both here and on the Minecraft Forge forums.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
After registering the Block, you need to create an ItemBlock for it, set the item's registry name to the block's registry name and then register the item.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I also heard to use something else instead of item.getUnlocalizedName().substring(5)
Yes, use registry names. You can set the unlocalised name to the full registry name if you want (and the item doesn't have completely separate unlocalised/registry names like Records), but don't set registry names from unlocalised names.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Do not set registry names from unlocalised names. Registry names are IDs, they must not change. Unlocalised names can change at any time. The registry name methods were introduced in 1.8.9 to stop people doing this.
Item.getItemFromBlock returns nothing until an ItemBlock has actually been registered for the Block. You can't use it when registering the ItemBlock, since you haven't created or registered it yet. You need to instantiate the ItemBlock, set its registry name (item.setRegistryName(block.getRegistryName())) and then register it.
Don't use unlocalised names for models. The default model loaded for every Item is the one with its registry name, don't assume that unlocalised names match registry names.
Don't use ItemModelMesher#register, use ModelLoader.setCustomModelResourceLocation/setCustomMeshDefinition in preInit.
Why are you using a linked list? It doesn't seem like the most suitable data structure in this case, especially since every index operation (i.e. List#get call) requires it to iterate through the list to find the value at that index. Using a for-each loop instead of a traditional for loop with manual indexing would at least only iterate through the list once.
Since order doesn't matter and the values should be unique, I'd recommend using a Set rather than a List.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
There is no zero-argument constructor of ItemBlock, you need to pass the Block as an argument. Aside from this, that is what you need to do.
diamond_sword is the registry name of the Diamond Sword Item, yes. Your registry names don't have to be in the same format, they just have to be unique within your mod.
Some blocks will require their item form to be an instance of a subclass of ItemBlock, so you may want to create a registration method that allows for this. I handle this in my mod by taking a Function<Block, ItemBlock> argument that creates the ItemBlock instance from the Block. I then have a single-argument overload of this method that passes a reference to the ItemBlock constructor as the Function.
You can see my implementation here. This uses Java 8's functional interfaces, method references and lambdas. If you're targeting Java 6/7, you'd use Guava's functional interfaces instead of Java's and anonymous classes instead of method references and lambdas.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Ok got everything done, nothing renders now (in the inventory)
The FML log should tell you what went wrong with the model loading process.
If you don't know what to make of it, upload the FML log to Gist and update your code on GitHub.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
ModelLoader.setCustomModelResourceLocation and RenderingRegistry#registerEntityRenderingHandler(Class<T>, IRenderFactory<? super T>) must be called in preInit, not init like you are now.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
the latest version of 1.9 seems to deprecate the registerItems with a new register method but i have no idea how to use it
My mods
#StopModReposts
Have you tried searching? I've explained this in several threads both here and on the Minecraft Forge forums.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Still don't really get the ItemBlock part.
My mods
#StopModReposts
After registering the Block, you need to create an ItemBlock for it, set the item's registry name to the block's registry name and then register the item.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I also heard to use something else instead of item.getUnlocalizedName().substring(5)
My mods
#StopModReposts
Yes, use registry names. You can set the unlocalised name to the full registry name if you want (and the item doesn't have completely separate unlocalised/registry names like Records), but don't set registry names from unlocalised names.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
It crashed I probably did something very wrong: crash report, github(code)
so what to use as registry names
My mods
#StopModReposts
Do not set registry names from unlocalised names. Registry names are IDs, they must not change. Unlocalised names can change at any time. The registry name methods were introduced in 1.8.9 to stop people doing this.
Item.getItemFromBlock returns nothing until an ItemBlock has actually been registered for the Block. You can't use it when registering the ItemBlock, since you haven't created or registered it yet. You need to instantiate the ItemBlock, set its registry name (item.setRegistryName(block.getRegistryName())) and then register it.
Don't use unlocalised names for models. The default model loaded for every Item is the one with its registry name, don't assume that unlocalised names match registry names.
Don't use ItemModelMesher#register, use ModelLoader.setCustomModelResourceLocation/setCustomMeshDefinition in preInit.
Why are you using a linked list? It doesn't seem like the most suitable data structure in this case, especially since every index operation (i.e. List#get call) requires it to iterate through the list to find the value at that index. Using a for-each loop instead of a traditional for loop with manual indexing would at least only iterate through the list once.
Since order doesn't matter and the values should be unique, I'd recommend using a Set rather than a List.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Just use
Right?
and the registry name is basically like diamond_sword?
My mods
#StopModReposts
There is no zero-argument constructor of ItemBlock, you need to pass the Block as an argument. Aside from this, that is what you need to do.
diamond_sword is the registry name of the Diamond Sword Item, yes. Your registry names don't have to be in the same format, they just have to be unique within your mod.
Some blocks will require their item form to be an instance of a subclass of ItemBlock, so you may want to create a registration method that allows for this. I handle this in my mod by taking a Function<Block, ItemBlock> argument that creates the ItemBlock instance from the Block. I then have a single-argument overload of this method that passes a reference to the ItemBlock constructor as the Function.
You can see my implementation here. This uses Java 8's functional interfaces, method references and lambdas. If you're targeting Java 6/7, you'd use Guava's functional interfaces instead of Java's and anonymous classes instead of method references and lambdas.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
That's the old registry system
My mods
#StopModReposts
this for loop?
My mods
#StopModReposts
Crash Report
Git Hub Is Above
My mods
#StopModReposts
https://gist.github.com/TehNut/bd8b7ab8dd0011be5f5604787a6c723c
Ok got everything done, nothing renders now (in the inventory)
My mods
#StopModReposts
The FML log should tell you what went wrong with the model loading process.
If you don't know what to make of it, upload the FML log to Gist and update your code on GitHub.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
No Errors, but no rendering. Block models are good, Item models don't render.
My mods
#StopModReposts
ModelLoader.setCustomModelResourceLocation and RenderingRegistry#registerEntityRenderingHandler(Class<T>, IRenderFactory<? super T>) must be called in preInit, not init like you are now.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Also, onUsingTick doesn't seem to work, what to do?
My mods
#StopModReposts
As far as I can see, you never call EntityLivingBase#setActiveHand, so the item is never set in use and Item#onUsingTick is never called.
You can no longer block with swords in 1.9, so ItemSword never calls this.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.