Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class RainbowTask implements Runnable
- {
- private Rainbow pl;
- public RainbowTask(Rainbow rainbow)
- {
- pl = rainbow;
- }
- @Override
- public void run()
- {
- for (Player p : pl.RainbowList) {
- nextRGB();
- //Быдлокод2000
- ItemStack boots = new ItemStack(Material.LEATHER_BOOTS);
- ItemStack leggins = new ItemStack(Material.LEATHER_LEGGINGS);
- ItemStack chestplate = new ItemStack(Material.LEATHER_CHESTPLATE);
- ItemStack helmet = new ItemStack(Material.LEATHER_HELMET);
- LeatherArmorMeta meta = (LeatherArmorMeta)boots.getItemMeta(); meta.setColor(Color.fromBGR(r, g, b)); boots.setItemMeta(meta); p.getInventory().setBoots(boots);
- meta = (LeatherArmorMeta)leggins.getItemMeta(); meta.setColor(Color.fromBGR(r, g, b)); leggins.setItemMeta(meta); p.getInventory().setLeggings(leggins);
- meta = (LeatherArmorMeta)chestplate.getItemMeta(); meta.setColor(Color.fromBGR(r, g, b)); chestplate.setItemMeta(meta); p.getInventory().setChestplate(chestplate);
- meta = (LeatherArmorMeta)helmet.getItemMeta(); meta.setColor(Color.fromBGR(r, g, b)); helmet.setItemMeta(meta); p.getInventory().setHelmet(helmet);
- }
- }
- private int r=255;
- private int g=0;
- private int b=0;
- private void nextRGB() {
- if ( r == 255 && g < 255 && b == 0 ) {
- g+=pl.jump;
- }
- if ( g == 255 && r > 0 && b == 0 ) {
- r-=pl.jump;
- }
- if ( g == 255 && b < 255 && r == 0 ) {
- b+=pl.jump;
- }
- if ( b == 255 && g > 0 && r == 0 ) {
- g-=pl.jump;
- }
- if ( b == 255 && r < 255 && g == 0 ) {
- r+=pl.jump;
- }
- if ( r == 255 && b > 0 && g == 0 ) {
- b-=pl.jump;
- }
- if (r>255) r=255; if (g>255) g=255; if (b>255) b=255;
- if (r<0) r=0; if (g<0) g=0; if (b<0) b=0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement