mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-10-31 09:33:43 +01:00 
			
		
		
		
	WE tweak / Fix teleport event
This commit is contained in:
		| @@ -1422,7 +1422,6 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen | |||||||
|         } |         } | ||||||
|         final org.bukkit.Location from = event.getFrom(); |         final org.bukkit.Location from = event.getFrom(); | ||||||
|         final org.bukkit.Location to = event.getTo(); |         final org.bukkit.Location to = event.getTo(); | ||||||
|          |  | ||||||
|         int x2; |         int x2; | ||||||
|         if (MathMan.roundInt(from.getX()) != (x2 = MathMan.roundInt(to.getX()))) { |         if (MathMan.roundInt(from.getX()) != (x2 = MathMan.roundInt(to.getX()))) { | ||||||
|             Player player = event.getPlayer(); |             Player player = event.getPlayer(); | ||||||
| @@ -1440,10 +1439,7 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen | |||||||
|             PlotId id = plotManager.getPlotId(plotworld, x2, 0, MathMan.roundInt(to.getZ())); |             PlotId id = plotManager.getPlotId(plotworld, x2, 0, MathMan.roundInt(to.getZ())); | ||||||
|             Plot lastPlot = (Plot) pp.getMeta("lastplot"); |             Plot lastPlot = (Plot) pp.getMeta("lastplot"); | ||||||
|             if (id == null) { |             if (id == null) { | ||||||
|                 if (lastPlot == null) { |                 if (lastPlot != null && !plotExit(pp, lastPlot)) { | ||||||
|                     return; |  | ||||||
|                 } |  | ||||||
|                 if (!plotExit(pp, lastPlot)) { |  | ||||||
|                     MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_EXIT_DENIED); |                     MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_EXIT_DENIED); | ||||||
|                     if (lastPlot.equals(MainUtil.getPlot(BukkitUtil.getLocation(from)))) { |                     if (lastPlot.equals(MainUtil.getPlot(BukkitUtil.getLocation(from)))) { | ||||||
|                         player.teleport(from); |                         player.teleport(from); | ||||||
| @@ -1506,10 +1502,7 @@ public class PlayerEvents extends com.plotsquared.listener.PlotListener implemen | |||||||
|             PlotId id = plotManager.getPlotId(plotworld, x2, 0, z2); |             PlotId id = plotManager.getPlotId(plotworld, x2, 0, z2); | ||||||
|             Plot lastPlot = (Plot) pp.getMeta("lastplot"); |             Plot lastPlot = (Plot) pp.getMeta("lastplot"); | ||||||
|             if (id == null) { |             if (id == null) { | ||||||
|                 if (lastPlot == null) { |                 if (lastPlot != null && !plotExit(pp, lastPlot)) { | ||||||
|                     return; |  | ||||||
|                 } |  | ||||||
|                 if (!plotExit(pp, lastPlot)) { |  | ||||||
|                     MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_EXIT_DENIED); |                     MainUtil.sendMessage(pp, C.NO_PERMISSION_EVENT, C.PERMISSION_ADMIN_EXIT_DENIED); | ||||||
|                     if (lastPlot.equals(MainUtil.getPlot(BukkitUtil.getLocation(from)))) { |                     if (lastPlot.equals(MainUtil.getPlot(BukkitUtil.getLocation(from)))) { | ||||||
|                         player.teleport(from); |                         player.teleport(from); | ||||||
|   | |||||||
| @@ -28,7 +28,7 @@ public class WEManager { | |||||||
|         HashSet<RegionWrapper> regions = new HashSet<>(); |         HashSet<RegionWrapper> regions = new HashSet<>(); | ||||||
|         UUID uuid = player.getUUID(); |         UUID uuid = player.getUUID(); | ||||||
|         for (Plot plot : PS.get().getPlotsInWorld(player.getLocation().getWorld())) { |         for (Plot plot : PS.get().getPlotsInWorld(player.getLocation().getWorld())) { | ||||||
|             if (!plot.isBasePlot() || Settings.DONE_RESTRICTS_BUILDING && FlagManager.getPlotFlag(plot, "done") != null) { |             if (!plot.isBasePlot() || (Settings.DONE_RESTRICTS_BUILDING && FlagManager.getPlotFlag(plot, "done") != null)) { | ||||||
|                 continue; |                 continue; | ||||||
|             } |             } | ||||||
|             if (Settings.WE_ALLOW_HELPER ? plot.isAdded(uuid) : (plot.isOwner(uuid) || plot.getTrusted().contains(uuid))) { |             if (Settings.WE_ALLOW_HELPER ? plot.isAdded(uuid) : (plot.isOwner(uuid) || plot.getTrusted().contains(uuid))) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 boy0001
					boy0001