Rework entity map to do both directions.
This commit is contained in:
parent
769e2e2148
commit
45a62a111e
@ -120,9 +120,13 @@ public class EntityMap
|
||||
{ // bulk entity
|
||||
for (int pos = 2; pos < packet.length; pos += 4)
|
||||
{
|
||||
if (oldId == readInt(packet, pos))
|
||||
int readId = readInt(packet, pos);
|
||||
if (readId == oldId)
|
||||
{
|
||||
setInt(packet, pos, newId);
|
||||
} else if (readId == newId)
|
||||
{
|
||||
setInt(packet, pos, oldId);
|
||||
}
|
||||
}
|
||||
} else
|
||||
@ -132,9 +136,13 @@ public class EntityMap
|
||||
{
|
||||
for (int pos : idArray)
|
||||
{
|
||||
if (oldId == readInt(packet, pos))
|
||||
int readId = readInt(packet, pos);
|
||||
if (readId == oldId)
|
||||
{
|
||||
setInt(packet, pos, newId);
|
||||
} else if (readId == newId)
|
||||
{
|
||||
setInt(packet, pos, oldId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user