Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoLezury committed Jul 27, 2024
1 parent b964e98 commit c2e8a42
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private static void onRenderLevelStage(RenderLevelStageEvent event) {
Player owner = flail.getPlayerOwner();
if (owner != null) {
int hand = owner.getMainArm() == HumanoidArm.RIGHT ? 1 : -1;
if (!owner.getMainHandItem().is(AAItemTags.FLAILS)) {
if (!owner.getMainHandItem().is(AAItemTags.FLAILS) && owner.getOffhandItem().is(AAItemTags.FLAILS)) {
hand = -hand;
}
boolean rightHand = (owner.getMainArm() == HumanoidArm.RIGHT && owner.getMainHandItem().is(AAItemTags.FLAILS)) || (owner.getMainArm() == HumanoidArm.LEFT && owner.getOffhandItem().is(AAItemTags.FLAILS));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import net.minecraft.world.item.enchantment.EnchantmentHelper;
import net.minecraft.world.level.Level;
import team.leomc.assortedarmaments.AACommonConfig;
import team.leomc.assortedarmaments.entity.FlailOwner;
import team.leomc.assortedarmaments.entity.ThrownFlail;
import team.leomc.assortedarmaments.tags.AAItemTags;

Expand Down Expand Up @@ -94,7 +95,7 @@ public void onUseTick(Level level, LivingEntity livingEntity, ItemStack stack, i
living.knockback(knockback * 0.5F, Mth.sin(player.getYRot() * Mth.DEG_TO_RAD), -Mth.cos(player.getYRot() * Mth.DEG_TO_RAD));
}
}
if (player.getTicksUsingItem() >= AACommonConfig.flailThrowMinUseDuration && !player.isCrouching()) {
if (player.getTicksUsingItem() >= AACommonConfig.flailThrowMinUseDuration && !player.isCrouching() && !(player instanceof FlailOwner owner && owner.getFlail() != null)) {
player.stopUsingItem();
ThrownFlail flail = new ThrownFlail(level, player);
flail.setItem(stack);
Expand Down

0 comments on commit c2e8a42

Please sign in to comment.