Jump to content

Choonster

Moderators
  • Posts

    5120
  • Joined

  • Last visited

  • Days Won

    75

Posts posted by Choonster

  1. 3 hours ago, Torojima said:

    yeah, the links are not really helping me, I know them already and my json syntax is good...

    Edit: but it probably will help whoever is surfing in from somewhere reading this question :)

     

    Anyway, the package net.minecraftforge.oredict has been removed from forge?! That's the reason the old entries are no longer valid. I've changed them all to minecraft items (except a few tags using the forge versions for the metal parts) and now it works.

     

    Thus the correct answer would be to use the minecraft items in the recipes in 1.13.x since forge oredict is no longer available.

     

    Tags are the replacement for the Ore Dictionary. To my knowledge, every Ore Dictionary entry that was provided by Forge itself has been replaced with a corresponding item tag.

  2. 1 hour ago, thearcadegalaxy said:

    no i am not use command just double click to jar to create a file mods but nothing happen

     

    DaemonUmbra wasn't asking whether or not you were running it in the command prompt, they were telling you to run it in the command prompt to see if there's any error messages.

  3. 23 minutes ago, Xumuk said:

    Do you know if I need a java entity model for this animation or not?
    You are a Forge developer, maybe you know)

     

    I don't think you need an entity model (ModelBase). I don't have much experience with the animation system myself, so I can't tell you all that much about it.

     

    I have the Forge Modder title on this forum, but that just indicates that I make mods with Forge; I don't develop Forge itself.

  4. 7 hours ago, fcelon said:

    JSON models don't work like this in java edition. This looks like bedrock edition model format. Saddly, java edition JSON models don't support animations. If you want your model to have moving parts, it has to be done in code, not in JSON

     

    The OP is using Forge's model animation system, which requires specifying the animations in JSON files.

     

    Unfortunately, I can't really provide any further help on this topic.

  5. I have this method that gets a LazyOptional of a player's inventory IItemHandler and searches for the first slot with an item that matches a predicate. If it finds a valid item, it returns a LazyOptional of a single-slot IItemHandler that wraps that slot. If it doesn't, it returns an empty LazyOptional.

     

    Currently there's no direct way for LazyOptional#map to transform a non-empty LazyOptional into an empty one, so I've had to use EmptyHandler.INSTANCE as a sentinel value and call LazyOptional#filter to transform that value into an empty LazyOptional.

     

    My main concern is that LazyOptional#filter has a comment inside saying "Should we allow this function at all?" due to it being a non-lazy operation, so I'm somewhat reluctant to use it.

     

    Java's Optional#map allows the function to return null to create an empty Optional, but Forge's LazyOptional#map uses a NonNullFunction so returning null isn't an option.

     

    Is there a better way to map a non-empty LazyOptional into an empty one?

  6. 1 hour ago, TheRPGAdventurer said:

    After this, can i make my own blocks individually now? Like use the manual method of registering them one by one instead of just using getSubType()

     

    Yes, but you need to do this before you try to add any remapping.

     

    1 hour ago, TheRPGAdventurer said:

    As i understad this renames all of them right?

     

    Essentially, yes.

     

    When it finds your_mod:old_variant_block_with_subtypes in the save, it converts it to the new block based on the metadata:

    • If the metadata corresponds to the variant foobar, it's converted into your_mod:foobar_variant_block
    • If the metadata corresponds to the variant barbaz, it's converted into your_mod:barbaz_variant_block

    your_mod:foobar_variant_block and your_mod:barbaz_variant_block would be two separate instances of the same Block class.

  7. 4 minutes ago, DavidM said:

    Just realized that the method changed in the update.

    How would I get a Consumer<PacketBuffer> from a PacketBuffer? From a look of the source code, I assume it requires a method that writes to another PacketBuffer, something like PacketBuffer#writeBytes?

     Thanks.

     

    Instead of constructing the PacketBuffer, writing to it and then calling openGui, simply call openGui with a lambda function that writes to the supplied PacketBuffer. Forge constructs the PacketBuffer for you.

    • Like 1
  8. 7 hours ago, Cadiboo said:

    What: Not using static initialisers.
    Why: Using static initialisers does not allow you to control when your objects are created or the order in which your objects are created.
    Consequences: Using static initialisers prevents other mods from overriding your objects, prevents forge from being able to dynamically load/unload mods and can cause weird, unreproducible crashes.
    How: Use the @ObjectHolder annotation if you need static references to your objects and create & register your objects in the appropriate registry event. (Note: before registry events Modders created and registered their items in preInit. This practice became out of date in 1.7 with the introduction of registry events, and is no longer possible in 1.13).

    What: Using @Override.
    Why: Using @Override tells the compiler that you intend to override a method. This lets your IDE warn you about bugs before they happen.
    Consequences: When you update your mod to a new minecraft version/ update your mappings/ update your Forge version and don’t use @Override, methods will silently stop overriding what they should override due to name changes, and will fail to ever be called, resulting in unexpected behaviour, crashes and bugs.
    How: Just annotate methods you intend to override with the @Override annotation.

     

     

    Your most recent few posts with these pre-written snippets of advice have been poorly formatted on the dark theme:

     

    image.thumb.png.4beb7a8f3da8f5f0f3ee10e521e3e593.png

     

    To fix it, you should be able to use the Tx (Remove Format) button and then re-apply the code formatting to the necessary parts.

     

    Normally I'd PM you this, but unfortunately the forum wants me to delete a whole lot of PMs in my inbox before I can send another one.

    • Thanks 1
  9. You'll need to create your own IRecipe implementation (optionally extending an existing one like ShapelessRecipes) that implements IRecipe#getRemainingItems to return the appropriate remaining items.

     

    You'll also need an IRecipeFactory to parse your recipe from JSON, this needs to be registered in _factories.json.

     

    You can see some examples of custom recipes and factories here and the _factories.json file here.

  10. On 2/13/2019 at 2:29 AM, diesieben07 said:

    There is no need to instantiate registry entries in the registry events.

     

    Thanks, that makes sense. I'm wondering how this approach would work in 1.13 with its removal of the current lifecycle events such as preInit.

     

    The closet equivalent would be the mod construction event (don't have the exact name at the moment), but I think that the documentation only suggests initialising registry entries in the appropriate registry events. 

  11. I'd be curious to know what the proper way to handle records is. I've just realised that my record item hasn't worked since I switched to instantiating registry entries in registry events; because the SoundEvent passed to the constructor doesn't yet exist when RegistryEvent.Register<Item> is fired.

     

    It's possible to override ItemRecord#getSound to return the SoundEvent directly (ignoring the ItemRecord#sound field), but this requires adding the record to the ItemRecord.RECORDS map manually so that Minecraft will display the record name above the hotbar when it's played.

     

    Is there a better way to do this?

×
×
  • Create New...

Important Information

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