Permalink
Browse files

Merge branch 'stable-bc7' into dev

# Conflicts:
#	common/logisticspipes/gui/orderer/GuiRequestTable.java
#	common/logisticspipes/modules/ModuleCrafter.java
#	common/logisticspipes/network/packets/pipe/PipeFluidUpdate.java
#	common/logisticspipes/pipes/PipeItemsInvSysConnector.java
#	common/logisticspipes/proxy/ProxyManager.java
#	common/logisticspipes/proxy/te/ThermalExpansionProxy.java
#	common/logisticspipes/renderer/LogisticsRenderPipe.java
#	common/logisticspipes/request/RequestTreeNode.java
#	common/logisticspipes/routing/order/LogisticsOrderManager.java
  • Loading branch information...
davboecki committed Apr 16, 2016
2 parents a10dc48 + dfbcc48 commit bffcf79379143b7d54d7bd16fe4728aebd688223
Showing with 912 additions and 264 deletions.
  1. +1 −1 build.gradle
  2. +4 −2 common/logisticspipes/LogisticsEventListener.java
  3. +13 −0 common/logisticspipes/asm/DevEnvHelper.java
  4. +36 −4 common/logisticspipes/config/PlayerConfig.java
  5. +1 −1 common/logisticspipes/gui/GuiInvSysConnector.java
  6. +13 −6 common/logisticspipes/gui/orderer/GuiRequestTable.java
  7. +1 −1 common/logisticspipes/gui/popup/GuiAddMacro.java
  8. +18 −2 common/logisticspipes/gui/popup/GuiRecipeImport.java
  9. +1 −1 common/logisticspipes/gui/popup/RequestMonitorPopup.java
  10. +1 −1 common/logisticspipes/logic/gui/LogicLayoutGui.java
  11. +47 −66 common/logisticspipes/modules/ModuleCrafter.java
  12. +2 −1 common/logisticspipes/modules/ModuleProvider.java
  13. +141 −0 common/logisticspipes/network/packets/pipe/FindMostLikelyRecipeComponents.java
  14. +86 −0 common/logisticspipes/network/packets/pipe/MostLikelyRecipeComponentsResponse.java
  15. +2 −1 common/logisticspipes/network/packets/pipe/PipeFluidUpdate.java
  16. +1 −1 common/logisticspipes/network/packets/pipe/PipeManagerContentPacket.java
  17. +1 −1 common/logisticspipes/pipes/PipeItemsCraftingLogistics.java
  18. +10 −7 common/logisticspipes/pipes/PipeItemsInvSysConnector.java
  19. +5 −1 common/logisticspipes/pipes/basic/CoreRoutedPipe.java
  20. +1 −1 common/logisticspipes/pipes/basic/fluid/FluidRoutedPipe.java
  21. +5 −0 common/logisticspipes/proxy/ProxyManager.java
  22. +6 −3 common/logisticspipes/proxy/buildcraft/BuildCraftProxy.java
  23. +9 −0 common/logisticspipes/proxy/interfaces/INEIProxy.java
  24. +47 −4 common/logisticspipes/proxy/nei/NEIProxy.java
  25. +5 −2 common/logisticspipes/proxy/te/ThermalExpansionProxy.java
  26. +37 −21 common/logisticspipes/renderer/LogisticsRenderPipe.java
  27. +5 −2 common/logisticspipes/request/RequestHandler.java
  28. +12 −12 common/logisticspipes/request/RequestTreeNode.java
  29. +41 −1 common/logisticspipes/request/resources/DictResource.java
  30. +7 −0 common/logisticspipes/request/resources/ResourceNetwork.java
  31. +8 −0 common/logisticspipes/routing/LogisticsDictPromise.java
  32. +41 −0 common/logisticspipes/routing/LogisticsExtraDictPromise.java
  33. +15 −3 common/logisticspipes/routing/order/LogisticsFluidOrderManager.java
  34. +6 −0 common/logisticspipes/routing/order/LogisticsItemOrder.java
  35. +61 −6 common/logisticspipes/routing/order/LogisticsItemOrderManager.java
  36. +3 −0 common/logisticspipes/routing/order/LogisticsOrder.java
  37. +96 −0 common/logisticspipes/routing/order/LogisticsOrderLinkedList.java
  38. +31 −25 common/logisticspipes/routing/order/LogisticsOrderManager.java
  39. +1 −1 common/logisticspipes/routing/pathfinder/PathFinder.java
  40. +65 −74 common/logisticspipes/utils/gui/GuiGraphics.java
  41. +1 −1 common/logisticspipes/utils/gui/LogisticsBaseGuiScreen.java
  42. +3 −0 common/logisticspipes/utils/gui/SubGuiScreen.java
  43. +2 −2 download-api.xml
  44. +0 −9 dummy/cofh/api/transport/RegistryEnderAttuned.java
  45. +9 −0 dummy/cofh/core/RegistryEnderAttuned.java
  46. +11 −0 dummy/cofh/lib/transport/EnderRegistry.java
View
@@ -107,7 +107,7 @@ processResources {
}
dependencies {
compile files("build/download/buildcraft-7.1.5-dev.jar")
compile files("build/download/buildcraft-7.1.16-dev.jar")
compile 'org.projectlombok:lombok:1.16.4'
compile 'codechicken:NotEnoughItems:1.7.10-1.0.5.111:dev'
compile 'codechicken:CodeChickenCore:1.7.10-1.0.7.46:dev'
@@ -198,8 +198,10 @@ public void onPlayerLogin(PlayerLoggedInEvent event) {
public void onPlayerLogout(PlayerLoggedOutEvent event) {
SimpleServiceLocator.serverBufferHandler.clear(event.player);
PlayerIdentifier ident = PlayerIdentifier.get(event.player);
PlayerConfig config = LogisticsEventListener.getPlayerConfig(ident);
config.writeToFile();
PlayerConfig config = LogisticsEventListener.playerConfigs.get(ident);
if (config != null) {
config.writeToFile();
}
LogisticsEventListener.playerConfigs.remove(ident);
}
@@ -550,6 +550,9 @@ private static Object processAnnotationValue(Mapping m, Object value) {
// returns actual owner of field
// or null if the field could not be resolved
private static String resolveField(String owner, String name, String desc, Mapping m) throws IOException {
if (owner == null) {
return null;
}
byte[] bytes = Launch.classLoader.getClassBytes(owner);
if (bytes == null) {
return null;
@@ -582,6 +585,9 @@ private static String resolveField(String owner, String name, String desc, Mappi
// returns [realOwner, realDesc]
// or null if the method could not be resolved
private static String[] resolveMethod(String owner, String name, String desc, Mapping m) throws IOException {
if (owner == null) {
return null;
}
byte[] bytes = Launch.classLoader.getClassBytes(owner);
if (bytes == null) {
return null;
@@ -617,6 +623,10 @@ private static String resolveField(String owner, String name, String desc, Mappi
while (true) {
if(owner == null) {
break;
}
bytes = Launch.classLoader.getClassBytes(owner);
if (bytes == null) {
break;
@@ -638,6 +648,9 @@ private static String resolveField(String owner, String name, String desc, Mappi
owner = originalOwner;
while (true) {
if (owner == null) {
break;
}
bytes = Launch.classLoader.getClassBytes(owner);
if (bytes == null) {
break;
@@ -9,6 +9,8 @@
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.UUID;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
@@ -31,6 +33,8 @@
public class PlayerConfig {
private static final Lock fileAccesLock = new ReentrantLock();
private final PlayerIdentifier playerIdent;
private boolean useNewRenderer = true;
@@ -114,14 +118,28 @@ public void readFromFile() {
if (playerIdent.getUsername() != null && !playerIdent.getUsername().isEmpty()) {
File file = new File(lpData, playerIdent.getUsername() + ".info");
if (file.exists()) {
lpUserData = CompressedStreamTools.readCompressed(new FileInputStream(file));
fileAccesLock.lock();
try {
lpUserData = CompressedStreamTools.readCompressed(new FileInputStream(file));
} catch(IOException e) {
//We simply can't load the old settings. Just fall back to the default once.
} finally {
fileAccesLock.unlock();
}
file.delete();
}
}
if (lpUserData == null && playerIdent.getId() != null) {
File file = new File(lpData, playerIdent.getId().toString() + ".info");
if (file.exists()) {
lpUserData = CompressedStreamTools.readCompressed(new FileInputStream(file));
fileAccesLock.lock();
try {
lpUserData = CompressedStreamTools.readCompressed(new FileInputStream(file));
} catch(IOException e) {
//We simply can't load the old settings. Just fall back to the default once.
} finally {
fileAccesLock.unlock();
}
}
}
if (lpUserData == null) {
@@ -163,15 +181,29 @@ public void writeToFile() {
if (file.exists()) {
file.delete();
}
CompressedStreamTools.writeCompressed(lpUserData, new FileOutputStream(file));
fileAccesLock.lock();
try {
CompressedStreamTools.writeCompressed(lpUserData, new FileOutputStream(file));
} catch(IOException e) {
//If we can't save them, so be it.
} finally {
fileAccesLock.unlock();
}
lpUserData = null;
}
if (lpUserData != null) {
File file = new File(lpData, playerIdent.getUsername() + ".info");
if (file.exists()) {
file.delete();
}
CompressedStreamTools.writeCompressed(lpUserData, new FileOutputStream(file));
fileAccesLock.lock();
try {
CompressedStreamTools.writeCompressed(lpUserData, new FileOutputStream(file));
} catch(IOException e) {
//If we can't save them, so be it.
} finally {
fileAccesLock.unlock();
}
lpUserData = null;
}
}
@@ -118,7 +118,7 @@ protected void drawGuiContainerForegroundLayer(int par1, int par2) {
int mouseY = height - Mouse.getY() * height / mc.displayHeight - 1;
if (x < mouseX && mouseX < x + 18 && y < mouseY && mouseY < y + 18) {
GuiGraphics.displayItemToolTip(new Object[] { mouseX, mouseY, st, true }, zLevel, guiLeft, guiTop, false, false);
GuiGraphics.displayItemToolTip(new Object[] { mouseX, mouseY, st, true }, zLevel, guiLeft, guiTop, false);
}
column++;
@@ -267,10 +267,17 @@ public void renderForground(int left, int top) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_DEPTH_TEST);
RenderHelper.enableGUIStandardItemLighting();
ItemStack stack = entry.getValue().getValue1().getDisplayItem().makeNormalStack();
GuiScreen.itemRender.renderItemAndEffectIntoGUI(mc.fontRenderer, getMC().renderEngine, stack, left + 5, top + 5);
GuiScreen.itemRender.renderItemOverlayIntoGUI(mc.fontRenderer, getMC().renderEngine, stack, left + 5, top + 5, "");
String s = StringUtils.getFormatedStackSize(stack.stackSize, false);
ItemStack stack = null;
IResource resource = entry.getValue().getValue1();
String s = null;
if(resource != null) {
stack = resource.getDisplayItem().makeNormalStack();
GuiScreen.itemRender.renderItemAndEffectIntoGUI(mc.fontRenderer, getMC().renderEngine, stack, left + 5, top + 5);
GuiScreen.itemRender.renderItemOverlayIntoGUI(mc.fontRenderer, getMC().renderEngine, stack, left + 5, top + 5, "");
s = StringUtils.getFormatedStackSize(stack.stackSize, false);
} else {
s = "List";
}
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GuiScreen.itemRender.zLevel = 0.0F;
@@ -381,12 +388,12 @@ public void handleMouseOverAt(int xPos, int yPos) {
list.add(ChatColor.BLUE + "Send to Router ID: " + ChatColor.YELLOW + order
.getRouterId());
GuiGraphics.displayItemToolTip(new Object[]{xPos - 10, yPos, order
.getAsDisplayItem().makeNormalStack(), true, list}, zLevel, guiLeft, guiTop, false, false);
.getAsDisplayItem().makeNormalStack(), true, list}, zLevel, guiLeft, guiTop, false);
});
} else {
List<String> list = new ArrayList<>();
list.add(ChatColor.BLUE + "Request ID: " + ChatColor.YELLOW + entry.getKey());
GuiGraphics.displayItemToolTip(new Object[] { xPos - 10, yPos, entry.getValue().getValue1().getDisplayItem().makeNormalStack(), true, list }, zLevel, guiLeft, guiTop, false, false);
GuiGraphics.displayItemToolTip(new Object[] { xPos - 10, yPos, entry.getValue().getValue1().getDisplayItem().makeNormalStack(), true, list }, zLevel, guiLeft, guiTop, false);
}
}
});
@@ -143,7 +143,7 @@ public void handleMouseInputSub() {
@Override
protected void renderToolTips(int mouseX, int mouseY, float par3) {
if (!hasSubGui()) {
GuiGraphics.displayItemToolTip(tooltip, 300, guiLeft, guiTop, true, false);
GuiGraphics.displayItemToolTip(tooltip, 300, guiLeft, guiTop, false);
}
}
@@ -7,7 +7,9 @@
import logisticspipes.gui.popup.SelectItemOutOfList.IHandleItemChoise;
import logisticspipes.network.PacketHandler;
import logisticspipes.network.abstractpackets.ModernPacket;
import logisticspipes.network.packets.NEISetCraftingRecipe;
import logisticspipes.network.packets.pipe.FindMostLikelyRecipeComponents;
import logisticspipes.proxy.MainProxy;
import logisticspipes.utils.Color;
import logisticspipes.utils.gui.GuiGraphics;
@@ -27,12 +29,12 @@
public static class Canidates {
Canidates(Set<ItemIdentifierStack> set) {
public Canidates(Set<ItemIdentifierStack> set) {
this.set = set;
}
Set<ItemIdentifierStack> set;
List<ItemIdentifierStack> order;
public List<ItemIdentifierStack> order;
int pos = 0;
}
@@ -82,6 +84,7 @@ public void initGui() {
super.initGui();
buttonList.clear();
buttonList.add(new SmallGuiButton(0, guiLeft + 100, guiTop + 180, 40, 10, "Done"));
buttonList.add(new SmallGuiButton(1, guiLeft + 10, guiTop + 180, 60, 10, "Most likely"));
int x = 0;
int y = 0;
for (Canidates canidate : list) {
@@ -191,6 +194,8 @@ protected void actionPerformed(GuiButton button) {
NEISetCraftingRecipe packet = PacketHandler.getPacket(NEISetCraftingRecipe.class);
MainProxy.sendPacketToServer(packet.setContent(stack).setPosX(tile.xCoord).setPosY(tile.yCoord).setPosZ(tile.zCoord));
exitGui();
} else if(id == 1) {
MainProxy.sendPacketToServer(PacketHandler.getPacket(FindMostLikelyRecipeComponents.class).setContent(list).setTilePos(tile));
} else if (id >= 10 && id < 30) {
int slot = id % 10;
boolean up = id < 20;
@@ -209,6 +214,17 @@ protected void actionPerformed(GuiButton button) {
}
}
public void handleProposePacket(List<Integer> response) {
if(list.size() != response.size()) return;
for(int slot=0;slot<list.size();slot++) {
Canidates canidate = list.get(slot);
int newPos = response.get(slot);
if(newPos != -1) {
canidate.pos = newPos;
}
}
}
@Override
protected void mouseClicked(int mouseX, int mouseY, int button) {
int x = 0;
@@ -131,7 +131,7 @@ protected void actionPerformed(GuiButton button) {
@Override
protected void renderToolTips(int mouseX, int mouseY, float par3) {
if (tooltip != null) {
GuiGraphics.displayItemToolTip(tooltip, zLevel, guiLeft, guiTop, false, true);
GuiGraphics.displayItemToolTip(tooltip, zLevel, guiLeft, guiTop, true);
}
}
@@ -140,7 +140,7 @@ public void drawScreen(int par1, int par2, float par3) {
}
GL11.glTranslatef(0.0F, 0.0F, 100.0F);
if (tooltip != null) {
GuiGraphics.displayItemToolTip(tooltip, zLevel, guiLeft, guiTop, false, true);
GuiGraphics.displayItemToolTip(tooltip, zLevel, guiLeft, guiTop, true);
}
}
Oops, something went wrong.

0 comments on commit bffcf79

Please sign in to comment.