Everything posted by Choonster
-
Make it clearer that ItemTooltipEvent is client-only
In previous versions of Minecraft, it was possible to create a handler for ItemTooltipEvent in common code without crashing the dedicated server as long as you didn't reference any client-only classes. In 1.12, ItemTooltipEvent now references the client-only ITooltipFlag, which crashes the dedicated server with a ClassNotFoundException when you create a handler for the event in common code (unless you mark the handler method as client-only). I suggest moving the event to a client package or at least mentioning that it's client-only in the doc comment.
-
[1.12] Json recipes, what to do next?
You don't need to do anything, Forge automatically loads every file in the recipes directory of each mod's assets.
-
[1.12] JSON recipe input nbt insensitive
I made my own Ingredient class for this, but it would make sense for minecraft:item_nbt to create an NBT-sensitive Ingredient.
-
[Solved] Register Entities
Replace "modID" with your actual mod ID and include your mod ID in the unlocalised name (e.g. by making it the String form of the registry name ResourceLocation). The numeric ID can be any number unique to your mod, though it's probably easiest if you start from 0 and increment by 1 each time you register an entity. It's used in the entity spawn packet. You can see how I register my mod's entities here.
-
[Solved] Register Entities
The ResourceLocation parameter is the registry name of your entity, which should have your mod ID as the domain and a name unique within your mod as the path. This is just like the registry name of a Block, Item or other IForgeRegistryEntry implementation. The String parameter is the unlocalised name of your entity, used for translation/display purposes. I recommend using the String form of the registry name as the unlocalised name.
-
[Solved] Register Entities
Use EntityRegistry.registerModEntity in preInit to register an entity. Use RenderingRegistry.registerEntityRenderingHandler(Class<T>, IRenderFactory<? super T>) in preInit from a client-only class to register an entity renderer.
-
Is there a better way to do this?
Similar questions have been asked (and answered) here and here. I implemented a solution the to the latter thread myself, you can see the API here and the implementation here. This uses a World capability to store the Map<ChunkPos, IChunkEnergy> at runtime, but loads the IChunkEnergy and saves it to the chunk's data using ChunkDataEvent.Load/Save.
-
[1.12] Crafting Recipe class question
I'm pretty sure the recipe system we have now is what those comments are talking about, they just haven't been updated yet. Now that IRecipe extends IForgeRegistryEntry, you can add a recipe in code by registering an IRecipe object with ForgeRegistries.RECIPES; just like any other IForgeRegistryEntry. I think using the JSON system where possible is preferred, though.
-
1.10.2 How to make your block flammable
Override Block#getFlammability and Block#getFireSpreadSpeed.
-
Crashed
Once you've done this, make sure you don't install 1.11.2 mods in the 1.8.9 profile and vice versa.
-
1.11.2 Won't Install
Set a different game directory for each launcher profile.
-
[1.12] Recipes Not Working
Not that know of. Look at the examples I linked and the IRecipeFactory implementations in CraftingHelper.init.
-
[1.12] As of this moment can crafting recipes be added?
There have been a few other threads about this, including this one where I just explained how to add recipes to someone else.
-
[1.12] Recipes Not Working
Either use a JSON file for the recipe (recommended) or create the recipe in code and register it with ForgeRegistries.RECIPES. Those methods are deprecated and non-functional (and will probably be removed). I have some examples of recipe files here and the recipe/ingredient classes used by them (apart from the Vanilla/Forge ones) here. LexManos has some prototype examples here.
-
[1.12] Recipes Not Working
"Not working" doesn't tell us anything. If you want help with a problem, describe exactly what's not working and post the relevant code.
-
Why still no BukkitAPI build-in Forge server?
Bukkit is dead, so nobody's going to develop a Bukkit API for modern versions of Forge. Sponge is plugin API that was created after the death of Bukkit and supports both Vanilla and Forge.
-
Can old mods be used with new forge
Due to the nature of Minecraft and Forge, Forge mods only support the Minecraft version that they were built for. The exceptions to this rule occur when not much was changed between Minecraft versions. 1.8.9 can load 1.8.8 mods, 1.10.2 can load 1.9 - 1.10 mods and 1.11.2 can load 1.11 mods.
-
1.11.2 Won't Install
Post the FML log (logs/fml-client-latest.log in the game directory) using Gist.
-
Crashed
You probably still have the 1.12 version of Optifine installed in the same mods directory used by your 1.8.9 profile. You should set each profile to have its own game directory in the launcher, allowing them to have their own set of mods installed.
-
I can't seem to be able to install forge 1.12 on a mac...
How did you install Forge? You need to use the installer to install all the libraries required by Minecraft and Forge.
-
Items Not Collectible / Add Pause
There shouldn't need to be any pause between spawning items. What's more likely is that you're spawning the items on both the logical client and server, when you should only be doing so on the server. See Forge's documentation for an explanation of sides. If this isn't the case, post your actual code.
-
How to View Code of Minecraft Mobs
If you've set up your workspace correctly, the Minecraft and Forge source code should be available as the forgeSrc-<forgeVersion> referenced library. You can either browse to a class in the library or use Navigate > Class (Ctrl-N) in IDEA or Navigate > Go To > Type... in Eclipse. The Ender Dragon is implemented in the net.minecraft.entity.boss.EntityDragon class.
-
[1.12] Recipe registry
There should be an error in the log telling you why your recipes failed to load. You can't use "block" for ingredients/results (since Blocks don't exist in inventories), you need to use "item" with the registry name of the Block's Item form. Make sure you're using a recent version of Forge, recipe loading wasn't in the first few 1.12 versions. Your Git repository should contain everything necessary to build your mod, including the Gradle buildscript and wrapper. See my mod and its .gitignore file for an example of which files to include.
-
[1.12] Recipe registry
Those haven't changed in 1.12, add them in init as you would in earlier versions.
-
[1.12] Recipe registry
Just create JSON files for your recipes in the assets/<modid>/recipes directory and Forge will automatically load them. You don't need to tell it to do so. I have some examples of recipe files here and the recipe/ingredient classes used by them (apart from the Vanilla/Forge ones) here.
IPS spam blocked by CleanTalk.