Update to 1.8.9
This commit is contained in:
@@ -354,7 +354,7 @@ public class ReplaySender extends ChannelInboundHandlerAdapter {
|
||||
}
|
||||
}
|
||||
if (p instanceof S40PacketDisconnect) {
|
||||
IChatComponent reason = ((S40PacketDisconnect) p).func_149165_c();
|
||||
IChatComponent reason = ((S40PacketDisconnect) p).getReason();
|
||||
if ("Please update to view this replay.".equals(reason.getUnformattedText())) {
|
||||
// This version of the mod supports replay restrictions so we are allowed
|
||||
// to remove this packet.
|
||||
@@ -368,7 +368,7 @@ public class ReplaySender extends ChannelInboundHandlerAdapter {
|
||||
|
||||
if(p instanceof S48PacketResourcePackSend) {
|
||||
S48PacketResourcePackSend packet = (S48PacketResourcePackSend) p;
|
||||
String url = packet.func_179783_a();
|
||||
String url = packet.getURL();
|
||||
if (url.startsWith("replay://")) {
|
||||
int id = Integer.parseInt(url.substring("replay://".length()));
|
||||
Map<Integer, String> index = replayFile.getResourcePackIndex();
|
||||
@@ -379,7 +379,7 @@ public class ReplaySender extends ChannelInboundHandlerAdapter {
|
||||
if (!file.exists()) {
|
||||
IOUtils.copy(replayFile.getResourcePack(hash).get(), new FileOutputStream(file));
|
||||
}
|
||||
mc.getResourcePackRepository().func_177319_a(file);
|
||||
mc.getResourcePackRepository().setResourcePackInstance(file);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -403,8 +403,8 @@ public class ReplaySender extends ChannelInboundHandlerAdapter {
|
||||
|
||||
if(p instanceof S07PacketRespawn) {
|
||||
S07PacketRespawn respawn = (S07PacketRespawn) p;
|
||||
p = new S07PacketRespawn(respawn.func_149082_c(),
|
||||
respawn.func_149081_d(), respawn.func_149080_f(), GameType.SPECTATOR);
|
||||
p = new S07PacketRespawn(respawn.getDimensionID(),
|
||||
respawn.getDifficulty(), respawn.getWorldType(), GameType.SPECTATOR);
|
||||
|
||||
allowMovement = true;
|
||||
}
|
||||
@@ -431,8 +431,8 @@ public class ReplaySender extends ChannelInboundHandlerAdapter {
|
||||
}
|
||||
|
||||
if(cent != null) {
|
||||
if(!allowMovement && !((Math.abs(cent.posX - ppl.func_148932_c()) > TP_DISTANCE_LIMIT) ||
|
||||
(Math.abs(cent.posZ - ppl.func_148933_e()) > TP_DISTANCE_LIMIT))) {
|
||||
if(!allowMovement && !((Math.abs(cent.posX - ppl.getX()) > TP_DISTANCE_LIMIT) ||
|
||||
(Math.abs(cent.posZ - ppl.getZ()) > TP_DISTANCE_LIMIT))) {
|
||||
return null;
|
||||
} else {
|
||||
allowMovement = false;
|
||||
@@ -451,7 +451,7 @@ public class ReplaySender extends ChannelInboundHandlerAdapter {
|
||||
}
|
||||
|
||||
CameraEntity cent = replayHandler.getCameraEntity();
|
||||
cent.setCameraPosition(ppl.func_148932_c(), ppl.func_148928_d(), ppl.func_148933_e());
|
||||
cent.setCameraPosition(ppl.getX(), ppl.getY(), ppl.getZ());
|
||||
return null;
|
||||
}
|
||||
}.call();
|
||||
@@ -459,7 +459,7 @@ public class ReplaySender extends ChannelInboundHandlerAdapter {
|
||||
|
||||
if(p instanceof S2BPacketChangeGameState) {
|
||||
S2BPacketChangeGameState pg = (S2BPacketChangeGameState)p;
|
||||
int reason = pg.func_149138_c();
|
||||
int reason = pg.getGameState();
|
||||
|
||||
// only allow the following packets:
|
||||
// 1 - End raining
|
||||
@@ -695,7 +695,7 @@ public class ReplaySender extends ChannelInboundHandlerAdapter {
|
||||
|
||||
if(p instanceof S0EPacketSpawnObject) {
|
||||
S0EPacketSpawnObject pso = (S0EPacketSpawnObject)p;
|
||||
int type = pso.func_148993_l();
|
||||
int type = pso.getType();
|
||||
if(type == 76) { // Firework rocket
|
||||
return null;
|
||||
}
|
||||
@@ -789,28 +789,28 @@ public class ReplaySender extends ChannelInboundHandlerAdapter {
|
||||
private void convertLegacyEntityIds(Packet packet) {
|
||||
if (packet instanceof S0CPacketSpawnPlayer) {
|
||||
S0CPacketSpawnPlayer p = (S0CPacketSpawnPlayer) packet;
|
||||
if (p.field_148957_a == LEGACY_ENTITY_ID) {
|
||||
p.field_148957_a = actualID;
|
||||
if (p.entityId == LEGACY_ENTITY_ID) {
|
||||
p.entityId = actualID;
|
||||
}
|
||||
} else if (packet instanceof S18PacketEntityTeleport) {
|
||||
S18PacketEntityTeleport p = (S18PacketEntityTeleport) packet;
|
||||
if (p.field_149458_a == LEGACY_ENTITY_ID) {
|
||||
p.field_149458_a = actualID;
|
||||
if (p.entityId == LEGACY_ENTITY_ID) {
|
||||
p.entityId = actualID;
|
||||
}
|
||||
} else if (packet instanceof S14PacketEntity.S17PacketEntityLookMove) {
|
||||
S14PacketEntity.S17PacketEntityLookMove p = (S14PacketEntity.S17PacketEntityLookMove) packet;
|
||||
if (p.field_149074_a == LEGACY_ENTITY_ID) {
|
||||
p.field_149074_a = actualID;
|
||||
if (p.entityId == LEGACY_ENTITY_ID) {
|
||||
p.entityId = actualID;
|
||||
}
|
||||
} else if (packet instanceof S19PacketEntityHeadLook) {
|
||||
S19PacketEntityHeadLook p = (S19PacketEntityHeadLook) packet;
|
||||
if (p.field_149384_a == LEGACY_ENTITY_ID) {
|
||||
p.field_149384_a = actualID;
|
||||
if (p.entityId == LEGACY_ENTITY_ID) {
|
||||
p.entityId = actualID;
|
||||
}
|
||||
} else if (packet instanceof S12PacketEntityVelocity) {
|
||||
S12PacketEntityVelocity p = (S12PacketEntityVelocity) packet;
|
||||
if (p.field_149417_a == LEGACY_ENTITY_ID) {
|
||||
p.field_149417_a = actualID;
|
||||
if (p.entityID == LEGACY_ENTITY_ID) {
|
||||
p.entityID = actualID;
|
||||
}
|
||||
} else if (packet instanceof S0BPacketAnimation) {
|
||||
S0BPacketAnimation p = (S0BPacketAnimation) packet;
|
||||
@@ -819,26 +819,26 @@ public class ReplaySender extends ChannelInboundHandlerAdapter {
|
||||
}
|
||||
} else if (packet instanceof S04PacketEntityEquipment) {
|
||||
S04PacketEntityEquipment p = (S04PacketEntityEquipment) packet;
|
||||
if (p.field_149394_a == LEGACY_ENTITY_ID) {
|
||||
p.field_149394_a = actualID;
|
||||
if (p.entityID == LEGACY_ENTITY_ID) {
|
||||
p.entityID = actualID;
|
||||
}
|
||||
} else if (packet instanceof S1BPacketEntityAttach) {
|
||||
S1BPacketEntityAttach p = (S1BPacketEntityAttach) packet;
|
||||
if (p.field_149408_a == LEGACY_ENTITY_ID) {
|
||||
p.field_149408_a = actualID;
|
||||
if (p.entityId == LEGACY_ENTITY_ID) {
|
||||
p.entityId = actualID;
|
||||
}
|
||||
if (p.field_149406_b == LEGACY_ENTITY_ID) {
|
||||
p.field_149406_b = actualID;
|
||||
if (p.vehicleEntityId == LEGACY_ENTITY_ID) {
|
||||
p.vehicleEntityId = actualID;
|
||||
}
|
||||
} else if (packet instanceof S0DPacketCollectItem) {
|
||||
S0DPacketCollectItem p = (S0DPacketCollectItem) packet;
|
||||
if (p.field_149356_b == LEGACY_ENTITY_ID) {
|
||||
p.field_149356_b = actualID;
|
||||
if (p.entityId == LEGACY_ENTITY_ID) {
|
||||
p.entityId = actualID;
|
||||
}
|
||||
} else if (packet instanceof S13PacketDestroyEntities) {
|
||||
S13PacketDestroyEntities p = (S13PacketDestroyEntities) packet;
|
||||
if (p.field_149100_a.length == 1 && p.field_149100_a[0] == LEGACY_ENTITY_ID) {
|
||||
p.field_149100_a[0] = actualID;
|
||||
if (p.entityIDs.length == 1 && p.entityIDs[0] == LEGACY_ENTITY_ID) {
|
||||
p.entityIDs[0] = actualID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user