Guest User

Untitled

a guest
Apr 23rd, 2016
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.08 KB | None | 0 0
  1. package neg2013.acsension.infrastructure;
  2.  
  3. import neg2013.acsension.Acsension;
  4. import neg2013.acsension.interfaces.IAc;
  5. import net.minecraft.block.Block;
  6. import net.minecraft.block.material.Material;
  7. import net.minecraft.client.Minecraft;
  8. import net.minecraft.world.IBlockAccess;
  9. import net.minecraft.world.World;
  10.  
  11. public class BlockEnergyDuctBase extends BlockAC implements IAc{
  12.  
  13. protected BlockEnergyDuctBase(Material material) {
  14. super(material);
  15.  
  16. }
  17.  
  18. //warning
  19. //power shit start
  20.  
  21.  
  22. //done
  23. @Override
  24. public int MaxEnergyStored() {
  25.  
  26. return 2;
  27. }
  28.  
  29. //done
  30. @Override
  31. public int EnergyGenerating() {
  32.  
  33. return 0;
  34. }
  35.  
  36. //done
  37. @Override
  38. public boolean canAcceptEnergy() {
  39.  
  40. return true;
  41. }
  42.  
  43. //done
  44. @Override
  45. public boolean canConnectToAc() {
  46.  
  47. return true;
  48. }
  49.  
  50. //done
  51. @Override
  52. public boolean CanGenerateEnergy(int x, int y, int z) {
  53.  
  54. return false;
  55. }
  56.  
  57. //done
  58. @Override
  59. public boolean CanConsumeEnergy() {
  60.  
  61. return false;
  62. }
  63.  
  64. //done
  65. @Override
  66. public int EnergyIn(IBlockAccess access, int x, int y, int z, World world) {
  67. int energyIn = EnergyIn(access, x, y, z, world);
  68.  
  69. energyIn = NeighborPush(access, x, y, z, world);
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78. return energyIn;
  79. }
  80.  
  81. @Override
  82. public int EnergyStored(IBlockAccess access, int x, int y, int z, World world) {
  83.  
  84. int tick = tickRate(Minecraft.getMinecraft().theWorld);
  85.  
  86. int energyStored = tick * EnergyGenerating();
  87.  
  88. return energyStored;
  89. }
  90.  
  91. @Override
  92. public int EnergyOut(IBlockAccess access, int x, int y, int z, World world) {
  93.  
  94. int energyIn = EnergyIn(access, x, y, z, world);
  95.  
  96. //if(){}
  97. return EnergyIn(access, x, y, z, world);
  98. }
  99.  
  100. @Override
  101. public int EnergyDraw(IBlockAccess access, int x, int y, int z, World world) {
  102.  
  103. return NeighborDraw(access, x, y, z, world);
  104. }
  105.  
  106. @Override
  107. public int EnergyPush(IBlockAccess access, int x, int y, int z, World world) {
  108.  
  109. return EnergyIn(access, x, y, z, world);
  110. }
  111.  
  112. @Override
  113. public int NeighborDraw(IBlockAccess access, int x, int y, int z, World world) {
  114.  
  115. BlockAC block = (BlockAC) access.getBlock(x, y, z);
  116.  
  117. if(!( block != Acsension.blockDuct && block != Acsension.blockSolarGenny && block != Acsension.blockEnergyCell)){
  118. int neighborDraw = block.EnergyDraw(access, x, y, z, world);
  119. return neighborDraw;
  120. }
  121. return 0;
  122. }
  123.  
  124. @Override
  125. public int NeighborPush(IBlockAccess access, int x, int y, int z, World world) {
  126.  
  127. BlockAC block = (BlockAC) access.getBlock(x, y, z);
  128.  
  129. if(!( block != Acsension.blockDuct && block != Acsension.blockSolarGenny && block != Acsension.blockEnergyCell)){
  130. int neighborPush = block.EnergyPush(access, x, y, z, world);
  131. return neighborPush;
  132. }
  133. return 0;
  134. }
  135.  
  136. @Override
  137. public boolean IsPowered(IBlockAccess access, int x, int y, int z, World world) {
  138.  
  139. if(NeighborPush(access, x, y, z, world) >= 1){
  140. return true;
  141. }
  142.  
  143. return false;
  144. }
  145.  
  146. }
Add Comment
Please, Sign In to add comment