Replace sendMiniMessage with sendRichMessage update to 1.21.10, fixed claimblock prices
This commit is contained in:
parent
e03851246e
commit
501de8128d
|
|
@ -1,6 +1,8 @@
|
|||
/*
|
||||
* This file was generated by the Gradle 'init' task.
|
||||
*/
|
||||
val nexusUser = providers.gradleProperty("alttdSnapshotUsername").orNull ?: System.getenv("NEXUS_USERNAME")
|
||||
val nexusPass = providers.gradleProperty("alttdSnapshotPassword").orNull ?: System.getenv("NEXUS_PASSWORD")
|
||||
|
||||
plugins {
|
||||
java
|
||||
|
|
@ -9,8 +11,10 @@ plugins {
|
|||
|
||||
repositories {
|
||||
// mavenLocal()
|
||||
|
||||
maven {
|
||||
url = uri("https://papermc.io/repo/repository/maven-public/")
|
||||
name = "userderezzedRepoSnapshots"
|
||||
url = uri("https://repo.userderezzed.dev/snapshots")
|
||||
}
|
||||
|
||||
maven {
|
||||
|
|
@ -26,7 +30,11 @@ repositories {
|
|||
}
|
||||
|
||||
maven {
|
||||
url = uri("https://repo.destro.xyz/snapshots")
|
||||
url = uri("https://repo.alttd.com/repository/alttd-snapshot/")
|
||||
credentials {
|
||||
username = nexusUser
|
||||
password = nexusPass
|
||||
}
|
||||
}
|
||||
|
||||
maven {
|
||||
|
|
@ -39,11 +47,11 @@ repositories {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly("com.alttd:Galaxy-API:1.21-R0.1-SNAPSHOT")
|
||||
compileOnly("de.keyle:mypet:3.11-SNAPSHOT")
|
||||
compileOnly("com.alttd.cosmos:cosmos-api:1.21.11-R0.1-SNAPSHOT")
|
||||
implementation("de.keyle:mypet-api:3.14.2-SNAPSHOT")
|
||||
compileOnly("com.github.NeumimTo:Pl3xMap:1.18-2")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter:5.7.0")
|
||||
compileOnly("com.sk89q.worldguard:worldguard-bukkit:7.0.4-SNAPSHOT")
|
||||
compileOnly("com.sk89q.worldguard:worldguard-bukkit:7.0.14")
|
||||
compileOnly("net.milkbowl.vault:VaultAPI:1.7")
|
||||
compileOnly("org.jetbrains:annotations:23.0.0")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -761,14 +761,14 @@ public class Claim
|
|||
if(!claim2.overlaps(claim)) continue;
|
||||
|
||||
if (claim2.isAdminClaim()) {
|
||||
player.sendMiniMessage(Config.claimNearAdminClaim, null);
|
||||
player.sendRichMessage(Config.claimNearAdminClaim);
|
||||
return false;
|
||||
}
|
||||
|
||||
Supplier<String> canClaimTrust = claim2.checkPermission(player, ClaimPermission.Claim, null);
|
||||
if (canClaimTrust == null) continue;
|
||||
|
||||
player.sendMiniMessage("<red>You can't claim this close to " + claim2.getOwnerName() + "'s claim.", null); // TODO placeholders
|
||||
player.sendRichMessage("<red>You can't claim this close to " + claim2.getOwnerName() + "'s claim."); // TODO placeholders
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -984,7 +984,7 @@ public abstract class DataStore
|
|||
if (creatingPlayer != null && !newClaim.isInsideBorder()) {
|
||||
result.succeeded = false;
|
||||
result.claim = null;
|
||||
creatingPlayer.sendMiniMessage(Config.claimCreatedOutsideBorder, null);
|
||||
creatingPlayer.sendRichMessage(Config.claimCreatedOutsideBorder);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@ import org.bukkit.OfflinePlayer;
|
|||
import org.bukkit.World;
|
||||
import org.bukkit.World.Environment;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.damage.DamageSource;
|
||||
import org.bukkit.damage.DamageType;
|
||||
import org.bukkit.entity.Animals;
|
||||
import org.bukkit.entity.Creature;
|
||||
import org.bukkit.entity.Donkey;
|
||||
|
|
|
|||
|
|
@ -1313,7 +1313,7 @@ public class GriefPrevention extends JavaPlugin
|
|||
}
|
||||
catch (DataStore.NoClaimblocksTransferException e)
|
||||
{
|
||||
player.sendMiniMessage("<red>target does have the claimblocks to claim this area.", null);
|
||||
player.sendRichMessage("<red>target does have the claimblocks to claim this area.");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -2497,7 +2497,7 @@ public class GriefPrevention extends JavaPlugin
|
|||
else if (cmd.getName().equalsIgnoreCase("kickfromclaim") && player != null)
|
||||
{
|
||||
if (args.length < 1) {
|
||||
player.sendMiniMessage(Config.PlayerNotSpecified, null); // todo placeholders.
|
||||
player.sendRichMessage(Config.PlayerNotSpecified); // todo placeholders.
|
||||
return true;
|
||||
}
|
||||
TagResolver placeholders = TagResolver.resolver(
|
||||
|
|
@ -2506,39 +2506,39 @@ public class GriefPrevention extends JavaPlugin
|
|||
);
|
||||
Player target = Bukkit.getPlayer(args[0]);
|
||||
if (target == null) {
|
||||
player.sendMiniMessage(Config.PlayerOffline, placeholders); // todo placeholders.
|
||||
player.sendRichMessage(Config.PlayerOffline, placeholders); // todo placeholders.
|
||||
return true;
|
||||
}
|
||||
if (player.equals(target)) {
|
||||
player.sendMiniMessage(Config.CannotKickSelf, null); // todo placeholders.
|
||||
player.sendRichMessage(Config.CannotKickSelf); // todo placeholders.
|
||||
return true;
|
||||
}
|
||||
Claim claim = this.dataStore.getClaimAt(target.getLocation(), true, null);
|
||||
if (claim == null || (claim.checkPermission(player, ClaimPermission.Manage, null) != null)) {
|
||||
player.sendMiniMessage(Config.TargetNotInClaim, placeholders); // todo placeholders.
|
||||
player.sendRichMessage(Config.TargetNotInClaim, placeholders); // todo placeholders.
|
||||
return true;
|
||||
}
|
||||
placeholders = TagResolver.resolver(placeholders, Placeholder.parsed("claim_owner", claim.getOwnerName()));
|
||||
SafeZone zone = new SafeZone(claim);
|
||||
if ((target.hasPermission("griefprevention.adminclaims") && claim.isAdminClaim()) || zone
|
||||
.hasTrust(target.getUniqueId())) {
|
||||
player.sendMiniMessage(Config.CannotKickTrustedTarget, placeholders); // todo placeholders.
|
||||
player.sendRichMessage(Config.CannotKickTrustedTarget, placeholders); // todo placeholders.
|
||||
return true;
|
||||
}
|
||||
if (target.hasPermission("griefprevention.kickfromclaimexempt")) {
|
||||
player.sendMiniMessage(Config.CannotKickExemptTarget, placeholders); // todo placeholders.
|
||||
player.sendRichMessage(Config.CannotKickExemptTarget, placeholders); // todo placeholders.
|
||||
return true;
|
||||
}
|
||||
zone.testForSafeSpot();
|
||||
Location safe = Bukkit.getWorlds().get(0).getSpawnLocation();
|
||||
if (safe == null) {
|
||||
player.sendMiniMessage(Config.NoSafeLocation, null); // todo placeholders.
|
||||
player.sendRichMessage(Config.NoSafeLocation); // todo placeholders.
|
||||
} else {
|
||||
if (target.isInsideVehicle()) target.leaveVehicle();
|
||||
target.teleport(safe);
|
||||
Bukkit.getPluginManager().callEvent(new PlayerTeleportEvent(target, safe, zone.getSafeArea()));
|
||||
player.sendMiniMessage(Config.KickSuccess, placeholders); // todo placeholders.
|
||||
target.sendMiniMessage(Config.KickedFromClaim, placeholders); // todo placeholders.
|
||||
player.sendRichMessage(Config.KickSuccess, placeholders); // todo placeholders.
|
||||
target.sendRichMessage(Config.KickedFromClaim, placeholders); // todo placeholders.
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -3330,8 +3330,8 @@ public class GriefPrevention extends JavaPlugin
|
|||
portalReturnTaskMap.put(player.getUniqueId(), task);
|
||||
}
|
||||
|
||||
private static final double[] xMult = {0, 10000, 50000, 300000, 1000000, Integer.MAX_VALUE};
|
||||
private static final double[] yMultBuy = {0.5, 0.75, 1, 2, 5};
|
||||
private static final double[] xMult = {0, 10000, 50000, 300000, Integer.MAX_VALUE};
|
||||
private static final double[] yMultBuy = {0.5, 0.75, 1, 2};
|
||||
private double claimBlockCost(int oldPoints, int transPts) {
|
||||
if (Config.claimBlockPrices.isEmpty())
|
||||
return transPts * GriefPrevention.instance.config_economy_claimBlocksPurchaseCost;
|
||||
|
|
|
|||
|
|
@ -480,7 +480,7 @@ class PlayerEventHandler implements Listener
|
|||
|
||||
//FEATURE: prevent players from using ender pearls to gain access to secured claims
|
||||
TeleportCause cause = event.getCause();
|
||||
if (cause == TeleportCause.CHORUS_FRUIT || (cause == TeleportCause.ENDER_PEARL && instance.config_claims_enderPearlsRequireAccessTrust))
|
||||
if (cause == TeleportCause.CONSUMABLE_EFFECT || (cause == TeleportCause.ENDER_PEARL && instance.config_claims_enderPearlsRequireAccessTrust))
|
||||
{
|
||||
Claim toClaim = this.dataStore.getClaimAt(event.getTo(), false, playerData.lastClaim);
|
||||
if (toClaim != null)
|
||||
|
|
|
|||
|
|
@ -823,7 +823,7 @@ class RestoreNatureProcessingTask implements Runnable
|
|||
playerBlocks.add(Material.NETHER_BRICK);
|
||||
playerBlocks.add(Material.MAGMA_BLOCK);
|
||||
playerBlocks.add(Material.ANCIENT_DEBRIS);
|
||||
playerBlocks.add(Material.CHAIN);
|
||||
playerBlocks.add(Material.IRON_CHAIN);
|
||||
playerBlocks.add(Material.SHROOMLIGHT);
|
||||
playerBlocks.add(Material.NETHER_GOLD_ORE);
|
||||
playerBlocks.add(Material.NETHER_SPROUTS);
|
||||
|
|
|
|||
|
|
@ -154,7 +154,6 @@ public class Config extends AbstractConfig {
|
|||
put("10001", .75);
|
||||
put("50001", 1.00);
|
||||
put("300001", 2.00);
|
||||
put("1000001", 5.00);
|
||||
}})
|
||||
.forEach((key, value) -> {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import me.ryanhamshire.GriefPrevention.GriefPrevention;
|
|||
import me.ryanhamshire.GriefPrevention.alttd.config.Config;
|
||||
import me.ryanhamshire.GriefPrevention.alttd.util.Utils;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.ComponentLike;
|
||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.Placeholder;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
||||
|
|
@ -48,6 +49,6 @@ public class IgnoreClaimWarningTask extends BukkitRunnable
|
|||
);
|
||||
Component component = MiniMessage.miniMessage().deserialize(Config.ignoreClaimWarningMessage, placeholders);
|
||||
Bukkit.broadcast(component, Config.ignoreClaimWarningPermission);
|
||||
player.sendMessage(component);
|
||||
player.sendMessage((ComponentLike) component);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user