From 157238b01e16b8e422437ac373f819bd0fbea13a Mon Sep 17 00:00:00 2001 From: Zrips Date: Wed, 20 Sep 2023 12:01:51 +0300 Subject: [PATCH] Bamboo stripping support --- .../com/gamingmesh/jobs/commands/list/archive.java | 12 ++++++------ .../jobs/listeners/JobsPaymentListener.java | 8 ++++++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/commands/list/archive.java b/src/main/java/com/gamingmesh/jobs/commands/list/archive.java index 5f8dc616..271e9af6 100644 --- a/src/main/java/com/gamingmesh/jobs/commands/list/archive.java +++ b/src/main/java/com/gamingmesh/jobs/commands/list/archive.java @@ -2,7 +2,6 @@ package com.gamingmesh.jobs.commands.list; import java.util.Set; -import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; @@ -12,6 +11,7 @@ import com.gamingmesh.jobs.container.JobProgression; import com.gamingmesh.jobs.container.JobsPlayer; import com.gamingmesh.jobs.i18n.Language; +import net.Zrips.CMILib.Colors.CMIChatColor; import net.Zrips.CMILib.RawMessages.RawMessage; public class archive implements Cmd { @@ -45,12 +45,12 @@ public class archive implements Cmd { for (JobProgression jobInfo : allJobs) { RawMessage rm = new RawMessage(); if (jobInfo.canRejoin()) - rm.addText(ChatColor.GREEN + "+" + Jobs.getCommandManager().jobStatsMessageArchive(jPlayer, jobInfo)) - .addHover(Jobs.getLanguage().getMessage("command.join.rejoin")).addCommand("jobs join " + jobInfo.getJob().getName()); + rm.addText(CMIChatColor.GREEN + "+" + Jobs.getCommandManager().jobStatsMessageArchive(jPlayer, jobInfo)) + .addHover(Jobs.getLanguage().getMessage("command.join.rejoin")) + .addCommand("jobs join " + jobInfo.getJob().getName()); else - rm.addText(ChatColor.RED + "-" + Jobs.getCommandManager().jobStatsMessageArchive(jPlayer, jobInfo)) - .addHover(Jobs.getLanguage().getMessage("command.join.error.rejoin", "[time]", jobInfo - .getRejoinTimeMessage())); + rm.addText(CMIChatColor.RED + "-" + Jobs.getCommandManager().jobStatsMessageArchive(jPlayer, jobInfo)) + .addHover(Jobs.getLanguage().getMessage("command.join.error.rejoin", "[time]", jobInfo.getRejoinTimeMessage())); rm.show(sender); } diff --git a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java index 680c4c6f..95abfd53 100644 --- a/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java +++ b/src/main/java/com/gamingmesh/jobs/listeners/JobsPaymentListener.java @@ -1841,8 +1841,12 @@ public final class JobsPaymentListener implements Listener { // either it's version 1.13+ and we're trying to strip a normal log like oak, // or it's 1.16+ and we're trying to strip a fungi like warped stem - if ((Version.isCurrentEqualOrHigher(Version.v1_13_R1) && (block.getType().toString().endsWith("_LOG") || block.getType().toString().endsWith("_WOOD"))) || - (Version.isCurrentEqualOrHigher(Version.v1_16_R1) && (block.getType().toString().endsWith("_STEM") || block.getType().toString().endsWith("_HYPHAE")))) { + + String type = block.getType().toString(); + + if ((Version.isCurrentEqualOrHigher(Version.v1_13_R1) && (type.endsWith("_LOG") || type.endsWith("_WOOD"))) || + (Version.isCurrentEqualOrHigher(Version.v1_16_R1) && (type.endsWith("_STEM") || type.endsWith("_HYPHAE"))) || + (Version.isCurrentEqualOrHigher(Version.v1_20_R1) && (type.equalsIgnoreCase("BAMBOO_BLOCK")))) { CMIScheduler.get().runTaskLater(() -> Jobs.action(jPlayer, new BlockActionInfo(block, ActionType.STRIPLOGS), block), 1); } }