Fix errors

This commit is contained in:
PeytonPlayz595 2023-12-18 10:43:23 -05:00
parent 3c3a039fa2
commit 8a34075f2c
17 changed files with 59 additions and 44 deletions

View File

@ -63,7 +63,7 @@ public final class LevelIO {
}
} catch (Exception var9) {
var9.printStackTrace();
"Failed to load level: " + var9.toString();
System.err.println("Failed to load level: " + var9.toString());
return null;
}
}

View File

@ -1,5 +1,6 @@
package com.mojang.minecraft.level;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectStreamClass;
@ -8,10 +9,10 @@ import java.util.Set;
public final class LevelObjectInputStream extends ObjectInputStream {
private Set classes = new HashSet();
private Set classes = new HashSet<String>();
public LevelObjectInputStream(InputStream var1) {
public LevelObjectInputStream(InputStream var1) throws IOException {
super(var1);
this.classes.add("com.mojang.minecraft.player.Player$1");
this.classes.add("com.mojang.minecraft.mob.Creeper$1");
@ -19,7 +20,13 @@ public final class LevelObjectInputStream extends ObjectInputStream {
}
protected final ObjectStreamClass readClassDescriptor() {
try {
ObjectStreamClass var1 = super.readClassDescriptor();
return this.classes.contains(var1.getName())?ObjectStreamClass.lookup(Class.forName(var1.getName())):var1;
} catch(Exception e) {
e.printStackTrace();
System.err.println("Error reading class descriptor!");
return null;
}
}
}

View File

@ -15,7 +15,7 @@ public enum Tile$SoundType {
private final float volume;
private final float pitch;
// $FF: synthetic field
private static final Tile$SoundType[] a = new Tile$SoundType[]{none, grass, cloth, gravel, stone, metal, wood};
private static final Tile$SoundType[] values = new Tile$SoundType[]{none, grass, cloth, gravel, stone, metal, wood};
private Tile$SoundType(String var1, int var2, String var3, float var4, float var5) {

View File

@ -86,7 +86,7 @@ public class a {
public static final a aa;
public final int ab;
public Tile$SoundType ac;
private boolean ag;
protected boolean ag;
private float ah;
private float ai;
private float aj;

View File

@ -27,9 +27,9 @@ public final class f extends a {
int var8 = var5 - 1;
int var10;
LiquidType var12;
if(!((var10 = var1.getTile(var11, var8, var6)) == 0?true:((var12 = a.b[var10].d()) == LiquidType.WATER?true:var12 == LiquidType.LAVA)) || var5 <= 0) {
if(!((var10 = var1.getTile(var11, var8, var6)) == 0?true:((var12 = b[var10].d()) == LiquidType.WATER?true:var12 == LiquidType.LAVA)) || var5 <= 0) {
if(var5 != var3) {
if((var10 = var1.getTile(var11, var5, var6)) > 0 && a.b[var10].d() != LiquidType.NOT_LIQUID) {
if((var10 = var1.getTile(var11, var5, var6)) > 0 && b[var10].d() != LiquidType.NOT_LIQUID) {
var1.setTileNoUpdate(var11, var5, var6, 0);
}

View File

@ -16,7 +16,7 @@ public final class h extends m {
public final void a(Level var1, int var2, int var3, int var4, Random var5) {
if(var1.growTrees) {
int var6 = var1.getTile(var2, var3 - 1, var4);
if(var1.isLit(var2, var3, var4) && (var6 == a.g.ab || var6 == a.f.ab)) {
if(var1.isLit(var2, var3, var4) && (var6 == g.ab || var6 == f.ab)) {
if(var5.nextInt(5) == 0) {
var1.setTileNoUpdate(var2, var3, var4, 0);
if(!var1.maybeGrowTree(var2, var3, var4)) {

View File

@ -40,9 +40,9 @@ public final class i extends r {
}
if(var5 != 0) {
LiquidType var7 = a.b[var5].d();
LiquidType var7 = b[var5].d();
if(this.ad == LiquidType.WATER && var7 == LiquidType.LAVA || var7 == LiquidType.WATER && this.ad == LiquidType.LAVA) {
var1.setTile(var2, var3, var4, a.e.ab);
var1.setTile(var2, var3, var4, e.ab);
return;
}
}

View File

@ -22,19 +22,19 @@ public final class k extends a {
}
public final void a(Level var1, int var2, int var3, int var4, int var5) {
if(this == a.V) {
if(this == V) {
;
}
}
public final void b(Level var1, int var2, int var3, int var4) {
if(this != a.V) {
if(this != V) {
super.b(var1, var2, var3, var4);
}
if(var1.getTile(var2, var3 - 1, var4) == V.ab) {
var1.setTile(var2, var3, var4, 0);
var1.setTile(var2, var3 - 1, var4, a.U.ab);
var1.setTile(var2, var3 - 1, var4, U.ab);
}
}

View File

@ -14,14 +14,14 @@ public final class l extends a {
public final void a(Level var1, int var2, int var3, int var4, Random var5) {
if(var5.nextInt(4) == 0) {
if(!var1.isLit(var2, var3, var4)) {
var1.setTile(var2, var3, var4, a.g.ab);
var1.setTile(var2, var3, var4, g.ab);
} else {
for(int var9 = 0; var9 < 4; ++var9) {
int var6 = var2 + var5.nextInt(3) - 1;
int var7 = var3 + var5.nextInt(5) - 3;
int var8 = var4 + var5.nextInt(3) - 1;
if(var1.getTile(var6, var7, var8) == a.g.ab && var1.isLit(var6, var7, var8)) {
var1.setTile(var6, var7, var8, a.f.ab);
if(var1.getTile(var6, var7, var8) == g.ab && var1.isLit(var6, var7, var8)) {
var1.setTile(var6, var7, var8, f.ab);
}
}

View File

@ -16,7 +16,7 @@ public class m extends a {
public void a(Level var1, int var2, int var3, int var4, Random var5) {
int var6 = var1.getTile(var2, var3 - 1, var4);
if(!var1.isLit(var2, var3, var4) || var6 != a.g.ab && var6 != a.f.ab) {
if(!var1.isLit(var2, var3, var4) || var6 != g.ab && var6 != f.ab) {
var1.setTile(var2, var3, var4, 0);
}

View File

@ -16,7 +16,7 @@ public class r extends a {
protected r(int var1, LiquidType var2) {
super(var1);
this.ad = var2;
a.d[var1] = true;
d[var1] = true;
this.af = var1;
this.ae = var1 + 1;
float var4 = 0.01F;
@ -43,7 +43,6 @@ public class r extends a {
var3 = var3;
var2 = var2;
var1 = var1;
this = this;
boolean var8 = false;
boolean var6;
@ -76,7 +75,7 @@ public class r extends a {
for(int var7 = var2 - 2; var7 <= var2 + 2; ++var7) {
for(int var5 = var3 - 2; var5 <= var3 + 2; ++var5) {
for(int var6 = var4 - 2; var6 <= var4 + 2; ++var6) {
if(var1.getTile(var7, var5, var6) == a.w.ab) {
if(var1.getTile(var7, var5, var6) == w.ab) {
return false;
}
}
@ -119,9 +118,9 @@ public class r extends a {
public void a(Level var1, int var2, int var3, int var4, int var5) {
if(var5 != 0) {
LiquidType var6 = a.b[var5].d();
LiquidType var6 = b[var5].d();
if(this.ad == LiquidType.WATER && var6 == LiquidType.LAVA || var6 == LiquidType.WATER && this.ad == LiquidType.LAVA) {
var1.setTile(var2, var3, var4, a.e.ab);
var1.setTile(var2, var3, var4, e.ab);
return;
}
}

View File

@ -15,7 +15,7 @@ public final class t extends m {
public final void a(Level var1, int var2, int var3, int var4, Random var5) {
int var6 = var1.getTile(var2, var3 - 1, var4);
if(var1.isLit(var2, var3, var4) || var6 != a.e.ab && var6 != a.q.ab && var6 != a.h.ab) {
if(var1.isLit(var2, var3, var4) || var6 != e.ab && var6 != q.ab && var6 != h.ab) {
var1.setTile(var2, var3, var4, 0);
}

View File

@ -12,8 +12,8 @@ final class ConsoleInput extends Thread {
ConsoleInput(MinecraftServer var1) {
this.server = var1;
super();
this.server = var1;
}
public final void run() {

View File

@ -18,9 +18,9 @@ final class HeartbeatManager extends Thread {
HeartbeatManager(MinecraftServer var1, String var2) {
super();
this.server = var1;
this.name = var2;
super();
}
public final void run() {

View File

@ -14,9 +14,9 @@ final class LevelSaver extends Thread {
LevelSaver(NetworkManager var1, byte[] var2) {
super();
this.networkManager = var1;
this.bytes = var2;
super();
}
public final void run() {

View File

@ -15,8 +15,12 @@ public final class BindTo {
public BindTo(int var1, MinecraftServer var2) {
this.server = var2;
try {
this.serverChannel = ServerSocketChannel.open();
this.serverChannel.socket().bind(new InetSocketAddress(var1));
this.serverChannel.configureBlocking(false);
} catch(Exception e) {
e.printStackTrace();
}
}
}

View File

@ -3,6 +3,7 @@ package com.mojang.net;
import com.mojang.minecraft.net.PacketType;
import com.mojang.minecraft.server.NetworkManager;
import java.net.Socket;
import java.net.SocketException;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;
import java.util.Arrays;
@ -21,6 +22,7 @@ public final class NetworkHandler {
public NetworkHandler(SocketChannel var1) {
try {
this.channel = var1;
this.channel.configureBlocking(false);
System.currentTimeMillis();
@ -34,6 +36,9 @@ public final class NetworkHandler {
this.socket.setReuseAddress(false);
this.socket.setSoTimeout(100);
this.address = this.socket.getInetAddress().toString();
} catch(Exception e) {
e.printStackTrace();
}
}
public final void close() {