Skip to content

Commit

Permalink
modified transfer code.
Browse files Browse the repository at this point in the history
  • Loading branch information
creatorfromhell committed Apr 28, 2024
1 parent 8699014 commit 0a76fe4
Showing 1 changed file with 1 addition and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,10 @@ public void onPortal(PlayerPortalEvent event) {
final String transferConfig = (end)? ".endtransfer" : ".nethertransfer";

if(PhantomWorlds.instance().data.getConfig().contains(cfgPath + transferConfig)) {
event.setCancelled(true);
final String to = PhantomWorlds.instance().data.getConfig().getString(cfgPath + transferConfig);

if(to == null) {
plugin.getLogger().warning("Configured transfer host doesn't exist!");
(new MultiMessage(
PhantomWorlds.instance().messages.getConfig()
.getStringList("common.invalidtransfer"), Arrays.asList(
new MultiMessage.Placeholder("prefix",
PhantomWorlds.instance().messages.getConfig().getString("common.prefix", "&b&lPhantomWorlds: &7"),
true)
))).send(event.getPlayer());
return;
}

Expand All @@ -91,6 +83,7 @@ public void onPortal(PlayerPortalEvent event) {
final int port = (details.length >= 2)? Integer.parseInt(details[1]) : 25565;

try {
event.setCancelled(true);
event.getPlayer().transfer(details[0], port);
} catch(NoSuchMethodError ignore) {
(new MultiMessage(
Expand Down

0 comments on commit 0a76fe4

Please sign in to comment.