#help-development

1 messages · Page 306 of 1

humble tulip
#

nice

twilit garden
#
for (int i = 0; i < splittedString.length; i++) {
            ChatColor.translateAlternateColorCodes('&', splittedString[i]);
            String color = ChatColor.getLastColors(splittedString[i]);
            splittedString[i + 1] = color + splittedString[i + 1];
            strings.add(splittedString[i + 1]);
            i++;
        }

hmm how sould i fix this

#

the index is out of bounds bc im tyirng to add to the next string

#

is there a way to make it not?

wet breach
#

use

#

StringBuilder and you can use append

#

or prepend

twilit garden
#

kk

humble tulip
#

is there a changelog for spigot?

#

like can i see when specific features were added?

remote swallow
remote swallow
humble tulip
#

eg when was Player#getLocale added

#

ah that sucks

#

gonna just look through old javadocs

pseudo hazel
#

I am seeking some advice on how to implement a thing I wanna do in my plugin. I am making a plugin that has an inventory gui, nothing crazy so far. now there are like a few submenus and stuff but my question is how can I make a system that can handle these submenus more elegantly than having like a bunch of classes.

Like ideally it would some kind of system where I can create a menu with like 3 options, and each option brings me to another menu, which does or does not have such options. idk if im making sense

#

basically I am getting stuck at making it dynamic I guess

humble tulip
#

ah

#

create a menu object would be your first guess

#

menu holds an inventory

#

lemme draft sumn up read quick

pseudo hazel
#

yes thats kinda how far I am

remote swallow
#

using maven shade how can i relocate something to another module

#

if its in the parent pom

pseudo hazel
#

black magic

#

srry idk

warm light
#

ahh, getting [proguard] Note: duplicate definition of library class anyone here using proguard?

humble tulip
#

just a pic of the classes in your ide would be fine

pseudo hazel
#

all of them? xD

humble tulip
#

nah just the menu ones

pseudo hazel
#

its for a bingo plugin fyi

#

AbstractGUIInventory is the one that has the inventory and methods to open them for players

#

public abstract class MultiPartUI extends AbstractGUIInventory
{
    private String currentPath;

    public MultiPartUI(String title, AbstractGUIInventory parent)
    {
        super(45, title, parent);
        this.currentPath = "root";
    }

    @Override
    public void delegateClick(InventoryClickEvent event, int slotClicked, Player player, ClickType clickType)
    {

    }
}``` and this is the on im making rn
#

ignore the currentpath thing I was trying something but it failed

humble tulip
#

you want a path so you can have back buttons?

pseudo hazel
#

well kinda

humble tulip
#

just have a menu that is the parent

pseudo hazel
#

I want to be able to go back and forth

humble tulip
#

yeah have the parent

pseudo hazel
#

like I want to navigate several windows to pick some options

humble tulip
#

im gonna use a phone for example

pseudo hazel
#

like filtering for a category

#

ok

humble tulip
#

You have homescreenmenu, parent is null
you have appsmenu, parent is homescreenmenu
you have settings menu, parent is appsmenu

#

kinda like that

pseudo hazel
#

yes

#

exactly like that

#

except for teh fact that I dont want to create all those as individual classes since they'll all do basically the same thing

#

which is redirecting you to another window

humble tulip
#

right so

pseudo hazel
#

until ofc the lowest ones which will actually do stuff

humble tulip
#

well you can create a NavigableMenu or something which takes a Map<Integer, MenuThatDoesStuff> and maps out the buttons

pseudo hazel
#

whats the int for, slot numbers?

humble tulip
#

ye

pseudo hazel
#

okay

humble tulip
#

so i'm giving more general advice

pseudo hazel
#

yeah makes sense

humble tulip
#

actually, do you have a Button class?

tropic ingot
#

Why it still doesn't work?

pseudo hazel
#

well i have an InventoryItem class which gets really close to being a button

humble tulip
pseudo hazel
#

so i would actually replace teh ints for inventory items

humble tulip
#

so your gui class can implement it

pseudo hazel
#

what does a button interface do

humble tulip
#

and opens itself when clicked

#

onClick(Player)

#

or something

#

wait lemme think it through

pseudo hazel
#

why would the gui class do that

humble tulip
#

yeah it doesnt make sense thinking abt it

pseudo hazel
#

for reference, my abstractinventory class can open itself to the player, as well as give click events and more stuff

rotund ravine
remote swallow
#

how do i make maven with multiple modules compile on mvn clean install to 1 location with the stuff not to a folder for each module

humble tulip
#

create a module that shades them all

#

called build

#

or something similar

remote swallow
#

ah okay

last bolt
#

When calling Bukkit.getServer().getOnlinePlayers.size() from a PlayerQuitEvent, the returned value is the number of players /before/ the player quits. The same command called from a PlayerJoinEvent returns the number of players /after/ the player joins. Is there a nice way of making this consistent without either adding or subtracting 1 to one of the values?

last bolt
#

Any idea why the conflicting behaviour?

rotund ravine
#

Yeah

humble tulip
#

playerquitevent is called before the player is unloaded frm the server

rotund ravine
#

There is a different event before the player is in the server.

humble tulip
#

playerjoinevent is called after the player is loaded

rotund ravine
humble tulip
#

you can see if that exists with playerloginevent

pseudo hazel
#

yeah so just remove 1 from the quitevent count

last bolt
#

Yeah and the Spigot docs recommend not to use the PlayerLoginEvent.

rotund ravine
humble tulip
#

@rotund ravine player is loading in but to the server, the player is already loaded

rotund ravine
last bolt
#

Rightio, I'll just subtract from the PlayerQuitEvent I suppose.

humble tulip
#

why can't you just subtract ye

last bolt
#

I don't like fudge.

pseudo hazel
#

then you shouldnt have been a plugin developer

last bolt
#

Fair.

hushed spindle
#

i made a custom recipe system but one annoying quirk about it is that custom recipes using RecipeChoice.ExactChoice fail to show up in the recipe book as craftable, even if the player has ingredients

#

does anyone know how to deal with this

tropic ingot
pseudo hazel
#

well you are adding 29 to the damage

#

and then checking if its lower than 0

rotund ravine
pseudo hazel
#

like what do you expect

rotund ravine
#

But also that

tropic ingot
pseudo hazel
#

well

#

riddle me this

#

how can something be x + 29 in one line

#

and then <= 0 in another line

#

like wouldnt it be atleast 29

rotund ravine
#

?logic

hushed spindle
#

durability works kinda in reverse but also not really

#

getDamage doesnt return the durability, it returns max durability - current durability

tropic ingot
hushed spindle
#

if an iron pickaxe, which has a max durability of 255, has 100 durability, it'll return 155 damage

rotund ravine
pseudo hazel
#

print the damage values to see what you are actually changing

#

that way you can see if the item even has damage to begin with

hushed spindle
#

you should be checking if damageable.getDamage() >= item.getType().getMaxDurability()

#

not if <= 0

#

also, there are item types that cant be damaged but that are still instanceof Damageable because of legacy support of certain items (like old dyes, for example lapis lazuli)

#

so also check if item.getType().getMaxDurability() > 0 as well as instanceof Damageable

hushed spindle
#

yeah because damage doesnt return durability, so checking of <= 0 is pointless

#

it would actually destroy the pickaxe if it had full durability (but in this case it cant because you're always adding at least 29 damage)

#

in any case now that that's done, does anyone know if there's anything I can do about minecraft's poor recipe book mechanics

#

basically i made custom recipes that uses RecipeChoice.ExactChoice for most of them and minecraft seems to struggle with figuring out if the player actually has the ingredients or not

#

so they're always shown as uncraftable and clicking on them only shows their red labeled preview images

#

but actually putting the ingredients in manually produces the item just fine

subtle folio
#

is it possible to change the size of a chest inventory ?

subtle folio
#

How 🙂

radiant cedar
#

anyoen know a fix to this?

rotund ravine
#

connect again

radiant cedar
#

if catches

#

disconnect and connect again

radiant cedar
distant ridge
#

I need help solving a large bug. I have a file that looks at the default YML files and upgrade a server owner's YML file if its missing data. The problem with that is if a server owner removes default settings then it regenerates them. Which normally wouldn't be bad, but it is bad because there are example settings in the YML file. So I need to try to find a better way of handling YML file upgrades.

balmy valve
#

anyone know if when “livingEntity#setRemoveWhenFarAway” is set to true, the entity will be removed after a restart

vast raven
#

How to get an event from a listener?

#

Like get a playerinteractionevent from a getHandlerList()

distant ridge
undone axleBOT
distant ridge
ivory sleet
#

However only some and not all

formal bear
#

huh? Why does it return null?``` ConfigurationSection section = getConfigurationSection("items");

    for (String path : section.getKeys(false)) Bukkit.getLogger().info("Item: " + getConfigurationSection(path).getCurrentPath());``` config.yml: ```items:

'0': "Test"```

#

ah nvm

#

logic

#

getConfigurationSection was running from base file not items section

distant ridge
ivory sleet
#

Here’s what I would do

crisp forum
#

I believe there was a list of included packages in Bukkit (like SnakeYAML etc) if there is can anyone send it?

ivory sleet
#

If the file is sourced and sinked from your jar file, then just let that be

#

Then just define the default key value pairs

crisp forum
quiet ice
#

Gotta open the picture in your browser

ivory sleet
#

Spigot does not expose it afaik

#

Or well, as a transitive dep

tender shard
#

craftbukkit dependencies be like

#

doesnt fit on one screen 😦

ivory sleet
#

Ye

crisp forum
#

for example for using snakeyaml I don't have to include it in my jar etc (because it is already included in Spigot or somewhere else) can I see a list of these?

#

a bit more readable list :d

ivory sleet
#

Yes

ivory sleet
#

And what mfnalex sent u

#

But those are not added to ur compile time classpath

#

Eg mysql connector

#

Hamcrest

#

But they’re provided to ur runtime classpath tho

rose aspen
#

Hello friends, gotta problem here

@EventHandler ... EntitySpawnEvent ....

                Firework firework = (Firework) entity;
                FireworkMeta fireworkMeta = firework.getFireworkMeta().clone();
                fireworkMeta.clearEffects();
                firework.setFireworkMeta(fireworkMeta);```

It doesn't clear the effects, but why?
eternal oxide
#

Not enough code to tell. Does your code even get called? debug with sysout

tender shard
#

I just checked and it indeed does not work

    @EventHandler
    public void onFireworkSpawn(EntitySpawnEvent event) {
        if(event.getEntity() instanceof Firework) {
            Firework firework = (Firework) event.getEntity();
            FireworkMeta meta = firework.getFireworkMeta();
            meta.clearEffects();
            firework.setFireworkMeta(meta);
            firework.detonate();
        }
    }
#

it instantly detonates() but the effects are still there

eternal oxide
#

tried creating a new meta and applying it?

rose aspen
#

With other words, is it possible to change the firework effects from a firework that gets spawned via EntitySpawnEvent?

More code ...

    @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
    public void creatureSpawnEvent(EntitySpawnEvent event) {
        Entity entity = event.getEntity();
        Location location = BukkitUtil.adapt(entity.getLocation());
        PlotArea area = location.getPlotArea();
        if (!location.isPlotArea()) {
            return;
        }
        Plot plot = location.getOwnedPlotAbs();
        EntityType type = entity.getType();
        if (plot == null) {

            // Try to fix elytras for plotsquared
            if(entity instanceof Firework) {
                Firework firework = (Firework) entity;
                FireworkMeta fireworkMeta = firework.getFireworkMeta().clone();
                fireworkMeta.clearEffects();
                firework.setFireworkMeta(fireworkMeta);

                System.out.println("Prevent " + entity.getName() + " explosion via EntitySpawnEvent");
                return;
            }
            // End of fix```

Sysouts:
100x ... `[00:06:17 INFO]: [PlotSquared] [STDOUT] Prevent Firework Rocket explosion via EntitySpawnEvent`

I try to fix a Plotsquared issue with fireworks, where you can't fly with a elytra and I just want to allow spawning fireworks everywhere in the plotworld, but without explosions.
The explosions cause big problems, for example armorstands will get destroyed and so on
tender shard
rose aspen
#

Mhhh dayum so much effort for me xd

#

I go to bed now, will answer tomorrow 🙂 Night

tender shard
#

wait

#

I think I got it

#

1 min

#

yeah

#

@rose aspen

    private boolean ignoreNextEntitySpawn = false;

    @EventHandler
    public void onFireworkSpawn(EntitySpawnEvent event) {
        if(ignoreNextEntitySpawn) return;
        if (event.getEntity() instanceof Firework) {
            event.setCancelled(true);
            ignoreNextEntitySpawn = true;
            event.getEntity().getWorld().spawn(event.getLocation(), Firework.class, firework -> {
                FireworkMeta meta = firework.getFireworkMeta();
                meta.clearEffects();
                firework.setFireworkMeta(meta);
            });
            ignoreNextEntitySpawn = false;
        }
    }
#

you have to spawn your own firework, then apply it to the spawned entity using the consumer

lofty plank
#

Hey, I am giving a warden a custom name using warden.customName("name") which should prevent it from burrowing back underground. However it does not. Any ideas on how to get the warden to stop burrowing for inactivity?

tender shard
lofty plank
#

setCustomName is deprectaed

#

It's customName

tender shard
tender shard
#

you are using the API of some fork probably. and even those will not have a customName(String) method

lofty plank
#

customName is bukkit.Nameable

tender shard
#

no

lofty plank
lofty plank
#

Anyway, now that's out the way. My issue is not with naming the warden. It is that it still burrows ❤️

#

Using setCustomName (the deprectaed one) still acts the same

#

I am using PaperAPI actually

tender shard
tender shard
#

have you tried whether it still happens when using a spigot .jar? sometimes paper introduces bugs like this, where a vanilla feature works on spigot but not on paper

#

if it works on spigot, you gotta report it to paper. if it also doesnt work on spigot, you gotta report it on spigot's JIRA

radiant cedar
#

Do I need to use repository and dependency in maven to make a plugin depend on another plugin jar i made before

#

if so what do I need to write for respotiroy and dependencies

tender shard
#

you can just install the other plugin to your local repository

#

for example, imagine you have this:

#

First plugin:
Group ID: me.demopro
Artifact ID: myfirstplugin

Then you just mvn install that.

Second plugin:

<dependency>
  <groupId>me.demopro</groupId>
  <artifactId>myfirstplugin</groupId>
  <version>..</version>
  <scope>provided</scope> <!-- compile if you wanna shade it, or provided if the other plugin is a "normal" plugin dependency that also runs on the server -->
radiant cedar
#

ohh alright

#

ok thanks

tender shard
#

np

#

you only need to upload "firstplugin" to a repository if you want other people to be able to use it without them "installing" it themselves

radiant cedar
#

oh

#

@tender shard im tryna make an api for myself for a discord bot

#

I want my plugin to use the api to tell discord bot what to do

#

So i just made a normal java file

#

Can I use this for it to depend on and stuff

#

or will it not work the same

tender shard
#

so you probably want to shade it

#

that means you need to declare the maven-shade-plugin and set the scope to "compile"

radiant cedar
#

i made my own file like this

#

is that a bad idea lol

tender shard
#

your groupid should be something like me.demopro or com.github.demopro

#

the artifactid should not contain a "."

radiant cedar
#

ohok

tender shard
#

no wait

radiant cedar
#

i changed

#

what u said

#

but is the build fine

#

can i use this for discord bot

tender shard
#

the shade plugin has to be inside the pom that uses the other .jar

radiant cedar
#

?paste

undone axleBOT
radiant cedar
tender shard
#

how is the other artifact called?

radiant cedar
#

the artifact is just a plugin jar

#

this discord one is not gonna call it

#

the plugin one is gonna call the discord one

tender shard
#

okay so you have a "discord-server-plugin" that depends on "discord-server" or sth, right?

radiant cedar
#

no

#

thi one i pasted and sent

#

im gonna make discord api

#

on it

#

but my prison game plugin for mc server

#

is gonna use that api

#

<dependency>
<scope>provided</scope>
<groupId>hi-discord</groupId>
<artifactId>server-discord</artifactId>
<version>1.0</version>
</dependency>

tender shard
#

I see. remove the shade stuff from the "server-discord"

radiant cedar
#

i just add this to the mc server one right

#

oh

tender shard
#

the shade stuff has to be in the pom that uses "server-discord" as dependency

radiant cedar
radiant cedar
#

<dependency>
<scope>provided</scope>
<groupId>hi-discord</groupId>
<artifactId>server-discord</artifactId>
<version>1.0</version>
</dependency>

#

and i add this to the mc plugin

tender shard
#

one second

#

this would be your "server-discord" pom

#

and this would be your plugin that uses the api (and shades it)

#

ofc also include the <properties> part, I just removed them to show the important parts

radiant cedar
#

ok ill try later tysm

#

ill also search abit more

#

if i cant find can i come back to u as last solution tmrw or smthgn lmao @tender shard

tender shard
#

lol ok

subtle folio
#

lol ok

tender shard
#

ok lol

#

ntdi come #bot-commands

subtle folio
#

ok ok

primal goblet
#

[INFO] --- maven-shade-plugin:3.4.1:shade (default) @ PGxPermissions --- [INFO] Including io.socket:socket.io-client🫙2.1.0 in the shaded jar. [INFO] Including io.socket:engine.io-client🫙2.1.0 in the shaded jar. [INFO] Including com.squareup.okhttp3:okhttp🫙3.12.12 in the shaded jar. [INFO] Including com.squareup.okio:okio🫙1.15.0 in the shaded jar. [INFO] Including org.json:json🫙20090211 in the shaded jar.

thats compiled to the jar file when i compile it with this cmd: mvn clean package
how can i exlude some dependencies from it like okhttp3 ?
thats a shade plugin so.. yep

tender shard
#

or do you want to exclude a dependency from a dependency?

#

if so:

#
        <dependency>
            <groupId>some.group.id</groupId>
            <artifactId>someartifact</artifactId>
            <version>1.2.3</version>
            <scope>compile</scope>
            <exclusions>
                <exclusion>
                    <groupId>com.squareup.okhttp3</groupId>
                    <artifactId>okhttp</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
primal goblet
primal goblet
primal goblet
tender shard
#

np

livid dove
#

So is there an easy way to wipe every enchantment from the server without wiping the eserver lol

wet sparrow
#

Hello, I am implementing vault in my skypvp plugin where I generate my coins with which kits can be bought later (another plugin that works with vault) when I don't have enough money it works fine, but when it has the money it doesn't subtract it

vital sandal
#

is it possible to create a static hashmap that can be used across plugins ?

#

like access other plugin hashmap

wet breach
wet sparrow
#

Hi?

wet breach
#

👋

summer scroll
#

I have a clock on my server and I want to show it on my website too, how can I make the clock sync in real-time between minecraft server and website?

vital sandal
worldly ingot
#

When you say clock, do you mean a countdown timer? Or like a real time clock?

vital sandal
#

just got it is about dependency :l

summer scroll
#

I wanted to show how many time left each player has on the website.

worldly ingot
#

Gotcha. Well if you've got it per-player and it's stored in SQL or something, you should be able to pull that timer from the same SQL database with PHP or something

#

Otherwise you'll need to work out some web requests so your plugin can send information to your website to update the timer

wet breach
summer scroll
#

That's what I do but I update the data into the SQL every 5 minutes.

vital sandal
summer scroll
#

No, I wanted it to update possibly in real-time.

wet breach
vital sandal
summer scroll
wet breach
#

The other alternative would be to have the plugin implement a small webserver to serve a single html page that your webserver can link to or reverse proxy to

worldly ingot
#

Well updating in real time is fine. If you have the start or end time in SQL it's just a matter of extrapolating now - storedTime (or vice versa depending on what's stored)

#

The real-time updating is just going to be your website updating text every second

summer scroll
#

On the plugin, I cache the data because I thought it's not gonna take server performance.

wet breach
#

The best way to do it with sql is like what choco said. Mysql does have math functions you can use with queries

#

So you only need to store the timer count and then use the math function with query to get time left and then you dont really need to update further

#

Plugin only updates when timer expires

urban kindle
#

Can anyone help me how I can get some random name that is within the Common example ess

summer scroll
#

The thing is, players can manipulate their time left. (e.g: by storing an item that can increase their time).

wet breach
#

Then update the timer when that happens

urban kindle
wet breach
#

On website just check when timer expires to update or remove timer as necessary or just frequently check

#

Mysql is capable of handling millions of connections and thousands of queries efficiently

summer scroll
#

On website I have it on real-time, as soon as the database updated the data will shown correctly.

#

Alright so, should I query it everytime the time left change?

wet breach
#

Sure

urban kindle
#

Can someone help me please?

summer scroll
#

I'm just afraid it's gonna be heavy on server performance.

crude charm
undone axleBOT
#

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

wet breach
#

You are nowhere close to mysqls limits

#

Stop worrying about performance until you actually need to

urban kindle
summer scroll
#

Alright, thanks for the help. I'll try the solution.

wet breach
urban kindle
wet breach
#

Count the entries and use a range with random. The pull a random entry based on number

#

Anyways back to work for me

urban kindle
#

do you have a better example?

summer scroll
#

and then randomize it.

urban kindle
#

yes

summer scroll
#

Okay, let's say you have successfully get all the common rewards

List<Reward> rewards = ...

// Get random rewards
Reward random = rewards.get(rewards.size() - 1);
urban kindle
#
  Common:
    Kit: '&aKit'
    Hat: '&aHat'```
urban kindle
summer scroll
#

Yes you can do that, but I don't think you can randomize it from the start, you actually need to get all of the values and then you can randomize it.

wet breach
#

Aglerr knows what i am talking about. Once you have your range you want a list of the entries so that whatever is the random number you can just pull the index with same number

summer scroll
#

yo frostalf, i think the solution for the timer is working perfectly well, so thanks! and also thanks Choco for helping me.

wet breach
#

Alright back to work for me in changing tires lol

river oracle
#

Don't be too efficient this time

wet breach
#

Lol

#

I am just going to ride out the times to max

mighty aurora
#

What would the best way of doing MySQL database connections? I am trying to use JDBC and OrmLite to connect but no matter what I try I get this error: Connection failed: com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

#

Please ping or do a reply with ping for responses to ^^^

wet breach
#

Did you not check or change max allowed connections for db server?

mighty aurora
#

I did

#

I changed it to a number over 1 billion

#

it didn't change anything

wet breach
#

That is too high

mighty aurora
#

I changed it to just a really high number to ensure it wasn't being messed up

wet breach
#

Anyways show the code for your connection

mighty aurora
#
            ConnectionSource connectionSource = new JdbcConnectionSource(url);```
#

And yes I have tried changing localhost to 127.0.0.1 and the local ip associated with the server

wet breach
#

In mysql config it goes below mysqld section

mighty aurora
#

That would be /etc/mysql/my.cnf right? I'm just doing a sanity check

wet breach
#

Usually but there is other areas where it can be so its whatever it was setup to use.

#

If you need to add it to config make sure to restart mysql for the setting to take effect

mighty aurora
#

mhm

mighty aurora
wet breach
#

Ok. You will have to wait for me to get home for me to help further. Get off work in 6.5 hours

#

Currently on phone so limited abilities to help appropriately with your issue

mighty aurora
#

thanks

#

I managed to fix it

wet breach
remote swallow
#

if i have nms version support for 1.17.1 to 1.19.3 which versions do i actually need? i was looking on some other repos earlier and they dont have 1 for each version sometimes 1 module covers 2 patch versions

ivory sleet
#

probably depend on what exactly you're doing

remote swallow
#

nbt data stuff

lone remnant
#
public void onChat(AsyncChatEvent event);``` how do i get the message that has been sent?
remote swallow
#

event.setMessage?

#

also wrong place

#

thats papers chat event

#

we dont support paper

lone remnant
#

ah alright

lone remnant
remote swallow
#

they use event.message

lone remnant
#

problem is that the field message is a component and i dont know how i get the content from that

remote swallow
#

easier answer is use spigot api

glossy venture
remote swallow
#

thats our event

glossy venture
#

yeah

lone remnant
glossy venture
#

ignore

#

stupid fucking paper deprecates everything

warm mica
glossy venture
#

if you see something deprecated in paper api you can ignore it like 90% of the time

remote swallow
#

just use spigot

glossy venture
#

because its bs

remote swallow
#

it works

#

the spigot api should always work on paper

rose aspen
warm mica
remote swallow
#

paperlib

buoyant viper
remote swallow
#

thats the entire point of it

warm mica
#

And then there are also things that spigot has half-adapted or copied over and just renamed it

#

Meaning that there are 2 methods for the literally the same thing in the paper api

#

Paper and spigot should just merge their api

remote swallow
#

they wont

#

paper is a different software

#

if you need paper features but want compat use paperlib

buoyant viper
#

totally different ideologies on what their softwares should do

#

their only common ground is (craft)bukkit duke

remote swallow
#

if (PaperLib.isPaper() {
do
}

warm mica
#

Ya I don't need a library for that

remote swallow
#

its papers api

warm mica
#

I just wish I wouldn't have to do that

remote swallow
#

you retain spigot compat

#

but get paper features

rose aspen
#

I think it is better to just use paper as serversoftware and code the plugins with spigot api.
This is how I do it.

remote swallow
#

^^

warm mica
#

Because there is no reason that many APIs are paper-only if they could just exist with soigot

remote swallow
#

do you realise why paper exists

remote swallow
#

paper only exists because md didnt want to accept the prs for some of their features

#

so they forked

#

the api's will never be combined

warm mica
#

Paper has deprecared AsyncPlayerChatEvent but spigot hasn't

remote swallow
#

because its our event

#

paper use AsyncChatEvent

warm mica
remote swallow
#

oh no

#

use paperlib

warm mica
#

So prepapre yourself in writing some boiler code to have both spigot and paper support

remote swallow
#

just use paperlib

#

you get the features you want

#

while

#

retaining

#

spigot

#

support

rose aspen
warm mica
buoyant viper
remote swallow
warm mica
#

That library is just a band aid for the actual problem

warm mica
warm mica
#

And now do that for whole events

remote swallow
#

make a method for it?

warm mica
remote swallow
#

i have way better things to do than argue with you when you just wont listen

warm mica
#

Even if you accept it or not

#

It's just some useless code because some people thought it'd be better to just not merge it into spigot

remote swallow
#

you really are dumb

warm mica
#

And we could all prevent that if we'd merge the changes into spigot

remote swallow
#

paper exists because md ** does not** want to merge papers features into spigot

warm mica
remote swallow
#

"add paper features to spigot"

warm mica
#

But the problem still persists

kind hatch
warm mica
remote swallow
#

you wont listen to me

warm mica
#

At what point did I not listen?

warm mica
#

I don't understand why hes so strict about everything

remote swallow
#

you said stuff on the lines of "add it to spigot" multiple times even though you got told the reason paper exists, and you continue to say it

remote swallow
#

no one is forcing you to support spigot

warm mica
#

Your comment doesn't make sense at all

#

It's basically just saying "accept it and shut up"

buoyant viper
#

looking at paper on github rn... where in the Fuck do they store their api code? is it only in patches?!

warm mica
#

Like, I would love if I didn't have to use it

#

Things would be a lot better if spigot would be more open with what coule be added to the API

kind hatch
warm mica
#

and I could just say that the plugin needs to implement some hacky solution to all the people that tell me that the motd is apparently not being set

#

But why all the stress if it can be done properly in the first place

#

And that's just one example

warm mica
#

And I think that the API is so perfect, that it should be just the norm for all plugins

crude loom
#

?paste

undone axleBOT
crude loom
#

Hi, I'm trying to make the player perform a command depending on their input,I can't do it Asincronically but the PlayerChatEvent is Async
That's my code:
https://paste.md-5.net/asotisesir.cs

livid dove
crude loom
remote swallow
#

yeah

#

use runTask

crude loom
#

I'll give it a try, thanks !

crude loom
remote swallow
#

just runTask should do it sync

#

runTaskAsync would do it async iirc

crude loom
#

This works, thanks for the help !!

#

This means it would just run on the next tick?

livid dove
#

So just like sever wide world edit can I on a secwr white listed dof maintained do a system that loads every chunk 1 by 1, searches for chests with enchanted items in and wipes their enchants?

hybrid spoke
buoyant viper
#

only to find out like a week ago paper already had it since 1.16

remote swallow
#

anyone know how i would convert NBTBase to its corresponding java.lang varient

sullen marlin
radiant cedar
#

anyone know why this.guild is null even though i copied serverId correctly

#

for discord bot

#

JDA

tardy delta
#

You clearly didnt then

#

Or the bot is not in the server

radiant cedar
#

i did

#

and it is lmao

hazy parrot
#

Or that happens before JDA is ready

radiant cedar
#

wdym

hazy parrot
#

Add .awaitReady() after .build()

tardy delta
#

Is build not blocking?

hazy parrot
#

It's not

radiant cedar
#

is this a problem on their end

hazy parrot
radiant cedar
#

what does this mean lol

#

onDisable i have to disconnect or somethign>

#

oh might it be cus im also running this on a server as im testing locally too

tardy delta
#

What does zip file closed even means in spigot context?

radiant cedar
#

i have no idea

#

i didnt do anything about this erro

hazy parrot
radiant cedar
#

ye cus im running bot at the same time on the mc server

hazy parrot
radiant cedar
#

idk how

hazy parrot
#

Smth like that

radiant cedar
#

ty

#

SHUTDOWN or SHUTTINGDOWN

hazy parrot
#

Now

warm mica
# sullen marlin Link to the feature request?

It's not about it specifically, but rather there are various features that firstly get added to paper and then to Spigot later on. And in my opinion it's just a waste on time on both sides, as each feature request needs to be implemented twice.
I am not asking you to merge with Paper, I fully understand that this is not possible and that there is a massive difference between both projects. But rather that your team would work more close together with the Paper's team and vice versa in creating an API that follows the same path. I have noticed that both APIs split more apart with each update, which really shouldn't the case as you two follow basically the same goal. And again, I am not asking you to merge literally anything.

Every party would benefit from this. Firstly your and Paper's team, as you wouldn't have to accomplish the exact same task twice. And then secondly all the developers working with them, as they could enjoy new parts of the API more easily and wouldn't have to deal with boiler code

radiant cedar
hazy parrot
tender shard
tender shard
tender shard
tender shard
hazy parrot
torn basalt
#
    @EventHandler
    public void onJoin(PlayerLoginEvent event) {
        getLogger().warning("Player: "+event.getPlayer()+ " Joined IP: "+event.getHostname());
        if(getConfig().getString("host").equalsIgnoreCase(event.getHostname())) {
            if(event.getPlayer().isOp()) {
                getLogger().warning("Player: "+event.getPlayer()+ " Joined IP: "+event.getHostname()+" Is Op: true");
                List<String> lines = getConfig().getStringList("kick-message-op.");
                for (String linestring : lines) {
                    event.getPlayer().kickPlayer(ChatColor.translateAlternateColorCodes('&', linestring));
                }
            }
        }
        if(!event.getHostname().equalsIgnoreCase(getConfig().getString("host"))) {
            List<String> lines = getConfig().getStringList("kick-message-host.");
            for (String linestring : lines) {
                getLogger().warning("Player: "+event.getPlayer()+ " Joined IP: "+event.getHostname()+ " Not joined with "+getConfig().getString("host"));
                event.getPlayer().kickPlayer(ChatColor.translateAlternateColorCodes('&', linestring));
            }
        }
    }
#

whats wrong with my code?

#
host: "play.foudrestudios.com:25565"

kick-message-op:
  - "&e&l● &6&lIUMGUARD &e&l●"
  - ""
  - "&aMerhaba, salak griefer kardeşim. Senin böyle bir salaklık yapacağını tahmin ettiğimiz için böyle bir sistem geliştirdik."
  - "&a&lHAA! &aSakın unutma Port Açığı gibi şeyler deneyeyim dersen onlar kapalı zaten sana iyi denemeler enayi. :D"
  - ""
  - "&3Bir kez yürünmüş bir yola düşenlerin sayısı çoktur, hedefe ulaşan az..."
  - "&b- Friedrich Nietzsche"
  - ""
  - "&6Support: &edeniz@foudrestudios.com"

kick-message-host:
  - "&e&l● &6&lIUMGUARD &e&l●"
  - ""
  - "&aLütfen sayısal ip ile girmek yerine &eplay.demirium.com &aadresi ile gir."
  - ""
  - "&6Support: &edeniz@foudrestudios.com"
#

i debugged it but its just say [13:59:27 WARN]: [IumGuard] Player: CraftPlayer{name=sheduxdev} Joined IP: IP:25565

tender shard
torn basalt
#

i try op secure system

#

if host: equals with event.getAdress check player is op

#

if player is op kick with kick-message-op

wet breach
# warm mica It's not about it specifically, but rather there are various features that first...

Both projects are different and its ok for both to diverge which is papers goal in then end to not depend on spigot. The reason features get added sometimes the way you are stating is because sometimes someone requests it for paper. Paper implements it and thinks this is actually really good. So they decide they want upstream to implement so they dont have to maintain the code for it and can just have it automatically. This is actually a normal process for downstream projects and how it should be done. Look at another project that is a form of something and you will see that is how it is. Paper devs are free to submit prs for spigot and are not prevented.

torn basalt
#

but its just send getLogger().warning("Player: "+event.getPlayer()+ " Joined IP: "+event.getHostname());

tender shard
#

you are checking event.getHostname() and not event.getAddress(). Also getAddress() returns the client's IP and not the server's

torn basalt
#

i checked it

hazy parrot
#

But you have server host name in config

kind hatch
warm mica
torn basalt
#

@wet breach if i do event.getAddress() its will be work?

wet breach
warm mica
hazy parrot
torn basalt
tender shard
torn basalt
wet breach
torn basalt
#

i trying get Server Adress

hazy parrot
radiant cedar
#

why does this happen

torn basalt
wet breach
torn basalt
#

i trying get player joined ip

#

its checking true

hazy parrot
wet breach
#

Well i already told you about the event

#

And the caveat

torn basalt
tender shard
tender shard
torn basalt
#

i think this wrong if(getConfig().getString("host").equalsIgnoreCase(event.getHostname()))

tender shard
torn basalt
wet breach
#

As well as forwarding

radiant cedar
#

name is not primary key

#

is that why

wet breach
#

If forwarding is not enabled player ips will match bungee ip address

torn basalt
hazy parrot
torn basalt
#

this section is wrong? if(getConfig().getString("host").equalsIgnoreCase(event.getHostname()))

tender shard
#

although I entered the hostname

tender shard
#
    @EventHandler
    public void onJoin(PlayerLoginEvent event) {
        System.out.println(event.getHostname());
    }
#

?jd-bc

torn basalt
#

1 min

#

if i convert this to bungeecord plugin its work fine?

tender shard
#

you can get the hostname they used from a private field in the bungee LoginEvent

wet breach
#

Not sure why you are trying to use hostname

torn basalt
wet breach
#

Hostname of what?

#

Client hostbame isnt what you think it is

torn basalt
#

joined server adress

wet breach
#

Told you how to get it

tender shard
torn basalt
#

@tender shard its shows;
Player: CraftPlayer{name=sheduxdev} Joined IP: /my ip
System.out.println("Player: "+event.getPlayer()+ " Joined IP: "+event.getAddress());

hazy parrot
torn basalt
#

so its impossible to see joined ip?

tender shard
#

you should really learn the difference between hostname and ip

torn basalt
wet breach
#

^

tender shard
#

on bungee, you can get the hostnaame only from bungee

torn basalt
#

In Turkey IP means the same thing too much, we call it IP instead of hostname.

torn basalt
wet breach
#

Its not impossible. Use plugin message channel i believe its set there if you call some bungee functions

torn basalt
#

ill try it

kind hatch
# radiant cedar

Try putting your value in single quotes.
DELETE FROM player_data WHERE name = 'PassTheTowel';

hazy parrot
tender shard
wet breach
tender shard
#
    @EventHandler
    public void onJoin(PlayerLoginEvent event) {
        String subdomain = event.getHostname().split("\\.")[0];
        if(subdomain.equalsIgnoreCase("admin")) {
            System.out.println("Admin domain used");
        } else if(subdomain.equalsIgnoreCase("play")) {
            System.out.println("Player domain used");
        } else {
            System.out.println("Another domain, or IP used");
        }
    }

@torn basalt

tender shard
torn basalt
#

how i save config in bungeecord

tender shard
tender shard
wet breach
tender shard
#

yeah well the docs explain it

#

I would have called it "getUsedHostname" or "getEnteredHostname" or sth idk

wet breach
tender shard
#

I also wouldnt know how that would work as bungee doesn't save any player data

#

it just passes everything through and doesn't "remember" anything about players

torn basalt
#

@tender shard

#

its not? PlayerConnectEvent

wet breach
#

You dont need a plugin on bungee to use it either

wet breach
tender shard
#

no idea what you're talking about

#

with Forward all you can do is to send a message from one server to another

wet breach
#

There is other functions too

#

That was just an example

#

But it appears there isnt one for getting the host name like they are wanting

tender shard
#

i know, because bungee doesn't keep track of it

tender shard
wet breach
#

Otherwise there wouldnt be a function to get real ip of player when forwarding is not enabled

tender shard
#

ofc it remembers their IP, it just doesnt keep track of the hostname they used

wet breach
#

Well it does, just no method in plugin message channel to get it

#

Probably should make a pr for it

tender shard
#

this is the only occurence of "hostname" in the whole bungeecord repo, besides one javadoc comment :/

formal bear
#

What hasIcon() boolean do in PotionEffect class?

torn basalt
#

@tender shard

#

how i can do check hostname on PlayerConnectEvent

wet breach
wet breach
#

I see it right there

hazy parrot
#

oh

torn basalt
tender shard
#

This will always return the correct hostname in spigot's PlayerLoginEvent:

    private static final String NULL_CHAR_STRING = String.valueOf('\u0000');
    
    @EventHandler
    public void onJoin(PlayerLoginEvent event) {
        String hostnameUsed;
        if (Bukkit.getServer().spigot().getConfig().getBoolean("bungeecord")) {
            String[] splitByColon = event.getHostname().split(":");
            hostnameUsed = event.getHostname().split(NULL_CHAR_STRING)[0] + splitByColon[splitByColon.length - 1];
        } else {
            hostnameUsed = event.getHostname();
        }
        System.out.println(hostnameUsed);
    }

@torn basalt @wet breach

tender shard
#

bungeecord uses the null char to seperate the actual hostname from the other gibberish from my earlier screenshot, as seen here:

tender shard
tender shard
#

kinda weird, but okay lol

#

no idea why it's like this

hazy parrot
tender shard
hazy parrot
wet breach
torn basalt
#

I am trying to do this, if the ip host: part in the config file is the same as the address used, it checks if the user is op and kicks if it is op. Otherwise, if the address entered is numeric, it kicks the same way

#

@tender shard

torn basalt
#

i just trying get joined adress

tender shard
torn basalt
#

if(!event.getHostname().equalsIgnoreCase(getConfig().getString("host")))

tender shard
torn basalt
tender shard
#

can you please try to form complete sentences

tender shard
#

with icon

#

without icon

torn basalt
#

I am writing a plugin for grief protection, as in the config, there are 3 parts host, kick-message-op, kick-message-host if the authorized person has an op when the authorized person enters the server host, it should kick with kick-message-op. But if it enters the server with a numeric ip, it should kick with kick-message-host.

tender shard
#

I don't get the problem

#

I showed you code above with which you can identify what they entered to connect

#

if they enter "1.2.3.4:25565" then my code will return "1.2.3.4"

tender shard
#

yes

torn basalt
#

let me try

tender shard
#

I've adjusted the code to also show the port and work with IPv6

#

it can now return any of those:

localhost:25565
127.0.0.1:25565
1.2.3.4:25565
play.domain.com:25565
fc00:1234::1:25565
::1:25565
#

if you wanna get rid of the port, just get rid of with a regex or split it or do lastIndexOf or whatever

wet breach
tender shard
#

well it's a dirty hack, md5 would probably yell at me

wet breach
#

Should pr it to spigot to fix the method lol

wet breach
tender shard
#

also technically the gibberish is the correct hostname, because that's what bungee uses to connect lol

#

bungee should just forward it properly

#

the biggerish is there to have proper skins and UUIDs since the backend servers are in offline mode

#

sooo hmm

#

actually then it's not a dirty workaround

#

because spigot itself just splits it by \u0000 to get the needed information

covert yacht
#

Hi i don't know if it's an issue with spigot or something else but if i set a block break event as cancelled when a sign is borken the sign will lose it's text i guess its the same for chests

#

Correction only signs

tender shard
#

is the text still gone after you rejoin?

covert yacht
#

after investigation the text comes back

#

after a re-join

tender shard
#

okay, then just send a SignChange to the player

#

i'll show an example in a minute

covert yacht
#

is there any other block that needs this kind update on the player side ?

#

i need to cancel break on all blocks and keep their data too

tender shard
#
    private static final BlockFace[] VALID_SIGN_POSITIONS = new BlockFace[] {
            BlockFace.NORTH,
            BlockFace.EAST,
            BlockFace.SOUTH,
            BlockFace.WEST,
            BlockFace.UP
    };

    @EventHandler
    public void onBlockBreak(BlockBreakEvent event) {
        event.setCancelled(true);
        Bukkit.getScheduler().runTask(this, () -> {
            for(BlockFace face : VALID_SIGN_POSITIONS) {
                Block possibleSignBlock = event.getBlock().getRelative(face);
                if(possibleSignBlock.getState() instanceof Sign sign) {
                    event.getPlayer().sendSignChange(possibleSignBlock.getLocation(), sign.getLines());
                }
            }
        });
    }
tender shard
covert yacht
#

Thanks for the example ! I just have a small issue, i'm not sure of the import for sign and i have this weird error that could be related

org.bukkit.block.Sign
Represents a captured state of either a SignPost or a WallSign.

The Java feature 'Pattern Matching in instanceof Expressions' is only available with source level 16 and above```
tender shard
#

If youre not on java 16+ jist refactor the instanceof

#

Example:

#

Wait ill send an example in 5 min

covert yacht
#

I'm on java 19

tender shard
#

Then your language level is set to lower than 16

#

if(foo instance of Bar bar) …

#

Is the sane as:

covert yacht
#

Where can i change this ? in my pom.xml ? (i'm using maven)

remote swallow
#

maven sdk

#

in ij

tender shard
covert yacht
#

i use vscode not ij lul

covert yacht
tender shard
remote swallow
#

ij has its own sdk level stuff

#

its really annoying

tender shard
#

Yes but that doesnt affect the language level

#

The IJ java version only changes which java version to use to run maven

remote swallow
#

it does on language level

covert yacht
tender shard
remote swallow
#

does it?

#

that never worked back when i used maven lol

tardy delta
#

yes

#

gotta change it in pom too

tender shard
#

Yes, after all you could run maven standalone

#

Maven doesnt care about any IJ settings

#

Except the SDK since thats whats used to run maven

remote swallow
#

i think i figured out a way for me to not need multi module stuff for this

#

except ive gotta convert a string to its correct type to re-add it

covert yacht
#

@tender shard Could this be the issue (vscode setting) there is no "real" error but only code editor error

tender shard
#

?paste your pom

undone axleBOT
covert yacht
tender shard
#

change both "1.8" to "17"

#

then click VSCode's "reload maven project" button, whereever that is

#

right now you tell maven that you only use java 8 features

remote swallow
#
StringBuilder builder = new StringBuilder("java.lang." + value.getClass().getSimpleName().replace("NBTTag", ""));
                    System.out.println(builder);
                    try {
                        if (value.getClass().getSimpleName().contains("Int")) {
                            builder.append("eger");
                        }
                        Class clazz = Class.forName(builder.toString());
                        System.out.println(clazz);
                        configurationSection.set("pdc." + key + ".value", clazz.cast(value.toString()));
                    } catch (ClassNotFoundException e) {
                        e.printStackTrace();
                    }
``` is a way to do somethinglike this, because i cant think of a better way than to make a method to pass its type in and Type.parse ect
tender shard
#

but as said, you can just do this

BlockState state = block.getState();
if(state instanceof Sign) {
  Sign sign = (Sign) state;
  ...
}

instead of

if(block.getState() instanceof Sign sign) {
  ...
}
#

upper one works in every java version, lower one only works in 16+

covert yacht
tender shard
#

that should only be important if you use gradle

#

VSCode probably also let's you define a project language level somewhere

#

but idk I only use intelliJ

covert yacht
remote swallow
#

wheres y2k when you need him

tender shard
#

it's the language level

#

e.g. you can set the jdk version to 19, then java 19 runs the compiler. but you can tell it to only use java 8 features

#

that's what you currently have

#

it basically means "I use java 19 to compile, but I still want my plugin to be able to run on java 8"

covert yacht
#

oh okay i see

tender shard
#

that's what the language level means basically

covert yacht
#

alright

#

yeah okay i do not plan to use on older version

#

only latest

tender shard
#

usually you want to use the newest JDK you have and set the language level ("maven.compiler.source" and "maven.compiler.target") to the lowest java version you wanna support. usually an LTS version, so 17

#

then also set your "language level" in VSCode to 17

covert yacht
remote swallow
#

your using maven

#

what do you need gradle home for

covert yacht
#

ask vscode xd

#

i know, i have openned a gradle project some month ago

#

i guess that's where that came from

cold field
#

Hi guys, I'm having a strange problem, basically I'm getting a NoSuchMethod exception but if I stop with the the debug tool at the specified line and try to run a debug command the method works, has anyone any idea what could be the issue?

            LingeringPotionSplashEvent event = (LingeringPotionSplashEvent) e;
            if (!(event.getEntity().getShooter() instanceof Player)) {
              return;
            }

The method that is giving me an issue is #getEntity
The only thing that I can think of is that the event isn't really a LingeringPotionSplashEvent

remote swallow
#

why would you be casting an event

cold field
#

It's a custom impl of the EventExecutor

#

Btw even if I do smth like

  @EventHandler
  public void test(LingeringPotionSplashEvent event) {
    event.getEntity();
    System.out.println("ok");
  }

is throwing NoSuchMethod

remote swallow
#

are you registering the event

cold field
#

Yeah ofc, if that wasn't the case my listener wouldn't throw an exception

remote swallow
#

are you testing on a lower version that what your depending on or using papers api but spigot server

glossy venture
#

nvm it should be getEntity

tardy delta
#

mismatched api/ server version?

cold field
#

Yep, just found out that on 1.13 the api was returning a LingeringPotion obj and 1.19 is returning a ThrownPotion obj

#

🤦🏻

#

Do I REALLY need to use reflection to have old version compatibility

tardy delta
#

or build on old version

#

and cry

cold field
#

😭

covert yacht
#

Does someone know why right click air is not emitted but left click air is not (with an empty hand) but right click air is emitted with something in the hand ?

remote swallow
#

are you using paper

covert yacht
#

nope

#

spigot

remote swallow
#

dafuq

#

only paper cancel empty hand interact events

tardy delta
#

lol

#

even whe clicking at a block?

covert yacht
#

yes i saw that by searching if someone already had this issue 🤔

#

no only air

#

targeting block everything works

#

maybe because right click in the air will do nothing with an empty hand

#

and with a block in it it tries to place it but as it is air it does not place it

sterile token
#

Because i need to cancel second hand usage. But on my first tried blocking the usage you werent able to use that second hand, but also not able to place blocks

#

So I'm my case for cancellimg the second hand usage without having the issue i mentioned up. I cancelled the next events:

PlayerItemSwapEvent
InventoryInteractEvent

covert yacht
#

i am cancelling the second hand event but even when i don't cancel it i don't get the right click air event

sterile token
#

What ard you looking for?

sterile token
#

I'm currently outside mi city so i dont have pc just help vía cellphone

covert yacht
#

Okayy

#

i'm trying to get the right click air event with an empty hand

sterile token
#

I'm my opinion the hand way Is not done correctly cuz it's pretty weird how it works

#

That my opinion

#

Because from the Unit testing i habe done i the result where that OFF_HAND or second hand Is true, when you use the key F OR Slot 41 AND placing blocks

covert yacht
sterile token
#

Yeah that why i think that Is not well designed

#

Either that or not well documented

#

Because it should be an specific hand use only for damaging, placing/breaking blocks/interaction and last one only for slot 41/key F

#

If not it's fkg a mess working with hands

tawdry parcel
#

Hi guys, I want to export my spigot plugin to a jar file in a custom location. I just wrote the location in the pom.xml file like this:

<project>
  <build>
    <outputDirectory>C:\Koner\projects\minecraft\konercraft\plugins</outputDirectory>
  </build>
</project>
```It works, but it exports the source code instead of a jar file when I run `package -f pom.xml`. How can I fix this?
sterile token
#

Why do you package like that?

remote swallow
#

run mvn clean package instead

sterile token
#

Why dont using mvn clean package

#

//

May i ask why Java haven't already implement a module based system on the JVM? So it's easier to work around with libraries without harcoding their injection into JVM. Something pretty simple like:

public class ExampleModule extends Module {
 
    public void enable() {
    } 

    public void disable() {
    }
}

So them on another java project you can do:

ExampleModule module = (ExampleModule) getLoader().getModules().getOrLoad("/home/ExampleModule.jar");
tardy delta
#

java has modules

covert yacht
#

xd

cold field
# tawdry parcel Hi guys, I want to export my spigot plugin to a jar file in a custom location. I...

Given that I use mvn shade plugin this is my configuration

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.3.0</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <outputFile>${plugin.output-dir}/${project.name}-${project.version}.jar</outputFile>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                           
                        </configuration>
                    </execution>
                </executions>
            </plugin>
sterile token
covert yacht
#

line 70

tardy delta
sterile token
tawdry parcel
#

I made the OutputDirectory directly on top, is that also possible?```xml
<build>
<outputDirectory>C:\Koner\projects\minecraft\konercraft\plugins</outputDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>

covert yacht
#

it works perfectly like that

#

only problem is i need to manually reload 😅

sterile token
#

Its really 💀doing that like that i wouldnt write such a long command when you can short it to few words 🤣🤣

sterile token
sterile token
#

It's pretty weird to opem another page to ser the image

#

💀💀

tardy delta
#

idk

sterile token
#

Lmao 🤣🤣

tawdry parcel
covert yacht
#

here is the look of the link lol

covert yacht
remote swallow
frank kettle
#

is there a way to check if a player would be able to break a certain block? to see if any other plugin is protecting it for example

sterile token
remote swallow
sterile token
#

It's pretty ugly tho because you depends on the shity exposing vía their api

tawdry parcel
radiant cedar
#

hey um

frank kettle
radiant cedar
#

what controls the map generation

#

cus i copied in a map from singleplayer to spigot

remote swallow
radiant cedar
#

and all regions that were rendered are fine

#

i walked more

#

and the rest of the world is generating flat

sterile token
tawdry parcel
sterile token
#

Lmao

#

Maven it's pretty okay not so diff

tardy delta
#

my chrome decided to not respond

sterile token
tardy delta
#

dont let your pc open for a week

#

chrome decides to start lagging

#

even worse with yt shorts

sterile token
#

Please move fast from there Chrome it's fkg amazing for your resourxes

tardy delta
#

wha

#

firefox eats ram too

sterile token
#

Chrome is qualifed as resource exterminator

tawdry parcel
#

what is the difference between the normal maven compiler and the maven shade plugin?

tardy delta
#

what not then? some shitty asian browser that doesnt even work properly?

sterile token
#

I didn't told to use shity firebox

#

There áre thousans around

#

Edge, Opera, Brave, etc

tardy delta
#

edge 💀

#

just looking for the fastest one

#

and that eats the least ram

sterile token
#

Edge it's pretty amazing bruh

#

You ingleses have pretty weird preferences

tardy delta
#

that shit uses bing by defualt 💀

sterile token
#

No?

tardy delta
#

whats this then

sterile token
#

Oh no i use diff Netscape based on Chromium but pretty much optimozed

tardy delta
#

💪

sterile token
#

No Germán

#

I dont understand

tawdry parcel
#

how can i send images?

remote swallow
#

verify

tardy delta
#

?img

undone axleBOT
tawdry parcel
#

oh okay

rotund ravine
#

?di

undone axleBOT
dry yacht
tardy delta
#

that something youd buy maybe?

tawdry parcel
# remote swallow looks like its using the -shaded jar when it should use the one without any addi...

can't i then just remove the maven-shade-plugin from the pom.xml? You know, this part here

              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
tardy delta
remote swallow
tawdry parcel
#

what is scope compile, sry i'm new to spigot

patent sierra
remote swallow
#

look on ur dependencies

#

does it have a <scope>compile<scope>

tardy delta
#

ctrl f in pom and type compile

remote swallow
patent sierra
tawdry parcel
remote swallow
#

saying they can do something when you have no idea if they can or not

remote swallow
#

the shade plugin

tawdry parcel
#

ok thanks

patent sierra
remote swallow
#

my god

patent sierra
#

yea

#

ik

#

crazy right

tawdry parcel
#

I don't need that either, or what is that for?

        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
tardy delta
#

it replaces things like ${project.version} in your files in the resource folder with the right data

tawdry parcel
#

oh okay i think then its important for me

patent sierra
#

i have no idea what im saying btw

#

dont take my advice srsly

remote swallow
#

9yr old when they see any code:

patent sierra
remote swallow
#

i somehow dont believe that

crude loom
#

Is it possible to change the player's mouse when they hover over text component so it would look clickable? (Change the cursor to pointer)

tardy delta
#

if the text component has a clickevent, doesnt the cursor already changes when you hover over it?

crude loom
#

If it's supposed to, I did something wrong because it doesn't

tardy delta
#

it probably doesnt ig, but no you cant force that, its client side

crude loom
#

Ah alright

#

In order to have multiple colors in a text component I just append multiple ones with different colors?

tardy delta
#

uhh lemme take a look at the docs

#

well i always used a componentbuilder, but you can create a textcomponent of a string right?

#

so a coloured string

round finch
#

is it easy to make custom events like a custom entity move event?

#

just wonder

tardy delta
#

gotta handle whatever other event and fire custom one

patent sierra