2018-08-30 16:12:21 +02:00
|
|
|
package com.minelittlepony.pony.data;
|
|
|
|
|
|
|
|
import net.minecraft.client.entity.AbstractClientPlayer;
|
|
|
|
import net.minecraft.entity.EntityLivingBase;
|
|
|
|
import net.minecraft.util.ResourceLocation;
|
2018-09-20 14:32:54 +02:00
|
|
|
import net.minecraft.util.math.AxisAlignedBB;
|
|
|
|
import net.minecraft.util.math.Vec3d;
|
2018-08-30 16:12:21 +02:00
|
|
|
|
|
|
|
import com.minelittlepony.MineLittlePony;
|
|
|
|
|
|
|
|
public interface IPony {
|
|
|
|
/**
|
|
|
|
* Gets or creates a new pony associated with the provided player.
|
|
|
|
* The results of this method should not be cached.
|
|
|
|
*/
|
|
|
|
static IPony forPlayer(AbstractClientPlayer player) {
|
|
|
|
return MineLittlePony.getInstance().getManager().getPony(player);
|
|
|
|
}
|
|
|
|
|
2018-10-20 23:18:20 +02:00
|
|
|
/**
|
|
|
|
* Gets or creates a new pony associated with the provided resource location.
|
|
|
|
* The results of this method should not be cached.
|
|
|
|
*/
|
|
|
|
static IPony forResource(ResourceLocation texture) {
|
|
|
|
return MineLittlePony.getInstance().getManager().getPony(texture);
|
|
|
|
}
|
|
|
|
|
2018-08-30 16:12:21 +02:00
|
|
|
/**
|
|
|
|
* Returns true if the provided entity is flying like a pegasus.
|
|
|
|
* True if the entity is off the ground, has race with wings.
|
|
|
|
* Creative flight counts only if the entity is <i>not</i> on the ground.
|
|
|
|
*
|
|
|
|
* Entities that are riding, climbing a ladder, or swimming are <i>not</i> flying.
|
|
|
|
*/
|
|
|
|
boolean isPegasusFlying(EntityLivingBase entity);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns true if the provided antity is actively wimming.
|
|
|
|
* That is, it should be fully submerged (isFullySubmerged returns true)
|
|
|
|
* and is not standing on the (river) bed or riding a ladder or any other entity.
|
|
|
|
*/
|
|
|
|
boolean isSwimming(EntityLivingBase entity);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns true if the provided entity is fully submerged with water reaching the entity's eyeheight or above.
|
|
|
|
*/
|
|
|
|
boolean isFullySubmerged(EntityLivingBase entity);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns true if an entity is wearing any headgear. This is used to hide things like the snout when wearing items
|
2018-08-31 11:45:09 +02:00
|
|
|
* such as the pumpkin, a player's head, or any other types of blocks.
|
|
|
|
*
|
|
|
|
* In this case the helmet does <i>not</i> count as headgear because those generally don't interfere with snuzzle rendering.
|
2018-08-30 16:12:21 +02:00
|
|
|
*/
|
|
|
|
boolean isWearingHeadgear(EntityLivingBase entity);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the race associated with this pony.
|
|
|
|
*
|
|
|
|
* @param ignorePony True to ignore the client's current pony level setting.
|
|
|
|
*/
|
|
|
|
PonyRace getRace(boolean ignorePony);
|
|
|
|
|
2018-09-19 23:22:59 +02:00
|
|
|
/**
|
|
|
|
* Returns true if an entity is riding a pony or other sentient life-form.
|
|
|
|
*
|
|
|
|
* Boats do not count.
|
|
|
|
*/
|
|
|
|
boolean isRidingInteractive(EntityLivingBase entity);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns the pony this entity is currently riding if any.
|
|
|
|
*/
|
|
|
|
IPony getMountedPony(EntityLivingBase entity);
|
|
|
|
|
2018-08-30 16:12:21 +02:00
|
|
|
/**
|
|
|
|
* Gets the texture used for rendering this pony.
|
|
|
|
*/
|
|
|
|
ResourceLocation getTexture();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the metadata associated with this pony's model texture.
|
|
|
|
*/
|
|
|
|
IPonyData getMetadata();
|
2018-09-20 14:32:54 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the riding offset of this entity relative to its lowermost mount.
|
|
|
|
*/
|
|
|
|
Vec3d getAbsoluteRidingOffset(EntityLivingBase entity);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the actual bounding box of this entity as a pony.
|
|
|
|
*/
|
|
|
|
AxisAlignedBB getComputedBoundingBox(EntityLivingBase entity);
|
2018-08-30 16:12:21 +02:00
|
|
|
}
|