Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: language re-work #435

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
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
58 changes: 0 additions & 58 deletions .gitlab-ci.yml

This file was deleted.

8 changes: 0 additions & 8 deletions .gitlab/issue_templates/suggestion.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
import com.andrei1058.bedwars.api.arena.shop.IContentTier;
import com.andrei1058.bedwars.api.command.ParentCommand;
import com.andrei1058.bedwars.api.configuration.ConfigManager;
import com.andrei1058.bedwars.api.language.Language;
import com.andrei1058.bedwars.api.language.LanguageOld;
import com.andrei1058.bedwars.api.language.LanguageService;
import com.andrei1058.bedwars.api.levels.Level;
import com.andrei1058.bedwars.api.party.Party;
import com.andrei1058.bedwars.api.server.ISetupSession;
Expand Down Expand Up @@ -441,7 +442,7 @@ interface TeamUpgradesUtil {
/**
* Get server default language.
*/
Language getDefaultLang();
LanguageOld getDefaultLang();

/**
* Get lobby world name.
Expand All @@ -459,12 +460,12 @@ interface TeamUpgradesUtil {
* Get language by iso code.
*/
@SuppressWarnings("unused")
Language getLanguageByIso(String isoCode);
LanguageOld getLanguageByIso(String isoCode);

/**
* Get a player language.
*/
Language getPlayerLanguage(Player player);
LanguageOld getPlayerLanguage(Player player);

/**
* This is my standard location where to store addons configurations.
Expand Down Expand Up @@ -493,4 +494,6 @@ interface ScoreboardUtil {
*/
void givePlayerScoreboard(Player player, boolean delay);
}

LanguageService getLanguageService();
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import com.andrei1058.bedwars.api.arena.team.ITeam;
import com.andrei1058.bedwars.api.arena.team.ITeamAssigner;
import com.andrei1058.bedwars.api.configuration.ConfigManager;
import com.andrei1058.bedwars.api.language.Language;
import com.andrei1058.bedwars.api.language.LanguageOld;
import com.andrei1058.bedwars.api.region.Region;
import com.andrei1058.bedwars.api.tasks.PlayingTask;
import com.andrei1058.bedwars.api.tasks.RestartingTask;
Expand Down Expand Up @@ -219,7 +219,7 @@ public interface IArena {
* Get the display status for an arena.
* A message that can be used on signs etc.
*/
String getDisplayStatus(Language lang);
String getDisplayStatus(LanguageOld lang);

/**
* Get arena display group for given player.
Expand All @@ -234,7 +234,7 @@ public interface IArena {
* @return translated group.
*/
@SuppressWarnings("unused")
String getDisplayGroup(Language language);
String getDisplayGroup(LanguageOld language);

List<ITeam> getTeams();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import com.andrei1058.bedwars.api.BedWars;
import com.andrei1058.bedwars.api.arena.IArena;
import com.andrei1058.bedwars.api.language.Language;
import com.andrei1058.bedwars.api.language.LanguageService;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.ArmorStand;
Expand All @@ -31,6 +31,7 @@
import java.util.ArrayList;
import java.util.List;

@Deprecated
public class ShopHolo {
/**
* Shop holograms per language <iso, holo></iso,>
Expand Down Expand Up @@ -67,7 +68,8 @@ public void update() {
Bukkit.broadcastMessage("LOCATION IS NULL");
}
for (Player p2 : l.getWorld().getPlayers()) {
if (Language.getPlayerLanguage(p2).getIso().equalsIgnoreCase(iso)) continue;
LanguageService lang = api.getLanguageService();
if (lang.getPlayerLanguage(p2).getIso().equalsIgnoreCase(iso)) continue;
if (a1 != null) {
api.getVersionSupport().hideEntity(a1, p2);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

import com.andrei1058.bedwars.api.arena.IArena;
import com.andrei1058.bedwars.api.arena.generator.IGenerator;
import com.andrei1058.bedwars.api.language.Language;
import com.andrei1058.bedwars.api.language.LanguageOld;
import com.andrei1058.bedwars.api.upgrades.EnemyBaseEnterTrap;
import org.bukkit.Location;
import org.bukkit.enchantments.Enchantment;
Expand Down Expand Up @@ -53,7 +53,7 @@ public interface ITeam {
*
* @param language get the display name in target language.
*/
String getDisplayName(Language language);
String getDisplayName(LanguageOld language);

/**
* Check if is member.
Expand Down
Loading