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


  • Posts

  • Joined

  • Last visited

Posts posted by ShetiPhian

  1. This was too long to post on cpw's twitter.


    If the user libraries (desktop, documents, etc.) are relocated via the windows supported method (properties/location) gradlew places the files in the wrong folder.

    Previous versions placed the .gradle folder in "C:\Users\<username>\" but in 1210-new its placed in "F:\User Folders" (where I moved the user libraries)

    The new location causes the folder not to be found because its looking in the old place:

    Illegal entry in Gradle Dependencies: C:/Users/<username>/.gradle/caches/minecraft/net/minecraftforge/forge/1.7.10-

    Illegal entry in Gradle Dependencies: E:/Programs/eclipse/unresolved dependency -  forgeBin 1.7.10-




    I deleted both .gradle folders and created a junction point from the old location to the new one, this did not work.

    But deleting both folders again and using a junction point to point the new location back to the old one did work (at least to get a usable environment, haven't compiled anything yet)



    Mods do correctly build with the junction point relocating the folder back to the proper place.


    While junction points are a usable option, I'm sure you don't want to start explaining how to create them to anyone who moved the user libraries.  ;)

  2. Looks like the wall of text caused the problem to be lost :)


    Say I have a recipe that looks like this


    Plank | Plank | Plank

    Stick | Plank | Plank


    With a normal recipe just using "plankWood" works perfectly, (in fact I make heavy use of it in my other recipes)


    But what I'm trying to do is restrict mixing (because the planks used change the look of the block), the three planks on the top must be the same type, and the two on the bottom must be the same type. But what planks you use for each type are up to you.


    I needed to register a recipe for every combo, and to do that and support mods I needed to grab the list of planks from the ore dictionary.

    While getting "plankWood" from the OreDictionary does give me all of the planks, any registered using the wild card value are merged into one item.


    The issue I was having was getting the separate planks from the merged item.

    The method that worked the best was client only, and the alternatives had several flaws.



    I did decide on making my own crafting block:

    - it gets around my issue

    - is simple to use

    - doesn't register a ton of recipes.

    Seriously with forestry in I was just over 1000 per block type and I had two. I don't know what Minecraft's limit is but a single mod adding over 2000 recipes sounds wrong :)

  3. My block uses the texture of the planks used in the recipe. This requires the planks used to be the same ones.

    I want to support mod added planks, and for the most part it already works well.


    The issue I've ran into involves planks registered with OreDictionary.WILDCARD_VALUE as its damage.


    If I use it as is, mixed planks can be used and I get several recipes with an output only uses the first plank texture.

    If I use only the first plank I get rid of the extra recipes but still only have one of the many planks used.

    Adding all 16 metadata results in many extra unused blocks getting a recipe.


    What worked well (at first) was getting the sub items from the item. This worked perfectly..... until I launched a server and realized getSubItems is client side only :(


    What I'm currently doing is checking the unlocalized name:

    List<ItemStack> stackList = new ArrayList<ItemStack>();
    if (dictionaryItemStack.getItemDamage() == OreDictionary.WILDCARD_VALUE) {
        List<String> stackNames = new ArrayList<String>();
        for (byte metadata = 0; metadata < 16; metadata++) {
            ItemStack singleItem = dictionaryItemStack.copy();
            String stackName = singleItem.getUnlocalizedName();
            if (!stackNames.contains(stackName)) {
    } else {


    This results in a few extra recipes if the metadata has a different name but is unused, and could result in missing ones due to having the same name.


    I looked at using ItemCraftedEvent but I don't seem to be able to change the output until crafting is attempted, this results in the output icon not displaying changes and gives the appearance mixed planks can be used.


    So basically is there a way to use the Ore Dictionary in recipes and flag blocks that must be the same? or is there a cleaner/better way to do what I'm doing now?



    My other option is making a crafting block that would use only the one planks.

    And the more I think about it this might be the better way to go, because adding many mods with several planks would result in a massive amount of recipes.

  4. Has anyone gotten a world with a 1.6 version of their mod to correctly load in an 1.7 environment?


    Mine works as it should with a fresh 1.7 world, but if I load a 1.6 world it acts up.


    - The Block is removed from the world.

    - The ItemBlock is not using the blocks renderer, rather its using the standard item renderer.

    - Item.getItemFromBlock() returns null, indicating the block has no item mapped to it anymore.


    It should work, the modid and registered block name are identical, and so are the class names.


    Even the code doing the registration is basically identical.


    Values.blockEnderTank = new BlockEnderTank(idEnderTank);
    GameRegistry.registerBlock(Values.blockEnderTank, ItemBlockEnderTank.class, "blockEnderTank");
    Values.itemEnderBucket = new ItemEnderBucket(idEnderBucket - 256);
    GameRegistry.registerItem(Values.itemEnderBucket, "itemEnderBucket");


    Values.blockEnderTank = new BlockEnderTank();
    GameRegistry.registerBlock(Values.blockEnderTank, ItemBlockEnderTank.class, "blockEnderTank");
    Values.itemEnderBucket = new ItemEnderBucket();
    GameRegistry.registerItem(Values.itemEnderBucket, "itemEnderBucket");


    Reading the conversion output, it only has 3 entries for my stuff, everything else is minecraft blocks and items.

    Found item id mismatch EnderTanks:itemEnderBucket : 4096 5380

    Found item id mismatch EnderTanks:blockEnderTank : 165 2380

    Injecting new block EnderTanks:blockEnderTank


  5. Before ISimpleBlockRenderingHandler is called the tessellator is started, the model render commands attempt to start the tessellator.

    This causes the crash.


    By adding a tile entity to your block you can use TileEntitySpecialRenderer to solve the problem.


    Or since your renderer is simple you can stop the tessellator before your code, and start it again after your code.


    <your render code>
    FMLClientHandler.instance().getClient().getTextureManager().bindTexture(TextureMap.locationBlocksTexture); // This is required or the textures will be messed up.


    This has drawbacks, GL11.glRotatef and GL11.glScalef do not work as expected, both of move the model instead.


    There might be a better way to render models without tile entities but this is the only one I know of.


    Bantasaurusrex is correct GL11.glPushMatrix() and GL11.glPopMatrix() are required, otherwise any models drawn after yours messes up.

  6. As far as adding sounds go you do it via json file: http://www.minecraftforge.net/forum/index.php?topic=15406.0


    You can't do a whole lot with sounds yet though,


    Currently these events are never posted:

    PlayBackgroundMusicEvent, PlaySoundEffectEvent, PlaySoundEffectSourceEvent, PlaySoundEvent, PlaySoundSourceEvent, PlayStreamingEvent, PlayStreamingSourceEvent, SoundEvent, and SoundResultEvent


    SoundLoadEvent and SoundSetupEvent are posted to the forge event bus in SoundManager

  7. No need to save it, its just visual.

    Now I've long replaced my Techne models with OBJ's so lets see if I can get this from memory.


    In TileEntityBlockCrafter.java add:

    public float rotation; // you want this a float for better speed control


    In ModelBlockCrafter.java add:

    public void rotateCube(float rotation)
        this.CenterCube.rotateAngleY = rotation;


    Now in TileEntityBlockCrafterRenderer.java before this.model.render:

    ((TileEntityBlockCrafter)te).rotation += 0.25F; // Change this number to change speed
    if (((TileEntityBlockCrafter)te).rotation > 180) ((TileEntityBlockCrafter)te).rotation = -180F; // I believe Techne uses -180 to 180, instead of 0 to 360

  8. Save the rotation value in the TileEntity. (not static)


    Have the renderer read the value from the TileEntity, edit it as needed, and save back.


    In my TileEntity:

    public float rotation;


    In my Renderer:

    tile.rotation += 0.25F;

    if (tile.rotation > 360) tile.rotation = 0F;

    GL11.glRotatef(tile.rotation, 1F, 0F, 0F);


  9. removeBlockByPlayer is now removedByPlayer



    You need to create a language file (make sure its UTF-8 encoded)



    Example File: en_US.lang

    tile.unlocalized_block_name.name=Localized Block Name
    item.unlocalized_item_name.name=Localized Item Name
    msg.message_name.txt=Displayed Message


    To use names on blocks and items:



    To send to player:

    entityPlayer.addChatMessage(new ChatComponentTranslation("msg.message_name.txt"));

  10. implement IVillageTradeHandler on a class (I called mine VillagerTradeHandler)


    add this in your FMLInitializationEvent

    VillagerRegistry.instance().registerVillageTradeHandler(<villagerID>, <class implementing IVillageTradeHandler >);


    In manipulateTradesForVillager you just need to use villager.getProfession() to make sure your editing the villager you want.

    Then use recipeList.add(new MerchantRecipe(<itemstack wanted by the villager>, <itemstack recieved by the player>)); to add the trade.


    Using EntityVillageraddDefaultEquipmentAndRecipies you can figure out what number is for what profession.


    Trimmed version of my code:

    public void load(FMLInitializationEvent event)

    public class VillagerTradeHandler implements IVillageTradeHandler
    public static VillagerTradeHandler INSTANCE = new VillagerTradeHandler();
    public void load()
    	VillagerRegistry.instance().registerVillageTradeHandler(1, this);
    	VillagerRegistry.instance().registerVillageTradeHandler(2, this);
    public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random)
    	switch (villager.getProfession()) {
    		case 1:
    		case 2:
    private void manipulateLibrarianTrades(MerchantRecipeList recipeList)
    	Item itemMain = Values.itemMain;
    	if (itemMain != null) {
    		recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald), new ItemStack(itemMain, 1, 11)));
    		recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald), new ItemStack(itemMain, 1, 15)));
    private void manipulateEnchanterTrades(MerchantRecipeList recipeList)
    	Item itemEquipable = Values.itemEquipable;
    	if (itemEquipable != null) {
    		recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 2), new ItemStack(itemEquipable, 1, 0)));
    		recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 3), new ItemStack(itemEquipable, 1, 1)));

  11. release a ForgeGradle version and Forge version for each update


    I figure your asking for both the old way (Scripts and Commands) and the new way (Gradle)


    Simply that will never happen.

    The switch to gradle was not because the developers felt like it, the change was necessary continue forward.

  12. My guess is something is not downloading correctly.


    I was using 964 then switched to 997 (to take a peak at 1.7)

    I returned to 964 to work on a few things while names got resolved.


    Today I attempted to install 1012 and got the same error as you, so I tried 1011, 1010, 997 (because it worked before), and 967 still got the same error.


    forgeSrc-1.7.2-..... doesn't seem to be correctly building, all the packages are empty and the class files are dumped into the default package.



    964 still works though, sadly you cant use it to grab a 1.7.2 version of forge "This version of ForgeGradle only works with Minecraft 1.6.4!"

  13. BlockIDs are not obsolete, you just have no control of or access to them anymore, and they can also be different per world.

    There is still an internal array thus still a limit. (32000 items, including the 4096 blocks)

    'Unlimited' never exists, there will ALWAYS be a limit, this one is in place based off the save format.

    Don't use more then you need ;)



    As for rendering, you'll need to code a custom renderer.

    No need to code it from scratch, you could copy the minecraft code into your own render class and make the needed changes to it.

  14. Because StatCollector.translateToLocal(string) is what blocks and items used ;)

    It works perfectly, except for color codes in a release environment, so I never noticed the issue while debugging.


    Is that object array a list of approved characters?


    after setting up a break point and stepping through the code I don't believe that will help.



    Oh well, I can hard code the colors, I only had them in the localization just in case someone wanted to change them.

  15. Some quick info


    Line From Mod Localization File:

    info.tank.header.msg=\u00A76-- Tank Data --


    Line In Code: (triggered in onBlockActivated)





    I've had the color code in the localization file since 1.5 and it has worked but in 1.6 it acts up only when compiled and zipped.


    In eclipse it properly displays

    "-- Tank Data --" and its orange


    but put it into a clean Minecraft & Forge (818) install it displays

    "\u00A76-- Tank Data --" and its white


    For some reason Eclipse uses the color code, but a release environment reads it as plain text.

  16. This will bind the blocks atlas



    This will bind the items atlas



    After binding one of those you can use an icon with drawTexturedModelRectFromIcon


    That only seems to work with the default blocks and items though, as it wouldn't draw the correct icon for any of my stuff.

    I figure there is another atlas for mod stuff but with nothing named I couldn't find it.


    So I wrote a simple work around. (its based off of drawTextureModelRectFromIcon)

    * Draws a texture at the given location, with the specified size
    * @param x Location X
    * @param y Location Y
    * @param w Draw Width
    * @param h Draw Height
    public void drawTexture(int x, int y, int w, int h)
        GL11.glColor4f(1F, 1F, 1F, 1F);
        Tessellator tessellator = Tessellator.instance;
        tessellator.addVertexWithUV(x + 0, y + h, this.zLevel, 0D, 1D);
        tessellator.addVertexWithUV(x + w, y + h, this.zLevel, 1D, 1D);
        tessellator.addVertexWithUV(x + w, y + 0, this.zLevel, 1D, 0D);
        tessellator.addVertexWithUV(x + 0, y + 0, this.zLevel, 0D, 0D);



    To use

    this.mc.func_110434_K().func_110577_a(  resource location of wanted texture  );
    drawTexture(this.xPosition+3, this.yPosition+3, 16, 16);




    Forgot to point out a few things.


    You do not need a new texture, just reuse your current one.


    The size field in drawTexture is the size you want it to be drawn not the size of the icon, the icon itself is scaled to this size.

  17. Would have responded sooner had I been at my PC, anyway...


    Your post does not mention the installer, and sounds very much like you tried the old way,

    but lest skip that and get to problem solving.



    I figured I'd give the new launcher and Forge Installer a go (hadn't yet used either)

    So starting from a clean .minecraft folder (never used it, was using multimc)

    I ran the Forge installer (build 789) it failed of course but I wasn't sure if it installed everything or not so I figured I try it :)

    Into the Minecraft launcher, created a new 1.6.2 profile and ran it once.

    I ran the Forge installer.

    Opened the Minecraft folder and dropped my freshly compiled mod in

    Launched the profile,

    Everything worked :)



    So for your problem, try cleaning out the .minecraft folder and start fresh.

    If that doesn't work try one mod at a time, one must be causing the problem.

  18. I haven't looked at your block yet, but I believe these are the functions you want for your mob.


    func_110143_aJ()  should replace gethealth()

    func_110138_aP() should be getMaxhealth()



    Fixed your block,

    the dispenser face uses the block icon name, there is two places to easily fix this.


    when you set up your block make sure you have .func_111022_d("dispenser")


    dispenser = (new Dispenser(2000)).setHardness(3.5F).setStepSound(soundStoneFootstep).setUnlocalizedName("dispenser").func_111022_d("dispenser");


    or add it here:


    protected Dispenser(int par1)







  19. .setUnlocalizedName

    is for setting the name of your block that goes through the localization files so it can be displayed in the users current language (if provided)


    for Blocks the function you want is .func_111022_d("yourMod:textureName")

    by using it you set field_111026_f


    registerIcons gets the icon from func_111023_E which in turn reads it from field_111026_f (the one you set)



    Items go through a similar path but you use .func_111206_d("yourMod:textureName")

  20. I believe CPW said to get old versions working with the new launcher would require the changes to be back ported, and that wasn't going to happen.



    Found it:


    Despite what @Dinnerbone says modded 1.5.2 on the new launcher is a futile exercise. Don't bother..

    its how we have to handle mods in a multi version environment.. We're not gonna backport all this to 1.5.2..

  • Create New...

Important Information

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