158 errors

This commit is contained in:
catfoolyou 2025-01-29 15:21:11 -05:00
parent d493fc42b0
commit f3ba539497
12 changed files with 76 additions and 8 deletions

View File

@ -72,7 +72,7 @@ public class GuiScreenBackupWorld extends GuiScreen {
cw.func_82286_a(new WorldInfo(this.levelDat.getCompoundTag("Data")));
this.mc.displayGuiScreen(cw);
}else if(par1GuiButton.id == 2) {
this.mc.displayGuiScreen(new GuiRenameWorld(this.selectWorld, this.worldName, true));
//this.mc.displayGuiScreen(new GuiRenameWorld(this.selectWorld, this.worldName, true));
}else if(par1GuiButton.id == 3) {
IntegratedServer.exportWorld(worldName, IPCPacket05RequestData.REQUEST_LEVEL_EAG);
this.mc.displayGuiScreen(new GuiScreenSingleplayerLoading(selectWorld, "selectWorld.progress.exporting.1", () -> {

View File

@ -321,7 +321,7 @@ public class LANClientNetworkManager implements INetworkManager {
}
}
@Override
public String getServerURI() {
return "[lan:" + displayRelay + ":" + displayCode + "]";
}

View File

@ -141,6 +141,21 @@ public class GuiCreateWorld extends GuiScreen
this.folderName = func_73913_a(this.mc.getSaveLoader(), this.folderName);
}
public static String makeUsableName(String s) {
char[] var1 = ChatAllowedCharacters.allowedCharactersArray;
int var2 = var1.length;
for (int var3 = 0; var3 < var2; ++var3) {
char var4 = var1[var3];
s = s.replace(var4, '_');
}
if (MathHelper.stringNullOrLengthZero(s)) {
s = "World";
}
return s; // FIX THIS!!!
}
private void updateButtonText()
{
this.buttonGameMode.displayString = I18n.getString("selectWorld.gameMode") + " " + I18n.getString("selectWorld.gameMode." + this.gameMode);

View File

@ -359,6 +359,10 @@ public class GuiMultiplayer extends GuiScreen
this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, par1ServerData));
}
public ServerData getTheServerData() {
return this.theServerData = new ServerData(StatCollector.translateToLocal("selectServer.defaultName"), "", false);
}
private static void func_74017_b(ServerData par0ServerData) throws IOException
{
ServerAddress var1 = ServerAddress.func_78860_a(par0ServerData.serverIP);

View File

@ -24,11 +24,6 @@ public interface INetworkManager
*/
void processReadPackets();
/**
* Return the InetSocketAddress of the remote endpoint
*/
SocketAddress getSocketAddress();
/**
* Shuts down the server. (Only actually used on the server)
*/

View File

@ -29,7 +29,6 @@ public class IntegratedServer extends MinecraftServer
this.setBuildLimit(256);
this.setConfigurationManager(new IntegratedPlayerList(this));
this.mc = par1Minecraft;
this.serverProxy = par1Minecraft.getProxy();
this.theWorldSettings = par4WorldSettings;
try

View File

@ -9,6 +9,8 @@ import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import net.minecraft.server.MinecraftServer;
public abstract class Packet
@ -89,6 +91,17 @@ public abstract class Packet
}
}
public static Packet getNewPacket(int par1) {
try {
Class var2 = (Class) packetIdToClassMap.lookup(par1);
return var2 == null ? null : (Packet) var2.newInstance();
} catch (Exception var3) {
var3.printStackTrace();
System.err.println("Skipping packet with id " + par1);
return null;
}
}
/**
* Writes a byte array to the DataOutputStream
*/
@ -175,6 +188,35 @@ public abstract class Packet
return var5;
}
public static Packet readPacket(DataInputStream par1DataInputStream, boolean par2) throws IOException {
boolean var4 = false;
Packet var5 = null;
int var9 = par1DataInputStream.read();
if (var9 == -1) {
return null;
}
if (par2 && !serverPacketIdList.contains(Integer.valueOf(var9)) || !par2 && !clientPacketIdList.contains(Integer.valueOf(var9))) {
throw new IOException("Bad packet id " + var9);
}
var5 = getNewPacket(var9);
if (var5 == null) {
throw new IOException("Bad packet id " + var9);
}
var5.readPacketData(par1DataInputStream);
++receivedID;
receivedSize += (long) var5.getPacketSize();
PacketCount.countPacket(var9, (long) var5.getPacketSize());
++receivedID;
receivedSize += (long) var5.getPacketSize();
return var5;
}
/**
* Writes a packet, prefixed by its ID, to the data stream.
*/

View File

@ -4,6 +4,9 @@ public class ServerData
{
public String serverName;
public String serverIP;
private final int id;
private static int idCounter = 0;
/**
* the string indicating number of players on and capacity of the server that is shown on the server browser (i.e.
@ -26,6 +29,7 @@ public class ServerData
public boolean field_78841_f;
private boolean field_78842_g = true;
private boolean acceptsTextures;
public final boolean isDefault;
/** Whether to hide the IP address for this server. */
private boolean hideAddress;
@ -34,6 +38,15 @@ public class ServerData
{
this.serverName = par1Str;
this.serverIP = par2Str;
this.isDefault = false;
this.id = ++idCounter;
}
public ServerData(String par1Str, String par2Str, boolean isDefault) {
this.serverName = par1Str;
this.serverIP = par2Str;
this.isDefault = isDefault;
this.id = ++idCounter;
}
/**