From e92d5d2d2d5707c8fafa846493f5782919392309 Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 12 Jan 2023 14:42:42 -0500 Subject: [PATCH] Fixed #8165 --- .../main/java/mindustry/annotations/entity/EntityProcess.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java b/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java index f227262e06..ba44aa5b9a 100644 --- a/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java +++ b/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java @@ -629,7 +629,7 @@ public class EntityProcess extends BaseProcessor{ groupsBuilder.addField(ParameterizedTypeName.get( ClassName.bestGuess("mindustry.entities.EntityGroup"), itype), group.name, Modifier.PUBLIC, Modifier.STATIC); - groupInit.addStatement("$L = new $T<>($L.class, $L, $L, (e, pos) -> (($L.IndexableEntity__$L)e).setIndex__$L(pos))", group.name, groupc, itype, group.spatial, group.mapping, packageName, group.name, group.name); + groupInit.addStatement("$L = new $T<>($L.class, $L, $L, (e, pos) -> { if(e instanceof $L.IndexableEntity__$L ix) ix.setIndex__$L(pos); })", group.name, groupc, itype, group.spatial, group.mapping, packageName, group.name, group.name); } //write the groups