mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-11-04 11:13:45 +01:00 
			
		
		
		
	use a new Location convert function to ensure that there will be no side effects
This commit is contained in:
		@@ -701,7 +701,7 @@ import java.util.regex.Pattern;
 | 
				
			|||||||
                    // to is identical to the plot's home location, and untrusted-visit is true
 | 
					                    // to is identical to the plot's home location, and untrusted-visit is true
 | 
				
			||||||
                    // i.e. untrusted-visit can override deny-teleport
 | 
					                    // i.e. untrusted-visit can override deny-teleport
 | 
				
			||||||
                    // this is acceptable, because otherwise it wouldn't make sense to have both flags set
 | 
					                    // this is acceptable, because otherwise it wouldn't make sense to have both flags set
 | 
				
			||||||
                    if (!result && !(Flags.UNTRUSTED_VISIT.isTrue(plot) && plot.getHome().equals(location))) {
 | 
					                    if (!result && !(Flags.UNTRUSTED_VISIT.isTrue(plot) && plot.getHome().equals(BukkitUtil.getLocationFull(to)))) {
 | 
				
			||||||
                        MainUtil.sendMessage(plotPlayer, Captions.NO_PERMISSION_EVENT,
 | 
					                        MainUtil.sendMessage(plotPlayer, Captions.NO_PERMISSION_EVENT,
 | 
				
			||||||
                            Captions.PERMISSION_ADMIN_ENTRY_DENIED);
 | 
					                            Captions.PERMISSION_ADMIN_ENTRY_DENIED);
 | 
				
			||||||
                        event.setCancelled(true);
 | 
					                        event.setCancelled(true);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -215,6 +215,12 @@ import java.util.Set;
 | 
				
			|||||||
            MathMan.roundInt(location.getY()), MathMan.roundInt(location.getZ()));
 | 
					            MathMan.roundInt(location.getY()), MathMan.roundInt(location.getZ()));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public static Location getLocationFull(@NonNull final org.bukkit.Location location) {
 | 
				
			||||||
 | 
					      return new Location(location.getWorld().getName(), MathMan.roundInt(location.getX()),
 | 
				
			||||||
 | 
					          MathMan.roundInt(location.getY()), MathMan.roundInt(location.getZ()),
 | 
				
			||||||
 | 
					          location.getYaw(), location.getPitch());
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static org.bukkit.Location getLocation(@NonNull final Location location) {
 | 
					    public static org.bukkit.Location getLocation(@NonNull final Location location) {
 | 
				
			||||||
        return new org.bukkit.Location(getWorld(location.getWorld()), location.getX(),
 | 
					        return new org.bukkit.Location(getWorld(location.getWorld()), location.getX(),
 | 
				
			||||||
            location.getY(), location.getZ());
 | 
					            location.getY(), location.getZ());
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user