Here is my log when I start up: Error Log
I have been trying to plug in multiple blocks with textures for Minecraft 1.8 forge version 11.14.3.1450.
The blocks get put into their creative tabs and get named correctly, but both the Item side and the Block Side of the Blocks are having problems. The JSON files don't even seem to be loading into the game.
I do all my block initialization in the preInit() function and I have this patch of code to register my files:
@SideOnly(Side.CLIENT)
public static void registerBlockRenderers(FMLInitializationEvent event) {
for(Map.Entry<String, PeriodicOre> e : allOres.entrySet()) {
String name = e.getKey();
PeriodicOre o = e.getValue();
Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
.register(net.minecraft.item.Item.getItemFromBlock(o), 0,
new ModelResourceLocation(PCM.MODID + ":model/" + name, "inventory"));
}
}
My file hierarchy is the attachment below. The blockstates, item and block models as well as the textures all have the same name to the corresponding block. Ex: oreLithium.json, oreLithium.json, oreLithium.json, oreLithium.png.
What's wrong?
Hey, you post a lot lately and seem to know generally what you are doing.
I just started modding about a week ago after spending two weeks learning some java. Pretty new to all of this but I catch on quick.
Modding with minecraft 1.7.10
I am currently making an Environment Mod to solidify the basics of all blocks, items, crops, worldGen, biomes, basically the bulk of it in one mod.
I started out with plank blocks which texture and initialize perfectly. Then I moved on to making the trees for those which included the log blocks, leaf blocks, saplings, world gen. blah blah you know.
Right now I am making the textures and popping them in for the logs and leaves. I finished two (for my "Holly Wood" and "Holly Leaves" ) but it seems my "Sequoia Wood" and "Sequoia Leaves" are also taking these textures. In my creative tab "Holly Wood" and "Holly Leaves" shows up perfect and places perfect like my planks but "Sequoia Wood" (still having the wrong texture anyways) turns the texture on its side showing the top of the wood texture on the side. This also concerns me because I imagine even if I figure out how to fix it not stealing another texture it will still turn its own to the side. I haven't put anymore textures in because I wanted to fix this before moving on but I just can't figure it out.
public static void registerBlocks() {
Block blockWoods = new LogsECO().setBlockName("blockWoods");
GameRegistry.registerBlock(blockWoods, ItemBlockWoods.class, blockWoods.getUnlocalizedName().substring(5));
}
public static final String[] woods = new String[] {"Chestnut", "Holly", "Mahogany", "Maple", "Olive", "Sequoia", "Walnut", "Willow"};
protected LogsECO() {
this.setCreativeTab(Core.tabEnvironment);
}
@SideOnly(Side.CLIENT)
public void getSubBlocks (Item item, CreativeTabs tabs, List list) {
for (int i = 0; i < woods.length; i++) {
list.add(new ItemStack(item, 1,i));
}
}
@SideOnly(Side.CLIENT)
public void registerBlockIcons (IIconRegister iconRegister) {
this.field_150167_a = new IIcon[woods.length];
this.field_150166_b = new IIcon[woods.length];
public int getMetadata(int meta) { return meta;
}
}
I just don't get what is going wrong with my equation for the string to make this happen. I assume that is what is making the problem but I could be wrong.
Hey, you post a lot lately and seem to know generally what you are doing.
I just started modding about a week ago after spending two weeks learning some java. Pretty new to all of this but I catch on quick.
Modding with minecraft 1.7.10
I am currently making an Environment Mod to solidify the basics of all blocks, items, crops, worldGen, biomes, basically the bulk of it in one mod.
I started out with plank blocks which texture and initialize perfectly. Then I moved on to making the trees for those which included the log blocks, leaf blocks, saplings, world gen. blah blah you know.
Right now I am making the textures and popping them in for the logs and leaves. I finished two (for my "Holly Wood" and "Holly Leaves" ) but it seems my "Sequoia Wood" and "Sequoia Leaves" are also taking these textures. In my creative tab "Holly Wood" and "Holly Leaves" shows up perfect and places perfect like my planks but "Sequoia Wood" (still having the wrong texture anyways) turns the texture on its side showing the top of the wood texture on the side. This also concerns me because I imagine even if I figure out how to fix it not stealing another texture it will still turn its own to the side. I haven't put anymore textures in because I wanted to fix this before moving on but I just can't figure it out.
public static void registerBlocks() {
Block blockWoods = new LogsECO().setBlockName("blockWoods");
GameRegistry.registerBlock(blockWoods, ItemBlockWoods.class, blockWoods.getUnlocalizedName().substring(5));
}
public static final String[] woods = new String[] {"Chestnut", "Holly", "Mahogany", "Maple", "Olive", "Sequoia", "Walnut", "Willow"};
protected LogsECO() {
this.setCreativeTab(Core.tabEnvironment);
}
@SideOnly(Side.CLIENT)
public void getSubBlocks (Item item, CreativeTabs tabs, List list) {
for (int i = 0; i < woods.length; i++) {
list.add(new ItemStack(item, 1,i));
}
}
@SideOnly(Side.CLIENT)
public void registerBlockIcons (IIconRegister iconRegister) {
this.field_150167_a = new IIcon[woods.length];
this.field_150166_b = new IIcon[woods.length];
public int getMetadata(int meta) { return meta;
}
}
I just don't get what is going wrong with my equation for the string to make this happen. I assume that is what is making the problem but I could be wrong.
Any help?
Alright.
If you want to ask questions to specific people, start a thread or pm. Don't ask in another thread about something else.
Textures are usually a problem with the name of the block. I use a handler class for all my normal blocks.
I'm not the person to ask this. I don't remember much of 1.7.10.
public static void registerBlockRenderers(FMLInitializationEvent event) {
for(Map.Entry<String, PeriodicOre> e : allOres.entrySet()) {
String name = e.getKey();
PeriodicOre o = e.getValue();
Minecraft.getMinecraft().getRenderItem().getItemModelMesher()
.register(net.minecraft.item.Item.getItemFromBlock(o), 0,
new ModelResourceLocation(PCM.MODID + ":model/" + name, "inventory"));
}
}
My file hierarchy is the attachment below. The blockstates, item and block models as well as the textures all have the same name to the corresponding block. Ex: oreLithium.json, oreLithium.json, oreLithium.json, oreLithium.png.
What's wrong?
I'm not crazy, i'm just not user friendly
--> Click here to get BETA ACCESS to this mod and upcoming server! <--
Here's all my code for the Blocks.
I register all my Blocks in a class called Blocks.java. The render code above is from this class.
I use a class called PeriodicOre, which is just a handler block class for every Ore, instead of having 12 seperate classes for each ore.
Then, my main class. My Blocks.init() is called in the preInit() method, and my renderBlockMesh() method is called in the Init method.
When i tried to make it so it is called with the FMLPreInitializationEvent, it gave me a null point exception.
I'm not crazy, i'm just not user friendly
--> Click here to get BETA ACCESS to this mod and upcoming server! <--
Hey, you post a lot lately and seem to know generally what you are doing.
I just started modding about a week ago after spending two weeks learning some java. Pretty new to all of this but I catch on quick.
Modding with minecraft 1.7.10
I am currently making an Environment Mod to solidify the basics of all blocks, items, crops, worldGen, biomes, basically the bulk of it in one mod.
I started out with plank blocks which texture and initialize perfectly. Then I moved on to making the trees for those which included the log blocks, leaf blocks, saplings, world gen. blah blah you know.
Right now I am making the textures and popping them in for the logs and leaves. I finished two (for my "Holly Wood" and "Holly Leaves" ) but it seems my "Sequoia Wood" and "Sequoia Leaves" are also taking these textures. In my creative tab "Holly Wood" and "Holly Leaves" shows up perfect and places perfect like my planks but "Sequoia Wood" (still having the wrong texture anyways) turns the texture on its side showing the top of the wood texture on the side. This also concerns me because I imagine even if I figure out how to fix it not stealing another texture it will still turn its own to the side. I haven't put anymore textures in because I wanted to fix this before moving on but I just can't figure it out.
This is my Logs Class:
package net.environment.mod.biome.features;
import java.util.List;
import net.environment.mod.Core;
import net.environment.mod.itemblocks.ItemBlockWoods;
import net.minecraft.block.Block;
import net.minecraft.block.BlockLog;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class LogsECO extends BlockLog {
public static Block blockWoods;
public static void init() {
registerBlocks();
}
public static void registerBlocks() {
Block blockWoods = new LogsECO().setBlockName("blockWoods");
GameRegistry.registerBlock(blockWoods, ItemBlockWoods.class, blockWoods.getUnlocalizedName().substring(5));
}
public static final String[] woods = new String[] {"Chestnut", "Holly", "Mahogany", "Maple", "Olive", "Sequoia", "Walnut", "Willow"};
protected LogsECO() {
this.setCreativeTab(Core.tabEnvironment);
}
@SideOnly(Side.CLIENT)
public void getSubBlocks (Item item, CreativeTabs tabs, List list) {
for (int i = 0; i < woods.length; i++) {
list.add(new ItemStack(item, 1,i));
}
}
@SideOnly(Side.CLIENT)
public void registerBlockIcons (IIconRegister iconRegister) {
this.field_150167_a = new IIcon[woods.length];
this.field_150166_b = new IIcon[woods.length];
for (int i = 0; i < this.field_150167_a.length; i++) {
this.field_150167_a = iconRegister.registerIcon(Core.modID + ":" + woods + "Wood");
this.field_150166_b = iconRegister.registerIcon(Core.modID + ":" + woods + "Wood" + "Top");
}
}
}
package net.environment.mod.itemblocks;
import net.minecraft.block.Block;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
public class ItemBlockWoods extends ItemBlock {
final static String[] woods = new String[] {"Chestnut", "Holly", "Mahogany", "Maple", "Olive", "Sequoia", "Walnut", "Willow"};
public ItemBlockWoods(Block block) {
super(block);
this.setHasSubtypes(true);
}
public String getUnlocalizedName(ItemStack itemstack) {
int i = itemstack.getItemDamage();
if (i < 0 || i >= woods.length) {
i = 0;
}
return super.getUnlocalizedName() + "." + woods + "Wood";
}
public int getMetadata(int meta) {
return meta;
}
}
I just don't get what is going wrong with my equation for the string to make this happen. I assume that is what is making the problem but I could be wrong.
Any help?
Alright.
If you want to ask questions to specific people, start a thread or pm. Don't ask in another thread about something else.
Textures are usually a problem with the name of the block. I use a handler class for all my normal blocks.
I'm not the person to ask this. I don't remember much of 1.7.10.
I'm not crazy, i'm just not user friendly
--> Click here to get BETA ACCESS to this mod and upcoming server! <--
Okay, sorry I am new to the modding forum as well :/
Thanks, didn't know 1.8 was very different.
FIXED!
The whole fundamentals of my code was flawed. I needed to include some client proxies and my jsons were glitching.
I updated to the latest version of forge and changed some code up. Works perfect now!
I'm not crazy, i'm just not user friendly
--> Click here to get BETA ACCESS to this mod and upcoming server! <--
WOW!! How did you work it out!
I have similar problem for binding block texture.
The register is here
https://github.com/ci010/Vending/blob/master/[1.8]Vending/src/main/java/info/jbcs/minecraft/vending/client/ClientProxy.java
The block have 16 metablock(0-15)
The blockstates
https://github.com/ci010/Vending/blob/master/[1.8]Vending/src/main/resources/assets/vending/blockstates/vendingMachine.json
and the model
https://github.com/ci010/Vending/blob/master/[1.8]Vending/src/main/resources/assets/vending/models/block/vendingMachine.json
My forge version is 1.8-11.14.3.1450
Any sugguestion? Or did I have any misunderstanding on these?
Thank a lot.
BTW, what's your final version looks like?
Maybe it will inspire me.