Everything posted by Choonster
-
json recipes not registering?! [solved]
Any Item that has subtypes (i.e. Item#getHasSubtypes returns true) requires the metadata to be specified with the data property when used in JSON recipes. I explained this here. ItemMeshDefinitions are registered with ModelLoader.setCustomMeshDefinition, just as before.
-
json recipes not registering?! [solved]
Have you checked for errors in the log? Side note: I previously said that newer versions of Forge continue loading recipes for a mod after encountering an error, but this is incorrect. I thought that this issue had already been fixed, but it hasn't.
-
json recipes not registering?! [solved]
Try deleting and recreating your IDE project. I initially had the same issue where assets weren't being copied to the IDE's output directory, but deleting and recreating the project fixed it. Item (and other IForgeRegistryEntry) instances should either be created in field initialisers or in the corresponding registry event, not in preInit. Models should be registered in ModelRegistryEvent. If your event handlers aren't being called, make sure you've registered them (either manually or with @Mod.EventBusSubscriber). If you've made these changes and are still having issues, update your repository and describe the issues.
-
json recipes not registering?! [solved]
I'm not sure what would cause that. Have you set up your IDE project by following these instructions? Update your code on GitHub and I'll try to reproduce and debug it locally.
-
[1.10] Item texture questions
IModel is the model in its raw form, which can be baked into an IBakedModel. IBakedModel is the model in a form optimised for being uploaded to the GPU. ICustomModelLoader is responsible for loading the IModel.
-
[1.11.2] Block metadata questions
The chunk will redraw any time the state saved to metadata changes, but not when the actual state changes (because the actual state could change at any time). You need to call World#notifyBlockUpdate to trigger a chunk redraw. Since there's no callback for blocks n positions above a block changing, you'll need to periodically check whether the block can see the sky and redraw the chunk if that changes. Since you need to store this somewhere and redraw the chunk when it changes, you may as well store in the metadata rather than setting it from the actual state. Depending on how frequently you want to check this, you can either use a TileEntity that implements ITickable or schedule block updates (override Block#updateTick to perform the check and call World#scheduleUpdate from Block#onBlockAdded and Block#updateTick).
-
json recipes not registering?! [solved]
Your repository should include the Gradle Wrapper (gradlew, gradlew.bat and the gradle directory) so people building your mod don't need to have Gradle installed locally. You're using an old version of Forge which stops loading recipes for a mod as soon as an exception is thrown, newer versions continue loading recipes and log every exception that's thrown. I ran your mod with its current version of Forge and this exception was logged: You need to specify the metadata using the data property for any Item that has subtypes. I tried updating to a newer version of Forge, but you're still using GameRegistry.register, which is private in newer versions. You need to use the registry events instead.
-
[1.12] [SOLVED] KeyInputEvent get keyPressed
Vanilla methods/fields have more than one name: there's the Notch name (Mojang's obfuscated names that change each version), the SRG name (MCP's auto-generated names that remain stable between versions) and the MCP name (MCP's community-assigned deobfuscated names). Forge deobfuscates from Notch to SRG names at runtime, so you never need to worry about Notch names. For normal code, ForgeGradle reobfuscates from MCP to SRG names at build time, so you don't need to worry about the names. For reflection, you need to check both the SRG and the MCP names for vanilla fields and methods yourself. The easiest way to do this is by using Forge's ReflectionHelper.findMethod/findField methods. These don't throw any checked exceptions, so you can use them directly in the field initialiser of the Method/Field field. You can use MCPBot to find the SRG name of a method/field.
-
[1.10] Item texture questions
To overlay things on your model, you'll need to create your own IModel/IBakedModel/ICustomModelLoader implementations. Forge has several examples of these. The SimpleModelFontRenderer class added to Forge in 1.11.2 allows you to render text on models. If there are a fixed number of variations, you can register them all with ModelBakery.registerItemVariants and then register an ItemMeshDefinition that selects the model based on some aspect of the ItemStack (e.g. metadata, NBT, capabilities). If the variants are dynamically-generated, you'll need your own model implementation. I can't really help you with the specifics of your model implementation, you'll need to look for examples in Forge or open-source mods.
-
[1.10.2] Redstone-triggered particles
Are you definitely registering an instance of this class? Post your registration code and the class that calls it. Also post the code where you create your creative tabs.
-
[1.12] Disabling recipes in configuration
You can add your own conditions by implementing IConditionFactory and specifying the class in your _factories.json file. You can then use these conditions to enable/disable JSON recipes at load time.
-
[1.12] Add custom nbt tags to vanilla mobs.
You need to call CapabilityManager#register in a method called in preInit, you can't call it in a field initialiser because it returns void. The Class object you pass as the first argument of CapabilityManager#register (IShave.class) is the same Class object you need to pass to the @CapabilityInject annotation to inject the Capability instance into a field. You need to attach a provider for your capability to the entity using AttachCapabilitiesEvent<Entity>. I have several examples of capabilities in my mod. You can see the APIs here and the implementations here.
-
json recipes not registering?! [solved]
Do you get any errors in the logs?
-
How to get server name on server-side mod?
You can use DedicatedServer#getStringProperty to get a property from the server.properties file, even if it's never used by Minecraft.
-
How to get server name on server-side mod?
As far as I can tell, the server-name property is never used by Minecraft 1.12. The wiki says here that the server-name property was only ever used by Minecraft Classic.
-
How to get server name on server-side mod?
What name are you talking about? Where is this name shown?
-
Replace a class
You can probably achieve this using RenderLivingEvent.Pre/Post or by adding a LayerRenderer to the Render. Botania renders its baubles and other items with this LayerRenderer. As an example, the cosmetic baubles are rendered by this method.
-
Replace a class
What's your overall goal? Tell me what you want to do (in terms of what the player will see/do), not how you want to do it.
-
Replace a class
This isn't possible. What are you trying to achieve? There's almost certainly a way to do it without needing to replace a whole class.
-
1.11.2 Crashing
Delete it from the mods directory.
-
1.11.2 Crashing
You have a 1.7.10 coremod installed, which won't work on 1.11.2. You should give each version its own game directory, you can configure this in the launcher. In future, please post the FML log (logs/fml-client-latest.log in the game directory) using Gist or Pastebin. This contains more information than the launcher's game output window and uploading it to Gist/Pastebin makes it easier to read.
-
[1.11.2] [Solved] Item Variant from NBT
Your blockstates file has two properties (game and facing), but the ModelResourceLocation you return from the ItemMeshDefinition only includes one of them. It needs to include both, in alphabetical order. You should also call ModelBakery.registerItemVariants with every possible ModelResourceLocation that can be returned by the ItemMeshDefinition to ensure that they're loaded by Minecraft.
-
1.12 Recipes
No, you don't need to register JSON recipes yourself; Forge automatically loads and registers them. Is the recipe in the correct directory? It should be in assets/<modid>/recipes. Are there any errors in the log?
-
Skins derping out
This is in the Support & Bug Reports section, which is for mod users rather than mod developers. Issues with a specific mod are best reported directly to the author, though.
-
Installer
The Forge installer you downloaded is for Minecraft 1.8. You need to download one for 1.12, e.g. 1.12-14.21.1.2387 (the current Recommended version).
IPS spam blocked by CleanTalk.