Skip to content

Commit

Permalink
Koloss blade will respect strength
Browse files Browse the repository at this point in the history
  • Loading branch information
legobmw99 committed May 28, 2021
1 parent a8ed30b commit ae6f96e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public interface IAllomancyData {
*
* @param player the player being checked
*/
void updateMetalBurnTime(ServerPlayerEntity player);
void tickBurning(ServerPlayerEntity player);

/**
* Get if the player has the supplied power
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@ public void inventoryTick(ItemStack stack, World worldIn, Entity entityIn, int i
PlayerEntity player = (PlayerEntity) entityIn;

if (isSelected && (player.getOffhandItem() != stack)) {
player.getCapability(AllomancyCapability.PLAYER_CAP).ifPresent(data -> {
if (!data.isBurning(Metal.PEWTER)) {
player.addEffect(new EffectInstance(Effects.DIG_SLOWDOWN, 10, 10, true, false));
player.addEffect(new EffectInstance(Effects.WEAKNESS, 10, 10, true, false));
player.addEffect(new EffectInstance(Effects.MOVEMENT_SLOWDOWN, 10, 0, true, false));
}
});
if (!player.hasEffect(Effects.DAMAGE_BOOST) && !player.getCapability(AllomancyCapability.PLAYER_CAP).filter(data -> data.isBurning(Metal.PEWTER)).isPresent()) {
player.addEffect(new EffectInstance(Effects.DIG_SLOWDOWN, 10, 10, true, false));
player.addEffect(new EffectInstance(Effects.WEAKNESS, 10, 10, true, false));
player.addEffect(new EffectInstance(Effects.MOVEMENT_SLOWDOWN, 10, 0, true, false));
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public static void onWorldTick(final TickEvent.WorldTickEvent event) {
// Run the necessary updates on the player's metals
// Ran AFTER duralumin and aluminum to make sure they function correctly
if (curPlayer instanceof ServerPlayerEntity) {
data.updateMetalBurnTime((ServerPlayerEntity) curPlayer);
data.tickBurning((ServerPlayerEntity) curPlayer);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public DefaultAllomancyData() {
}


public void updateMetalBurnTime(ServerPlayerEntity player) {
public void tickBurning(ServerPlayerEntity player) {
for (Metal metal : Metal.values()) {
if (this.isBurning(metal)) {
if (!this.hasPower(metal)) {
Expand Down

0 comments on commit ae6f96e

Please sign in to comment.