[1.6.2] [Forge] Sheenrox82's Forge 1.6.2 Texturing Tutorial - Blocks and Items.

  • #81
    Quote from hellow27

    When I tried to do this it simply didn't load my textures, tried renaming, moving, and copying everything into every sensible directory I could find, but nothing seems to work.
    Here's my console output...
    Jul 11, 2013 3:50:08 PM net.minecraft.launchwrapper.LogWrapper log
    INFO: Using tweak class name cpw.mods.fml.common.launcher.FMLTweaker
    2013-07-11 15:50:08 [INFO] [ForgeModLoader] Forge Mod Loader version 6.2.19.789 for Minecraft 1.6.2 loading
    2013-07-11 15:50:08 [INFO] [ForgeModLoader] Java is Java HotSpotâ„¢ 64-Bit Server VM, version 1.7.0_25, running on Windows 7:amd64:6.1, installed at C:\Program Files\Java\jre7
    2013-07-11 15:50:08 [INFO] [ForgeModLoader] Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation
    2013-07-11 15:50:08 [INFO] [STDOUT] Loaded 39 rules from AccessTransformer config file fml_at.cfg
    2013-07-11 15:50:08 [INFO] [STDOUT] Loaded 107 rules from AccessTransformer config file forge_at.cfg
    2013-07-11 15:50:09 [SEVERE] [ForgeModLoader] The binary patch set is missing. Things are probably about to go very wrong.
    2013-07-11 15:50:09 [INFO] [ForgeModLoader] Launching wrapped minecraft
    2013-07-11 15:50:10 [INFO] [Minecraft-Client] Setting user: Player423
    2013-07-11 15:50:10 [INFO] [Minecraft-Client] (Session ID is null)
    2013-07-11 15:50:10 [INFO] [Minecraft-Client] LWJGL Version: 2.9.0
    2013-07-11 15:50:11 [INFO] [Minecraft-Client] Reloading ResourceManager: Default
    2013-07-11 15:50:11 [INFO] [STDOUT]
    2013-07-11 15:50:11 [INFO] [STDOUT] Starting up SoundSystem...
    2013-07-11 15:50:11 [INFO] [MinecraftForge] Attempting early MinecraftForge initialization
    2013-07-11 15:50:11 [INFO] [STDOUT] MinecraftForge v9.10.0.789 Initialized
    2013-07-11 15:50:11 [INFO] [ForgeModLoader] MinecraftForge v9.10.0.789 Initialized
    2013-07-11 15:50:11 [INFO] [STDOUT] Replaced 101 ore recipies
    2013-07-11 15:50:11 [INFO] [MinecraftForge] Completed early MinecraftForge initialization
    2013-07-11 15:50:11 [INFO] [ForgeModLoader] Reading custom logging properties from C:\Users\Sam\Desktop\Metroid Mod\forge\mcp\jars\config\logging.properties
    2013-07-11 15:50:11 [OFF] [ForgeModLoader] Logging level for ForgeModLoader logging is set to ALL
    2013-07-11 15:50:11 [INFO] [STDOUT] Initializing LWJGL OpenAL
    2013-07-11 15:50:11 [INFO] [STDOUT] (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org)
    2013-07-11 15:50:12 [INFO] [STDOUT] OpenAL initialized.
    2013-07-11 15:50:12 [INFO] [ForgeModLoader] Searching C:\Users\Sam\Desktop\Metroid Mod\forge\mcp\jars\mods for mods
    2013-07-11 15:50:12 [INFO] [STDOUT]
    2013-07-11 15:50:13 [INFO] [ForgeModLoader] Forge Mod Loader has identified 4 mods to load
    2013-07-11 15:50:13 [INFO] [mcp] Activating mod mcp
    2013-07-11 15:50:13 [INFO] [FML] Activating mod FML
    2013-07-11 15:50:13 [INFO] [Forge] Activating mod Forge
    2013-07-11 15:50:13 [INFO] [Chimera27Metroid] Activating mod Chimera27Metroid
    2013-07-11 15:50:13 [INFO] [ForgeModLoader] Registering Forge Packet Handler
    2013-07-11 15:50:13 [INFO] [ForgeModLoader] Succeeded registering Forge Packet Handler
    2013-07-11 15:50:13 [INFO] [ForgeModLoader] Configured a dormant chunk cache size of 0
    2013-07-11 15:50:14 [SEVERE] [Minecraft-Client] Using missing texture, unable to load: minecraft:textures/items/MISSING_ICON_ITEM_5256_powerBeam.png
    2013-07-11 15:50:14 [INFO] [ForgeModLoader] Forge Mod Loader has successfully loaded 4 mods
    2013-07-11 15:50:14 [WARNING] [Metroid Cubed] Mod Metroid Cubed is missing a pack.mcmeta file, things may not work well
    2013-07-11 15:50:14 [INFO] [Minecraft-Client] Reloading ResourceManager: Default, FMLFileResourcePack:Metroid Cubed
    2013-07-11 15:50:14 [SEVERE] [Minecraft-Client] Using missing texture, unable to load: minecraft:textures/items/MISSING_ICON_ITEM_5256_powerBeam.png
    2013-07-11 15:50:14 [INFO] [STDOUT]
    2013-07-11 15:50:14 [INFO] [STDOUT] SoundSystem shutting down...
    2013-07-11 15:50:14 [INFO] [STDOUT] Author: Paul Lamb, www.paulscode.com
    2013-07-11 15:50:14 [INFO] [STDOUT]
    2013-07-11 15:50:14 [INFO] [STDOUT]
    2013-07-11 15:50:14 [INFO] [STDOUT] Starting up SoundSystem...
    2013-07-11 15:50:14 [INFO] [STDOUT] Initializing LWJGL OpenAL
    2013-07-11 15:50:14 [INFO] [STDOUT] (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org)
    2013-07-11 15:50:15 [INFO] [STDOUT] OpenAL initialized.
    2013-07-11 15:50:15 [INFO] [STDOUT]
    2013-07-11 15:50:25 [INFO] [Minecraft-Server] Starting integrated minecraft server version 1.6.2
    2013-07-11 15:50:25 [INFO] [Minecraft-Server] Generating keypair
    2013-07-11 15:50:25 [INFO] [ForgeModLoader] Loading dimension 0 (Debug) (net.minecraft.server.integrated.IntegratedServer@4216c97f)
    2013-07-11 15:50:25 [INFO] [ForgeModLoader] Loading dimension 1 (Debug) (net.minecraft.server.integrated.IntegratedServer@4216c97f)
    2013-07-11 15:50:25 [INFO] [ForgeModLoader] Loading dimension -1 (Debug) (net.minecraft.server.integrated.IntegratedServer@4216c97f)
    2013-07-11 15:50:25 [INFO] [Minecraft-Server] Preparing start region for level 0
    2013-07-11 15:50:26 [INFO] [STDOUT] loading single player
    2013-07-11 15:50:26 [INFO] [Minecraft-Server] Player423[/127.0.0.1:0] logged in with entity id 736 at (-367.6481820053433, 4.0, -473.8519479777546)
    2013-07-11 15:50:26 [INFO] [Minecraft-Server] Player423 joined the game
    2013-07-11 15:50:27 [INFO] [STDOUT] Setting up custom skins
    2013-07-11 15:50:32 [INFO] [Minecraft-Server] Saving and pausing game...
    2013-07-11 15:50:32 [INFO] [Minecraft-Server] Saving chunks for level 'Debug'/Overworld
    2013-07-11 15:50:32 [INFO] [Minecraft-Server] Saving chunks for level 'Debug'/Nether
    2013-07-11 15:50:32 [INFO] [Minecraft-Server] Saving chunks for level 'Debug'/The End
    2013-07-11 15:50:33 [INFO] [Minecraft-Server] Stopping server
    2013-07-11 15:50:33 [INFO] [Minecraft-Server] Saving players
    2013-07-11 15:50:33 [INFO] [Minecraft-Server] Player423 left the game
    2013-07-11 15:50:33 [INFO] [Minecraft-Server] Saving worlds
    2013-07-11 15:50:33 [INFO] [Minecraft-Server] Saving chunks for level 'Debug'/Overworld
    2013-07-11 15:50:33 [INFO] [Minecraft-Server] Saving chunks for level 'Debug'/Nether
    2013-07-11 15:50:33 [INFO] [Minecraft-Server] Saving chunks for level 'Debug'/The End
    2013-07-11 15:50:33 [INFO] [ForgeModLoader] Unloading dimension 0
    2013-07-11 15:50:33 [INFO] [ForgeModLoader] Unloading dimension -1
    2013-07-11 15:50:33 [INFO] [ForgeModLoader] Unloading dimension 1
    2013-07-11 15:51:29 [INFO] [Minecraft-Client] Stopping!
    2013-07-11 15:51:29 [INFO] [STDOUT]
    2013-07-11 15:51:29 [INFO] [STDOUT] SoundSystem shutting down...
    2013-07-11 15:51:29 [INFO] [STDOUT] Author: Paul Lamb, www.paulscode.com
    2013-07-11 15:51:29 [INFO] [STDOUT]

    Only relevant thing seems to be:
    2013-07-11 15:50:14 [SEVERE] [Minecraft-Client] Using missing texture, unable to load: minecraft:textures/items/MISSING_ICON_ITEM_5256_powerBeam.png
    (I tried renaming the texture to MISSING_ICON_ITEM_5256_powerBeam.png aswell, no dice.)

    I don't think I did anything wrong with the code either...


    public void updateIcons(IconRegister iconRegister)
    {
    this.itemIcon = iconRegister.registerIcon("Chimera27Metroid:Power Beam.png");
    }

    And the main file


    @Mod(modid = "Chimera27Metroid", name = "Metroid Cubed", version = "1.0.0")
    @NetworkMod(clientSideRequired = true, serverSideRequired = false)
    public class Main {

    @Instance("Chimera27Metroid")
    public static Main instance;

    private final static Item powerBeam = new PowerBeam(5000);

    @SidedProxy(clientSide = "project.main.client.ClientProxy", serverSide = "project.main.CommonProxy")
    public static CommonProxy proxy;

    @EventHandler
    public void preInit(FMLPreInitializationEvent event) {
    }

    @EventHandler
    public void load(FMLInitializationEvent event) {
    proxy.registerRenderers();
    LanguageRegistry.addName(powerBeam, "Power Beam");
    }

    @EventHandler
    public void postInit(FMLPostInitializationEvent event) {
    }
    }

    I really have no idea what's going on, I have been trying to figure this out for over 2 hours now, but everywhere I look says a different thing in an similarly vague way. Any help is GREATLY appreciated!


    Minecraft only uses png files so this does not need to be specified, also updateIcons should be registerIcons as well try to keep spaces out of the mix.

    public void registerIcons(IconRegister iconRegister)
    {
    this.itemIcon = iconRegister.registerIcon("Chimera27Metroid:PowerBeam");
    }


    also for your main code try this...
    @Mod(modid = "Chimera27Metroid", name = "Metroid Cubed", version = "1.0.0")
    @NetworkMod(clientSideRequired = true, serverSideRequired = false)
    public class Main {
    @Instance("Chimera27Metroid")
    public static Main instance;
    @SidedProxy(clientSide = "project.main.client.ClientProxy", serverSide = "project.main.CommonProxy")
    public static CommonProxy proxy;
    @EventHandler
    public void preInit(FMLPreInitializationEvent event) {
    private final static Item powerBeam = new PowerBeam(5000).setUnlocalizedName("Chimera27Metroid:PowerBeam");
    }
    @EventHandler
    public void load(FMLInitializationEvent event) {
    proxy.registerRenderers();
    LanguageRegistry.addName(powerBeam, "Power Beam");
    }
    @EventHandler
    public void postInit(FMLPostInitializationEvent event) {
    }
    }


    and if that doesn't work try changing @EventHandler on the PreInit function @PreInit
  • #82
    Thanks so much!!!! This fixed most of it, seems that items now need to be all lowercase too since 1.6.2, but at least it works!!!
    Creator of Metroid Cubed! Power Suits, Beams, Hypermode and more!

    Supporter of Cubic Chunks!
  • #83
    Quote from hellow27

    Thanks so much!!!! This fixed most of it, seems that items now need to be all lowercase too since 1.6.2, but at least it works!!!


    Great to Hear!
  • #84
    I mentioned this elsewhere, but if your textures are showing up in game, then there aren't any errors. Look closely at your log, after the missing texture errors you will probably see this:

    [INFO] [Minecraft-Client] Reloading ResourceManager: Default, FMLFileResourcePack:Your Mod Name

    If you put a
    System.out.println("[YOURMODNAME] loading texture " + this.getUnlocalizedName().substring(5)); 
    where you register your icons, you will see they get loaded after the above statement with no following error logs.

    I don't know why they try to load earlier and fail, but they load the second time.
  • #85
    It works, Thanks a lot!
  • #86
    Quote from coolAlias

    I mentioned this elsewhere, but if your textures are showing up in game, then there aren't any errors. Look closely at your log, after the missing texture errors you will probably see this:

    [INFO] [Minecraft-Client] Reloading ResourceManager: Default, FMLFileResourcePack:Your Mod Name

    If you put a
    System.out.println("[YOURMODNAME] loading texture " + this.getUnlocalizedName().substring(5)); 
    where you register your icons, you will see they get loaded after the above statement with no following error logs.

    I don't know why they try to load earlier and fail, but they load the second time.


    Yea, Im looking into that, seems weird.
  • #87
    I am encountering a very interesting issue that I've never seen before:

    The Sword that I have added doesn't seem to be working at all, even though it is in the game and looking just fine.
    Here is a short video where I demonstrate the problem:


    If you watch this, you'll see two problems:
    1. Both my Item and My Sword are called "My Awesome Sword"
    2. My Sword has a strange glitch where it cannot break any blocks, even in creative mode.
    Below is the code for my main MyModName class:

    public class MyNameMod {
    
    @SidedProxy(clientSide = MyNameModInfo.PROXY_LOCATION + ".ClientProxy", serverSide = MyNameModInfo.PROXY_LOCATION + ".CommonProxy")
    public static CommonProxy proxy;
    
    
    // DECLARE YOUR ITEMS HERE
    public static Item MyNameItem_1;
    public static Item MyNameSword_1;
    
    // DECLARE YOUR BLOCKS HERE
    public static Block MyNameBlock_1;
    
    // DECLARE YOUR MATERIALS HERE
    public static EnumToolMaterial MyNameToolMaterial = EnumHelper.addToolMaterial("Awesomeness", 2, 500, 6.0F, 6, 15);
    //
    
    @PreInit
    public void preInit( FMLPreInitializationEvent event )
    {
    MyNameItem_1 = new MyNameItem(2020);
    GameRegistry.registerItem(MyNameItem_1, "MyNameItem_1");
    LanguageRegistry.addName(MyNameItem_1, "My Awesome Item");
    
    MyNameSword_1 = new MyNameSword(2021, EnumToolMaterial.IRON);
    GameRegistry.registerItem(MyNameSword_1, "MyNameSword_1");
    LanguageRegistry.addName(MyNameSword_1, "My Awesome Sword");
    
    MyNameBlock_1 = new MyNameBlock(2022, "MyNameBlock_1").setHardness(2.0F).setStepSound(Block.soundMetalFootstep).setResistance(10.0F).setUnlocalizedName("MyNameMod:MyNameBlock_1");
    GameRegistry.registerBlock(MyNameBlock_1, "MyNameBlock_");
    LanguageRegistry.addName(MyNameBlock_1, "My Awesome Block");
    
    }



    Here is the code for my MyNameSword class:
    public class MyNameSword extends ItemSword {
    
    public MyNameSword(int ItemID, EnumToolMaterial material)
    {
    super(ItemID, material);
    }
    @Override
    @SideOnly(Side.CLIENT)
    public void registerIcons(IconRegister iconRegister)
    {
    this.itemIcon = iconRegister.registerIcon("MyNameMod:MyNameSword_1");
    }
    
    }


    And here's the code for my MyNameItem class:

    public class MyNameItem extends Item
    {
    
    public MyNameItem(int par1)
    {
    super(par1); //Returns super constructor: par1 is ID
    setCreativeTab(CreativeTabs.tabMaterials); // Tells the game what creative mode tab it goes in
    }
    
    @Override
    @SideOnly(Side.CLIENT)
    public void registerIcons(IconRegister iconRegister)
    {
    this.itemIcon = iconRegister.registerIcon("MyNameMod:MyNameItem_1");
    }
    
    }


    Does anyone have any idea what could be happening here?

    Thanks so much in advance,
    Last edited by ydsaaron: 7/14/2013 2:01:47 PM
  • #88
    Quote from ydsaaron

    I am encountering a very interesting issue that I've never seen before:

    The Sword that I have added doesn't seem to be working at all, even though it is in the game and looking just fine.
    Here is a short video where I demonstrate the problem:


    If you watch this, you'll see two problems:
    1. Both my Item and My Sword are called "My Awesome Sword"
    2. My Sword has a strange glitch where it cannot break any blocks, even in creative mode.
    Below is the code for my main MyModName class:

    public class MyNameMod {
    
    @SidedProxy(clientSide = MyNameModInfo.PROXY_LOCATION + ".ClientProxy", serverSide = MyNameModInfo.PROXY_LOCATION + ".CommonProxy")
    public static CommonProxy proxy;
    
    
    // DECLARE YOUR ITEMS HERE
    public static Item MyNameItem_1;
    public static Item MyNameSword_1;
    
    // DECLARE YOUR BLOCKS HERE
    public static Block MyNameBlock_1;
    
    // DECLARE YOUR MATERIALS HERE
    public static EnumToolMaterial MyNameToolMaterial = EnumHelper.addToolMaterial("Awesomeness", 2, 500, 6.0F, 6, 15);
    //
    
    @PreInit
    public void preInit( FMLPreInitializationEvent event )
    {
    MyNameItem_1 = new MyNameItem(2020);
    GameRegistry.registerItem(MyNameItem_1, "MyNameItem_1");
    LanguageRegistry.addName(MyNameItem_1, "My Awesome Item");
    
    MyNameSword_1 = new MyNameSword(2021, EnumToolMaterial.IRON);
    GameRegistry.registerItem(MyNameSword_1, "MyNameSword_1");
    LanguageRegistry.addName(MyNameSword_1, "My Awesome Sword");
    
    MyNameBlock_1 = new MyNameBlock(2022, "MyNameBlock_1").setHardness(2.0F).setStepSound(Block.soundMetalFootstep).setResistance(10.0F).setUnlocalizedName("MyNameMod:MyNameBlock_1");
    GameRegistry.registerBlock(MyNameBlock_1, "MyNameBlock_");
    LanguageRegistry.addName(MyNameBlock_1, "My Awesome Block");
    
    }



    Here is the code for my MyNameSword class:
    public class MyNameSword extends ItemSword {
    
    public MyNameSword(int ItemID, EnumToolMaterial material)
    {
    super(ItemID, material);
    }
    @Override
    @SideOnly(Side.CLIENT)
    public void registerIcons(IconRegister iconRegister)
    {
    this.itemIcon = iconRegister.registerIcon("MyNameMod:MyNameSword_1");
    }
    
    }


    And here's the code for my MyNameItem class:

    public class MyNameItem extends Item
    {
    
    public MyNameItem(int par1)
    {
    super(par1); //Returns super constructor: par1 is ID
    setCreativeTab(CreativeTabs.tabMaterials); // Tells the game what creative mode tab it goes in
    }
    
    @Override
    @SideOnly(Side.CLIENT)
    public void registerIcons(IconRegister iconRegister)
    {
    this.itemIcon = iconRegister.registerIcon("MyNameMod:MyNameItem_1");
    }
    
    }


    Does anyone have any idea what could be happening here?

    Thanks so much in advance,


    Its a new thing in 1.6

    Sword can't destroy blocks on creative mode. Your code is fine
  • #89
    Quote from sheenrox82

    Oops! My bad, forgot to add the minecraft part in. :P
    I'm still having problems with my block textures(except the top texture).

    Here's my code for BlockDishWasher:

    package dishWasherMod.blocks;
    import java.util.Random;
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    import dishWasherMod.DishWasherMod;
    import dishWasherMod.tileentity.TileEntityDishWasher;
    import net.minecraft.block.Block;
    import net.minecraft.block.BlockContainer;
    import net.minecraft.block.material.Material;
    import net.minecraft.client.renderer.texture.IconRegister;
    import net.minecraft.entity.EntityLiving;
    import net.minecraft.entity.EntityLivingBase;
    import net.minecraft.entity.item.EntityItem;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.inventory.Container;
    import net.minecraft.inventory.IInventory;
    import net.minecraft.item.ItemStack;
    import net.minecraft.nbt.NBTTagCompound;
    import net.minecraft.tileentity.TileEntity;
    import net.minecraft.tileentity.TileEntityFurnace;
    import net.minecraft.util.Icon;
    import net.minecraft.util.MathHelper;
    import net.minecraft.world.World;
    public class BlockDishWasher extends BlockContainer
    {
    private Random dishRand = new Random();
    private final boolean isActive;
    private static boolean keepdishInventory = false;
    @SideOnly(Side.CLIENT)
    private Icon dishIcon;
    private Icon dishIconTop;
    @SideOnly(Side.CLIENT)
    private Icon dishIconFront;
    public BlockDishWasher(int par1, boolean par2)
    {
    		 super(par1, Material.iron);
    		 this.isActive = par2;
    }
    public int getRenderType()
    {
    		 return 2105;
    }
    /**
    		 * Returns the ID of the items to drop on destruction.
    		 */
    public int idDropped(int par1, Random par2Random, int par3)
    {
    		 return DishWasherMod.dishWasher.blockID;
    }
    /**
    		 * Called whenever the block is added into the world. Args: world, x, y, z
    		 */
    public void onBlockAdded(World par1World, int par2, int par3, int par4)
    {
    		 super.onBlockAdded(par1World, par2, par3, par4);
    		 this.setDefaultDirection(par1World, par2, par3, par4);
    }
    /**
    		 * set a blocks direction
    		 */
    private void setDefaultDirection(World par1World, int par2, int par3, int par4)
    {
    		 if (!par1World.isRemote)
    		 {
    				 int l = par1World.getBlockId(par2, par3, par4 - 1);
    				 int i1 = par1World.getBlockId(par2, par3, par4 + 1);
    				 int j1 = par1World.getBlockId(par2 - 1, par3, par4);
    				 int k1 = par1World.getBlockId(par2 + 1, par3, par4);
    				 byte b0 = 3;
    				 if (Block.opaqueCubeLookup[l] && !Block.opaqueCubeLookup[i1])
    				 {
    						 b0 = 3;
    				 }
    				 if (Block.opaqueCubeLookup[i1] && !Block.opaqueCubeLookup[l])
    				 {
    						 b0 = 2;
    				 }
    				 if (Block.opaqueCubeLookup[j1] && !Block.opaqueCubeLookup[k1])
    				 {
    						 b0 = 5;
    				 }
    				 if (Block.opaqueCubeLookup[k1] && !Block.opaqueCubeLookup[j1])
    				 {
    						 b0 = 4;
    				 }
    				 par1World.setBlockMetadataWithNotify(par2, par3, par4, b0, 2);
    		 }
    }
    @SideOnly(Side.CLIENT)
    /**
    		 * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata
    		 */
    public Icon getIcon(int par1, int par2)
    {
    		 return par1 == 1 ? this.dishIconTop : (par1 == 0 ? this.dishIconTop : (par1 != par2 ? this.dishIcon : this.dishIconFront));
    }
    @SideOnly(Side.CLIENT)
    /**
    		 * Retrieves the block texture to use based on the display side. Args: iBlockAccess, x, y, z, side
    		 */
    public void registerIcons(IconRegister par1IconRegister)
    {
    		 this.dishIcon = par1IconRegister.registerIcon("DishWasherMod:dishwasherback");
    		 this.dishIconFront = par1IconRegister.registerIcon(this.isActive ? "DishWasherMod:dishwasheractive" : "DishWasherMod:dishwasheridle");
    		 this.dishIconTop = par1IconRegister.registerIcon("DishWasherMod:dishwashertop");
    }
    @SideOnly(Side.CLIENT)
    /**
    		 * A randomly called display update to be able to add particles or other items for display
    		 */
    public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random)
    {
    		 if (this.isActive)
    		 {
    				 int var6 = par1World.getBlockMetadata(par2, par3, par4);
    				 float var7 = (float)par2 + 0.5F;
    				 float var8 = (float)par3 + 0.0F + par5Random.nextFloat() * 6.0F / 16.0F;
    				 float var9 = (float)par4 + 0.5F;
    				 float var10 = 0.52F;
    				 float var11 = par5Random.nextFloat() * 0.6F - 0.3F;
    				
    		 }
    }
    /**
    		 * Called upon block activation (right click on the block.)
    		 */
    public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9)
    {
    		 if (par1World.isRemote)
    {
    return true;
    }
    else if (!par5EntityPlayer.isSneaking())
    {
    TileEntityDishWasher var10 = (TileEntityDishWasher) par1World.getBlockTileEntity(par2, par3, par4);
    if (var10 != null)
    {
    par5EntityPlayer.openGui(DishWasherMod.instance, 0, par1World, par2, par3, par4);
    }
    return true;
    }
    else
    {
    return false;
    }
    }
    
    /**
    		 * Update which block ID the furnace is using depending on whether or not it is burning
    		 */
    public static void updateFurnaceBlockState(boolean par0, World par1World, int par2, int par3, int par4)
    {
    		 int var5 = par1World.getBlockMetadata(par2, par3, par4);
    		 TileEntity var6 = par1World.getBlockTileEntity(par2, par3, par4);
    		 keepdishInventory = true;
    		 if (par0)
    		 {
    				 par1World.setBlock(par2, par3, par4, DishWasherMod.dishWasherActive.blockID);
    		 }
    		 else
    		 {
    				 par1World.setBlock(par2, par3, par4, DishWasherMod.dishWasher.blockID);
    		 }
    		 keepdishInventory = false;
    		 par1World.setBlockMetadataWithNotify(par2, par3, par4, var5, 2);
    		 if (var6 != null)
    		 {
    				 var6.validate();
    				 par1World.setBlockTileEntity(par2, par3, par4, var6);
    		 }
    }
    /**
    		 * Returns a new instance of a block's tile entity class. Called on placing the block.
    		 */
    public TileEntity createNewTileEntity(World par1World)
    {
    		 return new TileEntityDishWasher();
    }
    /**
    		 * Called when the block is placed in the world.
    		 */
    public void onBlockPlacedBy(World par1World, int par2, int par3, int par4, EntityLivingBase par5EntityLivingBase, ItemStack par6ItemStack)
    {
    		 int l = MathHelper.floor_double((double)(par5EntityLivingBase.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
    		 if (l == 0)
    		 {
    				 par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2);
    		 }
    		 if (l == 1)
    		 {
    				 par1World.setBlockMetadataWithNotify(par2, par3, par4, 5, 2);
    		 }
    		 if (l == 2)
    		 {
    				 par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2);
    		 }
    		 if (l == 3)
    		 {
    				 par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2);
    		 }
    		 if (par6ItemStack.hasDisplayName())
    		 {
    				 ((TileEntityDishWasher)par1World.getBlockTileEntity(par2, par3, par4)).setCustomName(par6ItemStack.getDisplayName());
    		 }
    }
    /**
    		 * ejects contained items into the world, and notifies neighbours of an update, as appropriate
    		 */
    public void breakBlock(World par1World, int par2, int par3, int par4, int par5, int par6)
    {
    		 if (!keepdishInventory)
    		 {
    				 TileEntityDishWasher var7 = (TileEntityDishWasher)par1World.getBlockTileEntity(par2, par3, par4);
    				 if (var7 != null)
    				 {
    						 for (int var8 = 0; var8 < var7.getSizeInventory(); ++var8)
    						 {
    								 ItemStack itemstack = var7.getStackInSlot(var8);
    								 if (itemstack != null)
    								 {
    										 float f = this.dishRand.nextFloat() * 0.8F + 0.1F;
    										 float f1 = this.dishRand.nextFloat() * 0.8F + 0.1F;
    										 float f2 = this.dishRand.nextFloat() * 0.8F + 0.1F;
    										 while (itemstack.stackSize > 0)
    										 {
    												 int k1 = this.dishRand.nextInt(21) + 10;
    												 if (k1 > itemstack.stackSize)
    												 {
    														 k1 = itemstack.stackSize;
    												 }
    												 itemstack.stackSize -= k1;
    												 EntityItem entityitem = new EntityItem(par1World, (double)((float)par2 + f), (double)((float)par3 + f1), (double)((float)par4 + f2), new ItemStack(itemstack.itemID, k1, itemstack.getItemDamage()));
    												 if (itemstack.hasTagCompound())
    												 {
    														 entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
    												 }
    												 float f3 = 0.05F;
    												 entityitem.motionX = (double)((float)this.dishRand.nextGaussian() * f3);
    												 entityitem.motionY = (double)((float)this.dishRand.nextGaussian() * f3 + 0.2F);
    												 entityitem.motionZ = (double)((float)this.dishRand.nextGaussian() * f3);
    												 par1World.spawnEntityInWorld(entityitem);
    										 }
    								 }
    						 }
    						 par1World.func_96440_m(par2, par3, par4, par5);
    				 }
    		 }
    		 super.breakBlock(par1World, par2, par3, par4, par5, par6);
    }
    public boolean hasComparatorInputOverride()
    {
    		 return true;
    }
    public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5)
    {
    		 return Container.calcRedstoneFromInventory((IInventory)par1World.getBlockTileEntity(par2, par3, par4));
    }
    }
  • #90
    I have a video covering different textures for different sides of blocks. Video is below, even though its for biomes I can guess the same code will apply to machines as well.


    Scrub to 13:10
    Last edited by Shaqaruden: 8/14/2013 9:36:08 PM
  • #91
    Quote from Shaqaruden

    I have a video covering different textures for different sides of blocks. Video is below, even though its for biomes I can guess the same code will apply to machines as well.


    Scrub to 13:10


    Yeah, but my DishWasher is a custom furnace. You should either have or make a tutorial on texturing furnaces because I've only gotten the top texture to load.
  • #92
    Still doesn't work, this s my code




    package moretomine; //Package directory
    /*
    * Basic importing
    */
    //Proxys
    
    import net.minecraft.block.Block;
    import net.minecraft.block.BlockFence;
    import net.minecraft.client.renderer.texture.IconRegister;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.entity.Entity;
    import net.minecraft.item.EnumToolMaterial;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemFood;
    import net.minecraft.item.ItemStack;
    import net.minecraft.util.Icon;
    import net.minecraftforge.common.Configuration;
    import net.minecraftforge.common.EnumHelper;
    import cpw.mods.fml.common.Mod;
    import cpw.mods.fml.common.Mod.EventHandler;
    import cpw.mods.fml.common.SidedProxy;
    import cpw.mods.fml.common.event.FMLInitializationEvent;
    import cpw.mods.fml.common.event.FMLPostInitializationEvent;
    import cpw.mods.fml.common.event.FMLPreInitializationEvent;
    import cpw.mods.fml.common.network.NetworkMod;
    import cpw.mods.fml.common.registry.GameRegistry;
    import cpw.mods.fml.common.registry.LanguageRegistry;
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    import net.minecraft.block.BlockFence;
    import net.minecraft.block.material.Material;
    /*
    * Basic needed forge stuff
    */
    @Mod(modid="moreforminecraft",name="More 4 Minecraft Mine Edition",version="0.0.1")
    @NetworkMod(clientSideRequired=true,serverSideRequired=false)
    public class base {
    
    /*
    * ToolMaterial
    */
    //prxy
    
    //Items
    public static Item tinkIngot;
    //Food Items
    public static Item Edible = (new ItemFood(8000, 3, 6.0F, false)).setUnlocalizedName("EdibleIngot").setCreativeTab(base.tabMine);
    public static Item edibleCooked = (new ItemFood(8001, 20, 6.0F, false)).setUnlocalizedName("edibleIngotCooked").setCreativeTab(base.tabMine);
    public static Item edibleSugar = (new ItemFood(8002, 6, 6.0F, false)).setUnlocalizedName("edibleSugar").setCreativeTab(base.tabMine);
    
    //Creative Tab
    public static CreativeTabs tabMine = new TabMineItems(CreativeTabs.getNextID(), "More To Mine");
    //Blocks
    
    public static Block tinkBlock;
    public static Block tinkOre;
    public static Block erodustOre;
    public static Block BlenOre;
    public static Block BlenFence;
    
    //DECLARING ENUMTOOLMATERIALS
    static EnumToolMaterial EnumToolMaterialTink= EnumHelper.addToolMaterial("HighPower",4, 250, 14.0F, 2, 14);
    static EnumToolMaterial EnumToolMaterialBlen= EnumHelper.addToolMaterial("BlenPowe",7, 450, 20.0F, 3, 24);
    //The neccessities
    public static Entity Steve;
    public static Item TinkAxe;
    public static Item TinkShovel;
    public static Item TinkSword;
    public static Item TinkPickaxe;
    public static Item TinkHoe;
    public static Item TinkPaxcel;
    public static Item BlenStone;
    public static Item BlenPickaxe;
    public static Item BlenSword;
    public static Item BlenSpade;
    public static Item BlenAxe;
    public static Item BlenHoe;
    public static Item BlenPaxcel;
    public static Item BlazeStick;
    
    //Declaring Init
    @EventHandler
    public void preInit(FMLPreInitializationEvent event) {
    
    }
    @EventHandler
    public void load(FMLInitializationEvent event){
    //I NEEDZ SOME CONFIG
      
    
    //Tools
    TinkAxe = new TinkAxe(9014, EnumToolMaterialTink).setUnlocalizedName("axeTink").setCreativeTab(base.tabMine);
    TinkShovel = new TinkShovel(9015, EnumToolMaterialTink).setUnlocalizedName("shovelTink").setCreativeTab(base.tabMine);
    TinkPickaxe = new TinkPickaxe(9016, EnumToolMaterialTink).setUnlocalizedName("pickaxeTink").setCreativeTab(base.tabMine);
    TinkSword = new TinkSword(9017, EnumToolMaterialTink).setUnlocalizedName("swordTink").setCreativeTab(base.tabMine);
    TinkPaxcel = new TinkPaxcel(9018, EnumToolMaterialTink).setUnlocalizedName("paxcelTink").setCreativeTab(base.tabMine);
    
    BlenAxe = new BlenAxe(9019, EnumToolMaterialBlen).setUnlocalizedName("blenAxe").setCreativeTab(base.tabMine);
    BlenPickaxe = new BlenPickaxe(9020, EnumToolMaterialBlen).setUnlocalizedName("blenPickaxe").setCreativeTab(base.tabMine);
    BlenHoe = new BlenHoe(9021, EnumToolMaterialBlen).setUnlocalizedName("blenHoe").setCreativeTab(base.tabMine);
    BlenSpade = new BlenSpade(9022, EnumToolMaterialBlen).setUnlocalizedName("blenSpade").setCreativeTab(base.tabMine);
    BlenSword = new BlenSword(9023, EnumToolMaterialBlen).setUnlocalizedName("blenSword").setCreativeTab(base.tabMine);
    BlenPaxcel = new BlenPaxcel(9024, EnumToolMaterialBlen).setUnlocalizedName("blenPaxcel").setCreativeTab(base.tabMine);
    
    
    
    //Armor
    
    
    //Ore Registry
    GameRegistry.registerWorldGenerator(new WorldGeneratorOreGen());
    GameRegistry.registerWorldGenerator(new WorldGenTinkOre());
    GameRegistry.registerWorldGenerator(new WorldGenBlenOre());
    
    
    //Register Blocks
    tinkBlock= new tinkblock(1910, "Block of Tink").setUnlocalizedName("tinkBlock").setHardness(3.0F).setStepSound(Block.soundMetalFootstep).setResistance(20.0F);
    GameRegistry.registerBlock(tinkBlock, "tinkblock");
    LanguageRegistry.addName(tinkBlock, "Block of Tink");
    
    BlenOre= new blenOre(1914, "Block of Tink").setUnlocalizedName("oreBlen").setHardness(6.0F).setStepSound(Block.soundMetalFootstep).setResistance(20.0F);
    GameRegistry.registerBlock(BlenOre, "blenOre");
    LanguageRegistry.addName(BlenOre, "Blen Ore");
    
    tinkOre= new Tinkore(1911, "Tink Ore").setUnlocalizedName("oreTink").setHardness(4.0F).setStepSound(Block.soundMetalFootstep).setResistance(10.0F);
    GameRegistry.registerBlock(tinkOre, "tinkore");
    LanguageRegistry.addName(tinkOre, "Tink Ore");
    
    erodustOre= new Erodudeore(1912, "Ero Dust Ore").setUnlocalizedName("oreEro").setHardness(4.0F).setStepSound(Block.soundMetalFootstep).setResistance(10.0F);
    GameRegistry.registerBlock(erodustOre, "Ero Dust Ore");
    LanguageRegistry.addName(erodustOre, "Ero Dust Ore");
    
    
    BlenFence = new BlockFence(1945, "blenFenceMaterial" ,(Material.wood)).setHardness(3F).setUnlocalizedName("blenFenceMaterial").setCreativeTab(tabMine);
    GameRegistry.registerBlock(BlenFence, "Fence of Blen");
    LanguageRegistry.addName(BlenFence, "Blen Fence");
    //items
    tinkIngot = new MineItems(1909).setUnlocalizedName("tinkIngot");
    BlenStone = new MineItems(1913).setUnlocalizedName("stoneBlen");
    BlazeStick = new MineItems(1918).setUnlocalizedName("stickBlaze");
    
    //adding names
    LanguageRegistry.addName(TinkAxe, "Tink Axe");
    LanguageRegistry.addName(TinkShovel, "Tink Shovel");
    LanguageRegistry.addName(TinkPickaxe, "Tink Pickaxe");
    LanguageRegistry.addName(TinkSword, "Tink Sword");
    LanguageRegistry.addName(TinkPaxcel, "Tink Paxcel");
    LanguageRegistry.addName(tinkIngot, "Tink Ingot");
    LanguageRegistry.addName(Edible, "Ero Dust");
    LanguageRegistry.addName(edibleCooked, "Cooked Ero Dust");
    LanguageRegistry.addName(edibleSugar, "Ero Dust Sugar");
    LanguageRegistry.addName(BlenStone, "Blen Stone");
    LanguageRegistry.addName(BlenAxe, "Blen Axe");
    LanguageRegistry.addName(BlenSpade, "Blen Shovel");
    LanguageRegistry.addName(BlenPickaxe, "Blen Pickaxe");
    LanguageRegistry.addName(BlenSword, "Blen Sword");
    LanguageRegistry.addName(BlenPaxcel, "Blen Paxcel");
    //crafting
    GameRegistry.addRecipe(new ItemStack(tinkBlock,1), new Object[]{
    "TTT","TTT","TTT",'T',tinkIngot,
    });
    GameRegistry.addRecipe(new ItemStack(TinkAxe,1), new Object[]{
    "TT ","TB "," B ",'T',tinkIngot,'B',Item.stick
    });
    GameRegistry.addShapelessRecipe(new ItemStack(edibleSugar,1), new Object[]{
    Item.sugar, Edible });
    GameRegistry.addShapelessRecipe(new ItemStack(BlazeStick,1), new Object[]{
    Item.blazeRod, Item.stick });
    
    //Entity
    //smelting
    GameRegistry.addSmelting(tinkOre.blockID, new ItemStack(tinkIngot, 1), 1F);
    GameRegistry.addSmelting(edibleSugar.itemID, new ItemStack(edibleCooked, 1), 1F);
    GameRegistry.addSmelting(BlenOre.blockID, new ItemStack(BlenStone, 1), 1F);
    
    }
    }


    I put that in
    mcp/src/minecraft/assets/moreforminecraft/textures/blocks/allmyitems.png
  • #93
    Quote from Deboomboom

    I put that in
    mcp/src/minecraft/assets/moreforminecraft/textures/blocks/allmyitems.png


    and the code for the block which ain't working with textures?
  • #94
    Quote from Mazetar

    and the code for the block which ain't working with textures?

    Nope, only my blenFenceMaterial is showing up. Thta's the only texture working.
  • #95
    Quote from Deboomboom


    Nope, only my blenFenceMaterial is showing up. Thta's the only texture working.

    I asked for the code of any of the blocks which aint working.. :P
  • #96
    Quote from Mazetar


    I asked for the code of any of the blocks which aint working.. :P


    Post it later, ob my kindle :P

    But its the 1.5 block code. No item.Icon register, I let that to the. StUnlocalizedName bit(stupid kindle typing.
  • To post a comment, please or register a new account.
Posts Quoted:
Reply
Clear All Quotes