Mobile manual aiming / Mobile control changes [UNSTABLE]

This commit is contained in:
Anuken
2020-10-07 14:19:08 -04:00
parent 583a12a47b
commit 30f5340a22
25 changed files with 223 additions and 224 deletions

View File

@@ -361,8 +361,7 @@ public class ArcNetProvider implements NetProvider{
}
public void writeFramework(ByteBuffer buffer, FrameworkMessage message){
if(message instanceof Ping){
Ping p = (Ping)message;
if(message instanceof Ping p){
buffer.put((byte)0);
buffer.putInt(p.id);
buffer.put(p.isReply ? 1 : (byte)0);
@@ -370,12 +369,10 @@ public class ArcNetProvider implements NetProvider{
buffer.put((byte)1);
}else if(message instanceof KeepAlive){
buffer.put((byte)2);
}else if(message instanceof RegisterUDP){
RegisterUDP p = (RegisterUDP)message;
}else if(message instanceof RegisterUDP p){
buffer.put((byte)3);
buffer.putInt(p.connectionID);
}else if(message instanceof RegisterTCP){
RegisterTCP p = (RegisterTCP)message;
}else if(message instanceof RegisterTCP p){
buffer.put((byte)4);
buffer.putInt(p.connectionID);
}

View File

@@ -237,12 +237,10 @@ public class Net{
*/
public void handleClientReceived(Object object){
if(object instanceof StreamBegin){
StreamBegin b = (StreamBegin)object;
if(object instanceof StreamBegin b){
streams.put(b.id, currentStream = new StreamBuilder(b));
}else if(object instanceof StreamChunk){
StreamChunk c = (StreamChunk)object;
}else if(object instanceof StreamChunk c){
StreamBuilder builder = streams.get(c.id);
if(builder == null){
throw new RuntimeException("Received stream chunk without a StreamBegin beforehand!");