Skip to content

Commit

Permalink
fixed sharpness not appearing for sharp weapons
Browse files Browse the repository at this point in the history
Signed-off-by: June <[email protected]>
  • Loading branch information
Khazoda committed Nov 8, 2024
1 parent 6f81393 commit 0502c22
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,16 @@ private void onGetApplicableItems(CallbackInfoReturnable<RegistryEntryList<Item>
private void onIsAcceptableItem(ItemStack stack, CallbackInfoReturnable<Boolean> cir) {
if (stack.isIn(BWTags.BASIC_WEAPONS)) {
String enchantDesc = ((Enchantment) (Object) this).toString().toLowerCase();
var a = enchantDesc.toLowerCase();
var c = stack.isIn(BWTags.NO_SWEEPING);
var d = stack.isIn(BWTags.BLUNT_WEAPONS);

// Block sweeping edge for weapons that shouldn't have it
if (stack.isIn(BWTags.NO_SWEEPING) && enchantDesc.contains("sweeping")) {
cir.setReturnValue(false);
return;
}

// Block sharpness for blunt weapons
else if (stack.isIn(BWTags.BLUNT_WEAPONS) && enchantDesc.contains("sharpness")) {
// Block sharpness only for blunt weapons
if (stack.isIn(BWTags.BLUNT_WEAPONS) && enchantDesc.contains("sharpness")) {
cir.setReturnValue(false);
} else {
cir.setReturnValue(true);
}
}
}
Expand All @@ -80,6 +76,7 @@ private void onIsPrimaryItem(ItemStack stack, CallbackInfoReturnable<Boolean> ci
// Block sweeping edge for weapons that shouldn't have it
if (stack.isIn(BWTags.NO_SWEEPING) && enchantDesc.contains("sweeping")) {
cir.setReturnValue(false);
return;
}

// Block sharpness for blunt weapons
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"#basicweapons:enchantable/sharp_basic_weapon"
]
}

0 comments on commit 0502c22

Please sign in to comment.