Jump to content

lukas2005

Forge Modder
  • Posts

    289
  • Joined

  • Days Won

    2

Everything posted by lukas2005

  1. can you make a github repo for this ?? this says that package growthcraft.api.cellar.CellarRegistry is not found and also does the eclipse say anthing? can you run the game?
  2. cant you just place a dirt under a player if it detects that it is a framland when wearing armor?
  3. hello i want to make that player inventory does not base on slots number but on weight of items i arelady maded a weight part but now how do i change player inventory? EDIT: i have found a tutorial how to do this: http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571597-forge-1-6-4-1-8-custom-inventories-in-items-and
  4. you are using minecraft server on a client side and wondering what did go wrong and i think commands needs to be registered on both sides and cant be client only
  5. oh my fault thank you for noticing this now it works
  6. i decided to make a repo for better look at this https://github.com/lukas2005/IDEA-Mod
  7. package lukas2005.idea; import java.util.HashMap; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; public class CustomValues { public static HashMap<Item,Float> ITEMWEIGHT = new HashMap<Item,Float>(); public static HashMap<Block,Float> BLOCKWEIGHT = new HashMap<Block,Float>(); public static void initValues(Configuration config) { config.addCustomCategoryComment("BLOCKS WEIGHT", "Here you can change how much ceratin blocks weight"); for (Block block : Block.REGISTRY) { Property pr = config.get("BLOCKS WEIGHT", block.getRegistryName().toString(), "1.0"); BLOCKWEIGHT.put(block, Float.parseFloat(pr.getString())); Logger.info("Weight of " + block.getRegistryName().toString()+"="+Float.parseFloat(pr.getString())); pr.setComment("Weight of " + block.getRegistryName().toString()); } config.addCustomCategoryComment("ITEMS WEIGHT", "Here you can change how much ceratin items weight"); for (Item item : Item.REGISTRY) { Property pr = config.get("ITEMS WEIGHT", item.getRegistryName().toString(), "1.0"); ITEMWEIGHT.put(item, Float.parseFloat(pr.getString())); Logger.info("Weight of "+item.getRegistryName().toString()+"="+Float.parseFloat(pr.getString())); pr.setComment("Weight of " + item.getRegistryName().toString()); } config.save(); } }
  8. i am using MinecraftForge.EVENT_BUS.register(new EventHooks()); in pre init @EventHandler public static void preInit(FMLPreInitializationEvent e) { Logger.setLogger(LogManager.getLogger(Reference.MODID.toUpperCase())); Logger.info("Pre Init!"); MinecraftForge.EVENT_BUS.register(new EventHooks()); Reference.CONFIG = new Configuration(e.getSuggestedConfigurationFile()); ModItems.main(); //Logger.info("Loaded and registered succesfully: " + ModItems.ITEMS.size() + " Items"); CustomValues.initValues(Reference.CONFIG); proxy.preInit(e); }
  9. i have code like that @SubscribeEvent public static void onItemTooltip(ItemTooltipEvent e) { List<String> toolTip = e.getToolTip(); if (e.getItemStack().getItem() instanceof ItemBlock) { toolTip.add("Weigth: "+CustomValues.BLOCKWEIGHT.get(Block.getBlockFromItem(e.getItemStack().getItem()))); } else if (e.getItemStack().getItem() instanceof Item) { toolTip.add("Weigth: "+CustomValues.BLOCKWEIGHT.get(e.getItemStack().getItem())); } } and it does not work and console does not say anything about this
  10. Hello i know how to make tooltip show under a item but what if i want to add it to existing item without modifiyng the class?
  11. ok i have one more question. How do i read a float from a Propery object bcause theres a getInt() method but not getFloat()?
  12. in pre init of main @EventHandler public static void preInit(FMLPreInitializationEvent e) { Logger.setLogger(LogManager.getLogger(Reference.MODID.toUpperCase())); Logger.info("Pre Init!"); Reference.CONFIG = new Configuration(e.getSuggestedConfigurationFile()); ModItems.main(); //Logger.info("Loaded and registered succesfully: " + ModItems.ITEMS.size() + " Items"); CustomValues.initValues(Reference.CONFIG); proxy.preInit(e); } in CustomValues class package lukas2005.idea; import java.util.HashMap; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; public class CustomValues { public static HashMap<Item,Integer> ITEMWEIGHT = new HashMap<Item,Integer>(); public static HashMap<Block,Integer> BLOCKWEIGHT = new HashMap<Block,Integer>(); public static void initValues(Configuration cONFIG) { Reference.CONFIG.addCustomCategoryComment("BLOCKS WEIGHT", "Here you can change how much ceratin blocks weight"); for (Block block : Block.REGISTRY) { Property pr = Reference.CONFIG.get("BLOCKS WEIGHT", block.getRegistryName().toString(), "1"); BLOCKWEIGHT.put(block, pr.getInt()); pr.setComment("Weight of a " + block.getRegistryName().toString()); } Reference.CONFIG.addCustomCategoryComment("ITEMS WEIGHT", "Here you can change how much ceratin items weight"); for (Item item : Item.REGISTRY) { Property pr = Reference.CONFIG.get("ITEMS WEIGHT", item.getRegistryName().toString(), "1"); ITEMWEIGHT.put(item, pr.getInt()); pr.setComment("Weight of a " + item.getRegistryName().toString()); } } }
  13. ok i created the code and runned minecraft config genrated but its empty
  14. ok but what if config file doesnt exist? do i need to make it by myself?
  15. i am confused right now is thre a tutorial about this or maybe docs?
  16. i want to load a hash map from a config but also if a value for something is not set then add it
  17. can you post the command b cause i has been searching how to run minecraft from command line for YEARS
  18. Do you mean something like Cray fish Model Creator or Techne?
  19. ok now how do i use this Configuration object??? theres only get methods
  20. In preInit event has a Configuration object for your mod that is what you will use to create a config. do you mean FMLPreInitializationEvent#getSuggestedConfigurationFile()? Yes and then i can use normal JavaIO? and configuration file syntax is created by me? or is there a recommended way of doing this?
×
×
  • Create New...

Important Information

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