Guest User

bBen.java

a guest
May 2nd, 2016
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. package com.rabidpotato.colony.blocks.clock;
  2.  
  3. import com.rabidpotato.colony.libs.RefStrings;
  4.  
  5. import net.minecraft.block.Block;
  6. import net.minecraft.block.material.Material;
  7. import net.minecraft.client.renderer.texture.IIconRegister;
  8. import net.minecraft.entity.EntityLivingBase;
  9. import net.minecraft.item.ItemStack;
  10. import net.minecraft.util.IIcon;
  11. import net.minecraft.world.World;
  12.  
  13. public class bBen extends Block{
  14.  
  15. protected bBen(Material mat) {
  16. super(mat);
  17. this.setHardness(14.2F);
  18. this.setResistance(6.0F);
  19. this.setStepSound(soundTypeMetal);
  20. this.setHarvestLevel("pickaxe", 3);
  21. //s0 is Wood, 1 is Stone, 2 is Iron and 3 is Diamond.
  22. }
  23.  
  24. @Override
  25. public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack)
  26. {
  27. boolean status;
  28. Block needed = RotateClock.anClock;
  29.  
  30. for(int k = 0; k < 3; k++){
  31. if(world.getBlock(x + k, y , z) == needed){
  32. if(world.getBlock(x, y + k, z) == needed){
  33. if(world.getBlock(x,y,z + k) == needed){
  34. status = true;
  35. }
  36. }
  37. }
  38. }
  39.  
  40. if(status = true){
  41. for(int i = 0; i < 16; i++){
  42. world.setBlockMetadataWithNotify(x,y,z,i,3);
  43. }
  44. }
  45.  
  46.  
  47. }
  48.  
  49.  
  50.  
  51. public IIcon[] icons = new IIcon[16];
  52.  
  53. @Override
  54. public void registerBlockIcons(IIconRegister reg) {
  55. for (int i = 1; i < 16; i ++) {
  56. this.icons[i] = reg.registerIcon(RefStrings.MODID + ":clock/clocktower_" + i);
  57. }
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment