1
0
mirror of https://github.com/Zrips/Jobs.git synced 2025-01-30 03:51:53 +01:00
This commit is contained in:
Zrips 2023-08-30 11:52:09 +03:00
parent 5667544626
commit f1eb7e5395
4 changed files with 41 additions and 35 deletions

View File

@ -94,10 +94,10 @@ import com.gamingmesh.jobs.economy.PaymentData;
import com.gamingmesh.jobs.hooks.HookManager;
import com.gamingmesh.jobs.i18n.Language;
import com.gamingmesh.jobs.listeners.JobsListener;
import com.gamingmesh.jobs.listeners.JobsPayment14Listener;
import com.gamingmesh.jobs.listeners.JobsPayment1_14Listener;
import com.gamingmesh.jobs.listeners.JobsPaymentListener;
import com.gamingmesh.jobs.listeners.PistonProtectionListener;
import com.gamingmesh.jobs.listeners.JobsPayment16Listener;
import com.gamingmesh.jobs.listeners.JobsPayment1_16Listener;
import com.gamingmesh.jobs.listeners.PlayerSignEdit1_20Listeners;
import com.gamingmesh.jobs.selection.SelectionManager;
import com.gamingmesh.jobs.stuff.Loging;
@ -794,10 +794,10 @@ public final class Jobs extends JavaPlugin {
pm.registerEvents(new JobsListener(getInstance()), getInstance());
pm.registerEvents(new JobsPaymentListener(getInstance()), getInstance());
if (Version.isCurrentEqualOrHigher(Version.v1_14_R1)) {
pm.registerEvents(new JobsPayment14Listener(), getInstance());
pm.registerEvents(new JobsPayment1_14Listener(), getInstance());
}
if (Version.isCurrentEqualOrHigher(Version.v1_16_R3)) {
pm.registerEvents(new JobsPayment16Listener(), getInstance());
pm.registerEvents(new JobsPayment1_16Listener(), getInstance());
}
if (Version.isCurrentEqualOrHigher(Version.v1_20_R1)) {

View File

@ -18,52 +18,58 @@
package com.gamingmesh.jobs.container;
import net.Zrips.CMILib.Container.CMIText;
public enum ActionType {
BREAK("Break"),
BREAK(),
STRIPLOGS("StripLogs"),
TNTBREAK("TNTBreak"),
PLACE("Place"),
KILL("Kill"),
PLACE(),
KILL(),
MMKILL("MMKill"),
FISH("Fish"),
CRAFT("Craft"),
FISH(),
CRAFT(),
VTRADE("VTrade"),
SMELT("Smelt"),
BREW("Brew"),
ENCHANT("Enchant"),
REPAIR("Repair"),
BREED("Breed"),
TAME("Tame"),
DYE("Dye"),
SHEAR("Shear"),
MILK("Milk"),
EXPLORE("Explore"),
EAT("Eat"),
SMELT(),
BREW(),
ENCHANT(),
REPAIR(),
BREED(),
TAME(),
DYE(),
SHEAR(),
MILK(),
EXPLORE(),
EAT(),
CUSTOMKILL("custom-kill"),
COLLECT("Collect"),
BAKE("Bake"),
BUCKET("Bucket");
COLLECT(),
BAKE(),
BUCKET();
private String name;
ActionType(String name) {
this.name = name;
this.name = name;
}
ActionType() {
this.name = CMIText.firstToUpperCase(this.toString());
}
public String getName() {
return name;
return name;
}
public static ActionType getByName(String name) {
if (name != null) {
name = name.replace("_", "");
if (name != null) {
name = name.replace("_", "");
for (ActionType one : ActionType.values()) {
if (one.name.equalsIgnoreCase(name))
return one;
}
}
for (ActionType one : ActionType.values()) {
if (one.name.equalsIgnoreCase(name))
return one;
}
}
return null;
return null;
}
}

View File

@ -24,7 +24,7 @@ import com.gamingmesh.jobs.actions.ItemActionInfo;
import com.gamingmesh.jobs.container.ActionType;
import com.gamingmesh.jobs.container.PlayerCamp;
public final class JobsPayment14Listener implements Listener {
public final class JobsPayment1_14Listener implements Listener {
// BlockCookEvent does not have "cooking owner"
private final Map<UUID, List<PlayerCamp>> campPlayers = new HashMap<>();

View File

@ -10,7 +10,7 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerBucketEntityEvent;
public class JobsPayment16Listener implements Listener {
public class JobsPayment1_16Listener implements Listener {
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onEntityBucketed(PlayerBucketEntityEvent event) {
Player player = event.getPlayer();