mirror of
https://github.com/Zrips/Jobs.git
synced 2025-01-06 16:27:59 +01:00
Slab type correct check when running on older versions
This commit is contained in:
parent
98cd4dee23
commit
7c5a03afb6
@ -29,6 +29,7 @@ public class ItemManager {
|
|||||||
static HashMap<String, CMIItemStack> byBukkitName = new HashMap<>();
|
static HashMap<String, CMIItemStack> byBukkitName = new HashMap<>();
|
||||||
static HashMap<String, CMIItemStack> byMojangName = new HashMap<>();
|
static HashMap<String, CMIItemStack> byMojangName = new HashMap<>();
|
||||||
static HashMap<CMIMaterial, CMIItemStack> byMaterial = new HashMap<>();
|
static HashMap<CMIMaterial, CMIItemStack> byMaterial = new HashMap<>();
|
||||||
|
static final Version version = Version.getCurrent();
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public static void load() {
|
public static void load() {
|
||||||
@ -2655,18 +2656,20 @@ public class ItemManager {
|
|||||||
if (!isSlab(block.getType()))
|
if (!isSlab(block.getType()))
|
||||||
return SlabType.NOTSLAB;
|
return SlabType.NOTSLAB;
|
||||||
|
|
||||||
if (Version.isCurrentEqualOrHigher(Version.v1_13_R1)) {
|
if (version.isEqualOrHigher(Version.v1_13_R1)) {
|
||||||
if (block.getBlockData() instanceof org.bukkit.block.data.type.Slab) {
|
try {
|
||||||
org.bukkit.block.data.type.Slab slab = (org.bukkit.block.data.type.Slab) block.getBlockData();
|
if (block.getBlockData() instanceof org.bukkit.block.data.type.Slab) {
|
||||||
switch (slab.getType()) {
|
org.bukkit.block.data.type.Slab slab = (org.bukkit.block.data.type.Slab) block.getBlockData();
|
||||||
case TOP:
|
org.bukkit.block.data.type.Slab.Type t = slab.getType();
|
||||||
return SlabType.TOP;
|
if (t.equals(org.bukkit.block.data.type.Slab.Type.TOP))
|
||||||
case BOTTOM:
|
return SlabType.TOP;
|
||||||
return SlabType.BOTTOM;
|
if (t.equals(org.bukkit.block.data.type.Slab.Type.BOTTOM))
|
||||||
case DOUBLE:
|
return SlabType.BOTTOM;
|
||||||
return SlabType.DOUBLE;
|
if (t.equals(org.bukkit.block.data.type.Slab.Type.DOUBLE))
|
||||||
}
|
return SlabType.DOUBLE;
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (NoClassDefFoundError e) {
|
||||||
}
|
}
|
||||||
return SlabType.NOTSLAB;
|
return SlabType.NOTSLAB;
|
||||||
}
|
}
|
||||||
|
@ -443,6 +443,10 @@ public class Placeholder {
|
|||||||
Job jobs = getJobFromValue(vals.get(0));
|
Job jobs = getJobFromValue(vals.get(0));
|
||||||
return jobs == null ? "" : convert(user.isInJob(jobs));
|
return jobs == null ? "" : convert(user.isInJob(jobs));
|
||||||
|
|
||||||
|
case maxjobs:
|
||||||
|
Double max = Jobs.getPermissionManager().getMaxPermission(user, "jobs.max");
|
||||||
|
max = max == null ? Jobs.getGCManager().getMaxJobs() : max;
|
||||||
|
return String.valueOf(max);
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user