mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-09 00:54:44 +02:00
Compare commits
7 Commits
docs/v6/up
...
renovate/a
Author | SHA1 | Date | |
---|---|---|---|
d3a9872dd5 | |||
0a32268784 | |||
ae3b8c06f6 | |||
713c4ad0d2 | |||
48386c0828 | |||
625b3921e1 | |||
48aa37d173 |
@ -97,7 +97,7 @@ tasks.named<ShadowJar>("shadowJar") {
|
|||||||
tasks {
|
tasks {
|
||||||
withType<Javadoc> {
|
withType<Javadoc> {
|
||||||
val opt = options as StandardJavadocDocletOptions
|
val opt = options as StandardJavadocDocletOptions
|
||||||
opt.links("https://papermc.io/javadocs/paper/1.18/")
|
opt.links("https://jd.papermc.io/paper/1.18/")
|
||||||
opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-bukkit/" + libs.worldeditBukkit.get().versionConstraint.toString())
|
opt.links("https://docs.enginehub.org/javadoc/com.sk89q.worldedit/worldedit-bukkit/" + libs.worldeditBukkit.get().versionConstraint.toString())
|
||||||
opt.links("https://javadoc.io/doc/com.plotsquared/PlotSquared-Core/latest/")
|
opt.links("https://javadoc.io/doc/com.plotsquared/PlotSquared-Core/latest/")
|
||||||
opt.links("https://jd.adventure.kyori.net/api/" + libs.adventure.get().versionConstraint.toString())
|
opt.links("https://jd.adventure.kyori.net/api/" + libs.adventure.get().versionConstraint.toString())
|
||||||
|
@ -551,6 +551,10 @@ public class BlockEventListener implements Listener {
|
|||||||
if (plot == null) {
|
if (plot == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (location.getY() >= area.getMaxBuildHeight() || location.getY() < area.getMinBuildHeight()) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
switch (event.getNewState().getType()) {
|
switch (event.getNewState().getType()) {
|
||||||
case SNOW:
|
case SNOW:
|
||||||
case SNOW_BLOCK:
|
case SNOW_BLOCK:
|
||||||
@ -750,62 +754,66 @@ public class BlockEventListener implements Listener {
|
|||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||||
public void onChange(BlockFromToEvent event) {
|
public void onChange(BlockFromToEvent event) {
|
||||||
Block from = event.getBlock();
|
Block fromBlock = event.getBlock();
|
||||||
|
|
||||||
// Check liquid flow flag inside of origin plot too
|
// Check liquid flow flag inside of origin plot too
|
||||||
final Location fLocation = BukkitUtil.adapt(from.getLocation());
|
final Location fromLocation = BukkitUtil.adapt(fromBlock.getLocation());
|
||||||
final PlotArea fromArea = fLocation.getPlotArea();
|
final PlotArea fromArea = fromLocation.getPlotArea();
|
||||||
if (fromArea != null) {
|
if (fromArea != null) {
|
||||||
final Plot plot = fromArea.getOwnedPlot(fLocation);
|
final Plot fromPlot = fromArea.getOwnedPlot(fromLocation);
|
||||||
if (plot != null && plot.getFlag(LiquidFlowFlag.class) == LiquidFlowFlag.FlowStatus.DISABLED && event
|
if (fromPlot != null && fromPlot.getFlag(LiquidFlowFlag.class) == LiquidFlowFlag.FlowStatus.DISABLED && event
|
||||||
.getBlock()
|
.getBlock()
|
||||||
.isLiquid()) {
|
.isLiquid()) {
|
||||||
plot.debug("Liquid could not flow because liquid-flow = disabled");
|
fromPlot.debug("Liquid could not flow because liquid-flow = disabled");
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Block to = event.getToBlock();
|
Block toBlock = event.getToBlock();
|
||||||
Location tLocation = BukkitUtil.adapt(to.getLocation());
|
Location toLocation = BukkitUtil.adapt(toBlock.getLocation());
|
||||||
PlotArea area = tLocation.getPlotArea();
|
PlotArea toArea = toLocation.getPlotArea();
|
||||||
if (area == null) {
|
if (toArea == null) {
|
||||||
if (from.getType() == Material.DRAGON_EGG && fromArea != null) {
|
if (fromBlock.getType() == Material.DRAGON_EGG && fromArea != null) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Plot plot = area.getOwnedPlot(tLocation);
|
if (toLocation.getY() >= toArea.getMaxBuildHeight() || toLocation.getY() < toArea.getMinBuildHeight()) {
|
||||||
|
event.setCancelled(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Plot toPlot = toArea.getOwnedPlot(toLocation);
|
||||||
|
|
||||||
if (from.getType() == Material.DRAGON_EGG && fromArea != null) {
|
if (fromBlock.getType() == Material.DRAGON_EGG && fromArea != null) {
|
||||||
final Plot fromPlot = fromArea.getOwnedPlot(fLocation);
|
final Plot fromPlot = fromArea.getOwnedPlot(fromLocation);
|
||||||
|
|
||||||
if (fromPlot != null || plot != null) {
|
if (fromPlot != null || toPlot != null) {
|
||||||
if ((fromPlot == null || !fromPlot.equals(plot)) && (plot == null || !plot.equals(fromPlot))) {
|
if ((fromPlot == null || !fromPlot.equals(toPlot)) && (toPlot == null || !toPlot.equals(fromPlot))) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plot != null) {
|
if (toPlot != null) {
|
||||||
if (!area.contains(fLocation.getX(), fLocation.getZ()) || !Objects.equals(plot, area.getOwnedPlot(fLocation))) {
|
if (!toArea.contains(fromLocation.getX(), fromLocation.getZ()) || !Objects.equals(toPlot, toArea.getOwnedPlot(fromLocation))) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (plot.getFlag(LiquidFlowFlag.class) == LiquidFlowFlag.FlowStatus.ENABLED && event.getBlock().isLiquid()) {
|
if (toPlot.getFlag(LiquidFlowFlag.class) == LiquidFlowFlag.FlowStatus.ENABLED && event.getBlock().isLiquid()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (plot.getFlag(DisablePhysicsFlag.class)) {
|
if (toPlot.getFlag(DisablePhysicsFlag.class)) {
|
||||||
plot.debug(event.getBlock().getType() + " could not update because disable-physics = true");
|
toPlot.debug(event.getBlock().getType() + " could not update because disable-physics = true");
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (plot.getFlag(LiquidFlowFlag.class) == LiquidFlowFlag.FlowStatus.DISABLED && event.getBlock().isLiquid()) {
|
if (toPlot.getFlag(LiquidFlowFlag.class) == LiquidFlowFlag.FlowStatus.DISABLED && event.getBlock().isLiquid()) {
|
||||||
plot.debug("Liquid could not flow because liquid-flow = disabled");
|
toPlot.debug("Liquid could not flow because liquid-flow = disabled");
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
} else if (!area.contains(fLocation.getX(), fLocation.getZ()) || !Objects.equals(null, area.getOwnedPlot(fLocation))) {
|
} else if (!toArea.contains(fromLocation.getX(), fromLocation.getZ()) || !Objects.equals(null, toArea.getOwnedPlot(fromLocation))) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
} else if (event.getBlock().isLiquid()) {
|
} else if (event.getBlock().isLiquid()) {
|
||||||
final org.bukkit.Location location = event.getBlock().getLocation();
|
final org.bukkit.Location location = event.getBlock().getLocation();
|
||||||
|
@ -18,7 +18,7 @@ plugins {
|
|||||||
idea
|
idea
|
||||||
}
|
}
|
||||||
|
|
||||||
version = "6.8.1-SNAPSHOT"
|
version = "6.8.2-SNAPSHOT"
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
group = "com.plotsquared"
|
group = "com.plotsquared"
|
||||||
@ -66,7 +66,6 @@ subprojects {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val javadocDir = rootDir.resolve("docs").resolve("javadoc").resolve(project.name)
|
|
||||||
allprojects {
|
allprojects {
|
||||||
dependencies {
|
dependencies {
|
||||||
// Tests
|
// Tests
|
||||||
@ -172,11 +171,6 @@ allprojects {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
named<Delete>("clean") {
|
|
||||||
doFirst {
|
|
||||||
javadocDir.deleteRecursively()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
compileJava {
|
compileJava {
|
||||||
options.compilerArgs.addAll(arrayOf("-Xmaxerrs", "1000"))
|
options.compilerArgs.addAll(arrayOf("-Xmaxerrs", "1000"))
|
||||||
@ -187,16 +181,6 @@ allprojects {
|
|||||||
options.encoding = "UTF-8"
|
options.encoding = "UTF-8"
|
||||||
}
|
}
|
||||||
|
|
||||||
javadoc {
|
|
||||||
val opt = options as StandardJavadocDocletOptions
|
|
||||||
opt.addStringOption("Xdoclint:none", "-quiet")
|
|
||||||
opt.tags(
|
|
||||||
"apiNote:a:API Note:",
|
|
||||||
"implSpec:a:Implementation Requirements:",
|
|
||||||
"implNote:a:Implementation Note:"
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
shadowJar {
|
shadowJar {
|
||||||
this.archiveClassifier.set(null as String?)
|
this.archiveClassifier.set(null as String?)
|
||||||
this.archiveFileName.set("${project.name}-${project.version}.${this.archiveExtension.getOrElse("jar")}")
|
this.archiveFileName.set("${project.name}-${project.version}.${this.archiveExtension.getOrElse("jar")}")
|
||||||
@ -221,37 +205,3 @@ nexusPublishing {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
|
||||||
val aggregatedJavadocs = create<Javadoc>("aggregatedJavadocs") {
|
|
||||||
title = "${project.name} ${project.version} API"
|
|
||||||
setDestinationDir(javadocDir)
|
|
||||||
options.destinationDirectory = javadocDir
|
|
||||||
|
|
||||||
doFirst {
|
|
||||||
javadocDir.deleteRecursively()
|
|
||||||
}
|
|
||||||
}.also {
|
|
||||||
it.group = "Documentation"
|
|
||||||
it.description = "Generate javadocs from all child projects as if it was a single project"
|
|
||||||
}
|
|
||||||
|
|
||||||
subprojects.forEach { subProject ->
|
|
||||||
subProject.afterEvaluate {
|
|
||||||
subProject.tasks.withType<Javadoc>().forEach { task ->
|
|
||||||
aggregatedJavadocs.source += task.source
|
|
||||||
aggregatedJavadocs.classpath += task.classpath
|
|
||||||
aggregatedJavadocs.excludes += task.excludes
|
|
||||||
aggregatedJavadocs.includes += task.includes
|
|
||||||
|
|
||||||
val rootOptions = aggregatedJavadocs.options as StandardJavadocDocletOptions
|
|
||||||
val subOptions = task.options as StandardJavadocDocletOptions
|
|
||||||
rootOptions.links(*subOptions.links.orEmpty().minus(rootOptions.links.orEmpty().toSet()).toTypedArray())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
build {
|
|
||||||
dependsOn(aggregatedJavadocs)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -12,7 +12,7 @@ spotbugs = "4.7.0"
|
|||||||
snakeyaml = "1.30" # Version set by Bukkit
|
snakeyaml = "1.30" # Version set by Bukkit
|
||||||
|
|
||||||
# Adventure & MiniMessage
|
# Adventure & MiniMessage
|
||||||
adventure-api = "4.9.3"
|
adventure-api = "4.11.0"
|
||||||
adventure-text-minimessage = "4.1.0-SNAPSHOT"
|
adventure-text-minimessage = "4.1.0-SNAPSHOT"
|
||||||
adventure-platform-bukkit = "4.0.1"
|
adventure-platform-bukkit = "4.0.1"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user