Search in sources :

Example 76 with ResourceLocation

use of net.minecraft.util.ResourceLocation in project OpenModularTurrets by OpenModularTurretsTeam.

the class DisposableItemTurretRenderer method renderTileEntityAt.

@SuppressWarnings("ConstantConditions")
@Override
@SideOnly(Side.CLIENT)
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale, int destroyStage) {
    DisposableItemTurretTileEntity turretHead = (DisposableItemTurretTileEntity) te;
    int rotation;
    ResourceLocation textures = (new ResourceLocation(Reference.MOD_ID + ":textures/blocks/dispose_item_turret.png"));
    Minecraft.getMinecraft().renderEngine.bindTexture(textures);
    GL11.glPushMatrix();
    GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
    if (te == null) {
        GL11.glScalef(0.7F, -0.7F, -0.7F);
        GL11.glTranslatef((float) x + 0.0F, (float) y + 0.4F, (float) z + 0.5F);
        GL11.glRotatef(45.0F, 2.5F, -4.5F, -1.0F);
        model.renderAll();
        GL11.glPopMatrix();
        return;
    }
    if (turretHead.shouldConceal) {
        GL11.glPopMatrix();
        return;
    }
    if (te.getWorld() != null) {
        rotation = te.getBlockMetadata();
        GL11.glRotatef(rotation * 90, 0.0F, 1.0F, 0.0F);
        GL11.glScalef(1.0F, -1F, -1F);
        model.setRotationForTarget(turretHead.rotationXY, turretHead.rotationXZ);
        model.Base.rotateAngleX = turretHead.baseFitRotationX;
        model.Base.rotateAngleY = turretHead.baseFitRotationZ;
        model.Pole.rotateAngleX = turretHead.baseFitRotationX;
        model.Pole.rotateAngleY = turretHead.baseFitRotationZ;
        model.BoxUnder.rotateAngleX = turretHead.baseFitRotationX;
    }
    model.renderAll();
    if (turretHead.getBase() != null) {
        if (TurretHeadUtil.hasSolarPanelAddon(turretHead.getBase())) {
            ResourceLocation texturesSolar = (new ResourceLocation(Reference.MOD_ID + ":textures/blocks/addon_solar_panel.png"));
            Minecraft.getMinecraft().renderEngine.bindTexture(texturesSolar);
            solar.setRotationForTarget(turretHead.rotationXY, turretHead.rotationXZ);
            solar.renderAll();
        }
        if (TurretHeadUtil.hasDamageAmpAddon(turretHead.getBase())) {
            ResourceLocation texturesAmp = (new ResourceLocation(Reference.MOD_ID + ":textures/blocks/addon_damage_amp.png"));
            Minecraft.getMinecraft().renderEngine.bindTexture(texturesAmp);
            amp.setRotationForTarget(turretHead.rotationXY, turretHead.rotationXZ);
            amp.renderAll();
        }
        if (TurretHeadUtil.hasRedstoneReactor(turretHead.getBase())) {
            ResourceLocation texturesReac = (new ResourceLocation(Reference.MOD_ID + ":textures/blocks/addon_redstone_reactor.png"));
            Minecraft.getMinecraft().renderEngine.bindTexture(texturesReac);
            reac.setRotationForTarget(turretHead.rotationXY, turretHead.rotationXZ);
            reac.renderAll();
        }
    }
    GL11.glPopMatrix();
}
Also used : ResourceLocation(net.minecraft.util.ResourceLocation) DisposableItemTurretTileEntity(omtteam.openmodularturrets.tileentity.turrets.DisposableItemTurretTileEntity) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 77 with ResourceLocation

use of net.minecraft.util.ResourceLocation in project OpenModularTurrets by OpenModularTurretsTeam.

the class GrenadeLauncherTurretRenderer method renderTileEntityAt.

@SuppressWarnings("ConstantConditions")
@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale, int destroyStage) {
    TurretHead turretHead = (TurretHead) te;
    int rotation;
    ResourceLocation textures = (new ResourceLocation(Reference.MOD_ID + ":textures/blocks/grenade_turret.png"));
    Minecraft.getMinecraft().renderEngine.bindTexture(textures);
    GL11.glPushMatrix();
    GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
    if (te == null) {
        GL11.glScalef(0.7F, -0.7F, -0.7F);
        GL11.glTranslatef((float) x + 0.0F, (float) y + 0.4F, (float) z + 0.5F);
        GL11.glRotatef(45.0F, 2.5F, -4.5F, -1.0F);
        model.renderAll();
        GL11.glPopMatrix();
        return;
    }
    if (turretHead.shouldConceal) {
        GL11.glPopMatrix();
        return;
    }
    if (te.getWorld() != null) {
        rotation = te.getBlockMetadata();
        GL11.glRotatef(rotation * 90, 0.0F, 1.0F, 0.0F);
        GL11.glScalef(1.0F, -1F, -1F);
        model.setRotationForTarget(turretHead.rotationXY, turretHead.rotationXZ);
        model.Base.rotateAngleX = turretHead.baseFitRotationX;
        model.Base.rotateAngleY = turretHead.baseFitRotationZ;
        model.Pole.rotateAngleX = turretHead.baseFitRotationX;
        model.Pole.rotateAngleY = turretHead.baseFitRotationZ;
        model.BoxUnder.rotateAngleX = turretHead.baseFitRotationX;
    }
    model.renderAll();
    if (turretHead.getBase() != null) {
        if (TurretHeadUtil.hasSolarPanelAddon(turretHead.getBase())) {
            ResourceLocation texturesSolar = (new ResourceLocation(Reference.MOD_ID + ":textures/blocks/addon_solar_panel.png"));
            Minecraft.getMinecraft().renderEngine.bindTexture(texturesSolar);
            solar.setRotationForTarget(turretHead.rotationXY, turretHead.rotationXZ);
            solar.renderAll();
        }
        if (TurretHeadUtil.hasDamageAmpAddon(turretHead.getBase())) {
            ResourceLocation texturesAmp = (new ResourceLocation(Reference.MOD_ID + ":textures/blocks/addon_damage_amp.png"));
            Minecraft.getMinecraft().renderEngine.bindTexture(texturesAmp);
            amp.setRotationForTarget(turretHead.rotationXY, turretHead.rotationXZ);
            amp.renderAll();
        }
        if (TurretHeadUtil.hasRedstoneReactor(turretHead.getBase())) {
            ResourceLocation texturesReac = (new ResourceLocation(Reference.MOD_ID + ":textures/blocks/addon_redstone_reactor.png"));
            Minecraft.getMinecraft().renderEngine.bindTexture(texturesReac);
            reac.setRotationForTarget(turretHead.rotationXY, turretHead.rotationXZ);
            reac.renderAll();
        }
    }
    GL11.glPopMatrix();
}
Also used : ResourceLocation(net.minecraft.util.ResourceLocation) TurretHead(omtteam.openmodularturrets.tileentity.turrets.TurretHead)

Example 78 with ResourceLocation

use of net.minecraft.util.ResourceLocation in project OpenModularTurrets by OpenModularTurretsTeam.

the class IncendiaryTurretRenderer method renderTileEntityAt.

@SuppressWarnings("ConstantConditions")
@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale, int destroyStage) {
    TurretHead turretHead = (TurretHead) te;
    int rotation;
    ResourceLocation textures = (new ResourceLocation(Reference.MOD_ID + ":textures/blocks/incendiary_turret.png"));
    Minecraft.getMinecraft().renderEngine.bindTexture(textures);
    GL11.glPushMatrix();
    GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
    if (te == null) {
        GL11.glScalef(0.7F, -0.7F, -0.7F);
        GL11.glTranslatef((float) x + 0.0F, (float) y + 0.4F, (float) z + 0.5F);
        GL11.glRotatef(45.0F, 2.5F, -4.5F, -1.0F);
        model.renderAll();
        GL11.glPopMatrix();
        return;
    }
    if (turretHead.shouldConceal) {
        GL11.glPopMatrix();
        return;
    }
    if (te.getWorld() != null) {
        rotation = te.getBlockMetadata();
        GL11.glRotatef(rotation * 90, 0.0F, 1.0F, 0.0F);
        GL11.glScalef(1.0F, -1F, -1F);
        model.setRotationForTarget(turretHead.rotationXY, turretHead.rotationXZ);
        model.Base.rotateAngleX = turretHead.baseFitRotationX;
        model.Base.rotateAngleY = turretHead.baseFitRotationZ;
        model.Pole.rotateAngleX = turretHead.baseFitRotationX;
        model.Pole.rotateAngleY = turretHead.baseFitRotationZ;
        model.BoxUnder.rotateAngleX = turretHead.baseFitRotationX;
    }
    model.renderAll();
    if (turretHead.getBase() != null) {
        if (TurretHeadUtil.hasSolarPanelAddon(turretHead.getBase())) {
            ResourceLocation texturesSolar = (new ResourceLocation(Reference.MOD_ID + ":textures/blocks/addon_solar_panel.png"));
            Minecraft.getMinecraft().renderEngine.bindTexture(texturesSolar);
            solar.setRotationForTarget(turretHead.rotationXY, turretHead.rotationXZ);
            solar.renderAll();
        }
        if (TurretHeadUtil.hasDamageAmpAddon(turretHead.getBase())) {
            ResourceLocation texturesAmp = (new ResourceLocation(Reference.MOD_ID + ":textures/blocks/addon_damage_amp.png"));
            Minecraft.getMinecraft().renderEngine.bindTexture(texturesAmp);
            amp.setRotationForTarget(turretHead.rotationXY, turretHead.rotationXZ);
            amp.renderAll();
        }
        if (TurretHeadUtil.hasRedstoneReactor(turretHead.getBase())) {
            ResourceLocation texturesReac = (new ResourceLocation(Reference.MOD_ID + ":textures/blocks/addon_redstone_reactor.png"));
            Minecraft.getMinecraft().renderEngine.bindTexture(texturesReac);
            reac.setRotationForTarget(turretHead.rotationXY, turretHead.rotationXZ);
            reac.renderAll();
        }
    }
    GL11.glPopMatrix();
}
Also used : ResourceLocation(net.minecraft.util.ResourceLocation) TurretHead(omtteam.openmodularturrets.tileentity.turrets.TurretHead)

Example 79 with ResourceLocation

use of net.minecraft.util.ResourceLocation in project OpenModularTurrets by OpenModularTurretsTeam.

the class MachineGunTurretRenderer method renderTileEntityAt.

@SuppressWarnings("ConstantConditions")
@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale, int destroyStage) {
    TurretHead turretHead = (TurretHead) te;
    int rotation;
    ResourceLocation textures = (new ResourceLocation(Reference.MOD_ID + ":textures/blocks/machine_gun_turret.png"));
    Minecraft.getMinecraft().renderEngine.bindTexture(textures);
    GL11.glPushMatrix();
    GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
    if (te == null) {
        GL11.glScalef(0.7F, -0.7F, -0.7F);
        GL11.glTranslatef((float) x + 0.0F, (float) y + 0.4F, (float) z + 0.5F);
        GL11.glRotatef(45.0F, 2.5F, -4.5F, -1.0F);
        model.renderAll();
        GL11.glPopMatrix();
        return;
    }
    if (turretHead.shouldConceal) {
        GL11.glPopMatrix();
        return;
    }
    if (te.getWorld() != null) {
        rotation = te.getBlockMetadata();
        GL11.glRotatef(rotation * 90, 0.0F, 1.0F, 0.0F);
        GL11.glScalef(1.0F, -1F, -1F);
        model.setRotationForTarget(turretHead.rotationXY, turretHead.rotationXZ);
        model.Base.rotateAngleX = turretHead.baseFitRotationX;
        model.Base.rotateAngleY = turretHead.baseFitRotationZ;
        model.Pole.rotateAngleX = turretHead.baseFitRotationX;
        model.Pole.rotateAngleY = turretHead.baseFitRotationZ;
        model.BoxUnder.rotateAngleX = turretHead.baseFitRotationX;
    }
    model.renderAll();
    if (turretHead.getBase() != null) {
        if (TurretHeadUtil.hasSolarPanelAddon(turretHead.getBase())) {
            ResourceLocation texturesSolar = (new ResourceLocation(Reference.MOD_ID + ":textures/blocks/addon_solar_panel.png"));
            Minecraft.getMinecraft().renderEngine.bindTexture(texturesSolar);
            solar.setRotationForTarget(turretHead.rotationXY, turretHead.rotationXZ);
            solar.renderAll();
        }
        if (TurretHeadUtil.hasDamageAmpAddon(turretHead.getBase())) {
            ResourceLocation texturesAmp = (new ResourceLocation(Reference.MOD_ID + ":textures/blocks/addon_damage_amp.png"));
            Minecraft.getMinecraft().renderEngine.bindTexture(texturesAmp);
            amp.setRotationForTarget(turretHead.rotationXY, turretHead.rotationXZ);
            amp.renderAll();
        }
        if (TurretHeadUtil.hasRedstoneReactor(turretHead.getBase())) {
            ResourceLocation texturesReac = (new ResourceLocation(Reference.MOD_ID + ":textures/blocks/addon_redstone_reactor.png"));
            Minecraft.getMinecraft().renderEngine.bindTexture(texturesReac);
            reac.setRotationForTarget(turretHead.rotationXY, turretHead.rotationXZ);
            reac.renderAll();
        }
    }
    GL11.glPopMatrix();
}
Also used : ResourceLocation(net.minecraft.util.ResourceLocation) TurretHead(omtteam.openmodularturrets.tileentity.turrets.TurretHead)

Example 80 with ResourceLocation

use of net.minecraft.util.ResourceLocation in project OpenModularTurrets by OpenModularTurretsTeam.

the class ExpanderInvGui method drawGuiContainerBackgroundLayer.

@Override
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
    ResourceLocation texture = (new ResourceLocation(Reference.MOD_ID + ":textures/gui/extender_inv.png"));
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.renderEngine.bindTexture(texture);
    int x = (width - xSize) / 2;
    int y = (height - ySize) / 2;
    this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
}
Also used : ResourceLocation(net.minecraft.util.ResourceLocation)

Aggregations

ResourceLocation (net.minecraft.util.ResourceLocation)272 ItemStack (net.minecraft.item.ItemStack)51 Block (net.minecraft.block.Block)47 Item (net.minecraft.item.Item)32 ModelResourceLocation (net.minecraft.client.renderer.block.model.ModelResourceLocation)31 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)30 IBlockState (net.minecraft.block.state.IBlockState)17 NBTTagCompound (net.minecraft.nbt.NBTTagCompound)15 ArrayList (java.util.ArrayList)14 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)14 Map (java.util.Map)11 EntityPlayer (net.minecraft.entity.player.EntityPlayer)11 ShaderLayer (blusunrize.immersiveengineering.api.shader.ShaderCase.ShaderLayer)10 IOException (java.io.IOException)10 TileEntity (net.minecraft.tileentity.TileEntity)9 IBakedModel (net.minecraft.client.renderer.block.model.IBakedModel)8 EnumFacing (net.minecraft.util.EnumFacing)8 BlockPos (net.minecraft.util.math.BlockPos)8 Random (java.util.Random)7 TextureAtlasSprite (net.minecraft.client.renderer.texture.TextureAtlasSprite)7