fix: IPeripheral ClassCarstenException
This commit is contained in:
parent
de2c2d419c
commit
2bfd953e6a
6 changed files with 6 additions and 6 deletions
|
@ -23,7 +23,7 @@ public class BlockATOTransmitterStopPoint extends BlockContainer implements IPer
|
|||
|
||||
public IPeripheral getPeripheral(World world, int x, int y, int z, int side) {
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
return (IPeripheral)tileEntity;
|
||||
return tileEntity instanceof IPeripheral ? (IPeripheral)tileEntity : null;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ public class BlockInfoGrabberDestination extends BlockContainer implements IPer
|
|||
|
||||
public IPeripheral getPeripheral(World world, int x, int y, int z, int side) {
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
return (IPeripheral)tileEntity;
|
||||
return tileEntity instanceof IPeripheral ? (IPeripheral)tileEntity : null;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -22,6 +22,6 @@ public class BlockInfoGrabberMTC extends BlockContainer implements IPeripheralPr
|
|||
|
||||
public IPeripheral getPeripheral(World world, int x, int y, int z, int side) {
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
return (IPeripheral)tileEntity;
|
||||
return tileEntity instanceof IPeripheral ? (IPeripheral)tileEntity : null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ public class BlockInfoTransmitterMTC extends BlockContainer implements IPeripher
|
|||
@Override
|
||||
public IPeripheral getPeripheral(World world, int x, int y, int z, int side) {
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
return (IPeripheral)tileEntity;
|
||||
return tileEntity instanceof IPeripheral ? (IPeripheral)tileEntity : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -20,7 +20,7 @@ public class BlockInfoTransmitterSpeed extends BlockContainer implements IPeriph
|
|||
@Override
|
||||
public IPeripheral getPeripheral(World world, int x, int y, int z, int side) {
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
return (IPeripheral)tileEntity;
|
||||
return tileEntity instanceof IPeripheral ? (IPeripheral)tileEntity : null;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ public class BlockPDMInstructionRadio extends Block implements IPeripheralProvi
|
|||
@Override
|
||||
public IPeripheral getPeripheral(World world, int x, int y, int z, int side) {
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
return (IPeripheral)tileEntity;
|
||||
return tileEntity instanceof IPeripheral ? (IPeripheral)tileEntity : null;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue