Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Choonster

Moderators
  • Joined

  • Last visited

Posts posted by Choonster

  1. Posted

    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.

  2. ·

    Edited by Choonster

    25 minutes ago, drok0920 said:

    Ok so this is what i should do?  

    
    EntityRegistry.registerModEntity(new ResourceLocation("modID", "leadBullet"), EntityLeadBullet.class, "leadBullet", 100, GunMod.instance, 0, 1, true);

     

    Also does id matter? (where i just temporarily put 100) like is it id within the mod or within the game.

     

    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.

  3. ·

    Edited by Choonster

    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.

  4. 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.

  5. 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.

  6. 4 hours ago, ctbe said:

    I have the same question. It'd be nice to know what are the plans.

     

    I think, though I could be wrong, that they are working on making another way for adding crafting recipes as the TODO comments talk about making IRecipe a registry. If whatever comes new doesn't use the same name for methods (addShapedRecipe, addShapelessRecipe, etc), then your RecipeManager class would need a substantial re-writing. For the moment being I think it is better to keep it for reference and re-write it when the time comes, if it ever comes. If once this forge version comes out of beta it results that there is no similar way to add recipes in code then I would remove it. But I'd keep it for now. Just for reference until then.

     

    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.

  7. 4 hours ago, DazDrag said:

    so what i must do? delete the optifine or what?

     

    On 2017-6-23 at 4:13 PM, Choonster said:

    You should set each profile to have its own game directory in the launcher, allowing them to have their own set of mods installed.

     

    Once you've done this, make sure you don't install 1.11.2 mods in the 1.8.9 profile and vice versa.

  8. 5 hours ago, Zanadu said:

    I also have a world on 1.7.10. I wanted to start a new world on 1.11.2. To do that I have to get rid of my world on 1.7.10? Can't I have both worlds?

     

    Set a different game directory for each launcher profile.

  9. 2 minutes ago, benjamin7006 said:

    Ok Thank You, Is There Any Tutorial On This? Like On The Wiki Or The Forums

     

    Not that know of. Look at the examples I linked and the IRecipeFactory implementations in CraftingHelper.init.

  10. ·

    Edited by Choonster

    5 minutes ago, benjamin7006 said:

    So Basically I'm Trying To Create A Recipe, I Tried To Create A Recipe Using The Old Method 

    
    		GameRegistry.addRecipe(name, recipe);
    		GameRegistry.addShapedRecipe(name, output, params)
    		GameRegistry.addShapelessRecipe(name, output, params);

    I Knew That This Was Updated So, I Was Hoping That Forge Has Updated Their API So We Can Create Recipes

     

    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.

  11. 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.

  12. 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.

  13. ·

    Edited by Choonster

    27 minutes ago, Kokkie said:

    Okay, thanks!

    Actually, they aren't working D:

    For my code etc. go to my github.

    https://github.com/KokkieBeer/Auto-Miner/tree/master/src/main/resources/assets/am/recipes

     

    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.

  14. ·

    Edited by Choonster

    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.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.