Flattened casings

This commit is contained in:
drcrazy 2018-09-16 03:34:26 +03:00
parent 1d4116a215
commit f6c143dce3
21 changed files with 212 additions and 186 deletions

View file

@ -25,11 +25,11 @@
package techreborn.tiles;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import reborncore.api.IToolDrop;
import reborncore.common.multiblock.MultiblockControllerBase;
import reborncore.common.multiblock.rectangular.RectangularMultiblockTileEntityBase;
import techreborn.blocks.BlockMachineCasing;
import techreborn.multiblocks.MultiBlockCasing;
public class TileMachineCasing extends RectangularMultiblockTileEntityBase
@ -93,6 +93,6 @@ public class TileMachineCasing extends RectangularMultiblockTileEntityBase
// IToolDrop
@Override
public ItemStack getToolDrop(EntityPlayer playerIn) {
return BlockMachineCasing.getStackByName(world.getBlockState(pos).getValue(BlockMachineCasing.TYPE));
return new ItemStack(Item.getItemFromBlock(world.getBlockState(pos).getBlock()));
}
}

View file

@ -203,7 +203,7 @@ public class TileMatterFabricator extends TilePowerAcceptor
// ItemHandlerProvider
@Override
public Inventory getInventory() {
public Inventory<TileMatterFabricator> getInventory() {
return inventory;
}

View file

@ -47,7 +47,7 @@ public class TileTechStorageBase extends TileLegacyMachineBase
implements ItemHandlerProvider, IToolDrop, IListInfoProvider {
public final int maxCapacity;
public final Inventory inventory;
public final Inventory<TileTechStorageBase> inventory;
public ItemStack storedItem;
public TileTechStorageBase(String name, int maxCapacity) {
@ -228,7 +228,7 @@ public class TileTechStorageBase extends TileLegacyMachineBase
// ItemHandlerProvider
@Override
public Inventory getInventory() {
public Inventory<TileTechStorageBase> getInventory() {
return inventory;
}

View file

@ -24,10 +24,10 @@
package techreborn.tiles.multiblock;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import techreborn.blocks.BlockMachineCasing;
import techreborn.init.ModBlocks;
public class MultiblockChecker {
@ -47,12 +47,19 @@ public class MultiblockChecker {
this.downCenter = downCenter;
}
// TODO: make thid not so ugly
public boolean checkCasing(int offX, int offY, int offZ, String type) {
IBlockState block = getBlock(offX, offY, offZ);
if (block.getBlock() == ModBlocks.MACHINE_CASINGS) {
Block block = getBlock(offX, offY, offZ).getBlock();
if (block == ModBlocks.MACHINE_CASINGS_STANDARD || block == ModBlocks.MACHINE_CASINGS_REINFORCED || block == ModBlocks.MACHINE_CASINGS_ADVANCED ) {
if (type == MultiblockChecker.CASING_ANY) {
return true;
} else if (block.getValue(BlockMachineCasing.TYPE).equals(type)) {
} else if ( type == "standard" && block == ModBlocks.MACHINE_CASINGS_STANDARD) {
return true;
}
else if (type == "reinforced" && block == ModBlocks.MACHINE_CASINGS_REINFORCED) {
return true;
}
else if (type == "advanced" && block == ModBlocks.MACHINE_CASINGS_ADVANCED) {
return true;
}
}