1
0
mirror of https://github.com/Zrips/Jobs.git synced 2024-12-29 04:18:07 +01:00

Bamboo stripping support

This commit is contained in:
Zrips 2023-09-20 12:01:51 +03:00
parent 46a244417b
commit 157238b01e
2 changed files with 12 additions and 8 deletions

View File

@ -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);
}

View File

@ -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);
}
}