Jump to content

calclavia

Forge Modder
  • Posts

    2281
  • Joined

  • Last visited

Everything posted by calclavia

  1. Works perfectly now! The code is so much cleaner than using the IOreHandler! Hmm maybe you should add a shortcut method in ShapedOreRecipe called ShapedOreRecipe.add(XXX) to simplify the method so people don't have to type such a long function such as: CraftingManager.getInstance().getRecipeList().add(xx)
  2. So in other words in the client side I use ModLoader.openGUI and on the server side on use Player.openGUI? Or is it both sides I use player.openGUI?
  3. Thats about right. But it doesn't really answer my question (although it makes everything more clear). The problem I am having is that I have to get my players to manually place the sound files in resources/mods/sounds/ directory in order for the sound to be actually found. I can't figure out a way to make the sound play when I store my xxx.ogg files in my mod distribution zip package. Industrialcraft seems to be able to do this with no problem but they are not using the Forge sound handler.
  4. BlockContainer is not needed, just override the getTileEntity function, which is defined in Block, in your subclass. I tried that and it somehow did not work. The GUI of the block stopped working and basically it had no tile entity... BlockContainer works perfectly though. Is it not recommended to use BlockContainer?
  5. A child mod is basically a sub-mod or an add-on to the main mod. Forge has their own info file. Take that as reference and make your own.
  6. I am REALLY sorry I wasn't paying attention to what you wrote above. Apologies.
  7. Speaking of wich, is it possible to get an item to have its metadata higher than 16 by using itemstacks but in the same time allowing the items to stack up to 64?
  8. I don't think that works well with using mcp.
  9. I can't get the GUI to open on the blocks. I am not sure how to do this. I read the FML porting tutorial. I have this in both server and client and I registered it via MinecraftForge.setGuiHandler(this, this); @Override public Object getGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { System.out.println("WORKING "+ID); return null; } On the blockActivated function I simply called ModLoader.openGUI(...) in both client and server side. It never prints that line. Not sure why... You can check out the full code here: https://github.com/calclavia/Universal-Electricity/tree/master/Universal_Electricity Changes are in UCBlockMachine, mod_UniversalElectricity
  10. I am trying to set up a GitHub repo for Universal Electricity. I am a 100% noob at GitHub and I'm trying to learn how to use it. How would I commit the entire project onto GitHub without including all the Minecraft src files that I don't need (without manually dragging it and organizing them)?
  11. There seems to be a new way of adding ore recipes now. I am not very sure how to use it yet. Anyone has any idea on how to use the new class ShapedOreRecipe and ShapelessOreRecipe?
  12. The newest build seems to have 4096 integrated. Check out the Jenkins change log.
  13. You also need an ItemBlock class. You have to register it with ModLoader. ModLoader.registerBlock(YourBlockVariable, YourItemBlock.class)
  14. You name the itemstack with the metadata. ModLoader.addName(new ItemStack(xxx, 1, 4), "NAME") In this case 4 is the metadata. XXX represents your block/item.
  15. Edit: I did a print line in the function onPlaySound and I found out for some reason the entry is always null...
  16. I looked at their code and did the exact same thing but the audio files don't seem to get recognized when I obfuscated it (it works no problem when I place it in the resource folder). static final String soundPrefix = "/icbm/sound/"; static final String[] soundFiles = {"airstrike", "missilelaunch", "emp", "explosion1", "machinehum", "missileinair", "targetlocked"}; @Override public void onLoadSoundSettings(SoundManager soundManager) { for(int i = 0; i < soundFiles.length; i++) { URL url = ICBMSound.class.getClassLoader().getResource(soundPrefix+soundFiles[i]+".ogg"); if(url != null) { soundManager.getSoundsPool().addSound("icbm.sound."+soundFiles[i], this.getClass().getResource(soundPrefix+soundFiles[i]+".ogg")); } else { System.out.println("Invalid sound file: " + soundFiles[i]); } } } The directory of my sound files are at /icbm/sound/... inside of my zip. What am I doing wrong?
  17. There are so many copper mods out there lol... Search the web for Forge texture tutorial. There are LOADS of them out there.
  18. I ran into a problem. Let's say my block/entity gets destroyed. The sound will keep playing even when it is gone.
  19. Do some debugging and print some variables
  20. Leave it so other people who encounter the same problem can see.
  21. Oh.. Why didn't I think of that =_=
  22. He is right. Use ModLoader.registerTileEntity... Search google for how to distribute your mod. Thre are so many tutorials out there on this.
  23. I already read that link. That's for the help. From what I see, they seem to have their sound files in a "sound" directory in the zip. I will try using that. And another question: How can I make a block to constantly play an ambient sound (when specified to do so by it's tile entity of course)? Industrialcraft has these machines that will keep playing noise as long as they're working. I can not use the world.playSoundEffect function since it doesn't really work well for this. I have a loop able sound track for some of my machines that I would like to have them used.
×
×
  • Create New...

Important Information

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