• 0

    posted a message on Trying to Change Item Texture with NBT; Mod Fails to do so
    Quote from UpcraftLP»

    Why don't you just register the item variants using metadata? (like :0 has texture 1, :1 has texture 2 etc.)


    Because I might need the item's damage for durability or something like it.
    Quote from Choonster»

    You're calling ModelLoader.setCustomMeshDefinition, but then immediately overwriting that by calling ModelLoader.setCustomModelResourceLocation.


    Only call one of these methods for each Item.


    That seemed to work; thanks for the helpful tip! :D

    Posted in: Modification Development
  • 0

    posted a message on Dimensional Doors v2.2.4

    Are you ever going to port this mod to later versions such as 1.8 or 1.10?

    Posted in: Minecraft Mods
  • 0

    posted a message on Trying to Change Item Texture with NBT; Mod Fails to do so

    So Minecraft 1.11 is about to be released, and I decided I'd make a mod for 1.10 before the corresponding Forge version is developed. Everything implemented into the mod seems to be working fine, but the one small issue I'm having is that I can't seem to get my ItemMeshDefinition class to work.


    The items are supposed to have textures like these (only 4 are listed examples):


    birthdaycake



    fruitpie_slice



    cupcake



    creampie

    But this is how they appear in the inventory:


    2016-09-28_19.58.09

    The holder for all the item variables:


     package toontownrecrafted.init;
    
    import java.util.ArrayList;
    import java.util.HashMap;
    
    import com.google.common.collect.Lists;
    import com.google.common.collect.Maps;
    import com.google.common.collect.ObjectArrays;
    
    import toontownrecrafted.ToontownRecrafted;
    import toontownrecrafted.items.GlobalItemMesh;
    import toontownrecrafted.items.ItemGeneral;
    import net.minecraft.block.material.Material;
    import net.minecraft.client.renderer.ItemMeshDefinition;
    import net.minecraft.client.renderer.block.model.ModelBakery;
    import net.minecraft.client.renderer.block.model.ModelResourceLocation;
    import net.minecraft.item.Item;
    import net.minecraft.item.ItemStack;
    import net.minecraft.util.ResourceLocation;
    import net.minecraftforge.client.model.ModelLoader;
    import net.minecraftforge.fml.common.registry.GameRegistry;
    import static toontownrecrafted.ToontownRecrafted.MODID;
    
    public class TTRC_Items 
    {
    	public static final Item general_item = addItem(new ItemGeneral(), "general_item");
    	
    	private static Item addItem(Item item, String internalName)
    	{
    		return GameRegistry.register(item.setUnlocalizedName(internalName).setRegistryName(internalName));
    	}
    	
    	private static void addItemRender(Item item)
    	{
    		ModelLoader.setCustomMeshDefinition(item, new GlobalItemMesh());
    		ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
    	}
    	
    	private static void addItemVariants(Item item, String[] variants)
    	{
    		int len = variants.length;
    		
    		ArrayList<ModelResourceLocation> resources = new ArrayList<ModelResourceLocation>();
    		
    		if(len > 0)
    		{
    			for(String variant : variants)
    			{
    				ModelResourceLocation model = new ModelResourceLocation(new ResourceLocation(ToontownRecrafted.MODID, variant), "inventory");
    				System.out.println("Added model variant: "+model);
    				resources.add(model);
    			}
    		}
    		ModelBakery.registerItemVariants(item, resources.toArray(new ModelResourceLocation[len]));
    	}
    	
    	public static final String[] toonupGags = {"tickle_feather", "megaphone", "lipstick", "bamboo_cane", "pixie_dust", "juggle_cubes", "high_dive"},
    								 trapGags = {"banana_peel", "rake", "marbles", "quicksand", "trapdoor", "tnt_tt", "railroad"},
    								 lureGags = {"1_dollar_bill", "small_magnet", "5_dollar_bill", "big_magnet", "hypno_goggles", "presentation"},
    								 soundGags = {"bikehorn", "whistle", "bugle", "aoogah", "elephant_trunk", "foghorn", "opera_voice"},
    					  			 throwGags = {"cupcake", "fruitpie_slice", "creampie_slice", "fruitpie", "creampie", "birthdaycake", "weddingcake"},
    					  			 squirtGags = {"squirt_flower", "water_glass", "squirt_gun", "seltzer_bottle", "fire_hose", "rain_cloud", "geyser"},
    					  			 dropGags = {"flower_pot_tt", "sandbag", "anvil_tt", "big_weight", "safe", "grand_piano", "toontanic"};
    	
    	public static final String[][] allGags = {toonupGags, trapGags, trapGags, lureGags, soundGags, throwGags, squirtGags, dropGags};
    	public static final Material[][] defaultGagMats = {{}, 
    													   {},
    													   {},
    													   {},
    													   {},
    													   {},
    													   {}};
    	
    	public static void registerRenders()
    	{
    		addItemRender(general_item);
    		addItemVariants(general_item, throwGags);
    		System.out.println("Registered item renders");
    	}
    }


    The ItemMeshDefinition class:


    package toontownrecrafted.items;
    
    import toontownrecrafted.ToontownRecrafted;
    import net.minecraft.client.renderer.ItemMeshDefinition;
    import net.minecraft.client.renderer.block.model.ModelResourceLocation;
    import net.minecraft.item.ItemStack;
    import net.minecraft.nbt.NBTTagCompound;
    import net.minecraft.util.ResourceLocation;
    import net.minecraftforge.client.model.ModelLoader;
    
    public class GlobalItemMesh implements ItemMeshDefinition
    {
     @Override
     public ModelResourceLocation getModelLocation(ItemStack stack) 
     {
     if(stack.hasTagCompound())
     {
     NBTTagCompound nbt = stack.getTagCompound();
     
     if(nbt.hasKey("ItemVariant"))
     {
     ModelResourceLocation variantModel = new ModelResourceLocation(new ResourceLocation(ToontownRecrafted.MODID, nbt.getString("ItemVariant")), "inventory");
     System.out.println("Found model: "+variantModel);
     return variantModel;
     }
     }
     System.out.println("Found no model location");
     return null;
     }
    
    }


    I'm a little confused as to why this is happening; I called the registerRenders() method in preInit(), the default item texture loads fine, and I can't seem to figure out what I'm doing wrong.

    Posted in: Modification Development
  • 0

    posted a message on [Mod now Released!] Disney's Toontown Online Mod for Minecraft - Discussion
    Quote from superevan214»

    But really, the creator of Toontown Rewritten commented on this, Bloxicon.


    Don't worry, I've got my own versions of the mod in the works: http://minecraft.curseforge.com/projects/toontown-on-minecraft

    The only available mod on that page is for Minecraft 1.6.4, but I'm working a version for 1.7.10 that I might release as an early alpha build. It's probably going to be experimental for a while, though; I don't know how many alpha or beta versions it's going to have.
    Posted in: Mods Discussion
  • 0

    posted a message on [Mod now Released!] Disney's Toontown Online Mod for Minecraft - Discussion
    Quote from meluvcheese22»

    Is there a server that uses this mod?


    I doubt it. This mod hasn't been updated in forever.
    Posted in: Mods Discussion
  • 0

    posted a message on ChickenBones Mods

    Is it possible to use ForgeMultipart dev in 1.6.4 modding environments? If so, how?

    Posted in: Minecraft Mods
  • 0

    posted a message on [Mod now Released!] Disney's Toontown Online Mod for Minecraft - Discussion

    i really love this mod are you gonna add more stuff?


    It might be a while before the mod gets updated, so be patient.

    Posted in: Mods Discussion
  • 0

    posted a message on ToonTown
    no but i would love to learn

    Sorry, but we can't let just anyone on the team unless they have some knowledge of coding or texturing or modeling.

    If you really want to learn Java, I suggest you look here for some tutorials: http://docs.oracle.com/javase/tutorial/
    Posted in: WIP Mods
  • 0

    posted a message on ToonTown
    i can help if you like

    Have you had any experience in Minecraft modding?
    Posted in: WIP Mods
  • 0

    posted a message on Five Nights At Freddy's 2 Mod v1.2 - Now with death images! Update!
    Quote from FastHawkTV»

    It's not a real cupcake?

    Nope. It's made of steel, aluminum, wires and fiberglass just like the rest of the characters.
    Posted in: Minecraft Mods
  • 0

    posted a message on Five Nights At Freddy's 2 Mod v1.2 - Now with death images! Update!
    Isn't the Cupcake technically an animatronic, too?
    Posted in: Minecraft Mods
  • 0

    posted a message on Gany's End - Miscellaneous ender themed additions!
    Where are all the versions of the mod for Minecraft 1.6.4?
    Posted in: Minecraft Mods
  • 0

    posted a message on ToonTown
    Quote from Craftertoon518»
    Ok thanks.

    You're welcome!
    Posted in: WIP Mods
  • 0

    posted a message on ToonTown
    Quote from Craftertoon518»
    I keep on trying to craft it but i don't think I'm doing it right. Can u send me a picture of how the crafting grid should look like? also, how do i get the lighter?

    http://minecraftrecipedesigner.com/creations/71035.png

    You can make Jellybeans from any Vanilla Minecraft Dye. There currently isn't a way to obtain the lighter, though the team and I could come up with some way to make it work.

    I'll keep you all updated!
    Posted in: WIP Mods
  • 0

    posted a message on ToonTown
    Quote from Craftertoon518»
    How can u make the dimension portal?

    You simply craft some Jellybean Blocks and place them in a Nether-Portal-like frame. You have to use the mod's "Custom Lighter", though.
    Posted in: WIP Mods
  • To post a comment, please or register a new account.