Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package neg2013.acsension.infrastructure;
- import java.util.ArrayList;
- import java.util.HashSet;
- import java.util.Random;
- import java.util.Set;
- import cpw.mods.fml.relauncher.Side;
- import cpw.mods.fml.relauncher.SideOnly;
- import neg2013.acsension.Acsension;
- import neg2013.acsension.interfaces.IAc;
- import neg2013.acsension.tile_entity.TileEntityCopperChest;
- import net.minecraft.block.Block;
- import net.minecraft.block.BlockContainer;
- import net.minecraft.block.BlockSlab;
- import net.minecraft.block.material.Material;
- import net.minecraft.client.model.ModelRenderer;
- import net.minecraft.client.renderer.texture.IIconRegister;
- import net.minecraft.entity.EntityLivingBase;
- import net.minecraft.init.Blocks;
- import net.minecraft.init.Items;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- import net.minecraft.nbt.NBTTagCompound;
- import net.minecraft.nbt.NBTTagList;
- import net.minecraft.tileentity.TileEntity;
- import net.minecraft.tileentity.TileEntityChest;
- import net.minecraft.util.AxisAlignedBB;
- import net.minecraft.util.Direction;
- import net.minecraft.util.IIcon;
- import net.minecraft.util.MathHelper;
- import net.minecraft.world.ChunkPosition;
- import net.minecraft.world.IBlockAccess;
- import net.minecraft.world.World;
- public class BlockDuct extends BlockEnergyDuctBase implements IAc{
- //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;
- }
- //work needed
- @Override
- public int EnergyIn(IBlockAccess access, int x, int y, int z, World world) {
- int energyIn = EnergyIn(access, x, y, z, world);
- Block block = access.getBlock(x, y, z);
- if(block == this && block != Acsension.blockSolarGenny && block != Acsension.blockEnergyCell){
- if (energyIn >= MaxEnergyIn()){
- return MaxEnergyIn();
- }
- if (energyIn <= MaxEnergyIn()){
- return energyIn;
- }
- }
- return 0;
- }
- @Override
- public int EnergyStored() {
- // TODO Auto-generated method stub
- return 0;
- }
- @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 0;
- }
- @Override
- public int EnergyPush(IBlockAccess access, int x, int y, int z, World world) {
- return EnergyIn(access, x, y, z, world);
- }
- */
- //power shit end
- //connection start
- public boolean canConnectDuctTo(IBlockAccess access, int x, int y, int z)
- {
- Block block = access.getBlock(x, y, z);
- // return ((IAc) block).canAcceptEnergy();
- return block != this && block != Acsension.blockDuct && block != Acsension.blockSolarGenny && block != Acsension.blockEnergyCell && block != Acsension.blockRedstoneConverter;
- }
- @Override
- public void setBlockBoundsBasedOnState(IBlockAccess access, int x, int y, int z)
- {
- boolean flag = this.canConnectDuctTo(access, x, y, z - 1);
- boolean flag1 = this.canConnectDuctTo(access, x, y, z + 1);
- boolean flag2 = this.canConnectDuctTo(access, x - 1, y, z);
- boolean flag3 = this.canConnectDuctTo(access, x + 1, y, z);
- boolean flag4 = this.canConnectDuctTo(access, x , y - 1, z);
- boolean flag5 = this.canConnectDuctTo(access, x , y + 1, z);
- float f = 0.25f;
- float f1 = 0.75f;
- float f2 = 0.25f;
- float f3 = 0.75f;
- float f4 = 0.25f;
- float f5 = 0.75f;
- if (!flag)
- {
- f2 = 0.0F;
- }
- if (!flag1)
- {
- f3 = 1.0F;
- }
- //me
- if (!flag4)
- {
- f4 = 0.0F;
- }
- if (!flag5)
- {
- f5 = 1.0F;
- }
- //me
- if (!flag2)
- {
- f = 0.0F;
- }
- if (!flag3)
- {
- f1 = 1.0F;
- }
- this.setBlockBounds(f, f4, f2, f1, f5, f3);
- }
- //connection end
- public BlockDuct(Material material) {
- super(material);
- this.blockHardness = 2f;
- }
- public boolean isOpaqueCube(){
- return false;
- }
- public boolean renderAsNormalBlock()
- {
- return false;
- }
- @Override
- public Block setLightOpacity(int p_149713_1_) {
- return super.setLightOpacity(15);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement