Jump to content

CarbonBasedGhost

Members
  • Posts

    29
  • Joined

  • Last visited

Everything posted by CarbonBasedGhost

  1. I'm not saying this is a bad idea but think of it this way, there are about 8 mods who use this and each uses it differently, the way it is used varies a moderate amount. It doesn't make sense to make an API (implemented in forge, a freestanding one is a different story) to support a varying underused system. There should be more time put into developing other things than this. If you want to take a crack at it I say it's worth a shot but I don't think at this time it makes sense for a forge developer to be doing this.
  2. I see this a bit far out of forge's intended reach as what can be used as heat is only done in a small collection of mods, it would make more sense for forge to support a macerator dictionary than this and even that sounds crazy. Also there would have to be some heat variable implemented and all the mods that use heat would have to support it and not all may want to use it.
  3. So I was making a core mod, I wanted to add something to simplify forge's furnace handling as I find it a bit bad as beginner modders seem to muck it up with if() statements making it a slight bit laggy when you put fuel with a lot of mods that add fuel installed. So I made this lightweight and easy to use FuelHandler that can accept blocks and items and output a fuel. I think this should be implemented into forge so beginning modders can have a more lightweight method of adding fuel, but I still think the fuel handler should stay for when modders want to experiment with NBT and metadata. Without further to do here it is: public class VinillaFurnaceFuelHandler implements IFuelHandler{ public static HashMap<Item, Integer> FurnaceFuel = new HashMap<Item, Integer>(); public class VinillaFurnaceFuelHandler implements IFuelHandler{ public static HashMap<Item, Integer> FurnaceFuel = new HashMap<Item, Integer>(); public static void RegisterFurnaceFuel(Item fuel, Integer burnTime){ FurnaceFuel.put(fuel, burnTime); } @Override public int getBurnTime(ItemStack fuel) { Item ItemInFuelSlot = fuel.getItem(); Integer BurnTime = FurnaceFuel.get(ItemInFuelSlot); if (BurnTime == null) return 0; else return BurnTime; } } And to add blocks you need this (I did the same for items just for consistency): public static void addItemFurnaceFuel(Item fuel, Integer burnTime){ VinillaFurnaceFuelHandler.RegisterFurnaceFuel(fuel, burnTime); } public static void addBlockFurnaceFuel (Block fuel, Integer burnTime){ VinillaFurnaceFuelHandler.RegisterFurnaceFuel(Item.getItemFromBlock(fuel), burnTime); } I hope this can be added to forge. Thanks for reading! CarbonBasedGhost
  4. So I have come across this problem multiple times and still have no solution. Is there anyway to get a Block from and ItemStack? This can be done for items by ItemStackInstance.getItem(); So is there anyway to do this with blocks?
  5. First off, I know how to code java so do not tell me to "go learn java" this should be exemplified in my code. My problem is simply how do I use a block as a furnace fuel? I came across the problem while making my core mod and thought I could find the answer here. So, this is the corresponding code but it registers items as furnace fuel: public class VinillaItemFurnaceFuelHandler implements IFuelHandler{ public static HashMap<Item, Integer> FurnaceFuel = new HashMap<Item, Integer>(); public static void RegisterFurnaceFuel(Item fuel, Integer burnTime){ FurnaceFuel.put(fuel, burnTime); } @Override public int getBurnTime(ItemStack fuel) { Item ItemInFuelSlot = fuel.getItem(); Integer BurnTime = FurnaceFuel.get(ItemInFuelSlot); if (BurnTime == null){ return 0; } else return BurnTime; } } Now I predict my problem with the upcoming code is I do not know how to get a Block for an ItemStack so if you know how to do so please say. public class VinillaItemFurnaceFuelHandler implements IFuelHandler{ public static HashMap<Item, Integer> FurnaceFuel = new HashMap<Item, Integer>(); public static void RegisterFurnaceFuel(Item fuel, Integer burnTime){ FurnaceFuel.put(fuel, burnTime); } @Override public int getBurnTime(ItemStack fuel) { //Here forward I am confused and do not know what to do Item ItemInFuelSlot = fuel.getItem(); //I need to get the Block Integer BurnTime = FurnaceFuel.get(ItemInFuelSlot); //Here forward I am not confused if (BurnTime == null){ return 0; } else return BurnTime; } } Thank You In Advanced, CarbonBasedGhost
  6. @Kwibble just repeating this in case he doesn't understand (you obviously understand) and if it had a special functionality you'd have to make separate blocks (at you level of knowledge)
  7. Personally I'd make a block with the onRightClickedMethod() then in that method I would put a switch statement testing for each dye (by ore dictionary) and then if it is x dye it changes to x color. This would need to be a tile entity though.
  8. this tutorial is awesome, but in the "Having fun 1" whenever I jump nothing happens. CODE: public class Boing { @SubscribeEvent(priority=EventPriority.HIGHEST, receiveCanceled=true) public void onEvent(LivingJumpEvent event) { // DEBUG if (event.entity instanceof EntityPlayer) { System.out.println("Boing"); } } }
  9. The title says it all is there a method that gets run when minecraft Loads. I am looking tom do this because I want to have a click sound happen when the game is loaded.
  10. So can anyone walk me though how to make my own damageable tool and how to make that tool damaged on crafting events.
  11. Hello, I am looking to make a tool and I was wondering if anyone could walk me through this class and tell me what does what and what to use when. Thanks in Advanced, CarbonBasedGhost
  12. Hi so I am not that good at adding textures and things of that nature to the code because in the past I have just been a code coder no textures and rendering. I have had people do that for me. But now that I have taken up minecraft modding I have had to have started taking this task upon myself. Well it has been going fine for me until now. I want to make a block that has different textures for each side and faces the way the player entity placed it. Can anyone help me out. Another things I should say is I am using this for a base block class. Thanks in advanced, CarbonBasedGhost
  13. So first go into your forge folder and - shift ctrl right click, and click open command window here. in there type "gradlew.bat setupDecompWorkspace eclipse" it will load for a minute or so then when it's done set your eclipse workspace to forge/eclipse. Note this is not the fabled Pahimar setup which is just as easy to setup but you are new so I wouldn't recommend it.
  14. So you seem to have little to none knowledge of either java or forge. There are thousands of differences between those versions and there is no possible way anyone would have made something to do that. NO WAY! In between that time variables where renamed things were completely redone and let's not forget we do not use item Ids anymore.
  15. I am not going to give you any code as if you can not figure this out yourself you cannot code but I will give you some resources and information. Thermal Expansion doesn't add RF. COFH Lib does. It is a medium large Library you put into your workspace. Here is https://github.com/KingLemming/CoFHLib COFH Lib.
  16. if (l == 0) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 2, 2); } if (l == 1) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 5, 2); } if (l == 2) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2); } if (l == 3) { par1World.setBlockMetadataWithNotify(par2, par3, par4, 4, 2); } if (par6ItemStack.hasDisplayName()) { ((TileHeatFurnace)par1World.getBlockTileEntity(par2, par3, par4)).setGuiDisplayName(par6ItemStack.getDisplayName()); } } I assume I can ignore all the return statements if I am making this a base class for all Blocks/Block Containers?
  17. [embed=425,349]if (par6ItemStack.hasDisplayName()) { ((TileHeatFurnace)par1World.getBlockTileEntity(par2, par3, par4)).setGuiDisplayName(par6ItemStack.getDisplayName()); }[/embed] Whats that doing?
  18. So I am making a Core mod for all of my future mods and I stumbled upon the problem of making a block that has sides change depending on how you place it (like the furnace). Does anyone know how to do this or have a tutorial with full ability to be customized in any way. Thanks in Advanced!, CarbonBasedGhost
  19. So I have a block that acts like soil and can have plants planted on it but I would like to know how to make my block accelerate the growth speed of the plants on it. Sapling, crops and pumpkins/melons.
  20. So I have a machine thingy that tells you what mining level your at. Well I have come across a problem when using my machine I need to click on a block. How do I stop this from happening and make it so you can just click on air. Item Class: public class Cordinate_Check extends Item_TypeNormal { public Cordinate_Check(){ this.maxStackSize = 1; this.setUnlocalizedName(Strings.Cordinate_CheckerName); this.setCreativeTab(CreativeTabs.tabMisc); Item_Registry.register(this); } @Override public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { if (par3World.isRemote) { return true; } else { if (par5 >= 1 && par5 <= 15 ) { Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("level == diamondLevel")); } if (par5 >= 16 && par5 <= 32) { Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("level == ironLevel")); } if (par5 >= 33 && par5 <= 52) { Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("level == coalLevel")); } if (par5 >= 53) { Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("level == null")); } return false; } } }
  21. Thanks, I saw onItemUse but it didn't say what variable it used so this will help!
  22. So I apologize for my ignorance in advanced because I know someones going to get mad at me for my lack of knowledge but how would I make an item do something when it is right clicked and get coordinates. You do not have to tell me what to do just what classes I should look in to achieve this. update found onRightClick method what should I do to get the coordinates.
  23. So I have a block that tests for certain blocks beside it and if the right block comes up I want it to say a chat message. So how would I do that. I am not interested in using the language registry yet so I just want to say something. (To the nearest player would be nice as well)
×
×
  • Create New...

Important Information

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