Fix Machine Casings

This commit is contained in:
modmuss50 2016-12-05 10:17:39 +00:00
parent c661f6b278
commit 8379115c97
4 changed files with 11 additions and 16 deletions

View file

@ -18,7 +18,7 @@ import techreborn.init.ModBlocks;
import java.security.InvalidParameterException; import java.security.InvalidParameterException;
public class BlockMachineFrame extends BaseBlock implements ITexturedBlock { public class BlockMachineFrame extends BaseBlock {
public static final String[] types = new String[] { "machine", "advancedMachine", "highlyAdvancedMachine" }; public static final String[] types = new String[] { "machine", "advancedMachine", "highlyAdvancedMachine" };
public static final PropertyInteger METADATA = PropertyInteger.create("type", 0, types.length - 1); public static final PropertyInteger METADATA = PropertyInteger.create("type", 0, types.length - 1);
@ -52,16 +52,6 @@ public class BlockMachineFrame extends BaseBlock implements ITexturedBlock {
return getMetaFromState(state); return getMetaFromState(state);
} }
@Override
public String getTextureNameFromState(IBlockState blockState, EnumFacing facing) {
return "techreborn:blocks/machine/machine_blocks/" + types[getMetaFromState(blockState)] + "_machine_block";
}
@Override
public int amountOfStates() {
return types.length;
}
@Override @Override
public int getMetaFromState(IBlockState state) { public int getMetaFromState(IBlockState state) {
return state.getValue(METADATA); return state.getValue(METADATA);

View file

@ -327,6 +327,7 @@ public class ModBlocks {
machineframe = new BlockMachineFrame(Material.IRON); machineframe = new BlockMachineFrame(Material.IRON);
registerBlock(machineframe, ItemBlockMachineFrame.class, "techreborn.machineFrame"); registerBlock(machineframe, ItemBlockMachineFrame.class, "techreborn.machineFrame");
Core.proxy.registerCustomBlockStateLocation(machineframe, "machines/storage/machine_blocks");
grinder = new BlockGrinder(Material.IRON); grinder = new BlockGrinder(Material.IRON);
registerBlock(grinder, "techreborn.grinder"); registerBlock(grinder, "techreborn.grinder");

View file

@ -24,6 +24,7 @@ import reborncore.client.multiblock.MultiblockRenderEvent;
import reborncore.common.blocks.BlockMachineBase; import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core; import techreborn.Core;
import techreborn.blocks.BlockMachineCasing; import techreborn.blocks.BlockMachineCasing;
import techreborn.blocks.BlockMachineFrame;
import techreborn.blocks.BlockRubberLeaves; import techreborn.blocks.BlockRubberLeaves;
import techreborn.client.ClientMultiBlocks; import techreborn.client.ClientMultiBlocks;
import techreborn.client.IconSupplier; import techreborn.client.IconSupplier;
@ -70,6 +71,9 @@ public class ClientProxy extends CommonProxy {
for (int i = 0; i < BlockMachineCasing.types.length; i++) { for (int i = 0; i < BlockMachineCasing.types.length; i++) {
Core.proxy.registerSubBlockInventoryLocation(ModBlocks.machineCasing, i, "techreborn:machines/structure/machine_casing", "type=" + i); Core.proxy.registerSubBlockInventoryLocation(ModBlocks.machineCasing, i, "techreborn:machines/structure/machine_casing", "type=" + i);
} }
for (int i = 0; i < BlockMachineFrame.types.length; i++) {
Core.proxy.registerSubBlockInventoryLocation(ModBlocks.machineframe, i, "techreborn:machines/storage/machine_blocks", "type=" + i);
}
ModelDynamicCell.init(); ModelDynamicCell.init();
RegisterItemJsons.registerModels(); RegisterItemJsons.registerModels();

View file

@ -9,18 +9,18 @@
"inventory": [ "inventory": [
{} {}
], ],
"tier1": { "type": {
"galena": { "0": {
"textures": { "textures": {
"all": "techreborn:blocks/machines/structure/tier1_machine_block" "all": "techreborn:blocks/machines/structure/tier1_machine_block"
} }
}, },
"tier2": { "1": {
"textures": { "textures": {
"all": "techreborn:blocks/machines/structure/tier2_machine_block" "all": "techreborn:blocks/machines/structure/tier2_machine_block"
} }
}, },
"tier3": { "2": {
"textures": { "textures": {
"all": "techreborn:blocks/machines/structure/tier3_machine_block" "all": "techreborn:blocks/machines/structure/tier3_machine_block"
} }