Skip to content

Commit

Permalink
Adjust duration of effects to prevent flickering with some shaders (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
Vaelzan authored and GirafiStudios committed Jan 25, 2020
1 parent 74b251f commit 4837da7
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ public NeptuniumArmor(IArmorMaterial armorMaterial, EquipmentSlotType equipmentS
public void onArmorTick(@Nonnull ItemStack stack, World world, PlayerEntity player) {
if (player.areEyesInFluid(FluidTags.WATER)) {
if (this.slot == EquipmentSlotType.HEAD) {
player.addPotionEffect(new EffectInstance(Effects.NIGHT_VISION, 1, 0, false, false, false));
player.addPotionEffect(new EffectInstance(Effects.NIGHT_VISION, 20, 0, false, false, false));
} else if (this.slot == EquipmentSlotType.CHEST) {
player.addPotionEffect(new EffectInstance(Effects.WATER_BREATHING, 1, 0, false, false, false));
player.addPotionEffect(new EffectInstance(Effects.WATER_BREATHING, 20, 0, false, false, false));
} else if (this.slot == EquipmentSlotType.LEGS) {
if (!player.isCrouching()) {
player.setMotion(player.getMotion().add(0, player.fallDistance, 0));
}
} else if (this.slot == EquipmentSlotType.FEET) {
player.addPotionEffect(new EffectInstance(Effects.SPEED, 1, 0, false, false, false));
player.addPotionEffect(new EffectInstance(Effects.SPEED, 20, 0, false, false, false));
player.move(MoverType.PLAYER, player.getMotion()); //Make the swimming react to the swiftness potion
}
}
Expand All @@ -50,4 +50,4 @@ public Item setArmorTexture(String string) {
public String getArmorTexture(@Nonnull ItemStack stack, Entity entity, EquipmentSlotType slot, String layer) {
return "aquaculture:textures/armor/" + this.texture + ".png";
}
}
}

0 comments on commit 4837da7

Please sign in to comment.