Jump to content

Choonster

Moderators
  • Posts

    5161
  • Joined

  • Last visited

  • Days Won

    76

Everything posted by Choonster

  1. You can see the changes Forge makes to vanilla classes in the patches folder of the GitHub repository. This is the patch for AnvilChunkLoader .
  2. Your Init and postInit methods are both handling FMLPreInitializationEvent instead of handling FMLInitializationEvent and FMLPostInitializationEvent . The RenderItem instance is created between preInit and init, so it's still null when you try to register your item models in the preInit phase.
  3. NEI can't find CodeChickenCore. Have you installed it?
  4. Use the -D<name>=<value> command line argument to set the values of system properties like fml.dumpRegistry .
  5. You should be able to call FoodStats#writeNBT on the vanilla object to get all of its values, then call HardFoodStats#readNBT to read those values into your own object before you replace the vanilla one. If HardFoodStats has values in addition to the vanilla ones, you may need to store them in the player's persisted NBT data or an IExtendedEntityProperties object.
  6. The compound tag returned by Entity#getEntityData is added by Forge and only used for custom entity data, it's never written to by Minecraft.
  7. I can reproduce this in the Stronghold at -1016, 27, -80 in seed -2262531267258551749. I believe the cause of this issue is the static initialiser in StructureStrongholdPieces.Library adding items to ChestGenHooks.STRONGHOLD_CORRIDOR but generating chests with items from ChestGenHooks.STRONGHOLD_LIBRARY . It appears the bug was introduced in the initial 1.8 update.
  8. Have you considered just using a different texture for your own item or changing its design to be something other than an egg?
  9. ASM is a library that allows you to manipulate the bytecode of classes at runtime. There aren't many tutorials on using it in coremods, since you should avoid using it unless you have a solid understanding of the bytecode format and you absolutely need to use it. Replacing the vanilla item with your own won't be easy and may not be possible. You can remove it from the creative menu, but players will still be able to obtain it through NEI or the /give command.
  10. The shine effect is controlled by the return value of Item#hasEffect . The default implementation only returns true when the ItemStack is enchanted (i.e. it has a compound tag with the "ench" key). This means there's no easy way to force an existing item to always display the effect without replacing it your own or resorting to ASM (neither of which is desirable). Changing the display name is much easier, just add a translation with the same key as the vanilla one ( item.monsterPlacer.name ) in your own lang files.
  11. I had to manually synchronise the project (rather than refresh it from the Gradle window) to get the reload popup to appear. Thanks for the tip.
  12. You don't need to close it Really? I haven't been able to generate runs from IDEA's Gradle window with the project open (even after refreshing the project), but generating them from the command line without the project open seems to work for me.
  13. That registration code looks correct, but I can't understand what you're asking.
  14. Use the Simple Network Wrapper to send packets between the client and server. Look at the tutorial I linked in my first post for an explanation of how to use the system.
  15. What do you mean? If your mod isn't on the server, you can't modify server-controlled values like experience unless you can use a vanilla packet to do it for you. There's no packet that modifies experience. You could send a chat packet to execute the /xp command, but that would only work if the player has permission to use it.
  16. You can't join a server from the development client unless you specify a valid username (email address) and password using the --username and --password command line arguments in your run configuration.
  17. You've used the pre-1.8 FML namespace ( cpw.mods.fml ) instead of the 1.8+ namespace ( net.minecraftforge.fml ). Why are you running the Launch class instead of the GradleStart class? Using the latter should automatically provide the necessary command line arguments for you, so you don't need to manually specify the version, tweaker or access token. If you run the genIntelliJRuns Gradle task with IDEA closed, it should generate the run configurations for you.
  18. GUIs are client-only, but the server is in control of the game. If you make changes on the client, they'll just be overwritten by the server's values. You need to send a packet to the server telling it that the player pressed the button so it can take the appropriate action. diesieben07 has a tutorial on the Simple Network Wrapper here.
  19. ModelLoader.setCustomModelResourceLocation and ModelLoader.setCustomMeshDefinition can be called during preInit to do the same thing as calling ItemModelMesher#register in init. The Minecraft instance is created and stored before mod loading starts, though the ItemModelMesher instance is only created between preInit and init. 1Poseidon3: You're free to use my code within the terms of the MIT License (basically you can do what you want with it as long as you credit me). I don't really mind if you include the credit in every file or just include a line in your license/readme.
  20. You don't pass those values to HarvestDropsEvent , Forge does that. You just need to subscribe to the event and read the values from it. coolAlias has a tutorial on event handlers here.
  21. That should work on both sides. How are you registering the event handler?
  22. This is what I was referring to.
  23. http://docs.oracle.com/javase/tutorial/java/javaOO/anonymousclasses.html I use anonymous classes that extend StateMapperBase in my ModModelManager class.
  24. ForgeGradle compiles your code with Java 6 compatibility by default (the same as Minecraft). If you want to use Java 8 features like lambdas, you need to tell Gradle to compile your code with Java 8 compatibility instead. You can see an example of this here. Keep in mind that users will need to be running Java 8 to use your mod if you do this, Minecraft itself only requires Java 6. If you don't want to compile with Java 8 compatibility, use an anonymous class instead of a lambda.
  25. I explained a lot of the new fluid model system (including example code) in this thread recently. Post #5 explains the fluid initialisation and registration, post #19 explains the model registration.
×
×
  • Create New...

Important Information

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