mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-26 23:12:58 +00:00
Compare commits
4
Commits
alex/tooltip
..
mu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a68a85c0a4 | ||
|
|
750239cc04 | ||
|
|
3f8b5d2032 | ||
|
|
e2d7843159 |
No files matched your search
@@ -1,9 +1,6 @@
|
||||
package binnie.core.machines;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -27,13 +24,4 @@ public class ItemMachine extends ItemBlock {
|
||||
public String getItemStackDisplayName(ItemStack itemstack) {
|
||||
return associatedBlock.getMachineName(itemstack.getItemDamage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) {
|
||||
super.addInformation(stack, player, tooltip, advanced);
|
||||
final MachinePackage pkg = associatedBlock.getPackage(stack.getItemDamage());
|
||||
if (pkg != null) {
|
||||
pkg.addTooltip(tooltip);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package binnie.core.machines;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import binnie.core.util.I18N;
|
||||
@@ -73,6 +71,4 @@ public abstract class MachinePackage {
|
||||
public String getInformation() {
|
||||
return I18N.localise(group.getMod().getModID() + ".machine." + group.getShortUID() + "." + getUID() + ".info");
|
||||
}
|
||||
|
||||
public void addTooltip(List<String> tooltip) {}
|
||||
}
|
||||
@@ -1,19 +1,15 @@
|
||||
package binnie.core.machines.storage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.gui.BinnieCoreGUI;
|
||||
import binnie.core.machines.IMachineType;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.MachinePackage;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.core.resource.BinnieResource;
|
||||
import binnie.core.resource.IBinnieTexture;
|
||||
import binnie.core.util.I18N;
|
||||
|
||||
enum Compartment implements IMachineType {
|
||||
|
||||
@@ -41,36 +37,11 @@ enum Compartment implements IMachineType {
|
||||
|
||||
public abstract static class PackageCompartment extends MachinePackage {
|
||||
|
||||
static final int ROWS_PER_TAB = 5;
|
||||
|
||||
private final BinnieResource renderTexture;
|
||||
private final int tabs;
|
||||
private final int slotsPerTab;
|
||||
|
||||
protected PackageCompartment(String uid, IBinnieTexture renderTexture, int tabs, int slotsPerTab) {
|
||||
protected PackageCompartment(String uid, IBinnieTexture renderTexture) {
|
||||
super(uid, false);
|
||||
this.renderTexture = renderTexture.getTexture();
|
||||
this.tabs = tabs;
|
||||
this.slotsPerTab = slotsPerTab;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentBinnieCoreGUI(machine, BinnieCoreGUI.Compartment);
|
||||
new ComponentCompartmentInventory(machine, tabs, slotsPerTab);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTooltip(List<String> tooltip) {
|
||||
final int slotsPerRow = slotsPerTab / ROWS_PER_TAB;
|
||||
final int slotsTotal = this.tabs * slotsPerTab;
|
||||
tooltip.add(
|
||||
I18N.localise(
|
||||
"binniecore.machine.storage.tooltip.size",
|
||||
slotsPerRow,
|
||||
ROWS_PER_TAB,
|
||||
this.tabs,
|
||||
slotsTotal));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.core.machines.storage;
|
||||
|
||||
import binnie.core.gui.BinnieCoreGUI;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.texture.BinnieCoreTexture;
|
||||
|
||||
public class StandardCompartment {
|
||||
@@ -7,42 +9,84 @@ public class StandardCompartment {
|
||||
public static class PackageCompartment extends Compartment.PackageCompartment {
|
||||
|
||||
public PackageCompartment() {
|
||||
super("compartment", BinnieCoreTexture.Compartment, 4, 25);
|
||||
super("compartment", BinnieCoreTexture.Compartment);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentBinnieCoreGUI(machine, BinnieCoreGUI.Compartment);
|
||||
new ComponentCompartmentInventory(machine, 4, 25);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class PackageCompartmentCopper extends Compartment.PackageCompartment {
|
||||
|
||||
public PackageCompartmentCopper() {
|
||||
super("compartmentCopper", BinnieCoreTexture.CompartmentCopper, 6, 25);
|
||||
super("compartmentCopper", BinnieCoreTexture.CompartmentCopper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentBinnieCoreGUI(machine, BinnieCoreGUI.Compartment);
|
||||
new ComponentCompartmentInventory(machine, 6, 25);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class PackageCompartmentBronze extends Compartment.PackageCompartment {
|
||||
|
||||
public PackageCompartmentBronze() {
|
||||
super("compartmentBronze", BinnieCoreTexture.CompartmentBronze, 8, 25);
|
||||
super("compartmentBronze", BinnieCoreTexture.CompartmentBronze);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentBinnieCoreGUI(machine, BinnieCoreGUI.Compartment);
|
||||
new ComponentCompartmentInventory(machine, 8, 25);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class PackageCompartmentIron extends Compartment.PackageCompartment {
|
||||
|
||||
public PackageCompartmentIron() {
|
||||
super("compartmentIron", BinnieCoreTexture.CompartmentIron, 4, 50);
|
||||
super("compartmentIron", BinnieCoreTexture.CompartmentIron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentBinnieCoreGUI(machine, BinnieCoreGUI.Compartment);
|
||||
new ComponentCompartmentInventory(machine, 4, 50);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class PackageCompartmentGold extends Compartment.PackageCompartment {
|
||||
|
||||
public PackageCompartmentGold() {
|
||||
super("compartmentGold", BinnieCoreTexture.CompartmentGold, 6, 50);
|
||||
super("compartmentGold", BinnieCoreTexture.CompartmentGold);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentBinnieCoreGUI(machine, BinnieCoreGUI.Compartment);
|
||||
new ComponentCompartmentInventory(machine, 6, 50);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class PackageCompartmentDiamond extends Compartment.PackageCompartment {
|
||||
|
||||
public PackageCompartmentDiamond() {
|
||||
super("compartmentDiamond", BinnieCoreTexture.CompartmentDiamond, 8, 50);
|
||||
super("compartmentDiamond", BinnieCoreTexture.CompartmentDiamond);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentBinnieCoreGUI(machine, BinnieCoreGUI.Compartment);
|
||||
new ComponentCompartmentInventory(machine, 8, 50);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -104,7 +104,7 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
||||
tabs2 = new Integer[] { 4, 5, 6, 7 };
|
||||
}
|
||||
boolean doubleTabbed = tabs2.length > 0;
|
||||
int compartmentPageWidth = 16 + 18 * inv.getPageSize() / Compartment.PackageCompartment.ROWS_PER_TAB;
|
||||
int compartmentPageWidth = 16 + 18 * inv.getPageSize() / 5;
|
||||
int compartmentPageHeight = 106;
|
||||
int compartmentWidth = compartmentPageWidth + (doubleTabbed ? 48 : 24);
|
||||
|
||||
@@ -193,12 +193,8 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
||||
slotsIDs[k] = i++;
|
||||
}
|
||||
|
||||
new ControlSlotArray(
|
||||
thisPage,
|
||||
8,
|
||||
8,
|
||||
inv.getPageSize() / Compartment.PackageCompartment.ROWS_PER_TAB,
|
||||
Compartment.PackageCompartment.ROWS_PER_TAB).create(actions, InventoryType.Machine, slotsIDs);
|
||||
new ControlSlotArray(thisPage, 8, 8, inv.getPageSize() / 5, 5)
|
||||
.create(actions, InventoryType.Machine, slotsIDs);
|
||||
}
|
||||
MessageCraftGUI.sendToServer(actions);
|
||||
x += compartmentPageWidth;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
@@ -11,6 +13,7 @@ import binnie.core.BinnieCore;
|
||||
import binnie.core.Mods;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.core.ExtraBeeItems;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.core.Tabs;
|
||||
@@ -79,7 +82,7 @@ public class ItemHoneyComb extends ItemProduct {
|
||||
EnumHoneyComb.LATEX.addProduct(honeyDrop, 0.50f);
|
||||
EnumHoneyComb.LATEX.addProduct(beeswax, 0.85f);
|
||||
if (!OreDictionary.getOres("itemRubber").isEmpty()) {
|
||||
EnumHoneyComb.LATEX.tryAddProduct(OreDictionary.getOres("itemRubber").get(0), 1.00f);
|
||||
EnumHoneyComb.LATEX.tryAddProduct(getOreDictionary("itemRubber"), 1.00f);
|
||||
} else {
|
||||
EnumHoneyComb.LATEX.active = false;
|
||||
}
|
||||
@@ -116,7 +119,7 @@ public class ItemHoneyComb extends ItemProduct {
|
||||
|
||||
EnumHoneyComb.URANIUM.copyProducts(EnumHoneyComb.STONE);
|
||||
if (!OreDictionary.getOres("crushedUranium").isEmpty()) {
|
||||
EnumHoneyComb.URANIUM.tryAddProduct(OreDictionary.getOres("crushedUranium").get(0), 0.50f);
|
||||
EnumHoneyComb.URANIUM.tryAddProduct(getOreDictionary("crushedUranium"), 0.50f);
|
||||
}
|
||||
|
||||
EnumHoneyComb.CLAY.tryAddProduct(beeswax, 0.25f);
|
||||
@@ -133,7 +136,7 @@ public class ItemHoneyComb extends ItemProduct {
|
||||
EnumHoneyComb.ACIDIC.addProduct(beeswax, 0.80f);
|
||||
EnumHoneyComb.ACIDIC.tryAddProduct(EnumHoneyDrop.ACID, 0.50f);
|
||||
if (!OreDictionary.getOres("dustSulfur").isEmpty()) {
|
||||
EnumHoneyComb.ACIDIC.addProduct(OreDictionary.getOres("dustSulfur").get(0), 0.75f);
|
||||
EnumHoneyComb.ACIDIC.addProduct(getOreDictionary("dustSulfur"), 0.75f);
|
||||
}
|
||||
|
||||
EnumHoneyComb.VENOMOUS.addProduct(beeswax, 0.80f);
|
||||
@@ -149,7 +152,7 @@ public class ItemHoneyComb extends ItemProduct {
|
||||
EnumHoneyComb.COFFEE.addProduct(beeswax, 0.90f);
|
||||
EnumHoneyComb.COFFEE.addProduct(honeyDrop, 0.75f);
|
||||
if (!OreDictionary.getOres("dustCoffee").isEmpty()) {
|
||||
EnumHoneyComb.COFFEE.tryAddProduct(OreDictionary.getOres("dustCoffee").get(0), 0.75f);
|
||||
EnumHoneyComb.COFFEE.tryAddProduct(getOreDictionary("dustCoffee"), 0.75f);
|
||||
}
|
||||
|
||||
EnumHoneyComb.GLACIAL.tryAddProduct(EnumHoneyDrop.ICE, 0.80f);
|
||||
@@ -157,7 +160,7 @@ public class ItemHoneyComb extends ItemProduct {
|
||||
|
||||
EnumHoneyComb.SHADOW.addProduct(honeyDrop, 0.50f);
|
||||
if (!OreDictionary.getOres("dustObsidian").isEmpty()) {
|
||||
EnumHoneyComb.SHADOW.tryAddProduct(OreDictionary.getOres("dustObsidian").get(0), 0.75f);
|
||||
EnumHoneyComb.SHADOW.tryAddProduct(getOreDictionary("dustObsidian"), 0.75f);
|
||||
} else {
|
||||
EnumHoneyComb.SHADOW.active = false;
|
||||
}
|
||||
@@ -206,20 +209,20 @@ public class ItemHoneyComb extends ItemProduct {
|
||||
|
||||
EnumHoneyComb.SAWDUST.addProduct(honeyDrop, 0.25f);
|
||||
if (!OreDictionary.getOres("dustSawdust").isEmpty()) {
|
||||
EnumHoneyComb.SAWDUST.tryAddProduct(OreDictionary.getOres("dustSawdust").get(0), 1.00f);
|
||||
EnumHoneyComb.SAWDUST.tryAddProduct(getOreDictionary("dustSawdust"), 1.00f);
|
||||
} else if (!OreDictionary.getOres("sawdust").isEmpty()) {
|
||||
EnumHoneyComb.SAWDUST.tryAddProduct(OreDictionary.getOres("sawdust").get(0), 1.00f);
|
||||
EnumHoneyComb.SAWDUST.tryAddProduct(getOreDictionary("sawdust"), 1.00f);
|
||||
}
|
||||
|
||||
EnumHoneyComb.CERTUS.addProduct(honeyDrop, 0.25f);
|
||||
EnumHoneyComb.CERTUS.addProduct(new ItemStack(Items.quartz), 0.25f);
|
||||
if (!OreDictionary.getOres("dustCertusQuartz").isEmpty()) {
|
||||
EnumHoneyComb.CERTUS.tryAddProduct(OreDictionary.getOres("dustCertusQuartz").get(0), 0.20f);
|
||||
EnumHoneyComb.CERTUS.tryAddProduct(getOreDictionary("dustCertusQuartz"), 0.20f);
|
||||
}
|
||||
|
||||
EnumHoneyComb.ENDERPEARL.addProduct(honeyDrop, 0.25f);
|
||||
if (!OreDictionary.getOres("dustEnderPearl").isEmpty()) {
|
||||
EnumHoneyComb.ENDERPEARL.tryAddProduct(OreDictionary.getOres("dustEnderPearl").get(0), 0.25f);
|
||||
EnumHoneyComb.ENDERPEARL.tryAddProduct(getOreDictionary("dustEnderPearl"), 0.25f);
|
||||
}
|
||||
|
||||
EnumHoneyComb.YELLORIUM.copyProducts(EnumHoneyComb.STONE);
|
||||
@@ -259,11 +262,15 @@ public class ItemHoneyComb extends ItemProduct {
|
||||
}
|
||||
}
|
||||
|
||||
/// The item registered under `string`: MaterialLib's when it registers one, since other mods' items under the
|
||||
/// same name are copies of it, else the first registered.
|
||||
private static ItemStack getOreDictionary(String string) {
|
||||
if (!OreDictionary.getOres(string).isEmpty()) {
|
||||
return OreDictionary.getOres(string).get(0);
|
||||
List<ItemStack> ores = OreDictionary.getOres(string);
|
||||
for (ItemStack ore : ores) {
|
||||
GameRegistry.UniqueIdentifier id = GameRegistry.findUniqueIdentifierFor(ore.getItem());
|
||||
if (id != null && "materiallib".equals(id.modId)) return ore;
|
||||
}
|
||||
return null;
|
||||
return ores.isEmpty() ? null : ores.get(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -282,7 +282,6 @@ binniecore.machine.storage.tab.properties=Tab Properties
|
||||
binniecore.machine.storage.tab.properties.desc=The label, color and icon of the Tab can be altered here. Clicking on the icon with a held item will change it
|
||||
binniecore.machine.storage.tab.name=Tab Name:
|
||||
binniecore.machine.storage.tab.icon=Tab Icon:
|
||||
binniecore.machine.storage.tooltip.size=Inventory %s*%s*%s - %s Slots
|
||||
binniecore.machine.storage.tooltip.icon=Icon for Current Tab
|
||||
binniecore.machine.storage.tooltip.icon.desc=Click here with an item to change
|
||||
binniecore.machine.storage.tab.color=Color:
|
||||
|
||||
Reference in new issue
Block a user