Merge branch 'v6' into v7

This commit is contained in:
Alexander Brandes 2023-03-05 10:18:55 +01:00
commit a5fdcda673
No known key found for this signature in database
GPG Key ID: 158F5701A6AAD00C
4 changed files with 24 additions and 9 deletions

View File

@ -11,7 +11,7 @@ jobs:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
DISCORD_USERNAME: PlotSquared Release DISCORD_USERNAME: PlotSquared Release
DISCORD_AVATAR: https://raw.githubusercontent.com/IntellectualSites/Assets/main/plugins/PlotSquared/PlotSquared.png DISCORD_AVATAR: https://raw.githubusercontent.com/IntellectualSites/Assets/main/plugins/PlotSquared/PlotSquared.png
uses: Ilshidur/action-discord@0c4b27844ba47cb1c7bee539c8eead5284ce9fa9 # ratchet:Ilshidur/action-discord@0.3.2 uses: Ilshidur/action-discord@08d9328877d6954120eef2b07abbc79249bb6210 # ratchet:Ilshidur/action-discord@0.3.2
with: with:
args: | args: |
"<@&525015541815967744> <@&679322738552471574> <@&699293353862496266>" "<@&525015541815967744> <@&679322738552471574> <@&699293353862496266>"

View File

@ -72,6 +72,7 @@ import org.bukkit.block.BlockFace;
import org.bukkit.block.BlockState; import org.bukkit.block.BlockState;
import org.bukkit.block.data.BlockData; import org.bukkit.block.data.BlockData;
import org.bukkit.block.data.type.Dispenser; import org.bukkit.block.data.type.Dispenser;
import org.bukkit.block.data.type.Farmland;
import org.bukkit.entity.Entity; import org.bukkit.entity.Entity;
import org.bukkit.entity.Fireball; import org.bukkit.entity.Fireball;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -746,22 +747,35 @@ public class BlockEventListener implements Listener {
Block block = event.getBlock(); Block block = event.getBlock();
Location location = BukkitUtil.adapt(block.getLocation()); Location location = BukkitUtil.adapt(block.getLocation());
PlotArea area = location.getPlotArea(); PlotArea area = location.getPlotArea();
if (area == null) { if (area == null) {
return; return;
} }
Plot plot = area.getOwnedPlot(location); Plot plot = area.getOwnedPlot(location);
if (plot == null) { if (plot == null) {
event.setCancelled(true); event.setCancelled(true);
return; return;
} }
Material blockType = block.getType();
if (blockType == Material.FARMLAND) { if (block.getBlockData() instanceof Farmland farmland && event.getNewState().getBlockData() instanceof Farmland newFarmland) {
if (!plot.getFlag(SoilDryFlag.class)) { int currentMoisture = farmland.getMoisture();
int newMoisture = newFarmland.getMoisture();
// farmland gets moisturizes
if (newMoisture > currentMoisture) {
return;
}
if (plot.getFlag(SoilDryFlag.class)) {
return;
}
plot.debug("Soil could not dry because soil-dry = false"); plot.debug("Soil could not dry because soil-dry = false");
event.setCancelled(true); event.setCancelled(true);
} }
} }
}
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true) @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onChange(BlockFromToEvent event) { public void onChange(BlockFromToEvent event) {

View File

@ -14,7 +14,7 @@ mvdwapi = "3.1.1"
prtree = "2.0.1" prtree = "2.0.1"
aopalliance = "1.0" aopalliance = "1.0"
cloud-services = "1.8.2" cloud-services = "1.8.2"
arkitektonika = "2.1.1" arkitektonika = "2.1.2"
squirrelid = "0.3.1" squirrelid = "0.3.1"
# Gradle plugins # Gradle plugins

View File

@ -4,6 +4,7 @@
"config:base", "config:base",
":semanticCommitsDisabled" ":semanticCommitsDisabled"
], ],
"labels": ["Renovate"], "labels": ["dependencies"],
"rebaseWhen": "conflicted" "rebaseWhen": "conflicted",
"schedule": ["on the first day of the week"]
} }