use of powercrystals.minefactoryreloaded.block.BlockFactoryGlassPane in project MineFactoryReloaded by powercrystals.
the class MineFactoryReloadedCore method init.
@Init
public void init(FMLInitializationEvent evt) {
instance = this;
float meatNuggetSaturation = MFRConfig.meatSaturation.getBoolean(false) ? 0.1F : 0.2F;
float meatIngotSaturation = MFRConfig.meatSaturation.getBoolean(false) ? 0.2F : 0.8F;
conveyorBlock = new BlockConveyor(MFRConfig.conveyorBlockId.getInt());
machineBlocks.put(0, new BlockFactoryMachine(MFRConfig.machineBlock0Id.getInt(), 0));
machineBlocks.put(1, new BlockFactoryMachine(MFRConfig.machineBlock1Id.getInt(), 1));
machineBlocks.put(2, new BlockFactoryMachine(MFRConfig.machineBlock2Id.getInt(), 2));
factoryGlassBlock = new BlockFactoryGlass(MFRConfig.factoryGlassBlockId.getInt());
factoryGlassPaneBlock = new BlockFactoryGlassPane(MFRConfig.factoryGlassPaneBlockId.getInt());
factoryRoadBlock = new BlockFactoryRoad(MFRConfig.factoryRoadBlockId.getInt());
factoryDecorativeBrickBlock = new BlockFactoryDecorativeBricks(MFRConfig.factoryDecorativeBrickBlockId.getInt());
factoryDecorativeStoneBlock = new BlockDecorativeStone(MFRConfig.factoryDecorativeStoneBlockId.getInt());
rubberWoodBlock = new BlockRubberWood(MFRConfig.rubberWoodBlockId.getInt());
rubberLeavesBlock = new BlockRubberLeaves(MFRConfig.rubberLeavesBlockId.getInt());
rubberSaplingBlock = new BlockRubberSapling(MFRConfig.rubberSaplingBlockId.getInt());
railDropoffCargoBlock = new BlockRailCargoDropoff(MFRConfig.railDropoffCargoBlockId.getInt());
railPickupCargoBlock = new BlockRailCargoPickup(MFRConfig.railPickupCargoBlockId.getInt());
railDropoffPassengerBlock = new BlockRailPassengerDropoff(MFRConfig.railDropoffPassengerBlockId.getInt());
railPickupPassengerBlock = new BlockRailPassengerPickup(MFRConfig.railPickupPassengerBlockId.getInt());
rednetCableBlock = new BlockRedNetCable(MFRConfig.rednetCableBlockId.getInt());
rednetLogicBlock = new BlockRedNetLogic(MFRConfig.rednetLogicBlockId.getInt());
rednetPanelBlock = new BlockRedNetPanel(MFRConfig.rednetPanelBlockId.getInt());
fakeLaserBlock = new BlockFakeLaser(MFRConfig.fakeLaserBlockId.getInt());
vineScaffoldBlock = new BlockVineScaffold(MFRConfig.vineScaffoldBlockId.getInt());
factoryHammerItem = (new ItemFactoryHammer(MFRConfig.hammerItemId.getInt())).setUnlocalizedName("mfr.hammer").setMaxStackSize(1);
fertilizerItem = (new ItemFactory(MFRConfig.fertilizerItemId.getInt())).setUnlocalizedName("mfr.fertilizer");
plasticSheetItem = (new ItemFactory(MFRConfig.plasticSheetItemId.getInt())).setUnlocalizedName("mfr.plastic.sheet");
rawPlasticItem = (new ItemFactory(MFRConfig.rawPlasticItemId.getInt())).setUnlocalizedName("mfr.plastic.raw");
rubberBarItem = (new ItemFactory(MFRConfig.rubberBarItemId.getInt())).setUnlocalizedName("mfr.rubber.bar");
syringeEmptyItem = (new ItemFactory(MFRConfig.syringeEmptyItemId.getInt())).setUnlocalizedName("mfr.syringe.empty");
syringeHealthItem = (new ItemSyringeHealth()).setUnlocalizedName("mfr.syringe.health").setContainerItem(syringeEmptyItem);
syringeGrowthItem = (new ItemSyringeGrowth()).setUnlocalizedName("mfr.syringe.growth").setContainerItem(syringeEmptyItem);
rawRubberItem = (new ItemFactory(MFRConfig.rawRubberItemId.getInt())).setUnlocalizedName("mfr.rubber.raw");
machineBaseItem = (new ItemFactory(MFRConfig.machineBaseItemId.getInt())).setUnlocalizedName("mfr.machineblock");
safariNetItem = (new ItemSafariNet(MFRConfig.safariNetItemId.getInt())).setUnlocalizedName("mfr.safarinet.reusable");
ceramicDyeItem = (new ItemCeramicDye(MFRConfig.ceramicDyeItemId.getInt())).setUnlocalizedName("mfr.ceramicdye");
blankRecordItem = (new ItemFactory(MFRConfig.blankRecordId.getInt())).setUnlocalizedName("mfr.record.blank").setMaxStackSize(1);
syringeZombieItem = (new ItemSyringeZombie()).setUnlocalizedName("mfr.syringe.zombie").setContainerItem(syringeEmptyItem);
safariNetSingleItem = (new ItemSafariNet(MFRConfig.safariNetSingleItemId.getInt())).setUnlocalizedName("mfr.safarinet.singleuse");
upgradeItem = (new ItemUpgrade(MFRConfig.upgradeItemId.getInt())).setUnlocalizedName("mfr.upgrade.radius").setMaxStackSize(1);
safariNetLauncherItem = (new ItemSafariNetLauncher(MFRConfig.safariNetLauncherItemId.getInt())).setUnlocalizedName("mfr.safarinet.launcher").setMaxStackSize(1);
sugarCharcoalItem = (new ItemFactory(MFRConfig.sugarCharcoalItemId.getInt())).setUnlocalizedName("mfr.sugarcharcoal");
milkBottleItem = (new ItemMilkBottle(MFRConfig.milkBottleItemId.getInt())).setUnlocalizedName("mfr.milkbottle").setMaxStackSize(16);
spyglassItem = (new ItemSpyglass(MFRConfig.spyglassItemId.getInt())).setUnlocalizedName("mfr.spyglass").setMaxStackSize(1);
portaSpawnerItem = (new ItemPortaSpawner(MFRConfig.portaSpawnerItemId.getInt())).setUnlocalizedName("mfr.portaspawner").setMaxStackSize(1);
strawItem = (new ItemStraw(MFRConfig.strawItemId.getInt())).setUnlocalizedName("mfr.straw").setMaxStackSize(1);
xpExtractorItem = (new ItemXpExtractor(MFRConfig.xpExtractorItemId.getInt())).setUnlocalizedName("mfr.xpextractor").setMaxStackSize(1);
syringeSlimeItem = (new ItemSyringeSlime(MFRConfig.syringeSlimeItemId.getInt())).setUnlocalizedName("mfr.syringe.slime").setContainerItem(syringeEmptyItem);
syringeCureItem = (new ItemSyringeCure(MFRConfig.syringeCureItemId.getInt())).setUnlocalizedName("mfr.syringe.cure").setContainerItem(syringeEmptyItem);
logicCardItem = (new ItemLogicUpgradeCard(MFRConfig.logicCardItemId.getInt())).setUnlocalizedName("mfr.upgrade.logic").setMaxStackSize(1);
rednetMeterItem = (new ItemRedNetMeter(MFRConfig.rednetMeterItemId.getInt())).setUnlocalizedName("mfr.rednet.meter").setMaxStackSize(1);
rednetMemoryCardItem = (new ItemRedNetMemoryCard(MFRConfig.rednetMemoryCardItemId.getInt())).setUnlocalizedName("mfr.rednet.memorycard").setMaxStackSize(1);
rulerItem = (new ItemRuler(MFRConfig.rulerItemId.getInt())).setUnlocalizedName("mfr.ruler").setMaxStackSize(1);
meatIngotRawItem = (new ItemFactoryFood(MFRConfig.meatIngotRawItemId.getInt(), 4, meatIngotSaturation)).setUnlocalizedName("mfr.meat.ingot.raw");
meatIngotCookedItem = (new ItemFactoryFood(MFRConfig.meatIngotCookedItemId.getInt(), 10, meatIngotSaturation)).setUnlocalizedName("mfr.meat.ingot.cooked");
meatNuggetRawItem = (new ItemFactoryFood(MFRConfig.meatNuggetRawItemId.getInt(), 1, meatNuggetSaturation)).setUnlocalizedName("mfr.meat.nugget.raw");
meatNuggetCookedItem = (new ItemFactoryFood(MFRConfig.meatNuggetCookedItemId.getInt(), 4, meatNuggetSaturation)).setUnlocalizedName("mfr.meat.nugget.cooked");
pinkSlimeballItem = (new ItemFactory(MFRConfig.pinkSlimeballItemId.getInt())).setUnlocalizedName("mfr.pinkslimeball");
safariNetJailerItem = (new ItemSafariNet(MFRConfig.safariNetJailerItemId.getInt())).setUnlocalizedName("mfr.safarinet.jailer");
laserFocusItem = (new ItemLaserFocus(MFRConfig.laserFocusItemId.getInt())).setUnlocalizedName("mfr.laserfocus").setMaxStackSize(1);
needlegunItem = (new ItemNeedleGun(MFRConfig.needlegunItemId.getInt())).setUnlocalizedName("mfr.needlegun").setMaxStackSize(1);
needlegunAmmoEmptyItem = (new ItemFactory(MFRConfig.needlegunAmmoEmptyItemId.getInt())).setUnlocalizedName("mfr.needlegun.ammo.empty");
needlegunAmmoStandardItem = (new ItemNeedlegunAmmoStandard(MFRConfig.needlegunAmmoStandardItemId.getInt())).setUnlocalizedName("mfr.needlegun.ammo.standard");
needlegunAmmoLavaItem = (new ItemNeedlegunAmmoBlock(MFRConfig.needlegunAmmoLavaItemId.getInt(), Block.lavaMoving.blockID, 3)).setUnlocalizedName("mfr.needlegun.ammo.lava");
needlegunAmmoSludgeItem = (new ItemNeedlegunAmmoBlock(MFRConfig.needlegunAmmoSludgeItemId.getInt(), sludgeLiquid.blockID, 6)).setUnlocalizedName("mfr.needlegun.ammo.sludge");
needlegunAmmoSewageItem = (new ItemNeedlegunAmmoBlock(MFRConfig.needlegunAmmoSewageItemId.getInt(), sewageLiquid.blockID, 6)).setUnlocalizedName("mfr.needlegun.ammo.sewage");
needlegunAmmoFireItem = (new ItemNeedlegunAmmoFire(MFRConfig.needlegunAmmoFireItemId.getInt())).setUnlocalizedName("mfr.needlegun.ammo.fire");
needlegunAmmoAnvilItem = (new ItemNeedlegunAmmoBlock(MFRConfig.needlegunAmmoAnvilItemId.getInt(), Block.anvil.blockID, 2)).setUnlocalizedName("mfr.needlegun.ammo.anvil").setMaxDamage(0);
plasticCup = (ItemFactoryCup) new ItemFactoryCup(MFRConfig.plasticCupItemId.getInt(), 64, 16).setUnlocalizedName("mfr.bucket.plasticcup");
rocketLauncherItem = (new ItemRocketLauncher(MFRConfig.rocketLauncherItemId.getInt())).setUnlocalizedName("mfr.rocketlauncher").setMaxStackSize(1);
rocketItem = (new ItemRocket(MFRConfig.rocketItemId.getInt())).setUnlocalizedName("mfr.rocket").setMaxStackSize(16);
for (Entry<Integer, Block> machine : machineBlocks.entrySet()) {
GameRegistry.registerBlock(machine.getValue(), ItemBlockFactoryMachine.class, machine.getValue().getUnlocalizedName());
}
GameRegistry.registerBlock(conveyorBlock, ItemBlockConveyor.class, conveyorBlock.getUnlocalizedName());
GameRegistry.registerBlock(factoryGlassBlock, ItemBlockFactoryGlass.class, factoryGlassBlock.getUnlocalizedName());
GameRegistry.registerBlock(factoryGlassPaneBlock, ItemBlockFactoryGlassPane.class, factoryGlassPaneBlock.getUnlocalizedName());
GameRegistry.registerBlock(factoryRoadBlock, ItemBlockFactoryRoad.class, factoryRoadBlock.getUnlocalizedName());
GameRegistry.registerBlock(factoryDecorativeBrickBlock, ItemBlockFactoryDecorativeBrick.class, factoryDecorativeBrickBlock.getUnlocalizedName());
GameRegistry.registerBlock(factoryDecorativeStoneBlock, ItemBlockDecorativeStone.class, factoryDecorativeStoneBlock.getUnlocalizedName());
GameRegistry.registerBlock(rubberWoodBlock, rubberWoodBlock.getUnlocalizedName());
GameRegistry.registerBlock(rubberLeavesBlock, rubberLeavesBlock.getUnlocalizedName());
GameRegistry.registerBlock(rubberSaplingBlock, rubberSaplingBlock.getUnlocalizedName());
GameRegistry.registerBlock(railPickupCargoBlock, railPickupCargoBlock.getUnlocalizedName());
GameRegistry.registerBlock(railDropoffCargoBlock, railDropoffCargoBlock.getUnlocalizedName());
GameRegistry.registerBlock(railPickupPassengerBlock, railPickupPassengerBlock.getUnlocalizedName());
GameRegistry.registerBlock(railDropoffPassengerBlock, railDropoffPassengerBlock.getUnlocalizedName());
GameRegistry.registerBlock(rednetCableBlock, rednetCableBlock.getUnlocalizedName());
GameRegistry.registerBlock(rednetLogicBlock, ItemBlockRedNetLogic.class, rednetLogicBlock.getUnlocalizedName());
GameRegistry.registerBlock(rednetPanelBlock, ItemBlockRedNetPanel.class, rednetPanelBlock.getUnlocalizedName());
GameRegistry.registerBlock(vineScaffoldBlock, ItemBlockVineScaffold.class, vineScaffoldBlock.getUnlocalizedName());
GameRegistry.registerBlock(milkLiquid, milkLiquid.getUnlocalizedName());
GameRegistry.registerBlock(sludgeLiquid, sludgeLiquid.getUnlocalizedName());
GameRegistry.registerBlock(sewageLiquid, sewageLiquid.getUnlocalizedName());
GameRegistry.registerBlock(essenceLiquid, essenceLiquid.getUnlocalizedName());
GameRegistry.registerBlock(biofuelLiquid, biofuelLiquid.getUnlocalizedName());
GameRegistry.registerBlock(meatLiquid, meatLiquid.getUnlocalizedName());
GameRegistry.registerBlock(pinkSlimeLiquid, pinkSlimeLiquid.getUnlocalizedName());
GameRegistry.registerBlock(chocolateMilkLiquid, chocolateMilkLiquid.getUnlocalizedName());
GameRegistry.registerBlock(mushroomSoupLiquid, mushroomSoupLiquid.getUnlocalizedName());
Block.setBurnProperties(rubberWoodBlock.blockID, 4, 20);
Block.setBurnProperties(rubberLeavesBlock.blockID, 30, 20);
MinecraftForge.setBlockHarvestLevel(MineFactoryReloadedCore.rednetCableBlock, 0, "pickaxe", 0);
if (MFRConfig.vanillaOverrideGlassPane.getBoolean(true)) {
Block.blocksList[Block.thinGlass.blockID] = null;
Item.itemsList[Block.thinGlass.blockID] = null;
Block.thinGlass = new BlockVanillaGlassPane();
GameRegistry.registerBlock(Block.thinGlass, Block.thinGlass.getUnlocalizedName());
}
if (MFRConfig.vanillaOverrideIce.getBoolean(true)) {
Block.blocksList[Block.ice.blockID] = null;
Item.itemsList[Block.ice.blockID] = null;
Block.ice = new BlockVanillaIce();
GameRegistry.registerBlock(Block.ice, ItemBlockVanillaIce.class, "blockVanillaIce");
}
GameRegistry.registerTileEntity(TileEntityConveyor.class, "factoryConveyor");
GameRegistry.registerTileEntity(TileEntityRedNetCable.class, "factoryRedstoneCable");
GameRegistry.registerTileEntity(TileEntityRedNetLogic.class, "factoryRednetLogic");
GameRegistry.registerTileEntity(TileEntityRedNetHistorian.class, "factoryRednetHistorian");
EntityRegistry.registerModEntity(EntitySafariNet.class, "entitySafariNet", 0, instance, 160, 5, true);
EntityRegistry.registerModEntity(EntityPinkSlime.class, "mfrEntityPinkSlime", 1, instance, 160, 5, true);
EntityRegistry.registerModEntity(EntityNeedle.class, "mfrEntityNeedle", 2, instance, 160, 5, true);
EntityRegistry.registerModEntity(EntityRocket.class, "mfrEntityRocket", 3, instance, 160, 1, true);
MinecraftForge.EVENT_BUS.register(instance);
MinecraftForge.EVENT_BUS.register(proxy);
OreDictionary.registerOre("itemRubber", MineFactoryReloadedCore.rubberBarItem);
OreDictionary.registerOre("woodRubber", MineFactoryReloadedCore.rubberWoodBlock);
OreDictionary.registerOre("sheetPlastic", MineFactoryReloadedCore.plasticSheetItem);
OreDictionary.registerOre("dustPlastic", MineFactoryReloadedCore.rawPlasticItem);
OreDictionary.registerOre("ingotMeat", MineFactoryReloadedCore.meatIngotCookedItem);
OreDictionary.registerOre("ingotMeatRaw", MineFactoryReloadedCore.meatIngotRawItem);
OreDictionary.registerOre("nuggetMeat", MineFactoryReloadedCore.meatNuggetCookedItem);
OreDictionary.registerOre("nuggetMeatRaw", MineFactoryReloadedCore.meatNuggetRawItem);
OreDictionary.registerOre("itemCharcoalSugar", MineFactoryReloadedCore.sugarCharcoalItem);
OreDictionary.registerOre("cableRedNet", MineFactoryReloadedCore.rednetCableBlock);
GameRegistry.registerFuelHandler(new MineFactoryReloadedFuelHandler());
proxy.init();
NetworkRegistry.instance().registerGuiHandler(this, new MFRGUIHandler());
IBehaviorDispenseItem behavior = new BehaviorDispenseSafariNet();
BlockDispenser.dispenseBehaviorRegistry.putObject(safariNetItem, behavior);
BlockDispenser.dispenseBehaviorRegistry.putObject(safariNetSingleItem, behavior);
// Work around to make the below behavior actually /exist/ before the server starts.
DispenserBehaviors.func_96467_a();
behavior = (IBehaviorDispenseItem) BlockDispenser.dispenseBehaviorRegistry.func_82594_a(Item.bucketWater);
BlockDispenser.dispenseBehaviorRegistry.putObject(sewageBucketItem, behavior);
BlockDispenser.dispenseBehaviorRegistry.putObject(sludgeBucketItem, behavior);
BlockDispenser.dispenseBehaviorRegistry.putObject(mobEssenceBucketItem, behavior);
BlockDispenser.dispenseBehaviorRegistry.putObject(bioFuelBucketItem, behavior);
BlockDispenser.dispenseBehaviorRegistry.putObject(meatBucketItem, behavior);
BlockDispenser.dispenseBehaviorRegistry.putObject(pinkSlimeBucketItem, behavior);
BlockDispenser.dispenseBehaviorRegistry.putObject(chocolateMilkBucketItem, behavior);
BlockDispenser.dispenseBehaviorRegistry.putObject(mushroomSoupBucketItem, behavior);
ChestGenHooks.getInfo(ChestGenHooks.DUNGEON_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(safariNetSingleItem), 1, 1, 25));
ChestGenHooks.getInfo(ChestGenHooks.MINESHAFT_CORRIDOR).addItem(new WeightedRandomChestContent(new ItemStack(safariNetSingleItem), 1, 1, 25));
ChestGenHooks.getInfo(ChestGenHooks.PYRAMID_DESERT_CHEST).addItem(new WeightedRandomChestContent(new ItemStack(safariNetSingleItem), 1, 1, 25));
VillagerRegistry.instance().registerVillageCreationHandler(new VillageCreationHandler());
VillagerRegistry.instance().registerVillagerType(MFRConfig.zoolologistEntityId.getInt(), villagerFolder + "zoologist.png");
VillagerRegistry.instance().registerVillageTradeHandler(MFRConfig.zoolologistEntityId.getInt(), new VillageTradeHandler());
GameRegistry.registerWorldGenerator(new MineFactoryReloadedWorldGen());
TickRegistry.registerScheduledTickHandler(new UpdateManager(this), Side.CLIENT);
}
use of powercrystals.minefactoryreloaded.block.BlockFactoryGlassPane in project MineFactoryReloaded by powercrystals.
the class FactoryGlassPaneRenderer method renderInventoryBlock.
@Override
public void renderInventoryBlock(Block tile, int metadata, int modelID, RenderBlocks renderer) {
BlockFactoryGlassPane block = (BlockFactoryGlassPane) tile;
Tessellator tessellator = Tessellator.instance;
int color = block.getRenderColor(metadata);
float red = (color >> 16 & 255) / 255.0F;
float green = (color >> 8 & 255) / 255.0F;
float blue = (color & 255) / 255.0F;
if (EntityRenderer.anaglyphEnable) {
float anaglyphRed = (red * 30.0F + green * 59.0F + blue * 11.0F) / 100.0F;
float anaglyphGreen = (red * 30.0F + green * 70.0F) / 100.0F;
float anaglyphBlue = (red * 30.0F + blue * 70.0F) / 100.0F;
red = anaglyphRed;
green = anaglyphGreen;
blue = anaglyphBlue;
}
Icon iconGlass, iconStreaks, iconSide, iconOverlay;
iconGlass = block.getIcon(0, metadata);
iconStreaks = block.getIcon(0, 16 | metadata);
iconSide = block.getSideTextureIndex();
iconOverlay = block.getBlockOverlayTexture();
double minXGlass = iconGlass.getMinU();
double maxXGlass = iconGlass.getMaxU();
double minYGlass = iconGlass.getMinV();
double maxYGlass = iconGlass.getMaxV();
double minXStreaks = iconStreaks.getMinU();
double maxXStreaks = iconStreaks.getMaxU();
double minYStreaks = iconStreaks.getMinV();
double maxYStreaks = iconStreaks.getMaxV();
double minXSide = iconSide.getInterpolatedU(7.0D);
double maxXSide = iconSide.getInterpolatedU(9.0D);
double minYSide = iconSide.getMinV();
double maxYSide = iconSide.getMaxV();
double minXOverlay = iconOverlay.getMinU();
double maxXOverlay = iconOverlay.getMaxU();
double minYOverlay = iconOverlay.getMinV();
double maxYOverlay = iconOverlay.getMaxV();
double offset = 0.001D;
double xMin = 0, xMax = 1;
double yMin = 0, yMax = 1;
double zMid = 0.5;
double negSideXOffset = zMid - 0.0625D;
double posSideXOffset = zMid + 0.0625D;
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
tessellator.startDrawingQuads();
tessellator.setColorOpaque_F(red, green, blue);
tessellator.addVertexWithUV(xMin, yMax, zMid, minXGlass, minYGlass);
tessellator.addVertexWithUV(xMin, yMin, zMid, minXGlass, maxYGlass);
tessellator.addVertexWithUV(xMax, yMin, zMid, maxXGlass, maxYGlass);
tessellator.addVertexWithUV(xMax, yMax, zMid, maxXGlass, minYGlass);
tessellator.setColorOpaque_F(1, 1, 1);
tessellator.addVertexWithUV(xMin, yMax, zMid, minXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMin, yMin, zMid, minXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMax, yMin, zMid, maxXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMax, yMax, zMid, maxXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMin, yMax, zMid, minXOverlay, minYOverlay);
tessellator.addVertexWithUV(xMin, yMin, zMid, minXOverlay, maxYOverlay);
tessellator.addVertexWithUV(xMax, yMin, zMid, maxXOverlay, maxYOverlay);
tessellator.addVertexWithUV(xMax, yMax, zMid, maxXOverlay, minYOverlay);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorOpaque_F(1, 1, 1);
tessellator.addVertexWithUV(xMin, yMax, negSideXOffset, minXSide, minYSide);
tessellator.addVertexWithUV(xMin, yMin, negSideXOffset, minXSide, maxYSide);
tessellator.addVertexWithUV(xMin, yMin, posSideXOffset, maxXSide, maxYSide);
tessellator.addVertexWithUV(xMin, yMax, posSideXOffset, maxXSide, minYSide);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorOpaque_F(1, 1, 1);
tessellator.addVertexWithUV(xMax, yMax, negSideXOffset, minXSide, minYSide);
tessellator.addVertexWithUV(xMax, yMin, negSideXOffset, minXSide, maxYSide);
tessellator.addVertexWithUV(xMax, yMin, posSideXOffset, maxXSide, maxYSide);
tessellator.addVertexWithUV(xMax, yMax, posSideXOffset, maxXSide, minYSide);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorOpaque_F(1, 1, 1);
tessellator.addVertexWithUV(xMin, yMax + offset, posSideXOffset, maxXSide, maxYSide);
tessellator.addVertexWithUV(xMax, yMax + offset, posSideXOffset, maxXSide, minYSide);
tessellator.addVertexWithUV(xMax, yMax + offset, negSideXOffset, minXSide, minYSide);
tessellator.addVertexWithUV(xMin, yMax + offset, negSideXOffset, minXSide, maxYSide);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setColorOpaque_F(1, 1, 1);
tessellator.addVertexWithUV(xMin, yMin - offset, posSideXOffset, maxXSide, maxYSide);
tessellator.addVertexWithUV(xMax, yMin - offset, posSideXOffset, maxXSide, minYSide);
tessellator.addVertexWithUV(xMax, yMin - offset, negSideXOffset, minXSide, minYSide);
tessellator.addVertexWithUV(xMin, yMin - offset, negSideXOffset, minXSide, maxYSide);
tessellator.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
use of powercrystals.minefactoryreloaded.block.BlockFactoryGlassPane in project MineFactoryReloaded by powercrystals.
the class FactoryGlassPaneRenderer method renderWorldBlock.
@Override
public boolean renderWorldBlock(IBlockAccess blockAccess, int x, int y, int z, Block tile, int modelId, RenderBlocks renderer) {
BlockFactoryGlassPane block = (BlockFactoryGlassPane) tile;
int worldHeight = blockAccess.getHeight();
int metadata = blockAccess.getBlockMetadata(x, y, z);
Tessellator tessellator = Tessellator.instance;
tessellator.setBrightness(tile.getMixedBrightnessForBlock(blockAccess, x, y, z));
int color = block.getRenderColor(metadata);
float red = (color >> 16 & 255) / 255.0F;
float green = (color >> 8 & 255) / 255.0F;
float blue = (color & 255) / 255.0F;
if (EntityRenderer.anaglyphEnable) {
float anaglyphRed = (red * 30.0F + green * 59.0F + blue * 11.0F) / 100.0F;
float anaglyphGreen = (red * 30.0F + green * 70.0F) / 100.0F;
float anaglyphBlue = (red * 30.0F + blue * 70.0F) / 100.0F;
red = anaglyphRed;
green = anaglyphGreen;
blue = anaglyphBlue;
}
Icon iconGlass, iconStreaks, iconSide, iconOverlaySouth, iconOverlayWest;
if (renderer.hasOverrideBlockTexture()) {
iconGlass = iconStreaks = iconSide = iconOverlaySouth = iconOverlayWest = renderer.overrideBlockTexture;
} else {
iconGlass = block.getIcon(0, metadata);
iconStreaks = block.getIcon(0, 16 | metadata);
iconSide = block.getSideTextureIndex();
iconOverlaySouth = block.getBlockOverlayTexture(blockAccess, x, y, z, 2);
iconOverlayWest = block.getBlockOverlayTexture(blockAccess, x, y, z, 5);
}
double minXGlass = iconGlass.getMinU();
double midXGlass = iconGlass.getInterpolatedU(8.0D);
double maxXGlass = iconGlass.getMaxU();
double minYGlass = iconGlass.getMinV();
double maxYGlass = iconGlass.getMaxV();
double minXStreaks = iconStreaks.getMinU();
double midXStreaks = iconStreaks.getInterpolatedU(8.0D);
double maxXStreaks = iconStreaks.getMaxU();
double minYStreaks = iconStreaks.getMinV();
double maxYStreaks = iconStreaks.getMaxV();
double minXSide = iconSide.getInterpolatedU(7.0D);
double maxXSide = iconSide.getInterpolatedU(9.0D);
double minYSide = iconSide.getMinV();
double midYSide = iconSide.getInterpolatedV(8.0D);
double maxYSide = iconSide.getMaxV();
double minXSouth = iconOverlaySouth.getMinU();
double midXSouth = iconOverlaySouth.getInterpolatedU(8.0D);
double maxXSouth = iconOverlaySouth.getMaxU();
double minYSouth = iconOverlaySouth.getMinV();
double maxYSouth = iconOverlaySouth.getMaxV();
double minXWest = iconOverlayWest.getMinU();
double midXWest = iconOverlayWest.getInterpolatedU(8.0D);
double maxXWest = iconOverlayWest.getMaxU();
double minYWest = iconOverlayWest.getMinV();
double maxYWest = iconOverlayWest.getMaxV();
double xMin = x;
double xMid = x + 0.5D;
double xMax = x + 1;
double zMin = z;
double zMid = z + 0.5D;
double zMax = z + 1;
double yMin = y;
double yMax = y + 1;
double vertSideZOffset = 0.001D;
double vertSideXOffset = 0.002D;
double negSideZOffset = xMid - 0.0625D;
double posSideZOffset = xMid + 0.0625D;
double negSideXOffset = zMid - 0.0625D;
double posSideXOffset = zMid + 0.0625D;
boolean connectedNegZ = block.canThisFactoryPaneConnectToThisBlockID(blockAccess.getBlockId(x, y, z - 1));
boolean connectedPosZ = block.canThisFactoryPaneConnectToThisBlockID(blockAccess.getBlockId(x, y, z + 1));
boolean connectedNegX = block.canThisFactoryPaneConnectToThisBlockID(blockAccess.getBlockId(x - 1, y, z));
boolean connectedPosX = block.canThisFactoryPaneConnectToThisBlockID(blockAccess.getBlockId(x + 1, y, z));
boolean renderTop = y >= worldHeight || block.shouldSideBeRendered(blockAccess, x, y + 1, z, 1);
boolean renderBottom = y <= 0 || block.shouldSideBeRendered(blockAccess, x, y - 1, z, 0);
if ((!connectedNegX || !connectedPosX) && (connectedNegX || connectedPosX || connectedNegZ || connectedPosZ)) {
if (connectedNegX && !connectedPosX) {
tessellator.setColorOpaque_F(red, green, blue);
tessellator.addVertexWithUV(xMin, yMax, zMid, minXGlass, minYGlass);
tessellator.addVertexWithUV(xMin, yMin, zMid, minXGlass, maxYGlass);
tessellator.addVertexWithUV(xMid, yMin, zMid, midXGlass, maxYGlass);
tessellator.addVertexWithUV(xMid, yMax, zMid, midXGlass, minYGlass);
tessellator.setColorOpaque_F(1, 1, 1);
tessellator.addVertexWithUV(xMin, yMax, zMid, minXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMin, yMin, zMid, minXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMid, yMin, zMid, midXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMid, yMax, zMid, midXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMin, yMax, zMid, minXSouth, minYSouth);
tessellator.addVertexWithUV(xMin, yMin, zMid, minXSouth, maxYSouth);
tessellator.addVertexWithUV(xMid, yMin, zMid, midXSouth, maxYSouth);
tessellator.addVertexWithUV(xMid, yMax, zMid, midXSouth, minYSouth);
if (!connectedPosZ && !connectedNegZ) {
tessellator.addVertexWithUV(xMid, yMax, posSideXOffset, minXSide, minYSide);
tessellator.addVertexWithUV(xMid, yMin, posSideXOffset, minXSide, maxYSide);
tessellator.addVertexWithUV(xMid, yMin, negSideXOffset, maxXSide, maxYSide);
tessellator.addVertexWithUV(xMid, yMax, negSideXOffset, maxXSide, minYSide);
}
if (renderTop) {
tessellator.addVertexWithUV(xMin, yMax + vertSideXOffset, posSideXOffset, maxXSide, midYSide);
tessellator.addVertexWithUV(xMid, yMax + vertSideXOffset, posSideXOffset, maxXSide, maxYSide);
tessellator.addVertexWithUV(xMid, yMax + vertSideXOffset, negSideXOffset, minXSide, maxYSide);
tessellator.addVertexWithUV(xMin, yMax + vertSideXOffset, negSideXOffset, minXSide, midYSide);
}
if (renderBottom) {
tessellator.addVertexWithUV(xMin, yMin - vertSideXOffset, posSideXOffset, maxXSide, midYSide);
tessellator.addVertexWithUV(xMid, yMin - vertSideXOffset, posSideXOffset, maxXSide, maxYSide);
tessellator.addVertexWithUV(xMid, yMin - vertSideXOffset, negSideXOffset, minXSide, maxYSide);
tessellator.addVertexWithUV(xMin, yMin - vertSideXOffset, negSideXOffset, minXSide, midYSide);
}
} else if (!connectedNegX && connectedPosX) {
tessellator.setColorOpaque_F(red, green, blue);
tessellator.addVertexWithUV(xMid, yMax, zMid, midXGlass, minYGlass);
tessellator.addVertexWithUV(xMid, yMin, zMid, midXGlass, maxYGlass);
tessellator.addVertexWithUV(xMax, yMin, zMid, maxXGlass, maxYGlass);
tessellator.addVertexWithUV(xMax, yMax, zMid, maxXGlass, minYGlass);
tessellator.setColorOpaque_F(1, 1, 1);
tessellator.addVertexWithUV(xMid, yMax, zMid, midXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMid, yMin, zMid, midXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMax, yMin, zMid, maxXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMax, yMax, zMid, maxXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMid, yMax, zMid, midXSouth, minYSouth);
tessellator.addVertexWithUV(xMid, yMin, zMid, midXSouth, maxYSouth);
tessellator.addVertexWithUV(xMax, yMin, zMid, maxXSouth, maxYSouth);
tessellator.addVertexWithUV(xMax, yMax, zMid, maxXSouth, minYSouth);
if (!connectedPosZ && !connectedNegZ) {
tessellator.addVertexWithUV(xMid, yMax, negSideXOffset, minXSide, minYSide);
tessellator.addVertexWithUV(xMid, yMin, negSideXOffset, minXSide, maxYSide);
tessellator.addVertexWithUV(xMid, yMin, posSideXOffset, maxXSide, maxYSide);
tessellator.addVertexWithUV(xMid, yMax, posSideXOffset, maxXSide, minYSide);
}
if (renderTop) {
tessellator.addVertexWithUV(xMid, yMax + vertSideXOffset, posSideXOffset, maxXSide, minYSide);
tessellator.addVertexWithUV(xMax, yMax + vertSideXOffset, posSideXOffset, maxXSide, midYSide);
tessellator.addVertexWithUV(xMax, yMax + vertSideXOffset, negSideXOffset, minXSide, midYSide);
tessellator.addVertexWithUV(xMid, yMax + vertSideXOffset, negSideXOffset, minXSide, minYSide);
}
if (renderBottom) {
tessellator.addVertexWithUV(xMid, yMin - vertSideXOffset, posSideXOffset, maxXSide, minYSide);
tessellator.addVertexWithUV(xMax, yMin - vertSideXOffset, posSideXOffset, maxXSide, midYSide);
tessellator.addVertexWithUV(xMax, yMin - vertSideXOffset, negSideXOffset, minXSide, midYSide);
tessellator.addVertexWithUV(xMid, yMin - vertSideXOffset, negSideXOffset, minXSide, minYSide);
}
}
} else {
tessellator.setColorOpaque_F(red, green, blue);
tessellator.addVertexWithUV(xMin, yMax, zMid, minXGlass, minYGlass);
tessellator.addVertexWithUV(xMin, yMin, zMid, minXGlass, maxYGlass);
tessellator.addVertexWithUV(xMax, yMin, zMid, maxXGlass, maxYGlass);
tessellator.addVertexWithUV(xMax, yMax, zMid, maxXGlass, minYGlass);
tessellator.setColorOpaque_F(1, 1, 1);
tessellator.addVertexWithUV(xMin, yMax, zMid, minXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMin, yMin, zMid, minXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMax, yMin, zMid, maxXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMax, yMax, zMid, maxXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMin, yMax, zMid, minXSouth, minYSouth);
tessellator.addVertexWithUV(xMin, yMin, zMid, minXSouth, maxYSouth);
tessellator.addVertexWithUV(xMax, yMin, zMid, maxXSouth, maxYSouth);
tessellator.addVertexWithUV(xMax, yMax, zMid, maxXSouth, minYSouth);
if (!connectedPosX && !connectedNegX) {
tessellator.addVertexWithUV(xMin, yMax, negSideXOffset, minXSide, minYSide);
tessellator.addVertexWithUV(xMin, yMin, negSideXOffset, minXSide, maxYSide);
tessellator.addVertexWithUV(xMin, yMin, posSideXOffset, maxXSide, maxYSide);
tessellator.addVertexWithUV(xMin, yMax, posSideXOffset, maxXSide, minYSide);
tessellator.addVertexWithUV(xMax, yMax, negSideXOffset, minXSide, minYSide);
tessellator.addVertexWithUV(xMax, yMin, negSideXOffset, minXSide, maxYSide);
tessellator.addVertexWithUV(xMax, yMin, posSideXOffset, maxXSide, maxYSide);
tessellator.addVertexWithUV(xMax, yMax, posSideXOffset, maxXSide, minYSide);
}
if (renderTop) {
tessellator.addVertexWithUV(xMin, yMax + vertSideXOffset, posSideXOffset, maxXSide, maxYSide);
tessellator.addVertexWithUV(xMax, yMax + vertSideXOffset, posSideXOffset, maxXSide, minYSide);
tessellator.addVertexWithUV(xMax, yMax + vertSideXOffset, negSideXOffset, minXSide, minYSide);
tessellator.addVertexWithUV(xMin, yMax + vertSideXOffset, negSideXOffset, minXSide, maxYSide);
}
if (renderBottom) {
tessellator.addVertexWithUV(xMin, yMin - vertSideXOffset, posSideXOffset, maxXSide, maxYSide);
tessellator.addVertexWithUV(xMax, yMin - vertSideXOffset, posSideXOffset, maxXSide, minYSide);
tessellator.addVertexWithUV(xMax, yMin - vertSideXOffset, negSideXOffset, minXSide, minYSide);
tessellator.addVertexWithUV(xMin, yMin - vertSideXOffset, negSideXOffset, minXSide, maxYSide);
}
}
if ((!connectedNegZ || !connectedPosZ) && (connectedNegX || connectedPosX || connectedNegZ || connectedPosZ)) {
if (connectedNegZ && !connectedPosZ) {
tessellator.setColorOpaque_F(red, green, blue);
tessellator.addVertexWithUV(xMid, yMax, zMin, minXGlass, minYGlass);
tessellator.addVertexWithUV(xMid, yMin, zMin, minXGlass, maxYGlass);
tessellator.addVertexWithUV(xMid, yMin, zMid, midXGlass, maxYGlass);
tessellator.addVertexWithUV(xMid, yMax, zMid, midXGlass, minYGlass);
tessellator.setColorOpaque_F(1, 1, 1);
tessellator.addVertexWithUV(xMid, yMax, zMin, minXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMid, yMin, zMin, minXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMid, yMin, zMid, midXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMid, yMax, zMid, midXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMid, yMax, zMin, minXWest, minYWest);
tessellator.addVertexWithUV(xMid, yMin, zMin, minXWest, maxYWest);
tessellator.addVertexWithUV(xMid, yMin, zMid, midXWest, maxYWest);
tessellator.addVertexWithUV(xMid, yMax, zMid, midXWest, minYWest);
if (!connectedPosX && !connectedNegX) {
tessellator.addVertexWithUV(negSideZOffset, yMax, zMid, minXSide, minYSide);
tessellator.addVertexWithUV(negSideZOffset, yMin, zMid, minXSide, maxYSide);
tessellator.addVertexWithUV(posSideZOffset, yMin, zMid, maxXSide, maxYSide);
tessellator.addVertexWithUV(posSideZOffset, yMax, zMid, maxXSide, minYSide);
}
if (renderTop) {
tessellator.addVertexWithUV(negSideZOffset, yMax + vertSideZOffset, zMin, maxXSide, minYSide);
tessellator.addVertexWithUV(negSideZOffset, yMax + vertSideZOffset, zMid, maxXSide, midYSide);
tessellator.addVertexWithUV(posSideZOffset, yMax + vertSideZOffset, zMid, minXSide, midYSide);
tessellator.addVertexWithUV(posSideZOffset, yMax + vertSideZOffset, zMin, minXSide, minYSide);
}
if (renderBottom) {
tessellator.addVertexWithUV(negSideZOffset, yMin - vertSideZOffset, zMin, maxXSide, minYSide);
tessellator.addVertexWithUV(negSideZOffset, yMin - vertSideZOffset, zMid, maxXSide, midYSide);
tessellator.addVertexWithUV(posSideZOffset, yMin - vertSideZOffset, zMid, minXSide, midYSide);
tessellator.addVertexWithUV(posSideZOffset, yMin - vertSideZOffset, zMin, minXSide, minYSide);
}
} else if (!connectedNegZ && connectedPosZ) {
tessellator.setColorOpaque_F(red, green, blue);
tessellator.addVertexWithUV(xMid, yMax, zMid, midXGlass, minYGlass);
tessellator.addVertexWithUV(xMid, yMin, zMid, midXGlass, maxYGlass);
tessellator.addVertexWithUV(xMid, yMin, zMax, maxXGlass, maxYGlass);
tessellator.addVertexWithUV(xMid, yMax, zMax, maxXGlass, minYGlass);
tessellator.setColorOpaque_F(1, 1, 1);
tessellator.addVertexWithUV(xMid, yMax, zMid, midXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMid, yMin, zMid, midXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMid, yMin, zMax, maxXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMid, yMax, zMax, maxXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMid, yMax, zMid, midXWest, minYWest);
tessellator.addVertexWithUV(xMid, yMin, zMid, midXWest, maxYWest);
tessellator.addVertexWithUV(xMid, yMin, zMax, maxXWest, maxYWest);
tessellator.addVertexWithUV(xMid, yMax, zMax, maxXWest, minYWest);
if (!connectedPosX && !connectedNegX) {
tessellator.addVertexWithUV(posSideZOffset, yMax, zMid, minXSide, minYSide);
tessellator.addVertexWithUV(posSideZOffset, yMin, zMid, minXSide, maxYSide);
tessellator.addVertexWithUV(negSideZOffset, yMin, zMid, maxXSide, maxYSide);
tessellator.addVertexWithUV(negSideZOffset, yMax, zMid, maxXSide, minYSide);
}
if (renderTop) {
tessellator.addVertexWithUV(negSideZOffset, yMax + vertSideZOffset, zMid, minXSide, midYSide);
tessellator.addVertexWithUV(negSideZOffset, yMax + vertSideZOffset, zMax, minXSide, maxYSide);
tessellator.addVertexWithUV(posSideZOffset, yMax + vertSideZOffset, zMax, maxXSide, maxYSide);
tessellator.addVertexWithUV(posSideZOffset, yMax + vertSideZOffset, zMid, maxXSide, midYSide);
}
if (renderBottom) {
tessellator.addVertexWithUV(negSideZOffset, yMin - vertSideZOffset, zMid, minXSide, midYSide);
tessellator.addVertexWithUV(negSideZOffset, yMin - vertSideZOffset, zMax, minXSide, maxYSide);
tessellator.addVertexWithUV(posSideZOffset, yMin - vertSideZOffset, zMax, maxXSide, maxYSide);
tessellator.addVertexWithUV(posSideZOffset, yMin - vertSideZOffset, zMid, maxXSide, midYSide);
}
}
} else {
tessellator.setColorOpaque_F(red, green, blue);
tessellator.addVertexWithUV(xMid, yMax, zMin, minXGlass, minYGlass);
tessellator.addVertexWithUV(xMid, yMin, zMin, minXGlass, maxYGlass);
tessellator.addVertexWithUV(xMid, yMin, zMax, maxXGlass, maxYGlass);
tessellator.addVertexWithUV(xMid, yMax, zMax, maxXGlass, minYGlass);
tessellator.setColorOpaque_F(1, 1, 1);
tessellator.addVertexWithUV(xMid, yMax, zMin, minXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMid, yMin, zMin, minXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMid, yMin, zMax, maxXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMid, yMax, zMax, maxXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMid, yMax, zMin, minXWest, minYWest);
tessellator.addVertexWithUV(xMid, yMin, zMin, minXWest, maxYWest);
tessellator.addVertexWithUV(xMid, yMin, zMax, maxXWest, maxYWest);
tessellator.addVertexWithUV(xMid, yMax, zMax, maxXWest, minYWest);
if (!connectedPosZ && !connectedNegZ) {
tessellator.addVertexWithUV(negSideZOffset, yMax, zMin, minXSide, minYSide);
tessellator.addVertexWithUV(negSideZOffset, yMin, zMin, minXSide, maxYSide);
tessellator.addVertexWithUV(posSideZOffset, yMin, zMin, maxXSide, maxYSide);
tessellator.addVertexWithUV(posSideZOffset, yMax, zMin, maxXSide, minYSide);
tessellator.addVertexWithUV(posSideZOffset, yMax, zMax, minXSide, minYSide);
tessellator.addVertexWithUV(posSideZOffset, yMin, zMax, minXSide, maxYSide);
tessellator.addVertexWithUV(negSideZOffset, yMin, zMax, maxXSide, maxYSide);
tessellator.addVertexWithUV(negSideZOffset, yMax, zMax, maxXSide, minYSide);
}
if (renderTop) {
tessellator.addVertexWithUV(posSideZOffset, yMax + vertSideZOffset, zMax, maxXSide, maxYSide);
tessellator.addVertexWithUV(posSideZOffset, yMax + vertSideZOffset, zMin, maxXSide, minYSide);
tessellator.addVertexWithUV(negSideZOffset, yMax + vertSideZOffset, zMin, minXSide, minYSide);
tessellator.addVertexWithUV(negSideZOffset, yMax + vertSideZOffset, zMax, minXSide, maxYSide);
}
// TODO: fix slightly awkward rendering when pane on top/bottom doesn't connect on both sides
if (renderBottom) {
tessellator.addVertexWithUV(posSideZOffset, yMin - vertSideZOffset, zMax, maxXSide, maxYSide);
tessellator.addVertexWithUV(posSideZOffset, yMin - vertSideZOffset, zMin, maxXSide, minYSide);
tessellator.addVertexWithUV(negSideZOffset, yMin - vertSideZOffset, zMin, minXSide, minYSide);
tessellator.addVertexWithUV(negSideZOffset, yMin - vertSideZOffset, zMax, minXSide, maxYSide);
}
}
return true;
}
use of powercrystals.minefactoryreloaded.block.BlockFactoryGlassPane in project MineFactoryReloaded by powercrystals.
the class FactoryGlassPaneItemRenderer method renderItem.
@SuppressWarnings("deprecation")
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
RenderEngine renderEngine = Minecraft.getMinecraft().renderEngine;
RenderBlocks renderer = (RenderBlocks) data[0];
BlockFactoryGlassPane pane = (BlockFactoryGlassPane) Block.blocksList[((ItemBlock) item.getItem()).getBlockID()];
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_CULL_FACE);
Tessellator tessellator = Tessellator.instance;
if (type == ItemRenderType.INVENTORY) {
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(16f, 16f, 16f);
GL11.glTranslatef(0.5f, 0.5f, 0.5f);
RenderingRegistry.instance().renderInventoryBlock(renderer, pane, item.getItemDamage(), MineFactoryReloadedCore.renderIdFactoryGlassPane);
GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
GL11.glScalef(1 / 16f, 1 / 16f, 1 / 16f);
if (item.hasEffect()) {
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glDepthFunc(GL11.GL_GREATER);
GL11.glDepthMask(false);
renderEngine.bindTexture("%blur%/misc/glint.png");
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_DST_COLOR);
GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F);
GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE);
float f = 0.00390625F;
float f1 = 0.00390625F;
float f2 = Minecraft.getSystemTime() % (3000 + 0 * 1873) / (3000.0F + 0 * 1873) * 256.0F;
float f3 = 0.0F;
float f4 = 4.0F;
tessellator.startDrawingQuads();
tessellator.addVertexWithUV(0, 16, -50, (f2 + 16 * f4) * f, (f3 + 16) * f1);
tessellator.addVertexWithUV(16, 16, -50, (f2 + 16 + 16 * f4) * f, (f3 + 16) * f1);
tessellator.addVertexWithUV(16, 0, -50, (f2 + 16) * f, (f3 + 0.0F) * f1);
tessellator.addVertexWithUV(0, 0, -50, (f2 + 0.0F) * f, (f3 + 0.0F) * f1);
tessellator.draw();
f2 = Minecraft.getSystemTime() % (3000 + 1 * 1873) / (3000.0F + 1 * 1873) * 256.0F;
f4 = -1.0F;
tessellator.startDrawingQuads();
tessellator.addVertexWithUV(0, 16, -50, (f2 + 16 * f4) * f, (f3 + 16) * f1);
tessellator.addVertexWithUV(16, 16, -50, (f2 + 16 + 16 * f4) * f, (f3 + 16) * f1);
tessellator.addVertexWithUV(16, 0, -50, (f2 + 16) * f, (f3 + 0.0F) * f1);
tessellator.addVertexWithUV(0, 0, -50, (f2 + 0.0F) * f, (f3 + 0.0F) * f1);
tessellator.draw();
GL11.glDisable(GL11.GL_BLEND);
GL11.glDepthMask(true);
GL11.glDepthFunc(GL11.GL_LEQUAL);
}
GL11.glEnable(GL11.GL_LIGHTING);
} else {
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
switch(type) {
case EQUIPPED_FIRST_PERSON:
case EQUIPPED:
GL11.glTranslatef(10 / 16f, 7 / 16f, 0f);
break;
case ENTITY:
GL11.glScalef(0.75f, 0.75f, 0.75f);
GL11.glTranslatef(0f, 4 / 16f, 0f);
break;
default:
}
RenderingRegistry.instance().renderInventoryBlock(renderer, pane, item.getItemDamage(), MineFactoryReloadedCore.renderIdFactoryGlassPane);
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
}
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glPopMatrix();
}
Aggregations