Block certain side
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package refinedstorage.tile;
|
package refinedstorage.tile;
|
||||||
|
|
||||||
|
import mcmultipart.microblock.IMicroblock;
|
||||||
import net.minecraft.block.SoundType;
|
import net.minecraft.block.SoundType;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@@ -46,6 +47,11 @@ public class TileConstructor extends TileMultipartNode implements IComparable {
|
|||||||
dataManager.addWatchedParameter(COMPARE);
|
dataManager.addWatchedParameter(COMPARE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canAddMicroblock(IMicroblock microblock) {
|
||||||
|
return !isBlockingMicroblock(microblock, getDirection());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getEnergyUsage() {
|
public int getEnergyUsage() {
|
||||||
return RefinedStorage.INSTANCE.constructorUsage + upgrades.getEnergyUsage();
|
return RefinedStorage.INSTANCE.constructorUsage + upgrades.getEnergyUsage();
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
package refinedstorage.tile;
|
package refinedstorage.tile;
|
||||||
|
|
||||||
|
import mcmultipart.microblock.IMicroblock;
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.state.IBlockState;
|
import net.minecraft.block.state.IBlockState;
|
||||||
import net.minecraft.inventory.InventoryHelper;
|
import net.minecraft.inventory.InventoryHelper;
|
||||||
@@ -40,6 +41,11 @@ public class TileDestructor extends TileMultipartNode implements IComparable, IF
|
|||||||
dataManager.addWatchedParameter(MODE);
|
dataManager.addWatchedParameter(MODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canAddMicroblock(IMicroblock microblock) {
|
||||||
|
return !isBlockingMicroblock(microblock, getDirection());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getEnergyUsage() {
|
public int getEnergyUsage() {
|
||||||
return RefinedStorage.INSTANCE.destructorUsage + upgrades.getEnergyUsage();
|
return RefinedStorage.INSTANCE.destructorUsage + upgrades.getEnergyUsage();
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
package refinedstorage.tile;
|
package refinedstorage.tile;
|
||||||
|
|
||||||
|
import mcmultipart.microblock.IMicroblock;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
@@ -31,6 +32,11 @@ public class TileExporter extends TileMultipartNode implements IComparable {
|
|||||||
dataManager.addWatchedParameter(COMPARE);
|
dataManager.addWatchedParameter(COMPARE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canAddMicroblock(IMicroblock microblock) {
|
||||||
|
return !isBlockingMicroblock(microblock, getDirection());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getEnergyUsage() {
|
public int getEnergyUsage() {
|
||||||
return RefinedStorage.INSTANCE.exporterUsage + upgrades.getEnergyUsage();
|
return RefinedStorage.INSTANCE.exporterUsage + upgrades.getEnergyUsage();
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
package refinedstorage.tile;
|
package refinedstorage.tile;
|
||||||
|
|
||||||
|
import mcmultipart.microblock.IMicroblock;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.EnumFacing;
|
import net.minecraft.util.EnumFacing;
|
||||||
@@ -34,6 +35,11 @@ public class TileImporter extends TileMultipartNode implements IComparable, IFil
|
|||||||
dataManager.addWatchedParameter(MODE);
|
dataManager.addWatchedParameter(MODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canAddMicroblock(IMicroblock microblock) {
|
||||||
|
return !isBlockingMicroblock(microblock, getDirection());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getEnergyUsage() {
|
public int getEnergyUsage() {
|
||||||
return RefinedStorage.INSTANCE.importerUsage + upgrades.getEnergyUsage();
|
return RefinedStorage.INSTANCE.importerUsage + upgrades.getEnergyUsage();
|
||||||
|
@@ -82,19 +82,25 @@ public abstract class TileMultipartNode extends TileNode implements IMicroblockC
|
|||||||
|
|
||||||
if (tile instanceof TileMultipartNode) {
|
if (tile instanceof TileMultipartNode) {
|
||||||
for (IMicroblock microblock : ((TileMultipartNode) tile).getMicroblockContainer().getParts()) {
|
for (IMicroblock microblock : ((TileMultipartNode) tile).getMicroblockContainer().getParts()) {
|
||||||
if (microblock instanceof IMicroblock.IFaceMicroblock) {
|
if (isBlockingMicroblock(microblock, direction)) {
|
||||||
IMicroblock.IFaceMicroblock faceMicroblock = (IMicroblock.IFaceMicroblock) microblock;
|
|
||||||
|
|
||||||
if (faceMicroblock.getFace() == direction && !faceMicroblock.isFaceHollow()) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isBlockingMicroblock(IMicroblock microblock, EnumFacing direction) {
|
||||||
|
if (!(microblock instanceof IMicroblock.IFaceMicroblock)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
IMicroblock.IFaceMicroblock faceMicroblock = (IMicroblock.IFaceMicroblock) microblock;
|
||||||
|
|
||||||
|
return faceMicroblock.getFace() == direction && !faceMicroblock.isFaceHollow();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canConduct(EnumFacing direction) {
|
public boolean canConduct(EnumFacing direction) {
|
||||||
return !hasBlockingMicroblock(worldObj, pos, direction) && !hasBlockingMicroblock(worldObj, pos.offset(direction), direction.getOpposite());
|
return !hasBlockingMicroblock(worldObj, pos, direction) && !hasBlockingMicroblock(worldObj, pos.offset(direction), direction.getOpposite());
|
||||||
|
@@ -2,6 +2,7 @@ package refinedstorage.tile.externalstorage;
|
|||||||
|
|
||||||
import com.jaquadro.minecraft.storagedrawers.api.storage.IDrawer;
|
import com.jaquadro.minecraft.storagedrawers.api.storage.IDrawer;
|
||||||
import com.jaquadro.minecraft.storagedrawers.api.storage.IDrawerGroup;
|
import com.jaquadro.minecraft.storagedrawers.api.storage.IDrawerGroup;
|
||||||
|
import mcmultipart.microblock.IMicroblock;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.network.datasync.DataSerializers;
|
import net.minecraft.network.datasync.DataSerializers;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
@@ -64,6 +65,11 @@ public class TileExternalStorage extends TileMultipartNode implements IStoragePr
|
|||||||
dataManager.addWatchedParameter(CAPACITY);
|
dataManager.addWatchedParameter(CAPACITY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canAddMicroblock(IMicroblock microblock) {
|
||||||
|
return !isBlockingMicroblock(microblock, getDirection());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getEnergyUsage() {
|
public int getEnergyUsage() {
|
||||||
return RefinedStorage.INSTANCE.externalStorageUsage + (storages.size() * RefinedStorage.INSTANCE.externalStoragePerStorageUsage);
|
return RefinedStorage.INSTANCE.externalStorageUsage + (storages.size() * RefinedStorage.INSTANCE.externalStoragePerStorageUsage);
|
||||||
|
Reference in New Issue
Block a user