mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Remove deprecations
This commit is contained in:
parent
c331e6638b
commit
6f9addd903
4 changed files with 2 additions and 30 deletions
|
@ -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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue