コード例 #1
0
 public static void saveBlockOwnersToDB() {
   for (Map.Entry<TileEntity, Resident> set : Protections.instance.ownedTileEntities.entrySet()) {
     DatasourceProxy.getDatasource()
         .saveBlockOwner(
             set.getValue(),
             set.getKey().getWorldObj().provider.dimensionId,
             set.getKey().xCoord,
             set.getKey().yCoord,
             set.getKey().zCoord);
   }
 }
コード例 #2
0
 /** Adds to the whitelist of the specified town. Used when placing blocks. */
 public static void addToBlockWhitelist(
     Class<? extends TileEntity> te, int dim, int x, int y, int z, Town town) {
   for (Protection prot : Protections.instance.getProtectionList()) {
     if (prot.isTileTracked(te))
       for (FlagType flagType : prot.getFlagsForTile(te)) {
         if (!town.hasBlockWhitelist(dim, x, y, z, flagType)) {
           BlockWhitelist bw = new BlockWhitelist(dim, x, y, z, flagType);
           DatasourceProxy.getDatasource().saveBlockWhitelist(bw, town);
         }
       }
   }
 }
コード例 #3
0
ファイル: Protection.java プロジェクト: Nerzhei/MyTown2
 public static MyTownDatasource getDatasource() {
   return DatasourceProxy.getDatasource();
 }