diff --git a/annotations/src/io/anuke/annotations/RemoteMethodAnnotationProcessor.java b/annotations/src/io/anuke/annotations/RemoteMethodAnnotationProcessor.java index 767441a48a..aed3f7568a 100644 --- a/annotations/src/io/anuke/annotations/RemoteMethodAnnotationProcessor.java +++ b/annotations/src/io/anuke/annotations/RemoteMethodAnnotationProcessor.java @@ -14,10 +14,7 @@ import javax.lang.model.element.ExecutableElement; import javax.lang.model.element.Modifier; import javax.lang.model.element.TypeElement; import javax.tools.Diagnostic.Kind; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Objects; -import java.util.Set; +import java.util.*; import java.util.stream.Collectors; @@ -87,6 +84,9 @@ public class RemoteMethodAnnotationProcessor extends AbstractProcessor { //list of all method entries classes = new ArrayList<>(); + List orderedElements = new ArrayList<>(elements); + orderedElements.sort(Comparator.comparing(Object::toString)); + //create methods for (Element element : elements) { Remote annotation = element.getAnnotation(Remote.class); diff --git a/core/src/io/anuke/mindustry/entities/effect/ItemTransfer.java b/core/src/io/anuke/mindustry/entities/effect/ItemTransfer.java index 0ae12872e5..74cbe081b2 100644 --- a/core/src/io/anuke/mindustry/entities/effect/ItemTransfer.java +++ b/core/src/io/anuke/mindustry/entities/effect/ItemTransfer.java @@ -93,6 +93,11 @@ public class ItemTransfer extends TimedEntity implements DrawTrait{ @Override public void update() { + if(to == null){ + remove(); + return; + } + super.update(); current.set(from).interpolate(tovec.set(to.getX(), to.getY()), fin(), Interpolation.pow3); current.add(tovec.set(to.getX(), to.getY()).sub(from).nor().rotate90(1).scl(seed * fslope() * 10f)); diff --git a/kryonet/src/io/anuke/kryonet/KryoClient.java b/kryonet/src/io/anuke/kryonet/KryoClient.java index fb6c0be06b..54eec4e9c5 100644 --- a/kryonet/src/io/anuke/kryonet/KryoClient.java +++ b/kryonet/src/io/anuke/kryonet/KryoClient.java @@ -27,6 +27,7 @@ import java.util.List; import static io.anuke.mindustry.Vars.netClient; import static io.anuke.mindustry.Vars.port; +import static io.anuke.mindustry.Vars.threads; public class KryoClient implements ClientProvider{ Client client; @@ -64,14 +65,14 @@ public class KryoClient implements ClientProvider{ c.id = connection.getID(); if(connection.getRemoteAddressTCP() != null) c.addressTCP = connection.getRemoteAddressTCP().toString(); - Gdx.app.postRunnable(() -> Net.handleClientReceived(c)); + threads.runDelay(() -> Net.handleClientReceived(c)); } @Override public void disconnected (Connection connection) { Disconnect c = new Disconnect(); - Gdx.app.postRunnable(() -> Net.handleClientReceived(c)); + threads.runDelay(() -> Net.handleClientReceived(c)); if(connection.getLastProtocolError() != null) Log.error("\n\n\n\nProtocol error: " + connection.getLastProtocolError() + "\n\n\n\n"); }