Conversion of legacy Minecraft materials to 1.13 materials
This commit is contained in:
parent
dd60ab550f
commit
fb403977f2
@ -397,7 +397,7 @@ public class AICore {
|
||||
}
|
||||
|
||||
public ItemStack createAncientSword() {
|
||||
ItemStack item = new ItemStack(Material.GOLD_SWORD);
|
||||
ItemStack item = new ItemStack(Material.matchMaterial("GOLD_SWORD"));
|
||||
String name = "Ancient Sword";
|
||||
ArrayList<String> lore = new ArrayList<String>();
|
||||
lore.add("AncientSword");
|
||||
|
@ -119,7 +119,7 @@ public class BuildStuff extends Core {
|
||||
final int chance = randgen.nextInt(100);
|
||||
if (chance > 70) {
|
||||
if (Herobrine.getPluginCore().getSupport().checkBuild(world.getBlockAt(x, y, z).getLocation())) {
|
||||
world.getBlockAt(x, y, z).setType(Material.REDSTONE_TORCH_ON);
|
||||
world.getBlockAt(x, y, z).setType(Material.matchMaterial("REDSTONE_TORCH_ON"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -98,7 +98,7 @@ public class BuryPlayer extends Core {
|
||||
final Location loc = new Location(world, X, Y, Z);
|
||||
final Location signloc = new Location(world, X, Y, Z - 2);
|
||||
final Block signblock = signloc.add(0.0, 0.0, 0.0).getBlock();
|
||||
signblock.setType(Material.SIGN_POST);
|
||||
signblock.setType(Material.matchMaterial("SIGN_POST"));
|
||||
final Sign sign = (Sign) signblock.getState();
|
||||
sign.setLine(1, playername);
|
||||
sign.update();
|
||||
|
@ -230,7 +230,7 @@ public class Pyramid extends Core {
|
||||
world.getBlockAt(X, Y + 1, Z - 1).setType(mainMat);
|
||||
world.getBlockAt(X, Y + 1, Z - 1).setType(mainMat);
|
||||
world.getBlockAt(X, Y + 2, Z).setType(mainMat);
|
||||
world.getBlockAt(X, Y + 3, Z).setType(Material.REDSTONE_TORCH_ON);
|
||||
world.getBlockAt(X, Y + 3, Z).setType(Material.matchMaterial("REDSTONE_TORCH_ON"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ public class Signs extends Core {
|
||||
final Block signblock = loc.add(0.0, 0.0, 0.0).getBlock();
|
||||
final Block undersignblock = signblock.getLocation().subtract(0.0, 1.0, 0.0).getBlock();
|
||||
if (Herobrine.isAllowedBlock(signblock.getType()) && !Herobrine.isAllowedBlock(undersignblock.getType())) {
|
||||
signblock.setType(Material.SIGN_POST);
|
||||
signblock.setType(Material.matchMaterial("SIGN_POST"));
|
||||
final Sign sign = (Sign) signblock.getState();
|
||||
sign.setLine(1, Herobrine.getPluginCore().getConfigDB().useSignMessages.get(randmsg));
|
||||
sign.setRawData((byte) BlockChanger.getPlayerBlockFace(ploc).ordinal());
|
||||
|
@ -13,7 +13,7 @@ public class GraveyardWorld {
|
||||
final Location loc = new Location(Bukkit.getServer().getWorld(Herobrine.getPluginCore().getConfigDB().HerobrineWorldName), 0.0, 3.0, 0.0);
|
||||
for (int x = -50; x <= 50; ++x) {
|
||||
for (int z = -50; z <= 50; ++z) {
|
||||
loc.getWorld().getBlockAt(x, 3, z).setType(Material.MYCEL);
|
||||
loc.getWorld().getBlockAt(x, 3, z).setType(Material.matchMaterial("MYCEL"));
|
||||
}
|
||||
}
|
||||
final int MainX = -10;
|
||||
|
@ -250,7 +250,7 @@ public class Herobrine extends JavaPlugin implements Listener {
|
||||
}
|
||||
|
||||
public static boolean isAllowedBlock(final Material mat) {
|
||||
if(mat == Material.WATER || mat == Material.STATIONARY_WATER || mat == Material.LAVA || mat == Material.STATIONARY_LAVA
|
||||
if(mat == Material.WATER || mat == Material.matchMaterial("STATIONARY_WATER") || mat == Material.LAVA || mat == Material.matchMaterial("STATIONARY_LAVA")
|
||||
|| mat == Material.ICE || mat == Material.PACKED_ICE)
|
||||
return false;
|
||||
else
|
||||
|
@ -61,16 +61,16 @@ public class BlockListener implements Listener {
|
||||
.getType() == Material.GOLD_BLOCK)
|
||||
&& (block.getWorld()
|
||||
.getBlockAt(blockloc.getBlockX(), blockloc.getBlockY(), blockloc.getBlockZ() + 1)
|
||||
.getType() == Material.REDSTONE_TORCH_ON)
|
||||
.getType() == Material.matchMaterial("REDSTONE_TORCH_ON"))
|
||||
&& (block.getWorld()
|
||||
.getBlockAt(blockloc.getBlockX(), blockloc.getBlockY(), blockloc.getBlockZ() - 1)
|
||||
.getType() == Material.REDSTONE_TORCH_ON)
|
||||
.getType() == Material.matchMaterial("REDSTONE_TORCH_ON"))
|
||||
&& (block.getWorld()
|
||||
.getBlockAt(blockloc.getBlockX() + 1, blockloc.getBlockY(), blockloc.getBlockZ())
|
||||
.getType() == Material.REDSTONE_TORCH_ON)
|
||||
.getType() == Material.matchMaterial("REDSTONE_TORCH_ON"))
|
||||
&& (block.getWorld()
|
||||
.getBlockAt(blockloc.getBlockX() - 1, blockloc.getBlockY(), blockloc.getBlockZ())
|
||||
.getType() == Material.REDSTONE_TORCH_ON)
|
||||
.getType() == Material.matchMaterial("REDSTONE_TORCH_ON"))
|
||||
&& Herobrine.getPluginCore().getConfigDB().UseTotem && !AICore.isTotemCalled) {
|
||||
if (!Herobrine.getPluginCore().getSupport().checkBuild(blockloc)) {
|
||||
event.getPlayer().sendMessage("§c[Herobrine] You can't summon the Herobrine in protect zone!");
|
||||
|
@ -113,7 +113,7 @@ public class PlayerListener implements Listener {
|
||||
if ((event.getClickedBlock() != null) && (event.getPlayer().getInventory().getItemInMainHand() != null) && (event.getClickedBlock().getType() == Material.JUKEBOX)) {
|
||||
final ItemStack item = event.getPlayer().getInventory().getItemInMainHand();
|
||||
final Jukebox block = (Jukebox) event.getClickedBlock().getState();
|
||||
if (!block.isPlaying() && (item.getType() == Material.RECORD_11)) {
|
||||
if (!block.isPlaying() && (item.getType() == Material.matchMaterial("RECORD_11"))) {
|
||||
Herobrine.getPluginCore().getAICore();
|
||||
if (!AICore.isDiscCalled) {
|
||||
final Player player = event.getPlayer();
|
||||
|
@ -95,7 +95,7 @@ public class BlockChanger {
|
||||
public static void PlaceSkull(final Location loc, final String name) {
|
||||
final int chance = new Random().nextInt(7);
|
||||
final Block b = loc.getBlock();
|
||||
b.setType(Material.SKULL);
|
||||
b.setType(Material.matchMaterial("SKULL"));
|
||||
final Skull skull = (Skull) b.getState();
|
||||
skull.setSkullType(SkullType.PLAYER);
|
||||
skull.setOwner(name);
|
||||
|
@ -56,7 +56,7 @@ public class ItemName {
|
||||
}
|
||||
|
||||
public static ItemStack CreateSkull(final String data) {
|
||||
final ItemStack skull = new ItemStack(Material.SKULL_ITEM, 1, (short) SkullType.PLAYER.ordinal());
|
||||
final ItemStack skull = new ItemStack(Material.matchMaterial("SKULL_ITEM"), 1, (short) SkullType.PLAYER.ordinal());
|
||||
final SkullMeta skullmeta = (SkullMeta) skull.getItemMeta();
|
||||
skullmeta.setOwner(data);
|
||||
skullmeta.setDisplayName(ChatColor.RESET + data);
|
||||
|
@ -32,11 +32,11 @@ public class CustomZombie extends EntityZombie implements CustomEntity {
|
||||
getAttributeInstance(GenericAttributes.maxHealth).setValue(Herobrine.getPluginCore().getConfigDB().npc.getInt("npc.Guardian.HP"));
|
||||
setHealth(Herobrine.getPluginCore().getConfigDB().npc.getInt("npc.Guardian.HP"));
|
||||
setCustomName("Artifact Guardian");
|
||||
((Zombie) getBukkitEntity()).getEquipment().setItemInMainHand(new ItemStack(Material.GOLD_SWORD, 1));
|
||||
((Zombie) getBukkitEntity()).getEquipment().setHelmet(new ItemStack(Material.GOLD_HELMET, 1));
|
||||
((Zombie) getBukkitEntity()).getEquipment().setChestplate(new ItemStack(Material.GOLD_CHESTPLATE, 1));
|
||||
((Zombie) getBukkitEntity()).getEquipment().setLeggings(new ItemStack(Material.GOLD_LEGGINGS, 1));
|
||||
((Zombie) getBukkitEntity()).getEquipment().setBoots(new ItemStack(Material.GOLD_BOOTS, 1));
|
||||
((Zombie) getBukkitEntity()).getEquipment().setItemInMainHand(new ItemStack(Material.matchMaterial("GOLD_SWORD"), 1));
|
||||
((Zombie) getBukkitEntity()).getEquipment().setHelmet(new ItemStack(Material.matchMaterial("GOLD_HELMET"), 1));
|
||||
((Zombie) getBukkitEntity()).getEquipment().setChestplate(new ItemStack(Material.matchMaterial("GOLD_CHESTPLATE"), 1));
|
||||
((Zombie) getBukkitEntity()).getEquipment().setLeggings(new ItemStack(Material.matchMaterial("GOLD_LEGGINGS"), 1));
|
||||
((Zombie) getBukkitEntity()).getEquipment().setBoots(new ItemStack(Material.matchMaterial("GOLD_BOOTS"), 1));
|
||||
getBukkitEntity().teleport(loc);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user