Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

meganmorgangames

Members
  • Posts

    17
  • Joined

  • Last visited

Posts posted by meganmorgangames

  1. Try changing the the package

     

    assets.extratools.textures.items

     

    Also, you might want to make certain that your modid is "extratools"

     

    [coolboy actually beat me to this]

     

    It's a really good idea to great a static class that references your mod id, mod name, and version number

     

    package com.mmg.candymod.lib;
    
    public class Strings {
    
        public static final String MODID = "extratools";
        public static final String MODNAME = "Extra Tools";
        public static final String VERSION = "0.1";	
    
    }
    

     

    That way, when you have to reference any of that information, it will always be correct.

     

    Then your texture would be

    setTextureName(Strings.MODID + ":EnderShard");
    

     

    This is assuming that the EnderShard texture is in your assets.extratools.textures.items folder is named "EnderShard.png"

  2. Just shooting off the hip here

     

    TileEntity te = this.worldObj.getBlockTileEntity(this.xCoord+1, this.yCoord, this.zCoord);

    if (te != null){

      if (te instanceof TileEntityWire){

          (TileEntityWire)te.yourmethodhere;

      }

    }

     

    Don't copy and paste it that, though.  I just typed it up here so it might not follow proper syntax.

  3. So, I'm trying to create a custom block that is effected by gravity and can be colored.  I've got the gravity part down, I just extended BlockFalling.  I looked at BlockColored and copied the body, renamed the variables that I knew what they were doing for easier reference, and created the appropriate textures for the block

     

     

    package com.mmg.candymod.blocks;
    
    import java.util.List;
    
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    import net.minecraft.block.BlockFalling;
    import net.minecraft.block.material.MapColor;
    import net.minecraft.block.material.Material;
    import net.minecraft.client.renderer.texture.IIconRegister;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemDye;
    import net.minecraft.item.ItemStack;
    import net.minecraft.util.IIcon;
    import net.minecraft.world.World;
    
    public class BlockSugarCrystals extends BlockFalling {
    
        @SideOnly(Side.CLIENT)
        private IIcon[] iconArray;	
    
    protected BlockSugarCrystals() {
    	super(Material.sand);
    	this.setHardness(0.5F);
    	this.setHarvestLevel("shovel", 0);
    	// TODO Auto-generated constructor stub
    }
    
        /**
         * Gets the block's texture. Args: side, meta
         */
        @SideOnly(Side.CLIENT)
        public IIcon getIcon(int side, int meta)
        {
            return this.iconArray[meta % this.iconArray.length];
        }
    
        /**
         * Determines the damage on the item the block drops. Used in cloth and wood.
         */
        public int damageDropped(int meta)
        {
            return meta;
        }
    
        public static int func_150032_b(int p_150032_0_)
        {
            return func_150031_c(p_150032_0_);
        }
    
        public static int func_150031_c(int p_150031_0_)
        {
            return ~p_150031_0_ & 15;
        }
    
        /**
         * returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
         */
        @SideOnly(Side.CLIENT)
        public void getSubBlocks(Item item, CreativeTabs creativeTab, List list)
        {
            for (int i = 0; i < 16; ++i)
            {
                list.add(new ItemStack(item, 1, i));
            }
        }
    
        @SideOnly(Side.CLIENT)
        public void registerBlockIcons(IIconRegister iconRegister)
        {
            this.iconArray = new IIcon[16];
    
            for (int i = 0; i < this.iconArray.length; ++i)
            {
                this.iconArray[i] = iconRegister.registerIcon(this.getTextureName() + "_" + ItemDye.field_150921_b[func_150031_c(i)]);
            }
        }
    
        public MapColor getMapColor(int p_149728_1_)
        {
            return MapColor.getMapColorForBlockColored(p_149728_1_);
        }	
    
    }
    

     

     

    Only things I didn't rename were func_150032_b and func_150031_c, as I have no idea what they are doing.

     

    I haven't done anything special while registering the block (Which may be where the problem is).  I created a simple little dirt to custom block with metavalue 2 to see if it works.  The block looks fine in inventory, but when I place it, it renders the neutral texture.  I get the colored texture back when I break it.  I'm guessing that somehow I have to pass the meta value on to the block, but I have no idea how, or if I should register it in some way to recognize the meta value from inventory.

     

    I'm sure this is an uber noobish question, but I'm stuck :-/

     

    [edit]  Okay.  So I figured out I need another class extending ItemBlockWithMetaData. 

     

     

    package com.mmg.candymod.items;
    
    import net.minecraft.block.Block;
    import net.minecraft.item.ItemBlockWithMetadata;
    import net.minecraft.item.ItemStack;
    
    import com.mmg.candymod.blocks.CustomBlock;
    
    public class ItemBlockSugarCrystals extends ItemBlockWithMetadata {
    
    private final static String[] subNames = {
    	"white", "orange",  "magenta", "lightBlue", "yellow", "lightGreen",
    	"pink", "darkGrey", "lightGrey", "cyan", "purple", "blue", "brown",
    	"green", "red", "black"
    };
    
    public ItemBlockSugarCrystals() {
    	super(CustomBlock.blockSugarCrystals, CustomBlock.blockSugarCrystals);
    	// TODO Auto-generated constructor stub
    }
    
    @Override
    public int getMetadata (int damageValue) {
    	return damageValue;
    }
    
    @Override
    public String getUnlocalizedName(ItemStack itemstack) {
    	return getUnlocalizedName() + "." + subNames[itemstack.getItemDamage()];
    }
    }
    

     

     

    I register in PreInit with: GameRegistry.registerBlock(blockSugarCrystals, ItemBlockSugarCrystals.class, blockSugarCrystals.getUnlocalizedName());

     

    Now the game crashes, probably because I'm registering wrong :-/

     

    Just in case, though

     

    Crash Report

     

     

    [11:10:09] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLTweaker

    [11:10:09] [main/INFO] [LaunchWrapper]: Using primary tweak class name cpw.mods.fml.common.launcher.FMLTweaker

    [11:10:09] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLTweaker

    [11:10:09] [main/INFO] [FML]: Forge Mod Loader version 7.2.116.1024 for Minecraft 1.7.2 loading

    [11:10:09] [main/INFO] [FML]: 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

    [11:10:09] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation

    [11:10:09] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

    [11:10:09] [main/INFO] [LaunchWrapper]: Loading tweak class name cpw.mods.fml.common.launcher.FMLDeobfTweaker

    [11:10:09] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

    [11:10:09] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLInjectionAndSortingTweaker

    [11:10:09] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper

    [11:10:09] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work!

    [11:10:10] [main/ERROR] [FML]: The minecraft jar file:/C:/Users/Darkness/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.0.1024/forgeSrc-1.7.2-10.12.0.1024.jar!/net/minecraft/client/ClientBrandRetriever.class appears to be corrupt! There has been CRITICAL TAMPERING WITH MINECRAFT, it is highly unlikely minecraft will work! STOP NOW, get a clean copy and try again!

    [11:10:10] [main/ERROR] [FML]: FML has been ordered to ignore the invalid or missing minecraft certificate. This is very likely to cause a problem!

    [11:10:10] [main/ERROR] [FML]: Technical information: ClientBrandRetriever was at jar:file:/C:/Users/Darkness/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.2-10.12.0.1024/forgeSrc-1.7.2-10.12.0.1024.jar!/net/minecraft/client/ClientBrandRetriever.class, there were 0 certificates for it

    [11:10:10] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing

    [11:10:10] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper

    [11:10:10] [main/INFO] [LaunchWrapper]: Calling tweak class cpw.mods.fml.common.launcher.FMLDeobfTweaker

    [11:10:12] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.client.main.Main}

    [11:10:14] [main/INFO]: Setting user: Player903

    [11:10:16] [Client thread/INFO]: LWJGL Version: 2.9.0

    [11:10:17] [Client thread/INFO] [MinecraftForge]: Attempting early MinecraftForge initialization

    [11:10:17] [Client thread/INFO] [FML]: MinecraftForge v10.12.0.1024 Initialized

    [11:10:17] [Client thread/INFO] [FML]: Replaced 128 ore recipies

    [11:10:17] [Client thread/INFO] [MinecraftForge]: Completed early MinecraftForge initialization

    [11:10:17] [Client thread/INFO] [FML]: Searching C:\Minecraft\Modding\Candy_1.7.2\eclipse\mods for mods

    [11:10:17] [Client thread/INFO] [cm]: Mod cm is missing the required element 'name'. Substituting cm

    [11:10:19] [Client thread/ERROR] [FML]: FML has detected a mod that is using a package name based on 'net.minecraft.src' : net.minecraft.src.FMLRenderAccessLibrary. This is generally a severe programming error.  There should be no mod code in the minecraft namespace. MOVE YOUR MOD! If you're in eclipse, select your source code and 'refactor' it into a new package. Go on. DO IT NOW!

    [11:10:21] [Client thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load

    [11:10:21] [Client thread/INFO]: Reloading ResourceManager: Default, FMLFileResourcePack:Forge Mod Loader, FMLFileResourcePack:Minecraft Forge, FMLFileResourcePack:cm

    [11:10:22] [Client thread/INFO] [FML]: Configured a dormant chunk cache size of 0

    [11:10:22] [Client thread/ERROR] [FML]: Caught an exception during block registration

    java.lang.NoSuchMethodException: com.mmg.candymod.items.ItemBlockSugarCrystals.<init>(net.minecraft.block.Block)

    at java.lang.Class.getConstructor0(Unknown Source) ~[?:1.7.0_25]

    at java.lang.Class.getConstructor(Unknown Source) ~[?:1.7.0_25]

    at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:187) [GameRegistry.class:?]

    at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:160) [GameRegistry.class:?]

    at com.mmg.candymod.blocks.CustomBlock.initializeBlock(CustomBlock.java:86) [CustomBlock.class:?]

    at com.mmg.candymod.blocks.CustomBlock.mainRegistry(CustomBlock.java:35) [CustomBlock.class:?]

    at com.mmg.candymod.main.CandyMod.preInit(CandyMod.java:25) [CandyMod.class:?]

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_25]

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_25]

    at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:536) [FMLModContainer.class:?]

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_25]

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_25]

    at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) [guava-15.0.jar:?]

    at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) [guava-15.0.jar:?]

    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) [guava-15.0.jar:?]

    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) [guava-15.0.jar:?]

    at com.google.common.eventbus.EventBus.post(EventBus.java:267) [guava-15.0.jar:?]

    at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:209) [LoadController.class:?]

    at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:188) [LoadController.class:?]

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_25]

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_25]

    at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) [guava-15.0.jar:?]

    at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) [guava-15.0.jar:?]

    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) [guava-15.0.jar:?]

    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) [guava-15.0.jar:?]

    at com.google.common.eventbus.EventBus.post(EventBus.java:267) [guava-15.0.jar:?]

    at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119) [LoadController.class:?]

    at cpw.mods.fml.common.Loader.loadMods(Loader.java:498) [Loader.class:?]

    at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:194) [FMLClientHandler.class:?]

    at net.minecraft.client.Minecraft.startGame(Minecraft.java:561) [Minecraft.class:?]

    at net.minecraft.client.Minecraft.run(Minecraft.java:931) [Minecraft.class:?]

    at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?]

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_25]

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_25]

    at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]

    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]

    [11:10:22] [Client thread/ERROR] [FML]: Fatal errors were detected during the transition from PREINITIALIZATION to INITIALIZATION. Loading cannot continue

    [11:10:22] [Client thread/ERROR] [FML]:

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

    FML{7.2.116.1024} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed->Pre-initialized

    Forge{10.12.0.1024} [Minecraft Forge] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed->Pre-initialized

    cm{0.1} [cm] (bin) Unloaded->Constructed->Errored

    [11:10:22] [Client thread/ERROR] [FML]: The following problems were captured during this phase

    [11:10:22] [Client thread/ERROR] [FML]: Caught exception from cm

    cpw.mods.fml.common.LoaderException: java.lang.NoSuchMethodException: com.mmg.candymod.items.ItemBlockSugarCrystals.<init>(net.minecraft.block.Block)

    at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:203) ~[GameRegistry.class:?]

    at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:160) ~[GameRegistry.class:?]

    at com.mmg.candymod.blocks.CustomBlock.initializeBlock(CustomBlock.java:86) ~[CustomBlock.class:?]

    at com.mmg.candymod.blocks.CustomBlock.mainRegistry(CustomBlock.java:35) ~[CustomBlock.class:?]

    at com.mmg.candymod.main.CandyMod.preInit(CandyMod.java:25) ~[CandyMod.class:?]

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_25]

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_25]

    at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:536) ~[FMLModContainer.class:?]

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_25]

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_25]

    at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) ~[guava-15.0.jar:?]

    at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) ~[guava-15.0.jar:?]

    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) ~[guava-15.0.jar:?]

    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) ~[guava-15.0.jar:?]

    at com.google.common.eventbus.EventBus.post(EventBus.java:267) ~[guava-15.0.jar:?]

    at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:209) ~[LoadController.class:?]

    at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:188) ~[LoadController.class:?]

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_25]

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_25]

    at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) ~[guava-15.0.jar:?]

    at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47) ~[guava-15.0.jar:?]

    at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314) ~[guava-15.0.jar:?]

    at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) ~[guava-15.0.jar:?]

    at com.google.common.eventbus.EventBus.post(EventBus.java:267) ~[guava-15.0.jar:?]

    at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119) [LoadController.class:?]

    at cpw.mods.fml.common.Loader.loadMods(Loader.java:498) [Loader.class:?]

    at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:194) [FMLClientHandler.class:?]

    at net.minecraft.client.Minecraft.startGame(Minecraft.java:561) [Minecraft.class:?]

    at net.minecraft.client.Minecraft.run(Minecraft.java:931) [Minecraft.class:?]

    at net.minecraft.client.main.Main.main(Main.java:112) [Main.class:?]

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_25]

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.7.0_25]

    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.7.0_25]

    at net.minecraft.launchwrapper.Launch.launch(Launch.java:134) [launchwrapper-1.9.jar:?]

    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.9.jar:?]

    Caused by: java.lang.NoSuchMethodException: com.mmg.candymod.items.ItemBlockSugarCrystals.<init>(net.minecraft.block.Block)

    at java.lang.Class.getConstructor0(Unknown Source) ~[?:1.7.0_25]

    at java.lang.Class.getConstructor(Unknown Source) ~[?:1.7.0_25]

    at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:187) ~[GameRegistry.class:?]

    ... 41 more

    ---- Minecraft Crash Report ----

    // You should try our sister game, Minceraft!

     

    Time: 3/28/14 11:10 AM

    Description: There was a severe problem during mod loading that has caused the game to fail

     

    cpw.mods.fml.common.LoaderException: java.lang.NoSuchMethodException: com.mmg.candymod.items.ItemBlockSugarCrystals.<init>(net.minecraft.block.Block)

    at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:203)

    at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:160)

    at com.mmg.candymod.blocks.CustomBlock.initializeBlock(CustomBlock.java:86)

    at com.mmg.candymod.blocks.CustomBlock.mainRegistry(CustomBlock.java:35)

    at com.mmg.candymod.main.CandyMod.preInit(CandyMod.java:25)

    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:536)

    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:47)

    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.sendEventToModContainer(LoadController.java:209)

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

    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:47)

    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:119)

    at cpw.mods.fml.common.Loader.loadMods(Loader.java:498)

    at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:194)

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

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

    at net.minecraft.client.main.Main.main(Main.java:112)

    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 net.minecraft.launchwrapper.Launch.launch(Launch.java:134)

    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

    Caused by: java.lang.NoSuchMethodException: com.mmg.candymod.items.ItemBlockSugarCrystals.<init>(net.minecraft.block.Block)

    at java.lang.Class.getConstructor0(Unknown Source)

    at java.lang.Class.getConstructor(Unknown Source)

    at cpw.mods.fml.common.registry.GameRegistry.registerBlock(GameRegistry.java:187)

    ... 41 more

     

     

    A detailed walkthrough of the error, its code path and all known details is as follows:

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

     

    -- System Details --

    Details:

    Minecraft Version: 1.7.2

    Operating System: Windows 7 (amd64) version 6.1

    Java Version: 1.7.0_25, Oracle Corporation

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

    Memory: 885738376 bytes (844 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

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

    FML: MCP v9.01-pre FML v7.2.116.1024 Minecraft Forge 10.12.0.1024 4 mods loaded, 4 mods active

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

    FML{7.2.116.1024} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed->Pre-initialized

    Forge{10.12.0.1024} [Minecraft Forge] (forgeSrc-1.7.2-10.12.0.1024.jar) Unloaded->Constructed->Pre-initialized

    cm{0.1} [cm] (bin) Unloaded->Constructed->Errored

    #@!@# Game crashed! Crash report saved to: #@!@# C:\Minecraft\Modding\Candy_1.7.2\eclipse\.\crash-reports\crash-2014-03-28_11.10.22-client.txt

     

     

     

    [edit again] Okay.  Digging around I found out that the problem was that the compiler was looking for a Block argument in the constructor.  I changed it to the following and it works like a dream:

     

     

    public ItemBlockSugarCrystals(Block block1) {
    	super(block1, block1);
    	// TODO Auto-generated constructor stub
    }
    

     

  4. Progress continues, and thank you for your patience.

     

    So, I figured out the best way to cancel it if the stacks aren't exactly right (item and size) was to create a class that implemented IRecipe, and it works like a charm.  I'm still using the ItemCraftedEvent (After fixing the loop...I feel like an idiot sometimes, I should have caught that, especially considering it is only a 2 slot recipe, meaning a crafting table isn't even nessicary) to decrease the stack size by the additional 15 (Also should have caught that).  Only thing left is getting the GUI to show the actual stack sizes and not what it thinks they should be :-/

     

     

    @SubscribeEvent
    public void itemCrafted(ItemCraftedEvent evt){
    	if (!evt.player.worldObj.isRemote){
    		//System.out.println("ItemCrafted Called");
    		if(evt.crafting.getItem() == CustomItem.cannonFuse){
    			for (int i = 0; i < evt.craftMatrix.getSizeInventory(); i++){
    				if(evt.craftMatrix.getStackInSlot(i) != null){
    					if (evt.craftMatrix.getStackInSlot(i).stackSize >= 15 && evt.craftMatrix.getStackInSlot(i).getItem() == Items.string){
    						evt.craftMatrix.decrStackSize(i, 15);
    					}
    				}
    			}
    		}
    	}
    	this.sendContainerAndContentsToPlayer(evt.player.openContainer, evt.player.openContainer.inventoryItemStacks);
    }
    
    @Override
    public void sendContainerAndContentsToPlayer(Container var1, List var2) {
    	// TODO Auto-generated method stub
    	var1.detectAndSendChanges();
    }
    

     

     

    This almost did the trick, it takes away 16 strings but now it is only showing that it took away 15 strings in the GUI.  Kind of the exact opposite problem from what I had before.  I'm certain that I'm calling detectAndSendChanges wrong, or at the wrong time, or in the wrong listener...I make things way more complicated than they need to be...lol

     

    Anyway.  Thank you for being so very patient with me.  I'm gonna continue to try and hammer this out after I make breakfast for the family, but any advice you can offer is greatly appreciated.  Applauds and Thank You to both of you :D

     

    [edit] Okay.  I'm completely lost now :-/

     

     

    package com.mmg.cannon.recipes;
    
    import net.minecraft.inventory.InventoryCrafting;
    import net.minecraft.item.ItemStack;
    import net.minecraft.item.crafting.IRecipe;
    import net.minecraft.world.World;
    
    public class CustomShapelessRecipe implements IRecipe {
    
    public ItemStack result;
    public ItemStack[] ingredients;
    
    public CustomShapelessRecipe(ItemStack var1, ItemStack[] var2){
    	this.result = var1;
    	this.ingredients = var2;
    }
    
    @Override
    public boolean matches(InventoryCrafting var1, World var2) {
    	// TODO Auto-generated method stub
    		int count = 0;
    		for(int i = 0; i < var1.getSizeInventory(); i++)
    		{
    			ItemStack stack = var1.getStackInSlot(i);
    			if(stack != null)
    			{
    				for(int j = 0; j < ingredients.length; j++){
    					if (stack.getItem() == ingredients[j].getItem() && stack.stackSize >= ingredients[j].stackSize){
    						count++;
    					}
    				}
    			}
    		}
    		if (count == ingredients.length) System.out.println("Valid Recipe " + result);
    		return count == ingredients.length;
    }
    
    @Override
    public ItemStack getCraftingResult(InventoryCrafting var1) {
    	// TODO Auto-generated method stub
    	return result;
    }
    
    @Override
    public int getRecipeSize() {
    	// TODO Auto-generated method stub
    	return 0;
    }
    
    @Override
    public ItemStack getRecipeOutput() {
    	// TODO Auto-generated method stub
    	return null;
    }
    
    }
    

     

     

    It works fine the first time I craft the fuses, but then for some reason the result stacksize is set to 0, and the fuses I just crafted stacksize is set to 0.  I'm not really sure what I've done wrong...Really starting to think trying to make fuses this way is a bad idea...lol

  5. Makes sense.  So I figured out how to create the event handler, and have it registered.  So that much is out of the way.

     

    I have the listener in place

     

     

     

    @SubscribeEvent
    public void itemCrafted(ItemCraftedEvent evt){
    	if (!evt.player.worldObj.isRemote){
    		System.out.println("ItemCrafted Called");
    		if(evt.crafting.getItem() == CustomItem.cannonFuse){
    			for (int i = 0; i < 10; i++){
    				if(evt.craftMatrix.getStackInSlot(i) != null){
    					if (evt.craftMatrix.getStackInSlot(i).stackSize >= 16 && evt.craftMatrix.getStackInSlot(i).getItem() == Items.string){
    						evt.craftMatrix.decrStackSize(i, 15);
    					} else {
    						//evt.setCanceled(true);
    					}
    				}
    			}
    		}
    	}
    }
    

     

     

     

    First point of interest.  Is that the most efficient way to do that?  Is this going to cause conflict with things like NEI?

     

    Second point of interest.  The stack is decreased, but it doesn't show on the crafting table.  The item amount is decreased when I return the strings to my inventory, however.  How should I refresh this?

     

    Third point of interest.  The evt.setCanceled is commented out because it crashed the game.  How should I tell the listener not to craft the item?

     

    Sorry for sounding so needy.  Usually I can find all the answers I need on Google, but sometime my Google-Fu is not strong.  Thanks for all the help :)

  6.  

     

    GameRegistry.addShapelessRecipe(new ItemStack(CustomItem.cannonFuse, 16), new Object[]{new ItemStack(Items.string, 16), new ItemStack(Items.gunpowder)});
    

     

     

     

    Obviously didn't work.  I'm trying to get the recipe to each 16 strings and 1 gunpowder to return 16 fuses.  Is there an easy way to do this?

  7. Hey.  Know I'm replying to a solved thread, but I have a question about the solution.

     

    Most of it makes sense, but I'm unclear as to what function 149730_j is checking (which is probably why my blocks are still all facing the same direction).  Also not really sure why we use the value "2" for the flag, but I'm sure that's something internal that I don't really need to know.

     

    Anyway.  Some clarification on the function would be great so I can troubleshoot the mod that I'm working on :)

     

    Thank you.

     

    [edit]  Okay, I figured it out.  Stored the block's metadata a bit differently:

     

     

     

    	int l = MathHelper.floor_double((double)(entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
    	world.setBlockMetadataWithNotify(x, y, z, l, 2);
    

     

     

     

    Then my Render class I modified as follows:

     

     

     

        @Override
        public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) {
        	TileEntityCannonEntity cannonTile = (TileEntityCannonEntity)te;
        	int direction = te.getWorldObj().getBlockMetadata(te.xCoord, te.yCoord, te.zCoord);
        	if (direction == 3) direction = 1;
        	else if (direction == 1) direction = 3;
        	else if (direction == 0) direction = 2;
        	else if (direction == 2) direction = 0;
    	GL11.glPushMatrix();
        GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
    	ResourceLocation textures = (new ResourceLocation(Strings.MODID + ":textures/models/Cannon.png")); 
    	Minecraft.getMinecraft().renderEngine.bindTexture(textures);
    	GL11.glPushMatrix();
    	GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
    	GL11.glRotatef(direction * 90.0F, 0.0F, 1.0F, 0.0F);
    	this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
    	GL11.glPopMatrix();
    	GL11.glPopMatrix();
        }
    

     

     

     

    And it works like a...magical...something...that works...working...

     

    Anyway.  Thanks for pointing me in the right direction :D

  8. I think I figured it out.  My trace of the Owner value on the mob came up with Player followed by an incrementally larger number.  I think it is because I am in a developer environment.  It never even occurred to me that I never actually login when I'm testing my mod. 

  9. I've been looking through the EntityWolf class, and I see where it sets the wolf to Tame, but I can't figure out how it knows what player has tamed it.

     

    In my mob, I'm certain I could just pass the EntityPlayer along, but doesn't that change when the player logs out and logs back in again?

     

    Anyway.  Any ideas how I can tie a player to an instance of an entity?

     

    [edit] It took some digging, but I found the line

     

    this.setOwner(par1EntityPlayer.getCommandSenderName());

     

    [edit again] Bah!

     

    Used that method to set the owner of my mob, and when I logged in and out EntityPlayer.getCommandSenderName() was a different value.  Is there any static value that follows the player?

  10. This is probably just me not knowing enough about Java, but I'm trying to get some custom actions to take place when the player collects the item from my crafting table.  I figure slotClicked is the method that I want to use, but the trace I have in place calls twice when I grab the item from the table.

     

     

    	public ItemStack slotClick(int par1,int par2,int par3, EntityPlayer player)
    {
    	ItemStack r = super.slotClick(par1, par2, par3, player);
    	if (par1 == 0 && r != null){
    		Item crafted = r.getItem();
    		if (crafted instanceof SummonerItem){
    			System.out.println("Summoner Item Result");
    		} 
    	}
    	this.onCraftMatrixChanged(this.craftingMatrix);
    	return r;
    }	

     

     

    Is the method that I am using, and I get my trace twice.

  11. Don't know what was wrong, but I found a much better tutorial for creating custom containers:

     

    http://www.minecraftforum.net/topic/1959857-162-advanced-minecraft-forge-modding-tutorial-2-inventories/

     

    more of a step by step of what the different methods are doing rather than the "here is the code" of the other tutorial I found.  Works like a charm, and I'm ready to start tweaking it to do what I want it to do :)

  12. Kind of following the tutorial on Containers and GUI, only really changing the names of certain things so that when I dig down into the code and start experimenting I can turn it into my final product.  I'm pretty sure I copied everything right, but I might not have.  Anyway I'm getting a null pointer exception, and not really sure where it is coming from. 

     

    Main Mod

     

    package summoner;
    
    import summoner.blocks.FusionTable;
    import summoner.items.PigEssence;
    import summoner.tileentities.TileEntityFusionTable;
    import net.minecraft.block.Block;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraftforge.common.MinecraftForge;
    import cpw.mods.fml.common.Mod;
    import cpw.mods.fml.common.Mod.EventHandler;
    import cpw.mods.fml.common.Mod.Instance;
    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.network.NetworkRegistry;
    import cpw.mods.fml.common.registry.GameRegistry;
    
    @Mod(modid="SummonerModID", name = "Summoner", version = "0.0.0")
    @NetworkMod(clientSideRequired=true, serverSideRequired=false)
    public class Summoner {
    
    @Instance(value = "SummonerModID")
    public static Summoner instance;
    
    @SidedProxy(clientSide="summoner.client.ClientProxy", serverSide="summoner.CommonProxy")
    public static CommonProxy proxy;
    
    @EventHandler
    public void preInit(FMLPreInitializationEvent event){
    	//Stub Method
    }
    
    @EventHandler
    public void load(FMLInitializationEvent event){
    	proxy.registerRenderers();
    	MinecraftForge.EVENT_BUS.register(new SummonerLivingDrops());
    	GameRegistry.registerBlock(fusionTable, "fusiontable");
    	GameRegistry.registerTileEntity(TileEntityFusionTable.class, "tileentityfusiontable");
    	NetworkRegistry.instance().registerGuiHandler(this, guihandler);
    	GameRegistry.addShapelessRecipe(new ItemStack(fusionTable), new ItemStack(Block.dirt));
    }
    
    @EventHandler
    public void postInit(FMLPostInitializationEvent event){
    	//Stub Method
    }
    
    public static final Block fusionTable = new FusionTable(500);
    public static final SummonerGuiHandler guihandler = new SummonerGuiHandler();
    }

     

     

    Block

     

    package summoner.blocks;
    
    import summoner.Summoner;
    import summoner.tileentities.TileEntityFusionTable;
    import net.minecraft.block.BlockContainer;
    import net.minecraft.block.material.Material;
    import net.minecraft.client.renderer.texture.IconRegister;
    import net.minecraft.creativetab.CreativeTabs;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.tileentity.TileEntity;
    import net.minecraft.util.Icon;
    import net.minecraft.world.World;
    
    import cpw.mods.fml.relauncher.Side;
    import cpw.mods.fml.relauncher.SideOnly;
    
    public class FusionTable extends BlockContainer {
    
    public FusionTable(int id) {
    	super(id, Material.rock);
    	setUnlocalizedName("fusiontable");
    }
    
    @SideOnly(Side.CLIENT)
    public static Icon topIcon;
    @SideOnly(Side.CLIENT)
    public static Icon bottomIcon;
    @SideOnly(Side.CLIENT)
    public static Icon sideIcon;
    
    @Override
    @SideOnly(Side.CLIENT)
    public void registerIcons(IconRegister icon){
    	topIcon = icon.registerIcon("summoner:fusiontabletop");
    	bottomIcon = icon.registerIcon("summoner:fusiontabletop");
    	sideIcon = icon.registerIcon("summoner:fusiontableside");
    }
    
    @Override
    @SideOnly(Side.CLIENT)
    public Icon getIcon(int side, int metadata){
    	if (side == 0){
    		return bottomIcon;
    	} else if (side == 1){
    		return topIcon;
    	} else {
    		return sideIcon;
    	}
    }
    
    @Override
    public void onBlockAdded(World world, int i, int j, int k){
    	super.onBlockAdded(world, i, j, k);
    	world.markBlockForUpdate(i, j, k);
    }
    
    @Override
    public void onBlockClicked(World world, int x, int y, int z, EntityPlayer player){
    	super.onBlockClicked(world, x, y, z, player);
    	System.out.println("Clicked a Fusion Table");
    }
    
    @Override
    public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player,
    		 int metadata, float par7, float par8, float par9){
    	//System.out.println("Activated a Fusion Table");
    
    	TileEntity tileEntity = world.getBlockTileEntity(x, y, z);
    	if (tileEntity == null || player.isSneaking()){
    		return false;
    	}
    
    	player.openGui(Summoner.instance, 0, world, x, y, z);
    	return true;
    }
    
    @Override
    public TileEntity createNewTileEntity(World world) {
    	// TODO Auto-generated method stub
    	return new TileEntityFusionTable();
    }
    
    }

     

     

    Tile Entity

     

    package summoner.tileentities;
    
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.inventory.IInventory;
    import net.minecraft.item.ItemStack;
    import net.minecraft.nbt.NBTTagCompound;
    import net.minecraft.nbt.NBTTagList;
    import net.minecraft.tileentity.TileEntity;
    
    public class TileEntityFusionTable extends TileEntity implements IInventory {
    
    private ItemStack[] inv;
    
    public TileEntityFusionTable(){
    	inv = new ItemStack[9];
    }
    
    @Override
    public void writeToNBT(NBTTagCompound par1){
    	super.writeToNBT(par1);
    
    	NBTTagList tagList = par1.getTagList("Inventory");
    	for (int i = 0; i < tagList.tagCount(); i ++){
    		NBTTagCompound tag = (NBTTagCompound)tagList.tagAt(i);
    		byte slot = tag.getByte("Slot");
    		if (slot >= 0 && slot < inv.length){
    			inv[slot] = ItemStack.loadItemStackFromNBT(tag);
    		}
    	}
    }
    
    @Override
    public void readFromNBT(NBTTagCompound par1){
    	super.readFromNBT(par1);
    
    	NBTTagList itemList = new NBTTagList();
    	for (int i =0; i < inv.length; i++){
    		ItemStack stack = inv[i];
    		if (stack != null){
    			NBTTagCompound tag = new NBTTagCompound();
    			tag.setByte("Slot", (byte)i);
    			stack.writeToNBT(tag);
    			itemList.appendTag(tag);
    		}
    		par1.setTag("Inventory", itemList);
    	}
    }
    
    @Override
    public int getSizeInventory() {
    	return inv.length;
    }
    
    @Override
    public ItemStack getStackInSlot(int slot) {
    	return inv[slot];
    }
    
    @Override
    public ItemStack decrStackSize(int slot, int amt) {
    	ItemStack stack = getStackInSlot(slot);
    	if (stack != null){
    		if (stack.stackSize <= amt){
    			setInventorySlotContents(slot, null);
    		} else {
    			stack = stack.splitStack(amt);
    			if (stack.stackSize == 0){
    				setInventorySlotContents(slot, null);
    			}
    		}
    	}
    	return stack;
    }
    
    @Override
    public ItemStack getStackInSlotOnClosing(int slot) {
    	ItemStack stack = getStackInSlot(slot);
    	if (stack != null){
    		setInventorySlotContents(slot, null);
    	}
    	return stack;
    }
    
    @Override
    public void setInventorySlotContents(int slot, ItemStack stack) {
    	inv[slot] = stack;
    	if (stack != null && stack.stackSize > getInventoryStackLimit()){
    		stack.stackSize = getInventoryStackLimit();
    	}
    }
    
    @Override
    public String getInvName() {
    	return "summoner.tileentites.tileentityfusiontable";
    }
    
    @Override
    public int getInventoryStackLimit() {
    	return 64;
    }
    
    @Override
    public boolean isUseableByPlayer(EntityPlayer player) {
    	return worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) == this && player.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 64;
    }
    
    @Override
    public void openChest() {
    
    }
    
    @Override
    public void closeChest() {
    
    }
    
    @Override
    public boolean isInvNameLocalized() {
    	// TODO Auto-generated method stub
    	return false;
    }
    
    @Override
    public boolean isItemValidForSlot(int i, ItemStack itemstack) {
    	// TODO Auto-generated method stub
    	return false;
    }
    
    
    }

     

     

    Container

     

    package summoner.containers;
    
    import summoner.tileentities.TileEntityFusionTable;
    import net.minecraft.entity.player.EntityPlayer;
    import net.minecraft.entity.player.InventoryPlayer;
    import net.minecraft.inventory.Container;
    import net.minecraft.inventory.Slot;
    import net.minecraft.item.ItemStack;
    
    public class FusionTableContainer extends Container {
    
    protected TileEntityFusionTable tileEntity;
    
    public FusionTableContainer(InventoryPlayer inventoryPlayer, TileEntityFusionTable te){
    	for (int i= 0; i < 3; i++){
    		for (int j = 0; j < 3; j++){
    			addSlotToContainer(new Slot(tileEntity, j + i * 3, 62 + j * 18, 18 + i * 18));
    		}
    	}
    
    	bindPlayerInventory(inventoryPlayer);
    }
    
    @Override
    public boolean canInteractWith(EntityPlayer entityplayer) {
    	// TODO Auto-generated method stub
    	return tileEntity.isUseableByPlayer(entityplayer);
    }
    
    protected void bindPlayerInventory(InventoryPlayer inventoryPlayer){
    	for (int i = 0; i < 3; i++){
    		for (int j = 0; j < 9; j++){
    			addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
    		}
    	}
    
    	for (int i = 0; i < 9; i++){
    		addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142));
    	}
    }
    
    @Override
    public ItemStack transferStackInSlot(EntityPlayer player, int slot){
    	ItemStack stack = null;
    
    	Slot slotObject = (Slot) inventorySlots.get(slot);
    
            //null checks and checks if the item can be stacked (maxStackSize > 1)
            if (slotObject != null && slotObject.getHasStack()) {
                    ItemStack stackInSlot = slotObject.getStack();
                    stack = stackInSlot.copy();
    
                    //merges the item into player inventory since its in the tileEntity
                    if (slot < 9) {
                            if (!this.mergeItemStack(stackInSlot, 0, 35, true)) {
                                    return null;
                            }
                    }
                    //places it into the tileEntity is possible since its in the player inventory
                    else if (!this.mergeItemStack(stackInSlot, 0, 9, false)) {
                            return null;
                    }
    
                    if (stackInSlot.stackSize == 0) {
                            slotObject.putStack(null);
                    } else {
                            slotObject.onSlotChanged();
                    }
    
                    if (stackInSlot.stackSize == stack.stackSize) {
                            return null;
                    }
                    slotObject.onPickupFromSlot(player, stackInSlot);
            }
    
    	return stack;
    }
    
    }
    

     

     

    Gui

     

    package summoner.gui;
    
    import org.lwjgl.opengl.GL11;
    
    import summoner.containers.FusionTableContainer;
    import summoner.tileentities.TileEntityFusionTable;
    
    import net.minecraft.client.gui.inventory.GuiContainer;
    import net.minecraft.entity.player.InventoryPlayer;
    import net.minecraft.inventory.Container;
    import net.minecraft.util.ResourceLocation;
    import net.minecraft.util.StatCollector;
    
    public class FusionTableGUI extends GuiContainer {
    
    public FusionTableGUI(InventoryPlayer inventoryPlayer, TileEntityFusionTable tileEntity) {
    	super(new FusionTableContainer(inventoryPlayer, tileEntity));
    }
    
    @Override
    protected void drawGuiContainerForegroundLayer(int param1, int param2) {
    	fontRenderer.drawString("Fusion Table", 8, 6, 4210752);
    	fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, ySize - 96 + 2, 4210752);
    }
    
    @Override
    protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
    	// TODO Auto-generated method stub
    	//GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
    	this.mc.renderEngine.bindTexture(guiTest);
    	int x = (width - xSize) / 2;
    	int y = (height - ySize) / 2;
    	this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
    }
    
    private ResourceLocation guiTest = new ResourceLocation("gui/guiTest.png");
    
    
    
    }

     

     

    There were two methods in the Tile Entity that were implemented but not covered in the tutorial, but I'm pretty sure they aren't being called.  My texture path might not be right, but I also tried "textures/gui/guiTest.png" and "summoner/textures/gui/guiTest.png".  I'm not extremely Java savy, but I know my way around.  Mostly I just mess with code to figure out how it works (when it works).  Any help is greatly appreciated.  Thank you.

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.