use of cpw.mods.fml.relauncher.SideOnly in project ICBM-Classic by BuiltBrokenModding.
the class TileMissileCoordinatorClient method renderDynamic.
@Override
@SideOnly(Side.CLIENT)
public void renderDynamic(Pos pos, float frame, int pass) {
GL11.glPushMatrix();
GL11.glTranslatef((float) pos.x() + 0.5F, (float) pos.y() + 1.5F, (float) pos.z() + 0.5F);
int radius = 4;
List players = world().getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(xCoord - radius, yCoord - radius, zCoord - radius, xCoord + radius, yCoord + radius, zCoord + radius));
if (players.size() > 0) {
if (this.lastSeePlayer > 20 * 3) {
FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_FILE_ON);
} else {
// Flicker for first 3 seconds when player comes near.
this.lastSeePlayer += frame;
if (Math.random() * 3 < this.lastSeePlayer / 3 && this.lastFlicker <= 0) {
this.lastFlicker = 8;
FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_FILE_ON);
} else {
FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_FILE);
}
this.lastFlicker -= frame;
}
} else {
this.lastSeePlayer = 0;
FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_FILE);
}
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
switch(getDirection().ordinal()) {
case 3:
GL11.glRotatef(180F, 0.0F, 180F, 1.0F);
break;
case 5:
GL11.glRotatef(90F, 0.0F, 180F, 1.0F);
break;
case 4:
GL11.glRotatef(-90F, 0.0F, 180F, 1.0F);
break;
}
// CalclaviaRenderHelper.disableBlending();
// CalclaviaRenderHelper.enableLighting();
MODEL.render(0, 0.0625F);
GL11.glPopMatrix();
}
use of cpw.mods.fml.relauncher.SideOnly in project ICBM-Classic by BuiltBrokenModding.
the class TileLauncherBaseClient method renderDynamic.
@Override
@SideOnly(Side.CLIENT)
public void renderDynamic(Pos pos, float frame, int pass) {
GL11.glPushMatrix();
GL11.glTranslatef((float) pos.x() + 0.5F, (float) pos.y() + 1.5F, (float) pos.z() + 0.5F);
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
if (getDirection() != ForgeDirection.NORTH && getDirection() != ForgeDirection.SOUTH) {
GL11.glRotatef(90F, 0F, 180F, 1.0F);
}
// The missile launcher screen
if (getTier() == 0) {
FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_FILE_0);
modelBase0.render(0.0625F);
modelRail0.render(0.0625F);
} else if (getTier() == 1) {
FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_FILE_1);
modelBase1.render(0.0625F);
modelRail1.render(0.0625F);
GL11.glRotatef(180F, 0F, 180F, 1.0F);
modelRail1.render(0.0625F);
} else if (getTier() == 2) {
FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_FILE_2);
modelBase2.render(0.0625F);
modelRail2.render(0.0625F);
GL11.glRotatef(180F, 0F, 180F, 1.0F);
modelRail2.render(0.0625F);
}
GL11.glPopMatrix();
if (cachedMissileStack != null) {
GL11.glPushMatrix();
GL11.glTranslatef((float) pos.x() + 0.5F, (float) pos.y() + 0.5F, (float) pos.z() + 0.5F);
//GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
Explosives e = Explosives.get(cachedMissileStack.getItemDamage());
Explosion missile = e == null ? (Explosion) Explosives.CONDENSED.handler : (Explosion) e.handler;
if (missile.missileModelPath.contains("missiles")) {
GL11.glScalef(0.00625f, 0.00625f, 0.00625f);
} else {
GL11.glScalef(0.05f, 0.05f, 0.05f);
}
RenderMissile.renderMissile(missile);
GL11.glPopMatrix();
}
}
use of cpw.mods.fml.relauncher.SideOnly in project ICBM-Classic by BuiltBrokenModding.
the class BlockExplosive method registerBlockIcons.
@SideOnly(Side.CLIENT)
@Override
public void registerBlockIcons(IIconRegister iconRegister) {
/** Register every single texture for all explosives. */
for (Explosives ex : Explosives.values()) {
if (ex.handler.hasBlockForm() && ex != Explosives.SMINE) {
ICONS.put(ex.ordinal() + "_top", this.getIcon(iconRegister, ex.handler, "_top"));
ICONS.put(ex.ordinal() + "_side", this.getIcon(iconRegister, ex.handler, "_side"));
ICONS.put(ex.ordinal() + "_bottom", this.getIcon(iconRegister, ex.handler, "_bottom"));
}
}
}
use of cpw.mods.fml.relauncher.SideOnly in project Trains-In-Motion-1.7.10 by EternalBlueFlame.
the class EventManager method onClientKeyPress.
/**
* <h2>Keybind management</h2>
* called when a client presses a key. this coveres pretty much everything.
* Most cases just send a packet to manage things
* @see PacketKeyPress
*
* Credit to Ferdinand for help with this function.
*
* @param event the event of a key being pressed on client.
*/
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void onClientKeyPress(InputEvent.KeyInputEvent event) {
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
if (player.ridingEntity instanceof GenericRailTransport || player.ridingEntity instanceof EntitySeat) {
//for lamp
if (ClientProxy.KeyLamp.isPressed()) {
TrainsInMotion.keyChannel.sendToServer(new PacketKeyPress(0, player.ridingEntity.getEntityId()));
((GenericRailTransport) player.ridingEntity).setBoolean(GenericRailTransport.boolValues.LAMP, !((GenericRailTransport) player.ridingEntity).getBoolean(GenericRailTransport.boolValues.LAMP));
}
//for inventory
if (ClientProxy.KeyInventory.isPressed()) {
TrainsInMotion.keyChannel.sendToServer(new PacketKeyPress(1, player.ridingEntity.getEntityId()));
}
if (player.ridingEntity instanceof EntityTrainCore) {
//for speed change
if (ClientProxy.KeyAccelerate.isPressed()) {
TrainsInMotion.keyChannel.sendToServer(new PacketKeyPress(2, player.ridingEntity.getEntityId()));
} else if (ClientProxy.KeyReverse.getIsKeyPressed()) {
TrainsInMotion.keyChannel.sendToServer(new PacketKeyPress(3, player.ridingEntity.getEntityId()));
} else if (ClientProxy.KeyHorn.isPressed()) {
TrainsInMotion.keyChannel.sendToServer(new PacketKeyPress(4, player.ridingEntity.getEntityId()));
}
}
}
}
use of cpw.mods.fml.relauncher.SideOnly in project SecurityCraft by Geforce132.
the class BlockReinforcedWood method getSubBlocks.
/**
* returns a list of blocks with the same ID, but different meta (eg: wood returns 4 blocks)
*/
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) {
p_149666_3_.add(new ItemStack(p_149666_1_, 1, 0));
p_149666_3_.add(new ItemStack(p_149666_1_, 1, 1));
p_149666_3_.add(new ItemStack(p_149666_1_, 1, 2));
p_149666_3_.add(new ItemStack(p_149666_1_, 1, 3));
p_149666_3_.add(new ItemStack(p_149666_1_, 1, 4));
p_149666_3_.add(new ItemStack(p_149666_1_, 1, 5));
}
Aggregations