-
Posts
5161 -
Joined
-
Last visited
-
Days Won
76
Everything posted by Choonster
-
[1.8.9] Help with rendering EntityThrowable
Choonster replied to bignose956's topic in Modder Support
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. -
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.
-
There are already experimental builds of Forge for 1.12 available, but they're not ready for general use.
-
1.7.10 is no longer supported on this forum, update if you want help.
-
1.7.10 is no longer supported on this forum, update if you want help.
-
Gradle generates the Eclipse project when you run the eclipse task. Forge's documentation explains how to set up a development environment here.
-
How can I create a fluid pipe system? 1.7.10
Choonster replied to PREXTAIL's topic in Modder Support
1.7.10 is no longer supported on this forum, update if you want help. -
[1.10.2] [SOLVED] Saving additional information to chunk data
Choonster replied to Bektor's topic in Modder Support
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. -
[1.11.2] Editing Vanilla Structure Generation
Choonster replied to Paladin's topic in Modder Support
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. -
Frame Lag Seemingly caused by Forge
Choonster replied to BazzaBlogz's topic in Support & Bug Reports
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). -
[1.11.2] [Unsolved] Accessing an entity's gui container
Choonster replied to OrangeVillager61's topic in Modder Support
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. -
[1.11.2] [Unsolved] Accessing an entity's gui container
Choonster replied to OrangeVillager61's topic in Modder Support
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). -
Minecraft Forge crashing when trying to start up game
Choonster replied to Selphia's topic in Support & Bug Reports
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. -
Minecraft Forge crashing when trying to start up game
Choonster replied to Selphia's topic in Support & Bug Reports
Do this by uploading to Gist and linking it here. Don't copy the log directly into your post. -
Frame Lag Seemingly caused by Forge
Choonster replied to BazzaBlogz's topic in Support & Bug Reports
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. -
[1.10.2] [SOLVED] Saving additional information to chunk data
Choonster replied to Bektor's topic in Modder Support
You can also use the ChunkPos(BlockPos) constructor to convert a BlockPos to a ChunkPos. -
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.
-
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.
-
"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.
-
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.
-
In 1.8.9 (before item properties were added), this was handled by TextureCompass rather than the IItemPropertyGetters and overrides in the model.
-
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.
-
[1.11.2] Lang file not loading properly?
Choonster replied to IceMetalPunk's topic in Modder Support
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. -
[1.11.2] Lang file not loading properly?
Choonster replied to IceMetalPunk's topic in Modder Support
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. -
[1.11.2] [Unsolved] Accessing an entity's gui container
Choonster replied to OrangeVillager61's topic in Modder Support
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.