Rewrite Transformers, closes #441
This commit is contained in:
parent
fbfd42427e
commit
4c2877d0d5
15 changed files with 454 additions and 156 deletions
|
@ -1,28 +1,17 @@
|
|||
package techreborn.tiles.transformers;
|
||||
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 16/03/2016.
|
||||
*/
|
||||
public class TileHVTransformer extends TileLVTransformer
|
||||
public class TileHVTransformer extends TileTransformer
|
||||
{
|
||||
|
||||
@Override
|
||||
public double getMaxOutput()
|
||||
public TileHVTransformer()
|
||||
{
|
||||
return 512;
|
||||
super("HVTransformer", ModBlocks.hvt, EnumPowerTier.EXTREME, 2048, 412, 2048*2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxInput()
|
||||
{
|
||||
return 2048;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPowerTier getTier()
|
||||
{
|
||||
return EnumPowerTier.EXTREME;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,45 +1,17 @@
|
|||
package techreborn.tiles.transformers;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import techreborn.tiles.storage.TileBatBox;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 16/03/2016.
|
||||
*/
|
||||
public class TileLVTransformer extends TileBatBox
|
||||
public class TileLVTransformer extends TileTransformer
|
||||
{
|
||||
|
||||
@Override
|
||||
public double getMaxOutput()
|
||||
public TileLVTransformer()
|
||||
{
|
||||
return 32;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxInput()
|
||||
{
|
||||
return 128;
|
||||
}
|
||||
|
||||
@Override
|
||||
// Can take medium power in
|
||||
public EnumPowerTier getTier()
|
||||
{
|
||||
return EnumPowerTier.MEDIUM;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxPower()
|
||||
{
|
||||
return getMaxInput() * 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getWrenchDrop(EntityPlayer entityPlayer)
|
||||
{
|
||||
return new ItemStack(worldObj.getBlockState(pos).getBlock());
|
||||
super("LVTransformer", ModBlocks.lvt, EnumPowerTier.LOW, 128, 32, 128*2);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,13 +1,19 @@
|
|||
package techreborn.tiles.transformers;
|
||||
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import techreborn.init.ModBlocks;
|
||||
|
||||
/**
|
||||
* Created by modmuss50 on 16/03/2016.
|
||||
*/
|
||||
public class TileMVTransformer extends TileLVTransformer
|
||||
public class TileMVTransformer extends TileTransformer
|
||||
{
|
||||
|
||||
public TileMVTransformer()
|
||||
{
|
||||
super("MVTransformer", ModBlocks.mvt, EnumPowerTier.HIGH, 512, 128, 512*2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getMaxOutput()
|
||||
{
|
||||
|
|
107
src/main/java/techreborn/tiles/transformers/TileTransformer.java
Normal file
107
src/main/java/techreborn/tiles/transformers/TileTransformer.java
Normal file
|
@ -0,0 +1,107 @@
|
|||
package techreborn.tiles.transformers;
|
||||
|
||||
import ic2.api.tile.IWrenchable;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.ITickable;
|
||||
import reborncore.api.power.EnumPowerTier;
|
||||
import reborncore.common.powerSystem.TilePowerAcceptor;
|
||||
import techreborn.blocks.transformers.BlockTransformer;
|
||||
|
||||
/**
|
||||
* Created by Rushmead
|
||||
*/
|
||||
public class TileTransformer extends TilePowerAcceptor implements IWrenchable, ITickable
|
||||
{
|
||||
|
||||
public String name;
|
||||
public Block wrenchDrop;
|
||||
public EnumPowerTier tier;
|
||||
public int maxInput;
|
||||
public int maxOutput;
|
||||
public int maxStorage;
|
||||
|
||||
public TileTransformer(String name, Block wrenchDrop, EnumPowerTier tier, int maxInput, int maxOuput, int maxStorage)
|
||||
{
|
||||
super(1);
|
||||
this.wrenchDrop = wrenchDrop;
|
||||
this.tier = tier;
|
||||
this.name = name;
|
||||
this.maxInput = maxInput;
|
||||
this.maxOutput = maxOuput;
|
||||
this.maxStorage = maxStorage;
|
||||
}
|
||||
|
||||
@Override public boolean wrenchCanSetFacing(EntityPlayer p0, EnumFacing p1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override public EnumFacing getFacing()
|
||||
{
|
||||
return getFacingEnum();
|
||||
}
|
||||
|
||||
@Override public boolean wrenchCanRemove(EntityPlayer entityPlayer)
|
||||
{
|
||||
if (entityPlayer.isSneaking())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override public float getWrenchDropRate()
|
||||
{
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
@Override public ItemStack getWrenchDrop(EntityPlayer p0)
|
||||
{
|
||||
return new ItemStack(wrenchDrop);
|
||||
}
|
||||
|
||||
@Override public double getMaxPower()
|
||||
{
|
||||
return maxStorage;
|
||||
}
|
||||
|
||||
@Override public boolean canAcceptEnergy(EnumFacing direction)
|
||||
{
|
||||
|
||||
return getFacingEnum() != direction;
|
||||
}
|
||||
|
||||
@Override public EnumFacing getFacingEnum()
|
||||
{
|
||||
Block block = worldObj.getBlockState(pos).getBlock();
|
||||
if (block instanceof BlockTransformer)
|
||||
{
|
||||
return ((BlockTransformer) block).getFacing(worldObj.getBlockState(pos));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override public boolean canProvideEnergy(EnumFacing direction)
|
||||
{
|
||||
return getFacing() == direction;
|
||||
}
|
||||
|
||||
|
||||
@Override public double getMaxOutput()
|
||||
{
|
||||
return maxOutput;
|
||||
}
|
||||
|
||||
@Override public double getMaxInput()
|
||||
{
|
||||
return maxInput;
|
||||
}
|
||||
|
||||
@Override public EnumPowerTier getTier()
|
||||
{
|
||||
return tier;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue