Flattened casings
This commit is contained in:
parent
1d4116a215
commit
f6c143dce3
21 changed files with 212 additions and 186 deletions
|
@ -24,14 +24,10 @@
|
|||
|
||||
package techreborn.blocks;
|
||||
|
||||
import com.google.common.base.CaseFormat;
|
||||
import com.google.common.collect.Lists;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
|
@ -40,69 +36,69 @@ import net.minecraft.util.NonNullList;
|
|||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import reborncore.api.ToolManager;
|
||||
import reborncore.client.models.ModelCompound;
|
||||
import reborncore.client.models.RebornModelRegistry;
|
||||
import reborncore.common.RebornCoreConfig;
|
||||
import reborncore.common.blocks.BlockWrenchEventHandler;
|
||||
import reborncore.common.blocks.PropertyString;
|
||||
import reborncore.common.items.WrenchHelper;
|
||||
import reborncore.common.multiblock.BlockMultiblockBase;
|
||||
import reborncore.common.util.ArrayUtils;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.lib.ModInfo;
|
||||
import techreborn.tiles.TileMachineCasing;
|
||||
import techreborn.utils.TechRebornCreativeTab;
|
||||
|
||||
import java.security.InvalidParameterException;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockMachineCasing extends BlockMultiblockBase {
|
||||
|
||||
public static final String[] types = new String[] { "standard", "reinforced", "advanced" };
|
||||
public static final PropertyString TYPE = new PropertyString("type", types);
|
||||
private static final List<String> typesList = Lists.newArrayList(ArrayUtils.arrayToLowercase(types));
|
||||
// public static final String[] types = new String[] { "standard", "reinforced", "advanced" };
|
||||
// public static final PropertyString TYPE = new PropertyString("type", types);
|
||||
// private static final List<String> typesList = Lists.newArrayList(ArrayUtils.arrayToLowercase(types));
|
||||
|
||||
public BlockMachineCasing() {
|
||||
super(Material.IRON);
|
||||
setCreativeTab(TechRebornCreativeTab.instance);
|
||||
setHardness(2F);
|
||||
this.setDefaultState(this.getDefaultState().withProperty(TYPE, "standard"));
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
RebornModelRegistry.registerModel(new ModelCompound(ModInfo.MOD_ID, this, i, "machines/structure").setInvVariant("type=" + types[i]));
|
||||
}
|
||||
RebornModelRegistry.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/structure"));
|
||||
// this.setDefaultState(this.getDefaultState().withProperty(TYPE, "standard"));
|
||||
// for (int i = 0; i < types.length; i++) {
|
||||
// RebornModelRegistry.registerModel(new ModelCompound(ModInfo.MOD_ID, this, i, "machines/structure").setInvVariant("type=" + types[i]));
|
||||
// }
|
||||
BlockWrenchEventHandler.wrenableBlocks.add(this);
|
||||
}
|
||||
|
||||
public static ItemStack getStackByName(String name, int count) {
|
||||
name = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name);
|
||||
for (int i = 0; i < types.length; i++) {
|
||||
if (types[i].equalsIgnoreCase(name)) {
|
||||
return new ItemStack(ModBlocks.MACHINE_CASINGS, count, i);
|
||||
}
|
||||
}
|
||||
throw new InvalidParameterException("The machine casing " + name + " could not be found.");
|
||||
}
|
||||
|
||||
public static ItemStack getStackByName(String name) {
|
||||
return getStackByName(name, 1);
|
||||
}
|
||||
// public static ItemStack getStackByName(String name, int count) {
|
||||
// name = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name);
|
||||
// for (int i = 0; i < types.length; i++) {
|
||||
// if (types[i].equalsIgnoreCase(name)) {
|
||||
// return new ItemStack(ModBlocks.MACHINE_CASINGS, count, i);
|
||||
// }
|
||||
// }
|
||||
// throw new InvalidParameterException("The machine casing " + name + " could not be found.");
|
||||
// }
|
||||
//
|
||||
// public static ItemStack getStackByName(String name) {
|
||||
// return getStackByName(name, 1);
|
||||
// }
|
||||
|
||||
/**
|
||||
* Provides heat info per casing for Industrial Blast Furnace
|
||||
* @param state Machine casing type
|
||||
* @param state IBlockstate Blockstate with Machine casing
|
||||
* @return Integer Heat value for casing
|
||||
*/
|
||||
public int getHeatFromState(IBlockState state) {
|
||||
switch (getMetaFromState(state)) {
|
||||
case 0:
|
||||
Block casing = state.getBlock();
|
||||
|
||||
if (casing == null ) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (casing == ModBlocks.MACHINE_CASINGS_STANDARD) {
|
||||
return 1020 / 25;
|
||||
case 1:
|
||||
}
|
||||
else if (casing == ModBlocks.MACHINE_CASINGS_REINFORCED) {
|
||||
return 1700 / 25;
|
||||
case 2:
|
||||
}
|
||||
else if (casing == ModBlocks.MACHINE_CASINGS_ADVANCED) {
|
||||
return 2380 / 25;
|
||||
}
|
||||
return 0;
|
||||
|
@ -111,10 +107,11 @@ public class BlockMachineCasing extends BlockMultiblockBase {
|
|||
@Override
|
||||
public void getDrops(NonNullList<ItemStack> drops, IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
if (RebornCoreConfig.wrenchRequired){
|
||||
if (state.getValue(TYPE) == "reinforced") {
|
||||
Block casing = state.getBlock();
|
||||
if (casing == ModBlocks.MACHINE_CASINGS_REINFORCED) {
|
||||
drops.add(new ItemStack(ModBlocks.MACHINE_BLOCK_ADVANCED));
|
||||
}
|
||||
else if (state.getValue(TYPE) == "advanced") {
|
||||
else if (casing == ModBlocks.MACHINE_CASINGS_ADVANCED) {
|
||||
drops.add(new ItemStack(ModBlocks.MACHINE_BLOCK_ELITE));
|
||||
}
|
||||
else {
|
||||
|
@ -146,41 +143,34 @@ public class BlockMachineCasing extends BlockMultiblockBase {
|
|||
return super.onBlockActivated(worldIn, pos, state, playerIn, hand, side, hitX, hitY, hitZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBlockState getStateFromMeta(int meta) {
|
||||
if (meta > types.length) {
|
||||
meta = 0;
|
||||
}
|
||||
return getBlockState().getBaseState().withProperty(TYPE, typesList.get(meta));
|
||||
}
|
||||
// @Override
|
||||
// public IBlockState getStateFromMeta(int meta) {
|
||||
// if (meta > types.length) {
|
||||
// meta = 0;
|
||||
// }
|
||||
// return getBlockState().getBaseState().withProperty(TYPE, typesList.get(meta));
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public int getMetaFromState(IBlockState state) {
|
||||
// return typesList.indexOf(state.getValue(TYPE));
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// protected BlockStateContainer createBlockState() {
|
||||
// return new BlockStateContainer(this, TYPE);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public Item getItemDropped(IBlockState state, Random rand, int fortune) {
|
||||
// return Item.getItemFromBlock(this);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
return typesList.indexOf(state.getValue(TYPE));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, TYPE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
|
||||
return Item.getItemFromBlock(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(CreativeTabs creativeTabs, NonNullList<ItemStack> list) {
|
||||
for (int meta = 0; meta < types.length; meta++) {
|
||||
list.add(new ItemStack(this, 1, meta));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(IBlockState state) {
|
||||
return getMetaFromState(state);
|
||||
}
|
||||
//
|
||||
// @Override
|
||||
// public int damageDropped(IBlockState state) {
|
||||
// return getMetaFromState(state);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(final World world, final int meta) {
|
||||
|
|
|
@ -112,43 +112,43 @@ public class GuiBlastFurnace extends GuiBase {
|
|||
{
|
||||
// This code here makes a basic multiblock and then sets to the selected one.
|
||||
final Multiblock multiblock = new Multiblock();
|
||||
this.addComponent(0, 0, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(1, 0, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(0, 0, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(-1, 0, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(0, 0, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(-1, 0, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(-1, 0, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(1, 0, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(1, 0, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(0, 0, 0, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(1, 0, 0, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(0, 0, 1, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(-1, 0, 0, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(0, 0, -1, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(-1, 0, -1, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(-1, 0, 1, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(1, 0, -1, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(1, 0, 1, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
|
||||
this.addComponent(1, 1, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(0, 1, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(-1, 1, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(0, 1, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(-1, 1, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(-1, 1, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(1, 1, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(1, 1, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(1, 1, 0, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(0, 1, 1, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(-1, 1, 0, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(0, 1, -1, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(-1, 1, -1, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(-1, 1, 1, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(1, 1, -1, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(1, 1, 1, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
|
||||
this.addComponent(1, 2, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(0, 2, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(-1, 2, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(0, 2, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(-1, 2, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(-1, 2, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(1, 2, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(1, 2, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(1, 2, 0, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(0, 2, 1, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(-1, 2, 0, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(0, 2, -1, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(-1, 2, -1, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(-1, 2, 1, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(1, 2, -1, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(1, 2, 1, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
|
||||
this.addComponent(0, 3, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(1, 3, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(0, 3, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(-1, 3, 0, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(0, 3, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(-1, 3, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(-1, 3, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(1, 3, -1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(1, 3, 1, ModBlocks.MACHINE_CASINGS.getDefaultState(), multiblock);
|
||||
this.addComponent(0, 3, 0, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(1, 3, 0, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(0, 3, 1, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(-1, 3, 0, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(0, 3, -1, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(-1, 3, -1, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(-1, 3, 1, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(1, 3, -1, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
this.addComponent(1, 3, 1, ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState(), multiblock);
|
||||
|
||||
final MultiblockSet set = new MultiblockSet(multiblock);
|
||||
ClientProxy.multiblockRenderEvent.setMultiblock(set);
|
||||
|
|
|
@ -33,7 +33,6 @@ import net.minecraft.util.math.BlockPos;
|
|||
import reborncore.client.multiblock.Multiblock;
|
||||
import reborncore.client.multiblock.MultiblockRenderEvent;
|
||||
import reborncore.client.multiblock.MultiblockSet;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.client.gui.widget.GuiButtonHologram;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.proxies.ClientProxy;
|
||||
|
@ -108,8 +107,8 @@ public class GuiDistillationTower extends GuiBase {
|
|||
{
|
||||
// This code here makes a basic multiblock and then sets to the selected one.
|
||||
final Multiblock multiblock = new Multiblock();
|
||||
IBlockState advancedCasing = ModBlocks.MACHINE_CASINGS.getDefaultState().withProperty(BlockMachineCasing.TYPE, "advanced");
|
||||
IBlockState standardCasing = ModBlocks.MACHINE_CASINGS.getDefaultState().withProperty(BlockMachineCasing.TYPE, "standard");
|
||||
IBlockState advancedCasing = ModBlocks.MACHINE_CASINGS_ADVANCED.getDefaultState();
|
||||
IBlockState standardCasing = ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState();
|
||||
|
||||
this.addComponent(0, 0, 0, standardCasing, multiblock);
|
||||
this.addComponent(1, 0, 0, standardCasing, multiblock);
|
||||
|
|
|
@ -32,7 +32,6 @@ import net.minecraft.util.math.BlockPos;
|
|||
import reborncore.client.multiblock.Multiblock;
|
||||
import reborncore.client.multiblock.MultiblockRenderEvent;
|
||||
import reborncore.client.multiblock.MultiblockSet;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.client.gui.widget.GuiButtonHologram;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.proxies.ClientProxy;
|
||||
|
@ -117,8 +116,7 @@ public class GuiFluidReplicator extends GuiBase {
|
|||
{
|
||||
// This code here makes a basic multiblock and then sets to the selected one.
|
||||
final Multiblock multiblock = new Multiblock();
|
||||
final IBlockState reinforcedCasing = ModBlocks.MACHINE_CASINGS.getDefaultState()
|
||||
.withProperty(BlockMachineCasing.TYPE, "reinforced");
|
||||
final IBlockState reinforcedCasing = ModBlocks.MACHINE_CASINGS_REINFORCED.getDefaultState();
|
||||
|
||||
addComponent(1, 0, 0, reinforcedCasing, multiblock);
|
||||
addComponent(0, 0, 1, reinforcedCasing, multiblock);
|
||||
|
|
|
@ -32,7 +32,6 @@ import net.minecraft.util.math.BlockPos;
|
|||
import reborncore.client.multiblock.Multiblock;
|
||||
import reborncore.client.multiblock.MultiblockRenderEvent;
|
||||
import reborncore.client.multiblock.MultiblockSet;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.client.gui.widget.GuiButtonHologram;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.proxies.ClientProxy;
|
||||
|
@ -114,7 +113,7 @@ public class GuiImplosionCompressor extends GuiBase {
|
|||
for (int y = -4; y <= -2; y++) {
|
||||
for (int z = -1; z <= 1; z++) {
|
||||
if (!((x == 0) && (y == -3) && (z == 0))) {
|
||||
this.addComponent(x, y, z, ModBlocks.MACHINE_CASINGS.getDefaultState().withProperty(BlockMachineCasing.TYPE, "reinforced"), multiblock);
|
||||
this.addComponent(x, y, z, ModBlocks.MACHINE_CASINGS_REINFORCED.getDefaultState(), multiblock);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,6 @@ import net.minecraft.util.math.BlockPos;
|
|||
import reborncore.client.multiblock.Multiblock;
|
||||
import reborncore.client.multiblock.MultiblockRenderEvent;
|
||||
import reborncore.client.multiblock.MultiblockSet;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.client.gui.widget.GuiButtonHologram;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.proxies.ClientProxy;
|
||||
|
@ -114,8 +113,8 @@ public class GuiIndustrialGrinder extends GuiBase {
|
|||
{
|
||||
// This code here makes a basic multiblock and then sets to the selected one.
|
||||
final Multiblock multiblock = new Multiblock();
|
||||
IBlockState standardCasing = ModBlocks.MACHINE_CASINGS.getDefaultState().withProperty(BlockMachineCasing.TYPE, "standard");
|
||||
IBlockState reinforcedCasing = ModBlocks.MACHINE_CASINGS.getDefaultState().withProperty(BlockMachineCasing.TYPE, "reinforced");
|
||||
IBlockState standardCasing = ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState();
|
||||
IBlockState reinforcedCasing = ModBlocks.MACHINE_CASINGS_REINFORCED.getDefaultState();
|
||||
|
||||
this.addComponent(0, -1, 0, standardCasing, multiblock);
|
||||
this.addComponent(1, -1, 0, standardCasing, multiblock);
|
||||
|
|
|
@ -33,7 +33,6 @@ import net.minecraft.util.math.BlockPos;
|
|||
import reborncore.client.multiblock.Multiblock;
|
||||
import reborncore.client.multiblock.MultiblockRenderEvent;
|
||||
import reborncore.client.multiblock.MultiblockSet;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.client.gui.widget.GuiButtonHologram;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.proxies.ClientProxy;
|
||||
|
@ -113,8 +112,8 @@ public class GuiIndustrialSawmill extends GuiBase {
|
|||
{
|
||||
// This code here makes a basic multiblock and then sets to the selected one.
|
||||
final Multiblock multiblock = new Multiblock();
|
||||
IBlockState standardCasing = ModBlocks.MACHINE_CASINGS.getDefaultState().withProperty(BlockMachineCasing.TYPE, "standard");
|
||||
IBlockState reinforcedCasing = ModBlocks.MACHINE_CASINGS.getDefaultState().withProperty(BlockMachineCasing.TYPE, "reinforced");
|
||||
IBlockState standardCasing = ModBlocks.MACHINE_CASINGS_STANDARD.getDefaultState();
|
||||
IBlockState reinforcedCasing = ModBlocks.MACHINE_CASINGS_REINFORCED.getDefaultState();
|
||||
|
||||
this.addComponent(0, -1, 0, standardCasing, multiblock);
|
||||
this.addComponent(1, -1, 0, standardCasing, multiblock);
|
||||
|
|
|
@ -31,7 +31,6 @@ import net.minecraft.util.math.BlockPos;
|
|||
import reborncore.client.multiblock.Multiblock;
|
||||
import reborncore.client.multiblock.MultiblockRenderEvent;
|
||||
import reborncore.client.multiblock.MultiblockSet;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.client.gui.widget.GuiButtonHologram;
|
||||
import techreborn.init.ModBlocks;
|
||||
import techreborn.proxies.ClientProxy;
|
||||
|
@ -105,7 +104,7 @@ public class GuiVacuumFreezer extends GuiBase {
|
|||
{
|
||||
// This code here makes a basic multiblock and then sets to the selected one.
|
||||
final Multiblock multiblock = new Multiblock();
|
||||
IBlockState reinforcedCasing = ModBlocks.MACHINE_CASINGS.getDefaultState().withProperty(BlockMachineCasing.TYPE, "reinforced");
|
||||
IBlockState reinforcedCasing = ModBlocks.MACHINE_CASINGS_REINFORCED.getDefaultState();
|
||||
|
||||
this.addComponent(0, -1, 0, reinforcedCasing, multiblock);
|
||||
this.addComponent(1, -1, 0, reinforcedCasing, multiblock);
|
||||
|
|
|
@ -57,7 +57,9 @@ public class ModBlocks {
|
|||
public static Block CABLE;
|
||||
public static Block COMPUTER_CUBE;
|
||||
public static Block FLARE;
|
||||
public static Block MACHINE_CASINGS;
|
||||
public static Block MACHINE_CASINGS_ADVANCED;
|
||||
public static Block MACHINE_CASINGS_REINFORCED;
|
||||
public static Block MACHINE_CASINGS_STANDARD;
|
||||
public static Block MACHINE_BLOCK_ADVANCED;
|
||||
public static Block MACHINE_BLOCK_BASIC;
|
||||
public static Block MACHINE_BLOCK_ELITE;
|
||||
|
@ -164,8 +166,14 @@ public class ModBlocks {
|
|||
MACHINE_BLOCK_ELITE = new BlockMachineFrames();
|
||||
registerBlock(MACHINE_BLOCK_ELITE, "machineBlockElite");
|
||||
|
||||
MACHINE_CASINGS = new BlockMachineCasing();
|
||||
registerBlock(MACHINE_CASINGS, ItemBlockMachineCasing.class, "machine_casing");
|
||||
MACHINE_CASINGS_ADVANCED = new BlockMachineCasing();
|
||||
registerBlock(MACHINE_CASINGS_ADVANCED, "machineCasingAdvanced");
|
||||
|
||||
MACHINE_CASINGS_REINFORCED = new BlockMachineCasing();
|
||||
registerBlock(MACHINE_CASINGS_REINFORCED, "machineCasingReinforced");
|
||||
|
||||
MACHINE_CASINGS_STANDARD = new BlockMachineCasing();
|
||||
registerBlock(MACHINE_CASINGS_STANDARD, "machineCasingStandard");
|
||||
|
||||
NUKE = new BlockNuke();
|
||||
registerBlock(NUKE, "nuke");
|
||||
|
|
|
@ -112,7 +112,7 @@ public class CraftingTableRecipes extends RecipeMethods {
|
|||
registerShaped(getStack(ModBlocks.WIND_MILL), " I ", " G ", " I ", 'I', "plateMagnalium", 'G', getStack(ModBlocks.SOLID_FUEL_GENEREATOR));
|
||||
registerShaped(getStack(ModBlocks.WIND_MILL), "IGI", 'I', "plateMagnalium", 'G', getStack(ModBlocks.SOLID_FUEL_GENEREATOR));
|
||||
registerShaped(getStack(ModBlocks.WATER_MILL), "SWS", "WGW", "SWS", 'S', "stickWood", 'W', "plankWood", 'G', getStack(ModBlocks.SOLID_FUEL_GENEREATOR));
|
||||
registerShaped(getStack(ModBlocks.LIGHTNING_ROD), "CAC", "ACA", "CAC", 'A', getStack(ModBlocks.MACHINE_CASINGS, 1, 2), 'C', "circuitMaster");
|
||||
// registerShaped(getStack(ModBlocks.LIGHTNING_ROD), "CAC", "ACA", "CAC", 'A', getStack(ModBlocks.MACHINE_CASINGS, 1, 2), 'C', "circuitMaster");
|
||||
registerShaped(getStack(ModBlocks.IRON_ALLOY_FURNACE), "III", "F F", "III", 'I', "ingotRefinedIron", 'F', getStack(ModBlocks.IRON_FURNACE));
|
||||
registerShaped(getStack(ModBlocks.INDUSTRIAL_ELECTROLYZER), "RER", "CFC", "RER", 'R', "plateIron", 'E', getStack(ModBlocks.EXTRACTOR), 'C', "circuitAdvanced", 'F', "machineBlockAdvanced");
|
||||
registerShaped(getStack(ModBlocks.INDUSTRIAL_CENTRIFUGE), "RCR", "AEA", "RCR", 'R', "ingotRefinedIron", 'E', getStack(ModBlocks.EXTRACTOR), 'A', "machineBlockAdvanced", 'C', "circuitAdvanced");
|
||||
|
@ -134,7 +134,7 @@ public class CraftingTableRecipes extends RecipeMethods {
|
|||
registerShaped(getStack(ModBlocks.LSU_STORAGE), "LLL", "LCL", "LLL", 'L', "blockLapis", 'C', "circuitBasic");
|
||||
registerShaped(getStack(ModBlocks.SCRAPBOXINATOR), "ICI", "DSD", "ICI", 'S', getStack(TRItems.SCRAP_BOX), 'C', "circuitBasic", 'I', "plateIron", 'D', "dirt");
|
||||
registerShaped(getStack(ModBlocks.FUSION_CONTROL_COMPUTER), "CCC", "PTP", "CCC", 'P', "energyCrystal", 'T', getStack(ModBlocks.FUSION_COIL), 'C', "circuitMaster");
|
||||
registerShaped(getStack(ModBlocks.FUSION_COIL), "CSC", "NAN", "CRC", 'A', getStack(ModBlocks.MACHINE_CASINGS, 1, 2), 'N', getMaterial("nichromeHeatingCoil", Type.PART), 'C', "circuitMaster", 'S', "craftingSuperconductor", 'R', getMaterial("iridiumNeutronReflector", Type.PART));
|
||||
// registerShaped(getStack(ModBlocks.FUSION_COIL), "CSC", "NAN", "CRC", 'A', getStack(ModBlocks.MACHINE_CASINGS, 1, 2), 'N', getMaterial("nichromeHeatingCoil", Type.PART), 'C', "circuitMaster", 'S', "craftingSuperconductor", 'R', getMaterial("iridiumNeutronReflector", Type.PART));
|
||||
registerShaped(getStack(ModBlocks.DIGITAL_CHEST), "PPP", "PDP", "PCP", 'P', "plateAluminum", 'D', TRIngredients.Parts.DATA_ORB.getStack(), 'C', TRIngredients.Parts.COMPUTER_MONITOR.getStack());
|
||||
registerShaped(getStack(ModBlocks.DIGITAL_CHEST), "PPP", "PDP", "PCP", 'P', "plateSteel", 'D', TRIngredients.Parts.DATA_ORB.getStack(), 'C', TRIngredients.Parts.COMPUTER_MONITOR.getStack());
|
||||
registerShaped(getStack(ModBlocks.MATTER_FABRICATOR), "ETE", "AOA", "ETE", 'E', "circuitMaster", 'T', getStack(ModBlocks.EXTRACTOR), 'A', "machineBlockElite", 'O', getStack(TRItems.LAPOTRONIC_ORB));
|
||||
|
|
|
@ -64,8 +64,8 @@ public abstract class RecipeMethods {
|
|||
return BlockCable.getCableByName(name, count);
|
||||
// } else if (type == Type.MACHINE_FRAME) {
|
||||
// return BlockMachineFrames.getFrameByName(name, count);
|
||||
} else if (type == Type.MACHINE_CASING) {
|
||||
return BlockMachineCasing.getStackByName(name, count);
|
||||
// } else if (type == Type.MACHINE_CASING) {
|
||||
// return BlockMachineCasing.getStackByName(name, count);
|
||||
// } else if (type == Type.UPGRADE) {
|
||||
// return ItemUpgrades.getUpgradeByName(name, count);
|
||||
// } else if (type == Type.ORE) {
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
/*
|
||||
* This file is part of TechReborn, licensed under the MIT License (MIT).
|
||||
*
|
||||
* Copyright (c) 2018 TechReborn
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
package techreborn.itemblocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemMultiTexture;
|
||||
import techreborn.blocks.BlockMachineCasing;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
public class ItemBlockMachineCasing extends ItemMultiTexture {
|
||||
|
||||
public ItemBlockMachineCasing(Block block) {
|
||||
super(ModBlocks.MACHINE_CASINGS, ModBlocks.MACHINE_CASINGS, BlockMachineCasing.types);
|
||||
}
|
||||
|
||||
}
|
|
@ -335,7 +335,7 @@ public class MultiBlockCasing extends RectangularMultiblockControllerBase {
|
|||
@Override
|
||||
protected void isBlockGoodForFrame(World world, int x, int y, int z) throws MultiblockValidationException {
|
||||
Block block = world.getBlockState(new BlockPos(x, y, z)).getBlock();
|
||||
if (block == ModBlocks.MACHINE_CASINGS) {
|
||||
if (block == ModBlocks.MACHINE_CASINGS_STANDARD || block == ModBlocks.MACHINE_CASINGS_REINFORCED || block == ModBlocks.MACHINE_CASINGS_ADVANCED) {
|
||||
|
||||
} else {
|
||||
super.isBlockGoodForFrame(world, x, y, z);
|
||||
|
|
|
@ -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()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -203,7 +203,7 @@ public class TileMatterFabricator extends TilePowerAcceptor
|
|||
|
||||
// ItemHandlerProvider
|
||||
@Override
|
||||
public Inventory getInventory() {
|
||||
public Inventory<TileMatterFabricator> getInventory() {
|
||||
return inventory;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"transform": "forge:default-block",
|
||||
"model": "cube_all",
|
||||
"textures": {
|
||||
"all": "techreborn:blocks/machines/structure/tier3_casing"
|
||||
}
|
||||
},
|
||||
"variants": {
|
||||
"inventory": [
|
||||
{
|
||||
|
||||
}
|
||||
],
|
||||
"normal": [
|
||||
{
|
||||
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"transform": "forge:default-block",
|
||||
"model": "cube_all",
|
||||
"textures": {
|
||||
"all": "techreborn:blocks/machines/structure/tier2_casing"
|
||||
}
|
||||
},
|
||||
"variants": {
|
||||
"inventory": [
|
||||
{
|
||||
|
||||
}
|
||||
],
|
||||
"normal": [
|
||||
{
|
||||
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"transform": "forge:default-block",
|
||||
"model": "cube_all",
|
||||
"textures": {
|
||||
"all": "techreborn:blocks/machines/structure/tier1_casing"
|
||||
}
|
||||
},
|
||||
"variants": {
|
||||
"inventory": [
|
||||
{
|
||||
|
||||
}
|
||||
],
|
||||
"normal": [
|
||||
{
|
||||
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
|
@ -14,9 +14,9 @@ tile.techreborn.creative_quantum_chest.name=Creative Quantum Chest
|
|||
tile.techreborn.digital_chest.name=Digital Chest
|
||||
tile.techreborn.industrial_centrifuge.name=Industrial Centrifuge
|
||||
tile.techreborn.rolling_machine.name=Rolling Machine
|
||||
tile.techreborn.machine_casing.standard.name=Standard Machine Casing
|
||||
tile.techreborn.machine_casing.reinforced.name=Reinforced Machine Casing
|
||||
tile.techreborn.machine_casing.advanced.name=Advanced Machine Casing
|
||||
tile.techreborn.machinecasingstandard.name=Standard Machine Casing
|
||||
tile.techreborn.machinecasingreinforced.name=Reinforced Machine Casing
|
||||
tile.techreborn.machinecasingadvanced.name=Advanced Machine Casing
|
||||
tile.techreborn.industrial_blast_furnace.name=Industrial Blast Furnace
|
||||
tile.techreborn.alloy_smelter.name=Alloy Smelter
|
||||
tile.techreborn.matter_fabricator.name=Matter Fabricator
|
||||
|
|
Loading…
Reference in a new issue