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

bpshawarma

Members
  • Posts

    10
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

bpshawarma's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. In case anyone else was wondering, this is the line of code you need: FMLCommonHandler.instance().bus().register(new MyEventListener()); "MyEventListener.java" is the file I made that holds the ItemCraftedEvent method.
  2. Hey Diesenben and Coolboy, I'm afraid to say that, even with your advice, I was not able to figure out what to replace the below line of code with: MinecraftForge.EVENT_BUS.register(new MyEventListener()); I couldn't find any forum entries on registering an event bus with FML events... You mentioned I needed FMLCommonHandler - so would it start with FMLCommonHandler.(something)? Any other help would be really appreciated! Thanks so much,
  3. Hey CoolBoy, Thanks for the quick response, but I'm afraid that the achievement is still not being triggered. Now my MyEventListener.java file looks like this: package mymod.handlers; import mymod.Main; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; public class MyEventListener { @SubscribeEvent public void SomethingCrafted(ItemCraftedEvent event) { if (event.crafting.getItem() == Main.MySword_1) { event.player.addStat(Main.MyAchievement_1, 1); } } } And in my Main mod file, I have in the init section: MinecraftForge.EVENT_BUS.register(new MyEventListener()); Any ideas why this wouldn't be working? Thanks,
  4. Hello Modders, I'm trying to trigger an achievement when a particular item is crafted. I have created a new class called "MyEventListener.java" and this is the code I have in there: package mymod.handlers; import mymod.Main; import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent; public class MyEventListener { public void SomethingCrafted(ItemCraftedEvent event) { if (event.crafting.getItem() == Main.MySword_1) { event.player.addStat(Main.MyAchievement_1, 1); } } } Then, in my main Mod class, I register this class in the "init" section with this line: MinecraftForge.EVENT_BUS.register(new MyEventListener()); I thought that, perhaps, this was being caused because I didn't have the "@ForgeSubscribe" annotation I used to have before the "SomethingCrafted" event, but when I try to add it, it claims to be an error. Any ideas? Thanks!
  5. Thanks so much - that works perfectly! I just have one more question: Is there something I could set it to so that it would be "null" or something like that? What I mean is: Is there a username I could use that could never be associated with a real name so that it always used the default Steve skin? Thanks!
  6. Hello Diesenben, Thanks so much for your response. Could you explain a bit more what you mean by "use the --username program argument"? How would you do this? Where would you put it in the code? Thanks in advance,
  7. Hello Forge Experts, I was working on a Mod with my son for Forge 1.6.4 and we were adding a new Biome. For some reason, when we ran Minecraft, the standard Steve skin had been replaced by some other inappropriate naked skin that we had never seen before. We then closed Minecraft and re-launched it from Eclipse and it was back to the normal version of Steve. We have been working on this mod for quite some time, so I'm just trying to understand what could have possibly caused this. It's my understanding that Eclipse retrieves the Skin from mcp / jars / versions / 1.6.4 / 1.6.4.jar. We checked out steve.png in that jar file and all seemed in order (normal clothed Steve). We've also never downloaded a skin that looked like that... and even if we had - I just don't understand how it could have made its way into our modding version of Minecraft (in the mcp / jars folder) and why it would have only appeared one time and then gone away... Can anyone think of a conceivable explanation for how this could have happened? Could some error in the code prevented the standard texture from loading and forced Minecraft to retrieve the texture from somewhere else (possibly online)? I'd love to get to the bottom of this, so any help or insights would be appreciated!
  8. Hello Forge Experts, Most tutorials I've seen specify that it is essential to set up the Path Environment variable in order to Mod successfully. However, I just reformatted my computer and set up Forge again without the path variable... I was just wondering: Is setting up the path variable actually necessary? If it is necessary, in what circumstances and what exactly does it do? I just want to know going forward as I explain it to others... Thanks in advance!
  9. Hello Forge experts, I'm trying to really understand the code and there's one line that Forge implements that I don't quite get. It's the GameRegistry.registerItem line.... In the forge class, it says this: * Register an item with the item registry with a custom name : this allows for easier server-client resolution * @param item The item to register * @param name The mod-unique name of the item public static void registerItem(net.minecraft.item.Item item, String name) { registerItem(item, name, null); } Does anyone know what it's doing to allow for easier server; client resolution and what exactly a "mod-unique" name is? If I have this code: // LOAD THE SWORD MySword_1 = new MySword(2234, ToolMaterial.IRON).setUnlocalizedName("MySword_1"); GameRegistry.registerItem(MySword_1, "MySword_1"); LanguageRegistry.addName(MySword_1, "My Awesome Sword"); If I remove the GameRegistry Line, nothing seems to happen... Any ideas?
  10. Hello Forge people, I have had a very hard time understanding the role of the Common Proxy and Client Proxy Code that are frequently recommended in Forge Modding tutorials. The code I'm referring to goes in the Main mod file that looks like this: @SidedProxy(clientSide = "mymod.proxies.ClientProxy", serverSide = "mymod.proxies.CommonProxy") public static CommonProxy proxy; These refer to pretty much empty java classes named "ClientProxy" and "CommonProxy" I have gone blindly forward and included them in my mod, but they don't seem to be doing anything. When I remove them, nothing happens... Everything still seems to work fine! So my questions are: 1. If they can be removed with no consequences, what exactly are those classes doing? 2. Am I making a rookie mistake by removing them? Thanks in advance!
×
×
  • Create New...

Important Information

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