#help-development

1 messages · Page 1469 of 1

wraith rapids
#

also that

#

simply add jitpack as a repository

past vapor
#

im ngl bro

#

i have no clue how to do that

#

nor do i know what jitpack is

wraith rapids
#

do you know how to add a repository

#

you've done it once for bukkit/spigot/whatever

#

you just need to copy it and change the values

past vapor
#

I cant remember how to do it lmao

wraith rapids
#

control-C

past vapor
#

bruh

wraith rapids
quaint mantle
#
<repositories>
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>
    </repositories>
past vapor
#

what am i copying tho

wraith rapids
#

the repository

past vapor
#

add that to my pom.xml?

quaint mantle
#

yes

past vapor
#

ite but i dont know what that did

wraith rapids
#

don't add it whole

#

show your pom.xml

past vapor
wraith rapids
#

yes, that's right

#

the dependencies list lists the things your build depends on

past vapor
#

ah right

wraith rapids
#

the repositories list lists the places where the things can be found in

past vapor
#

so its depending on jitpack?

wraith rapids
#

you are depending on BetterRTP

past vapor
#

their documentation is in json?

wraith rapids
#

wut

past vapor
#

bro i

#

my fucking brain

#

ong

#

shit ur saying means nothing to me ngl

wraith rapids
#

what you're looking at is not documentation

#

it's a list of builds

vocal mirage
#

is it possible to get help ?
Thanks

wraith rapids
#

that is accessed by maven

#

maven looks through the list and finds the jar described in dependencies

past vapor
#

right

#

it looks like BetterRTP hasnt rlly been imported in the format it wants

covert bluff
#

I am making an AFK plugin, and it adds them to a team called AFK, which is made by the plugin if there isn't already an existing one. After they get removed from the AFK status, I want to put back their previous team (if they had any). how would i do this? a method i haven't tried yet that i've thought of just now is putting the player in a hashmap, with their uuid as the key and the team as the object. is this method fine, or is there a more efficient one?

wraith rapids
#

for example, your bukkit dependency is as such

#
        <dependency>
            <groupId>org.bukkit</groupId>
            <artifactId>bukkit</artifactId>
            <version>1.15.2-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
#

first it finds the group id

#

which would be this

#

org.bukkit -> org/bukkit

wraith rapids
#

then it finds the artifact itself

#

which is simply bukkit

#

which would be this

#

then it finds the version you described

past vapor
#

right ok

past vapor
#

How would i do that for this instance?

#

of betterrtp

#

thats wat i dont get here

wraith rapids
#

unless I missed something you already did it

#

you added betterrtp in your dependencies

past vapor
#

its still fucked

wraith rapids
#

what is fucked

wraith rapids
#

and what are the errors

past vapor
#

Dependency not found

wraith rapids
#

jitpack uses different values for the dependency list

#

see the examples

#

click on the maven button

past vapor
wraith rapids
#

yes, read what i said

past vapor
#

I did

#

i dont know what youre saying

wraith rapids
#

read the page

past vapor
#

oh shit

#

wait

#

ok i got the groupId and artifactId

#

but idk abot the version and packaging

wraith rapids
#

remove the packaging tag

#

that isn't supposed to be there and is there only because you blindly cuntpasted it from their pom.xml

past vapor
#

looool

wraith rapids
#

tag refers to these

past vapor
#

accidentally pressed x on the fucking maven button

#

how does one unfuck it

#

and be able to press it again

wraith rapids
#

i don't know what you're talking about

past vapor
#

nvm im jus hella retarded rn

#
<dependency>
            <groupId>com.github.SuperRonanCraft</groupId>
            <artifactId>BetterRTP</artifactId>
        </dependency>```
#

its still fucked up

#

it doesnt like it

wraith rapids
#

did i tell you to remove the version

#

just

#

fucking look at it

past vapor
#

what do i put in the <version><\version>

past vapor
#

ye ik i just saw it

wraith rapids
past vapor
#
<dependency>
            <groupId>com.github.SuperRonanCraft</groupId>
            <artifactId>BetterRTP</artifactId>
            <version>2.12.0</version>
        </dependency>```
wraith rapids
#

those values look right

#

🤷🏿‍♀️ build it locally i guess

past vapor
#

wym by that

wraith rapids
#

clone or download the repository and build it with maven

#

f.e by importing it into your ide and then smashing the package button

#

if you use intellij you can import a project directly from git

#

file > new > project from version control > git

#

then cuntpaste this in it

#

i don't have the effort to try and wrangle you into using maven from the command line

past vapor
#

idk wats up

#

maven has done the shit it needs to do

#

but its still fucked

wraith rapids
#

nothing of that means anything

wraith rapids
#

did you build it locally

quaint mantle
#

hey i have config and messages.yml in resources/spigot folder and it saves to plugins/AuthTools/spigot but i want it to plugins/AuthTools/

#

my code

#
  • getFile
wraith rapids
#

use getResource and write the inputstream to disk

#

saveResource just dumps the file whereever

past vapor
quaint mantle
#

okay

wraith rapids
#

now that you're building it locally, you want to copy the dependency info from their pom.xml again

#

instead of using the information for jitpack

weak mauve
#

old question new problem, im trying to make the orb buffs only real PLAYER as npc dont have mana data, but, how? I tried to use world.getOnlinePlayers() or bukkit.getOnlinePlayers()

past vapor
#

no clue what i changed, but it seems to be ite now

naive spindle
#

how can i disable nametag visibility on scoreboard teams?

#

i set nametagvisibility to never

#

but not worked

keen kelp
#

why does the console say Disabling PluginName v1.0.0 even though it's not 1.0.0 in plugin.yml or build.gradle

ivory sleet
#

What version did you declare in plugin yml then?

keen kelp
#

version: ${pluginVersion}

#

processResources {
expand "pluginVersion": project.version
}

ivory sleet
#

What is project.version set to?

keen kelp
#

version '0.0.5'

#

in build.gradle

ivory sleet
#

actually change both to rootProject.version

keen kelp
#

like the version in build.gradle and plugin.yml?

#

and what version would that use

ivory sleet
#

You’d have expand "pluginVersion": rootProject.version then rootProject.version '0.05'

keen kelp
#

okok

#

so
plugins {
id 'java'
}

group 'EE.ric'
rootProject.version '0.0.5'

#

and

#

processResources {
expand "pluginVersion": rootProject.version
}

#

yes?

ivory sleet
#

Ye

#

Splendid

keen kelp
#

ok imma try it out now

#

btw do u use Intellij?

ivory sleet
#

Yeah

keen kelp
#

how do I make it trigger a deploy after run

#

since "run" is building with gradle

ivory sleet
#

you could chain a task after build

keen kelp
#

how do I change that

#

Run/debug configurations?

ivory sleet
#

Uh sure that works

keen kelp
#

and now?

ivory sleet
#

But I would suggest using gradle for deployment

keen kelp
#

oh ok

#

gradle has support for sftp right

ivory sleet
#

Ye there exist a plugin for that

#

I can try help you later with that, never tried it myself frankly

keen kelp
#

why is using gradle recommended tho

ivory sleet
#

I mean gradle is good

#

Its capability of configurability is good, Idk if it’s actually significantly faster than maven but definitely faster than ant afaik. Then it’s also both imperative and declarative which can be nice. I’m not gonna go here talk why gradle is recommended because I honestly don’t know everything about it but it’s good imo.

keen kelp
#

also it's still saying
[Plugin Name] Loading PluginName v1.0.0

ivory sleet
#

Did you run the clear task?

keen kelp
#

no :/

ivory sleet
#

Run the clean task

keen kelp
#

should I make it run clear every time I build?

ivory sleet
#

Uh if you want you could make something like
build.dependsOn clean

keen kelp
#

using the compound run in intellij

ivory sleet
#

(In build.gradle)

keen kelp
ivory sleet
#

Because if you use gradle as your build automation tool using it to additionally deploy may be beneficial since you can directly take advantage of the api and the plugins other than using some half working intellij interop solution

keen kelp
ivory sleet
#

It’s in build.gradle, if you use gradle you most likely want to depend as much as possible on what gradle is capable of

#

And since this is one instance where it’s possible I advice you to declare the task dependency in gradle

keen kelp
#
plugins {
    id 'java'
}

group 'EE.ric'
rootProject.version '0.0.5'
build.dependsOn clean

repositories {
    mavenCentral()
    maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
    maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
}

dependencies {
    compileOnly 'org.spigotmc:spigot-api:1.16.5-R0.1-SNAPSHOT'
}

processResources {
    expand "pluginVersion": rootProject.version
}
ivory sleet
#

Yeah

keen kelp
#

bruh

#

I think it cleaned right after it built

#

cause the build folder never appeared

ivory sleet
#

It should clean before

keen kelp
#

that's my question

#

I mean it builds when I commented it out

ivory sleet
#

Yeah that’s somewhat odd

#

You could try with one other thing

keen kelp
#

being?

ivory sleet
#
    doFirst {
        file("${buildDir}/resources/main").listFiles().each {
            delete it
        }
    }```
put this in your processResources (before the expand)
keen kelp
#

ok

#

yep I think dis fine

ivory sleet
#

Ok nice so basically it would clear eventually cached resources when generating new ones

keen kelp
#

ncie

#

do you have time to do the sftp thing now?

ivory sleet
#

Hmm I will ping you when I’m available

keen kelp
#

ok

deep sail
#

Is there an event for falling blocks turning into a regular block (already tried EntityChangeBlockEvent)? (1.8)

near crypt
#

how can i clear the Inventory of an Player?

deep sail
near crypt
#

true xD thx iam dump 😉

deep sail
#

np

dense goblet
#

what is an efficient way of checking up to 4,356 blocks which are located in at most a 3x3 chunk bounding box

#

I only need to know if they are passable or not

#

and if they are not passable, whether it is a door

#

this would be done rarely (once per 20 minutes per room in a loaded chunk, with offset timings)

eternal oxide
dense goblet
keen kelp
#

wait nvm I shouldn'tv'e asked here

#

this isn't a java support server

dense goblet
eternal oxide
#

yes

quaint mantle
#

Ait so I got this in my config file:

arenaList:
- map1
- map2``` How would I go on about map voting? Maybe so it looks something like this at the end in the Minecraft chat
1. map1 (0 votes)
2. map2 (0 votes)
How would I go on about making this? I know how to get the list of course and I know I should be using arraylist / hashmaps yes?
dense goblet
#

so I can take a chunk snapshot within an async operation

#

when i reach a new chunk

eternal oxide
#

Its not guaranteed safe but it works. If its not a time sensitive search you can always grab it sync

dense goblet
#

it is time sensitive to some extent, as every in-game morning all houses should have finished running the operation for all their rooms since the last morning

eternal oxide
#

Not time sensitive as in tick accurate

dense goblet
#

so say in-game time 8AM all houses are queried on their previously calculated floor space and bed count, and each house calculates it at some point during the day depending on when it was built

#

yeah I guess worst case is that a house misses 20 min of productivity once and then should be fine as long as its not edited

#

Ill give it a go ty 🙂

wispy flume
#

I'm trying write a part of a plugin to download new plugin updates, but I keep getting an Error 503 when trying to execute.
However, if I put the URL in my browser, it goes fine.

public static boolean downloadSpigotMcPlugin(final Integer pluginId, final Integer version, final File file) throws IOException {
        
    URL apiUrl = new URL("https://api.spiget.org/v2/resources/" + pluginId + "/versions/" + version + "/download");
    try{
        HttpURLConnection connection = (HttpURLConnection) apiUrl.openConnection();
        connection.setRequestProperty("User-Agent", PluginManager.getInstance().getConfig().getString("UserAgent"));
        connection.setInstanceFollowRedirects(true);
        connection.setDoInput(true);


        if (connection.getResponseCode() != 200) {
            Logger.sendConsole("Response was " + connection.getResponseCode());
            return false;
        }
    }catch (Exception e) {
        Logger.sendConsole(e.getMessage());
    }
    try {
        BufferedInputStream bis = new BufferedInputStream(apiUrl.openStream());
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(file));
        byte[] buffer = new byte[bis.available()];
        bis.read(buffer);
        bos.write(buffer);
        bos.close();
        bis.close();
        return true;
    } catch (Exception e) {
        e.printStackTrace();
    }
    return false;
}

Google hasn't been too much help, so if anyone can give some input, I'd greatly appreciate it

#

Here's the User-Agent I'm using

Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:88.0) Gecko/20100101 Firefox/88.0
keen kelp
#

is this how I do distinct on a custom class?

        List<ItemStack> list = new ArrayList<>();
        Set<ItemStack> uniqueValues = new HashSet<>();
        for (ItemStack itemStack : itemArray) {
            if (uniqueValues.add(itemStack)) {
                list.add(itemStack);
            }
        }
        ItemStack[] items = list.toArray(new ItemStack[0]);

here itemArray is the array I want to remove duplicates from

eternal oxide
#

ItemStacks are comparable, just use the code from the link that was posted earlier

keen kelp
#

where

eternal oxide
#

yes

#

the second one is simplest

keen kelp
#

oh that's right

#

tf am I doing lel

#

Set<ItemStack> items = Arrays.stream(itemArray).collect(Collectors.toSet());

#

so like this?

worldly ingot
#

you need the .distinct() call

keen kelp
#

but sets can't have duplicates?

worldly ingot
#

ah suppose so

keen kelp
#

set is exactly what I needed, idk why I never thought of it

eternal oxide
#

no sets can;t have duplicates

worldly ingot
#

In that case however, just skip the stream o.O

keen kelp
#

so what do I change it to

worldly ingot
#

afaik, there's Sets.newHashSet(array);

#

Provided by Guava I think it is, which is shaded into Bukkit

keen kelp
#

wait how do I do make it into my code?

worldly ingot
#

Just use that line above lol. It creates a Set for you

keen kelp
#

oh

worldly ingot
#

Instead of the Stream thing

#

Streams aren't super great for performance if used frequently, and given that the stream is very small and easily replaceable, definitely the better alternative imo

keen kelp
#

and it also changes itself to the correct type?

worldly ingot
#

Yeah it's generic

keen kelp
#

cool

worldly ingot
#

If you're using Java 9+, there's also Set.of() I think that also accepts varargs

keen kelp
#

and what would the set's name be

worldly ingot
#

Dunno. Whatever you want. lol

#

It's your variable ;p

wispy flume
#

Guess nobody's got anything for my error 503 problem? 😅

keen kelp
#

so dis?
Set<ItemStack> ItemSet = Set.of(recipe);

#

I mean it's a java network thing

#

try StackOverflow

eternal oxide
#
ArrayList<ItemStack> yourList = new ArrayList<>();
Set<ItemStack> setWithoutDuplicates = Sets.newHashSet(yourList);```
keen kelp
#

what about Set.of() tho

ivory sleet
#

Its unmodifiable

eternal oxide
#

oh you are, nm then

wispy flume
#

Yeah, I was about to say

#

I was getting 302 earlier, but I managed to solve that

#

Now I'm getting 503, so I know it's following the redirects, but I can't figure out why my browser resolves the API url but my code won't

keen kelp
#

did you miss some init thing? I never worked with network, pure guessing

eternal oxide
#

This is how I do it ```java
URL url = new URL("https://api.github.com/repos/ElgarL/GroupManager/releases/latest");
URLConnection conn = url.openConnection();
conn.setReadTimeout(5000);
conn.addRequestProperty("User-Agent", "GroupManager Update Check");
conn.setDoOutput(false);

// Handle redirects.
String redirect = conn.getHeaderField("Location");
if (redirect != null){
conn = new URL(redirect).openConnection();
}```

keen kelp
#

since 503 is the server is not ready or smth iirc

wispy flume
#

Ah fuck, timeout

#

I missed the timeout

#

I'mma give that a whirl

eternal oxide
#

yep, no timeout will not wait for the redirect

keen kelp
#

ElgarL, what's the difference between the thing you sent and sets.of

#

did I miss an explaination

eternal oxide
#

what is sets.of from?

keen kelp
#

Java.util.set

#

so java

eternal oxide
#

I see no Set.of

keen kelp
#

Choco said it's available from Java 9+

#

and I'm not getting shouted by inte so imma suppose it's good for now

eternal oxide
#

Possibly. I'm using 1.8 compat so don;t get it

keen kelp
#

I see

#

1.8 uses java 8 right

worldly ingot
#

yes

keen kelp
#

hi choco

eternal oxide
#

java 8 compat

worldly ingot
#

Set.of() was either Java 9 or Java 11. I can't recall

#

Sets.newHashSet() is Guava

eternal oxide
#

So pretty much does the same thing

worldly ingot
#

Yes

#

Only, not requiring a third party library

eternal oxide
#

yep

#

So long as you are using Java 9+

worldly ingot
#

I mean, 1.17 requires Java 16 PES_SadShrug so that's nice

keen kelp
#

I use java 11

worldly ingot
#

Will be fine to use Set.of() then

keen kelp
#

It was 16 but my server was running on java 11 and 16 plugin doesn't accept 11 server :/

#

because 60 dropped support for 55

crude hound
#

just, in 1.8.9 how can I get EntityEquipment from an entity?

warm galleon
#

My entity end crystals arent dealing explosion knockback and damage, but are braking blocks,
Code:

@EventHandler
    public void onSnowballThrow(ProjectileHitEvent e){
        if (e.getEntity() instanceof Snowball) {
            Snowball projectile = (Snowball) e.getEntity();
            Location loc = e.getEntity().getLocation();
            loc.getWorld().spawnEntity(loc, EntityType.ENDER_CRYSTAL);

        }
    }``` (When you hit it it explodes but doesnt do damage and knockback)
#

vasically anything player related to the explosion doesnt appn

quaint mantle
wispy flume
quaint mantle
#

btw this is my code for spiget i use


public String getDownloadURL() {
        try {
            URL url = new URL(SPIGET);
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();

            connection.addRequestProperty("User-Agent", "AuthTools");

            int code = connection.getResponseCode();

            if (code == 404) {
                connection.disconnect();
                this.result = Result.BAD_ID;
                return null;
            }

            InputStream inputStream = connection.getInputStream();
            InputStreamReader reader = new InputStreamReader(inputStream);

            JsonElement element = new JsonParser().parse(reader);

            try {
                if (element.getAsJsonObject().get("external").getAsBoolean())
                    return element.getAsJsonObject().get("file").getAsJsonObject().get("externalUrl").getAsString();
                else
                    return "https://www.spigotmc.org/" + element.getAsJsonObject().get("file").getAsJsonObject().get("url").getAsString();
            } catch (NullPointerException exception) {
                exception.printStackTrace();
                return null;
            }
        } catch (IOException ex) {
            ex.printStackTrace();
        }

        return null;
    }
wispy flume
#

How does everyone else's simpler code work

quaint mantle
#

the SPIGET is "https://api.spiget.org/v2/resources/" + id + "/"

#

idk

#

i literally dealt with this for 2 days bcz i didnt know how to get the file.externalUrl or smth bcz idk json and it works so nice

wispy flume
#

Well, I can get JSONs no problem

#

I'm actually trying to download the plugin .jar file though

quaint mantle
wispy flume
#

Here's my "Get JSON" code

public static JsonObject getSpigotMcPluginInfo(final int pluginId) throws IOException {
        URL apiUrl = new URL("https://api.spiget.org/v2/resources/" + pluginId + "/versions/latest");
        HttpURLConnection connection = (HttpURLConnection) apiUrl.openConnection();
        connection.setRequestProperty("User-Agent", PluginManager.getInstance().getConfig().getString("UserAgent"));

        if (connection.getResponseCode() != 200) {
            Logger.sendConsole("Response was " + connection.getResponseCode());
            return null;
        }

        // InputStream stream = ;
        String string = CharStreams.toString(new InputStreamReader(connection.getInputStream()));
        JsonObject object = new Gson().fromJson(string, JsonObject.class);

        return object;
    }
weak mauve
#
Player p = (Player) entity;

i want to fix this line of code, like, this command returns player including NPC, i want to avoid that

keen kelp
#

ok... I just switch my plugin test server to java 16 and it seems to be fine... Ill test on my main server later, in case it's fine, how do I upgrade my plugin project to java 16?

quaint mantle
#

do you work in intellij?

keen kelp
#

cause last time I tried downgrading from 16 to 11, something seemed to still be on java 16 despite me changing the project setting

#

yes

eternal oxide
#

he's using gradle

keen kelp
#

yes uwu

wispy flume
#

Shit, wrong reply

#

No ,wait, right reply

quaint mantle
#

File -> Project Structure -> Project -> Project language level and change the sdk

keen kelp
#

dats all?

quaint mantle
#

yea

keen kelp
#

ok

quaint mantle
#

some guy idk theyre name told me that this is how you do it

keen kelp
#

there's no rule against "uwu" or "owo" right

quaint mantle
#

:uwu: i dont think so

#

oh something said frick nitro emotes? xd

keen kelp
#

yeah

#

I too tried lel

quaint mantle
#

do you have like the only server in emoji selector too?

#

and in dms all servers?

keen kelp
#

I think they banned nitro emotes here

chrome beacon
#

Use getClass to find where it's from

#

Not sure if that would even work

#

There isn't much of a difference between players and NPCs and that usually is intended

chrome beacon
#

Then check that

weak mauve
#
                for (Entity entity : stand.getNearbyEntities(18, 18, 18))
                {
                    if (!(entity instanceof Player)) continue;
                    if (!(entity instanceof NPC))
 continue;
                    Player p = (Player) entity;
                    if (c >= 5) break;

keen kelp
#

I don't have gradle.properties

quaint mantle
#

is there something like getDescription#getWebsite?

eternal oxide
#

With Maven you define it in your pom. No clue how with Gradle

#

?jd and search getDescription

chrome beacon
#

Is that what you want

warm galleon
#

My entity end crystals arent dealing explosion knockback and damage, but are braking blocks,
Code:

@EventHandler
    public void onSnowballThrow(ProjectileHitEvent e){
        if (e.getEntity() instanceof Snowball) {
            Snowball projectile = (Snowball) e.getEntity();
            Location loc = e.getEntity().getLocation();
            loc.getWorld().spawnEntity(loc, EntityType.ENDER_CRYSTAL);

        }
    }``` (When you hit it it explodes but doesnt do damage and knockback)
weak mauve
#

the biggest issue is, i cant even join the game

vestal dome
#

is there a way to make a creeper explode?

#

force the creeper to explode I meant

quaint mantle
vestal dome
#

1.8.........

quaint mantle
#

ohhh

vestal dome
#

maybe looking at CraftCrepper may give an idea on how bukkit does it

#

copy time 🙂

quaint mantle
#

yeah

midnight galleon
#

Yeag

#

Creeper.ignite()

weak mauve
#

will this work?

if (!(player instanceof NPC)) { 
            player.setHealth(Math.min(player.getMaxHealth(), player.getHealth() + (player.getMaxHealth() * 0.025)));
            PlayerStatistics statistics = PlayerUtils.STATISTICS_CACHE.get(player.getUniqueId());
            PlayerUtils.boostPlayer(statistics, new PlayerBoostStatistics()
            {
                @Override
                public String getDisplayName()
                {
                    return null;
                }
                @Override
                public Rarity getRarity()
                {
                    return null;
                }
                @Override
                public GenericItemType getType()
                {
                    return null;
                }
                @Override
                public double getBaseStrength()
                {
                    return 25;
            }
        }, 20);
        statistics.boostManaRegeneration(1.0, 20);
        statistics.boostHealthRegeneration(0.05, 20);
        }
gritty lake
#

Anyone know how i can override force_default_server by connecting them to another server on join?

Before it used to work to change connect value in PostLoginEvent but after a bungeecord update it stopped working them being connected to the server but being forced towards lobby

vestal dome
#

yeah I have that...

#

I guess.. I found it.. nice

#

do you think I have to send packets to the players about the creeper... or....

dense goblet
#

yo is there something wrong with this? It never fires, all the other events in this class do.

  @EventHandler
    public void onBlockDropItem(BlockDropItemEvent e) {
        Bukkit.broadcastMessage("start cancelled: " + e.isCancelled());
        cancelCustomBlockEvent(getCustomBlockFromLocation(e.getBlockState().getLocation()), e);
        Bukkit.broadcastMessage("location: " + e.getBlockState().getLocation() + " // block: " + e.getBlockState().getType() + " // cancelled: " + e.isCancelled());
    }
quaint mantle
#

I have a question but I dont know where to find an answer so I figured I would ask here. if I do a command like /command player how can I make it so it sends the refrenced player a message?

vestal dome
#

then just use Bukkit.getPlayer(args[0])

#

it may be null...

vestal dome
#

if you say others in that class work...

quaint mantle
#

Isn't Bukkit.getPlayer() very inefficient?

vestal dome
#

don't think so?

#

unless I'm being a DUMBASS

dense goblet
# vestal dome uhh... maybe it's the wrong event?

it says it would should fire whenever a block drops an item, including torch on top of a block being broken etc. I break a block with a torch on top (in survival), the torch drops but the event is not fired

quaint mantle
vestal dome
#

unless you get offline player...

#

but then you will have to check if the player is online and convert into a player object.

quaint mantle
#

Well the main way I do it right now is have a reference map based on uuid so I can just do core.getPlayerReference(uuid) to retrieve the player object

dense goblet
#

oh it may be a mohist thing...

quaint mantle
#

Nah getting an offline player is more resource heavy then getPlayer

dense goblet
#

seems to work on normal spigot

quaint mantle
#

mohist?

vestal dome
#

it's a server implementation..

dense goblet
#

allows forge + spigot. I want to make a vanilla-client compatible server with terraforged for worldgen

dusk flicker
#

For future note

dusk flicker
#

We don't support forks of Spigot

dense goblet
#

yup thought it was a problem in normal spigot but turns out nope

#

I'll file a bug report on mohist if its not fixed in the newest version (I'm a couple days behind)

#

though a thing worth noting, it doesnt seem to work as advertised in the docs

vestal dome
#

why even have a fork which combines spigot and forge..

dense goblet
#

(this is on normal spigot now) I get the event for the broken block but not the torch or banner or whatever on top of it

#

This event will also be called if the player breaks a multi block structure, for example a torch on top of a stone. Both items will have an event call.

dense goblet
maiden cape
#

Is there a way of initialising an empty audience (in adventure api) that can then have players added to it
I'm trying to keep track of the players listening to a boss bar for an entity
but there isn't necessary an initial player there

eternal oxide
#

Paper not Spigot

sage swift
quaint mantle
#

Hey, Could anyone tell me how i change the gamerule with the command?

gritty lake
#

How can i override force_default_server? it used to be possible before but stopped worked after a update long time ago

quaint mantle
sage swift
#

well it says right there it's deprecated to use String

#

but ¯_(ツ)_/¯

quaint mantle
sage swift
#

no cause i dont know how to instantiate or get GameRule

#

but if you were to take a look at the class, you'd see how to use it.

quaint mantle
#

is it like this p.getWorld().setGameRuleValue(doMobSpawning, false);

sage swift
#

nope

#

lol

quaint mantle
#

im kinda new to this stuff tho

sage swift
#

again, look at the class

quaint mantle
#

okay

eternal oxide
#

why a duplicate forEach inside the lambda?

lyric grove
#

its so i can check both player and online

eternal oxide
#

eh? that makes no sense

#

You are only getting Online Players. There will be no offline

lyric grove
#

thats not what i mean

vestal dome
#

?????????????????

#

what

eternal oxide
#

You are looping over every online player for every online player.,

vestal dome
#

for every player, for every player, for every player, for every player

eternal oxide
#

down the rabbit hole we go.

vestal dome
#

for(Player p1 : Bukkti.getOnlinePlayers()) for(Player p2 : Bukkit.getOnlinePlayers())

lyric grove
#

xd

vestal dome
#

lmfao

#

I'm just trolling I'm leaving now

eternal oxide
#

It would probably be easier if you explained what you are attempting to do.

lyric grove
#

i think its because im using the server jar, not the api

#

where do i get the spigot api?

vestal dome
#

what IDE specifically are you using?

eternal oxide
#

makes no difference. server jar just has the API and implementation

lyric grove
#

intelijj

vestal dome
#

didn't you install Minecraft development plugin?

lyric grove
#

no i dont have it

#

i juse use my pom.xml

eternal oxide
#

if you are using pom then just use spigot-api instead of spigot

#

unless you are using nsm

lyric grove
#

is there a 1.7.10 api?

eternal oxide
#

go away

lyric grove
#

lmao

eternal oxide
#

Do you mean above their head?

#

then p.sendTitle

quaint mantle
#

just send them a new one

hybrid spindle
#

Is there a possibility to license a purchase individually in the sourcecode of a plugin? To prevent multipeople use of a purchased plugin?

eternal oxide
#

how often are you sending it?

quaint mantle
#

pretty sure packets take care of that

vestal dome
eternal oxide
#

It shoudl not flicker if used correctly

vestal dome
#

but I'm a dumbo and decided to go extra stupid and I'm mapping 1.16 to 1.5

#

for specific reasons, if you get it 🙂

eternal oxide
#

How often are you calling sendTitle?

vestal dome
eternal oxide
#

You don;t know how often you are calling the method

lyric grove
eternal oxide
#

?paste

queen dragonBOT
vestal dome
lyric grove
#

thanks

gaunt relic
#

Hello everyone, I have a question: If I have two plugins that have shaded the same libraries but they have different versions, will the bukkit class loader only load the first it finds or does it prioritize the one I have shaded

gritty lake
#

Is there a way to access getForcedHosts in bungeecord? the info in ListenerInfo

quaint mantle
#
    public void sendTitleToPlayer(Player player, Integer fadeIn, Integer stay, Integer fadeOut, String title, String subtitle) {
        PlayerConnection con = ((CraftPlayer) player).getHandle().playerConnection;
        con.sendPacket(new PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction.TIMES, null, fadeIn, stay, fadeOut));

        if (subtitle != null) {
            con.sendPacket(new PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction.SUBTITLE, IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + subtitle + "\"}")));
        }

        if (title != null) {
            con.sendPacket(new PacketPlayOutTitle(PacketPlayOutTitle.EnumTitleAction.TITLE, IChatBaseComponent.ChatSerializer.a("{\"text\": \"" + title + "\"}")));
        }
    }```
eternal oxide
#

is this running on your main thread?

#

commands are still on the main

lyric grove
#

i have the spigotmc repo

vestal dome
quaint mantle
#

Yeah he's basically just killing his server

lyric grove
vestal dome
#

then I have actually... no idea...

eternal oxide
#

you run it in its own thread

#

Thread

quaint mantle
#

Is it possible to add velocity to a player without having them pause in place as when i add velocity its not smooth

vestal dome
#

this is my code..... probably a lil bit not understandable, but still hope it is.

gaunt relic
quaint mantle
#
        //core == instance of main class
        //20 == ticks == 1 second
        core.getServer().getScheduler().runTaskLater(core, () -> {
            //do stuff here
        }, 20);```
vestal dome
#

(it probably doesn't, let's be honest)

quaint mantle
lyric grove
vestal dome
#

for cross compatibility with versions

#

basically you just have to send a times(fade in, stay, fade out) packet every title you send...

quaint mantle
#

afaik the packet one already solves all that shit for you anyway

gaunt relic
#

There isn't a spigot 1.7.10 repository, but I think there's a craftbukkit one

lyric grove
vestal dome
#

is there even a percentage of servers that uses 1.6?

#

or 1.5?

eternal oxide
#

one sec, I'm writing a tst

pliant copper
#

Does spigot allow premium resources to download dependencies from jitpack/github/maven repository and put them into a lib folder?

gaunt relic
#

I was reading a thread about that, just a sec

keen kelp
#

emm what

#

when I try yo build, it just shows this error
Unknown command-line option '-v'.

#

so something is setting the enviroment for gradle to contain something -v

#

but i can't find any file with that

gaunt relic
keen kelp
#

nvm I was being dumb

pliant copper
gaunt relic
#

Idk, better check the premium resource guidelines

keen kelp
#

why's that

gaunt relic
#

but if it's a built-in function I'm pretty sure it's allowed

keen kelp
#

Why are premium plugins not allowed to access the internet

pliant copper
keen kelp
#

I mean premiumVanish

#

it auto-checks for updates

#

and it's paid

pliant copper
eternal oxide
keen kelp
#

what does that have to do with internet access

#

it just means the plugin must be able to run without accessing a specific server

eternal oxide
#

I'll show you it not flickering and show you the code

pliant copper
wary harness
#

I mean and that rule is a bit weird that force devs to make plugins to work

#

in offline

eternal oxide
#

?paste

queen dragonBOT
eternal oxide
pliant copper
#

Okay then, how are plugins that use large external libraries such as JDA supposed to both follow the 4mb max upload size and not download from a website?

wary harness
#

featherboard guy does it in seperated jar

#

so he by passes

#

that

#

at least I think

pliant copper
#

So then having a free resource download the dependencies would be allowed?

wraith rapids
#

some plugins download dependencies at runtime

#

luckperms is a fine example

pliant copper
#

Yeah, its just I'd rather not be banned for misunderstanding the rules 😂

#

Really wish they were more specific

wraith rapids
#

just make an alt

pliant copper
#

Pretty sure thats not allowed

wraith rapids
#

that's the point of making an alt

#

you don't need to follow the rules

pliant copper
#

So if i had an alt that got banned, my main would technically become another alt and I'd be punishment evading.

#

Yeah how about no

wraith rapids
#

punishment evading is the point of the alt

#

why else would you have an alt

pliant copper
#

To test stuff?

wraith rapids
#

hardly ever need alts to test stuff

pliant copper
#

Yeah

#

idk

wraith rapids
#

but anyway

#

if luckperms can get away with it, you're probably not going to get banned for it either

#

downloading dependencies at runtime isn't drm

#

if someone complains about it, tell splögget to up their artifact size limit

pliant copper
#

Okay I have an idea

wraith rapids
#

or just bake the dependencies in and serve them from a third party without a ridiculously low artifact size limit

#

like github

pliant copper
#

maybe have the user change a value like Download dependencies at startup from false to true

pliant copper
wraith rapids
#

there's no point in premium to begin with

#

get a real job if you want money

pliant copper
#

😂

wraith rapids
#

plenty of premium projects are open source anyway

wary harness
#

and it breaks rules if that was premmium plugin

wraith rapids
#

that's for drm

keen kelp
wraith rapids
#

we're talking about libraries

#

not plugins

#

shit you'd normally shade in

keen kelp
#

Wait what libraried

wraith rapids
#

idk, JDA was thrown as an example

keen kelp
#

The just shade it in

wraith rapids
#

the splögget artifact size limit is lik 4mb or something

#

easy to go over

keen kelp
#

Bruh

#

4mb

#

Da frick is splőgget

wraith rapids
#

spigot

keen kelp
#

Wait what

dense goblet
#

is it ok to use normal data structures (e.g. LinkedList for a Queue) in a method that will be called asynchronously? I only use the data structure internally and don't return it etc

wraith rapids
#

define "use in a method"

keen kelp
#

I once accidentally shaded in bungee chat api and spigot itself and the plugin was 40mb but it loaded just fine?

wraith rapids
#

for the website

#

not the server

#

try uploading your 50mb plugin to spigot

keen kelp
#

Wait what website

#

Ohhhh

#

I see

#

The uploaded plugin cant be bigger than 4mb

dense goblet
#

I have a method calculateRoom which will take chunk snapshots and check if a space is enclosed and if so, how much floor area there is, the amount of beds and positions for possible connected rooms (behind doors).

wraith rapids
#

is this linkedlist passed in as an argument

dense goblet
#

I plan to run this asynchronously as it could be scanning (not modifying) up to ~4.5k blocks

#

nope

#

it is completely contained within the function

wraith rapids
#

the thing with the "asynchronous" word that you need to remember is that it's always relative

#

it is "not synchronous with x"

dense goblet
#

so, it should be safe right

wraith rapids
#

in bukkit development, it's generally used as a substitute for "not synchronous with the main server thread"

dense goblet
#

since relatively speaking it is synchronised with everything it interacts with

wraith rapids
#

every thread is "asynchronous"

#

there is zero difference between code running on thread A and thread B

dense goblet
#

makes sense

wraith rapids
#

whether something is synchronous or asynchronous only comes into play when thread A and thread B interact

keen kelp
#

Oh also NNY, what was the method to do something on another thread again?

dense goblet
#

then an interaction would be getting a chunk snapshot

keen kelp
#

You told me but I forgot

wraith rapids
#

the chunk snapshot is grabbed on the main thread

#

and then passed to your thread for processing

#

this would be asynchronous

vestal dome
#

👏

wraith rapids
#

your processing of the chunk snapshot however is not asynchronous

keen kelp
#

It was bukkit.something iirc

wraith rapids
#

nor is it synchronous

#

it is alone

#

there is nothing to be synchronized with or not be synchronized with

#

it simply happens

#

you can say that it is "concurrent with the main thread", that is, it happens at the same time as the main thread does stuff

dense goblet
#

so say I do not know which chunks I need before I begin my algorithm. Is it safe to request a chunk snapshot within my calculateRoom function, which is asynchronous with the main thread?

wraith rapids
#

but since your code doesn't do anything with the main thread, that is entirely irrelevant

#

no, chunk snapshots must be obtained on the main thread

#

the method isn't thread safe

dense goblet
#

okay I see

#

so I need to split it

wraith rapids
#

there are various ways you could go about it

dense goblet
#

the rooms would worst case occupy 3x3 chunks

wraith rapids
#

a queue, pool of futures, just blocking on an asynchronous method

dense goblet
#

hmm

wraith rapids
#

simplest would be to create a method in your algorithm class that returns a CompletableFuture<ChunkSnapshot>

#

and then joining that future to the thread that runs the algorithm

#

the method would schedule a bukkit task to obtain the chunk and compute the chunk snapshot, and then compute the future with it

#

and then return the future

#

which you then .join or .get

#

this will make your algorithm stop whenever it runs into a new chunk snapshot

#

it will then wait until the main thread gets around to obtaining it, completing the future

#

the thread then resumes and does whatever you tell it to

dense goblet
#

okay thats the behaviour I want. I'll do a DFS floodfill (since that should fail faster than a BFS when it needs to) and build up my cache of chunk snapshots as I discover them

wraith rapids
#

if it's a public plugin and there's a chance the chunks may be unloaded, remember to use paper(lib)

dense goblet
#

as in if the chunks that I want to snapshot are unloaded?

wraith rapids
#

if that is a possibility, yes

#

as the 60% of people that run on paper will throw your plugin in the shit bucket if they see it loading chunks synchronously

dense goblet
#

so what is the proper way to load those chunks

eternal oxide
#

60% of 35% is not a lot

wraith rapids
#

60% as in the total people on modern versions in the bukkit ecosystem that use paper

eternal oxide
#

Ignore the grumpy old man thats NNYa and write it using Spigot as you would. See how it performs.

dense goblet
#

maybe I should write it without async to see if it even needs optimisation in the first place

wraith rapids
#

the proper way is to call getChunkAtAsync

#

which will not blow up the chunk loading queue on paper servers

eternal oxide
#

If using Paper

wraith rapids
#

the library does it for you

#

if the environment is spigot, it'll just call the regular spigot sync loads

dense goblet
#

how much of an issue is the chunk loading queue if the method is called infrequently?

eternal oxide
#

un noticable mostly

wraith rapids
#

an arbitrary estimate would be that it'd take around 7ms to get the chunk

#

which is very noticeable if you do it frequently

eternal oxide
#

he said infrequently

wraith rapids
#

yes, well, i'm giving him information

eternal oxide
#

Your just being a bitchy fan of paper

wraith rapids
#

i'm being a bitchy fan of not lagging to shit

#

i've spent my due time hunting down sync chunk loads on my server

eternal oxide
#

infrequent, possible chunk loads. Doesn;t sound laggy to me.

wraith rapids
#

certainly not

#

which is why I said if you do it frequently

#

occasional 7ms here and there is fine if it only happens on startup

#

doesn't mean that he shouldn't get some practice with working with futures for when he actually needs to make something performant, however

eternal oxide
#

I agree Futures are a great thing to learn

dense goblet
#

its mostly down to how many rooms there will be which is hard to predict

wraith rapids
#

64.73% on 1.16 btw

dense goblet
#

it would be ~63ms (9 chunks) worst case per room, each room would need to be verified every 20 minutes.

#

at offset intervals

wraith rapids
#

if you're doing it repeatedly, you'd definitely want to do it asynchronously, even if the time impact isn't high

eternal oxide
#

I'm seeing 37.9 straight paper on 1.16

wraith rapids
#

as the people looking at their timings reports will actually throw it in the shit bucket for seeing the repeating number

eternal oxide
#

all forks is 51.2 Spigot, the rest forks.

wraith rapids
#

pretty sure this pulls the stats from bstats

eternal oxide
#

this is from bStats, but its only a single plugin representation.

dense goblet
#

though, all the rooms in a house will be calculated with the same offset so if I want to not get lag spikes with large apartment blocks I should do it async yea

wraith rapids
#

46% across all versions

#

64% on 1.16

#

< 30% on 1.12

#

strangely enough 1.12.1 is almost 50% while 1.12.2 is like 30% 🤔

#

are you looking at the stats of groupmanager?

eternal oxide
#

a couple

#

actually GM has the lowest uptake by paper users.

wraith rapids
#

i was going to compare the spread of luckperms but I can only find luckpermsgui on bstats

#

yeah i'm not surprised by that, gm is pretty old school

eternal oxide
#

I've also not put it anywhere but on Spigot/Github

wraith rapids
#

most of them probably don't even know paper exists lmao

#

still living in the craftbukkit age

quaint mantle
#

Okay, so I'm trying to create a map vote system.. this is how I've tried to make it select 5 random maps from the arenaList in the config file. It gets the list fine and all I guess? This is the code I use for that part: https://paste.md-5.net/ojavumoguv.php, and to get the list and send it in chat, I tried doing this: https://paste.md-5.net/sotaqetawu.php but I can't seem to make it work the way I am trying to. I'm trying to make it return a list in chat like this

  1. map1 (0 votes)
  2. map2 (0 votes)
  3. map3 (0 votes) yeah? but I can't seem to do this right and I'm not sure what to do.
wraith rapids
#

huh?

eternal oxide
#

I assume you only want each player to be able to vote once

#

in which case you should be storing it as Map<String, Set<UUID>>

wraith rapids
#

or more properly, a set or a map of Arena objects or something

#

nesting several maps/collections is kind of iffy

#

stuff like HashMap<List<String>, Integer> is 🤡

quaint mantle
#

I also want it to select 5 random maps from the config string list when the server starts so players can only vote for some maps, like I mentioned with

  1. map1 (0 votes)
  2. map2 (0 votes)
  3. map3 (0 votes)
eternal oxide
#

You could String, Integer and have a Set external to that to track who has voted

#

Yeah, we are not writing it for you. We can advise and help with errors, but the writing is up to you

wraith rapids
#

my ass hairs are itching in a way that speaks "this needs to be oop'fied"

eternal oxide
#

He can;t select 5, not sure oop is going to be easy for him

wraith rapids
#

myeah

eternal oxide
#

He woudl do better to start now though

wraith rapids
#

i remember this one chat game plugin

#

chatreaction i think it was called

quaint mantle
#

never even mentioned that

wraith rapids
#

basically, there's a .txt of words that it'd much up and then print in chat

#

and the first one who writes the word in chat wins some prize

#

there were a handful of issues, though

eternal oxide
#

Yeah, I've seen some streamers play that game

wraith rapids
#

most pressingly, it loaded the entire .txt fresh from disk every time it wanted to print a word

eternal oxide
#

one of those party pack games

wraith rapids
#

which, for a file with several thousands of words in it, could tak like 4 seconds

eternal oxide
#

ah

quaint mantle
#

https://paste.md-5.net/ojavumoguv.php this one as linked above shows how I tried to make it select only 5 maps on startup but it doesnt work, I wanted to find out why and what I maybe could do about it

wraith rapids
#

so the whole server just froze for a few seconds just before it

#

the second issue was that even though the file had like 2000 words, the plugin exploded somewhere on the way and could only print one of the first 100 or 200

#

which made the whole game predictable and boring

#

i haven't been able to find a decent replacement for it since throwing it in the shit bucket

eternal oxide
quaint mantle
#

ait

wraith rapids
#

not the most performant solution but should be fine unless you have hundreds of maps

eternal oxide
#

he's only doing it at startup

wraith rapids
#

that should be fine

eternal oxide
#

My KFC dinners late 😦 Driver still at teh restaurant

wraith rapids
#

that's cultural appropriation

eternal oxide
#

um, I do fancy some water melon too

wraith rapids
#

lmao

quaint mantle
#

hey is this somehow how i would implement my repository through jitpack? https://github.com/pavlyi1/AuthTools/

<dependency>
    <groupId>com.github.pavlyi1</groupId>
    <artifactId>AuthTools</artifactId>
    <version>1.7</version>
    <scope>provided</scope>
  </dependency>
GitHub

2FA Verification Addon for AuthMe or a standalone 2FA Auth Plugin - pavlyi1/AuthTools

wraith rapids
#

you need to use a tag or a commit hash as the version

quaint mantle
#

this tag right?

wraith rapids
#

yeah, tags show up here

quaint mantle
#

oh nice thank you

tardy delta
#

for some reason my code is again not working, can someone maybe take a look at it? I really dont know what's wrong, It's supposed to lock a container but even "Locked!" isnt shown in chat
https://paste.md-5.net/oqibosiyol.cs

gaunt relic
#

You are using || instead of && on line 10

eternal oxide
#

he shoudl be using ||

wraith rapids
#

the || is fine

eternal oxide
#

there is nothing wrong in that code. You broke it elsewhere

wraith rapids
#

he wants to return if the block isn't a tile or if the block isn't lockable

gaunt relic
#

Hmm

eternal oxide
#

oh sec I see your mistake

#

.contains(p.getUniqueId()) See something wrong there?

#

are you storing UUID's or strings?

#

if UUIDs then ignore my ramblings

wraith rapids
#

you'd expect he's storing uuids

#

but i suppose you never know

eternal oxide
#

I'd hope

#

Yeah, I see nothing wrong there, other than ugly code 😄

wraith rapids
#

well, what I'd recommend here is instead of throwing all of the logic in the if clauses and having it all become unreadable, is precompute some booleans for us

#

and then sit down and think up of the possible outcomes for our action

#

and then figure out the relations of the computed booleans, our input, and the outcome, our output

#

f.e we have effectively 3 input variables for this logical operation

#

is the chest locked?
is the player trying to lock something?
does the player have the key for this chest?

#

we also have 4 possible outcomes

#

you can't lock this
you can lock this
you can't open this
you can open this

#

now, construct a logical map of these inputs and these outputs

#

and then write it down with ||'s and &&'s

#

in our particular case, the 4 possible outcomes can be represented as a truth table of two properties; whether we can open the chest, and whether we can lock the chest

#

that said this approach sucks anyway and you'll need to split locking into its own separate listener on MONITOR priority

#

but you should do it anyway since it's a decent logical excercise

tardy delta
#

i can open it and cant lock

wraith rapids
#

and you've read literally nothing of what i've said

tardy delta
#

what

#

some booleans?

wraith rapids
#

yeah, throw around some booleans or whatever

eternal oxide
#

You either broke your command or the map you hold the players wanting a lock in

#

If the player is never added to the list then your code falls straight out the bottom.

quaint mantle
#

Would it be considered bad practice if I replaced my Player interface with a json object orientated one?
Like instead of the usual java class IPlayer{ int kills; public int getKills() { return kills; } public void setKills(int a) { this.kills = a; } }

i'd instead use something like

class IIPlayer{
    JsonObject json;
    public int getKills(){
        return json.get("kills").getAsInt();
    }
    public void setKills(int kills){
        json.addProperty("kills", kills);
    }
}
#

This would make stuff like storing data externally so much easier

wraith rapids
#

yeah that is iffy

#

that is effectively just a mapper/wrapper over a json object

quaint mantle
#

Correct

wraith rapids
#

it imples shit tier performance but I suppose other than that there is nothing blatantly wrong about it

#

really though, just write a serializer and a deserializer

#

it's about the same amount of work

quaint mantle
#

But using this technique I could simply add methods on the fly & not have to worry about saving those new items.
Currently when I add new properties to the IPlayer I'd also have to map those new items to the class that saves/loads their stats

wraith rapids
#

pretty sure you can rig up gson or whatever to automatically serialize complex objects anyway

quaint mantle
young knoll
#

Can't gson serialize pojo without anything extra

wraith rapids
#

yeah

#

and don't tell me you're storing json strings in a sql database

quaint mantle
wraith rapids
#

🙈

quaint mantle
#

I may or may not be doing that.

#

How should I be doing it then

wraith rapids
#

you should have a column for each property

young knoll
#

Using proper relational database methods

quaint mantle
#

You really think I can be fucked to do that

young knoll
#

Then just store the json as files

wraith rapids
#

instead of a {kills=20,name=yourmom}, you should have 2 columns named kills and name

eternal oxide
#

dump it in as a blob and forget about it. Be sure to show it to NNYa regularly

quaint mantle
#

My IPlayer has about 150 properties, i really don't want to create a table with 150 elements

wraith rapids
#

just use the bukkit config api if you insist on doing everything wrong

quaint mantle
#

That's a fair point.

young knoll
#

Don't some SQL implementations actually allow querying json

quaint mantle
#

Yeah

#

Though I don't really understand why simply dumping the json string itself into it

young knoll
#

I mean it kind of defeats the entire point of relational databases

quaint mantle
#

I get that

#

But there's not really a reason behind why it's bad

wraith rapids
#

like, other than using a brick as a hammer

quaint mantle
#

It works just fine

wraith rapids
#

so does the brick

quaint mantle
#

Alright

#

but the brick might break

young knoll
#

Get a better brick

wraith rapids
#

you also look like a monkey using improvised tools

quaint mantle
#

idk i've just not really seen any arguments showing why it's bad

wraith rapids
#

that's because sql is black magic and nobody understands why or how it works

quaint mantle
#

That's fair

#

but it works

wraith rapids
#

people just recite the same inane shit they read up somewhere without knowing the reasons behind it

quaint mantle
#

👌

quaint mantle
#

offtopic but why?

late ledge
#

Is it a premium resource?

quaint mantle
#

no free

late ledge
#

maybe it got marked for manual review 🤷‍♂️

quaint mantle
#

rip

wraith rapids
#

everybody needs to keep up appearances, after all

quaint mantle
#

wdym

wraith rapids
#

they need to at least pretend to moderate the free resources section

quaint mantle
#

xd

late ledge
wraith rapids
#

there's a ton of malware plugins out there in the free section

#

they do probably moderate it a bit on their own but they mostly rely on reports

late ledge
#

well yeah... ofcourse

finite dawn
#

idk if this is the right place to ask, but my buildtools continuously says it is outdated when trying to build a spigot version even if i download the latest buildtools from jenkins, anyone got some advice?

wraith rapids
#

what does it say exactly

finite dawn
wraith rapids
#

are you trying to build something mega ancient

finite dawn
#

nah 1.16.5

#

latest ver

wraith rapids
#

dunno then

late ledge
#

java version updated?

quaint mantle
#

can you try removing everything in the folder where is the BuildTools.jar?

finite dawn
#

java is updated to latest, and i have tried deleting everything in the folder with buildtools and it still didn't work

quaint mantle
#

show screen of the cmd

finite dawn
quaint mantle
#

how do you run it

finite dawn
#

? wdym?

quaint mantle
#

how do you run the buildtools

#

example java -jar buildtools.jar

finite dawn
#

java -jar BuildTools.jar --rev latest

quaint mantle
#

weird

#

ig try removing the BuildTools folder on Desktop and then redownload the buildtools again from here

#

?bt

queen dragonBOT
finite dawn
#

i have done that multiple times, but i'll try once more haha

#

nope same error

quaint mantle
#

thats so weird

wraith rapids
#

what're you trying to do? get a serbur to run or install nms to the local maven repo?

finite dawn
#

ngl half of that i don't truly understand

wraith rapids
#

why are you running buildtools

finite dawn
#

literally i'm just trying to build spigot 1.16.5

#

i've done it before for 1.16.4 but idk why it's not working for 1.16.5

wraith rapids
#

i'm asking because depending on what you want to achieve there may be an alternative solution

finite dawn
#

apparently there is a website to download spigot builds from or something? i might use that in the meanwhile my buildtools is broken lol

quaint mantle
#

wait

wraith rapids
#

if you need nms in your local maven repo, that won't work

#

if you just need the jar, yeah that's fine

finite dawn
#

i just need jar so i guess the website will work

vestal dome
#

hmmm

quaint mantle
wraith rapids
#

generally ill advised to download random jars from random people

finite dawn
# quaint mantle

yeah i just downloaded that from the website it seems to work, but thank you anyway haha

vestal dome
dusk flicker
#

@grand swan sorry for ping but spigot jar distributed above

wraith rapids
#

call the lawyer army

#

illegal distribution of mojang binaries wee woo wee woo

vestal dome
#

wait what....

dusk flicker
#

Not you

vestal dome
#

confusion

dusk flicker
#

the other jar

vestal dome
#

what jar?

#

specifically?

wraith rapids
#

gee

dusk flicker
#

the spigot-1.16.5.jar

vestal dome
#

h,

#

hm

#

still confused..

dusk flicker
#

You can't distribute it legally

#

Aka why you have to build it with buildtools

vestal dome
#

then how does spigot exist...

wraith rapids
#

that's the whole reason why everybody needs to deal with buildtools

vestal dome
#

h

#

m

wraith rapids
#

they don't distribute the jar

vestal dome
#

cool

wraith rapids
#

they distribute a script that builds the jar

vestal dome
#

too big brain for u

#

and for me..

#

lmao

wraith rapids
#

likewise, paper distributes a jar that builds the jar

#

except that unlike buildtools, it works as a server jar

#

it builds the actual jar on the fly when the serbur starts

vestal dome
#

🍋

#

I would say that's dumb tbh

#

but who am I to judge.

dusk flicker
#

It's a legal reason

wraith rapids
#

it is dumb

#

but we're still stuck with it

late ledge
#

its not dumb if it saves them a lawsuit

wraith rapids
#

it's dumb that they need to do that to not get sued

late ledge
#

thats mojangs decision

dusk flicker
#

It's not actually

#

It was one of the bukkit devs

wraith rapids
#

whose decision it was isn't relevent, it still remains dumb

late ledge
#

well the option to sue would come from mojang

vestal dome
#

bukkit devs which did what?

#

I am confusion

wraith rapids
#

you're perpetually confused about everything

vestal dome
#

yes

#

does anyone know which packet it sent to the server when an entity Interacts with a BLOCK.

#

not an entity.

late ledge
#

the EntityInteractEvent gets fired not sure what you mean with thepackage however. If an entity does something, it will be server sided?

vestal dome
#

packet

#

Packet is a lil information that the player can represent o nthe map

#

to inform the server or the player..

#

every time you send a message in chat, a packet is sent, etc. etc. etc.

#

I want the packet that corresponds to when an entity / player RIGHT CLICKS or ATTACKS a block.

#

basically the "interact event"

young knoll
#

Entities don't attack blocks

vestal dome
#

I'm talking about players.

wraith rapids
#

entities don't send packets either

#

PacketPlayInInteract off the top of my head, idk

vestal dome
#

you know that it was formerly named "PlayerInteractEvent" which changed to "EntityInteractEvent"

#

and PlayerInteractEvent is deprecated.

young knoll
vestal dome
#

what about right click...

wraith rapids
#

i'm sure you can ctrl-f the page yourself

late ledge
young knoll
late ledge
#

but entities are server sided. The player is the only entity that can send clientbound packets

young knoll
#

serverbound*

vestal dome
#

hmmm

#

I sometimes look at the amount of packets and think about how outdated bukkit is in some situations

wraith rapids
#

iirc the hand animation packets are also used for the interact event

vestal dome
#

just gives me anxiety to start coding with them

wraith rapids
#

generally it's kind of fucked

vestal dome
#

Thanks for the help**

quaint mantle
#

itemStack.addEnchantment(value, level); is throwing me an Illegalaccessexception because the level is 10

#

how fix how fix

vestal dome
#

you have a third parameter...

#

called "bypassMaximum"

#

for a reason....

quaint mantle
#

oh that only exists for itemMeta

#

good shit

smoky lance
#

how do I register my listener into bungee plugin channel?

vestal dome
#

Plugin Messages?

smoky lance
#

yes

eternal oxide
#

Spigot side or server?

smoky lance
smoky lance
vestal dome
#

in bungeecord use getProxy().registerChannel("<channel>");

vestal dome
#

at spigot use getServer().getPluginManager().registerOutgoing/IncomingChannel("channel");

smoky lance
vestal dome
#

I think yes....

eternal oxide
#

I believe it requires a : in it

vestal dome
#

but look for viaversion because it has the idea of cancelling Plugin messages where the names are capitalized..

eternal oxide
#

ie bungee:channel

severe night
#

Guys, CompletableFuture<Inventory> future = CompletableFuture.supplyAsync(()->abstractInv.build());

#

future.join(); will stops main spigot thread until the inventory terminate?

smoky lance
severe night
#

no , alright?

vestal dome
#

Incredibly "future.thenAccept(<consumer>);" works.

#

no u won't get bukkit yelling it's not main thread.

severe night
#

i forgot that

vestal dome
#

WAIT

smoky lance
# severe night if run like that:

runTaskAsynchronously, if I'm not mistaken still runs in the main thread, just not synced with minecraft ticks, use andThen (or whatever the operator is called)

vestal dome
#

this is a bruh moment, just noticed who you are.

vestal dome
#

it will throw exceptions....

#

I tested myself...

smoky lance
#

It's not synced with minecraft ticks, but still, it's the main thread

severe night
vestal dome