diff --git a/buildcraft_resources/changelog/7.1.1 b/buildcraft_resources/changelog/7.1.1 index 65f3c4c1..32014140 100644 --- a/buildcraft_resources/changelog/7.1.1 +++ b/buildcraft_resources/changelog/7.1.1 @@ -8,4 +8,5 @@ Improvements: Bugs fixed: +* [#2948] Precise damage checking not working (asie) * Hovering over slot causing incorrect item lighting (asie) diff --git a/common/buildcraft/core/lib/utils/ColorUtils.java b/common/buildcraft/core/lib/utils/ColorUtils.java index 4291bece..8d39c53a 100644 --- a/common/buildcraft/core/lib/utils/ColorUtils.java +++ b/common/buildcraft/core/lib/utils/ColorUtils.java @@ -15,7 +15,7 @@ import net.minecraftforge.oredict.OreDictionary; public final class ColorUtils { private static final int[] WOOL_TO_RGB = new int[] { - 0xFFFFFF, 0xD87F33, 0xB24CD8, 0x6699D8, + 0xFAFAFA, 0xD87F33, 0xB24CD8, 0x6699D8, 0xE5E533, 0x7FCC19, 0xF27FA5, 0x4C4C4C, 0x999999, 0x4C7F99, 0x7F3FB2, 0x334CB2, 0x664C33, 0x667F33, 0x993333, 0x191919 diff --git a/common/buildcraft/core/list/ListHandlerNew.java b/common/buildcraft/core/list/ListHandlerNew.java index 457fa02a..bdbd2312 100644 --- a/common/buildcraft/core/list/ListHandlerNew.java +++ b/common/buildcraft/core/list/ListHandlerNew.java @@ -69,8 +69,11 @@ public final class ListHandlerNew { } } else { for (ItemStack s : stacks) { - if (s != null && StackHelper.isMatchingItem(s, target, precise || target.getItem().getHasSubtypes(), precise)) { - return true; + if (s != null && StackHelper.isMatchingItem(s, target, true, precise)) { + // If precise, re-check damage + if (!precise || s.getItemDamage() == target.getItemDamage()) { + return true; + } } } } diff --git a/common/buildcraft/core/list/ListMatchHandlerArmor.java b/common/buildcraft/core/list/ListMatchHandlerArmor.java index a9676ac7..1283314c 100644 --- a/common/buildcraft/core/list/ListMatchHandlerArmor.java +++ b/common/buildcraft/core/list/ListMatchHandlerArmor.java @@ -30,7 +30,11 @@ public class ListMatchHandlerArmor extends ListMatchHandler { int armorTypeIDSource = getArmorTypeID(stack); if (armorTypeIDSource > 0) { int armorTypeIDTarget = getArmorTypeID(target); - return (armorTypeIDSource & armorTypeIDTarget) != 0; + if (precise) { + return armorTypeIDSource == armorTypeIDTarget; + } else { + return (armorTypeIDSource & armorTypeIDTarget) != 0; + } } } return false; diff --git a/common/buildcraft/core/list/ListMatchHandlerTools.java b/common/buildcraft/core/list/ListMatchHandlerTools.java index 0c5de67c..b01a0b7c 100644 --- a/common/buildcraft/core/list/ListMatchHandlerTools.java +++ b/common/buildcraft/core/list/ListMatchHandlerTools.java @@ -1,9 +1,7 @@ package buildcraft.core.list; -import java.util.HashSet; import java.util.Set; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import buildcraft.api.lists.ListMatchHandler; @@ -15,6 +13,11 @@ public class ListMatchHandlerTools extends ListMatchHandler { Set toolClassesSource = stack.getItem().getToolClasses(stack); Set toolClassesTarget = target.getItem().getToolClasses(stack); if (toolClassesSource.size() > 0 && toolClassesTarget.size() > 0) { + if (precise) { + if (toolClassesSource.size() != toolClassesTarget.size()) { + return false; + } + } for (String s : toolClassesSource) { if (!toolClassesTarget.contains(s)) { return false; diff --git a/common/buildcraft/transport/PipeTransportPower.java b/common/buildcraft/transport/PipeTransportPower.java index b7ddb9d3..eaf81f7c 100644 --- a/common/buildcraft/transport/PipeTransportPower.java +++ b/common/buildcraft/transport/PipeTransportPower.java @@ -226,12 +226,15 @@ public class PipeTransportPower extends PipeTransport implements IDebuggable { watts); internalPower[i] -= watts; dbgEnergyOutput[j] += watts; + + powerAverage[j].push((int) Math.ceil(watts)); + powerAverage[i].push((int) Math.ceil(watts)); } else { int iWatts = (int) watts; if (ep instanceof IEnergyHandler) { IEnergyHandler handler = (IEnergyHandler) ep; if (handler.canConnectEnergy(ForgeDirection.VALID_DIRECTIONS[j].getOpposite())) { - watts = handler.receiveEnergy(ForgeDirection.VALID_DIRECTIONS[j].getOpposite(), + iWatts = handler.receiveEnergy(ForgeDirection.VALID_DIRECTIONS[j].getOpposite(), iWatts, false); } internalPower[i] -= iWatts; @@ -239,16 +242,16 @@ public class PipeTransportPower extends PipeTransport implements IDebuggable { } else if (ep instanceof IEnergyReceiver) { IEnergyReceiver handler = (IEnergyReceiver) ep; if (handler.canConnectEnergy(ForgeDirection.VALID_DIRECTIONS[j].getOpposite())) { - watts = handler.receiveEnergy(ForgeDirection.VALID_DIRECTIONS[j].getOpposite(), + iWatts = handler.receiveEnergy(ForgeDirection.VALID_DIRECTIONS[j].getOpposite(), iWatts, false); } internalPower[i] -= iWatts; dbgEnergyOutput[j] += iWatts; } - } - powerAverage[j].push((int) Math.ceil(watts)); - powerAverage[i].push((int) Math.ceil(watts)); + powerAverage[j].push(iWatts); + powerAverage[i].push(iWatts); + } } } } @@ -263,7 +266,7 @@ public class PipeTransportPower extends PipeTransport implements IDebuggable { } } - overload += highestPower > ((float) maxPower) * 0.95F ? 1 : -1; + overload += highestPower > (maxPower * 0.95F) ? 1 : -1; if (overload < 0) { overload = 0; } diff --git a/common/buildcraft/transport/render/PipeRendererWorld.java b/common/buildcraft/transport/render/PipeRendererWorld.java index dd60b871..feef9c10 100644 --- a/common/buildcraft/transport/render/PipeRendererWorld.java +++ b/common/buildcraft/transport/render/PipeRendererWorld.java @@ -29,6 +29,7 @@ import buildcraft.transport.PipeIconProvider; import buildcraft.transport.PipeRenderState; import buildcraft.transport.TileGenericPipe; import buildcraft.transport.TransportProxy; +import buildcraft.transport.pipes.PipeStructureCobblestone; public class PipeRendererWorld implements ISimpleBlockRenderingHandler { @@ -52,6 +53,12 @@ public class PipeRendererWorld implements ISimpleBlockRenderingHandler { if (renderPass == 1) { fakeBlock.setColor(ColorUtils.getRGBColor(glassColor)); + } else if (glassColor >= 0 && tile.getPipe() instanceof PipeStructureCobblestone) { + if (glassColor == 0) { + fakeBlock.setColor(0xDFDFDF); + } else { + fakeBlock.setColor(ColorUtils.getRGBColor(glassColor)); + } } // render the unconnected pipe faces of the center block (if any)