Skip to content

Commit

Permalink
Remove accesswidener for ModelPart
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Dec 7, 2024
1 parent c5fd482 commit bd95afc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.simibubi.create.content.trains.schedule.hat;

import java.util.ArrayList;
import java.util.List;

import com.jozufozu.flywheel.util.transform.TransformStack;
import com.mojang.blaze3d.vertex.PoseStack;
import com.simibubi.create.AllPartialModels;
Expand All @@ -12,7 +15,6 @@
import com.simibubi.create.foundation.utility.Couple;

import io.github.fabricators_of_create.porting_lib.mixin.accessors.client.accessor.ModelPartAccessor;
import io.github.fabricators_of_create.porting_lib.mixin.accessors.common.accessor.LivingEntityAccessor;
import net.fabricmc.fabric.api.client.rendering.v1.LivingEntityFeatureRendererRegistrationCallback.RegistrationHelper;
import net.minecraft.client.model.AgeableListModel;
import net.minecraft.client.model.EntityModel;
Expand All @@ -36,9 +38,6 @@
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;

import java.util.ArrayList;
import java.util.List;

public class TrainHatArmorLayer<T extends LivingEntity, M extends EntityModel<T>> extends RenderLayer<T, M> {

public TrainHatArmorLayer(RenderLayerParent<T, M> renderer) {
Expand Down Expand Up @@ -81,7 +80,7 @@ public void render(PoseStack ms, MultiBufferSource buffer, int light, LivingEnti

ModelPart lastChild = partsToHead.get(partsToHead.size() - 1);
if (!lastChild.isEmpty()) {
Cube cube = ((ModelPartAccessor) lastChild).porting_lib$cubes().get(Mth.clamp(info.cubeIndex(), 0, ((ModelPartAccessor) lastChild).porting_lib$cubes().size() - 1));
Cube cube = ((ModelPartAccessor) (Object) lastChild).porting_lib$cubes().get(Mth.clamp(info.cubeIndex(), 0, ((ModelPartAccessor) lastChild).porting_lib$cubes().size() - 1));
ms.translate(info.offset().x() / 16.0F, (cube.minY - cube.maxY + info.offset().y()) / 16.0F, info.offset().z() / 16.0F);
float max = Math.max(cube.maxX - cube.minX, cube.maxZ - cube.minZ) / 8.0F * info.scale();
ms.scale(max, max, max);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ public static List<ModelPart> getAdjustedPart(TrainHatInfo info, ModelPart root,
}

public static Map<String, ModelPart> getChildren(ModelPart modelPart) {
return ((ModelPartAccessor) modelPart).porting_lib$children();
return ((ModelPartAccessor) (Object) modelPart).porting_lib$children();
}
}
3 changes: 0 additions & 3 deletions src/main/resources/create.accesswidener
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,3 @@ accessible field net/minecraft/data/tags/TagsProvider$TagAppender builder Lnet/m
# I (IThundxr) will change these to use accessors upstream eventually
accessible field net/minecraft/client/renderer/LevelRenderer capturedFrustum Lnet/minecraft/client/renderer/culling/Frustum;
accessible field net/minecraft/client/renderer/LevelRenderer cullingFrustum Lnet/minecraft/client/renderer/culling/Frustum;

# Can't cast a final class to a interface (accessor)
extendable class net/minecraft/client/model/geom/ModelPart

0 comments on commit bd95afc

Please sign in to comment.