For-each loops, remove unused method parameters
This commit is contained in:
@@ -94,7 +94,7 @@ public class PacketsManager {
|
||||
/**
|
||||
* Construct the packets I need to spawn in the disguise
|
||||
*/
|
||||
public static PacketContainer[] constructSpawnPackets(Disguise disguise, Entity disguisedEntity, Player observer) {
|
||||
public static PacketContainer[] constructSpawnPackets(Disguise disguise, Entity disguisedEntity) {
|
||||
if (disguise.getEntity() == null)
|
||||
disguise.setEntity(disguisedEntity);
|
||||
Object nmsEntity = ReflectionManager.getNmsEntity(disguisedEntity);
|
||||
@@ -703,8 +703,8 @@ public class PacketsManager {
|
||||
if (packets == null) {
|
||||
packets = new PacketContainer[] { event.getPacket() };
|
||||
}
|
||||
for (int i = 0; i < packets.length; i++) {
|
||||
PacketContainer packet = packets[i];
|
||||
for (PacketContainer packet1 : packets) {
|
||||
PacketContainer packet = packet1;
|
||||
if (packet.equals(event.getPacket())) {
|
||||
packet = packet.deepClone();
|
||||
}
|
||||
@@ -717,10 +717,7 @@ public class PacketsManager {
|
||||
}
|
||||
if (event.getPacketType() == PacketType.Play.Server.ENTITY_METADATA) {
|
||||
event.setPacket(event.getPacket().deepClone());
|
||||
Iterator<WrappedWatchableObject> itel = event.getPacket().getWatchableCollectionModifier().read(0)
|
||||
.iterator();
|
||||
while (itel.hasNext()) {
|
||||
WrappedWatchableObject watch = itel.next();
|
||||
for (WrappedWatchableObject watch : event.getPacket().getWatchableCollectionModifier().read(0)) {
|
||||
if (watch.getIndex() == 0) {
|
||||
byte b = (Byte) watch.getValue();
|
||||
byte a = (byte) (b | 1 << 5);
|
||||
@@ -1232,7 +1229,7 @@ public class PacketsManager {
|
||||
|| sentPacket.getType() == PacketType.Play.Server.SPAWN_ENTITY_EXPERIENCE_ORB
|
||||
|| sentPacket.getType() == PacketType.Play.Server.SPAWN_ENTITY
|
||||
|| sentPacket.getType() == PacketType.Play.Server.SPAWN_ENTITY_PAINTING) {
|
||||
packets = constructSpawnPackets(disguise, entity, observer);
|
||||
packets = constructSpawnPackets(disguise, entity);
|
||||
}
|
||||
|
||||
// Else if the disguise is attempting to send players a forbidden packet
|
||||
|
Reference in New Issue
Block a user