From 55a0e39c07c9aa65740697019925763228e757f6 Mon Sep 17 00:00:00 2001 From: "Aidan C. Brady" Date: Sat, 4 Jan 2014 11:41:09 -0500 Subject: [PATCH] Digital Miner inverse mode --- .../client/gui/GuiDigitalMinerConfig.java | 23 ++++++++++++++++++ .../common/miner/ThreadMinerSearch.java | 9 ++++++- .../tileentity/TileEntityDigitalMiner.java | 10 ++++++-- .../mekanism/gui/GuiDigitalMinerConfig.png | Bin 4555 -> 5102 bytes resources/assets/mekanism/lang/en_US.lang | 1 + 5 files changed, 40 insertions(+), 3 deletions(-) diff --git a/common/mekanism/client/gui/GuiDigitalMinerConfig.java b/common/mekanism/client/gui/GuiDigitalMinerConfig.java index 8602f51ed..00a069df5 100644 --- a/common/mekanism/client/gui/GuiDigitalMinerConfig.java +++ b/common/mekanism/client/gui/GuiDigitalMinerConfig.java @@ -203,6 +203,15 @@ public class GuiDigitalMinerConfig extends GuiMekanism mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F); setMaxY(); } + + if(xAxis >= 11 && xAxis <= 25 && yAxis >= 141 && yAxis <= 155) + { + ArrayList data = new ArrayList(); + data.add(10); + + PacketHandler.sendPacket(Transmission.SERVER, new PacketTileEntity().setParams(Coord4D.get(tileEntity), data)); + mc.sndManager.playSoundFX("random.click", 1.0F, 1.0F); + } } } @@ -288,6 +297,7 @@ public class GuiDigitalMinerConfig extends GuiMekanism fontRenderer.drawString("T: " + tileEntity.filters.size(), 11, 28, 0x00CD00); fontRenderer.drawString("IS: " + getItemStackFilters().size(), 11, 37, 0x00CD00); fontRenderer.drawString("OD: " + getOreDictFilters().size(), 11, 46, 0x00CD00); + fontRenderer.drawString("I: " + (tileEntity.inverse ? MekanismUtils.localize("gui.on") : MekanismUtils.localize("gui.off")), 11, 131, 0x00CD00); fontRenderer.drawString("Radi: " + tileEntity.radius, 11, 58, 0x00CD00); @@ -342,6 +352,11 @@ public class GuiDigitalMinerConfig extends GuiMekanism } } + if(xAxis >= 11 && xAxis <= 25 && yAxis >= 141 && yAxis <= 155) + { + drawCreativeTabHoveringText(MekanismUtils.localize("gui.digitalMiner.inverse"), xAxis, yAxis); + } + super.drawGuiContainerForegroundLayer(mouseX, mouseY); } @@ -413,6 +428,14 @@ public class GuiDigitalMinerConfig extends GuiMekanism drawTexturedModalRect(guiWidth + 39, guiHeight + 117, 176 + 11, 11, 11, 11); } + if(xAxis >= 11 && xAxis <= 25 && yAxis >= 141 && yAxis <= 155) + { + drawTexturedModalRect(guiWidth + 11, guiHeight + 141, 176 + 22, 0, 14, 14); + } + else { + drawTexturedModalRect(guiWidth + 11, guiHeight + 141, 176 + 22, 14, 14, 14); + } + radiusField.drawTextBox(); minField.drawTextBox(); maxField.drawTextBox(); diff --git a/common/mekanism/common/miner/ThreadMinerSearch.java b/common/mekanism/common/miner/ThreadMinerSearch.java index 7fc5667a2..21f10d488 100644 --- a/common/mekanism/common/miner/ThreadMinerSearch.java +++ b/common/mekanism/common/miner/ThreadMinerSearch.java @@ -63,13 +63,20 @@ public class ThreadMinerSearch extends Thread continue; } + boolean hasFilter = false; + for(MinerFilter filter : tileEntity.filters) { if(filter.canFilter(stack)) { - tileEntity.oresToMine.add(new Coord4D(x, y, z, tileEntity.worldObj.provider.dimensionId)); + hasFilter = true; } } + + if(tileEntity.inverse ? !hasFilter : hasFilter) + { + tileEntity.oresToMine.add(new Coord4D(x, y, z, tileEntity.worldObj.provider.dimensionId)); + } } } } diff --git a/common/mekanism/common/tileentity/TileEntityDigitalMiner.java b/common/mekanism/common/tileentity/TileEntityDigitalMiner.java index 36130290a..1bcf430c6 100644 --- a/common/mekanism/common/tileentity/TileEntityDigitalMiner.java +++ b/common/mekanism/common/tileentity/TileEntityDigitalMiner.java @@ -177,7 +177,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I } } - if(!hasFilter) + if(inverse ? hasFilter : !hasFilter) { toRemove.add(obj); continue; @@ -224,7 +224,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I else if(getEjectInv() instanceof ILogisticalTransporter) { ItemStack rejected = TransporterUtils.insert(getEjectTile(), (ILogisticalTransporter)getEjectInv(), getTopEject(false, null), null, true, 0); - System.out.println(rejected + " " + (rejected != null ? rejected.stackSize : 0)); + if(TransporterManager.didEmit(getTopEject(false, null), rejected)) { getTopEject(true, rejected); @@ -628,6 +628,10 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I { silkTouch = !silkTouch; } + else if(type == 10) + { + inverse = !inverse; + } for(EntityPlayer player : playersUsing) { @@ -746,6 +750,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I data.add(oresToMine.size()); data.add(controlType.ordinal()); + data.add(inverse); data.add(filters.size()); @@ -798,6 +803,7 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I data.add(oresToMine.size()); data.add(controlType.ordinal()); + data.add(inverse); return data; } diff --git a/resources/assets/mekanism/gui/GuiDigitalMinerConfig.png b/resources/assets/mekanism/gui/GuiDigitalMinerConfig.png index 7f12021c7925d60915daf579c57c6f0ab22227f1..e3e078cfc594efa40c5ffde4b0c4f072700db9f9 100644 GIT binary patch delta 4034 zcmc&#do)yw9^QM~#)z0GjrVvoJsgZA^2i{e(9<(Ca+$d<8Ae_9(RY5Q?Kv0EK5_SFx{#1L)papDT zd95Q(Wly)V+*%I{HF1SuS51MKd#>A$nJZ^n;G2wWQ!3(#lJWV@_F^OZ=E^4KJnv6E zeYfex%-^Cd7JPm&Jr?ufa7rA>_#<>f)5{bC=OP4X)0&;7fI*7 z%ikw$-}S}qXwQjTG8t8m)&ih3eDUJN+)|Ozrx9l>i*mn-Xw80>$=kjA+Ee;`^1@6@ zoz%qZV|w}z-*VKGWq?`(Cy3Uma*xfgqiDG5)XJwMpF`arwVPoE80%#>FSEL$o0=JA#)ugb*B$*@MV)SCH?(;3eHZHuh=fV9*M~9 z?0V2hO4AQt07vt#b1z(mq;W+jlyO!n?iyN&T+IrugG~O(g z@xw_UpNDNk}B^556zjXhKE zm9JhYYqITJ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!m)(ev_yhT?NVo)9kyx%4mj{GgzvN7f8|#Y`n}5!@X%N^2CpR7B z#txPSe4=9(`V*8aJZAHxou=HOq;kmiIm%X=pu7wnS|cSOuouH*>dOl$f;6xn+d|D= z=FS^eKC@VGKW0HzXAB#=Nq6Y0Y#OU0MHhru*=A!UCiS%D=J1=yqMt@&F32 zwjr;Fdze{J-u|e>Cb8+At(82JWf$H~C|wr5X9+rL(eKCn*rq_s7tY9?Q@4(zzJ-JE zw-q4xzqSj`OhsVqibDj%8|ura4{q}Yalf)n-daeOPluVR7TkLtqyYaQlt+Q)@TM^O zZBx8&!v4BnNLy5uq~)&)mo31R<%zR700Km!FgPOfcQ4Q%OMh48<-Y!vDy-kt_>&GM Q-T?e~?DN`t&y959U+Rk6+W-In diff --git a/resources/assets/mekanism/lang/en_US.lang b/resources/assets/mekanism/lang/en_US.lang index 6df8df506..608682175 100644 --- a/resources/assets/mekanism/lang/en_US.lang +++ b/resources/assets/mekanism/lang/en_US.lang @@ -277,6 +277,7 @@ gui.digitalMiner.silk=Silk gui.digitalMiner.toMine=To mine gui.digitalMiner.running=Running gui.digitalMiner.idle=Idle +gui.digitalMiner.inverse=Inverse mode //Item and block tooltip text tooltip.configurator.modify=Modify