Digital Miner inverse mode

This commit is contained in:
Aidan C. Brady 2014-01-04 11:41:09 -05:00
parent c824aea5d4
commit 55a0e39c07
5 changed files with 40 additions and 3 deletions

View file

@ -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();

View file

@ -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));
}
}
}
}

View file

@ -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;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 5 KiB

View file

@ -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