Get PS from Location rather than Entity to minimize the risk for hitting a velocityX NaN bug.
This commit is contained in:
@@ -41,7 +41,7 @@ public abstract class CmdFactionsAccessAbstract extends FactionsCommand
|
||||
@Override
|
||||
public void perform()
|
||||
{
|
||||
chunk = PS.valueOf(me).getChunk(true);
|
||||
chunk = PS.valueOf(me.getLocation()).getChunk(true);
|
||||
ta = BoardColl.get().getTerritoryAccessAt(chunk);
|
||||
hostFaction = ta.getHostFaction();
|
||||
|
||||
|
@@ -89,7 +89,7 @@ public class CmdFactionsHome extends FactionsCommandHome
|
||||
}
|
||||
|
||||
|
||||
Faction factionHere = BoardColl.get().getFactionAt(PS.valueOf(me));
|
||||
Faction factionHere = BoardColl.get().getFactionAt(PS.valueOf(me.getLocation()));
|
||||
Location locationHere = me.getLocation().clone();
|
||||
|
||||
// if player is not in a safe zone or their own faction territory, only allow teleport if no enemies are nearby
|
||||
|
@@ -2,6 +2,8 @@ package com.massivecraft.factions.cmd;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.bukkit.Location;
|
||||
|
||||
import com.massivecraft.factions.Const;
|
||||
import com.massivecraft.factions.Perm;
|
||||
import com.massivecraft.factions.entity.BoardColl;
|
||||
@@ -61,7 +63,8 @@ public class CmdFactionsMap extends FactionsCommand
|
||||
|
||||
public void showMap(int width, int height)
|
||||
{
|
||||
List<String> message = BoardColl.get().getMap(msenderFaction, PS.valueOf(me), me.getLocation().getYaw(), width, height);
|
||||
Location location = me.getLocation();
|
||||
List<String> message = BoardColl.get().getMap(msenderFaction, PS.valueOf(location), location.getYaw(), width, height);
|
||||
sendMessage(message);
|
||||
}
|
||||
|
||||
|
@@ -37,7 +37,7 @@ public class CmdFactionsSeeChunkOld extends FactionsCommand
|
||||
{
|
||||
// Args
|
||||
World world = me.getWorld();
|
||||
PS chunk = PS.valueOf(me).getChunk(true);
|
||||
PS chunk = PS.valueOf(me.getLocation()).getChunk(true);
|
||||
int chunkX = chunk.getChunkX();
|
||||
int chunkZ = chunk.getChunkZ();
|
||||
|
||||
|
@@ -57,7 +57,7 @@ public class CmdFactionsSetAuto extends FactionsCommand
|
||||
msg("<i>Now auto-setting <h>%s<i> land.", newFaction.describeTo(msender));
|
||||
|
||||
// Chunks
|
||||
final PS chunk = PS.valueOf(me).getChunk(true);
|
||||
final PS chunk = PS.valueOf(me.getLocation()).getChunk(true);
|
||||
Set<PS> chunks = Collections.singleton(chunk);
|
||||
|
||||
// Apply / Inform
|
||||
|
@@ -37,7 +37,7 @@ public class CmdFactionsSetCircle extends CmdFactionsSetXRadius
|
||||
public Set<PS> getChunks()
|
||||
{
|
||||
// Common Startup
|
||||
final PS chunk = PS.valueOf(me).getChunk(true);
|
||||
final PS chunk = PS.valueOf(me.getLocation()).getChunk(true);
|
||||
final Set<PS> chunks = new LinkedHashSet<PS>();
|
||||
|
||||
chunks.add(chunk); // The center should come first for pretty messages
|
||||
|
@@ -41,7 +41,7 @@ public class CmdFactionsSetFill extends CmdFactionsSetXSimple
|
||||
public Set<PS> getChunks()
|
||||
{
|
||||
// Common Startup
|
||||
final PS chunk = PS.valueOf(me).getChunk(true);
|
||||
final PS chunk = PS.valueOf(me.getLocation()).getChunk(true);
|
||||
final Set<PS> chunks = new LinkedHashSet<PS>();
|
||||
|
||||
// What faction (aka color) resides there?
|
||||
|
@@ -32,7 +32,7 @@ public class CmdFactionsSetOne extends CmdFactionsSetXSimple
|
||||
@Override
|
||||
public Set<PS> getChunks()
|
||||
{
|
||||
final PS chunk = PS.valueOf(me).getChunk(true);
|
||||
final PS chunk = PS.valueOf(me.getLocation()).getChunk(true);
|
||||
final Set<PS> chunks = Collections.singleton(chunk);
|
||||
return chunks;
|
||||
}
|
||||
|
@@ -37,7 +37,7 @@ public class CmdFactionsSetSquare extends CmdFactionsSetXRadius
|
||||
public Set<PS> getChunks()
|
||||
{
|
||||
// Common Startup
|
||||
final PS chunk = PS.valueOf(me).getChunk(true);
|
||||
final PS chunk = PS.valueOf(me.getLocation()).getChunk(true);
|
||||
final Set<PS> chunks = new LinkedHashSet<PS>();
|
||||
|
||||
chunks.add(chunk); // The center should come first for pretty messages
|
||||
|
Reference in New Issue
Block a user