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);
   }
 }
 /** 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);
         }
       }
   }
 }
Beispiel #3
0
 public static MyTownDatasource getDatasource() {
   return DatasourceProxy.getDatasource();
 }