Skip to content

Commit

Permalink
remove experimental retribution enchantment (still a WIP!)
Browse files Browse the repository at this point in the history
  • Loading branch information
ExDrill committed Jul 30, 2023
1 parent c05e537 commit 0307a72
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 23 deletions.
2 changes: 2 additions & 0 deletions src/main/java/com/teamabode/guarding/Guarding.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,13 @@ public class Guarding implements ModInitializer {
builder.addFloatProperty("additional_knockback_strength_per_level", 0.15f);
return builder;
})
/*
.addGroup("retribution", builder -> {
builder.addIntProperty("slowness_amplifier", 1);
builder.addBooleanProperty("is_treasure", true);
return builder;
})
*/
.build();

public void onInitialize() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ public int getMaxLevel() {
}

public boolean isTreasureOnly() {
return Guarding.CONFIG.getGroup("retribution").getBooleanProperty("is_treasure");
return false;
//return Guarding.CONFIG.getGroup("retribution").getBooleanProperty("is_treasure");
}

protected boolean checkCompatibility(Enchantment other) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class GuardingCallbacks {

public static void init() {
GuardingEvents.SHIELD_BLOCKED.register(GuardingCallbacks::onShieldBlock);
GuardingEvents.SHIELD_DISABLED.register(GuardingCallbacks::onShieldDisabled);
//GuardingEvents.SHIELD_DISABLED.register(GuardingCallbacks::onShieldDisabled);
}

// Logic for blocking
Expand Down Expand Up @@ -99,6 +99,7 @@ private static void tryParryEffects(Player user, Entity sourceEntity, boolean is

// Handles the code for the Retribution Enchantment
private static void onShieldDisabled(Player user, LivingEntity attacker) {
/*
ItemStack useItem = user.getUseItem();
int retributionLevel = EnchantmentHelper.getItemEnchantmentLevel(GuardingEnchantments.RETRIBUTION, useItem);
int amplifier = Guarding.CONFIG.getGroup("retribution").getIntProperty("slowness_amplifier");
Expand All @@ -110,6 +111,7 @@ private static void onShieldDisabled(Player user, LivingEntity attacker) {
livingEntity.addEffect(new MobEffectInstance(MobEffects.MOVEMENT_SLOWDOWN, retributionLevel * 50, amplifier, true, true));
}
}
*/
}

// The condition for retribution to apply
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
public class GuardingEnchantments {
public static final Enchantment BARBED = register("barbed", new BarbedEnchantment());
public static final Enchantment PUMMELING = register("pummeling", new PummelingEnchantment());
public static final Enchantment RETRIBUTION = register("retribution", new RetributionEnchantment());

private static <E extends Enchantment> E register(String name, E enchantment) {
return Registry.register(BuiltInRegistries.ENCHANTMENT, new ResourceLocation(Guarding.MOD_ID, name), enchantment);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,24 +64,4 @@ private void disableNetheriteShield(boolean becauseOfAxe, CallbackInfo ci) {
this.level().broadcastEntityEvent(this, (byte)30);
}
}

@Shadow
public Iterable<ItemStack> getArmorSlots() {
return null;
}

@Shadow
public ItemStack getItemBySlot(EquipmentSlot slot) {
return null;
}

@Shadow
public void setItemSlot(EquipmentSlot slot, ItemStack stack) {

}

@Shadow
public HumanoidArm getMainArm() {
return null;
}
}

0 comments on commit 0307a72

Please sign in to comment.