mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-15 01:35:08 +00:00
Compare commits
14
Commits
2.6.41
..
2.6.21-pre
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d19a546ff | ||
|
|
fa41059f0b | ||
|
|
3771cc3f86 | ||
|
|
1fca9d3b1d | ||
|
|
b1a47727d9 | ||
|
|
e9178f3e79 | ||
|
|
28989257fd | ||
|
|
1b0c1bb3f3 | ||
|
|
b497ff57f6 | ||
|
|
c29ac8f8ff | ||
|
|
6c24da5270 | ||
|
|
a52f1b0926 | ||
|
|
2e159f1983 | ||
|
|
dde6c79f9e |
No files matched your search
@@ -32,7 +32,6 @@
|
||||
*.[dD][lL][lL] binary
|
||||
*.[dD][yY][lL][iI][bB] binary
|
||||
*.[pP][sS][dD] binary
|
||||
*.[pP][dD][nN] binary
|
||||
*.[tT][tT][fF] binary
|
||||
*.[oO][tT][fF] binary
|
||||
|
||||
|
||||
+4
-4
@@ -1,12 +1,12 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:ForestryMC:4.11.32:dev')
|
||||
implementation('com.github.GTNewHorizons:GTNHLib:0.11.35:dev')
|
||||
api('com.github.GTNewHorizons:ForestryMC:4.11.11:dev')
|
||||
implementation('com.github.GTNewHorizons:GTNHLib:0.9.44:dev')
|
||||
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.118-GTNH:dev')
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.78-GTNH:dev')
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.63:api')
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.57:api')
|
||||
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
|
||||
compileOnly("curse.maven:extrabiomesxl-60041:2273301")
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
#This file is generated by updateDaemonJvm
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/97d46b5ff4df0bf61e95652a190a5567/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/9ef54a08e06b0754cee9fc95ed3a3134/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/97d46b5ff4df0bf61e95652a190a5567/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/9ef54a08e06b0754cee9fc95ed3a3134/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1df82b76031285ef2e6a4f59ffe9299d/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/c7d5be6a02945ac2e045048ee54a7d32/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/97d46b5ff4df0bf61e95652a190a5567/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/9ef54a08e06b0754cee9fc95ed3a3134/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/643f404f769811f5f265fd66f7af5d89/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/38256085a73e137cb4937ea9c4807fec/redirect
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/5ee463876563a46fff651cce1bc53a4c/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/d4fd992c9557644e637ebe98263e0ae7/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/59a9771cad43219260d9aac9a8ec4d6a/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c5ee947fbfb70bc347d8d531e3a578c4/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/a4c09dd2e2d7079373d30e524bbc2829/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/8e1d9ee5d0f13e442218f6884a306da1/redirect
|
||||
toolchainVersion=25
|
||||
+1
-1
@@ -17,5 +17,5 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.27'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '2.0.24'
|
||||
}
|
||||
@@ -211,6 +211,7 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
/**
|
||||
* Cached values() array for frequent read-only operations, the array should NOT be mutated.
|
||||
*/
|
||||
|
||||
public static final TileType[] VALUES = values();
|
||||
private final String id;
|
||||
private final String name;
|
||||
|
||||
@@ -38,8 +38,8 @@ public class ItemInsulatedTube extends Item {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
for (Material mat : Material.VALUES) {
|
||||
for (Insulate ins : Insulate.VALUES) {
|
||||
for (Material mat : Material.values()) {
|
||||
for (Insulate ins : Insulate.values()) {
|
||||
list.add(new ItemStack(this, 1, mat.ordinal() + ins.ordinal() * 128));
|
||||
}
|
||||
}
|
||||
@@ -97,8 +97,6 @@ public class ItemInsulatedTube extends Item {
|
||||
Bronze(0xddc276, "bronze"),
|
||||
Iron(0xd8d8d8, "iron");
|
||||
|
||||
public static final Material[] VALUES = values();
|
||||
|
||||
private final int color;
|
||||
private final String name;
|
||||
|
||||
@@ -108,7 +106,7 @@ public class ItemInsulatedTube extends Item {
|
||||
}
|
||||
|
||||
public static Material get(int i) {
|
||||
return VALUES[i % VALUES.length];
|
||||
return values()[i % values().length];
|
||||
}
|
||||
|
||||
public int getColor() {
|
||||
@@ -129,8 +127,6 @@ public class ItemInsulatedTube extends Item {
|
||||
Stone(0x6d6d6d, "smoothStone"),
|
||||
Sandstone(0xc1b989, "sandstone");
|
||||
|
||||
public static final Insulate[] VALUES = values();
|
||||
|
||||
private final int color;
|
||||
private final String name;
|
||||
|
||||
@@ -140,7 +136,7 @@ public class ItemInsulatedTube extends Item {
|
||||
}
|
||||
|
||||
public static Insulate get(int i) {
|
||||
return values()[i / 128 % VALUES.length];
|
||||
return values()[i / 128 % values().length];
|
||||
}
|
||||
|
||||
public int getColor() {
|
||||
|
||||
@@ -48,7 +48,7 @@ public class BlockPlant extends BlockBush {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
for (Type t : Type.VALUES) {
|
||||
for (Type t : Type.values()) {
|
||||
t.icon = Botany.proxy.getIcon(register, t.name().toLowerCase());
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,7 @@ public class BlockPlant extends BlockBush {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return Type.VALUES[meta % Type.VALUES.length].icon;
|
||||
return Type.values()[meta % Type.values().length].icon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -72,7 +72,7 @@ public class BlockPlant extends BlockBush {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
for (Type type : Type.VALUES) {
|
||||
for (Type type : Type.values()) {
|
||||
list.add(type.get());
|
||||
}
|
||||
}
|
||||
@@ -135,7 +135,6 @@ public class BlockPlant extends BlockBush {
|
||||
DeadFlower("deadFlower"),
|
||||
DecayingFlower("decayingFlower");
|
||||
|
||||
public static final Type[] VALUES = values();
|
||||
public IIcon icon;
|
||||
|
||||
private final String name;
|
||||
@@ -145,7 +144,7 @@ public class BlockPlant extends BlockBush {
|
||||
}
|
||||
|
||||
public static Type get(int id) {
|
||||
return VALUES[id % VALUES.length];
|
||||
return values()[id % values().length];
|
||||
}
|
||||
|
||||
public ItemStack get() {
|
||||
|
||||
@@ -18,7 +18,7 @@ public class ItemWeed extends ItemBlock {
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
return BlockPlant.Type.VALUES[stack.getItemDamage()].getName();
|
||||
return BlockPlant.Type.values()[stack.getItemDamage()].getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,8 +17,6 @@ public class ItemMetadata extends ItemBlock {
|
||||
|
||||
public ItemMetadata(Block block) {
|
||||
super(block);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package binnie.core.craftgui;
|
||||
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Deque;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
@@ -165,14 +168,17 @@ public abstract class TopLevelWidget extends Widget implements ITopLevelWidget {
|
||||
}
|
||||
|
||||
public Deque<IWidget> calculateMousedOverWidgets() {
|
||||
Deque<IWidget> widgets = new ArrayDeque<>();
|
||||
addMousedOverWidgets(this, widgets);
|
||||
return widgets;
|
||||
Deque<IWidget> list = new ArrayDeque<>();
|
||||
for (IWidget widget : getQueuedWidgets(this)) {
|
||||
if (widget.calculateIsMouseOver()) {
|
||||
list.addLast(widget);
|
||||
}
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
private void addMousedOverWidgets(IWidget widget, Deque<IWidget> widgets) {
|
||||
if (!widget.isVisible()) return;
|
||||
|
||||
private Collection<IWidget> getQueuedWidgets(IWidget widget) {
|
||||
List<IWidget> widgets = new ArrayList<>();
|
||||
boolean addChildren = true;
|
||||
if (widget.isCroppedWidget()) {
|
||||
addChildren = widget.getCroppedZone().contains(widget.getCropWidget().getRelativeMousePosition());
|
||||
@@ -182,12 +188,11 @@ public abstract class TopLevelWidget extends Widget implements ITopLevelWidget {
|
||||
ListIterator<IWidget> li = widget.getWidgets().listIterator(widget.getWidgets().size());
|
||||
while (li.hasPrevious()) {
|
||||
IWidget child = li.previous();
|
||||
addMousedOverWidgets(child, widgets);
|
||||
widgets.addAll(getQueuedWidgets(child));
|
||||
}
|
||||
}
|
||||
if (widget.calculateIsMouseOver()) {
|
||||
widgets.addLast(widget);
|
||||
}
|
||||
widgets.add(widget);
|
||||
return widgets;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -306,22 +306,17 @@ public class Widget implements IWidget {
|
||||
}
|
||||
|
||||
onUpdateClient();
|
||||
List<IWidget> deletedWidgets = null;
|
||||
List<IWidget> deletedWidgets = new ArrayList<>();
|
||||
for (IWidget widget : getWidgets()) {
|
||||
if (widget.hasAttribute(WidgetAttribute.NEEDS_DELETION)) {
|
||||
if (deletedWidgets == null) {
|
||||
deletedWidgets = new ArrayList<>();
|
||||
}
|
||||
deletedWidgets.add(widget);
|
||||
} else {
|
||||
widget.updateClient();
|
||||
}
|
||||
}
|
||||
|
||||
if (deletedWidgets != null) {
|
||||
for (IWidget widget : deletedWidgets) {
|
||||
deleteChild(widget);
|
||||
}
|
||||
for (IWidget widget : deletedWidgets) {
|
||||
deleteChild(widget);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -188,9 +188,7 @@ public class WindowFieldKit extends Window {
|
||||
glassOffsetX *= 1.0f - analyseProgress;
|
||||
glassOffsetY += glassVY;
|
||||
glassOffsetY *= 1.0f - analyseProgress;
|
||||
if (GlassControl != null) {
|
||||
GlassControl.setOffset(new IPoint(glassOffsetX, glassOffsetY));
|
||||
}
|
||||
GlassControl.setOffset(new IPoint(glassOffsetX, glassOffsetY));
|
||||
}
|
||||
|
||||
private void refreshSpecies() {
|
||||
|
||||
@@ -201,22 +201,22 @@ public class ContainerCraftGUI extends Container {
|
||||
Slot shiftClickedSlot = inventorySlots.get(index);
|
||||
ItemStack itemstack = null;
|
||||
if (shiftClickedSlot.getHasStack()) {
|
||||
itemstack = shiftClickedSlot.getStack();
|
||||
itemstack = shiftClickedSlot.getStack().copy();
|
||||
}
|
||||
|
||||
IInventory playerInventory = player.inventory;
|
||||
IInventory entityInventory = window.getInventory();
|
||||
IInventory windowInventory = window.getWindowInventory();
|
||||
IInventory fromPlayer = (entityInventory == null) ? windowInventory : entityInventory;
|
||||
int[] target = new int[36];
|
||||
for (int i = 0; i < target.length; ++i) {
|
||||
target[i] = i;
|
||||
}
|
||||
|
||||
TransferRequest request;
|
||||
if (shiftClickedSlot.inventory == playerInventory) {
|
||||
request = new TransferRequest(itemstack, fromPlayer).setOrigin(shiftClickedSlot.inventory);
|
||||
} else {
|
||||
int[] target = new int[36];
|
||||
for (int i = 0; i < target.length; ++i) {
|
||||
target[i] = i;
|
||||
}
|
||||
request = new TransferRequest(itemstack, playerInventory).setOrigin(shiftClickedSlot.inventory)
|
||||
.setTargetSlots(target);
|
||||
}
|
||||
@@ -234,7 +234,7 @@ public class ContainerCraftGUI extends Container {
|
||||
ItemStack heldItem = player.inventory.getItemStack().copy();
|
||||
IInventory entityInventory = window.getInventory();
|
||||
heldItem = new TransferRequest(heldItem, entityInventory).setOrigin(player.inventory).setTargetSlots(new int[0])
|
||||
.setTargetTanks(new int[] { slotID }).dropOverflow(player).transfer(true);
|
||||
.setTargetTanks(new int[] { slotID }).transfer(true);
|
||||
|
||||
player.inventory.setItemStack(heldItem);
|
||||
|
||||
@@ -246,14 +246,7 @@ public class ContainerCraftGUI extends Container {
|
||||
}
|
||||
|
||||
public void handleNBT(Side side, EntityPlayer player, NBTTagCompound action) {
|
||||
if (handleNBTAction(side, player, action)) {
|
||||
sendContainerContents();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean handleNBTAction(Side side, EntityPlayer player, NBTTagCompound action) {
|
||||
final String actionType = action.getString(ACTION_TYPE);
|
||||
boolean slotRegistered = false;
|
||||
|
||||
if (side == Side.SERVER) {
|
||||
switch (actionType) {
|
||||
@@ -263,7 +256,11 @@ public class ContainerCraftGUI extends Container {
|
||||
final int slotIndex = action.getShort(SLOT_INDEX);
|
||||
final int slotNumber = action.getShort(SLOT_NUMBER);
|
||||
|
||||
slotRegistered = createSlot(InventoryType.values()[slotType % 4], slotIndex, slotNumber);
|
||||
createSlot(InventoryType.values()[slotType % 4], slotIndex, slotNumber);
|
||||
|
||||
for (ICrafting crafterObject : crafters) {
|
||||
crafterObject.sendContainerAndContentsToPlayer(this, getInventory());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -278,7 +275,6 @@ public class ContainerCraftGUI extends Container {
|
||||
if (actionType.contains(TANK_UPDATE)) onTankUpdate(action);
|
||||
}
|
||||
}
|
||||
return slotRegistered;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -311,7 +307,8 @@ public class ContainerCraftGUI extends Container {
|
||||
|
||||
if (machineSync != null) machineSync.sendGuiNBT(syncedNBT);
|
||||
|
||||
NBTTagList actions = null;
|
||||
Map<String, NBTTagCompound> sentThisTime = new HashMap<>();
|
||||
NBTTagList actions = new NBTTagList();
|
||||
|
||||
for (Map.Entry<String, NBTTagCompound> entry : syncedNBT.entrySet()) {
|
||||
final String actionType = entry.getKey();
|
||||
@@ -322,16 +319,10 @@ public class ContainerCraftGUI extends Container {
|
||||
|
||||
if (action.equals(actionPrev)) continue;
|
||||
|
||||
if (actions == null) {
|
||||
actions = new NBTTagList();
|
||||
}
|
||||
actions.appendTag(action);
|
||||
sentNBT.put(actionType, action);
|
||||
sentThisTime.put(actionType, action);
|
||||
}
|
||||
|
||||
syncedNBT.clear();
|
||||
if (actions == null) return;
|
||||
|
||||
NBTTagCompound actionsBatch = new NBTTagCompound();
|
||||
actionsBatch.setString(ACTION_TYPE, ACTION_BATCH);
|
||||
actionsBatch.setTag(ACTIONS, actions);
|
||||
@@ -342,6 +333,9 @@ public class ContainerCraftGUI extends Container {
|
||||
BinnieCore.proxy.sendToPlayer(packet, playerMP);
|
||||
}
|
||||
}
|
||||
|
||||
sentNBT.putAll(sentThisTime);
|
||||
syncedNBT.clear();
|
||||
}
|
||||
|
||||
private NBTTagCompound createErrorNBT(IErrorStateSource error) {
|
||||
@@ -492,34 +486,19 @@ public class ContainerCraftGUI extends Container {
|
||||
}
|
||||
|
||||
public void receiveNBT(Side side, EntityPlayer player, NBTTagCompound action) {
|
||||
if (receiveNBTAction(side, player, action)) {
|
||||
sendContainerContents();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean receiveNBTAction(Side side, EntityPlayer player, NBTTagCompound action) {
|
||||
String actionType = action.getString(ACTION_TYPE);
|
||||
if (actionType.equals(ACTION_BATCH)) {
|
||||
boolean slotRegistered = false;
|
||||
NBTTagList actionsBatch = action.getTagList(ACTIONS, TAG_COMPOUND);
|
||||
for (int i = 0; i < actionsBatch.tagCount(); i++) {
|
||||
slotRegistered |= receiveNBTAction(side, player, actionsBatch.getCompoundTagAt(i));
|
||||
receiveNBT(side, player, actionsBatch.getCompoundTagAt(i));
|
||||
}
|
||||
return slotRegistered;
|
||||
return;
|
||||
}
|
||||
boolean slotRegistered = handleNBTAction(side, player, action);
|
||||
handleNBT(side, player, action);
|
||||
window.receiveGuiNBT(getSide(), player, actionType, action);
|
||||
INetwork.ReceiveGuiNBT machine = Machine.getInterface(INetwork.ReceiveGuiNBT.class, window.getInventory());
|
||||
if (machine != null) {
|
||||
machine.receiveGuiNBT(getSide(), player, actionType, action);
|
||||
}
|
||||
return slotRegistered;
|
||||
}
|
||||
|
||||
private void sendContainerContents() {
|
||||
for (ICrafting crafter : crafters) {
|
||||
crafter.sendContainerAndContentsToPlayer(this, getInventory());
|
||||
}
|
||||
if (machine == null) return;
|
||||
machine.receiveGuiNBT(getSide(), player, actionType, action);
|
||||
}
|
||||
|
||||
public Slot getOrCreateSlot(InventoryType inventoryType, int slotIndex) {
|
||||
@@ -543,15 +522,13 @@ public class ContainerCraftGUI extends Container {
|
||||
};
|
||||
}
|
||||
|
||||
private boolean createSlot(InventoryType type, int index, int slotNumber) {
|
||||
if (inventorySlots.get(slotNumber) != null) return false;
|
||||
private void createSlot(InventoryType type, int index, int slotNumber) {
|
||||
if (inventorySlots.get(slotNumber) != null) return;
|
||||
|
||||
IInventory inventory = getInventory(type);
|
||||
Slot slot = new CustomSlot(inventory, index);
|
||||
slot.slotNumber = slotNumber;
|
||||
inventorySlots.add(slotNumber, slot);
|
||||
ItemStack stack = slot.getStack();
|
||||
inventoryItemStacks.add(slotNumber, stack == null ? null : stack.copy());
|
||||
return true;
|
||||
inventoryItemStacks.add(slotNumber, null);
|
||||
}
|
||||
}
|
||||
@@ -90,7 +90,6 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
zLevel = 10.0f;
|
||||
GuiScreen.itemRender.zLevel = zLevel;
|
||||
|
||||
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
|
||||
window.render();
|
||||
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
@@ -103,7 +102,7 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
InventoryPlayer playerInventory = mc.thePlayer.inventory;
|
||||
draggedItem = playerInventory.getItemStack();
|
||||
if (draggedItem != null) {
|
||||
GL11.glTranslatef(0.0f, 0.0f, 200.0f);
|
||||
renderItem(new IPoint(mouseX - 8, mouseY - 8), draggedItem, false);
|
||||
renderItem(new IPoint(mouseX - 8, mouseY - 8), draggedItem, false);
|
||||
}
|
||||
GL11.glDisable(32826); // GL_RESCALE_NORMAL_EXT
|
||||
@@ -117,6 +116,7 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
} else {
|
||||
tooltip.setType(Tooltip.Type.STANDARD);
|
||||
window.getTooltip(tooltip);
|
||||
NEIHook.renderToolTips(mouseX, mouseY);
|
||||
}
|
||||
|
||||
if (tooltip.exists()) {
|
||||
@@ -240,16 +240,12 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
|
||||
@Override
|
||||
protected void keyTyped(char c, int key) {
|
||||
boolean noFocusedWidget = window.getFocusedWidget() == null;
|
||||
NEIHook.lastKeyTyped(key, c);
|
||||
|
||||
if (noFocusedWidget) {
|
||||
NEIHook.lastKeyTyped(key, c);
|
||||
}
|
||||
|
||||
if (key == 1 || (key == mc.gameSettings.keyBindInventory.getKeyCode() && noFocusedWidget)) {
|
||||
if (key == 1 || (key == mc.gameSettings.keyBindInventory.getKeyCode() && window.getFocusedWidget() == null)) {
|
||||
mc.thePlayer.closeScreen();
|
||||
}
|
||||
IWidget origin = noFocusedWidget ? window : window.getFocusedWidget();
|
||||
IWidget origin = (window.getFocusedWidget() == null) ? window : window.getFocusedWidget();
|
||||
window.callEvent(new EventKey.Down(origin, c, key));
|
||||
}
|
||||
|
||||
@@ -448,6 +444,7 @@ public class GuiCraftGUI extends GuiContainer {
|
||||
}
|
||||
|
||||
GuiScreen.itemRender.renderItemOverlayIntoGUI(font, mc.renderEngine, item, (int) pos.x(), (int) pos.y(), null);
|
||||
GL11.glClear(256);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ import java.util.Map;
|
||||
class ListMap<T> implements List<T> {
|
||||
|
||||
private final LinkedHashMap<Integer, T> map;
|
||||
private int size;
|
||||
|
||||
ListMap() {
|
||||
map = new LinkedHashMap<>();
|
||||
@@ -18,7 +17,13 @@ class ListMap<T> implements List<T> {
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
return size;
|
||||
int i = -1;
|
||||
for (int k : map.keySet()) {
|
||||
if (k > i) {
|
||||
i = k;
|
||||
}
|
||||
}
|
||||
return i + 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -88,7 +93,6 @@ class ListMap<T> implements List<T> {
|
||||
@Override
|
||||
public void clear() {
|
||||
map.clear();
|
||||
size = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -99,14 +103,12 @@ class ListMap<T> implements List<T> {
|
||||
@Override
|
||||
public T set(int index, T element) {
|
||||
map.put(index, element);
|
||||
size = Math.max(size, index + 1);
|
||||
return element;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(int index, T element) {
|
||||
map.put(index, element);
|
||||
size = Math.max(size, index + 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -53,7 +53,6 @@ public abstract class Window extends TopLevelWidget implements INetwork.ReceiveG
|
||||
protected float titleButtonLeft;
|
||||
protected float titleButtonRight;
|
||||
private GuiCraftGUI gui;
|
||||
private Renderer renderer;
|
||||
private final ContainerCraftGUI container;
|
||||
private final WindowInventory windowInventory;
|
||||
private ControlText title;
|
||||
@@ -84,8 +83,8 @@ public abstract class Window extends TopLevelWidget implements INetwork.ReceiveG
|
||||
ControlSlot.highlighting.put(h, new ArrayList<>());
|
||||
}
|
||||
|
||||
renderer = new Renderer(gui);
|
||||
renderer.stylesheet(StyleSheetManager.getDefault());
|
||||
CraftGUI.render = new Renderer(gui);
|
||||
CraftGUI.render.stylesheet(StyleSheetManager.getDefault());
|
||||
titleButtonLeft = -14.0f;
|
||||
|
||||
if (showHelpButton()) {
|
||||
@@ -196,9 +195,6 @@ public abstract class Window extends TopLevelWidget implements INetwork.ReceiveG
|
||||
}
|
||||
|
||||
public void initGui() {
|
||||
|
||||
CraftGUI.render = renderer;
|
||||
|
||||
if (hasBeenInitialised) {
|
||||
return;
|
||||
}
|
||||
@@ -271,9 +267,7 @@ public abstract class Window extends TopLevelWidget implements INetwork.ReceiveG
|
||||
entityInventory = inventory;
|
||||
}
|
||||
|
||||
public void onClose() {
|
||||
CraftGUI.render = null;
|
||||
}
|
||||
public void onClose() {}
|
||||
|
||||
public boolean isServer() {
|
||||
return !isClient();
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package binnie.core.liquid;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
@@ -11,62 +9,32 @@ import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import binnie.core.ManagerBase;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ManagerLiquid extends ManagerBase {
|
||||
|
||||
private static final Set<String> EXTERNAL_FLUIDS = new HashSet<>();
|
||||
|
||||
static {
|
||||
EXTERNAL_FLUIDS.add("liquidnitrogen");
|
||||
}
|
||||
|
||||
private static boolean isExternalFluid(String identifier) {
|
||||
return EXTERNAL_FLUIDS.contains(identifier) && Loader.isModLoaded("gregtech_nh");
|
||||
}
|
||||
|
||||
public Map<String, IFluidType> fluids;
|
||||
private final Set<String> ownedFluids;
|
||||
|
||||
public ManagerLiquid() {
|
||||
fluids = new LinkedHashMap<>();
|
||||
ownedFluids = new HashSet<>();
|
||||
}
|
||||
|
||||
public void createLiquids(IFluidType[] liquids, int startID) {
|
||||
for (IFluidType liquid : liquids) {
|
||||
String identifier = liquid.getIdentifier().toLowerCase();
|
||||
Fluid fluid = createOrGetLiquid(liquid, startID++);
|
||||
if (fluid == null && !isExternalFluid(identifier)) {
|
||||
BinnieFluid fluid = createLiquid(liquid, startID++);
|
||||
if (fluid == null) {
|
||||
throw new RuntimeException("Liquid registered incorrectly - " + liquid.getIdentifier());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public BinnieFluid createLiquid(IFluidType fluid, int id) {
|
||||
Fluid registeredFluid = createOrGetLiquid(fluid, id);
|
||||
return (registeredFluid instanceof BinnieFluid) ? (BinnieFluid) registeredFluid : null;
|
||||
}
|
||||
|
||||
private Fluid createOrGetLiquid(IFluidType fluid, int id) {
|
||||
String identifier = fluid.getIdentifier().toLowerCase();
|
||||
fluids.put(identifier, fluid);
|
||||
Fluid registeredFluid = FluidRegistry.getFluid(identifier);
|
||||
if (registeredFluid == null && !isExternalFluid(identifier)) {
|
||||
BinnieFluid binnieFluid = new BinnieFluid(fluid);
|
||||
FluidRegistry.registerFluid(binnieFluid);
|
||||
registeredFluid = FluidRegistry.getFluid(identifier);
|
||||
ownedFluids.add(identifier);
|
||||
} else if (registeredFluid == null) {
|
||||
FMLLog.warning(
|
||||
"[Binnie] External liquid %s is not registered yet. Waiting for the owning mod to register it before postInit.",
|
||||
identifier);
|
||||
}
|
||||
fluids.put(fluid.getIdentifier().toLowerCase(), fluid);
|
||||
BinnieFluid binnieFluid = new BinnieFluid(fluid);
|
||||
FluidRegistry.registerFluid(binnieFluid);
|
||||
ItemFluidContainer.registerFluid(fluid, id);
|
||||
return registeredFluid;
|
||||
return binnieFluid;
|
||||
}
|
||||
|
||||
public FluidStack getLiquidStack(String name, int amount) {
|
||||
@@ -76,26 +44,18 @@ public class ManagerLiquid extends ManagerBase {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void reloadIcons(IIconRegister register) {
|
||||
for (IFluidType type : fluids.values()) {
|
||||
String identifier = type.getIdentifier().toLowerCase();
|
||||
FluidStack stack = getLiquidStack(identifier, 1);
|
||||
Fluid fluid = stack == null ? null : stack.getFluid();
|
||||
Fluid fluid = getLiquidStack(type.getIdentifier(), 1).getFluid();
|
||||
type.registerIcon(register);
|
||||
if (fluid == null) {
|
||||
throw new RuntimeException("[Binnie] Liquid not registered properly - " + type.getIdentifier());
|
||||
}
|
||||
if (ownedFluids.contains(identifier)) {
|
||||
fluid.setIcons(type.getIcon());
|
||||
}
|
||||
fluid.setIcons(type.getIcon());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
for (IFluidType fluid : fluids.values()) {
|
||||
String identifier = fluid.getIdentifier().toLowerCase();
|
||||
if (isExternalFluid(identifier) && FluidRegistry.getFluid(identifier) == null) {
|
||||
throw new RuntimeException("[Binnie] External liquid not registered - " + identifier);
|
||||
}
|
||||
for (FluidContainer container : FluidContainer.values()) {
|
||||
if (container.isActive() && fluid.canPlaceIn(container)) {
|
||||
container.registerContainerData(fluid);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.core.machines;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import binnie.core.util.I18N;
|
||||
@@ -52,7 +53,8 @@ public abstract class MachinePackage {
|
||||
this.group = group;
|
||||
}
|
||||
|
||||
public abstract void renderMachine(Machine machine, double x, double y, double z, float partialTick);
|
||||
public abstract void renderMachine(Machine machine, double x, double y, double z, float partialTick,
|
||||
RenderBlocks renderer);
|
||||
|
||||
public boolean isActive() {
|
||||
return active;
|
||||
|
||||
@@ -5,6 +5,7 @@ import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import binnie.Binnie;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
@@ -12,27 +13,30 @@ import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
// Hmm. It's used class
|
||||
public class RendererMachine extends TileEntitySpecialRenderer implements ISimpleBlockRenderingHandler {
|
||||
|
||||
RenderBlocks blockRenderer;
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity entity, double x, double y, double z, float partialTick) {
|
||||
renderTileEntity((TileEntityMachine) entity, x, y, z, partialTick);
|
||||
renderTileEntity((TileEntityMachine) entity, x, y, z, partialTick, blockRenderer);
|
||||
}
|
||||
|
||||
private void renderTileEntity(TileEntityMachine entity, double x, double y, double z, float partialTick) {
|
||||
public void renderTileEntity(TileEntityMachine entity, double x, double y, double z, float partialTick,
|
||||
RenderBlocks renderer) {
|
||||
if (entity != null && entity.getMachine() != null) {
|
||||
MachinePackage machinePackage = entity.getMachine().getPackage();
|
||||
machinePackage.renderMachine(entity.getMachine(), x, y, z, partialTick);
|
||||
machinePackage.renderMachine(entity.getMachine(), x, y, z, partialTick, renderer);
|
||||
}
|
||||
}
|
||||
|
||||
private void renderInvBlock(Block block, int i, int j) {
|
||||
public void renderInvBlock(RenderBlocks renderblocks, Block block, int i, int j) {
|
||||
TileEntity entity = block.createTileEntity(null, i);
|
||||
renderTileEntity((TileEntityMachine) entity, 0.0, -0.1, 0.0, 0.0625f);
|
||||
renderTileEntity((TileEntityMachine) entity, 0.0, -0.1, 0.0, 0.0625f, renderblocks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
if (modelID == Binnie.Machine.getMachineRenderID()) {
|
||||
renderInvBlock(block, metadata, modelID);
|
||||
renderInvBlock(renderer, block, metadata, modelID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +48,7 @@ public class RendererMachine extends TileEntitySpecialRenderer implements ISimpl
|
||||
&& tile.getMachine().getPackage() != null
|
||||
&& tile.getMachine().getPackage().getGroup() != null
|
||||
&& !tile.getMachine().getPackage().getGroup().customRenderer) {
|
||||
renderTileEntity(tile, x, y, z, 1.0f);
|
||||
renderTileEntity(tile, x, y, z, 1.0f, renderer);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -58,4 +62,9 @@ public class RendererMachine extends TileEntitySpecialRenderer implements ISimpl
|
||||
public int getRenderId() {
|
||||
return Binnie.Machine.getMachineRenderID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_147496_a(World par1World) {
|
||||
blockRenderer = new RenderBlocks(par1World);
|
||||
}
|
||||
}
|
||||
@@ -164,7 +164,7 @@ public class ComponentTankContainer extends MachineComponent implements ITankMac
|
||||
|
||||
@Override
|
||||
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) {
|
||||
int index = getTankIndexToDrain(from, resource);
|
||||
int index = getTankIndexToDrain(from, null);
|
||||
if (!tanks.containsKey(index)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@@ -153,8 +152,7 @@ public class ComponentPowerReceptor extends MachineComponent
|
||||
}
|
||||
|
||||
private void addToEnergyNet() {
|
||||
World world = getMachine().getWorld();
|
||||
if (world == null || world.isRemote) {
|
||||
if (getMachine().getWorld() == null) {
|
||||
return;
|
||||
}
|
||||
if (Mods.ic2.active()) {
|
||||
@@ -163,8 +161,7 @@ public class ComponentPowerReceptor extends MachineComponent
|
||||
}
|
||||
|
||||
private void removeFromEnergyNet() {
|
||||
World world = getMachine().getWorld();
|
||||
if (world == null || world.isRemote) {
|
||||
if (getMachine().getWorld() == null) {
|
||||
return;
|
||||
}
|
||||
if (Mods.ic2.active()) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.core.machines.storage;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@@ -50,7 +51,8 @@ enum Compartment implements IMachineType {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderMachine(Machine machine, double x, double y, double z, float partialTick) {
|
||||
public void renderMachine(Machine machine, double x, double y, double z, float partialTick,
|
||||
RenderBlocks renderer) {
|
||||
MachineRendererCompartment.instance.renderMachine(machine, renderTexture, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,6 @@ class ComponentCompartmentInventory extends ComponentInventorySlots implements I
|
||||
private final int numberOfTabs;
|
||||
private final int slotsPerPage;
|
||||
private final Map<Integer, CompartmentTab> tabs;
|
||||
private NBTTagCompound cachedGuiNBT;
|
||||
|
||||
public ComponentCompartmentInventory(IMachine machine, int sections) {
|
||||
this(machine, sections, 4);
|
||||
@@ -52,24 +51,21 @@ class ComponentCompartmentInventory extends ComponentInventorySlots implements I
|
||||
public CompartmentTab getTab(int i) {
|
||||
if (!tabs.containsKey(i)) {
|
||||
tabs.put(i, new CompartmentTab(i));
|
||||
cachedGuiNBT = null;
|
||||
}
|
||||
return tabs.get(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendGuiNBT(Map<String, NBTTagCompound> nbts) {
|
||||
if (cachedGuiNBT == null) {
|
||||
NBTTagList list = new NBTTagList();
|
||||
for (int i = 0; i < numberOfTabs; ++i) {
|
||||
NBTTagCompound tabNBT = new NBTTagCompound();
|
||||
getTab(i).writeToNBT(tabNBT);
|
||||
list.appendTag(tabNBT);
|
||||
}
|
||||
cachedGuiNBT = new NBTTagCompound();
|
||||
cachedGuiNBT.setTag("tabs", list);
|
||||
NBTTagList list = new NBTTagList();
|
||||
for (int i = 0; i < numberOfTabs; ++i) {
|
||||
NBTTagCompound nbt2 = new NBTTagCompound();
|
||||
getTab(i).writeToNBT(nbt2);
|
||||
list.appendTag(nbt2);
|
||||
}
|
||||
nbts.put("comp-tabs", cachedGuiNBT);
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setTag("tabs", list);
|
||||
nbts.put("comp-tabs", tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -82,13 +78,11 @@ class ComponentCompartmentInventory extends ComponentInventorySlots implements I
|
||||
tab.readFromNBT(tag);
|
||||
tabs.put(tab.getId(), tab);
|
||||
}
|
||||
cachedGuiNBT = null;
|
||||
}
|
||||
if (name.equals("comp-change-tab")) {
|
||||
CompartmentTab tab2 = new CompartmentTab(0);
|
||||
tab2.readFromNBT(nbt);
|
||||
tabs.put(tab2.getId(), tab2);
|
||||
cachedGuiNBT = null;
|
||||
getMachine().getTileEntity().markDirty();
|
||||
}
|
||||
}
|
||||
@@ -103,7 +97,6 @@ class ComponentCompartmentInventory extends ComponentInventorySlots implements I
|
||||
tab.readFromNBT(tag);
|
||||
tabs.put(tab.getId(), tab);
|
||||
}
|
||||
cachedGuiNBT = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -173,7 +173,6 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
||||
}
|
||||
CraftGUIUtil.linkWidgets(tab, compartmentPages);
|
||||
int i = 0;
|
||||
final NBTTagList actions = new NBTTagList();
|
||||
for (int p2 = 0; p2 < inv.getTabNumber(); ++p2) {
|
||||
ControlPage thisPage = page[p2];
|
||||
Panel panel = new Panel(thisPage, 0.0f, 0.0f, thisPage.w(), thisPage.h(), MinecraftGUI.PanelType.Black) {
|
||||
@@ -192,10 +191,11 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
||||
slotsIDs[k] = i++;
|
||||
}
|
||||
|
||||
final NBTTagList actions = new NBTTagList();
|
||||
new ControlSlotArray(thisPage, 8, 8, inv.getPageSize() / 5, 5)
|
||||
.create(actions, InventoryType.Machine, slotsIDs);
|
||||
MessageCraftGUI.sendToServer(actions);
|
||||
}
|
||||
MessageCraftGUI.sendToServer(actions);
|
||||
x += compartmentPageWidth;
|
||||
if (tabs2.length > 0) {
|
||||
ControlTabBar<Integer> tab2 = new ControlTabBar<Integer>(
|
||||
@@ -256,8 +256,8 @@ public class WindowCompartment extends WindowMachine implements IWindowAffectsSh
|
||||
ControlSlide slide = new ControlSlide(this, 0.0f, 134.0f, 136.0f, 92.0f, Position.LEFT);
|
||||
slide.setLabel(I18N.localise("binniecore.machine.storage.tab.properties"));
|
||||
slide.setSlide(false);
|
||||
slide.addHelp(I18N.localise("binniecore.machine.storage.tab.properties"));
|
||||
slide.addHelp(I18N.localise("binniecore.machine.storage.tab.properties.desc"));
|
||||
slide.addHelp(I18N.localise("binniecore.machine.storage.tooltip.properties"));
|
||||
slide.addHelp(I18N.localise("binniecore.machine.storage.tooltip.properties.desc"));
|
||||
Panel tabPropertyPanel = new Panel(slide, 16.0f, 8.0f, 112.0f, 76.0f, MinecraftGUI.PanelType.Gray);
|
||||
int y2 = 4;
|
||||
new ControlText(tabPropertyPanel, new IPoint(4.0f, y2), I18N.localise("binniecore.machine.storage.tab.name"));
|
||||
|
||||
@@ -3,7 +3,6 @@ package binnie.core.machines.transfer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
@@ -26,20 +25,23 @@ public class TransferRequest {
|
||||
private int[] targetTanks;
|
||||
private boolean transferLiquids;
|
||||
private boolean ignoreReadOnly;
|
||||
private EntityPlayer overflowPlayer;
|
||||
private List<TransferSlot> insertedSlots;
|
||||
private List<Integer> insertedTanks;
|
||||
private final List<TransferSlot> insertedSlots;
|
||||
private final List<Integer> insertedTanks;
|
||||
|
||||
public TransferRequest(ItemStack toTransfer, IInventory destination) {
|
||||
itemToTransfer = null;
|
||||
returnItem = null;
|
||||
targetSlots = null;
|
||||
targetSlots = new int[0];
|
||||
targetTanks = new int[0];
|
||||
transferLiquids = true;
|
||||
ignoreReadOnly = false;
|
||||
overflowPlayer = null;
|
||||
insertedSlots = null;
|
||||
insertedTanks = null;
|
||||
insertedSlots = new ArrayList<>();
|
||||
insertedTanks = new ArrayList<>();
|
||||
int[] target = new int[destination.getSizeInventory()];
|
||||
|
||||
for (int i = 0; i < target.length; ++i) {
|
||||
target[i] = i;
|
||||
}
|
||||
|
||||
int[] targetTanks = new int[0];
|
||||
if (destination instanceof ITankMachine) {
|
||||
@@ -56,6 +58,7 @@ public class TransferRequest {
|
||||
|
||||
setOrigin(null);
|
||||
setDestination(destination);
|
||||
setTargetSlots(target);
|
||||
setTargetTanks(targetTanks);
|
||||
transferLiquids = true;
|
||||
}
|
||||
@@ -92,71 +95,59 @@ public class TransferRequest {
|
||||
return this;
|
||||
}
|
||||
|
||||
public TransferRequest dropOverflow(EntityPlayer player) {
|
||||
overflowPlayer = player;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemStack getReturnItem() {
|
||||
return returnItem;
|
||||
}
|
||||
|
||||
public ItemStack transfer(boolean doAdd) {
|
||||
ItemStack item = doAdd || returnItem == null ? returnItem : returnItem.copy();
|
||||
ItemStack item = returnItem;
|
||||
if (item == null || destination == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (transferLiquids && destination instanceof ITankMachine) {
|
||||
for (int tankID : targetTanks) {
|
||||
ItemStack itemBeforeTransfer = item.copy();
|
||||
item = transferToTank(item, origin, (ITankMachine) destination, tankID, doAdd);
|
||||
if (item == null || !ItemStack.areItemStacksEqual(item, itemBeforeTransfer)) {
|
||||
break;
|
||||
}
|
||||
|
||||
item = transferFromTank(item, origin, (ITankMachine) destination, tankID, doAdd);
|
||||
if (item == null || !ItemStack.areItemStacksEqual(item, itemBeforeTransfer)) {
|
||||
break;
|
||||
if (item != null) {
|
||||
item = transferFromTank(item, origin, (ITankMachine) destination, tankID, doAdd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO simplify
|
||||
if (item != null) {
|
||||
int[] slots = getTargetSlots();
|
||||
for (int slot : slots) {
|
||||
for (int slot : targetSlots) {
|
||||
if (destination.isItemValidForSlot(slot, item) || ignoreReadOnly) {
|
||||
if (!(destination instanceof IInventorySlots)
|
||||
|| ((IInventorySlots) destination).getSlot(slot) == null
|
||||
|| !((IInventorySlots) destination).getSlot(slot).isRecipe()) {
|
||||
ItemStack merged = destination.getStackInSlot(slot);
|
||||
if (merged != null && item.isStackable()
|
||||
&& destination.getInventoryStackLimit() > 1
|
||||
&& areItemsEqual(item, merged)) {
|
||||
int amount = Math.min(item.stackSize, merged.getMaxStackSize() - merged.stackSize);
|
||||
if (amount > 0) {
|
||||
getInsertedSlots().add(new TransferSlot(slot, destination));
|
||||
if (doAdd) {
|
||||
ItemStack newStack = merged.copy();
|
||||
newStack.stackSize += amount;
|
||||
destination.setInventorySlotContents(slot, newStack);
|
||||
if (destination.getStackInSlot(slot) != null) {
|
||||
if (item.isStackable() && destination.getInventoryStackLimit() > 1) {
|
||||
ItemStack merged = destination.getStackInSlot(slot).copy();
|
||||
ItemStack[] newStacks = mergeStacks(item.copy(), merged.copy());
|
||||
item = newStacks[0];
|
||||
if (!areItemsEqual(merged, newStacks[1])) {
|
||||
insertedSlots.add(new TransferSlot(slot, destination));
|
||||
}
|
||||
if (doAdd) {
|
||||
destination.setInventorySlotContents(slot, newStacks[1]);
|
||||
}
|
||||
if (item == null) {
|
||||
return null;
|
||||
}
|
||||
item.stackSize -= amount;
|
||||
if (item.stackSize <= 0) return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int slot : slots) {
|
||||
for (int slot : targetSlots) {
|
||||
if (destination.isItemValidForSlot(slot, item) || ignoreReadOnly) {
|
||||
if (!(destination instanceof IInventorySlots)
|
||||
|| ((IInventorySlots) destination).getSlot(slot) == null
|
||||
|| !((IInventorySlots) destination).getSlot(slot).isRecipe()) {
|
||||
if (destination.getStackInSlot(slot) == null) {
|
||||
getInsertedSlots().add(new TransferSlot(slot, destination));
|
||||
insertedSlots.add(new TransferSlot(slot, destination));
|
||||
if (doAdd) {
|
||||
ItemStack movedStack = item.copy();
|
||||
if (movedStack.stackSize > destination.getInventoryStackLimit()) {
|
||||
@@ -209,13 +200,11 @@ public class TransferRequest {
|
||||
|
||||
private ItemStack transferToTankUsingFluidContainer(ItemStack item, IInventory origin, ITankMachine destination,
|
||||
int tankID, boolean doAdd) {
|
||||
if (item == null || origin == null || !(item.getItem() instanceof IFluidContainerItem fluidContainer)) {
|
||||
if (item == null || !(item.getItem() instanceof IFluidContainerItem fluidContainer)) {
|
||||
return item;
|
||||
}
|
||||
|
||||
ItemStack singleContainer = item.copy();
|
||||
singleContainer.stackSize = 1;
|
||||
FluidStack fluid = fluidContainer.getFluid(singleContainer);
|
||||
FluidStack fluid = fluidContainer.getFluid(item);
|
||||
if (fluid == null) {
|
||||
return item;
|
||||
}
|
||||
@@ -227,22 +216,11 @@ public class TransferRequest {
|
||||
}
|
||||
|
||||
int maxFill = tank.fill(fluid, false);
|
||||
FluidStack toTake = fluidContainer.drain(singleContainer, maxFill, true);
|
||||
if (toTake == null || toTake.amount <= 0) {
|
||||
return item;
|
||||
}
|
||||
|
||||
TransferRequest containerDump = createContainerDump(singleContainer, origin);
|
||||
boolean dropContainer = containerDump.transfer(false) != null;
|
||||
if (dropContainer && overflowPlayer == null) {
|
||||
return item;
|
||||
}
|
||||
|
||||
FluidStack toTake = fluidContainer.drain(item, maxFill, true);
|
||||
if (doAdd) {
|
||||
tank.fill(toTake, true);
|
||||
dumpContainer(singleContainer, containerDump, dropContainer);
|
||||
}
|
||||
return removeSingleContainer(item);
|
||||
return item;
|
||||
}
|
||||
|
||||
private ItemStack transferToTankUsingContainerData(ItemStack item, IInventory origin, ITankMachine destination,
|
||||
@@ -327,69 +305,24 @@ public class TransferRequest {
|
||||
|
||||
private ItemStack transferFromTankUsingFluidContainer(ItemStack item, IInventory origin, ITankMachine destination,
|
||||
int tankID, boolean doAdd) {
|
||||
if (item == null || origin == null || !(item.getItem() instanceof IFluidContainerItem fluidContainer)) {
|
||||
if (item == null || !(item.getItem() instanceof IFluidContainerItem fluidContainer)) {
|
||||
return item;
|
||||
}
|
||||
|
||||
ItemStack singleContainer = item.copy();
|
||||
singleContainer.stackSize = 1;
|
||||
IFluidTank tank = destination.getTanks()[tankID];
|
||||
FluidStack fluid = tank.getFluid();
|
||||
if (fluid == null) {
|
||||
return item;
|
||||
}
|
||||
|
||||
int amount = fluidContainer.fill(singleContainer, fluid, false);
|
||||
FluidStack drained = tank.drain(amount, false);
|
||||
if (drained == null || drained.amount <= 0) {
|
||||
int amount = fluidContainer.fill(item, fluid, false);
|
||||
amount = Math.min(amount, (tank.drain(amount, false) == null) ? 0 : tank.drain(amount, false).amount);
|
||||
if (amount <= 0) {
|
||||
return item;
|
||||
}
|
||||
|
||||
int amountFilled = fluidContainer.fill(singleContainer, drained, true);
|
||||
if (amountFilled <= 0) {
|
||||
return item;
|
||||
}
|
||||
|
||||
TransferRequest containerDump = createContainerDump(singleContainer, origin);
|
||||
boolean dropContainer = containerDump.transfer(false) != null;
|
||||
if (dropContainer && overflowPlayer == null) {
|
||||
return item;
|
||||
}
|
||||
|
||||
if (doAdd) {
|
||||
tank.drain(amountFilled, true);
|
||||
dumpContainer(singleContainer, containerDump, dropContainer);
|
||||
}
|
||||
return removeSingleContainer(item);
|
||||
}
|
||||
|
||||
private TransferRequest createContainerDump(ItemStack container, IInventory origin) {
|
||||
TransferRequest containerDump = new TransferRequest(container, origin).setTargetTanks(new int[0]);
|
||||
if (overflowPlayer != null && origin == overflowPlayer.inventory) {
|
||||
int[] mainInventorySlots = new int[overflowPlayer.inventory.mainInventory.length];
|
||||
for (int i = 0; i < mainInventorySlots.length; ++i) {
|
||||
mainInventorySlots[i] = i;
|
||||
}
|
||||
containerDump.setTargetSlots(mainInventorySlots);
|
||||
}
|
||||
return containerDump;
|
||||
}
|
||||
|
||||
private void dumpContainer(ItemStack container, TransferRequest containerDump, boolean dropContainer) {
|
||||
if (dropContainer) {
|
||||
overflowPlayer.dropPlayerItemWithRandomChoice(container.copy(), false);
|
||||
} else {
|
||||
containerDump.transfer(true);
|
||||
}
|
||||
}
|
||||
|
||||
private static ItemStack removeSingleContainer(ItemStack item) {
|
||||
if (item.stackSize <= 1) {
|
||||
return null;
|
||||
}
|
||||
ItemStack leftover = item.copy();
|
||||
--leftover.stackSize;
|
||||
return leftover;
|
||||
fluidContainer.fill(item, tank.drain(amount, doAdd), doAdd);
|
||||
return item;
|
||||
}
|
||||
|
||||
private ItemStack transferFromTankUsingContainerData(ItemStack item, IInventory origin, ITankMachine destination,
|
||||
@@ -466,16 +399,10 @@ public class TransferRequest {
|
||||
}
|
||||
|
||||
public List<TransferSlot> getInsertedSlots() {
|
||||
if (insertedSlots == null) {
|
||||
insertedSlots = new ArrayList<>();
|
||||
}
|
||||
return insertedSlots;
|
||||
}
|
||||
|
||||
public List<Integer> getInsertedTanks() {
|
||||
if (insertedTanks == null) {
|
||||
insertedTanks = new ArrayList<>();
|
||||
}
|
||||
return insertedTanks;
|
||||
}
|
||||
|
||||
@@ -492,12 +419,6 @@ public class TransferRequest {
|
||||
}
|
||||
|
||||
public int[] getTargetSlots() {
|
||||
if (targetSlots == null) {
|
||||
targetSlots = new int[destination.getSizeInventory()];
|
||||
for (int i = 0; i < targetSlots.length; ++i) {
|
||||
targetSlots[i] = i;
|
||||
}
|
||||
}
|
||||
return targetSlots;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@@ -65,7 +66,8 @@ public enum AlvearyMachine implements IMachineType {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderMachine(Machine machine, double x, double y, double z, float partialTick) {
|
||||
public void renderMachine(Machine machine, double x, double y, double z, float partialTick,
|
||||
RenderBlocks renderer) {
|
||||
MachineRendererBlock.instance.renderMachine(machineTexture, x, y, z, partialTick);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -1,11 +1,11 @@
|
||||
package binnie.genetics.config;
|
||||
package binnie.extrabees.config;
|
||||
|
||||
import static binnie.genetics.Genetics.GENETICS_MODID;
|
||||
import static binnie.extrabees.ExtraBees.EB_MODID;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.config.Config;
|
||||
|
||||
@Config(modid = GENETICS_MODID)
|
||||
public class GeneticsConfig {
|
||||
@Config(modid = EB_MODID)
|
||||
public class EBConfigMachines {
|
||||
|
||||
@Config.Comment("Percentage chance of Isolator consuming bee. 0 never consumes, 1 always does.")
|
||||
@Config.RangeFloat(min = 0f, max = 1f)
|
||||
@@ -58,7 +58,7 @@ public interface ILogType {
|
||||
Rosewood("rosewood", 0x998666, PlankType.ExtraTreePlanks.Rosewood),
|
||||
Purpleheart("purpleheart", 0x9392a2, PlankType.ExtraTreePlanks.Purpleheart),
|
||||
Iroko("iroko", 0x605c5b, PlankType.ExtraTreePlanks.Iroko),
|
||||
Ginkgo("ginkgo", 0xadae9c, PlankType.ExtraTreePlanks.Ginkgo),
|
||||
Gingko("gingko", 0xadae9c, PlankType.ExtraTreePlanks.Gingko),
|
||||
Eucalyptus("eucalyptus", 0xeadeda, PlankType.ExtraTreePlanks.Eucalyptus),
|
||||
Eucalyptus2("eucalyptus", 0x867e65, PlankType.ExtraTreePlanks.Eucalyptus),
|
||||
Box("box", 0xab6f57, PlankType.ExtraTreePlanks.Box),
|
||||
|
||||
@@ -22,6 +22,8 @@ public class ItemETSlab extends ItemMetadata {
|
||||
theHalfSlab = (BlockETSlab) ExtraTrees.blockSlab;
|
||||
doubleSlab = (BlockETSlab) ExtraTrees.blockDoubleSlab;
|
||||
isFullBlock = (block != theHalfSlab);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,8 +19,6 @@ public class ItemETStairs extends ItemBlock {
|
||||
super(block);
|
||||
setCreativeTab(CreativeTabs.tabBlock);
|
||||
setUnlocalizedName("stairs");
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -67,7 +67,7 @@ public class PlankType {
|
||||
Olive(0xb0ad88),
|
||||
Sweetgum(0xd59658),
|
||||
Rosewood(0x761500),
|
||||
Ginkgo(0xf4e7ba),
|
||||
Gingko(0xf4e7ba),
|
||||
PinkIvory(0xec8ca0);
|
||||
|
||||
/**
|
||||
|
||||
@@ -69,7 +69,7 @@ public enum ExtraTreeFruitGene implements IAlleleFruit, IFruitProvider {
|
||||
Acorn(6, 0x72b226, 0xad6a1d, FruitSprite.Tiny),
|
||||
Elderberry(9, 0x71975d, 0x515b43, FruitSprite.Tiny),
|
||||
Olive(9, 0x879e35, 0x62572a, FruitSprite.Small),
|
||||
GinkgoNut(7, 0x8c975b, 0xe5daad, FruitSprite.Tiny),
|
||||
GingkoNut(7, 0x8c975b, 0xe5daad, FruitSprite.Tiny),
|
||||
Coffee(8, 0x716d1d, 0xf84f66, FruitSprite.Tiny),
|
||||
Pear(10, 0x9f8f51, 0x9fd551, FruitSprite.Pear),
|
||||
OsangeOsange(10, 0x979752, 0xa2bf27, FruitSprite.Larger),
|
||||
@@ -205,8 +205,8 @@ public enum ExtraTreeFruitGene implements IAlleleFruit, IFruitProvider {
|
||||
ExtraTreeFruitGene.Elderberry.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.Olive.addProduct(Food.Olive.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Olive.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.GinkgoNut.addProduct(Food.GinkgoNut.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.GinkgoNut.setFamily(familyNuts);
|
||||
ExtraTreeFruitGene.GingkoNut.addProduct(Food.GingkoNut.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.GingkoNut.setFamily(familyNuts);
|
||||
ExtraTreeFruitGene.Coffee.addProduct(Food.Coffee.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Coffee.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Pear.addProduct(Food.Pear.get(1), 1.0f);
|
||||
|
||||
@@ -125,7 +125,7 @@ public class ExtraTreeMutation implements ITreeMutation {
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Brazilwood, getVanilla("Kapok"), ExtraTreeSpecies.Purpleheart, 10);
|
||||
new ExtraTreeMutation(getVanilla("Ebony"), getVanilla("Teak"), ExtraTreeSpecies.Rosewood, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Rosewood, getVanilla("Kapok"), ExtraTreeSpecies.Logwood, 10);
|
||||
new ExtraTreeMutation(getVanilla("Wenge"), getVanilla("Lime"), ExtraTreeSpecies.Ginkgo, 10);
|
||||
new ExtraTreeMutation(getVanilla("Wenge"), getVanilla("Lime"), ExtraTreeSpecies.Gingko, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Beech, getVanilla("Jungle"), ExtraTreeSpecies.Brazilnut, 10);
|
||||
new ExtraTreeMutation(getVanilla("Balsa"), getVanilla("Jungle"), ExtraTreeSpecies.RoseGum, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.RoseGum, getVanilla("Mahogony"), ExtraTreeSpecies.SwampGum, 10);
|
||||
@@ -165,8 +165,8 @@ public class ExtraTreeMutation implements ITreeMutation {
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Allspice, ExtraTreeSpecies.Clove, ExtraTreeSpecies.StarAnise, 10);
|
||||
new ExtraTreeMutation(getVanilla("Jungle"), ExtraTreeSpecies.Orange, ExtraTreeSpecies.Mango, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.StarAnise, ExtraTreeSpecies.Mango, ExtraTreeSpecies.Starfruit, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Hazel, ExtraTreeSpecies.Ginkgo, ExtraTreeSpecies.Candlenut, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Hazel, ExtraTreeSpecies.Ginkgo, ExtraTreeSpecies.Chilli, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Hazel, ExtraTreeSpecies.Gingko, ExtraTreeSpecies.Candlenut, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Hazel, ExtraTreeSpecies.Gingko, ExtraTreeSpecies.Chilli, 10);
|
||||
new ExtraTreeMutation(ExtraTreeSpecies.Hazel, ExtraTreeSpecies.Alder, ExtraTreeSpecies.DwarfHazel, 10);
|
||||
}
|
||||
|
||||
|
||||
@@ -187,7 +187,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
Rosewood("dalbergia", "latifolia", 0x879b22, ILogType.ExtraTreeLog.Rosewood, null, WorldGenRosewood.class),
|
||||
Purpleheart("peltogyne", "spp.", 0x778f55, ILogType.ExtraTreeLog.Purpleheart, null, WorldGenPurpleheart.class),
|
||||
Iroko("milicia", "excelsa", 0xafc86c, ILogType.ExtraTreeLog.Iroko, null, WorldGenIroko.class),
|
||||
Ginkgo("ginkgo", "biloba", 0x719651, ILogType.ExtraTreeLog.Ginkgo, ExtraTreeFruitGene.GinkgoNut,
|
||||
Gingko("ginkgo", "biloba", 0x719651, ILogType.ExtraTreeLog.Gingko, ExtraTreeFruitGene.GingkoNut,
|
||||
WorldGenGingko.class),
|
||||
Brazilnut("bertholletia", "excelsa", 0x7c8f7b, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.BrazilNut,
|
||||
WorldGenBrazilNut.class),
|
||||
@@ -548,7 +548,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
ExtraTreeSpecies.Iroko.addFamily(familyNuts).addFamily(familyJungle).setHeight(EnumAllele.Height.AVERAGE)
|
||||
.setFertility(EnumAllele.Saplings.LOW);
|
||||
|
||||
ExtraTreeSpecies.Ginkgo.addFamily(familyNuts).addFamily(familyJungle).setLeafType(LeafType.JUNGLE)
|
||||
ExtraTreeSpecies.Gingko.addFamily(familyNuts).addFamily(familyJungle).setLeafType(LeafType.JUNGLE)
|
||||
.setHeight(EnumAllele.Height.LARGE).setYield(EnumAllele.Yield.LOWER)
|
||||
.setSappiness(EnumAllele.Sappiness.LOW);
|
||||
|
||||
@@ -902,7 +902,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {
|
||||
for (SaplingType type : SaplingType.VALUES) {
|
||||
for (SaplingType type : SaplingType.values()) {
|
||||
type.icon = new IIcon[2];
|
||||
type.icon[0] = ExtraTrees.proxy.getIcon(register, "saplings/" + type.toString().toLowerCase() + ".trunk");
|
||||
type.icon[1] = ExtraTrees.proxy.getIcon(register, "saplings/" + type.toString().toLowerCase() + ".leaves");
|
||||
|
||||
@@ -12,7 +12,5 @@ public enum SaplingType {
|
||||
PALM,
|
||||
SHRUB;
|
||||
|
||||
public static final SaplingType[] VALUES = values();
|
||||
|
||||
public IIcon[] icon;
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public enum Food implements IItemMisc {
|
||||
Acorn(0),
|
||||
Elderberry(1),
|
||||
Olive(1),
|
||||
GinkgoNut(1),
|
||||
GingkoNut(1),
|
||||
Coffee(0),
|
||||
OsangeOrange(1),
|
||||
Clove(0),
|
||||
@@ -129,7 +129,7 @@ public enum Food implements IItemMisc {
|
||||
Food.Acorn.ore("Acorn");
|
||||
Food.Elderberry.ore("Elderberry");
|
||||
Food.Olive.ore("Olive");
|
||||
Food.GinkgoNut.ore("GinkgoNut");
|
||||
Food.GingkoNut.ore("GingkoNut");
|
||||
Food.Coffee.ore("Coffee");
|
||||
Food.OsangeOrange.ore("OsangeOrange");
|
||||
Food.Clove.ore("Clove");
|
||||
|
||||
@@ -84,7 +84,7 @@ public class ModuleItems implements IInitializable {
|
||||
Food.Acorn.addOil(20, 50, 3);
|
||||
Food.Elderberry.addJuice(10, 100, 5);
|
||||
Food.Olive.addOil(20, 50, 3);
|
||||
Food.GinkgoNut.addOil(20, 50, 5);
|
||||
Food.GingkoNut.addOil(20, 50, 5);
|
||||
Food.Coffee.addOil(15, 20, 2);
|
||||
Food.OsangeOrange.addJuice(10, 300, 15);
|
||||
Food.Clove.addOil(10, 25, 2);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.extratrees.machines;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -80,7 +81,8 @@ public enum ExtraTreeMachine implements IMachineType {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderMachine(Machine machine, double x, double y, double z, float partialTick) {
|
||||
public void renderMachine(Machine machine, double x, double y, double z, float partialTick,
|
||||
RenderBlocks renderer) {
|
||||
MachineRendererForestry.renderMachine(textureName.getShortPath(), x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,8 +54,7 @@ public class Lumbermill {
|
||||
|
||||
private static Collection<ItemStack> getRecipeResult(ItemStack output) {
|
||||
List<ItemStack> list = new ArrayList<>();
|
||||
List<IRecipe> iRecipes = new ArrayList<>(CraftingManager.getInstance().getRecipeList());
|
||||
for (IRecipe iRecipe : iRecipes) {
|
||||
for (IRecipe iRecipe : CraftingManager.getInstance().getRecipeList()) {
|
||||
if (iRecipe instanceof ShapelessRecipes shapeless) {
|
||||
if (shapeless.recipeItems.size() != 1 || !(shapeless.recipeItems.get(0) instanceof ItemStack)) {
|
||||
continue;
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package binnie.genetics;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.config.ConfigException;
|
||||
import com.gtnewhorizon.gtnhlib.config.ConfigurationManager;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.Tags;
|
||||
import binnie.core.gui.IBinnieGUID;
|
||||
@@ -11,7 +8,6 @@ import binnie.core.machines.MachineGroup;
|
||||
import binnie.core.network.BinniePacketHandler;
|
||||
import binnie.core.network.IPacketID;
|
||||
import binnie.core.proxy.IProxyCore;
|
||||
import binnie.genetics.config.GeneticsConfig;
|
||||
import binnie.genetics.core.GeneticsGUI;
|
||||
import binnie.genetics.core.GeneticsPacket;
|
||||
import binnie.genetics.item.ItemAnalyst;
|
||||
@@ -32,29 +28,19 @@ import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
|
||||
@Mod(
|
||||
modid = Genetics.GENETICS_MODID,
|
||||
modid = "Genetics",
|
||||
name = "Genetics",
|
||||
version = Tags.VERSION,
|
||||
useMetadata = true,
|
||||
dependencies = "after:BinnieCore")
|
||||
public class Genetics extends AbstractMod {
|
||||
|
||||
public static final String GENETICS_MODID = "Genetics";
|
||||
|
||||
@Mod.Instance("Genetics")
|
||||
public static Genetics instance;
|
||||
|
||||
@SidedProxy(clientSide = "binnie.genetics.proxy.ProxyClient", serverSide = "binnie.genetics.proxy.ProxyServer")
|
||||
public static Proxy proxy;
|
||||
|
||||
static {
|
||||
try {
|
||||
ConfigurationManager.registerConfig(GeneticsConfig.class);
|
||||
} catch (ConfigException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public static final String CHANNEL = "GEN";
|
||||
|
||||
public static ItemSerumArray itemSerumArray = null;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.genetics.machine;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import binnie.core.machines.Machine;
|
||||
@@ -25,7 +26,7 @@ public abstract class PackageGeneticBase extends MachinePackage {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderMachine(Machine machine, double x, double y, double z, float partialTick) {
|
||||
public void renderMachine(Machine machine, double x, double y, double z, float partialTick, RenderBlocks renderer) {
|
||||
MachineRendererGenetics.instance.renderMachine(machine, renderTexture, x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,14 @@ public class AnalyserComponentFX extends MachineComponent
|
||||
BinnieCore.proxy.getMinecraftInstance().effectRenderer
|
||||
.addEffect(new EntityFX(world, x + 0.5, y + 1.3 + rand.nextDouble() * 0.2, z + 0.5, 0.0, 0.0, 0.0) {
|
||||
|
||||
double axisX = posX;
|
||||
double axisZ = posZ;
|
||||
double angle = rand.nextDouble() * 2.0 * 3.1415;
|
||||
|
||||
{
|
||||
axisX = 0.0;
|
||||
axisZ = 0.0;
|
||||
angle = 0.0;
|
||||
motionX = 0.05 * (rand.nextDouble() - 0.5);
|
||||
motionZ = 0.05 * (rand.nextDouble() - 0.5);
|
||||
motionY = 0.0;
|
||||
|
||||
@@ -48,6 +48,9 @@ public class InoculatorComponentFX extends MachineComponent
|
||||
double angle = (int) (worldObj.getTotalWorldTime() % 4L) * 0.5 * 3.1415;
|
||||
|
||||
{
|
||||
axisX = 0.0;
|
||||
axisZ = 0.0;
|
||||
angle = 0.0;
|
||||
motionX = 0.0;
|
||||
motionZ = 0.0;
|
||||
motionY = 0.007 + rand.nextDouble() * 0.002;
|
||||
|
||||
@@ -65,10 +65,10 @@ public class IsolatorComponentFX extends MachineComponent implements IRender.Ran
|
||||
}
|
||||
|
||||
BinnieCore.proxy.getMinecraftInstance().effectRenderer
|
||||
.addEffect(new EntityFX(world, x + 0.5, y + 1, z + 0.75, 0.0, 0.0, 0.0) {
|
||||
.addEffect(new EntityFX(world, x + 0.5, y + 1, z + 0.5, 0.0, 0.0, 0.0) {
|
||||
|
||||
final double axisX = posX;
|
||||
final double axisZ = posZ - 0.25;
|
||||
final double axisX = 0.0;
|
||||
final double axisZ = 0.0;
|
||||
double angle = 0.0;
|
||||
|
||||
{
|
||||
|
||||
@@ -13,7 +13,7 @@ import binnie.core.machines.power.ComponentProcessSetCost;
|
||||
import binnie.core.machines.power.ErrorState;
|
||||
import binnie.core.machines.power.IProcess;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.genetics.config.GeneticsConfig;
|
||||
import binnie.extrabees.config.EBConfigMachines;
|
||||
import binnie.genetics.item.ItemSequence;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAllele;
|
||||
@@ -100,7 +100,7 @@ public class IsolatorComponentLogic extends ComponentProcessSetCost implements I
|
||||
ItemStack serum = ItemSequence.create(gene);
|
||||
getUtil().setStack(Isolator.SLOT_RESULT, serum);
|
||||
getUtil().decreaseStack(Isolator.SLOT_SEQUENCER_VIAL, 1);
|
||||
if (rand.nextFloat() < GeneticsConfig.isolatorConsumptionChance) {
|
||||
if (rand.nextFloat() < EBConfigMachines.isolatorConsumptionChance) {
|
||||
getUtil().decreaseStack(Isolator.SLOT_TARGET, 1);
|
||||
}
|
||||
getUtil().drainTank(Isolator.TANK_ETHANOL, (int) ethanolPerProcess);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.genetics.machine.lab;
|
||||
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.genetics.core.GeneticsTexture;
|
||||
import binnie.genetics.machine.ComponentGUIHolder;
|
||||
@@ -18,7 +20,7 @@ public class LabMachinePackage extends PackageGeneticBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderMachine(Machine machine, double x, double y, double z, float partialTick) {
|
||||
public void renderMachine(Machine machine, double x, double y, double z, float partialTick, RenderBlocks renderer) {
|
||||
MachineRendererLab.instance.renderMachine(machine, renderTexture, x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -37,6 +37,9 @@ public class PolymeriserComponentFX extends MachineComponent implements IRender.
|
||||
double angle = 0.7 + (int) (worldObj.getTotalWorldTime() % 2L) * 3.1415;
|
||||
|
||||
{
|
||||
axisX = 0.0;
|
||||
axisZ = 0.0;
|
||||
angle = 0.0;
|
||||
motionX = 0.0;
|
||||
motionZ = 0.0;
|
||||
motionY = -0.006;
|
||||
|
||||
@@ -34,6 +34,9 @@ public class SequencerComponentFX extends MachineComponent implements IRender.Ra
|
||||
double angle = rand.nextDouble() * 2.0 * 3.1415;
|
||||
|
||||
{
|
||||
axisX = 0.0;
|
||||
axisZ = 0.0;
|
||||
angle = 0.0;
|
||||
motionX = 0.0;
|
||||
motionZ = 0.0;
|
||||
motionY = 0.0;
|
||||
|
||||
@@ -49,6 +49,9 @@ public class SplicerComponentFX extends MachineComponent
|
||||
double angle = (int) (worldObj.getTotalWorldTime() % 4L) * 0.5 * 3.1415;
|
||||
|
||||
{
|
||||
axisX = 0.0;
|
||||
axisZ = 0.0;
|
||||
angle = 0.0;
|
||||
motionX = 0.0;
|
||||
motionZ = 0.0;
|
||||
motionY = (rand.nextDouble() - 0.5) * 0.02;
|
||||
|
||||
@@ -11,7 +11,6 @@ import binnie.core.nei.RecipeHandlerBase;
|
||||
import binnie.genetics.Genetics;
|
||||
import binnie.genetics.item.GeneticsItems;
|
||||
import binnie.genetics.item.ItemSerumArray;
|
||||
import binnie.genetics.nei.helper.ColorUtils;
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.ItemList;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
@@ -61,7 +60,7 @@ public class DatabaseRecipeHandler extends RecipeHandlerBase {
|
||||
StatCollector.translateToLocalFormatted("genetics.nei.tip.databaseDesc"),
|
||||
140);
|
||||
for (int i = 0; i < desc.size(); i++) {
|
||||
GuiDraw.drawStringC(desc.get(i), 88, 44 + 12 * (i - 1), ColorUtils.neiDisplayText.getColor());
|
||||
GuiDraw.drawStringC(desc.get(i), 88, 44 + 12 * (i - 1), 0xFFFFFF);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ import binnie.core.nei.PositionedFluidTank;
|
||||
import binnie.core.nei.RecipeHandlerBase;
|
||||
import binnie.genetics.api.IIncubatorRecipe;
|
||||
import binnie.genetics.machine.incubator.Incubator;
|
||||
import binnie.genetics.nei.helper.ColorUtils;
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
@@ -49,16 +48,8 @@ public class IncubatorRecipeHandler extends RecipeHandlerBase {
|
||||
@Override
|
||||
public void drawExtras(int recipe) {
|
||||
this.drawProgressBar(75, 27, 176, 0, 24, 17, 40, 0);
|
||||
GuiDraw.drawStringC(
|
||||
StatCollector.translateToLocal("genetics.nei.tip.loss"),
|
||||
62,
|
||||
5,
|
||||
ColorUtils.neiDisplayText.getColor());
|
||||
GuiDraw.drawStringC(
|
||||
((CachedIncubatorRecipe) arecipes.get(recipe)).lossChance,
|
||||
62,
|
||||
15,
|
||||
ColorUtils.neiDisplayText.getColor());
|
||||
GuiDraw.drawStringC(StatCollector.translateToLocal("genetics.nei.tip.loss"), 62, 5, 0xFFFFFF);
|
||||
GuiDraw.drawStringC(((CachedIncubatorRecipe) arecipes.get(recipe)).lossChance, 62, 15, 0xFFFFFF);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
package binnie.genetics.nei.helper;
|
||||
|
||||
import com.gtnewhorizon.gtnhlib.color.ColorResource;
|
||||
|
||||
public class ColorUtils {
|
||||
|
||||
private static final ColorResource.Factory color = new ColorResource.Factory("binniecore");
|
||||
|
||||
public static final ColorResource
|
||||
// spotless:off
|
||||
neiDisplayText = color.rgb("neiDisplayText", "0xFFFFFF");
|
||||
// spotless:on
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
|
Before Width: | Height: | Size: 231 B After Width: | Height: | Size: 231 B |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
|
Before Width: | Height: | Size: 204 B After Width: | Height: | Size: 204 B |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loaded 100 of 141 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user