forked from kaboomserver/extras
Update Paper API to 1.19.4 & limit commandModificationBlockLimit gamerule
This commit is contained in:
parent
4d0d1bb69b
commit
d0246790cb
2 changed files with 5 additions and 4 deletions
2
pom.xml
2
pom.xml
|
@ -15,7 +15,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.papermc.paper</groupId>
|
<groupId>io.papermc.paper</groupId>
|
||||||
<artifactId>paper-api</artifactId>
|
<artifactId>paper-api</artifactId>
|
||||||
<version>1.18.2-R0.1-SNAPSHOT</version>
|
<version>1.19.4-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
package pw.kaboom.extras.modules.server;
|
package pw.kaboom.extras.modules.server;
|
||||||
|
|
||||||
|
import io.papermc.paper.event.world.WorldGameRuleChangeEvent;
|
||||||
import org.bukkit.GameRule;
|
import org.bukkit.GameRule;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
|
||||||
import io.papermc.paper.event.world.WorldGameRuleChangeEvent;
|
|
||||||
|
|
||||||
public final class ServerGameRule implements Listener {
|
public final class ServerGameRule implements Listener {
|
||||||
@EventHandler
|
@EventHandler
|
||||||
void onGameRuleChange(final WorldGameRuleChangeEvent event) {
|
void onGameRuleChange(final WorldGameRuleChangeEvent event) {
|
||||||
|
@ -14,7 +13,9 @@ public final class ServerGameRule implements Listener {
|
||||||
if ((gameRule == GameRule.RANDOM_TICK_SPEED
|
if ((gameRule == GameRule.RANDOM_TICK_SPEED
|
||||||
&& Integer.parseInt(event.getValue()) > 6)
|
&& Integer.parseInt(event.getValue()) > 6)
|
||||||
|| (event.getGameRule() == GameRule.SPAWN_RADIUS
|
|| (event.getGameRule() == GameRule.SPAWN_RADIUS
|
||||||
&& Integer.parseInt(event.getValue()) > 100)) {
|
&& Integer.parseInt(event.getValue()) > 100)
|
||||||
|
|| (event.getGameRule() == GameRule.COMMAND_MODIFICATION_BLOCK_LIMIT
|
||||||
|
&& Integer.parseInt(event.getValue()) > 32768)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue