Skip to content

Commit

Permalink
Made requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBusyBiscuit committed Jul 20, 2020
1 parent 397f194 commit 29b26ed
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package io.github.thebusybiscuit.slimefun4.api.gps;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.UUID;

Expand Down Expand Up @@ -59,10 +61,21 @@ public void openTeleporterGUI(Player p, UUID uuid, Block b, int complexity) {
}

int slot = teleporterInventory[index];

Location l = waypoint.getLocation();
menu.addItem(slot, new CustomItem(waypoint.getIcon(), waypoint.getName().replace("player:death ", ""), "", "&8\u21E8 &7" + SlimefunPlugin.getLocalization().getResourceString(p, "tooltips.world") + ": &f" + l.getWorld().getName(), "&8\u21E8 &7X: &f" + l.getX(), "&8\u21E8 &7Y: &f" + l.getY(), "&8\u21E8 &7Z: &f" + l.getZ(), "&8\u21E8 &7" + SlimefunPlugin.getLocalization().getMessage(p, "machines.TELEPORTER.gui.time") + ": &f" + DoubleHandler.fixDouble(0.5 * getTeleportationTime(complexity, source, l)) + "s", "", "&8\u21E8 &c"
+ SlimefunPlugin.getLocalization().getMessage(p, "machines.TELEPORTER.gui.tooltip")));
double time = DoubleHandler.fixDouble(0.5 * getTeleportationTime(complexity, source, l));

List<String> nameAndLore = new ArrayList<>();
nameAndLore.add(waypoint.getName().replace("player:death ", ""));
nameAndLore.add("");
nameAndLore.add("&8\u21E8 &7" + SlimefunPlugin.getLocalization().getResourceString(p, "tooltips.world") + ": &f" + l.getWorld().getName());
nameAndLore.add("&8\u21E8 &7X: &f" + l.getX());
nameAndLore.add("&8\u21E8 &7Y: &f" + l.getY());
nameAndLore.add("&8\u21E8 &7Z: &f" + l.getZ());
nameAndLore.add("&8\u21E8 &7" + SlimefunPlugin.getLocalization().getMessage(p, "machines.TELEPORTER.gui.time") + ": &f" + time + "s");
nameAndLore.add("");
nameAndLore.add("&8\u21E8 &c" + SlimefunPlugin.getLocalization().getMessage(p, "machines.TELEPORTER.gui.tooltip"));

menu.addItem(slot, new CustomItem(waypoint.getIcon(), nameAndLore));
menu.addMenuClickHandler(slot, (pl, s, item, action) -> {
pl.closeInventory();
teleport(pl.getUniqueId(), complexity, source, l, false);
Expand Down Expand Up @@ -129,7 +142,8 @@ private void updateProgress(UUID uuid, int speed, int progress, Location source,
SlimefunPlugin.getLocalization().sendMessage(p, "machines.TELEPORTER.invulnerability");
}

destination.getWorld().spawnParticle(Particle.PORTAL, new Location(destination.getWorld(), destination.getX(), destination.getY() + 1, destination.getZ()), progress * 2, 0.2F, 0.8F, 0.2F);
Location loc = new Location(destination.getWorld(), destination.getX(), destination.getY() + 1, destination.getZ());
destination.getWorld().spawnParticle(Particle.PORTAL, loc, progress * 2, 0.2F, 0.8F, 0.2F);
destination.getWorld().playSound(destination, Sound.BLOCK_BEACON_ACTIVATE, 1F, 1F);
teleporterUsers.remove(uuid);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public boolean isHidden() {
public void onExecute(CommandSender sender, String[] args) {
if (sender.hasPermission("slimefun.command.versions") || sender instanceof ConsoleCommandSender) {
// After all these years... Spigot still displays as "CraftBukkit"
// so we will just this issue for them :)
// so we will just fix this inconsistency for them :)
String serverSoftware = PaperLib.isSpigot() && !PaperLib.isPaper() ? "Spigot" : Bukkit.getName();
sender.sendMessage(ChatColors.color("&a" + serverSoftware + " &2" + ReflectionUtils.getVersion()));
sender.sendMessage("");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public void open(Player p, Block b) {
Location destination = new Location(player.getWorld(), block.getX() + 0.5, block.getY() + 0.4, block.getZ() + 0.5, yaw, player.getEyeLocation().getPitch());
PaperLib.teleportAsync(player, destination).thenAccept(teleported -> {
if (teleported.booleanValue()) {
Slimefun.runSync(() -> player.sendTitle(ChatColor.WHITE + ChatColors.color(floor), " ", 20, 60, 20));
Slimefun.runSync(() -> player.sendTitle(ChatColor.WHITE + ChatColors.color(floor), null, 20, 60, 20));
}
});
})));
Expand Down

0 comments on commit 29b26ed

Please sign in to comment.