From 49e1dadf942813e6408082f0d2616b817af28546 Mon Sep 17 00:00:00 2001 From: Len <40720638+destro174@users.noreply.github.com> Date: Sat, 20 Jul 2024 16:54:10 +0200 Subject: [PATCH] Update and changes for 1.21 --- build.gradle.kts | 4 +- chat/index.html | 38 ------------------- gradle/wrapper/gradle-wrapper.properties | 2 +- .../GriefPrevention/EntityEventHandler.java | 30 +++++++-------- src/main/resources/plugin.yml | 2 +- 5 files changed, 19 insertions(+), 57 deletions(-) delete mode 100644 chat/index.html diff --git a/build.gradle.kts b/build.gradle.kts index 26548b0..c2122e3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -39,7 +39,7 @@ repositories { } dependencies { - compileOnly("com.alttd:Galaxy-API:1.20.4-R0.1-SNAPSHOT") + compileOnly("com.alttd:Galaxy-API:1.21-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_17 +java.sourceCompatibility = JavaVersion.VERSION_21 publishing { publications.create("maven") { diff --git a/chat/index.html b/chat/index.html deleted file mode 100644 index c09df0f..0000000 --- a/chat/index.html +++ /dev/null @@ -1,38 +0,0 @@ - - - - GriefPrevention Chatroom - - - - - -
-

GriefPrevention Chat

-

Before proceeding, try searching the Docs or Discussions for your question.

- No need to wait for a response before asking; simply state your question and then wait patiently for a response. This is an idle chatroom - think of this like email instead of a phone conversation.
-
- Chat window not appearing? Click here to open in a separate tab.
- Or join with your own IRC client. Server: irc.spi.gt Channel: #GriefPrevention
-
- Want chat history? Consider using IRCCloud or a free bouncer service. Chat logs are also available, see the channel topic.
- Yes, GriefPrevention has an official discord channel. -
- - diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 84d1f85..a595206 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/EntityEventHandler.java b/src/main/java/me/ryanhamshire/GriefPrevention/EntityEventHandler.java index a52aa05..611f561 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/EntityEventHandler.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/EntityEventHandler.java @@ -336,7 +336,7 @@ public class EntityEventHandler implements Listener @EventHandler(ignoreCancelled = true) void onTNTExitPortal(EntityPortalExitEvent event) { - if (event.getEntityType() != EntityType.PRIMED_TNT) + if (event.getEntityType() != EntityType.TNT) return; if (event.getTo().getWorld().getEnvironment() != Environment.THE_END) return; @@ -694,7 +694,7 @@ public class EntityEventHandler implements Listener if (event.getEntity() instanceof Mule && !GriefPrevention.instance.config_claims_protectDonkeys) return; if (event.getEntity() instanceof Llama && !GriefPrevention.instance.config_claims_protectLlamas) return; //protected death loot can't be destroyed, only picked up or despawned due to expiration - if (event.getEntityType() == EntityType.DROPPED_ITEM) + if (event.getEntityType() == EntityType.ITEM) { if (event.getEntity().hasMetadata("GP_ITEMOWNER")) { @@ -943,7 +943,7 @@ public class EntityEventHandler implements Listener || subEvent.getEntityType() == EntityType.GLOW_ITEM_FRAME || subEvent.getEntityType() == EntityType.ARMOR_STAND || subEvent.getEntityType() == EntityType.VILLAGER - || subEvent.getEntityType() == EntityType.ENDER_CRYSTAL) + || subEvent.getEntityType() == EntityType.END_CRYSTAL) { //allow for disabling villager protections in the config if (subEvent.getEntityType() == EntityType.VILLAGER && !GriefPrevention.instance.config_claims_protectCreatures) @@ -1071,7 +1071,7 @@ public class EntityEventHandler implements Listener && damageSource != null && damageSource.getType() != EntityType.CREEPER && damageSource.getType() != EntityType.WITHER - && damageSource.getType() != EntityType.ENDER_CRYSTAL + && damageSource.getType() != EntityType.END_CRYSTAL && damageSource.getType() != EntityType.AREA_EFFECT_CLOUD && damageSource.getType() != EntityType.WITCH && !(damageSource instanceof Projectile) @@ -1136,7 +1136,7 @@ public class EntityEventHandler implements Listener //kill the arrow to avoid infinite bounce between crowded together animals //RoboMWM: except for tridents if (arrow != null && arrow.getType() != EntityType.TRIDENT) arrow.remove(); - if (damageSource != null && damageSource.getType() == EntityType.FIREWORK && event.getEntity().getType() != EntityType.PLAYER) + if (damageSource != null && damageSource.getType() == EntityType.FIREWORK_ROCKET && event.getEntity().getType() != EntityType.PLAYER) return; try { @@ -1317,7 +1317,7 @@ public class EntityEventHandler implements Listener } //if not a player and not an explosion, always allow - if (attacker == null && damageSourceType != EntityType.CREEPER && damageSourceType != EntityType.WITHER && damageSourceType != EntityType.PRIMED_TNT) + if (attacker == null && damageSourceType != EntityType.CREEPER && damageSourceType != EntityType.WITHER && damageSourceType != EntityType.TNT) { return; } @@ -1405,9 +1405,9 @@ public class EntityEventHandler implements Listener // Restrict some potions on claimed villagers and animals. // Griefers could use potions to kill entities or steal them over fences. - if (PotionEffectType.HARM.equals(effectType) + if (PotionEffectType.INSTANT_DAMAGE.equals(effectType) || PotionEffectType.POISON.equals(effectType) - || PotionEffectType.JUMP.equals(effectType) + || PotionEffectType.JUMP_BOOST.equals(effectType) || PotionEffectType.WITHER.equals(effectType)) { Claim cachedClaim = null; @@ -1528,9 +1528,9 @@ public class EntityEventHandler implements Listener // Restrict some potions on claimed villagers and animals. // Griefers could use potions to kill entities or steal them over fences. - if (PotionEffectType.HARM.equals(effectType) + if (PotionEffectType.INSTANT_DAMAGE.equals(effectType) || PotionEffectType.POISON.equals(effectType) - || PotionEffectType.JUMP.equals(effectType) + || PotionEffectType.JUMP_BOOST.equals(effectType) || PotionEffectType.WITHER.equals(effectType)) { Claim cachedClaim = null; @@ -1581,14 +1581,14 @@ public class EntityEventHandler implements Listener public static final HashSet positiveEffects = new HashSet<>(Arrays.asList ( PotionEffectType.ABSORPTION, - PotionEffectType.DAMAGE_RESISTANCE, - PotionEffectType.FAST_DIGGING, + PotionEffectType.RESISTANCE, + PotionEffectType.HASTE, PotionEffectType.FIRE_RESISTANCE, - PotionEffectType.HEAL, + PotionEffectType.REGENERATION, PotionEffectType.HEALTH_BOOST, - PotionEffectType.INCREASE_DAMAGE, + PotionEffectType.STRENGTH, PotionEffectType.INVISIBILITY, - PotionEffectType.JUMP, + PotionEffectType.JUMP_BOOST, PotionEffectType.NIGHT_VISION, PotionEffectType.REGENERATION, PotionEffectType.SATURATION, diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 58c7024..d2466b2 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -4,7 +4,7 @@ softdepend: [Vault, Multiverse-Core, My_Worlds, MystCraft, Transporter, TheUnder dev-url: https://dev.bukkit.org/projects/grief-prevention loadbefore: [TheUnderground] version: '${git.commit.id.describe}' -api-version: '1.17' +api-version: '1.21' commands: abandonclaim: description: Deletes a claim.