Get PS from Location rather than Entity to minimize the risk for hitting a velocityX NaN bug.

This commit is contained in:
Olof Larsson
2014-11-18 10:00:15 +01:00
parent 7da0b805a1
commit 2240696c98
10 changed files with 22 additions and 19 deletions

View File

@@ -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();

View File

@@ -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

View File

@@ -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);
}

View File

@@ -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();

View File

@@ -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

View File

@@ -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

View File

@@ -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?

View File

@@ -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;
}

View File

@@ -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