Multiplayer bugfixes

This commit is contained in:
Anuken
2020-07-09 13:13:57 -04:00
parent 29e9d064df
commit 2584197a02
24 changed files with 139 additions and 70 deletions

View File

@@ -193,7 +193,7 @@ public class EntityIO{
st("$L = $L($T.$L($L, $L, alpha))", name, field.annotation(SyncField.class).clamped() ? "arc.math.Mathf.clamp" : "", Mathf.class, field.annotation(SyncField.class).value() ? "lerp" : "slerp", lastName, targetName);
}
ncont("else"); //no meaningful data has arrived yet
ncont("else if(lastUpdated != 0)"); //check if no meaningful data has arrived yet
//write values directly to targets
for(Svar field : fields){

View File

@@ -566,6 +566,14 @@ public class EntityProcess extends BaseProcessor{
//write the groups
groupsBuilder.addMethod(groupInit.build());
MethodSpec.Builder groupClear = MethodSpec.methodBuilder("clear").addModifiers(Modifier.PUBLIC, Modifier.STATIC);
for(GroupDefinition group : groupDefs){
groupClear.addStatement("$L.clear()", group.name);
}
//write clear
groupsBuilder.addMethod(groupClear.build());
//add method for resizing all necessary groups
MethodSpec.Builder groupResize = MethodSpec.methodBuilder("resize")
.addParameter(TypeName.FLOAT, "x").addParameter(TypeName.FLOAT, "y").addParameter(TypeName.FLOAT, "w").addParameter(TypeName.FLOAT, "h")