Jump to content

KeeperofMee

Forge Modder
  • Posts

    73
  • Joined

  • Last visited

Everything posted by KeeperofMee

  1. How do I get the mods directory/path from code?
  2. PlayerTickEvent. player.inventory.armorItemInSlot(/*The slot.*/).getItem(); Slots: 0 = boots. 1 = leggings. 2 = chestplate. 3 = helmet.
  3. I'm trying to use ItemSmeltedEvent in order to keep track of items smelted(I've added a few "rpg stats"), the problem is that the event differently on shift and normal pickup so I printed them: The problem is that in order to keep track of the items smelted I increase my own int with the stacksize of the event.smelting, but as you can see shift click triggers twice on server side with a stacksize of 0. Is there anyway else I can keep track of items smelted properly
  4. Items/Blocks: OreDictionary.registerOre(myInstance, "oreSilver"); Recipes: GameRegistry.addRecipe(new ShapedOreRecipe("QIW", " S ", " S ", 'Q', "oreCopper", 'I', "ingotSilver", 'W','"plankWood", 'S', "stickWood"));
  5. Could you please use readable variable names...?
  6. All the mods you had are possible to easily recreate in forge without base edits.
  7. Thank you, that's something at least, but what if it's something no one has never done? Then you study the minecraft code and learn java.
  8. Well i just don't wan't to miss 2 weeks of coding, i would not like to test it, just code and then test it back home I found some programs, I only listed the ones with java syntax: https://itunes.apple.com/us/app/koder-code-editor/id439271237?mt=8 https://itunes.apple.com/us/app/codetogo/id382677229?mt=8 https://itunes.apple.com/us/app/for-i-code-editor-for-the-ipad/id363493710?mt=8 Then there's also simple text editors(no syntax but free): https://itunes.apple.com/us/app/edhita-open-source-text-editor/id398896655?mt=8 I don't know if the next one has java syntax but I'll list it anyway: https://itunes.apple.com/se/app/vim/id492668168?mt=8 There are probably more out there but hope I could be to any help.
  9. Why would you want eclipse on an iPad, you can't test it anyway.
  10. You can also use currentScreen in any class. Minecraft.getMinecraft().currentScreen
  11. Simply copy the workbench gui classes and change the method from false to true. Don't forget the gui handler.
  12. Heres a list of damages: http://pastebin.com/Pu4GJQMJ new ItemStack(Items.dye, 1, DAMAGE)
  13. You're totally right I really shouldn't code while distracted. My new code probably isn't the best but it's better anyway, Here's the new code: @Override public void breakBlock(World world, int x, int y, int z, Block block, int meta) { super.breakBlock(world, x, y, z, block, meta); //List of drops List<ItemStack> drops = block.getDrops(world, x, y, z, meta, 0); //Loops through all drops. for(ItemStack itemstack : drops){ //Spawns the drops into the world. world.spawnEntityInWorld(new EntityItem(world, x, y, z, itemstack)); } //Sets the block to the current block. world.setBlock(x, y, z, this); }
  14. I don't usually give code but anyway when I do I add comments.. It's your loss if you copy and paste without trying to understand so please don't if you're serious about modding. @Override public void breakBlock(World world, int x, int y, int z, Block block, int meta) { //Using random ints in the drops may cause a crash. Set amounts don't. //Loops through all drops. for(int i = 0; i < block.getDrops(world, x, y, z, meta, 0).size(); i++){ //Breaks the loop if i == size. if(i == block.getDrops(world, x, y, z, meta, 0).size()){ break; } //Spawns the drops into the world. world.spawnEntityInWorld(new EntityItem(world, x, y, z, block.getDrops(world, x, y, z, meta, 0).get(i))); } //Sets the block to the current block. world.setBlock(x, y, z, this); }
  15. Not jumping as on land but you can add a check to see if the jump button is pressed and if so temporary disable it while you're pressing the jump keybind just replace player.motionY = 0.0D with this(it will also enable you to get onto land again without any problems(i.e. before you would have to find land at the same height w/o it)): if(!Minecraft.getMinecraft().gameSettings.keyBindJump.getIsKeyPressed()){ player.motionY = 0.0D; }
  16. Try simply using (please not you will not be able to jump while walking on water due to the nature of setting the Y to 0 ) if(world.getBlock(x, y-1, z).getMaterial() == Material.water){ player.motionY = 0.0D; } Image(there should atleast be one):
  17. Make a class implementing IWorldGenerator then register it with GameRegistry.registerWorldGenerator(new MyWorldGeneratorClass(), 0);
  18. Is there anyway to flip a texture without having to flip it inside an editing software and save a new image?
  19. If I remember correctly it was something like this inside your getIcon(int side, int meta){} method: if(side == 3 && meta == 0){ return frontIcon; }else{ //Your current code }
  20. This may not be the correct place but I'm wondering how to submit "unobfuscated names" of function(if there is such a place)?
  21. Make your own IRecipe class... I made a similar mod yesterday and I needed the same so I copied the vanilla shaped recipe code and removed one of the match checks.
  22. You have access to the ItemBlock/ItemStack just make a new ItemBlock and register your block with it like so: GameRegistry.registerBlock(myBlockInstance, MyItemBlock.class, "myBlockName"); EDIT: nvm
×
×
  • Create New...

Important Information

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