Advertisement
Guest User

Пробничек блятьб

a guest
Aug 24th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. TileEntity.registerPrototype(BlockID.AltarAbyssal, {
  2. defaultValues: {
  3. progress: 0,
  4. items:[{center:null},{cell1:null},{cell2:null},{cell3:null},{cell4:null},{cell5:null},{cell6:null},{cell7:null},{cell8:null}],
  5. connects:[],
  6. haveRecipe:false,
  7. energyTotal: 0,
  8. result: null,
  9. consumption: 0
  10. },
  11. connect: function(connect, c){
  12. let block = World.getBlock(c.x, c.y, c.z).id === BlockID.AltarAbyssal;
  13. if(connect === null && block){
  14. let tile = World.getTileEntity(c.x, c.y, c.z);
  15. connect = tile.connect(this);
  16. Game.message("Connected Block at x: "+c.x+", y: "+c.y+", z: "+c.z);
  17. }
  18. if(connect != null && block)
  19. Game.message("Already Connected Block at x: "+c.x+", y: "+c.y+", z: "+c.z);
  20. },
  21. click: function(id, count, data, c){
  22. if(id != ItemID.normalNecronomicon){
  23. this.addAnim(id, count, data);
  24. var prms = {id:id,data:data};
  25. this.items.push(prms);
  26. }else{
  27. this.data.haveRecipe = true;
  28.  
  29. }
  30. },
  31. drop: function(){
  32. for(var j in this.data.items){
  33. Player.addItemToInventory(this.data.items[j].id, 1, this.data.items[j].data); this.data.items[j]=null; this.anim.destroy();
  34. }
  35. },
  36. destroy: function(){
  37. if(this.data.items){
  38. this.drop();
  39. }
  40. },
  41. anim: null,
  42. created: function(){
  43. for(var k in SacrificesApi.connections){
  44. this.anim = new Animation.item(SacrificesApi.connections[k].x+0.5, SacrificesApi.connections[k].y+1, SacrificesApi.connections[k].z+0.5);
  45. }
  46. },
  47. init: function(){
  48. for(var k in SacrificesApi.connections){
  49. this.anim = new Animation.item(SacrificesApi.connections[k].x+0.5, SacrificesApi.connections[k].y+1, SacrificesApi.connections[k].z+0.5);
  50. }
  51. },
  52. addAnim: function(id, count, data){
  53. for(var j in this.data.items){
  54. if(this.data.items[j]===null || this.data.items[j]===undefined || id != null){
  55. Player.decreaseCarriedItem(1);
  56. this.data.items[j] = {id: id, count: 1, data: data};
  57. this.anim.describeItem({
  58. id: this.data.items[j].id,
  59. count: 1,
  60. data: this.data.items[j].data,
  61. size: 1,
  62. rotation: [Math.PI/2, 0, 0],
  63. notRandomize: true
  64. });
  65. animation.load();
  66. }else{this.drop();}
  67. }
  68. }
  69. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement