mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-23 00:21:20 +01:00
Improved baking action doesn't pay enough when items are on another block
- Removed some deprecated methods
This commit is contained in:
parent
83377ddee0
commit
9e006ebe89
@ -28,12 +28,6 @@ import com.gamingmesh.jobs.Placeholders.NewPlaceholderAPIHook;
|
|||||||
import com.gamingmesh.jobs.Placeholders.Placeholder;
|
import com.gamingmesh.jobs.Placeholders.Placeholder;
|
||||||
import com.gamingmesh.jobs.Placeholders.PlaceholderAPIHook;
|
import com.gamingmesh.jobs.Placeholders.PlaceholderAPIHook;
|
||||||
import com.gamingmesh.jobs.hooks.HookManager;
|
import com.gamingmesh.jobs.hooks.HookManager;
|
||||||
import com.gamingmesh.jobs.hooks.McMMO.McMMOManager;
|
|
||||||
import com.gamingmesh.jobs.hooks.MyPet.MyPetManager;
|
|
||||||
import com.gamingmesh.jobs.hooks.MythicMobs.MythicMobInterface;
|
|
||||||
import com.gamingmesh.jobs.hooks.MythicMobs.MythicMobs2;
|
|
||||||
import com.gamingmesh.jobs.hooks.MythicMobs.MythicMobs4;
|
|
||||||
import com.gamingmesh.jobs.hooks.WorldGuard.WorldGuardManager;
|
|
||||||
import com.gamingmesh.jobs.Signs.SignUtil;
|
import com.gamingmesh.jobs.Signs.SignUtil;
|
||||||
import com.gamingmesh.jobs.api.JobsExpGainEvent;
|
import com.gamingmesh.jobs.api.JobsExpGainEvent;
|
||||||
import com.gamingmesh.jobs.api.JobsPrePaymentEvent;
|
import com.gamingmesh.jobs.api.JobsPrePaymentEvent;
|
||||||
@ -93,15 +87,6 @@ public class Jobs extends JavaPlugin {
|
|||||||
|
|
||||||
private static PistonProtectionListener PistonProtectionListener = null;
|
private static PistonProtectionListener PistonProtectionListener = null;
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
private static McMMOManager McMMOManager = null;
|
|
||||||
@Deprecated
|
|
||||||
private static MythicMobInterface MythicManager = null;
|
|
||||||
@Deprecated
|
|
||||||
private static MyPetManager myPetManager = null;
|
|
||||||
@Deprecated
|
|
||||||
private static WorldGuardManager worldGuardManager = null;
|
|
||||||
|
|
||||||
private static ConfigManager configManager = null;
|
private static ConfigManager configManager = null;
|
||||||
private static GeneralConfigManager GconfigManager = null;
|
private static GeneralConfigManager GconfigManager = null;
|
||||||
|
|
||||||
@ -136,28 +121,12 @@ public class Jobs extends JavaPlugin {
|
|||||||
|
|
||||||
private static PointsData pointsDatabase = null;
|
private static PointsData pointsDatabase = null;
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public static McMMOManager getMcMMOManager() {
|
|
||||||
if (McMMOManager == null)
|
|
||||||
McMMOManager = new McMMOManager();
|
|
||||||
return McMMOManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static PistonProtectionListener getPistonProtectionListener() {
|
public static PistonProtectionListener getPistonProtectionListener() {
|
||||||
if (PistonProtectionListener == null)
|
if (PistonProtectionListener == null)
|
||||||
PistonProtectionListener = new PistonProtectionListener();
|
PistonProtectionListener = new PistonProtectionListener();
|
||||||
return PistonProtectionListener;
|
return PistonProtectionListener;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public static MyPetManager getMyPetManager() {
|
|
||||||
if (myPetManager == null && getInstance().getServer().getPluginManager().getPlugin("MyPet") != null) {
|
|
||||||
myPetManager = new MyPetManager();
|
|
||||||
}
|
|
||||||
|
|
||||||
return myPetManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
private Placeholder Placeholder;
|
private Placeholder Placeholder;
|
||||||
private boolean PlaceholderAPIEnabled = false;
|
private boolean PlaceholderAPIEnabled = false;
|
||||||
|
|
||||||
@ -191,32 +160,6 @@ public class Jobs extends JavaPlugin {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public static WorldGuardManager getWorldGuardManager() {
|
|
||||||
return worldGuardManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public void setMythicManager() {
|
|
||||||
try {
|
|
||||||
Class.forName("net.elseland.xikage.MythicMobs.API.MythicMobsAPI");
|
|
||||||
MythicManager = new MythicMobs2(this);
|
|
||||||
} catch (ClassNotFoundException e) {
|
|
||||||
try {
|
|
||||||
Class.forName("io.lumine.xikage.mythicmobs.api.bukkit.BukkitAPIHelper");
|
|
||||||
MythicManager = new MythicMobs4(this);
|
|
||||||
} catch (ClassNotFoundException ex) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (MythicManager != null)
|
|
||||||
consoleMsg("&e[Jobs] MythicMobs detected.");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public static MythicMobInterface getMythicManager() {
|
|
||||||
return MythicManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Loging getLoging() {
|
public static Loging getLoging() {
|
||||||
if (loging == null)
|
if (loging == null)
|
||||||
loging = new Loging();
|
loging = new Loging();
|
||||||
@ -488,7 +431,7 @@ public class Jobs extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Job getJob(int id) {
|
public static Job getJob(int id) {
|
||||||
return getJobsIds().get(id);
|
return jobsIds.get(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPlaceholderAPIEnabled() {
|
public boolean isPlaceholderAPIEnabled() {
|
||||||
|
@ -3,6 +3,7 @@ package com.gamingmesh.jobs.listeners;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import org.bukkit.block.Campfire;
|
import org.bukkit.block.Campfire;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -20,7 +21,7 @@ import com.gamingmesh.jobs.container.PlayerCamp;
|
|||||||
|
|
||||||
public class JobsPayment14Listener implements Listener {
|
public class JobsPayment14Listener implements Listener {
|
||||||
|
|
||||||
private Map<Player, PlayerCamp> campPlayers = new HashMap<>();
|
private final Map<PlayerCamp, Player> campPlayers = new HashMap<>();
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.LOW)
|
@EventHandler(priority = EventPriority.LOW)
|
||||||
public void onCook(BlockCookEvent event) {
|
public void onCook(BlockCookEvent event) {
|
||||||
@ -36,22 +37,23 @@ public class JobsPayment14Listener implements Listener {
|
|||||||
if (!(event.getBlock().getState() instanceof Campfire))
|
if (!(event.getBlock().getState() instanceof Campfire))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (Iterator<Map.Entry<Player, PlayerCamp>> it = campPlayers.entrySet().iterator(); it.hasNext();) {
|
for (Iterator<Entry<PlayerCamp, Player>> it = campPlayers.entrySet().iterator(); it.hasNext();) {
|
||||||
Map.Entry<Player, PlayerCamp> camps = it.next();
|
Entry<PlayerCamp, Player> camps = it.next();
|
||||||
if (camps == null) {
|
if (camps == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!camps.getValue().getBlock().getLocation().equals(event.getBlock().getLocation())) {
|
PlayerCamp camp = camps.getKey();
|
||||||
|
if (!camp.getBlock().getLocation().equals(event.getBlock().getLocation())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(camps.getKey());
|
JobsPlayer jPlayer = Jobs.getPlayerManager().getJobsPlayer(camps.getValue());
|
||||||
if (jPlayer == null)
|
if (jPlayer == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Jobs.action(jPlayer, new ItemActionInfo(event.getSource(), ActionType.BAKE));
|
Jobs.action(jPlayer, new ItemActionInfo(event.getSource(), ActionType.BAKE));
|
||||||
if (camps.getValue().getItem().equals(event.getSource())) {
|
if (camp.getItem().equals(event.getSource())) {
|
||||||
it.remove();
|
it.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -79,6 +81,6 @@ public class JobsPayment14Listener implements Listener {
|
|||||||
if (!JobsPaymentListener.payIfCreative(p))
|
if (!JobsPaymentListener.payIfCreative(p))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
campPlayers.put(p, new PlayerCamp(ev.getItem(), click));
|
campPlayers.put(new PlayerCamp(ev.getItem(), click), p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user