mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2024-11-22 18:46:35 +01:00
for got to add a ! to reverse the boolean warped
This commit is contained in:
parent
4fe6bfe955
commit
024fa7c2a0
@ -86,21 +86,25 @@ public class Listeners implements Listener {
|
||||
|
||||
boolean warped = Portal.activate(player, portal.toString());
|
||||
|
||||
DataCollector.playerWarped();
|
||||
|
||||
if(warped){
|
||||
if(!warped){
|
||||
player.teleport(fromloc);
|
||||
event.setCancelled(true);
|
||||
}
|
||||
else{
|
||||
DataCollector.playerWarped();
|
||||
}
|
||||
|
||||
final Player finalplayer = event.getPlayer();
|
||||
if(player.getGameMode().equals(GameMode.CREATIVE)){
|
||||
player.setMetadata("HasWarped", new FixedMetadataValue(plugin, true));
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
||||
public void run(){
|
||||
finalplayer.removeMetadata("HasWarped", plugin);
|
||||
}
|
||||
}, 20);
|
||||
if(Portal.triggers[portalId].equals(Material.PORTAL)){
|
||||
final Player finalplayer = event.getPlayer();
|
||||
if(player.getGameMode().equals(GameMode.CREATIVE)){
|
||||
player.setMetadata("HasWarped", new FixedMetadataValue(plugin, true));
|
||||
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
||||
public void run(){
|
||||
finalplayer.removeMetadata("HasWarped", plugin);
|
||||
}
|
||||
}, 20);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -233,7 +233,7 @@ public class Portal {
|
||||
}
|
||||
}
|
||||
else{
|
||||
player.sendMessage("§cThe destination you are attempting to warp to doesnt exist!");
|
||||
player.sendMessage("§cThe portal you are trying to use doesn't have a destination!");
|
||||
plugin.getLogger().log(Level.SEVERE, "The portal '" + portalName + "' has just had a warp "
|
||||
+ "attempt and either the data is corrupt or portal doesn't exist!");
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user