1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-19 19:25:48 +00:00

[CI skip] Updated language files

This commit is contained in:
TheBusyBiscuit 2020-03-10 22:09:19 +01:00
parent eb6140c7ed
commit 952d2592b7
6 changed files with 44 additions and 28 deletions

View File

@ -6,6 +6,7 @@ import java.util.Set;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Particle;
import org.bukkit.Sound;
@ -51,7 +52,7 @@ public final class TeleportationManager {
menu.addItem(slot, ChestMenuUtils.getBackground(), ChestMenuUtils.getEmptyClickHandler());
}
menu.addItem(4, new CustomItem(SkullItem.fromBase64("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzljODg4MWU0MjkxNWE5ZDI5YmI2MWExNmZiMjZkMDU5OTEzMjA0ZDI2NWRmNWI0MzliM2Q3OTJhY2Q1NiJ9fX0="), "&7Waypoint Overview &e(Select a Destination)"));
menu.addItem(4, new CustomItem(SkullItem.fromHash("c9c8881e42915a9d29bb61a16fb26d059913204d265df5b439b3d792acd56"), ChatColor.YELLOW + SlimefunPlugin.getLocal().getMessage(p, "machines.TELEPORTER.gui.title")));
menu.addMenuClickHandler(4, ChestMenuUtils.getEmptyClickHandler());
Location source = new Location(b.getWorld(), b.getX() + 0.5D, b.getY() + 2D, b.getZ() + 0.5D);
@ -64,10 +65,10 @@ public final class TeleportationManager {
Location l = entry.getValue();
ItemStack globe = network.getIcon(entry);
menu.addItem(slot, new CustomItem(globe, entry.getKey(), "&8\u21E8 &7World: &r" + l.getWorld().getName(), "&8\u21E8 &7X: &r" + l.getX(), "&8\u21E8 &7Y: &r" + l.getY(), "&8\u21E8 &7Z: &r" + l.getZ(), "&8\u21E8 &7Estimated Teleportation Time: &r" + DoubleHandler.fixDouble(0.5 * getTeleportationTime(complexity, source, l)) + "s", "", "&8\u21E8 &cClick to select"));
menu.addItem(slot, new CustomItem(globe, entry.getKey(), "", "&8\u21E8 &7" + SlimefunPlugin.getLocal().getResourceString(p, "tooltips.world") + ": &r" + l.getWorld().getName(), "&8\u21E8 &7X: &r" + l.getX(), "&8\u21E8 &7Y: &r" + l.getY(), "&8\u21E8 &7Z: &r" + l.getZ(), "&8\u21E8 &7" + SlimefunPlugin.getLocal().getMessage(p, "machines.TELEPORTER.gui.time") + ": &r" + DoubleHandler.fixDouble(0.5 * getTeleportationTime(complexity, source, l)) + "s", "", "&8\u21E8 &c" + SlimefunPlugin.getLocal().getMessage(p, "machines.TELEPORTER.gui.tooltip")));
menu.addMenuClickHandler(slot, (pl, s, item, action) -> {
pl.closeInventory();
start(pl.getUniqueId(), complexity, source, l, false);
teleport(pl.getUniqueId(), complexity, source, l, false);
return false;
});
@ -77,7 +78,7 @@ public final class TeleportationManager {
menu.open(p);
}
public void start(UUID uuid, int complexity, Location source, Location destination, boolean resistance) {
public void teleport(UUID uuid, int complexity, Location source, Location destination, boolean resistance) {
teleporterUsers.add(uuid);
int time = getTeleportationTime(complexity, source, destination);

View File

@ -31,11 +31,7 @@ public class PermissionsService {
public void load() {
config = new Config(plugin, "permissions.yml");
config.getConfiguration().options().header(
"This file is used to assign permission nodes to items from Slimefun or any of its addons.\n" +
"To assign an item a certain permission node you simply have to set the 'permission' attribute\n" +
"to your desired permission node. You can also customize the text that is displayed when a Player does not have that permission."
);
config.getConfiguration().options().header("This file is used to assign permission nodes to items from Slimefun or any of its addons.\n" + "To assign an item a certain permission node you simply have to set the 'permission' attribute\n" + "to your desired permission node. You can also customize the text that is displayed when a Player does not have that permission.");
config.getConfiguration().options().copyHeader(true);
}
@ -56,18 +52,23 @@ public class PermissionsService {
String permission = SlimefunPlugin.getItemCfg().getString(item.getID() + ".required-permission");
if (permission != null) {
config.setDefaultValue(item.getID() + ".permission", permission.length() == 0 ? "none": permission);
config.setDefaultValue(item.getID() + ".permission", permission.length() == 0 ? "none" : permission);
config.setDefaultValue(item.getID() + ".lore", SlimefunPlugin.getItemCfg().getString(item.getID() + ".no-permission-tooltip"));
SlimefunPlugin.getItemCfg().setValue(item.getID() + ".required-permission", null);
SlimefunPlugin.getItemCfg().setValue(item.getID() + ".no-permission-tooltip", null);
return true;
}
return false;
}
public boolean hasPermission(Player p, SlimefunItem item) {
if (item == null) {
// Failsafe
return true;
}
String permission = config.getString(item.getID() + ".permission");
return permission == null || permission.equals("none") || p.hasPermission(permission);
@ -75,7 +76,7 @@ public class PermissionsService {
public List<String> getLore(SlimefunItem item) {
List<String> lore = config.getStringList(item.getID() + ".lore");
return lore == null ? Arrays.asList("LORE NOT FOUND"): lore;
return lore == null ? Arrays.asList("LORE NOT FOUND") : lore;
}
}

View File

@ -145,17 +145,20 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation {
return true;
}
else {
List<String> parents = new ArrayList<>();
parents.add("");
parents.add(ChatColor.translateAlternateColorCodes('&', "&rYou need to unlock all Items"));
parents.add(ChatColor.translateAlternateColorCodes('&', "&rfrom the following Categories first:"));
parents.add("");
List<String> lore = new ArrayList<>();
lore.add("");
for (String line : SlimefunPlugin.getLocal().getMessages(p, "guide.locked-category")) {
lore.add(ChatColor.RESET + line);
}
lore.add("");
for (Category parent : ((LockedCategory) category).getParents()) {
parents.add(parent.getItem(p).getItemMeta().getDisplayName());
lore.add(parent.getItem(p).getItemMeta().getDisplayName());
}
menu.addItem(index, new CustomItem(Material.BARRIER, "&4LOCKED &7- &r" + category.getItem(p).getItemMeta().getDisplayName(), parents.toArray(new String[0])));
menu.addItem(index, new CustomItem(Material.BARRIER, "&4" + SlimefunPlugin.getLocal().getMessage(p, "guide.locked") + " &7- &r" + category.getItem(p).getItemMeta().getDisplayName(), lore.toArray(new String[0])));
menu.addMenuClickHandler(index, ChestMenuUtils.getEmptyClickHandler());
return true;
}
@ -209,7 +212,7 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation {
if (survival && research != null && !profile.hasUnlocked(research)) {
if (Slimefun.hasPermission(p, sfitem, false)) {
menu.addItem(index, new CustomItem(Material.BARRIER, "&r" + ItemUtils.getItemName(sfitem.getItem()), "&4&lLOCKED", "", "&a> Click to unlock", "", "&7Cost: &b" + research.getCost() + " Level"));
menu.addItem(index, new CustomItem(Material.BARRIER, "&r" + ItemUtils.getItemName(sfitem.getItem()), "&4&l" + SlimefunPlugin.getLocal().getMessage(p, "guide.locked"), "", "&a> Click to unlock", "", "&7Cost: &b" + research.getCost() + " Level"));
menu.addMenuClickHandler(index, (pl, slot, item, action) -> {
if (!SlimefunPlugin.getRegistry().getCurrentlyResearchingPlayers().contains(pl.getUniqueId())) {
if (research.canUnlock(pl)) {
@ -223,7 +226,7 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation {
if (pl.getGameMode() == GameMode.CREATIVE) {
research.unlock(pl, SlimefunPlugin.getSettings().researchesFreeInCreative);
openCategory(profile, category, survival, page);
Slimefun.runSync(() -> openCategory(profile, category, survival, page), 5L);
}
else {
research.unlock(pl, false);
@ -277,7 +280,7 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation {
Player p = profile.getPlayer();
if (p == null) return;
ChestMenu menu = new ChestMenu("Searching for: " + ChatUtils.crop(ChatColor.RESET, input));
ChestMenu menu = new ChestMenu(SlimefunPlugin.getLocal().getMessage(p, "guide.search.inventory").replace("%item%", ChatUtils.crop(ChatColor.RESET, input)));
String searchTerm = input.toLowerCase();
if (addToHistory) {
@ -542,7 +545,7 @@ public class ChestSlimefunGuide implements SlimefunGuideImplementation {
if (slimefunItem == null) return item;
String lore = Slimefun.hasPermission(p, slimefunItem, false) ? "&rNeeds to be unlocked elsewhere" : "&rNo Permission";
return Slimefun.hasUnlocked(p, slimefunItem, false) ? item : new CustomItem(Material.BARRIER, ItemUtils.getItemName(item), "&4&lLOCKED", "", lore);
return Slimefun.hasUnlocked(p, slimefunItem, false) ? item : new CustomItem(Material.BARRIER, ItemUtils.getItemName(item), "&4&l" + SlimefunPlugin.getLocal().getMessage(p, "guide.locked"), "", lore);
}
else {
return item;

View File

@ -55,7 +55,7 @@ public final class ChestMenuUtils {
return new CustomItem(SEARCH_BUTTON, meta -> {
meta.setDisplayName(ChatColors.color(SlimefunPlugin.getLocal().getMessage(p, "guide.search.name")));
List<String> lore = SlimefunPlugin.getLocal().getMessages(p, "guide.search.lore");
List<String> lore = Arrays.asList("", ChatColor.GRAY + "\u21E6 " + SlimefunPlugin.getLocal().getMessage(p, "guide.search.tooltip"));
lore.replaceAll(ChatColors::color);
meta.setLore(lore);
});

View File

@ -173,7 +173,7 @@ public class Research implements Keyed {
* @param instant
* Whether to unlock the research instantly
*/
public void unlock(final Player p, boolean instant) {
public void unlock(Player p, boolean instant) {
if (!instant) {
Slimefun.runSync(() -> {
p.playSound(p.getLocation(), Sound.ENTITY_BAT_TAKEOFF, 0.7F, 1F);

View File

@ -16,12 +16,18 @@ commands:
reset-target: '&cYour Knowledge has been reset'
guide:
locked: 'LOCKED'
locked-category:
- 'To unlock this category you will'
- 'need to unlock all items from the'
- 'following categories'
search:
message: '&bWhat would you like to search for?'
name: '&7Search...'
lore:
- '&bWhat would you like to search for?'
- '&7Type your search term into chat'
tooltip: '&bClick to search for an item'
inventory: 'Searching for: %item%'
tooltips:
open-category: 'Click to open'
@ -176,6 +182,11 @@ machines:
teleported: '&3Teleported!'
cancelled: '&4Teleportation cancelled!'
invulnerability: '&b&lYou have been given 30 seconds of Invulnerability!'
gui:
title: 'Your waypoints'
tooltip: 'Click to teleport'
time: 'Estimated time'
GPS_CONTROL_PANEL:
title: 'GPS - Control Panel'