Improved force field robustness (code review finding)

This commit is contained in:
Unknown 2018-04-15 22:19:43 +02:00 committed by unknown
parent e4828c8365
commit 3d3065aa62

View file

@ -145,6 +145,12 @@ public class ForceFieldSetup extends GlobalPosition {
Vector3 v3Translation = new Vector3(0.0D, 0.0D, 0.0D);
for (final TileEntity tileEntity : tileEntities) {
// sanity check
if (tileEntity == null) {
WarpDrive.logger.error(String.format("Invalid tile entity returned from ForgeFieldRegistry at %s",
this));
continue;
}
// only consider same dimension
if (tileEntity.getWorldObj() == null || tileEntity.getWorldObj().provider.dimensionId != dimensionId) {
continue;