Continue the great refactor of mid 2017 (A lot of stuff still broken, it's a WIP)

This commit is contained in:
Prospector 2017-06-14 08:56:09 -07:00
parent 1fa9f1cf52
commit 40e3062903
123 changed files with 1469 additions and 1486 deletions

View file

@ -27,15 +27,18 @@ package techreborn.blocks;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
public class BlockFusionCoil extends Block {
public BlockFusionCoil(Material material) {
public BlockFusionCoil() {
super(Material.IRON);
setHardness(2f);
setSoundType(SoundType.METAL);
setUnlocalizedName("techreborn.fusioncoil");
setCreativeTab(TechRebornCreativeTab.instance);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/generators"));
}
}

View file

@ -24,33 +24,35 @@
package techreborn.blocks;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;
import techreborn.tiles.fusionReactor.TileEntityFusionController;
import techreborn.lib.ModInfo;
import techreborn.tiles.fusionReactor.TileFusionControlComputer;
import techreborn.utils.damageSources.FusionDamageSource;
public class BlockFusionControlComputer extends BlockMachineBase {
public BlockFusionControlComputer(final Material material) {
public BlockFusionControlComputer() {
super();
this.setUnlocalizedName("techreborn.fusioncontrolcomputer");
this.setCreativeTab(TechRebornCreativeTab.instance);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/generators"));
}
@Override
public boolean onBlockActivated(final World world, final int x, final int y, final int z, final EntityPlayer player, final int side, final float hitX,
final float hitY, final float hitZ) {
final TileEntityFusionController tileEntityFusionController = (TileEntityFusionController) world
final TileFusionControlComputer tileFusionControlComputer = (TileFusionControlComputer) world
.getTileEntity(new BlockPos(x, y, z));
tileEntityFusionController.checkCoils();
tileFusionControlComputer.checkCoils();
if (!player.isSneaking())
player.openGui(Core.INSTANCE, EGui.FUSION_CONTROLLER.ordinal(), world, x, y, z);
return true;
@ -59,9 +61,9 @@ public class BlockFusionControlComputer extends BlockMachineBase {
@Override
public void onEntityWalk(final World worldIn, final BlockPos pos, final Entity entityIn) {
super.onEntityWalk(worldIn, pos, entityIn);
if (worldIn.getTileEntity(pos) instanceof TileEntityFusionController) {
if (((TileEntityFusionController) worldIn.getTileEntity(pos)).crafingTickTime != 0
&& ((TileEntityFusionController) worldIn.getTileEntity(pos)).checkCoils()) {
if (worldIn.getTileEntity(pos) instanceof TileFusionControlComputer) {
if (((TileFusionControlComputer) worldIn.getTileEntity(pos)).crafingTickTime != 0
&& ((TileFusionControlComputer) worldIn.getTileEntity(pos)).checkCoils()) {
entityIn.attackEntityFrom(new FusionDamageSource(), 200F);
}
}
@ -69,6 +71,6 @@ public class BlockFusionControlComputer extends BlockMachineBase {
@Override
public TileEntity createNewTileEntity(final World world, final int meta) {
return new TileEntityFusionController();
return new TileFusionControlComputer();
}
}

View file

@ -25,8 +25,8 @@
package techreborn.blocks;
import com.google.common.base.CaseFormat;
import com.google.common.collect.Lists;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
@ -39,7 +39,9 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.PropertyString;
import reborncore.common.multiblock.BlockMultiblockBase;
import reborncore.common.util.ArrayUtils;
import techreborn.Core;
import techreborn.client.TechRebornCreativeTab;
import techreborn.init.ModBlocks;
@ -47,22 +49,26 @@ import techreborn.lib.ModInfo;
import techreborn.tiles.TileMachineCasing;
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 PropertyInteger METADATA = PropertyInteger.create("type", 0, types.length);
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(METADATA, 0));
if (Core.proxy.isCTMAvailable()) {
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/structure/ctm"));
} else {
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/structure"));
this.setDefaultState(this.getDefaultState().withProperty(TYPE, "standard"));
for (int i = 0; i > types.length; i++) {
if (Core.proxy.isCTMAvailable()) {
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, i, "machines/structure/ctm").setInvVariant(types[i]));
} else {
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, i, "machines/structure").setInvVariant(types[i]));
}
}
}
@ -82,16 +88,19 @@ public class BlockMachineCasing extends BlockMultiblockBase {
@Override
public IBlockState getStateFromMeta(int meta) {
return this.getDefaultState().withProperty(METADATA, meta);
if (meta > types.length) {
meta = 0;
}
return getBlockState().getBaseState().withProperty(TYPE, typesList.get(meta));
}
@Override
public int getMetaFromState(IBlockState state) {
return state.getValue(METADATA);
return typesList.indexOf(state.getValue(TYPE));
}
protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, METADATA);
return new BlockStateContainer(this, TYPE);
}
public int getHeatFromState(IBlockState state) {

View file

@ -25,8 +25,8 @@
package techreborn.blocks;
import com.google.common.base.CaseFormat;
import com.google.common.collect.Lists;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
@ -34,26 +34,45 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.BaseBlock;
import reborncore.common.blocks.PropertyString;
import reborncore.common.util.ArrayUtils;
import techreborn.client.TechRebornCreativeTab;
import techreborn.init.ModBlocks;
import techreborn.lib.ModInfo;
import java.security.InvalidParameterException;
import java.util.List;
public class BlockMachineFrame extends BaseBlock {
public static final String[] types = new String[] { "machine", "advancedMachine", "highlyAdvancedMachine" };
public static final PropertyInteger METADATA = PropertyInteger.create("type", 0, types.length - 1);
public class BlockMachineFrames extends BaseBlock {
public static final String[] types = new String[] { "basic", "advanced", "highly_advanced" };
public static final PropertyString TYPE = new PropertyString("type", types);
private static final List<String> typesList = Lists.newArrayList(ArrayUtils.arrayToLowercase(types));
public BlockMachineFrame(Material material) {
super(material);
setUnlocalizedName("techreborn.machineFrame");
public BlockMachineFrames() {
super(Material.IRON);
setCreativeTab(TechRebornCreativeTab.instance);
setHardness(1f);
this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0));
this.setDefaultState(this.getDefaultState().withProperty(TYPE, "basic"));
for (int i = 0; i > types.length; i++) {
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, i, "machines/structure").setInvVariant(types[i]));
}
}
public static ItemStack getFrameByName(String name, int count) {
name = CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, name);
name = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, name);
if (name.equals("machine")) {
return new ItemStack(ModBlocks.MACHINE_FRAMES, count, 0);
}
if (name.equals("advanced_machine")) {
return new ItemStack(ModBlocks.MACHINE_FRAMES, count, 1);
}
if (name.equals("highly_advanced_machine")) {
return new ItemStack(ModBlocks.MACHINE_FRAMES, count, 1);
}
for (int i = 0; i < types.length; i++) {
if (types[i].equalsIgnoreCase(name)) {
return new ItemStack(ModBlocks.MACHINE_FRAMES, count, i);
@ -80,17 +99,20 @@ public class BlockMachineFrame extends BaseBlock {
}
@Override
public int getMetaFromState(IBlockState state) {
return state.getValue(METADATA);
}
protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, METADATA);
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) {
return this.getDefaultState().withProperty(METADATA, meta);
public int getMetaFromState(IBlockState state) {
return typesList.indexOf(state.getValue(TYPE));
}
protected BlockStateContainer createBlockState() {
return new BlockStateContainer(this, TYPE);
}
}

View file

@ -80,7 +80,7 @@ public class BlockOre extends Block implements IOreNameProvider {
setHarvestLevel("pickaxe", 2);
this.setDefaultState(this.getStateFromMeta(0));
for (int i = 0; i < ores.length; i++) {
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, i, "storage").setInvVariant("type=" + ores[i]).setFileName("ores"));
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, i).setInvVariant("type=" + ores[i]).setFileName("ores"));
}
}

View file

@ -64,7 +64,7 @@ public class BlockOre2 extends Block implements IOreNameProvider {
setHarvestLevel("pickaxe", 1);
this.setDefaultState(this.getStateFromMeta(0));
for (int i = 0; i < ores.length; i++) {
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, i, "storage").setInvVariant("type=" + ores[i]).setFileName("ores"));
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, i).setInvVariant("type=" + ores[i]).setFileName("ores"));
}
}

View file

@ -37,6 +37,7 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.translation.I18n;
@ -52,6 +53,7 @@ import reborncore.common.util.ArrayUtils;
import reborncore.common.util.ChatUtils;
import reborncore.common.util.StringUtils;
import techreborn.client.TechRebornCreativeTab;
import techreborn.init.ModBlocks;
import techreborn.lib.MessageIDs;
import techreborn.lib.ModInfo;
import techreborn.tiles.TilePlayerDectector;
@ -75,6 +77,11 @@ public class BlockPlayerDetector extends BlockMachineBase {
}
}
@Override
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
return new ItemStack(ModBlocks.PLAYER_DETECTOR, typeNamesList.indexOf(state.getValue(TYPE)));
}
@Override
public Item getItemDropped(IBlockState state, Random rand, int fortune) {
return Item.getItemFromBlock(this);

View file

@ -27,16 +27,19 @@ package techreborn.blocks;
import net.minecraft.block.BlockFence;
import net.minecraft.block.BlockPlanks;
import net.minecraft.block.material.Material;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.lib.ModInfo;
public class BlockIronFence extends BlockFence {
public class BlockRefinedIronFence extends BlockFence {
public BlockIronFence() {
public BlockRefinedIronFence() {
super(Material.IRON, BlockPlanks.EnumType.OAK.getMapColor());
setUnlocalizedName("techreborn.ironfence");
setCreativeTab(TechRebornCreativeTabMisc.instance);
setHardness(2.0F);
setHarvestLevel("pickaxe", 2);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this));
}
}

View file

@ -29,16 +29,19 @@ import net.minecraft.block.state.IBlockState;
import net.minecraft.util.BlockRenderLayer;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.BaseBlock;
import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.lib.ModInfo;
public class BlockReinforcedGlass extends BaseBlock {
public BlockReinforcedGlass(Material materialIn) {
super(materialIn);
setUnlocalizedName("techreborn.reinforcedglass");
public BlockReinforcedGlass() {
super(Material.GLASS);
setCreativeTab(TechRebornCreativeTabMisc.instance);
setHardness(4.0F);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this));
}
@Override

View file

@ -37,8 +37,11 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.init.ModBlocks;
import techreborn.lib.ModInfo;
import java.util.List;
import java.util.Random;
@ -50,11 +53,11 @@ public class BlockRubberLeaves extends BlockLeaves {
public BlockRubberLeaves() {
super();
setUnlocalizedName("techreborn.rubberleaves");
setCreativeTab(TechRebornCreativeTabMisc.instance);
this.setDefaultState(this.getDefaultState().withProperty(CHECK_DECAY, true)
.withProperty(DECAYABLE, true));
Blocks.FIRE.setFireInfo(this, 30, 60);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this));
}
@Override

View file

@ -41,12 +41,15 @@ import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.powerSystem.PoweredItem;
import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.init.ModSounds;
import techreborn.items.ItemParts;
import techreborn.items.tools.ItemElectricTreetap;
import techreborn.items.tools.ItemTreeTap;
import techreborn.lib.ModInfo;
import java.util.ArrayList;
import java.util.List;
@ -62,7 +65,6 @@ public class BlockRubberLog extends Block {
public BlockRubberLog() {
super(Material.WOOD);
setUnlocalizedName("techreborn.rubberlog");
setCreativeTab(TechRebornCreativeTabMisc.instance);
this.setHardness(2.0F);
this.setDefaultState(
@ -70,6 +72,7 @@ public class BlockRubberLog extends Block {
this.setTickRandomly(true);
this.setSoundType(SoundType.WOOD);
Blocks.FIRE.setFireInfo(this, 5, 5);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this));
}
protected BlockStateContainer createBlockState() {

View file

@ -28,7 +28,10 @@ import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.lib.ModInfo;
/**
* Created by modmuss50 on 20/02/2016.
@ -37,10 +40,10 @@ public class BlockRubberPlank extends Block {
public BlockRubberPlank() {
super(Material.WOOD);
setUnlocalizedName("techreborn.rubberplank");
setCreativeTab(TechRebornCreativeTabMisc.instance);
this.setHardness(2.0F);
this.setSoundType(SoundType.WOOD);
Blocks.FIRE.setFireInfo(this, 5, 20);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this));
}
}

View file

@ -32,7 +32,10 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.lib.ModInfo;
import techreborn.world.RubberTreeGenerator;
import java.util.Random;
@ -43,10 +46,10 @@ import java.util.Random;
public class BlockRubberSapling extends BlockSapling {
public BlockRubberSapling() {
setUnlocalizedName("techreborn.rubbersapling");
setCreativeTab(TechRebornCreativeTabMisc.instance);
this.setDefaultState(this.getDefaultState().withProperty(STAGE, 0));
setSoundType(SoundType.PLANT);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this));
}
@Override

View file

@ -24,8 +24,8 @@
package techreborn.blocks;
import com.google.common.collect.Lists;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
@ -37,25 +37,29 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.BaseBlock;
import reborncore.common.blocks.PropertyString;
import reborncore.common.util.ArrayUtils;
import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.init.ModBlocks;
import techreborn.lib.ModInfo;
import java.util.List;
import java.util.Random;
public class BlockStorage extends BaseBlock {
public static final String[] types = new String[] { "silver", "aluminum", "titanium", "chrome", "steel", "brass",
"lead", "electrum", "zinc", "platinum", "tungsten", "nickel", "invar", "iridium" };
public PropertyInteger METADATA;
public static final PropertyString TYPE = new PropertyString("type", types);
private static final List<String> typesList = Lists.newArrayList(ArrayUtils.arrayToLowercase(types));
public BlockStorage() {
super(Material.IRON);
setCreativeTab(TechRebornCreativeTabMisc.instance);
setHardness(2f);
this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0));
this.setDefaultState(this.getDefaultState().withProperty(TYPE, "silver"));
for (int i = 0; i < types.length; i++) {
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, i, "storage").setInvVariant("type=" + types[i]).setFileName("storage"));
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, i).setInvVariant("type=" + types[i]).setFileName("storage"));
}
}
@ -95,18 +99,16 @@ public class BlockStorage extends BaseBlock {
if (meta > types.length) {
meta = 0;
}
return this.getDefaultState().withProperty(METADATA, meta);
return getBlockState().getBaseState().withProperty(TYPE, typesList.get(meta));
}
@Override
public int getMetaFromState(IBlockState state) {
return state.getValue(METADATA);
return typesList.indexOf(state.getValue(TYPE));
}
protected BlockStateContainer createBlockState() {
METADATA = PropertyInteger.create("type", 0, types.length - 1);
return new BlockStateContainer(this, METADATA);
return new BlockStateContainer(this, TYPE);
}
}

View file

@ -24,8 +24,9 @@
package techreborn.blocks;
import com.google.common.base.CaseFormat;
import com.google.common.collect.Lists;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.PropertyInteger;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
@ -37,31 +38,36 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.BaseBlock;
import reborncore.common.blocks.PropertyString;
import reborncore.common.util.ArrayUtils;
import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.init.ModBlocks;
import techreborn.lib.ModInfo;
import java.security.InvalidParameterException;
import java.util.List;
import java.util.Random;
public class BlockStorage2 extends BaseBlock {
public static final String[] types = new String[] { "tungstensteel",
"iridium_reinforced_tungstensteel", "iridium_reinforced_stone", "ruby", "sapphire", "peridot",
"yellowGarnet", "redGarnet", "copper", "tin", "refinedIron" };
public PropertyInteger METADATA;
"yellow_garnet", "red_garnet", "copper", "tin", "refined_iron" };
public static final PropertyString TYPE = new PropertyString("type", types);
private static final List<String> typesList = Lists.newArrayList(ArrayUtils.arrayToLowercase(types));
public BlockStorage2() {
super(Material.IRON);
setCreativeTab(TechRebornCreativeTabMisc.instance);
setHardness(2f);
this.setDefaultState(this.getDefaultState().withProperty(METADATA, 0));
this.setDefaultState(this.getDefaultState().withProperty(TYPE, "tungstensteel"));
for (int i = 0; i < types.length; i++) {
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, i, "storage").setInvVariant("type=" + types[i]).setFileName("storage"));
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, i).setInvVariant("type=" + types[i]).setFileName("storage"));
}
}
public static ItemStack getStorageBlockByName(String name, int count) {
name = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, name);
for (int i = 0; i < types.length; i++) {
if (types[i].equals(name)) {
return new ItemStack(ModBlocks.STORAGE2, count, i);
@ -93,18 +99,16 @@ public class BlockStorage2 extends BaseBlock {
if (meta > types.length) {
meta = 0;
}
return this.getDefaultState().withProperty(METADATA, meta);
return getBlockState().getBaseState().withProperty(TYPE, typesList.get(meta));
}
@Override
public int getMetaFromState(IBlockState state) {
return state.getValue(METADATA);
return typesList.indexOf(state.getValue(TYPE));
}
protected BlockStateContainer createBlockState() {
METADATA = PropertyInteger.create("type", 0, types.length - 1);
return new BlockStateContainer(this, METADATA);
return new BlockStateContainer(this, TYPE);
}
}

View file

@ -25,14 +25,17 @@
package techreborn.blocks.advanced_machine;
import net.minecraft.block.material.Material;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
public class BlockDistillationTower extends BlockMachineBase {
public BlockDistillationTower(Material material) {
public BlockDistillationTower() {
super();
setUnlocalizedName("techreborn.distillationtower");
setCreativeTab(TechRebornCreativeTab.instance);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier2_machines"));
}
}

View file

@ -24,22 +24,24 @@
package techreborn.blocks.advanced_machine;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import techreborn.tiles.TileIndustrialElectrolyzer;
public class BlockIndustrialElectrolyzer extends BlockMachineBase {
public BlockIndustrialElectrolyzer(final Material material) {
public BlockIndustrialElectrolyzer() {
super();
this.setUnlocalizedName("techreborn.industrialelectrolyzer");
this.setCreativeTab(TechRebornCreativeTab.instance);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier1_machines"));
}
@Override

View file

@ -24,23 +24,25 @@
package techreborn.blocks.advanced_machine;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import techreborn.tiles.multiblock.TileIndustrialSawmill;
public class BlockIndustrialSawmill extends BlockMachineBase {
public BlockIndustrialSawmill(final Material material) {
public BlockIndustrialSawmill() {
super();
this.setUnlocalizedName("techreborn.industrialsawmill");
this.setCreativeTab(TechRebornCreativeTab.instance);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier2_machines"));
}
@Override

View file

@ -27,25 +27,28 @@ package techreborn.blocks.generator;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.BaseTileBlock;
import techreborn.client.TechRebornCreativeTab;
import techreborn.tiles.generator.TileCreativePanel;
import techreborn.lib.ModInfo;
import techreborn.tiles.generator.TileCreativeSolarPanel;
/**
* Created by modmuss50 on 25/02/2016.
*/
public class BlockCreativePanel extends BaseTileBlock {
public class BlockCreativeSolarPanel extends BaseTileBlock {
public BlockCreativePanel() {
public BlockCreativeSolarPanel() {
super(Material.IRON);
setUnlocalizedName("techreborn.creativepanel");
setCreativeTab(TechRebornCreativeTab.instance);
setHardness(2.0F);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/generators"));
}
@Override
public TileEntity createNewTileEntity(World worldIn, int meta) {
return new TileCreativePanel();
return new TileCreativeSolarPanel();
}
}

View file

@ -24,23 +24,25 @@
package techreborn.blocks.generator;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import techreborn.tiles.generator.TileDieselGenerator;
public class BlockDieselGenerator extends BlockMachineBase {
public BlockDieselGenerator(final Material material) {
public BlockDieselGenerator() {
super();
this.setUnlocalizedName("techreborn.dieselgenerator");
this.setCreativeTab(TechRebornCreativeTab.instance);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/generators"));
}
@Override

View file

@ -24,29 +24,31 @@
package techreborn.blocks.generator;
import net.minecraft.block.material.Material;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.client.TechRebornCreativeTab;
import techreborn.tiles.generator.TileDragonEggSiphoner;
import techreborn.lib.ModInfo;
import techreborn.tiles.generator.TileDragonEggSyphon;
import java.util.List;
public class BlockDragonEggSiphoner extends BlockMachineBase {
public class BlockDragonEggSyphon extends BlockMachineBase {
public BlockDragonEggSiphoner(Material material) {
public BlockDragonEggSyphon() {
super();
setUnlocalizedName("techreborn.dragoneggsiphoner");
setCreativeTab(TechRebornCreativeTab.instance);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/generators"));
}
@Override
public TileEntity createNewTileEntity(World world, int p_149915_2_) {
return new TileDragonEggSiphoner();
return new TileDragonEggSyphon();
}
@Override

View file

@ -29,18 +29,21 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import techreborn.tiles.generator.TileGasTurbine;
public class BlockGasTurbine extends BlockMachineBase {
public BlockGasTurbine(final Material material) {
public BlockGasTurbine() {
super();
this.setUnlocalizedName("techreborn.gasTurbine");
this.setCreativeTab(TechRebornCreativeTab.instance);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/generators"));
}
@Override

View file

@ -24,24 +24,21 @@
package techreborn.blocks.generator;
import net.minecraft.block.material.Material;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import techreborn.tiles.generator.TileHeatGenerator;
import java.util.List;
public class BlockHeatGenerator extends BlockMachineBase {
public BlockHeatGenerator(Material material) {
public BlockHeatGenerator() {
super();
setUnlocalizedName("techreborn.heatgenerator");
setCreativeTab(TechRebornCreativeTab.instance);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/generators"));
}
@Override

View file

@ -24,19 +24,21 @@
package techreborn.blocks.generator;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import techreborn.tiles.generator.TileLightningRod;
public class BlockLightningRod extends BlockMachineBase {
public BlockLightningRod(Material material) {
public BlockLightningRod() {
super();
setUnlocalizedName("techreborn.lightningrod");
setCreativeTab(TechRebornCreativeTab.instance);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/generators"));
}
@Override

View file

@ -24,16 +24,18 @@
package techreborn.blocks.generator;
import net.minecraft.block.material.Material;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
public class BlockMagicEnergyAbsorber extends BlockMachineBase {
public BlockMagicEnergyAbsorber(Material material) {
public BlockMagicEnergyAbsorber() {
super();
setUnlocalizedName("techreborn.magicenergyabsorber");
setCreativeTab(TechRebornCreativeTab.instance);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/generators"));
}
}

View file

@ -24,15 +24,17 @@
package techreborn.blocks.generator;
import net.minecraft.block.material.Material;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
public class BlockMagicEnergyConverter extends BlockMachineBase {
public BlockMagicEnergyConverter(Material material) {
public BlockMagicEnergyConverter() {
super();
setUnlocalizedName("techreborn.magicenergyconverter");
setCreativeTab(TechRebornCreativeTab.instance);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/generators"));
}
}

View file

@ -24,28 +24,30 @@
package techreborn.blocks.generator;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;
import techreborn.tiles.generator.TileSemifluidGenerator;
import techreborn.lib.ModInfo;
import techreborn.tiles.generator.TileSemiFluidGenerator;
public class BlockSemiFluidGenerator extends BlockMachineBase {
public BlockSemiFluidGenerator(final Material material) {
public BlockSemiFluidGenerator() {
super();
this.setUnlocalizedName("techreborn.semifluidgenerator");
this.setCreativeTab(TechRebornCreativeTab.instance);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/generators"));
}
@Override
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
return new TileSemifluidGenerator();
return new TileSemiFluidGenerator();
}
@Override

View file

@ -34,8 +34,11 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.BaseTileBlock;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import techreborn.tiles.generator.TileSolarPanel;
/**
@ -44,14 +47,13 @@ import techreborn.tiles.generator.TileSolarPanel;
public class BlockSolarPanel extends BaseTileBlock {
public static PropertyBool ACTIVE = PropertyBool.create("active");
private final String prefix = "techreborn:blocks/machine/generators/";
public BlockSolarPanel() {
super(Material.IRON);
setUnlocalizedName("techreborn.solarpanel");
setCreativeTab(TechRebornCreativeTab.instance);
this.setDefaultState(this.getDefaultState().withProperty(ACTIVE, false));
setHardness(2.0F);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/generators"));
}
protected BlockStateContainer createBlockState() {

View file

@ -27,23 +27,26 @@ package techreborn.blocks.generator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;
import techreborn.tiles.generator.TileGenerator;
import techreborn.lib.ModInfo;
import techreborn.tiles.generator.TileSolidFuelGenerator;
public class BlockGenerator extends BlockMachineBase {
public class BlockSolidFuelGenerator extends BlockMachineBase {
public BlockGenerator() {
public BlockSolidFuelGenerator() {
super();
this.setUnlocalizedName("techreborn.generator");
this.setCreativeTab(TechRebornCreativeTab.instance);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/generators"));
}
@Override
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
return new TileGenerator();
return new TileSolidFuelGenerator();
}
@Override

View file

@ -27,9 +27,11 @@ package techreborn.blocks.generator;
import net.minecraft.block.material.Material;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import reborncore.RebornCore;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.BaseTileBlock;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import techreborn.tiles.generator.TileWaterMill;
/**
@ -37,13 +39,11 @@ import techreborn.tiles.generator.TileWaterMill;
*/
public class BlockWaterMill extends BaseTileBlock {
private final String prefix = "techreborn:blocks/machine/generators/";
public BlockWaterMill() {
super(Material.IRON);
setUnlocalizedName("techreborn.watermill");
setCreativeTab(TechRebornCreativeTab.instance);
setHardness(2.0F);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/generators"));
}
@Override

View file

@ -26,8 +26,11 @@ package techreborn.blocks.generator;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import techreborn.tiles.generator.TileWindMill;
/**
@ -37,9 +40,9 @@ public class BlockWindMill extends BlockMachineBase {
public BlockWindMill() {
super(false);
setUnlocalizedName("techreborn.windmill");
setCreativeTab(TechRebornCreativeTab.instance);
setHardness(2.0F);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/generators"));
}
@Override

View file

@ -24,7 +24,6 @@
package techreborn.blocks.iron_machines;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
@ -32,26 +31,29 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;
import techreborn.tiles.TileAlloyFurnace;
import techreborn.lib.ModInfo;
import techreborn.tiles.TileIronAlloyFurnace;
import java.util.ArrayList;
import java.util.List;
public class BlockAlloyFurnace extends BlockMachineBase {
public class BlockIronAlloyFurnace extends BlockMachineBase {
public BlockAlloyFurnace(final Material material) {
public BlockIronAlloyFurnace() {
super();
this.setUnlocalizedName("techreborn.alloyfurnace");
this.setCreativeTab(TechRebornCreativeTab.instance);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier0_machines"));
}
@Override
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
return new TileAlloyFurnace();
return new TileIronAlloyFurnace();
}
@Override

View file

@ -35,10 +35,13 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import techreborn.tiles.TileIronFurnace;
import java.util.ArrayList;
@ -49,8 +52,8 @@ public class BlockIronFurnace extends BlockMachineBase {
public BlockIronFurnace() {
super();
this.setUnlocalizedName("techreborn.ironfurnace");
this.setCreativeTab(TechRebornCreativeTab.instance);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier0_machines"));
}
@Override

View file

@ -24,22 +24,24 @@
package techreborn.blocks.machine;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import techreborn.tiles.TileAssemblingMachine;
public class BlockAssemblingMachine extends BlockMachineBase {
public BlockAssemblingMachine(final Material material) {
public BlockAssemblingMachine() {
super();
this.setUnlocalizedName("techreborn.assemblingmachine");
this.setCreativeTab(TechRebornCreativeTab.instance);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier1_machines"));
}
@Override

View file

@ -24,22 +24,24 @@
package techreborn.blocks.machine;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import techreborn.tiles.TileChemicalReactor;
public class BlockChemicalReactor extends BlockMachineBase {
public BlockChemicalReactor(final Material material) {
public BlockChemicalReactor() {
super();
this.setUnlocalizedName("techreborn.chemicalreactor");
this.setCreativeTab(TechRebornCreativeTab.instance);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier1_machines"));
}
@Override

View file

@ -24,27 +24,29 @@
package techreborn.blocks.machine;
import net.minecraft.block.material.Material;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import techreborn.tiles.TileScrapboxinator;
import java.util.List;
public class BlockScrapboxinator extends BlockMachineBase {
public BlockScrapboxinator(final Material material) {
public BlockScrapboxinator() {
super();
this.setUnlocalizedName("techreborn.scrapboxinator");
this.setCreativeTab(TechRebornCreativeTab.instance);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier1_machines"));
}
@Override

View file

@ -24,7 +24,6 @@
package techreborn.blocks.machine;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
@ -32,18 +31,21 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import techreborn.tiles.multiblock.TileVacuumFreezer;
public class BlockVacuumFreezer extends BlockMachineBase {
public BlockVacuumFreezer(final Material material) {
public BlockVacuumFreezer() {
super();
this.setUnlocalizedName("techreborn.vacuumfreezer");
this.setCreativeTab(TechRebornCreativeTab.instance);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier2_machines"));
}
@Override

View file

@ -32,19 +32,19 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import techreborn.client.EGui;
import techreborn.init.ModBlocks;
import techreborn.tiles.TileAesu;
import techreborn.tiles.TileAdjustableSU;
import java.util.ArrayList;
import java.util.List;
public class BlockAESU extends BlockEnergyStorage {
public BlockAESU() {
public class BlockAdjustableSU extends BlockEnergyStorage {
public BlockAdjustableSU() {
super("AESU", EGui.AESU.ordinal());
}
@Override
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
return new TileAesu();
return new TileAdjustableSU();
}
@Override

View file

@ -37,9 +37,12 @@ import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.BaseTileBlock;
import techreborn.Core;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import java.util.Iterator;
import java.util.Random;
@ -49,18 +52,17 @@ import java.util.Random;
*/
public abstract class BlockEnergyStorage extends BaseTileBlock {
public static PropertyDirection FACING = PropertyDirection.create("facing", Facings.ALL);
protected final String prefix = "techreborn:blocks/machines/energy/";
public String name;
public int guiID;
public BlockEnergyStorage(String name, int guiID) {
super(Material.ROCK);
super(Material.IRON);
setHardness(2f);
setUnlocalizedName("techreborn." + name.toLowerCase());
setCreativeTab(TechRebornCreativeTab.instance);
this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
this.name = name;
this.guiID = guiID;
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/energy"));
}
@Override
@ -147,10 +149,10 @@ public abstract class BlockEnergyStorage extends BaseTileBlock {
if (fullName.equalsIgnoreCase("Batbox")) {
return "lv_storage";
}
if (fullName.equalsIgnoreCase("MFE")) {
if (fullName.equalsIgnoreCase("MEDIUM_VOLTAGE_SU")) {
return "mv_storage";
}
if (fullName.equalsIgnoreCase("MFSU")) {
if (fullName.equalsIgnoreCase("HIGH_VOLTAGE_SU")) {
return "hv_storage";
}
if (fullName.equalsIgnoreCase("AESU")) {

View file

@ -32,7 +32,7 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import techreborn.client.EGui;
import techreborn.init.ModBlocks;
import techreborn.tiles.storage.TileMFSU;
import techreborn.tiles.storage.TileHighVoltageSU;
import java.util.ArrayList;
import java.util.List;
@ -40,15 +40,15 @@ import java.util.List;
/**
* Created by modmuss50 on 14/03/2016.
*/
public class BlockMFSU extends BlockEnergyStorage {
public BlockMFSU() {
super("MFSU", EGui.MFSU.ordinal());
public class BlockHighVoltageSU extends BlockEnergyStorage {
public BlockHighVoltageSU() {
super("high_voltage_su", EGui.HIGH_VOLTAGE_SU.ordinal());
this.setHardness(2f);
}
@Override
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
return new TileMFSU();
return new TileHighVoltageSU();
}
@Override

View file

@ -33,27 +33,27 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import techreborn.client.EGui;
import techreborn.tiles.idsu.TileIDSU;
import techreborn.tiles.idsu.TileInterdimensionalSU;
import java.util.ArrayList;
import java.util.List;
public class BlockIDSU extends BlockEnergyStorage {
public BlockIDSU() {
public class BlockInterdimensionalSU extends BlockEnergyStorage {
public BlockInterdimensionalSU() {
super("IDSU", EGui.IDSU.ordinal());
}
@Override
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
return new TileIDSU();
return new TileInterdimensionalSU();
}
@Override
public IBlockState getStateForPlacement(final World world, final BlockPos pos, final EnumFacing facing, final float hitX, final float hitY,
final float hitZ, final int meta, final EntityLivingBase placer) {
final TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileIDSU) {
((TileIDSU) tile).ownerUdid = placer.getUniqueID().toString();
if (tile instanceof TileInterdimensionalSU) {
((TileInterdimensionalSU) tile).ownerUdid = placer.getUniqueID().toString();
}
return this.getDefaultState();
}
@ -69,8 +69,8 @@ public class BlockIDSU extends BlockEnergyStorage {
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) {
super.onBlockPlacedBy(world, pos, state, placer, stack);
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileIDSU) {
((TileIDSU) tile).ownerUdid = placer.getUniqueID().toString();
if (tile instanceof TileInterdimensionalSU) {
((TileInterdimensionalSU) tile).ownerUdid = placer.getUniqueID().toString();
}
}
}

View file

@ -33,34 +33,42 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.BaseTileBlock;
import techreborn.Core;
import techreborn.client.TechRebornCreativeTab;
import techreborn.tiles.lesu.TileLesuStorage;
import techreborn.lib.ModInfo;
import techreborn.tiles.lesu.TileLSUStorage;
import java.util.ArrayList;
import java.util.List;
public class BlockLESUStorage extends BaseTileBlock {
public class BlockLSUStorage extends BaseTileBlock {
;
public BlockLESUStorage(Material material) {
super(material);
setUnlocalizedName("techreborn.lesustorage");
public BlockLSUStorage() {
super(Material.IRON);
setCreativeTab(TechRebornCreativeTab.instance);
if (Core.proxy.isCTMAvailable()) {
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/energy/ctm"));
} else {
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/energy"));
}
}
@Override
public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase player, ItemStack itemstack) {
super.onBlockPlacedBy(world, pos, state, player, itemstack);
if (world.getTileEntity(pos) instanceof TileLesuStorage) {
((TileLesuStorage) world.getTileEntity(pos)).rebuildNetwork();
if (world.getTileEntity(pos) instanceof TileLSUStorage) {
((TileLSUStorage) world.getTileEntity(pos)).rebuildNetwork();
}
}
@Override
public void breakBlock(World world, BlockPos pos, IBlockState state) {
if (world.getTileEntity(pos) instanceof TileLesuStorage) {
((TileLesuStorage) world.getTileEntity(pos)).removeFromNetwork();
if (world.getTileEntity(pos) instanceof TileLSUStorage) {
((TileLSUStorage) world.getTileEntity(pos)).removeFromNetwork();
}
super.breakBlock(world, pos, state);
}
@ -74,7 +82,7 @@ public class BlockLESUStorage extends BaseTileBlock {
@Override
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
return new TileLesuStorage();
return new TileLSUStorage();
}
public boolean shouldConnectToBlock(IBlockAccess blockAccess, int x, int y, int z, Block block, int meta) {

View file

@ -31,19 +31,19 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import techreborn.client.EGui;
import techreborn.tiles.lesu.TileLesu;
import techreborn.tiles.lesu.TileLapotronicSU;
import java.util.ArrayList;
import java.util.List;
public class BlockLESU extends BlockEnergyStorage {
public BlockLESU() {
public class BlockLapotronicSU extends BlockEnergyStorage {
public BlockLapotronicSU() {
super("LESU", EGui.LESU.ordinal());
}
@Override
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
return new TileLesu();
return new TileLapotronicSU();
}
@Override

View file

@ -31,7 +31,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import techreborn.client.EGui;
import techreborn.tiles.storage.TileBatBox;
import techreborn.tiles.storage.TileLowVoltageSU;
import java.util.ArrayList;
import java.util.List;
@ -39,14 +39,14 @@ import java.util.List;
/**
* Created by modmuss50 on 14/03/2016.
*/
public class BlockBatBox extends BlockEnergyStorage {
public BlockBatBox() {
super("Batbox", EGui.BATBOX.ordinal());
public class BlockLowVoltageSU extends BlockEnergyStorage {
public BlockLowVoltageSU() {
super("low_voltage_su", EGui.LOW_VOLTAGE_SU.ordinal());
}
@Override
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
return new TileBatBox();
return new TileLowVoltageSU();
}
@Override

View file

@ -32,7 +32,7 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import techreborn.client.EGui;
import techreborn.init.ModBlocks;
import techreborn.tiles.storage.TileMFE;
import techreborn.tiles.storage.TileMediumVoltageSU;
import java.util.ArrayList;
import java.util.List;
@ -40,14 +40,14 @@ import java.util.List;
/**
* Created by modmuss50 on 14/03/2016.
*/
public class BlockMFE extends BlockEnergyStorage {
public BlockMFE() {
super("MFE", EGui.MFE.ordinal());
public class BlockMediumVoltageSU extends BlockEnergyStorage {
public BlockMediumVoltageSU() {
super("medium_voltage_su", EGui.MEDIUM_VOLTAGE_SU.ordinal());
}
@Override
public TileEntity createNewTileEntity(final World world, final int p_149915_2_) {
return new TileMFE();
return new TileMediumVoltageSU();
}
@Override

View file

@ -24,24 +24,24 @@
package techreborn.blocks.tier1;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import techreborn.tiles.teir1.TileCompressor;
public class BlockCompressor extends BlockMachineBase {
private final String prefix = "techreborn:blocks/machine/tier1_machines/";
public BlockCompressor(final Material material) {
public BlockCompressor() {
super();
this.setUnlocalizedName("techreborn.compressor");
this.setCreativeTab(TechRebornCreativeTab.instance);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier1_machines"));
}
@Override

View file

@ -24,22 +24,24 @@
package techreborn.blocks.tier1;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import techreborn.tiles.teir1.TileElectricFurnace;
public class BlockElectricFurnace extends BlockMachineBase {
public BlockElectricFurnace(final Material material) {
public BlockElectricFurnace() {
super();
this.setUnlocalizedName("techreborn.electricfurnace");
this.setCreativeTab(TechRebornCreativeTab.instance);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier1_machines"));
}
@Override

View file

@ -24,22 +24,24 @@
package techreborn.blocks.tier1;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import techreborn.tiles.teir1.TileExtractor;
public class BlockExtractor extends BlockMachineBase {
public BlockExtractor(final Material material) {
public BlockExtractor() {
super();
this.setUnlocalizedName("techreborn.extractor");
this.setCreativeTab(TechRebornCreativeTab.instance);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier1_machines"));
}
@Override

View file

@ -24,22 +24,24 @@
package techreborn.blocks.tier1;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import techreborn.tiles.teir1.TileGrinder;
public class BlockGrinder extends BlockMachineBase {
public BlockGrinder(final Material material) {
public BlockGrinder() {
super();
this.setUnlocalizedName("techreborn.grinder");
this.setCreativeTab(TechRebornCreativeTab.instance);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier1_machines"));
}
@Override

View file

@ -24,22 +24,24 @@
package techreborn.blocks.tier1;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.blocks.BlockMachineBase;
import techreborn.Core;
import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import techreborn.tiles.teir1.TileRecycler;
public class BlockRecycler extends BlockMachineBase {
public BlockRecycler(final Material material) {
public BlockRecycler() {
super();
this.setUnlocalizedName("techreborn.recycler");
this.setCreativeTab(TechRebornCreativeTab.instance);
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier1_machines"));
}
@Override

View file

@ -42,7 +42,7 @@ import java.util.List;
public class BlockHVTransformer extends BlockTransformer {
public BlockHVTransformer() {
super("hvtransformer");
super("hv_transformer");
}
@Override

View file

@ -41,7 +41,7 @@ import java.util.List;
public class BlockLVTransformer extends BlockTransformer {
public BlockLVTransformer() {
super("lvtransformer");
super("lv_transformer");
}
@Override

View file

@ -42,7 +42,7 @@ import java.util.List;
public class BlockMVTransformer extends BlockTransformer {
public BlockMVTransformer() {
super("mvtransformer");
super("mv_transformer");
}
@Override

View file

@ -43,8 +43,11 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fluids.BlockFluidBase;
import prospector.shootingstar.ShootingStar;
import prospector.shootingstar.model.ModelCompound;
import reborncore.common.BaseTileBlock;
import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo;
import java.util.ArrayList;
import java.util.Iterator;
@ -60,12 +63,12 @@ public abstract class BlockTransformer extends BaseTileBlock {
public String name;
public BlockTransformer(String name) {
super(Material.ROCK);
super(Material.IRON);
setHardness(2f);
setUnlocalizedName("techreborn." + name.toLowerCase());
setCreativeTab(TechRebornCreativeTab.instance);
this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
this.name = name;
ShootingStar.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/energy"));
}
protected BlockStateContainer createBlockState() {