Jump to content

vemerion

Members
  • Posts

    390
  • Joined

  • Last visited

  • Days Won

    15

Posts posted by vemerion

  1. 6 hours ago, EveryBlu said:

    I mean how do I get a reference of my listener in another class to call these methods? Vanilla code for example gets the RecipeManager via:

    You should save a reference to it before you register it in AddReloadListenerEvent and then you can access that reference from wherever you need it. Here is an example of how Forge itself does it for the LootModifierManager.

  2. 4 hours ago, EveryBlu said:

    No like how do I use my new PreperableReloadListener, I know how to set it up now and register it, I just need to know how to use it in other classes.

    That completely depends on what your listener is for. For example, the vanilla RecipeManager has a method 'getRecipeFor()' which is used in various places, one of them being the furnace to see if an item can be smelted.

  3. 18 hours ago, EveryBlu said:

    I want to create a registry for a custom data file in a data-driven system I'm trying to make. I know how to use forge's built-in registries (for items, blocks, etc), but I have no idea how to setup my own, let alone one for a custom type of data pack file. Any help is appreciated.

    To create your own data driven system you can extends PreparableReloadListener (or its subclass SimpleJsonResourceReloadListener) and then register it in AddReloadListenerEvent.

  4. 6 hours ago, EDGW_ said:

    I created a texture with transparent parts for the block model, but the transparent parts of the texture were rendered black.

    How can I render those parts transparent?

    You need to add this field to the model json file of your block

    "render_type": "minecraft:cutout"

    or

    "render_type": "minecraft:translucent"

    depending on if if those parts are semi-transparent or fully transparent.

  5. 6 hours ago, MatNX said:

    Provider is fairly straightforward, here you go. Thanks for the fast response and the tip!

    Hmm, I don't see any problems with the code. You could try debugging and put breakpoints in saveNBTData() and loadNBTData() to see make sure that the methods are called and that the code in the methods works as expected.

  6. 20 minutes ago, MatNX said:

    Either way, I'm not sure where to go, so any help would be greatly appreciated.

    Can you post the code for your capability provider? Also, you can use NbtUtils.writeBlockPos()/readBlockPos() to more easily write/read BlockPos to/from NBT.

  7. 7 hours ago, RaguRaccoon said:

    I always thought the bounding box and hitbox of an entity were the same. From what I have looked up they are the same, but if anyone knows otherwise please do tell me. Anyway at this point I am just considering creating a new projectile and hoping it won't have the same issue.

    The collision in this case is calculated using ProjectileUtil.getHitResult() which uses a slightly different bounding box than the bounding box of the projectile. But that bounding box should be bigger so should not be a problem. Your best bet might be to try and place some breakpoints and step throught the code to try and figure out why the collision does not work.

×
×
  • Create New...

Important Information

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