Jump to content

Choonster

Moderators
  • Posts

    5161
  • Joined

  • Last visited

  • Days Won

    76

Everything posted by Choonster

  1. You don't create the RenderManager or RenderItem instances yourself, you use the instances Minecraft has already created. To register a Render for an Entity class, call RenderingRegistry.registerEntityRenderingHandler(Class<T>, IRenderFactory<? super T>) in preInit. In the IRenderFactory#createRenderFor implementation, create and return the Render instance. You receive the RenderManager instance as an argument of IRenderFactory#createRenderFor and you can get the RenderItem instance using Minecraft#getRenderItem. This advice applies to all versions from 1.8.9 onwards. 1.7.10 and earlier are still available for download, but they're not supported on this forum. I believe 1.8.9 is still supported, but you should really update.
  2. I'm assuming you mean "still" rather than "steel". If it's not working, describe exactly what the problem is. Did you follow the instructions I linked? What happened when you did so? Also post any error messages you're getting.
  3. There are already experimental builds of Forge for 1.12 available, but they're not ready for general use.
  4. 1.7.10 is no longer supported on this forum, update if you want help.
  5. 1.7.10 is no longer supported on this forum, update if you want help.
  6. Gradle generates the Eclipse project when you run the eclipse task. Forge's documentation explains how to set up a development environment here.
  7. 1.7.10 is no longer supported on this forum, update if you want help.
  8. World Saved Data lets you store data per-dimension or per-map. World Capabilities are just a nicer wrapper around per-dimension WorldSavedData. For a public API, I recommend using Capabilities rather than World Saved Data. I helped someone with a similar system and created my own implementation of it in this thread. You can see the API here and the implementation here.
  9. The getBiomeSpecificBlockState method fires the BiomeEvent.GetVillageBlockID event, which allows you to change the IBlockState returned by it based on the Biome. To change the IBlockState: Subscribe to the event. Note that it's fired on MinecraftForge.TERRAIN_GEN_BUS rather than MinecraftForge.EVENT_BUS. Check that the Biome is Ice Plains. Use BiomeEvent.GetVillageBlockID#getOriginal to get the original IBlockState. Set the replacement IBlockState with BiomeEvent.GetVillageBlockID#setReplacement. Set the event's result to Event.Result.DENY with Event#setResult to use the replacement IBlockState instead of the original.
  10. That's not the full FML log, that's the console output. It does show that this error is happening multiple times a second: The server is sending invalid chunk data, which could be the cause of the framerate drops. I don't think there's much you can do about this, apart from telling the server to fix the issue or playing on a different server. Please post the actual FML log from a session where you experienced the issue, gave Minecraft 2 GB or RAM and didn't have any mods installed (apart from Forge).
  11. Store the World in the constructor (i.e. on the network thread), but only call World#getEntityByID in the run method (i.e. on the main thread). That looks correct, yes.
  12. It looks correct, apart from this: When you create a Slot, you pass it an inventory (IItemHandler) and a slot index (the slot in that inventory to read from/write to). Two instances of the same Container class will generally have Slots with the same inventories and slot indexes. Your villager Containers should have one Slot for slot 0 of the villager's inventory (the only slot) and 36 Slots for slots 0-35 of the player's inventory (the main inventory section).
  13. In addition to what diesieben07 said, that's not the FML log, that's the console output. There's also no crash in the log you posted. Please post the actual FML log from a session where Minecraft crashes.
  14. Do this by uploading to Gist and linking it here. Don't copy the log directly into your post.
  15. Which version of Minecraft are you using? Does this happen without any mods installed (just Forge)? Upload the FML log (logs/fml-client-latest.log in the game directory) from a session where this framerate drop occurs to Gist and link it here.
  16. You can also use the ChunkPos(BlockPos) constructor to convert a BlockPos to a ChunkPos.
  17. Use your IDE to search for the class by name. In IDEA, use Ctrl-N or Navigate > Class. In Eclipse, use Ctrl-Shift-T or Navigate > Open Type.
  18. InitMapGen is fired when ChunkProviderOverworld/ChunkProviderHell initialise their MapGenBase instances, you can use this to replace or modify them. InitMapGenEvent#getType will return InitMapGenEvent.EventType.VILLAGE when the MapGenBase being initialised (InitMapGenEvent#getOriginalGen) is a MapGenVillage.
  19. "Chat" components were renamed to "Text" components in 1.9. ChatComponentText is now TextComponentString, EnumChatFormatting is now TextFormatting. This issue tracker documents most renames in 1.8+. You can also use MCPBot to find the current name of a field/method/parameter when you have its old name: Use the findf/findm/findp commands with the old MCP (deobfuscated) name and the old Minecraft version to find the SRG (obfuscated) name. Use the same command with the SRG name and the new Minecraft version (or omit the version argument for the current version) to find the current MCP name. Alternatively, use the fh/mh/ph commands with the SRG name to display the name history instead of just the current name.
  20. If you control the Block but not all the Items, it's best to handle the interactions in Block#onBlockActivated. If you control the Items but not the Block, it's best to handle the interactions in Item#onItemUse. If you control neither the Block nor the Items, you can handle the interactions using PlayerInteractEvent.RightClickBlock.
  21. In 1.8.9 (before item properties were added), this was handled by TextureCompass rather than the IItemPropertyGetters and overrides in the model.
  22. No, it's an instance field so you need to specify which instance to change the field's value for. If you get/set the value of a field or call a method with reflection more than once, you should use ReflectionHelper.findField/findMethod to look up the Field/Method object, store it in a private static field and then use it whenever you need to interact with the field/method. Looking up the Field/Method object is relatively slow, so you should only do it once.
  23. It's best to include the pack.mcmeta file so you're using the current resource pack format with lowercase names. LegacyV2Adapter is only meant for loading resource packs designed for previous versions of Minecraft and could be removed at some point in the future, so it's best not to rely on it.
  24. Do you have a pack.mcmeta file in src/main/resources with pack_format set to 3? If you don't, Forge will load your mod's resources using the LegacyV2Adapter IResourcePack wrapper. This means that your lang files will be loaded with the old mixed-case names (e.g. en_US.lang) rather than the new lower-case names (e.g. en_us.lang). If you do, your lang files should be loaded with lower-case names. Try refreshing your IDE project (i.e. click the "Refresh all Gradle projects" button in IDEA's Gradle window or re-run the eclipse Gradle task) and/or rebuilding it.
  25. That's close, but you're trying to call the constructor like a regular method instead of using the new operator, which won't compile. You're using MinecraftServer#getEntityWorld to get the World, but this is always dimension 0, which the player may not be in. You should use the player's World instead. You're also getting the villager from the World in the constructor, which is still called on the network thread. Don't do this, it's not safe to call methods like this from the network thread. The Runnable implementation doesn't have to be a named class, it could be an anonymous class or a lambda. If you want it to be named, I suggest making it a nested class of the IMessage or the IMessageHandler. You don't get a container out of an inventory, I'm not entirely sure what you're talking about. You can have multiple Container classes that interact with the same slots of an inventory without issue. For example, almost every Container includes the same slots of the player's inventory. An IItemHandler is a persistent inventory, it's generally created once when the containing object (e.g. an Entity or TileEntity) is created and read from and written to NBT with the containing object. A Container is a temporary view of specific slots of one or more inventories, it's generally created when a player opens a GUI and released for garbage collection when the GUI is closed. Its sole purpose is to handle client/server interaction and synchronisation for a GUI.
×
×
  • Create New...

Important Information

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