mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-10 09:22:49 +00:00
Javadoc fixes and fixes missing dependency ChatMessageIDProvider in
IDProviderModule Signed-off-by: Rogiel <rogiel@rogiel.com>
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
package com.l2jserver.service.game.clan;
|
||||
|
||||
import com.l2jserver.model.world.Clan;
|
||||
import com.l2jserver.model.world.L2Character;
|
||||
import com.l2jserver.service.Service;
|
||||
|
||||
/**
|
||||
@@ -25,5 +26,7 @@ import com.l2jserver.service.Service;
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public interface ClanService extends Service {
|
||||
void join(Clan clan, L2Character character, L2Character inviter);
|
||||
|
||||
void leave(Clan clan, L2Character character);
|
||||
}
|
||||
|
||||
@@ -16,10 +16,11 @@
|
||||
*/
|
||||
package com.l2jserver.service.game.clan;
|
||||
|
||||
import com.l2jserver.model.game.Fort;
|
||||
import com.l2jserver.service.Service;
|
||||
|
||||
/**
|
||||
* This service manages Fort instances.
|
||||
* This service manages {@link Fort} instances.
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
*/
|
||||
package com.l2jserver.service.game.world.filter.impl;
|
||||
|
||||
import org.apache.commons.math.util.FastMath;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.l2jserver.model.world.PositionableObject;
|
||||
import com.l2jserver.service.game.world.filter.WorldObjectFilter;
|
||||
@@ -45,16 +47,30 @@ public class RangeFilter implements WorldObjectFilter<PositionableObject> {
|
||||
*/
|
||||
public RangeFilter(final PositionableObject object, final int range) {
|
||||
Preconditions.checkNotNull(object, "object");
|
||||
Preconditions.checkState(range >= 0, "range < 0");
|
||||
Preconditions.checkState(range >= 0, "negative range");
|
||||
this.object = object;
|
||||
this.range = Math.pow(range, 2);
|
||||
this.range = range;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean accept(PositionableObject other) {
|
||||
if (other == null)
|
||||
return false;
|
||||
|
||||
return other.getPosition().getDistanceSquared(object.getPosition()) <= range;
|
||||
|
||||
final double dx = FastMath.abs(object.getPoint().getX()
|
||||
- other.getPoint().getX());
|
||||
final double dy = FastMath.abs(object.getPoint().getY()
|
||||
- other.getPoint().getY());
|
||||
final double dz = FastMath.abs(object.getPoint().getZ()
|
||||
- other.getPoint().getZ());
|
||||
|
||||
if (dx > range)
|
||||
return false;
|
||||
if (dy > range)
|
||||
return false;
|
||||
if (dz > range)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,10 +37,6 @@ public class RangePointFilter implements WorldObjectFilter<PositionableObject> {
|
||||
* The desired maximum distance of the object
|
||||
*/
|
||||
private final double range;
|
||||
/**
|
||||
* The <tt>range</tt> multiplied by two
|
||||
*/
|
||||
private final double doubleRange;
|
||||
|
||||
/**
|
||||
* Creates a new instance
|
||||
@@ -55,7 +51,6 @@ public class RangePointFilter implements WorldObjectFilter<PositionableObject> {
|
||||
Preconditions.checkState(range >= 0, "range < 0");
|
||||
this.point = point;
|
||||
this.range = Math.pow(range, 2);
|
||||
this.doubleRange = range * 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -66,13 +61,13 @@ public class RangePointFilter implements WorldObjectFilter<PositionableObject> {
|
||||
final double dy = FastMath.abs(point.getY() - other.getPoint().getY());
|
||||
final double dz = FastMath.abs(point.getZ() - other.getPoint().getZ());
|
||||
|
||||
if (dx > doubleRange)
|
||||
if (dx > range)
|
||||
return false;
|
||||
if (dy > doubleRange)
|
||||
if (dy > range)
|
||||
return false;
|
||||
if (dz > doubleRange)
|
||||
if (dz > range)
|
||||
return false;
|
||||
|
||||
return ((dx * dx) + (dy * dy) + (dz * dz)) <= range;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user