Guest User

Untitled

a guest
Apr 23rd, 2016
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.94 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.material.Material;
  12. import net.minecraft.client.Minecraft;
  13. import net.minecraft.client.renderer.texture.IIconRegister;
  14. import net.minecraft.util.IIcon;
  15. import net.minecraft.world.IBlockAccess;
  16. import net.minecraft.world.World;
  17. import net.minecraftforge.common.util.ForgeDirection;
  18.  
  19. public class BlockSolarGenny extends BlockAC
  20. {
  21.  
  22. @SideOnly(Side.CLIENT)
  23. private IIcon field_150035_a;
  24. @SideOnly(Side.CLIENT)
  25. private IIcon field_150034_b;
  26.  
  27. public BlockSolarGenny(Material material) {
  28. super(material);
  29. }//constructor
  30.  
  31. @SideOnly(Side.CLIENT)
  32. public void registerBlockIcons(IIconRegister p_149651_1_)
  33.  
  34. {
  35.  
  36.  
  37.  
  38. this.blockIcon = p_149651_1_.registerIcon(this.getTextureName() + "_side" );
  39. this.field_150034_b = p_149651_1_.registerIcon(this.getTextureName() + "_side");
  40.  
  41. this.field_150035_a = p_149651_1_.registerIcon(this.getTextureName() + "_top");
  42.  
  43. }//register iicon
  44.  
  45.  
  46. @Override
  47. public IIcon getIcon(int p_149691_1_, int p_149691_2_)
  48. {
  49. 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));
  50. }//get iicon
  51.  
  52. //power shit
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59. //done
  60. @Override
  61. public int MaxEnergyStored() {
  62.  
  63. return 128;
  64. }
  65.  
  66. //done
  67. @Override
  68. public boolean CanGenerateEnergy(int x, int y, int z) {
  69.  
  70.  
  71. if(Minecraft.getMinecraft().theWorld.canBlockSeeTheSky(x, y, z)){
  72.  
  73. if(Minecraft.getMinecraft().theWorld.isDaytime()){
  74.  
  75. return true;
  76. }//day
  77. }//sky
  78.  
  79. return false;
  80. }
  81.  
  82. //done
  83. @Override
  84. public boolean canAcceptEnergy() {
  85. return false;
  86. }
  87.  
  88. @Override
  89. public int EnergyGenerating() {
  90.  
  91. if (MaxEnergyStored() == 128){
  92. return 0;
  93. }
  94. else{return 8;}
  95.  
  96. }
  97.  
  98. //done
  99. @Override
  100. public boolean canConnectToAc() {
  101. return true;
  102. }
  103.  
  104. //done
  105. @Override
  106. public boolean CanConsumeEnergy() {
  107.  
  108. return false;
  109. }
  110.  
  111.  
  112. @Override
  113. public int EnergyStored(IBlockAccess access, int x, int y, int z, World world) {
  114. int tick = tickRate(Minecraft.getMinecraft().theWorld);
  115.  
  116. int energyStored = tick * EnergyGenerating();
  117.  
  118. return energyStored;
  119. }
  120.  
  121.  
  122. //done
  123. @Override
  124. public int EnergyIn(IBlockAccess access, int x, int y, int z, World world) {
  125.  
  126. return 0;
  127. }
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. //done
  137. @Override
  138. public int EnergyPush(IBlockAccess access, int x, int y, int z, World world) {
  139.  
  140. return 8;
  141. }
  142.  
  143.  
  144.  
  145.  
  146. @Override
  147. public int EnergyConsuming() {
  148.  
  149. return 0;
  150. }
Advertisement
Add Comment
Please, Sign In to add comment