erogenousbeef.core.multiblock.MultiblockValidationException Java Examples

The following examples show how to use erogenousbeef.core.multiblock.MultiblockValidationException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MultiblockTurbineSimulator.java    From reactor_simulator with MIT License 6 votes vote down vote up
@Override
protected void isBlockGoodForInterior(World world, int x, int y, int z) throws MultiblockValidationException {
  // We only allow air and functional parts in turbines.

  // Air is ok
  if (world.isAirBlock(x, y, z)) {
    return;
  }

  Block block = world.getBlock(x, y, z);
  int metadata = world.getBlockMetadata(x, y, z);

  // Coil windings below here:
  // Everything else, gtfo
  throw new MultiblockValidationException(String.format("%d, %d, %d is invalid for a turbine interior. Only rotor parts, metal blocks and empty space are allowed.", x, y, z));
}
 
Example #2
Source File: MultiblockTurbine.java    From BigReactors with MIT License 6 votes vote down vote up
@Override
protected void isBlockGoodForInterior(World world, int x, int y, int z) throws MultiblockValidationException {
	// We only allow air and functional parts in turbines.

	// Air is ok
	if(world.isAirBlock(x, y, z)) { return; }

	Block block = world.getBlock(x, y, z);
	int metadata = world.getBlockMetadata(x,y,z);

	// Coil windings below here:
	if(getCoilPartData(x, y, z, block, metadata) != null) {
		foundCoils.add(new CoordTriplet(x,y,z));
		return;
	}

	// Everything else, gtfo
	throw new MultiblockValidationException(String.format("%d, %d, %d is invalid for a turbine interior. Only rotor parts, metal blocks and empty space are allowed.", x, y, z));
}
 
Example #3
Source File: TileEntityReactorFuelRodSimulator.java    From reactor_simulator with MIT License 6 votes vote down vote up
@Override
public void isGoodForInterior() throws MultiblockValidationException {
  // Check above and below. Above must be fuel rod or control rod.
  TileEntity entityAbove = this.worldObj.getTileEntity(xCoord, yCoord + 1, zCoord);
  if (!(entityAbove instanceof TileEntityReactorFuelRodSimulator || entityAbove instanceof TileEntityReactorControlRod)) {
    throw new MultiblockValidationException(String.format("Fuel rod at %d, %d, %d must be part of a vertical column that reaches the entire height of the reactor, with a control rod on top.", xCoord, yCoord, zCoord));
  }

  // Below must be fuel rod or the base of the reactor.
  TileEntity entityBelow = this.worldObj.getTileEntity(xCoord, yCoord - 1, zCoord);
  if (entityBelow instanceof TileEntityReactorFuelRodSimulator) {
    return;
  } else if (entityBelow instanceof RectangularMultiblockTileEntityBase) {
    ((RectangularMultiblockTileEntityBase)entityBelow).isGoodForBottom();
    return;
  }

  throw new MultiblockValidationException(String.format("Fuel rod at %d, %d, %d must be part of a vertical column that reaches the entire height of the reactor, with a control rod on top.", xCoord, yCoord, zCoord));
}
 
Example #4
Source File: MultiblockTurbineSimulator.java    From reactor_simulator with MIT License 6 votes vote down vote up
@Override
protected void isBlockGoodForInterior(World world, int x, int y, int z) throws MultiblockValidationException {
  // We only allow air and functional parts in turbines.

  // Air is ok
  if (world.isAirBlock(x, y, z)) {
    return;
  }

  Block block = world.getBlock(x, y, z);
  int metadata = world.getBlockMetadata(x, y, z);

  // Coil windings below here:
  // Everything else, gtfo
  throw new MultiblockValidationException(String.format("%d, %d, %d is invalid for a turbine interior. Only rotor parts, metal blocks and empty space are allowed.", x, y, z));
}
 
Example #5
Source File: TileEntityReactorFuelRod.java    From BigReactors with MIT License 6 votes vote down vote up
@Override
public void isGoodForInterior() throws MultiblockValidationException {
	// Check above and below. Above must be fuel rod or control rod.
	TileEntity entityAbove = this.worldObj.getTileEntity(xCoord, yCoord + 1, zCoord);
	if(!(entityAbove instanceof TileEntityReactorFuelRod || entityAbove instanceof TileEntityReactorControlRod)) {
		throw new MultiblockValidationException(String.format("Fuel rod at %d, %d, %d must be part of a vertical column that reaches the entire height of the reactor, with a control rod on top.", xCoord, yCoord, zCoord));
	}

	// Below must be fuel rod or the base of the reactor.
	TileEntity entityBelow = this.worldObj.getTileEntity(xCoord, yCoord - 1, zCoord);
	if(entityBelow instanceof TileEntityReactorFuelRod) {
		return;
	}
	else if(entityBelow instanceof RectangularMultiblockTileEntityBase) {
		((RectangularMultiblockTileEntityBase)entityBelow).isGoodForBottom();
		return;
	}
	
	throw new MultiblockValidationException(String.format("Fuel rod at %d, %d, %d must be part of a vertical column that reaches the entire height of the reactor, with a control rod on top.", xCoord, yCoord, zCoord));
}
 
Example #6
Source File: TileEntityReactorFuelRodSimulator.java    From reactor_simulator with MIT License 6 votes vote down vote up
@Override
public void isGoodForInterior() throws MultiblockValidationException {
  // Check above and below. Above must be fuel rod or control rod.
  TileEntity entityAbove = this.worldObj.getTileEntity(xCoord, yCoord + 1, zCoord);
  if (!(entityAbove instanceof TileEntityReactorFuelRodSimulator || entityAbove instanceof TileEntityReactorControlRod)) {
    throw new MultiblockValidationException(String.format("Fuel rod at %d, %d, %d must be part of a vertical column that reaches the entire height of the reactor, with a control rod on top.", xCoord, yCoord, zCoord));
  }

  // Below must be fuel rod or the base of the reactor.
  TileEntity entityBelow = this.worldObj.getTileEntity(xCoord, yCoord - 1, zCoord);
  if (entityBelow instanceof TileEntityReactorFuelRodSimulator) {
    return;
  } else if (entityBelow instanceof RectangularMultiblockTileEntityBase) {
    ((RectangularMultiblockTileEntityBase)entityBelow).isGoodForBottom();
    return;
  }

  throw new MultiblockValidationException(String.format("Fuel rod at %d, %d, %d must be part of a vertical column that reaches the entire height of the reactor, with a control rod on top.", xCoord, yCoord, zCoord));
}
 
Example #7
Source File: TileEntityReactorControlRod.java    From BigReactors with MIT License 5 votes vote down vote up
@Override
public void isGoodForTop() throws MultiblockValidationException {
	// Check that the space below us is a fuel rod
	TileEntity teBelow = this.worldObj.getTileEntity(xCoord, yCoord - 1, zCoord);
	if(!(teBelow instanceof TileEntityReactorFuelRod)) {
		throw new MultiblockValidationException(String.format("%d, %d, %d - Control rods may only be placed on the top face, atop a column of fuel rods", xCoord, yCoord, zCoord));
	}
}
 
Example #8
Source File: TileEntityReactorPart.java    From BigReactors with MIT License 5 votes vote down vote up
@Override
public void isGoodForFrame() throws MultiblockValidationException {
	int metadata = this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord);
	if(BlockReactorPart.isCasing(metadata)) { return; }
	
	throw new MultiblockValidationException(String.format("%d, %d, %d - Only casing may be used as part of a reactor's frame", xCoord, yCoord, zCoord));
}
 
Example #9
Source File: MultiblockReactor.java    From BigReactors with MIT License 5 votes vote down vote up
@Override
protected void isMachineWhole() throws MultiblockValidationException {
	// Ensure that there is at least one controller and control rod attached.
	if(attachedControlRods.size() < 1) {
		throw new MultiblockValidationException("Not enough control rods. Reactors require at least 1.");
	}
	
	if(attachedControllers.size() < 1) {
		throw new MultiblockValidationException("Not enough controllers. Reactors require at least 1.");
	}
	
	super.isMachineWhole();
}
 
Example #10
Source File: TileEntityReactorRedstonePort.java    From BigReactors with MIT License 4 votes vote down vote up
@Override
public void isGoodForTop() throws MultiblockValidationException {
	throw new MultiblockValidationException(String.format("%d, %d, %d - Redstone ports may only be placed on a reactor's external side faces, not the top", xCoord, yCoord, zCoord));
}
 
Example #11
Source File: TileEntityTurbinePartStandard.java    From BigReactors with MIT License 4 votes vote down vote up
@Override
public void isGoodForInterior() throws MultiblockValidationException {
	if(getBlockMetadata() != BlockTurbinePart.METADATA_HOUSING) {
		throw new MultiblockValidationException(String.format("%d, %d, %d - this part is not valid for the interior of a turbine", xCoord, yCoord, zCoord));
	}
}
 
Example #12
Source File: TileEntityReactorRedstonePort.java    From BigReactors with MIT License 4 votes vote down vote up
@Override
public void isGoodForSides() throws MultiblockValidationException {
}
 
Example #13
Source File: TileEntityReactorRedstonePort.java    From BigReactors with MIT License 4 votes vote down vote up
@Override
public void isGoodForFrame() throws MultiblockValidationException {
	throw new MultiblockValidationException(String.format("%d, %d, %d - Redstone ports may only be placed on a reactor's external side faces, not as part of the frame", xCoord, yCoord, zCoord));
}
 
Example #14
Source File: TileEntityReactorFuelRod.java    From BigReactors with MIT License 4 votes vote down vote up
@Override
public void isGoodForBottom() throws MultiblockValidationException {
	throw new MultiblockValidationException(String.format("%d, %d, %d - fuel rods may only be placed in the reactor interior", xCoord, yCoord, zCoord));
}
 
Example #15
Source File: TileEntityReactorFuelRod.java    From BigReactors with MIT License 4 votes vote down vote up
@Override
public void isGoodForTop() throws MultiblockValidationException {
	throw new MultiblockValidationException(String.format("%d, %d, %d - fuel rods may only be placed in the reactor interior", xCoord, yCoord, zCoord));
}
 
Example #16
Source File: TileEntityReactorFuelRod.java    From BigReactors with MIT License 4 votes vote down vote up
@Override
public void isGoodForSides() throws MultiblockValidationException {
	throw new MultiblockValidationException(String.format("%d, %d, %d - fuel rods may only be placed in the reactor interior", xCoord, yCoord, zCoord));
}
 
Example #17
Source File: TileEntityReactorFuelRod.java    From BigReactors with MIT License 4 votes vote down vote up
@Override
public void isGoodForFrame() throws MultiblockValidationException {
	throw new MultiblockValidationException(String.format("%d, %d, %d - fuel rods may only be placed in the reactor interior", xCoord, yCoord, zCoord));
}
 
Example #18
Source File: TileEntityReactorFuelRodSimulator.java    From reactor_simulator with MIT License 4 votes vote down vote up
@Override
public void isGoodForFrame() throws MultiblockValidationException {
  throw new MultiblockValidationException(String.format("%d, %d, %d - fuel rods may only be placed in the reactor interior", xCoord, yCoord, zCoord));
}
 
Example #19
Source File: TileEntityReactorRedstonePort.java    From BigReactors with MIT License 4 votes vote down vote up
@Override
public void isGoodForBottom() throws MultiblockValidationException {
	throw new MultiblockValidationException(String.format("%d, %d, %d - Redstone ports may only be placed on a reactor's external side faces, not the bottom", xCoord, yCoord, zCoord));
}
 
Example #20
Source File: TileEntityReactorRedstonePort.java    From BigReactors with MIT License 4 votes vote down vote up
@Override
public void isGoodForInterior() throws MultiblockValidationException {
	throw new MultiblockValidationException(String.format("%d, %d, %d - Redstone ports may not be placed in a reactor's interior", xCoord, yCoord, zCoord));
}
 
Example #21
Source File: TileEntityTurbinePartGlass.java    From BigReactors with MIT License 4 votes vote down vote up
@Override
public void isGoodForFrame() throws MultiblockValidationException {
	throw new MultiblockValidationException(String.format("%s, %s, %s - Glass cannot be used as part of a turbine's frame", xCoord, yCoord, zCoord));
}
 
Example #22
Source File: TileEntityTurbinePartGlass.java    From BigReactors with MIT License 4 votes vote down vote up
@Override
public void isGoodForSides() throws MultiblockValidationException {
}
 
Example #23
Source File: TileEntityTurbinePartGlass.java    From BigReactors with MIT License 4 votes vote down vote up
@Override
public void isGoodForTop() throws MultiblockValidationException {
}
 
Example #24
Source File: TileEntityTurbinePartGlass.java    From BigReactors with MIT License 4 votes vote down vote up
@Override
public void isGoodForBottom() throws MultiblockValidationException {
}
 
Example #25
Source File: TileEntityTurbinePartGlass.java    From BigReactors with MIT License 4 votes vote down vote up
@Override
public void isGoodForInterior() throws MultiblockValidationException {
	throw new MultiblockValidationException(String.format("%s, %s, %s - Glass can only be used as part of a turbine's exterior", xCoord, yCoord, zCoord));
}
 
Example #26
Source File: TileEntityReactorControlRod.java    From BigReactors with MIT License 4 votes vote down vote up
@Override
public void isGoodForFrame() throws MultiblockValidationException {
	throw new MultiblockValidationException(String.format("%d, %d, %d - Control rods may only be placed on the top face", xCoord, yCoord, zCoord));
}
 
Example #27
Source File: TileEntityReactorControlRod.java    From BigReactors with MIT License 4 votes vote down vote up
@Override
public void isGoodForSides() throws MultiblockValidationException {
	throw new MultiblockValidationException(String.format("%d, %d, %d - Control rods may only be placed on the top face", xCoord, yCoord, zCoord));
}
 
Example #28
Source File: TileEntityReactorControlRod.java    From BigReactors with MIT License 4 votes vote down vote up
@Override
public void isGoodForBottom() throws MultiblockValidationException {
	throw new MultiblockValidationException(String.format("%d, %d, %d - Control rods may only be placed on the top face", xCoord, yCoord, zCoord));
}
 
Example #29
Source File: TileEntityReactorControlRod.java    From BigReactors with MIT License 4 votes vote down vote up
@Override
public void isGoodForInterior() throws MultiblockValidationException {
	throw new MultiblockValidationException(String.format("%d, %d, %d - Control rods may only be placed on the top face", xCoord, yCoord, zCoord));
}
 
Example #30
Source File: TileEntityReactorPart.java    From BigReactors with MIT License 4 votes vote down vote up
@Override
public void isGoodForInterior() throws MultiblockValidationException {
	throw new MultiblockValidationException(String.format("%d, %d, %d - This reactor part may not be placed in the reactor's interior", xCoord, yCoord, zCoord));
}