Skip to content

Commit

Permalink
make max height configurable (closes #57)
Browse files Browse the repository at this point in the history
  • Loading branch information
UpcraftLP committed Apr 14, 2024
1 parent 6435a56 commit 3ceff9a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@ public final class IcarusConfig {
public static float exhaustionAmount = 0.03F;
@ConfigEntry(id = "roll_amount", type = EntryType.FLOAT, translation = "config.icarus.roll_amount")
public static float rollAmount = 1.0F;
@ConfigEntry(id = "max_height_above_world", type = EntryType.INTEGER, translation = "config.icarus.max_height_above_world")
public static int maxHeightAboveWorld = 64;
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public boolean isUsable(LivingEntity entity, ItemStack stack) {

public boolean onFlightTick(LivingEntity entity, ItemStack wings, int ticks) {
if (IcarusConfig.wingsDurability > 0 && wings.is(IcarusItemTags.MELTS) && !(entity instanceof Player player && player.isCreative())) {
if (ticks % 20 == 0 || (entity.getY() > entity.level().getHeight() + 64 && ticks % 2 == 0)) {
if (ticks % 20 == 0 || (entity.getY() > entity.level().getHeight() + IcarusConfig.maxHeightAboveWorld && ticks % 2 == 0)) {
wings.hurtAndBreak(1, entity, e -> e.broadcastBreakEvent(EquipmentSlot.CHEST));
}
}
Expand Down
1 change: 1 addition & 0 deletions Common/src/main/resources/assets/icarus/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
"config.icarus.wings_durability": "How much durability all the wings have.",
"config.icarus.exhaustion_amount": "Exhaustion cost for flying.",
"config.icarus.roll_amount": "How much the player can roll while flying. (Requires CameraOverhaul)",
"config.icarus.max_height_above_world": "Maximum height above the world build limit that players can fly to",

"message.icarus.status.no_fly.dimension": "Flying is not allowed in this dimension!"
}
1 change: 1 addition & 0 deletions Common/src/main/resources/assets/icarus/lang/pt_br.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
"config.icarus.wings_durability": "Quanta durabilidade todas as asas tem.",
"config.icarus.exhaustion_amount": "Custo de exaustão por vôo.",
"config.icarus.roll_amount": "Quanto o jogador pode rodar enquanto voa. (Requires CameraOverhaul)",
"config.icarus.max_height_above_world": "Maximum height above the world build limit that players can fly to",

"message.icarus.status.no_fly.dimension": "Flying is not allowed in this dimension!"
}

0 comments on commit 3ceff9a

Please sign in to comment.