Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Sollace committed Jan 26, 2024
1 parent 0910ad7 commit 7c7ea1e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.BlockRenderView;

@SuppressWarnings("deprecation")

This comment has been minimized.

Copy link
@Fauli1221

Fauli1221 Jan 27, 2024

Collaborator

This sounds like something that should be addressed not suppressed

This comment has been minimized.

Copy link
@Sollace

Sollace Jan 27, 2024

Author Owner

It's my own deprecation that I'm suppressing, is all good.

public interface URenderers {
BlockEntity CHEST_RENDER_ENTITY = new CloudChestBlock.TileData(BlockPos.ORIGIN, UBlocks.CLOUD_CHEST.getDefaultState());

@SuppressWarnings("unchecked")
static void bootstrap() {
ParticleFactoryRegistry.getInstance().register(UParticles.UNICORN_MAGIC, createFactory(MagicParticle::new));
ParticleFactoryRegistry.getInstance().register(UParticles.CHANGELING_MAGIC, createFactory(ChangelingMagicParticle::new));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.entity.feature.FeatureRenderer;
import net.minecraft.client.render.entity.feature.FeatureRendererContext;
import net.minecraft.client.render.entity.model.BipedEntityModel;
import net.minecraft.client.render.entity.model.EntityModel;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.LivingEntity;
Expand All @@ -23,9 +24,10 @@ public class AccessoryFeatureRenderer<
T extends LivingEntity,
M extends EntityModel<T>> extends FeatureRenderer<T, M> {

private static final List<FeatureFactory<?>> REGISTRY = new ArrayList<>();
private static final List<FeatureFactory<?, ?>> REGISTRY = new ArrayList<>();

public static void register(FeatureFactory<?>...factories) {
@SafeVarargs
public static <T extends LivingEntity> void register(FeatureFactory<T, BipedEntityModel<T>>...factories) {
for (var factory : factories) {
REGISTRY.add(factory);
}
Expand All @@ -36,7 +38,7 @@ public static void register(FeatureFactory<?>...factories) {
@SuppressWarnings("unchecked")
public AccessoryFeatureRenderer(FeatureRendererContext<T, M> context) {
super(context);
features = REGISTRY.stream().map(f -> ((FeatureFactory<T>)f).create(context)).toList();
features = REGISTRY.stream().map(f -> ((FeatureFactory<T, M>)f).create(context)).toList();
}

@Override
Expand Down Expand Up @@ -68,8 +70,8 @@ public boolean beforeRenderArms(ArmRenderer sender, float tickDelta, MatrixStack
return cancelled;
}

public interface FeatureFactory<T extends LivingEntity> {
Feature<T> create(FeatureRendererContext<T, ? extends EntityModel<T>> context);
public interface FeatureFactory<T extends LivingEntity, M extends EntityModel<T>> {
Feature<T> create(FeatureRendererContext<T, M> context);
}

public interface Feature<T extends LivingEntity> {
Expand Down

0 comments on commit 7c7ea1e

Please sign in to comment.