mirror of
https://github.com/songoda/EpicFarming.git
synced 2024-07-04 02:04:45 +02:00
fix for caching issue
This commit is contained in:
parent
be31a1ce5f
commit
acd4f9e97a
|
@ -288,6 +288,10 @@ public class EFarm implements Farm {
|
|||
cachedCrops.add(block);
|
||||
}
|
||||
|
||||
public void removeCachedCrop(Block block) {
|
||||
cachedCrops.remove(block);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Block> getCachedCrops() {
|
||||
return new ArrayList<>(cachedCrops);
|
||||
|
|
|
@ -114,7 +114,7 @@ public class FarmTask extends BukkitRunnable {
|
|||
}
|
||||
|
||||
public List<Block> getCrops(Farm farm, boolean add) {
|
||||
if (System.currentTimeMillis() - ((EFarm)farm).getLastCached() > 30 * 1000) {
|
||||
if (System.currentTimeMillis() - ((EFarm)farm).getLastCached() > 30 * 1000 || !add) {
|
||||
((EFarm)farm).setLastCached(System.currentTimeMillis());
|
||||
Block block = farm.getLocation().getBlock();
|
||||
int radius = farm.getLevel().getRadius();
|
||||
|
@ -132,8 +132,8 @@ public class FarmTask extends BukkitRunnable {
|
|||
((EFarm)farm).addCachedCrop(b2);
|
||||
continue;
|
||||
}
|
||||
((EFarm)farm).removeCachedCrop(b2);
|
||||
plugin.getGrowthTask().removeCropByLocation(b2.getLocation());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
name: EpicFarming
|
||||
description: EpicFarming
|
||||
main: com.songoda.epicfarming.EpicFarmingPlugin
|
||||
version: 2.0.13
|
||||
version: 2.0.14
|
||||
depend: [Arconix]
|
||||
soft-depend: [Multiverse-Core]
|
||||
author: Songoda
|
||||
|
|
Loading…
Reference in New Issue
Block a user