|
1 | 1 | package com.simibubi.create.content.trains.schedule.hat;
|
2 | 2 |
|
| 3 | +import java.util.ArrayList; |
| 4 | +import java.util.List; |
| 5 | + |
3 | 6 | import com.jozufozu.flywheel.util.transform.TransformStack;
|
4 | 7 | import com.mojang.blaze3d.vertex.PoseStack;
|
5 | 8 | import com.simibubi.create.AllPartialModels;
|
|
12 | 15 | import com.simibubi.create.foundation.utility.Couple;
|
13 | 16 |
|
14 | 17 | import io.github.fabricators_of_create.porting_lib.mixin.accessors.client.accessor.ModelPartAccessor;
|
15 |
| -import io.github.fabricators_of_create.porting_lib.mixin.accessors.common.accessor.LivingEntityAccessor; |
16 | 18 | import net.fabricmc.fabric.api.client.rendering.v1.LivingEntityFeatureRendererRegistrationCallback.RegistrationHelper;
|
17 | 19 | import net.minecraft.client.model.AgeableListModel;
|
18 | 20 | import net.minecraft.client.model.EntityModel;
|
|
36 | 38 | import net.minecraft.world.level.block.Blocks;
|
37 | 39 | import net.minecraft.world.level.block.state.BlockState;
|
38 | 40 |
|
39 |
| -import java.util.ArrayList; |
40 |
| -import java.util.List; |
41 |
| - |
42 | 41 | public class TrainHatArmorLayer<T extends LivingEntity, M extends EntityModel<T>> extends RenderLayer<T, M> {
|
43 | 42 |
|
44 | 43 | public TrainHatArmorLayer(RenderLayerParent<T, M> renderer) {
|
@@ -81,7 +80,7 @@ public void render(PoseStack ms, MultiBufferSource buffer, int light, LivingEnti
|
81 | 80 |
|
82 | 81 | ModelPart lastChild = partsToHead.get(partsToHead.size() - 1);
|
83 | 82 | if (!lastChild.isEmpty()) {
|
84 |
| - Cube cube = ((ModelPartAccessor) lastChild).porting_lib$cubes().get(Mth.clamp(info.cubeIndex(), 0, ((ModelPartAccessor) lastChild).porting_lib$cubes().size() - 1)); |
| 83 | + Cube cube = ((ModelPartAccessor) (Object) lastChild).porting_lib$cubes().get(Mth.clamp(info.cubeIndex(), 0, ((ModelPartAccessor) lastChild).porting_lib$cubes().size() - 1)); |
85 | 84 | ms.translate(info.offset().x() / 16.0F, (cube.minY - cube.maxY + info.offset().y()) / 16.0F, info.offset().z() / 16.0F);
|
86 | 85 | float max = Math.max(cube.maxX - cube.minX, cube.maxZ - cube.minZ) / 8.0F * info.scale();
|
87 | 86 | ms.scale(max, max, max);
|
|
0 commit comments