Skip to content

Commit

Permalink
Lang rework 26
Browse files Browse the repository at this point in the history
fixes rebase artifacts
  • Loading branch information
FireInstall committed Feb 24, 2024
1 parent a556ab4 commit c1b9ad3
Show file tree
Hide file tree
Showing 88 changed files with 511 additions and 456 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ private void clickMenu(@NotNull InventoryClickEvent event) {
} else if (!mgPlayer.getMenu().getAllowModify()) {
Inventory topInv = event.getView().getTopInventory();
switch (event.getAction()) {
case NOTHING, DROP_ALL_CURSOR, DROP_ONE_CURSOR, UNKNOWN -> {
case NOTHING, DROP_ALL_CURSOR, DROP_ONE_CURSOR, CLONE_STACK, UNKNOWN -> {
} // nothing
case PICKUP_ALL, PICKUP_SOME, PICKUP_HALF, PICKUP_ONE, DROP_ALL_SLOT, DROP_ONE_SLOT, HOTBAR_MOVE_AND_READD, // may take
PLACE_ALL, PLACE_SOME, PLACE_ONE, /*may place*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class MinigameTimer {
private boolean broadcastTime = true;
private BossBar bossBar = null;

public MinigameTimer(Minigame minigame, int timeLength) {
public MinigameTimer(Minigame minigame, long timeLength) {
this.timeLength = timeLength;
this.timeLeft = timeLength;
this.minigame = minigame;
Expand Down Expand Up @@ -91,6 +91,8 @@ private void runTimer() {
bossBar.addViewer(ply.getPlayer());
}
}
case NONE -> {
}
}

if (timeMsg.contains(timeLeft) && broadcastTime) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@
import java.io.InputStream;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Pattern;

public class Minigames extends JavaPlugin {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ public Boolean getValue() {
public void setValue(Boolean value) {
usePermission = value;
}


};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import au.com.mineauz.minigames.stats.MinigameStat;
import au.com.mineauz.minigames.stats.StatisticValueField;
import au.com.mineauz.minigames.stats.StoredStat;
import com.google.common.collect.Lists;
import net.kyori.adventure.text.logger.slf4j.ComponentLogger;
import net.kyori.adventure.text.minimessage.MiniMessage;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public boolean onCommand(@NotNull CommandSender sender,

if (mgm != null) {
File save = new File(PLUGIN.getDataFolder() + "/minigames/" + mgm.getName());

if (save.exists() && save.isDirectory()) {
try {
FileUtils.deleteDirectory(save);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public boolean onCommand(final @NotNull CommandSender sender, @NotNull String @N
}
} else {
MinigameMessageManager.sendMgMessage(sender, MinigameMessageType.ERROR, MgCommandLangKey.COMMAND_ERROR_INTERNAL);
Minigames.getCmpnntLogger().error("An internal error occurred while loading statistics.", throwable);
Minigames.getCmpnntLogger().error("An internal error occurred while loading the statistics.", throwable);
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import au.com.mineauz.minigames.objects.MinigamePlayer;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
import org.bukkit.Location;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -66,7 +65,7 @@ public boolean onCommand(@NotNull CommandSender sender, @NotNull Minigame miniga
if (sender instanceof Player player) {
MinigamePlayer mgPlayer = Minigames.getPlugin().getPlayerManager().getMinigamePlayer(player);

switch (args[0].toLowerCase()){
switch (args[0].toLowerCase()) {
case "create" -> {
if (mgPlayer.hasSelection()) {
minigame.setFloorDegen(new MgRegion("degen", mgPlayer.getSelectionLocations()[0], mgPlayer.getSelectionLocations()[1]));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public boolean canBeConsole() {
}

@Override
public Component getUsage() { //todo look up if new display types are in translation
return MinigameMessageManager. aaaaaaaaa getMgMessage(MgCommandLangKey.COMMAND_SET_TIMER_USAGE); // intentional error so this todo doesn't get lost
public Component getUsage() {
return MinigameMessageManager.getMgMessage(MgCommandLangKey.COMMAND_SET_TIMER_USAGE);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ public void setValue(Boolean value) {
});
}

@Override
public MenuItemBoolean getMenuItem(@Nullable Material displayMat, @Nullable Component name) {
return getMenuItem(displayMat, name, null);
}

@Override
public MenuItemBoolean getMenuItem(@Nullable Material displayMat, @Nullable Component name,
@Nullable List<@NotNull Component> description) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ public void loadValue(@NotNull FileConfiguration config, @NotNull String path) {
}
}

@Override
public MenuItemString getMenuItem(@Nullable Material displayMat, @Nullable Component name) {
return getMenuItem(displayMat, name, null);
}

@Override
public MenuItemString getMenuItem(@Nullable Material displayMat, @Nullable Component name,
@Nullable List<@NotNull Component> description) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,14 @@ public void endMinigame(@NotNull List<@NotNull MinigamePlayer> winners,
}
}

if (mgm.getMpTimer() == null) return;
if (mgm.getMpTimer() == null) {
return;
}
mgm.getMpTimer().setStartWaitTime(0);
mgm.setMpTimer(null);
}

public void endMinigameFindWinner(Minigame mgm) {
public void endMinigameFindWinner(@NotNull Minigame mgm) {
if (mgm.isTeamGame()) {
if (TeamsModule.getMinigameModule(mgm).getDefaultWinner() != null) { //default winner
TeamsModule tm = TeamsModule.getMinigameModule(mgm);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public enum MgCommandLangKey implements LangKey {
COMMAND_SET_REGENAREA_DESCRIPTION("command.set.regenArea.description"),
COMMAND_SET_REGENAREA_ERROR_NOTSELECTED("command.set.regenArea.error.notSelected"),
COMMAND_SET_REGENAREA_LIST_HEADER("command.set.regenArea.listHeader"),
COMMAND_SET_REGENAREA_USAGE("command.set-regenArea.usage"),
COMMAND_SET_REGENAREA_USAGE("command.set.regenArea.usage"),
COMMAND_SET_REGENDELAY_DESCRIPTION("command.set.regenDelay.description"),
COMMAND_SET_REGENDELAY_SUCCESS("command.set.regenDelay.success"),
COMMAND_SET_REGENDELAY_USAGE("command.set.regenDelay.usage"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public enum MgMenuLangKey implements LangKey {
MENU_EDIT_SHIFTLEFT("menu.edit.shiftLeft"),
MENU_EFFECTS_SAVE_NAME("menu.effects.save.name"),
MENU_ELEMENTNOTSET("menu.elementNotSet"),
MENU_ERROR_UNKNOWN("menu.error.unknown"),
MENU_FLAGADD_ENTERCHAT("menu.flagAdd.enterChat"),
MENU_FLAGADD_NAME("menu.flagAdd.name"),
MENU_FLAG_REMOVED("menu.flag.removed"),
Expand All @@ -55,7 +56,6 @@ public enum MgMenuLangKey implements LangKey {
MENU_INFECTED_TEAM_INFECTED_NAME("menu.infected.team.infected.name"),
MENU_INFECTED_TEAM_SURVIVOR_NAME("menu.infected.team.survivor.name"),
MENU_INVERT_NAME("menu.invert.name"),
MENU_ERROR_UNKNOWN("menu.error.unknown"),
MENU_LIST_ENTERCHAT("menu.list.enterChat"),
MENU_LIST_ERROR_INVALID("menu.list.error.invalid"),
MENU_LIST_ERROR_TOOLONG("menu.list.error.long"),
Expand All @@ -64,17 +64,6 @@ public enum MgMenuLangKey implements LangKey {
MENU_LOADOUT_ADD_NAME("menu.loadout.add.name"),
MENU_LOADOUT_ERROR_ALREADYEXISTS("menu.loadout.error.alreadyExists"),
MENU_LOADOUT_SAVE("menu.displayLoadout.save.success"),
MENU_LOBBY_WAIT_PLAYER_INTERACT_NAME("menu.lobby.wait.player.interact.name"),
MENU_LOBBY_WAIT_PLAYER_MOVE_NAME("menu.lobby.wait.player.move.name"),
MENU_LOBBY_WAIT_PLAYER_TELEPORT_DESCRIPTION("menu.lobby.wait.player.teleport.description"),
MENU_LOBBY_WAIT_PLAYER_TELEPORT_NAME("menu.lobby.wait.player.teleport.name"),
MENU_LOBBY_WAIT_PLAYER_TIME_DESCRIPTION("menu.lobby.wait.player.time.description"),
MENU_LOBBY_WAIT_PLAYER_TIME_NAME("menu.lobby.wait.player.time.name"),
MENU_LOBBY_WAIT_START_INTERACT_NAME("menu.lobby.wait.start.interact.name"),
MENU_LOBBY_WAIT_START_MOVE_NAME("menu.lobby.wait.start.move.name"),
MENU_LOBBY_WAIT_START_TELEPORT_DESCRIPTION("menu.lobby.wait.teleport.description"),
MENU_LOBBY_WAIT_START_TELEPORT_NAME("menu.lobby.wait.start.teleport.name"),
MENU_MATERIAL_DESCRIOPTION("menu.material.description"),
MENU_LOADOUT_SELECT_NAME("menu.loadout.select.name"),
MENU_LOBBY_WAIT_PLAYER_INTERACT_NAME("menu.lobby.wait.player.interact.name"),
MENU_LOBBY_WAIT_PLAYER_MOVE_NAME("menu.lobby.wait.player.move.name"),
Expand All @@ -86,6 +75,7 @@ public enum MgMenuLangKey implements LangKey {
MENU_LOBBY_WAIT_START_MOVE_NAME("menu.lobby.wait.start.move.name"),
MENU_LOBBY_WAIT_START_TELEPORT_DESCRIPTION("menu.lobby.wait.teleport.description"),
MENU_LOBBY_WAIT_START_TELEPORT_NAME("menu.lobby.wait.start.teleport.name"),
MENU_MATERIAL_DESCRIOPTION("menu.material.description"),
MENU_MINIGAME_ALLOWLATEJOIN_NAME("menu.minigame.allowLateJoin.name"),
MENU_MINIGAME_ALLOWSPECTATORFLY_NAME("menu.minigame.allowSpectatorFly.name"),
MENU_MINIGAME_DEGEN_DELAY_NAME("menu.minigame.degen.delay.name"),
Expand Down Expand Up @@ -129,7 +119,6 @@ public enum MgMenuLangKey implements LangKey {
MENU_MINIGAME_WHITELIST_BLOCK_DESCRIPTION_MAIN("menu.minigame.whitelist.block.description.main"),
MENU_MINIGAME_WHITELIST_BLOCK_DESCRIPTION_SECOND("menu.minigame.whitelist.block.description.second"),
MENU_MINIGAME_WHITELIST_BLOCK_NAME("menu.minigame.whitelist.block.name"),
MENU_MATERIAL_DESCRIOPTION("menu.material.description"),
MENU_MONEYREWARD_ITEM_NAME("menu.moneyReward.item.name"),
MENU_MONEYREWARD_MENU_NAME("menu.moneyReward.menu.name"),
MENU_NUMBER_ENTERCHAT("menu.number.enterChat"),
Expand Down Expand Up @@ -172,13 +161,6 @@ public enum MgMenuLangKey implements LangKey {
MENU_PLAYSOUND_PRIVATEPLAYBACK_NAME("menu.playSound.privatePlayback.name"),
MENU_PLAYSOUND_SOUND_NAME("menu.playSound.sound.name"),
MENU_PLAYSOUND_VOLUME_NAME("menu.playSound.volume.name"),
MENU_POTIONADD_ENTERCHAT("menu.potionAdd.enterChat"),
MENU_POTIONADD_ERROR_SYNTAX("menu.potionAdd.error.syntax"),
MENU_POTIONADD_NAME("menu.potionAdd.name"),
MENU_POTION_DURATION("menu.potion.duration"),
MENU_POTION_LEVEL("menu.potion.level"),
MENU_REWARDPAIR_EDIT("menu.rewardPair.edit"),
MENU_POTIONADD_NAME("menu.potionAdd.name"), // todo unused
MENU_RESOURCEPACK_OPTIONS_DISPLAYNAME_NAME("menu.resourcePack.options.displayname.name"),
MENU_RESOURCEPACK_OPTIONS_ENABLE_NAME("menu.resourcePack.options.enable.name"),
MENU_RESOURCEPACK_OPTIONS_FORCE_NAME("menu.resourcePack.options.force.name"),
Expand All @@ -191,7 +173,6 @@ public enum MgMenuLangKey implements LangKey {
MENU_REWARD_GROUP_ENTERCHAT("menu.reward.group.enterChat"),
MENU_REWARD_GROUP_NAME("menu.reward.group.name"),
MENU_REWARD_ITEM_ADD_DESCRIPTION("menu.reward.group.add.description"),
MENU_REWARD_NAME("menu.reward.name"),
MENU_REWARD_ITEM_ADD_NAME("menu.reward.item.add.name"),
MENU_REWARD_KILLS_DESCRIPTION("menu.reward.kills.description"),
MENU_REWARD_NAME("menu.reward.name"),
Expand Down Expand Up @@ -290,15 +271,6 @@ public enum MgMenuLangKey implements LangKey {
MENU_WHITELIST_ENTERCHAT("menu.whitelist.enterChat"),
MENU_WHITELIST_ERROR_CONTAINS("menu.whitelist.error.contains"),
MENU_WHITELIST_INTERACT("menu.whitelist.interact"),
MENU_WHITELIST_MODE("menu.whitelist.mode"),
MENU_TIMEWEATHER_NAME("menu.timeWeather.name"),
MENU_TIMEWEATHER_TIME_USE_NAME("menu.timeWeather.time.use.name"),
MENU_TIMEWEATHER_TIME_NAME("menu.timeWeather.time.name"),
MENU_TIMEWEATHER_WEATHER_USE_NAME("menu.timeWeather.weather.use.name"),
MENU_TIMEWEATHER_WEATHER_NAME("menu.timeWeather.weather.name"),
MENU_MINIGAME_TIME_DISPLAYTYPE_NAME("menu.minigame.time.displayType.name"),
MENU_WHITELIST_MODE("menu.whitelist.mode"),
MENU_WHITELIST_INTERACT("menu.whitelist.interact"),
MENU_WHITELIST_MODE("menu.whitelist.mode");

private final @NotNull String path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ public enum MinigameLangKey implements LangKey { //todo this gets rather big. Sl
SIGN_ERROR_INVALID("sign.error.invalid"),
SIGN_ERROR_TEAM_INVALIDFORMAT("sign.error.team.invalidFormat"),
SIGN_FINISH_REQUIREFLAGS("sign.finish.requireFlags"),
SIGN_FLAG_BROKEN_SUPPORT("sign.flag.broken.support"),
SIGN_JOIN_ERROR_INVALIDMONEY("sign.join.invalidMoney"),
SIGN_REWARD_ERROR_NONAME("sign.reward.error.noName"),
SIGN_REWARD_SAVED("sign.reward.saved"),
Expand Down Expand Up @@ -260,17 +261,6 @@ public enum MinigameLangKey implements LangKey { //todo this gets rather big. Sl
TOOL_SET_ENDLOCATION("tool.set.endLocation"),
TOOL_SET_LOBBYLOCATION("tool.set.lobbyLocation"),
TOOL_SET_QUITLOCATION("tool.set.quitLocation"),
TOOL_SET_SPECTATORLOCATION("tool.set.spectatorLocation"),
STATISTIC_WINS_NAME("statistic.wins.name"),
STATISTIC_LOSSES_NAME("statistic.losses.name"),
STATISTIC_ATTEMPTS_NAME("statistic.attempts.name"),
STATISTIC_TIME_NAME("statistic.time.name"),
STATISTIC_KILLS_NAME("statistic.kills.name"),
STATISTIC_DEATHS_NAME("statistic.deaths.name"),
STATISTIC_SCORE_NAME("statistic.score.name"),
STATISTIC_REVERTS_NAME("statistic.reverts.name"),
TOOL_SET_SPECTATORLOCATION("tool.set.spectatorLocation"),
BOOL_TRUE("bool.true"),
TOOL_SET_SPECTATORLOCATION("tool.set.spectatorLocation");

private final @NotNull String path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class MenuItemAddTeam extends MenuItem {
private final TeamsModule tm;

public MenuItemAddTeam(Component name, @NotNull TeamsModule tm) {
super(name, MenuUtility.getCreateMaterial());
super(MenuUtility.getCreateMaterial(), name);
this.tm = tm;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,20 +83,24 @@ public void updateDescription() {

@Override
public ItemStack onClick() {
if (max == null || value.getValue() < max)
if (max == null || value.getValue() < max) {
value.setValue(value.getValue() + lowerInc);
if (max != null && value.getValue() > max)
}
if (max != null && value.getValue() > max) {
value.setValue(max);
}
updateDescription();
return getDisplayItem();
}

@Override
public ItemStack onRightClick() {
if (min == null || value.getValue() > min)
if (min == null || value.getValue() > min) {
value.setValue(value.getValue() - lowerInc);
if (min != null && value.getValue() < min)
}
if (min != null && value.getValue() < min) {
value.setValue(min);
}
updateDescription();
return getDisplayItem();
}
Expand Down

This file was deleted.

Loading

0 comments on commit c1b9ad3

Please sign in to comment.