Jump to content

TLHPoE

Members
  • Posts

    638
  • Joined

  • Last visited

Everything posted by TLHPoE

  1. Ok, I've switched events. Now, the event is registered on the server and not the client. @SubscribeEvent public void EntitySpawnEvent(LivingSpawnEvent event) { if(event.entity instanceof EntityPlayer) { System.out.println("1"); EntityPlayer player = (EntityPlayer) event.entity; if(!player.worldObj.isRemote) { System.out.println("2"); if(DataHelper.getRace(player.getDisplayName()) == -1) { System.out.println("3"); player.openGui(RPG.instance, 0, player.worldObj, (int) player.posX, (int) player.posY, (int) player.posZ); } } } } For some reason, it never detects the player. There was a print behind the first if statement but it was spamming the console.
  2. Ah, thanks.
  3. I've looked on some threads, and I've got this code: package net.rpg.handler; import net.minecraft.client.Minecraft; import net.minecraft.client.settings.KeyBinding; import net.minecraft.entity.player.EntityPlayer; import net.rpg.RPG; import org.lwjgl.input.Keyboard; import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent; public class KeyHandler { private KeyBinding stats = new KeyBinding("Stats", Keyboard.KEY_F, "RPG"); public KeyHandler() { ClientRegistry.registerKeyBinding(stats); } @SubscribeEvent public void KeyInputEvent(KeyInputEvent event) { System.out.println("1"); if(stats.func_151468_f()) { System.out.println("2"); if(Minecraft.getMinecraft().currentScreen == null) { EntityPlayer p = Minecraft.getMinecraft().thePlayer; p.openGui(RPG.instance, 1, p.worldObj, (int) p.posX, (int) p.posY, (int) p.posZ); } } } } And I've registered it, and the keybinding appears in the menu. The problem is, the event is never called. Am I using the wrong event? Here's my code for registering it: package net.rpg.helper; import net.minecraftforge.common.MinecraftForge; import net.rpg.handler.ClientEventHandler; import net.rpg.handler.KeyHandler; import cpw.mods.fml.common.eventhandler.EventBus; public class ClientEventHelper { public static void init() { EventBus funBus = MinecraftForge.EVENT_BUS; funBus.register(new KeyHandler()); funBus.register(new ClientEventHandler()); } }
  4. You can set the damage by either setting it to a new material, or creating your own class extending sword. To create your own material, look into EnumHelper.
  5. ItemSword newSword = new ItemSword(ToolMaterial.EMERALD);
  6. I added prints: It printed all of them. Also, the position has no effect at all. Here's my GuiHandler: Here's my container And here's my gui
  7. I have this code, which is suppose to open a GUI if the player has -1 as a race. package net.rpg.handler; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.rpg.RPG; import net.rpg.helper.DataHelper; import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class WorldEventHandler { @SubscribeEvent public void EntityJoinWorldEvent(EntityJoinWorldEvent event) { if(!event.world.isRemote && event.entity instanceof EntityPlayer) { EntityPlayer p = (EntityPlayer) event.entity; DataHelper.load(event.world); if(DataHelper.getRace(p.getDisplayName()) == -1) { p.openGui(RPG.instance, 1, p.worldObj, 0, 0, 0); } } } } The problem is, it crashes. I'm guessing it crashes because maybe the player is unready to open GUIs? Crashlog: Is there any other way to open a GUI when a player first joins?
  8. Is there a new way to sync up data in 1.7.2? As in packets, etc.
  9. In my code, I create a configuration file in the world. My current problem, is editing values that are inside of it. package net.rpg.helper; import java.io.File; import net.minecraft.world.World; import net.minecraftforge.common.config.Configuration; public class CoinHelper { private static Configuration coinData; public static void load(World w) { coinData = new Configuration(new File("./saves/" + w.getWorldInfo().getWorldName() + "/rpgdata.dat")); coinData.load(); } public static void save() { coinData.save(); } public static void setCoins(String n, int amt) { coinData.get("Coin Data", n, amt); //Doesn't work save(); } public static void storePlayer(String n) { coinData.get("Coin Data", n, 0); } public static int getCoins(String n) { return coinData.get("Coin Data", n, 0).getInt(); } } Is there a way to edit the values? The way I'm using in my code doesn't work.
  10. Currently, I'm using this code to generate my mcmod.info file: Does this still work? Or do I need to create it manually?
  11. Am I using the method correctly? It doesn't seem to be working. Code: LanguageRegistry.instance().injectLanguage("en_US", langMap); Here's what the hash map looks like: [TLHPoE's Bonanzas]{tile.hellStoneOre.name=Hell Stone Ore, tile.furmaniumBlock.name=Furmanium Block, item.adamantiteShovel.name=Adamantite Shovel, item.corundumIngot.name=Corundum Ingot, item.opiumHoe.name=Opium Hoe, item.furliumIngot.name=Furlium Ingot, item.leadBoots.name=Lead Boots, item.platinumSword.name=Platinum Sword, item.leadIngot.name=Lead Ingot, tile.platinumOre.name=Platinum Ore, item.netheriteBoots.name=Netherite Boots, item.copperSword.name=Copper Sword, item.netheriteHoe.name=Netherite Hoe, tile.artemiumBlock.name=Artemium Block, item.aluminumLeggings.name=Aluminum Leggings, tile.copperOre.name=Copper Ore, tile.rubyOre.name=Ruby Ore, item.cobaltIngot.name=Cobalt Ingot, item.nickelAxe.name=Nickel Axe, item.leadChestplate.name=Lead Chestplate, item.qeeriumHoe.name=Qeerium Hoe, item.koraniumIngot.name=Koranium Ingot, tile.nickelOre.name=Nickel Ore, tile.sapphireBlock.name=Sapphire Block, tile.deveramBlock.name=Deveram Block, tile.leadBlock.name=Lead Block, item.koraniumShovel.name=Koranium Shovel, item.erumAxe.name=Erum Axe, item.copperPickaxe.name==Copper Pickaxe, item.platinumHoe.name=Platinum Hoe, item.rulperSword.name=Rulper Sword, item.sapphireIngot.name=Sapphire Ingot, item.slipStoneAxe.name=Slip Stone Axe, item.julitePickaxe.name==Julite Pickaxe, item.slipStoneShovel.name=Slip Stone Shovel, item.erumShovel.name=Erum Shovel, item.muraniteLeggings.name=Muranite Leggings, item.suminiteBoots.name=Suminite Boots, item.tungstenSword.name=Tungsten Sword, tile.amethystOre.name=Amethyst Ore, item.permaniteAxe.name=Permanite Axe, item.permaniteHoe.name=Permanite Hoe, item.qeeriumIngot.name=Qeerium Ingot, item.netheriteSword.name=Netherite Sword, tile.aluminumOre.name=Aluminum Ore, item.hellStoneIngot.name=Hell Stone Ingot, tile.permaniteBlock.name=Permanite Block, item.adamantiteHoe.name=Adamantite Hoe, item.mythrilSword.name=Mythril Sword, tile.netheriteBlock.name=Netherite Block, item.enderiteHelmet.name=Enderite Helmet, item.netheritePickaxe.name==Netherite Pickaxe, item.cobaltShovel.name=Cobalt Shovel, tile.adamantiteOre.name=Adamantite Ore, tile.koraniumBlock.name=Koranium Block, item.moonStonePickaxe.name==Moon Stone Pickaxe, tile.corundumOre.name=Corundum Ore, item.sapphireShovel.name=Sapphire Shovel, item.paladiumSword.name=Paladium Sword, item.gookulHelmet.name=Gookul Helmet, item.moonStoneSword.name=Moon Stone Sword, item.adamantiteSword.name=Adamantite Sword, item.slipStoneHoe.name=Slip Stone Hoe, item.mythrilPickaxe.name==Mythril Pickaxe, item.rulperIngot.name=Rulper Ingot, item.mythrilHoe.name=Mythril Hoe, item.netheriteShovel.name=Netherite Shovel, tile.opiumBlock.name=Opium Block, item.hellStoneLeggings.name=Hell Stone Leggings, item.erumHoe.name=Erum Hoe, item.corundumChestplate.name=Corundum Chestplate, tile.helamiteBlock.name=Helamite Block, tile.gookulBlock.name=Gookul Block, item.tungstenShovel.name=Tungsten Shovel, item.aluminumIngot.name=Aluminum Ingot, tile.slipStoneBlock.name=Slip Stone Block, tile.qeeriumOre.name=Qeerium Ore, item.slipStoneIngot.name=Slip Stone Ingot, item.suminiteChestplate.name=Suminite Chestplate, item.enderiteChestplate.name=Enderite Chestplate, item.helamiteIngot.name=Helamite Ingot, item.copperAxe.name=Copper Axe, item.qeeriumAxe.name=Qeerium Axe, tile.enderiteOre.name=Enderite Ore, item.iridiumIngot.name=Iridium Ingot, item.furliumHoe.name=Furlium Hoe, item.rubyPickaxe.name==Ruby Pickaxe, tile.slipStoneOre.name=Slip Stone Ore, item.corundumBoots.name=Corundum Boots, item.slipStonePickaxe.name==Slip Stone Pickaxe, tile.koraniumOre.name=Koranium Ore, tile.rubyBlock.name=Ruby Block, item.amethystIngot.name=Amethyst Ingot, tile.cobaltBlock.name=Cobalt Block, item.gookulLeggings.name=Gookul Leggings, tile.moonStoneOre.name=Moon Stone Ore, tile.enderiteBlock.name=Enderite Block, item.jadeSword.name=Jade Sword, item.opiumShovel.name=Opium Shovel, item.qeeriumShovel.name=Qeerium Shovel, item.deveramHoe.name=Deveram Hoe, item.nickelPickaxe.name==Nickel Pickaxe, item.koraniumAxe.name=Koranium Axe, tile.adamantiteBlock.name=Adamantite Block, item.amethystAxe.name=Amethyst Axe, item.furmaniumIngot.name=Furmanium Ingot, item.juliteShovel.name=Julite Shovel, item.helamiteHelmet.name=Helamite Helmet, item.rubyIngot.name=Ruby Ingot, tile.tungstenOre.name=Tungsten Ore, tile.deveramOre.name=Deveram Ore, item.moonStoneAxe.name=Moon Stone Axe, item.erumSword.name=Erum Sword, item.tungstenIngot.name=Tungsten Ingot, item.osmiumBoots.name=Osmium Boots, item.furliumPickaxe.name==Furlium Pickaxe, tile.furliumOre.name=Furlium Ore, item.sapphirePickaxe.name==Sapphire Pickaxe, item.hellStoneBoots.name=Hell Stone Boots, item.tungstenAxe.name=Tungsten Axe, tile.erumBlock.name=Erum Block, tile.rulperBlock.name=Rulper Block, item.juliteAxe.name=Julite Axe, item.mythrilIngot.name=Mythril Ingot, item.aluminumChestplate.name=Aluminum Chestplate, item.gookulIngot.name=Gookul Ingot, item.furliumShovel.name=Furlium Shovel, item.artemiumIngot.name=Artemium Ingot, item.aluhkiteIngot.name=Aluh-Kite Ingot, item.enderiteBoots.name=Enderite Boots, item.osmiumLeggings.name=Osmium Leggings, tile.sapphireOre.name=Sapphire Ore, itemGroup.bonanzasItem=Bonanzas' Items, item.osmiumChestplate.name=Osmium Chestplate, item.artemiumSword.name=Artemium Sword, item.rubyShovel.name=Ruby Shovel, item.adamantitePickaxe.name==Adamantite Pickaxe, item.gookulChestplate.name=Gookul Chestplate, item.erumIngot.name=Erum Ingot, item.qeeriumSword.name=Qeerium Sword, item.helamiteBoots.name=Helamite Boots, item.rulperHoe.name=Rulper Hoe, item.nickelSword.name=Nickel Sword, tile.mythrilOre.name=Mythril Ore, item.osmiumHelmet.name=Osmium Helmet, tile.leadOre.name=Lead Ore, item.netheriteLeggings.name=Netherite Leggings, item.suminiteHelmet.name=Suminite Helmet, item.rulperAxe.name=Rulper Axe, item.leadLeggings.name=Lead Leggings, item.permaniteSword.name=Permanite Sword, item.artemiumShovel.name=Artemium Shovel, item.slipStoneSword.name=Slip Stone Sword, item.aluhkiteChestplate.name=Aluh-Kite Chestplate, item.aluminumHelmet.name=Aluminum Helmet, item.cobaltAxe.name=Cobalt Axe, item.deveramIngot.name=Deveram Ingot, item.iridiumShovel.name=Iridium Shovel, item.helamiteChestplate.name=Helamite Chestplate, item.nickelHoe.name=Nickel Hoe, tile.muraniteOre.name=Muranite Ore, item.paladiumShovel.name=Paladium Shovel, tile.copperBlock.name=Copper Block, tile.aluhkiteBlock.name=Aluh-Kite Block, tile.furmaniumOre.name=Furmanium Ore, tile.iridiumOre.name=Iridium Ore, tile.jadeBlock.name=Jade Block, item.deveramPickaxe.name==Deveram Pickaxe, item.tungstenHoe.name=Tungsten Hoe, item.adamantiteIngot.name=Adamantite Ingot, tile.netheriteOre.name=Netherite Ore, item.paladiumPickaxe.name==Paladium Pickaxe, item.koraniumHoe.name=Koranium Hoe, item.koraniumPickaxe.name==Koranium Pickaxe, item.permaniteIngot.name=Permanite Ingot, item.cobaltPickaxe.name==Cobalt Pickaxe, item.opiumSword.name=Opium Sword, tile.opiumOre.name=Opium Ore, tile.helamiteOre.name=Helamite Ore, item.erumPickaxe.name==Erum Pickaxe, item.jadePickaxe.name==Jade Pickaxe, tile.tungstenBlock.name=Tungsten Block, item.copperLeggings.name=Copper Leggings, item.rubySword.name=Ruby Sword, tile.mythrilBlock.name=Mythril Block, item.paladiumIngot.name=Paladium Ingot, item.suminiteLeggings.name=Suminite Leggings, item.jadeHoe.name=Jade Hoe, item.artemiumPickaxe.name==Artemium Pickaxe, item.moonStoneIngot.name=Moon Stone Ingot, tile.suminiteOre.name=Suminite Ore, item.koraniumSword.name=Koranium Sword, item.qeeriumPickaxe.name==Qeerium Pickaxe, item.jadeAxe.name=Jade Axe, tile.erumOre.name=Erum Ore, item.opiumAxe.name=Opium Axe, tile.iridiumBlock.name=Iridium Block, item.moonStoneHoe.name=Moon Stone Hoe, item.platinumAxe.name=Platinum Axe, item.amethystShovel.name=Amethyst Shovel, item.rubyAxe.name=Ruby Axe, tile.furliumBlock.name=Furlium Block, item.platinumIngot.name=Platinum Ingot, tile.artemiumOre.name=Artemium Ore, item.enderiteLeggings.name=Enderite Leggings, item.muraniteBoots.name=Muranite Boots, item.juliteSword.name=Julite Sword, item.sapphireSword.name=Sapphire Sword, item.rulperPickaxe.name==Rulper Pickaxe, item.juliteHoe.name=Julite Hoe, item.jadeShovel.name=Jade Shovel, item.suminiteIngot.name=Suminite Ingot, item.adamantiteAxe.name=Adamantite Axe, item.moonStoneShovel.name=Moon Stone Shovel, tile.permaniteOre.name=Permanite Ore, tile.paladiumOre.name=Paladium Ore, item.gookulBoots.name=Gookul Boots, item.platinumPickaxe.name==Platinum Pickaxe, item.mythrilShovel.name=Mythril Shovel, item.leadHelmet.name=Lead Helmet, item.copperIngot.name=Copper Ingot, tile.nickelBlock.name=Nickel Block, tile.osmiumOre.name=Osmium Ore, item.aluhkitePickaxe.name==Aluh-Kite Pickaxe, item.aluhkiteHoe.name=Aluh-Kite Hoe, itemGroup.bonanzasArmor=Bonanzas' Armor, item.paladiumAxe.name=Paladium Axe, tile.rulperOre.name=Rulper Ore, item.deveramSword.name=Deveram Sword, tile.hellStoneBlock.name=Hell Stone Block, item.amethystPickaxe.name==Amethyst Pickaxe, tile.platinumBlock.name=Platinum Block, item.sapphireAxe.name=Sapphire Axe, item.corundumHelmet.name=Corundum Helmet, tile.jadeOre.name=Jade Ore, item.copperHoe.name=Copper Hoe, item.sapphireHoe.name=Sapphire Hoe, tile.qeeriumBlock.name=Qeerium Block, item.aluminumBoots.name=Aluminum Boots, tile.corundumBlock.name=Corundum Block, item.copperHelmet.name=Copper Helmet, item.furmaniumLeggings.name=Furmanium Leggings, item.mythrilAxe.name=Mythril Axe, item.aluhkiteSword.name=Aluh-Kite Sword, item.amethystHoe.name=Amethyst Hoe, item.furmaniumBoots.name=Furmanium Boots, item.muraniteChestplate.name=Muranite Chestplate, item.osmiumIngot.name=Osmium Ingot, item.muraniteIngot.name=Muranite Ingot, tile.paladiumBlock.name=Paladium Block, tile.juliteOre.name=Julite Ore, item.furliumAxe.name=Furlium Axe, item.copperChestplate.name=Copper Chestplate, item.aluhkiteShovel.name=Aluh-Kite Shovel, item.amethystSword.name=Amethyst Sword, item.iridiumHoe.name=Iridium Hoe, item.artemiumHoe.name=Artemium Hoe, tile.muraniteBlock.name=Muranite Block, itemGroup.bonanzasTool=Bonanzas' Tools, item.iridiumAxe.name=Iridium Axe, tile.amethystBlock.name=Amethyst Block, item.aluhkiteAxe.name=Aluh-Kite Axe, item.netheriteHelmet.name=Netherite Helmet, item.hellStoneChestplate.name=Hell Stone Chestplate, item.corundumLeggings.name=Corundum Leggings, item.hellStoneHelmet.name=Hell Stone Helmet, item.enderiteIngot.name=Enderite Ingot, item.rubyHoe.name=Ruby Hoe, item.tungstenPickaxe.name==Tungsten Pickaxe, tile.aluminumBlock.name=Aluminum Block, item.permaniteShovel.name=Permanite Shovel, item.opiumIngot.name=Opium Ingot, tile.aluhkiteOre.name=Aluh-Kite Ore, item.muraniteHelmet.name=Muranite Helmet, item.paladiumHoe.name=Paladium Hoe, item.artemiumAxe.name=Artemium Axe, item.nickelShovel.name=Nickel Shovel, item.aluhkiteBoots.name=Aluh-Kite Boots, item.aluhkiteHelmet.name=Aluh-Kite Helmet, item.opiumPickaxe.name==Opium Pickaxe, item.juliteIngot.name=Julite Ingot, tile.gookulOre.name=Gookul Ore, item.aluhkiteLeggings.name=Aluh-Kite Leggings, item.copperBoots.name=Copper Boots, item.iridiumPickaxe.name==Iridium Pickaxe, item.furmaniumHelmet.name=Furmanium Helmet, tile.osmiumBlock.name=Osmium Block, item.platinumShovel.name=Platinum Shovel, item.helamiteLeggings.name=Helamite Leggings, item.furliumSword.name=Furlium Sword, item.netheriteAxe.name=Netherite Axe, tile.suminiteBlock.name=Suminite Block, item.furmaniumChestplate.name=Furmanium Chestplate, tile.cobaltOre.name=Cobalt Ore, item.jadeIngot.name=Jade Ingot, item.copperShovel.name=Copper Shovel, item.permanitePickaxe.name==Permanite Pickaxe, tile.juliteBlock.name=Julite Block, item.cobaltSword.name=Cobalt Sword, item.netheriteIngot.name=Netherite Ingot, item.cobaltHoe.name=Cobalt Hoe, item.iridiumSword.name=Iridium Sword, item.deveramAxe.name=Deveram Axe, item.deveramShovel.name=Deveram Shovel, item.nickelIngot.name=Nickel Ingot, item.netheriteChestplate.name=Netherite Chestplate, item.rulperShovel.name=Rulper Shovel, tile.moonStoneBlock.name=Moon Stone Block, itemGroup.bonanzasBlock=Bonanzas' Blocks}
  12. It works, thanks. Not sure if you need this, but here's the log:
  13. Same error, here's the cmd:
  14. Another update, I ran the cmd as an administrator and followed Lex Manos's tutorial (on his channel). Same error. Here's the cmd:
  15. I've been following this tutorial: http://www.minecraftforge.net/forum/index.php/topic,14048.0.html And I got this error: It worked on forge 1008 today.
  16. Crash Report: Occurs when I create a new world, right after the "Building Terrain" text.
  17. My sound is located in assets/treeditions/sounds/unwrap.ogg
  18. Turns out the method was being fired at all (in the item). I'm currently trying to play my own sound. For some reason, it won't play the sound. The onSoundLoad method is already registered. Code snippet I used to add it to the game: @SideOnly(Side.CLIENT) @ForgeSubscribe public void onSoundLoad(SoundLoadEvent e) { e.manager.soundPoolSounds.addSound("treeditions:unwrap.ogg"); } Code snippet I used to play it: @Override public void onPlayerStoppedUsing(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer, int par4) { par2World.playSoundAtEntity(par3EntityPlayer, "treeditions:unwrap", 1F, 1F); }
  19. Oh, I'm an idiot... I could just use the animated textures thing/feature.
  20. I think that might cause some more problems because my block uses meta data to determine which location it faces (vine)
  21. So I currently have this piece of code inside of my block: @Override public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { if(blockIcon == icons[0]) { blockIcon = icons[1]; return; } if(blockIcon == icons[1]) { blockIcon = icons[2]; return; } if(blockIcon == icons[2]) { blockIcon = icons[3]; return; } if(blockIcon == icons[3]) { blockIcon = icons[0]; return; } } It only changes the texture when it is in my hand/inventory, not the world.
  22. Haven't modded for a while, but here are a list of things you'll need: Gui handler Custom sorter (the vanilla one is protected/private) Custom recipe manager (Not sure about this one) Custom container (Not sure about this one) Custom gui (If you want to change the name/change texture/add additional things)
  23. Use the LivingDropsEvent and remember to register it MinecraftForge.EVENT_BUS.register(new EventHandler());
×
×
  • Create New...

Important Information

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