#help-development

1 messages · Page 2278 of 1

eternal night
#

you don't know what the next step is just from the method name

gleaming grove
#

ye it separates sub builders

ivory sleet
#

They’re probably using a staged builder :0

#

But yes I agree with Lynx, no need to have that

#

Also

#

Just having a single builder is good enough? Over engineering the type system seems rather superfluous

glossy scroll
#

CommandBuilder

#

CommandFactory

#

CommandBuilderFactory

ivory sleet
#

There’s a lib called cloud which has that

lost matrix
#

For a single server this would handle very decently

ivory sleet
#

And fairly justifiable also :3

gleaming grove
ivory sleet
#

Sounds like you should split your components up a bit more

glossy scroll
#

Also focus on getting 100 players before upgrading lol

#

Chances are you wont have that many starting out

#

100 concurrent is a lot

ivory sleet
#

This staged/step builder is a bit well…. Often can be addressed better

gleaming grove
ivory sleet
#

Sounds rather compulsive

gleaming grove
#

nah

jagged thicket
ivory sleet
#

Am I?

rancid hare
#

Hey

ivory sleet
#

Hey 👋

rancid hare
#
Y:\Development\IntelliJ\OTroll\src\at\orange\otroll\OTroll.java:120:49
java: cannot access com.mojang.brigadier.context.CommandContextBuilder
  class file for com.mojang.brigadier.context.CommandContextBuilder not found
#

How could I fix that?

eternal oxide
#

That error does not come from the line you have highlighted

rancid hare
#

It does

eternal oxide
#

?paste teh full error

undone axleBOT
rancid hare
#

This is the full error

eternal oxide
#

ah an IDE error

#

I'll assume you are trying to access a private field in the ServerPlayer object (as you are using obfuscated names its hard to tell). b should be the connection

waxen barn
#

Btw, is there some easy way to run task at the end of the tick? (in 1.17.1 btw)

eternal oxide
#

tasks run next tick at the earliest

lost matrix
quiet ice
#

it is also possible that there is a method with the name that returns or requires CommandContextBuilder, but that class is not on the build classpath

#

Though I have only seen the eclipse compiler complain about that issue

lost matrix
waxen barn
waxen barn
lost matrix
quiet ice
#

well two ticks plus the ping would make it quite noticable

opal juniper
#

just increase the tick rate :)

eternal oxide
quiet ice
#

Just use minestom

quiet ice
#

I haven't used IJ for long enough to be absolutely sure about it however

crude loom
#

Why am I getting null from e.getPlayer here?

 @EventHandler
    public void onPlayerChat(AsyncPlayerChatEvent e){
        Player p = e.getPlayer();

        //If the player is AFK, disable AFK
        if(main.afkManager.isAFK(p.getUniqueId()))
            main.afkManager.disableAFK(p,System.currentTimeMillis());

    }
eternal oxide
#

Yeah, I don;t see how he is even getting that warnign on that line for a non obfuscated path when he's not using any mappings

opal juniper
#

player is not null normall

river oracle
#

I don't think you are

eternal oxide
quiet ice
#

either you misidentified the thing that NPEs (it's probably main.afkManager that is null) or some plugin is not honoring the nullability specs

crude loom
#

Ah, I notice now that it only happens when the player is afk I will look into that

eternal oxide
crude loom
rancid hare
eternal oxide
#

in the folder where you found the 1.19 SNAPSHOT jar there is one marked SNAPSHOT-bootstrap

quiet ice
#

How the hell can one think that this is null? Whatever

quiet ice
crude loom
quiet ice
#

Schedule a task that runs on the next tick

#

?jd-s

undone axleBOT
rancid hare
rancid hare
quiet ice
#

Javac moment

eternal oxide
#

Weirdly I just checked the spigot jars and it is missing a bunch of the brigadier classes. It only has the tree package

#

well, and the CommandDispatcher

eternal night
#

I mean, in 1.18 and 1.19 those should be their own jars

eternal oxide
#

Yeah, in 1.19 it only has the minimal Brigadier

rancid hare
#

So is there any way to fix it?

eternal oxide
#

how did you try depending on teh GitHab Brigadier?

#

its only released as sourcecode and you are not using any build tool

opal juniper
#

the jar

rancid hare
#

But would the people have to download the Github brigadier too?

eternal oxide
#

Well, you said you tried it but clearly you have not

opal juniper
#

oh they dont publish release jars

eternal oxide
#

as there is no jar to download for it. you have to build it yourself

#

However, your IDE error makes no sense at all. Its complaining about a dependency you are not using

#

its literally bitching about Brigadier when you call ServerPlayer#connection.send(packet) (yours is obfuscated).

dry forum
#

https://pastebin.com/kG4e1Z4t anyone know why this would be lagging my server? its supose to load a schematic using FAWE over a period of time so its kind of in rows which it does fine on a small scale but i have a relatively small schematic (20x20x40) ish and it crashes my server ;p im loading it over 1000 ticks so its not like its all being set at once

lost matrix
quiet ice
#

If you know that they are offline and will continue to be offline you can use Trees - this would keep them stored for a long(-er) time at virtually no cost

rancid hare
dry forum
eternal oxide
rancid hare
#

There is

eternal oxide
#

try the jar geol linked

rancid hare
lost matrix
dry forum
dry forum
quiet ice
#

Well then you would need to keep tree and a list/map (or just update the tree on logout/login)

lost matrix
eternal oxide
rancid hare
#

Oh the problem was:

#

It wasn't used

#

It was added as an library but not as an dependency

dry forum
lost matrix
dry forum
quaint mantle
#

Looks > Speed

#

😎

dry forum
#

but it should be pasting 1 row every ~40 ticks so its not every tick

lost matrix
dry forum
quiet ice
#
TreeSet<OfflinePlayerEntry> offlinePlayers = new TreeSet<>();
Map<UUID, Integer> onlinePlayers = new HashMap<>(); // This one would need to be sorted every time and merged with the offlinePlayers tree when needed

class OfflinePlayerEntry implements Comparable<OfflinePlayerEntry> {
    private final UUID offlinePlayer;
    private final int playtimeHours; // MUST BE FINAL
    // Don't forget the constructor, hashcode and equals method
    public void compareTo(OfflinePlayerEntry other) {
         return Integer.compare(playtimeHours, other.playertimeHours);
    }
}

// On logon remove player from the offlinePlayers list (you must need to have the EXACT same playtimeHours variable)
// On logoff you can add it back again

Something like that

lost matrix
quiet ice
#

The big issue is that there is no way to easily sort something by it's value if the value can change

dry forum
quiet ice
#

Hence we NEED to make the "value" final

#

Yeah - hence we only represent offline players in the tree

#

For the online players you can represent it however you want

golden turret
#

how can i rotate an Object[][][] array?

lost matrix
golden turret
lost matrix
quiet ice
#
List<Map.Entry<UUID, Long>> /* uuid, ticksPlayed */ online = new ArrayList<>();
// Populate the online list
List<Map.Entry<UUID, Long>> bestPlayers = new ArrayList<>();
Iterator<OfflinePlayerEntry> itOff = offlinePlayers.iterator();
Iterator<Map.Entry<UUID, Long>> itOn = online.iterator();

Map.Entry<UUID, Long> bestOnline = null;

while (itOff.hasNext()) {
   OfflinePlayerEntry e = itOff.next();

   while (true) {
       if (bestOnline == null) {
           if (itOn.hasNext())  {
             bestOnline = itON.next();
           } else {
             bestPlayers.add(Map.entry(e.offlinePlayer, e.playtimeTicks));
             break;
           }
       }
       if (e.playtimeTicks <= bestOnline.getValue()) {
          bestPlayers.add(Map.entry(e.offlinePlayer, e.playtimeTicks));
          break;
       }
       bestPlayers.add(bestOnline);
       bestOnline = null;
   }
}
if (bestOnline != null) {
    bestPlayers.add(bestOnline);
}

while (itOn.hasNext()) {
   bestPlayers.add(itOn.next());
}

@last temple

lost matrix
golden turret
#

wdym

quiet ice
#

Well the code that I suggested would, if implemented correctly have 0 latency

#

It would be more buggy however

#

But they can be ironed out

lost matrix
golden turret
#

yea

#

that is what i want

lost matrix
#

And you want this for an 3D array?

  1. Why?
  2. Is it a cube?
golden turret
#
  1. yes
lost matrix
# golden turret 2) yes

This makes it a bit easier. But you still need to decide around which axis you want to rotate and in which direction.

golden turret
#

that is not a problem

lost matrix
#

LootGenerateEvent or edit the loot tables directly

#

I find the first one less tedious.

lost matrix
# golden turret 2) yes

I can only think of algorithms that would scale poorly memory and time wise. But its pretty much just a nested loop over
2 dimensions that need to be flipped.

lost matrix
# golden turret send them
  public void rotate(Object[][][] cube) {
    int sideLength = cube.length;
    Object[][][] temp = new Object[sideLength][sideLength][sideLength];
    System.arraycopy(cube, 0, temp, 0, sideLength);
    for(int x = 0; x < sideLength; x++) {
      for(int y = 0; y < sideLength; y++) {
        System.arraycopy(temp[y][x], 0, cube[x][y], 0, sideLength);
      }
    }
  }
golden turret
#

hm

#

this one rotates to whch direction?

lost matrix
#

No idea

#

Clockwise around the z axis would be my guess

#

Again: Why do you need to do this?
I cant imagine a scenario where this would be useful.

agile anvil
#

Well to rotate you just have to multiply your matrix by the rotation matrix you want

lost matrix
cunning canopy
#

my server keeps loosing like 50% of the chunks every time I restart the server. I have world edit installed and my plugins folder is connected to a github repo. Could it have anything to do with the plugins?

vocal cloud
#

How does a server lose 50% of the chunks? As in deleted? reset? What version? lol

cunning canopy
#

1.19 as in deleted no nothing just void

chrome beacon
#

Sounds like the chunks refuse to load

#

Can you build in them?

cunning canopy
#

yup

chrome beacon
#

Odd

#

Any plugins?

cunning canopy
#

world edit

#

custom plugin

#

self made

#

although

#

I dont see how my plugin should affect it

chrome beacon
#

Try without them

cunning canopy
#

although

#

it works if i do /save-all

#

before I restart it

chrome beacon
#

How are you stopping the server

quiet ice
#

Using spigot or a fork?

cunning canopy
#

oh

#

lol

#

thats prob the problem

#

cause it needs to run some stuff before instantly killing it right?

chrome beacon
#

Let it stop normally

quiet ice
#

That is just like pulling the power cable

cunning canopy
#

how would I let it stop?

paper viper
#

Stop command

quiet ice
#

Ctrl + C or the stop command

cunning canopy
#

/stop?

paper viper
#

yea

cunning canopy
#

can I use it ingame?

paper viper
#

Or just “stop” in console

#

Yes

quiet ice
#

Yeah, but also via the console

cunning canopy
#

thanks ppl

rare flicker
#

Hoi, i'm making a plugin where i need to damage a player's armor, and this works fine, now my problem is having the armor break when reaching 0. of course i could just remove it but what i'm looking for is to let the player know that his armor piece broke

vocal cloud
#

if left - amount <= 0:
tellPlayer()
?

rare flicker
#

i mean by having the breaking animation display

#

like, when you take damage at 0 durability, you hear a sound and see the armor's particles

#

just like you would by taking regular damage

cunning canopy
#

how would I turn off pvp in a plugin?

#

like

rare flicker
#

i suppose so

rare flicker
cunning canopy
#

is there a /restart command so I dont have to stop and start all the time?

opal juniper
#

yes

#

there is a /restart

#

NOOOOO

#

DO NOT USE /reload

rare flicker
#

it causes some problems for some plugins but isnt it just fine for most?

opal juniper
#

Yes, so therefore do not use it

#

it dont take long to restart

#

do that

rare flicker
#

sucks for dev tho

noble lantern
#

i use reload for development purposes all dah time no cap cuz on the blood on the gang cuz

rare flicker
#

i would need to restart almost every minute when debugging

noble lantern
#

tbf

#

restart takes 9 seconds

rare flicker
#

depends on whats on your server

#

add multiverse and this 9 seconds already become smth like 20

noble lantern
#

ew multiverse

rare flicker
#

wdym ew

#

not everyone can afford to run bungee

noble lantern
#

why rely on mu-

#

i

rare flicker
#

try running bungee on an AMD fx with 7g of ram ddr3 x)

noble lantern
#

funny thing is

#

you could

#

proxy is lightweight

#

and your hub is lightweight

rare flicker
#

yeah at like 16 tps

rare flicker
noble lantern
#

if i can run 4 1.8 - 1.18 servers with a few ide tabs open, with chrome tabs open to high hells you can make bungeecord run

#

Running multiple servers on one server isnt how things are meant to be

#

bungeecord for this reason

rare flicker
noble lantern
#

oracle free vps

rare flicker
noble lantern
#

IE running multiple servers on one server with multiverse

#

thats just

#

why

balmy fox
#

So I made my own plugin and in there I check if a player has a permission using if (player.hasPermission("warpplugin.command.list")) { But somehow it doesnt work. Even though I did add those permissions by using Powerranks webeditor

noble lantern
#

i have this bug sometimes

balmy fox
noble lantern
#

permission checking straight up wouldnt work, used vault to check perms and never had issues again

#

sec

lost matrix
eternal oxide
balmy fox
eternal oxide
#

then you didn;t give the permission

balmy fox
lost matrix
eternal oxide
# noble lantern Why not?

Vault hooks directly to each permission plugin so its not needed. Effective permissions are on the actual player

lost matrix
eternal oxide
#

Vault would be teh correct choice, if you want to check a permission in a world they player is not in

lost matrix
wary harness
#

How is EntityPlayer called in remaped jar

#

Player?

lost matrix
wary harness
#

ServerPlayer

balmy fox
lost matrix
wary harness
#

names

balmy fox
cunning canopy
#

what does restart do

#

for me it just shuts it down

lost matrix
#

or bukkit cant remember

cunning canopy
#

or bash file?

crude loom
#

should InventoryInteractEvent detect moving items around in the inventory ?

hybrid spoke
#

i dont just make a cow flip simulator

quaint mantle
#

Does someone know how to use cronjobs on sh skript to automatically restart the server at certain time every day? I tried and it didn't work

steel swan
#

hey ! so i have this code.
the goal is to create a private chat between the roles "Zabuza" and "Haku".
when either of them send a message in chat with a "!" before that message, the other one and the player receives that message.
the problem is the folowing :
when the player is "Zabuza" it works perfectly fine
when he is "haku" it doesnt.
anyone knows why?

@EventHandler
    public void onMessageSend(PlayerChatEvent event){
        Player player = event.getPlayer();
        User user = getUser(player.getUniqueId());
        String message = event.getMessage();
        if(hasStarted){

            if(user.getRole() == Role.Zabuza){
                if(String.valueOf(message.charAt(0)).equals("!")){
                    for(Player player1 : Bukkit.getOnlinePlayers()){
                        if(getUser(player1.getUniqueId()).getRole() == Role.Haku && users.contains(getUser(player1.getUniqueId()))){
                            player1.sendMessage(BLUE + "Zabuza : " + GOLD +  message.substring(1));
                            player.sendMessage(BLUE + "Zabuza : " + GOLD +  message.substring(1));
                        }
                    }
                }
            }else{
                if (user.getRole() == Role.Haku) {
                    if (String.valueOf(message.charAt(0)).equals("!")) {
                        for (Player player1 : Bukkit.getOnlinePlayers()) {
                            if (getUser(player1.getUniqueId()).getRole() == Role.Zabuza && users.contains(getUser(player1.getUniqueId()))) {
                                player1.sendMessage(BLUE + "Haku : " + GOLD + message.substring(1));
                                player.sendMessage(BLUE + "Haku : " + GOLD + message.substring(1));
                            }
                        }
                    }
                }
            }
            event.setCancelled(true);
        }

    }
lost matrix
quaint mantle
lost matrix
#

ah shell

#

shell script

#

With a c

steel swan
quaint mantle
#

Yes shell

quaint mantle
lost matrix
lost matrix
crude loom
#

How can I detect when a player uses a command?

quaint mantle
lost matrix
quaint mantle
#

Nope tmux

#

I can send u my code if you want

#

It doesn't work for whatever reason

lost matrix
steel swan
#

i get it

lost matrix
# steel swan wdym?

For example this:

if (String.valueOf(message.charAt(0)).equals("!"))

Whenever you have copy pasted code then you are doing something wrong

steel swan
#

wdym copy pasted code?

#

this is not copy pasted code

lost matrix
lost matrix
# steel swan this is not copy pasted code
  private static final Set<Role> CHAT_ROLES = Set.of(Role.Zabusa, Role.Haku);

  @EventHandler
  public void onMessageSend(PlayerChatEvent event) {
    Player player = event.getPlayer();
    User user = getUser(player.getUniqueId());
    String message = event.getMessage();
    if (!hasStarted) {
      return;
    }

    event.setCancelled(true);

    Role userRole = user.getRole();
    if (!CHAT_ROLES.contains(userRole)) {
      return;
    }

    if (!message.startsWith("!")) {
      return;
    }

    Role oppositeRole = userRole == Role.Zabusa ? Role.Haku : Role.Zabusa;

    for (Player receiver : Bukkit.getOnlinePlayers()) {
      if (getUser(receiver.getUniqueId()).getRole() == oppositeRole) {
        receiver.sendMessage(BLUE + userRole + " : " + GOLD + message.substring(1));
        player.sendMessage(BLUE + userRole + " : " + GOLD + message.substring(1));
      }
    }

  }

This does pretty much the same with the common code extracted.

#

Go ask on the skript discord

lost matrix
# steel swan oh i seee

Actually this might be a bit cleaner

  private static final Map<Role, Role> CHAT_ROLES = Map.of(
          Role.Zabusa, Role.Haku,
          Role.Haku, Role.Zabusa
  );

  @EventHandler
  public void onMessageSend(PlayerChatEvent event) {
    Player player = event.getPlayer();
    User user = getUser(player.getUniqueId());
    String message = event.getMessage();
    
    if (!hasStarted) {
      return;
    }

    event.setCancelled(true);

    Role userRole = user.getRole();
    Role oppositeRole = CHAT_ROLES.get(userRole);
    
    if(oppositeRole == null || !message.startsWith("!")) {
      return;
    }
    
    for (Player receiver : Bukkit.getOnlinePlayers()) {
      if (getUser(receiver.getUniqueId()).getRole() == oppositeRole) {
        receiver.sendMessage(BLUE + userRole + " : " + GOLD + message.substring(1));
        player.sendMessage(BLUE + userRole + " : " + GOLD + message.substring(1));
      }
    }

  }

Its expandable for more roles.

grim ice
#

yall have ideas i can learn on

#

some topics or smth

lost matrix
lost matrix
#

CompletableFutures?

grim ice
#

yes

noble lantern
#

functional interfaces are the best ongod

#

pair a functional interface to a future and ohmygod

lost matrix
grim ice
#

yes

lost matrix
grim ice
#

yes

lost matrix
#

Orchestration with Semaphores and Locks?

noble lantern
#

yes

grim ice
#

what

#

lmao

noble lantern
#

thats like

#

literally basic java

#

week 1 stuff

grim ice
#

definitely

lost matrix
#

synchronized keyword, locks, semaphores, executors etc

grim ice
#

70% of that

#

locks and synchronized key word and executors yes

#

idk what the heck is a semaphore

#

we in high school?

lost matrix
#

Well then its time for some frameworks.
I would highly suggest Redisson.

grim ice
#

redis framework?

lost matrix
#

Yes

grim ice
#

hm

#

idk whats a semaphore and why u need redis for it

lost matrix
#

Redis is the most powerful tool for multi instance networks

grim ice
#

i know that

#

but what is a semaphore lol

lost matrix
#

Another thing you can try is communication through sockets.

grim ice
#

OH

#

A LOCK

#

A TYPE OF LOCK

lost matrix
grim ice
#

yes yes

#

makes sense

cunning canopy
#

tps dros to 19.99 when I run a command

#

is that allright?

noble lantern
#

whats the command doing

lost matrix
#

Unplayable. Almost crashing the server.

noble lantern
#

^

#

God i finally have this stupid auth server finished

#

Hey smile question

grim ice
# cunning canopy tps dros to 19.99 when I run a command

the amount of stress you caused to your server made it produce extremely high amounts of temperature that had the FBI and CIA and the russian government concerned and prepared for wide range nuclear explosions, you caused a catastrophe!

noble lantern
#

Is there any tools or way, to where i can clone a github repo, and have it be built on a linux machine?

noble lantern
#

But money

noble lantern
#

i should of mentioned free

lost matrix
#

jenkins is free

noble lantern
#

oh

grim ice
#

go for the basement!

#

btw smile

#

whats orechestrwowthwuaoehaweu

noble lantern
#

i think i need to plug my own server in

grim ice
#

orchestration

noble lantern
#

gonna be like 4 different server instances

grim ice
#

cant believe i spelled it right

noble lantern
#

Orchestra?

lost matrix
grim ice
#

i mean thats pretty vague

lost matrix
#

Yes it is. Go for other topics.

lost matrix
#

Serialisation with Gson. This one is really hard to master.
Im at the point where i dont have to manually write any serializer anymore
because my uber Gson instance can serialize everything from records to interfaces

grim ice
#

gson is easy to use though

#

its mad easy

#

or is that sarcasm

lost matrix
grim ice
#

not sure

#

i use it for serializing config files

#

not in spigot btw

noble lantern
#

but

#

i also heard jenkins is a bitch to setup

opal juniper
#

not really that hard

noble lantern
#

I would love to just be able to build on my local pc, and when it builds it pushed the jar to my linux server

opal juniper
#

i use it for posting my python package to pip when i make a new release

noble lantern
#

idk if i rly need something like jenkins for that or not

#

Dont know how any automation stuff rly works

noble lantern
#

same with nodejs

#

i could create my own auto deployment with nodejs but with java idk how lmao

cunning canopy
#

I need to spawn cages for a minigame. Any way to use a schematic or something to have the same build spawn at multiple places without using too much resources?

grim ice
#

what is lru

sage patio
#

How i can get a List of a value in a MySQL table?
like my table has name and uuid
how i can create a List of uuid?

eternal night
#

I mean SELECT uuid FROM table and then iterate over the result set ?

grim ice
#

💀

eternal night
#

List of uuid 👀

sage patio
#

UUID is stored as String in database

#

so whatever

eternal night
#

Well then still do the same

#

but just get the uuid collum as a string ?

lost matrix
opal juniper
grim ice
#

this conversation is making me lose brain cells

opal juniper
grim ice
sage patio
grim ice
#

saying the first 2 words u see in google isnt that much of an explanation yk but thanks

lost matrix
#

Every db supports uuids natively and its infinitely faster than varchar

grim ice
#

i did but i didnt understand much honestly

#

well

sage patio
grim ice
#

may you explain how it works

rotund scroll
#

can someone help me with thius erorr log

lost matrix
lost matrix
undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

sage patio
grim ice
#

make a tag

#

for

rotund scroll
#

ye i was gonna

#

but

#

i couldnt upload the error log

#

file

#

no perms to

sage patio
sage patio
rotund scroll
# sage patio so we can't help you without any logs

Current Thread: Server Thread
[21:37:41] [ERROR]: [tchdog Thread] PID: 52 | Suspended: false | Native: true | State: RUNNABLE
[21:37:41] [ERROR]: [tchdog Thread] Stack:
[21:37:41] [ERROR]: [tchdog Thread] java.net.SocketInputStream.socketRead0(Native Method)
[21:37:41] [ERROR]: [tchdog Thread] java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
[21:37:41] [ERROR]: [tchdog Thread] java.net.SocketInputStream.read(SocketInputStream.java:171)
[21:37:41] [ERROR]: [tchdog Thread] java.net.SocketInputStream.read(SocketInputStream.java:141)
[21:37:41] [ERROR]: [tchdog Thread] java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
[21:37:41] [ERROR]: [tchdog Thread] java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
[21:37:41] [ERROR]: [tchdog Thread] java.io.BufferedInputStream.read(BufferedInputStream.java:345)
[21:37:41] [ERROR]: [tchdog Thread] sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:735)
[21:37:41] [ERROR]: [tchdog Thread] sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:678)
[21:37:41] [ERROR]: [tchdog Thread] sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1590)
[21:37:41] [ERROR]: [tchdog Thread] sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1495)
[21:37:41] [ERROR]: [tchdog Thread] java.net.URL.openStream(URL.java:1093)

#

thats a shortened version

chrome beacon
#

?paste

undone axleBOT
chrome beacon
#

Need all of it

rotund scroll
#

it works on our test server but not in our production server

sage patio
#

^

opal juniper
#

to make space

opal juniper
#

Well, age as in when it was added

eternal night
#

PaperSpigot kekw

grim ice
#

is just kicked

#

ic

#

thats pretty dumb if u ask me

#

had to use "dumb" cuz "This message can’t be posted because it contains content blocked by this community. The message may also be viewed by the community owners."

#

r word is blocked 💀

chrome beacon
rotund scroll
#

oh

grim ice
#

owo

rotund scroll
#

How do i not run it on the main thread

eternal night
#

also on a minecraft version that is old enough to go to kindergarden

rotund scroll
#

ive done it before but refresh my memory

#

its been a while

eternal night
#

either use a completable future on its fork join thread pool or the bukkit scheduler provides async run methods

grim ice
#

use bukkit scheduler

#

much easier to use and u should def use it if ur using bukkit lol

rotund scroll
#

alr

#

ty

chrome beacon
#

?scheduling

undone axleBOT
chrome beacon
#

^

noble lantern
#

imma use futures

#

because my future so bright

#

that i always gotta be

#

looking in the future

grim ice
#

very emotionally moving words

#

im in tears

cunning canopy
#

can a method of the eventlistener class be non static?

eternal night
#

they should all be non static

cunning canopy
#

oh

compact haven
#

Lol what

eternal night
#

public void <methodName>(<EventType> eventVarName)

compact haven
#

You create the instance when registering the listener

#

why would it be static

quaint mantle
#

Doesnt matter if its static or not

#

Its just normal to keep it non-static

#

people dont like static

#

if you instantiate a listener, the listener methods should be available to that instance

#

ig

#

idk the dimensions

eternal night
#

if you wanna check below that block for more air is up to you

crude loom
#

Why does InventoryOpenEvent doesn't fire?

humble maple
#

does anyone have any commandapi?

eternal night
#

like command framework ?

humble maple
eternal night
noble lantern
#

update i found a way to make my own auto deployment

#

i made a script that clones the repo and then builds with gradle and shoves the gradle file to the server directory whytho

quaint mantle
#

?paste

undone axleBOT
quaint mantle
#

ignore

hard socket
#

help pls

eternal night
#

replacing a plugin jar file while it is open might not play too well

hard socket
#

i didnt

eternal night
#

I mean

#

that is the only time that error usually pops up

hard socket
#

well it i dont

#

its not even creating the package

quaint mantle
#

you still have to /rl or /restart tho

severe turret
#

How do i cancel a command 🤔

quaint mantle
#

twitter works well

unkempt peak
severe turret
#

?

unkempt peak
#

Did you make the command?

severe turret
#

well yeah

#

I guess I can return false

crude loom
#

Is there a way to detect player movement that was only done by the player?

severe turret
#

but that would send the usage messages

unkempt peak
#

No return true with your own error message

severe turret
#

oh right

#

im dumb

#

ty

eternal night
#

don't you only need the block at 8 ?

#

for middle

rotund scroll
#

hi im probably dumb

#

but

#
public static boolean checkNicked(UUID uuid) {
        AtomicReference<Boolean> nicked = new AtomicReference<>(false);
        try {
            Runnable runnable1 = () -> {
                try {
                    BufferedReader in = new BufferedReader(new InputStreamReader(new URL("http://45.151.135.0:3005/checkNick?uuid=" + uuid.toString() + "&token=e
").openStream()));
                    nicked.set(Boolean.parseBoolean((((JsonObject) new JsonParser().parse(in)).get("nicked")).toString()));
                    in.close();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            };

        } catch (Exception e) {
            System.out.println(e);
            System.out.println("checkNicked error");
            nicked.set(false);
        }
        return nicked.get();

    }
#

why isnt that working

eternal night
#
final int chunkXInRealWorld = chunk.getX() << 4;
final int chunkZInRealWorld = chunk.getZ() << 4;
world.getHighestBlockAt(chunkXInRealWorld + 8, chunkZInRealWorld + 8);
#

would do it no ?

quaint mantle
# lost matrix Well either way you need to schedule the job outside of the window and let it ta...
15 2 * * * tmux send-keys -t ${SERVER} "broadcast Server is restarting in &c45 minutes&7!" Enter
30 2 * * * tmux send-keys -t ${SERVER} "broadcast Server is restarting in &c30 minutes&7!" Enter
45 2 * * * tmux send-keys -t ${SERVER} "broadcast Server is restarting in &c15 minutes&7!" Enter
50 2 * * * tmux send-keys -t ${SERVER} "broadcast Server is restarting in &c10 minutes&7!" Enter
55 2 * * * tmux send-keys -t ${SERVER} "broadcast Server is restarting in &c5 minutes&7!" Enter
56 2 * * * tmux send-keys -t ${SERVER} "broadcast Server is restarting in &c4 minutes&7!" Enter
57 2 * * * tmux send-keys -t ${SERVER} "broadcast Server is restarting in &c3 minutes&7!" Enter
58 2 * * * tmux send-keys -t ${SERVER} "broadcast Server is restarting in &c2 minutes&7!" Enter
59 2 * * * tmux send-keys -t ${SERVER} "broadcast Server is restarting in &c1 minute&7!" Enter
15 59 2 * * * tmux send-keys -t ${SERVER} "broadcast Server is restarting in &c45 seconds&7!" Enter
30 59 2 * * * tmux send-keys -t ${SERVER} "broadcast Server is restarting in &c30 seconds&7!" Enter
45 59 2 * * * tmux send-keys -t ${SERVER} "broadcast Server is restarting in &c15 seconds&7!" Enter
50 59 2 * * * tmux send-keys -t ${SERVER} "broadcast Server is restarting in &c10 seconds&7!" Enter
55 59 2 * * * tmux send-keys -t ${SERVER} "broadcast Server is restarting in &c5 seconds&7!" Enter
56 59 2 * * * tmux send-keys -t ${SERVER} "broadcast Server is restarting in &c4 seconds&7!" Enter
57 59 2 * * * tmux send-keys -t ${SERVER} "broadcast Server is restarting in &c3 seconds&7!" Enter
58 59 2 * * * tmux send-keys -t ${SERVER} "broadcast Server is restarting in &c2 seconds&7!" Enter
59 59 2 * * * tmux send-keys -t ${SERVER} "broadcast Server is restarting in &c1 second&7!" Enter
0 3 * * * tmux send-keys -t ${SERVER} "broadcast &4Server is restarting&c..." Enter
0 3 * * * tmux send-keys -t ${SERVER} "stop" Enter```
grim ice
#

@steel swan btw

#

u shouldnt do

#

"if (String.valueOf(message.charAt(0)).equals("!"))"

#

u can just

#

if (mssage.charAt(0) == '!')

#

no need to wrap a string

deft axle
#

I'm having issues with implementing the spigot 1.19 jar into my old plugin that I haven't messed with since 1.17; it tells me all the bukkit imports and such can't be resolved, i.e. import org.bukkit.Bukkit can't be resolved

sterile token
deft axle
#

I am not entirely sure how to do that whoops

sage patio
#

this gives me a NullPointerException for PreparedStatement line

waxen plinth
#

Connection is probably null

sage patio
waxen plinth
#

Print connection

paper viper
#

Suppose I want to find the coordinate that a player clicked at on an map (that is inside an item frame). Not sure how to approach this at first, but could I first assume the map as a plane axis and get the player clicked direction as a vector, and find the intersection point between a vector and plane in 3d space? Im not sure what the proper way would be.

sage patio
#

because if its null why plugin is still running

eternal night
#

maybe because connect just doesn't properly set it

eternal night
sage patio
#

to it is fine?

eternal night
#

?paste

undone axleBOT
sage patio
#
public void connect() throws SQLException {
        if (!isConnected()) connection = DriverManager.getConnection("jdbc:mysql://" +
                host + ":" + port + "/" + database + "?useSSL=" + ssl, username, password);

    }

    public void createTables() {
        PreparedStatement preparedStatement;
        try {
            preparedStatement = connection.prepareStatement(
                    "CREATE TABLE IF NOT EXISTS " + playersTable + "(uuid VARCHAR(255), name VARCHAR(16), PRIMARY KEY (uuid))");
            preparedStatement.executeUpdate();
            preparedStatement = connection.prepareStatement(
                    "CREATE TABLE IF NOT EXISTS " + experienceTable + "(uuid VARCHAR(255), xp INTEGER, PRIMARY KEY (uuid))");
            preparedStatement.executeUpdate();
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
noble lantern
#

uwu

eternal night
#

is MySQL a field name ??

sage patio
eternal night
#

how are you calling a non static method then

sage patio
paper viper
sage patio
paper viper
#

I’ll research some stuff

eternal night
#

iirc the map's location should be its centre ?

waxen plinth
sage patio
#

it was not static

#

that was the problem

eternal night
#

static was the problem

sage patio
#

problen?

eternal night
#

sorry, too late for spelling xD

sage patio
#

xd np

#

its 1 and 5 but prints 1 and 2

eternal night
#

getRow is not how you do that

sage patio
#

resultSet.getInt(resultSet.getRow())?

eternal night
#

no

#

read through a tutorial

#

specifically this part

#

on how to grab results from a result set

sage patio
#

fixed thanks

sage patio
#

i don't know how to get top 10 players from a database has 2 tables
table 1 is Player UUID and XP
table 2 is Player username and UUID
how i can store top 10 players in a hashmap? (Username and XP)

eternal night
#

join the two tables

#

and then order by and limit

sage patio
eternal night
#

Ah

#

give me like 4 mins to finish my game

humble tulip
#

I cba to type the query out

sage patio
#

@eternal night like this?

eternal night
#
SELECT username, xp
FROM players
     JOIN xp x on players.uuid = x.uuid
ORDER BY xp DESC 
LIMIT 10
formal bear
#

Are static variables like Inventories safe or it's better to store them inside something?

eternal night
#

would yield you the top 10 players in regards to xp by name and xp

eternal night
formal bear
#

I have gui inventory method which returns inventory then i want to access it in two other classes

eternal night
#

Wouldn't you want that inventory in a Map<UUID, Inventory> anyway tho ?

#

else how would your plugin handle two players using the inventory at the same time

formal bear
#

So Map okay

sage patio
#

Table 1 (name: players) is Player UUID (name: uuid) (key) and XP (name: xp)
Table 2 (name: experience) is Player UUID (name: uuid) (key) and Username (name: name)
can you gimme another example with this information? thanks

young knoll
#

x is the name to refrence the xp table

sage patio
#

ow

eternal night
#

you don't really need it

#

my tabled was named xp too tho

#

so I added it

young knoll
#

You can probably just natural join that

#

If both have a column with the same name

sage patio
#

i think this works
SELECT uuid, xp FROM experience JOIN xp x on players.uuid = x.uuid ORDER BY xp DESC LIMIT 10

eternal night
#

eh

#

no

sage patio
#

i've to change player yes?

eternal night
#

JOIN xp x

#

makes no sense

#

if your table is named experience

#

also if you start from experience, you'd join player

sage patio
#

my brain is not working correct

#

sorry

eternal night
#
SELECT username, xp
FROM players
     JOIN experience on players.uuid = experience.uuid
ORDER BY xp DESC
LIMIT 10
#

for example

sage patio
#

thanks

eternal night
#

note, we can drop the table identifier here

paper viper
#

sleep

eternal night
#

as we don't have a name collision

sage patio
eternal night
#

nah pulse, finishing this is gonna be the best feeling

#

yeaaa

paper viper
#

lol

sage patio
eternal night
#

ah

#

just the name thingy

young knoll
#

You can get name from uuid

eternal night
#

so name

young knoll
#

But it’s a bit sketchy

eternal night
#

instead of username

#

I mean, no need for a mojang auth request if you have it in your DB

young knoll
#

Well

#

If they’ve played before it’ll be in the cache

sage patio
#

if this will not work i delete IntelliJ IDEA
"SELECT name, xp FROM " + playersTable + " JOIN " + experienceTable + " on " + playersTable + ".uuid = " + experienceTable + ".uuid ORDER BY xp DESC LIMIT 10;"

young knoll
#

Don’t forget the ;

#

Even though it’s not strictly required

humble tulip
#

Space before first Join

#

After players table

#

playersTableJOIN

#

experienceTableuuid

#

Ofc it won't work

sage patio
humble tulip
#

?

sage patio
#

like playersJOIN ?

humble tulip
#

no

sage patio
sage patio
#

" JOIN "

#

i can't see it

humble tulip
#

OHH

#

I'm on mobile

sage patio
#

lol np

humble tulip
#

Rotating my phone showed me the space

sage patio
#

np

humble tulip
#

Mb

sage patio
#

i need to sort it with XP

#

not username

young knoll
#

It should be sorted by the experience column

wanton lynx
#

Hey I have a question is anyone available

quaint mantle
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

sage patio
#
public static HashMap<String, Integer> getTopPlayers() throws SQLException {
        String playersTable = Utils.getConfig("database.players_table"), experienceTable = Utils.getConfig("database.experience_table");
        HashMap<String, Integer> players = new HashMap<>();
        PreparedStatement preparedStatement = MySQL.getConnection().prepareStatement(
                "SELECT name, xp FROM " + playersTable + " JOIN " + experienceTable +
                        " on " + playersTable + ".uuid = " + experienceTable + ".uuid ORDER BY xp ASC LIMIT 10;");
        ResultSet resultSet = preparedStatement.executeQuery();
        while (resultSet.next()) {
            players.put(resultSet.getString("name"), resultSet.getInt("xp"));
        }
        return players;
    }
try {
                    Utils.getTopPlayers().forEach((String username, Integer xp) -> {
                        player.sendMessage(username + " " + xp);
                    });
                } catch (SQLException e) {
                    throw new RuntimeException(e);
                }
young knoll
#

Ah

#

Hashmap will yeet the order

wanton lynx
#

Erm so I was looking through the website and was wondering if there was any good /vanish plugins you could recommend

sage patio
#

ok thanks

eternal night
#

imajin predicting the future

sage patio
#

nice

quaint mantle
#

🙂

young knoll
#

69

sage patio
#

:D

sage patio
#

@eternal night i think if i sleep rn, i will wake up 3 or 4 more days

eternal night
#

lmao xD

sage patio
#

so gn

#

or maybe good morning *

eternal night
#

gn xD glad you figured it out 🙂

sage patio
#

yes

#

thanks

noble lantern
#

Does anyone know of any good web panels that let me create and manage VM/VPSs? Preferably one I can install on my own server node

Not like VirtualBox, I want something a little more and ptero doesn't really cut the needs cause I want root access to the VMs not just have a docker instance

I want a tool like some VPS hosting companies have, being able to look through a web panel and view statistics about the overall dedi and vms, create VMS, view databases, and manage other things about the server (Like cPanel/sPanel has) I would use one of those two but I don't wanna spend money on just something ill have locally for a while and not gonna be deployed remotely as of now

sterile token
#

Let me find the name

sterile token
vast zenith
#

So im making a plugin that runs a command through console, and i want people to be able to change the message it sends but I don't really understand how to do it. I got the config to generate but I don't know how to get it to run the commands like I want

#

import org.bukkit.Bukkit;
import org.bukkit.scheduler.BukkitRunnable;
import world.pokeorigins.mc.pokeclear.PokeClear;

public class Broadcast extends BukkitRunnable{

    PokeClear plugin;


    public Broadcast(PokeClear plugin) {
        this.plugin = plugin;

    }

    @Override
    public void run() {
        Bukkit.getServer().dispatchCommand(Bukkit.getConsoleSender(), "broadcast §bPokemon have been cleared");
    }



}```
#

it pretty much every hour runs the command broadcast

#

but I want to be able to change the message in the config after the word broadcast

sterile token
sterile token
ornate patio
#

how do i check if a block is a door

sterile token
ornate patio
#

yeah but there isnt a built in way to check if its one of the 5 kinds of doors

#

whatev I did this

#
public static final EnumSet<Material> MATERIALS = EnumSet.noneOf(Material.class);

static {
    for (Material material : Material.values()) {
        if (material.toString().contains("DOOR")) {
            MATERIALS.add(material);
        }
    }
}
quaint mantle
#

@ornate patio

sterile token
#

?di

quaint mantle
#

instanceof

undone axleBOT
worldly ingot
#

I'll do you one better

#

Tag.DOORS.isTagged(material)

quaint mantle
#

Ok

sterile token
quaint mantle
#

hop on rocket league

sterile token
#

😂

worldly ingot
#

Playing Minecraft with my girlfriend

quaint mantle
#

Couple goals

sterile token
#

If i can know

quaint mantle
#

22

worldly ingot
#

22

quaint mantle
#

Slow

sterile token
#

haha

worldly ingot
#

I was tabbed out starting lofi girl

sterile token
#

i suppouse she is the one on the photo

worldly ingot
#

Yes

sterile token
#

Oh you looks pretty much well together

#

Its really nice

worldly ingot
#

tyty

sterile token
#

I thought you where 17-18

noble lantern
#

ill look into it

#

gotta wait for this dedi to deploy time for a coffee

sterile token
#

Burch a friend told me

#

I just send it to you ==> <==

#

☝️

#

You can also have others alternatives like cPanel

noble lantern
#

yes but cpanel costs money

#

i would use sPanel if it was open source

#

gonna try ispconfig and see what thats like

noble lantern
#

oh shit

#

spanel is free

sterile token
#

Hi, is a dumb question but im thinking about it. But the runnable is not running

sterile token
#

Ok

#

Burch wait me please

#

I will send in 1 minute

#

Paste md5 doesnt load

#

:mad:

sterile token
#

Sorry for time but pastemd5 wasnt loading

#

I think the issue is caused by the TImeUnit because it was working before

#

Burch?

desert loom
#

I think it's because you're passing milliseconds for the period.

noble lantern
#

if so you can pass it to Instant/Date instead of doing that wonky transform

#

in reguards to it not working

#

it should work uhm

#

im not sure never overrided BukkitRunnables before

sterile token
#

Allrgiht

sterile token
#

Also on git how can ignore every target directory from the modules?

noble lantern
#

add .idea/ too to ignore idea files

desert loom
#

and since period is in ticks it's treating that like 1000 ticks

sterile token
#

But wait

#

ill ignore modules target?

#

Because i have modules. menu and file which contains a target directory

#

Will them ignored?

noble lantern
#

hmmm

#

for that you may need to ignore in the module directory

#

ive never git ignored like that before

#

i would assume

#

target/* ignores every folder named target

sterile token
#

allright

#

i will try

#

Thanks man

noble lantern
#

while target/ ignores just the target folder in the base directory (hence why .idea/ doesnt have a * at the end)

#

** is also another thing

sterile token
noble lantern
#

in fact ** might be entire module

#

no

#

target/*

#

here

#

ill send link

sterile token
#

ok

sterile token
#

thanks and sorry for being annoying

noble lantern
#

nono its fine gitignore is annoying

#

i was doing soething a few months back, it was different i think iwas trying to gitignore a private key file inside the code and it didnt wanna work lol

sterile token
#

wait its possible to ignore keywords form being upload to git?

#

Lmao i would love to know that

golden turret
#
.idea/
.gradle/
**/build/``` my gitignore
sterile token
#

what mean double **

#

Sorry for my ignorance

#

But im not enogught skilled with git

sterile token
noble lantern
#

i just found this most badass thing holy shit

wind shoal
#

Any idea why maven can't resolve spigot 1.19? Unresolved dependency: 'org.spigotmc:spigot:jar:1.19-R0.1-SNAPSHOT'

lost matrix
lost matrix
wind shoal
stark nebula
#

So I've just started with spigot & java - and have been making a few simple plugins to learn.

I'm trying to get all the blocks of a certain type in X chunk.
Is there any already existing methods that I would use, or do I scan through every block in the chunk I need
and compare it's type?

That's obviously exceedingly inefficient and resource intensive, but not sure if there's a better way to do it.

ornate patio
#

is it possible to play the hand animation from the server side

#

as in, for example a player right clicks some bricks with a stick

#

i want the animation of the player swinging their hand to be there

sterile token
#

okay1203, i dont think because i know that the server only displays the player itself in the server to all the players

#

But im NOT really sure

sterile token
teal lodge
#

ok sorry

dusty herald
#

hey why is my server not running

#

can you fix it please

errant narwhal
#

Someone help me please i try to make plugin with 1.19 bukkit but it can't import using buildpath can someone share totorial how to import bukkit file using maven pls

dusty herald
#

i just installed a new skript addon and now my server wont run

#

and it says spooky things like "hecked ur serevr"

dusty herald
#

yes

#

on my serevr

errant narwhal
dusty herald
#

no i ask here

lost matrix
errant narwhal
lost matrix
#

lol

lost matrix
dusty herald
#

sorry im high and watching a show

#

bri

#

shes

#

fucking insane

#

did he booby trap the car

#

@quaint mantle

quaint mantle
#

Nop

dusty herald
#

oh ok thank you

#

WHAT THE FUCK

#

WHY IS HE

quaint mantle
#

Whut

lavish folio
#

how can i set log type to birch in 1.8?

ashen quest
#

1.8 🥲

quiet ice
lavish folio
#

Deprecated

quiet ice
#

Deprecated as in "this method doesn't make Sense, yet it exists"

#

It is Safe to use in 1.8

#

In 1.13 and above you should never use it however

lavish folio
#

thanks working

quiet ice
#

This is the Main reason I despise 1.8 - 1.12

latent bone
#

I'm pretty much new to Spigot and Paper, please don't judge how messy this is.
Anyway, this works. But however, when I try to craft the item named "Reroll Item" it gives me the first recipe, which was an Enchanted Golden Apple instead. Can anyone help? Thanks 😄

quiet ice
#

When you initialize SR1 you use Item, Not item1

#

Also, avoid using the mc namespace when it makes No sense

latent bone
#

i was looking everywhere ty

earnest forum
#

?jd-s

undone axleBOT
tardy delta
tardy delta
#

what kind of executor is best suited for database operations? im intending to provide it to the completablefuture instead of the common pool

#

basically do some db queries once in a while

ivory sleet
#

What type of db is it, is the tasks cpu bound or io bound?

#

Altho in general I personally prefer a work stealing pool in scenarios like these with async mode enabled that is

tardy delta
#

but what do you mean if the tasks are cpu or io bound?

ivory sleet
#

Depending on that you might wanna adjust the parallelism of the pool

#

If some tasks are cpu bound the usually there’s no point in going over the amount of processors when choosing the parallelism

tardy delta
#

well its mostly loading playerdata stuff and saving things so im not sure

#

i think mostly io as its a database? ¯_(ツ)_/¯

ivory sleet
#

Yeah h2 is mostly io bound

#

In that case you could go with a higher parallelism than the amount of available processors

tardy delta
#

dont really know what parallelism is

#

the amount of tasks it can run at the same time?

ivory sleet
#

It’s the amount active workers the pool will try to maintain

#

The amount of threads can still be more tho

tardy delta
#

ah

ivory sleet
#

The biggest advantage of fjp provided you use it in async mode is that you get a queue per worker

#

And a worker can basically steal another worker’s tasks on their queue

#

A normal thread pool executor only has a single queue for the tasks before they get executed

tardy delta
#

and what the advantage of having a queue per worker then? faster?

tardy delta
#

hmm

ivory sleet
#

Else a fixed thread pool where you configure M:N (core pool size:max pool size) is fine

#

But yeah you should probably read about littles law and what the notion of a blocking coefficient means, that might help you a bit to configure the values of whatever pool you’re gonna use

tardy delta
#

hmmm

#

if im understanding it correctly, the blocking coefficient is the percent of the time that a task is blocking and waiting for input or something?

#

not sure about the blocked part

cunning canopy
#

how would I create a new task that runs 30 times with 1 second between each time and then schedule it?

tardy delta
#

?scheduling

undone axleBOT
cunning canopy
#

I saw it

#

but I dont understand the values

#

like

#

what does 30L mean

eternal oxide
#

L signifies its a long

cunning canopy
#

a long for what

#

ticks?

eternal oxide
#

yes

cunning canopy
#

so it waits so many ticks before doing the task?

#

gameStartCountDown.runTaskTimer(this.plugin, 20L, 30L); will this run the Runnable 1 time per second for 30 seconds?

eternal oxide
#

in 30 ticks it will start the task and run it every second forever

#

or the other way around

#

I forget which is delay and which is interval

#

interval, is second one, so starts in 20 ticks and runs every 30 ticks from them on

cunning canopy
#

the first is the delay

eternal oxide
#

yes

cunning canopy
#

okay

#

but

#

how woild I set it to only run for 30 seconds

#

would

#

lol

eternal oxide
#

you keep a count inside the task and cancel it when you reach 30

cunning canopy
#

how do I cancel from within the run function?

eternal oxide
#

you didn;t read that scheduling page fully did you

#

this.cancel()

cunning canopy
#

but

#

nvm

#
BukkitRunnable gameStartCountDown = new BukkitRunnable() {
            private int count = 30;
            private final Mgames plugin;
            
            public BukkitRunnable(Mgames plugin) {
                this.plugin = plugin;
            }
            
            @Override
            public void run() {
                if (count == 0) {
                    this.cancel();
                }
                Bukkit.broadcastMessage("Seconds: "+count);
                count--;
            }
        };
        gameStartCountDown.runTaskTimer(this, 0L, 20L);
``` How do I access the main plugin from within the BukkitRunnable I realized this would not work
cunning canopy
#

That a thing?

#

Can you get already initialized objects by class. This

#

Will it return the initialized objects of that class?

lost matrix
#

No?

#

Its the same as this
You just specify the full qualifier

cunning canopy
#

Kk thanks

#

So that way you can do it in a nested class?

tardy delta
#

dont you need to do a return after the cancel() too?

cunning canopy
#

Run is a void though..

#

Oh nvm

#

Idk if I do

torn oyster
#

hi

lost matrix
#

oi

eternal oxide
#

I'm late back to the discussions but, learn Dependency Injection to get the Plugin instance. However my favourite at the moment is java JavaPlugin.getProvidingPlugin(this.getClass())

lost matrix
#

Unless he calls it with PluginName.class

eternal oxide
#

ah yep, he's inside a runnable

#

actually he's not

lost matrix
#

He can just do

YourPlugin plguin = YourPlugin.this;

If the runnable is an anonymous class inside his JavaPlugin

eternal oxide
#

this is for scheduling so it shoudl work. its taking the current class

#

its getProvidingPlugin not getPlugin

lost matrix
#

I thought he wanted an instance inside of his runnable

eternal oxide
#

gets teh Plugin that provided this class

#

ah nope

#

just to schedule I believe

cunning canopy
noble lantern
#

Sorry to barge in with some random bullshit but maybe someone knows something about this

Does anyone know how to allow lets encrypt to use a secondary IP to create a SSL record against?

I have a subdomain that points to a secondary IP my server has (Yes it points to the server, i can use both ips to ssh in the server so im not sure why lets encrypt says this to me)

eternal oxide
#

then I'm wrong

eternal oxide
noble lantern
eternal oxide
#

It says (154.53.58.245) is teh resolved IP for panel.civ-server.cloud

noble lantern
#

Yeah thats the secondary IP

#

the main IP is the other

ivory sleet
eternal oxide
#

oh are you specifying the other IP when setting up?

ivory sleet
#

I mean he creates an anonymous subordinate/subclass

short raptor
#

Say I have a config file

test:
  item1: 1
  item2: 409358
  item3: -2304230

How can I remove just one of these items from here?

noble lantern
#

itll work with the main ip im sure of that

#

but for some reason it doesnt like the secondary one

#

I did just change my name servers to my providing IP so maybe that will help sec

tardy delta
short raptor
#

I thought that would just set it like item2: null

#

Admittedly I didn't test though

eternal oxide
#

nulls can;t exist in a config outside of an enclosing object like a List

quiet ice
#

Actually they can, Just in another way iirc

eternal oxide
#

they have to be enclosed in something

#

setting any element to null removes it

noble lantern
eternal oxide
#

yay!?

noble lantern
#

didnt know that was a thing but alright

tacit drift
#

Not a spigot problem, but I have started a local webserver using java and when trying to use a script.js in a html file it doesn't use the content of the file

#

does anyone have any idea on why it's like that? :))

eternal oxide
#

I don't see you using the script anywhere

tacit drift
#

i don't need to, it's "loaded" in the head

#

if i just open root.html in my browser, it works as expected, logs to the console "Test!"

quiet ice
#

Use Firefox, it has a Mode to intercept all Network Traffic coming from the browser

#

If it does not GET your Script, then you have a serious issue

tacit drift
#

i think i know that the problem is

quiet ice
#

If the GET is sent, but the Server responds with 404, then the Script is Not there