mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +01:00
Merge branch 'v6' into v7
This commit is contained in:
commit
a5fdcda673
@ -11,7 +11,7 @@ jobs:
|
||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
DISCORD_USERNAME: PlotSquared Release
|
||||
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:
|
||||
args: |
|
||||
"<@&525015541815967744> <@&679322738552471574> <@&699293353862496266>"
|
||||
|
@ -72,6 +72,7 @@ import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.type.Dispenser;
|
||||
import org.bukkit.block.data.type.Farmland;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Fireball;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -746,22 +747,35 @@ public class BlockEventListener implements Listener {
|
||||
Block block = event.getBlock();
|
||||
Location location = BukkitUtil.adapt(block.getLocation());
|
||||
PlotArea area = location.getPlotArea();
|
||||
|
||||
if (area == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Plot plot = area.getOwnedPlot(location);
|
||||
|
||||
if (plot == null) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
Material blockType = block.getType();
|
||||
if (blockType == Material.FARMLAND) {
|
||||
if (!plot.getFlag(SoilDryFlag.class)) {
|
||||
|
||||
if (block.getBlockData() instanceof Farmland farmland && event.getNewState().getBlockData() instanceof Farmland newFarmland) {
|
||||
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");
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onChange(BlockFromToEvent event) {
|
||||
|
@ -14,7 +14,7 @@ mvdwapi = "3.1.1"
|
||||
prtree = "2.0.1"
|
||||
aopalliance = "1.0"
|
||||
cloud-services = "1.8.2"
|
||||
arkitektonika = "2.1.1"
|
||||
arkitektonika = "2.1.2"
|
||||
squirrelid = "0.3.1"
|
||||
|
||||
# Gradle plugins
|
||||
|
@ -4,6 +4,7 @@
|
||||
"config:base",
|
||||
":semanticCommitsDisabled"
|
||||
],
|
||||
"labels": ["Renovate"],
|
||||
"rebaseWhen": "conflicted"
|
||||
"labels": ["dependencies"],
|
||||
"rebaseWhen": "conflicted",
|
||||
"schedule": ["on the first day of the week"]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user