Update to 1.20.4

This commit is contained in:
Len 2024-01-05 19:15:43 +01:00
parent d26c6a8082
commit fc816340d5
6 changed files with 989 additions and 988 deletions

View File

@ -8,7 +8,7 @@ plugins {
}
repositories {
mavenLocal()
// mavenLocal()
maven {
url = uri("https://papermc.io/repo/repository/maven-public/")
}
@ -39,7 +39,7 @@ repositories {
}
dependencies {
compileOnly("com.alttd:Galaxy-API:1.18.2-R0.1-SNAPSHOT")
compileOnly("com.alttd:Galaxy-API:1.20.4-R0.1-SNAPSHOT")
compileOnly("de.keyle:mypet:3.11-SNAPSHOT")
compileOnly("com.github.NeumimTo:Pl3xMap:1.18-2")
testImplementation("org.junit.jupiter:junit-jupiter:5.7.0")
@ -51,7 +51,7 @@ dependencies {
group = "com.griefprevention"
version = "16.18-RC2-SNAPSHOT"
description = "GriefPrevention"
java.sourceCompatibility = JavaVersion.VERSION_16
java.sourceCompatibility = JavaVersion.VERSION_17
publishing {
publications.create<MavenPublication>("maven") {

View File

@ -411,7 +411,7 @@ public class BlockEventHandler implements Listener
else if (Tag.SAPLINGS.isTagged(block.getType()) && GriefPrevention.instance.config_blockSkyTrees && GriefPrevention.instance.claimsEnabledForWorld(player.getWorld()))
{
Block earthBlock = placeEvent.getBlockAgainst();
if (earthBlock.getType() != Material.GRASS)
if (earthBlock.getType() != Material.SHORT_GRASS)
{
if (earthBlock.getRelative(BlockFace.DOWN).getType() == Material.AIR ||
earthBlock.getRelative(BlockFace.DOWN).getRelative(BlockFace.DOWN).getType() == Material.AIR)

View File

@ -3239,26 +3239,26 @@ public class GriefPrevention extends JavaPlugin
return true;
}
static void banPlayer(Player player, String reason, String source)
{
if (GriefPrevention.instance.config_ban_useCommand)
{
Bukkit.getServer().dispatchCommand(
Bukkit.getConsoleSender(),
GriefPrevention.instance.config_ban_commandFormat.replace("%name%", player.getName()).replace("%reason%", reason));
}
else
{
BanList bans = Bukkit.getServer().getBanList(Type.NAME);
bans.addBan(player.getName(), reason, null, source);
//kick
if (player.isOnline())
{
player.kickPlayer(reason);
}
}
}
// static void banPlayer(Player player, String reason, String source)
// {
// if (GriefPrevention.instance.config_ban_useCommand)
// {
// Bukkit.getServer().dispatchCommand(
// Bukkit.getConsoleSender(),
// GriefPrevention.instance.config_ban_commandFormat.replace("%name%", player.getName()).replace("%reason%", reason));
// }
// else
// {
// BanList bans = Bukkit.getServer().getBanList(Type.NAME);
// bans.addBan(player.getName(), reason, null, source);
//
// //kick
// if (player.isOnline())
// {
// player.kickPlayer(reason);
// }
// }
// }
public ItemStack getItemInHand(Player player, EquipmentSlot hand)
{

View File

@ -1560,7 +1560,7 @@ class PlayerEventHandler implements Listener
}
else
{
allowedFillBlocks.add(Material.GRASS);
allowedFillBlocks.add(Material.SHORT_GRASS);
allowedFillBlocks.add(Material.DIRT);
allowedFillBlocks.add(Material.STONE);
allowedFillBlocks.add(Material.SAND);
@ -1624,7 +1624,7 @@ class PlayerEventHandler implements Listener
}
//only replace air, spilling water, snow, long grass
if (block.getType() == Material.AIR || block.getType() == Material.SNOW || (block.getType() == Material.WATER && ((Levelled) block.getBlockData()).getLevel() != 0) || block.getType() == Material.GRASS)
if (block.getType() == Material.AIR || block.getType() == Material.SNOW || (block.getType() == Material.WATER && ((Levelled) block.getBlockData()).getLevel() != 0) || block.getType() == Material.SHORT_GRASS)
{
//if the top level, always use the default filler picked above
if (y == maxHeight)
@ -2066,7 +2066,7 @@ class PlayerEventHandler implements Listener
Material type = result.getType();
if (type != Material.AIR &&
(!passThroughWater || type != Material.WATER) &&
type != Material.GRASS &&
type != Material.SHORT_GRASS &&
type != Material.SNOW) return result;
}

View File

@ -61,7 +61,8 @@ class PlayerKickBanTask implements Runnable
if (this.ban)
{
//ban
GriefPrevention.banPlayer(this.player, this.reason, this.source);
// GriefPrevention.banPlayer(this.player, this.reason, this.source);
this.player.kickPlayer(this.reason);
}
else if (this.player.isOnline())
{

View File

@ -95,7 +95,7 @@ class RestoreNatureProcessingTask implements Runnable
this.notAllowedToHang = EnumSet.noneOf(Material.class);
this.notAllowedToHang.add(Material.DIRT);
this.notAllowedToHang.add(Material.GRASS);
this.notAllowedToHang.add(Material.SHORT_GRASS);
this.notAllowedToHang.add(Material.SNOW);
this.notAllowedToHang.add(Material.OAK_LOG);
this.notAllowedToHang.add(Material.SPRUCE_LOG);
@ -106,7 +106,7 @@ class RestoreNatureProcessingTask implements Runnable
if (this.aggressiveMode)
{
this.notAllowedToHang.add(Material.GRASS);
this.notAllowedToHang.add(Material.SHORT_GRASS);
this.notAllowedToHang.add(Material.STONE);
}
@ -395,7 +395,7 @@ class RestoreNatureProcessingTask implements Runnable
Material[] excludedBlocksArray = new Material[]
{
Material.CACTUS,
Material.GRASS,
Material.SHORT_GRASS,
Material.RED_MUSHROOM,
Material.BROWN_MUSHROOM,
Material.DEAD_BUSH,
@ -483,10 +483,10 @@ class RestoreNatureProcessingTask implements Runnable
fillableBlocks.add(Material.AIR);
fillableBlocks.add(Material.WATER);
fillableBlocks.add(Material.LAVA);
fillableBlocks.add(Material.GRASS);
fillableBlocks.add(Material.SHORT_GRASS);
ArrayList<Material> notSuitableForFillBlocks = new ArrayList<>();
notSuitableForFillBlocks.add(Material.GRASS);
notSuitableForFillBlocks.add(Material.SHORT_GRASS);
notSuitableForFillBlocks.add(Material.CACTUS);
notSuitableForFillBlocks.add(Material.WATER);
notSuitableForFillBlocks.add(Material.LAVA);