Jump to content

SanAndreaP

Forge Modder
  • Posts

    1689
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by SanAndreaP

  1. Just check if the attacking entity is not null (to make sure) and if it's an instanceof ENtityPlayer.
  2. It means you're passing a TileEntity to a function that is expecting a GuiScreen. not a TileEntity, but a container.
  3. Yes, there's also that. BlockCrops uses that method IIRC. But just for dropping an item with metadata, the previous methods should be enough. Also if you want to drop multiple items of the same type (which isn't meta-sensitive, though) there's the quantityDropped method.
  4. the second parameter is the GuiID, which you can use in your GuiHandler to specify which GUI / Container will open.
  5. I think he means how does he specify which of the subblocks drops what item. I think that because I want to know this too... It'd certainly save on ID's! If you wanna specify which metadata should be dropped, use the damageDropped method. Lets say for example, I wanted to make a custom wool set that dropped a custom dye. The wools are all subblocks (500:1, 500:2 etc) How would I specify that MyWoolRed drops red dye, whilst MyWoolBlue drops blue dye? (I assume this is what the OP meant. He's not replied since the post so just guessing; but it's something I want to know ) Then use both methods, idDropped and damageDropped. Easy as that.
  6. I think he means how does he specify which of the subblocks drops what item. I think that because I want to know this too... It'd certainly save on ID's! If you wanna specify which metadata should be dropped, use the damageDropped method.
  7. player.openGui(Remula.remulaGuiHandler, 0, world, x, y, z); The first parameter is wrong. It must be your Mod's instance (the @Instance field inside your main mod class) https://github.com/SanAndreasP/TurretModv3/blob/master/sanandreasp/mods/TurretMod3/block/BlockLaptop.java#L104
  8. What line of code do you use to open your GUI?
  9. You don't need either findGlobalUniqueEntityId nor registerGlobalEntityID. registerModEntity is enough to get it work.
  10. You heard of the 'instanceof' keyword?
  11. You see the 2 string parameters. The first one is the name given by MCP, so you can test it. The second one is the SRG name of that field. It's like an index given by MCP before the real naming occurs. (path of deobfuscation goes like >> Notch (obfuscated) names -> SRG (index) names -> deobfuscated (community-driven) names << The Notch names and the deobf-names are changing through MC updates, where SRG names are unlikely to change (except the fields / methods have changed or been removed or something like that). Forge comes with "runtime-deobfuscation", meaning it converts the Notch names to SRG names and thus mods don't need to update unless a part in MC changed which the mod uses. To get those SRG names, open the '/forge/mcp/conf/fields.csv' and look up the name. The SRG name is the very first (starts with 'field_'). For methods it's in the 'method.csv' in the same directory.
  12. I tried to do the same thing with my turrets. Works quite well, except of the entities move faster than usual when targeted, so you have to ajust the speed (so do I ). Everytime the projectile hits a target, the target will 'target' the shooting entity (the turret). Have some code: https://github.com/SanAndreasP/TurretModv3/blob/master/sanandreasp/mods/TurretMod3/entity/projectile/TurretProjectile.java#L381
  13. b doesn't work since Forge makes an instance of the Event class everytime the event is fired. An unregistered subclass would crash / simply not work if you try to register it and 1) don't put it into the net.minecraftforge(.client).event package 2) don't fire it manually with an instance of your subclass
  14. Yes at first I put this into the Main class and then I saw a tutorial. They said that I have to put it into the ClientProxy. I didn't understand this But this doesn't solve my problem Can you post your render class?
  15. Why do you register your entity client-side only? It needs to be registered for the server as well! Shove it out of your prxy directly in your main mod class.
  16. Go to the RivalRebels mod thread and post it there. Also wrong subforum.
  17. I see that you don't register your model to your entity: [*]your common proxy should have the same registerRenderInformation as the Client Proxy, just with an empty method body [*]you must call your registerRenderInformation in your @Init method through your proxy field
  18. Pretty sure not. None of it refers to your code and I think I get that error to. That error is deep in the texture stitching code that turns all of our block and item PNGs into a single spritesheet (which doesn't effect mob textures, nor any texture directly referenced like you're doing). I really don't see the issue with the code or anything That error is just because you don't have the latest LWJGL, you don't need to worry about that. Can I see your proxy classes and your main mod class?
  19. I have created the model in Techne at 64x32 and did you actually export the model from techne into a java file, fix the errors, made an animation for this and register your Model class with the RenderingRegistry?
  20. public static void load(Configuration config) { config = configuration; Probably because you have a parameter which is named the same as a variable and trying to set it with a non-existant variable.
  21. So I learned how to use ASM and everything works as expected like adding code lines or even methods. But if I try to modify a method in the RenderBiped class, I get a crash: I noticed if I edit something in the MethodNode's instructions list it does this. Here's the code I use: https://gist.github.com/SanAndreasP/c350016ddaea4d9ff7ae And yes, I know that those method names aren't named like this anymore after reobf, it's just for testing purposes.
  22. You need to register your TileEntity with the GameRegistry.
  23. You use this: "EmeraldsPlus" in your registerModEntity calls. This parameter is not supposed to be a string, but the instance variable from your main mod. (EmeraldsPlusCore.instance)
×
×
  • Create New...

Important Information

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