More multiplayer bugfixes

This commit is contained in:
Anuken
2020-06-23 22:46:28 -04:00
parent db2f61ec29
commit 843be42568
14 changed files with 75 additions and 16 deletions

View File

@@ -27,7 +27,7 @@ public class Annotations{
boolean clamped() default false;
}
/** Indicates that a field will not be read from the server when syncing. */
/** Indicates that a field will not be read from the server when syncing the local player state. */
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.SOURCE)
public @interface SyncLocal{

View File

@@ -145,7 +145,7 @@ public class EntityIO{
if(sl){
ncont("else" );
st("read.f()");
io(field.type, "");
econt();
}

View File

@@ -29,7 +29,7 @@ public class TypeIOResolver{
}else if(params.size == 1 && params.first().tname().toString().equals("arc.util.io.Reads") && !meth.isVoid()){
//1 param, one is reader, returns type
out.readers.put(fix(meth.retn().toString()), type.fullName() + "." + meth.name());
}else if(params.size == 2 && params.first().tname().toString().equals("arc.util.io.Reads") && !meth.isVoid() && meth.ret() == meth.params().get(1).mirror()){
}else if(params.size == 2 && params.first().tname().toString().equals("arc.util.io.Reads") && !meth.isVoid() && meth.ret().equals(meth.params().get(1).mirror())){
//2 params, one is reader, other is type, returns type - these are made to reduce garbage allocated
out.mutatorReaders.put(fix(meth.retn().toString()), type.fullName() + "." + meth.name());
}