mirror of
https://github.com/songoda/EpicFarming.git
synced 2025-02-22 07:21:54 +01:00
Merge branch 'development'
This commit is contained in:
commit
296de9985f
2
pom.xml
2
pom.xml
@ -2,7 +2,7 @@
|
|||||||
<groupId>com.songoda</groupId>
|
<groupId>com.songoda</groupId>
|
||||||
<artifactId>EpicFarming</artifactId>
|
<artifactId>EpicFarming</artifactId>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<version>3.0.25</version>
|
<version>3.0.26</version>
|
||||||
<build>
|
<build>
|
||||||
<defaultGoal>clean install</defaultGoal>
|
<defaultGoal>clean install</defaultGoal>
|
||||||
<finalName>EpicFarming-${project.version}</finalName>
|
<finalName>EpicFarming-${project.version}</finalName>
|
||||||
|
@ -176,8 +176,9 @@ public class Farm {
|
|||||||
return Collections.unmodifiableList(items);
|
return Collections.unmodifiableList(items);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Should be used in sync.
|
||||||
public void addItem(ItemStack toAdd) {
|
public void addItem(ItemStack toAdd) {
|
||||||
for (ItemStack item : new ArrayList<>(getItems())) {
|
for (ItemStack item : new ArrayList<>(items)) {
|
||||||
if (item.getType() != toAdd.getType()
|
if (item.getType() != toAdd.getType()
|
||||||
|| item.getAmount() + toAdd.getAmount() > item.getMaxStackSize()) continue;
|
|| item.getAmount() + toAdd.getAmount() > item.getMaxStackSize()) continue;
|
||||||
item.setAmount(item.getAmount() + toAdd.getAmount());
|
item.setAmount(item.getAmount() + toAdd.getAmount());
|
||||||
|
@ -220,9 +220,10 @@ public class ModuleAutoCollect extends Module {
|
|||||||
ItemStack seedStack = new ItemStack(cropTypeData.getSeedMaterial(), random.nextInt(3) + 1 + (useBoneMeal(farm) ? 1 : 0));
|
ItemStack seedStack = new ItemStack(cropTypeData.getSeedMaterial(), random.nextInt(3) + 1 + (useBoneMeal(farm) ? 1 : 0));
|
||||||
|
|
||||||
if (!farm.willFit(stack) || !farm.willFit(seedStack)) return false;
|
if (!farm.willFit(stack) || !farm.willFit(seedStack)) return false;
|
||||||
Bukkit.getScheduler().runTask(plugin, () ->
|
Bukkit.getScheduler().runTask(plugin, () -> {
|
||||||
Methods.animate(farm.getLocation(), cropTypeData.getYieldMaterial()));
|
Methods.animate(farm.getLocation(), cropTypeData.getYieldMaterial());
|
||||||
farm.addItem(stack);
|
farm.addItem(stack);
|
||||||
|
});
|
||||||
if (getCollectionType(farm) != CollectionType.NO_SEEDS)
|
if (getCollectionType(farm) != CollectionType.NO_SEEDS)
|
||||||
farm.addItem(seedStack);
|
farm.addItem(seedStack);
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user