Guest User

Untitled

a guest
Apr 24th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.45 KB | None | 0 0
  1. package neg2013.acsension.infrastructure;
  2.  
  3. import java.util.ArrayList;
  4.  
  5. import cpw.mods.fml.relauncher.Side;
  6. import cpw.mods.fml.relauncher.SideOnly;
  7. import neg2013.acsension.block.BlockGenny;
  8. import neg2013.acsension.interfaces.EnergyStorage;
  9. import neg2013.acsension.interfaces.IAc;
  10. import net.minecraft.block.Block;
  11. import net.minecraft.block.ITileEntityProvider;
  12. import net.minecraft.block.material.Material;
  13. import net.minecraft.client.Minecraft;
  14. import net.minecraft.client.renderer.texture.IIconRegister;
  15. import net.minecraft.tileentity.TileEntity;
  16. import net.minecraft.util.IIcon;
  17. import net.minecraft.world.IBlockAccess;
  18. import net.minecraft.world.World;
  19. import net.minecraftforge.common.util.ForgeDirection;
  20.  
  21. public class BlockSolarGenny extends BlockAC implements ITileEntityProvider
  22. {
  23.  
  24. @SideOnly(Side.CLIENT)
  25. private IIcon field_150035_a;
  26. @SideOnly(Side.CLIENT)
  27. private IIcon field_150034_b;
  28.  
  29. public BlockSolarGenny(Material material) {
  30. super(material);
  31. }//constructor
  32.  
  33. @SideOnly(Side.CLIENT)
  34. public void registerBlockIcons(IIconRegister p_149651_1_)
  35.  
  36. {
  37.  
  38.  
  39.  
  40. this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side" );
  41. this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_side");
  42.  
  43. this.field_150035_a = p_149651_1_.registerIcon(this.getTextureName() + "_top");
  44.  
  45. }//register iicon
  46.  
  47.  
  48. @Override
  49. public IIcon getIcon(int p_149691_1_, int p_149691_2_)
  50. {
  51. return p_149691_1_ == 1 ? this.field_150035_a : (p_149691_1_ == 0 ? this.field_150035_a : (p_149691_1_ != 2 && p_149691_1_ != 4 ? this.blockIcon : this.field_150034_b));
  52. }//get iicon
  53.  
  54. //power shit
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61. //done
  62. @Override
  63. public int MaxEnergyStored() {
  64.  
  65. return 128;
  66. }
  67.  
  68. //done
  69. @Override
  70. public boolean CanGenerateEnergy(int x, int y, int z) {
  71.  
  72.  
  73. if(Minecraft.getMinecraft().theWorld.canBlockSeeTheSky(x, y, z)){
  74.  
  75. if(Minecraft.getMinecraft().theWorld.isDaytime()){
  76.  
  77. return true;
  78. }//day
  79. }//sky
  80.  
  81. return false;
  82. }
  83.  
  84. //done
  85. @Override
  86. public boolean canAcceptEnergy() {
  87. return false;
  88. }
  89.  
  90. @Override
  91. public int EnergyGenerating() {
  92.  
  93. if (MaxEnergyStored() == 128){
  94. return 0;
  95. }
  96. else{return 8;}
  97.  
  98. }
  99.  
  100. //done
  101. @Override
  102. public boolean canConnectToAc() {
  103. return true;
  104. }
  105.  
  106. //done
  107. @Override
  108. public boolean CanConsumeEnergy() {
  109.  
  110. return false;
  111. }
  112.  
  113.  
  114. @Override
  115. public int EnergyStored(IBlockAccess access, int x, int y, int z, World world) {
  116. int tick = tickRate(Minecraft.getMinecraft().theWorld);
  117.  
  118. int energyStored = tick * EnergyGenerating();
  119.  
  120. return energyStored;
  121. }
  122.  
  123.  
  124. //done
  125. @Override
  126. public int EnergyIn(IBlockAccess access, int x, int y, int z, World world) {
  127.  
  128. return 0;
  129. }
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138. //done
  139. @Override
  140. public int EnergyPush(IBlockAccess access, int x, int y, int z, World world) {
  141.  
  142. return 8;
  143. }
  144.  
  145.  
  146.  
  147.  
  148. @Override
  149. public int EnergyConsuming() {
  150.  
  151. return 0;
  152. }
  153.  
  154. @Override
  155. public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
  156. // TODO Auto-generated method stub
  157. return null;
  158. }
  159.  
  160. /*
  161. @Override
  162. public int EnergyOut(IBlockAccess access, int x, int y, int z, World world) {
  163. if(EnergyDraw(access, x, y, z, world) >= 1){
  164. return EnergyDraw(access, x, y, z, world);
  165. }
  166. else{return 0;}
  167. }
  168. */
  169.  
  170. }//class body
Add Comment
Please, Sign In to add comment