コード例 #1
0
 /* 107:    */
 /* 108:    */ public static boolean saveToSpawner(int x, int y, int z, EntityHumanBase human)
       /* 109:    */ {
   /* 110:101 */ World world = human.worldObj;
   /* 111:102 */ if (world.getBlock(x, y, z) != Blocks.air) {
     /* 112:103 */ y++;
     /* 113:    */ }
   /* 114:105 */ world.setBlock(x, y, z, ChocolateQuest.spawner);
   /* 115:106 */ BlockMobSpawnerTileEntity te = new BlockMobSpawnerTileEntity();
   /* 116:107 */ NBTTagCompound tag = new NBTTagCompound();
   /* 117:108 */ human.writeToNBTOptional(tag);
   /* 118:109 */ human.writeEntityToSpawnerNBT(tag, x, y, z);
   /* 119:110 */ te.mobNBT = tag;
   /* 120:111 */ te.mob = -1;
   /* 121:112 */ world.setTileEntity(x, y, z, te);
   /* 122:113 */ return true;
   /* 123:    */ }
コード例 #2
0
 /*  87:    */
 /*  88:    */ public boolean saveEntityToSpawner(int x, int y, int z, Entity entity)
       /*  89:    */ {
   /*  90: 83 */ World world = entity.worldObj;
   /*  91: 84 */ if (world.getBlock(x, y, z) != Blocks.air) {
     /*  92: 85 */ y++;
     /*  93:    */ }
   /*  94: 87 */ world.setBlock(x, y, z, ChocolateQuest.spawner);
   /*  95: 88 */ BlockMobSpawnerTileEntity te = new BlockMobSpawnerTileEntity();
   /*  96: 89 */ NBTTagCompound tag = new NBTTagCompound();
   /*  97: 90 */ boolean wrote = entity.writeToNBTOptional(tag);
   /*  98: 91 */ if (wrote)
   /*  99:    */ {
     /* 100: 92 */ te.mobNBT = tag;
     /* 101: 93 */ te.mob = -1;
     /* 102: 94 */ world.setTileEntity(x, y, z, te);
     /* 103: 95 */ return true;
     /* 104:    */ }
   /* 105: 97 */ return false;
   /* 106:    */ }