Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package neg2013.acsension.infrastructure;
- import neg2013.acsension.Acsension;
- import neg2013.acsension.interfaces.IAc;
- import net.minecraft.block.Block;
- import net.minecraft.block.material.Material;
- import net.minecraft.client.Minecraft;
- import net.minecraft.world.IBlockAccess;
- import net.minecraft.world.World;
- public class BlockEnergyDuctBase extends BlockAC implements IAc{
- protected BlockEnergyDuctBase(Material material) {
- super(material);
- }
- //warning
- //power shit start
- //done
- @Override
- public int MaxEnergyStored() {
- return 2;
- }
- //done
- @Override
- public int EnergyGenerating() {
- return 0;
- }
- //done
- @Override
- public boolean canAcceptEnergy() {
- return true;
- }
- //done
- @Override
- public boolean canConnectToAc() {
- return true;
- }
- //done
- @Override
- public boolean CanGenerateEnergy(int x, int y, int z) {
- return false;
- }
- //done
- @Override
- public boolean CanConsumeEnergy() {
- return false;
- }
- //done
- @Override
- public int EnergyIn(IBlockAccess access, int x, int y, int z, World world) {
- int energyIn = EnergyIn(access, x, y, z, world);
- energyIn = NeighborPush(access, x, y, z, world);
- return energyIn;
- }
- @Override
- public int EnergyStored(IBlockAccess access, int x, int y, int z, World world) {
- int tick = tickRate(Minecraft.getMinecraft().theWorld);
- int energyStored = tick * EnergyGenerating();
- return energyStored;
- }
- @Override
- public int EnergyOut(IBlockAccess access, int x, int y, int z, World world) {
- int energyIn = EnergyIn(access, x, y, z, world);
- //if(){}
- return EnergyIn(access, x, y, z, world);
- }
- @Override
- public int EnergyDraw(IBlockAccess access, int x, int y, int z, World world) {
- return NeighborDraw(access, x, y, z, world);
- }
- @Override
- public int EnergyPush(IBlockAccess access, int x, int y, int z, World world) {
- return EnergyIn(access, x, y, z, world);
- }
- @Override
- public int NeighborDraw(IBlockAccess access, int x, int y, int z, World world) {
- BlockAC block = (BlockAC) access.getBlock(x, y, z);
- if(!( block != Acsension.blockDuct && block != Acsension.blockSolarGenny && block != Acsension.blockEnergyCell)){
- int neighborDraw = block.EnergyDraw(access, x, y, z, world);
- return neighborDraw;
- }
- return 0;
- }
- @Override
- public int NeighborPush(IBlockAccess access, int x, int y, int z, World world) {
- BlockAC block = (BlockAC) access.getBlock(x, y, z);
- if(!( block != Acsension.blockDuct && block != Acsension.blockSolarGenny && block != Acsension.blockEnergyCell)){
- int neighborPush = block.EnergyPush(access, x, y, z, world);
- return neighborPush;
- }
- return 0;
- }
- @Override
- public boolean IsPowered(IBlockAccess access, int x, int y, int z, World world) {
- if(NeighborPush(access, x, y, z, world) >= 1){
- return true;
- }
- return false;
- }
- }
Add Comment
Please, Sign In to add comment