Remove deprecations

This commit is contained in:
Sollace 2023-04-11 17:35:42 +02:00
parent c331e6638b
commit 6f9addd903
4 changed files with 2 additions and 30 deletions

View file

@ -1,12 +1,9 @@
package com.minelittlepony.unicopia.client.minelittlepony; package com.minelittlepony.unicopia.client.minelittlepony;
import java.util.Optional;
import com.minelittlepony.api.model.*; import com.minelittlepony.api.model.*;
import com.minelittlepony.api.model.fabric.PonyModelPrepareCallback; import com.minelittlepony.api.model.fabric.PonyModelPrepareCallback;
import com.minelittlepony.api.model.gear.IGear; import com.minelittlepony.api.model.gear.IGear;
import com.minelittlepony.api.pony.IPony; import com.minelittlepony.api.pony.IPony;
import com.minelittlepony.client.render.LevitatingItemRenderer;
import com.minelittlepony.unicopia.*; import com.minelittlepony.unicopia.*;
import com.minelittlepony.unicopia.client.render.PlayerPoser.Animation; import com.minelittlepony.unicopia.client.render.PlayerPoser.Animation;
import com.minelittlepony.unicopia.entity.player.Pony; import com.minelittlepony.unicopia.entity.player.Pony;
@ -14,11 +11,8 @@ import com.minelittlepony.unicopia.trinkets.TrinketsDelegate;
import com.minelittlepony.unicopia.util.AnimationUtil; import com.minelittlepony.unicopia.util.AnimationUtil;
import net.fabricmc.api.ClientModInitializer; 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.Entity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
@ -108,13 +102,4 @@ public class Main extends MineLPDelegate implements ClientModInitializer {
return Race.HUMAN; return Race.HUMAN;
} }
} }
@Override
public Optional<VertexConsumer> getItemBuffer(VertexConsumerProvider vertexConsumers, Identifier texture) {
if (LevitatingItemRenderer.isEnabled()) {
return Optional.of(vertexConsumers.getBuffer(LevitatingItemRenderer.getRenderLayer(texture)));
}
return Optional.empty();
}
} }

View file

@ -1,15 +1,10 @@
package com.minelittlepony.unicopia.client.minelittlepony; package com.minelittlepony.unicopia.client.minelittlepony;
import java.util.Optional;
import com.minelittlepony.unicopia.Race; import com.minelittlepony.unicopia.Race;
import net.minecraft.client.MinecraftClient; 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.Entity;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Identifier;
public class MineLPDelegate { public class MineLPDelegate {
static MineLPDelegate INSTANCE = new MineLPDelegate(); static MineLPDelegate INSTANCE = new MineLPDelegate();
@ -36,8 +31,4 @@ public class MineLPDelegate {
public Race getRace(Entity entity) { public Race getRace(Entity entity) {
return Race.HUMAN; return Race.HUMAN;
} }
public Optional<VertexConsumer> getItemBuffer(VertexConsumerProvider vertexConsumers, Identifier texture) {
return Optional.empty();
}
} }

View file

@ -70,7 +70,7 @@ class WingsGear implements IGear {
@Override @Override
public void pose(IModel model, Entity entity, boolean rainboom, UUID interpolatorId, float move, float swing, float bodySwing, float ticks) { public void pose(IModel model, Entity entity, boolean rainboom, UUID interpolatorId, float move, float swing, float bodySwing, float ticks) {
((ClientPonyModel)model).copyAttributes(this.model); ((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 @Override

View file

@ -1,7 +1,5 @@
package com.minelittlepony.unicopia.client.render; 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.model.ModelLoadingRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.BuiltinItemRendererRegistry; import net.fabricmc.fabric.api.client.rendering.v1.BuiltinItemRendererRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.BuiltinItemRendererRegistry.DynamicItemRenderer; 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); matrices.scale(1, -1, -1);
Identifier id = Registries.ITEM.getId(stack.getItem()); Identifier id = Registries.ITEM.getId(stack.getItem());
Identifier texture = new Identifier(id.getNamespace(), "textures/entity/polearm/" + id.getPath() + ".png"); Identifier texture = new Identifier(id.getNamespace(), "textures/entity/polearm/" + id.getPath() + ".png");
model.render(matrices, MineLPDelegate.getInstance().getItemBuffer(vertexConsumers, texture).orElseGet(() -> { model.render(matrices, ItemRenderer.getDirectItemGlintConsumer(vertexConsumers, model.getLayer(texture), false, stack.hasGlint()), light, overlay, 1, 1, 1, 1);
return ItemRenderer.getDirectItemGlintConsumer(vertexConsumers, model.getLayer(texture), false, stack.hasGlint());
}), light, overlay, 1, 1, 1, 1);
matrices.pop(); matrices.pop();
} }
} }