Fix some multiplayer stuff

This commit is contained in:
PeytonPlayz595 2024-03-23 18:30:39 -04:00
parent 3f5d1cd6d1
commit e7cbfb0e89
9 changed files with 2144 additions and 2127 deletions

File diff suppressed because it is too large Load Diff

View File

@ -435,7 +435,7 @@ public class Minecraft implements Runnable {
public void shutdown() { public void shutdown() {
System.out.println("Stopping!"); System.out.println("Stopping!");
if(this.theWorld != null) { if(this.theWorld != null && !this.theWorld.multiplayerWorld) {
this.theWorld.saveLevel(); this.theWorld.saveLevel();
this.theWorld.chunkProvider.saveChunks(false, (IProgressUpdate)null); this.theWorld.chunkProvider.saveChunks(false, (IProgressUpdate)null);
} }

View File

@ -300,6 +300,9 @@ public class ChunkProviderGenerate implements IChunkProvider {
} }
public void populate(IChunkProvider var1, int var2, int var3) { public void populate(IChunkProvider var1, int var2, int var3) {
if(this.worldObj.multiplayerWorld) {
return;
}
BlockSand.fallInstantly = true; BlockSand.fallInstantly = true;
int var4 = var2 * 16; int var4 = var2 * 16;
int var5 = var3 * 16; int var5 = var3 * 16;

View File

@ -45,6 +45,7 @@ public class GameSettings {
public GameSettings(Minecraft var1) { public GameSettings(Minecraft var1) {
this.mc = var1; this.mc = var1;
Minecraft.getMinecraft().gameSettings = this;
this.loadOptions(); this.loadOptions();
} }

View File

@ -141,8 +141,8 @@ public class NetworkManager {
stream.flip(); stream.flip();
DataInputStream packetStream = new DataInputStream(new ByteBufferDirectInputStream(stream)); DataInputStream packetStream = new DataInputStream(new ByteBufferDirectInputStream(stream));
//int var1 = 100; int var1 = 100;
while(stream.hasRemaining()) { while(stream.hasRemaining() && var1-- >= 0) {
stream.mark(); stream.mark();
try { try {
Packet pkt = Packet.readPacket(packetStream); Packet pkt = Packet.readPacket(packetStream);
@ -205,9 +205,9 @@ public class NetworkManager {
return var0.isServerTerminating; return var0.isServerTerminating;
} }
static void readNetworkPacket(NetworkManager var0) { // static void readNetworkPacket(NetworkManager var0) {
var0.readPacket(); // var0.readPacket();
} // }
static void sendNetworkPacket(NetworkManager var0) { static void sendNetworkPacket(NetworkManager var0) {
var0.sendPacket(); var0.sendPacket();

View File

@ -442,6 +442,10 @@ public class World implements IBlockAccess {
} }
public boolean func_650_a(int var1) { public boolean func_650_a(int var1) {
if(this.multiplayerWorld) {
return true;
}
if(!this.chunkProvider.func_536_b()) { if(!this.chunkProvider.func_536_b()) {
return true; return true;
} else { } else {
@ -2003,6 +2007,11 @@ public class World implements IBlockAccess {
} }
public void func_663_l() { public void func_663_l() {
if(this.multiplayerWorld) {
return;
}
if(!GL11.isWebGL) { if(!GL11.isWebGL) {
net.PeytonPlayz585.minecraft.World.checkSessionLock(this); net.PeytonPlayz585.minecraft.World.checkSessionLock(this);
} }

View File

@ -86,10 +86,12 @@ public class WorldClient extends World {
} }
public void func_713_a(int var1, int var2, boolean var3) { public void func_713_a(int var1, int var2, boolean var3) {
if(var3) { if(this.C != null) {
this.C.func_538_d(var1, var2); if(var3) {
} else { this.C.func_538_d(var1, var2);
this.C.func_539_c(var1, var2); } else {
this.C.func_539_c(var1, var2);
}
} }
if(!var3) { if(!var3) {

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long