use of ValkyrienWarfareControl.Block.BlockHovercraftController in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class ValkyrienWarfareControlMod method registerBlocks.
private void registerBlocks(FMLStateEvent event) {
double basicEnginePower = config.get(Configuration.CATEGORY_GENERAL, "basicEnginePower", 4000D, "Engine power for the basic Engine").getDouble();
double advancedEnginePower = config.get(Configuration.CATEGORY_GENERAL, "advancedEnginePower", 6000D, "Engine power for the advanced Engine").getDouble();
double eliteEnginePower = config.get(Configuration.CATEGORY_GENERAL, "eliteEnginePower", 8000D, "Engine power for the elite Engine").getDouble();
double ultimateEnginePower = config.get(Configuration.CATEGORY_GENERAL, "ultimateEnginePower", 16000D, "Engine power for the ultimate Engine").getDouble();
double redstoneEnginePower = config.get(Configuration.CATEGORY_GENERAL, "redstoneEnginePower", 500D, "Multiplied by the redstone power (0-15) to the Redstone Engine").getDouble();
double basicEtherCompressorPower = config.get(Configuration.CATEGORY_GENERAL, "basicEtherCompressorPower", 25000D, "Engine power for the basic Ether Compressor").getDouble();
double advancedEtherCompressorPower = config.get(Configuration.CATEGORY_GENERAL, "advancedEtherCompressorPower", 45000D, "Engine power for the advanced Ether Compressor").getDouble();
double eliteEtherCompressorPower = config.get(Configuration.CATEGORY_GENERAL, "eliteEtherCompressorPower", 80000D, "Engine power for the elite Ether Compressor").getDouble();
double ultimateEtherCompressorPower = config.get(Configuration.CATEGORY_GENERAL, "ultimateEtherCompressorPower", 100000D, "Engine power for the ultimate Ether Compressor").getDouble();
basicEngine = new BlockNormalEngine(Material.WOOD, basicEnginePower).setHardness(5f).setUnlocalizedName("basicEngine").setRegistryName(MODID, "basicEngine").setCreativeTab(CreativeTabs.TRANSPORTATION);
advancedEngine = new BlockNormalEngine(Material.ROCK, advancedEnginePower).setHardness(6f).setUnlocalizedName("advancedEngine").setRegistryName(MODID, "advancedEngine").setCreativeTab(CreativeTabs.TRANSPORTATION);
eliteEngine = new BlockNormalEngine(Material.IRON, eliteEnginePower).setHardness(8f).setUnlocalizedName("eliteEngine").setRegistryName(MODID, "eliteEngine").setCreativeTab(CreativeTabs.TRANSPORTATION);
ultimateEngine = new BlockNormalEngine(Material.GROUND, ultimateEnginePower).setHardness(10f).setUnlocalizedName("ultimateEngine").setRegistryName(MODID, "ultimateEngine").setCreativeTab(CreativeTabs.TRANSPORTATION);
redstoneEngine = new BlockRedstoneEngine(Material.REDSTONE_LIGHT, redstoneEnginePower).setHardness(7.0f).setUnlocalizedName("redstoneEngine").setRegistryName(MODID, "redstoneEngine").setCreativeTab(CreativeTabs.TRANSPORTATION);
antigravityEngine = new BlockNormalEtherCompressor(Material.WOOD, basicEtherCompressorPower).setHardness(8f).setUnlocalizedName("antigravengine").setRegistryName(MODID, "antigravengine").setCreativeTab(CreativeTabs.TRANSPORTATION);
advancedEtherCompressor = new BlockNormalEtherCompressor(Material.ROCK, advancedEtherCompressorPower).setHardness(8f).setUnlocalizedName("advancedEtherCompressor").setRegistryName(MODID, "advancedEtherCompressor").setCreativeTab(CreativeTabs.TRANSPORTATION);
eliteEtherCompressor = new BlockNormalEtherCompressor(Material.IRON, eliteEtherCompressorPower).setHardness(8f).setUnlocalizedName("eliteEtherCompressor").setRegistryName(MODID, "eliteEtherCompressor").setCreativeTab(CreativeTabs.TRANSPORTATION);
ultimateEtherCompressor = new BlockNormalEtherCompressor(Material.GROUND, ultimateEtherCompressorPower).setHardness(8f).setUnlocalizedName("ultimateEtherCompressor").setRegistryName(MODID, "ultimateEtherCompressor").setCreativeTab(CreativeTabs.TRANSPORTATION);
creativeEtherCompressor = new BlockCreativeEtherCompressor(Material.BARRIER, Double.MAX_VALUE / 4).setHardness(0.0f).setUnlocalizedName("creativeEtherCompressor").setRegistryName(MODID, "creativeEtherCompressor").setCreativeTab(CreativeTabs.TRANSPORTATION);
basicHoverController = new BlockHovercraftController(Material.IRON).setHardness(10f).setUnlocalizedName("basichovercraftcontroller").setRegistryName(MODID, "basichovercraftcontroller").setCreativeTab(CreativeTabs.TRANSPORTATION);
dopedEtherium = new BlockDopedEtherium(Material.GLASS).setHardness(4f).setUnlocalizedName("dopedetherium").setRegistryName(MODID, "dopedetherium").setCreativeTab(CreativeTabs.TRANSPORTATION);
balloonBurner = new BlockBalloonBurner(Material.IRON).setHardness(4f).setUnlocalizedName("balloonburner").setRegistryName(MODID, "balloonburner").setCreativeTab(CreativeTabs.TRANSPORTATION);
pilotsChair = new BlockShipPilotsChair(Material.IRON).setHardness(4f).setUnlocalizedName("shippilotschair").setRegistryName(MODID, "shippilotschair").setCreativeTab(CreativeTabs.TRANSPORTATION);
passengerChair = new BlockShipPassengerChair(Material.IRON).setHardness(4f).setUnlocalizedName("shippassengerchair").setRegistryName(MODID, "shippassengerchair").setCreativeTab(CreativeTabs.TRANSPORTATION);
thrustRelay = new BlockThrustRelay(Material.IRON).setHardness(5f).setUnlocalizedName("thrustrelay").setRegistryName(MODID, "thrustrelay").setCreativeTab(CreativeTabs.TRANSPORTATION);
thrustModulator = new BlockThrustModulator(Material.IRON).setHardness(8f).setUnlocalizedName("thrustmodulator").setRegistryName(MODID, "thrustmodulator").setCreativeTab(CreativeTabs.TRANSPORTATION);
registerBlock(basicEngine);
registerBlock(advancedEngine);
registerBlock(eliteEngine);
registerBlock(ultimateEngine);
registerBlock(redstoneEngine);
registerBlock(antigravityEngine);
registerBlock(advancedEtherCompressor);
registerBlock(eliteEtherCompressor);
registerBlock(ultimateEtherCompressor);
registerBlock(creativeEtherCompressor);
registerBlock(basicHoverController);
registerBlock(dopedEtherium);
registerBlock(balloonBurner);
registerBlock(pilotsChair);
registerBlock(passengerChair);
registerBlock(thrustRelay);
registerBlock(thrustModulator);
}
use of ValkyrienWarfareControl.Block.BlockHovercraftController in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class TileEntityEtherCompressor method getForceOutput.
public Vector getForceOutput(World world, BlockPos pos, IBlockState state, PhysicsWrapperEntity shipEntity, double secondsToApply) {
if (controllerPos.equals(BlockPos.ORIGIN)) {
return null;
}
if (!shipEntity.wrapping.ownsChunk(controllerPos.getX() >> 4, controllerPos.getZ() >> 4)) {
return null;
}
IBlockState controllerState = shipEntity.wrapping.VKChunkCache.getBlockState(controllerPos);
TileEntity tileEnt = shipEntity.wrapping.VKChunkCache.getTileEntity(controllerPos);
if (!(controllerState.getBlock() instanceof BlockHovercraftController)) {
if (tileEnt instanceof TileEntityHoverController) {
tileEnt.invalidate();
}
return null;
}
if (!(tileEnt instanceof TileEntityHoverController)) {
return null;
}
TileEntityHoverController controller = (TileEntityHoverController) tileEnt;
return controller.getForceForEngine(this, world, pos, state, shipEntity.wrapping, secondsToApply);
}
use of ValkyrienWarfareControl.Block.BlockHovercraftController in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class ItemSystemLinker method onItemUse.
@Override
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
IBlockState state = worldIn.getBlockState(pos);
Block block = state.getBlock();
NBTTagCompound stackCompound = stack.getTagCompound();
if (stackCompound == null) {
stackCompound = new NBTTagCompound();
stack.setTagCompound(stackCompound);
}
if (block instanceof BlockHovercraftController) {
if (!worldIn.isRemote) {
NBTUtils.writeBlockPosToNBT("controllerPos", pos, stackCompound);
playerIn.addChatMessage(new TextComponentString("ControllerPos set <" + pos.getX() + ":" + pos.getY() + ":" + pos.getZ() + ">"));
} else {
return EnumActionResult.SUCCESS;
}
}
if (block instanceof BlockEtherCompressor) {
if (!worldIn.isRemote) {
BlockPos controllerPos = NBTUtils.readBlockPosFromNBT("controllerPos", stackCompound);
if (controllerPos.equals(BlockPos.ORIGIN)) {
playerIn.addChatMessage(new TextComponentString("No selected Controller"));
} else {
PhysicsWrapperEntity controllerWrapper = ValkyrienWarfareMod.physicsManager.getObjectManagingPos(worldIn, controllerPos);
PhysicsWrapperEntity engineWrapper = ValkyrienWarfareMod.physicsManager.getObjectManagingPos(worldIn, pos);
if (controllerWrapper != engineWrapper) {
playerIn.addChatMessage(new TextComponentString("Controller and Engine are on seperate ships"));
return EnumActionResult.SUCCESS;
}
TileEntity worldTile = worldIn.getTileEntity(pos);
if (worldTile instanceof TileEntityEtherCompressor) {
TileEntityEtherCompressor tileEntity = (TileEntityEtherCompressor) worldTile;
BlockPos gravControllerPos = tileEntity.controllerPos;
if (gravControllerPos.equals(BlockPos.ORIGIN)) {
playerIn.addChatMessage(new TextComponentString("Set Controller To " + controllerPos.toString()));
} else {
playerIn.addChatMessage(new TextComponentString("Replaced controller position from: " + gravControllerPos.toString() + " to: " + controllerPos.toString()));
}
tileEntity.setController(controllerPos);
}
}
} else {
return EnumActionResult.SUCCESS;
}
}
return EnumActionResult.PASS;
}
Aggregations