
Stasio
Użytkownik-
Ilość zawartości
199 -
Rejestracja
-
Ostatnia wizyta
O Stasio
- Urodziny 03.03.2019 (3.316199335 lat)
Ostatnie wizyty
Blok z ostatnimi odwiedzającymi dany profil jest wyłączony i nie jest wyświetlany użytkownikom.
Osiągnięcia Stasio

Użytkownik III (7/13)
3
Reputacja
-
Błąd z konsoli zniknął po dodaniu tej linijki ale itemy w ekwipunku wciąż nie są naprawiane, a co do linijki 56 to dmg.setDamage(0);
-
Stasio obserwuje zawartość Odczyt z pliku , Repair i Fireball
-
Witam. Postanowiłem napisać komendę repair, lecz z jakiegoś powodu kiedy próbuje naprawić całą zawartość ekwipunku dostaje błąd. Wersja 1.15.2 [12:51:27] [Server thread/ERROR]: null org.bukkit.command.CommandException: Unhandled exception executing command 'ii' in plugin tets v1.0 at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[spigot-1.15.2.jar:git-Spigot-800b93f-8160e29] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[spigot-1.15.2.jar:git-Spigot-800b93f-8160e29] at org.bukkit.craftbukkit.v1_15_R1.CraftServer.dispatchCommand(CraftServer.java:711) ~[spigot-1.15.2.jar:git-Spigot-800b93f-8160e29] at net.minecraft.server.v1_15_R1.PlayerConnection.handleCommand(PlayerConnection.java:1657) ~[spigot-1.15.2.jar:git-Spigot-800b93f-8160e29] at net.minecraft.server.v1_15_R1.PlayerConnection.a(PlayerConnection.java:1497) ~[spigot-1.15.2.jar:git-Spigot-800b93f-8160e29] at net.minecraft.server.v1_15_R1.PacketPlayInChat.a(PacketPlayInChat.java:47) ~[spigot-1.15.2.jar:git-Spigot-800b93f-8160e29] at net.minecraft.server.v1_15_R1.PacketPlayInChat.a(PacketPlayInChat.java:1) ~[spigot-1.15.2.jar:git-Spigot-800b93f-8160e29] at net.minecraft.server.v1_15_R1.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:19) ~[spigot-1.15.2.jar:git-Spigot-800b93f-8160e29] at net.minecraft.server.v1_15_R1.TickTask.run(SourceFile:18) [spigot-1.15.2.jar:git-Spigot-800b93f-8160e29] at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeTask(SourceFile:144) [spigot-1.15.2.jar:git-Spigot-800b93f-8160e29] at net.minecraft.server.v1_15_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) [spigot-1.15.2.jar:git-Spigot-800b93f-8160e29] at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeNext(SourceFile:118) [spigot-1.15.2.jar:git-Spigot-800b93f-8160e29] at net.minecraft.server.v1_15_R1.MinecraftServer.ba(MinecraftServer.java:918) [spigot-1.15.2.jar:git-Spigot-800b93f-8160e29] at net.minecraft.server.v1_15_R1.MinecraftServer.executeNext(MinecraftServer.java:911) [spigot-1.15.2.jar:git-Spigot-800b93f-8160e29] at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.awaitTasks(SourceFile:127) [spigot-1.15.2.jar:git-Spigot-800b93f-8160e29] at net.minecraft.server.v1_15_R1.MinecraftServer.sleepForTick(MinecraftServer.java:895) [spigot-1.15.2.jar:git-Spigot-800b93f-8160e29] at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:828) [spigot-1.15.2.jar:git-Spigot-800b93f-8160e29] at java.lang.Thread.run(Thread.java:748) [?:1.8.0_292] Caused by: java.lang.NullPointerException at me.cpk.test.Main.repairAll(Main.java:56) ~[?:?] at me.cpk.test.Main.onCommand(Main.java:33) ~[?:?] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-1.15.2.jar:git-Spigot-800b93f-8160e29] ... 17 more public void repairAll(Player player) { for (ItemStack item : player.getInventory().getContents()) { if(item.getType().isBlock()) return; if(item.getType().isEdible()) return; if(item.getType().isAir()) return; ItemMeta i = item.getItemMeta(); if(i instanceof Damageable) { Damageable dmg = (Damageable) i; if(!dmg.hasDamage()) return; dmg.setDamage(0); item.setItemMeta(i); player.sendMessage("Naprawiono"); } } }
-
nwse zareagował(a) na odpowiedź na pytanie: Odliczanie
-
Wiem że tamten kod był idiotyczny i odliczanie robi się przy użyciu HashMapy
-
Rozumiem. Czy mógłbyś wytłumaczyć dlaczego?
-
Ale tworzenie pliku przy wejściu może zostać w onJoin a zapis w onQuit?
-
W takim razie coś polecisz początkującemu?
-
Dzięki za objaśnienie jutro to przetestuje naprawdę mnie ratujesz thx
-
hymm okej spróbuje ale nie ogarniam zbytnio hasmap ale tak jak mówię spróbuje Dobra nie mam pojęcia jak to napisać xd
-
Witam. W jaki sposób moge sprawdzić czy fireball dotyka ziemi a następnie wykonać eksplozje mój obecny kod if(e.getAction() == org.bukkit.event.block.Action.LEFT_CLICK_AIR || e.getAction() ==org.bukkit.event.block.Action.LEFT_CLICK_BLOCK) { if(p.getInventory().getItemInMainHand().equals(wand)) { Fireball f = (Fireball) p.getWorld().spawnEntity(p.getEyeLocation().add(p.getEyeLocation().getDirection()), EntityType.FIREBALL); f.setVelocity(p.getLocation().getDirection().multiply(3)); f.getWorld().createExplosion(f.getLocation(), 10f); p.sendMessage("EKSPLOZJA!"); } }
-
Witam oto mój kod na zapis i odczyt i właśnie z tym ostatnim jest problem nie odczytuje mi zmiennych z plików
-
Witam, o to mój kod ale nie działa więc pytam co jest nie tak
-
okej poczytam