Skip to content

Commit

Permalink
fix(swords): disable entity invulnerability on hit and update sword b…
Browse files Browse the repository at this point in the history
…alance- Remove entity invulnerability when hit by Blaze Sword or Crystal Sword

- Adjust Blaze Sword attack speed to default sword value
- Update mod version to1.3.9.0-alpha2
  • Loading branch information
cnlimiter committed Nov 15, 2024
1 parent 74f9de8 commit 7bdd24d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ mod_id=avaritia
mod_name=Re-Avaritia-forged
mod_license=MIT
mod_version=1.3.9.0
mod_version_tag=alpha1
mod_version_tag=alpha2
mod_group_id=committee.nova.mods
mod_authors=cnlimiter, Asek3, MikhailTapio
mod_description=Are you the type of modded Minecraft player that makes a beeline for the designated \"end game\" and then gives up on ever playing again once you get there? Do you wish there was a way to make the process take significantly longer? Do you love GregTech, but wish it weren't so short? Do you sit down on your chest full of Galgadorian Drills and wish there was a mod that didn't just hand things to you on a silver platter?\n\n \n\nThis might be the mod for you!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import net.minecraft.sounds.SoundSource;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResultHolder;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.SwordItem;
Expand All @@ -34,7 +35,7 @@
public class BlazeSwordItem extends SwordItem implements ITooltip, ISwitchable, InitEnchantItem {
private final String name;
public BlazeSwordItem(String name) {
super(ModToolTiers.BLAZE_SWORD, 0, -2.4f,
super(ModToolTiers.BLAZE_SWORD, 0, 0f,
new Properties()
.rarity(ModRarities.EPIC)
.stacksTo(1)
Expand Down Expand Up @@ -76,4 +77,11 @@ public void appendHoverText(@NotNull ItemStack stack, @Nullable Level level, Lis
level.playSound(player, player.getOnPos(), SoundEvents.SNOWBALL_THROW, SoundSource.NEUTRAL, 0.5F, 0.4F / (level.random.nextFloat() * 0.4F + 0.8F));
return InteractionResultHolder.success(heldItem);
}

@Override
public boolean onLeftClickEntity(ItemStack stack, Player player, Entity entity) {
entity.setInvulnerable(false);
return super.onLeftClickEntity(stack, player, entity);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public boolean onLeftClickEntity(ItemStack stack, Player player, Entity entity)
// 取消攻击冷却
serverPlayer.resetAttackStrengthTicker();
}
entity.setInvulnerable(false);
return super.onLeftClickEntity(stack, player, entity);
}

Expand Down

0 comments on commit 7bdd24d

Please sign in to comment.