Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/main/java/world/bentobox/caveblock/CaveBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import world.bentobox.bentobox.api.configuration.Config;
import world.bentobox.bentobox.api.configuration.WorldSettings;
import world.bentobox.bentobox.api.flags.Flag;
import world.bentobox.caveblock.commands.AdminReloadConfirmCommand;
import world.bentobox.caveblock.commands.IslandAboutCommand;
import world.bentobox.caveblock.generators.ChunkGeneratorWorld;
import world.bentobox.caveblock.listeners.CustomHeightLimitations;
Expand Down Expand Up @@ -53,7 +54,16 @@ public void setup()
};

// Admin command.
this.adminCommand = new DefaultAdminCommand(this) {};
this.adminCommand = new DefaultAdminCommand(this)
{
@Override
public void setup()
{
super.setup();
// Replaces the default "reload" sub-command so the admin gets feedback
new AdminReloadConfirmCommand(this);
}
};
}


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package world.bentobox.caveblock.commands;

import java.util.List;

import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.commands.admin.AdminReloadCommand;
import world.bentobox.bentobox.api.user.User;


/**
* Replaces BentoBox's default admin reload command, which reloads silently,
* so that the admin gets confirmation that config.yml was reloaded.
*/
public class AdminReloadConfirmCommand extends AdminReloadCommand {

/**
* Reload
* @param adminCommand - parent command
*/
public AdminReloadConfirmCommand(CompositeCommand adminCommand) {
super(adminCommand);
}

@Override
public boolean execute(User user, String label, List<String> args) {
super.execute(user, label, args);
user.sendMessage("caveblock.commands.admin.reload.reloaded");
return true;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public class CustomHeightLimitations implements Listener
public CustomHeightLimitations(CaveBlock addon)
{
this.addon = addon;
this.worldHeight = addon.getSettings().getWorldDepth() - 1;
}

/**
Expand All @@ -51,7 +50,7 @@ public void onPlayerMove(PlayerMoveEvent event)


// Prevent to get over world height
if (nextY >= this.worldHeight)
if (nextY >= this.getWorldHeight())
{
User.getInstance(player).sendMessage("caveblock.general.errors.cave-limit-reached");
event.setCancelled(true);
Expand All @@ -77,7 +76,7 @@ public void onPlayerTeleport(PlayerTeleportEvent event)
}

// Prevent to get over world height
if (nextY >= this.worldHeight)
if (nextY >= this.getWorldHeight())
{
User.getInstance(player).sendMessage("caveblock.general.errors.cave-limit-reached");
event.setCancelled(true);
Expand All @@ -96,7 +95,7 @@ public void onPlayerTeleport(PlayerTeleportEvent event)
*/
private boolean shouldNotBeCancelled(double nextY, Player player, Location from, Location to)
{
return nextY < this.worldHeight ||
return nextY < this.getWorldHeight() ||
from == to ||
from.getY() >= nextY &&
from.getBlockX() == to.getBlockX() &&
Expand All @@ -112,6 +111,17 @@ private boolean shouldNotBeCancelled(double nextY, Player player, Location from,
}


/**
* Read from the live settings each time so that changing world depth and running
* the admin reload command takes effect without a server restart.
* @return the Y level players cannot go above.
*/
private int getWorldHeight()
{
return this.addon.getSettings().getWorldDepth() - 1;
}


// ---------------------------------------------------------------------
// Section: Variables
// ---------------------------------------------------------------------
Expand All @@ -121,9 +131,4 @@ private boolean shouldNotBeCancelled(double nextY, Player player, Location from,
* CaveBlock addon
*/
private final CaveBlock addon;

/**
* This variable store world height.
*/
private final int worldHeight;
}
3 changes: 3 additions & 0 deletions src/main/resources/locales/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ caveblock:
already-have-island: "<red>Již máš svou jeskyni!"
no-safe-location-found: "<red>Nelze najít bezpečné místo pro teleportaci do tvé jeskyně."
not-owner: "<red>Nejsi vlastník této jeskyně!"
cave-limit-reached: "<red> Dosáhl jsi stropu své jeskyně. Výš už se dostat nemůžeš!"
commands:
# Parameters in <> are required, parameters in [] are optional
admin:
Expand Down Expand Up @@ -108,6 +109,8 @@ caveblock:
description: "odstraní jeskyni hráče"
cannot-delete-owner: "<red>Všichni členové jeskyně musí být vykopnuti z jeskyně, než jej bude možné smazat."
deleted-island: "<green>Jeskyně na <yellow>[xyz] <green> byla úspěšně smazána."
reload:
reloaded: "<green>Konfigurace CaveBlock byla znovu načtena. Změny se projeví v nově generovaných chuncích. Název světa, dimenze a aliasy příkazů vyžadují restart serveru."
island:
go:
description: "teleportuje tě do tvé jeskyně"
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/locales/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ caveblock:
cannot-delete-owner: "<red>Alle Höhlenmitglieder müssen vor dem Löschen aus der
Höhle geworfen werden."
deleted-island: "<green>Höhle bei <yellow>[xyz] <green>wurde erfolgreich gelöscht."
reload:
reloaded: "<green>CaveBlock-Konfiguration neu geladen. Änderungen gelten für neu generierte Chunks. Weltname, Dimensionen und Befehls-Aliase erfordern einen Serverneustart."
island:
go:
description: teleportiere dich zu deiner Höhle
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/locales/en-US.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ caveblock:

commands:
admin:
reload:
reloaded: "<green>CaveBlock config reloaded. Changes apply to newly generated chunks. World name, dimensions and command aliases need a server restart."
info:
no-island: "<red>You are not in a cave right now..."
# The BentoBox defaults below use the literal word "islands", not a prefix
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ caveblock:
no-safe-location-found: "<red>No encontramos un lugar seguro para teletransportarte
a la cueva."
not-owner: "<red>¡No eres el propietario de la cueva!"
cave-limit-reached: "<red> Has alcanzado el techo de tu cueva. ¡No puedes subir más!"
commands:
admin:
team:
Expand Down Expand Up @@ -108,6 +109,8 @@ caveblock:
cannot-delete-owner: "<red>Todos los miembros de la cueva deben ser expulsados
antes de eliminarla."
deleted-island: "<green>Cueva de <yellow>[xyz] <green>eliminada correctamente."
reload:
reloaded: "<green>Configuración de CaveBlock recargada. Los cambios se aplican a los chunks generados a partir de ahora. El nombre del mundo, las dimensiones y los alias de comandos requieren reiniciar el servidor."
island:
go:
description: teletransportar a tu cueva
Expand Down
84 changes: 84 additions & 0 deletions src/main/resources/locales/id.yml
Original file line number Diff line number Diff line change
@@ -1 +1,85 @@
###########################################################################################
# This is a YML file. Be careful when editing. Check your edits in a YAML checker like #
# the one at http://yaml-online-parser.appspot.com #
###########################################################################################

caveblock:
prefixes:
island: gua
Island: Gua
Islands: Gua
an-island: sebuah gua
islands: gua

sign:
line0: "<red>CaveBlock"
line1: "Selamat datang!"
line2: "[name]"
line3: "Mulai menggali! <red><3"

informational:
to-nether: "Sial sekali, kamu jatuh ke nether."
to-the-end: "Kamu telah mencapai The End."
to-normal: "Kembali ke guamu."

general:
errors:
cave-limit-reached: "<red> Kamu telah mencapai puncak guamu. Kamu tidak bisa naik lebih tinggi lagi!"

commands:
admin:
reload:
reloaded: "<green>Konfigurasi CaveBlock dimuat ulang. Perubahan berlaku untuk chunk yang baru dibuat. Nama dunia, dimensi, dan alias perintah memerlukan restart server."
info:
no-island: "<red>Kamu tidak sedang berada di gua saat ini..."
islands-in-trash: "<light_purple>Pemain memiliki gua di tempat sampah."
trash:
no-unowned-in-trash: "<red>Tidak ada gua tanpa pemilik di tempat sampah"
no-islands-in-trash: "<red>Pemain tidak memiliki gua di tempat sampah"
description: "tampilkan gua tanpa pemilik atau gua pemain di tempat sampah"
title: "<light_purple>=========== Gua di Tempat Sampah ==========="
emptytrash:
description: "Kosongkan tempat sampah untuk pemain, atau semua gua tanpa pemilik di tempat sampah"
island:
team:
invite:
accept:
confirmation: |-
<red>Apakah kamu yakin ingin menerima undangan ini?
<red><bold>Kamu akan <underlined>KEHILANGAN<reset> <red><bold>guamu saat ini!

ranks:
owner: "Raja Kurcaci"
sub-owner: "Ksatria Kurcaci"
member: "Kurcaci"
trusted: "Tepercaya"
coop: "Coop"
visitor: "Manusia"
banned: "Orc"

protection:
flags:
ISLAND_RESPAWN:
description: |-
<green>Pemain bangkit kembali
<green>di gua mereka
OFFLINE_GROWTH:
description: |-
<green>Jika dinonaktifkan, tanaman
<green>tidak akan tumbuh di gua
<green>yang semua anggotanya offline.
<green>Dapat membantu mengurangi lag.
OFFLINE_REDSTONE:
description: |-
<green>Jika dinonaktifkan, redstone
<green>tidak akan berfungsi di gua
<green>yang semua anggotanya offline.
<green>Dapat membantu mengurangi lag.
<green>Tidak memengaruhi gua spawn.

protection:
flags:
SKY_WALKER_FLAG:
description: "<dark_purple><italic>Aktifkan/nonaktifkan\n<dark_purple><italic> kemampuan untuk berjalan di\n<dark_purple><italic> atas dunia gua\n<dark_purple><italic> tanpa izin tambahan."
name: "Sky Walker"
hint: "Memungkinkan berjalan di atap gua."
3 changes: 3 additions & 0 deletions src/main/resources/locales/ja.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ caveblock:
already-have-island: "<red>あなたはすでに洞窟を持っています!"
no-safe-location-found: "<red>洞窟でテレポートする安全な場所が見つかりませんでした。"
not-owner: "<red>あなたは洞窟の所有者ではありません!"
cave-limit-reached: "<red> 洞窟の天井に到達しました。これ以上高くは行けません!"
commands:
admin:
team:
Expand Down Expand Up @@ -96,6 +97,8 @@ caveblock:
description: プレイヤーの洞窟を削除します
cannot-delete-owner: "<red>すべての洞窟のメンバーは、削除する前に洞窟から追い出されなければなりません。"
deleted-island: "<green> [xyz]の<green>洞窟は正常に削除されました。"
reload:
reloaded: "<green>CaveBlockの設定を再読み込みしました。変更は新しく生成されるチャンクに適用されます。ワールド名、ディメンション、コマンドのエイリアスの変更にはサーバーの再起動が必要です。"
island:
go:
description: 洞窟にテレポートする
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/locales/lv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ caveblock:
command-cancelled: "<red>Komanda atcleta."
use-in-game: "<red>Šī komanda ir pieejama tikai spēlē."
unknown-player: "<red>[name] ir nezināms spēlētājs!"
cave-limit-reached: "<red> Tu esi sasniedzis savas alas griestus. Augstāk tikt nevari!"
success: "<green>Darīts!"
tips:
changing-obsidian-to-lava: Pārveido obsidiānu uz lavu. Esi uzmanīgāks!
Expand Down Expand Up @@ -339,6 +340,8 @@ caveblock:
description: Pārvaldīt pasaules iestatījumus
help:
description: admin komanda
reload:
reloaded: "<green>CaveBlock konfigurācija pārlādēta. Izmaiņas attiecas uz jauni ģenerētajiem čankiem. Pasaules nosaukuma, dimensiju un komandu aizstājvārdu maiņai nepieciešama servera restartēšana."
island:
go:
description: pārvieto tevi uz tavu salu
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/locales/pl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ caveblock:
no-safe-location-found: "<red>Nie można znaleźć bezpiecznego miejsca dla teleportu
do jaskini."
not-owner: "<red>To nie twoja jaskinia!"
cave-limit-reached: "<red> Osiągnąłeś szczyt swojej jaskini. Nie możesz wejść wyżej!"
commands:
admin:
team:
Expand Down Expand Up @@ -105,6 +106,8 @@ caveblock:
cannot-delete-owner: "<red>Wszyscy członkowie jaskini muszą zostać wyrzuceni
z jaskini przed jej usunięciem."
deleted-island: "<green>Wyspa w <yellow>[xyz] <green>została pomyślnie usunięta."
reload:
reloaded: "<green>Konfiguracja CaveBlock została przeładowana. Zmiany dotyczą nowo generowanych chunków. Nazwa świata, wymiary i aliasy komend wymagają restartu serwera."
island:
go:
description: teleportować cię do swojej jaskini
Expand Down
84 changes: 84 additions & 0 deletions src/main/resources/locales/ro.yml
Original file line number Diff line number Diff line change
@@ -1 +1,85 @@
###########################################################################################
# This is a YML file. Be careful when editing. Check your edits in a YAML checker like #
# the one at http://yaml-online-parser.appspot.com #
###########################################################################################

caveblock:
prefixes:
island: peșteră
Island: Peșteră
Islands: Peșteri
an-island: o peșteră
islands: peșteri

sign:
line0: "<red>CaveBlock"
line1: "Bun venit!"
line2: "[name]"
line3: "Începe să sapi! <red><3"

informational:
to-nether: "Ce ghinion să cazi în Nether."
to-the-end: "Ai ajuns în End."
to-normal: "Înapoi în peștera ta."

general:
errors:
cave-limit-reached: "<red> Ai ajuns în vârful peșterii tale. Nu poți urca mai sus!"

commands:
admin:
reload:
reloaded: "<green>Configurația CaveBlock a fost reîncărcată. Modificările se aplică chunk-urilor generate de acum înainte. Numele lumii, dimensiunile și aliasurile comenzilor necesită repornirea serverului."
info:
no-island: "<red>Nu te afli într-o peșteră acum..."
islands-in-trash: "<light_purple>Jucătorul are peșteri în coșul de gunoi."
trash:
no-unowned-in-trash: "<red>Nu există peșteri fără proprietar în coșul de gunoi"
no-islands-in-trash: "<red>Jucătorul nu are peșteri în coșul de gunoi"
description: "arată peșterile fără proprietar sau peșterile jucătorului din coșul de gunoi"
title: "<light_purple>=========== Peșteri în coșul de gunoi ==========="
emptytrash:
description: "Golește coșul de gunoi pentru un jucător sau toate peșterile fără proprietar din coș"
island:
team:
invite:
accept:
confirmation: |-
<red>Sigur vrei să accepți această invitație?
<red><bold>Îți vei <underlined>PIERDE<reset> <red><bold>peștera actuală!

ranks:
owner: "Rege Pitic"
sub-owner: "Cavaler Pitic"
member: "Pitic"
trusted: "De încredere"
coop: "Coop"
visitor: "Om"
banned: "Orc"

protection:
flags:
ISLAND_RESPAWN:
description: |-
<green>Jucătorii reapar
<green>în peștera lor
OFFLINE_GROWTH:
description: |-
<green>Când este dezactivat, plantele
<green>nu vor crește în peșterile
<green>în care toți membrii sunt offline.
<green>Poate ajuta la reducerea lag-ului.
OFFLINE_REDSTONE:
description: |-
<green>Când este dezactivat, redstone-ul
<green>nu va funcționa în peșterile
<green>în care toți membrii sunt offline.
<green>Poate ajuta la reducerea lag-ului.
<green>Nu afectează peștera de spawn.

protection:
flags:
SKY_WALKER_FLAG:
description: "<dark_purple><italic>Activează/dezactivează\n<dark_purple><italic> abilitatea de a merge pe\n<dark_purple><italic> partea de sus a lumii peșterilor\n<dark_purple><italic> fără permisiuni suplimentare."
name: "Sky Walker"
hint: "Permite mersul pe acoperișul peșterii."
Loading
Loading