Jump to content

MateuszKam7

Members
  • Posts

    14
  • Joined

  • Last visited

Posts posted by MateuszKam7

  1. I tried to make a block (grass), which has multiple textures. The block i made says "Missing Texture" all over it... Does anyone know how to make this? Here is my code:

    package mods.MattCraft.Common;
    
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    import java.util.Random;
    
    import net.minecraft.block.Block;
    import net.minecraft.block.material.Material;
    import net.minecraft.client.renderer.texture.IconRegister;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.util.Icon;
    import net.minecraft.world.ColorizerGrass;
    import net.minecraft.world.IBlockAccess;
    import net.minecraft.world.World;
    
    public class ZGrassBlock extends Block
    {
        private Icon ZGrassTop;
        private Icon ZGrassSide;
        private Icon ZDirtBlock;
        
    
        protected ZGrassBlock(int par1)
        {
            super(par1, Material.ground);
            this.setTickRandomly(true);
            this.setCreativeTab(CreativeTabs.tabBlock);
       
        }
        public int idDropped(int par1, Random par2Random, int par3)
        {
            return MattCraftMain.ZDirt.idDropped(0, par2Random, par3);
        }
    
        @SideOnly(Side.CLIENT)
    
        /**
         * When this method is called, your block should register all the icons it needs with the given IconRegister. This
         * is the only chance you get to register icons.
         */
        public void registerIcons(IconRegister reg){
        	this.blockIcon = reg.registerIcon("MattCraft:ZGrassTop");
        	this.blockIcon = reg.registerIcon("MattCraft:ZGrassSide");
        	this.blockIcon = reg.registerIcon("MattCraft:ZDirtBlock");
    
        }
        @SideOnly(Side.CLIENT)
        public Icon getBlockTextureFromSideAndMetadata(int i, int j)
        {
                if (i == 0)
                {
                        return ZDirtBlock;
                }
                if (i == 1)
                {
                        return ZGrassTop;
                }
                else
                {
                        return ZGrassSide;
                }
        }
        
        
    
    }
    

     

  2. I tried to make a block (grass), which has multiple textures. The block i made says "Missing Texture" all over it... Does anyone know how to make this? Here is my code:

    package mods.MattCraft.Common;
    
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    import java.util.Random;
    
    import net.minecraft.block.Block;
    import net.minecraft.block.material.Material;
    import net.minecraft.client.renderer.texture.IconRegister;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.util.Icon;
    import net.minecraft.world.ColorizerGrass;
    import net.minecraft.world.IBlockAccess;
    import net.minecraft.world.World;
    
    public class ZGrassBlock extends Block
    {
        private Icon ZGrassTop;
        private Icon ZGrassSide;
        private Icon ZDirtBlock;
        
    
        protected ZGrassBlock(int par1)
        {
            super(par1, Material.ground);
            this.setTickRandomly(true);
            this.setCreativeTab(CreativeTabs.tabBlock);
       
        }
        public int idDropped(int par1, Random par2Random, int par3)
        {
            return MattCraftMain.ZDirt.idDropped(0, par2Random, par3);
        }
    
        @SideOnly(Side.CLIENT)
    
        /**
         * When this method is called, your block should register all the icons it needs with the given IconRegister. This
         * is the only chance you get to register icons.
         */
        public void registerIcons(IconRegister reg){
        	this.blockIcon = reg.registerIcon("MattCraft:ZGrassTop");
        	this.blockIcon = reg.registerIcon("MattCraft:ZGrassSide");
        	this.blockIcon = reg.registerIcon("MattCraft:ZDirtBlock");
    
        }
        @SideOnly(Side.CLIENT)
        public Icon getBlockTextureFromSideAndMetadata(int i, int j)
        {
                if (i == 0)
                {
                        return ZDirtBlock;
                }
                if (i == 1)
                {
                        return ZGrassTop;
                }
                else
                {
                        return ZGrassSide;
                }
        }
        
        
    
    }
    

     

  3. My Main:

    package mods.MattCraft.Common;

     

    import net.minecraft.block.Block;

    import net.minecraft.block.material.Material;

    import net.minecraft.creativetab.CreativeTabs;

    import net.minecraft.item.Item;

    import net.minecraft.item.ItemStack;

    import net.minecraft.world.biome.BiomeGenBase;

    import net.minecraftforge.common.DimensionManager;

    import cpw.mods.fml.common.Mod;

    import cpw.mods.fml.common.Mod.Init;

    import cpw.mods.fml.common.event.FMLInitializationEvent;

    import cpw.mods.fml.common.network.NetworkMod;

    import cpw.mods.fml.common.registry.GameRegistry;

    import cpw.mods.fml.common.registry.LanguageRegistry;

     

    @Mod(modid = "Mateuszkam7",name = "MattCraft", version = "1.0" )

    @NetworkMod(clientSideRequired = true, serverSideRequired = false)

     

    public class MattCraftMain {

     

    public static Block GTorch;

    public static Block RBlock;

    //Zombie Dimension

    public static Block ZombieBlock;

        public static Block ZIgnitor;

        public static Block ZGrass;

        public static Block ZDirt;

        public static Block ZStone;

       

        public static Block ZCStone;

        public static Block ZTLog;

        public static Block ZTLeaf;

       

        public static Item ZFlintAndSteel;

        public static portal portal;

     

    int ZombieBlockID = 500;

    int GTorchID = 501;

    int RBlockID = 502;

    int portalID = 503;

    int ZGrassID = 504;

    int ZDirtID = 505;

    int ZStoneID = 506;

    int ZCStoneID = 507;

     

    //Zombie Dimension

    public static int dimension = 11;

        public static BiomeGenBase ZBiome;

     

    public static CreativeTabs ZombiePlus = new CreativeTabs("ZombiePlus") {

    public ItemStack getIconItemStack() {

     

    ZombieBlock.setCreativeTab(ZombiePlus);

    RBlock.setCreativeTab(ZombiePlus);

    portal.setCreativeTab(ZombiePlus);

    GTorch.setCreativeTab(ZombiePlus);

    ZFlintAndSteel.setCreativeTab(ZombiePlus);

    return new ItemStack(ZombieBlock, 1, 0);

     

    }

    };

    {

    }

    @Init

     

     

     

    public void load(FMLInitializationEvent event){

     

     

    GTorch = new GTorchBlock(GTorchID).setUnlocalizedName("GlowStone Torch");

    ZombieBlock = new CorruptBlock1(ZombieBlockID, Material.iron).setUnlocalizedName("Corrupt Block").setLightValue(0.5F).setHardness(2.5F).setResistance(20F);

    RBlock = new RBlock2(RBlockID, Material.rock).setUnlocalizedName("Reinforced Stone Brick").setResistance(24.0F).setHardness(1.5F);

    //Zombie Dimension

    ZIgnitor = (new ZIgniter(2809,4)).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("ZIgnitor").setHardness(0.5F).setResistance(999999F);

    ZFlintAndSteel = (new ZFlintAndSteel(2903)).setUnlocalizedName("ZFlintAndSteel");

    portal = (portal)((portal)(new portal(2800)).setStepSound(Block.soundWoodFootstep).setHardness(0.5F).setResistance(1.0F).setUnlocalizedName("portal"));

    ZBiome = new ZBiomeGen(25);

    ZGrass = new ZGrassBlock(ZGrassID).setUnlocalizedName("Zombie Block");

    ZDirt = new ZDirtBlock(ZDirtID);

    ZStone = new ZStoneBlock(ZStoneID);

    ZCStone = new ZCStoneBlock(ZCStoneID,Material.rock);

     

    gameRegisters();

    languageRegisters();

    craftingRecipes();

     

     

     

           

     

     

    }

    private Block IronIgniter(int ironIgniterID2){

    return null;

    }

    public void craftingRecipes(){

     

    GameRegistry.addShapedRecipe(new ItemStack(GTorch,4), new Object []{

    "C","D",

    'C', Block.glowStone, 'D', Item.stick

    });

     

    GameRegistry.addShapedRecipe(new ItemStack(ZombieBlock), new Object []{

    "AAA","ABA","AAA",

    'A', Item.rottenFlesh, 'B', Item.enderPearl

     

    });

    GameRegistry.addShapedRecipe(new ItemStack(RBlock,5), new Object []{

    "BAB","AAA","BAB",

    'A', Block.stoneBrick, 'B', Item.rottenFlesh

     

     

    //Zombie Dimension

     

    });

     

    GameRegistry.addShapedRecipe(new ItemStack(ZFlintAndSteel), new Object []{

    "A  ","CB ",

    'A',Item.ingotIron, 'B', Item.flint, 'C',Item.rottenFlesh

    });

    GameRegistry.addShapedRecipe(new ItemStack(ZFlintAndSteel), new Object []{

    " A "," CB",

    'A',Item.ingotIron, 'B', Item.flint, 'C',Item.rottenFlesh

    });

     

    //Zombie Dimension

    DimensionManager.registerProviderType(11, WorldProviderIron.class, false);

            DimensionManager.registerDimension(11, 11);

     

    LanguageRegistry.instance().addStringLocalization("itemGroup.ZombiePlus", "en_US", "ZombiePlus");

    }

    private static void gameRegisters(){

    GameRegistry.registerBlock(ZombieBlock, "Zombie Block");

    GameRegistry.registerBlock(GTorch, "GlowStone Torch");

    GameRegistry.registerBlock(RBlock, "Reinforced Stone Brick");

     

    //Zombie Dimension

    GameRegistry.registerBlock(portal);

    GameRegistry.registerBlock(ZIgnitor);

    GameRegistry.registerBlock(ZGrass, "Zombie Grass");

    GameRegistry.addBiome(ZBiome);

    GameRegistry.registerBlock(ZDirt, "Zombie Dirt");

    GameRegistry.registerBlock(ZStone, "Zombie Stone");

    GameRegistry.registerBlock(ZCStone, "Zombie Cobble Stone");

     

    }

    private static void languageRegisters(){

    LanguageRegistry.addName(ZombieBlock, "Zombie Block");

    LanguageRegistry.addName(GTorch, "GlowStone Torch");

    LanguageRegistry.addName(RBlock, "Reinforced Stone Brick");

    //Zombie Dimension

            LanguageRegistry.addName(portal, "portal");

            LanguageRegistry.addName(ZIgnitor, "Ignitor");

            LanguageRegistry.addName(ZFlintAndSteel, "Zombie Flint And Steel");

            LanguageRegistry.addName(ZGrass, "Zombie Grass");

            LanguageRegistry.addName(ZDirt, "Zombie Dirt");

            LanguageRegistry.addName(ZStone, "Zombie Stone");

            LanguageRegistry.addName(ZCStone, "Zombie Cobble Stone");

     

     

        }

     

     

    }

     

    My Biome:

    package mods.MattCraft.Common;

     

    import java.util.Random;

    import net.minecraft.world.biome.BiomeGenBase;

    import net.minecraft.world.biome.SpawnListEntry;

    import net.minecraft.world.gen.feature.WorldGenerator;

     

    public class ZBiomeGen extends BiomeGenBase

    {

        public ZBiomeGen(int var1)

        {

            super(var1);

            this.topBlock = (byte)MattCraftMain.ZGrass.blockID;

            this.fillerBlock = (byte)MattCraftMain.ZStone.blockID;

            this.minHeight = 0.1F;

            this.maxHeight = 0.2F;

            this.spawnableCreatureList.clear();

            this.spawnableMonsterList.clear();

            this.spawnableWaterCreatureList.clear();

            // this.spawnableMonsterList.add(new SpawnListEntry(EntityZombieWithBow.class, 10, 4, 4));

        }

     

        /**

        * Gets a WorldGen appropriate for this biome.

        */

      // public WorldGenerator getRandomWorldGenForTrees(Random var1)

        {

        //    return new WorldGenBlightTrees(false);

        }

    }

    I havent put the biome into the new dimension(which works) If there is something else you need, say so !

  4. I am making a new biome for my mod and when i tested it, it crashed... Here is my crash report and tell me what code you need to see:

     

          Minecraft has crashed!     

          ----------------------     

     

    Minecraft has stopped running because it encountered a problem; Failed to start game

     

    A full error report has been saved to C:\Users\Minecraft Modded\Desktop\forge\mcp\jars\.\crash-reports\crash-2013-04-12_19.15.59-client.txt - Please include a copy of that file (Not this screen!) if you report this crash to anyone; without it, they will not be able to help fix the crash :(

     

     

     

    --- BEGIN ERROR REPORT e0d88f57 --------

    Full report at:

    C:\Users\Minecraft Modded\Desktop\forge\mcp\jars\.\crash-reports\crash-2013-04-12_19.15.59-client.txt

    Please show that file to Mojang, NOT just this screen!

     

    Generated 4/12/13 7:15 PM

     

    -- System Details --

    Details:

    Minecraft Version: 1.5.1

    Operating System: Windows Vista (amd64) version 6.0

    Java Version: 1.7.0_13, Oracle Corporation

    Java VM Version: Java HotSpot 64-Bit Server VM (mixed mode), Oracle Corporation

    Memory: 902719840 bytes (860 MB) / 1056309248 bytes (1007 MB) up to 1056309248 bytes (1007 MB)

    JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M

    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

    Suspicious classes: FML and Forge are installed

    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

    FML: MCP v7.44 FML v5.1.8.611 Minecraft Forge 7.7.1.611 4 mods loaded, 4 mods active

    mcp [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized

    FML [Forge Mod Loader] (coremods) Unloaded->Constructed->Pre-initialized->Initialized

    Forge [Minecraft Forge] (coremods) Unloaded->Constructed->Pre-initialized->Initialized

    Mateuszkam7 [MattCraft] (bin) Unloaded->Constructed->Pre-initialized->Errored

    LWJGL: 2.4.2

    OpenGL: ATI Radeon HD 4350 GL version 2.1.8490 Release, ATI Technologies Inc.

    Is Modded: Definitely; Client brand changed to 'forge,fml'

    Type: Client (map_client.txt)

    Texture Pack: Default

    Profiler Position: N/A (disabled)

    Vec3 Pool Size: ~~ERROR~~ NullPointerException: null

     

    java.lang.NullPointerException

    at mods.MattCraft.Common.ZBiomeGen.<init>(ZBiomeGen.java:13)

    at mods.MattCraft.Common.MattCraftMain.load(MattCraftMain.java:79)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

    at java.lang.reflect.Method.invoke(Unknown Source)

    at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:515)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

    at java.lang.reflect.Method.invoke(Unknown Source)

    at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

    at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

    at com.google.common.eventbus.EventBus.post(EventBus.java:267)

    at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:165)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

    at java.lang.reflect.Method.invoke(Unknown Source)

    at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)

    at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45)

    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)

    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)

    at com.google.common.eventbus.EventBus.post(EventBus.java:267)

    at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:98)

    at cpw.mods.fml.common.Loader.initializeMods(Loader.java:689)

    at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:206)

    at net.minecraft.client.Minecraft.startGame(Minecraft.java:444)

    at net.minecraft.client.MinecraftAppletImpl.startGame(MinecraftAppletImpl.java:44)

    at net.minecraft.client.Minecraft.run(Minecraft.java:729)

    at java.lang.Thread.run(Unknown Source)

    --- END ERROR REPORT 858f6a29 ----------

     

     

     

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.