mirror of
https://github.com/StarWishsama/Slimefun4.git
synced 2024-09-19 19:25:48 +00:00
Added several new strings for translation
* Cargo node connector messages now also show up in the actionbar! * /sf stats and /sf researching can no longer be used if researching is disabled. * If researching is disabled the guide will no longer contain settings for research-related options
This commit is contained in:
parent
5d5decbf45
commit
aa74958837
@ -48,6 +48,9 @@
|
|||||||
#### Changes
|
#### Changes
|
||||||
* Tree Growth Accelerators can now actually cause the Tree to fully grow (1.17+ only)
|
* Tree Growth Accelerators can now actually cause the Tree to fully grow (1.17+ only)
|
||||||
* Slimefun now requires Java 16
|
* Slimefun now requires Java 16
|
||||||
|
* "Connected / Not connected" messages for cargo nodes are now sent via the actionbar
|
||||||
|
* "/sf stats" can no longer be used if researching is disabled
|
||||||
|
* "/sf research" can no longer be used if researching is disabled
|
||||||
|
|
||||||
#### Fixes
|
#### Fixes
|
||||||
* Fixed #3597
|
* Fixed #3597
|
||||||
|
@ -8,6 +8,7 @@ import java.util.Set;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
|
import javax.annotation.ParametersAreNonnullByDefault;
|
||||||
|
|
||||||
import org.apache.commons.lang.Validate;
|
import org.apache.commons.lang.Validate;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -28,6 +29,7 @@ import io.github.thebusybiscuit.slimefun4.api.geo.GEOResource;
|
|||||||
import io.github.thebusybiscuit.slimefun4.api.geo.ResourceManager;
|
import io.github.thebusybiscuit.slimefun4.api.geo.ResourceManager;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
|
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItem;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile;
|
import io.github.thebusybiscuit.slimefun4.api.player.PlayerProfile;
|
||||||
|
import io.github.thebusybiscuit.slimefun4.core.services.localization.SlimefunLocalization;
|
||||||
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
|
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
|
||||||
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems;
|
import io.github.thebusybiscuit.slimefun4.implementation.SlimefunItems;
|
||||||
import io.github.thebusybiscuit.slimefun4.implementation.items.gps.GPSTransmitter;
|
import io.github.thebusybiscuit.slimefun4.implementation.items.gps.GPSTransmitter;
|
||||||
@ -57,7 +59,9 @@ public class GPSNetwork {
|
|||||||
|
|
||||||
private final Map<UUID, Set<Location>> transmitters = new HashMap<>();
|
private final Map<UUID, Set<Location>> transmitters = new HashMap<>();
|
||||||
private final TeleportationManager teleportation = new TeleportationManager();
|
private final TeleportationManager teleportation = new TeleportationManager();
|
||||||
|
|
||||||
private final ResourceManager resourceManager;
|
private final ResourceManager resourceManager;
|
||||||
|
private final SlimefunLocalization locale;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This constructs a new {@link GPSNetwork}.
|
* This constructs a new {@link GPSNetwork}.
|
||||||
@ -68,6 +72,7 @@ public class GPSNetwork {
|
|||||||
*/
|
*/
|
||||||
public GPSNetwork(@Nonnull Slimefun plugin) {
|
public GPSNetwork(@Nonnull Slimefun plugin) {
|
||||||
resourceManager = new ResourceManager(plugin);
|
resourceManager = new ResourceManager(plugin);
|
||||||
|
locale = Slimefun.getLocalization();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -141,24 +146,24 @@ public class GPSNetwork {
|
|||||||
* The {@link Player}
|
* The {@link Player}
|
||||||
*/
|
*/
|
||||||
public void openTransmitterControlPanel(@Nonnull Player p) {
|
public void openTransmitterControlPanel(@Nonnull Player p) {
|
||||||
ChestMenu menu = new ChestMenu(ChatColor.BLUE + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.title"));
|
ChestMenu menu = new ChestMenu(ChatColor.BLUE + locale.getMessage(p, "machines.GPS_CONTROL_PANEL.title"));
|
||||||
|
|
||||||
for (int slot : border) {
|
for (int slot : border) {
|
||||||
menu.addItem(slot, ChestMenuUtils.getBackground(), ChestMenuUtils.getEmptyClickHandler());
|
menu.addItem(slot, ChestMenuUtils.getBackground(), ChestMenuUtils.getEmptyClickHandler());
|
||||||
}
|
}
|
||||||
|
|
||||||
menu.addItem(2, new CustomItemStack(SlimefunItems.GPS_TRANSMITTER, im -> {
|
menu.addItem(2, new CustomItemStack(SlimefunItems.GPS_TRANSMITTER, im -> {
|
||||||
im.setDisplayName(ChatColor.GRAY + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.transmitters"));
|
im.setDisplayName(ChatColor.GRAY + locale.getMessage(p, "machines.GPS_CONTROL_PANEL.transmitters"));
|
||||||
im.setLore(null);
|
im.setLore(null);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
menu.addMenuClickHandler(2, ChestMenuUtils.getEmptyClickHandler());
|
menu.addMenuClickHandler(2, ChestMenuUtils.getEmptyClickHandler());
|
||||||
|
|
||||||
int complexity = getNetworkComplexity(p.getUniqueId());
|
int complexity = getNetworkComplexity(p.getUniqueId());
|
||||||
menu.addItem(4, new CustomItemStack(SlimefunItems.GPS_CONTROL_PANEL, "&7Network Info", "", "&8\u21E8 &7Status: " + (complexity > 0 ? "&2&lONLINE" : "&4&lOFFLINE"), "&8\u21E8 &7Complexity: &f" + complexity));
|
menu.addItem(4, new CustomItemStack(SlimefunItems.GPS_CONTROL_PANEL, "&7Network Info", "", "&8\u21E8 &7Status: " + getStatusText(p, complexity), "&8\u21E8 &7Complexity: &f" + complexity));
|
||||||
menu.addMenuClickHandler(4, ChestMenuUtils.getEmptyClickHandler());
|
menu.addMenuClickHandler(4, ChestMenuUtils.getEmptyClickHandler());
|
||||||
|
|
||||||
menu.addItem(6, new CustomItemStack(HeadTexture.GLOBE_OVERWORLD.getAsItemStack(), "&7" + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.waypoints"), "", ChatColor.GRAY + "\u21E8 " + Slimefun.getLocalization().getMessage(p, "guide.tooltips.open-itemgroup")));
|
menu.addItem(6, new CustomItemStack(HeadTexture.GLOBE_OVERWORLD.getAsItemStack(), "&7" + locale.getMessage(p, "machines.GPS_CONTROL_PANEL.waypoints"), "", ChatColor.GRAY + "\u21E8 " + locale.getMessage(p, "guide.tooltips.open-itemgroup")));
|
||||||
menu.addMenuClickHandler(6, (pl, slot, item, action) -> {
|
menu.addMenuClickHandler(6, (pl, slot, item, action) -> {
|
||||||
openWaypointControlPanel(pl);
|
openWaypointControlPanel(pl);
|
||||||
return false;
|
return false;
|
||||||
@ -200,8 +205,8 @@ public class GPSNetwork {
|
|||||||
*
|
*
|
||||||
* @return An icon for this waypoint
|
* @return An icon for this waypoint
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
@ParametersAreNonnullByDefault
|
||||||
public ItemStack getIcon(@Nonnull String name, @Nonnull Environment environment) {
|
public @Nonnull ItemStack getIcon(String name, Environment environment) {
|
||||||
if (name.startsWith("player:death ")) {
|
if (name.startsWith("player:death ")) {
|
||||||
return HeadTexture.DEATHPOINT.getAsItemStack();
|
return HeadTexture.DEATHPOINT.getAsItemStack();
|
||||||
} else if (environment == Environment.NETHER) {
|
} else if (environment == Environment.NETHER) {
|
||||||
@ -213,15 +218,24 @@ public class GPSNetwork {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ParametersAreNonnullByDefault
|
||||||
|
private @Nonnull String getStatusText(Player player, int complexity) {
|
||||||
|
if (complexity > 0) {
|
||||||
|
return "&2&l" + locale.getMessage(player, "gps.status-online");
|
||||||
|
} else {
|
||||||
|
return "&4&l" + locale.getMessage(player, "gps.status-offline");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void openWaypointControlPanel(@Nonnull Player p) {
|
public void openWaypointControlPanel(@Nonnull Player p) {
|
||||||
PlayerProfile.get(p, profile -> {
|
PlayerProfile.get(p, profile -> {
|
||||||
ChestMenu menu = new ChestMenu(ChatColor.BLUE + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.title"));
|
ChestMenu menu = new ChestMenu(ChatColor.BLUE + locale.getMessage(p, "machines.GPS_CONTROL_PANEL.title"));
|
||||||
|
|
||||||
for (int slot : border) {
|
for (int slot : border) {
|
||||||
menu.addItem(slot, ChestMenuUtils.getBackground(), ChestMenuUtils.getEmptyClickHandler());
|
menu.addItem(slot, ChestMenuUtils.getBackground(), ChestMenuUtils.getEmptyClickHandler());
|
||||||
}
|
}
|
||||||
|
|
||||||
menu.addItem(2, new CustomItemStack(SlimefunItems.GPS_TRANSMITTER, "&7" + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.transmitters"), "", ChatColor.GRAY + "\u21E8 " + Slimefun.getLocalization().getMessage(p, "guide.tooltips.open-itemgroup")));
|
menu.addItem(2, new CustomItemStack(SlimefunItems.GPS_TRANSMITTER, "&7" + locale.getMessage(p, "machines.GPS_CONTROL_PANEL.transmitters"), "", ChatColor.GRAY + "\u21E8 " + locale.getMessage(p, "guide.tooltips.open-itemgroup")));
|
||||||
menu.addMenuClickHandler(2, (pl, slot, item, action) -> {
|
menu.addMenuClickHandler(2, (pl, slot, item, action) -> {
|
||||||
openTransmitterControlPanel(pl);
|
openTransmitterControlPanel(pl);
|
||||||
return false;
|
return false;
|
||||||
@ -231,7 +245,7 @@ public class GPSNetwork {
|
|||||||
menu.addItem(4, new CustomItemStack(SlimefunItems.GPS_CONTROL_PANEL, "&7Network Info", "", "&8\u21E8 &7Status: " + (complexity > 0 ? "&2&lONLINE" : "&4&lOFFLINE"), "&8\u21E8 &7Complexity: &f" + complexity));
|
menu.addItem(4, new CustomItemStack(SlimefunItems.GPS_CONTROL_PANEL, "&7Network Info", "", "&8\u21E8 &7Status: " + (complexity > 0 ? "&2&lONLINE" : "&4&lOFFLINE"), "&8\u21E8 &7Complexity: &f" + complexity));
|
||||||
menu.addMenuClickHandler(4, ChestMenuUtils.getEmptyClickHandler());
|
menu.addMenuClickHandler(4, ChestMenuUtils.getEmptyClickHandler());
|
||||||
|
|
||||||
menu.addItem(6, new CustomItemStack(HeadTexture.GLOBE_OVERWORLD.getAsItemStack(), "&7" + Slimefun.getLocalization().getMessage(p, "machines.GPS_CONTROL_PANEL.waypoints")));
|
menu.addItem(6, new CustomItemStack(HeadTexture.GLOBE_OVERWORLD.getAsItemStack(), "&7" + locale.getMessage(p, "machines.GPS_CONTROL_PANEL.waypoints")));
|
||||||
menu.addMenuClickHandler(6, ChestMenuUtils.getEmptyClickHandler());
|
menu.addMenuClickHandler(6, ChestMenuUtils.getEmptyClickHandler());
|
||||||
|
|
||||||
int index = 0;
|
int index = 0;
|
||||||
@ -274,11 +288,11 @@ public class GPSNetwork {
|
|||||||
|
|
||||||
PlayerProfile.get(p, profile -> {
|
PlayerProfile.get(p, profile -> {
|
||||||
if ((profile.getWaypoints().size() + 2) > inventory.length) {
|
if ((profile.getWaypoints().size() + 2) > inventory.length) {
|
||||||
Slimefun.getLocalization().sendMessage(p, "gps.waypoint.max", true);
|
locale.sendMessage(p, "gps.waypoint.max", true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Slimefun.getLocalization().sendMessage(p, "gps.waypoint.new", true);
|
locale.sendMessage(p, "gps.waypoint.new", true);
|
||||||
p.playSound(p.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 0.5F, 1F);
|
p.playSound(p.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 0.5F, 1F);
|
||||||
|
|
||||||
ChatInput.waitForPlayer(Slimefun.instance(), p, message -> addWaypoint(p, message, l));
|
ChatInput.waitForPlayer(Slimefun.instance(), p, message -> addWaypoint(p, message, l));
|
||||||
@ -302,7 +316,7 @@ public class GPSNetwork {
|
|||||||
|
|
||||||
PlayerProfile.get(p, profile -> {
|
PlayerProfile.get(p, profile -> {
|
||||||
if ((profile.getWaypoints().size() + 2) > inventory.length) {
|
if ((profile.getWaypoints().size() + 2) > inventory.length) {
|
||||||
Slimefun.getLocalization().sendMessage(p, "gps.waypoint.max", true);
|
locale.sendMessage(p, "gps.waypoint.max", true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -315,7 +329,7 @@ public class GPSNetwork {
|
|||||||
|
|
||||||
for (Waypoint wp : profile.getWaypoints()) {
|
for (Waypoint wp : profile.getWaypoints()) {
|
||||||
if (wp.getId().equals(id)) {
|
if (wp.getId().equals(id)) {
|
||||||
Slimefun.getLocalization().sendMessage(p, "gps.waypoint.duplicate", true, msg -> msg.replace("%waypoint%", event.getName()));
|
locale.sendMessage(p, "gps.waypoint.duplicate", true, msg -> msg.replace("%waypoint%", event.getName()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -323,7 +337,7 @@ public class GPSNetwork {
|
|||||||
profile.addWaypoint(new Waypoint(profile, id, event.getLocation(), event.getName()));
|
profile.addWaypoint(new Waypoint(profile, id, event.getLocation(), event.getName()));
|
||||||
|
|
||||||
p.playSound(p.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 1F, 1F);
|
p.playSound(p.getLocation(), Sound.BLOCK_NOTE_BLOCK_PLING, 1F, 1F);
|
||||||
Slimefun.getLocalization().sendMessage(p, "gps.waypoint.added", true);
|
locale.sendMessage(p, "gps.waypoint.added", true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -33,6 +33,12 @@ class ResearchCommand extends SubCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onExecute(CommandSender sender, String[] args) {
|
public void onExecute(CommandSender sender, String[] args) {
|
||||||
|
// Check if researching is even enabled
|
||||||
|
if (!Slimefun.getRegistry().isResearchingEnabled()) {
|
||||||
|
Slimefun.getLocalization().sendMessage(sender, "messages.researching-is-disabled");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (args.length == 3) {
|
if (args.length == 3) {
|
||||||
if (!(sender instanceof Player) || sender.hasPermission("slimefun.cheat.researches")) {
|
if (!(sender instanceof Player) || sender.hasPermission("slimefun.cheat.researches")) {
|
||||||
Optional<Player> player = PlayerList.findByName(args[1]);
|
Optional<Player> player = PlayerList.findByName(args[1]);
|
||||||
|
@ -23,6 +23,12 @@ class StatsCommand extends SubCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onExecute(CommandSender sender, String[] args) {
|
public void onExecute(CommandSender sender, String[] args) {
|
||||||
|
// Check if researching is even enabled
|
||||||
|
if (!Slimefun.getRegistry().isResearchingEnabled()) {
|
||||||
|
Slimefun.getLocalization().sendMessage(sender, "messages.researching-is-disabled");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
if (sender.hasPermission("slimefun.stats.others") || sender instanceof ConsoleCommandSender) {
|
if (sender.hasPermission("slimefun.stats.others") || sender instanceof ConsoleCommandSender) {
|
||||||
Optional<Player> player = PlayerList.findByName(args[1]);
|
Optional<Player> player = PlayerList.findByName(args[1]);
|
||||||
|
@ -10,6 +10,7 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
import io.github.bakedlibs.dough.data.persistent.PersistentDataAPI;
|
import io.github.bakedlibs.dough.data.persistent.PersistentDataAPI;
|
||||||
import io.github.bakedlibs.dough.items.CustomItemStack;
|
import io.github.bakedlibs.dough.items.CustomItemStack;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon;
|
import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon;
|
||||||
|
import io.github.thebusybiscuit.slimefun4.core.SlimefunRegistry;
|
||||||
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
|
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
|
||||||
|
|
||||||
class FireworksOption implements SlimefunGuideOption<Boolean> {
|
class FireworksOption implements SlimefunGuideOption<Boolean> {
|
||||||
@ -26,7 +27,9 @@ class FireworksOption implements SlimefunGuideOption<Boolean> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Optional<ItemStack> getDisplayItem(Player p, ItemStack guide) {
|
public Optional<ItemStack> getDisplayItem(Player p, ItemStack guide) {
|
||||||
if (Slimefun.getRegistry().isResearchFireworkEnabled()) {
|
SlimefunRegistry registry = Slimefun.getRegistry();
|
||||||
|
|
||||||
|
if (registry.isResearchingEnabled() && registry.isResearchFireworkEnabled()) {
|
||||||
boolean enabled = getSelectedOption(p, guide).orElse(true);
|
boolean enabled = getSelectedOption(p, guide).orElse(true);
|
||||||
ItemStack item = new CustomItemStack(Material.FIREWORK_ROCKET, "&bFireworks: &" + (enabled ? "aYes" : "4No"), "", "&7You can now toggle whether you", "&7will be presented with a big firework", "&7upon researching an item.", "", "&7\u21E8 &eClick to " + (enabled ? "disable" : "enable") + " your fireworks");
|
ItemStack item = new CustomItemStack(Material.FIREWORK_ROCKET, "&bFireworks: &" + (enabled ? "aYes" : "4No"), "", "&7You can now toggle whether you", "&7will be presented with a big firework", "&7upon researching an item.", "", "&7\u21E8 &eClick to " + (enabled ? "disable" : "enable") + " your fireworks");
|
||||||
return Optional.of(item);
|
return Optional.of(item);
|
||||||
|
@ -13,6 +13,7 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
import io.github.bakedlibs.dough.data.persistent.PersistentDataAPI;
|
import io.github.bakedlibs.dough.data.persistent.PersistentDataAPI;
|
||||||
import io.github.bakedlibs.dough.items.CustomItemStack;
|
import io.github.bakedlibs.dough.items.CustomItemStack;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon;
|
import io.github.thebusybiscuit.slimefun4.api.SlimefunAddon;
|
||||||
|
import io.github.thebusybiscuit.slimefun4.core.SlimefunRegistry;
|
||||||
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
|
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -39,7 +40,9 @@ class LearningAnimationOption implements SlimefunGuideOption<Boolean> {
|
|||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public Optional<ItemStack> getDisplayItem(@Nonnull Player p, @Nonnull ItemStack guide) {
|
public Optional<ItemStack> getDisplayItem(@Nonnull Player p, @Nonnull ItemStack guide) {
|
||||||
if (Slimefun.getRegistry().isLearningAnimationDisabled()) {
|
SlimefunRegistry registry = Slimefun.getRegistry();
|
||||||
|
|
||||||
|
if (!registry.isResearchingEnabled() || registry.isLearningAnimationDisabled()) {
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
} else {
|
} else {
|
||||||
boolean enabled = getSelectedOption(p, guide).orElse(true);
|
boolean enabled = getSelectedOption(p, guide).orElse(true);
|
||||||
|
@ -7,12 +7,12 @@ import org.bukkit.block.Block;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import io.github.bakedlibs.dough.common.ChatColors;
|
|
||||||
import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
|
import io.github.thebusybiscuit.slimefun4.api.items.ItemGroup;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
|
import io.github.thebusybiscuit.slimefun4.api.items.SlimefunItemStack;
|
||||||
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
|
import io.github.thebusybiscuit.slimefun4.api.recipes.RecipeType;
|
||||||
import io.github.thebusybiscuit.slimefun4.core.handlers.BlockUseHandler;
|
import io.github.thebusybiscuit.slimefun4.core.handlers.BlockUseHandler;
|
||||||
import io.github.thebusybiscuit.slimefun4.core.networks.cargo.CargoNet;
|
import io.github.thebusybiscuit.slimefun4.core.networks.cargo.CargoNet;
|
||||||
|
import io.github.thebusybiscuit.slimefun4.implementation.Slimefun;
|
||||||
import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem;
|
import io.github.thebusybiscuit.slimefun4.implementation.items.SimpleSlimefunItem;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -32,9 +32,8 @@ public class CargoConnectorNode extends SimpleSlimefunItem<BlockUseHandler> {
|
|||||||
super(itemGroup, item, recipeType, recipe, recipeOutput);
|
super(itemGroup, item, recipeType, recipe, recipeOutput);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
|
||||||
@Override
|
@Override
|
||||||
public BlockUseHandler getItemHandler() {
|
public @Nonnull BlockUseHandler getItemHandler() {
|
||||||
return e -> {
|
return e -> {
|
||||||
if (!e.getClickedBlock().isPresent()) {
|
if (!e.getClickedBlock().isPresent()) {
|
||||||
return;
|
return;
|
||||||
@ -44,9 +43,9 @@ public class CargoConnectorNode extends SimpleSlimefunItem<BlockUseHandler> {
|
|||||||
Block b = e.getClickedBlock().get();
|
Block b = e.getClickedBlock().get();
|
||||||
|
|
||||||
if (CargoNet.getNetworkFromLocation(b.getLocation()) != null) {
|
if (CargoNet.getNetworkFromLocation(b.getLocation()) != null) {
|
||||||
p.sendMessage(ChatColors.color("&7Connected: " + "&2\u2714"));
|
Slimefun.getLocalization().sendActionbarMessage(p, "machines.CARGO_NODES.connected", false);
|
||||||
} else {
|
} else {
|
||||||
p.sendMessage(ChatColors.color("&7Connected: " + "&4\u2718"));
|
Slimefun.getLocalization().sendActionbarMessage(p, "machines.CARGO_NODES.not-connected", false);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -54,8 +54,7 @@ class ElevatorFloor {
|
|||||||
*
|
*
|
||||||
* @return The name of this floor
|
* @return The name of this floor
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
public @Nonnull String getName() {
|
||||||
public String getName() {
|
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,8 +63,7 @@ class ElevatorFloor {
|
|||||||
*
|
*
|
||||||
* @return The {@link Location} of this floor
|
* @return The {@link Location} of this floor
|
||||||
*/
|
*/
|
||||||
@Nonnull
|
public @Nonnull Location getLocation() {
|
||||||
public Location getLocation() {
|
|
||||||
return location;
|
return location;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,8 +68,7 @@ public class ElevatorPlate extends SimpleSlimefunItem<BlockUseHandler> {
|
|||||||
addItemHandler(onPlace());
|
addItemHandler(onPlace());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
private @Nonnull BlockPlaceHandler onPlace() {
|
||||||
private BlockPlaceHandler onPlace() {
|
|
||||||
return new BlockPlaceHandler(false) {
|
return new BlockPlaceHandler(false) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -81,9 +80,8 @@ public class ElevatorPlate extends SimpleSlimefunItem<BlockUseHandler> {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
|
||||||
@Override
|
@Override
|
||||||
public BlockUseHandler getItemHandler() {
|
public @Nonnull BlockUseHandler getItemHandler() {
|
||||||
return e -> {
|
return e -> {
|
||||||
Block b = e.getClickedBlock().get();
|
Block b = e.getClickedBlock().get();
|
||||||
|
|
||||||
@ -93,8 +91,7 @@ public class ElevatorPlate extends SimpleSlimefunItem<BlockUseHandler> {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
public @Nonnull List<ElevatorFloor> getFloors(@Nonnull Block b) {
|
||||||
public List<ElevatorFloor> getFloors(@Nonnull Block b) {
|
|
||||||
LinkedList<ElevatorFloor> floors = new LinkedList<>();
|
LinkedList<ElevatorFloor> floors = new LinkedList<>();
|
||||||
int index = 0;
|
int index = 0;
|
||||||
|
|
||||||
@ -209,7 +206,7 @@ public class ElevatorPlate extends SimpleSlimefunItem<BlockUseHandler> {
|
|||||||
|
|
||||||
@ParametersAreNonnullByDefault
|
@ParametersAreNonnullByDefault
|
||||||
public void openEditor(Player p, Block b) {
|
public void openEditor(Player p, Block b) {
|
||||||
ChestMenu menu = new ChestMenu("Elevator Settings");
|
ChestMenu menu = new ChestMenu(Slimefun.getLocalization().getMessage(p, "machines.ELEVATOR.editor-title"));
|
||||||
|
|
||||||
menu.addItem(4, new CustomItemStack(Material.NAME_TAG, "&7Floor Name &e(Click to edit)", "", ChatColor.WHITE + ChatColors.color(BlockStorage.getLocationInfo(b.getLocation(), DATA_KEY))));
|
menu.addItem(4, new CustomItemStack(Material.NAME_TAG, "&7Floor Name &e(Click to edit)", "", ChatColor.WHITE + ChatColors.color(BlockStorage.getLocationInfo(b.getLocation(), DATA_KEY))));
|
||||||
menu.addMenuClickHandler(4, (pl, slot, item, action) -> {
|
menu.addMenuClickHandler(4, (pl, slot, item, action) -> {
|
||||||
|
@ -168,6 +168,7 @@ messages:
|
|||||||
piglin-barter: '&4You cannot barter with piglins using Slimefun items'
|
piglin-barter: '&4You cannot barter with piglins using Slimefun items'
|
||||||
bee-suit-slow-fall: '&eYour Bee Wings will help you to get back to the ground safe and slow'
|
bee-suit-slow-fall: '&eYour Bee Wings will help you to get back to the ground safe and slow'
|
||||||
deprecated-item: '&4This item has been deprecated and will be removed from Slimefun soon.'
|
deprecated-item: '&4This item has been deprecated and will be removed from Slimefun soon.'
|
||||||
|
researching-is-disabled: '&cResearching has been disabled on this server. Everything is unlocked by default!'
|
||||||
|
|
||||||
multi-tool:
|
multi-tool:
|
||||||
mode-change: '&b%device% mode changed to: &9%mode%'
|
mode-change: '&b%device% mode changed to: &9%mode%'
|
||||||
@ -296,8 +297,9 @@ machines:
|
|||||||
pick-a-floor: '&3- Pick a floor -'
|
pick-a-floor: '&3- Pick a floor -'
|
||||||
current-floor: '&eThis is the floor you are currently on:'
|
current-floor: '&eThis is the floor you are currently on:'
|
||||||
click-to-teleport: '&eClick &7to teleport to this floor:'
|
click-to-teleport: '&eClick &7to teleport to this floor:'
|
||||||
enter-name: '&7Please enter your desired floor name into your Chat. &r(Color Codes are supported!)'
|
enter-name: '&7Please enter your desired floor name into your Chat. &f(Color Codes are supported!)'
|
||||||
named: '&2Successfully named this floor: &r%floor%'
|
named: '&2Successfully named this floor: &f%floor%'
|
||||||
|
editor-title: 'Configure this elevator'
|
||||||
|
|
||||||
TELEPORTER:
|
TELEPORTER:
|
||||||
teleporting: '&3Teleporting...'
|
teleporting: '&3Teleporting...'
|
||||||
@ -317,6 +319,8 @@ machines:
|
|||||||
|
|
||||||
CARGO_NODES:
|
CARGO_NODES:
|
||||||
must-be-placed: '&4Must be placed onto a chest or machine!'
|
must-be-placed: '&4Must be placed onto a chest or machine!'
|
||||||
|
connected: '&2Connected!'
|
||||||
|
not-connected: '&4Not connected!'
|
||||||
|
|
||||||
INDUSTRIAL_MINER:
|
INDUSTRIAL_MINER:
|
||||||
no-fuel: '&cYour Industrial Miner ran out of fuel! Put your fuel into the chest above.'
|
no-fuel: '&cYour Industrial Miner ran out of fuel! Put your fuel into the chest above.'
|
||||||
@ -356,6 +360,8 @@ cauldron:
|
|||||||
|
|
||||||
gps:
|
gps:
|
||||||
deathpoint: '&4Deathpoint &7%date%'
|
deathpoint: '&4Deathpoint &7%date%'
|
||||||
|
status-online: 'ONLINE'
|
||||||
|
status-offline: 'OFFLINE'
|
||||||
waypoint:
|
waypoint:
|
||||||
new: '&ePlease type in a name for your new waypoint in the chat. &7(Color Codes supported!)'
|
new: '&ePlease type in a name for your new waypoint in the chat. &7(Color Codes supported!)'
|
||||||
added: '&aSuccessfully added a new waypoint'
|
added: '&aSuccessfully added a new waypoint'
|
||||||
|
Loading…
Reference in New Issue
Block a user