Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //methode
- public ItemStack gear(Player p, Material Material, String kleurnaam, int hex) {
- int red = (hex & 0xFF0000) >> 32;
- int green = (hex & 0xFF00) >> 16;
- int blue = hex & 0xFF;
- ItemStack i = new ItemStack(Material, 1);
- ItemMeta meta = i.getItemMeta();
- meta.setDisplayName("§f" + kleurnaam);
- i.setItemMeta(meta);
- LeatherArmorMeta kleurMeta = (LeatherArmorMeta)i.getItemMeta();
- kleurMeta.setColor(Color.fromRGB(red, green, blue));
- i.setItemMeta(kleurMeta);
- return i;
- }
- //in mn class
- ItemStack test = plugin.gear(p, Material.LEATHER_CHESTPLATE, "testkleur", 965482);
- //error
- null
- org.bukkit.command.CommandException: Unhandled exception executing command 'rugzak' in plugin MinetopiaExpansion v1.1
- at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46) ~[spigot.jar:git-Spigot-4af49dc-c5e9a16]
- at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[spigot.jar:git-Spigot-4af49dc-c5e9a16]
- at org.bukkit.craftbukkit.v1_9_R2.CraftServer.dispatchCommand(CraftServer.java:645) ~[spigot.jar:git-Spigot-4af49dc-c5e9a16]
- at net.minecraft.server.v1_9_R2.PlayerConnection.handleCommand(PlayerConnection.java:1349) [spigot.jar:git-Spigot-4af49dc-c5e9a16]
- at net.minecraft.server.v1_9_R2.PlayerConnection.a(PlayerConnection.java:1184) [spigot.jar:git-Spigot-4af49dc-c5e9a16]
- at net.minecraft.server.v1_9_R2.PacketPlayInChat.a(PacketPlayInChat.java:45) [spigot.jar:git-Spigot-4af49dc-c5e9a16]
- at net.minecraft.server.v1_9_R2.PacketPlayInChat.a(PacketPlayInChat.java:1) [spigot.jar:git-Spigot-4af49dc-c5e9a16]
- at net.minecraft.server.v1_9_R2.PlayerConnectionUtils$1.run(SourceFile:13) [spigot.jar:git-Spigot-4af49dc-c5e9a16]
- at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_131]
- at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_131]
- at net.minecraft.server.v1_9_R2.SystemUtils.a(SourceFile:45) [spigot.jar:git-Spigot-4af49dc-c5e9a16]
- at net.minecraft.server.v1_9_R2.MinecraftServer.D(MinecraftServer.java:726) [spigot.jar:git-Spigot-4af49dc-c5e9a16]
- at net.minecraft.server.v1_9_R2.DedicatedServer.D(DedicatedServer.java:399) [spigot.jar:git-Spigot-4af49dc-c5e9a16]
- at net.minecraft.server.v1_9_R2.MinecraftServer.C(MinecraftServer.java:665) [spigot.jar:git-Spigot-4af49dc-c5e9a16]
- at net.minecraft.server.v1_9_R2.MinecraftServer.run(MinecraftServer.java:564) [spigot.jar:git-Spigot-4af49dc-c5e9a16]
- at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]
- Caused by: java.lang.IllegalArgumentException: Red is not between 0-255: 917504
- at org.apache.commons.lang.Validate.isTrue(Validate.java:93) ~[spigot.jar:git-Spigot-4af49dc-c5e9a16]
- at org.bukkit.Color.<init>(Color.java:164) ~[spigot.jar:git-Spigot-4af49dc-c5e9a16]
- at org.bukkit.Color.fromRGB(Color.java:119) ~[spigot.jar:git-Spigot-4af49dc-c5e9a16]
- at me.MinetopiaExpansion.Main.gear(Main.java:50) ~[?:?]
- at commands.Rugzak.onCommand(Rugzak.java:71) ~[?:?]
- at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) ~[spigot.jar:git-Spigot-4af49dc-c5e9a16]
- ... 15 more
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement