mirror of
https://github.com/Eaglercraft-Archive/Eaglercraftx-1.8.8-src.git
synced 2025-06-27 18:38:14 -05:00
Update #36 - Fix incorrect use of arithmetic shift, more capes
This commit is contained in:
@ -57,9 +57,9 @@ public class SkullCommand {
|
||||
for(int i = 0, j, k; i < 4096; ++i) {
|
||||
j = i << 2;
|
||||
k = loaded.pixels[i];
|
||||
rawSkin[j] = (byte)(k >> 24);
|
||||
rawSkin[j + 1] = (byte)(k >> 16);
|
||||
rawSkin[j + 2] = (byte)(k >> 8);
|
||||
rawSkin[j] = (byte)(k >>> 24);
|
||||
rawSkin[j + 1] = (byte)(k >>> 16);
|
||||
rawSkin[j + 2] = (byte)(k >>> 8);
|
||||
rawSkin[j + 3] = (byte)(k & 0xFF);
|
||||
}
|
||||
mc.thePlayer.sendQueue.addToSendQueue(new C17PacketCustomPayload("EAG|Skins-1.8", SkinPackets.writeCreateCustomSkull(rawSkin)));
|
||||
|
@ -8,8 +8,10 @@ import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayServer;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayServerSocket;
|
||||
import net.lax1dude.eaglercraft.v1_8.sp.socket.NetHandlerSingleplayerLogin;
|
||||
import net.minecraft.client.LoadingScreenRenderer;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiDisconnected;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.multiplayer.ServerData;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.network.EnumConnectionState;
|
||||
import net.minecraft.network.login.client.C00PacketLoginStart;
|
||||
@ -54,6 +56,7 @@ public class GuiScreenLANConnecting extends GuiScreen {
|
||||
this.parent = parent;
|
||||
this.code = code;
|
||||
this.relay = relay;
|
||||
Minecraft.getMinecraft().setServerData(new ServerData("Shared World", "shared:" + relay.address, false));
|
||||
}
|
||||
|
||||
public boolean doesGuiPauseGame() {
|
||||
|
@ -32,7 +32,7 @@ import net.lax1dude.eaglercraft.v1_8.sp.relay.pkt.*;
|
||||
*/
|
||||
public class LANServerController {
|
||||
|
||||
public static final Logger logger = LogManager.getLogger("IntegratedServerLAN");
|
||||
public static final Logger logger = LogManager.getLogger("LANServerController");
|
||||
|
||||
public static final List<String> currentICEServers = new ArrayList();
|
||||
|
||||
|
@ -154,7 +154,7 @@ public class IPacket {
|
||||
is.write(0);
|
||||
}else {
|
||||
int l = txt.length();
|
||||
is.write((l >> 8) & 0xFF);
|
||||
is.write((l >>> 8) & 0xFF);
|
||||
is.write(l & 0xFF);
|
||||
for(int i = 0; i < l; ++i) {
|
||||
is.write((int)txt.charAt(i));
|
||||
|
@ -41,8 +41,8 @@ public class EaglerChunkLoader extends AnvilChunkLoader {
|
||||
|
||||
char[] path = new char[12];
|
||||
for(int i = 5; i >= 0; --i) {
|
||||
path[i] = hex.charAt((unsignedX >> (i * 4)) & 0xF);
|
||||
path[i + 6] = hex.charAt((unsignedZ >> (i * 4)) & 0xF);
|
||||
path[i] = hex.charAt((unsignedX >>> (i << 2)) & 0xF);
|
||||
path[i + 6] = hex.charAt((unsignedZ >>> (i << 2)) & 0xF);
|
||||
}
|
||||
|
||||
return new String(path);
|
||||
|
@ -49,7 +49,7 @@ public class EPKCompiler {
|
||||
EagRuntime.fixDateFormat(new SimpleDateFormat("hh:mm:ss aa")).format(d) + "\n\n # world name: " + name + "\n\n")
|
||||
.getBytes(StandardCharsets.UTF_8);
|
||||
|
||||
os.write((comment.length >> 8) & 255);
|
||||
os.write((comment.length >>> 8) & 255);
|
||||
os.write(comment.length & 255);
|
||||
os.write(comment);
|
||||
|
||||
@ -134,9 +134,9 @@ public class EPKCompiler {
|
||||
|
||||
byte[] ret = os.toByteArray();
|
||||
|
||||
ret[lengthIntegerOffset] = (byte)((totalFileCount >> 24) & 0xFF);
|
||||
ret[lengthIntegerOffset + 1] = (byte)((totalFileCount >> 16) & 0xFF);
|
||||
ret[lengthIntegerOffset + 2] = (byte)((totalFileCount >> 8) & 0xFF);
|
||||
ret[lengthIntegerOffset] = (byte)(totalFileCount >>> 24);
|
||||
ret[lengthIntegerOffset + 1] = (byte)(totalFileCount >>> 16);
|
||||
ret[lengthIntegerOffset + 2] = (byte)(totalFileCount >>> 8);
|
||||
ret[lengthIntegerOffset + 3] = (byte)(totalFileCount & 0xFF);
|
||||
|
||||
return ret;
|
||||
@ -147,21 +147,21 @@ public class EPKCompiler {
|
||||
}
|
||||
|
||||
public static void writeInt(int i, OutputStream os) throws IOException {
|
||||
os.write((i >> 24) & 0xFF);
|
||||
os.write((i >> 16) & 0xFF);
|
||||
os.write((i >> 8) & 0xFF);
|
||||
os.write((i >>> 24) & 0xFF);
|
||||
os.write((i >>> 16) & 0xFF);
|
||||
os.write((i >>> 8) & 0xFF);
|
||||
os.write(i & 0xFF);
|
||||
}
|
||||
|
||||
public static void writeLong(long i, OutputStream os) throws IOException {
|
||||
os.write((int)((i >> 56) & 0xFF));
|
||||
os.write((int)((i >> 48) & 0xFF));
|
||||
os.write((int)((i >> 40) & 0xFF));
|
||||
os.write((int)((i >> 32) & 0xFF));
|
||||
os.write((int)((i >> 24) & 0xFF));
|
||||
os.write((int)((i >> 16) & 0xFF));
|
||||
os.write((int)((i >> 8) & 0xFF));
|
||||
os.write((int)(i & 0xFF));
|
||||
os.write((int)((i >>> 56l) & 0xFFl));
|
||||
os.write((int)((i >>> 48l) & 0xFFl));
|
||||
os.write((int)((i >>> 40l) & 0xFFl));
|
||||
os.write((int)((i >>> 32l) & 0xFFl));
|
||||
os.write((int)((i >>> 24l) & 0xFFl));
|
||||
os.write((int)((i >>> 16l) & 0xFFl));
|
||||
os.write((int)((i >>> 8l) & 0xFFl));
|
||||
os.write((int)(i & 0xFFl));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -89,9 +89,9 @@ public class IntegratedCapePackets {
|
||||
byte[] ret = new byte[1 + 16 + 4];
|
||||
ret[0] = (byte)PACKET_OTHER_CAPE_PRESET;
|
||||
IntegratedSkinPackets.UUIDToBytes(uuid, ret, 1);
|
||||
ret[17] = (byte)(presetId >> 24);
|
||||
ret[18] = (byte)(presetId >> 16);
|
||||
ret[19] = (byte)(presetId >> 8);
|
||||
ret[17] = (byte)(presetId >>> 24);
|
||||
ret[18] = (byte)(presetId >>> 16);
|
||||
ret[19] = (byte)(presetId >>> 8);
|
||||
ret[20] = (byte)(presetId & 0xFF);
|
||||
return ret;
|
||||
}
|
||||
|
@ -143,9 +143,9 @@ public class IntegratedSkinPackets {
|
||||
byte[] ret = new byte[1 + 16 + 4];
|
||||
ret[0] = (byte)PACKET_OTHER_SKIN_PRESET;
|
||||
UUIDToBytes(uuid, ret, 1);
|
||||
ret[17] = (byte)(presetId >> 24);
|
||||
ret[18] = (byte)(presetId >> 16);
|
||||
ret[19] = (byte)(presetId >> 8);
|
||||
ret[17] = (byte)(presetId >>> 24);
|
||||
ret[18] = (byte)(presetId >>> 16);
|
||||
ret[19] = (byte)(presetId >>> 8);
|
||||
ret[20] = (byte)(presetId & 0xFF);
|
||||
return ret;
|
||||
}
|
||||
@ -197,21 +197,21 @@ public class IntegratedSkinPackets {
|
||||
public static void UUIDToBytes(EaglercraftUUID uuid, byte[] bytes, int off) {
|
||||
long msb = uuid.getMostSignificantBits();
|
||||
long lsb = uuid.getLeastSignificantBits();
|
||||
bytes[off] = (byte)(msb >> 56l);
|
||||
bytes[off + 1] = (byte)(msb >> 48l);
|
||||
bytes[off + 2] = (byte)(msb >> 40l);
|
||||
bytes[off + 3] = (byte)(msb >> 32l);
|
||||
bytes[off + 4] = (byte)(msb >> 24l);
|
||||
bytes[off + 5] = (byte)(msb >> 16l);
|
||||
bytes[off + 6] = (byte)(msb >> 8l);
|
||||
bytes[off] = (byte)(msb >>> 56l);
|
||||
bytes[off + 1] = (byte)(msb >>> 48l);
|
||||
bytes[off + 2] = (byte)(msb >>> 40l);
|
||||
bytes[off + 3] = (byte)(msb >>> 32l);
|
||||
bytes[off + 4] = (byte)(msb >>> 24l);
|
||||
bytes[off + 5] = (byte)(msb >>> 16l);
|
||||
bytes[off + 6] = (byte)(msb >>> 8l);
|
||||
bytes[off + 7] = (byte)(msb & 0xFFl);
|
||||
bytes[off + 8] = (byte)(lsb >> 56l);
|
||||
bytes[off + 9] = (byte)(lsb >> 48l);
|
||||
bytes[off + 10] = (byte)(lsb >> 40l);
|
||||
bytes[off + 11] = (byte)(lsb >> 32l);
|
||||
bytes[off + 12] = (byte)(lsb >> 24l);
|
||||
bytes[off + 13] = (byte)(lsb >> 16l);
|
||||
bytes[off + 14] = (byte)(lsb >> 8l);
|
||||
bytes[off + 8] = (byte)(lsb >>> 56l);
|
||||
bytes[off + 9] = (byte)(lsb >>> 48l);
|
||||
bytes[off + 10] = (byte)(lsb >>> 40l);
|
||||
bytes[off + 11] = (byte)(lsb >>> 32l);
|
||||
bytes[off + 12] = (byte)(lsb >>> 24l);
|
||||
bytes[off + 13] = (byte)(lsb >>> 16l);
|
||||
bytes[off + 14] = (byte)(lsb >>> 8l);
|
||||
bytes[off + 15] = (byte)(lsb & 0xFFl);
|
||||
}
|
||||
|
||||
|
@ -239,9 +239,9 @@ public class IntegratedServerPlayerNetworkManager {
|
||||
byte[] compressedData;
|
||||
try {
|
||||
temporaryOutputStream.write(2);
|
||||
temporaryOutputStream.write((len >> 24) & 0xFF);
|
||||
temporaryOutputStream.write((len >> 16) & 0xFF);
|
||||
temporaryOutputStream.write((len >> 8) & 0xFF);
|
||||
temporaryOutputStream.write((len >>> 24) & 0xFF);
|
||||
temporaryOutputStream.write((len >>> 16) & 0xFF);
|
||||
temporaryOutputStream.write((len >>> 8) & 0xFF);
|
||||
temporaryOutputStream.write(len & 0xFF);
|
||||
try(OutputStream os = EaglerZLIB.newDeflaterOutputStream(temporaryOutputStream)) {
|
||||
temporaryBuffer.readBytes(os, len);
|
||||
|
Reference in New Issue
Block a user