Continue the great refactor of mid 2017 (A lot of stuff still broken, it's a WIP)
This commit is contained in:
parent
1fa9f1cf52
commit
40e3062903
123 changed files with 1469 additions and 1486 deletions
|
@ -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
|
|
@ -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")) {
|
||||
|
|
|
@ -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
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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) {
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue