Added missing MountData and SingleEntityMountData files.

For some reason, git decided that it was a good idea to remove these two
files from the index...
This commit is contained in:
xGamingDudex 2015-12-01 00:46:20 +01:00
parent 6120c8246b
commit c98b427fde
2 changed files with 78 additions and 0 deletions

View File

@ -0,0 +1,43 @@
package mineplex.core.mount;
import java.util.List;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
public abstract class MountData
{
protected Player _owner;
public MountData(Player player)
{
_owner = player;
}
public boolean isPartOfMount(Entity ent)
{
return getEntityParts().contains(ent);
}
public abstract List<Entity> getEntityParts();
public boolean ownsMount(Player p)
{
return _owner.equals(p);
}
public Player getOwner()
{
return _owner;
}
public void remove()
{
for(Entity e : getEntityParts())
{
e.remove();
}
}
}

View File

@ -0,0 +1,35 @@
package mineplex.core.mount;
import java.util.ArrayList;
import java.util.List;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
public class SingleEntityMountData<T extends Entity> extends MountData
{
protected T Entity;
public SingleEntityMountData(Player player, T ent)
{
super(player);
Entity = ent;
}
@Override
public List<Entity> getEntityParts()
{
List<Entity> list = new ArrayList<Entity>();
list.add(Entity);
return list;
}
public T getEntity()
{
return Entity;
}
}