Search in sources :

Example 1 with BlockHovercraftController

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);
}
Also used : BlockShipPilotsChair(ValkyrienWarfareControl.Block.BlockShipPilotsChair) BlockRedstoneEngine(ValkyrienWarfareControl.Block.Engine.BlockRedstoneEngine) BlockHovercraftController(ValkyrienWarfareControl.Block.BlockHovercraftController) BlockNormalEngine(ValkyrienWarfareControl.Block.Engine.BlockNormalEngine) BlockDopedEtherium(ValkyrienWarfareControl.Block.BlockDopedEtherium) BlockCreativeEtherCompressor(ValkyrienWarfareControl.Block.EtherCompressor.BlockCreativeEtherCompressor) BlockThrustRelay(ValkyrienWarfareControl.Block.BlockThrustRelay) BlockNormalEtherCompressor(ValkyrienWarfareControl.Block.EtherCompressor.BlockNormalEtherCompressor) BlockBalloonBurner(ValkyrienWarfareControl.Block.BlockBalloonBurner) BlockThrustModulator(ValkyrienWarfareControl.Block.BlockThrustModulator) BlockShipPassengerChair(ValkyrienWarfareControl.Block.BlockShipPassengerChair)

Example 2 with BlockHovercraftController

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);
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) BlockHovercraftController(ValkyrienWarfareControl.Block.BlockHovercraftController) IBlockState(net.minecraft.block.state.IBlockState) TileEntityHoverController(ValkyrienWarfareControl.TileEntity.TileEntityHoverController)

Example 3 with BlockHovercraftController

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;
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) BlockHovercraftController(ValkyrienWarfareControl.Block.BlockHovercraftController) BlockEtherCompressor(ValkyrienWarfareBase.API.Block.EtherCompressor.BlockEtherCompressor) IBlockState(net.minecraft.block.state.IBlockState) PhysicsWrapperEntity(ValkyrienWarfareBase.PhysicsManagement.PhysicsWrapperEntity) TileEntityEtherCompressor(ValkyrienWarfareBase.API.Block.EtherCompressor.TileEntityEtherCompressor) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) Block(net.minecraft.block.Block) BlockPos(net.minecraft.util.math.BlockPos) TextComponentString(net.minecraft.util.text.TextComponentString)

Aggregations

BlockHovercraftController (ValkyrienWarfareControl.Block.BlockHovercraftController)3 IBlockState (net.minecraft.block.state.IBlockState)2 TileEntity (net.minecraft.tileentity.TileEntity)2 BlockEtherCompressor (ValkyrienWarfareBase.API.Block.EtherCompressor.BlockEtherCompressor)1 TileEntityEtherCompressor (ValkyrienWarfareBase.API.Block.EtherCompressor.TileEntityEtherCompressor)1 PhysicsWrapperEntity (ValkyrienWarfareBase.PhysicsManagement.PhysicsWrapperEntity)1 BlockBalloonBurner (ValkyrienWarfareControl.Block.BlockBalloonBurner)1 BlockDopedEtherium (ValkyrienWarfareControl.Block.BlockDopedEtherium)1 BlockShipPassengerChair (ValkyrienWarfareControl.Block.BlockShipPassengerChair)1 BlockShipPilotsChair (ValkyrienWarfareControl.Block.BlockShipPilotsChair)1 BlockThrustModulator (ValkyrienWarfareControl.Block.BlockThrustModulator)1 BlockThrustRelay (ValkyrienWarfareControl.Block.BlockThrustRelay)1 BlockNormalEngine (ValkyrienWarfareControl.Block.Engine.BlockNormalEngine)1 BlockRedstoneEngine (ValkyrienWarfareControl.Block.Engine.BlockRedstoneEngine)1 BlockCreativeEtherCompressor (ValkyrienWarfareControl.Block.EtherCompressor.BlockCreativeEtherCompressor)1 BlockNormalEtherCompressor (ValkyrienWarfareControl.Block.EtherCompressor.BlockNormalEtherCompressor)1 TileEntityHoverController (ValkyrienWarfareControl.TileEntity.TileEntityHoverController)1 Block (net.minecraft.block.Block)1 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)1 BlockPos (net.minecraft.util.math.BlockPos)1