From 82ec2b4f1483da5ec1e615c97ff6fdbbfa418e22 Mon Sep 17 00:00:00 2001 From: Sollace Date: Tue, 29 Aug 2023 02:06:13 +0100 Subject: [PATCH] Add changeling wings --- .../client/minelittlepony/BodyPartGear.java | 23 ++++++++++++++++-- .../unicopia/client/minelittlepony/Main.java | 2 ++ .../textures/models/wings/bug_pony.png | Bin 0 -> 1269 bytes 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 src/main/resources/assets/unicopia/textures/models/wings/bug_pony.png diff --git a/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/BodyPartGear.java b/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/BodyPartGear.java index f8ba0d14..e99a9860 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/BodyPartGear.java +++ b/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/BodyPartGear.java @@ -9,6 +9,7 @@ import com.minelittlepony.api.model.gear.IGear; import com.minelittlepony.client.model.ClientPonyModel; import com.minelittlepony.client.model.ModelType; import com.minelittlepony.client.model.PlayerModelKey; +import com.minelittlepony.client.model.entity.race.ChangelingModel; import com.minelittlepony.client.model.entity.race.PegasusModel; import com.minelittlepony.client.model.entity.race.UnicornModel; import com.minelittlepony.client.model.part.UnicornHorn; @@ -33,6 +34,9 @@ class BodyPartGear & MsonModel & IModel> private static final Identifier ICARUS_WINGS = Unicopia.id("textures/models/wings/icarus_pony.png"); private static final Identifier ICARUS_WINGS_CORRUPTED = Unicopia.id("textures/models/wings/icarus_corrupted_pony.png"); + public static final Predicate BUG_WINGS_PREDICATE = MINE_LP_HAS_NO_WINGS.and(AmuletSelectors.PEGASUS_AMULET.negate()).and(EquinePredicates.PLAYER_CHANGELING); + public static final Identifier BUG_WINGS = Unicopia.id("textures/models/wings/bug_pony.png"); + public static final Predicate BAT_WINGS_PREDICATE = MINE_LP_HAS_NO_WINGS.and(AmuletSelectors.PEGASUS_AMULET.negate()).and(EquinePredicates.PLAYER_BAT); public static final Identifier BAT_WINGS = Unicopia.id("textures/models/wings/bat_pony.png"); @@ -52,7 +56,11 @@ class BodyPartGear & MsonModel & IModel> } public static BodyPartGear batWings() { - return new BodyPartGear<>(BodyPart.BODY, ModelType.BAT_PONY, BAT_WINGS_PREDICATE, WingsGearModel::new, WingsGearModel::getWings, e -> BAT_WINGS); + return new BodyPartGear<>(BodyPart.BODY, ModelType.BAT_PONY, BAT_WINGS_PREDICATE, WingsGearModel::new, IPegasus::getWings, e -> BAT_WINGS); + } + + public static BodyPartGear bugWings() { + return new BodyPartGear<>(BodyPart.BODY, ModelType.CHANGELING, BUG_WINGS_PREDICATE, BugWingsGearModel::new, IPegasus::getWings, e -> BUG_WINGS); } public static BodyPartGear unicornHorn() { @@ -70,7 +78,7 @@ class BodyPartGear & MsonModel & IModel> PlayerModelKey modelKey, Predicate renderTargetPredicate, MsonModel.Factory modelFactory, - Function partExtractor, + Function partExtractor, Function textureSupplier) { this.gearLocation = gearLocation; this.model = modelKey.steveKey().createModel(modelFactory); @@ -119,6 +127,17 @@ class BodyPartGear & MsonModel & IModel> } } + static final class BugWingsGearModel extends ChangelingModel { + public BugWingsGearModel(ModelPart tree) { + super(tree, false); + } + + @Override + public boolean canFly() { + return true; + } + } + static final class HornGearModel extends UnicornModel { public HornGearModel(ModelPart tree) { super(tree, false); diff --git a/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/Main.java b/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/Main.java index 2f7c292d..958debad 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/Main.java +++ b/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/Main.java @@ -29,6 +29,7 @@ public class Main extends MineLPDelegate implements ClientModInitializer { IGear.register(HeldEntityGear::new); IGear.register(BodyPartGear::pegasusWings); IGear.register(BodyPartGear::batWings); + IGear.register(BodyPartGear::bugWings); IGear.register(BodyPartGear::unicornHorn); IGear.register(AmuletGear::new); IGear.register(GlassesGear::new); @@ -51,6 +52,7 @@ public class Main extends MineLPDelegate implements ClientModInitializer { model.getAttributes().isGoingFast |= zMotion > 0.4F; model.getAttributes().isGoingFast |= pony.getMotion().isDiving(); } + model.getAttributes().isGoingFast |= pony.getMotion().isRainbooming(); model.getAttributes().isGoingFast &= !pony.getEntityInArms().isPresent(); diff --git a/src/main/resources/assets/unicopia/textures/models/wings/bug_pony.png b/src/main/resources/assets/unicopia/textures/models/wings/bug_pony.png new file mode 100644 index 0000000000000000000000000000000000000000..7b3db5b707732b9ba72f1f7499f09211fa067672 GIT binary patch literal 1269 zcmV5 zh!^#sf*u6_ECgHw9*VR9afwJ5!O*1@DLbUeY-BuaXF7SAdGkLenfYLtdGDLI?|r}T z&-=bNS#si$hs_6`eH!1r{2B-$Wc8sZ&1!WO>e^{+e|r|PEF%u-x{mIRMZ3-M1#lb> zK@cHHGVZVajisd}92^|jcPF*mZDKudZf=?Yu)V!ag3hn1s>$Ln?Ed;2`Tmu2gb+fI z0y%|`OM}56^ccf1m>2IgFbVCu(Z53j9LGlJ^G20Q1)?ZM%LAN2Z$!KL$hG9&V=H1rU?RH0m+`94u0N|q!e;gV6%yac@#Q^>Yq$YqS??{g$*8-9x zx#slKMxT9g?dV*fRJ?aaP%7H}3t>!c8tL7SFA>)I1i1u3E&)JOC>1RrngE)DT=KU7 zx|*_lE-CHr@9#7D)oPW=f8+TJrgM#oqKve~a>=vS5X+_b<*=^nkprWy>$rVz+y{V| z*`Hiw@?rzfy|IXuT6hrX)8f>EU$IEHwc(vRO^X*B0PA?mN|gM7aK5)vOCJPY;4wTL zHZ34{fd_E!IW_>6z|Kn13j~@c%Q86LZwbRhK%m;16$lg01Dw_nBvx=7&%6>M%@dq7 z%+3NKh*b!J==0Z7%QZBn1-$kCc@l+3gW$JINRrIFs5uiqKJ&DIw_m(uM&X667|Uh9 z4h#!J3&V1!57}N9_={r#|Ibxe;1ept)0EtWJS-prbo}c2e;^-Y9cgE zboVR(nFT;BXBdFXzhA*8JJ*@X(cD`AeIAfG7obaF&r~?8lobH9+ycgd&~g{Z7yw!( zcY(UXjZ}bNUb{8YpLrMHvnFs|;WW!4QmF>%Z*#h?Gr!-fsyZ^>FpN;+^B|Z5Fy#Pr zyIm6J_XTms`w>aP=jpznho*54T@Ay)-rgR`T_6V_2OtL^2OtMvz5p26+S2^Dnu!1q zL;z|(Hv{G