Witam. Czy ktos mi przerobi kod na disco zbroje smooth tak aby zmienialo sie jak kolory policji? Probowalem... ale jak zrobilem to jak wlaczylem disco to mi sie wlaczyla na niebiesko i sie NIE zmieniala ... KODY:
Kod Zmieniania kolorow (NIE PATRZCIE NA GRAYSHADE :D):
public static int redSmooth = 255;
public static int greenSmooth = 0;
public static int blueSmooth = 0;
public static int grayShade = 0;
public static int grayShadeCycle = 0;
public static void start() { Bukkit.getScheduler().scheduleSyncRepeatingTask((Plugin)MCKDisco.getInst(), new Runnable()
{
public void run()
{
if (ColorScheduler.redSmooth > 0 && ColorScheduler.blueSmooth == 0) {
ColorScheduler.redSmooth -= 3;
ColorScheduler.greenSmooth += 3;
}
if (ColorScheduler.greenSmooth > 0 && ColorScheduler.redSmooth == 0) {
ColorScheduler.greenSmooth -= 3;
ColorScheduler.blueSmooth += 3;
}
if (ColorScheduler.blueSmooth > 0 && ColorScheduler.greenSmooth == 0) {
ColorScheduler.redSmooth += 3;
ColorScheduler.blueSmooth -= 3;
}
if (ColorScheduler.grayShadeCycle == 0) {
ColorScheduler.grayShade += 3;
}
if (ColorScheduler.grayShade >= 255) {
ColorScheduler.grayShadeCycle = 1;
}
if (ColorScheduler.grayShadeCycle == 1) {
ColorScheduler.grayShade -= 3;
}
if (ColorScheduler.grayShade == 0)
ColorScheduler.grayShadeCycle = 0;
}
}, 0L, 2L); }
}
A TO KOD NA USTAWIENIE DISCO ZBROI:
if (discoType == DiscoType.SMOOTH)
try {
eq.setPlayerSlot(player, 5, Util.createColorArmor(new ItemStack(Material.LEATHER_HELMET), Color.fromRGB(ColorScheduler.redSmooth, ColorScheduler.greenSmooth, ColorScheduler.blueSmooth)));
eq.setPlayerSlot(player, 4, Util.createColorArmor(new ItemStack(Material.LEATHER_CHESTPLATE), Color.fromRGB(ColorScheduler.redSmooth, ColorScheduler.greenSmooth, ColorScheduler.blueSmooth)));
eq.setPlayerSlot(player, 3, Util.createColorArmor(new ItemStack(Material.LEATHER_LEGGINGS), Color.fromRGB(ColorScheduler.redSmooth, ColorScheduler.greenSmooth, ColorScheduler.blueSmooth)));
eq.setPlayerSlot(player, 2, Util.createColorArmor(new ItemStack(Material.LEATHER_BOOTS), Color.fromRGB(ColorScheduler.redSmooth, ColorScheduler.greenSmooth, ColorScheduler.blueSmooth))); continue;
} catch (ClassNotFoundException e) {
e.printStackTrace(); continue;
} catch (NoSuchMethodException e) {
e.printStackTrace(); continue;
} catch (InvocationTargetException e) {
e.printStackTrace(); continue;
} catch (IllegalAccessException e) {
e.printStackTrace(); continue;
} catch (InstantiationException e) {
e.printStackTrace(); continue;
} catch (NoSuchFieldException e) {
e.printStackTrace(); continue;
}
Pytanie
Timeq 2
Witam. Czy ktos mi przerobi kod na disco zbroje smooth tak aby zmienialo sie jak kolory policji? Probowalem... ale jak zrobilem to jak wlaczylem disco to mi sie wlaczyla na niebiesko i sie NIE zmieniala ... KODY:
Kod Zmieniania kolorow (NIE PATRZCIE NA GRAYSHADE :D):
public static int redSmooth = 255; public static int greenSmooth = 0; public static int blueSmooth = 0; public static int grayShade = 0; public static int grayShadeCycle = 0; public static void start() { Bukkit.getScheduler().scheduleSyncRepeatingTask((Plugin)MCKDisco.getInst(), new Runnable() { public void run() { if (ColorScheduler.redSmooth > 0 && ColorScheduler.blueSmooth == 0) { ColorScheduler.redSmooth -= 3; ColorScheduler.greenSmooth += 3; } if (ColorScheduler.greenSmooth > 0 && ColorScheduler.redSmooth == 0) { ColorScheduler.greenSmooth -= 3; ColorScheduler.blueSmooth += 3; } if (ColorScheduler.blueSmooth > 0 && ColorScheduler.greenSmooth == 0) { ColorScheduler.redSmooth += 3; ColorScheduler.blueSmooth -= 3; } if (ColorScheduler.grayShadeCycle == 0) { ColorScheduler.grayShade += 3; } if (ColorScheduler.grayShade >= 255) { ColorScheduler.grayShadeCycle = 1; } if (ColorScheduler.grayShadeCycle == 1) { ColorScheduler.grayShade -= 3; } if (ColorScheduler.grayShade == 0) ColorScheduler.grayShadeCycle = 0; } }, 0L, 2L); } } A TO KOD NA USTAWIENIE DISCO ZBROI: if (discoType == DiscoType.SMOOTH) try { eq.setPlayerSlot(player, 5, Util.createColorArmor(new ItemStack(Material.LEATHER_HELMET), Color.fromRGB(ColorScheduler.redSmooth, ColorScheduler.greenSmooth, ColorScheduler.blueSmooth))); eq.setPlayerSlot(player, 4, Util.createColorArmor(new ItemStack(Material.LEATHER_CHESTPLATE), Color.fromRGB(ColorScheduler.redSmooth, ColorScheduler.greenSmooth, ColorScheduler.blueSmooth))); eq.setPlayerSlot(player, 3, Util.createColorArmor(new ItemStack(Material.LEATHER_LEGGINGS), Color.fromRGB(ColorScheduler.redSmooth, ColorScheduler.greenSmooth, ColorScheduler.blueSmooth))); eq.setPlayerSlot(player, 2, Util.createColorArmor(new ItemStack(Material.LEATHER_BOOTS), Color.fromRGB(ColorScheduler.redSmooth, ColorScheduler.greenSmooth, ColorScheduler.blueSmooth))); continue; } catch (ClassNotFoundException e) { e.printStackTrace(); continue; } catch (NoSuchMethodException e) { e.printStackTrace(); continue; } catch (InvocationTargetException e) { e.printStackTrace(); continue; } catch (IllegalAccessException e) { e.printStackTrace(); continue; } catch (InstantiationException e) { e.printStackTrace(); continue; } catch (NoSuchFieldException e) { e.printStackTrace(); continue; }
Wstawiam w code
Notatka dodana przez HeezQ
Odnośnik do komentarza
Udostępnij na innych stronach
6 odpowiedzi na to pytanie
Rekomendowane odpowiedzi