#help-development

1 messages ยท Page 658 of 1

hybrid turret
#

uhm

eternal oxide
#

did you run BT to build spigot?

#

actually no need as its just API

north nova
#

he doesn't need to yeah

hybrid turret
#

nnnnnnnnnnnnnnnnnnot exactly? i have absolutely no idea about maven

eternal oxide
#

refresh maven as noob said

hybrid turret
#

yeah, that is... how?

eternal oxide
#

Intelij maven window right wide of screen

remote swallow
#

are you using intellij

eternal oxide
#

theres a button to refresh

north nova
#

imagine its eclipse

#

๐Ÿ˜ญ

hybrid turret
#

oh

#

there we go

eternal oxide
#

eclipse...

north nova
#

the ECLIPSE incident

eternal oxide
#

right click pom update project

hybrid turret
remote swallow
hybrid turret
#

IJ on top

north nova
remote swallow
#

he uses eclipse

north nova
#

i assume everyone absolutely hates eclipse

#

oh

#

......

hybrid turret
#

LMAO

eternal oxide
#

Right click pom.xml -> Maven -> Update Project

hybrid turret
#

i got it yeah, nice

barren pumice
#

hello how can I make armorstend pet plugin so it will be following player using velocity?

eternal oxide
#

you can change the scope on your annotations dependency to provided as it's not used at runtime

barren pumice
#

yes

#

I have simple code for that but it bounces it or something like that

north nova
#

so send the code

#

and we can try to help you figure out what's wrong with it

barren pumice
#
ArmorStand armorStand = entry.getValue();            
Location targetLocation = player.getLocation().add(1, 0, 0);
Vector direction = targetLocation.subtract(entry.getValue().getLocation()).toVector();
armorStand.setVelocity(direction.getVelocity().normalize().multiply(1.2));
#

so?

north nova
#

4 lines of code will definitely not help anyone help you

eternal oxide
#

bounces?

north nova
#

also instead of doing velocity.normalize().multiply(1.2)

#

try velocity.multipliy(0.2)

#

or something like that

barren pumice
north nova
#

i assume that code is fired on every tick

#

?

barren pumice
eternal oxide
#

he has to normalize as he's using locations as vectors so it will not be a unit vector

#

You need to have a minimum follow distance and only set velocity if outside that

#

else you are setting a velocity even if it's on the player

#

use direction.length()

barren pumice
eternal oxide
#

a double

#

if it's above 1.2 apply a velocity

barren pumice
#

well it still has this weird behaviour

#

it still bounces

eternal oxide
#

no idea what you mean by bounces

barren pumice
#

I cant send files here lool

#

go dm

eternal oxide
#

I don't do dm

barren pumice
#

it goes too far and then goes back etc.

north nova
#

cursed

chrome beacon
#

ah yes 18+ warning

north nova
#

on point 18+

eternal oxide
#

then don;t multiply after normalizing

#

or multiply by 0.8

lavish vortex
#
                    if (p.hasPermission java herb("commandcooldown." + cmd + possible.get(i))) {```
#

if (p.hasPermission("commandcooldown." + cmd + possible.get(i))) {
}

barren pumice
north nova
#

you're missing a ; on line 27

#

lol

barren pumice
#

and it will still bounce

#

but smaller

eternal oxide
#

no it won't

barren pumice
#

it will

#

because it will try to reach perfectly the location

#

but it never can

eternal oxide
#

which is why you need a minimum distance

lavish vortex
north nova
#

can u send the whole code

barren pumice
barren pumice
#

lol

eternal oxide
#

increase teh 1.2 distance to 1.5

north nova
#

not u

#

sorry

lavish vortex
eternal oxide
#

or whatever you need to stop it bouncing

north nova
#

๐Ÿ˜

#

send the method

#

that contains line 27

barren pumice
eternal oxide
#

yes but you are teleporting inside teh collision box

#

if you move they push apart

lavish vortex
#
    public void onCommand(PlayerCommandPreprocessEvent e) {
        Player p = e.getPlayer();
        if (plugin.cooldowns.containsKey(p.getName()) && !p.hasPermission("commandcooldown.override")) {
            HashMap<String, Long> commands = plugin.cooldowns.get(p.getName());
            String cmd = e.getMessage().substring(1, e.getMessage().contains(" ") ? e.getMessage().indexOf(' ') : e.getMessage().length());
            if (plugin.delays.containsKey(cmd)) {
                ArrayList<Integer> possible = plugin.delays.get(cmd);
                Integer min = null;
                for (int i = 0; i < possible.size(); ++i) {
                    if (p.hasPermission("commandcooldown." + cmd + possible.get(i))) {
                }```
barren pumice
north nova
#

the whole

#

method

lavish vortex
#

doesn't fit

#

xD

north nova
#

?paste

undone axleBOT
lavish vortex
cunning crater
#

How can i set a permission like core.worlds.* and make it work? I used .setPermission on a PermissionAttachment but it seems that the * doens't work.

tall dragon
#

ussually permission plugins automatically handle the * wildcard

#

it does not require any work on your side

eternal oxide
# barren pumice collisions off

how did you disable collisions? As disabling gravity also disables collisions but then it would not be affected by velocity

tall dragon
#

unless ur making a permission plugin

north nova
#

ur missing a }

#

add a } at the end of ur code

barren pumice
eternal oxide
#

there is no setting to prevent collisions in spigot.yml

#

which means you still have collisions

cunning crater
barren pumice
north nova
#

@lavish vortex what even is that code btw that will not work

eternal oxide
#

you can not move an armorstand using velocity to stop inside a collision box

barren pumice
#

using velocity

eternal oxide
#

yes

barren pumice
#

collisions are just off thats it

eternal oxide
#

I guarantee they are not

barren pumice
#

yes, they are

eternal oxide
#

They are not or your stand would not "bounce"

#

you need to set a follow distance so it's not trying to move inside the players collision box.

barren pumice
#

it bounces because of the velocity

#

ah

#

I sent the image

#

it goes towards location everytime making it bounce

eternal oxide
#

then you did not add a check for the length as I told you to do

barren pumice
#

I did

eternal oxide
#

show code

wary topaz
#

`<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
<version>2.7.2</version> <!-- Make sure you use the latest version -->
</dependency>
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.33</version>
</dependency>

<dependency>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-shade-plugin</artifactId>
  <version>3.5.0</version>
  <type>maven-plugin</type>
</dependency>
<dependency>
      <groupId>net.md-5</groupId>
      <artifactId>bungeecord-api</artifactId>
      <version>1.20-R0.1-SNAPSHOT</version>
      <scope>provided</scope>
  </dependency>`

What dependency do i not need?

#

or do I need them all

eternal oxide
#

maven shade plugin is not a dependency

wary topaz
#

huh?

eternal oxide
#

it goes in a plugins section

barren pumice
# eternal oxide show code
Location playerLocation = player.getLocation();
Location targetLocation = playerLocation.clone().add(1, 0, 0);
Vector direction = targetLocation.subtract(armorStand.getLocation()).toVector();

double distance = direction.length();

double minimumFollowDistance = 1.0;

if (distance > minimumFollowDistance) {

    direction.normalize();

    double speed = 1.2;
    armorStand.setVelocity(direction.multiply(speed));
}
wary topaz
#

oh but the plugin works without it than

barren pumice
#

oh btw. can I make armorstand a marker and use velocity somehow?

eternal oxide
barren pumice
#

so I should use it after?

barren pumice
#

because I cant hit blocks etc. through the armorstand

eternal oxide
#

don't use a velocity greater than yoru distance

#

you are telling it to overshoot

cunning crater
eternal oxide
#

you have to parse all child perms if you want to implement wildcards

barren pumice
#

oh btw. can I make armorstand a marker and use velocity somehow?
but what about this, I want my armorstand to not block interactions

eternal oxide
#

try it and see?

barren pumice
#

try what

eternal oxide
#

as a marker

barren pumice
#

I set armorstand.setMarker(true) and velocity didnt work

eternal oxide
#

then you have your answer ๐Ÿ™‚

barren pumice
#

so I can't? that sucks

eternal oxide
#

what is this armorstand intended to do?

#

You mentioned a pet earlier

barren pumice
#

yea follow the player

eternal oxide
#

do you need to interact with it?

barren pumice
#

nope, just follow

eternal oxide
#

then you shoudl probably look at DisplayEntities

barren pumice
#

what is this

#

I don't have Display class :?

river oracle
#

I'm sorry what

do { // while not updated inside the loop we must wait for the main thread to sum
    System.out.println(workers.size() + " | " + chunkPositionMap.size()); // REMOVING THIS BREAKS EVERYTHING
} while (chunkPositionMap.size() != workers.size());

Any ideas?

whole portal
#

Hello Guys can anyone show me how I can catch this error?

[18:59:00 ERROR]: [org.bukkit.configuration.serialization.ConfigurationSerialization] Could not call method 'public static org.bukkit.Location org.bukkit.Location.deserialize(java.util.Map)' of class org.bukkit.Location for deserialization
java.lang.IllegalArgumentException: unknown world
        at org.bukkit.Location.deserialize(Location.java:1140) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:578) ~[?:?]
        at org.bukkit.configuration.serialization.ConfigurationSerialization.deserializeViaMethod(ConfigurationSerialization.java:85) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.configuration.serialization.ConfigurationSerialization.deserialize(ConfigurationSerialization.java:127) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.configuration.serialization.ConfigurationSerialization.deserializeObject(ConfigurationSerialization.java:207) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.configuration.file.YamlConstructor$ConstructCustomObject.construct(YamlConstructor.java:58) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:264) ~[snakeyaml-2.0.jar:?]
        at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:247) ~[snakeyaml-2.0.jar:?]
        at org.bukkit.configuration.file.YamlConstructor.construct(YamlConstructor.java:37) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.configuration.file.YamlConfiguration.fromNodeTree(YamlConfiguration.java:163) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:120) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:160) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:128) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(YamlConfiguration.java:309) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at at.spawn.spawn.loadConfig(spawn.java:105) ~[spawn-1.0-RELEASE.jar:?]
        at at.spawn.spawn.onEnable(spawn.java:71) ~[spawn-1.0-RELEASE.jar:?]
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:189) ~[purpur-1.20.1.jar:git-Purpur-2023]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:104) ~[purpur-1.20.1.jar:git-Purpur-2023]
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:507) ~[purpur-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugin(CraftServer.java:653) ~[purpur-1.20.1.jar:git-Purpur-2023]
        at org.bukkit.craftbukkit.v1_20_R1.CraftServer.enablePlugins(CraftServer.java:564) ~[purpur-1.20.1.jar:git-Purpur-2023]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:311) ~[purpur-1.20.1.jar:git-Purpur-2023]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1117) ~[purpur-1.20.1.jar:git-Purpur-2023]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323) ~[purpur-1.20.1.jar:git-Purpur-2023]
        at java.lang.Thread.run(Thread.java:1623) ~[?:?]
vital sandal
#

is there anyway that AsyncPlayerPreLoginEvent#disallow doesn't logging 2 times?

river oracle
#

You're using purpur api? Idk how much we can help

whole portal
eternal oxide
hazy parrot
wary topaz
fleet imp
#

how do I kill an instance of a CommandExecutor from inside itself

lilac dagger
#

wow, the ender dragon is so hard coded

whole portal
hazy parrot
eternal oxide
#

We use/Support Spigot here, not Paper

fleet imp
# hazy parrot What

I have a CommandExecutor that starts a countdown. If the countdown reaches 0 before a specific user input happens, i want the whole instance to cancel

wary topaz
#

yes but why? plugin.language is the result of the pluginmessaging

austere cove
#

guessing that message wont come through until after the player joins

wary topaz
#

so I should wait like 20 ticks?

eternal oxide
#

no

austere cove
#

no lol

wary topaz
#

80?

eternal oxide
#

you send that message when you get teh response from bungee

hazy parrot
eternal oxide
#

you do not wait

wary topaz
#

how do I know when I get the response?

eternal oxide
#

in PMC

austere cove
#

dont wait at all, use a callback

wary topaz
#

can I have an example?

fleet imp
hazy parrot
#

Can you send code

wary topaz
#

@EventHandler public void onPlayerJoin(PlayerJoinEvent event) { event.getPlayer().sendMessage("debug"); plugin.requestLanguage(event.getPlayer()).thenAccept(language -> { event.getPlayer().sendMessage("Your language is " + language); }); }

#

completeable futures are goat

#

spigot

#

buildtools

#

NO

#

caps

#

you just need to install buildtools

river oracle
wary topaz
#

and add spigot as a dep

river oracle
#

Once I have all of them I can sum them up

eternal oxide
#

no

wary topaz
#

you dont?

eternal oxide
#

?nms

wary topaz
#

personally I use protocollib

fleet imp
# hazy parrot Can you send code
public class command implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        Player player = (Player) sender;
        ScheduledThreadPoolExecutor sched = new ScheduledThreadPoolExecutor(1);
        ScheduledFuture<?> future = sched.schedule(() -> check(), 90, TimeUnit.SECONDS);

        TextComponent msg = new TextComponent("click here");
msg.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "trigger objective"))
        BaseComponent[] components = new ComponentBuilder().append(msg).create();
        player.spigot().sendMessage(components);

//code to await input (to be written)
        return true;
    }

    private void check() {
//cancel other method
    }
}
zealous osprey
#

Why does Java not throw exceptions that you don't catch, so fkn annoying AHHH

Let this be a warning to all that'll read this msg of voew:
Code in try-catches only throw exceptions if you catch them!
So smth like this won't throw a "DivideByZero" exception:

final int zero = 0;

try {
  final FileReader reader = new FileReader("some file ig");

  reader.read() / zero;

  reader.flush();
  reader.close();
}
catch (IOException e) { e.printStackTrace(); }
eternal oxide
#

no, an uncaught exception will be passed up the chain

wary topaz
#

@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
event.getPlayer().sendMessage("debug");
plugin.requestLanguage(event.getPlayer()).thenAccept(language -> event.getPlayer().sendMessage("Your language is " + language));
}

#

why is this happening?

eternal oxide
#

1.18.2 is before Mojang mappings, but also... Paper

river oracle
#

Mojmaps started in 1.17.1

zealous osprey
eternal oxide
#

Mojmaps were nto implemented in Spigot until around 1.18.5 I thiought

#

1.18.4

#

why do you want to ceate your own over using citizens?

#

creating yoru own you have to manage code for every version you want to support

hazy parrot
#

Also you can just call cancel() on future

eternal oxide
#

what version?

#

um

#

pretty sure citizens supports all versions

chrome beacon
eternal oxide
#

search my post history. I uploaded a zip for fakeplayer about a month or two back for 1.19.3

fleet imp
eternal oxide
#

this channel

#

posts by me

#

FakePlayer.zip I think

maiden kiln
#

Citizens supports 1.19.4, you should just update - using an outdated patch-version isn't a good idea anyway

hazy parrot
maiden kiln
#

Updating a server is simple, there are plenty of online guides - TL;DR you just stop your server, update the server jar, update all plugins to versions that support the new version, and start it back up (but again, there are plenty of guides with more detail)

fleet imp
hazy parrot
fleet imp
eternal oxide
#

its all teh code you need to spawn fake players

#

just pull what you need

#

maven

#

If I remember I had it spawn one in teh Listener when a player joins

#

its just demo code

#

so probably in FakePlayer

#

yep

fossil coral
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

fossil coral
#

where tf did the convert to kotlin go, brand new project

#

first time dealing with it, it always had that option

#

installed it from ubuntu software

#

hmm

#

it works with classes

#

also just noticed there is a new UI

pale hazel
#

Am I wasting my time with spigot tutorials, or should I just jump in and starting coding?

eternal oxide
#

If you know java do a first plugin tutorial

fossil coral
#

orr at least I didn't find any

pale hazel
#

This guy is really good but I feel like I'm selling myself short by just watching tutorials

#

Up to date I believe too

smoky oak
#

Can someone explain why PersistentDataContainer#get(key, PersistentDataType.STRING) returns an object instead of a string?

eternal oxide
#

because it's a single method

smoky oak
#

so it's guaranteed to be null or String?

whole surge
#

Hello. I imported remapped minecraft-server and i get error package net.minecraft.server.v1_20_R1 does not exist
Bellow is my pom.yml ๐ŸฅŸ

eternal oxide
#

thew return is always an object no matter what type you ask for

fossil coral
upper hazel
#

who can know how to get all sea biome locations in the world?

#

i want spawn dange

fossil coral
#

you kinda can't

smoky oak
#

minecraft generation is chaotic

#

so you can only know by generating that part

#

(With some... obvious exceptions -> flat worlds)

fossil coral
#

yeah

upper hazel
#

random generation occurs when loading player chunks??

smoky oak
#

no

#

but biomes can only be determined by either loading or generating the corresponding area

upper hazel
#

I mean, unless when creating the world, it will no longer be known in advance where the sea is

#

?

smoky oak
#

thats not known in advance

ocean hollow
#

what's better?

  1. save the Quest class to the list in the plugin, and then work with it, and then only save it to the database.
  2. create a Quest class, store it in the database, and then when you need to perform all sorts of functions for it
smoky oak
#

the coordinates and the seed enter a chaotic generative algorithm based on perlin noise

upper hazel
#

But what about the seed of the world, etc.

#

with the help of seed, they will find out where the dungeons are, etc.

smoky oak
smoky oak
upper hazel
#

well, if so, then the location is not chaotic because the coordinates are the same

#

in bioms

smoky oak
#

well that may be true, but you have to run the algorithm for biome generation to actually know what biome there is

smoky oak
#

imo yes

ocean hollow
#

okay, thanks

smoky oak
#

and good luck with that

whole surge
upper hazel
remote swallow
#

then reload maven

smoky oak
#

oh i couldnt see that

#

weird

wary topaz
#

now why is this error happening? I shaded the deps

smoky oak
#

don't you need that both on build and on the server?

wary topaz
#

?

smoky oak
#

the mariadb driver

wary topaz
#

yes

#

Class.forName("org.mariadb.jdbc.Driver"); is not found

#

how can I make it found? lol

remote swallow
#

whats ur pom looking like

smoky oak
#

I'm trying to remember if shading is supposed to include the thing youre linking

wary topaz
remote swallow
#

looks fine, probably incorrect path or something

#

use hikariCP and mysql driver

wary topaz
#

wait but this was working on bungeecord I think its something else thats messed up

upper hazel
#

what about the loading of chunks by the player?

whole surge
upper hazel
#

end check biom

remote swallow
tender shard
remote swallow
tender shard
#

R_1_20 is not part of the package name

#

Its just net.minecraft.server

remote swallow
#

isnt the dep wrong

#

its org.spigotmc not org.spigot

#

oh it is corret

#

mb

tender shard
wary topaz
#

try {
Class.forName("org.mariadb.jdbc.Driver");

} catch (SQLException | ClassNotFoundException e) {
e.printStackTrace();
getLogger().severe("Failed to connect to the database or load the configuration!");
}

if its not finding the driver what do I do?

remote swallow
#

just use hikari cp

wary topaz
#

whats that

remote swallow
#

a sql lib

#

that handles all the connection stuff for you

#

and adds a connection pool

wary topaz
#

so that should be the only dependencys?

remote swallow
#

yes

wary topaz
#

dependency?

#

alr

tender shard
wary topaz
#

thank you so much

whole surge
tender shard
#

because that's how it is?

wary topaz
#

EpicEbic how can I access UUID

#

like if I put uuid into the thing it will return the language

#

of the players prefered

wary topaz
#

or atleast how can I execute a query

tender shard
#
try(Connection connection = myDataSource.getConnection();
    PreparedStatement preparedStatement = connection.prepareStatement("SELECT Lang FROM Players WHERE UUID = ?");
) {
  preparedStatement.setString(1, myUuidAsString);
  ResultSet result = preparedStatement.executeQuery();
  ...
remote swallow
#

that

#

i was just tying it

remote swallow
wary topaz
#

tysm

tender shard
#

yes, my bad

#

the creation of the prepared statement also belongs into the try ( ... ) part

#

i edited it

quaint mantle
#

how can i get a items remaining durability

#

cause getDurability returns very weird things

remote swallow
crisp forum
#

Is there any good docs about sending messages to Bungee

wary topaz
#

the sql is on a different machine how can I get rid of this reror

remote swallow
#

ignore it pretty much

crisp forum
#

ignore it

wary topaz
#

Unable to resolve sysmbol players?

remote swallow
#

is it not inquotes

wary topaz
#

it is

remote swallow
#

msot likely something with intellij ultimate

wary topaz
crisp forum
#

ignore

remote swallow
#

and its db stuff

wary topaz
#

alr ill ignore

remote swallow
#

u can most likely disable the inspection

wary topaz
#

done

mortal hare
#

how cursed is that

remote swallow
#

not very

tender shard
#

that is pretty cursed

remote swallow
#

would prefer for a Class.forname with a paper class but ig that works

tender shard
#

or mohist

#

or catserver

remote swallow
#

fuck both of those

#

and why is anyone rujnning cb

green plaza
#

WHOS THE GUY WHO WANTED TO SEE MY PROJECT?

tender shard
#

NOT ME

remote swallow
#

WHAT PROJECT IS IT

brave bear
#

help me

tender shard
wary topaz
tender shard
brave bear
#

i have problem whit vault plugin

tender shard
#

how is this a development question?

mortal hare
remote swallow
tender shard
wary topaz
#

god damn

green plaza
wary topaz
remote swallow
#

its in ur pom

green plaza
#

@alpine urchin wanna see it?

lilac dagger
#

what even is modern loading strategy?

mortal hare
#

you either shade it or use dependencies tag inside yaml

#

iirc

tender shard
wary topaz
#

its the shade?

remote swallow
#

no it isnt

mortal hare
green plaza
remote swallow
#

thats intellij artifacts

wary topaz
#

i use maven

#

oh

remote swallow
#

you shade inside ur pom.xml

tender shard
#

then do not use build artifacts if you use maven

kindred sentinel
#

Hi, how to get slot of item that player picked up?

mortal hare
#

event.getClicked() iirc

wary topaz
tender shard
mortal hare
#

oh

tender shard
#

now all you gotta is to use maven to build

wary topaz
#

its been like that ;-;

#

why isnt it working

mortal hare
#

use maven tab

remote swallow
#

you havent been building with maven

mortal hare
#

to compile

#

not intellij build

wary topaz
#

yes I have

remote swallow
#

run maven package

wary topaz
#

oh

tender shard
#

if you have used maven, then why did you show a screenshot of IJ build artifacts? >.<

remote swallow
#

have you been pressing the big green hammer

tender shard
#

this is how to build ^

#

double click package

mortal hare
#

well after you click this you can then probably use run button to repeat the same task

#

so you can close the tab afterwards

hazy parrot
#

@brave bear does your plugin load before vault?

brave bear
#

how do i know?

hazy parrot
#

Have you added vault in plugin yml as dependency?

remote swallow
#

do you have softdepend: Vault in ur plugin.yml

#

or even depend: Vault

hazy parrot
#

Can you show it

wary topaz
#

im getting the same erro message

tender shard
#

manifold's syntax is cursed

remote swallow
tender shard
brave bear
#

i fixed

#

all ok guys

wary topaz
#

yes i did

tender shard
#

where did you take it from?

brave bear
#

๐Ÿ˜…

upper hazel
#

if i want rtp my structure in biom i need for loop?

wary topaz
tender shard
#

and where did you take the .ajr from?

remote swallow
#

where did you now take the jar from

tender shard
#

.jar *

brave bear
#

all ok bye bye and thanks <3

wary topaz
#

` 2023-08-06T17:05:50-04:00
[INFO] ------------------------------------------------------------------------
[WARNING]
[WARNING] Plugin validation issues were detected in 3 plugin(s)
[WARNING]
[WARNING] * org.apache.maven.plugins:maven-compiler-plugin:3.8.1
[WARNING] * org.apache.maven.plugins:maven-shade-plugin:3.2.4
[WARNING] * org.apache.maven.plugins:maven-resources-plugin:3.3.0
[WARNING]
[WARNING] For more or less details, use 'maven.plugin.validation' property with one of the values (case insensitive): [BRIEF, DEFAULT, VERBOSE]
[WARNING]

Process finished with exit code 0
`

remote swallow
#

where from

tender shard
#

where did you take the .jar from

wary topaz
#

where intellij compiles my plugin

tender shard
#

intellij does not compile your plugin

#

maven now compiles your plugin

#

so you are still using your old non-maven .jar

wary topaz
#

so I cant use intellij build anymore?

tender shard
#

no

remote swallow
#

no

tender shard
#

why are oyu using maven in the first place if you don't wanna use it

kindred sentinel
remote swallow
#

alex get the blog out

wary topaz
#

i love maven?

remote swallow
#

you arent using it though

tender shard
remote swallow
#

output dir

wary topaz
#

how do I change mavens output directly

unreal quartz
#

Menace to society

#

Frick ur cookies

kindred sentinel
#

In any case, I need to find out if the item picked up by the player is in his hands

tender shard
#

blame EU for that cookie banner

wary topaz
#

wrong message

tender shard
#

then you'll have to manually check the inventory for the first matching slot

wary topaz
#

y.
[21:09:09 INFO]: Paper: Using OpenSSL 3.0.x (Linux x86_64) cipher from Velocity.
[21:09:10 WARN]: [org.bukkit.craftbukkit.v1_20_R1.legacy.CraftLegacy] Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug!
[21:09:16 WARN]: Legacy plugin Lobbymanager v1.0 does not specify an api-version.
[21:09:16 ERROR]: [ModernPluginLoadingStrategy] Could not load plugin 'Lobbymanager.jar' in folder 'plugins'
org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: com/zaxxer/hikari/HikariDataSource
at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:127) ~[paper-1.20.1.jar:git-Paper-108]
at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:35) ~[paper-1.20.1.jar:git-Paper-108]
at io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:116) ~[paper-1.20.1.jar:git-Paper-108]
at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:39) ~[paper-1.20.1.jar:git-Paper-108]
at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:36) ~[paper-1.20.1.jar:git-Paper-108]
at org.bukkit.craftbukkit.v1_20_R1.CraftServer.loadPlugins(CraftServer.java:508) ~[paper-1.2

remote swallow
#

nice ip you got there

wary topaz
#

thats just my ubuntu

#

10.2.99.111:8123

undone axleBOT
wary topaz
tender shard
#

looks good. you are still using the wrong .jar

remote swallow
#

is the profile enabled

#

and is that actually where your plugins folder is

wary topaz
#

no I upload my plugin to pterodactyl

tender shard
#

i highly doubt it, it doesn't even end in plugins/

wary topaz
#

since mysql is on my linux

#

and im no where near it

remote swallow
#

delete the old jar on ptero and downloads, then build again making sure the profile is enabled and the upload the new jar

tender shard
#

send your full maven log

#

after you ran mvn package

wary topaz
tender shard
#

C:\Users\ethga\OneDrive\Desktop\BetterServer\Lobbymanager\target\Lobbymanager-1.0.jar

#

did you use this .jar?

wary topaz
#

oh uhh no

remote swallow
#

thats crazy, you dont have the proifle enabeld it looks like

tender shard
#

have you even read the blog post about how to change the output directory

#

or did you just copy / paste it without reading it

wary topaz
#

i copy an pasted it ๐Ÿ˜„

tender shard
#

yeah well then read it again pls

remote swallow
#

im going to bed before my brain commits suicide

#

good luck

wary topaz
#

ima ujst do it the lazy way

remote swallow
#

it takes 1 button press

tender shard
#

you do realize that all you gotta do is click one checkbox right?

remote swallow
#

just read and look at the pictures

wary topaz
#

wait checjkbox?

remote swallow
#

yes

#

Look at the images

tender shard
#

i literally wrote down every step

remote swallow
#

is this big enough for you

tender shard
#

look at my fancy arrow

remote swallow
#

thin arrow

wary topaz
#

it works!

tender shard
#

as expected ๐Ÿ˜„

remote swallow
#

this is what happens when you read the instructions

wary topaz
#

thank you!

#

where is the message

#

?

remote swallow
#

show ur code

wary topaz
#

wait give me a minute

#

let me try something

tender shard
#

btw you should update your maven-shade-plugin to 3.5.0 in case you ever update your java version

wary topaz
#

what de hell

remote swallow
#

show ur code

#

like i said the first time

tender shard
#

what's the issue?

wary topaz
tender shard
#

works exactly as it should

#

what's the issue

wary topaz
#

it is supposed to say "en"

tender shard
#

why? no

remote swallow
#

result.getString("xyz")

#

it helps if you use google

#

why arent you just .toString

wary topaz
#

does it really matter?

remote swallow
#

no

tender shard
remote swallow
#

dont remember

tender shard
#

you have to

remote swallow
#

been a while since i did mysql

#

but half of these issues are very basic and can be solved in 1 google search, eg "Oh whats this? ResultSet? never heard of it, ill google it to see how to use it"

tender shard
#
String lang = null;
if(rs.next()) {
  lang = rs.getString("Lang");
}
#

rs is the resultset

glad prawn
#

while or if is better

tender shard
#

if is better than if?

remote swallow
#

while(rs.hasNext() most likely

tender shard
#

99% the UUID will be the primary key

#

so there will be either 0 or 1 results

glad prawn
#

hehe 1

remote swallow
#

im going to bed before i start a fight

tender shard
#

and even if you'd use while - then you would also only ever get one entry

wary topaz
#

`@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
event.getPlayer().sendMessage("debug");
try (Connection connection = plugin.sql.getConnection()) {
PreparedStatement preparedStatement = connection.prepareStatement("SELECT Lang FROM Players.PlayerData WHERE UUID = ?");
preparedStatement.setString(1, String.valueOf(event.getPlayer().getUniqueId()));
ResultSet result = preparedStatement.executeQuery();

    if (result.next()) {
        String lang = result.getString("Lang");
        event.getPlayer().sendMessage(lang);
    } else {
        event.getPlayer().sendMessage("No language data found for you in the database.");
    }
    
} catch (SQLException e) {
    event.getPlayer().sendMessage("An error occurred while fetching your language data.");
    // You can also log the error for debugging:
    // e.printStackTrace();
}

}
`

#

this should work

#

let me test it

remote swallow
#

that sql might be wrong, i dont remember the correct format lol

pale hazel
wary topaz
#

IM GONNA cry

#

thank you guys so much

#

im going to bed ๐Ÿ˜‰

tender shard
#

good night

wary topaz
#

gn

remote swallow
#

You what

quaint mantle
#

why doesnt this work

chrome beacon
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

quaint mantle
#

it literally doesnt work. returns null

#

just nothing

#

i dont know how else to explain it

#

there is no error code nothing

#

it just does nothing

chrome beacon
#

Does the item have a display name set

quaint mantle
#

yes

#

ig?

eternal oxide
#

it can;t return null

quaint mantle
#

isnt display name just the items name?

eternal oxide
#

getMeta can though

tender shard
tender shard
#

Is it null or an empty string?

quaint mantle
quaint mantle
tender shard
chrome beacon
quaint mantle
quaint mantle
tender shard
#

But as olivo said you can display it

#

getTranslationKey was PRed by some genius for this

quaint mantle
#

cant i just get whats its called on english? fk multi langual

tender shard
#

?nms

chrome beacon
#

Which version? And why craftbukkit

tender shard
quaint mantle
chrome beacon
#

Instead of Spigot

eternal oxide
#

he's on 1.18.2 I think

tender shard
#

In that case: ?nms

chrome beacon
#

?bootstrap

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

tender shard
#

?nms

chrome beacon
#

Preferably this ^

eternal oxide
#

you don;t copy

#

you read it and understand

#

read it until you do

tender shard
#

what do you not understand?

#

doesnt matter where

eternal oxide
#

all we will do is repeat whats already on that page

tender shard
#

just download buildtools and run it

#

it does stuff and then it'll work

torn shuttle
tender shard
#

yeees

worldly ingot
#

TECHNICALLY with Mojmaps it's just NM :D

torn shuttle
tender shard
worldly ingot
#

There are, yes

eternal oxide
#

run in same folder

lilac dagger
#

do you double click it @fierce cave

#

?

tender shard
#

obviously you have to run that command in the folder where you downloaded buildtools to

#

READ

eternal oxide
#

seriously

#

Would you like us to remote into your PC and do it for you?

tender shard
torn shuttle
eternal oxide
#

I was just goign to go "Connecting..." ๐Ÿ™‚

tender shard
#

there's a suspicous stew typing

torn shuttle
#

I didn't know you discriminated against specific stews, I see how it is

eternal oxide
#

lol

tender shard
#

you have not read the buildtools isntructions

eternal oxide
#

don;t run it on your desktop

tender shard
#

Please do not run in a path with special characters!

chrome beacon
#

Read what it tells you

eternal oxide
#

OneDrive = bad nightmare

torn shuttle
#

you mean don't run it on onedrive

tender shard
#

oh yeah one drive too

torn shuttle
#

desktop is fine

tender shard
#
  1. onedrive not allowed
  2. spaces in path not allowed
  3. special chars in path not allowed
#

wtf just move it to somewhere else

torn shuttle
#

no he's correct

tender shard
#

C:\BuildTools, whatever

torn shuttle
#

windows for some reason defaults to this garbage now

#

it's a recent thing, my laptop was doing the same thing

eternal oxide
#

I don;t have OneDrive in windows 7 ๐Ÿ˜‰

tender shard
#

you also don't have security updates in windows 7 I believe

eternal oxide
#

I have all I want

torn shuttle
#

hell yeah brother

tender shard
torn shuttle
#

don't let these nerds stop you from downloading freedom viruses

eternal oxide
#

yum, I just ate sweet and sour chicken balls

buoyant viper
#

did somebody say freedom?

pseudo hazel
#

you also dont have onedrive if you nuke it from your pc

buoyant viper
#

๐Ÿ‡บ๐Ÿ‡ธ

torn shuttle
#

๐ŸŒญ

tender shard
buoyant viper
#

๐Ÿ”

pseudo hazel
#

just as much effort

torn shuttle
eternal oxide
#

Now Patience...

torn shuttle
#

so much freedom today

buoyant viper
#

downwoading apache maven and git for windows

torn shuttle
#

I'm crying bbq tears

buoyant viper
#

what does onedrive have to do with a proper os

#

its for cloud storage

#

thats it

tender shard
#

nah windows uses it as default now

#

for your desktop and stuff

buoyant viper
#

doesnt apple do that w icloud lol

torn shuttle
#

yep

eternal oxide
#

MS in your shit stealing all your Pron

torn shuttle
#

also a fake os

buoyant viper
#

ur desktop and documents are cloud folders

tender shard
#

if you click no, it doesn't do that

buoyant viper
#

microsoft asks u if u want onedrive too

chrome beacon
torn shuttle
#

if you're not using TempleOS are you even using a computer

buoyant viper
#

it still installs it, but defo doesnt /use/ it

tender shard
#

idk, magma claimed that it does it by default

#

I'm on windows 11 and also don't have any onedrive enabled

torn shuttle
#

you can toggle it off on a fresh install but the default prompt is allowing it

lunar wigeon
#

how to use BlockDisplay or sth like that, I dont have it in my spigot project (1.18.2)

lunar wigeon
#

oh

#

thats why

tender shard
#

you can probably safely update to 1.19.4, almost nobody uses versions between 1.18.2 and 1.19.3

#

yeah well 6.8% on 1.19.2, for whatever reason

spice ibex
#

I'm trying to make a plugin where you can disable certain enchanted books from appearing in villager trades. Is there a way to go through each possible villager trade and remove them from potentially appearing?

#

either that, or is there some way to reroll a villager trade if it contains a blacklisted item

tender shard
#

listen to VillagerAcquireTradeEvent

#

and cancel it if the recipe's result is an enchanted book

spice ibex
#

that just deletes the recipe

#

I want to reroll it

#

so you have a higher chance of getting whitelisted enchants

tender shard
#

then get the villager's loot table and grab a random other recipe

spice ibex
#

how do I get its loot table

#

nvm

tender shard
#

sth like this should do

    @EventHandler
    public void onTradeAquire(VillagerAcquireTradeEvent event) {
        MerchantRecipe recipe = event.getRecipe();
        if(recipe.getResult().getType() != Material.ENCHANTED_BOOK) return;
        MerchantRecipe newRecipe = new MerchantRecipe(getRandomLoot(event.getEntity()), recipe.getUses(), recipe.getMaxUses(), recipe.hasExperienceReward(), recipe.getVillagerExperience(), recipe.getPriceMultiplier());
        event.setRecipe(newRecipe);
    }
    
    public static ItemStack getRandomLoot(AbstractVillager villager) {
        Inventory inv = Bukkit.createInventory(null, 9);
        LootTable lootTable = villager.getLootTable();
        lootTable.fillInventory(inv, ThreadLocalRandom.current(), new LootContext.Builder(villager.getLocation()).lootedEntity(villager).build());
        return inv.getItem(0);
    }
#

that would use the same ingredients so you might wanna change that somehow, idk

#

also I'm not sure if the LootTable actually consists of the potentional trade results or whether it's just their kill drops

#

you'll have to try it

spice ibex
#

yeah that's what I was worried about, let me check

tender shard
#

but since there's one loot table per villager type, they prooobably contain the recipe results

#

otherwise it'd make little sense to have separate loot tables i guess

lilac dagger
#

and since no plugin cries for an update they just use it as is

lunar wigeon
wise mesa
#

item displays didn't exist in 1.18.2

tender shard
wise mesa
#

mojang added them in 1.19.4

#

is there any reason you need the backwards compatibility

tender shard
#

yeah

#

?nms

tender shard
#

continue with this after the buildtools part

wise mesa
#

it installed it into your local maven

#

hey wait

#

did you run it with --remapped

#

oh nvm i thought it made an additional file

#

carry on

tender shard
#

replace it

wise mesa
#

replace

tender shard
#

basically just add the <classifier> part to your dependency

wise mesa
#

and get rid of api

tender shard
#

oh yeah

eternal oxide
#

and remove -api

tender shard
#

didnt see that

wise mesa
#

added an event system to my game akin to spigot's

#

now with listener priorities

wary topaz
#

omg freak me

tender shard
#

not really

wary topaz
#

im back lol

#

cant sleep

#

time to code

tender shard
#

basically you only needed to run buildtools and adjust the dependency and copy the specialsource part

spice ibex
tender shard
#

alternatively try LootTables.VILLAGER_<PROFESSION>

#

np

tall dragon
#

did you register the listener

tender shard
#

why do you keep repeating the mistakes I already told you about yesterday?

#

you'r enot using the consumer to spawn the entity and you also recreate a new useless random everytime

#

you also didnt add any debug output at the top of your listener

tall dragon
#

ooh angry alex!

tender shard
#

I'm tired of people asking for help then ignoring every advive

#

the error is also obvious and you'd have easily found it out yourself by printing out m.getType()

#

you need to check the event's getNewState() instead

tall dragon
#

fair enough uwu

tender shard
#

because the block is still AIR when that event is called

#

also why is the block called "m" and what's "GG" supposed to mean. and the creeper's name is "bz"? why aren't you using proper variable names

tall dragon
#

what are your thoughts on the bracket formatting alex?

tender shard
#

why the heck is the string cast to string

#

and the char cast to char

#

??

young knoll
#

Sometimes you gotta make sure

lavish hemlock
#

What if your short eventually grows up and becomes a long one day?

#

I modded a code base one time that was written in C# and

#

The dev literally never used proper types for half of it

tender shard
#
        @EventHandler
        public void OnGrow( BlockGrowEvent event) {
            Block m = (Block) ((BlockEvent)event).getBlock();
            if((((Material)((Block)m).getType()) == (Material) Material.BAMBOO)) {
                int $_GG = (int) ((Random)new Random()).nextInt((int)200);
                if ((int)$_GG >= (int)1) {
                    Bukkit.broadcastMessage(((String)(CharSequence)"FUNCA"));
                    Creeper asd = (Creeper)((World)((Block)m).getWorld()).spawnEntity(m.getLocation().add((double)0.0D, (double)1.0D, (double)0.0D), (EntityType) EntityType.CREEPER);
                    asd.setCustomName(ChatColor.translateAlternateColorCodes((char)'&', (String)"&a&lLeave Creeper"));
                    asd.setSilent((boolean)true);
                    asd.addPotionEffect((PotionEffect) new PotionEffect((PotionEffectType) PotionEffectType.SLOW_FALLING, (int) 39999600, (int) 0));
                    asd.addPotionEffect((PotionEffect) new PotionEffect((PotionEffectType) PotionEffectType.INVISIBILITY, (int) 20*20, (int) 1));
                }
            }
        }

did I miss anything?

lavish hemlock
#

He just used the any type everywhere and casted to the type he wanted

lavish hemlock
tall dragon
lavish hemlock
#

Oh, true

tender shard
#

fixed it, i casted it to BlockEvent

tall dragon
#

i mean what if spigot sends you a different event by mistake

#

can happen

tender shard
#

aint no point in casting it to the specific event type

lavish hemlock
#

The fucking (Random) new Random() is so silly oml

tall dragon
#

personally this is my favorite (String)(CharSequence)"FUNCA"

young knoll
#

Hey you never know what constructing a class will return

lavish hemlock
#

Yeah the JVM might just spit out the wrong type eventually

#

And actually you should probably just make extra sure you're using the right type by casting twice, since the cast could give you the wrong type too

lilac dagger
unreal quartz
#

Fuck types

#

Real men cast to Object and use reflection to access methods

young knoll
#

I once saw some decompiled server code that casted to blockstate 4 times

#

Beautiful

tender shard
#
public class BambooGrowListener implements Listener {

    private final Random random = new Random();

    @EventHandler
    public void spawnCreeperOnBambooGrow(BlockGrowEvent event) {
        if (event.getNewState().getType() != Material.BAMBOO) {
            return;
        }

        int chance = random.nextInt(200);

        if (chance < 1) {
            return;
        }

        Location location = event.getBlock().getLocation().add(0.0, 1.0, 0.0);

        location.getWorld().spawn(location, Creeper.class, CreatureSpawnEvent.SpawnReason.CUSTOM, creeper -> {
            creeper.setCustomName(ChatColor.translateAlternateColorCodes('&', "&a&lLeave Creeper"));
            creeper.setSilent(true);
            creeper.addPotionEffect(new PotionEffect(PotionEffectType.SLOW_FALLING, 39999600, 0));
            creeper.addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 20 * 20, 1));
        });
    }
}

I couldn't go to bed without sending the proper version

#

idk why it didnt copy the new lines properly

unreal quartz
#

C# programmer detected

wise mesa
#

on god

wise mesa
#

love c#

#

been programming in it

wise mesa
#

making games in it is so much fun

#

its crazy its like when i code in java i hate my life and i have the opposite of fun

#

when i code in c# i have fun doing it

mellow snow
#

Is anyone available to help me in vocal that I'm not good at writing in English?

lavish hemlock
#

Oh yeah I can relate to hating your life when coding Java

wise mesa
#

like i do it anyways because I want the end product

#

but it isn't fun

lavish hemlock
mellow snow
lavish hemlock
#

It's always closer to

relief

#

Anyway so yeah hah funni coffee language

wise mesa
#

maybe kotlin would be better but it scares me

lavish hemlock
#

Run.

mellow snow
#

I need to check only a piece of the name of a luckperms group

lavish hemlock
#

You've mentioned Kotlin, they're coming for you.

whole surge
#

i have a little question. how can i get NoClassDefFoundError to class i had never used ๐Ÿ˜•

wise mesa
#

can you send the entire stack trace

tender shard
wise mesa
#

the whole error

tender shard
#

?nms

lavish hemlock
#

Don't you know that the people in this server will shove sticks up their asses if you do so much as mention either Kotlin or Rust?

tender shard
#

^

wise mesa
#

i love rust despite having used it like once and not doing any actual projects in it

whole surge
wise mesa
#

but its great i love it

tender shard
wise mesa
#

@whole surge are you using special source

whole surge
# wise mesa the whole error
[22:14:39] [Thread-26/WARN]: Caused by: java.lang.NoClassDefFoundError: net/minecraft/world/level/ItemLike
[22:14:39] [Thread-26/WARN]:     at MineA4.jar//su.haku.quinowell.player.CanvasSection.<init>(CanvasSection.java:36)
[22:14:39] [Thread-26/WARN]:     at MineA4.jar//su.haku.quinowell.player.VideoFrame.<init>(VideoFrame.java:31)
[22:14:39] [Thread-26/WARN]:     at MineA4.jar//su.haku.quinowell.render.RenderWorker.call(RenderWorker.java:24)
[22:14:39] [Thread-26/WARN]:     at MineA4.jar//su.haku.quinowell.render.RenderWorker.call(RenderWorker.java:11)
[22:14:39] [Thread-26/WARN]:     at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[22:14:39] [Thread-26/WARN]:     at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
[22:14:39] [Thread-26/WARN]:     at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[22:14:39] [Thread-26/WARN]:     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[22:14:39] [Thread-26/WARN]:     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[22:14:39] [Thread-26/WARN]:     ... 1 more
[22:14:39] [Thread-26/WARN]: Caused by: java.lang.ClassNotFoundException: net.minecraft.world.level.ItemLike
[22:14:39] [Thread-26/WARN]:     at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:185)
[22:14:39] [Thread-26/WARN]:     at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:152)
[22:14:39] [Thread-26/WARN]:     at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
[22:14:39] [Thread-26/WARN]:     ... 10 more```
tender shard
#

you have NOT remapped your .jar

lavish hemlock
wise mesa
#

oh yea you sent that a while ago

tender shard
#

?nms

tender shard
#

^

mellow snow
#

I would check only the first part of the group name for example:
LSPDAGENT I want to check only if there is lspd

wise mesa
#

seems very cool

lavish hemlock
#

But yeah so things to note about Kotlin

#

It's not that similar to Java

#

It introduces a lot of its own unique concepts as it's very focused on syntactic sugar

whole surge
lavish hemlock
#

If there were a programming language spectrum, you'd have one side that's all about imperative paradigms and explicit logic (Assembly)
And the other side would be declarative and implicit logic (Kotlin)

#
  • The type system functions differently to Java in a number of ways (generics work differently, companion objects, objects, receiver types)
  • There are certain convenience features that are actually pretty nice, i.e. type aliasing, import aliasing, extension methods, top-level functions.
  • It does not run as fast as regular Java, you are sacrificing a bit of performance for (subjective) comfort, the Kotlin stdlib, and multi-platform (Native, JS, and JVM).
  • Kotlin is very focused around DSLs (domain-specific languages, i.e. APIs that look like their own programming languages) and functional programming.
    • This is actually the main reason why it's the language of choice for Android. It allows you to declare UIs in code using a much more eloquent API.

Generally speaking, it's actually pretty nice to code in. I'd recommend you read the online docs rather than go through Koans though.

tender shard
lavish hemlock
#

Oh yeah also there's coroutines, that's pretty neat.

mellow snow
#

I would check only the first part of the group name for example:
LSPDAGENT I want to check only if there is lspd

Please help me I want to sleep duke

tender shard
#

substring, contains, startsWith, ...

mellow snow
tender shard
#
if("asd".startsWith("a")) {
  // "asd" starts with "a"
mellow snow
#

love you

lavish hemlock
#

I ship it

lavish hemlock
tender shard
#

I like latin

#

Especially ACI constructions

lavish hemlock
#

Latin is pretty cool

tender shard
#

Theres a latin Wikipedia

lavish hemlock
#

I'm gonna get called a weeb for this but I've always been more partial to East Asian languages lol

#

Japanese is fascinating linguistically

edgy crystal
#

Hello Guys, if i compile my Bukkit Plugin i've got this error:

[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.```

if i re-run the BuildTool ``java -jar BuildTools.jar --rev 1.20.1``, it works. So if i restart my IDE it no longer works, how to fix it?
tender shard
#

To see the full stack trace of the errors, re-run Maven with the -e switch.

#

then ?paste it

#

or just use -X

#

mvn clean package -X

whole surge
tender shard
#

you still ahven't remapped it properly

#

you are now mapping it to obfuscated mappings

#

`nms

#

?nms

tender shard
#

do it like there ^

#

you are supposed to use the .jar that's simply called "YourPlugin-Version.jar" and not "YourPlugin-Version-remapped-obf.jar" or anything

whole surge
#

ะฐะฐะฐะฐะฐะฐ ะฑะปั

tender shard
#

the remapped-obf .jar is basically an interim stage - first it takes your mojang mapped .jar, then remaps it to obfuscated mappings (the remapped-obf.jar) and then remaps that again to spigot mappings. In the default specialsource config (the one from my blog post, which is also found in the spigot 1.17 announcement) the spigot-mapped .jar will replace your original mojang mapped .jar, so yeah it's just MyPlugin-1.0.jar

#

then you haven't run buildtools for 1.18.2 with the --remapped flag

#

then why did you use the 1.18.2 mappings?

whole surge
wary topaz
#

why is this happeninggg

tender shard
#

because you just insert another row

wary topaz
#

im new to sql

tender shard
#

your original table looked like this:

| UUID | Lang |
|------|------|
| 1234 | en   |

and now it looks like this

| UUID | Lang |
|------|------|
| 1234 | en   |
| 1234 | hi   |
wary topaz
#

can I drop all of them btw?

tender shard
#

DELETE FROM Tablename WHERE UUID = ?

#

to insert OR change you do INSERT INTO ... ON DUPLICATE KEY UPDATE

#

that requires having the UUID column as primary key

#
INSERT INTO Tablename (UUID, Lang) VALUES (?, ?) ON DUPLICATE KEY UPDATE Lang=?
#

but as said, your table must have the primary key set to the uuid column

#

btw you should think about using consistent column names

CREATE TABLE IF NOT EXISTS `Tablename` (
    `uuid` VARCHAR(36) NOT NULL,
    `language` VARCHAR(2) DEFAULT NULL,
    PRIMARY KEY (`uuid`)
);
#

idk what you're talking about

#

are you trying to create a fake player or what?

#

if so have you even sent the packets to the online players?

#

which packet?

#

i guess you have to send the AddPlayerPacket first

#

and then the other one

#

?

#

i guess you have to send the AddPlayerPacket first
and then the other one

#

no

lavish hemlock
#

Have you taken a look at the login sequence on wiki.vg?

#

It should help at least somewhat.

tender shard
#

you do 1. and then 2.

#

I asked you to do 2. and then 1.

lavish hemlock
#

While you don't need to emulate the actual login (i.e. authentication and compression and such - which isn't even possible since those include C2S packets), there is a bit more to it than just sending a player info packet afaik.

echo basalt
#

I remember something about a location packet

#

Or inventory packet

lavish hemlock
#

Looking at wiki.vg suggests it's Player Info Update -> Spawn Player

tender shard
#

does it show up in chat?

#

the name

#

does the name of the player show up in chat's tabcomplete?

tender shard
#

wdym "the player who run the command"?

lavish hemlock
#

Yeah

#

That means you need to use wiki.vg as reference

tender shard
#

and I meant the name of the player you added

#

not who ran the command

#

it's obvious that an actual online palyer shows up there

lavish hemlock
#

Their Protocol page details all the fields and requirements for packets.

tender shard
lavish hemlock
#

Eh it's usually not too far off from the proper name

tender shard
#

then how do you expect them to show up in the tab list if you didnt give them any name?

lavish hemlock
#

Something to note is that they've existed longer than Mojmap has

tender shard
#

yeah but why don't they at least add the proper name now that it's available

lavish hemlock
#

Laziness?

tender shard
#

idk which packets are needed for the tab list

river oracle
#

I'm quite stumped. Essentially I have a system in which I send tasks to the main thread to be queued (I need chunksnapshots which can not be created asynchronously. I essentially halt the main process of my scheduler until I recieve ALL ChunkSnapshots back (These chunk snapshots run separate calculation tasks so computing time isn't wasted while waiting). Once all tasks are processed on the main thread my code should start working again. However, it only does 'sometimes'
https://paste.md-5.net/otedigotan.cs
Essentially if I uncomment the System.out.println(workers.size() + " | " + chunkPositionMap.size()); inside of my while loop (a debug used to check and make sure all workers are recieved) my code processes as normally, however as soon as I comment this debug, it stops processing and never proceeds on past the while loop (ending in an infinite loop. Now I was a bit curious why this would happen so I took a look at the recompiled jar code when the sysout is commented and nothing seems out of ordinary https://paste.md-5.net/fuzosopina.cs. I'm confused beyond belief and would want to know a somewhat technical reason why this occurs

river oracle
eternal oxide
#

That would indicate a syncronization issue

ivory sleet
#

Im rather unsure if cdl is the best choice here

eternal oxide
#

ah I see

#

change your map type and iterate instead of a for loop

#

A ConcurrentSkipListMap would work well for you

#

as you are doing it all async its slow access won;t be anissue

#

I'm guessing your issue is your async thread is trying to start work before the main thread has finished accessing your Map causing the locked thread. the sysout is just enough to delay it and allow it to be released

#

using an iterator and a skipList will solve that

quaint mantle
#

hello team.

I have a plugin which uses an sqlite database... just wondering if this design setup will cause issues on a big scale of things and if there is a better way to go about this.

    @EventHandler
    public void onPlayerHit(EntityDamageByEntityEvent event) {
        if (!(event.getDamager() instanceof Player)) return;
        if (!(event.getEntity() instanceof Player)) return;
        Player attacker = (Player) event.getDamager();
        Player victim = (Player) event.getEntity();


        Optional<String> attackerGang = gangAPI.getPlayerGangName(attacker.getUniqueId().toString());
        Optional<String> victimGang = gangAPI.getPlayerGangName(victim.getUniqueId().toString());


        if (attackerGang.isPresent() && victimGang.isPresent()) {
            if (attackerGang.get().equals(victimGang.get()) && !attackerGang.get().equals("Wilderness")) {
                event.setCancelled(true);
                attacker.sendMessage(Msg.color("&eYou cannot hurt&c " + victim.getName()));
            }//if
        }//if
    }//onPlayerHit

gangAPI.getPlayerGangName

    public Optional<String> getPlayerGangName(String uuid) {
        Optional<String> answer;
        try(Connection conn = DriverManager.getConnection(gangDatabase.getPath());
            PreparedStatement statement = conn.prepareStatement(
                    "SELECT gang_name FROM players WHERE uuid = ?;"
            )
        ) {
            statement.setString(1, uuid);
            ResultSet resultSet = statement.executeQuery();
            if (resultSet.next()) {
                answer = Optional.ofNullable(resultSet.getString("gang_name"));
            }//if
            else {
                answer = Optional.empty();
            }//else
        }//try
        catch (SQLException e) {
            answer = Optional.empty();
        }//catch
        return answer;
    }//getPlayerGangName

Is it bad to send a query like that every time a player gets hit by another player?

eternal oxide
#

cache gangs, don;t query live

river oracle
zealous snow
zealous snow
#

adding this on his is rip to perfomrance

#

yea but if he wanted to add this on hit he could believe in losing memory xd

river oracle
#

quereing every time you need data is like the ultimate way to kill performance on top of that they're using Optional which does no service to both CPU and Memory performance

#

Optional in java is super slow

zealous snow
river oracle
#

streams aren't bad compared to optional tbh. Streams have good performance once warmed up

zealous snow
#

worse performance compared to for loop

river oracle
#

Optional is just a useless wrapper for a null check

#

I can see its use in API design, but not internally

zealous snow
slender elbow
#

if anything the memory footprint is marginally larger, but unless you are running with -Xint the performance difference is actually negligible

#

unless you are insane like mojang and you like to run them in very hot spots l m a o

wary topaz
#

[02:12:38 INFO]: [com.zaxxer.hikari.HikariDataSource] Players-Connection-Pool - Starting...
[02:12:38 INFO]: [com.zaxxer.hikari.HikariDataSource] Players-Connection-Pool - Start completed.

Can I remove this message?

worldly ingot
#

ThrownPotion has no setBasePotionData() method

#

The PotionMeta of the ItemStack you're setting via #setItem() would though

vital ridge
#

how can i check if my json file is empty?

worldly ingot
#

Two options, depends on how you want to define "empty". If you just want {}, then parse the JSON and check if the json object has any keys. If you want to check the there are no characters in the file, read the file's contents as a string, check if isEmpty() (or isBlank(), whichever you want), do what you want, then parse that string into JSON

vital ridge
#

I mean I don't rly have any objects to parse other than gson and file

#

I can just to file.toString().isEmpty()?

worldly ingot
#

Well, no, because a File object's #toString() doesn't return the contents of the file

vital ridge
#

yeah

worldly ingot
#

You'll have to read the contents with a buffered reader

vital ridge
#

thats what i thought aswel

worldly ingot
#

You can Google about file reading. It's just regular Java there

vital ridge
#

I can just use an inputstreamer

worldly ingot
#

Lots of articles on it

vital ridge
#

i guess