Improve fluid rendering

This commit is contained in:
Nedelosk committed 2017-01-23 15:44:46 +01:00
1 parent f0d8d6b89d
commit 87cf7386c6
83 files changed
+351 -306

No files matched your search

@@ -29,8 +29,8 @@ public class ControlColourDisplay extends Control implements IControlValue<IFlow
@Override
public void onRenderBackground() {
CraftGUI.Render.solid(this.getArea(), -1);
CraftGUI.Render.solid(this.getArea().inset(1), -16777216 + this.getValue().getColor(false));
CraftGUI.render.solid(this.getArea(), -1);
CraftGUI.render.solid(this.getArea().inset(1), -16777216 + this.getValue().getColor(false));
}
@Override
@@ -22,9 +22,9 @@ public class ControlColourMixSymbol extends Control implements ITooltip {
public void onRenderBackground() {
super.onRenderBackground();
if (this.type == 0) {
CraftGUI.Render.texture(ControlColourMixSymbol.MutationPlus, IPoint.ZERO);
CraftGUI.render.texture(ControlColourMixSymbol.MutationPlus, IPoint.ZERO);
} else {
CraftGUI.Render.texture(ControlColourMixSymbol.MutationArrow, IPoint.ZERO);
CraftGUI.render.texture(ControlColourMixSymbol.MutationArrow, IPoint.ZERO);
}
}
@@ -19,7 +19,7 @@ public class ControlColourOption extends ControlTextOption<IFlowerColour> {
this.addAttribute(Attribute.MouseOver);
CraftGUIUtil.moveWidget(this.textWidget, new IPoint(22.0f, 0.0f));
this.textWidget.setSize(this.textWidget.getSize().sub(new IPoint(24.0f, 0.0f)));
final int th = (int) CraftGUI.Render.textHeight(this.textWidget.getValue(), this.textWidget.getSize().x());
final int th = (int) CraftGUI.render.textHeight(this.textWidget.getValue(), this.textWidget.getSize().x());
final int height = Math.max(20, th + 6);
this.setSize(new IPoint(this.size().x(), height));
this.textWidget.setSize(new IPoint(this.textWidget.getSize().x(), height));
@@ -1,11 +1,18 @@
package binnie.core.block;
import binnie.core.network.packet.MessageMetadata;
import binnie.core.network.packet.PacketMetadata;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityCommandBlock;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.common.util.BlockSnapshot;
public class TileEntityMetadata extends TileEntity {
private int meta;
@@ -19,8 +26,7 @@ public class TileEntityMetadata extends TileEntity {
public boolean receiveClientEvent(final int par1, final int par2) {
if (par1 == 42) {
this.meta = par2;
//TODO UPDATE
//this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
markDirty();
}
return true;
}
@@ -38,10 +44,6 @@ public class TileEntityMetadata extends TileEntity {
return nbt2;
}
// @Override
// public boolean canUpdate() {
// return false;
// }
public int getTileMetadata() {
return this.meta;
@@ -51,17 +53,21 @@ public class TileEntityMetadata extends TileEntity {
if (this.meta != meta) {
this.meta = meta;
if (notify) {
//TODO UPDATE
//this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
IBlockState state = worldObj.getBlockState(pos);
worldObj.notifyBlockUpdate(pos, state, state, 3);
}
}
}
//TODO update packet
// @Override
// public Packet getDescriptionPacket() {
// return BinnieCore.instance.getNetworkWrapper().getPacketFrom(new MessageMetadata(this.xCoord, this.yCoord, this.zCoord, this.meta).GetMessage());
// }
@Override
public void onDataPacket(NetworkManager net, SPacketUpdateTileEntity pkt) {
super.onDataPacket(net, pkt);
}
@Override
public SPacketUpdateTileEntity getUpdatePacket() {
return new PacketMetadata(pos, meta, getUpdateTag());
}
public static TileEntityMetadata getTile(final IBlockAccess world, final BlockPos pos) {
final TileEntity tile = world.getTileEntity(pos);
@@ -21,6 +21,9 @@ import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidUtil;
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
import net.minecraftforge.fluids.capability.IFluidHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -115,9 +118,15 @@ class BlockMachine extends BlockContainer implements IBlockMachine {
if (player.isSneaking()) {
return true;
}
final TileEntity entity = world.getTileEntity(pos);
if (entity instanceof TileEntityMachine) {
((TileEntityMachine) entity).getMachine().onRightClick(world, player, pos);
TileEntity tileEntity = world.getTileEntity(pos);
if (tileEntity.hasCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, side)) {
IFluidHandler tileFluidHandler = tileEntity.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, side);
if (FluidUtil.interactWithFluidHandler(heldItem, tileFluidHandler, player)) {
return true;
}
}
if (tileEntity instanceof TileEntityMachine) {
((TileEntityMachine) tileEntity).getMachine().onRightClick(world, player, pos);
}
return true;
}
@@ -37,6 +37,6 @@ class ControlColourSelector extends Control implements ITooltip, IControlValue<E
@Override
public void onRenderBackground() {
super.onRenderBackground();
CraftGUI.Render.gradientRect(this.getArea(), -16777216 + this.value.getColour(), -16777216 + this.value.getColour());
CraftGUI.render.gradientRect(this.getArea(), -16777216 + this.value.getColour(), -16777216 + this.value.getColour());
}
}
@@ -154,9 +154,9 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
final Panel panel = new Panel(thisPage, 0.0f, 0.0f, thisPage.w(), thisPage.h(), MinecraftGUI.PanelType.Black) {
@Override
public void onRenderForeground() {
final Texture iTexture = CraftGUI.Render.getTexture(CraftGUITexture.TabOutline);
CraftGUI.Render.colour(WindowCompartment.this.getTab(WindowCompartment.this.panels.get(this)).getColor().getColour());
CraftGUI.Render.texture(iTexture, this.getArea().inset(3));
final Texture iTexture = CraftGUI.render.getTexture(CraftGUITexture.TabOutline);
CraftGUI.render.colour(WindowCompartment.this.getTab(WindowCompartment.this.panels.get(this)).getColor().getColour());
CraftGUI.render.texture(iTexture, this.getArea().inset(3));
}
};
this.panels.put(panel, p2);
@@ -286,7 +286,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
@Override
public void onRenderBackground() {
final Object texture = this.isMouseOver() ? CraftGUITexture.TabHighlighted : CraftGUITexture.Tab;
CraftGUI.Render.texture(CraftGUI.Render.getTexture(texture).crop(Position.Bottom, 8.0f), this.getArea());
CraftGUI.render.texture(CraftGUI.render.getTexture(texture).crop(Position.Bottom, 8.0f), this.getArea());
}
};
searchButton.addHelp("Search Button");
@@ -310,8 +310,8 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
final ControlScrollableContent<IWidget> scroll = new ControlScrollableContent<IWidget>(this, 124.0f, 16.0f, 116.0f, 92.0f, 6.0f) {
@Override
public void onRenderBackground() {
CraftGUI.Render.colour(11184810);
CraftGUI.Render.texture(CraftGUITexture.Outline, this.getArea().inset(new IBorder(0.0f, 6.0f, 0.0f, 0.0f)));
CraftGUI.render.colour(11184810);
CraftGUI.render.texture(CraftGUITexture.Outline, this.getArea().inset(new IBorder(0.0f, 6.0f, 0.0f, 0.0f)));
}
};
scroll.setScrollableContent(this.slotGrid = new Control(scroll, 1.0f, 1.0f, 108.0f, 18.0f));
@@ -2,14 +2,15 @@ package binnie.core.network.packet;
import binnie.core.network.BinnieCorePacketID;
import io.netty.buffer.ByteBuf;
import net.minecraft.util.math.BlockPos;
import java.io.IOException;
public class MessageMetadata extends MessageCoordinates {
public int meta;
public MessageMetadata(final int posX, final int posY, final int posZ, final int meta) {
super(BinnieCorePacketID.TileMetadata.ordinal(), posX, posY, posZ);
public MessageMetadata(BlockPos coordinates, int meta) {
super(BinnieCorePacketID.TileMetadata.ordinal(), coordinates);
this.meta = meta;
}
@@ -0,0 +1,32 @@
package binnie.core.network.packet;
import java.io.IOException;
import binnie.botany.flower.TileEntityFlower;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
import net.minecraft.util.math.BlockPos;
public class PacketMetadata extends SPacketUpdateTileEntity {
public int metadata;
public PacketMetadata(BlockPos blockPos, int metadata, NBTTagCompound compound) {
super(blockPos, 0, compound);
this.metadata = metadata;
}
@Override
public void writePacketData(PacketBuffer buf) throws IOException {
super.writePacketData(buf);
buf.writeInt(metadata);
}
@Override
public void readPacketData(PacketBuffer buf) throws IOException {
super.readPacketData(buf);
metadata = buf.readInt();
}
}
@@ -110,7 +110,7 @@ public class WindowFieldKit extends Window {
@Override
public void initialiseClient() {
this.setTitle("Field Kit");
CraftGUI.Render.stylesheet(new StyleSheetPunnett());
CraftGUI.render.stylesheet(new StyleSheetPunnett());
this.getWindowInventory().createSlot(0);
this.getWindowInventory().createSlot(1);
this.setupValidators();
@@ -62,6 +62,6 @@ public class ControlCheckbox extends Control implements IControlValue<Boolean> {
if (this.isMouseOver()) {
texture = (this.getValue() ? CraftGUITexture.CheckboxCheckedHighlighted : CraftGUITexture.CheckboxHighlighted);
}
CraftGUI.Render.texture(texture, IPoint.ZERO);
CraftGUI.render.texture(texture, IPoint.ZERO);
}
}
@@ -28,7 +28,7 @@ public class ControlText extends Control implements IControlValue<String> {
@Override
public void onRenderBackground() {
CraftGUI.Render.text(this.getArea(), this.align, this.text, this.getColour());
CraftGUI.render.text(this.getArea(), this.align, this.text, this.getColour());
}
@Override
@@ -78,7 +78,7 @@ public class ControlTextEdit extends Control implements IControlValue<String> {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(CraftGUITexture.Slot, this.getArea());
CraftGUI.render.texture(CraftGUITexture.Slot, this.getArea());
this.renderTextField();
}
@@ -55,6 +55,6 @@ public class ControlButton extends Control {
} else if (this.isEnabled()) {
texture = CraftGUITexture.Button;
}
CraftGUI.Render.texture(texture, this.getArea());
CraftGUI.render.texture(texture, this.getArea());
}
}
@@ -57,7 +57,7 @@ public class ControlOption<T> extends Control implements IControlValue<T> {
@Override
public void onRenderForeground() {
if (this.isCurrentSelection()) {
CraftGUI.Render.texture(CraftGUITexture.Outline, this.getArea());
CraftGUI.render.texture(CraftGUITexture.Outline, this.getArea());
}
}
}
@@ -75,6 +75,6 @@ public class ControlScrollBar extends Control {
} else if (this.isEnabled()) {
texture = CraftGUITexture.Scroll;
}
CraftGUI.Render.texture(texture, renderArea);
CraftGUI.render.texture(texture, renderArea);
}
}
@@ -74,7 +74,7 @@ public class ControlTab<T> extends Control implements ITooltip, IControlValue<T>
} else if (this.isCurrentSelection()) {
texture = CraftGUITexture.Tab;
}
final Texture lTexture = CraftGUI.Render.getTexture(texture);
final Texture lTexture = CraftGUI.render.getTexture(texture);
final Position position = this.getTabPosition();
Texture iTexture = lTexture.crop(position, 8.0f);
final IArea area = this.getArea();
@@ -86,7 +86,7 @@ public class ControlTab<T> extends Control implements ITooltip, IControlValue<T>
area.setSize(area.getSize().sub(new IPoint(4 * position.x(), 4 * position.y())));
}
}
CraftGUI.Render.texture(iTexture, area);
CraftGUI.render.texture(iTexture, area);
if (this instanceof ControlTabIcon) {
final ControlTabIcon icon = (ControlTabIcon) this;
final ControlItemDisplay item = (ControlItemDisplay) this.getWidgets().get(0);
@@ -96,10 +96,10 @@ public class ControlTab<T> extends Control implements ITooltip, IControlValue<T>
item.setColour(-1);
}
if (icon.hasOutline()) {
iTexture = CraftGUI.Render.getTexture(CraftGUITexture.TabOutline);
iTexture = CraftGUI.render.getTexture(CraftGUITexture.TabOutline);
iTexture = iTexture.crop(position, 8.0f);
CraftGUI.Render.colour(icon.getOutlineColour());
CraftGUI.Render.texture(iTexture, area.inset(2));
CraftGUI.render.colour(icon.getOutlineColour());
CraftGUI.render.texture(iTexture, area.inset(2));
}
}
}
@@ -4,6 +4,6 @@ import binnie.craftgui.core.renderer.Renderer;
import binnie.craftgui.resource.minecraft.CraftGUIResourceManager;
public class CraftGUI {
public static CraftGUIResourceManager ResourceManager;
public static Renderer Render;
public static CraftGUIResourceManager resourceManager;
public static Renderer render;
}
@@ -271,18 +271,18 @@ public class Widget implements IWidget {
@Override
public final void render() {
if (this.isVisible()) {
CraftGUI.Render.preRender(this);
CraftGUI.render.preRender(this);
this.onRender(RenderStage.PreChildren);
for (final IWidget widget : this.getWidgets()) {
widget.render();
}
for (final IWidget widget : this.getWidgets()) {
CraftGUI.Render.preRender(widget);
CraftGUI.render.preRender(widget);
widget.onRender(RenderStage.PostSiblings);
CraftGUI.Render.postRender(widget);
CraftGUI.render.postRender(widget);
}
this.onRender(RenderStage.PostChildren);
CraftGUI.Render.postRender(this);
CraftGUI.render.postRender(this);
}
}
@@ -12,6 +12,8 @@ import binnie.craftgui.resource.Texture;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import org.lwjgl.opengl.GL11;
import java.util.List;
@@ -171,12 +173,12 @@ public class Renderer {
this.gui.renderItem(pos, item, rotating);
}
public void iconBlock(final IPoint pos, final TextureAtlasSprite icon) {
this.gui.renderIcon(pos, icon, TextureMap.LOCATION_BLOCKS_TEXTURE);
public void sprite(final IPoint pos, final TextureAtlasSprite icon) {
this.gui.renderSprite(pos, icon, TextureMap.LOCATION_BLOCKS_TEXTURE);
}
public void iconItem(final IPoint pos, final TextureAtlasSprite icon) {
this.gui.renderIcon(pos, icon, TextureMap.LOCATION_BLOCKS_TEXTURE);
public void fluid(IPoint pos, FluidStack fluid){
this.gui.renderFluid(fluid, pos);
}
public void limitArea(final IArea area) {
@@ -16,6 +16,6 @@ public class ControlBlockIconDisplay extends Control {
@Override
public void onRenderBackground() {
CraftGUI.Render.iconBlock(IPoint.ZERO, this.icon);
CraftGUI.render.sprite(IPoint.ZERO, this.icon);
}
}
@@ -13,6 +13,8 @@ import binnie.craftgui.resource.Texture;
import binnie.craftgui.resource.minecraft.StandardTexture;
import binnie.extratrees.core.ExtraTreeTexture;
import binnie.extratrees.machines.Brewery;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import org.lwjgl.opengl.GL11;
@@ -25,25 +27,25 @@ public class ControlBreweryProgress extends ControlProgressBase {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(ControlBreweryProgress.Brewery, new IPoint(0.0f, 0.0f));
CraftGUI.render.texture(ControlBreweryProgress.Brewery, new IPoint(0.0f, 0.0f));
final Brewery.ComponentBreweryLogic logic = Machine.getInterface(Brewery.ComponentBreweryLogic.class, Window.get(this).getInventory());
if (logic == null || logic.currentCrafting == null || logic.currentCrafting.currentInput == null) {
return;
}
final int fermentedHeight = (int) (32.0f * logic.getProgress() / 100.0f);
CraftGUI.Render.limitArea(new IArea(new IPoint(1.0f, 6.0f).add(this.getAbsolutePosition()), new IPoint(32.0f, 32 - fermentedHeight)));
CraftGUI.render.limitArea(new IArea(new IPoint(1.0f, 6.0f).add(this.getAbsolutePosition()), new IPoint(32.0f, 32 - fermentedHeight)));
GL11.glEnable(3089);
this.renderFluid(logic.currentCrafting.currentInput, new IPoint(1.0f, 6.0f));
this.renderFluid(logic.currentCrafting.currentInput, new IPoint(17.0f, 6.0f));
this.renderFluid(logic.currentCrafting.currentInput, new IPoint(1.0f, 22.0f));
this.renderFluid(logic.currentCrafting.currentInput, new IPoint(17.0f, 22.0f));
CraftGUI.render.fluid(new IPoint(1.0f, 6.0f), logic.currentCrafting.currentInput);
CraftGUI.render.fluid(new IPoint(17.0f, 6.0f), logic.currentCrafting.currentInput);
CraftGUI.render.fluid(new IPoint(1.0f, 22.0f), logic.currentCrafting.currentInput);
CraftGUI.render.fluid(new IPoint(17.0f, 22.0f), logic.currentCrafting.currentInput);
GL11.glDisable(3089);
CraftGUI.Render.limitArea(new IArea(new IPoint(1.0f, 38 - fermentedHeight).add(this.getAbsolutePosition()), new IPoint(32.0f, fermentedHeight)));
CraftGUI.render.limitArea(new IArea(new IPoint(1.0f, 38 - fermentedHeight).add(this.getAbsolutePosition()), new IPoint(32.0f, fermentedHeight)));
GL11.glEnable(3089);
this.renderFluid(binnie.extratrees.machines.Brewery.getOutput(logic.currentCrafting), new IPoint(1.0f, 6.0f));
this.renderFluid(binnie.extratrees.machines.Brewery.getOutput(logic.currentCrafting), new IPoint(17.0f, 6.0f));
this.renderFluid(binnie.extratrees.machines.Brewery.getOutput(logic.currentCrafting), new IPoint(1.0f, 22.0f));
this.renderFluid(binnie.extratrees.machines.Brewery.getOutput(logic.currentCrafting), new IPoint(17.0f, 22.0f));
CraftGUI.render.fluid(new IPoint(1.0f, 6.0f), binnie.extratrees.machines.Brewery.getOutput(logic.currentCrafting));
CraftGUI.render.fluid(new IPoint(17.0f, 6.0f), binnie.extratrees.machines.Brewery.getOutput(logic.currentCrafting));
CraftGUI.render.fluid(new IPoint(1.0f, 22.0f), binnie.extratrees.machines.Brewery.getOutput(logic.currentCrafting));
CraftGUI.render.fluid(new IPoint(17.0f, 22.0f), binnie.extratrees.machines.Brewery.getOutput(logic.currentCrafting));
GL11.glDisable(3089);
final ItemStackSet stacks = new ItemStackSet();
Collections.addAll(stacks, logic.currentCrafting.inputs);
@@ -51,7 +53,7 @@ public class ControlBreweryProgress extends ControlProgressBase {
int x = 1;
int y = 6;
for (final ItemStack stack : stacks) {
CraftGUI.Render.item(new IPoint(x, y), stack);
CraftGUI.render.item(new IPoint(x, y), stack);
x += 16;
if (x > 18) {
x = 1;
@@ -69,17 +71,4 @@ public class ControlBreweryProgress extends ControlProgressBase {
this.addAttribute(Attribute.MouseOver);
}
public void renderFluid(final FluidStack fluid, final IPoint pos) {
// final int hex = fluid.getFluid().getColor(fluid);
// final int r = (hex & 0xFF0000) >> 16;
// final int g = (hex & 0xFF00) >> 8;
// final int b = hex & 0xFF;
// final IIcon icon = fluid.getFluid().getIcon();
// GL11.glColor4f(r / 255.0f, g / 255.0f, b / 255.0f, 1.0f);
// GL11.glEnable(3042);
// GL11.glBlendFunc(770, 771);
// CraftGUI.Render.iconBlock(pos, fluid.getFluid().getIcon());
// GL11.glDisable(3042);
}
}
@@ -13,6 +13,8 @@ import binnie.craftgui.resource.Texture;
import binnie.craftgui.resource.minecraft.StandardTexture;
import binnie.extratrees.core.ExtraTreeTexture;
import binnie.extratrees.machines.Distillery;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.FluidStack;
import org.lwjgl.opengl.GL11;
@@ -25,8 +27,8 @@ public class ControlDistilleryProgress extends ControlProgressBase {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(ControlDistilleryProgress.DistilleryBase, new IPoint(0.0f, 0.0f));
CraftGUI.Render.texturePercentage(ControlDistilleryProgress.LiquidFlow, new IArea(18.0f, 0.0f, 38.0f, 66.0f), Position.Left, this.progress);
CraftGUI.render.texture(ControlDistilleryProgress.DistilleryBase, new IPoint(0.0f, 0.0f));
CraftGUI.render.texturePercentage(ControlDistilleryProgress.LiquidFlow, new IArea(18.0f, 0.0f, 38.0f, 66.0f), Position.Left, this.progress);
final Distillery.ComponentDistilleryLogic component = Machine.getInterface(Distillery.ComponentDistilleryLogic.class, Window.get(this).getInventory());
FluidStack stack = null;
if (component != null) {
@@ -34,7 +36,7 @@ public class ControlDistilleryProgress extends ControlProgressBase {
}
if (stack != null) {
for (int y = 0; y < 4; ++y) {
this.renderFluid(stack, new IPoint(1.0f, 1 + y * 16));
CraftGUI.render.fluid(new IPoint(1.0f, 1 + y * 16), stack);
}
}
}
@@ -44,8 +46,8 @@ public class ControlDistilleryProgress extends ControlProgressBase {
Distillery.ComponentDistilleryLogic distilleryLogic = Machine.getInterface(Distillery.ComponentDistilleryLogic.class, Window.get(this).getInventory());
if (distilleryLogic != null) {
final int level = distilleryLogic.level;
CraftGUI.Render.texture(ControlDistilleryProgress.Output, new IPoint(47.0f, 14 + level * 15));
CraftGUI.Render.texture(ControlDistilleryProgress.DistilleryOverlay, new IPoint(0.0f, 0.0f));
CraftGUI.render.texture(ControlDistilleryProgress.Output, new IPoint(47.0f, 14 + level * 15));
CraftGUI.render.texture(ControlDistilleryProgress.DistilleryOverlay, new IPoint(0.0f, 0.0f));
}
}
@@ -71,18 +73,4 @@ public class ControlDistilleryProgress extends ControlProgressBase {
});
}
public void renderFluid(final FluidStack fluid, final IPoint pos) {
final int hex = fluid.getFluid().getColor(fluid);
final int r = (hex & 0xFF0000) >> 16;
final int g = (hex & 0xFF00) >> 8;
final int b = hex & 0xFF;
//final IIcon icon = fluid.getFluid().getIcon();
GL11.glColor4f(r / 255.0f, g / 255.0f, b / 255.0f, 1.0f);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
//TODO RENDERING
//CraftGUI.Render.iconBlock(pos, fluid.getFluid().getIcon());
GL11.glDisable(3042);
}
}
@@ -12,10 +12,15 @@ import binnie.craftgui.resource.minecraft.StandardTexture;
import binnie.extratrees.core.ExtraTreeTexture;
import binnie.extratrees.machines.fruitpress.FruitPressRecipes;
import binnie.extratrees.machines.fruitpress.FruitPressMachine;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import org.lwjgl.opengl.GL11;
public class ControlFruitPressProgress extends ControlProgressBase {
@@ -24,7 +29,7 @@ public class ControlFruitPressProgress extends ControlProgressBase {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(ControlFruitPressProgress.PressSlot, new IPoint(3.0f, 52.0f));
CraftGUI.render.texture(ControlFruitPressProgress.PressSlot, new IPoint(3.0f, 52.0f));
Slot slotFromInventory = Window.get(this).getContainer().getSlotFromInventory(Window.get(this).getInventory(), FruitPressMachine.SLOT_CURRENT);
if (slotFromInventory == null) {
return;
@@ -33,25 +38,14 @@ public class ControlFruitPressProgress extends ControlProgressBase {
if (input == null || FruitPressRecipes.getOutput(input) == null) {
return;
}
final Fluid fluid = FruitPressRecipes.getOutput(input).getFluid();
final int hex = fluid.getColor(FruitPressRecipes.getOutput(input));
final int r = (hex & 0xFF0000) >> 16;
final int g = (hex & 0xFF00) >> 8;
final int b = hex & 0xFF;
//IIcon icon = fluid.getIcon();
GL11.glColor4f(r / 255.0f, g / 255.0f, b / 255.0f, 1.0f);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
//TODO RENDERING
//CraftGUI.Render.iconBlock(new IPoint(4.0f, 52.0f), fluid.getIcon());
GL11.glDisable(3042);
//icon = input.getIconIndex();
//CraftGUI.Render.iconItem(new IPoint(4.0f, 52.0f), icon);
FluidStack fluid = FruitPressRecipes.getOutput(input);
CraftGUI.render.fluid(new IPoint(4.0f, 52.0f), fluid);
CraftGUI.render.item(new IPoint(4.0f, 52.0f), input);
}
@Override
public void onRenderForeground() {
CraftGUI.Render.texture(ControlFruitPressProgress.PressTexture, new IPoint(0.0f, 16.0f * this.progress));
CraftGUI.render.texture(ControlFruitPressProgress.PressTexture, new IPoint(0.0f, 16.0f * this.progress));
}
protected ControlFruitPressProgress(final IWidget parent, final float x, final float y) {
@@ -37,7 +37,7 @@ public class ControlLumbermillProgress extends ControlProgressBase {
public void onRenderForeground() {
GL11.glDisable(2896);
final int sawX = (int) (63.0f * this.progress);
CraftGUI.Render.texture(ControlLumbermillProgress.Saw, new IPoint(sawX, -8.0f + 6.0f * (float) Math.sin(this.animation)));
CraftGUI.render.texture(ControlLumbermillProgress.Saw, new IPoint(sawX, -8.0f + 6.0f * (float) Math.sin(this.animation)));
final ItemStack item = Window.get(this).getInventory().getStackInSlot(LumbermillMachine.SLOT_LOG);
if (item == null) {
return;
@@ -69,14 +69,14 @@ public class ControlLumbermillProgress extends ControlProgressBase {
//final IIcon icon2 = block2.getIcon(2, result.getItemDamage());
final IPoint size = this.getSize();
final IPoint pos = this.getAbsolutePosition();
CraftGUI.Render.limitArea(new IArea(pos.add(new IPoint(0.0f, 0.0f)), new IPoint(this.progress * 64.0f + 2.0f, 18.0f)));
CraftGUI.render.limitArea(new IArea(pos.add(new IPoint(0.0f, 0.0f)), new IPoint(this.progress * 64.0f + 2.0f, 18.0f)));
GL11.glEnable(3089);
for (int j = 0; j < 4; ++j) {
//TODO RENDERING
//CraftGUI.Render.iconBlock(new IPoint(1 + j * 16, 1.0f), icon2);
}
GL11.glDisable(3089);
CraftGUI.Render.texture(ControlLumbermillProgress.Saw2, new IPoint(sawX + 2, -8.0f + 6.0f * (float) Math.sin(this.animation)));
CraftGUI.render.texture(ControlLumbermillProgress.Saw2, new IPoint(sawX + 2, -8.0f + 6.0f * (float) Math.sin(this.animation)));
}
protected ControlLumbermillProgress(final IWidget parent, final float x, final float y) {
@@ -153,18 +153,18 @@ public class ControlTileSelect extends Control implements IControlValue<IDesign>
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(CraftGUITexture.Slot, IPoint.ZERO);
CraftGUI.render.texture(CraftGUITexture.Slot, IPoint.ZERO);
}
@Override
public void onRenderForeground() {
final ItemStack image = ((WindowWoodworker) this.getSuperParent()).getDesignerType().getDisplayStack(this.getValue());
CraftGUI.Render.item(new IPoint(1.0f, 1.0f), image);
CraftGUI.render.item(new IPoint(1.0f, 1.0f), image);
if (((IControlValue) this.getParent()).getValue() != this.getValue()) {
if (Window.get(this).getMousedOverWidget() == this) {
CraftGUI.Render.gradientRect(this.getArea().inset(1), 1157627903, 1157627903);
CraftGUI.render.gradientRect(this.getArea().inset(1), 1157627903, 1157627903);
} else {
CraftGUI.Render.gradientRect(this.getArea().inset(1), -1433892728, -1433892728);
CraftGUI.render.gradientRect(this.getArea().inset(1), -1433892728, -1433892728);
}
}
}
@@ -71,7 +71,7 @@ public class PagePlanksOverview extends PageAbstract<ItemStack> {
}
controlDescription.setValue(descBody + "§r");
controlSignature.setValue(descSig + "§r");
final float descHeight = CraftGUI.Render.textHeight(controlDescription.getValue(), controlDescription.getSize().x());
final float descHeight = CraftGUI.render.textHeight(controlDescription.getValue(), controlDescription.getSize().x());
controlSignature.setPosition(new IPoint(controlSignature.pos().x(), controlDescription.getPosition().y() + descHeight + 10.0f));
}
}
@@ -66,10 +66,10 @@ public class ControlFluidDisplay extends Control implements ITooltip {
GL11.glPushMatrix();
final float scale = this.getSize().x() / 16.0f;
GL11.glScalef(scale, scale, 1.0f);
CraftGUI.Render.iconBlock(IPoint.ZERO, icon);
CraftGUI.render.sprite(IPoint.ZERO, icon);
GL11.glPopMatrix();
} else {
CraftGUI.Render.iconBlock(IPoint.ZERO, icon);
CraftGUI.render.sprite(IPoint.ZERO, icon);
}
GL11.glDisable(3042);
}
@@ -38,9 +38,9 @@ public class ControlSlotFluid extends Control implements ITooltip {
@Override
public void onRenderBackground() {
final int size = (int) this.getSize().x();
CraftGUI.Render.texture(CraftGUITexture.Slot, this.getArea());
CraftGUI.render.texture(CraftGUITexture.Slot, this.getArea());
if (this.getSuperParent().getMousedOverWidget() == this) {
CraftGUI.Render.gradientRect(new IArea(new IPoint(1.0f, 1.0f), this.getArea().size().sub(new IPoint(2.0f, 2.0f))), -2130706433, -2130706433);
CraftGUI.render.gradientRect(new IArea(new IPoint(1.0f, 1.0f), this.getArea().size().sub(new IPoint(2.0f, 2.0f))), -2130706433, -2130706433);
}
}
@@ -74,10 +74,10 @@ public class ControlGene extends Control implements IControlValue<IGene>, IToolt
@Override
public void onRenderBackground() {
if (this.isMouseOver() && this.canFill(Window.get(this).getHeldItemStack())) {
CraftGUI.Render.solid(this.getArea(), -1);
CraftGUI.Render.solid(this.getArea().inset(1), -12303292);
CraftGUI.render.solid(this.getArea(), -1);
CraftGUI.render.solid(this.getArea().inset(1), -12303292);
}
CraftGUI.Render.colour(-1);
CraftGUI.Render.iconItem(IPoint.ZERO, BinnieCore.proxy.getTextureAtlasSprite(GeneticsTexture.dnaIcon.getResourceLocation()));
CraftGUI.render.colour(-1);
CraftGUI.render.sprite(IPoint.ZERO, BinnieCore.proxy.getTextureAtlasSprite(GeneticsTexture.dnaIcon.getResourceLocation()));
}
}
@@ -14,8 +14,8 @@ public class ControlProcessTemporary extends ControlMachineProgress {
@Override
public void onRenderBackground() {
CraftGUI.Render.solid(this.getArea(), -4868683);
CraftGUI.render.solid(this.getArea(), -4868683);
final float w = this.getSize().y() * this.progress / 100.0f;
CraftGUI.Render.solid(new IArea(this.getArea().x(), this.getArea().y(), w, this.getArea().h()), -65536);
CraftGUI.render.solid(new IArea(this.getArea().x(), this.getArea().y(), w, this.getArea().h()), -65536);
}
}
@@ -40,10 +40,10 @@ public class ControlSplicerProgress extends ControlProgressBase {
c2 += alpha;
c3 += alpha;
c4 += alpha;
CraftGUI.Render.solidAlpha(new IArea(this.w() / 2.0f + y, offMovement * percentView, 4.0f, h / 2.0f), c1);
CraftGUI.Render.solidAlpha(new IArea(this.w() / 2.0f + y, offMovement * percentView + 4.0f, 4.0f, h / 2.0f), (y < 0.0f) ? c2 : c3);
CraftGUI.Render.solidAlpha(new IArea(this.w() / 2.0f + y, this.h() - offMovement * percentView - 8.0f, 4.0f, h / 2.0f), (y < 0.0f) ? c3 : c2);
CraftGUI.Render.solidAlpha(new IArea(this.w() / 2.0f + y, this.h() - offMovement * percentView - 4.0f, 4.0f, h / 2.0f), c4);
CraftGUI.render.solidAlpha(new IArea(this.w() / 2.0f + y, offMovement * percentView, 4.0f, h / 2.0f), c1);
CraftGUI.render.solidAlpha(new IArea(this.w() / 2.0f + y, offMovement * percentView + 4.0f, 4.0f, h / 2.0f), (y < 0.0f) ? c2 : c3);
CraftGUI.render.solidAlpha(new IArea(this.w() / 2.0f + y, this.h() - offMovement * percentView - 8.0f, 4.0f, h / 2.0f), (y < 0.0f) ? c3 : c2);
CraftGUI.render.solidAlpha(new IArea(this.w() / 2.0f + y, this.h() - offMovement * percentView - 4.0f, 4.0f, h / 2.0f), c4);
}
}
}
@@ -34,9 +34,9 @@ public abstract class Dialog extends Control {
@Override
public void onRenderBackground() {
CraftGUI.Render.gradientRect(this.getArea().outset(400), -1442840576, -1442840576);
CraftGUI.Render.texture(CraftGUITexture.Window, this.getArea());
CraftGUI.Render.texture(CraftGUITexture.TabOutline, this.getArea().inset(4));
CraftGUI.render.gradientRect(this.getArea().outset(400), -1442840576, -1442840576);
CraftGUI.render.texture(CraftGUITexture.Window, this.getArea());
CraftGUI.render.texture(CraftGUITexture.TabOutline, this.getArea().inset(4));
}
@Override
@@ -17,6 +17,7 @@ import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.VertexBuffer;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.ItemStack;
@@ -24,6 +25,8 @@ import net.minecraft.nbt.JsonToNBT;
import net.minecraft.nbt.NBTException;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.input.Keyboard;
@@ -406,12 +409,25 @@ public class GuiCraftGUI extends GuiContainer {
GL11.glEnable(3042);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
RenderHelper.disableStandardItemLighting();
CraftGUI.Render.colour(-1);
CraftGUI.render.colour(-1);
GL11.glEnable(32826);
GL11.glPopMatrix();
}
public void renderFluid(FluidStack fluid, IPoint pos) {
final int hex = fluid.getFluid().getColor(fluid);
final int r = (hex & 0xFF0000) >> 16;
final int g = (hex & 0xFF00) >> 8;
final int b = hex & 0xFF;
TextureAtlasSprite icon = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(fluid.getFluid().getStill().toString());
GL11.glColor4f(r / 255.0f, g / 255.0f, b / 255.0f, 1.0f);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
renderSprite(pos, icon, TextureMap.LOCATION_BLOCKS_TEXTURE);
GL11.glDisable(3042);
}
public void renderIcon(final IPoint pos, final TextureAtlasSprite icon, final ResourceLocation map) {
public void renderSprite(final IPoint pos, final TextureAtlasSprite icon, final ResourceLocation map) {
if (icon == null) {
return;
}
@@ -141,7 +141,7 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
for (final EnumHighlighting h : EnumHighlighting.values()) {
ControlSlot.highlighting.put(h, new ArrayList<>());
}
(CraftGUI.Render = new Renderer(this.gui)).stylesheet(StyleSheetManager.getDefault());
(CraftGUI.render = new Renderer(this.gui)).stylesheet(StyleSheetManager.getDefault());
this.titleButtonLeft = -14.0f;
if (this.showHelpButton()) {
new ControlHelp(this, this.titleButtonLeft += 22.0f, 8.0f);
@@ -202,15 +202,15 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
@Override
public void onRenderBackground() {
CraftGUI.Render.colour(16777215);
CraftGUI.render.colour(16777215);
if (this.getBackground1() != null) {
CraftGUI.Render.texture(this.getBackground1(), IPoint.ZERO);
CraftGUI.render.texture(this.getBackground1(), IPoint.ZERO);
}
if (this.getBackground2() != null) {
CraftGUI.Render.texture(this.getBackground2(), new IPoint(256.0f, 0.0f));
CraftGUI.render.texture(this.getBackground2(), new IPoint(256.0f, 0.0f));
}
CraftGUI.Render.colour(this.getColour());
CraftGUI.Render.texture(CraftGUITexture.Window, this.getArea());
CraftGUI.render.colour(this.getColour());
CraftGUI.render.texture(CraftGUITexture.Window, this.getArea());
}
@Override
@@ -74,9 +74,9 @@ public class ControlEnergyBar extends Control implements ITooltip {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(CraftGUITexture.EnergyBarBack, this.getArea());
CraftGUI.render.texture(CraftGUITexture.EnergyBarBack, this.getArea());
final float percentage = this.getPercentage() / 100.0f;
CraftGUI.Render.colour(this.getColourFromPercentage(percentage));
CraftGUI.render.colour(this.getColourFromPercentage(percentage));
final IArea area = this.getArea();
switch (this.direction) {
case Top:
@@ -94,26 +94,26 @@ public class ControlEnergyBar extends Control implements ITooltip {
}
if (this.isMouseOver() && Window.get(this).getGui().isHelpMode()) {
final int c = -1442840576 + MinecraftTooltip.getOutline(Tooltip.Type.Help);
CraftGUI.Render.gradientRect(this.getArea().inset(1), c, c);
CraftGUI.render.gradientRect(this.getArea().inset(1), c, c);
} else if (ControlEnergyBar.isError) {
final int c = -1442840576 + MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error);
CraftGUI.Render.gradientRect(this.getArea().inset(1), c, c);
CraftGUI.render.gradientRect(this.getArea().inset(1), c, c);
}
CraftGUI.Render.texture(CraftGUITexture.EnergyBarGlow, area);
CraftGUI.render.texture(CraftGUITexture.EnergyBarGlow, area);
GL11.glColor3d(1.0, 1.0, 1.0);
CraftGUI.Render.texture(CraftGUITexture.EnergyBarGlass, this.getArea());
CraftGUI.render.texture(CraftGUITexture.EnergyBarGlass, this.getArea());
}
@Override
public void onRenderForeground() {
if (this.isMouseOver() && Window.get(this).getGui().isHelpMode()) {
final IArea area = this.getArea();
CraftGUI.Render.colour(MinecraftTooltip.getOutline(Tooltip.Type.Help));
CraftGUI.Render.texture(CraftGUITexture.Outline, area.outset(1));
CraftGUI.render.colour(MinecraftTooltip.getOutline(Tooltip.Type.Help));
CraftGUI.render.texture(CraftGUITexture.Outline, area.outset(1));
} else if (ControlEnergyBar.isError) {
final IArea area = this.getArea();
CraftGUI.Render.colour(MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error));
CraftGUI.Render.texture(CraftGUITexture.Outline, area.outset(1));
CraftGUI.render.colour(MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error));
CraftGUI.render.texture(CraftGUITexture.Outline, area.outset(1));
}
}
@@ -26,7 +26,7 @@ public class ControlErrorState extends Control implements ITooltip {
} else if (this.type == 0) {
texture = CraftGUITexture.StateError;
}
CraftGUI.Render.texture(texture, IPoint.ZERO);
CraftGUI.render.texture(texture, IPoint.ZERO);
super.onRenderBackground();
}
@@ -16,7 +16,7 @@ public class ControlHelp extends Control implements ITooltip {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(CraftGUITexture.HelpButton, this.getArea());
CraftGUI.render.texture(CraftGUITexture.HelpButton, this.getArea());
}
@Override
@@ -18,6 +18,6 @@ public class ControlIconDisplay extends Control {
@Override
public void onRenderForeground() {
CraftGUI.Render.iconItem(IPoint.ZERO, this.icon);
CraftGUI.render.sprite(IPoint.ZERO, this.icon);
}
}
@@ -17,6 +17,6 @@ public class ControlImage extends Control {
@Override
public void onRenderForeground() {
CraftGUI.Render.texture(this.key, IPoint.ZERO);
CraftGUI.render.texture(this.key, IPoint.ZERO);
}
}
@@ -19,7 +19,7 @@ public class ControlInfo extends Control implements ITooltip {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(CraftGUITexture.InfoButton, this.getArea());
CraftGUI.render.texture(CraftGUITexture.InfoButton, this.getArea());
}
@Override
@@ -56,10 +56,10 @@ public class ControlItemDisplay extends Control implements ITooltip {
GL11.glScalef(scale, scale, 1.0f);
BinnieCore.proxy.getMinecraftInstance();
final float phase = Minecraft.getSystemTime() / 20.0f;
CraftGUI.Render.item(IPoint.ZERO, this.itemStack, this.rotating);
CraftGUI.render.item(IPoint.ZERO, this.itemStack, this.rotating);
GL11.glPopMatrix();
} else {
CraftGUI.Render.item(IPoint.ZERO, this.itemStack, this.rotating);
CraftGUI.render.item(IPoint.ZERO, this.itemStack, this.rotating);
}
}
}
@@ -72,18 +72,18 @@ public class ControlLiquidTank extends Control implements ITooltip {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(this.horizontal ? CraftGUITexture.HorizontalLiquidTank : CraftGUITexture.LiquidTank, IPoint.ZERO);
CraftGUI.render.texture(this.horizontal ? CraftGUITexture.HorizontalLiquidTank : CraftGUITexture.LiquidTank, IPoint.ZERO);
if (this.isMouseOver() && Window.get(this).getGui().isHelpMode()) {
final int c = -1442840576 + MinecraftTooltip.getOutline(Tooltip.Type.Help);
CraftGUI.Render.gradientRect(this.getArea().inset(1), c, c);
CraftGUI.render.gradientRect(this.getArea().inset(1), c, c);
} else if (ControlLiquidTank.tankError.contains(this.tankID)) {
final int c = -1442840576 + MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error);
CraftGUI.Render.gradientRect(this.getArea().inset(1), c, c);
CraftGUI.render.gradientRect(this.getArea().inset(1), c, c);
} else if (this.getSuperParent().getMousedOverWidget() == this) {
if (Window.get(this).getGui().getDraggedItem() != null) {
CraftGUI.Render.gradientRect(this.getArea().inset(1), -1426089575, -1426089575);
CraftGUI.render.gradientRect(this.getArea().inset(1), -1426089575, -1426089575);
} else {
CraftGUI.Render.gradientRect(this.getArea().inset(1), -2130706433, -2130706433);
CraftGUI.render.gradientRect(this.getArea().inset(1), -2130706433, -2130706433);
}
}
if (this.isTankValid()) {
@@ -105,14 +105,14 @@ public class ControlLiquidTank extends Control implements ITooltip {
if (this.horizontal) {
limited.setSize(new IPoint(limited.w() - 1.0f, limited.h()));
}
CraftGUI.Render.limitArea(new IArea(limited.pos().add(pos).add(offset), limited.size().sub(offset)));
CraftGUI.render.limitArea(new IArea(limited.pos().add(pos).add(offset), limited.size().sub(offset)));
GL11.glEnable(3089);
BinnieCore.proxy.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
for (int y = 0; y < height; y += 16) {
for (int x = 0; x < (this.horizontal ? 58 : 16); x += 16) {
final TextureAtlasSprite icon = BinnieCore.proxy.getTextureAtlasSprite(fluid.getStill());
CraftGUI.Render.iconBlock(new IPoint(1 + x, 1 + y), icon);
CraftGUI.render.sprite(new IPoint(1 + x, 1 + y), icon);
}
}
@@ -123,16 +123,16 @@ public class ControlLiquidTank extends Control implements ITooltip {
@Override
public void onRenderForeground() {
CraftGUI.Render.texture(this.horizontal ? CraftGUITexture.HorizontalLiquidTankOverlay : CraftGUITexture.LiquidTankOverlay, IPoint.ZERO);
CraftGUI.render.texture(this.horizontal ? CraftGUITexture.HorizontalLiquidTankOverlay : CraftGUITexture.LiquidTankOverlay, IPoint.ZERO);
if (this.isMouseOver() && Window.get(this).getGui().isHelpMode()) {
final IArea area = this.getArea();
CraftGUI.Render.colour(MinecraftTooltip.getOutline(Tooltip.Type.Help));
CraftGUI.Render.texture(CraftGUITexture.Outline, area.outset(1));
CraftGUI.render.colour(MinecraftTooltip.getOutline(Tooltip.Type.Help));
CraftGUI.render.texture(CraftGUITexture.Outline, area.outset(1));
}
if (ControlLiquidTank.tankError.contains(this.tankID)) {
final IArea area = this.getArea();
CraftGUI.Render.colour(MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error));
CraftGUI.Render.texture(CraftGUITexture.Outline, area.outset(1));
CraftGUI.render.colour(MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error));
CraftGUI.render.texture(CraftGUITexture.Outline, area.outset(1));
}
}
@@ -20,7 +20,7 @@ public class ControlPowerSystem extends Control implements ITooltip {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(CraftGUITexture.PowerButton, this.getArea());
CraftGUI.render.texture(CraftGUITexture.PowerButton, this.getArea());
}
@Override
@@ -20,7 +20,7 @@ public class ControlProgress extends ControlProgressBase {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(this.progressBlank, this.getArea());
CraftGUI.Render.texturePercentage(this.progressBar, this.getArea(), this.direction, this.progress);
CraftGUI.render.texture(this.progressBlank, this.getArea());
CraftGUI.render.texturePercentage(this.progressBar, this.getArea(), this.direction, this.progress);
}
}
@@ -37,17 +37,17 @@ public class ControlSlide extends Control {
public void onRenderBackground() {
super.onRenderBackground();
if (this.label != null) {
final float lw = CraftGUI.Render.textWidth(this.label) + 16;
final float lh = CraftGUI.Render.textHeight() + 16;
final float lw = CraftGUI.render.textWidth(this.label) + 16;
final float lh = CraftGUI.render.textHeight() + 16;
final boolean hor = this.anchor.x() != 0;
final IArea ar = this.isSlideActive() ? this.expanded : this.shrunk;
IArea tabArea = new IArea(hor ? (-lh / 2.0f) : (-lw / 2.0f), hor ? (-lw / 2.0f) : (-lh / 2.0f), hor ? lh : lw, hor ? lw : lh);
final IPoint shift = new IPoint(ar.w() * (1 - this.anchor.x()) / 2.0f, ar.h() * (1 - this.anchor.y()) / 2.0f);
tabArea = tabArea.shift(shift.x() - (-3.0f + lh / 2.0f) * this.anchor.x(), shift.y() - (-3.0f + lh / 2.0f) * this.anchor.y());
Texture texture = CraftGUI.Render.getTexture(this.isSlideActive() ? CraftGUITexture.Tab : CraftGUITexture.TabDisabled).crop(this.anchor.opposite(), 8.0f);
CraftGUI.Render.texture(texture, tabArea);
texture = CraftGUI.Render.getTexture(CraftGUITexture.TabOutline).crop(this.anchor.opposite(), 8.0f);
CraftGUI.Render.texture(texture, tabArea.inset(2));
Texture texture = CraftGUI.render.getTexture(this.isSlideActive() ? CraftGUITexture.Tab : CraftGUITexture.TabDisabled).crop(this.anchor.opposite(), 8.0f);
CraftGUI.render.texture(texture, tabArea);
texture = CraftGUI.render.getTexture(CraftGUITexture.TabOutline).crop(this.anchor.opposite(), 8.0f);
CraftGUI.render.texture(texture, tabArea.inset(2));
final IArea labelArea = new IArea(-lw / 2.0f, 0.0f, lw, lh);
GL11.glPushMatrix();
GL11.glTranslatef(shift.x() + this.anchor.x() * 2.0f, shift.y() + this.anchor.y() * 2.0f, 0.0f);
@@ -57,12 +57,12 @@ public class ControlSlide extends Control {
if (this.anchor.y() > 0) {
GL11.glTranslatef(0.0f, -lh, 0.0f);
}
CraftGUI.Render.text(labelArea, TextJustification.MiddleCenter, this.label, 16777215);
CraftGUI.render.text(labelArea, TextJustification.MiddleCenter, this.label, 16777215);
GL11.glPopMatrix();
}
CraftGUI.Render.texture(CraftGUITexture.Window, this.getArea());
CraftGUI.render.texture(CraftGUITexture.Window, this.getArea());
final Object slideTexture = (this.anchor == Position.Bottom) ? CraftGUITexture.SlideDown : ((this.anchor == Position.Top) ? CraftGUITexture.SlideUp : ((this.anchor == Position.Left) ? CraftGUITexture.SlideLeft : CraftGUITexture.SlideRight));
CraftGUI.Render.texture(slideTexture, new IPoint((this.anchor.x() + 1.0f) * this.w() / 2.0f - 8.0f, (this.anchor.y() + 1.0f) * this.h() / 2.0f - 8.0f));
CraftGUI.render.texture(slideTexture, new IPoint((this.anchor.x() + 1.0f) * this.w() / 2.0f - 8.0f, (this.anchor.y() + 1.0f) * this.h() / 2.0f - 8.0f));
}
public boolean isSlideActive() {
@@ -58,7 +58,7 @@ public class ControlSlot extends ControlSlotBase {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(CraftGUITexture.Slot, IPoint.ZERO);
CraftGUI.render.texture(CraftGUITexture.Slot, IPoint.ZERO);
if (this.slot == null) {
return;
}
@@ -67,7 +67,7 @@ public class ControlSlot extends ControlSlotBase {
if (islot != null && islot.getValidator() != null) {
final TextureAtlasSprite icon = islot.getValidator().getIcon(!islot.getInputSides().isEmpty());
if (icon != null) {
CraftGUI.Render.iconItem(new IPoint(1.0f, 1.0f), icon);
CraftGUI.render.sprite(new IPoint(1.0f, 1.0f), icon);
}
}
boolean highlighted = false;
@@ -80,13 +80,13 @@ public class ControlSlot extends ControlSlotBase {
}
highlighted = true;
final int c = -1442840576 + Math.min(highlight.getKey().getColour(), 16777215);
CraftGUI.Render.gradientRect(new IArea(1.0f, 1.0f, 16.0f, 16.0f), c, c);
CraftGUI.render.gradientRect(new IArea(1.0f, 1.0f, 16.0f, 16.0f), c, c);
}
if (!highlighted && this.getSuperParent().getMousedOverWidget() == this) {
if (Window.get(this).getGui().getDraggedItem() != null && !this.slot.isItemValid(Window.get(this).getGui().getDraggedItem())) {
CraftGUI.Render.gradientRect(new IArea(1.0f, 1.0f, 16.0f, 16.0f), -1426089575, -1426089575);
CraftGUI.render.gradientRect(new IArea(1.0f, 1.0f, 16.0f, 16.0f), -1426089575, -1426089575);
} else {
CraftGUI.Render.gradientRect(new IArea(1.0f, 1.0f, 16.0f, 16.0f), -2130706433, -2130706433);
CraftGUI.render.gradientRect(new IArea(1.0f, 1.0f, 16.0f, 16.0f), -2130706433, -2130706433);
}
}
}
@@ -111,8 +111,8 @@ public class ControlSlot extends ControlSlotBase {
area = this.getParent().getArea();
area.setPosition(IPoint.ZERO.sub(this.getPosition()));
}
CraftGUI.Render.colour(c);
CraftGUI.Render.texture(CraftGUITexture.Outline, area.outset(1));
CraftGUI.render.colour(c);
CraftGUI.render.texture(CraftGUITexture.Outline, area.outset(1));
}
}
@@ -41,9 +41,9 @@ public abstract class ControlSlotBase extends Control implements ITooltip {
@Override
public void onRenderBackground() {
final int size = (int) this.getSize().x();
CraftGUI.Render.texture(CraftGUITexture.Slot, this.getArea());
CraftGUI.render.texture(CraftGUITexture.Slot, this.getArea());
if (this.getSuperParent().getMousedOverWidget() == this) {
CraftGUI.Render.gradientRect(new IArea(new IPoint(1.0f, 1.0f), this.getArea().size().sub(new IPoint(2.0f, 2.0f))), -2130706433, -2130706433);
CraftGUI.render.gradientRect(new IArea(new IPoint(1.0f, 1.0f), this.getArea().size().sub(new IPoint(2.0f, 2.0f))), -2130706433, -2130706433);
}
}
@@ -20,8 +20,8 @@ public class ControlSlotCharge extends Control {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(CraftGUITexture.PanelBlack, this.getArea());
CraftGUI.Render.texturePercentage(CraftGUI.Render.getTexture(CraftGUITexture.SlotCharge), this.getArea().inset(1), Position.Bottom, this.getCharge());
CraftGUI.render.texture(CraftGUITexture.PanelBlack, this.getArea());
CraftGUI.render.texturePercentage(CraftGUI.render.getTexture(CraftGUITexture.SlotCharge), this.getArea().inset(1), Position.Bottom, this.getCharge());
}
public ControlSlotCharge(final IWidget parent, final int x, final int y, final int slot) {
@@ -24,7 +24,7 @@ public class ControlUser extends Control implements ITooltip {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(CraftGUITexture.UserButton, this.getArea());
CraftGUI.render.texture(CraftGUITexture.UserButton, this.getArea());
}
@Override
@@ -24,10 +24,10 @@ class ControlBreedingProgress extends Control {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(CraftGUITexture.PanelBlack, this.getArea());
CraftGUI.render.texture(CraftGUITexture.PanelBlack, this.getArea());
final IArea area = this.getArea().inset(1);
area.setSize(new IPoint(area.size().x() * this.percentage, area.size().y()));
CraftGUI.Render.colour(this.colour);
CraftGUI.Render.texture(ControlBreedingProgress.Progress, area);
CraftGUI.render.colour(this.colour);
CraftGUI.render.texture(ControlBreedingProgress.Progress, area);
}
}
@@ -19,7 +19,7 @@ public class ControlItemStackOption extends ControlTextOption<ItemStack> {
this.addAttribute(Attribute.MouseOver);
CraftGUIUtil.moveWidget(this.textWidget, new IPoint(22.0f, 0.0f));
this.textWidget.setSize(this.textWidget.getSize().sub(new IPoint(24.0f, 0.0f)));
final int th = (int) CraftGUI.Render.textHeight(this.textWidget.getValue(), this.textWidget.getSize().x());
final int th = (int) CraftGUI.render.textHeight(this.textWidget.getValue(), this.textWidget.getSize().x());
final int height = Math.max(20, th + 6);
this.setSize(new IPoint(this.size().x(), height));
this.textWidget.setSize(new IPoint(this.textWidget.getSize().x(), height));
@@ -26,9 +26,9 @@ class ControlMutationSymbol extends Control implements ITooltip {
public void onRenderBackground() {
super.onRenderBackground();
if (this.type == 0) {
CraftGUI.Render.texture(ControlMutationSymbol.MutationPlus, IPoint.ZERO);
CraftGUI.render.texture(ControlMutationSymbol.MutationPlus, IPoint.ZERO);
} else {
CraftGUI.Render.texture(ControlMutationSymbol.MutationArrow, IPoint.ZERO);
CraftGUI.render.texture(ControlMutationSymbol.MutationArrow, IPoint.ZERO);
}
}
@@ -24,7 +24,7 @@ class ControlSpeciexBoxOption extends ControlTextOption<IAlleleSpecies> {
}
CraftGUIUtil.moveWidget(this.textWidget, new IPoint(22.0f, 0.0f));
this.textWidget.setSize(this.textWidget.getSize().sub(new IPoint(24.0f, 0.0f)));
final int th = (int) CraftGUI.Render.textHeight(this.textWidget.getValue(), this.textWidget.getSize().x());
final int th = (int) CraftGUI.render.textHeight(this.textWidget.getValue(), this.textWidget.getSize().x());
final int height = Math.max(20, th + 6);
this.setSize(new IPoint(this.size().x(), height));
this.textWidget.setSize(new IPoint(this.textWidget.getSize().x(), height));
@@ -42,7 +42,7 @@ public class PageBranchOverview extends PageBranch {
String line = "";
final List<String> descLines = new ArrayList<>();
for (final String str : desc.split(" ")) {
if (CraftGUI.Render.textWidth(line + " " + str) > 134) {
if (CraftGUI.render.textWidth(line + " " + str) > 134) {
descLines.add(TextFormatting.ITALIC + line + TextFormatting.RESET);
line = "";
}
@@ -62,7 +62,7 @@ public class PageSpeciesOverview extends PageSpecies {
}
this.controlDescription.setValue(descBody + TextFormatting.RESET);
this.controlSignature.setValue(descSig);
final float descHeight = CraftGUI.Render.textHeight(this.controlDescription.getValue(), this.controlDescription.getSize().x());
final float descHeight = CraftGUI.render.textHeight(this.controlDescription.getValue(), this.controlDescription.getSize().x());
this.controlSignature.setPosition(new IPoint(this.controlSignature.pos().x(), this.controlDescription.getPosition().y() + descHeight + 10.0f));
}
}
@@ -16,7 +16,7 @@ public class StyleSheetManager {
private static class DefaultStyleSheet implements IStyleSheet {
@Override
public Texture getTexture(final Object key) {
return CraftGUI.ResourceManager.getTexture(key.toString());
return CraftGUI.resourceManager.getTexture(key.toString());
}
}
}
@@ -34,7 +34,7 @@ public class CraftGUIResourceManager implements IResourceManagerReloadListener {
public CraftGUIResourceManager() {
this.textureSheets = new HashMap<>();
this.textures = new HashMap<>();
CraftGUI.ResourceManager = this;
CraftGUI.resourceManager = this;
}
@Override
@@ -26,6 +26,6 @@ public enum CraftGUITextureSheet implements IBinnieTexture {
if (BinnieCore.proxy.isServer()) {
return null;
}
return CraftGUI.ResourceManager.getTextureSheet(this.name).getTexture();
return CraftGUI.resourceManager.getTextureSheet(this.name).getTexture();
}
}
@@ -29,23 +29,23 @@ public class Panel extends Control {
if (panelType instanceof MinecraftGUI.PanelType) {
switch ((MinecraftGUI.PanelType) panelType) {
case Black: {
CraftGUI.Render.texture(CraftGUITexture.PanelBlack, this.getArea());
CraftGUI.render.texture(CraftGUITexture.PanelBlack, this.getArea());
break;
}
case Gray: {
CraftGUI.Render.texture(CraftGUITexture.PanelGray, this.getArea());
CraftGUI.render.texture(CraftGUITexture.PanelGray, this.getArea());
break;
}
case Tinted: {
CraftGUI.Render.texture(CraftGUITexture.PanelTinted, this.getArea());
CraftGUI.render.texture(CraftGUITexture.PanelTinted, this.getArea());
break;
}
case Outline: {
CraftGUI.Render.texture(CraftGUITexture.Outline, this.getArea());
CraftGUI.render.texture(CraftGUITexture.Outline, this.getArea());
break;
}
case TabOutline: {
CraftGUI.Render.texture(CraftGUITexture.TabOutline, this.getArea());
CraftGUI.render.texture(CraftGUITexture.TabOutline, this.getArea());
break;
}
default: {
@@ -51,7 +51,7 @@ public class ControlBiomes extends Control implements ITooltip {
//TODO FIND COLOR
//CraftGUI.Render.colour(Biome.getBiome(i).color);
}
CraftGUI.Render.texture(CraftGUITexture.Button, new IArea(x, y, 16.0f, 16.0f));
CraftGUI.render.texture(CraftGUITexture.Button, new IArea(x, y, 16.0f, 16.0f));
}
}
@@ -64,7 +64,7 @@ public class ControlClimateBar extends Control implements ITooltip {
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(CraftGUITexture.EnergyBarBack, this.getArea());
CraftGUI.render.texture(CraftGUITexture.EnergyBarBack, this.getArea());
final int types = this.isHumidity ? 3 : 6;
final int w = (int) ((this.getSize().x() - 2.0f) / types);
for (int i = 0; i < types; ++i) {
@@ -76,10 +76,10 @@ public class ControlClimateBar extends Control implements ITooltip {
} else {
colour = this.tempColours[i];
}
CraftGUI.Render.solid(new IArea(x + 1, 1.0f, w, this.getSize().y() - 2.0f), colour);
CraftGUI.render.solid(new IArea(x + 1, 1.0f, w, this.getSize().y() - 2.0f), colour);
}
}
CraftGUI.Render.texture(CraftGUITexture.EnergyBarGlass, this.getArea());
CraftGUI.render.texture(CraftGUITexture.EnergyBarGlass, this.getArea());
}
public void setSpecies(final IAlleleBeeSpecies species) {
@@ -30,9 +30,9 @@ public class ControlChromosome extends Control implements IControlValue<IChromos
@Override
public void onRenderBackground() {
CraftGUI.Render.texture(ExtraBeeGUITexture.Chromosome, this.getArea());
CraftGUI.Render.colour(16711680);
CraftGUI.Render.texture(ExtraBeeGUITexture.Chromosome2, this.getArea());
CraftGUI.render.texture(ExtraBeeGUITexture.Chromosome, this.getArea());
CraftGUI.render.colour(16711680);
CraftGUI.render.texture(ExtraBeeGUITexture.Chromosome2, this.getArea());
}
@Override
@@ -24,10 +24,10 @@ public class ControlPunnett extends Control {
@Override
public void onRenderBackground() {
CraftGUI.Render.solid(new IArea(0.0f, ControlPunnett.boxHeight, ControlPunnett.boxWidth * 3, 1.0f), 11184810);
CraftGUI.Render.solid(new IArea(ControlPunnett.boxWidth / 2.0f, ControlPunnett.boxHeight * 2, ControlPunnett.boxWidth * 2.5f, 1.0f), 11184810);
CraftGUI.Render.solid(new IArea(ControlPunnett.boxWidth, 0.0f, 1.0f, ControlPunnett.boxHeight * 3), 11184810);
CraftGUI.Render.solid(new IArea(ControlPunnett.boxWidth * 2, ControlPunnett.boxHeight / 2.0f, 1.0f, ControlPunnett.boxHeight * 2.5f), 11184810);
CraftGUI.render.solid(new IArea(0.0f, ControlPunnett.boxHeight, ControlPunnett.boxWidth * 3, 1.0f), 11184810);
CraftGUI.render.solid(new IArea(ControlPunnett.boxWidth / 2.0f, ControlPunnett.boxHeight * 2, ControlPunnett.boxWidth * 2.5f, 1.0f), 11184810);
CraftGUI.render.solid(new IArea(ControlPunnett.boxWidth, 0.0f, 1.0f, ControlPunnett.boxHeight * 3), 11184810);
CraftGUI.render.solid(new IArea(ControlPunnett.boxWidth * 2, ControlPunnett.boxHeight / 2.0f, 1.0f, ControlPunnett.boxHeight * 2.5f), 11184810);
}
public void setup(final IChromosomeType chromosome, final IIndividual ind1, final IIndividual ind2, final ISpeciesRoot root) {
@@ -43,7 +43,7 @@ public class WindowPunnettSquare extends Window {
@Override
public void initialiseClient() {
this.setTitle("Punnett Square");
CraftGUI.Render.stylesheet(new StyleSheetPunnett());
CraftGUI.render.stylesheet(new StyleSheetPunnett());
}
static class StyleSheetPunnett extends StyleSheet {
@@ -4,6 +4,10 @@ import javax.annotation.Nonnull;
import binnie.Constants;
import forestry.api.arboriculture.IWoodType;
import forestry.api.arboriculture.TreeManager;
import forestry.api.arboriculture.WoodBlockKind;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.common.registry.GameRegistry;
public enum EnumExtraTreeLog implements IWoodType {
Apple("Apple", PlankType.ExtraTreePlanks.Apple),
@@ -68,15 +72,20 @@ public enum EnumExtraTreeLog implements IWoodType {
}
// public void addRecipe() {
// if (this.plank == null) {
// return;
// }
// final ItemStack log = this.getItemStack();
// final ItemStack result = this.plank.getStack();
// result.stackSize = 4;
// GameRegistry.addShapelessRecipe(result, new Object[]{log});
// }
public void addRecipe() {
if (this.plank == null) {
return;
}
ItemStack log = TreeManager.woodAccess.getStack(this, WoodBlockKind.LOG, false);
ItemStack result = TreeManager.woodAccess.getStack(this, WoodBlockKind.PLANKS, false);
result.stackSize = 4;
GameRegistry.addShapelessRecipe(result, log);
ItemStack logFireproof = TreeManager.woodAccess.getStack(this, WoodBlockKind.LOG, true);
ItemStack resultFireproof = TreeManager.woodAccess.getStack(this, WoodBlockKind.PLANKS, true);
resultFireproof.stackSize = 4;
GameRegistry.addShapelessRecipe(resultFireproof, logFireproof);
}
@Override
public float getHardness() {
@@ -101,8 +101,7 @@ public class PlankType {
@Override
public ItemStack getStack() {
// TODO get stack
return null; //TileEntityMetadata.getItemStack(ExtraTrees.blockPlanks, this.ordinal());
return TreeManager.woodAccess.getStack(woodType, WoodBlockKind.PLANKS, true);
}
// public IIcon loadIcon(final IIconRegister register) {
@@ -7,6 +7,7 @@ import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
public class MultiFenceRecipeEmbedded implements IRecipe {
ItemStack cached;
@@ -53,9 +54,8 @@ public class MultiFenceRecipeEmbedded implements IRecipe {
return (this.cached == null) ? new ItemStack(Blocks.OAK_FENCE) : this.cached;
}
//TODO
@Override
public ItemStack[] getRemainingItems(InventoryCrafting inv) {
return new ItemStack[0];
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
}
@@ -7,6 +7,7 @@ import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
import java.util.ArrayList;
import java.util.List;
@@ -78,10 +79,8 @@ public class MultiFenceRecipeSize implements IRecipe {
}
}
//TODO
@Override
public ItemStack[] getRemainingItems(InventoryCrafting inv) {
return new ItemStack[0];
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
}
@@ -6,6 +6,7 @@ import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
public class MultiFenceRecipeSolid implements IRecipe {
ItemStack cached;
@@ -50,9 +51,8 @@ public class MultiFenceRecipeSolid implements IRecipe {
return (this.cached == null) ? new ItemStack(Blocks.OAK_FENCE) : this.cached;
}
//TODO
@Override
public ItemStack[] getRemainingItems(InventoryCrafting inv) {
return new ItemStack[0];
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
}
}
@@ -142,8 +142,8 @@ public class ModuleItems implements IInitializable {
}
FuelManager.bronzeEngineFuel.put(ExtraTreeLiquid.Sap.get(1).getFluid(), new EngineBronzeFuel(ExtraTreeLiquid.Sap.get(1).getFluid(), 20, 10000, 1));
FuelManager.bronzeEngineFuel.put(ExtraTreeLiquid.Resin.get(1).getFluid(), new EngineBronzeFuel(ExtraTreeLiquid.Resin.get(1).getFluid(), 30, 10000, 1));
for (final EnumExtraTreeLog log : EnumExtraTreeLog.values()) {
//log.addRecipe(); //FIXME
for (EnumExtraTreeLog log : EnumExtraTreeLog.values()) {
log.addRecipe();
}
}
}
@@ -38,7 +38,7 @@ public class AnalystPageBehaviour extends ControlAnalystPage {
final String effectDesc = BinnieCore.proxy.localiseOrBlank("allele." + effect.getUID() + ".desc");
final String loc = effectDesc.equals("") ? ("Effect: " + effect.getName()) : effectDesc;
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 0.0f), loc, TextJustification.TopCenter).setColour(this.getColour());
y += (int) (CraftGUI.Render.textHeight(loc, this.w() - 8.0f) + 1.0f);
y += (int) (CraftGUI.render.textHeight(loc, this.w() - 8.0f) + 1.0f);
new ControlTextCentered(this, y, "§oWithin " + (int) (t.getX() / 2.0f) + " blocks").setColour(this.getColour());
y += 22;
}
@@ -58,7 +58,7 @@ public class AnalystPageBehaviour extends ControlAnalystPage {
final String effectDesc2 = BinnieCore.proxy.localiseOrBlank("allele." + effect2.getUID() + ".desc");
final String loc2 = effectDesc2.equals("") ? ("Effect: " + effect2.getName()) : effectDesc2;
new ControlText(this, new IArea(4.0f, y, this.w() - 8.0f, 0.0f), loc2, TextJustification.TopCenter).setColour(this.getColour());
y += (int) (CraftGUI.Render.textHeight(loc2, this.w() - 8.0f) + 1.0f);
y += (int) (CraftGUI.render.textHeight(loc2, this.w() - 8.0f) + 1.0f);
y += 22;
}
}
@@ -67,10 +67,10 @@ public class AnalystPageDatabase extends ControlAnalystPage {
@Override
public void onRenderBackground() {
CraftGUI.Render.colour(5592405);
CraftGUI.Render.texture(CraftGUITexture.TabSolid, this.getArea().inset(1));
CraftGUI.Render.colour(AnalystPageDatabase.this.getColour());
CraftGUI.Render.texture(CraftGUITexture.TabOutline, this.getArea());
CraftGUI.render.colour(5592405);
CraftGUI.render.texture(CraftGUITexture.TabSolid, this.getArea().inset(1));
CraftGUI.render.colour(AnalystPageDatabase.this.getColour());
CraftGUI.render.texture(CraftGUITexture.TabOutline, this.getArea());
super.renderTextField();
}
};
@@ -100,7 +100,7 @@ public class AnalystPageDatabase extends ControlAnalystPage {
@Override
public void onRenderBackground() {
CraftGUI.Render.text(this.getArea(), TextJustification.MiddleCenter, this.value.getName(), 16777215);
CraftGUI.render.text(this.getArea(), TextJustification.MiddleCenter, this.value.getName(), 16777215);
}
};
}
@@ -114,8 +114,8 @@ public class AnalystPageDatabase extends ControlAnalystPage {
if (!this.isEnabled()) {
return;
}
CraftGUI.Render.gradientRect(this.getArea(), 1140850688 + AnalystPageDatabase.this.getColour(), 1140850688 + AnalystPageDatabase.this.getColour());
CraftGUI.Render.solid(this.getRenderArea(), AnalystPageDatabase.this.getColour());
CraftGUI.render.gradientRect(this.getArea(), 1140850688 + AnalystPageDatabase.this.getColour(), 1140850688 + AnalystPageDatabase.this.getColour());
CraftGUI.render.solid(this.getRenderArea(), AnalystPageDatabase.this.getColour());
}
};
}
@@ -146,13 +146,13 @@ public class AnalystPageDatabase extends ControlAnalystPage {
public void onRenderBackground() {
final WindowAnalyst window = (WindowAnalyst) AnalystPageDatabase.this.getSuperParent();
if (window.getIndividual() != null && window.getIndividual().getGenome().getPrimary() == species) {
CraftGUI.Render.colour(15658734);
CraftGUI.Render.texture(CraftGUITexture.TabSolid, this.getArea().outset(1));
CraftGUI.Render.colour(AnalystPageDatabase.this.getColour());
CraftGUI.Render.texture(CraftGUITexture.TabOutline, this.getArea().outset(1));
CraftGUI.render.colour(15658734);
CraftGUI.render.texture(CraftGUITexture.TabSolid, this.getArea().outset(1));
CraftGUI.render.colour(AnalystPageDatabase.this.getColour());
CraftGUI.render.texture(CraftGUITexture.TabOutline, this.getArea().outset(1));
} else if (this.calculateIsMouseOver()) {
CraftGUI.Render.colour(15658734);
CraftGUI.Render.texture(CraftGUITexture.TabSolid, this.getArea().outset(1));
CraftGUI.render.colour(15658734);
CraftGUI.render.texture(CraftGUITexture.TabSolid, this.getArea().outset(1));
}
super.onRenderBackground();
}
@@ -52,14 +52,14 @@ public class AnalystPageDescription extends ControlAnalystPage {
new ControlTextCentered(this, y, "§o" + branchBinomial + " " + species.getBinomial() + "§r").setColour(this.getColour());
y += 20;
new ControlTextCentered(this, y, "Discovered by §l" + authority + "§r").setColour(this.getColour());
y += (int) (3.0f + CraftGUI.Render.textHeight("Discovered by §l" + authority + "§r", this.w()));
y += (int) (3.0f + CraftGUI.render.textHeight("Discovered by §l" + authority + "§r", this.w()));
new ControlTextCentered(this, y, "Genetic Complexity: " + species.getComplexity()).setColour(this.getColour());
y += 26;
final ControlText descText = new ControlText(this, new IArea(8.0f, y, this.w() - 16.0f, 0.0f), descBody + "§r", TextJustification.TopCenter);
final IWidget signatureText = new ControlText(this, new IArea(8.0f, y, this.w() - 16.0f, 0.0f), descSig + "§r", TextJustification.BottomRight);
descText.setColour(this.getColour());
signatureText.setColour(this.getColour());
final float descHeight = CraftGUI.Render.textHeight(descText.getValue(), descText.getSize().x());
final float descHeight = CraftGUI.render.textHeight(descText.getValue(), descText.getSize().x());
signatureText.setPosition(new IPoint(signatureText.pos().x(), descText.getPosition().y() + descHeight + 10.0f));
this.setSize(new IPoint(this.w(), 20.0f + signatureText.y()));
}
@@ -45,7 +45,7 @@ public class AnalystPageGenome extends ControlAnalystPage {
for (final IChromosomeType chromo : system.getActiveKaryotype()) {
final IAllele allele = active ? ind.getGenome().getActiveAllele(chromo) : ind.getGenome().getInactiveAllele(chromo);
final String alleleName = system.getAlleleName(chromo, allele);
final float height = CraftGUI.Render.textHeight(alleleName, this.w() / 2.0f - 2.0f);
final float height = CraftGUI.render.textHeight(alleleName, this.w() / 2.0f - 2.0f);
new ControlText(scaled, new IArea(0.0f, y + (height - 9.0f) / 2.0f, this.w() / 2.0f - 2.0f, 0.0f), system.getChromosomeShortName(chromo) + " :", TextJustification.TopRight).setColour(this.getColour());
new ControlText(scaled, new IArea(this.w() / 2.0f + 2.0f, y, this.w() / 2.0f - 2.0f, 0.0f), alleleName, TextJustification.TopLeft).setColour(this.getColour());
y += (int) (3.0f + height);
@@ -130,15 +130,15 @@ public class AnalystPageMutations extends ControlAnalystPage {
@Override
public void onRenderBackground() {
CraftGUI.Render.item(new IPoint(0.0f, 0.0f), system.getDefaultMember(mutation.getAllele0().getUID()));
CraftGUI.Render.item(new IPoint(28.0f, 0.0f), system.getDefaultMember(mutation.getAllele1().getUID()));
CraftGUI.render.item(new IPoint(0.0f, 0.0f), system.getDefaultMember(mutation.getAllele0().getUID()));
CraftGUI.render.item(new IPoint(28.0f, 0.0f), system.getDefaultMember(mutation.getAllele1().getUID()));
if (specificChance != mutation.getBaseChance()) {
CraftGUI.Render.colour(AnalystPageMutations.this.getMutationColour(mutation.getBaseChance()).getColour());
CraftGUI.render.colour(AnalystPageMutations.this.getMutationColour(mutation.getBaseChance()).getColour());
//CraftGUI.Render.iconItem(new IPoint(14.0f, 0.0f), ModuleItem.iconAdd0.getIcon());
CraftGUI.Render.colour(AnalystPageMutations.this.getMutationColour(specificChance).getColour());
CraftGUI.render.colour(AnalystPageMutations.this.getMutationColour(specificChance).getColour());
//CraftGUI.Render.iconItem(new IPoint(14.0f, 0.0f), ModuleItem.iconAdd1.getIcon());
} else {
CraftGUI.Render.colour(AnalystPageMutations.this.getMutationColour(mutation.getBaseChance()).getColour());
CraftGUI.render.colour(AnalystPageMutations.this.getMutationColour(mutation.getBaseChance()).getColour());
//CraftGUI.Render.iconItem(new IPoint(14.0f, 0.0f), ModuleItem.iconAdd.getIcon());
}
}
@@ -188,16 +188,16 @@ public class AnalystPageMutations extends ControlAnalystPage {
@Override
public void onRenderBackground() {
CraftGUI.Render.item(new IPoint(0.0f, 0.0f), system.getDefaultMember(speciesComb.getUID()));
CraftGUI.Render.item(new IPoint(28.0f, 0.0f), system.getDefaultMember(mutation.getTemplate()[0].getUID()));
CraftGUI.Render.colour(AnalystPageMutations.this.getMutationColour(mutation.getBaseChance()).getColour());
CraftGUI.render.item(new IPoint(0.0f, 0.0f), system.getDefaultMember(speciesComb.getUID()));
CraftGUI.render.item(new IPoint(28.0f, 0.0f), system.getDefaultMember(mutation.getTemplate()[0].getUID()));
CraftGUI.render.colour(AnalystPageMutations.this.getMutationColour(mutation.getBaseChance()).getColour());
if (specificChance2 != mutation.getBaseChance()) {
CraftGUI.Render.colour(AnalystPageMutations.this.getMutationColour(mutation.getBaseChance()).getColour());
CraftGUI.render.colour(AnalystPageMutations.this.getMutationColour(mutation.getBaseChance()).getColour());
//CraftGUI.Render.iconItem(new IPoint(14.0f, 0.0f), ModuleItem.iconArrow0.getIcon());
CraftGUI.Render.colour(AnalystPageMutations.this.getMutationColour(specificChance2).getColour());
CraftGUI.render.colour(AnalystPageMutations.this.getMutationColour(specificChance2).getColour());
//CraftGUI.Render.iconItem(new IPoint(14.0f, 0.0f), ModuleItem.iconArrow1.getIcon());
} else {
CraftGUI.Render.colour(AnalystPageMutations.this.getMutationColour(mutation.getBaseChance()).getColour());
CraftGUI.render.colour(AnalystPageMutations.this.getMutationColour(mutation.getBaseChance()).getColour());
//CraftGUI.Render.iconItem(new IPoint(14.0f, 0.0f), ModuleItem.iconArrow.getIcon());
}
}
@@ -257,7 +257,7 @@ public class AnalystPageMutations extends ControlAnalystPage {
@Override
public void onRenderBackground() {
CraftGUI.Render.text(this.getArea(), TextJustification.MiddleCenter, "UNKNOWN", 11184810);
CraftGUI.render.text(this.getArea(), TextJustification.MiddleCenter, "UNKNOWN", 11184810);
}
}
}
@@ -17,6 +17,7 @@ import forestry.api.apiculture.EnumBeeChromosome;
import forestry.api.apiculture.IBee;
import forestry.api.apiculture.IBeeGenome;
import forestry.apiculture.PluginApiculture;
import forestry.core.fluids.FluidHelper;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -42,7 +42,7 @@ public class ControlAnalystChromosome extends Control implements ITooltip {
@Override
public void onRenderBackground() {
super.onRenderBackground();
CraftGUI.Render.texture(this.isHomozygous() ? this.Homozygous : this.Heterozygous, IPoint.ZERO);
CraftGUI.render.texture(this.isHomozygous() ? this.Homozygous : this.Heterozygous, IPoint.ZERO);
}
@Override
@@ -46,7 +46,7 @@ public class ControlChromoPicker extends Control implements ITooltip {
super.onRenderBackground();
final boolean selected = this.isMouseOver();
final Texture text = selected ? this.Selected : this.Texture;
CraftGUI.Render.texture(text, IPoint.ZERO);
CraftGUI.render.texture(text, IPoint.ZERO);
}
@Override
@@ -119,7 +119,7 @@ public class ControlChromosome extends Control implements IControlValue<IChromos
}
super.onRenderBackground();
final Texture text = this.getTypeTexture();
CraftGUI.Render.texture(text, IPoint.ZERO);
CraftGUI.render.texture(text, IPoint.ZERO);
}
private Texture getTypeTexture() {
@@ -23,9 +23,9 @@ public class ControlGenesisOption extends ControlOption<Gene> {
@Override
public void onRenderBackground() {
super.onRenderBackground();
CraftGUI.Render.text(new IArea(0.0f, 0.0f, 70.0f, 22.0f), TextJustification.MiddleCenter, this.getChromosomeName(), this.getColour());
CraftGUI.Render.text(new IArea(75.0f, 0.0f, 80.0f, 22.0f), TextJustification.MiddleCenter, this.getAlleleName(), this.getColour());
CraftGUI.Render.solid(new IArea(70.0f, 2.0f, 1.0f, 16.0f), -16777216 + this.getColour());
CraftGUI.render.text(new IArea(0.0f, 0.0f, 70.0f, 22.0f), TextJustification.MiddleCenter, this.getChromosomeName(), this.getColour());
CraftGUI.render.text(new IArea(75.0f, 0.0f, 80.0f, 22.0f), TextJustification.MiddleCenter, this.getAlleleName(), this.getColour());
CraftGUI.render.solid(new IArea(70.0f, 2.0f, 1.0f, 16.0f), -16777216 + this.getColour());
}
}
@@ -48,13 +48,13 @@ public abstract class ControlToleranceBar<T extends Enum<T>> extends Control imp
@Override
public void onRenderBackground() {
CraftGUI.Render.gradientRect(this.getArea(), -1431655766, -1431655766);
CraftGUI.render.gradientRect(this.getArea(), -1431655766, -1431655766);
final float w = this.getArea().w() / this.fullSet.size();
int t = 0;
for (final T value : this.fullSet) {
final int col = (this.tolerated.contains(value) ? -16777216 : 855638016) + this.getColour(value);
final IBorder inset = new IBorder(this.tolerated.contains(value) ? 1.0f : 3.0f);
CraftGUI.Render.gradientRect(new IArea(w * t, 0.0f, w, this.h()).inset(inset), col, col);
CraftGUI.render.gradientRect(new IArea(w * t, 0.0f, w, this.h()).inset(inset), col, col);
++t;
}
}
@@ -145,14 +145,14 @@ public class WindowAnalyst extends Window {
@Override
public void onRenderBackground() {
CraftGUI.Render.colour(syst.getColour());
CraftGUI.render.colour(syst.getColour());
final int outset = (WindowAnalyst.this.getSystem() == syst) ? 1 : 0;
CraftGUI.Render.texture(CraftGUITexture.TabOutline, this.getArea().outset(outset));
CraftGUI.render.texture(CraftGUITexture.TabOutline, this.getArea().outset(outset));
if (WindowAnalyst.this.getSystem() == syst) {
CraftGUI.Render.colour(1140850688 + syst.getColour());
CraftGUI.Render.texture(CraftGUITexture.TabSolid, this.getArea().outset(outset));
CraftGUI.render.colour(1140850688 + syst.getColour());
CraftGUI.render.texture(CraftGUITexture.TabSolid, this.getArea().outset(outset));
}
CraftGUI.Render.item(new IPoint(2.0f, 2.0f), syst.getItemStackRepresentitive());
CraftGUI.render.item(new IPoint(2.0f, 2.0f), syst.getItemStackRepresentitive());
}
};
x += 22;
@@ -168,7 +168,7 @@ public class WindowAnalyst extends Window {
this.analystPanel = new Panel(this, 16.0f, 54.0f, 280.0f, 164.0f, MinecraftGUI.PanelType.Outline) {
@Override
public void onRenderBackground() {
CraftGUI.Render.gradientRect(this.getArea(), 1157627903, 1728053247);
CraftGUI.render.gradientRect(this.getArea(), 1157627903, 1728053247);
super.onRenderBackground();
}
@@ -182,8 +182,8 @@ public class WindowAnalyst extends Window {
if (this.getContent() == null) {
return;
}
CraftGUI.Render.colour(this.getContent().getColour());
CraftGUI.Render.texture(CraftGUITexture.TabOutline, this.getArea());
CraftGUI.render.colour(this.getContent().getColour());
CraftGUI.render.texture(CraftGUITexture.TabOutline, this.getArea());
}
};
new ControlScrollBar(this, sectionWidth + 2.0f - 3.0f, 6.0f, 3.0f, this.h() - 8.0f + 2.0f - 6.0f, WindowAnalyst.this.leftPage) {
@@ -195,8 +195,8 @@ public class WindowAnalyst extends Window {
if (WindowAnalyst.this.leftPage.getContent() == null) {
return;
}
CraftGUI.Render.gradientRect(this.getArea(), 1140850688 + WindowAnalyst.this.leftPage.getContent().getColour(), 1140850688 + WindowAnalyst.this.leftPage.getContent().getColour());
CraftGUI.Render.solid(this.getRenderArea(), WindowAnalyst.this.leftPage.getContent().getColour());
CraftGUI.render.gradientRect(this.getArea(), 1140850688 + WindowAnalyst.this.leftPage.getContent().getColour(), 1140850688 + WindowAnalyst.this.leftPage.getContent().getColour());
CraftGUI.render.solid(this.getRenderArea(), WindowAnalyst.this.leftPage.getContent().getColour());
}
};
WindowAnalyst.this.rightPage = new ControlScrollableContent<IWidget>(this, 3.0f + sectionWidth + 4.0f, 3.0f, sectionWidth + 2.0f, this.h() - 8.0f + 2.0f, 0.0f) {
@@ -205,8 +205,8 @@ public class WindowAnalyst extends Window {
if (this.getContent() == null) {
return;
}
CraftGUI.Render.colour(this.getContent().getColour());
CraftGUI.Render.texture(CraftGUITexture.TabOutline, this.getArea());
CraftGUI.render.colour(this.getContent().getColour());
CraftGUI.render.texture(CraftGUITexture.TabOutline, this.getArea());
}
};
new ControlScrollBar(this, sectionWidth + 2.0f - 3.0f + sectionWidth + 4.0f, 6.0f, 3.0f, this.h() - 8.0f + 2.0f - 6.0f, WindowAnalyst.this.rightPage) {
@@ -218,8 +218,8 @@ public class WindowAnalyst extends Window {
if (WindowAnalyst.this.rightPage.getContent() == null) {
return;
}
CraftGUI.Render.gradientRect(this.getArea(), 1140850688 + WindowAnalyst.this.rightPage.getContent().getColour(), 1140850688 + WindowAnalyst.this.rightPage.getContent().getColour());
CraftGUI.Render.solid(this.getRenderArea(), WindowAnalyst.this.rightPage.getContent().getColour());
CraftGUI.render.gradientRect(this.getArea(), 1140850688 + WindowAnalyst.this.rightPage.getContent().getColour(), 1140850688 + WindowAnalyst.this.rightPage.getContent().getColour());
CraftGUI.render.solid(this.getRenderArea(), WindowAnalyst.this.rightPage.getContent().getColour());
}
};
WindowAnalyst.this.analystPageSize = new IArea(1.0f, 1.0f, sectionWidth, this.h() - 8.0f);
@@ -375,10 +375,10 @@ public class WindowAnalyst extends Window {
@Override
public void onRenderBackground() {
final boolean active = this.value == WindowAnalyst.this.leftPage.getContent() || this.value == WindowAnalyst.this.rightPage.getContent();
CraftGUI.Render.colour((active ? -16777216 : 1140850688) + this.value.getColour());
CraftGUI.Render.texture(CraftGUITexture.TabSolid, this.getArea().inset(1));
CraftGUI.Render.colour(this.value.getColour());
CraftGUI.Render.texture(CraftGUITexture.TabOutline, this.getArea().inset(1));
CraftGUI.render.colour((active ? -16777216 : 1140850688) + this.value.getColour());
CraftGUI.render.texture(CraftGUITexture.TabSolid, this.getArea().inset(1));
CraftGUI.render.colour(this.value.getColour());
CraftGUI.render.texture(CraftGUITexture.TabOutline, this.getArea().inset(1));
super.onRenderBackground();
}
};