@Override public void read(DataInputStream input) throws IOException { FireworkEffect.Builder builder = FireworkEffect.builder(); builder.flicker(input.readBoolean()); builder.trail(input.readBoolean()); int len = input.readInt(); for(int i = 0; i < len; i++) { builder.withColor(Color.fromRGB(input.readInt(), input.readInt(), input.readInt())); } len = input.readInt(); for(int i = 0; i < len; i++) { builder.withFade(Color.fromRGB(input.readInt(), input.readInt(), input.readInt())); } builder.with(FireworkEffect.Type.valueOf(input.readUTF())); }
/** * l.add("��2����ֱ������"); * @return ��ˮ */ public static ItemStack getFreshWater(){ ItemStack sw=new ItemStack(Material.POTION); PotionMeta im = (PotionMeta) sw.getItemMeta(); im.setColor(Color.fromRGB(36, 165, 229)); im.setDisplayName("��3��l��ˮ"); List<String> l=new LinkedList<String>(); l.add("��a��l"+rs.getLoreTabel("Thirst")+": ��b��l"+Utils.random(10, 25)+"%"); l.add(""); l.add("��7��l"+rs.getLoreTabel("Weight")+": 1"); l.add(""); l.add("��2����ֱ������"); im.setLore(l); sw.setItemMeta(im); return sw; }
public static Color parseColor(String s) { String[] parts = s.split(";"); if (parts.length != 3) { Color color; if (s.charAt(0) == '#' && s.length() >= 7) {//Hex color try { color = Color.fromRGB(Integer.parseUnsignedInt(s.substring(1, 7), 16)); } catch (IllegalArgumentException e) { color = null; } } else color = COLOR_BY_NAME.get(s.toUpperCase()); if (color == null) throw new InvalidConfigException("Invalid color \"" + s + "\", use \"R;G;B\", \"#RRGGBB\" or color name!"); else return color; } else return Color.fromRGB(parseInt(parts[0]), parseInt(parts[1]), parseInt(parts[2])); }
public static Color getColor(ChatColor color) { if (color == ChatColor.RED) { return Color.RED; } else if (color == ChatColor.BLUE) { return Color.BLUE; } else if (color == ChatColor.LIGHT_PURPLE) { return Color.FUCHSIA; } else if (color == ChatColor.GREEN) { return Color.GREEN; } else if (color == ChatColor.YELLOW) { return Color.YELLOW; } else if (color == ChatColor.GOLD) { return Color.ORANGE; } else if (color == ChatColor.AQUA) { return Color.AQUA; } else if (color == ChatColor.DARK_PURPLE) { return Color.PURPLE; } else { return Color.WHITE; } }
/** * l.add("��2��ˮ,�����ճɿ�ˮ"); l.add("��4��lֱ�Ӻ��м�������!"); l.add("��b��Ҫ�á�e��l��ˮװ�á�b���������������!"); * @return��ˮ */ public static ItemStack getLakeWater(){ ItemStack sw=new ItemStack(Material.POTION); PotionMeta im = (PotionMeta) sw.getItemMeta(); im.setColor(Color.fromRGB(36, 165, 229)); im.setDisplayName("��2��l��ˮ"); List<String> l=new LinkedList<String>(); l.add("��2��l"+rs.getLoreTabel("Thirst")+": ��b��l"+Utils.random(5, 20)+"%"); l.add("��2��l"+rs.getLoreTabel("SickKind")+": ��c��l"+rs.defSick.split(";")[(int)Utils.random(0, rs.defSick.split(";").length)]); l.add("��2��l"+rs.getLoreTabel("Sickness")+": ��c��l"+Utils.random(5, 15)+"%"); l.add(""); l.add("��7��l"+rs.getLoreTabel("Weight")+": 1"); l.add(""); l.add("��4��lֱ�Ӻ��м�������!"); l.add("��b��Ҫ�á�e��l��ˮװ�á�b���������������!"); im.setLore(l); sw.setItemMeta(im); return sw; }
@Override public void onRun() { double x, y, z; for (int i = 0; i < 50; i++) { int count = 20; do { count--; x = RMath.randDouble(0, 2); y = RMath.randDouble(0, 2); z = RMath.randDouble(0, 2); } while (count >= 0 && x * x + y * y + z * z > 4); x -= 1; z -= 1; loc.add(x, y, z); display(ParticleEffect.REDSTONE, loc, Color.WHITE); loc.subtract(x, y, z); } }
@Override public void onRun() { double x, y, z; for (int i = 0; i < 50; i++) { int count = 20; do { count--; x = RMath.randDouble(0, 2); y = RMath.randDouble(0, 2); z = RMath.randDouble(0, 2); } while (count >= 0 && x * x + y * y + z * z > 4); x -= 1; z -= 1; loc.add(x, y, z); display(ParticleEffect.REDSTONE, loc, Color.AQUA); loc.subtract(x, y, z); } }
@Override public void onRun() { double x, y, z; for (int i = 0; i < 50; i++) { int count = 20; do { count--; x = RMath.randDouble(0, 2); y = RMath.randDouble(0, 2); z = RMath.randDouble(0, 2); } while (count >= 0 && x * x + y * y + z * z > 4); x -= 1; z -= 1; loc.add(x, y, z); display(ParticleEffect.REDSTONE, loc, Color.ORANGE); loc.subtract(x, y, z); } }
@Override public void onRun() { double x, z; for (double dy = 0; dy < 1.5; dy += 0.25) { loc.add(0, dy, 0); for (int i = 0; i < particles; i++) { double angle = (double) 2 * Math.PI * i / particles; x = Math.cos(angle) * radius; z = Math.sin(angle) * radius; loc.add(x, 0, z); display(particle, loc, Color.AQUA); loc.subtract(x, 0, z); } loc.subtract(0, dy, 0); } }
@Override public void read(DataInputStream input) throws IOException { PotionEffectType type = PotionEffectType.getById(input.readInt()); int duration = input.readInt(); int amplifier = input.readInt(); boolean aimbient = input.readBoolean(); boolean particles = input.readBoolean(); int r = input.readInt(); int g = input.readInt(); int b = input.readInt(); Color color = Color.fromRGB(r, g, b); setValue(new PotionEffect( type, duration, amplifier, aimbient, particles, color )); }
public void castSpell(final LivingEntity caster, final MobData md, Player target) { final ArrayList<Entity> hit = new ArrayList<Entity>(); final Location start = md.entity.getLocation(); start.setY(start.getY() + 1.2); for (Vector v : getVectorsNormal(md.entity)) { ArrayList<Location> locs = RMath.calculateVectorPath(start.clone(), v, range, 2); int count = 0; for (int k = 0; k < locs.size(); k++) { final Location loc = locs.get(k); RScheduler.schedule(Spell.plugin, new Runnable() { public void run() { ParticleEffect.REDSTONE.display(null, loc, Color.AQUA, 100, 0.2f, 0.2f, 0.2f, 1, 2); int damage = (int) (md.getDamage() * 1.2); ArrayList<Entity> damaged = Spell.damageNearby(damage, md.entity, loc, 1.0, hit, true, false, true); hit.addAll(damaged); } }, 1 * count); if (k % 2 == 0) count++; } } }
@Override public void read(DataInputStream input) throws IOException { super.read(input); getValue().setScaling(input.readBoolean()); boolean hasLocationName = input.readBoolean(); if(hasLocationName) { getValue().setLocationName(input.readUTF()); } boolean hasColor = input.readBoolean(); if(hasColor) { getValue().setColor(Color.fromRGB(input.readInt(), input.readInt(), input.readInt())); } }
public static CustomBlockTexture extractTextureFromEntity(ArmorStand e) { CustomBlockTexture t = new CustomBlockTexture(); short tex = (short) e.getHelmet().getDurability(); Color c = ((LeatherArmorMeta) e.getHelmet().getItemMeta()).getColor(); boolean g = e.getHelmet().containsEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL); t.setLayerPrimary(tex, c, g); if (e.getEquipment().getItemInMainHand() == null) { return t; } short tex2 = (short) e.getEquipment().getItemInMainHand().getDurability(); Color c2 = ((LeatherArmorMeta) e.getEquipment().getItemInMainHand().getItemMeta()).getColor(); boolean g2 = e.getEquipment().getItemInMainHand().containsEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL); t.setLayerSecondary(tex2, c2, g2); return t; }
@Override public void start() { if (!kitsDir.exists()) { log.info("Kits dir doesn't exist, creating...."); kitsDir.mkdirs(); } File[] files = kitsDir.listFiles(); if (files != null) { for (File file : files) { if (file.getName().endsWith(".json")) { availableKits.add(file.getName().replace(".json", "")); } } } log.info("There are " + availableKits.size() + " kits available."); // test stuff Kit kit = new Kit("DefaultKit"); kit.addItem(0, new ItemBuilder(Material.STONE).name("Test Stone").build()); kit.addItem(1, new ItemBuilder(Material.DIAMOND_SWORD).enchantment(Enchantment.DAMAGE_ALL, 5).name(ChatColor.RED + "Cool sword").amount(2).build()); kit.addItem(2, new ItemBuilder(Material.LEATHER_BOOTS).enchantment(Enchantment.PROTECTION_EXPLOSIONS, 2).enchantment(Enchantment.PROTECTION_FALL, 5).name("Cool bots").amount(3).color(Color.RED).durability(10).lore("test").lore("Lore").build()); createKit(kit); kit = loadKit("DefaultKit", new File(kitsDir, kit.getName() + ".json")); System.out.println(kit); }
/** * l.add("��2����ֱ������"); l.add("��b��l���Ը����彵��!"); * @return ��ˮ */ public static ItemStack getIceWater(){ ItemStack sw=new ItemStack(Material.POTION); PotionMeta im = (PotionMeta) sw.getItemMeta(); im.setColor(Color.fromRGB(36, 165, 229)); im.setDisplayName("��3��l��ˮ"); List<String> l=new LinkedList<String>(); l.add("��a��l"+rs.getLoreTabel("Thirst")+": ��b��l"+Utils.random(10, 25)+"%"); l.add("��3��l"+rs.getLoreTabel("Tem")+": ��c��l-"+Utils.random(0.1, 1.5)+"%"); l.add(""); l.add("��7��l"+rs.getLoreTabel("Weight")+": 1"); l.add(""); l.add("��2����ֱ������"); l.add("��b��l���Ը����彵��!"); im.setLore(l); sw.setItemMeta(im); return sw; }
public void spawnFireworkDisplay(Location center, Color color, int count, double radius, int power) { FireworkEffect effect = FireworkEffect.builder().with(Type.BURST) .withFlicker() .withColor(color) .withFade(Color.BLACK) .build(); for(int i = 0; i < count; i++) { double angle = 2 * Math.PI / count * i; double dx = radius * Math.cos(angle); double dz = radius * Math.sin(angle); Location baseLocation = center.clone().add(dx, 0, dz); Block block = baseLocation.getBlock(); if(block == null || !block.getType().isOccluding()) { FireworkUtil.spawnFirework(FireworkUtil.getOpenSpaceAbove(baseLocation), effect, power); } } }
/** * l.add("��2��ˮ,����..."); l.add("��4�������ܽ��,��l���м�������!"); l.add("��b��Ҫ�þ�ˮװ�����������������!"); * @return ��ˮ */ public static ItemStack getSeaWater(){ ItemStack sw=new ItemStack(Material.POTION); PotionMeta im = (PotionMeta) sw.getItemMeta(); im.setColor(Color.fromRGB(15, 103, 219)); im.setDisplayName("��1��l��ˮ"); List<String> l=new LinkedList<String>(); l.add("��a��l"+rs.getLoreTabel("Thirst")+": ��b��l-"+Utils.random(2, 20)+"%"); l.add("��2��l"+rs.getLoreTabel("SickKind")+": ��c��l"+rs.defSick.split(";")[(int)Utils.random(0, rs.defSick.split(";").length)]); l.add("��2��l"+rs.getLoreTabel("Sickness")+": ��c��l"+Utils.random(20, 30)+"%"); l.add(""); l.add("��7��l"+rs.getLoreTabel("Weight")+": 1"); l.add(""); l.add("��2��ˮ,����..."); l.add("��4�������ܽ��,��l���м�������!"); l.add("��b��Ҫ�þ�ˮװ�����������������!"); im.setLore(l); sw.setItemMeta(im); return sw; }
public void playFirework(Player p, Location loc, Color color1, Color color2, FireworkEffect.Type type) { loc.add(0.5, 1, 0.5); Firework fw = p.getWorld().spawn(loc, Firework.class); FireworkMeta fwmeta = ((org.bukkit.entity.Firework) fw).getFireworkMeta(); FireworkEffect.Builder builder = FireworkEffect.builder(); builder.withFlicker(); builder.withFade(color2); builder.withColor(color1); builder.with(type); fwmeta.clearEffects(); Field f; try { f = fwmeta.getClass().getDeclaredField("power"); f.setAccessible(true); f.set(fwmeta, -1); } catch (Exception e) { return; } fwmeta.addEffect(builder.build()); fw.setFireworkMeta(fwmeta); }
/** l.add("��2��ˮ�����˵���DZȽϸɾ���"); l.add("��b���ǻ����н�С���ʵò�"); * @return ��ˮ */ public static ItemStack getRainwater(){ ItemStack sw=new ItemStack(Material.POTION); PotionMeta im = (PotionMeta) sw.getItemMeta(); im.setColor(Color.fromRGB(36, 165, 229)); im.setDisplayName("��b��l��ˮ"); List<String> l=new LinkedList<String>(); l.add("��a��l"+rs.getLoreTabel("Thirst")+": ��b��l"+Utils.random(5, 25)+"%"); l.add("��2��l"+rs.getLoreTabel("SickKind")+": ��c��l"+rs.defSick.split(";")[(int)Utils.random(0, rs.defSick.split(";").length)]); l.add("��2��l"+rs.getLoreTabel("Sickness")+": ��c��l"+Utils.random(2, 10)+"%"); l.add(""); l.add("��7��l"+rs.getLoreTabel("Weight")+": 1"); l.add(""); l.add("��2��ˮ�����˵���DZȽϸɾ���"); l.add("��b���ǻ����н�С���ʵò�"); im.setLore(l); sw.setItemMeta(im); return sw; }
public Color getRandomColor() { int color = getRandomNum(17, 1); switch (color) { case 1: return Color.AQUA; case 2: return Color.BLACK; case 3: return Color.BLUE; case 4: return Color.FUCHSIA; case 5: return Color.GRAY; case 6: return Color.GREEN; case 7: return Color.LIME; case 8: return Color.MAROON; case 9: return Color.NAVY; case 10: return Color.OLIVE; case 11: return Color.ORANGE; case 12: return Color.PURPLE; case 13: return Color.RED; case 14: return Color.SILVER; case 15: return Color.TEAL; case 16: return Color.WHITE; case 17: return Color.YELLOW; default: return Color.RED; } }
public static Color getColor(String c) { switch (c) { case "aqua": return Color.AQUA; case "black": return Color.BLACK; case "blue": return Color.BLUE; case "fuschia": return Color.FUCHSIA; case "gray": return Color.GRAY; case "green": return Color.GREEN; case "lime": return Color.LIME; case "maroon": return Color.MAROON; case "navy": return Color.NAVY; case "olvie": return Color.OLIVE; case "orange": return Color.ORANGE; case "purple": return Color.PURPLE; case "red": return Color.RED; case "silver": return Color.SILVER; case "teal": return Color.TEAL; case "white": return Color.WHITE; case "yellow": return Color.YELLOW; default: return Color.NAVY; } }
/** * l.add("��2����ֱ������"); l.add("��a��l���Ի������Ƽ���!"); l.add("��c������ů����!"); * @return ��ˮ */ public static ItemStack getHotWater(){ ItemStack sw=new ItemStack(Material.POTION); PotionMeta im = (PotionMeta) sw.getItemMeta(); im.setColor(Color.fromRGB(36, 165, 229)); im.setDisplayName("��d��l��ˮ"); List<String> l=new LinkedList<String>(); l.add("��a��l"+rs.getLoreTabel("Thirst")+": ��b��l"+Utils.random(10, 25)+"%"); l.add("��c��l"+rs.getLoreTabel("Tem")+": ��b��l"+Utils.random(0.1, 1.5)); l.add(""); l.add("��7��l"+rs.getLoreTabel("Weight")+": 1"); l.add(""); l.add("��2����ֱ������"); l.add("��a��l���Ի������Ƽ���!"); l.add("��c������ů����!"); im.setLore(l); sw.setItemMeta(im); return sw; }
/** * Make a new twinkle with specific color which will move from a to b. * * @param a First point * @param b Second point * @param c Color of line */ public MovingTwinkle(Location a, Location b, Color c) { this.a = a; this.b = b; this.c = c; drawloc = a.clone(); dist = a.distance(b); move = b.toVector().subtract(a.toVector()).multiply(0.5 / dist); twinkles.add(this); }
@Override public Object getOriginal() { List<Color> colors = new ArrayList<>(); for(RGBColor temp : color) colors.add((Color) temp.getOriginal()); return colors; }
public static Color getColorAll(ChatColor color) { switch (color) { case BLACK: return Color.fromRGB(0, 0, 0); case DARK_BLUE: return Color.fromRGB(0, 0, 170); case DARK_GREEN: return Color.fromRGB(0, 170, 0); case DARK_AQUA: return Color.fromRGB(0, 170, 170); case DARK_RED: return Color.fromRGB(170, 0, 0); case DARK_PURPLE: return Color.fromRGB(170, 0, 170); case GOLD: return Color.fromRGB(255, 170, 0); case GRAY: return Color.fromRGB(170, 170, 170); case DARK_GRAY: return Color.fromRGB(85, 85, 85); case BLUE: return Color.fromRGB(85, 85, 255); case GREEN: return Color.fromRGB(85, 255, 85); case AQUA: return Color.fromRGB(85, 255, 255); case RED: return Color.fromRGB(255, 85, 85); case LIGHT_PURPLE: return Color.fromRGB(255, 85, 255); case YELLOW: return Color.fromRGB(255, 255, 85); case WHITE: return Color.fromRGB(255, 255, 255); } return Color.WHITE; }
public static ChatColor getChatColor(Color color) { if (color == Color.RED) { return ChatColor.RED; } else if (color == Color.BLUE) { return ChatColor.BLUE; } else if (color == Color.PURPLE) { return ChatColor.DARK_PURPLE; } else if (color == Color.GREEN) { return ChatColor.GREEN; } else if (color == Color.YELLOW) { return ChatColor.YELLOW; } else { return ChatColor.WHITE; } }
public static ItemStack createColouredArmour(Material m, Color colour, String n, List<String> l) { ItemStack i = new ItemStack(m); i = applyItemFlags(i); LeatherArmorMeta lam = (LeatherArmorMeta) i.getItemMeta(); lam.setDisplayName(n); lam.setLore(l); lam.setColor(colour); i.setItemMeta(lam); return i; }
public static Color convertByteToColor(byte d) { Color c = null; if (d == 0) c = Color.WHITE; if (d == 1) c = Color.ORANGE; if (d == 2) c = Color.FUCHSIA; if (d == 3) c = Color.BLUE; if (d == 4) c = Color.YELLOW; if (d == 5) c = Color.LIME; if (d == 6) c = Color.FUCHSIA; if (d == 7) c = Color.GRAY; if (d == 8) c = Color.GRAY; if (d == 9) c = Color.TEAL; if (d == 10) c = Color.PURPLE; if (d == 11) c = Color.BLUE; if (d == 12) c = Color.MAROON; if (d == 13) c = Color.GREEN; if (d == 14) c = Color.RED; if (d == 15) c = Color.BLACK; return c; }
public Elevator(String name, String id) { super(name, id); getTexture().setLayerPrimary(CustomBlockTexture.DIAMOND_BLOCK, Color.WHITE); getTexture().setLayerSecondary(CustomBlockTexture.DAYLIGHT_BOTTOM, Color.WHITE); //setMaterial(Material.SLIME_BLOCK); setMaterial(Material.GLASS); }
public HealingPads(String name, String id) { super(name, id); getTexture().setLayerPrimary(CustomBlockTexture.CLAY, Color.fromRGB(14, 150, 204), true); getTexture().setLayerSecondary(CustomBlockTexture.PURPUR_PILLAR, Color.fromRGB(235, 2, 57), true); setMaterial(Material.GLASS); setItemMaterial(Material.GLASS); }
/** * Sets the color of the itemStack. Only works on leatherItems * * @param color color * @return builder */ public ItemStackBuilder setColor(Color color) { if (this.getItemMeta() instanceof LeatherArmorMeta) { final LeatherArmorMeta meta = (LeatherArmorMeta) this.getItemMeta(); meta.setColor(color); this.setItemMeta(meta); } return this; }
public static ItemStack createColouredArmour(Material m, Color colour, String n) { ItemStack i = new ItemStack(m); i = applyItemFlags(i); LeatherArmorMeta lam = (LeatherArmorMeta) i.getItemMeta(); lam.setDisplayName(n); lam.setColor(colour); i.setItemMeta(lam); return i; }
/** * Create Color for use from ChatColor. * * @param c ChatColor to translate * @return Color to use in twinkles */ public static Color fromChatColor(ChatColor c) { switch (c) { case AQUA: return Color.fromRGB(0, 255, 255); case BLACK: return Color.fromRGB(0, 0, 0); case BLUE: return Color.fromRGB(0, 0, 255); case DARK_AQUA: return Color.fromRGB(0, 127, 127); case DARK_BLUE: return Color.fromRGB(0, 0, 127); case DARK_GRAY: return Color.fromRGB(85, 85, 85); case DARK_GREEN: return Color.fromRGB(0, 127, 0); case DARK_PURPLE: return Color.fromRGB(127, 0, 127); case DARK_RED: return Color.fromRGB(127, 0, 0); case GOLD: return Color.fromRGB(255, 127, 0); case GRAY: return Color.fromRGB(170, 170, 170); case GREEN: return Color.fromRGB(0, 255, 0); case LIGHT_PURPLE: return Color.fromRGB(255, 0, 255); case RED: return Color.fromRGB(255, 0, 0); case YELLOW: return Color.fromRGB(255, 255, 0); default: return Color.fromRGB(255, 255, 255); } }
public Slab(String name, String id) { super(name, id); getTexture().setLayerPrimary(CustomBlockTexture.SAND, Color.fromRGB(194, 178, 128)); setMaterial(Material.AIR); setItemMaterial(Material.SAND); }
public PolishedGold(String name, String id) { super(name, id); getTexture().setLayerPrimary(CustomBlockTexture.DIAMOND_BLOCK, Color.fromRGB(224, 197, 20), true); getTexture().setLayerSecondary(CustomBlockTexture.QUARTZ_MAZE, Color.fromRGB(173, 152, 14), true); setMaterial(Material.MOB_SPAWNER); setItemMaterial(Material.GOLD_BLOCK); }
public PolishedQuartz(String name, String id) { super(name, id); getTexture().setLayerPrimary(CustomBlockTexture.DIAMOND_BLOCK, Color.fromRGB(224, 197, 200), true); getTexture().setLayerSecondary(CustomBlockTexture.QUARTZ_MAZE, Color.fromRGB(173, 152, 200), true); setMaterial(Material.GLASS); setItemMaterial(Material.QUARTZ_BLOCK); }
private void setWardenInv(Player target) throws SQLException { RankManager.setGuardLevel(target, 2); RankManager.setWantedLevel(target, 0); target.getInventory().clear(); ItemStack boots = new ItemStack(Material.LEATHER_BOOTS); LeatherArmorMeta bootsMeta = (LeatherArmorMeta)boots.getItemMeta(); bootsMeta.setColor(Color.fromRGB(224, 33, 15)); boots.setItemMeta(bootsMeta); target.getInventory().setBoots(boots); ItemStack leggings = new ItemStack(Material.LEATHER_LEGGINGS); LeatherArmorMeta leggingsMeta = (LeatherArmorMeta)leggings.getItemMeta(); leggingsMeta.setColor(Color.fromRGB(224, 33, 15)); leggings.setItemMeta(leggingsMeta); target.getInventory().setLeggings(leggings); ItemStack chest = new ItemStack(Material.LEATHER_CHESTPLATE); LeatherArmorMeta chestMeta = (LeatherArmorMeta)chest.getItemMeta(); chestMeta.setColor(Color.fromRGB(224, 33, 15)); chest.setItemMeta(chestMeta); target.getInventory().setChestplate(chest); ItemStack helmet = new ItemStack(Material.LEATHER_HELMET); LeatherArmorMeta helmetMeta = (LeatherArmorMeta)helmet.getItemMeta(); helmetMeta.setColor(Color.fromRGB(224, 33, 15)); helmet.setItemMeta(helmetMeta); target.getInventory().setHelmet(helmet); try{ ScrapsUtil.setScraps(target, ScrapsUtil.getScraps(target)); } catch(SQLException e){ e.printStackTrace(); } }
public MagicalWood(String name, String id) { super(name, id); getTexture().setLayerPrimary(CustomBlockTexture.WOOD, Color.fromRGB(70, 255, 168), true); setMaterial(Material.GLASS); setItemMaterial(Material.LOG); }
@Override public void setColor(Color c) { Location l = getTextureEntity().getLocation(); getTextureEntity().remove(); getTexture().setLayerPrimary(CustomBlockTexture.DIAMOND_BLOCK, c); getTexture().setLayerSecondary(CustomBlockTexture.DAYLIGHT_BOTTOM, c); setTextureEntity(getTexture().placeBlock(l)); color = c; }
public static ItemStack setArmourColour(ItemStack i, Color c) { Material t = i.getType(); if (!(t == Material.LEATHER_HELMET || t == Material.LEATHER_CHESTPLATE || t == Material.LEATHER_LEGGINGS || t == Material.LEATHER_BOOTS)) { return i; } LeatherArmorMeta m = (LeatherArmorMeta) i.getItemMeta(); m.setColor(c); i.setItemMeta(m); i = applyItemFlags(i); return i; }