mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-29 08:36:45 +01:00
Update BukkitUtil#isBlockSolid to 1.13
This commit is contained in:
parent
28f3be56b3
commit
8bc0bcd9e6
@ -13,15 +13,12 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.OfflinePlayer;
|
import org.bukkit.OfflinePlayer;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.block.*;
|
import org.bukkit.block.*;
|
||||||
import org.bukkit.block.Sign;
|
|
||||||
import org.bukkit.block.data.Rotatable;
|
|
||||||
import org.bukkit.block.data.type.WallSign;
|
import org.bukkit.block.data.type.WallSign;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
import org.bukkit.inventory.InventoryHolder;
|
import org.bukkit.inventory.InventoryHolder;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.material.*;
|
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
@ -400,13 +397,15 @@ import java.util.*;
|
|||||||
|
|
||||||
@Override public boolean isBlockSolid(@NonNull final PlotBlock block) {
|
@Override public boolean isBlockSolid(@NonNull final PlotBlock block) {
|
||||||
try {
|
try {
|
||||||
final Material material = getMaterial(block);
|
Material material = getMaterial(block);
|
||||||
|
if (material.isLegacy()) {
|
||||||
|
material = getBukkitLegacyMappings().fromLegacyToString(material.name())
|
||||||
|
.to(Material.class);
|
||||||
|
}
|
||||||
if (material.isBlock() && material.isSolid() && !material.hasGravity()) {
|
if (material.isBlock() && material.isSolid() && !material.hasGravity()) {
|
||||||
Class<?> data = material.data;
|
String name = material.name().toLowerCase(Locale.ENGLISH);
|
||||||
if (data.equals(MaterialData.class) && !material.isTransparent() && material
|
if (material.isOccluding() || name.contains("stairs") || name.contains("slab")
|
||||||
.isOccluding() || data.equals(Tree.class) || data.equals(Sandstone.class)
|
|| name.contains("wool")) {
|
||||||
|| data.equals(Wool.class) || data.equals(Step.class) || data
|
|
||||||
.equals(WoodenStep.class)) {
|
|
||||||
switch (material) {
|
switch (material) {
|
||||||
case NOTE_BLOCK:
|
case NOTE_BLOCK:
|
||||||
case SPAWNER:
|
case SPAWNER:
|
||||||
@ -418,7 +417,6 @@ import java.util.*;
|
|||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
ignored.printStackTrace();
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user