Started work on new Digital Miner filter system
|
@ -171,6 +171,14 @@ public class GuiMItemStackFilter extends GuiMekanism
|
|||
drawTexturedModalRect(guiWidth + 5, guiHeight + 5, 176, 11, 11, 11);
|
||||
}
|
||||
|
||||
if(xAxis >= 148 && xAxis <= 162 && yAxis >= 45 && yAxis <= 59)
|
||||
{
|
||||
drawTexturedModalRect(guiWidth + 148, guiHeight + 45, 176 + 23, 0, 14, 14);
|
||||
}
|
||||
else {
|
||||
drawTexturedModalRect(guiWidth + 148, guiHeight + 45, 176 + 23, 14, 14, 14);
|
||||
}
|
||||
|
||||
if(xAxis >= 12 && xAxis <= 28 && yAxis >= 19 && yAxis <= 35)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
|
@ -185,6 +193,21 @@ public class GuiMItemStackFilter extends GuiMekanism
|
|||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
if(xAxis >= 149 && xAxis <= 165 && yAxis >= 19 && yAxis <= 35)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
|
||||
int x = guiWidth + 149;
|
||||
int y = guiHeight + 19;
|
||||
drawGradientRect(x, y, x + 16, y + 16, -2130706433, -2130706433);
|
||||
|
||||
GL11.glPopAttrib();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -171,6 +171,14 @@ public class GuiMMaterialFilter extends GuiMekanism
|
|||
drawTexturedModalRect(guiWidth + 5, guiHeight + 5, 176, 11, 11, 11);
|
||||
}
|
||||
|
||||
if(xAxis >= 148 && xAxis <= 162 && yAxis >= 45 && yAxis <= 59)
|
||||
{
|
||||
drawTexturedModalRect(guiWidth + 148, guiHeight + 45, 176 + 23, 0, 14, 14);
|
||||
}
|
||||
else {
|
||||
drawTexturedModalRect(guiWidth + 148, guiHeight + 45, 176 + 23, 14, 14, 14);
|
||||
}
|
||||
|
||||
if(xAxis >= 12 && xAxis <= 28 && yAxis >= 19 && yAxis <= 35)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
|
@ -185,6 +193,21 @@ public class GuiMMaterialFilter extends GuiMekanism
|
|||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
if(xAxis >= 149 && xAxis <= 165 && yAxis >= 19 && yAxis <= 35)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
|
||||
int x = guiWidth + 149;
|
||||
int y = guiHeight + 19;
|
||||
drawGradientRect(x, y, x + 16, y + 16, -2130706433, -2130706433);
|
||||
|
||||
GL11.glPopAttrib();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -203,6 +203,29 @@ public class GuiMModIDFilter extends GuiMekanism
|
|||
drawTexturedModalRect(guiWidth + 131, guiHeight + 47, 176 + 11, 12, 12, 12);
|
||||
}
|
||||
|
||||
if(xAxis >= 148 && xAxis <= 162 && yAxis >= 45 && yAxis <= 59)
|
||||
{
|
||||
drawTexturedModalRect(guiWidth + 148, guiHeight + 45, 176 + 23, 0, 14, 14);
|
||||
}
|
||||
else {
|
||||
drawTexturedModalRect(guiWidth + 148, guiHeight + 45, 176 + 23, 14, 14, 14);
|
||||
}
|
||||
|
||||
if(xAxis >= 149 && xAxis <= 165 && yAxis >= 19 && yAxis <= 35)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
|
||||
int x = guiWidth + 149;
|
||||
int y = guiHeight + 19;
|
||||
drawGradientRect(x, y, x + 16, y + 16, -2130706433, -2130706433);
|
||||
|
||||
GL11.glPopAttrib();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
modIDText.drawTextBox();
|
||||
}
|
||||
|
||||
|
|
|
@ -206,6 +206,29 @@ public class GuiMOreDictFilter extends GuiMekanism
|
|||
drawTexturedModalRect(guiWidth + 131, guiHeight + 47, 176 + 11, 12, 12, 12);
|
||||
}
|
||||
|
||||
if(xAxis >= 148 && xAxis <= 162 && yAxis >= 45 && yAxis <= 59)
|
||||
{
|
||||
drawTexturedModalRect(guiWidth + 148, guiHeight + 45, 176 + 23, 0, 14, 14);
|
||||
}
|
||||
else {
|
||||
drawTexturedModalRect(guiWidth + 148, guiHeight + 45, 176 + 23, 14, 14, 14);
|
||||
}
|
||||
|
||||
if(xAxis >= 149 && xAxis <= 165 && yAxis >= 19 && yAxis <= 35)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
|
||||
int x = guiWidth + 149;
|
||||
int y = guiHeight + 19;
|
||||
drawGradientRect(x, y, x + 16, y + 16, -2130706433, -2130706433);
|
||||
|
||||
GL11.glPopAttrib();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
oreDictText.drawTextBox();
|
||||
}
|
||||
|
||||
|
|
|
@ -211,7 +211,7 @@ public class EntityFlame extends Entity implements IEntityAdditionalSpawnData
|
|||
item.ticksExisted = 0;
|
||||
|
||||
spawnParticlesAt(new Pos3D(item));
|
||||
worldObj.playSoundAtEntity(this, "random.fizz", 1.0F, 1.0F);
|
||||
worldObj.playSoundAtEntity(item, "random.fizz", 1.0F, 1.0F);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -47,6 +47,8 @@ public class MItemStackFilter extends MinerFilter
|
|||
@Override
|
||||
public NBTTagCompound write(NBTTagCompound nbtTags)
|
||||
{
|
||||
super.write(nbtTags);
|
||||
|
||||
nbtTags.setInteger("type", 0);
|
||||
itemType.writeToNBT(nbtTags);
|
||||
|
||||
|
@ -56,6 +58,8 @@ public class MItemStackFilter extends MinerFilter
|
|||
@Override
|
||||
protected void read(NBTTagCompound nbtTags)
|
||||
{
|
||||
super.read(nbtTags);
|
||||
|
||||
itemType = ItemStack.loadItemStackFromNBT(nbtTags);
|
||||
}
|
||||
|
||||
|
@ -64,6 +68,8 @@ public class MItemStackFilter extends MinerFilter
|
|||
{
|
||||
data.add(0);
|
||||
|
||||
super.write(data);
|
||||
|
||||
data.add(MekanismUtils.getID(itemType));
|
||||
data.add(itemType.stackSize);
|
||||
data.add(itemType.getItemDamage());
|
||||
|
@ -72,6 +78,8 @@ public class MItemStackFilter extends MinerFilter
|
|||
@Override
|
||||
protected void read(ByteBuf dataStream)
|
||||
{
|
||||
super.read(dataStream);
|
||||
|
||||
itemType = new ItemStack(Item.getItemById(dataStream.readInt()), dataStream.readInt(), dataStream.readInt());
|
||||
}
|
||||
|
||||
|
@ -95,6 +103,8 @@ public class MItemStackFilter extends MinerFilter
|
|||
public MItemStackFilter clone()
|
||||
{
|
||||
MItemStackFilter filter = new MItemStackFilter();
|
||||
filter.replaceStack = replaceStack;
|
||||
filter.requireStack = requireStack;
|
||||
filter.itemType = itemType.copy();
|
||||
|
||||
return filter;
|
||||
|
|
|
@ -36,6 +36,8 @@ public class MMaterialFilter extends MinerFilter
|
|||
@Override
|
||||
public NBTTagCompound write(NBTTagCompound nbtTags)
|
||||
{
|
||||
super.write(nbtTags);
|
||||
|
||||
nbtTags.setInteger("type", 2);
|
||||
materialItem.writeToNBT(nbtTags);
|
||||
|
||||
|
@ -45,6 +47,8 @@ public class MMaterialFilter extends MinerFilter
|
|||
@Override
|
||||
protected void read(NBTTagCompound nbtTags)
|
||||
{
|
||||
super.read(nbtTags);
|
||||
|
||||
materialItem = ItemStack.loadItemStackFromNBT(nbtTags);
|
||||
}
|
||||
|
||||
|
@ -53,6 +57,8 @@ public class MMaterialFilter extends MinerFilter
|
|||
{
|
||||
data.add(2);
|
||||
|
||||
super.write(data);
|
||||
|
||||
data.add(MekanismUtils.getID(materialItem));
|
||||
data.add(materialItem.stackSize);
|
||||
data.add(materialItem.getItemDamage());
|
||||
|
@ -61,6 +67,8 @@ public class MMaterialFilter extends MinerFilter
|
|||
@Override
|
||||
protected void read(ByteBuf dataStream)
|
||||
{
|
||||
super.read(dataStream);
|
||||
|
||||
materialItem = new ItemStack(Item.getItemById(dataStream.readInt()), dataStream.readInt(), dataStream.readInt());
|
||||
}
|
||||
|
||||
|
@ -84,6 +92,8 @@ public class MMaterialFilter extends MinerFilter
|
|||
public MMaterialFilter clone()
|
||||
{
|
||||
MMaterialFilter filter = new MMaterialFilter();
|
||||
filter.replaceStack = replaceStack;
|
||||
filter.requireStack = requireStack;
|
||||
filter.materialItem = materialItem;
|
||||
|
||||
return filter;
|
||||
|
|
|
@ -28,6 +28,8 @@ public class MModIDFilter extends MinerFilter
|
|||
@Override
|
||||
public NBTTagCompound write(NBTTagCompound nbtTags)
|
||||
{
|
||||
super.write(nbtTags);
|
||||
|
||||
nbtTags.setInteger("type", 3);
|
||||
nbtTags.setString("modID", modID);
|
||||
|
||||
|
@ -37,6 +39,8 @@ public class MModIDFilter extends MinerFilter
|
|||
@Override
|
||||
protected void read(NBTTagCompound nbtTags)
|
||||
{
|
||||
super.read(nbtTags);
|
||||
|
||||
modID = nbtTags.getString("modID");
|
||||
}
|
||||
|
||||
|
@ -44,12 +48,17 @@ public class MModIDFilter extends MinerFilter
|
|||
public void write(ArrayList data)
|
||||
{
|
||||
data.add(3);
|
||||
|
||||
super.write(data);
|
||||
|
||||
data.add(modID);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void read(ByteBuf dataStream)
|
||||
{
|
||||
super.read(dataStream);
|
||||
|
||||
modID = PacketHandler.readString(dataStream);
|
||||
}
|
||||
|
||||
|
@ -71,6 +80,8 @@ public class MModIDFilter extends MinerFilter
|
|||
public MModIDFilter clone()
|
||||
{
|
||||
MModIDFilter filter = new MModIDFilter();
|
||||
filter.replaceStack = replaceStack;
|
||||
filter.requireStack = requireStack;
|
||||
filter.modID = modID;
|
||||
|
||||
return filter;
|
||||
|
|
|
@ -71,6 +71,8 @@ public class MOreDictFilter extends MinerFilter
|
|||
public MOreDictFilter clone()
|
||||
{
|
||||
MOreDictFilter filter = new MOreDictFilter();
|
||||
filter.replaceStack = replaceStack;
|
||||
filter.requireStack = requireStack;
|
||||
filter.oreDictName = oreDictName;
|
||||
|
||||
return filter;
|
||||
|
|
|
@ -4,20 +4,64 @@ import io.netty.buffer.ByteBuf;
|
|||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public abstract class MinerFilter
|
||||
{
|
||||
public ItemStack replaceStack;
|
||||
|
||||
public boolean requireStack;
|
||||
|
||||
public abstract boolean canFilter(ItemStack itemStack);
|
||||
|
||||
public abstract NBTTagCompound write(NBTTagCompound nbtTags);
|
||||
public NBTTagCompound write(NBTTagCompound nbtTags)
|
||||
{
|
||||
nbtTags.setBoolean("requireStack", requireStack);
|
||||
|
||||
protected abstract void read(NBTTagCompound nbtTags);
|
||||
if(replaceStack != null)
|
||||
{
|
||||
nbtTags.setTag("replaceStack", replaceStack.writeToNBT(new NBTTagCompound()));
|
||||
}
|
||||
|
||||
public abstract void write(ArrayList data);
|
||||
return nbtTags;
|
||||
}
|
||||
|
||||
protected abstract void read(ByteBuf dataStream);
|
||||
protected void read(NBTTagCompound nbtTags)
|
||||
{
|
||||
requireStack = nbtTags.getBoolean("requireStack");
|
||||
|
||||
if(nbtTags.hasKey("replaceStack"))
|
||||
{
|
||||
replaceStack = ItemStack.loadItemStackFromNBT(nbtTags.getCompoundTag("replaceStack"));
|
||||
}
|
||||
}
|
||||
|
||||
public void write(ArrayList data)
|
||||
{
|
||||
if(replaceStack != null)
|
||||
{
|
||||
data.add(true);
|
||||
data.add(MekanismUtils.getID(replaceStack));
|
||||
data.add(replaceStack.getItemDamage());
|
||||
}
|
||||
else {
|
||||
data.add(false);
|
||||
}
|
||||
}
|
||||
|
||||
protected void read(ByteBuf dataStream)
|
||||
{
|
||||
if(dataStream.readBoolean())
|
||||
{
|
||||
replaceStack = new ItemStack(Block.getBlockById(dataStream.readInt()), 1, dataStream.readInt());
|
||||
}
|
||||
else {
|
||||
replaceStack = null;
|
||||
}
|
||||
}
|
||||
|
||||
public static MinerFilter readFromNBT(NBTTagCompound nbtTags)
|
||||
{
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package mekanism.common.miner;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.BitSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import mekanism.api.BlockInfo;
|
||||
|
@ -9,7 +11,6 @@ import mekanism.api.Coord4D;
|
|||
import mekanism.common.tile.TileEntityBoundingBlock;
|
||||
import mekanism.common.tile.TileEntityDigitalMiner;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
|
@ -20,6 +21,7 @@ public class ThreadMinerSearch extends Thread
|
|||
public State state = State.IDLE;
|
||||
|
||||
public BitSet oresToMine = new BitSet();
|
||||
public List<Integer> replaceMap = new ArrayList<Integer>();
|
||||
|
||||
public Map<BlockInfo, Boolean> acceptedItems = new HashMap<BlockInfo, Boolean>();
|
||||
|
||||
|
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 5.2 KiB |
Before Width: | Height: | Size: 4 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.6 KiB |