Advertisement
Guest User

Untitled

a guest
Jul 17th, 2015
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. /**
  2. * Lets the block know when one of its neighbor changes. Doesn't know which neighbor changed (coordinates passed are
  3. * their own) Args: x, y, z, neighbor Block
  4. */
  5. public void onNeighborBlockChange(World p_149695_1_, int p_149695_2_, int p_149695_3_, int p_149695_4_, Block p_149695_5_)
  6. {
  7. if (!p_149695_1_.isRemote)
  8. {
  9. if (this.field_150171_a && !p_149695_1_.isBlockIndirectlyGettingPowered(p_149695_2_, p_149695_3_, p_149695_4_))
  10. {
  11. p_149695_1_.scheduleBlockUpdate(p_149695_2_, p_149695_3_, p_149695_4_, this, 4);
  12. }
  13. else if (!this.field_150171_a && p_149695_1_.isBlockIndirectlyGettingPowered(p_149695_2_, p_149695_3_, p_149695_4_))
  14. {
  15. p_149695_1_.setBlock(p_149695_2_, p_149695_3_, p_149695_4_, Blocks.lit_redstone_lamp, 0, 2);
  16. }
  17. }
  18. }
  19.  
  20. /**
  21. * Ticks the block if it's been scheduled
  22. */
  23. public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_)
  24. {
  25. if (!p_149674_1_.isRemote && this.field_150171_a && !p_149674_1_.isBlockIndirectlyGettingPowered(p_149674_2_, p_149674_3_, p_149674_4_))
  26. {
  27. p_149674_1_.setBlock(p_149674_2_, p_149674_3_, p_149674_4_, Blocks.redstone_lamp, 0, 2);
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement