use of micdoodle8.mods.galacticraft.planets.mars.tile.TileEntityCryogenicChamber in project Galacticraft by micdoodle8.
the class EventHandlerMars method orientCamera.
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void orientCamera(OrientCameraEvent event) {
EntityPlayer entity = Minecraft.getMinecraft().thePlayer;
if (entity != null) {
int x = MathHelper.floor_double(entity.posX);
int y = MathHelper.floor_double(entity.posY);
int z = MathHelper.floor_double(entity.posZ);
TileEntity tile = Minecraft.getMinecraft().theWorld.getTileEntity(new BlockPos(x, y - 1, z));
if (tile instanceof TileEntityMulti) {
tile = ((TileEntityMulti) tile).getMainBlockTile();
}
if (tile instanceof TileEntityCryogenicChamber) {
GL11.glRotatef(180, 0.0F, 1.0F, 0.0F);
switch(tile.getBlockMetadata() & 3) {
case 0:
GL11.glTranslatef(-0.4F, -0.5F, 4.1F);
break;
case 1:
GL11.glTranslatef(0, -0.5F, 4.1F);
break;
case 2:
GL11.glTranslatef(0, -0.5F, 4.1F);
break;
case 3:
GL11.glTranslatef(0.0F, -0.5F, 4.1F);
break;
}
GL11.glRotatef(-180, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(FMLClientHandler.instance().getClientPlayerEntity().sleepTimer - 50, 0.0F, 1.0F, 0.0F);
GL11.glTranslatef(0.0F, 0.3F, 0.0F);
}
}
}
use of micdoodle8.mods.galacticraft.planets.mars.tile.TileEntityCryogenicChamber in project Galacticraft by micdoodle8.
the class PacketSimpleMars method handleClientSide.
@SideOnly(Side.CLIENT)
@Override
public void handleClientSide(EntityPlayer player) {
EntityPlayerSP playerBaseClient = null;
if (player instanceof EntityPlayerSP) {
playerBaseClient = (EntityPlayerSP) player;
}
switch(this.type) {
case C_OPEN_CUSTOM_GUI:
int entityID = 0;
Entity entity = null;
switch((Integer) this.data.get(1)) {
case 0:
entityID = (Integer) this.data.get(2);
entity = player.worldObj.getEntityByID(entityID);
if (entity != null && entity instanceof EntitySlimeling) {
FMLClientHandler.instance().getClient().displayGuiScreen(new GuiSlimelingInventory(player, (EntitySlimeling) entity));
}
player.openContainer.windowId = (Integer) this.data.get(0);
break;
case 1:
entityID = (Integer) this.data.get(2);
entity = player.worldObj.getEntityByID(entityID);
if (entity != null && entity instanceof EntityCargoRocket) {
FMLClientHandler.instance().getClient().displayGuiScreen(new GuiCargoRocket(player.inventory, (EntityCargoRocket) entity));
}
player.openContainer.windowId = (Integer) this.data.get(0);
break;
}
break;
case C_OPEN_CUSTOM_GUI_TILE:
BlockPos pos;
TileEntity tile;
switch((Integer) this.data.get(1)) {
case 0:
pos = (BlockPos) this.data.get(2);
tile = player.worldObj.getTileEntity(pos);
if (tile != null && tile instanceof TileEntityLaunchController) {
FMLClientHandler.instance().getClient().displayGuiScreen(new GuiLaunchControllerAdvanced(player.inventory, (TileEntityLaunchController) tile));
}
player.openContainer.windowId = (Integer) this.data.get(0);
break;
}
break;
case C_BEGIN_CRYOGENIC_SLEEP:
pos = (BlockPos) this.data.get(0);
tile = player.worldObj.getTileEntity(pos);
if (tile instanceof TileEntityCryogenicChamber) {
((TileEntityCryogenicChamber) tile).sleepInBedAt(player, pos.getX(), pos.getY(), pos.getZ());
}
default:
break;
}
}
Aggregations