Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TileEntity.registerPrototype(BlockID.AltarAbyssal, {
- defaultValues: {
- progress: 0,
- items:[{center:null},{cell1:null},{cell2:null},{cell3:null},{cell4:null},{cell5:null},{cell6:null},{cell7:null},{cell8:null}],
- connects:[],
- haveRecipe:false,
- energyTotal: 0,
- result: null,
- consumption: 0
- },
- connect: function(connect, c){
- let block = World.getBlock(c.x, c.y, c.z).id === BlockID.AltarAbyssal;
- if(connect === null && block){
- let tile = World.getTileEntity(c.x, c.y, c.z);
- connect = tile.connect(this);
- Game.message("Connected Block at x: "+c.x+", y: "+c.y+", z: "+c.z);
- }
- if(connect != null && block)
- Game.message("Already Connected Block at x: "+c.x+", y: "+c.y+", z: "+c.z);
- },
- click: function(id, count, data, c){
- if(id != ItemID.normalNecronomicon){
- this.addAnim(id, count, data);
- var prms = {id:id,data:data};
- this.items.push(prms);
- }else{
- this.data.haveRecipe = true;
- }
- },
- drop: function(){
- for(var j in this.data.items){
- Player.addItemToInventory(this.data.items[j].id, 1, this.data.items[j].data); this.data.items[j]=null; this.anim.destroy();
- }
- },
- destroy: function(){
- if(this.data.items){
- this.drop();
- }
- },
- anim: null,
- created: function(){
- for(var k in SacrificesApi.connections){
- this.anim = new Animation.item(SacrificesApi.connections[k].x+0.5, SacrificesApi.connections[k].y+1, SacrificesApi.connections[k].z+0.5);
- }
- },
- init: function(){
- for(var k in SacrificesApi.connections){
- this.anim = new Animation.item(SacrificesApi.connections[k].x+0.5, SacrificesApi.connections[k].y+1, SacrificesApi.connections[k].z+0.5);
- }
- },
- addAnim: function(id, count, data){
- for(var j in this.data.items){
- if(this.data.items[j]===null || this.data.items[j]===undefined || id != null){
- Player.decreaseCarriedItem(1);
- this.data.items[j] = {id: id, count: 1, data: data};
- this.anim.describeItem({
- id: this.data.items[j].id,
- count: 1,
- data: this.data.items[j].data,
- size: 1,
- rotation: [Math.PI/2, 0, 0],
- notRandomize: true
- });
- animation.load();
- }else{this.drop();}
- }
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement