#help-development

1 messages · Page 320 of 1

regal scaffold
#

Which is the only thing screwing every up

#

acf has too much more stuff

#

That I don't need

#

Just need to fix the splitter

#

And prefer to do it myself

tender shard
regal scaffold
#

So I can learn

tender shard
regal scaffold
#

This

#

Command: ds Args: [user, add, TSans_]
Sometimes it'll think the command ran is user and user.add

#

Like makes no sense

dreamy vessel
#

super quick question n im not really sure how to word it:

My plugin is depending on mcmmo and i want to make it so that a scoreboard shows up every time a player gains xp in a skill. I have the event, which is "McMmoPlayerXpGainEvent." so i typed "@ eventhandler publicvoidXPGainEvent(McMMOPlayerXpGainEvent e)," but what would i type to check the skill value?

I checked the source of MCMMO and I found this under the event
" public McMMOPlayerXpGainEvent(Player player, PrimarySkillType skill, float xpGained, XPGainReason xpGainReason) {
super(player, skill, xpGainReason);
this.xpGained = xpGained;"

regal scaffold
#

Same command, exact same will sometimes trigger the parent command randomly

#

So I assume my arg splitter is messing up

tender shard
#

returns a PrimarySkillType

regal scaffold
#

It's this function that's messing it up

#

Gotta figure out why

dreamy vessel
tender shard
#

np

regal scaffold
#

@tender shard Not possible to debug methods using IntelliJ right?

#

Like not in a plugin

tender shard
#

you can do that

regal scaffold
#

Can I add breaks? Call a method manually with input? etc?

tender shard
#

yes, sure

#

but you gotta set the timeout interval very high, otherwise the server thinks it died

regal scaffold
#

Do you think that's my best solution to test out my method?

#

I just need to test the 1 method not anything else

tender shard
#

you could ofc just add a ton of debug messages lol

#

that's how I usually do it

regal scaffold
#

Problem is

#

My issue is inconsistent

tender shard
#

the intellij debugger if ofc extremely powerful, but it's a bit annoying to set it up

regal scaffold
#

Happens randomly which is why I'm losing my mind

sterile token
#

I finally ended the beta version, just need to test it

regal scaffold
#
        for (Command cmd : subCommands.keySet()) {
            final String name = cmd.name(), cmdName = commandName + (possibleArgs.length == 0 ? "" : "." + String.join(".", Arrays.copyOfRange(possibleArgs,                             0, name.split("\\.").length - 1)));

            if (name.equalsIgnoreCase(cmdName) || Stream.of(cmd.aliases()).anyMatch(commandName::equalsIgnoreCase)) {
                command = cmd;
                break;
            }
        }
regal scaffold
#

Narrowed it even more to ```java
final String name = cmd.name(), cmdName = commandName + (possibleArgs.length == 0 ? "" : "." + String.join(".", Arrays.copyOfRange(possibleArgs, 0, name.split("\.").length - 1)));

#

That's the line that's screwing up the args

tender shard
#

that line looks horrible lol

regal scaffold
#

Yes

#

I want to die

tender shard
#

split it up into more detailed steps

regal scaffold
#

Hmmm alr

tender shard
#

then always print out the "inbetween" result

regal scaffold
#

I'm straight out debugging

#

Only way I got to that

#
String.join(".", Arrays.copyOfRange(possibleArgs, 0, name.split("\\.").length - 1))

That line

#

That portion of the line

#

Is there a better way to join String array elements?

#

FIXED IT

#

Holy crap

#

I hate the dev that made that lib

#

4 hours

#

Copilot is cheating anyways

#

Perfectly mirrored method

rotund ravine
#

Yah copilot is nice

wet breach
regal scaffold
#

I was using a lib

#

Clearly not a very good one

#

But I was able to solve it now

wet breach
rotund ravine
#

Run the command as a console

#

That’d be funny

regal scaffold
#

It has checks

#

for that

rotund ravine
#

Must be somewhere else

regal scaffold
#
@Command(
            name = "example",
            aliases = {"firstAlias", "secondAlias"},
            permission = "example.permission",
            desc = "Sends an example message to sender",
            usage = "/example",
            min = 1,
            max = 5,
            cooldown = 10,
            senderType = Command.SenderType.CONSOLE
    )
#

All those

#

Optionals

rotund ravine
#

Ah

wet breach
#

Stringbuilder should probably be used for that code

regal scaffold
#

It's pretty cool tbh

#

Just had to fix that 1 bug

#

Took 4 hours

#

IntelliJ remote debugging

#

And a walk, but I got it

wet breach
#

At least you fixed it. Now time to optimize it

regal scaffold
#

Now fixing the autocomplete :/

#

Yeah I will

#

Gonna sort the autocomplete

#

Here we go again

#
    @Override
    public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull org.bukkit.command.Command command, @NotNull String label, String[] args) {
        plugin.getLogger().info("Completions: " + completions);
        for (Map.Entry<Completer, Map.Entry<Method, Object>> entry : completions.entrySet()) {
            final Completer completer = entry.getKey();

            if (command.getName().equalsIgnoreCase(completer.name()) || Stream.of(completer.aliases()).anyMatch(command.getName()::equalsIgnoreCase)) {
                try {
                    final Object instance = entry.getValue().getKey().invoke(entry.getValue().getValue(), new CommandArguments(sender, command, label, args));

                    return (List<String>) instance;
                } catch (IllegalAccessException | InvocationTargetException e) {
                    e.printStackTrace();
                }
            }
        }

        return null;
    }
#

Oh god

#

I found the autocomplete error :/

#

The ability to do the same thing 1012312313 different ways is both a bless and a curse

wet breach
# regal scaffold Yeah I will

Just fyi unless you are only doing join for one or two things. Stringbuilder is going to be the best in most cases

regal scaffold
#

Alright, appreciate it, I'll defo change it after I fix this

#

Suffer with me 🙂

rotund ravine
#

Isn’t*

regal scaffold
#

Jan help me figure out this death

rotund ravine
wet breach
#

Join will not do any extra copying and can work the exact length out. However its downside is having to check twice and ruining the cache for strings to do so. So if you have an array of strings better to use stringbuilder as that is what it is for.

#

Also its cleaner looking when using stringbuilder if you have a bunch of strings vs doing a bunch of joins everywhere lol

#

In terms of optimization join only wins if used minimally and stringbuilder wins in all other cases

regal scaffold
#

How to use string Builder to append a String[] with "." delimeter

#

@wet breach

#

Since you seem to be loving stringbuilder

ivory sleet
#

StringJoiner uses a StringBuilder under the hood

regal scaffold
#
        String fullCommand;
        if (args.length == 0) {
            new StringBuilder(command.getName()).append(" ").append(String.join(".", args)).toString();
        }
        fullCommand = new StringBuilder(command.getName()).append(".").append(String.join(".", args)).toString();

How would I simplify that block of code?

ivory sleet
#

What are you doing more precisely?

regal scaffold
#

I need to combine a string with a string[]

#

But if the string[] is 0 then I just need the original string1

#

Otherwise append all of string[] with "." delimeter

#
        String fullCommand = new StringBuilder(command.getName()).append(" ").append(String.join(".", args)).toString();
        if (args.length != 0) 
            fullCommand = new StringBuilder(command.getName()).append(".").append(String.join(".", args)).toString();
#

Still kinda long

ivory sleet
#

Couldnt you just

regal scaffold
#
        String fullCommand = command.getName();
        if (args.length != 0)
            fullCommand = new StringBuilder(command.getName()).append(".").append(String.join(".", args)).toString();
#

yes

ivory sleet
#

.append(args.length == 0 ? " " : ".")

regal scaffold
#

Hmmmm

ivory sleet
#

Which gets rid of you having 2 almost identical code blocks

regal scaffold
#

Wait I got a diff issue at hand now

wet breach
regal scaffold
#

How can I get the names of all players connected to a server into a List<String>

wet breach
#

From bungee or the server?

regal scaffold
#

Arrays.asList(Arrays.toString(Bukkit.getOnlinePlayers().toArray())) returns [CraftPlayer{name=TSans_}]

#

I just need a array of the names

#

Server

wet breach
#

Because there is bukkit.getOnlinePlayers

#

Which gives you an array

regal scaffold
#

I just said it returns [CraftPlayer{name=TSans_}]

#

How can I extract just the name

wet breach
#

You dont need toarray on a method that already returns an array

regal scaffold
#

Straight from the docs

wet breach
#

You are not doing anything that requires a snapshot. All you are doing is making a copy which you can use addAll from the arraylist interface

#

Anyways

#
for (Player player : bukkit.getOnlinePlayers()){
player.getName();
}```
regal scaffold
#

Seems a lot more complicated no?

#

If getOnlinePlayers() returns a collection

wet breach
#

It returns an array []

#

Which is already immutable

regal scaffold
#

So the only way is making a method then

#

Alr thanks

#
    private List<String> getOnlinePlayers() {
        List<String> players = new ArrayList<>();
        for (Player player : Bukkit.getOnlinePlayers()) {
            players.add(player.getName());
        }
        return players;
    }
#

Just did that

wet breach
#

You could make it simpler

rotund ravine
#

It did back in the day tho

wet breach
#

players.addAll(bukkit.getOnlinePlayers);
Just make players hold the player object. Then when you need to loop you can get the names and do some other stuff in the loop as well that you need done.

wet breach
rotund ravine
#

It’s a Collection<? extends Player>

wet breach
#

Not sure why that was changed but alright then

rotund ravine
wet breach
regal scaffold
#

Im getting an insanely weird error

#

It doesn't even show in logs

wet breach
#

Odd

regal scaffold
#

But my console is spamming

        at org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.callInventoryOpenEvent(CraftEventFactory.java:1226)
        at org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.callInventoryOpenEvent(CraftEventFactory.java:1221)
        at org.bukkit.craftbukkit.v1_19_R1.entity.CraftHumanEntity.openCustomInventory(CraftHumanEntity.java:322)
        at org.bukkit.craftbukkit.v1_19_R1.entity.CraftHumanEntity.openInventory(CraftHumanEntity.java:307)
        at me.tomisanhues2.deepstorage.gui.guis.BaseGui.open(BaseGui.java:493)
        at me.tomisanhues2.deepstorage.events1.ChestEvents.createNewGUI(ChestEvents.java:91)
        at me.tomisanhues2.deepstorage.events1.ChestEvents.lambda$openAddGUI$5(ChestEvents.java:117)
        at me.tomisanhues2.deepstorage.gui.guis.GuiListener.onGuiClose(GuiListener.java:143)
        at jdk.internal.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576)
        at org.bukkit.craftbukkit.v1_19_R1.event.CraftEventFactory.handleInventoryCloseEvent(CraftEventFactory.java:1384)```
#

I can't see it in latest.log

wet breach
#

Weird, unfortunately dont have time right this moment to help with that error. Will be home in about 6 hours though

regal scaffold
#

It

#

It's ok. thanks anyways

wet breach
#

Currently at work using my phone lol

#

So you know have some limitations

regal scaffold
#

Oh wait

#

@wet breach

#

InventoryCloseEvent

#

Isn't that only paper?

wet breach
#

No

#

That is in spigot

chrome beacon
#

?paste

undone axleBOT
regal scaffold
#

The developer fixed it

#

He knew about it

#

Must add at least 1 tick delay

#

Game limitation he said

#

What's the best way to detect if a player added a item to a chest?

#

Shift clicking it in or anything like that

wet breach
#

Inventory click event and checking inventory for changes

#

Nvm

#

Inventory click event detects shift click

#

Just get the clicktype and check for shift click

regal scaffold
#

Hold on pause that

wet breach
#

And then for normal way its just using inventory drag event

regal scaffold
#

How can I get a Chest object from InventoryClickEvent

wet breach
#

Get the inventory holder

#

Check if its a chest

#

Ok back to work for me

dreamy vessel
#

new to java:
Trying to set up a command that runs a scoreboard command whenever a player gains XP in a skill. it checks which skill, then runs the command. The problem is, if the scoreboard for the Mining Skill is already up, it still keeps trying to set it to Mining. can anyone help me fix up my code a bit so it will check to see what scoreboard is already running?

Code:
package slug.essentials.slugessentials;

import com.gmail.nossr50.datatypes.experience.XPGainReason;
import com.gmail.nossr50.datatypes.skills.PrimarySkillType;
import com.gmail.nossr50.datatypes.skills.interfaces.Skill;
import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent;
import com.gmail.nossr50.skills.mining.Mining;
import com.gmail.nossr50.util.player.UserManager;
import net.royawesome.jlibnoise.module.combiner.Min;
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.w3c.dom.Text;

import java.awt.*;
public class XpGainReader implements Listener {
@EventHandler
public void onXPGain(McMMOPlayerXpGainEvent e) throws InterruptedException {
Player player = e.getPlayer();
String name = e.getSkill().name();
if (name == "MINING") {
player.sendMessage("Skill: " + e.getSkill());
ConsoleCommandSender console = Bukkit.getServer().getConsoleSender();
String command = "usc setScoreboard %player% MINING";
command = command.replace("%player%", player.getName());
Bukkit.dispatchCommand(console, command);
Thread.sleep(4000);
String commandreset = "usc setScoreboard %player% SCOREBOARD";
commandreset = commandreset.replace("%player%", player.getName());
}
}
}

vestal nebula
#

Quickshop plugin is not working not working even if i do /qs there is nothing like quickshop why?

glossy venture
vestal nebula
glossy venture
#

thats the first problem i see

glossy venture
#

for plugin use/server help

vestal nebula
#

ok

#

where to use that cmd @glossy venture

glossy venture
#

?

vestal nebula
#

in help server?

glossy venture
#

yeah you just ask your question there, this is for plugin development

#

help server

vestal nebula
#

oh

tardy flame
#

Yo, is there any way to suggest player a command without their need to click text component?

dreamy vessel
tardy flame
#

?help

undone axleBOT
#
CafeBabe Help Menu
*Red V3*
**__Admin:__**

selfrole Add or remove a selfrole from yourself.

**__Cleanup:__**

cleanup Base command for deleting messages.

**__Core:__**

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

**__Downloader:__**

findcog Find which cog a command comes from.

**__Mod:__**

names Show previous names and nicknames of a member.
userinfo Show information about a member.

**__ModLog:__**

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

**__Permissions:__**

permissions Command permission management tools.

tardy flame
#

?deque

regal scaffold
#

Hey! I'm working on allowing upgrades for my plugin. For example:

MyClass.class
-> int maxNumber
-> Default at 10. {10,20,40,50,etc,etc}

Every tier would have a price associated with it.

#

How do I define a upgrade collection like that?

wet breach
#

?paste

undone axleBOT
wet breach
#

But preferably use the paste site

hybrid spoke
regal scaffold
#

So im wondering what's the best way to define those tiers

#

To then do like:
getNextTier.getPrice() etc etc etc

#

Is the best thing just to create a Map<Value, Price> as final static?

hybrid spoke
regal scaffold
#

I don't want infinite, I want to specify which ones and the cost

#

I'm just wondering if the best way to store this would be inside MyClass.class as a Map<Value, Price> as final static or enums or something else @hybrid spoke

#

Key/pair value

hybrid spoke
#

enums could work

#

but i think i would prefer the map

#

even if enums would be more clear

regal scaffold
#

Alright

#

Map it is

#

Now

#

Would you put it in the MyClass.class

hybrid spoke
#

what would MyClass be?

regal scaffold
#

Isn't that waste of resources? Cause everytime you create a MyClass.class object

#

It would create the upgradeList all over again

hybrid spoke
regal scaffold
#

When you say

#

Global map

hybrid spoke
#

static

regal scaffold
#

Oh so it doesn't make it again

#

ok cool

#

Gonna do that then

#

Now a more advanced question

#

I'll dm you a file rq

hybrid spoke
#

just sent it in here

#

?paste preferable

undone axleBOT
rotund ravine
#

Why are you storing 20 twice

regal scaffold
#

@hybrid spoke Rather not it's my custom file

#

But

#

Seeing that object

rotund ravine
#

We usually deny help in dms.

#

Or well i do.

warm light
#

I want to get the block where an item dropped.
which event will be good for this?
item physics or item spawn?

hybrid spoke
#

my bio says it all

regal scaffold
#

If I make a static map for each upgrade you see, since I don't actually need to serialize the static maps, do I still have to include all the data in my deserialize

rotund ravine
#

@warm light BlockBreakEvent.getDrops?

regal scaffold
#

I'm not asking for support in dms. I just prefer not to send my entire file here

rotund ravine
#

Afraid someone will steal it?

regal scaffold
#

Probably not guarantee anyone can do it better than I did

#

But I chose not to

regal scaffold
#

Didn't think it would matter that much

#

Alright well thanks for the help anyways ig

hybrid spoke
warm light
hybrid spoke
chrome beacon
#

if you only need block drops you can use BlockDropItemEvent

warm light
#

I did this to get to bottom block (where the item will be dropped)
but server get stuck :/

Location loc = item.getLocation();
Item item = event.getEntity();
  Block bottomBlock = loc.getBlock();
    while(bottomBlock.getType() == Material.AIR){
      bottomBlock = loc.getBlock();
    }
#

on ItemSpawnEvent

eternal oxide
#

you are getting the same block every time and locking the server

warm light
#

there is no spigot method to get the block. how can I get it?

rotund ravine
#

There is

#

Just don’t do a while

eternal oxide
#

getRelative

#

getRelative(BlockFace.DOWN)

warm light
#

if a player dropped a item, it will be on air first. then on ground

eternal oxide
#

you have to use teh blocks location not a fixed location

wet breach
warm light
tardy delta
#

Cant you raytrace?

rotund ravine
#

Don’g loop

chrome beacon
tardy delta
#

Damn station wifi sucks

chrome beacon
#

And spigot does have api methods to get the block

wet breach
hybrid spoke
echo basalt
#

I mean

#

you'd need to raycast, no?

#

what if you drop an item into the void

wet breach
#

Block block = item.getWorld().getBlockAt(item.getLocation().sub(0,1,0));
wet breach
hybrid spoke
echo basalt
#

after a while, yeah

#

hmm

#

what if it falls for like 5 blocks instead?

hybrid spoke
#

as of what i understood he's trying to get the block below on spawn

echo basalt
#

that's easy

#

I think he wants the lowest block on spawn

echo basalt
#

that's a bit more complicated

wet breach
hybrid spoke
#

then just brute force your way down

echo basalt
#

I'd just do a raycast down with a range of like y level

wet breach
#

Why? That is so much slower

echo basalt
#

ehh

#

checking a single block is not what he wants

#

getting the block below is 1 thing

#

getting the lowest is another

#

It's basically predicting where it's gonna land

#

but without actually any physics

wet breach
#

Ok make a loop to modify location y with the code i gave, toss all the blocks in an array

#

Doubt the item is going to have some insane velocities

#

Or fly off

hybrid spoke
#

let it bounce

warm light
wet breach
chrome beacon
#

and don't use a while loop on the main thread to wait

wet breach
#

Wont take but a few ticks for it to not have velocity unless you are spawning way up in the air lmao

hybrid spoke
#

why dont just iterate your way down to earth

#

that'd be way less than a tick

#

if its not spawned at 20000000 y

wet breach
hybrid spoke
#

thats what we all said

wet breach
#

You can just loop over the location modifing the y value of said location

warm light
#

umm. let me try

wet breach
#

But yeah solution is nothing complex

regal scaffold
#

How can I get a (Chest) object from InventoryClickEvent only when a custom chest is clicked

#

No can do

#

Chest chest = (Chest) event.getClickedInventory().getHolder();
error

Caused by: java.lang.ClassCastException: class me.tomisanhues2.deepstorage.gui.guis.Gui cannot be cast to class org.bukkit.block.Chest (me.tomisanhues2.deepstorage.gui.guis.Gui is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @310f378; org.bukkit.block.Chest is in unnamed module of loader java.net.URLClassLoader @46ee7fe8)
        at me.tomisanhues2.deepstorage.events1.ChestEvents.withdrawItem(ChestEvents.java:146) ~[?:?]
        at me.tomisanhues2.deepstorage.events1.ChestEvents.lambda$addItemList$4(ChestEvents.java:133) ~[?:?]
        at me.tomisanhues2.deepstorage.gui.guis.GuiListener.onGuiClick(GuiListener.java:102) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-api-1.19.2-R0.1-SNAPSHOT.jar:?]
eternal night
#

Presumably you use a custom inventory holder there ?

regal scaffold
#

TriumphGUI

eternal night
#

Well yea so you are fucked

#

¯_(ツ)_/¯

regal scaffold
#

But idk why that would prevent me from getting it from InventoryClickEvent since the api just adds addAction()

eternal night
#

there is no chest there

wet breach
eternal night
#

its a custom inventory

regal scaffold
#

Yeah I know what you mean

#

hmmm

wet breach
#

But if a chest doesnt actually exist. Then i dont see the purpose of getting a chest

regal scaffold
#

Gotta just pass the chest object around ig

wet breach
#

A physical chest is not required to do stuff with a chest inventory

regal scaffold
#

For what I'm doing it is

#

But I got it

#

Works perfectly!

wet breach
regal scaffold
#

The data is stored in the chest

#

pdc

#

It's not a command thing, it's a physical chest

wet breach
#

You could just use the chunks at spawn and use the chunk pdc.

#

This way you dont need physical chests or add them

regal scaffold
#

Was easier to just have a physical chest

eternal night
#

or just attach the PDC instance to the custom gui 🤔

#

you can get the live instance iirc

#

actually, idk if that is spigot or not

regal scaffold
#

Now we talking to complicated

wet breach
#

Its not anymore complex then what you are already doing

regal scaffold
#

Really?

#

Didn't know that

#

But I gotta be honest I'm really really happy with how it's turning out\

wet breach
#

Anyways if its working like you want it then so be it though. Its your plugin lol

regal scaffold
#

After a lot of hours of figuring stuff out

crimson terrace
#

using a physical item has good properties aswell. you can easily transfer them between players without commands etc.

wet breach
crimson terrace
#

unless its for each player their own storage

wet breach
#

You can share the inventory view with multiple players in that case

regal scaffold
#

Yes!

#

I even made a thing where the chest has a list of UUID

#

So you can add allowed players to the chest

wet breach
#

But still doesnt require a physical chest

#

But like i said it is your pluging. So if it works the way you want then who are we to complain lol

frank kettle
#

does ProjectileSource only return entities?

#

i want to know if the projectilesource is a dispenser but seems like the list is just entities

#

not just arrows

crimson terrace
frank kettle
#

im trying to now make firecharges not work basically

#

but just not work if it's from a Source in a different chunk

#

so trying to check where the source is

frank kettle
#

oh amazing

#

i fcking read the soruces and didnt see that

#

saw like 5 lines of just entities

crimson terrace
#

yeah i had to look really hard too

frank kettle
#

you're the man

regal scaffold
#

How can I get the value of the key from a Map<String,String>

#

Hard coded

crimson terrace
#

Map#get(String key)

frank kettle
#

map.get(key)?

regal scaffold
#

nono

crimson terrace
#

yesyes

regal scaffold
#

Oh wrong phrasing

frank kettle
#

how to get the key of a value u mean then?

regal scaffold
#

How can I get the key value of index 0

crimson terrace
#

map.entryset i think

#

and then iterate over that

regal scaffold
#

That returns a big thing

#

Oh

#

No easier way

crimson terrace
#

dont think so

regal scaffold
#

Hmmmm should've used enums...

#

Sht

rotund ravine
#

.entryset.get(0)

regal scaffold
#

How can I convert ```java
public static final Map<Integer, Double> MAX_ALLOWED_ITEMSTACKS_UPGRADES = new HashMap<>() {{
put(1000, 1.0);
put(5000, 2.0);
put(10000, 3.0);
put(50000, 4.0);
}};

#

Oh nvm defo using that instead

wet breach
eternal night
#

☠️ people creating anonymous subclasses of hashmaps

frank kettle
#

is there a recommended max of an array/hashmap size before it "starts lagging"(affecting ticks)? 🤔

rotund ravine
#

Not really

crimson terrace
frank kettle
#

I'm afraid some of my hashmaps will get really big at some point

regal scaffold
frank kettle
eternal night
#

A map does not have an order

regal scaffold
eternal night
#

or well, a hash map does not

regal scaffold
#

Yeah I know that

rotund ravine
#

Meh it’s a set so that’s why

crimson terrace
eternal night
#

so the concept of an "index" is useless

rotund ravine
#

A hashmap is not sorted

wet breach
regal scaffold
#

That's why I need to change it

#

But I don't know how to use enums in that way

wet breach
#

Believe that should work

rotund ravine
#

Well not the one i did.

wet breach
#

On phone so cant really check lol

frank kettle
wet breach
frank kettle
#

i thought it would be better for server performance

rotund ravine
#

@wet breach It’d probably be jumbled up unless he sorts it

wet breach
crimson terrace
frank kettle
#

atm this one hashmap has 120 in size. but it will always increase ofc... 🤔

frank kettle
rotund ravine
#

It’s probably fine

frank kettle
#

just thought a hashmap would be more efficient than changing the yml all the time

rotund ravine
#

Though don’t make it too big

wet breach
#

I would use expiring cache from guava that is shaded in

crimson terrace
frank kettle
#

never used sqlite, only mysql or ymls

crimson terrace
#

not too much difference tbh

wet breach
#

Lets you setup save and load methods and cache takes care of the rest

frank kettle
#

anyone has a good spigot thread tutorial on how to do it?

crimson terrace
hybrid spoke
#

?bing

undone axleBOT
wet breach
#

This way your map is never too large

frank kettle
hybrid spoke
#

how should the map be too large

#

just hold the chunk keys in there and invalidate on unload

#

and boom

frank kettle
#

server currently:

#

doesn't seem too bad yet to care much about it

#

since it can go up like 20x that

wet breach
# hybrid spoke how should the map be too large

Not sure where the threshold is at. But you put enough objects in the map and it starts to lose its speed and can take time to fetch what you are wanting. Also no reason to keep stuff loaded if it is hardly being used.

#

So an expiring cache from guava which is shaded into spigot already would help with that because you can set when and how it expires as well as set what the save and load methods should be

eternal night
#

doesn't even guava recommend caffeine these days

wet breach
#

Have no idea and dont know what that is

eternal night
#

pretty damn good caching library

wet breach
#

Well so is guava

#

Depends what you need

eternal night
#

I guess concerning guava is shipped

#

might be the better pick

#

ye

wet breach
frank kettle
#

is there an event when chunks are loaded/deloaded?

frank kettle
#

maybe i can use that to store/delete chunks from my hashmap, no point having chunks there if they are not loaded

wet breach
#

Chunkloadevent and chunkunloadevent

frank kettle
#

oh ok ty, i will keep it in mind for the future then

eternal night
#

yes

#

the javadocs literally tell you to use caffeine xD

wet breach
#

Maybe that might be a decent pr to do for spigot

#

Swap out guava for caffeine

eternal night
#

I don't think spigot shades guava for the caching

#

guava offers other stuff

wet breach
#

Well weak hashmap stuff and what not

eternal night
#

ye, so I don't think you can replace guava

#

maybe ship caffeine ?

#

but also, just shade it / use library feature

wet breach
#

Maybe we can see if we can get caffeine shaded in then? Lol

#

Would be better then having a bunch of projects having to shade it. Considering guava is EOL it seems like

eternal night
#

guava is EOL ?

#

o.O

wet breach
#

After java 7 support ends

#

It is what it said

#

So whenever that happens guava is EOL unless they change that lol

#
Consider Caffeine for Caching to Replace Guava After EOL of Java 7 Support```
eternal night
#

I don't think guava goes EOL

#

maybe the caching shit ?

#

already lol

wet breach
#

That could be it? Maybe they might remove the caching from guava?

eternal night
#

maybe

#

¯_(ツ)_/¯

#

when does java 7 go EOL

#

it already is kekw

#

summer of 2022

wet breach
#

Is that true for enterprise support?

#

Typically that is what is usually referred to with these kinds of projects

wet breach
#

Sustaining support?

#

Lol

eternal night
#

no idea xD

wet breach
#

Anyways enterprise was up 6 months ago

#

So fairly recent then

#

So that comment lines up just right as it was posted in 2021

eternal night
#

yea, if you just use it for caching I guess its just a nice switch to make

wet breach
#

So i guess we could create ticket for spigot in regards to guava caching being eol then. But first need to do some more information gathering

frank kettle
#

So I've turned off dispenser projectiles on the entity damage entities event from different chunk owners.

But now I want to make it so people can't use fireballs to put other chunks on fire and this isn't a entityDamageEntity event. Which event could I use for this?

eternal night
#

I wonder if the API uses caching anywhere

wet breach
#

Not sure, but regardless worth letting everyone know who isnt aware

eternal night
#

true I guess 😅 at least raising it to md_5, tho I'd guess he knows

eternal night
#

¯_(ツ)_/¯

wet breach
#

I didnt even know about it

eternal night
#

who knows what information makes it to upside down land

wet breach
#

But yeah worth letting people know and the fact that bug hasnt been fixed

#

With the caching eol they are not going to fix any other bugs found

#

But before i make a ticket i want to gather more information on it to see to what extent

#

Dont want to raise any alarms if not necessary lol

earnest prawn
#

Is there a way to make PlayerItemMendEvent consume the XP but not repair the tool?

wet breach
#

Now i wont recommend it anymore lol

eternal night
eternal night
wet breach
earnest prawn
#

Alright. Thought there would be a built in way to do that

rotund ravine
#

By take he means remove or kill

wet breach
#

They wont notice the difference

rotund ravine
#

Nvm it’s a mend event

#

Not pickup xp

wet breach
rotund ravine
wet breach
#

Just dont use the methods to change anything and use the other api methods

#

And with that i am signing off and going home

atomic violet
#

is there a way to get the coordinates at 4, 4 in any given chunk?

wet breach
#

Lynx has got you on this

eternal night
#

you can convert a chunk x to an in world location using x << 4

#

same of z

#

xD

#

I was getting ready for the typewriter race

wet breach
#

Unfortunately i am getting ready to clock out from work

wet breach
#

And then driving home

#

Though might have to explain bitshifiting to them

atomic violet
eternal night
#

well it doesn't get you the location at all

atomic violet
#

alright cause i’m confused how you get a chunk x

eternal night
#

it gives you the chunks x and z key

#

Chunk#getX()

atomic violet
#

so what exactly is that number that it returns

#

a range?

eternal night
#

it returns the x key of the chunk

#

chunks are uniquely identified by a combination of their x and z key

atomic violet
#

oh wait

#

yeah i know what you mean now

eternal night
#

the first and third number on the chunk there

atomic violet
#

yeah it took me a sec lmao

hybrid spoke
wet breach
grizzled oasis
#

Someone knows an Framwork thats works with spigot and velocity?

hybrid spoke
#

and if you have enough chunks loaded to overclock the keys you have other problems than that

hybrid spoke
wet breach
#

No that isnt possible after a certain amount since there isnt infinite time

eternal night
#

O(1) also does not particularly mean you are going to be fast 😅

hybrid spoke
#

sure, and precisely said it isnt O(1), but near to O(1)

#

nearer than to O(n)

#

so fuck the size of the map

eternal night
#

I mean yea, if you have a shit load of values your map is going to be faster on average than a list iteration (in trade of for more memory needed)

wet breach
#

Alright driving home now uwu

white root
# eternal night O(1) also does not particularly mean you are going to be fast 😅

Could be worth a watch 👀
https://www.youtube.com/watch?v=o4-zpAI7qBc

Have you ever analyzed your algorithm and found out that it runs in O(n^2) and thought to yourself, "man I'm a crappy programmer...". Well, you are! But not for the reasons you think! If you think Big Oh = performance, boy have I got news for you. In this video I try to dispel this fallacy that programmers have assumed, that Big Oh complexity eq...

▶ Play video
river oracle
#

This video was awesome

white root
#

agree

hybrid spoke
#

got it

white root
#

12 iq interpretation, but you do you

vale ember
#

why is player still receiving damage from lightning even when i cancel EntityDamageEvent?

hybrid spoke
#

we can only guess

#

provide some code

hybrid spoke
vale ember
#
        event.setCancelled(event.getCause() == EntityDamageEvent.DamageCause.LIGHTNING
                && PersistentDataWrapper.wrap(plugin, event.getEntity()).check("storm", true));

I checked via logging, both conditions are true

white root
#

to make it more readable, you could do this instead ```java
Boolean isSourceLightning = event.getCause() == EntityDamageEvent.DamageCause.LIGHTNING
Boolean isSomethingStorm = PersistentDataWrapper.wrap(plugin, event.getEntity()).check("storm", true) //I literally have no idea what this is, sorry
event.setCancelled(isSourceLightning && isSomethingStorm)

hybrid spoke
#

so you gotta handle that too

hybrid spoke
white root
#

Its psudo code written on mobile and I use :kotlin: anyway 🤷

#

but yeah

vale ember
#

When i use setdamage 0 instead it works, weird

white root
#

then just do that instead :dogekek:

frank kettle
#

I've tried entitydeathevent or entityexplodevent and fireball does not call either of them 🤔 wouldn't a fireball when touching a block "die"?

#

also tried entityinteract but fireballs doesnt call it either 🤔

hybrid spoke
#

since fireball is an projectile

frank kettle
#

holy

#

you're the man

primal goblet
#
public static Location stringToLocation(String string) {
        // x, y, z, yaw, pitch, world
        if(string == null) return null;
        String[] alg = string.replaceAll(" ", "").split(",");
        if(alg.length < 6) return null;
        World world = Bukkit.getWorld(alg[5]);
        world = world == null ? Bukkit.createWorld(new WorldCreator(alg[5])) : world;
        return new Location(
                world,
                Double.parseDouble(alg[0]),
                Double.parseDouble(alg[1]),
                Double.parseDouble(alg[2]),
                Float.parseFloat(alg[3]),
                Float.parseFloat(alg[4])
        );
    }
public static void safeTeleport(Player player, Location location) {
        if(location == null || player == null || !player.isOnline()) return;

        new BukkitRunnable() {
            @Override
            public void run() {
                player.teleport(location);
            }
        }.runTaskLater(Main.getPlugin(Main.class), 4L);
    }

this code often teleporting to void i'm sure for the values but why he's teleporting me to the void or a survival world? am i doing something wrong?

frank kettle
#

i was trying every entity event

#

didnt know projectiles had their own events

#

tyty

hybrid spoke
warm mica
#

Empty lines is lava

primal goblet
hybrid spoke
#

void could mean the unloaded world is still loadng or you fucked up the parameters

warm mica
#

Check where you are using the location instance and look what could possibly cause that

primal goblet
#

@warm mica @hybrid spoke i tried both the survival is unloaded world yep, but the void i checked the parameters and every things is fine someone told me that i have to put the teleport function in the main thread and i didn't understand am i doing something wrong?

hybrid spoke
#

as once again, debug your code. we dont know what you enter in there. validate the parameters and give us a log

#

you could also check your console for exceptions

primal goblet
#

uhmm i'm gonna debug and see what will happen 🥲

lethal knoll
#

Anyone currently using the serialize /deserialize method for ItemStack ? Are they working property? Containing all data?

#

I used a custom serializer before, considering going to use the serialize method of spigot

rotund ravine
#

They work.

lethal knoll
#

Alright

#

All I needed to know, thnx

remote swallow
#

its not very readable/change-able but they do save everything

lethal knoll
#

Yeah, but having a readable format where all data from the IS included would be tricky anyway

frank kettle
lethal knoll
#

And it's only to store data 🙂

lethal knoll
#

@remote swallow , I mean, if you want a properly serialized & deserialized value, you would need everything the IS has

remote swallow
lethal knoll
#

There is not really something you would leave behind

frank kettle
#

code on cancelling:

event.getEntity().remove();
event.setCancelled(true);
Bukkit.broadcastMessage("supposed to be cancelled");```

i set to remove entity since just cancelling event wasn't doing anything so I deleted entity and put to send a message as "debug" but still it gets on fire 🤔
lethal knoll
#

Yeaa, I use something simular at the moment

#

But still

#

If something is changing in the future to the IS format, it would break anyway

remote swallow
#

i had to make this on another project and it was just painful

lethal knoll
#

I can imagine

remote swallow
#

so i just started to make this so i never have to do it again

lethal knoll
#

I don't recall why I never went with the serialize and deserialize before tbh

#

Maybe it wasn't a thing back then

drowsy hamlet
#

Hey, how would you guys go about writing a plugin that will generate a biome in every new chunk loaded?

lethal knoll
#

It's an old project tbh

remote swallow
#

if its to a FIleConfiguration you can just use config.set("path", stack) and config.getItemStack("path")

lethal knoll
#

Oh there is getItemStack on the config? didn't knew that

remote swallow
#

yeah

#

same for location

lethal knoll
#

Well, I'm using jackson now also to serialize and deserialize

#

But having a map would help alot

#

Because Idk what jackson will try to do with the IS class :p

remote swallow
#

lol

lethal knoll
#

Interesting

#

But those didn't exist before I assume, because otherwise dumb me

misty current
#

can you visually rename variables in compiled read only classes using intellij?

#

not actually change the file, just edit them visually so they are easier to read when reverse engineering

foggy holly
#

yo

#

can someone help me

frank kettle
#

with what

foggy holly
#

idk about sqlite

#

how can i use it

crimson terrace
foggy holly
#

ye ye

#

tho idk

molten hearth
#

ye ye well read

foggy holly
#

tho dont works

molten hearth
#

What error do you get

foggy holly
#

dont works

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.

molten hearth
#

Show your code

#

?paste

undone axleBOT
foggy holly
#

id elete the code

#

because i was not workng

molten hearth
#

BROTHA

wet breach
#

?spoon

undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

wet breach
#

probably came here in hopes someone would give code, especially seeing they deleted the code they needed but had issues

misty current
#

can you visually rename variables in compiled read only classes using intellij?
not actually change the file, just edit them visually so they are easier to read when reverse engineering

wet breach
# foggy holly because i was not workng

not sure what you hoped we would do for you, however this isn't a place where we just drum up some code for you to use. In other words we are not going to do the work for you. The goal of here is to help you with already created code to point out the error or to help you understand where it is that it is going wrong so that you can fix it in hopes it works like are wanting. We do love to help people, just not do their work for them is all 🙂

wet breach
#

no worries, give it another try, do a bit of research to attempt to get it working, if all else fails instead of deleting what you have come back here and show us, and tell us what you have tried to do. Then we will be in a better to position to help you and odds are you will learn better from it as well 🙂

foggy holly
#

fine ty

kind hatch
#

Hey @wet breach, I finally managed to fix the connection leaks with Hikari. Turns out I'm just stupid. I had a global Connection instance at the core of my implementation and turns out I wasn't closing it. 🥹

tardy delta
#

i thought from the beginning are you closing your connection lol

kind hatch
#

I did too. :3

#

I'm now trying to figure out how to store a list of data into a table, but almost every thread relating to it seems to be against that idea. The problem is, I don't know what a better approach would be. I need what is essentially a Map<UUID, List<UUID>> stored. I'm trying to keep track of unique interactions.

tardy delta
#

dont you mean a map

kind hatch
#

Oops, I do.

tardy delta
#

ig work with foreign keys to link to records in another table?

#

atleast thats what i remember from classes

quaint mantle
#

uh

#

i forgor how to do this

#

and i cant find any new tutorials

#

but how do you make like a /kit command

#

and give the p the item

kind hatch
#

Yea, I'd have to use foreign keys anyways. In this case it would be the uuid as the key and the table value would be the List<UUID>, but it seems that it isn't the best idea.

quaint mantle
#

i forgot how item stacking works

wet breach
wet breach
#

Lol all good, at least you fixed it

#

did you ever try BoneCP?

#

I would probably still use that

kind hatch
#

No, I was just so fixated on getting hikari to work. I'll give it a try on another project since this was such a hassle. However, I'm just glad it was an issue with my code and not the library.

#

I have used it in the past, but like ~2 years ago in the past. It's just that people recommended to switch to hikari, so I finally decided to give it a try when I actually needed to make a MySQL implementation.

wet breach
#

and then the recommendation turned out to be hard to implement because it couldn't tell you there was something wrong

#

all it knew was just that there is a connection leaking somewhere randomly XD

quaint mantle
#

whats the item stack thingy on setting an items name

kind hatch
#

ItemMeta#setDisplayName()

quaint mantle
#

yeah no

#

thats not a thing

kind hatch
#

org.bukkit.inventory.meta.ItemMeta is most definitely a thing.

quaint mantle
#

oh

rotund ravine
#

?google

undone axleBOT
quaint mantle
#

I need a help

kind hatch
#

?ask

undone axleBOT
#

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

#

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!

quaint mantle
#

i did

#

its just im a lil stupid

rotund ravine
#

No

quaint mantle
#

huh

#

wdym

foggy holly
#

yo

#

java.sql.SQLException: path to 'plugins\SQLite\table_name.db': 'C:\Users\USER\Desktop\Mc Server\1.12.2 2\plugins\SQLite' does not exist

#

😿

quaint mantle
#

probably means it doesn't exist pal

#

and if it doesnt exist

#

then you need to create it

foggy holly
#

ik

#

tho idk what to do

quaint mantle
#

me neither

#

im still working on itemstack

#

very confusing

humble tulip
#

@quaint mantle getItemMeta returns a copy

#

It doesn't return the item meta actually associated with the itemstack

#

So you need to get it

#

Like ItemMeta meta = Item getItemMeta;

#

Then make all your cjanges to meta

#

Then do Item.setItemMeta(meta)

quaint mantle
#

i googled it

#

and added line 1 and 4

#

this should work tho right?

foggy holly
#
java.sql.SQLException: path to 'plugins\SQLite\table_name.db': 'C:\Users\USER\Desktop\Mc Server\1.12.2 2\plugins\SQLite' does not exist

doesnt that create the folder automatically?

#

what can i do

humble tulip
#

That should work yes

foggy holly
#

im newbie

quaint mantle
humble tulip
foggy holly
#
package code.main;

import org.bukkit.plugin.java.JavaPlugin;
import code.database.Database;
import code.database.SQLite;

public final class Main extends JavaPlugin {

    private Database db;

    @Override
    public void onEnable(){
        this.db = new SQLite(this);
        this.db.load();
        System.out.println("Plugin started");
    }

    public Database getRDatabase() {
        return this.db;
    }


    @Override
    public void onDisable() {
    }
}
#

its the normal

#

database/
Database
Error
Errors
SQLite

tardy delta
#

oh god new Sqlite

foggy holly
#

😿

#

im newbie

tardy delta
#

theres nothing useful in that code

#

show sqlite.load or smth

restive mango
#

I’d like to search all inventories on a server for an item, anyone know how to do that?

primal goblet
foggy holly
tardy delta
#

?paste

undone axleBOT
kind hatch
#

?img

undone axleBOT
foggy holly
#

true

kind hatch
#

You didn't finish your sentence.

#

I assumed picture.

foggy holly
tardy delta
#

that site broken sometimes

foggy holly
tardy delta
#

uh the issue was with the file right

#

not being created or smth

foggy holly
#

ye

tardy delta
#

use new File(getDataFolder(), "database.db").createNewFile() if it doesnt already exist

#

i usually do this where ensureFileExists creates it if it wasnt already created

foggy holly
#

yikes

#

Cannot resolve method 'getDataFolder' in 'SQLite'

tardy delta
#

need a plugin instance to call that on

foggy holly
#

a

chrome beacon
#

If you're new to Java working with SQLite might not be the best idea

tardy delta
#

i hope they know sql

chrome beacon
#

Doubt

tardy delta
#

just use the yaml stuff at that point

foggy holly
#

brh

quaint mantle
#

er

#

basic stuff

#

how do i register a command -_-

rotund ravine
#

?cmd

tardy delta
#

getCommand(name).setExcutor() in main class

rotund ravine
#

?commands

#

Sigh

#

?google

undone axleBOT
tardy delta
#

get rekt

#

atleast not bing

kind hatch
#

?bing

undone axleBOT
quaint mantle
tardy delta
#

instance of CommandExecutor impl

#

check the docs

quaint mantle
#

ok

#

i figured it out

#

i watched a yt video

#

but the itemmeta did not work

#

bruh

#

like the name and enchants are just not there

tardy delta
#

getItemMeta returns a copy you can modify

#

and then you need to put it back on the item

quaint mantle
#

i did .setitemmeta

#
            kpph.addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 1);
            kpph.getItemMeta().setDisplayName("KitPvp Helmet");
            kpph.setItemMeta(kpphItemMeta);```
#

ooop i dunno why its like that

rotund ravine
#

?cba

undone axleBOT
#

Jan Tuck#0142 definitely regrets to for the most part inform you that unfortunately, they essentially are unable to definitely assist with definitely your enquiry, which essentially is fairly significant. Please simply really ask again later or possibly kind of ask someone else about this enquiry, demonstrating that the person that ran this command generally regrets to kind of inform you that unfortunately, they for the most part are unable to generally assist with actually your enquiry in a subtle way. Thank you very sort of much for kind of your time and the person that ran this command specifically wishes you a really good day, so the person that ran this command really regrets to actually inform you that unfortunately, they literally are unable to definitely assist with very your enquiry, or so they particularly thought.

quaint mantle
#

????

#

lmfao

tardy delta
#

kpph.getItemMeta().setDisplayName("KitPvp Helmet"); does exaclty nothing

quaint mantle
#

wait so then how do you do it?

tardy delta
#

you have an itemmeta var

#

use that

quaint mantle
#

oh

#

wait so then do i just apply it on the var

#

or the item itself

rotund ravine
#

?learnjava

undone axleBOT
glossy venture
quaint mantle
#

ok

#

also

#

one last basic thing ish

#

how do you add color to a text

tardy delta
#

ChatColor.WHATEVER + text

quaint mantle
#

oh its chatcolor

#

i did color

#

ty

tardy delta
#

or use the color codes (like &c) in a string and use ChatColor.translateAlternateColors('&', text) to colorize it

livid dove
#

So my ender dragon is dead

#

cannot spawn due to MV

#

but

#

boss bar is still there

tardy delta
#

mv?

livid dove
#

any funni code I can do to cheat the system and remove the bugger

#

multiverse plugin

#

its not spawned by design

rotund ravine
#

I mean you can just not send the bossbar, but it seems weird.

quaint mantle
#

lesss go

#

i got the names working

#

now i need to figure out why enchants arent

quaint mantle
#

me

#

im best dev

#

trust

#

i just spent the last 3 hours

#

figuring our

#

item meta & stack

#

worth it but sucks

#

i should probably learn java

#

but oh well

remote swallow
#

i knew it

#

you dont know java

quaint mantle
#

lmfao

foggy holly
#

yo

#

then

#

who can help me

#

😿

remote swallow
#

you have to create the table yourself

#

or the folder

quaint mantle
#

i legit told him this

foggy holly
remote swallow
#

it shouldnt

tardy delta
#

you need to setup the file and the tables

remote swallow
#
private void createDataFolder() {
        if (!getDataFolder().exists()) {
            getDataFolder().mkdirs();
        }
    }```
harsh badge
#

?bin

#

?pastebin

remote swallow
#

?paste

undone axleBOT
harsh badge
sterile token
harsh badge
#

Sorry

remote swallow
harsh badge
#

I have asked but they just close the ticket

#

The plugin works for my friends but not for me

hasty prawn
#

Well it's a problem in their plugin it seems like. Just make sure you're using the right version.

sterile token
#

Maybe You are using a not an update client

#

Check if You have latest lunar launcher

remote swallow
#

its a server error not caused by client

foggy holly
hardy quartz
#

some experienced java dev for hire?

remote swallow
#

?services

undone axleBOT
hardy quartz
#

tks

quaint mantle
quaint mantle
#

no no

#

im better

#

im worth a bajillion an hour

#

faster then chat gpt

#

trust

remote swallow
#

write an itembuilder

quaint mantle
#

?cba

undone axleBOT
#

Mission#0001 definitely regrets to for the most part inform you that unfortunately, they essentially are unable to definitely assist with definitely your enquiry, which essentially is fairly significant. Please simply really ask again later or possibly kind of ask someone else about this enquiry, demonstrating that the person that ran this command generally regrets to kind of inform you that unfortunately, they for the most part are unable to generally assist with actually your enquiry in a subtle way. Thank you very sort of much for kind of your time and the person that ran this command specifically wishes you a really good day, so the person that ran this command really regrets to actually inform you that unfortunately, they literally are unable to definitely assist with very your enquiry, or so they particularly thought.

remote swallow
#

so you arent the best dev

#

wont even show off ur "skill"

quaint mantle
#

cuz im 2 gid

remote swallow
#

doubt

livid dove
hasty prawn
#

?? KEKW

#

Why bother to have a support server if everyone who asks questions gets kicked

tardy delta
#

sounds like enginehub support

#

got kicked a few times and then banned cuz 'oh no youre not the person who has to help, we'll do that'

#

bunch of idiots

livid dove
#

Legit on the edge of finding alternatives

#

to all their plugins as frankly the exposure is a bit

kind hatch
#

FAWE?

livid dove
#

i dont feel right

#

using em

#

Cause ngl it does seem this entire community is full of folk who are like "the plugin gets the job done, who cares if the devs are not nice"

#

Engineer irl myself and tbh i dont like the idea of supporting customer unfriendly folk

hasty prawn
#

Yeah it's unfortunate that some really good plugins are made by complete dicks lol

livid dove
hasty prawn
#

Well just because it's really good doesn't mean that it can't be improved upon

#

Even if they dev thinks they've made the perfect plugin lol

livid dove
#

Yeah I get you but on the other foot, even looking at some of the API's you sorta have to go "This is held together with popsicles and pritstick under the hood isnt it?"

#

lmao

hasty prawn
remote swallow
#

brits be like

hasty prawn
#

If you tell them that their backend API is trash thats when they'll really get defensive

livid dove
#

Like i love the lands plugin, it does the job fantastically and is ong amazing

#

but lets say hypothetically one looked under the hood

#

an decompiled

#

hypothetically of course

kind hatch
#

Isn't Lands open source?

livid dove
#

The one you pay to use? Unlesss im an utter goob and missed it no

#

Why do i feel this bout to become a leanring day lmao

kind hatch
#

Huh, I thought it was. Wonder what I'm confusing it with.

livid dove
#

Either way

#

lets say hypothetically you are right and it was accesisble to view

#

as lovely

#

nice looking in game it is

#

and all in all based plugin

#

lets say hypothetically you'd realise its held together with dreams, tears and the souls of 1000 people who nest if statements every weekend

hasty prawn
#

and they do ```java
if
{
System.out.println("This garbage");
}

tardy delta
#

get garbage collected

remote swallow
#

System,gc

hasty prawn
#

I call System.gc after every statement just to make sure my memory is perfectly allocated

foggy holly
#

guuuuys

#
        if (!dataFolder.exists()){
            try {
                dataFolder.createNewFile();
            } catch (IOException e) {
                plugin.getLogger().log(Level.SEVERE, "File write error: "+dbname+".db");
            }
        }
#

dont works

tardy delta
#

define dont works

foggy holly
#

dont works

tardy delta
#

is that a folder or a file

foggy holly
#

[11:16:45 ERROR]: [SQLite] File write error: table_name.db
[11:16:45 ERROR]: [SQLite] SQLite exception on initialize
java.sql.SQLException: path to 'plugins\SQLite\table_name.db': 'C:\Users\USER\Desktop\Mc Server\1.12.2 2\plugins\SQLite' does not exist

foggy holly
tardy delta
#

and where does the file needs to be?

foggy holly
#

plugins

tardy delta
#

dont call it folder then

foggy holly
#

?

remote swallow
#

is your plugin called SQLite

foggy holly
#

ye

#

xd

#

its for test

tardy delta
#

whats the value of that file object?

foggy holly
#

its literral ythis

tardy delta
#

bruh

foggy holly
#

why dont works

tardy delta
#

how does that path not exist

foggy holly
#

idk

bold crane
#

Just wondering how I would go by doing a command that only works with a user specified so like idk for example. (Username) has permissions then it continues the command but then if its not that user exacuting the command false

tardy delta
#

well returning false show the usage message so you probably want return true

#

you could check if player.hasPermission("something.here") or check the players username

sterile token
bold crane
#

alright thank you

tardy delta
tardy delta
#

im thinking that about people sometimes 💀

tender shard
#

i never remember, is there a way to map the actual enchantment names to the "well known" ones and vice versa? e.g. "DAMAGE_ALL" <> Sharpness

frank kettle
#

is there a way to remove all of certain "code" from a file? I was using JDA for discord bot on main plugin but changed. and this added import org.jetbrains.annotations.NotNull; to all of my commands.... and now i removed it so all of my command classes have errors.

Is there a quick way to remove every @NotNull from a class or has to be 1 by 1?