Last few fixes. 0.6.11 done
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
**Bugfixes**
|
**Bugfixes**
|
||||||
- Fixed crafting patterns crashing when item of an input or output no longer exists
|
- Fixed crafting patterns crashing when item of an input or output no longer exists
|
||||||
- Fixed Grid letting the current held item flicker
|
- Fixed Grid letting the current held item flicker
|
||||||
|
- Fixed Importer / Exporter / External Storage not being able to push or pull out of a second chest in a double chest
|
||||||
- Converted all inventories in the mod to Forge's item handler capability system
|
- Converted all inventories in the mod to Forge's item handler capability system
|
||||||
|
|
||||||
### 0.6.10
|
### 0.6.10
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ import net.minecraft.world.IBlockAccess;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
import refinedstorage.RefinedStorage;
|
import refinedstorage.RefinedStorage;
|
||||||
import refinedstorage.RefinedStorageBlocks;
|
|
||||||
import refinedstorage.RefinedStorageUtils;
|
import refinedstorage.RefinedStorageUtils;
|
||||||
import refinedstorage.item.ItemBlockBase;
|
import refinedstorage.item.ItemBlockBase;
|
||||||
import refinedstorage.tile.TileBase;
|
import refinedstorage.tile.TileBase;
|
||||||
@@ -104,19 +103,12 @@ public abstract class BlockBase extends Block {
|
|||||||
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack itemStack) {
|
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack itemStack) {
|
||||||
super.onBlockPlacedBy(world, pos, state, player, itemStack);
|
super.onBlockPlacedBy(world, pos, state, player, itemStack);
|
||||||
|
|
||||||
Block blockPlaced = state.getBlock();
|
|
||||||
|
|
||||||
TileEntity tile = world.getTileEntity(pos);
|
TileEntity tile = world.getTileEntity(pos);
|
||||||
|
|
||||||
if (tile instanceof TileBase) {
|
if (tile instanceof TileBase) {
|
||||||
EnumFacing facing = BlockPistonBase.getFacingFromEntity(pos, player);
|
EnumFacing facing = BlockPistonBase.getFacingFromEntity(pos, player);
|
||||||
|
|
||||||
if (player.isSneaking() && (blockPlaced == RefinedStorageBlocks.IMPORTER ||
|
if (player.isSneaking() && hasOppositeFacingOnSneakPlace()) {
|
||||||
blockPlaced == RefinedStorageBlocks.EXPORTER ||
|
|
||||||
blockPlaced == RefinedStorageBlocks.EXTERNAL_STORAGE ||
|
|
||||||
blockPlaced == RefinedStorageBlocks.CONSTRUCTOR ||
|
|
||||||
blockPlaced == RefinedStorageBlocks.DESTRUCTOR ||
|
|
||||||
blockPlaced == RefinedStorageBlocks.CRAFTER)) {
|
|
||||||
facing = facing.getOpposite();
|
facing = facing.getOpposite();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,4 +152,8 @@ public abstract class BlockBase extends Block {
|
|||||||
public Item createItemForBlock() {
|
public Item createItemForBlock() {
|
||||||
return new ItemBlockBase(this, false);
|
return new ItemBlockBase(this, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean hasOppositeFacingOnSneakPlace() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,4 +30,9 @@ public class BlockConstructor extends BlockMachine {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasOppositeFacingOnSneakPlace() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,4 +30,9 @@ public class BlockCrafter extends BlockMachine {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasOppositeFacingOnSneakPlace() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,4 +30,9 @@ public class BlockDestructor extends BlockMachine {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasOppositeFacingOnSneakPlace() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,4 +30,9 @@ public class BlockExporter extends BlockMachine {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasOppositeFacingOnSneakPlace() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,4 +30,9 @@ public class BlockExternalStorage extends BlockMachine {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasOppositeFacingOnSneakPlace() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,4 +30,9 @@ public class BlockImporter extends BlockMachine {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasOppositeFacingOnSneakPlace() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,7 +33,11 @@ public class TileDestructor extends TileMachine implements ICompareConfig, IMode
|
|||||||
public static final int BASE_SPEED = 20;
|
public static final int BASE_SPEED = 20;
|
||||||
|
|
||||||
private BasicItemHandler filters = new BasicItemHandler(9, this);
|
private BasicItemHandler filters = new BasicItemHandler(9, this);
|
||||||
private BasicItemHandler upgrades = new BasicItemHandler(4, this, new BasicItemValidator(RefinedStorageItems.UPGRADE, ItemUpgrade.TYPE_SPEED));
|
private BasicItemHandler upgrades = new BasicItemHandler(
|
||||||
|
4,
|
||||||
|
this,
|
||||||
|
new BasicItemValidator(RefinedStorageItems.UPGRADE, ItemUpgrade.TYPE_SPEED)
|
||||||
|
);
|
||||||
|
|
||||||
private int compare = 0;
|
private int compare = 0;
|
||||||
private int mode = ModeConstants.WHITELIST;
|
private int mode = ModeConstants.WHITELIST;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import net.minecraft.item.ItemStack;
|
|||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
|
import net.minecraftforge.items.wrapper.CombinedInvWrapper;
|
||||||
import refinedstorage.RefinedStorageItems;
|
import refinedstorage.RefinedStorageItems;
|
||||||
import refinedstorage.RefinedStorageUtils;
|
import refinedstorage.RefinedStorageUtils;
|
||||||
import refinedstorage.container.ContainerCrafter;
|
import refinedstorage.container.ContainerCrafter;
|
||||||
@@ -83,16 +84,6 @@ public class TileCrafter extends TileMachine {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IItemHandler getDroppedItems() {
|
public IItemHandler getDroppedItems() {
|
||||||
BasicItemHandler dummy = new BasicItemHandler(PATTERN_SLOTS + 4);
|
return new CombinedInvWrapper(patterns, upgrades);
|
||||||
|
|
||||||
for (int i = 0; i < PATTERN_SLOTS; ++i) {
|
|
||||||
dummy.setStackInSlot(i, patterns.getStackInSlot(i));
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < 4; ++i) {
|
|
||||||
dummy.setStackInSlot(PATTERN_SLOTS + i, upgrades.getStackInSlot(i));
|
|
||||||
}
|
|
||||||
|
|
||||||
return dummy;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,17 +14,17 @@ public class SoldererRegistry {
|
|||||||
recipes.add(recipe);
|
recipes.add(recipe);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ISoldererRecipe getRecipe(IItemHandler inventory) {
|
public static ISoldererRecipe getRecipe(IItemHandler items) {
|
||||||
for (ISoldererRecipe recipe : recipes) {
|
for (ISoldererRecipe recipe : recipes) {
|
||||||
boolean ok = true;
|
boolean ok = true;
|
||||||
|
|
||||||
for (int i = 0; i < 3; ++i) {
|
for (int i = 0; i < 3; ++i) {
|
||||||
if (!RefinedStorageUtils.compareStackNoQuantity(recipe.getRow(i), inventory.getStackInSlot(i))) {
|
if (!RefinedStorageUtils.compareStackNoQuantity(recipe.getRow(i), items.getStackInSlot(i))) {
|
||||||
ok = false;
|
ok = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inventory.getStackInSlot(i) != null && recipe.getRow(i) != null) {
|
if (items.getStackInSlot(i) != null && recipe.getRow(i) != null) {
|
||||||
if (inventory.getStackInSlot(i).stackSize < recipe.getRow(i).stackSize) {
|
if (items.getStackInSlot(i).stackSize < recipe.getRow(i).stackSize) {
|
||||||
ok = false;
|
ok = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import net.minecraft.world.World;
|
|||||||
import net.minecraftforge.common.capabilities.Capability;
|
import net.minecraftforge.common.capabilities.Capability;
|
||||||
import net.minecraftforge.items.CapabilityItemHandler;
|
import net.minecraftforge.items.CapabilityItemHandler;
|
||||||
import net.minecraftforge.items.IItemHandler;
|
import net.minecraftforge.items.IItemHandler;
|
||||||
|
import net.minecraftforge.items.wrapper.CombinedInvWrapper;
|
||||||
import refinedstorage.RefinedStorageItems;
|
import refinedstorage.RefinedStorageItems;
|
||||||
import refinedstorage.RefinedStorageUtils;
|
import refinedstorage.RefinedStorageUtils;
|
||||||
import refinedstorage.container.ContainerSolderer;
|
import refinedstorage.container.ContainerSolderer;
|
||||||
@@ -179,17 +180,7 @@ public class TileSolderer extends TileMachine {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IItemHandler getDroppedItems() {
|
public IItemHandler getDroppedItems() {
|
||||||
BasicItemHandler dummy = new BasicItemHandler(4 + 4);
|
return new CombinedInvWrapper(items, upgrades);
|
||||||
|
|
||||||
for (int i = 0; i < 4; ++i) {
|
|
||||||
dummy.setStackInSlot(i, items.getStackInSlot(i));
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < 4; ++i) {
|
|
||||||
dummy.setStackInSlot(4 + i, upgrades.getStackInSlot(i));
|
|
||||||
}
|
|
||||||
|
|
||||||
return dummy;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user