use of powercrystals.minefactoryreloaded.block.BlockFactoryGlass 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.BlockFactoryGlass in project MineFactoryReloaded by powercrystals.
the class FactoryGlassRenderer method renderWorldBlock.
@Override
public boolean renderWorldBlock(IBlockAccess blockAccess, int x, int y, int z, Block tile, int modelId, RenderBlocks renderer) {
if (renderer.hasOverrideBlockTexture()) {
// usually: block is being broken
renderer.renderFaceYNeg(tile, x, y, z, null);
renderer.renderFaceYPos(tile, x, y, z, null);
renderer.renderFaceZNeg(tile, x, y, z, null);
renderer.renderFaceZPos(tile, x, y, z, null);
renderer.renderFaceXNeg(tile, x, y, z, null);
renderer.renderFaceXPos(tile, x, y, z, null);
return true;
}
BlockFactoryGlass block = (BlockFactoryGlass) tile;
int worldHeight = blockAccess.getHeight();
int metadata = blockAccess.getBlockMetadata(x, y, z);
Tessellator tessellator = Tessellator.instance;
tessellator.setBrightness(block.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, iconOverlayTop, iconOverlaySouth, iconOverlayWest;
iconGlass = block.getIcon(0, metadata);
iconStreaks = block.getIcon(0, 16 | metadata);
iconOverlayTop = block.getBlockOverlayTexture(blockAccess, x, y, z, 1);
iconOverlaySouth = block.getBlockOverlayTexture(blockAccess, x, y, z, 2);
iconOverlayWest = block.getBlockOverlayTexture(blockAccess, x, y, z, 5);
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 minXSouth = iconOverlaySouth.getMinU();
double maxXSouth = iconOverlaySouth.getMaxU();
double minYSouth = iconOverlaySouth.getMinV();
double maxYSouth = iconOverlaySouth.getMaxV();
double minXWest = iconOverlayWest.getMinU();
double maxXWest = iconOverlayWest.getMaxU();
double minYWest = iconOverlayWest.getMinV();
double maxYWest = iconOverlayWest.getMaxV();
double minXTop = iconOverlayTop.getMinU();
double maxXTop = iconOverlayTop.getMaxU();
double minYTop = iconOverlayTop.getMinV();
double maxYTop = iconOverlayTop.getMaxV();
double xMin = x, xMax = x + 1;
double yMin = y, yMax = y + 1;
double zMin = z, zMax = z + 1;
boolean renderAll = renderer.renderAllFaces;
boolean[] renderSide = { renderAll || y <= 0 || block.shouldSideBeRendered(blockAccess, x, y - 1, z, 0), renderAll || y >= worldHeight || block.shouldSideBeRendered(blockAccess, x, y + 1, z, 1), renderAll || block.shouldSideBeRendered(blockAccess, x, y, z - 1, 2), renderAll || block.shouldSideBeRendered(blockAccess, x, y, z + 1, 3), renderAll || block.shouldSideBeRendered(blockAccess, x - 1, y, z, 4), renderAll || block.shouldSideBeRendered(blockAccess, x + 1, y, z, 5) };
if (renderSide[1]) {
// UP
tessellator.setColorOpaque_F(red, green, blue);
tessellator.addVertexWithUV(xMin, yMax, zMin, minXGlass, minYGlass);
tessellator.addVertexWithUV(xMin, yMax, zMax, minXGlass, maxYGlass);
tessellator.addVertexWithUV(xMax, yMax, zMax, maxXGlass, maxYGlass);
tessellator.addVertexWithUV(xMax, yMax, zMin, maxXGlass, minYGlass);
tessellator.setColorOpaque_F(1, 1, 1);
tessellator.addVertexWithUV(xMin, yMax, zMin, minXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMin, yMax, zMax, minXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMax, yMax, zMax, maxXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMax, yMax, zMin, maxXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMin, yMax, zMin, minXTop, minYTop);
tessellator.addVertexWithUV(xMin, yMax, zMax, minXTop, maxYTop);
tessellator.addVertexWithUV(xMax, yMax, zMax, maxXTop, maxYTop);
tessellator.addVertexWithUV(xMax, yMax, zMin, maxXTop, minYTop);
}
if (renderSide[0]) {
// DOWN
tessellator.setColorOpaque_F(red, green, blue);
tessellator.addVertexWithUV(xMin, yMin, zMax, minXGlass, maxYGlass);
tessellator.addVertexWithUV(xMin, yMin, zMin, minXGlass, minYGlass);
tessellator.addVertexWithUV(xMax, yMin, zMin, maxXGlass, minYGlass);
tessellator.addVertexWithUV(xMax, yMin, zMax, maxXGlass, maxYGlass);
tessellator.setColorOpaque_F(1, 1, 1);
tessellator.addVertexWithUV(xMin, yMin, zMax, minXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMin, yMin, zMin, minXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMax, yMin, zMin, maxXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMax, yMin, zMax, maxXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMin, yMin, zMax, minXTop, maxYTop);
tessellator.addVertexWithUV(xMin, yMin, zMin, minXTop, minYTop);
tessellator.addVertexWithUV(xMax, yMin, zMin, maxXTop, minYTop);
tessellator.addVertexWithUV(xMax, yMin, zMax, maxXTop, maxYTop);
}
if (renderSide[2]) {
tessellator.setColorOpaque_F(red, green, blue);
tessellator.addVertexWithUV(xMax, yMax, zMin, maxXGlass, minYGlass);
tessellator.addVertexWithUV(xMax, yMin, zMin, maxXGlass, maxYGlass);
tessellator.addVertexWithUV(xMin, yMin, zMin, minXGlass, maxYGlass);
tessellator.addVertexWithUV(xMin, yMax, zMin, minXGlass, minYGlass);
tessellator.setColorOpaque_F(1, 1, 1);
tessellator.addVertexWithUV(xMax, yMax, zMin, maxXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMax, yMin, zMin, maxXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMin, yMin, zMin, minXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMin, yMax, zMin, minXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMax, yMax, zMin, maxXSouth, minYSouth);
tessellator.addVertexWithUV(xMax, yMin, zMin, maxXSouth, maxYSouth);
tessellator.addVertexWithUV(xMin, yMin, zMin, minXSouth, maxYSouth);
tessellator.addVertexWithUV(xMin, yMax, zMin, minXSouth, minYSouth);
}
if (renderSide[3]) {
tessellator.setColorOpaque_F(red, green, blue);
tessellator.addVertexWithUV(xMin, yMax, zMax, minXGlass, minYGlass);
tessellator.addVertexWithUV(xMin, yMin, zMax, minXGlass, maxYGlass);
tessellator.addVertexWithUV(xMax, yMin, zMax, maxXGlass, maxYGlass);
tessellator.addVertexWithUV(xMax, yMax, zMax, maxXGlass, minYGlass);
tessellator.setColorOpaque_F(1, 1, 1);
tessellator.addVertexWithUV(xMin, yMax, zMax, minXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMin, yMin, zMax, minXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMax, yMin, zMax, maxXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMax, yMax, zMax, maxXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMin, yMax, zMax, minXSouth, minYSouth);
tessellator.addVertexWithUV(xMin, yMin, zMax, minXSouth, maxYSouth);
tessellator.addVertexWithUV(xMax, yMin, zMax, maxXSouth, maxYSouth);
tessellator.addVertexWithUV(xMax, yMax, zMax, maxXSouth, minYSouth);
}
if (renderSide[4]) {
tessellator.setColorOpaque_F(red, green, blue);
tessellator.addVertexWithUV(xMin, yMin, zMax, maxXGlass, maxYGlass);
tessellator.addVertexWithUV(xMin, yMax, zMax, maxXGlass, minYGlass);
tessellator.addVertexWithUV(xMin, yMax, zMin, minXGlass, minYGlass);
tessellator.addVertexWithUV(xMin, yMin, zMin, minXGlass, maxYGlass);
tessellator.setColorOpaque_F(1, 1, 1);
tessellator.addVertexWithUV(xMin, yMin, zMax, maxXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMin, yMax, zMax, maxXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMin, yMax, zMin, minXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMin, yMin, zMin, minXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMin, yMin, zMax, maxXWest, maxYWest);
tessellator.addVertexWithUV(xMin, yMax, zMax, maxXWest, minYWest);
tessellator.addVertexWithUV(xMin, yMax, zMin, minXWest, minYWest);
tessellator.addVertexWithUV(xMin, yMin, zMin, minXWest, maxYWest);
}
if (renderSide[5]) {
tessellator.setColorOpaque_F(red, green, blue);
tessellator.addVertexWithUV(xMax, yMin, zMin, minXGlass, maxYGlass);
tessellator.addVertexWithUV(xMax, yMax, zMin, minXGlass, minYGlass);
tessellator.addVertexWithUV(xMax, yMax, zMax, maxXGlass, minYGlass);
tessellator.addVertexWithUV(xMax, yMin, zMax, maxXGlass, maxYGlass);
tessellator.setColorOpaque_F(1, 1, 1);
tessellator.addVertexWithUV(xMax, yMin, zMin, minXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMax, yMax, zMin, minXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMax, yMax, zMax, maxXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMax, yMin, zMax, maxXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMax, yMin, zMin, minXWest, maxYWest);
tessellator.addVertexWithUV(xMax, yMax, zMin, minXWest, minYWest);
tessellator.addVertexWithUV(xMax, yMax, zMax, maxXWest, minYWest);
tessellator.addVertexWithUV(xMax, yMin, zMax, maxXWest, maxYWest);
}
return true;
}
use of powercrystals.minefactoryreloaded.block.BlockFactoryGlass in project MineFactoryReloaded by powercrystals.
the class FactoryGlassRenderer method renderInventoryBlock.
@Override
public void renderInventoryBlock(Block tile, int metadata, int modelID, RenderBlocks renderer) {
BlockFactoryGlass block = (BlockFactoryGlass) 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, iconOverlay;
iconGlass = block.getIcon(0, metadata);
iconStreaks = block.getIcon(0, 16 | metadata);
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 minXOverlay = iconOverlay.getMinU();
double maxXOverlay = iconOverlay.getMaxU();
double minYOverlay = iconOverlay.getMinV();
double maxYOverlay = iconOverlay.getMaxV();
double xMin = 0, xMax = 1;
double yMin = 0, yMax = 1;
double zMin = 0, zMax = 1;
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, -1.0F, 0.0F);
tessellator.setColorOpaque_F(red, green, blue);
tessellator.addVertexWithUV(xMin, yMin, zMax, minXGlass, minYGlass);
tessellator.addVertexWithUV(xMin, yMin, zMin, minXGlass, maxYGlass);
tessellator.addVertexWithUV(xMax, yMin, zMin, maxXGlass, maxYGlass);
tessellator.addVertexWithUV(xMax, yMin, zMax, maxXGlass, minYGlass);
tessellator.setColorOpaque_F(1, 1, 1);
tessellator.addVertexWithUV(xMin, yMin, zMax, minXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMin, yMin, zMin, minXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMax, yMin, zMin, maxXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMax, yMin, zMax, maxXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMin, yMin, zMax, minXOverlay, minYOverlay);
tessellator.addVertexWithUV(xMin, yMin, zMin, minXOverlay, maxYOverlay);
tessellator.addVertexWithUV(xMax, yMin, zMin, maxXOverlay, maxYOverlay);
tessellator.addVertexWithUV(xMax, yMin, zMax, maxXOverlay, minYOverlay);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
tessellator.setColorOpaque_F(red, green, blue);
tessellator.addVertexWithUV(xMin, yMax, zMin, minXGlass, minYGlass);
tessellator.addVertexWithUV(xMin, yMax, zMax, minXGlass, maxYGlass);
tessellator.addVertexWithUV(xMax, yMax, zMax, maxXGlass, maxYGlass);
tessellator.addVertexWithUV(xMax, yMax, zMin, maxXGlass, minYGlass);
tessellator.setColorOpaque_F(1, 1, 1);
tessellator.addVertexWithUV(xMin, yMax, zMin, minXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMin, yMax, zMax, minXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMax, yMax, zMax, maxXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMax, yMax, zMin, maxXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMin, yMax, zMin, minXOverlay, minYOverlay);
tessellator.addVertexWithUV(xMin, yMax, zMax, minXOverlay, maxYOverlay);
tessellator.addVertexWithUV(xMax, yMax, zMax, maxXOverlay, maxYOverlay);
tessellator.addVertexWithUV(xMax, yMax, zMin, maxXOverlay, minYOverlay);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, -1.0F);
tessellator.setColorOpaque_F(red, green, blue);
tessellator.addVertexWithUV(xMax, yMax, zMin, minXGlass, minYGlass);
tessellator.addVertexWithUV(xMax, yMin, zMin, minXGlass, maxYGlass);
tessellator.addVertexWithUV(xMin, yMin, zMin, maxXGlass, maxYGlass);
tessellator.addVertexWithUV(xMin, yMax, zMin, maxXGlass, minYGlass);
tessellator.setColorOpaque_F(1, 1, 1);
tessellator.addVertexWithUV(xMax, yMax, zMin, minXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMax, yMin, zMin, minXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMin, yMin, zMin, maxXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMin, yMax, zMin, maxXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMax, yMax, zMin, minXOverlay, minYOverlay);
tessellator.addVertexWithUV(xMax, yMin, zMin, minXOverlay, maxYOverlay);
tessellator.addVertexWithUV(xMin, yMin, zMin, maxXOverlay, maxYOverlay);
tessellator.addVertexWithUV(xMin, yMax, zMin, maxXOverlay, minYOverlay);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 0.0F, 1.0F);
tessellator.setColorOpaque_F(red, green, blue);
tessellator.addVertexWithUV(xMin, yMax, zMax, minXGlass, minYGlass);
tessellator.addVertexWithUV(xMin, yMin, zMax, minXGlass, maxYGlass);
tessellator.addVertexWithUV(xMax, yMin, zMax, maxXGlass, maxYGlass);
tessellator.addVertexWithUV(xMax, yMax, zMax, maxXGlass, minYGlass);
tessellator.setColorOpaque_F(1, 1, 1);
tessellator.addVertexWithUV(xMin, yMax, zMax, minXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMin, yMin, zMax, minXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMax, yMin, zMax, maxXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMax, yMax, zMax, maxXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMin, yMax, zMax, minXOverlay, minYOverlay);
tessellator.addVertexWithUV(xMin, yMin, zMax, minXOverlay, maxYOverlay);
tessellator.addVertexWithUV(xMax, yMin, zMax, maxXOverlay, maxYOverlay);
tessellator.addVertexWithUV(xMax, yMax, zMax, maxXOverlay, minYOverlay);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(-1.0F, 0.0F, 0.0F);
tessellator.setColorOpaque_F(red, green, blue);
tessellator.addVertexWithUV(xMin, yMin, zMax, minXGlass, minYGlass);
tessellator.addVertexWithUV(xMin, yMax, zMax, minXGlass, maxYGlass);
tessellator.addVertexWithUV(xMin, yMax, zMin, maxXGlass, maxYGlass);
tessellator.addVertexWithUV(xMin, yMin, zMin, maxXGlass, minYGlass);
tessellator.setColorOpaque_F(1, 1, 1);
tessellator.addVertexWithUV(xMin, yMin, zMax, minXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMin, yMax, zMax, minXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMin, yMax, zMin, maxXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMin, yMin, zMin, maxXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMin, yMin, zMax, minXOverlay, minYOverlay);
tessellator.addVertexWithUV(xMin, yMax, zMax, minXOverlay, maxYOverlay);
tessellator.addVertexWithUV(xMin, yMax, zMin, maxXOverlay, maxYOverlay);
tessellator.addVertexWithUV(xMin, yMin, zMin, maxXOverlay, minYOverlay);
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(1.0F, 0.0F, 0.0F);
tessellator.setColorOpaque_F(red, green, blue);
tessellator.addVertexWithUV(xMax, yMin, zMin, minXGlass, minYGlass);
tessellator.addVertexWithUV(xMax, yMax, zMin, minXGlass, maxYGlass);
tessellator.addVertexWithUV(xMax, yMax, zMax, maxXGlass, maxYGlass);
tessellator.addVertexWithUV(xMax, yMin, zMax, maxXGlass, minYGlass);
tessellator.setColorOpaque_F(1, 1, 1);
tessellator.addVertexWithUV(xMax, yMin, zMin, minXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMax, yMax, zMin, minXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMax, yMax, zMax, maxXStreaks, maxYStreaks);
tessellator.addVertexWithUV(xMax, yMin, zMax, maxXStreaks, minYStreaks);
tessellator.addVertexWithUV(xMax, yMin, zMin, minXOverlay, minYOverlay);
tessellator.addVertexWithUV(xMax, yMax, zMin, minXOverlay, maxYOverlay);
tessellator.addVertexWithUV(xMax, yMax, zMax, maxXOverlay, maxYOverlay);
tessellator.addVertexWithUV(xMax, yMin, zMax, maxXOverlay, minYOverlay);
tessellator.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
Aggregations