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