Jump to content

Choonster

Moderators
  • Posts

    5117
  • Joined

  • Last visited

  • Days Won

    75

Everything posted by Choonster

  1. Read Paint_Ninja's message again, there's an additional requirement that you're not meeting.
  2. Use DamageSource#getDirectEntity to get the projectile entity.
  3. The debug.log includes the crash report and other information, there's no need to post crash reports separately. Regardless, 1.16.3 is no longer supported on this forum.
  4. It's entirely possible for crafting table recipes to customise their output (including setting NBT/damage) by overriding IRecipe#assemble. I have a recipe that does a similar thing for armour here.
  5. ServerChatEvent was overhauled in the 1.19.1 update to support the secure chat system, it's probably not going to be possible to fix this without updating to 1.19.1 or 1.19.2.
  6. If you look at the loot table for cows, you'll see that it checks whether the entity is on fire to determine whether to drop steak; not whether the tool has Fire Aspect.
  7. I never found a way to ignore the errors; but I eventually replaced HWYLA with Jade, which doesn't have this issue.
  8. Instead of using an interface and extending the vanilla entity classes, could you use a capability? You could have a base class with the shared logic and then entity-specific implementations attached to different entity classes. If you need to do stuff every tick, you'd need to use LivingUpdateEvent.
  9. ObfuscationReflectionHelper methods always take SRG names, even in the development environment. In development, the SRG name is automatically remapped to the corresponding MCP name.
  10. The second argument of withExistingParent is the path to a model file to use as a parent, not a texture. For basic block items, the model normally uses the block model as the parent, rather than specifying individual textures. I use this helper method in my BlockStateProvider implementation to generate block item models that simply extend the block model. You can see an example of this here. On a side note, the DeferredRegister instance should always be created in the same class as it's used in; don't put the DeferredRegister and RegistryObject fields in separate classes.
  11. NBTIngredient doesn't have an of method itself, you're actually calling Ingredient.of. You need to create an instance of NBTIngredient directly (or a class that extends it, since the constructor is protected).
  12. Java doesn't have ref either, but does have tuples (from Minecraft and Apache Commons Lang).
  13. Thanks, I think that makes sense. I've tried to follow this advice and clean up all my DistExecutor code in this commit, does this look correct?
  14. I have a packet that's sent to the client to open a GUI, which I'm using DistExecutor to do. The packet's handler method does the following: DistExecutor.safeRunWhenOn(Dist.CLIENT, () -> ClientOnlyNetworkMethods.openClientScreen(message)) ClientOnlyNetworkMethods.openClientScreen currently looks like this: public static DistExecutor.SafeRunnable openClientScreen(final OpenClientScreenMessage message) { return new DistExecutor.SafeRunnable() { @Override public void run() { ClientScreenManager.openScreen(message.getId(), message.getAdditionalData(), Minecraft.getInstance()); } }; } ClientScreenManager is a client-only class that handles opening the GUI. As you can see from the code, I need to pass arguments from the packet to the client-only method; which rules out using a method reference as the SafeRunnable implementation. When I replace the anonymous class implementation of SafeRunnable in ClientOnlyNetworkMethods.openClientScreen with a lambda, DistExecutor.validateSafeReferent throws an "Unsafe Referent usage found in safe referent method" exception. From what I can see, using any non-lambda implementation of SafeReferent simply bypasses the safety checks in validateSafeReferent but doesn't necessarily mean that the code is safe. The current code with the anonymous class does seem to work on the dedicated server, but is this the correct way to use DistExecutor; or is there a better way to do it?
  15. Yes, that probably would have been a useful feature. It's a shame that the author didn't have time to complete it.
  16. Part of the idea with my system was to allow syncing capabilities attached to arbitrary items, not just items that know about their capabilities. What would you recommend for capabilities attached to items from Vanilla or another mod?
  17. I've had a brief look at this and can't see any easy way to work around it, so I've created a suggestion thread for a change here: I'm not sure if it will go anywhere.
  18. I have a system for syncing item capability data that uses ICapabilityListener, as explained here: I discovered in that thread that this pull request for 1.12.2 back in 2017 partially broke my system by changing Container#detectAndSendChanges to only call IContainerListener#sendSlotContents if a slot's Item, count or share tag has changed; which often won't be the case for capability-only updates. The change does make sense for Vanilla IContainerListener implementations to reduce unnecessary network traffic, but would it be possible to allow modded IContainerListeners to opt-in to having sendSlotContents called even if the Items, counts and share tags are equal?
  19. It looks like Forge patches Container#detectAndSendChanges to only call IContainerListener#sendSlotContents if a slot's Item, count or share tag has changed; which often won't be the case for capability-only updates. I may need to re-evaluate the IContainerListener system to see if there's any way around this. This change was actually introduced in August 2017 for 1.12.2, six months after I created my system. I thought it was working more recently than that, but I must not have tested it properly.
×
×
  • Create New...

Important Information

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