mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-28 07:56:01 +00:00
Updates for 1.11. Running but missing textures.
This commit is contained in:
1 parent
424fdaaf48
commit
f660f213f6
185 files changed
+959
-783
No files matched your search
@@ -34,6 +34,7 @@ import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
@@ -54,8 +55,6 @@ public class WindowFieldKit extends Window {
|
||||
private float analyseProgress;
|
||||
private boolean isAnalysing;
|
||||
private Map<IChromosomeType, String> info;
|
||||
@Nullable
|
||||
private ItemStack prev;
|
||||
|
||||
public WindowFieldKit(final EntityPlayer player, @Nullable final IInventory inventory, final Side side) {
|
||||
super(280, 230, player, inventory, side);
|
||||
@@ -67,7 +66,6 @@ public class WindowFieldKit extends Window {
|
||||
this.analyseProgress = 1;
|
||||
this.isAnalysing = false;
|
||||
this.info = new HashMap<>();
|
||||
this.prev = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -146,6 +144,7 @@ public class WindowFieldKit extends Window {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onUpdateClient() {
|
||||
super.onUpdateClient();
|
||||
if (this.isAnalysing) {
|
||||
@@ -154,7 +153,7 @@ public class WindowFieldKit extends Window {
|
||||
this.isAnalysing = false;
|
||||
this.analyseProgress = 1;
|
||||
final ItemStack stack = this.getWindowInventory().getStackInSlot(0);
|
||||
if (stack != null) {
|
||||
if (!stack.isEmpty()) {
|
||||
this.sendClientAction("analyse", new NBTTagCompound());
|
||||
}
|
||||
this.refreshSpecies();
|
||||
@@ -171,7 +170,7 @@ public class WindowFieldKit extends Window {
|
||||
|
||||
private void refreshSpecies() {
|
||||
final ItemStack item = this.getWindowInventory().getStackInSlot(0);
|
||||
if (item == null || !AlleleManager.alleleRegistry.isIndividual(item)) {
|
||||
if (item.isEmpty() || !AlleleManager.alleleRegistry.isIndividual(item)) {
|
||||
return;
|
||||
}
|
||||
final IIndividual ind = AlleleManager.alleleRegistry.getIndividual(item);
|
||||
@@ -214,10 +213,9 @@ public class WindowFieldKit extends Window {
|
||||
}
|
||||
if (this.isClient()) {
|
||||
final ItemStack item = this.getWindowInventory().getStackInSlot(0);
|
||||
this.prev = item;
|
||||
this.text.setValue("");
|
||||
if (item != null && !Analyser.isAnalysed(item)) {
|
||||
if (this.getWindowInventory().getStackInSlot(1) == null) {
|
||||
if (!item.isEmpty() && !Analyser.isAnalysed(item)) {
|
||||
if (this.getWindowInventory().getStackInSlot(1).isEmpty()) {
|
||||
this.text.setValue("No Paper!");
|
||||
this.isAnalysing = false;
|
||||
this.analyseProgress = 1;
|
||||
@@ -228,7 +226,7 @@ public class WindowFieldKit extends Window {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else if (item != null) {
|
||||
} else if (!item.isEmpty()) {
|
||||
this.isAnalysing = false;
|
||||
this.analyseProgress = 1;
|
||||
this.refreshSpecies();
|
||||
|
||||
@@ -139,9 +139,11 @@ public class WindowGenesis extends Window {
|
||||
return;
|
||||
}
|
||||
final IChromosomeType chromo = ((Gene) event.value).getChromosome();
|
||||
WindowGenesis.this.template[chromo.ordinal()] = ((Gene) event.value).getAllele();
|
||||
if (chromo == ((Gene) event.value).getSpeciesRoot().getSpeciesChromosomeType()) {
|
||||
WindowGenesis.this.template = ((Gene) event.value).getSpeciesRoot().getTemplate(((Gene) event.value).getAllele().getUID());
|
||||
IAllele allele = ((Gene) event.value).getAllele();
|
||||
WindowGenesis.this.template[chromo.ordinal()] = allele;
|
||||
ISpeciesRoot speciesRoot = ((Gene) event.value).getSpeciesRoot();
|
||||
if (chromo == speciesRoot.getSpeciesChromosomeType()) {
|
||||
WindowGenesis.this.template = speciesRoot.getTemplate(allele.getUID());
|
||||
}
|
||||
WindowGenesis.this.refreshTemplate(chromo);
|
||||
}
|
||||
@@ -199,10 +201,10 @@ public class WindowGenesis extends Window {
|
||||
if (side == Side.SERVER && name.equals("genesis")) {
|
||||
final ItemStack stack = new ItemStack(action);
|
||||
final InventoryPlayer playerInv = player.inventory;
|
||||
if (stack == null) {
|
||||
if (stack.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
if (playerInv.getItemStack() == null) {
|
||||
if (playerInv.getItemStack().isEmpty()) {
|
||||
playerInv.setItemStack(stack);
|
||||
} else if (playerInv.getItemStack().isItemEqual(stack) && ItemStack.areItemStackTagsEqual(playerInv.getItemStack(), stack)) {
|
||||
final int fit = stack.getMaxStackSize() - (stack.getCount() + playerInv.getItemStack().getCount());
|
||||
|
||||
@@ -12,7 +12,10 @@ import binnie.craftgui.events.EventTextEdit;
|
||||
import binnie.craftgui.events.EventWidget;
|
||||
import binnie.craftgui.resource.minecraft.CraftGUITexture;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ControlTextEdit extends Control implements IControlValue<String> {
|
||||
GuiTextField field;
|
||||
private String cachedValue;
|
||||
|
||||
@@ -18,11 +18,14 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.client.config.GuiUtils;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class RenderUtil {
|
||||
|
||||
private RenderUtil() {
|
||||
|
||||
@@ -87,10 +87,10 @@ public class ContainerCraftGUI extends Container {
|
||||
for (int i = 0; i < inventory.getSizeInventory(); ++i) {
|
||||
if (inventory.dispenseOnClose(i)) {
|
||||
ItemStack stack = inventory.getStackInSlot(i);
|
||||
if (stack != null) {
|
||||
if (!stack.isEmpty()) {
|
||||
TransferRequest transferRequest = new TransferRequest(stack, par1EntityPlayer.inventory);
|
||||
stack = transferRequest.transfer(true);
|
||||
if (stack != null) {
|
||||
if (!stack.isEmpty()) {
|
||||
par1EntityPlayer.dropItem(stack, false);
|
||||
}
|
||||
}
|
||||
@@ -123,27 +123,25 @@ public class ContainerCraftGUI extends Container {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public final ItemStack transferStackInSlot(final EntityPlayer player, final int slotID) {
|
||||
return this.shiftClick(player, slotID);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private ItemStack shiftClick(final EntityPlayer player, final int slotnumber) {
|
||||
final TransferRequest request = this.getShiftClickRequest(player, slotnumber);
|
||||
final ItemStack itemstack = request.transfer(true);
|
||||
final Slot shiftClickedSlot = this.inventorySlots.get(slotnumber);
|
||||
shiftClickedSlot.putStack(itemstack);
|
||||
shiftClickedSlot.onSlotChanged();
|
||||
return null;
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
private TransferRequest getShiftClickRequest(final EntityPlayer player, final int slotnumber) {
|
||||
final Slot shiftClickedSlot = this.inventorySlots.get(slotnumber);
|
||||
ItemStack itemstack = null;
|
||||
ItemStack itemstack = ItemStack.EMPTY;
|
||||
if (shiftClickedSlot.getHasStack()) {
|
||||
ItemStack shiftClickedStack = shiftClickedSlot.getStack();
|
||||
if (shiftClickedStack != null) {
|
||||
if (!shiftClickedStack.isEmpty()) {
|
||||
itemstack = shiftClickedStack.copy();
|
||||
}
|
||||
}
|
||||
@@ -174,7 +172,7 @@ public class ContainerCraftGUI extends Container {
|
||||
return null;
|
||||
}
|
||||
ItemStack heldItem = player.inventory.getItemStack();
|
||||
if (heldItem == null) {
|
||||
if (heldItem.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
heldItem = heldItem.copy();
|
||||
@@ -461,7 +459,7 @@ public class ContainerCraftGUI extends Container {
|
||||
final Slot slot = new CustomSlot(inventory, index);
|
||||
slot.slotNumber = slotNumber;
|
||||
this.inventorySlots.add(slotNumber, slot);
|
||||
this.inventoryItemStacks.add(slotNumber, null);
|
||||
this.inventoryItemStacks.add(slotNumber, ItemStack.EMPTY);
|
||||
return slot;
|
||||
}
|
||||
}
|
||||
@@ -13,8 +13,8 @@ import javax.annotation.Nullable;
|
||||
|
||||
public class CustomSlot extends Slot {
|
||||
@Override
|
||||
public boolean isItemValid(@Nullable final ItemStack stack) {
|
||||
return stack != null && this.inventory.isItemValidForSlot(this.getSlotIndex(), stack);
|
||||
public boolean isItemValid(final ItemStack stack) {
|
||||
return !stack.isEmpty() && this.inventory.isItemValidForSlot(this.getSlotIndex(), stack);
|
||||
}
|
||||
|
||||
public CustomSlot(final IInventory inventory, final int index) {
|
||||
@@ -38,8 +38,8 @@ public class CustomSlot extends Slot {
|
||||
public void onSlotClick(final ContainerCraftGUI container, final int dragType, final ClickType modifier, final EntityPlayer player) {
|
||||
ItemStack stack = player.inventory.getItemStack();
|
||||
//TODO modifier==mouseButton2?
|
||||
if (stack == null || modifier == ClickType.PICKUP_ALL) {
|
||||
this.putStack(null);
|
||||
if (stack.isEmpty() || modifier == ClickType.PICKUP_ALL) {
|
||||
this.putStack(ItemStack.EMPTY);
|
||||
} else {
|
||||
stack = stack.copy();
|
||||
stack.setCount(1);
|
||||
|
||||
@@ -31,7 +31,6 @@ import java.util.List;
|
||||
public class GuiCraftGUI extends GuiContainer {
|
||||
IPoint mousePos;
|
||||
private Window window;
|
||||
@Nullable
|
||||
private ItemStack draggedItem;
|
||||
|
||||
@Override
|
||||
@@ -47,6 +46,7 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
super(window.getContainer());
|
||||
this.mousePos = IPoint.ZERO;
|
||||
this.window = window;
|
||||
this.draggedItem = ItemStack.EMPTY;
|
||||
this.resize(window.getSize());
|
||||
}
|
||||
|
||||
@@ -65,7 +65,6 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
this.window.initGui();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public ItemStack getDraggedItem() {
|
||||
return this.draggedItem;
|
||||
}
|
||||
|
||||
@@ -213,6 +213,7 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
RenderUtil.setColour(16777215);
|
||||
if (this.getBackground1() != null) {
|
||||
@@ -226,7 +227,9 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onUpdateClient() {
|
||||
super.onUpdateClient();
|
||||
ControlSlot.highlighting.get(EnumHighlighting.Help).clear();
|
||||
ControlSlot.shiftClickActive = false;
|
||||
}
|
||||
@@ -239,7 +242,6 @@ public abstract class Window extends TopLevelWidget implements INetwork.RecieveG
|
||||
return this.getPlayer().getGameProfile();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public ItemStack getHeldItemStack() {
|
||||
return this.player.inventory.getItemStack();
|
||||
}
|
||||
|
||||
@@ -13,6 +13,8 @@ import binnie.craftgui.minecraft.MinecraftTooltip;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.resource.minecraft.CraftGUITexture;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@@ -22,6 +24,7 @@ public class ControlErrorState extends Control implements ITooltip {
|
||||
private int type;
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
Object texture = CraftGUITexture.StateWarning;
|
||||
if (this.errorState == null) {
|
||||
@@ -33,6 +36,7 @@ public class ControlErrorState extends Control implements ITooltip {
|
||||
super.onRenderBackground(guiWidth, guiHeight);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public ErrorState getError() {
|
||||
return Window.get(this).getContainer().getErrorState();
|
||||
}
|
||||
|
||||
@@ -10,11 +10,13 @@ import binnie.craftgui.core.renderer.RenderUtil;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.lwjgl.opencl.CL;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class ControlItemDisplay extends Control implements ITooltip {
|
||||
@Nullable
|
||||
private ItemStack itemStack;
|
||||
public boolean hastooltip;
|
||||
private boolean rotating;
|
||||
@@ -38,14 +40,15 @@ public class ControlItemDisplay extends Control implements ITooltip {
|
||||
|
||||
public ControlItemDisplay(final IWidget parent, final int x, final int y, final int size) {
|
||||
super(parent, x, y, size, size);
|
||||
this.itemStack = null;
|
||||
this.itemStack = ItemStack.EMPTY;
|
||||
this.hastooltip = false;
|
||||
this.rotating = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
if (this.itemStack == null) {
|
||||
if (this.itemStack.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -67,18 +70,18 @@ public class ControlItemDisplay extends Control implements ITooltip {
|
||||
GlStateManager.enableAlpha();
|
||||
}
|
||||
|
||||
public void setItemStack(@Nullable final ItemStack itemStack) {
|
||||
public void setItemStack(final ItemStack itemStack) {
|
||||
this.itemStack = itemStack;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public ItemStack getItemStack() {
|
||||
return this.itemStack;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
if (this.hastooltip && this.itemStack != null) {
|
||||
if (this.hastooltip && !this.itemStack.isEmpty()) {
|
||||
tooltip.add(this.itemStack.getTooltip(((Window) this.getTopParent()).getPlayer(), false));
|
||||
}
|
||||
super.getTooltip(tooltip);
|
||||
|
||||
@@ -25,6 +25,8 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@@ -75,6 +77,7 @@ public class ControlLiquidTank extends Control implements ITooltip {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
CraftGUI.render.texture(this.horizontal ? CraftGUITexture.HorizontalLiquidTank : CraftGUITexture.LiquidTank, IPoint.ZERO);
|
||||
GuiCraftGUI gui = Window.get(this).getGui();
|
||||
@@ -85,7 +88,7 @@ public class ControlLiquidTank extends Control implements ITooltip {
|
||||
final int c = -1442840576 + MinecraftTooltip.getOutline(MinecraftTooltip.Type.Error);
|
||||
RenderUtil.drawGradientRect(this.getArea().inset(1), c, c);
|
||||
} else if (this.getTopParent().getMousedOverWidget() == this) {
|
||||
if (gui.getDraggedItem() != null) {
|
||||
if (!gui.getDraggedItem().isEmpty()) {
|
||||
RenderUtil.drawGradientRect(this.getArea().inset(1), -1426089575, -1426089575);
|
||||
} else {
|
||||
RenderUtil.drawGradientRect(this.getArea().inset(1), -2130706433, -2130706433);
|
||||
@@ -130,6 +133,7 @@ public class ControlLiquidTank extends Control implements ITooltip {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderForeground(int guiWidth, int guiHeight) {
|
||||
CraftGUI.render.texture(this.horizontal ? CraftGUITexture.HorizontalLiquidTankOverlay : CraftGUITexture.LiquidTankOverlay, IPoint.ZERO);
|
||||
GuiCraftGUI gui = Window.get(this).getGui();
|
||||
|
||||
@@ -50,7 +50,7 @@ public class ControlPlayerInventory extends Control {
|
||||
}
|
||||
}
|
||||
|
||||
public void addItem(@Nullable final ItemStack item) {
|
||||
public void addItem(final ItemStack item) {
|
||||
for (final ControlSlot slot : this.slots) {
|
||||
if (!slot.slot.getHasStack()) {
|
||||
slot.slot.putStack(item);
|
||||
|
||||
@@ -13,6 +13,8 @@ import binnie.craftgui.core.renderer.RenderUtil;
|
||||
import binnie.craftgui.resource.Texture;
|
||||
import binnie.craftgui.resource.minecraft.CraftGUITexture;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class ControlSlide extends Control {
|
||||
private IArea expanded;
|
||||
@@ -35,6 +37,7 @@ public class ControlSlide extends Control {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
super.onRenderBackground(guiWidth, guiHeight);
|
||||
if (this.label != null) {
|
||||
|
||||
@@ -119,7 +119,7 @@ public class ControlSlot extends ControlSlotBase {
|
||||
}
|
||||
if (!highlighted && this.getTopParent().getMousedOverWidget() == this) {
|
||||
GuiCraftGUI gui = Window.get(this).getGui();
|
||||
if (gui.getDraggedItem() != null && !this.slot.isItemValid(gui.getDraggedItem())) {
|
||||
if (!gui.getDraggedItem().isEmpty() && !this.slot.isItemValid(gui.getDraggedItem())) {
|
||||
RenderUtil.drawGradientRect(new IArea(1, 1, 16, 16), -1426089575, -1426089575);
|
||||
} else {
|
||||
RenderUtil.drawGradientRect(new IArea(1, 1, 16, 16), -2130706433, -2130706433);
|
||||
|
||||
@@ -32,9 +32,7 @@ public abstract class ControlSlotBase extends Control implements ITooltip {
|
||||
this.addSelfEventHandler(new EventWidget.ChangeSize.Handler() {
|
||||
@Override
|
||||
public void onEvent(final EventWidget.ChangeSize event) {
|
||||
if (ControlSlotBase.this.itemDisplay != null) {
|
||||
ControlSlotBase.this.itemDisplay.setSize(ControlSlotBase.this.getSize().sub(new IPoint(2, 2)));
|
||||
}
|
||||
ControlSlotBase.this.itemDisplay.setSize(ControlSlotBase.this.getSize().sub(new IPoint(2, 2)));
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -61,14 +59,14 @@ public abstract class ControlSlotBase extends Control implements ITooltip {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
final ItemStack item = this.getItemStack();
|
||||
if (item == null) {
|
||||
if (item.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
tooltip.add(item.getTooltip(((Window) this.getTopParent()).getPlayer(), false));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public abstract ItemStack getItemStack();
|
||||
}
|
||||
@@ -5,6 +5,8 @@ import binnie.craftgui.controls.tab.ControlTab;
|
||||
import binnie.craftgui.controls.tab.ControlTabBar;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@@ -17,15 +19,15 @@ public class ControlTabIcon<T> extends ControlTab<T> {
|
||||
this.item.hastooltip = false;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public ItemStack getItemStack() {
|
||||
if (this.value instanceof IItemStackRepresentitive) {
|
||||
return ((IItemStackRepresentitive) this.value).getItemStackRepresentitive();
|
||||
}
|
||||
return null;
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onUpdateClient() {
|
||||
super.onUpdateClient();
|
||||
this.item.setItemStack(this.getItemStack());
|
||||
|
||||
@@ -6,6 +6,6 @@ import forestry.api.genetics.IClassification;
|
||||
|
||||
class ControlBranchBoxOption extends ControlTextOption<IClassification> {
|
||||
public ControlBranchBoxOption(final ControlList<IClassification> controlList, final IClassification option, final int y) {
|
||||
super(controlList, option, (option.getName() == null) ? option.getScientific() : (option.getName().contains(".") ? option.getScientific() : option.getName()), y);
|
||||
super(controlList, option, option.getName().contains(".") ? option.getScientific() : option.getName(), y);
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ import binnie.craftgui.events.EventMouse;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.craftgui.minecraft.control.ControlItemDisplay;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
@@ -28,7 +29,8 @@ public class ControlDatabaseIndividualDisplay extends ControlItemDisplay impleme
|
||||
public void setSpecies(final IAlleleSpecies species, EnumDiscoveryState state) {
|
||||
final ISpeciesRoot speciesRoot = Binnie.GENETICS.getSpeciesRoot(species);
|
||||
final BreedingSystem system = Binnie.GENETICS.getSystem(speciesRoot);
|
||||
final IIndividual ind = system.getSpeciesRoot().templateAsIndividual(system.getSpeciesRoot().getTemplate(species.getUID()));
|
||||
final IAllele[] template = system.getSpeciesRoot().getTemplate(species);
|
||||
final IIndividual ind = system.getSpeciesRoot().templateAsIndividual(template);
|
||||
super.setItemStack(system.getSpeciesRoot().getMemberStack(ind, system.getDefaultType()));
|
||||
this.species = species;
|
||||
final GameProfile username = Window.get(this).getUsername();
|
||||
|
||||
@@ -13,7 +13,10 @@ import binnie.craftgui.resource.Texture;
|
||||
import binnie.craftgui.resource.minecraft.CraftGUITextureSheet;
|
||||
import binnie.craftgui.resource.minecraft.StandardTexture;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IMutation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
class ControlMutationSymbol extends Control implements ITooltip {
|
||||
private static Texture MutationPlus = new StandardTexture(2, 94, 16, 16, CraftGUITextureSheet.Controls2);
|
||||
@@ -23,6 +26,7 @@ class ControlMutationSymbol extends Control implements ITooltip {
|
||||
private int type;
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
super.onRenderBackground(guiWidth, guiHeight);
|
||||
if (this.type == 0) {
|
||||
@@ -54,15 +58,13 @@ class ControlMutationSymbol extends Control implements ITooltip {
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
if (this.type == 1 && this.discovered) {
|
||||
final IAllele species1 = this.value.getAllele0();
|
||||
final IAllele species2 = this.value.getAllele1();
|
||||
final IAlleleSpecies species1 = this.value.getAllele0();
|
||||
final IAlleleSpecies species2 = this.value.getAllele1();
|
||||
final BreedingSystem system = ((WindowAbstractDatabase) this.getTopParent()).getBreedingSystem();
|
||||
final float chance = system.getChance(this.value, Window.get(this).getPlayer(), species1, species2);
|
||||
tooltip.add("Current Chance - " + chance + "%");
|
||||
if (this.value.getSpecialConditions() != null) {
|
||||
for (final String string : this.value.getSpecialConditions()) {
|
||||
tooltip.add(string);
|
||||
}
|
||||
for (final String string : this.value.getSpecialConditions()) {
|
||||
tooltip.add(string);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,8 +39,8 @@ public class PageSpeciesOverview extends PageSpecies {
|
||||
public void onValueChanged(final IAlleleSpecies species) {
|
||||
this.controlInd1.setSpecies(species, EnumDiscoveryState.Show);
|
||||
this.controlInd2.setSpecies(species, EnumDiscoveryState.Show);
|
||||
final String branchBinomial = (species.getBranch() != null) ? species.getBranch().getScientific() : "<Unknown>";
|
||||
final String branchName = (species.getBranch() != null) ? species.getBranch().getName() : "Unknown";
|
||||
final String branchBinomial = species.getBranch().getScientific();
|
||||
final String branchName = species.getBranch().getName();
|
||||
this.controlName.setValue(TextFormatting.UNDERLINE + species.getName());
|
||||
this.controlScientific.setValue(TextFormatting.ITALIC + branchBinomial + " " + species.getBinomial());
|
||||
this.controlAuthority.setValue(Binnie.LANGUAGE.localise("binniecore.gui.database.discovered") + ": " + TextFormatting.BOLD + species.getAuthority());
|
||||
|
||||
@@ -29,6 +29,7 @@ import forestry.api.genetics.IClassification;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -44,9 +45,13 @@ public abstract class WindowAbstractDatabase extends Window {
|
||||
private Map<IDatabaseMode, ModeWidgets> modes;
|
||||
boolean isNEI;
|
||||
private BreedingSystem system;
|
||||
@Nullable
|
||||
private Panel panelInformation;
|
||||
@Nullable
|
||||
private Panel panelSearch;
|
||||
@Nullable
|
||||
private ControlPages<IDatabaseMode> modePages;
|
||||
@Nullable
|
||||
private IAlleleSpecies gotoSpecies;
|
||||
|
||||
public void changeMode(final IDatabaseMode mode) {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package binnie.craftgui.resource.minecraft;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.resource.BinnieResource;
|
||||
import binnie.core.resource.IBinnieTexture;
|
||||
import binnie.craftgui.core.CraftGUI;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public enum CraftGUITextureSheet implements IBinnieTexture {
|
||||
Controls2("controls"),
|
||||
@@ -22,10 +23,8 @@ public enum CraftGUITextureSheet implements IBinnieTexture {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public BinnieResource getTexture() {
|
||||
if (BinnieCore.getBinnieProxy().isServer()) {
|
||||
return null;
|
||||
}
|
||||
return CraftGUI.resourceManager.getTextureSheet(this.name).getTexture();
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,8 @@ package binnie.craftgui.resource.minecraft;
|
||||
import binnie.core.resource.BinnieResource;
|
||||
import binnie.core.resource.IBinnieTexture;
|
||||
import binnie.core.resource.ResourceType;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
class ParsedTextureSheet implements IBinnieTexture {
|
||||
private String name;
|
||||
@@ -16,6 +18,7 @@ class ParsedTextureSheet implements IBinnieTexture {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public BinnieResource getTexture() {
|
||||
return new BinnieResource(this.modid, ResourceType.GUI, this.path);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user