Version increment to 0.7.9 + Fixed not being able to place sugar cane

This commit is contained in:
Raoul Van den Berge
2016-06-05 12:55:23 +02:00
parent 4492ba6f26
commit b1bc8cd378
4 changed files with 36 additions and 29 deletions

View File

@@ -19,7 +19,7 @@ import refinedstorage.proxy.CommonProxy;
@Mod(modid = RefinedStorage.ID, version = RefinedStorage.VERSION)
public final class RefinedStorage {
public static final String ID = "refinedstorage";
public static final String VERSION = "0.7.8";
public static final String VERSION = "0.7.9";
public static final SimpleNetworkWrapper NETWORK = NetworkRegistry.INSTANCE.newSimpleChannel(ID);

View File

@@ -3,7 +3,6 @@ package refinedstorage.tile;
import io.netty.buffer.ByteBuf;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.state.IBlockState;
import net.minecraft.inventory.Container;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
@@ -32,7 +31,36 @@ public class TileConstructor extends TileMachine implements ICompareConfig {
public static final int BASE_SPEED = 20;
private BasicItemHandler filter = new BasicItemHandler(1, this);
private BasicItemHandler filter = new BasicItemHandler(1, this) {
@Override
protected void onContentsChanged(int slot) {
super.onContentsChanged(slot);
ItemStack stack = getStackInSlot(0);
if (stack != null) {
Item item = stack.getItem();
if (item instanceof ItemBlockSpecial) {
try {
Field f = ((ItemBlockSpecial) item).getClass().getDeclaredField("block");
f.setAccessible(true);
block = (Block) f.get(item);
} catch (IllegalAccessException e) {
// NO OP
} catch (NoSuchFieldException e) {
// NO OP
}
} else if (item instanceof ItemBlock) {
block = ((ItemBlock) item).getBlock();
} else {
block = null;
}
} else {
block = null;
}
}
};
private BasicItemHandler upgrades = new BasicItemHandler(
4,
this,
@@ -41,6 +69,7 @@ public class TileConstructor extends TileMachine implements ICompareConfig {
);
private int compare = 0;
private Block block;
private CraftingTaskScheduler scheduler = new CraftingTaskScheduler();
@@ -51,32 +80,10 @@ public class TileConstructor extends TileMachine implements ICompareConfig {
@Override
public void updateMachine() {
if (ticks % RefinedStorageUtils.getSpeed(upgrades, BASE_SPEED, 4) == 0 && filter.getStackInSlot(0) != null) {
if (block != null && ticks % RefinedStorageUtils.getSpeed(upgrades, BASE_SPEED, 4) == 0) {
BlockPos front = pos.offset(getDirection());
IBlockState frontBlockState = worldObj.getBlockState(front);
if (!frontBlockState.getBlock().isAir(frontBlockState, worldObj, front)) {
return;
}
Item item = filter.getStackInSlot(0).getItem();
Block block = null;
if (item instanceof ItemBlockSpecial) {
try {
Field f = ((ItemBlockSpecial) item).getClass().getDeclaredField("block");
f.setAccessible(true);
block = (Block) f.get(item);
} catch (IllegalAccessException e) {
// NO OP
} catch (NoSuchFieldException e) {
// NO OP
}
} else if (item instanceof ItemBlock) {
block = ((ItemBlock) item).getBlock();
}
if (block != null && block.canPlaceBlockAt(worldObj, front)) {
if (worldObj.isAirBlock(front) && block.canPlaceBlockAt(worldObj, front)) {
ItemStack took = controller.take(filter.getStackInSlot(0), 1, compare);
if (took != null) {

View File

@@ -3,7 +3,7 @@
"modid": "refinedstorage",
"name": "Refined Storage",
"description": "A Minecraft mod all about storage.",
"version": "0.7.8",
"version": "0.7.9",
"mcversion": "1.9.4",
"url": "",
"updateUrl": "",