mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 19:59:55 +00:00
quick fix : Collections.sort() can be replaced with List.sort()
This commit is contained in:
1 parent
bbaba41d83
commit
3d1489401c
2 files changed
+7
-13
No files matched your search
@@ -130,8 +130,8 @@ public class TankLayerScan extends LogicComponent {
|
||||
|
||||
// @SuppressWarnings({ "unchecked" })
|
||||
protected void finalizeStructure() {
|
||||
Collections.sort(blockCoords, new CoordTupleSort());
|
||||
Collections.sort(airCoords, new CoordTupleSort());
|
||||
blockCoords.sort(new CoordTupleSort());
|
||||
airCoords.sort(new CoordTupleSort());
|
||||
|
||||
for (CoordTuple coord : blockCoords) {
|
||||
TileEntity servant = world.getTileEntity(coord.x, coord.y, coord.z);
|
||||
|
||||
@@ -137,19 +137,13 @@ public class PacketPipeline extends MessageToMessageCodec<FMLProxyPacket, Abstra
|
||||
if (this.isPostInitialised) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.isPostInitialised = true;
|
||||
Collections.sort(this.packets, new Comparator<Class<? extends AbstractPacket>>() {
|
||||
|
||||
@Override
|
||||
public int compare(Class<? extends AbstractPacket> clazz1, Class<? extends AbstractPacket> clazz2) {
|
||||
int com = String.CASE_INSENSITIVE_ORDER.compare(clazz1.getCanonicalName(), clazz2.getCanonicalName());
|
||||
if (com == 0) {
|
||||
com = clazz1.getCanonicalName().compareTo(clazz2.getCanonicalName());
|
||||
}
|
||||
|
||||
return com;
|
||||
this.packets.sort((clazz1, clazz2) -> {
|
||||
int com = String.CASE_INSENSITIVE_ORDER.compare(clazz1.getCanonicalName(), clazz2.getCanonicalName());
|
||||
if (com == 0) {
|
||||
com = clazz1.getCanonicalName().compareTo(clazz2.getCanonicalName());
|
||||
}
|
||||
return com;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user