Commit eae49404 by Jonathan Thomas

Fixed bug which caused a max friend to interact with both off hand + main hand,…

Fixed bug which caused a max friend to interact with both off hand + main hand, causing both a message + riding (only check main hand now)
parent a6c71ed6
......@@ -13,6 +13,7 @@ All notable changes to **CreatureChat** are documented in this file. The format
### Fixed
- Fixed a bug which broadcasts death messages for any mob with a customName (now it must also have a character sheet)
- Prevent crash due to missing texture when max friend/enemy + right click on entity
- Fixed bug which caused a max friend to interact with both off hand + main hand, causing both a message + riding (only check main hand now)
## [1.2.0] - 2024-12-28
......
......@@ -27,6 +27,16 @@ public class MixinMobEntity {
@Inject(method = "interact", at = @At(value = "RETURN"))
private void onItemGiven(PlayerEntity player, Hand hand, CallbackInfoReturnable<ActionResult> cir) {
// Only process interactions on the server side
if (player.getWorld().isClient()) {
return;
}
// Only process interactions for the main hand
if (hand != Hand.MAIN_HAND) {
return;
}
ItemStack itemStack = player.getStackInHand(hand);
MobEntity thisEntity = (MobEntity) (Object) this;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment