#help-development

1 messages · Page 288 of 1

vague swallow
#

e is the target

#

but e stands for entity

tender shard
#

See how confusing it is? Use proper names

vague swallow
#

Look I got your problem, I'm sorry. It's not confusing for me so I'll change it next time I ask something

tender shard
tender shard
#

I want to be annoying so you do it better next time :p

vague swallow
#

XD

tender shard
#

You‘ll be the same in 2 years

vague swallow
#

who knows

#

however

#

have a good day or evening or whereever you live

tender shard
#

Thanks, you too my fruity friend

#

Anyway, sorry, did you get it fixed meanwhile? Im only on the phone rn and its hard to read stacktraces or code on this tiny screen

#

The raytrace method returns null when there‘s no hit at all

junior remnant
#

hello, i need a little bit of help with shading maven dependencies! somebody can help me please?

fallow violet
#

@last temple Can u be my cat?

outer sorrel
#

if i am using .sendBlockChange to send client block changes to players will it still send to a user even if it is outside their render distance? and if it does get sent and is in an unloaded chunk does the block show when they load the chunk?

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!

junior remnant
#

Okok

#

Am I allowed to send images here to better explanation?

#

Imma try so I don’t wait answers

junior remnant
#

Thanks

#

I'm getting used to this Shading maven dependencies, I'm trying to adapt a plugin to Velocity and this platform doesn't have the com.mysql.jdbc.Driver, so it started my journey. To not make a paragraph, i'll be direct. I learned how to do it, but not in the place I want. For example, SkinsRestorer have their shaded dependencias inside of its META-INF, and I wanna do that, but the dependencies just appears like it is my code

tender shard
#

uhgm I am a bit confused of what you're trying to do

#

one sec pls

junior remnant
#

Imma send images

#

Pc slow sorry

tender shard
junior remnant
#

this is SkinsRestorer

tender shard
junior remnant
#

and this is mine

#

these packages of com.google and all just adds like it were my code, and it is not and looks bad, so i wanna "exclude it" as SR does

#

i dont know if im explaining well

tender shard
#

you can safely ignore the META-INF folder, nobody cares about that. it just includes a few pom files

#

Is there anything wrong outside of the META-INF directory?

junior remnant
#

and this is the maven plugin that im using

          <artifactId>maven-assembly-plugin</artifactId>
          <version>3.3.0</version>
        <configuration>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
        </configuration>
          <executions>
            <execution>
              <id>maven-assembly</id>
              <phase>package</phase>
                <goals>
                  <goal>single</goal>
                </goals>
            </execution>
          </executions>
        </plugin>```
tender shard
#

why do you need the assembly plugin?

junior remnant
junior remnant
tender shard
#

you should use the shade plugin instead

#

delete the assembly plugin, and use maven-shade-plugin. check the blog post I sent abobve

junior remnant
#

i tested too and worked the same, so i stayed with the shorer one

#

shorter*

wet breach
#

maven assembly is primarily if you want to make war files or uber jars

#

an ubjer jar is where it contains more jar files itself and not the actual classes of the dependencies which is what shade plugin is for

#

while technically you can do the same thing with assembly plugin or similar should say as what shade does they are both different in how they do it.

tender shard
#

in 99% of cases, you wanna use shade instead of assembly

wet breach
#

^

junior remnant
# tender shard here ^

not a lot of help, I have supposed it but now I know I was right, actually i have like 6 depencies in provided, the ones that I'm telling you I need them in my jar, but i dont want them to appear like part of my code because looks bad

#

that's why I want to make it like SR

#

t.t

wet breach
#

the problem with doing it that way in regards to spigot is that you would need to extract them from the jar and then have your own loader for classes

#

shade is fine and you can relocate class files to be in their own packages if they come from dependencies

#

in fact, the default is to put them in their own packages as they are in the dependencies, but should relocate in case someone else has same dependencies in their plugin so that you don't get a class path conflict going on

#

which is probably something you didn't think about

junior remnant
#

actually no

#

so, you recommend to leave my idea and doing it normal way but other package names?

#

so it is more easier and less problems?

wet breach
#

in the event a class path conflict happens, java takes which ever was the first and ignores the others. in this scenario this means an older dependency version class can be on the path that isn't compatible with your plugin

#

so to resolve that you relocate the classes of dependencies to be in a different package but clearly marked as not being yours 🙂

wet breach
#

if you don't want those classes to show up in your jar like all the other classes there are other ways you can do it, just they are more work to do so then what anyone else really cares about. Developers don't look at your jar and go hmmm they are copying another projects class files

#

instead they just see, ah they shade in dependencies

#

it is more further to see that if they are able to see your maven pom file

junior remnant
#

imma translate so i can understand better, wait

#

okok!

#

I know it is "dumb" that someone want to do this, but personally it would have looked more, like, beautiful? ajajsad

wet breach
#

but no one is going to look at it except possibly other developers. Users typically don't care and if you have a user that is looking inside of the jar it is probably because they want to edit the plugin.yml jar

wet breach
#

otherwise there is literally no other useful thing for the user to do so

tender shard
#

You shade what you need and dont shade what you dont need

#

Easy as that

junior remnant
wet breach
tender shard
#

You can always relocate shaded stuff

wet breach
#

exception being if you are making an API

junior remnant
#

you explained it better than me

#

leel

tender shard
#

Eg my.package.libs.com.google…

junior remnant
#

i now want them to be like "shaded.com.mysql . .. ", so it could be like this?

#
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.2.1</version>
        <executions>
          <execution>
            <id>shade</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <relocations>
            <relocation>
              <pattern>com.mysql</pattern>
              <shadedPattern>shaded</shadedPattern>
            </relocation>
            <relocation>
              <pattern>com.google</pattern>
              <shadedPattern>shaded</shadedPattern>
            </relocation>
            <relocation>
              <pattern>google.protobuf</pattern>
              <shadedPattern>shaded</shadedPattern>
            </relocation>
          </relocations>
        </configuration>
      </plugin>```
tender shard
#

Naaah

#

Do not just use „shaded“

#

Use your.packagename.shaded

wet breach
#

only benefit of providing a non-shaded one is for API's really

junior remnant
#

so, like this then?

        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>3.2.1</version>
        <executions>
          <execution>
            <id>shade</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <relocations>
            <relocation>
              <pattern>com.mysql</pattern>
              <shadedPattern>com.ticocraft.ticodisguise.shaded</shadedPattern>
            </relocation>
            <relocation>
              <pattern>com.google</pattern>
              <shadedPattern>com.ticocraft.ticodisguise.shaded</shadedPattern>
            </relocation>
            <relocation>
              <pattern>google.protobuf</pattern>
              <shadedPattern>com.ticocraft.ticodisguise.shaded</shadedPattern>
            </relocation>
          </relocations>
        </configuration>
      </plugin>```
junior remnant
#

sorry

#

it worked!111!!!

#

is it good like that?

distant ridge
#
        RegisteredServiceProvider<Economy> rspEcon = getServer().getServicesManager().getRegistration(net.milkbowl.vault.economy.Economy.class);
        if(rspEcon != null) econ = rspEcon.getProvider();```

i'm having an issue with this. rspEcon isn't null but throws an error relating to the econ plugin. Vault is loaded in but the Economy plugin isn't loaded yet. how do i make it detect the economy plugin but after its loaded
jagged monolith
#
private static Economy econ = null;

    /**
     *
     * Sets up the Economy provider from vault
     * for use within the plugin
     *
     */
    private boolean setupEconomy() {
        if (getServer().getPluginManager().getPlugin("Vault") == null) {
            return false;
        }
        RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
        if (rsp == null) {
            return false;
        }
        econ = rsp.getProvider();
        return econ != null;
    }

    public Economy getEcon() {
        return econ;
    }

That's what I have.

distant ridge
#

I had something similiar and it didn't work before

#

i think i need to create an economy manager

junior remnant
jagged monolith
#

That's the way it tells you to do it in the vaultapi

distant ridge
#

so i see the econ loaded in but it throws a null error for TheNewEconomy being null

jagged monolith
#

Use the one that's on their github as it's the proper way you need to do it.

distant ridge
#

I tried that one first and it didn't work

hardy garnet
#

I am loading a world while my server is running, but it takes too long to load and everyone times out. Do you guys have any suggestions on how to prevent this?

distant ridge
#

So i've been chasing the rabbit

jagged monolith
#

It's what I've got an it works fine. Do you have an economy plugin installed.

distant ridge
#

Yes, the one I mentioned above TheNewEconomy

#

It loads in but its null until after all other plugins load in and then it finishes loading

distant ridge
#

Hmmm still null with another econ plugin

#

what's weird is in my main file it works but when i use .getEcon() its null

#

there's also this

#

Caused by: java.lang.NullPointerException: Cannot invoke "net.milkbowl.vault.economy.Economy.getBalance(org.bukkit.OfflinePlayer)" because "this.econ" is null

jagged monolith
# distant ridge there's also this

Mine says that too sometimes, but it does work. Try using something like Essentials and see if it works. Might be that Economy plugin you're using

distant ridge
#

I need it to work because other people could be using these econ plugins with mine

jagged monolith
#

I don't use the Economy.jar I add Vault as a dependency in the build file and add is a softdepend.

distant ridge
#

Yeah that's what I did

#

This is the error I get from just using the vault code that was given above (right off their github)

#
        setupPermissions();
        if (setupEconomy() ) {
            // Econ loaded
            getLogger().info("bal: " + econ.getBalance(Bukkit.getOfflinePlayer("7b7de6c2-ac99-4b93-a997-730b451e3c01")));
        } else {
            getLogger().info("Could not load econ");
        }```

I have this with my onenable and it works
#

but its null when i use .getEcon()

#

then

econ.getBalance(player);``` 

throws

``` at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "net.milkbowl.vault.economy.Economy.getBalance(org.bukkit.OfflinePlayer)" because "this.econ" is null
        at io.signality.Sleep.SleepManager.doVote(SleepManager.java:101) ~[?:?]
        at io.signality.commands.SleepCommand.onCommand(SleepCommand.java:53) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched_1.16.5.jar:git-Paper-794]
        ... 19 more```
#

in my manager class I do have private final Economy econ = VoteSleep.getEcon(); at the top with all my other loads for that class

#

oh shit i'm dumb

#

i figured it out

#

i had economy loading after my manager class so it was always null

jagged monolith
#

So you got it working?

distant ridge
#

yeah'

supple moth
#

so i recently started a server and put the csgo plugin i can provide link if needed it works with quality armory and for somereason when i start the game and play a few rounds the guns and hands and everything with stop doing damage

#

can anyone help fix or know a solution to thos? i am thing the spawns are to close and its messing it up but not sure

distant ridge
supple moth
distant ridge
#

whats the plugin

distant ridge
#

or message him directly on spigot

supple moth
#

thank you

distant ridge
#

chances are very low you'll find someone how knows about that plugin here tbh

undone yarrow
#

How can I add a passenger entity? This doesn't seem to work and when I right click it doesnt say 'import class ...' e.getEntity().addPassenger(Entity.Chicken);

#

It says cannot resolve symbol 'chicken'. I tried a lot of things but I can't get it to say Chicken without giving me an error

sullen marlin
#

?learnjava

undone axleBOT
remote swallow
#

Damn

#

You have to create and spawn the entity you want to add

undone yarrow
#

How?

remote swallow
#

Google how to spawn an entity spigot

quaint mantle
#

Sorry sir 😏

undone yarrow
ocean hollow
#

hi guys, how can I move items in certain slot(in gui).

remote swallow
#

move with a cursor or set items

ocean hollow
#

So I should use InventoryMoveItemEvent?

#

or what

remote swallow
#

are you wanting to move items in an inventory by code or listen to people moving items

ocean hollow
#

move book from player inventory to 1 and claim from 2

#

(Offset already fixed)

remote swallow
#

if you want to know when the player moves the items use InventoryClickEvent, if you want to move stuff from slot 1 to slot 2, get the item in slot 1 using Inventory#getItem(1) and set slot 2 using Inventory#setItem(2, item), with setting slot 1 to air

ocean hollow
#

no no no, I put in slot 1 by cursor(from player inventory), do operations(click buttons) and after it gives modified item to slot 2. And I can claim item from slot 2

remote swallow
#

yeah listen to inventory click event, get the item from slot 1 and then set slot one to air do your stuff, set slot 2 to your result item

crystal palm
#

what would be the best way to check whether a player is online or not?
currently im doing Bukkit.getPlayer(args[1]) != null

remote swallow
#

OfflinePlayer#isOnline

crystal palm
#

that'd mean using a deprecated method :^(

remote swallow
#

isonline isnt deprecated?

crystal palm
#

OfflinePlayer(string) is.

remote swallow
#

ah

#

your current method is probably fine then

crystal palm
#

👍

remote swallow
#

your cancelling all inventory click events

#

if you need to be able to drag stuff into the top inventory only cancel clicks from the top inventory

ocean hollow
#

so

#

i need to do this?

#

11 - (1), 38 - (2)

remote swallow
ocean hollow
#

Did I get it right?

remote swallow
#

you dont need the slot checks on that, unless your inventory has other items in it

ocean hollow
#

As I understand it, I have to block everything except the player's inventory and these two slots. Yes? Or how?

remote swallow
#

yeah that should work

manic furnace
#

Is it a good idea to cache config-data so it you don't have to read it from the conf-file every time?

remote swallow
manic furnace
#

So it is already cached and there is actually no IO stuff going on?

remote swallow
#

i dont actually know, i havent had a look at stash for it

#

thats just what i would say is the better thing to do instead of calling JavaPlugin#getConfig, which would get the most up to date config

lapis belfry
#

EpicEbic

lapis belfry
#

can i send u logs

remote swallow
#

?paste them

undone axleBOT
rotund ravine
quaint mantle
#

How would you do it so if a player presses q to drop the item, it disallows it but if they click q again to confirm it they can drop it?

vague swallow
#

In an item drop event or however it's called

remote swallow
remote swallow
#

else dont

quaint mantle
#

So a confirmation you want to actually drop the item

crystal palm
#

cant. it's a command

#

i dont expect players to lookup uuids 😅

#

oh well. == null works

remote swallow
#

if its already there drop the item and remove it from pdc

quaint mantle
#

Yes, thank you

crystal palm
#

its a view points command.

#

so /plugin view <name>

#

if offline, get from sqlite.
if online, get from hashmap

#

how come

buoyant viper
#

this has probably been asked a million times.... but is there a reason bukkit/spigot-api doesnt expose methods to set stuff like max player count and MOTD?

undone axleBOT
buoyant viper
#

you can change what the server will tell a client when they request info with ServerListPingEvent, but not the actual information

crystal palm
#

name is also stored in sqlite. bukkit can get online players by username just fine.

#

hashmap is uuid, sqlite has both uuid and name

buoyant viper
#

yeah

#

im aware

#

doesnt stop other methods being exposed by api like toggling whitelist

peak jetty
#

this code isnt working i dont know how to fix it:

    @EventHandler
    public void Break(BlockBreakEvent event) {
        if (event.getBlock().getType() == Material.OAK_LOG && event.getPlayer().getGameMode().equals(GameMode.SURVIVAL)) {
            int delay = 1;
            final Location loc = event.getBlock().getLocation();
            final Block block = event.getBlock();
            final World world = block.getWorld();
            final String stringWorld = world.getName();
            BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
            scheduler.scheduleSyncDelayedTask(getServer().getPluginManager().getPlugin("Minigame1"), new Runnable() {
                @Override
                public void run() {
                    Bukkit.getServer().getWorld(stringWorld).getBlockAt(loc).setType(Material.FIRE);
                }
            }, delay);
        }
    }```
#

pls ping

#

i want it to replace the block with fire when you break oak log but its not working

buoyant viper
#

changing values with reflections works as an alternative to a no-restart change for MOTD and maxPlayers

#

id know since id write plugins to bypass Aternos limits

#

would just be nice to have for something that shouldnt /really/ require reflections just to do

crystal palm
#

ok new issue
i want to save values of the hashmap to the sqlite db every x seconds. Do I use runTaskTimerAsynchronously or scheduleSyncRepeatingTask? the latter seems to be sync, which doesnt sound good in this scenario

peak jetty
#

hey does any1 know why this event isnt triggering?

    @EventHandler
    public void Break(BlockBreakEvent event) {
        getLogger().info("1");
        if (event.getBlock().getType() == Material.OAK_LOG && event.getPlayer().getGameMode().equals(GameMode.SURVIVAL)) {
            getLogger().info("2");
            // Clear Drops
            Material type = event.getBlock().getType();
            Collection<ItemStack> droppedItems = event.getBlock().getDrops();
            for (ItemStack stack : droppedItems
            ) {
                event.getPlayer().getInventory().addItem(stack);
            }
            event.setDropItems(false);
            getLogger().info("3");

            int delay = 1;
            final Location loc = event.getBlock().getLocation();
            final Block block = event.getBlock();
            final World world = block.getWorld();
            final String stringWorld = world.getName();
            BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
            scheduler.scheduleSyncDelayedTask(getServer().getPluginManager().getPlugin("Minigame1"), new Runnable() {
                @Override
                public void run() {
                    Bukkit.getServer().getWorld(stringWorld).getBlockAt(loc).setType(Material.FIRE);
                }
            }, delay);
            getLogger().info("4");
        }
    }

}```
jagged monolith
hazy parrot
peak jetty
#

its in the main class

crystal palm
#

yeahh

quaint mantle
#

?paste

undone axleBOT
jagged monolith
hazy parrot
#

Saving ever x seconds seems stupid af, as afaik update statement in sqlite isn't idempotent

#

It will make much more queries

peak jetty
# jagged monolith Did you register the event in the onEnable method in the main class.

here is the full thing:

public final class FrictionFire extends JavaPlugin {

    @Override
    public void onEnable() {
        // Plugin startup logic
        
    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }

    @EventHandler
    public void Break(BlockBreakEvent event) {
        getLogger().info("1");
        if (event.getBlock().getType() == Material.OAK_LOG && event.getPlayer().getGameMode().equals(GameMode.SURVIVAL)) {
            getLogger().info("2");
            // Clear Drops
            Material type = event.getBlock().getType();
            Collection<ItemStack> droppedItems = event.getBlock().getDrops();
            for (ItemStack stack : droppedItems
            ) {
                event.getPlayer().getInventory().addItem(stack);
            }
            event.setDropItems(false);
            getLogger().info("3");

            int delay = 1;
            final Location loc = event.getBlock().getLocation();
            final Block block = event.getBlock();
            final World world = block.getWorld();
            final String stringWorld = world.getName();
            BukkitScheduler scheduler = Bukkit.getServer().getScheduler();
            scheduler.scheduleSyncDelayedTask(getServer().getPluginManager().getPlugin("Minigame1"), new Runnable() {
                @Override
                public void run() {
                    Bukkit.getServer().getWorld(stringWorld).getBlockAt(loc).setType(Material.FIRE);
                }
            }, delay);
            getLogger().info("4");
        }
    }

}```
hazy parrot
#

That is true tho

jagged monolith
# peak jetty how?

getServer().getPluginManager().registerEvents(new MyListener(), this);

Thats an example

jagged monolith
#

Firstly I'm on phone so it's impossible to read that error. Secondly. Show how you added it to the onEnable

rotund ravine
jagged monolith
#

That's wrong.

eternal oxide
peak jetty
#

how do i fix?

remote swallow
jagged monolith
#

I'd recommend moving the event to its own events class. Then just change the new FrictionFire() to that's class name.

rotund ravine
#

Thought u wanted him to add it to the item

remote swallow
#

ah lol

crystal palm
#

i was thinking more about creating a list of modifiedKeys xd

#

but alright cool

#

thanks

hushed pawn
#

there is any good ways to get empty world every time when server starting?

subtle folio
crystal palm
jagged monolith
#

?paste

undone axleBOT
hushed pawn
#

and it shoud be "world"

jagged monolith
subtle folio
#

there’s no easy way

jagged monolith
#

Because you moved it to a new class, you have to change how you're getting the plugin instance for the scheduler.

#

I'd recommend Dependency Injection for it

#

?di

undone axleBOT
remote swallow
#

idk why your checking the items pdc when you dont need to change that at all, you are checking for key2 when you set key1, you set pdc if anything happens

quaint mantle
#

I have two keys, one for the actual item its self and one which you advised setting for the confirmation no?

#

shit

#

I see, i've checked wrong key

remote swallow
#

give me a moment ill type what i mean up

quaint mantle
#

Okay no problem

remote swallow
#

that should work

rotund ravine
remote swallow
#

that would probably be smart

#

i didnt think about that part lol

quaint mantle
ocean hollow
#

Is there something like event.getClickedSlot()?

orchid gazelle
#

//push

quaint mantle
#

#nomove but you can also see in the screenshot

remote swallow
#

i dont see you using setCancelled(true) int hat

quaint mantle
remote swallow
#

what messages get sent to the player?

quaint mantle
#

#nomove <user>

remote swallow
#

args.length isnt 2 then so thats why that part doesnt work

quaint mantle
#

#nomove <user> and then it is displayed in the chat but I want to have it so that the message is not displayed

#

yes

#

Yes

quaint mantle
#

#nomove <username>

#

yes

#

When I type #nomove <player name> the message is displayed in the chat. But I do not want that

#

I have hidden my name but I have also written to it

#

No error comes

#

No

rotund ravine
#

Just use a command?

quaint mantle
#

It's so funny all of a sudden it works. Thanks for your help

quaint mantle
rotund ravine
vale ember
#

Why is PlayerInteractEvent called twice when right-clicking on a stone?

remote swallow
#

?interactevent

undone axleBOT
#

The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.

For example, only executing code if the main hand was used:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
vale ember
#

oh thanks i didn't know this

#

but why is it called only once for anvil then?

remote swallow
#

no clue

versed nest
#

Good day! I've been trying to send a chat packet from bungeecord to an attached server. When trying to construct it. I appear to be getting the following error: https://pastes.dev/iI9yFblSrO . The code i'm using can be found here: https://pastes.dev/8tvtyft2p8 . A few versions ago, constructing the Chat packet with just the message seemed to work. I tried the current code as an alternative but everything yields the same result.

opal juniper
versed nest
vague swallow
remote swallow
#

resourcepack

vague swallow
vague swallow
remote swallow
#

that looks like a chest

#

it might bea 5line inv

ocean hollow
#

54 slots

vale ember
#

does BlockBreakEvent#isDropItems take into account whether the player is in creative or not?

vague swallow
buoyant viper
#

how it feels to not know how to use patches and then checkstyle+surefire not showing the errors in IDE

remote swallow
#

can i have that code

buoyant viper
#

sorry its property of winnpixie™️

remote swallow
#

damn

buoyant viper
#

oh fukc U

#

forgot about the bukkit class

#

wish i knew how to just like

#

merge the patches too

#

granted ive touched like 3 files tops so i could just redo buildtools

#

yeah im resetting it and trying again

#

ill send u the patch files once i stop being stupid @remote swallow

#

altho not like its nontrivial

remote swallow
#

thanks

buoyant viper
#

only way itd get more involved is if i made it persist across server restarts

#

bc this is only a per-session thing im testing

remote swallow
#

are you gonna pr it

buoyant viper
#

debatable

#

like someone else said earlier when i asked why they werent already in API-- theyre pretty useless unless ya make them save to server.properties

quaint mantle
#

?paste

undone axleBOT
quaint mantle
#

https://paste.md-5.net/hivuculihi.cs - Adding them to a map with system currenttimemillis, getting the difference between when they were added and the current time in millis and dividing that by 1000, if it's greater than 10 removing the key and removing from map

remote swallow
#

the only problem you would have with that is someone press q, waiting 10 seconds and pressing it again

#

it would just loop in that case

quaint mantle
#

That's what I'm after no? I want it so if they press q, 10 seconds go by and they try do it again they have to re confirm (PRess it twice, within 10 seconds) but it's not working, after 10 seconds I can just press q and drop it

remote swallow
#

yeah ig

quaint mantle
#

So how come it's not working?

#

See anything I'm not?

remote swallow
#

it only runs when you drop anything

quaint mantle
#

No, I have a check for specific item pdc?

#

I have two keys in that event being checked

remote swallow
#

your time check will only run when you drop anything, it wont run if you just wait

quaint mantle
#

ah yeahh

buoyant viper
remote swallow
#

thanks

buoyant viper
#

feel free to change the names of the patches (if its possible) idk

#

patches were made against a fresh build of 1.19.3 from BuildTools

#

and ofc add restart persistence :^)

vague swallow
#

How can I check if a raytrace was interrupted by a block?

buoyant viper
#

link to what

#

oh no i havent

#

i dont even have an account on the stash or jira

vale ember
#

Hey, why is this happening?
Stacktrace: https://paste.md-5.net/duritesizi.pl
Code:

        CollectionMaps.forEach(attributeModifiers, (attribute, modifier) ->
              Objects.requireNonNull(entity.getAttribute(attribute)).addModifier(modifier));

//

public class CollectionMaps {
    public static <K, V> void forEach(Map<K, Collection<V>> map, BiConsumer<K, V> action) {
        map.forEach((key, value) -> value.forEach(it -> action.accept(key, it)));
    }
}
crystal palm
#
PreparedStatement ps = plugin.data.getSQLConnection().prepareStatement("INSERT IGNORE INTO points(UUID,NAME,POINTS,COOLDOWN) VALUES (?,?,?,?)");

anything wrong with this? console keeps saying:
org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (near "IGNORE": syntax error)

summer agate
#

try INSERT OR IGNORE

tardy delta
#

isnt it insert or ignore

#

it is insert ignore

vale ember
#

why tf is BlockBreakEvent called when i left-click with a sword in creative???

crystal palm
#

new error, lads!

[14:43:28 WARN]: org.sqlite.SQLiteException: [SQLITE_BUSY]  The database file is locked (database is locked)
[14:43:28 WARN]:        at org.sqlite.core.DB.newSQLException(DB.java:1030)
[14:43:28 WARN]:        at org.sqlite.core.DB.newSQLException(DB.java:1042)
[14:43:28 WARN]:        at org.sqlite.core.DB.throwex(DB.java:1007)
[14:43:28 WARN]:        at org.sqlite.core.DB.executeBatch(DB.java:832)
[14:43:28 WARN]:        at org.sqlite.core.CorePreparedStatement.executeBatch(CorePreparedStatement.java:64)
[14:43:28 WARN]:        at Points-1.0.jar//me.goosbanny.points.tasks.DataSaver.lambda$run$0(DataSaver.java:40)
...blah blah useless stuff
```https://bin.birdflop.com/efisapahig.java
#

autocommit is disabled

tardy delta
#

insert ignore into

crystal palm
#

nono INTO comes before tablename

#

aka points

tardy delta
summer agate
#

He is inserting into points, ignore is an sqlite statement

crystal palm
#

nah haha

tardy delta
#

the question is by what its locked

summer agate
#

A transaction locks a table I believe in order to prevent errors

#

if an error occurs you want your changes to be undone

crystal palm
#

there is only one?

crystal palm
quaint mantle
#

How to define a player in the event ServerCommandEvent e.g. Player player = e.getPlayer();

vale ember
crystal palm
quaint mantle
#

Thanks

remote swallow
#

slight problem with that

crystal palm
remote swallow
crystal palm
#

ah. servercmdevent.

#

brah

quaint mantle
#

It does not work

remote swallow
#

you are trying to get the player from an event that wouldnt have a player

upbeat vine
#

Hey guys iam having one issue when i try to access spigot web This challenge page was accidentally cached by an intermediary and is no longer available please help me

opal juniper
#

iirc it is true by default

quaint mantle
remote swallow
crystal palm
#

i should probably not /reload when working with dbs lmao

remote swallow
#

close connection on disable

hazy parrot
crystal palm
#

right.. except

summer agate
crystal palm
#

already closing it onDis.

#

weiiirdd.. but it's /reload sooo

#

can't complain

vague swallow
#

How can I check if a raytrace was interrupted by a block?

summer agate
#

doesn't a raytraceresult have a getHitBlock or something? if that is not null a block has been hit

tender shard
vague swallow
quaint mantle
#

Anyone know how to implement auto selling with vault api?

summer agate
remote swallow
quaint mantle
#

Sounds good thanks

soft viper
#

How to restart server?

#

I use Bukkit.getServer().spigot().restart()

#

But nothing happens

fallow violet
#

just stop the server

#

and in the startup script you start it again

#

on .sh its

while true
do
JAVA SERVER STARTUP HERE
done
soft viper
#

I want to do it in plugin

fallow violet
#

i guess if you run restart the server stops itself and rerun the start script file

remote swallow
#

do you get any errors

soft viper
#

Attempting to restart with ./start.sh

soft viper
soft viper
remote swallow
#

does it just stop the server

soft viper
#

Yes

remote swallow
#

its doing what the method says it would

fallow violet
remote swallow
soft viper
remote swallow
#

the restart stuff isnt setup so it cant restart auto

soft viper
#

Should i setup it in spigot.yml?

#

settings:
debug: false
sample-count: 12
timeout-time: 60
restart-on-crash: true
restart-script: ./start.sh

#

I think i did it

tender shard
#

don't forget to make the script executable or call it through a shell instead

tender shard
#

it'll look for entities and blocks

#

and stop whatever it hits first

tardy delta
#

are you on linux?

soft viper
#

Yes

tardy delta
#

chmod +x start.sh then to make it executable

soft viper
#

Ok, ill try it

#

Nothing changed

tender shard
#

what's the problem?

soft viper
#

Im trying to restart server

#

But it just stops

tender shard
#

?paste your script

undone axleBOT
soft viper
#

#bin/sh

screen -S test-p-1.19 java -Xms2048M -Xmx2048M --add-modules=jdk.incubator.vector -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -jar server.jar --nogui

tender shard
#

nooo

#

do not use a screen session from inside screen

soft viper
#

without screen?

tender shard
#

inside that, just do

#!/usr/bin/env bash
java ... -jar server.jar --nogui
#

also I'd combine both scripts

#
SCREEN=""
if [[ $1 == "screen" ]]; then
  SCREEN="screen -S test-p-1.19"
fi

$SCREEN java -Xms2048M -Xmx2048M --add-modules=jdk.incubator.vector -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs/ -Daikars.new.flags=true -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -jar server.jar --nogui
#

then you could do ./start.sh screen to run it in screen and your restart thing could just call ./start.sh

#

otherwise you'd have to adjust the params in both scripts

#

but tbh I wouldn't use the restart option in the first place

#

if your java proc gets killed by the OOM killer or something, it wouldn't work I guess

#

I'd rather just use a systemd service

#

that's the best option for sure and also the most comfortable one

soft viper
#

#!/usr/bin/env bash

java -Xms2048M -Xmx2048M --add-modules=jdk.incubator.vector -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs/ -Daikars.new.flags=true -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -jar server.jar --nogui

#

Should it work fine?

tender shard
#

I guess it should work

frank kettle
#

Hello, my plugin has been lagging the server for no reason. I recently upgraded the server host to a better service on the same provider and now when connecting to mySQL it's taking 25000ms(20+ seconds) instead of the usual 20-30ms.

Error:
https://paste.md-5.net/jumumecafu.md

What can be causing this? It's on the mySQL connection but makes no sense.... it was working fine before upgrading host...

#

I know I'm using paper for server version 💀 but plugin is in spigot.

soft viper
# tender shard I guess it should work

restart
[20:33:54 INFO]: [STDOUT] [org.spigotmc.RestartCommand] Attempting to restart with ./restart.sh
[20:33:54 INFO]: Stopping server
[20:33:54 INFO]: Saving players
[20:33:54 INFO]: Saving worlds
[20:33:54 INFO]: Saving chunks for level 'ServerLevel[world]'/minecraft:overworld
[20:33:56 INFO]: Saving chunks for level 'ServerLevel[world_nether]'/minecraft:the_nether
[20:33:56 INFO]: Saving chunks for level 'ServerLevel[world_the_end]'/minecraft:the_end
[20:33:56 INFO]: ThreadedAnvilChunkStorage (world): All chunks are saved
[20:33:56 INFO]: ThreadedAnvilChunkStorage (DIM-1): All chunks are saved
[20:33:56 INFO]: ThreadedAnvilChunkStorage (DIM1): All chunks are saved
[20:33:56 INFO]: ThreadedAnvilChunkStorage: All dimensions are saved
[20:33:56 INFO]: Flushing Chunk IO
[20:33:56 INFO]: Closing Thread Pool
2023-01-02 20:34:00,055 Log4j2-AsyncAppenderEventDispatcher-1-Async WARN Advanced terminal features are not available in this environment
[20:33:59 INFO]: Closing Server

#

Its my logs

tender shard
soft viper
#

Yes

frank kettle
#

if they were wrong a error should have appeared

#

connections have a try/catch

tender shard
#

nah it can happen that it's a firewall issue

#

e.g. if you upgradeded the server, the mysql ip might have changed

frank kettle
#

hm maybe thats why, this "upgraded" servers are new on the host

frank kettle
tender shard
#

then it waits like 60 seconds before it says "connection refused"

frank kettle
#

i noticed that and thought was that at first so i updated

tender shard
#

and paper dies before that

#

have you checked whether the mysql ip is correct?

#

after upgrading

frank kettle
#

im using url connection

tender shard
#

yeah but you have to give at least SOME hostname

frank kettle
#

password below.

#

the server and users should be right

tender shard
#

hm I don't have mysql installed right now

#

one sec

frank kettle
#

the mysql "data" itself stayed but the "server" changed so I updated it but still super laggy

#

🤔

soft viper
#

after stop my screen just closing

tender shard
#

hm looks good to me

#

firewall doesn't seem any problem

#

do you got SSH access?

frank kettle
#

idk what that is so i assume no

tender shard
#

check your server panel if you see sth like "ssh"

quaint mantle
#

How would one add the whole SUM amount instead of it spamming each individual sale

frank kettle
#

i assume i would have that if it was a vps? but it's just a single server

tender shard
#

can other plugins access your mysql database fine?

frank kettle
tender shard
#

just download any and try if those work

#

LuckPerms for example

tardy delta
#

why instantiating bukkitrunnables for no reason

tender shard
remote swallow
#

auto selling stuff im pretty sure

#

take X items and give Y money

frank kettle
#

its happening when someone joins server to get their data

#

correct but im trying to figure out why is it not connecting

tardy delta
#

are you loading data in async pre login event?

frank kettle
#

main thread or not, it was working fine before.

#

the threads wouldnt be a issue here for the connection

tender shard
#

I don't think that "making it async" is a proper fix for "I cannot connect to my DB because it times out"

alpine urchin
#

lol

frank kettle
#

it was working 1hour ago on previous host

tardy delta
#

just use a file based db or smth that ships with the plugin

frank kettle
#

with the same exact code

frank kettle
tender shard
#

yes and that's not the problem

alpine urchin
#

did you send the code

tender shard
#

the problem is not the thread dying ut the "cannot connect" in the first place

tardy delta
#

then atleast it doesnt take 20secs

tender shard
#

then it would say "connection refused"

hazy parrot
#

timed out is 100% network issue

tender shard
#

yeah I can connect to the host they gave

hazy parrot
#

can they try to ping that host ?

#

maybe its nat loopback issue

frank kettle
#

it was working for past month on previous host

#

this has to be a host issue, not the plugin itself

hazy parrot
amber lichen
#

we need a plugin developer. anyone here for medium budget plugin dev ?

hazy parrot
#

?services

undone axleBOT
tardy delta
#

why using an online host too and not just shipping a db file with the plugin?

frank kettle
hazy parrot
tardy delta
#

for what reason

frank kettle
frank kettle
#

"just change the way you store data" doesnt fix the issue that wasn't happening for a month and now happens when swapping hosts

hazy parrot
#

you can also try to use local ip

#

instead of domain

frank kettle
#

i feel like this is a diff issue and some people here are trying to ignore it instead of finding why

frank kettle
#

it fixes the issue by not fixing it

hazy parrot
#

he cant connect to db..

frank kettle
#

i can enter the mysql from the website

#

not from plugin

hazy parrot
#

he already gave

frank kettle
#

it lags and sends this

#

every "has not repsonded for 10 seconds".... 20 seconds.. .30... 40...

#

well the error there is when connecting

undone axleBOT
frank kettle
#

this is when it tries to connect to it.

#

then i dont know what you mean by this

#

😅 sry

#

ah

#

i posted above

#

1sec

undone axleBOT
frank kettle
#

well i sent this cause it has the password there

#

sure... it's just that tho

#

here

tender shard
#

does the web panel actually tell you to use "minecraft3667.omgserv.com" as mysql host, or do they also give you some IP address?

#

if so, is that IP 62.210.233.174 ?

frank kettle
#

@tender shard

tender shard
#

then go try other plugins

frank kettle
#

btw, I added luckperms on the server

tender shard
#

Luckperms

frank kettle
#

i just dont know what to do now with it

#

never used

tender shard
#

set it to use mysql

#

one sec

hazy parrot
#

yap, working totally fine for me too

tender shard
#

restart server and see whether luckperms throws an error

#

and/or check whether it could successfully create the tables

remote swallow
#

save your data first ofc

tender shard
#

if yes, sths wrong with your code.
if not, mock your hoster.

untold patio
#

Guys can anyone pls guide me through this

#

Idk what I'm doing wrong but I'm trying to replace a message sent by the player

#

But it's still looking as default

tardy delta
#

probably dont need replaceAll

tender shard
#

rulesNames? That's a weird variable name for a Rule[]

tender shard
untold patio
frank kettle
#

ok, i changed to mysql, restarting server

untold patio
#

This is the rule class

tender shard
frank kettle
#

ok

#

error

tardy delta
frank kettle
#

i guess its not just my plugin

tender shard
#

root@localhost

hazy parrot
frank kettle
#

ah

frank kettle
#

well, i never used this 😂

#

sorry

frank kettle
#

let me fix

untold patio
# tardy delta whats that doin

I'm storing all data in an arraylist with that information, then I want to check if a player sent a message which equals the "input"

#

If so, it will replace that message with the "output"

tardy delta
#

what even is a rule

tender shard
#

then check if message.equals(input)

#

you don't need replaceAll if you just want to replace the whole message

frank kettle
tender shard
#

btw you should NEVER use replaceAll unless you want to use regex

#

just use replace(...) to replace things in strings

frank kettle
#

ok

#

another huge error

tardy delta
#

why does that method has such a stupid name tho

frank kettle
#

?paste

undone axleBOT
tender shard
tardy delta
#

ye

frank kettle
#

🤔

tardy delta
#

literally same thing

tender shard
# tardy delta ye

both replaceFirst and replaceAll take a regex. a proper name would maybe replaceRegexFirst or sth but idk

#

yeah it's a weird name

untold patio
#

So, if event.getMessage().equalsIgnoreCase(rule.getInput())

tender shard
untold patio
#

Then event.getMessage().replace(Old String, new String)?

tardy delta
#

ah didnt know about replaceFirst

tender shard
frank kettle
tardy delta
#

love it how i cant longer open ij on linux

chrome beacon
#

What did you do?

untold patio
#

Like this?

tender shard
tender shard
undone axleBOT
tardy delta
#

last time im using kde neon, so many bugs

frank kettle
tender shard
untold patio
#

There will be more types

tardy delta
#

why arent you using a map

tender shard
#

I really have no clue what that whole method is supposed to do

#

I mean

#

if you have a rule called "equal" and you loop over all rules, then this will always at some point be true

untold patio
chrome beacon
tender shard
#

so why do you loop in the first place

tardy delta
#

might wanna use plain debian then too

tender shard
#

debian is the best distro

untold patio
#

I have an arraylist, with n number of rules

tardy delta
#

as i have the most experience with that

untold patio
#

Some are gonna have "type: equal" others will not

tender shard
#

ooh now I get it

untold patio
#

So, if the rule the loop is checking has "type: equal" It's gonna get its input and its output

tardy delta
#

i dont

untold patio
#

and then replace the message only if a player has sent the "input"

tender shard
#

he has rules like this:

rule1:
  text: "jesus"
  type: equal
rule2:
  text: "asd"
  type: contains
#

the string "jesus" would match rule1 but "jesus123" woulod not match

tardy delta
#

equal jesus

tender shard
#

"asd123" woulod match rule2 and "asd" would match too

tardy delta
#

and whats with the rules

untold patio
#

and an output too

tender shard
#
for(Rule rule : allRules) {
  if(rule.getType().equals("equal")) {
    if(event.getMessage().equals(rule.getText()) {
      event.setMessage(rule.getReplacement());
    }
  } else {
    if(event.getMessage().contains(rule.getText()) {
      event.setMessage(event.getMessage().replace(rule.getText(), rule.getReplacement());
    }
  }
}

I'd just do it sth like this

tender shard
tardy delta
#

what do those rules input and output thing do

tender shard
#

it's a chat filter

tardy delta
#

🤔

tender shard
#

have you ever seen a chat filter?

tardy delta
#

ik what that stuff is supposed to do :

untold patio
#

So is my code right? I mean the last pic I sent?

tender shard
#

there is no need to use replace in this case

#

if the message equals, then why bother replacing it

#

instead of just seting it

#

btw chatfilters should support regex

untold patio
#

Oh

#

So this would be it

tender shard
#

looks like it

untold patio
misty current
#

hey, i've made a library plugin (EssenceAPI) that i want to use in my project (EvolvedPrison), but i've noticed some weird behaviour and I did some debugging and I have found out that for some reason the main class of my library (EssenceAPI) is not the same as the one i have imported with maven. I have made a local repo by using the "install" plugin when compiling EssenceAPI.

This is the code in the onLoad method of my plugin (EvolvedPrison):

        Class<? extends JavaPlugin> class1 = ((JavaPlugin) Bukkit.getPluginManager().getPlugin("EssenceAPI")).getClass();
        Class<? extends JavaPlugin> class2 = EssenceAPI.class;

        getLogger().log(Level.WARNING, class1.getName());
        getLogger().log(Level.WARNING, String.valueOf(class1.getClassLoader()));

        getLogger().log(Level.WARNING, class2.getName());
        getLogger().log(Level.WARNING, String.valueOf(class2.getClassLoader()));

        getLogger().log(Level.WARNING, String.valueOf(class1 == class2));

and this is the console output:

[17:14:14 INFO]: [EvolvedPrison] Enabling EvolvedPrison v1.0
[17:14:14 WARN]: [EvolvedPrison] me.kill05.essenceapi.EssenceAPI
[17:14:14 WARN]: [EvolvedPrison] PluginClassLoader{plugin=EssenceAPI v1.0, pluginEnabled=true, url=plugins\EssenceAPI-1.0.jar}
[17:14:14 WARN]: [EvolvedPrison] me.kill05.essenceapi.EssenceAPI
[17:14:14 WARN]: [EvolvedPrison] PluginClassLoader{plugin=EvolvedPrison v1.0, pluginEnabled=true, url=plugins\evolvedprison-1.0.jar}
[17:14:14 WARN]: [EvolvedPrison] false

also it's worth mentioning that EvolvedPrison has EssenceAPI as a dependency in plugin.yml:

name: '${project.name}'
version: '${project.version}'
main: me.kill05.evolvedprison.EvolvedPrison
load: STARTUP
api-version: 1.19
authors: [ kill05 ]
description: '${project.description}'

depend:
  - 'EssenceAPI'

softdepend:
  - 'DeluxeChat'
  - 'PlaceholderAPI'

sorry for the long message but i've tried to provide as many details as I could

untold patio
#

:c

#

or changed

remote swallow
misty current
#

it's a plugin that runs on my server that is also imported as a dependency in my pom.xml

tender shard
#

mvn clean install the lib
mvn clean install the plugin
reinstall both .jars on the server

misty current
#

so the highlighted one?

rotund ravine
# tender shard ```java for(Rule rule : allRules) { if(rule.getType().equals("equal")) { i...

Or something like this:

import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;

import java.util.ArrayList;
import java.util.List;

public class ChatListener implements Listener {

    private List<Rule> rule = new ArrayList<>();

    @EventHandler
    public void asyncChatEvent(AsyncPlayerChatEvent event){
        rule.forEach(
                rule -> {
                    if (rule.getType().getMethod().test(event.getMessage(), rule.getString())){
                        event.setMessage("false");
                    }
                }
        );
    }
}
import java.util.function.BiPredicate;

public enum FilterType {
    EQUAL(String::equals),
    Contains(String::contains);

    private BiPredicate<String, String> method;
    FilterType(BiPredicate<String, String> methodReference) {
        this.method = methodReference;
    }

    public BiPredicate<String, String> getMethod() {
        return method;
    }
}
public class Rule {
    private FilterType type;
    private String string;

    public FilterType getType() {
        return type;
    }

    public String getString() {
        return string;
    }
}
tender shard
remote swallow
#

i thought your meant to do control twice for build command stuff

tender shard
#

oh

untold patio
#

Looks like it's not reaching this part

tender shard
#

maybe it's control

misty current
#

shift is the search isn't it

tender shard
misty current
#

yea it's ctrl

untold patio
misty current
#

kk restarting the server

tender shard
#

print out both

untold patio
tender shard
#

message and rule input

#

print out both things to console - the rule input and the actual text

misty current
#
[17:24:58 INFO]: [EvolvedPrison] Enabling EvolvedPrison v1.0
[17:24:58 WARN]: [EvolvedPrison] me.kill05.essenceapi.EssenceAPI
[17:24:58 WARN]: [EvolvedPrison] PluginClassLoader{plugin=EssenceAPI v1.0, pluginEnabled=true, url=plugins\EssenceAPI-1.0.jar}
[17:24:58 WARN]: [EvolvedPrison] me.kill05.essenceapi.EssenceAPI
[17:24:58 WARN]: [EvolvedPrison] PluginClassLoader{plugin=EvolvedPrison v1.0, pluginEnabled=true, url=plugins\evolvedprison-1.0.jar}
[17:24:58 WARN]: [EvolvedPrison] false

this is the new log so nothing changed :c

vale ember
#

do you shade it>

misty current
#

i've ran the command on both projects

vale ember
#

?

misty current
#

hold on i'll paste my pom

#

?paste

undone axleBOT
misty current
tender shard
#

yeah you are shading it

vale ember
#

that's the problem

tender shard
#

<scope>provided

#

into your dependency

misty current
#

wait isn't provided the default scope?

tender shard
#

no

untold patio
tender shard
#

compile is

untold patio
#

Here it is

tender shard
#

the default

misty current
#

oh

vale ember
#

its compile

tender shard
#

show the full code

misty current
#

i wish i knew before debugging for hours

untold patio
tender shard
vale ember
#

that's why i use gradle 😀

misty current
#

hmm i should learn to use gradle

#

never used it

tender shard
#

ofc it has, gradle doesnt even have an official shade plugin

rotund ravine
river oracle
#

If you wanna use gradle switch to using paper

misty current
#

not really for spigot but for other projects

tardy delta
#

gradle has like a bunch of files 🤔

vale ember
tender shard
misty current
#

i've seen gradle being used more often than maven

#

and I usually just copy paste

vale ember
river oracle
#

You know with maven too

#

Super easy

misty current
#

almost 2 years of java and still copy-pasting maven and gradle imports lol

remote swallow
#

i use the mc dev plugin in intellij and have default build.gradle setup lol

rotund ravine
tender shard
#

maven has 2.8% and gradle 0.2% - if those numbers are true, idk

misty current
#

with that i meant i don't know how 90% of maven features work

#

oh really

vale ember
#

yeah but like gradle is 100 times more readable and compact

misty current
#

interesting

#

anyways i'm sticking with maven for now

tender shard
vale ember
#

instead of 100 lines of shitty xml you have 10 lines of kotlin

tender shard
#

build.gradle files are so confusing

remote swallow
#

fuck kotlin

river oracle
#

Fuck kotlin

tender shard
#

I love that maven uses XML

vale ember
#

kotlin > groovy

tender shard
#

it's so easy to read compared to weird groovy syntax

vale ember
#

i don't mean for plugin code, just for the build file

misty current
#

also what does the shade plugin do if you can just specify compile as the scope?

remote swallow
vale ember
tender shard
#

I also don't like gradle because the shadow plugin is shit

misty current
#

i mean doesn't compile already do that

tender shard
#

and stuff like "why do I have to specify my local or central maven repo"

misty current
#

by that i mean include the packages of the dependency in the compiled jar

remote swallow
tender shard
#

and it's not an official plugin

tender shard
#

it's made from some random githu dude

vale ember
tender shard
remote swallow
#

its on their plugin system so is offical

tender shard
#

please read my full message

rotund ravine
tender shard
#

no...

#

you all dont get it

rotund ravine
#

go to tph and ask instead and they'll waste their time to do it.

#

I do, we had this chat before.

tender shard
#

it can NOT. do filtering, relocating, AND minimizing AT THE SAME TIME

#

it can do every of those things

misty current
#

anyways now it works fine

#

thanks

tender shard
#

but not all 3 together

rotund ravine
#

Obviously you just need to do it a more complicated way.

tender shard
#

yeah and in maven it's so easy

quaint mantle
#

I don't get how people make private mine plugins and arena plugins like practice

tender shard
#

I don't hate gradle, I just think maven is way more powerful in terms of builtin plugins, and "uuugh xml has soo many lines" is a quite stupid argument

untold patio
#

I just took a look and it seems like it should be working

tender shard
#

I think XML is way more tidy

tender shard
quaint mantle
#

?paste

undone axleBOT
remote swallow
vague swallow
echo basalt
#

I use gradle but I'm no expert

quaint mantle
#

If anyone can tell me why this isn't working, that would be nice too... At the moment the confirmation is working perfectly but it should be having a ten second timer that resets, so q to drop item, asks to press it again to actually drop the item. If 10 seconds goes by and you don't click q again it resets back to having to confirm. https://paste.md-5.net/kuwosileja.cs - I've been told to use a schedular which is my next plan but i've moved on from this for now so if anyone can enlighten me, thanks 🙂

fluid river
#

i guess i finally found out how to do O(1) hashmap

#

but i want to know how java's rehashing works

tender shard
fluid river
#

for hashmap

untold patio
#

mfnalex, could you take a look at the pic? :c

tender shard
#

brb gotta cook

vale ember
#

i don't see what's the problem with doing all 3 things together

vale ember
remote swallow
#

has anyone else had discord saying "be careful on this download link" on paste.md-5.net links

fluid river
remote swallow
#

whats discord done now to fuck that up

vague swallow
river oracle
#

It's always been like that afaik

remote swallow
#

it didnt used to do that

#

for me atleast

river oracle
#

You might have white listed it

remote swallow
#

theres no button for it

river oracle
#

What?

remote swallow
#

to whitelist

river oracle
#

You don't have that?

remote swallow
fluid river
remote swallow
river oracle
vale ember
# tender shard https://github.com/JEFF-Media-GbR/JeffLib/issues/18

There's no issue here. I wrote the following build file.

plugins {
    id("com.github.johnrengelman.shadow") version "7.1.2"
    java
}

repositories {
    maven("https://hub.jeff-media.com/nexus/repository/jeff-media-public/")
}

dependencies {
    implementation("com.jeff_media:JeffLib:12.0.0")
}

tasks.shadowJar {
    relocate("com.jeff_media.jefflib", "me.username.jefflib") {
        include("com/jeff_media/jefflib/internal/nms/**")
    }
    minimize()
}

When any of the nms classes are referenced in the code, the jar contains all required classes inside me/username/jefflib/internal/nms. When there are no references to any nms classes, jar is expectedly empty because of minimizing. All jefflib classes outside of internal/nms are NOT relocated, but rather shaed in com/jeff_media/jefflib because of the filtering. There is absolutely NO problem with the gradle or shadow plugin.

remote swallow
#

thats what i was thinking

#

it started earlier

fluid river
#

this might be the issue

fluid river
#

are u sure it's line 98 in your current code version

fluid river
#

can you print out location after .add()

humble tulip
#

just clone then add?

fluid river
#

and before tp

fluid river
vague swallow
fluid river
#

cuz some methods return clone, and some the actual location

vague swallow
#

of the moving entity right?

fluid river
#

the moveStart

#

between .add and .teleport

vague swallow
#

yes

fluid river
#

print it

vague swallow
#

but since it's not executing anything it's also not printing the location

#

oh nvm

vague swallow
# fluid river print it

I got this as location: Location{world=CraftWorld{name=world},x=NaN,y=NaN,z=NaN,pitch=79.64987,yaw=84.93686}

misty current
#

do you do any division by 0

#

with doubles

remote swallow
tender shard
misty current
vale ember
remote swallow
#

fuck kotlin

#

get out

fluid river
river oracle
#

Gross kotlin

vale ember
#

Use build.gradle.kts

remote swallow
#

no

fluid river
#

cuz as i said it might be the issue

remote swallow
#

dont

#

fuck kotlin

#

never use it

#

even for gradle files

river oracle
#

Lol I'm joking idk what this brit is doing

vale ember
#

Why you hate it so much?

remote swallow
#

its bad

vale ember
#

Why??

remote swallow
#

who wants to use val something instead of specifiying type

untold patio
#

Guys can anyone pls help, Idk why this ain't working

river oracle
#

You van specify type after 😈it just looks like shit

remote swallow
#

?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.

vale ember
#

Well it's not worse than groovy

remote swallow
untold patio
#

k

remote swallow
untold patio
#

I don't get any errors, it should replace a message sent in the chat but it's not doing it

hazy parrot
tender shard
remote swallow
remote swallow
untold patio
#

This is the rule class

vale ember
tender shard
remote swallow
#

also do you have a build {} area

tender shard
remote swallow
#

@young knoll how do you write multi module gradle stuff

vale ember
#

Is there any usage of nms stuff in code of the project?

white root
#

Does anyone know if protocollib has a discord or unofficial community where I can ask questions?
Ive never used it before, and it would be nice if there were a place to ask them other than just inside of github tickets

remote swallow
#

in jefflib ytes

vale ember
#

You minimize it

tender shard
remote swallow
vague swallow
quaint mantle
vale ember
#

Empty jar is expected cuz of minimize

remote swallow
#

he can exclude fine he just cant include, exclude and minimize

quiet ice
quaint mantle
#

aaaaaaaaa

quiet ice
#

Use mojmap man - that is the next big thing

vague swallow
#

between .add and .teleport it was Location{world=CraftWorld{name=world},x=NaN,y=NaN,z=NaN,pitch=79.64987,yaw=84.93686}

and before .add it was Location{world=CraftWorld{name=world},x=345.29961288477193,y=124.0,z=68.1742196950407,pitch=88.79999,yaw=-52.613102}

vale ember
quiet ice
quiet ice
#

Can you print the value of currDX, currDY, currDZ?

fluid river
#

you calculated them wrong way

#

and well, you need to check them out

quiet ice
#

The issue is that NaN is very hard to get in java world

#

POSITIVE_INFINITY and NEGATIVE_INFINITY exist for most cases where you'd expect NaN

#

thus NaN only really happens due to a Math#sqrt op

vague swallow
#

so what should I change on the code then?

quiet ice
#

So yeah, path.length() may be NaN and thus triggering that chain of events

#

?stash let's see why that could be

undone axleBOT
quiet ice
#

NaN will be returned if the inner result of the sqrt() function overflows, which will be caused if the length is too long.

#

Basically the X and/or Y and/or Z field (or all of them combined) of your path Vector is too large

vague swallow
remote swallow
#

what does sqrt even do

quiet ice
#

...

remote swallow
#

i dont math

#

google is too hard

quiet ice
#

Are you german by any chance? I don't know the english lingo there

harsh totem
remote swallow
#

oh

#

that makes sense

quiet ice
#

smh

remote swallow
#

i havent been to school in 2 years its fine

#

i should be going but nah