Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. package de.cubenetwork.lokykun.cubestats;
  2.  
  3. import org.bukkit.block.Block;
  4.  
  5. public class BlockCreateTabel {
  6.  
  7. public int ID;
  8. public String name;
  9. public int[] block = new int[1-95];
  10. public int[] wool = new int[35001-35015];
  11. public int[] log = new int[17001-17002];
  12. public int[] slap = new int[44001-44002];
  13. public int[] doubleSlap = new int[44001-44002];
  14.  
  15. public BlockCreateTabel(int ID, String name){
  16. this.ID = ID;
  17. this.name = name;
  18.  
  19. //Arrays mit 0 füllen
  20. for (int i = 1; i <= block.length; i++ ){
  21. block[i] = 0;
  22. }
  23. for (int i = 1; i <= wool.length; i++ ){
  24. wool[35000 + i] = 0;
  25. }
  26. for (int i = 1; i <= log.length; i++ ){
  27. log[17000 + i] = 0;
  28. }
  29. for (int i = 1; i <= slap.length; i++ ){
  30. slap[44000 + i] = 0;
  31. }
  32. for (int i = 1; i <= doubleSlap.length; i++ ){
  33. doubleSlap[43000 + i] = 0;
  34. }
  35. }
  36.  
  37. public void setInTabel(Block block){
  38. //Wool abfangen
  39. if (block.getTypeId() == 35){
  40. if (block.getData() != 00){
  41. wool[35000 + block.getData()]++;
  42. return;
  43. }
  44. }
  45. //Log abfangen
  46. if (block.getTypeId() == 17){
  47. if (block.getData() != 00){
  48. wool[17000 + block.getData()]++;
  49. return;
  50. }
  51. }
  52. //Slap abfangen
  53. if (block.getTypeId() == 44){
  54. if (block.getData() != 00){
  55. wool[44000 + block.getData()]++;
  56. return;
  57. }
  58. }
  59. //DoubelSlap abfangen
  60. if (block.getTypeId() == 43){
  61. if (block.getData() != 00){
  62. wool[43000 + block.getData()]++;
  63. return;
  64. }
  65. }
  66. // Block abfangen
  67. this.block[block.getTypeId()]++;
  68.  
  69.  
  70. }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement