Explorar el Código

BETA: Minor update for IPositionable interface.
* Adding setXYZ(ILocational loc) overload to setXYZ() method.

xban1x hace 11 años
padre
commit
81bd99a120

+ 2 - 3
L2J_Server_BETA/java/com/l2jserver/gameserver/model/L2Object.java

@@ -797,11 +797,10 @@ public abstract class L2Object implements IIdentifiable, INamable, ISpawnable, I
 		_z.set(z);
 	}
 	
+	@Override
 	public void setXYZ(ILocational loc)
 	{
-		_x.set(loc.getX());
-		_y.set(loc.getY());
-		_z.set(loc.getZ());
+		setXYZ(loc.getX(), loc.getY(), loc.getZ());
 	}
 	
 	@Override

+ 15 - 1
L2J_Server_BETA/java/com/l2jserver/gameserver/model/L2Spawn.java

@@ -37,6 +37,7 @@ import com.l2jserver.gameserver.model.actor.L2Character;
 import com.l2jserver.gameserver.model.actor.L2Npc;
 import com.l2jserver.gameserver.model.actor.templates.L2NpcTemplate;
 import com.l2jserver.gameserver.model.interfaces.IIdentifiable;
+import com.l2jserver.gameserver.model.interfaces.ILocational;
 import com.l2jserver.gameserver.model.interfaces.IPositionable;
 import com.l2jserver.gameserver.model.zone.type.NpcSpawnTerritory;
 import com.l2jserver.util.Rnd;
@@ -251,7 +252,9 @@ public class L2Spawn implements IPositionable, IIdentifiable
 	
 	/**
 	 * Set the x, y, z position of the spawn point.
-	 * @param z the z coordinate
+	 * @param x The x coordinate.
+	 * @param y The y coordinate.
+	 * @param z The z coordinate.
 	 */
 	@Override
 	public void setXYZ(int x, int y, int z)
@@ -261,6 +264,17 @@ public class L2Spawn implements IPositionable, IIdentifiable
 		setZ(z);
 	}
 	
+	/**
+	 * Set the x, y, z position of the spawn point.
+	 * @param loc The location.
+	 */
+	@Override
+	public void setXYZ(ILocational loc)
+	{
+		setXYZ(loc.getX(), loc.getY(), loc.getZ());
+		
+	}
+	
 	/**
 	 * @return the heading of L2NpcInstance when they are spawned.
 	 */

+ 11 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/Location.java

@@ -18,6 +18,7 @@
  */
 package com.l2jserver.gameserver.model;
 
+import com.l2jserver.gameserver.model.interfaces.ILocational;
 import com.l2jserver.gameserver.model.interfaces.IPositionable;
 
 /**
@@ -131,6 +132,16 @@ public class Location implements IPositionable
 		setZ(z);
 	}
 	
+	/**
+	 * Set the x, y, z coordinates.
+	 * @param loc The location.
+	 */
+	@Override
+	public void setXYZ(ILocational loc)
+	{
+		setXYZ(loc.getX(), loc.getY(), loc.getZ());
+	}
+	
 	/**
 	 * Get the heading.
 	 * @return the heading

+ 2 - 0
L2J_Server_BETA/java/com/l2jserver/gameserver/model/interfaces/IPositionable.java

@@ -34,6 +34,8 @@ public interface IPositionable extends ILocational
 	
 	public void setXYZ(int x, int y, int z);
 	
+	public void setXYZ(ILocational loc);
+	
 	public void setHeading(int heading);
 	
 	public void setInstanceId(int instanceId);