mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
my head hurts
This commit is contained in:
parent
8a080a037f
commit
67a9c91950
@ -129,6 +129,7 @@ public class ContainerCraneExtractor extends Container {
|
||||
}
|
||||
|
||||
slot.onSlotChanged();
|
||||
extractor.matcher.initPatternStandard(extractor.getWorldObj(), slot.getStack(), index);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -118,6 +118,7 @@ public class ModulePatternMatcher {
|
||||
public boolean isValidForFilter(ItemStack filter, int index, ItemStack input) {
|
||||
|
||||
String mode = modes[index];
|
||||
|
||||
switch(mode) {
|
||||
case MODE_EXACT: return input.isItemEqual(filter) && ItemStack.areItemStackTagsEqual(input, filter);
|
||||
case MODE_WILDCARD: return input.getItem() == filter.getItem() && ItemStack.areItemStackTagsEqual(input, filter);
|
||||
@ -137,7 +138,7 @@ public class ModulePatternMatcher {
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
|
||||
|
||||
for(int i = 0; i < modes.length; i++) {
|
||||
if(modes[i] != null) {
|
||||
nbt.setString("mode" + i, modes[i]);
|
||||
|
||||
@ -143,4 +143,19 @@ public class TileEntityMassStorage extends TileEntityCrateBase implements INBTPa
|
||||
this.output = !output;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemStack, int j) {
|
||||
return !this.isLocked() && i == 0 && (this.getType() == null || (getType().isItemEqual(itemStack) && ItemStack.areItemStackTagsEqual(itemStack, getType())));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
return !this.isLocked() && i == 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return new int[] { 0, 2 };
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,9 +45,9 @@ public class TileEntityCraneExtractor extends TileEntityMachineBase implements I
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
if(worldObj.getTotalWorldTime() % 20 == 0) {
|
||||
int amount = 16;
|
||||
int amount = 64;
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.blockMetadata);
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata());
|
||||
TileEntity te = worldObj.getTileEntity(xCoord - dir.offsetX, yCoord - dir.offsetY, zCoord - dir.offsetZ);
|
||||
Block b = worldObj.getBlock(xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ);
|
||||
|
||||
@ -99,6 +99,7 @@ public class TileEntityCraneExtractor extends TileEntityMachineBase implements I
|
||||
|
||||
public void networkUnpack(NBTTagCompound nbt) {
|
||||
this.isWhitelist = nbt.getBoolean("isWhitelist");
|
||||
this.matcher.modes = new String[this.matcher.modes.length];
|
||||
this.matcher.readFromNBT(nbt);
|
||||
}
|
||||
|
||||
@ -107,7 +108,7 @@ public class TileEntityCraneExtractor extends TileEntityMachineBase implements I
|
||||
for(int i = 0; i < 9; i++) {
|
||||
ItemStack filter = slots[i];
|
||||
|
||||
if(this.matcher.isValidForFilter(filter, i, stack)) {
|
||||
if(filter != null && this.matcher.isValidForFilter(filter, i, stack)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@ public class TileEntityCraneInserter extends TileEntityMachineBase implements IG
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.blockMetadata);
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata());
|
||||
TileEntity te = worldObj.getTileEntity(xCoord - dir.offsetX, yCoord - dir.offsetY, zCoord - dir.offsetZ);
|
||||
|
||||
int[] access = null;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user