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

ShetiPhian

Members
  • Posts

    198
  • Joined

  • Last visited

Everything 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-10.13.1.1210-new/start Illegal entry in Gradle Dependencies: E:/Programs/eclipse/unresolved dependency - forgeBin 1.7.10-10.13.1.1210-new EDIT: 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) EDIT2: 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(); singleItem.setItemDamage(metadata); String stackName = singleItem.getUnlocalizedName(); if (!stackNames.contains(stackName)) { stackNames.add(stackName); stackList.add(singleItem); } } } else { stackList.add(dictionaryItemStack); } 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? EDIT: 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. 1.6 Values.blockEnderTank = new BlockEnderTank(idEnderTank); GameRegistry.registerBlock(Values.blockEnderTank, ItemBlockEnderTank.class, "blockEnderTank"); Values.itemEnderBucket = new ItemEnderBucket(idEnderBucket - 256); GameRegistry.registerItem(Values.itemEnderBucket, "itemEnderBucket"); 1.7 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. Tessellator.instance.draw(); GL11.glPushMatrix() <your render code> GL11.glPopMatrix() FMLClientHandler.instance().getClient().getTextureManager().bindTexture(TextureMap.locationBlocksTexture); // This is required or the textures will be messed up. Tessellator.instance.startDrawingQuads(); 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. return Items.bone The Blocks.class and Items.class have all the vanilla blocks and items.
  7. 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
  8. 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 this.model.rotateCube(((TileEntityBlockCrafter)te).rotation);
  9. 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);
  10. removeBlockByPlayer is now removedByPlayer You need to create a language file (make sure its UTF-8 encoded) assets/<modID>/lang/<langID>.lang 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: Block.setBlockName("unlocalized_block_name"); Item.setUnlocalizedName("unlocalized_item_name"); To send to player: entityPlayer.addChatMessage(new ChatComponentTranslation("msg.message_name.txt"));
  11. 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: @EventHandler public void load(FMLInitializationEvent event) { VillagerTradeHandler.INSTANCE.load(); } public class VillagerTradeHandler implements IVillageTradeHandler { public static VillagerTradeHandler INSTANCE = new VillagerTradeHandler(); public void load() { VillagerRegistry.instance().registerVillageTradeHandler(1, this); VillagerRegistry.instance().registerVillageTradeHandler(2, this); } @Override public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random) { switch (villager.getProfession()) { case 1: manipulateLibrarianTrades(recipeList); break; case 2: manipulateEnchanterTrades(recipeList); break; } } 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))); } } }
  12. 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.
  13. 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!"
  14. 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) 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.
  15. 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.
  16. Some quick info Line From Mod Localization File: info.tank.header.msg=\u00A76-- Tank Data -- Line In Code: (triggered in onBlockActivated) entityPlayer.addChatMessage(StatCollector.translateToLocal("info.tank.header.msg")); Problem: 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.
  17. This will bind the blocks atlas this.mc.func_110434_K().func_110577_a(TextureMap.field_110575_b); This will bind the items atlas this.mc.func_110434_K().func_110577_a(TextureMap.field_110576_c); 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.startDrawingQuads(); 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); tessellator.draw(); } To use this.mc.func_110434_K().func_110577_a( resource location of wanted texture ); drawTexture(this.xPosition+3, this.yPosition+3, 16, 16); Edit: 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.
  18. 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.
  19. Do NOT edit the jar. Forge has an installer, use it.
  20. Code doesn't always decompile cleanly and Minecraft isn't the best written. You can ignore these, errors would be from a bad decompile and you need to do it again, Most warnings are pre-ignored with filters, by disabling them a clean minecraft decomple has about 3500 warnings
  21. 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() EDIT: 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") example: dispenser = (new Dispenser(2000)).setHardness(3.5F).setStepSound(soundStoneFootstep).setUnlocalizedName("dispenser").func_111022_d("dispenser"); or add it here: protected Dispenser(int par1) { super(par1); func_111022_d("dispenser"); this.setCreativeTab(null); }
  22. I missed the 1.5.2 part, noticed the suggestion of using setUnlocalizedName for textures and thought, oh no thats going to cause problems in the future. There has already been several people who have ignored the new functions due to the names, just figured it was happening again
  23. .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")
  24. 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:
×
×
  • Create New...

Important Information

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