From 34071a46c6d872a2bd5dcc324068d3e711a798a9 Mon Sep 17 00:00:00 2001 From: Sollace Date: Fri, 12 Oct 2018 18:09:40 +0200 Subject: [PATCH] Fill in various missing documentation --- .../model/armour/IArmorTextureResolver.java | 3 +++ .../model/armour/IEquestrianArmor.java | 12 ++++++++++++ .../model/capabilities/IModel.java | 18 ++++++++++++++++++ .../model/capabilities/IModelPart.java | 2 +- .../model/capabilities/IModelPegasus.java | 6 +++++- .../model/capabilities/IModelUnicorn.java | 3 +++ 6 files changed, 42 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/minelittlepony/model/armour/IArmorTextureResolver.java b/src/main/java/com/minelittlepony/model/armour/IArmorTextureResolver.java index ca41cfb1..0e84ca88 100644 --- a/src/main/java/com/minelittlepony/model/armour/IArmorTextureResolver.java +++ b/src/main/java/com/minelittlepony/model/armour/IArmorTextureResolver.java @@ -11,5 +11,8 @@ import javax.annotation.Nullable; public interface IArmorTextureResolver { + /** + * Gets the armour texture to be used for the given entity, armour piece, slot, and render layer. + */ ResourceLocation getArmorTexture(T entity, ItemStack itemstack, EntityEquipmentSlot slot, ArmorLayer layer, @Nullable String type); } diff --git a/src/main/java/com/minelittlepony/model/armour/IEquestrianArmor.java b/src/main/java/com/minelittlepony/model/armour/IEquestrianArmor.java index c5bc8884..44df57f0 100644 --- a/src/main/java/com/minelittlepony/model/armour/IEquestrianArmor.java +++ b/src/main/java/com/minelittlepony/model/armour/IEquestrianArmor.java @@ -6,10 +6,22 @@ import com.minelittlepony.model.capabilities.IModelArmor; import com.minelittlepony.model.capabilities.IModelWrapper; public interface IEquestrianArmor extends IModelWrapper { + /** + * Gets the armour model to render for the given layer. + */ V getArmorForLayer(ArmorLayer layer); + /** + * The layer used to render a given armour piece. + */ enum ArmorLayer { + /** + * Fits snugly to the player's model. + */ INNER, + /** + * Hanging loose and sagging free + */ OUTER } } diff --git a/src/main/java/com/minelittlepony/model/capabilities/IModel.java b/src/main/java/com/minelittlepony/model/capabilities/IModel.java index 4c4a8531..5bbbb4c5 100644 --- a/src/main/java/com/minelittlepony/model/capabilities/IModel.java +++ b/src/main/java/com/minelittlepony/model/capabilities/IModel.java @@ -20,6 +20,9 @@ public interface IModel extends ICapitated { */ void transform(BodyPart part); + /** + * Gets the active scaling profile used to lay out this model's parts. + */ PonySize getSize(); /** @@ -27,6 +30,9 @@ public interface IModel extends ICapitated { */ IEquestrianArmor createArmour(); + /** + * Gets the skin metadata associated with this model. + */ IPonyData getMetadata(); /** @@ -77,12 +83,24 @@ public interface IModel extends ICapitated { */ boolean isChild(); + /** + * Gets the current leg swing amount. + */ float getSwingAmount(); + /** + * Gets the y-offset applied to entities riding this one. + */ float getRiderYOffset(); + /** + * Gets the actual, visible height of this model when rendered. + */ float getModelHeight(); + /** + * Tests if this model is wearing the given piece of gear. + */ default boolean isWearing(PonyWearable wearable) { return getMetadata().isWearing(wearable); } diff --git a/src/main/java/com/minelittlepony/model/capabilities/IModelPart.java b/src/main/java/com/minelittlepony/model/capabilities/IModelPart.java index 85e6d455..86787da8 100644 --- a/src/main/java/com/minelittlepony/model/capabilities/IModelPart.java +++ b/src/main/java/com/minelittlepony/model/capabilities/IModelPart.java @@ -17,7 +17,7 @@ public interface IModelPart { */ default void setRotationAndAngles(boolean rainboom, float move, float swing, float bodySwing, float ticks) { - }; + } /** * Renders this model component. diff --git a/src/main/java/com/minelittlepony/model/capabilities/IModelPegasus.java b/src/main/java/com/minelittlepony/model/capabilities/IModelPegasus.java index 2410c7de..c73ca487 100644 --- a/src/main/java/com/minelittlepony/model/capabilities/IModelPegasus.java +++ b/src/main/java/com/minelittlepony/model/capabilities/IModelPegasus.java @@ -14,7 +14,11 @@ public interface IModelPegasus extends IModel { return (isSwimming() || isFlying() || isCrouching()) && !isElytraFlying(); } - + /** + * Determines angle used to animate wing flaps whilst flying/swimming. + * + * @param ticks Partial render ticks + */ default float getWingRotationFactor(float ticks) { if (isSwimming()) { return (MathHelper.sin(ticks * 0.136f) / 2) + ROTATE_270; diff --git a/src/main/java/com/minelittlepony/model/capabilities/IModelUnicorn.java b/src/main/java/com/minelittlepony/model/capabilities/IModelUnicorn.java index a9ad0e9c..61751bd7 100644 --- a/src/main/java/com/minelittlepony/model/capabilities/IModelUnicorn.java +++ b/src/main/java/com/minelittlepony/model/capabilities/IModelUnicorn.java @@ -5,6 +5,9 @@ import net.minecraft.util.EnumHandSide; import com.minelittlepony.render.model.PonyRenderer; public interface IModelUnicorn extends IModel { + /** + * Gets the arm used for holding items in their magic. + */ PonyRenderer getUnicornArmForSide(EnumHandSide side); /**