Posted January 25, 201510 yr heres my code package com.mcpixelplex.blocks; import com.mcpixelplex.CreativeTabs.BlessedCreativeTab; import com.mcpixelplex.lib.RefStrings; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.util.IIcon; public class machineBlock extends Block{ public machineBlock(Material p_i45394_1_) { super(p_i45394_1_); } @SideOnly(Side.CLIENT) public static IIcon topIcon; @SideOnly(Side.CLIENT) public static IIcon sideIcon; @SideOnly(Side.CLIENT) public static IIcon frontIcon; @SideOnly(Side.CLIENT) public void registerIIcons(IIconRegister icon) { topIcon = icon.registerIcon(RefStrings.MODID + ":machineBlockTop"); //top sideIcon = icon.registerIcon(RefStrings.MODID + ":machineBlockSide"); //side frontIcon = icon.registerIcon(RefStrings.MODID + ":machineBlockFront"); //front } public IIcon getIIcon(int side, int meta) { if(side == 0 || side == 1) { return topIcon; } else if(side == 2) { return frontIcon; } else { return sideIcon; } } }
January 25, 201510 yr This is why you use @Override If you had @Override on your getIIcon function you would know what the problem is. 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.
January 25, 201510 yr Also, the first letter of your class name should be capitalized. e.g. MachineBlock not machineBlock. Don't make mods if you don't know Java. Check out my website: http://shadowfacts.net Developer of many mods
January 25, 201510 yr Author This is why you use @Override If you had @Override on your getIIcon function you would know what the problem is. It tells me to remove the override function
January 25, 201510 yr should Or rather, it's common practice and considered good technique, but the compiler doesn't give a shit. 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.
January 25, 201510 yr Yeah, common practice to make it easier to tell wether something is a class, method, or field. Seriously, use it. This naming convention is used in pretty much every programming language that has classes. Don't make mods if you don't know Java. Check out my website: http://shadowfacts.net Developer of many mods
January 25, 201510 yr Author Not to be rude but ya getting a little bit off topic, the getIIcon tells me to remove @override
January 25, 201510 yr Yeah, common practice to make it easier to tell wether something is a class, method, or field. Package, class, constant, methods. Yep. (packages are all lower case. Classes are camel case with a capitalized first letter, constants are ALL CAPS, methods, fields, and other variables are camel case with lower case first letter). Not to be rude but ya getting a little bit off topic, the getIIcon tells me to remove @override Because your method signature is wrong. It's not overriding any function in the super class. Look closely. 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.
January 25, 201510 yr Author Yeah, common practice to make it easier to tell wether something is a class, method, or field. Package, class, constant, methods. Yep. (packages are all lower case. Classes are camel case with a capitalized first letter, constants are ALL CAPS, methods, fields, and other variables are camel case with lower case first letter). Not to be rude but ya getting a little bit off topic, the getIIcon tells me to remove @override Because your method signature is wrong. It's not overriding any function in the super class. Look closely. What can I do to fix it
January 25, 201510 yr Look at the method in the Block class. Then look at yours. What is different? Don't make mods if you don't know Java. Check out my website: http://shadowfacts.net Developer of many mods
January 25, 201510 yr *facepalms* getIcon not getIIcon and registerIcons not registerIIcons. Don't make mods if you don't know Java. Check out my website: http://shadowfacts.net Developer of many mods
January 25, 201510 yr getIcon != getIIcon 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.
January 25, 201510 yr Author *facepalms* getIcon not getIIcon and registerIcons not registerIIcons. Ive tried that
January 25, 201510 yr Author This is what I got so far package com.mcpixelplex.blocks; import com.mcpixelplex.CreativeTabs.BlessedCreativeTab; import com.mcpixelplex.lib.RefStrings; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; public class MachineBlock extends Block{ public MachineBlock(int id) { super(Material.iron); setBlockName("machineBlock"); setCreativeTab(BlessedCreativeTab.tabBlocks); setHardness(5F); setResistance(10F); } //public TileEntity createNewTileEntity(World world) { // return null; //} @SideOnly(Side.CLIENT) public static IIcon topIcon; @SideOnly(Side.CLIENT) public static IIcon sideIcon; @SideOnly(Side.CLIENT) public static IIcon frontIcon; @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister icon) { topIcon = icon.registerIcon(RefStrings.MODID + ":machineBlockTop"); //top sideIcon = icon.registerIcon(RefStrings.MODID + ":machineBlockSide"); //side frontIcon = icon.registerIcon(RefStrings.MODID + ":machineBlockFront"); //front } @Override public IIcon getIcon(int side, int meta) { if(side == 0 || side == 1) { return topIcon; } else if(side == 2) { return frontIcon; } else { return sideIcon; } } }
January 25, 201510 yr Author Well I ended up rewriting the entire block and it seems to be working but I would like to know how to make it rotate depending on the players location
January 25, 201510 yr Make a new topic. Don't make mods if you don't know Java. Check out my website: http://shadowfacts.net Developer of many mods
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.