Fix unnecessary object creation in TileEntityEio#getLocation

This commit is contained in:
tterrag1098 committed 2015-04-11 22:26:27 -04:00
1 parent 2d33e7ad55
commit 48c253d3ed
1 file changed
+3 -1
@@ -56,8 +56,10 @@ public abstract class TileEntityEio extends TileEntity {
public void init() {
}
private BlockCoord cachedLocation = null;
public BlockCoord getLocation() {
return new BlockCoord(this);
return cachedLocation == null || !cachedLocation.equals(xCoord, yCoord, zCoord) ? (cachedLocation = new BlockCoord(this)) : cachedLocation;
}
/**