From 6f9addd90323f503fbb5779e6cf68e50f373bdb9 Mon Sep 17 00:00:00 2001 From: Sollace Date: Tue, 11 Apr 2023 17:35:42 +0200 Subject: [PATCH] Remove deprecations --- .../unicopia/client/minelittlepony/Main.java | 15 --------------- .../client/minelittlepony/MineLPDelegate.java | 9 --------- .../unicopia/client/minelittlepony/WingsGear.java | 2 +- .../unicopia/client/render/PolearmRenderer.java | 6 +----- 4 files changed, 2 insertions(+), 30 deletions(-) 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 873d8c2a..af5c43b2 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/Main.java +++ b/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/Main.java @@ -1,12 +1,9 @@ package com.minelittlepony.unicopia.client.minelittlepony; -import java.util.Optional; - import com.minelittlepony.api.model.*; import com.minelittlepony.api.model.fabric.PonyModelPrepareCallback; import com.minelittlepony.api.model.gear.IGear; import com.minelittlepony.api.pony.IPony; -import com.minelittlepony.client.render.LevitatingItemRenderer; import com.minelittlepony.unicopia.*; import com.minelittlepony.unicopia.client.render.PlayerPoser.Animation; import com.minelittlepony.unicopia.entity.player.Pony; @@ -14,11 +11,8 @@ import com.minelittlepony.unicopia.trinkets.TrinketsDelegate; import com.minelittlepony.unicopia.util.AnimationUtil; import net.fabricmc.api.ClientModInitializer; -import net.minecraft.client.render.VertexConsumer; -import net.minecraft.client.render.VertexConsumerProvider; import net.minecraft.entity.Entity; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.util.Identifier; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; @@ -108,13 +102,4 @@ public class Main extends MineLPDelegate implements ClientModInitializer { return Race.HUMAN; } } - - @Override - public Optional getItemBuffer(VertexConsumerProvider vertexConsumers, Identifier texture) { - if (LevitatingItemRenderer.isEnabled()) { - return Optional.of(vertexConsumers.getBuffer(LevitatingItemRenderer.getRenderLayer(texture))); - } - - return Optional.empty(); - } } diff --git a/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/MineLPDelegate.java b/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/MineLPDelegate.java index dd75ed82..24de4ba0 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/MineLPDelegate.java +++ b/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/MineLPDelegate.java @@ -1,15 +1,10 @@ package com.minelittlepony.unicopia.client.minelittlepony; -import java.util.Optional; - import com.minelittlepony.unicopia.Race; import net.minecraft.client.MinecraftClient; -import net.minecraft.client.render.VertexConsumer; -import net.minecraft.client.render.VertexConsumerProvider; import net.minecraft.entity.Entity; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.util.Identifier; public class MineLPDelegate { static MineLPDelegate INSTANCE = new MineLPDelegate(); @@ -36,8 +31,4 @@ public class MineLPDelegate { public Race getRace(Entity entity) { return Race.HUMAN; } - - public Optional getItemBuffer(VertexConsumerProvider vertexConsumers, Identifier texture) { - return Optional.empty(); - } } diff --git a/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/WingsGear.java b/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/WingsGear.java index 71cbb304..754b0d1c 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/WingsGear.java +++ b/src/main/java/com/minelittlepony/unicopia/client/minelittlepony/WingsGear.java @@ -70,7 +70,7 @@ class WingsGear implements IGear { @Override public void pose(IModel model, Entity entity, boolean rainboom, UUID interpolatorId, float move, float swing, float bodySwing, float ticks) { ((ClientPonyModel)model).copyAttributes(this.model); - this.model.getWings().setRotationAndAngles(rainboom, interpolatorId, move, swing, bodySwing, ticks); + this.model.getWings().setPartAngles(this.model.getAttributes(), move, swing, bodySwing, ticks); } @Override diff --git a/src/main/java/com/minelittlepony/unicopia/client/render/PolearmRenderer.java b/src/main/java/com/minelittlepony/unicopia/client/render/PolearmRenderer.java index ece97b2a..e86d4d20 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/render/PolearmRenderer.java +++ b/src/main/java/com/minelittlepony/unicopia/client/render/PolearmRenderer.java @@ -1,7 +1,5 @@ package com.minelittlepony.unicopia.client.render; -import com.minelittlepony.unicopia.client.minelittlepony.MineLPDelegate; - import net.fabricmc.fabric.api.client.model.ModelLoadingRegistry; import net.fabricmc.fabric.api.client.rendering.v1.BuiltinItemRendererRegistry; import net.fabricmc.fabric.api.client.rendering.v1.BuiltinItemRendererRegistry.DynamicItemRenderer; @@ -70,9 +68,7 @@ public class PolearmRenderer implements DynamicItemRenderer, ClampedModelPredica matrices.scale(1, -1, -1); Identifier id = Registries.ITEM.getId(stack.getItem()); Identifier texture = new Identifier(id.getNamespace(), "textures/entity/polearm/" + id.getPath() + ".png"); - model.render(matrices, MineLPDelegate.getInstance().getItemBuffer(vertexConsumers, texture).orElseGet(() -> { - return ItemRenderer.getDirectItemGlintConsumer(vertexConsumers, model.getLayer(texture), false, stack.hasGlint()); - }), light, overlay, 1, 1, 1, 1); + model.render(matrices, ItemRenderer.getDirectItemGlintConsumer(vertexConsumers, model.getLayer(texture), false, stack.hasGlint()), light, overlay, 1, 1, 1, 1); matrices.pop(); } }