#help-development

1 messages · Page 438 of 1

icy beacon
#

roxy might've been confused because your "your pom should look like this" only has the jar plugin

tender shard
icy beacon
#

at this point probably should use your pom generator

#

send it

tender shard
icy beacon
#

you had like a website where you could pick stuff and it'd generate the pom

tender shard
#

that's long dead, this is the successor

icy beacon
#

oh damn

#

kk

#

gonna star it

tender shard
#

I'm also doing an IntelliJ plugin for it

#

but IJ plugins are a pain

icy beacon
#

oh yeah i remember you complaining about bad docs

#

haha

tender shard
#

IJ being stupid again

ocean hollow
#
          start loop(wait 6 seconds and after that do smth);
}
else{
          cancel loops for block;
}``` Hi guys, how can I make logic for starting loop and disabling it
warm mica
green falcon
#

is there a way to get BuildTools to fully decompile all of NMS with spigot patches applied?

ocean hollow
#

I know it's a spigot. I roughly described the logic, how I want to implement it

heavy mural
#

Hey, I currently have an entity as passenger of a player.
Is there a way to remove/kill the entity uppon disconnect of a player?
I've tried to "getpassengers()" uppon playerQuitEvent, but it seems like the passengers are already not a passenger anymore (list is empty) when that event fires.

The passenger entity just remains on the ground when the player disconnects, instead of being removed.

tender shard
#

as you see, it also builds successfully, maven understands it. just IJ doesnt understand it

ocean hollow
#

I can save task number. The problem is only with the creation of the loop. Bukkit.getScheduler().scheduleSyncRepeatingTask(this, () -> { @Override public void run() { runTaskLater(this new Runnable() {...}, 120L) } }, 0L, 120L) so I need to make this?

tardy delta
#

use runtaskTimer

#

and a lambda instead of your weird runnable

sacred scaffold
#

Someone send me a 652000 hour course of java

#

Thanks

ocean hollow
zealous thistle
pseudo hazel
#

no they are dead serious

#

i mean ofcourse its a joke, he just wants to learn some java, quite extensively

green falcon
timber oar
#

hey ive been having a problem for the past few days which would be that i cannot figure it out why my custom event wont fire. also something weird is that the code after the call line doesnt execute.

calling event

PlayerUtils.soundToAll(Sound.BLOCK_NOTE_BLOCK_PLING);
PlayerUtils.messageToAll(config.getString("prefix") + "§aThe Hunger Games have started! Good luck!");
HandlerList list = GameStartedEvent.getHandlerList();
JavaPlugin.getPlugin(PixliesHungergames.class).getLogger().log(Level.SEVERE, list.toString()); //works up to here
Bukkit.getPluginManager().callEvent(new GameStartedEvent());
JavaPlugin.getPlugin(PixliesHungergames.class).getLogger().log(Level.SEVERE, "test"); //doesnt print

event itself

public class GameStartedEvent extends Event implements Cancellable {
    private static final HandlerList handlers = new HandlerList();
    private boolean isCancelled;
    public static HandlerList getHandlerList() {
        return handlers;
    }
    @Override
    public @NotNull HandlerList getHandlers() {
        return handlers;
    }
    public boolean isCancelled() {
        return this.isCancelled;
    }

    public void setCancelled(boolean isCancelled) {
        this.isCancelled = isCancelled;
    }
}

listener

public class onGameStart implements Listener {
    
    @EventHandler
    public void startEvent(GameStartedEvent e){
        JavaPlugin.getPlugin(PixliesHungergames.class).getLogger().info("Starting Hunger Games");//doesnt print
      ...
  }
}

registering listener in main

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

i can also send the link to the project(pretty small) if it would help

rotund ravine
#

Does the server freeze?

timber oar
#

no

rotund ravine
#

Send me your compiled jar

eternal oxide
#

link to project. Nothing you have posted is wrong

timber oar
timber oar
rotund ravine
#

You're doing quite a few things wrong.

#

But the event logic seems fine.

timber oar
#

i know that the scheduler is bad, thats not my code ill fix it later after ive figured out why the event doesnt work

rotund ravine
#

What does the console output when it starts?

timber oar
#

[19:09:11 ERROR]: [PixliesHungergames] org.bukkit.event.HandlerList@bbc6230

#

thats it

rotund ravine
#

Do handerList.getRegisteredListeners and loop over each.

#

then print them

#

instead of printing the handlerlist

icy beacon
#

totally not spending 1.5 minutes to compile, 15 seconds to send the file to the server and 40 seconds to restart to debug one fucking event

#

gods spare me

timber oar
#
 RegisteredListener{plugin="PixliesHungergames", listener="org.pixlies.pixlieshungergames.listeners.onGameStart@54215e5c", executor="TimedEventExecutor['ASMEventExecutor['public void org.pixlies.pixlieshungergames.listeners.onGameStart.startEvent(org.pixlies.pixlieshungergames.events.GameStartedEvent)']']", priority="NORMAL (2)", ignoringCancelled=false}
icy beacon
fluid river
#

Bukkit#broadcastMessage()

#

that's strange

#

the code looks fine

#

idk what can be wrong

timber oar
#

cus the idea was to not send it to all players on the server but i havent done that yet so thats a placeholder

fluid river
#

mc/java/core version?

#

@timber oar

#

1.19.4/17/spigot?

timber oar
#

server and client on 1.19.3
jre 19.0.2
jdk corretto 17.0.6

icy beacon
#

no way, fast compile time

#

i'm about to eject white liquid

remote swallow
#

Maven L

icy beacon
#

lmao

#

i know nothing about gradle

#

but i'm open to new experiences

#

for example this is my third project in kotlin

#

and my first comm in kotlin

#

so maybe someday it'll be gradle

#

though gradle loading times are fucking crazy slow

winged anvil
#

I'm looking if you guys know of an algorithm I can use to figure this out. I'm making claim zones where players can only claim in these zones. I want to maximize the amount of claims I can fit in a zone. This is an example with a claim size of 1 chunk, where there can't be another claim within its 1 chunk border inside a 7x7 zone where this would be the most optimal claim layout. https://gyazo.com/a1c0b5cc8e92a786399aba9b2bd6930f

fluid river
icy beacon
#

ily ❤️

fluid river
#

❤️

fluid river
icy beacon
#

new antirecord

fluid river
#

))

icy beacon
#

i can't stand this

fluid river
#

how huge is the project?

#

sheit

icy beacon
#

not even that big

#

my laptop just sucks ass tbh

#

i mean it's fairly large but not THIS large

fluid river
icy beacon
#

i want to get back to my pc

#

this is unbearable

#

my pc would do this in like 15-25 secs

fluid river
#

disgusting

icy beacon
#

agree

fluid river
#

isnt there some shit for testing without starting a server

icy beacon
#

mockbukkit

fluid river
#

MockBukkit or how was it called

#

ye why don't you try it

icy beacon
#

i use mockbukkit in my main project

#

but here the tests would have to be way too detailed

#

i don't feel like doing that

#

i mean actually i could

#

but t oo late

fluid river
#

tlauncher be like 3mins for 200mb

toxic lion
#

is their an alternative to storing value in config that dont reset after server restart?

fluid river
#

pdc

#

database

#

which value are u saving

toxic lion
#

Location value

icy beacon
#

i just yoinked my sister's laptop to open the browser and minecraft there

#

to decrease the overload on my main laptop

#

now i have 2 laptops and it looks absolutely fucking comical

fluid river
#

you can store it on chunk's pdc

toxic lion
#

yes im making /setspawn command

fluid river
#

oh

#

why not just move spawn loc to config

green falcon
#

is there a way to use non-obfuscated spigot in production?

chrome beacon
#

but why?

toxic lion
# fluid river why not just move spawn loc to config

like i tried that already
i pulled location with
Location location = ```p.getLocation();

plugin.getConfig().set("spawn", location);``` But when i already have things in the config it doesnt work for somereason

#

like i already stored a prefix: string in the config and now the spawn location doesnt save

chrome beacon
#

Did you save the config?

fluid river
#

show your config code lol

#

it shouldn't work like this

toxic lion
#
player-!online: "&fThat player is currently not online."

flight-enabled: "&fSuccesfully &eDenabled &fflight mode."
flight-disabled: "&fSuccesfully &edisabled &fflight mode."

spawn:

#

the reset fo the stuff all works fine

icy beacon
#

why is there a ! in the name

#

does that work

toxic lion
#

the spawn stuff work too but when you restart server it wipes

fluid river
#

saveConfig()

icy beacon
#

looks like something that yaml would yell at you for

toxic lion
fluid river
#

might actually work

tender shard
eternal oxide
#

if your config is wiping you are accessing the config too early, before you save your default config.

fluid river
#

if your config is wiping, your hands should be fixed 🙂

quaint mantle
#

One message removed from a suspended account.

eternal oxide
#

delete .getType()

quaint mantle
#

One message removed from a suspended account.

icy beacon
#

yay 2x faster

eternal oxide
#

this is an enum not a field potionType

quaint mantle
#

One message removed from a suspended account.

#

One message removed from a suspended account.

tender shard
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

eternal oxide
#

P not p

tender shard
#

get verified, then you can send screenshots

quaint mantle
#

One message removed from a suspended account.

eternal oxide
#

?img

undone axleBOT
fluid river
tender shard
quaint mantle
#

One message removed from a suspended account.

fluid river
#

@timber oar

#
public class GameStateChangeEvent extends Event implements Cancellable {

    private static final HandlerList handlers = new HandlerList();
    private boolean cancelled;
    private GameState state;
    
    public GameStateChangeEvent(GameState newState) {
        state = newState;
    }

    public HandlerList getHandlers() {
        return handlers;
    }

    public static HandlerList getHandlerList() {
        return handlers;
    }

    public boolean isCancelled() {
        return cancelled;
    }

    public void setCancelled(boolean cancelled) {
        this.cancelled = cancelled;
    }

    public GameState getNewState() {
        return state;
    }

}```
quaint mantle
#

One message removed from a suspended account.

undone axleBOT
#

A private message has been sent to your SpigotMC.org account for verification!

fluid river
#
public class GameStateChangeListener implements Listener {
    
    @EventHandler
    public void onGameStateChange(GameStateChangeEvent event) {
        Bukkit.broadcastMessage(paint("&aHoly shit!"));
    }
    
    @EventHandler
    public void onJoin(PlayerJoinEvent event) {
        Bukkit.getPluginManager().callEvent(new GameStateChangeEvent(GameState.CREATED));
    }

}```
#
public class EtalonGame extends JavaPlugin {
    
    public void onEnable() {
        getServer().getPluginManager().registerEvents(new GameStateChangeListener(), this);
        send("&aPlugin enabled!");
    }

    private void send(String text) {
        getServer().getConsoleSender().sendMessage("[EtalonGame] " + paint(text));
    }

}```
eternal oxide
#

I like the naming of paint

fluid river
#

😉

#
import net.md_5.bungee.api.ChatColor;

public class Painter {
    
    public static String paint(String text) {
        return ChatColor.translateAlternateColorCodes('&', text);
    }

}```
#

basically

quaint mantle
#

One message removed from a suspended account.

quaint mantle
#

One message removed from a suspended account.

fluid river
#

why don't you just code yourself

agile anvil
#

Hello, it has been a long time I haven't played with minecraft. I want to update my pure NMS plugin using reflection for 1.19.4. But it seems that the PacketPlayOutMetadata constructor has changed (it was before (int id, DataWatcher watcher, boolean) but now it's (int id, List<DataWatcher.b>))
Any idea on how to get a DataWatcher$b instance from DataWatcher ?

delicate lynx
#

well... you're writing effectType as a function

quaint mantle
quaint mantle
tender shard
#

?switchmappings

tender shard
#

Check out both

quaint mantle
fluid river
#

item.getType().toString().endsWith("_SWORD");

#

ez i erased like 2 lines of code

quaint mantle
#

One message removed from a suspended account.

eternal oxide
quaint mantle
#

One message removed from a suspended account.

eternal oxide
#

Not my fault you have other errors too

agile anvil
# tender shard Check out both

Thanks, I know I should do that but I'm rn too lazy to change my whole code (I used to just check manually the mappings x)). However since it's a parameter change is it still related to mappings ?

quaint mantle
tender shard
fluid river
#

item.getType().toString().endsWith("_SWORD") && item.getType() != Material.GOLDEN_SWORD;

tender shard
fluid river
#

or ^

quaint mantle
#

One message removed from a suspended account.

tender shard
#
    private static Set<Material> SWORDS_EXCEPT_GOLD = new HashSet<>();

    static {
        Arrays.stream(Material.values()).filter(mat -> mat.name().endsWith("_SWORD") && mat != Material.GOLDEN_SWORD).forEach(SWORDS_EXCEPT_GOLD::add);
    }
    
    public static boolean isSwordButNotGoldSword(ItemStack item) {
        return SWORDS_EXCEPT_GOLD.contains(item.getType());
    }
fluid river
#

anyways just erase the line with PotionEffrectType = ... and arrow.setItem()

tender shard
#

I'd do it like this

quaint mantle
#

One message removed from a suspended account.

fluid river
#

remove your if

#

for now

#

paste the entire code somewhere outside of the method

tender shard
#

Looks like chatgpt wrote that o0

quaint mantle
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

tender shard
#

Yikes gpt should learn to use methods

fluid river
#

and then make a new if

if (!SWORDS_EXCEPT_GOLD.contains(item.getType()) { /*item is not a valid sword*/ return;};
rotund ravine
#

Iamgine

fluid river
#

I am gine

#

Youarenot

tender shard
#

everyone's gine

quaint mantle
#

One message removed from a suspended account.

fluid river
#

except JanTuck obviously

tender shard
#

he's a volvo

fluid river
#

shit

tender shard
#

or a scania

#

who knows

fluid river
#

Opel GL

quaint mantle
#

One message removed from a suspended account.

#

One message removed from a suspended account.

tender shard
#

Chat GTS

#

Chat GTS Coupe

rotund ravine
#

Imagine obviously

#

I am just too fast.

toxic lion
#

@fluid river when i save config:

            plugin.saveConfig();```
it just completely wipes the rest of the stuff thats in their, do i also have to set that stuff again?
quaint mantle
fluid river
#

Ford Mustang GC

tender shard
rotund ravine
fluid river
toxic lion
quaint mantle
#

One message removed from a suspended account.

fluid river
#

and also you shouldn't modify the config by hand while the server is on

agile anvil
# tender shard Maybe show your current code, and tell us which version it was originally for. I...

The code is too complex but here are the main parts :
NB: Last version was 1.19

// 1.19
PacketPlayOutEntityMetadataConstructor = PacketPlayOutEntityMetadata.getConstructor(int.class, DataWatcher, boolean.class);
// 1.19.4
PacketPlayOutEntityMetadataConstructor = PacketPlayOutEntityMetadata.getConstructor(int.class, List.class);

And here is how I construct it (PS: the getDataWatcher method is correct, I checked the mappings and the return object is yet a DataWatcher instance)

// 1.19
packet = ReflectionCache.PacketPlayOutEntityMetadataConstructor.newInstance(id, ReflectionCache.getDataWatcher.invoke(entity), true);
// 1.19.4
packet = ReflectionCache.PacketPlayOutEntityMetadataConstructor.newInstance(id, Collections.singletonList(ReflectionCache.getDataWatcher.invoke(entity)));

Now I get a cast issue error (cause I give a list of DataWatcher but it requires a DataWatcher$b instance).

 class net.minecraft.network.syncher.DataWatcher cannot be cast to class net.minecraft.network.syncher.DataWatcher$b

Which is normal cause this is how look the new constructor (1.19.4) :

public PacketPlayOutEntityMetadata(int id, List<DataWatcher.b<?>> list)

Any idea on how I could get this DataWatcher b instance ?

toxic lion
rotund ravine
fluid river
#

just pre-save a config base version in your jar

rotund ravine
#

How are you loading and using the config.

#

I can't tell by your very little amount of code.

toxic lion
#

do you need me to provide all of it?

fluid river
toxic lion
#

sure

fluid river
#

one sec

#

dm me

tender shard
#

this is mojang maps

#

(you should be using mojang maps)

fluid river
tender shard
#

you can translate it back to obfuscated mappings:

#

?switchmappings

tender shard
#

but remember that the methods will have a different name in every version, so reflection won't work cross-version

#

easiest way is to setup mojang maps

timber oar
fluid river
#

well the code i sent above works perfectly

timber oar
fluid river
#

You don't need gamestate lol

timber oar
#

ill try calling it from somewhere else, maybe thats it

agile anvil
fluid river
#

and the saveConfig basically erases config contents

#

might be a bug of 1.17.1

eternal oxide
#

its not, show code

timber oar
#

ok it actually works if i call it from somewhere else... now im even more confused

fluid river
#

guess guy's hosting has some problems

#

he is using some random free one

agile anvil
# tender shard Np!

Oh and last quick question : I just read both articles, and it seems that I have to compile my plugin for each version. Am I right? And if yes, is there a way to do it multi-version compatible without using a thirdpart lib like PLib?

vocal cloud
#

You'll only need to compile for versions where things change. It's not all versions usually

pure copper
#

Is it possible to set the gameTime value with packets to a player?
By gameTime I mean worldAge, if so, could someone clue me in, please?

timber oar
fluid river
#

can you call me so we can both look at the code

timber oar
fluid river
#

dm

#

streams are not available on spigotmc

#

hi morice

#

jree fava lessons

tardy delta
#

give me free C++ lessons

vivid skiff
#

How can i hide a player nametag an another player?

eternal oxide
#

teams

vivid skiff
zenith crescent
#

Hey guys! Im having a little bit of an issue. This could very well be a client side issue as i know iv seen it done before. What im trying to do is update the title of a gui (Currently, its just a timer but i have plans to use this for another feature). I have it working, my only issue is the PacketPlayOutOpenWindow removes all items in the inventory causing a super annoying flicker every second. Any ideas to work around this?

fluid river
#

and called the event from it

tender shard
fluid river
#

so he messed up the task watchers work ig

#

we just tried several solutions(runTask, switching to bukkit scheduler) and they worked

rotund ravine
#

Didn’t think much of it

eternal oxide
#

yeah SnakeYaml isn't thread safe

rare rover
#

anyone know how would i get the connection of the player in 1.19.4 it seems like they've changed it?

terse ore
#

One Java question, I am reading some code and makes a variable private and then uses geters for accessing it, should I do it like this instead of making the variable public?

eternal oxide
rare rover
#

;-;

#

so how would i send a packet?

tender shard
eternal oxide
#

good point too

rare rover
#

OH WHOOPS

#

lmfao

eternal oxide
#

connection.connection is private now

rare rover
#

there we go

#

lmao

tender shard
#

the ServerGamePacketListenerImpl is still public, and that's enough to send packets

#

but yeah, the COnnection field of that is now private

young knoll
#

Anyone happen to have experience making NMS patches

rotund ravine
#

It’s easy

tender shard
#

isn't it explained in the ?contribute thing?

rotund ravine
#

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

young knoll
#

Yes

#

But when I run makePatches it just immediately closes and does nothing

#

And I can't read any error, because it immediately closes

rotund ravine
#

Run it from a terminal

young knoll
#

I've tried running it from command prompt and powershell

remote swallow
#

how

young knoll
#

It opens a new window, and then closes

rotund ravine
#

Open your cmd

remote swallow
#

iirc its bash filename.sh

rotund ravine
#

Navigate to the folder

#

And run the bat with ./…bat

remote swallow
#

its a .sh so wouldnt you need the bash

tender shard
#

you gotta pass the work dir to buildtools

#
sh applyPatches.sh /path/to/buildtools/work/215721952167591265
#

sth like that

#

it's explained in the craftbukkit or spigot repo in the README

#

and in ?contribute

young knoll
#

There we go

#

Still would be nice if the window didn't just peace out if you did it wrong

#

Thanks

tender shard
young knoll
#

Running it from command line didn't help

rotund ravine
young knoll
#

Guh

tender shard
#
./applyPatches.sh /c/mctest/buildtools/work/decompile-00fabbe5/
#

then it should print a ton of stuff like this

Patching net/minecraft/advancements/Advancement.java < net/minecraft/advancements/Advancement.patch
(Stripping trailing CRs from patch; use --binary to disable.)
patching file net/minecraft/advancements/Advancement.java
Hunk #1 succeeded at 39 (offset -2 lines).

...
twilit roost
#

how can I convert HH:mm:ss to Date?

tender shard
#

first you run applyPatches, then you do your changes, then you run makePatches

rotund ravine
undone axleBOT
tender shard
#

gnoogle

rotund ravine
#

?bing

undone axleBOT
tender shard
#

mcgooglegal

#

from harry potter

young knoll
#

?duckduckgo

young knoll
#

?ddg

#

Sad

tender shard
#

?dumbledore

#

?doubledoor

remote swallow
#

?ecosia

undone axleBOT
young knoll
#

The fuck is an ecosia

remote swallow
#

tree thingi think

young knoll
#

Sounds like a plant

rotund ravine
#

?Yagoo

#

?yahoo

undone axleBOT
tender shard
young knoll
#

Oh good she can search stuff for me

livid dove
#

So I'm trying to wrap my head around why custom potions can cause a lot of lag if they include colour gradient lore (e.g an inventory of brews wkth custom gradiented lore is bad ju ju)

tender shard
#

yeah, if she's not currently watering something, she can google stuff for you

rotund ravine
#

Probably not

young knoll
#

I mean gradients mean the packets for the item will be a lot bigger

rotund ravine
#

It’ll probably be fine

livid dove
#

Well server I play on uses brewery plugin and it has literally been (a few shilkers of these brews are essentially lag machines)

tender shard
#

i remember selling books of poems about sausages on a minecraft server back in the days, people paid good money for those poems

icy beacon
#

I've been using ecosia for like 2 months now and it's surprisingly not bad

fluid river
livid dove
#

With custom brews

young knoll
#

Well they use jitpack

#

But I don't think that is a relevant flaw

livid dove
#

Ooft

remote swallow
#

it uses slimefun

#

immediately downgraded

livid dove
#

Lmaooo

sullen marlin
#

Nom Nom Nom

young knoll
#

Speaking of slime

#

It's the orange slime

livid dove
#

But legit I'm trying to see if it's the code itself or some minwcraft flaw with custom pots. Seems like one of those where if the plugin falls flat on its arse during the first fight with 50+ players

#

Then seems a bit naff

#

As said the thing lags tf out with just a shulker or 2 of drinks

sullen marlin
#

Client or server

livid dove
#

Server

sullen marlin
#

Sounds a little surprising

#

But if it really is that bad a quick profile should catch it

livid dove
#

Oh no they know it's the issue. I'm here as someone learning more about nbt to know why its sufh a huge issue

#

I.e. is it nbt itself or is it how this chucklecluck has coded it in

sullen marlin
#

Oh plugin issue

young knoll
#

chucklecluck

livid dove
#

🤣

sullen marlin
#

Profiler will quickly pinpoint it still

livid dove
#

Tis true. Its one of those where apparently its nbt gradients?

#

Always wondered if id looked at this right? Whats the big "wtf" thing on here?

sullen marlin
#

Can't you send a link or something

rotund ravine
#

He can

livid dove
#

Didnt want it up for too long for obvs reasons

worldly ingot
#

idk what those reasons would be

tardy delta
rotund ravine
#

They’re made to be shared

young knoll
#

He uses purpur

#

Get him!

rotund ravine
#

Quite a lot of ram.

livid dove
remote swallow
#

how many is quite a lot

rotund ravine
#

48G

remote swallow
#

ah thats nothing

tender shard
#

48GB is barely enough to run IJ with the minecraft dev plugin

remote swallow
#

i run it on like 4

round finch
remote swallow
#

i only lag if i open the material enum

livid dove
#

legit tho was there any hints as wtf is goin on lol

rotund ravine
#

It is to be expected with that amount of players on one server though

round finch
#

1 sec

#

anyone who can kindly help me out with this problem

#

my guess is it is a ghost item

rough drift
#
player.playSound(player, Sound.BLOCK_NOTE_BLOCK_PLING, SoundCategory.MASTER, 1, 0.5f);
System.out.println("Running!");
```doesn't seem to play any sound (1.19.4, this code is indeed running as the print statement runs)
worldly ingot
#

Do you have your sounds turned down? ;p

rough drift
#

Nope

#

Everything is at max

#

Wait... it plays?

#

I am so confused lmao

wet breach
#

looking at one or two images of what you think it is, doesn't help

#

when you are the one asking for help on it

rotund ravine
#

Think i read that somewhere in here

worldly ingot
#

Some effects have sounds but that's always been the case

#

You can still play sounds independently from effects ;p

round finch
#

?paste

undone axleBOT
round finch
#

here is a cleaner version

tardy delta
#

HEEHEE

#

took me 10 minutes to write a for loop 🥹

quaint mantle
young knoll
rustic hedge
#

I am not 100% sure where to ask this it is sorta development help , I was just wondering if anyone knew a place where I could find like 1-2 people that would be willing to help me test a Spigot Plugin I am working on. I would not say its complex but it does have some depth to it.

#

If anyone here is willing to help feel free to DM me for more details

wet breach
rustic hedge
quaint mantle
#

is this the best palce to save my system msg in different languages?

wet breach
#

or create a spigot thread

rustic hedge
#

fair point my bad this is my first proper plugin and I have like no idea what im doing outside of coding lol

granite burrow
#

Is it possible to not send certain people a death message? I can't seem to find a way in the documentation.

The only way I found to prevent players from getting a death message is by using a game rule or by removing the message all together, however, both options are not favorable

young knoll
#

Remove the message and then manually send it to the players you do want to see it

granite burrow
#

The only issue with that way of doing it is that it breaks support for other plugins like DiscordSRV

late swallow
#

Hey I don't have a ton of experience with Java so I might be misunderstanding something, but I'm getting a NullPointerException whenever either of these goals try to use any methods from the bind "variable" they are passed. The TFTZombie class is able to access the methods just fine so why is the bind being passed as null to the goals?

hazy parrot
#

can you show how are you initializing TFTZombie

late swallow
#

To avoid using NMS more than necessary I'm only using the TFTZombie for spawning a zombie with custom pathfinders. It is spawned from the createEntity method in the ZombiePiece class that handles all of the other important operations

#

but the nms class needs to be able to access some methods from the pure bukkit one so it is passed a copy of it to keep access

hazy parrot
#

can you show your npe stacktrace, because i can't really see how bind can be null there

late swallow
#

I'm sorry I'm not exactly sure what that means, do you mean like the server error?

hazy parrot
#

yap

late swallow
#

this is the stacktrace from literally just trying to call the println method in the constructor

hazy parrot
#

can you show TFTNearestTarget.java:25

late swallow
#

its called latch in this one but its the exact same thing as bind I just forgot to change it

hazy parrot
#

You would have to do some debugging, you can use intellij debugger and track that bind variable, i don't see anything wrong here

#

probably someone other will find problem

late swallow
#

alright thanks for the help anyways

#

can the intellij debugger run with the minecraft server?

#

ohp I found the article nvm we good

frozen thorn
#

Hi, I have a problem, I use PersistentDataContainer, and when I save a value in the metadata of an item, it works but when I reconnect I see that there is one nbt tag less and there is no longer the information I stored there

verbal slate
#

Hey! How to make a color TabCompleter?

young knoll
#

You have to hook brigadier

#

Luckperms uses a custom library for it

verbal slate
#

oh, okay

#

thank you

wet breach
#

Your issue is that latch is null that is being passed into the constructor and in that class you also dont initialize latch so its automatically null. If you set a null with a null its still null

wet breach
rare rover
#

hmm, what would be the best way of calculating the amount of blocks within 2 locations?

#

gotta loop every block ofc

#

could just do it async ig

#

amount of air blocks*

#

my bad

#

just wanting the best performance possible

late swallow
#

So there was probably a way to make it more concise or function better but Im not well versed enough to know that

wet breach
#

Abstract classes cant be instantiated directly

late swallow
#

yeah which is why I think I'm going to try to move away from that implementation because it seems really poor and overcomplicated lol

#

not abstract classes in general just the way I was trying to use it

wet breach
#

Probably wise, since it doesnt appear that is what you want to do anyways and should look into using interfaces instead

#

Still need to implement the base interface everthing extends from but still gives you the ability of casting if that is what you need and associating classes with each other

late swallow
#

Im still using that part

#

but I dont think the nms entities need to have access to it

#

I was mainly using it to store extra stats that minecraft mobs don't usually have (crit chance, mana, stuff like that) but I think storing them in nbt would be easier

wet breach
#

Does it need to be persistent?

late swallow
#

especially because for my purposes the data will be cleared at restart anyways

#

no

#

its for a minigame type thing

wet breach
#

Then create a wrapper class around the entity to add extra info to the object

late swallow
#

Ive been using this

#

is that a bad way to do it?

vernal oasis
#

Is there a 'default' block/item list for the TabCompleter?

wet breach
#

That makes the data persistent which you said you dont need

vernal oasis
#

like how the /give command has all the minecraft:acacia_button stuff?

late swallow
#

I don't need it, is there a way thats easier?

young knoll
#

No but you can make one fairly quickly

wet breach
#

Instead make a class that takes the entity as a parameter and thus have a custom entity object to add the info you want. Toss that object in a list or hashmap

#

That is essentially the basis of a wrapper

late swallow
#

will the pathfinders and such be able to access that though?

#

It needs to be able to be changed on the fly

wet breach
#

Dont see why it wouldnt be able to

#

Anyways got work to do lol. Hope that helped in figuring out your null issue as well come up with an alternative solution

late swallow
#

thanks for your help!

halcyon citrus
#

how do i save a variable to a player and also call it?

young knoll
#

Do you want to save it across restarts

halcyon citrus
#

yeah

young knoll
#

If it’s just one variable you can probably shove it in PDC

#

Depending on what it is

halcyon citrus
#

ive seen some plugins use .csv files

#

im just not sure how they work

young knoll
#

I guess you could do that

#

But json or yml is probably easier

halcyon citrus
#

ah

#

how do they work though?

young knoll
#

They are just plaintext with fancy formatting

#

Spigot has an api for yml, and also includes gson which is an api for json

halcyon citrus
#

ah

#

how would the code look for it?

halcyon citrus
#

sick, thanks

#

that actually doesn't seem too bad lol

versed canyon
tender shard
#
    private List<String> blockNames = Arrays.stream(Material.values()).filter(Material::isBlock).map(Material::name).collect(Collectors.toList());
    
    @Nullable
    @Override
    public List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, @NotNull String[] args) {
        return blockNames;
    }
vernal oasis
#

I already got a solution for it, thanks thought

tender shard
#

oki, I hope you're not using Material.values() everytime

#

because that's quite slow, it creates a new huge array everytime

vernal oasis
#

nah just something entirely different lmao

tender shard
#

oki

vernal oasis
#

How does the hex work with ChatColor?

#

Bungee Cord one has the capability to do that, right?

rare rover
#

would streams be good here? I have a hard time picking between for loops or streams

public static boolean isPlayerGenerator(UUID uuid, Location location) {
        if (!playerGenerators.containsKey(uuid))
            return false;
        
        Location generator = playerGenerators.get(uuid).stream()
                .map(PlayerGenerator::getLocation)
                .filter(location1 -> location1 == location)
                .findFirst()
                .orElse(null);
        
        return generator != null;
    }```
#

or

public static boolean isPlayerGenerator(UUID uuid, Location location) {
        if (!playerGenerators.containsKey(uuid))
            return false;

        PlayerGenerator generator = playerGenerators.get(uuid).stream()
                .filter(playerGenerator -> playerGenerator.getLocation() == location)
                .findFirst()
                .orElse(null);

        return generator != null;
    }```
#

idk man

vernal oasis
#

does ChatColor.translateAlternateColorCodes not work for hex?

rare rover
vernal oasis
#

yea?

vernal oasis
eternal oxide
#

import md5 chatcolor not bukkit

rare rover
#

&

vernal oasis
#

it is

rare rover
#

^

vernal oasis
#

& is the char

rare rover
#

there's 2 different ones

vernal oasis
#

using bungee cord

rare rover
#

use mine

vernal oasis
#

huh

rare rover
#

cant do that

#

that would be &x&a&a&d&s&s&q for a hex

rare rover
#

i needa know

eternal oxide
#

You are instance comparing location. Probably not going to go down well

#

your code is asking if they are the same Location object

#

same memory address

rare rover
#

okay...

#

so what do i do

#

.equals?

eternal oxide
#

also locations values are doubles so unless created VERY carefully they can fail an equals check

rare rover
#

hm

eternal oxide
#

how are your locations being created?

rare rover
#

i haven't coded that yet but it'll be a block

#

since a generator = block

eternal oxide
#

ok if it's a Block location you should be ok with .equals

rare rover
#

okay

#

which one should i pick?

#

there's 2 different streams

#

or use for loop?

#

i have a hard time choosing

eternal oxide
#

the first is the better use of a stream

rare rover
#

okay, thanks

eternal oxide
#

but not really much difference

vernal oasis
sharp storm
#

Is there some method in the spigot or bukkit api that returns the server type
eg: Spigot, Bukkit, Paper, etc

Bukkit.getServer().getVersion() is kinda what i need but it has the server version and git and other stuff.

I just want the server name

tender shard
#

isRunningSpigot() would return true on spigot and all forks
same for isRunningPaper()

sharp storm
#

ok thanks

halcyon citrus
#

how do i make my own placeholder to use in config?

#

like if i use %player% in the config it would automatically convert to the player's username

tender shard
halcyon citrus
#

sick, thanks

tender shard
#

gotta read the full page, not just the part I sent, maven information etc is at the top

halcyon citrus
tender shard
#
String myString = getConfig().getString("join-message"); // Imagine it's "%player% joined the server"
String myReplacedString = PlaceholderAPI.setPlaceholders(somePlayer, myString);
torn shuttle
#

ok so I might be wrong but I think slimes literally have no pathfinding

#

it looks like they're hardcoded to jump and pray

halcyon citrus
tender shard
#

wdym how does it work?

torn shuttle
#

what a peculiar issue

halcyon citrus
#

like the (somePlayer, myString)

tender shard
#

it's a normal method call?

tender shard
#

but yeah they just go into the exact direction, not trying to avoid obstacles

halcyon citrus
#

yes, but what does somePlayer mean

tender shard
#

it is any player object

#

the one that you want to apply the placeholders for

torn shuttle
tender shard
#
Player mfnalex = Bukkit.getPlayer("mfnalex");
String joined = PlaceholderAPI.setPlaceholders(mfnalex, "The player's name is %player%");

this would obviously print "the player's name is mfnalex"

torn shuttle
#

they probably couldn't find their way out of a chuck-e-cheese maze that would be given to @echo basalt to shut him up for 5 minutes

tender shard
#

i only know chuck-e-cheese from parks & rec

#

damn it now I gotta check who streams parks & rec

graceful oak
#

When i package using maven how do I stop it from creating the original and snapshot files and just make it override the actual plugin file that is there so I dont have 3 copies?
https://i.thick.at/wxc3H4HU.png

solar mauve
#

hey there

#

is 9 am here

#

and we are losing players because of server is down

#

i need to know the answer to that question really quick

#

but now, i put the exact dependency on maven to compile my other project with it

#

and its just giving me this garbage error, im raging, HELP

sullen marlin
#

Well what is the error

solar mauve
#
Unsupported class file major version 61
eternal oxide
#

wrong java version

solar mauve
#

but, it works with gralde

eternal oxide
#

?paste the full error

undone axleBOT
rare rover
#

would there be a way around this?

ItemStack itemStack = GeneratorHandler.getGeneratorItemStack(block.getType());
            ItemStack itemInhand = e.getItemInHand().clone();
            itemInhand.setAmount(1);
            if (itemInhand != itemStack)
                return;```
#

without doing setAmount?

solar mauve
eternal oxide
#

its not, the full stack trace error

solar mauve
#

ok

sullen marlin
rare rover
#

so i can just do item == item1 instead of setting amount

#

it just looks ugly

sullen marlin
rare rover
#

since they both need to be the same amount

eternal oxide
#

you wan to compare? if (itemInHand.isSimilar(itemStack))

rare rover
#

O

#

ty

graceful oak
# sullen marlin Idk if you can get rid of original, but shaded is something in your pom. What's ...

I Just want to be able to package and have it replace the files that are there instead of making the others. When I package the first time I get 1 file. Then if I package without removing that first one it makes the original. Then if I package without removing either it makes the snapshot and eventually it makes me package 2x to actually get the changes I made to my plugin so I have to go in and delete all 3 files

sullen marlin
#

Post the pom

#

Good idea to always use mvn clean install anyway

eternal oxide
#

clean package, unless you really want them all in your local repo

sullen marlin
#

True

#

My local repo is filled with like 8 years of junk

eternal oxide
#

same 🙂

graceful oak
sullen marlin
#

Update maven shade version to support version of java used by mongo

solar mauve
#

ok, lemme try

sullen marlin
#

Actually be careful with that

solar mauve
sullen marlin
#

Honestly pinning outputDirectory is just messy and prevents anyone else building your plugin

#

I think @tender shard has a blog post

#

But I would leave as is and symlink the plugin in your server dir

tardy delta
rough drift
#

PlayerInventory.addItem adds to hotbar first right?

tardy delta
#

Iirc no

eternal oxide
#

yes it goes slot zero first

forest pumice
#

Is it possible to rayTraceBlock the whole world?

rough drift
#

but why?

hybrid spoke
forest pumice
#

😂

tender shard
#

long answer should be yeeees

round finch
#

fancy thing with maven

hybrid spoke
#

you can read it as yes but also as yes

tender shard
remote swallow
#

thats cool, ill give you that

hybrid spoke
tender shard
#

@hybrid spoke ```xml
<testServerPath>C:\mctest</testServerPath>
</properties>

<profiles>
        <profile>
            <id>runTestServer</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jar-plugin</artifactId>
                        <version>2.3.1</version>
                        <configuration>
                            <outputDirectory>${testServerPath}/plugins</outputDirectory>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>exec-maven-plugin</artifactId>
                        <version>1.2.1</version>
                        <executions>
                            <execution>
                                <id>run-testserver</id>
                                <phase>package</phase>
                                <goals>
                                    <goal>exec</goal>
                                </goals>
                                <configuration>
                                    <workingDirectory>${testServerPath}</workingDirectory>
                                    <executable>java</executable>
                                    <arguments>
                                        <argument>-Xms128m</argument>
                                        <argument>-Xmx512m</argument>
                                        <argument>-jar</argument>
                                        <argument>${testServerPath}/spigot.jar</argument>
                                    </arguments>
                                </configuration>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
</profiles>
#

this should do, havent tested

#

yeah works fine

icy beacon
#

what the fuck

tender shard
#

?

icy beacon
#

why does clearing the inventory call InventoryClickEvent

remote swallow
#

maven be like

torn shuttle
#

so NMS has PathfinderMob which does not exist in the Spigot API, however is there a way to determine if an entity extends PathfinderMob without using NMS?

icy beacon
#

on EVERY ITEM

#

in the inventory

#

(clearing with shift+lmb/rmb on the X)

tender shard
remote swallow
icy beacon
#

no lol

#

that's vanilla

#

in the creative menu

remote swallow
#

oh that one

#

i thought you meant a normal inv

#

mojank strikes again

glossy venture
#

yo anyone know how to put a . in your gradle module name like how java has it for its jre and jdk modules like aaa.bbb.ccc

icy beacon
#

why is there a ClickType.CREATIVE in InventoryClickEvent?????????

#

mf how do i differentiate from a clearing click and a normal click in creative mode now

#

this shit

#

i swear

hybrid spoke
#

inventory's weird but that actually makes sense

icy beacon
#

looks like i'll have to find out the action

hybrid spoke
#

its like shift doubleclicking your whole inventory into a chest

#

it will call for every single item

icy beacon
#

perhaps

tender shard
glossy venture
#

ok is it possible though

tender shard
#

idk that

#

the gradle docs don't mention anything about rules for module names

#

it only has some recommendations, e.g. to use kebab-case-formatting

tender shard
#

in bukkit

tender shard
torn shuttle
rough drift
#

I am trying to create a new world, however it hangs the server a bit (The world file is copied async, and then I am using worldcreator sync to load it into bukkit), I am also preventing spawn chunks from being loaded, is there any way to run world creator async as well

nova sparrow
#

Yo. I was just curious. Does spigot have any plans to add back the ".setTitle()" option for inventories at some point? It was taken away a while ago for some reason, but was hoping to see it make a return

glossy venture
#

what the fuck

rough drift
#

you need to get a player view and edit the title there

nova sparrow
#

that's pretty cool tbh

#

Thanks for letting me know 🙂

#

So uhh any chance you're able to tell me how I can edit it? 😅

#

thought it would simply be a matter of

player.getOpenInventory().setTitle(title);
```but it seems there's only a "getTitle()" option there
rough drift
#

You need an inventory view

tender shard
nova sparrow
#

Just tested on InventoryClickEvent

event.getView.getTitle()
``` is the only option as far as I'm aware
rare rover
#

should i be doing this?

@Override
    public boolean isGenerator(Material material) {
        return Optional.of(generators.values())
                .orElse(Collections.emptyList())
                .stream()
                .map(Generator::genItem)
                .map(ItemStack::getType)
                .anyMatch(material1 -> material1 == material);
    }

    @Override
    public boolean isGenerator(ItemStack itemStack) {
        return Optional.of(generators.values())
                .orElse(Collections.emptyList())
                .stream()
                .map(Generator::genItem)
                .anyMatch(itemStack1 -> itemStack1.isSimilar(itemStack));
    }``` im sorry, i really hate how i can't decide on Streams or For loops
hybrid spoke
hybrid spoke
rare rover
#

basically, if values is null it'll make it an empty list and if it isn't it'll do .stream() then map it to the genItem (Itemstack) then returns if there's any matches

rare rover
#

just checks if its a generator

#

aka itemstack

hybrid spoke
#

and whats your question

nova sparrow
remote swallow
#
public boolean isGenerator(ItemStack stack) {
    if (generator.values() == null) return false;
    return generator.values().stream().map(Generator::genItem).anyMatch(itemStack -> itemStack.isSimilar(stack));
``` would be better imo
tender shard
#

it wasn't removed, it was never there

rare rover
#

on materials can i do .equals

#

and how do i know when i can

hybrid spoke
#

just compare with ==

rare rover
#

alr

hybrid spoke
rare rover
#

ah okay

#

ty

nova sparrow
#

Hmm. I might be thinking of something else then. I know something was removed/changed about inventories but I can't recall

#

maybe something about the viewers 🤔

hybrid spoke
#

why does it matter

nova sparrow
#

no yeah doesn't matter anymore ig, just a personal vendetta now to figure out what that old issue I was having was 😂

rare rover
rough drift
rare rover
#

oop

#

ohh

#

yeah let me fix that

#

thanks

rough drift
#

np

rare rover
#

is everything else decent, im changing .getPlayerGenerator() rn

rough drift
#

I guess you should cache player gens

desert loom
rough drift
#

And when a generator is added recalculate the cache

desert loom
#

oh alright

remote swallow
#

uh you probably wanna fix it .gitignore, you shouldnt be pushing /build/ to github

hybrid spoke
#

rename Handler. lookup SRP/SOLID. use a logging framework. log4j comes with CB. cache your stuff. looks like this class is very performance inefficient

rare rover
#

oki

#

but is it decent at least?

#

hopefully 🤞

remote swallow
#

yeah, just questionable packages

rare rover
#

true

hybrid spoke
#

looks like copilot generated

rare rover
#

hmm?

#

where

#

should i use for loops for readability?

#

eh nvm

rough drift
#

I have a world's files, and I am trying to load them using WorldCreator, however even if I disable spawn chunk loading, it still takes a good ~5ms to load, plus a server hang (Which is what I care about, the 5ms is perfectly fine), any way I can stop the server from hanging?

sullen marlin
#

Not sure what you mean

rough drift
#

Say I have a world named SomeWorld, if I run new WorldCreator("SomeWorld").createWorld(), this would load the world as it already exists as a world folder, now the problem I am having is that while the operation takes relatively little, it seems to cause a hang/lag spike, as this method can only be run sync, and that's my problem, I am also using

@EventHandler
public void on(WorldInitEvent event) {
  event.getWorld().setKeepSpawnInMemory(false);
}

to speed things up (I manually load needed chunks), this decreased overall time it took to load the world, but the slight lag spike is still there (0.2s or something near that, didn't take accurate measurements)

sullen marlin
#

A hang/spike when

#

200ms doesn't seem outrageous for pretty much the heaviest operation on the server

#

If you think there's something particularly slow that can be optimised, open a bug report with a profile showing where the spike is

rough drift
#

Oh no that's fine, It can take time, I am just trying to not make it visually block the server (For example I'd be fine if it took 200ms but it didn't block like entity movement and such)

brisk estuary
#

does anybody know if it is possible to have multiple chats, one per language, so when a player enters the server he/she chooses a language and then only see messages sent to the correspondent chat?

sullen marlin
#

This is a development channel, use -server for plugin help

remote swallow
#

yeah, just cancel all chat messages and run a for loop to send the messages to the correct channel if ur making a plugin

brisk estuary
#

Okay, I was asking because if it is possible I'd like to implement it xD

sullen marlin
#

Yes it's possible

rough drift
#

I might try to get WorldCreator to be thread safe, then my issue would technically be solved

desert loom
#

registerGenerator logs an inaccurate registration time since registration takes place after the logging
you should probably log more than just the exception's message in your try-catch

rough drift
hybrid spoke
#

you could use paper or write your own world creation thingy which goes async

#

but normally you dont create worlds that frequently that it be noticable

rough drift
#

Yeah I am creating worlds somewhat frequently

#

that's why it's an issue for me lol

hybrid spoke
#

for what

rough drift
#

Instanced worlds

#

There that makes it more concise lmao

hybrid spoke
#

pregenerate them

#

use schematics

#

or just live with it

rough drift
lime nest
#

does any one know how to allow essentials to but pickaxes and stuff on your head when /hat is used?

terse ore
#

since when is setLore deprecated?

rare rover
#

its just lore()

sullen marlin
#

?whereami

terse ore
#

mb

lime nest
#

when I do /hat with a pickaxe it says "this item can not be used as a hat" and I need it to allow me to do that. @terse ore

terse ore
#

should be in the config ig

lime nest
#

it not though

#

its*

#

and if not that do you know of any plugins that would allow me to do that?

terse ore
#

make it your own

#

it's a relatively simple plugin

lime nest
#

I cant

terse ore
#

why

lime nest
#

I do not have any programs that allow me to write java. it to expensive

remote swallow
#

theres free apps

terse ore
#

yeah

rough drift
terse ore
#

you could still code in notepad

rough drift
#

you also got intellij community

desert loom
#

intelli j/eclipse/visual studio code all have free stuff

terse ore
#

if you needed to pay to code this whole concept would end

sullen marlin
#

2 second Google

desert loom
#

was about to post just that

terse ore
#

lol

sullen marlin
#

I'm sure there's dozens

lime nest
#

are you sure? because I tryed and the code always endsup looking like "Êþº¾ 4
     java/lang/Object <init> ()V " every time I edit or make a file

terse ore
#

oof

lime nest
#

and has weird stuff

sullen marlin
#

?learnjava

undone axleBOT
lime nest
desert loom
#

if your goal is to make stuff with java it will

#

but if it's not, just use one of those linked plugins.

lime nest
#

But the code always breaks or corrupts

rough drift
#

Damn

lime nest
#

idk why or how

rough drift
#

You got corrupting code?

#

I prefer crimson code tbh

lime nest
#

I can write python, but I doubt that will help with mc

terse ore
hybrid spoke
#

me too. see: "python"

terse ore
#

(like 4 years ago 💀)

eternal night
#

grabbing an existing plugin seems like the better way forward for you then

remote swallow
#

if it looked like this you tried to open a .class file with bytecode in it

terse ore
lime nest
#

it never looks like that. its ways messed up looking

terse ore
lime nest
#

I tryed every program I can

sullen marlin
rough drift
#

lmao

sullen marlin
#

Anyway, we've provided multiple plugins above

#

Use one

flint coyote
quiet ice
remote swallow
#

bytecode viewer

quiet ice
#

huh

remote swallow
#

shows the decompiled code and a bytecode disassembler

quiet ice
#

I'll stay with recaf

flint coyote
remote swallow
#

recaf refuses to run on my pc

#

its very fun

terse ore
remote swallow
#

fuck knows

terse ore
#

and in italic 😭

quiet ice
#

Recaf requires JFX if you are running on Java 8. Runs best on Java 11+ (where it can resolve JFX itself)

#

But yeah, it sometimes is a bit strange

remote swallow
#

the only way i could make it run was from cmd and i couldnt be arsed to do that everytime

quiet ice
#

Yeah I guess you are running it with the wrong JDK then

lime nest
remote swallow
#

.class is a compiled java file

#

you should be editing a .java file

lime nest
#

.class files are in java files

terse ore
#

what does .dll have to do with this

lime nest
#

nothing

remote swallow
#

yeah, .class files are in jars, the .class file is the compiled .java file

lime nest
#

oh sorry, .java file. I thought you said .jar

#

any way idk how to fix it, but thanks for the help

terse ore
#

one quesion guys, how can I detect if I created the inventory or if someone just renamed a chest for example?

flint coyote
#

By using InventoryHolder and not (only) checking by name

terse ore
#

how would that help?

flint coyote
#

If someone renamed a chest it won't be null

terse ore
#

ooh

flint coyote
#

For a custom inventory it is (unless you specify one)

terse ore
#

yeah makes sense

quiet ice
lime nest
#

Oh well that works, thanks!

terse ore
#

I want to store a lot of key value pairs, should I use yml json or sqlite?

quiet ice
#

If they are basic types I'd just use DataInputStream/DataOutputStream

terse ore
#

string string

quiet ice
#

yaml or json are not that great for larger parts

terse ore
#

okok ty

sullen marlin
quiet ice
#

not to be confused with ObjectOutputStream

sullen marlin
#

You don't need to make your own file format no one else can read

terse ore
#

if it doesn't get to a thousand

#

what should I use?

quiet ice
#

Then performance is irrelevant

sullen marlin
#

Yaml

terse ore
#

yaml is fine then¿

#

ok

#

ty guys

quiet ice
#

JSON is like the standard for data storage though

#

But I guess people will be more accustomed to yaml here

terse ore
#

YAMLConfiguration is op ngl

quiet ice
#

But also rather slow

warm mica
forest pumice
#

why is this the case when I try to check if a string != null

chrome beacon
#

Looks like the string never is null there

#

or you've marked it as not null

forest pumice
#

im checking it from a config file

rotund ravine
#

Are you using getString?

forest pumice
#

yea

rotund ravine
#

Show us

forest pumice
#

show u what

rotund ravine
#

How you are loading it till you are using it.

chrome beacon
#

?paste

undone axleBOT
forest pumice
chrome beacon
#

Yeah commands will never be null

#

If it is null it will throw an npe and break

forest pumice
#

This is the case for everything I'm using

#

not just commands

rotund ravine
#

Oh wait

#

Why are you using .replace on something that is nullable.

forest pumice
#

hm what

#

should I replace it after checking?

chrome beacon
#

Also why are you trying to get it as a string and then a string list

#

Only one of them would work since it can't be both

forest pumice
rotund ravine
#

just use isset

chrome beacon
#

or even better check if getStringList is null or empty

#

empty check will be handled by that for loop so just check null

forest pumice
#

bro ignore that, as I said its not working for anything I have

#

for normal strings

#

its still not workibgn

#

and im so confused

chrome beacon
#

Send that code

rotund ravine
chrome beacon
#

ah

forest pumice
#

?paste

undone axleBOT
forest pumice
#

for instance this

#

@chrome beacon

rotund ravine
#

remove the replace part

forest pumice
#

why

rotund ravine
#

Cause getString is nullable.

#

Check before using any other functions on it.

eternal oxide
#

getStringList will return null IF the section is not a List

chrome beacon
eternal oxide
#

oh I'm corrected

rotund ravine
#

Tbf

terse ore
#

hwo can I save a YAMLConfiguration?

forest pumice
#

ok sorry what, I don't understand how I'll fix "commands"

eternal oxide
#

I always thought that returned null, same as if a section didn;t exist

forest pumice
rotund ravine
terse ore
#

strange

forest pumice
#

@rotund ravine you said its never null, so can I just check if its empty?

chrome beacon
#

Yeah