use of ValkyrienWarfareControl.TileEntity.TileEntityHoverController 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.TileEntity.TileEntityHoverController in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class ControlGUIHandler method getServerGuiElement.
@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
if (ID == ControlGUIEnum.HoverCraftController.ordinal()) {
TileEntity tileEnt = world.getTileEntity(new BlockPos(x, y, z));
if (!(tileEnt instanceof TileEntityHoverController)) {
return null;
}
TileEntityHoverController tile = (TileEntityHoverController) tileEnt;
((EntityPlayerMP) player).connection.sendPacket(tile.getUpdatePacket());
return new HovercraftControllerContainer(player.inventory, tile);
}
return null;
}
use of ValkyrienWarfareControl.TileEntity.TileEntityHoverController in project Valkyrien-Warfare-Revamped by ValkyrienWarfare.
the class HovercraftControllerGUIInputHandler method onMessage.
@Override
public IMessage onMessage(final HovercraftControllerGUIInputMessage message, final MessageContext ctx) {
IThreadListener mainThread = ctx.getServerHandler().serverController;
mainThread.addScheduledTask(new Runnable() {
@Override
public void run() {
PhysicsWrapperEntity wrapper = ValkyrienWarfareMod.physicsManager.getObjectManagingPos(ctx.getServerHandler().playerEntity.worldObj, message.tilePos);
TileEntity tileEnt = wrapper.wrapping.VKChunkCache.getTileEntity(message.tilePos);
if (tileEnt != null) {
if (tileEnt instanceof TileEntityHoverController) {
((TileEntityHoverController) tileEnt).handleGUIInput(message, ctx);
}
} else {
System.out.println("Player: " + ctx.getServerHandler().playerEntity.getName() + " sent a broken packet");
}
}
});
return null;
}
Aggregations