use of WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack in project BloodMagic by WayofTime.
the class RenderAlchemicCalcinator method renderTileEntityAt.
@Override
public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) {
if (tileEntity instanceof TEAlchemicCalcinator) {
TEAlchemicCalcinator tileAltar = (TEAlchemicCalcinator) tileEntity;
GL11.glPushMatrix();
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/AlchemicalCalcinator.png");
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
GL11.glPushMatrix();
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
this.modelConduit.render(null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
GL11.glPopMatrix();
GL11.glPopMatrix();
GL11.glPushMatrix();
if (tileAltar.getStackInSlot(1) != null) {
boolean fancySaved = Minecraft.isFancyGraphicsEnabled();
Minecraft.getMinecraft().gameSettings.fancyGraphics = true;
float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(1));
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
ghostEntityItem.hoverStart = 0.0F;
ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(1));
float displacement = 0.2F;
if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock) {
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.7F, (float) d2 + 0.5F);
} else {
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 10.4f / 16.0f, (float) d2 + 0.5F - 0.0625f * 2f);
}
GL11.glScalef(scaleFactor, scaleFactor, scaleFactor);
if (!(ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock)) {
GL11.glRotatef(90f, 1.0f, 0.0f, 0.0F);
}
customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
Minecraft.getMinecraft().gameSettings.fancyGraphics = fancySaved;
}
GL11.glPopMatrix();
GL11.glPushMatrix();
if (tileAltar.getStackInSlot(0) != null) {
boolean fancySaved = Minecraft.isFancyGraphicsEnabled();
Minecraft.getMinecraft().gameSettings.fancyGraphics = true;
float scaleFactor = getGhostItemScaleFactor(tileAltar.getStackInSlot(0));
EntityItem ghostEntityItem = new EntityItem(tileAltar.getWorldObj());
ghostEntityItem.hoverStart = 0.0F;
ghostEntityItem.setEntityItemStack(tileAltar.getStackInSlot(0));
float displacement = -0.5F;
if (ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock) {
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 0.7F, (float) d2 + 0.5F);
} else {
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + displacement + 10.4f / 16.0f, (float) d2 + 0.5F - 0.0625f * 2f);
}
GL11.glScalef(scaleFactor, scaleFactor, scaleFactor);
if (!(ghostEntityItem.getEntityItem().getItem() instanceof ItemBlock)) {
GL11.glRotatef(90f, 1.0f, 0.0f, 0.0F);
}
customRenderItem.doRender(ghostEntityItem, 0, 0, 0, 0, 0);
Minecraft.getMinecraft().gameSettings.fancyGraphics = fancySaved;
}
GL11.glPopMatrix();
ReagentContainerInfo[] info = tileAltar.getContainerInfo(ForgeDirection.UNKNOWN);
if (info.length >= 1 && info[0] != null) {
ReagentStack reagentStack = info[0].reagent;
int capacity = info[0].capacity;
if (reagentStack != null && reagentStack.reagent != null) {
Reagent reagent = reagentStack.reagent;
this.renderTankContents(d0, d1, d2, reagent.getColourRed(), reagent.getColourGreen(), reagent.getColourBlue(), 200 * reagentStack.amount / capacity);
}
}
}
}
use of WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack in project BloodMagic by WayofTime.
the class RenderCrystalBelljar method renderTileEntityAt.
@Override
public void renderTileEntityAt(TileEntity tileEntity, double d0, double d1, double d2, float f) {
if (tileEntity instanceof TEBellJar) {
TEBellJar tileAltar = (TEBellJar) tileEntity;
GL11.glPushMatrix();
GL11.glTranslatef((float) d0 + 0.5F, (float) d1 + 1.5F, (float) d2 + 0.5F);
ResourceLocation test = new ResourceLocation("alchemicalwizardry:textures/models/CrystalBelljar.png");
FMLClientHandler.instance().getClient().renderEngine.bindTexture(test);
GL11.glPushMatrix();
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
this.modelConduit.render(null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
GL11.glPopMatrix();
GL11.glPopMatrix();
ReagentContainerInfo[] info = tileAltar.getContainerInfo(ForgeDirection.UNKNOWN);
if (info.length >= 1 && info[0] != null) {
ReagentStack reagentStack = info[0].reagent;
int capacity = info[0].capacity;
if (reagentStack != null && reagentStack.reagent != null) {
Reagent reagent = reagentStack.reagent;
this.renderTankContents(d0, d1, d2, reagent.getColourRed(), reagent.getColourGreen(), reagent.getColourBlue(), 200 * reagentStack.amount / capacity);
}
}
}
}
use of WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack in project BloodMagic by WayofTime.
the class TEAlchemicCalcinator method moveBufferToMain.
public void moveBufferToMain() {
ReagentStack amountStack = this.bufferTank.drain(bufferTransferRate, false);
int drainAmount = this.fill(ForgeDirection.UNKNOWN, amountStack, false);
if (drainAmount > 0) {
ReagentStack drainedStack = this.bufferTank.drain(drainAmount, true);
this.fill(ForgeDirection.UNKNOWN, drainedStack, true);
}
}
use of WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack in project BloodMagic by WayofTime.
the class RitualEffect method canDrainReagent.
public boolean canDrainReagent(IMasterRitualStone ritualStone, Reagent reagent, int amount, boolean doDrain) {
if (ritualStone == null || reagent == null || amount == 0) {
return false;
}
ReagentStack reagentStack = new ReagentStack(reagent, amount);
ReagentStack stack = ritualStone.drain(ForgeDirection.UNKNOWN, reagentStack, false);
if (stack != null && stack.amount >= amount) {
if (doDrain) {
ritualStone.drain(ForgeDirection.UNKNOWN, reagentStack, true);
}
return true;
}
return false;
}
use of WayofTime.alchemicalWizardry.api.alchemy.energy.ReagentStack in project BloodMagic by WayofTime.
the class ItemBlockCrystalBelljar method addInformation.
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
ReagentContainer[] tanks = this.getReagentContainers(stack);
if (tanks == null) {
list.add(StatCollector.translateToLocal("tooltip.crystalbelljar.empty"));
} else {
list.add(StatCollector.translateToLocal("tooltip.crystalbelljar.contents"));
for (int i = 0; i < tanks.length; i++) {
if (tanks[i] == null || tanks[i].getReagent() == null || tanks[i].getReagent().reagent == null) {
list.add("- Empty");
} else {
ReagentStack reagentStack = tanks[i].getReagent();
list.add("- " + reagentStack.reagent.name + ": " + reagentStack.amount + "/" + tanks[i].getCapacity() / 1000 + "k AR");
}
}
}
}
Aggregations