use pattern variables

This commit is contained in:
dfsek
2021-11-27 08:34:03 -07:00
parent 2d316fa042
commit 2307897b31
16 changed files with 33 additions and 58 deletions
@@ -62,8 +62,7 @@ public class ChunkCoordinate implements Serializable {
@Override
public boolean equals(Object obj) {
if(!(obj instanceof ChunkCoordinate)) return false;
ChunkCoordinate other = (ChunkCoordinate) obj;
if(!(obj instanceof ChunkCoordinate other)) return false;
return other.getX() == x && other.getZ() == z;
}
}
@@ -127,8 +127,7 @@ public class BukkitWorld implements World {
@Override
public boolean equals(Object obj) {
if(!(obj instanceof BukkitWorld)) return false;
BukkitWorld other = (BukkitWorld) obj;
if(!(obj instanceof BukkitWorld other)) return false;
return other.getHandle().equals(delegate);
}
@@ -54,7 +54,8 @@ public abstract class BlockEntityMixin {
}
public boolean terra$update(boolean applyPhysics) {
if(hasWorld()) world.getChunk(pos).setBlockEntity((net.minecraft.block.entity.BlockEntity) (Object) this);
if(hasWorld()) //noinspection ConstantConditions
world.getChunk(pos).setBlockEntity((net.minecraft.block.entity.BlockEntity) (Object) this);
return true;
}