Skip to content

Commit

Permalink
Fix ECJ compile error in ClientEventTests.java (#1773)
Browse files Browse the repository at this point in the history
Co-authored-by: Brennan Ward <[email protected]>
  • Loading branch information
Shadows-of-Fire and Shadows-of-Fire authored Dec 15, 2024
1 parent 2239428 commit cdd9e5b
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
import net.minecraft.client.renderer.entity.LivingEntityRenderer;
import net.minecraft.client.renderer.entity.MobRenderer;
import net.minecraft.client.renderer.entity.player.PlayerRenderer;
import net.minecraft.client.renderer.entity.state.HoglinRenderState;
import net.minecraft.client.renderer.entity.state.LivingEntityRenderState;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.core.SectionPos;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.context.ContextKey;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.entity.monster.hoglin.HoglinBase;
Expand Down Expand Up @@ -150,7 +152,8 @@ static void updateRenderState(final DynamicTest test) {
renderState.setRenderData(numRenderAttachmentKey, entity.getData(testAttachment));
});
// Test other type parameters for safety
event.registerEntityModifier(new TypeToken<AbstractHoglinRenderer<?>>() {}, (entity, renderState) -> {});
// This call requires explicit typing to satisfy ECJ. Without it, the wildcard on AbstractHoglinRenderer is invalid.
event.<Entity, HoglinRenderState>registerEntityModifier(new TypeToken<AbstractHoglinRenderer<?>>() {}, (entity, renderState) -> {});
event.registerEntityModifier(new TypeToken<MobRenderer<Mob, LivingEntityRenderState, ?>>() {}, (entity, renderState) -> {});
try {
class TestBrokenHoglinRendererTypeToken<T extends Mob & HoglinBase> extends TypeToken<AbstractHoglinRenderer<T>> {}
Expand Down

0 comments on commit cdd9e5b

Please sign in to comment.