#development

1 messages ยท Page 106 of 1

thick kestrel
#

^~^

#

I think its an interesting addition and would love to see a plugin with it

#

personally Id love so see all my mobs harder also

#

even though the mobs in my server are already stupied difficult x3

#

brutes can 2 shot you

#

allot of mobs have way more health

#

but honestly I dont like the way the plugin configures stats

#

I would prefer potion effects

#

@plucky helm

plucky helm
#

Ah, I see

thick kestrel
#

ya its in json format and all over the place and harder to write than code

#

its called leveled mobs

broken elbow
#

you probably added it before adding listing it in gitignore

thick kestrel
#

theres an old plugin yes you can update it if you want to decompile it

#

well you dont have to decompile I guess because it has a github repo

lyric gyro
thick kestrel
#

so what are you looking for

#

egg spawning or not

lyric gyro
#

Making it not spawn

thick kestrel
#

find an item excluder plugin

#

item and block excluder

#

I didnt find any so you may have to code a plugin yourself

#

it would be simple if the egg spawns at exact cordnates everytime

#

but Im not sure if it does

#

I dont think it does

#

well I cant really help you looking into it now

#

theres no such thing as block excluder

#

and dragon egg spawns in random locations

#

and its not a drop item so you cant change the loottable

lyric gyro
thick kestrel
#

thats if you kill it in same place everytime

lyric gyro
thick kestrel
#

then make a event when dragon dies it removes the egg block at location

#

but thats if end portal has 0 cordnates

#

if else its probably random end portal location spawn in each end you create

#

but if you dont plan on changing your end world then you can get the location of the egg and destroy the block

#

simple

#

you may want to include a wait after it dies for the code the execute destroying the block

lyric gyro
#

How would I return a boolean from a diff class

high edge
#

DI?

lyric gyro
#

Huh

high edge
#

dependency injection

broken elbow
#

dependency injection

neat pierBOT
broken elbow
#

read here for more ^

thick kestrel
#

if its a method then you can make the method bolean and have it return your bolean

#

its its a class bolean value then you can make it public

#

if its going to another class then make it public static

high edge
#

No

thick kestrel
#

no?

high edge
#

Try to avoid static when not needed

thick kestrel
#

why

high edge
#

Also, your variables shouldn't be public, instead you should have getters and setters

thick kestrel
#

Im not one to make code complicated

#

I dont really care for security

lyric gyro
#

it's not about security

#

it's about flexibility

#

and static is absolutely hideous if used wrong and a major source of hard to track bugs

high edge
#

Can't remember if there's any convos saved on why static bad

thick kestrel
#

ok

#

i will take that advice then

#

I see its simple

#

I never knew about it

tight junco
#

we need a why static bad cause we have a uh

#

?plsnolombok

neat pierBOT
#
FAQ Answer:

Why is Lombok bad?

  • It's a compiler hack - the Java compiler isn't designed to modify code, so it can cause difficult to debug errors, or worse
  • It requires an IDE plugin, so unless you've properly configured Maven, Gradle and your IDE, you'll get hundreds of compilation errors. This process takes time too, it's not easy
  • Lombok'd code won't show in Javadocs
  • The code generation is often unpredictable and difficult to debug, and often you'll have to do it "the hard way" anyway
  • Java is supposed to be explicit, Lombok hides a lot of key functionality into a subtle annotation which can be easy to miss
  • While IDEs support it with a plugin, it's usually more difficult to find specific things, like usages of a getter because they don't exist in the source code
  • Finally, Lombok'd bytecode doesn't match the source code, so it causes a pretty annoying warning in IntelliJ
pulsar ferry
#

Well static isn't bad, people just miss use it

tight junco
#

i mean id argue it's bad because its so easily misused

lyric gyro
#

it's not inherently bad

#

it's how it's used

hard wigeon
#

I'm trying to make something that compiles a custom language into a spigot plugin (Basically, trying to make a web minecraft plugin creator).

What tools should I use to convert my (converted to) JSON markup into a compiled jar?
I'm thinking I have like 2 options, and would like to hear input

1 ) Write little snippets of java, then compile it via the command line, and return that on a webserver
2 ) Find a library in any language to work with compiled bytecode, and (probably in TS) convert the JSON to bytecode manually
#

which makes the most sense?

dense drift
#

use gradle

hard wigeon
#

huh? how does gradle effect anything

#

I'm not gonna use any compile time package managers

#

I'm gonna manually compile for times sake

dense drift
#

๐Ÿค”

hard wigeon
#

I'm trying to make a custom language compile to JVM as quickly as possible basically

#

and I'm wondering what my best bet is

cinder forum
#

Hi guys, how heavy for server would be sending all packets send to/from 20 players to another server? approx

lyric gyro
#

it would be as heavy as if the other server had those extra 20 players

cinder forum
#

emily

dense drift
#
$ send Server all```
#

run this from bungee console

cinder forum
#

i want to send the data to non minecraft server ok

dense drift
#

well that's different

slow kiln
#

Can someone help me here, I'm trying to work with the UltraPrisonCore api but keep getting this error when trying to load my plugin.

java.lang.NullPointerException: Cannot invoke "me.drawethree.ultraprisoncore.UltraPrisonCore.getTokens()" because the return value of "me.drawethree.ultraprisoncore.UltraPrisonCore.getInstance()" is null
cinder forum
#

plugin code?

slow kiln
thick kestrel
#

@slow kiln if you have intellij you will be able to see if something in your code may return null

#

in that case you have a wrong statement

#

unless your returning null on purpose

thick kestrel
#

it says right there

#

value of "me.drawethree.ultraprisoncore.UltraPrisonCore.getInstance()" is null

#

that part of the code is wrong

#

whatever instance your trying to get your not gonna get with getInstance() because its null

fiery pollen
#

You are getting an instance of a core

#

but its null

thick kestrel
#

^

slow kiln
#

It's not my code lol, It's trying to access an api

thick kestrel
#

um

#

access the api with a different statment

#

you dont need to use getInstance

#

just import it and your good

#

then you can use UltraPrision.AnyMethod

#

but if your trying to use it and its not letting you add to your method

#

myMethod(UltraPrision ultra) {}

lyric gyro
#

what are you talking about

thick kestrel
#

they are saying they cant access the api

lyric gyro
#

yes because they're doing something wrong

thick kestrel
#

well duh

lyric gyro
#

but what you're saying is even worse

thick kestrel
#

how is that worse

lyric gyro
lyric gyro
thick kestrel
#

because is some way or another they are getting an instance of the core

#

why I dunno

lyric gyro
#

[16:34] Sophia: access the api with a different statment
[16:34] Sophia: you dont need to use getInstance
[16:35] Sophia: just import it and your good
[16:35] Sophia: then you can use UltraPrision.AnyMethod

this is wrong

#

they are not static methods

#

you need an instance, which you get by calling getInstance

thick kestrel
#

you dont need a static method to do that

lyric gyro
#

???

#

then you can use UltraPrision.AnyMethod
you mean like UltraPrison.someMethod()?

#

that's a static method

thick kestrel
#

ya if you define the Instance in the method

#

but its not static

lyric gyro
#

?????

#

you're making no sense

thick kestrel
#

Im sure someone understands but you

lyric gyro
#

either way we'd need code and/or stack trace to provide any help

slow kiln
#

I've added the plugin jar as a dependency of my plugin, then I'm trying to get an instance of it, but when my plugin loads it says the instance is null. The depending jar is not my plugin.

#

java.lang.NullPointerException: Cannot invoke "me.drawethree.ultraprisoncore.UltraPrisonCore.getTokens()" because the return value of "me.drawethree.ultraprisoncore.UltraPrisonCore.getInstance()" is null
    at xyz.foggies.buzzbackpacks.BuzzBackPacks.onEnable(BuzzBackPacks.java:26) ~[BuzzBackPacks.jar:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[patched_1.17.1.jar:git-Airplane-106]
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[patched_1.17.1.jar:git-Airplane-106]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[patched_1.17.1.jar:git-Airplane-106]
    at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugin(CraftServer.java:561) ~[patched_1.17.1.jar:git-Airplane-106]
    at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugins(CraftServer.java:475) ~[patched_1.17.1.jar:git-Airplane-106]
    at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:733) ~[patched_1.17.1.jar:git-Airplane-106]
    at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:319) ~[patched_1.17.1.jar:git-Airplane-106]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1220) ~[patched_1.17.1.jar:git-Airplane-106]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[patched_1.17.1.jar:git-Airplane-106]
    at java.lang.Thread.run(Thread.java:831) ~[?:?]


  this.tokensAPI = UltraPrisonCore.getInstance().getTokens().getApi();

lyric gyro
#

just to be sure, did you add the other plugin to your plugin.yml depend list?

slow kiln
#

yeah

thick kestrel
#

well never mind my method I thought you were just grabbing a method

slow kiln
#

It loads before my plugin is loaded.

lyric gyro
#

how are you building your plugin?

#

maven/gradle

slow kiln
#

maven

lyric gyro
#

make sure the UPC dependency has <scope>provided</scope>, or else you're (most likely) shading it (bundling it inside your jar which is a no no)

wooden loom
#

hey can someone help me with a problem

slow kiln
#

Alright I was building it incorrectly, but now it's giving an error saying:

package me.drawethree.ultraprisoncore does not exist
broken elbow
wooden loom
#
public void createArena(String id) {
  if (arena.contains(id)) return;

  // Create the arena.
  arena.createSection(id);
  arena.set(id + ".name", "Arena " + id);
  arena.set(id + ".status", "closed");
  arena.set(id + ".players", 0);
  plugin.getArena().saveConfig();
}

I have this code but once I run the function I got this in my yml file:

'id814235':
  name: Arena 1
  status: closed
  players: 0

How can I get rid of the ' ' around the id

slow kiln
#

you need a . after arena

cinder forum
#

Hi guys, is there any Java 3D library that can render image from X, Y, Z coordinates and its texture?

broken elbow
lyric gyro
#

?paste

neat pierBOT
#
FAQ Answer:

Paste Services
When asking for help with a config/menu/code issue please use our paste bin:
(we prefer it over pastebin.com)
โ€ข HelpChat Paste - How To Use

slow kiln
lyric gyro
#

you should never really mix build tools / building mechanisms

#

either use maven for all of your dependencies or don't use it at all

thick kestrel
#

well it will autodelete it when you build it anyways

lyric gyro
#

wat

thick kestrel
#

the dependacy in modules

#

if you add it manually then build with maven

slow kiln
#

POG

#

It worked

#

I used the pom.xml

wooden loom
thick kestrel
#

@lyric gyro can you help me change this static to a injection

#
    public static Map<String, ItemStack[]> menus = PrivateVaultStorage.menus;
}```
lyric gyro
#

Right, so

broken elbow
#

first of all

#

then

#

and in the end

#

there you go

thick kestrel
#
    public void transfer(PrivateVaultStorage Vault) {
        this.menus = Vault.menus;
    }```
#

this is what I got

#

so far

#
    
    public void transfer(PrivateVaultStorage Vault) {
        this.menus = Vault.menus;
    }```
lyric gyro
#

in whichever class that is, you can take a PrivateVaultStorage in the constructor, and take the map from there

public class SomeClass {
  private final Map<String, ItemStack[]> menus;

  public SomeClass(PrivateVaultStorage vault) {
    this.menus = vault.menus();
  }

  public void someMethod() {
    // use menus
  }
}

(as a side note: prefer getters/setters before public fields, in the case you want to add some extra logic inside the getter/setter then it's easier to add in the future without having to change every single place you change vault.menus to call the getter)

#

i never bought the whole "ruh roh everyone can change anything if it's public" speech, by itself it's no different than having both a getter and a setter -- the difference relies in that you can add extra logic, for instance you can check in a setter that the argument passed isn't null or that it matches certain criterion - or in a getter that certain things are initialized before something can be used, etc

cinder forum
#

CPU only*

wintry grove
#

then idk

thick kestrel
#

so this is kinda messed

#

The PrivateVault methood of the class needs a parameter of PrivateVaultStorage when I try to use it in a third class method

#

seems like its only 2 way

proud pebble
#

what would be the best way to select a new area that isnt occupied by someone else, such as if i wanted to designate 1 chunk for every player.
like on a square grid that goes as far as the world border

#

like how islands are in skyblock plugins

queen plank
#

How do I save a .yml file to a subfolder? Star, you told me to use Bukkit saveResource() but I'm unsure if that can't save to a subfolder. I haven't gotten it to do that any ways.

wintry grove
#

ummmm

#

;d spigot saveResource

thick kestrel
#

so this: public PrivateVault(PrivateVaultStorage vault) { this.menus = vault.menus; }
links this this:

public class PrivateVaultStorage extends JavaPlugin {
    @Path("Player Vault")
    public Map<String, ItemStack[]> menus = new HashMap<String, ItemStack[]>();
}```
but this method:
```    public void guiOPEN(CommandSender commandSender) {
        Player player = (Player) commandSender;
        Inventory inv = Bukkit.createInventory(player, 54, player.getName() + "'s Private Vault");
        if (menus.containsKey(player.getUniqueId().toString())) {
            inv.setContents(menus.get(player.getUniqueId().toString()));
            player.openInventory(inv);
        }
    }```
needs to be open by this method:
```    @SubCommand("Private_Vault")
    public void privateVaultCommand(final CommandSender commandSender, PrivateVault vault) {

        vault.guiOPEN();
    }```
@lyric gyro
#

they are all in different classes

wintry grove
#

dam

cinder forum
proud pebble
#

like a square grid, starting from 0,0 going out like a snake spiraling around that center area

wintry grove
#

what was the god damn method?

mental cypress
#

For?

thick kestrel
#

saveconfig?

wintry grove
#

saveResources

cinder forum
#

javaplugin

wintry grove
#

that god

queen plank
wintry grove
#

d;spigot JavaPlugin#saveResource

uneven lanternBOT
#
void saveResource(@NotNull String resourcePath, boolean replace)
throws IllegalArgumentException```
Description:

Saves the raw contents of any resource embedded with a plugin's .jar file assuming it can be found using getResource(String).

The resource is saved into the plugin's data folder using the same hierarchy as the .jar file (subdirectories are preserved).

Parameters:

resourcePath - the embedded resource path to look for within the plugin's .jar file. (No preceding slash).
replace - if true, the embedded resource will overwrite the contents of an existing file.

Throws:

IllegalArgumentException - if the resource path is null, empty, or points to a nonexistent resource.

wintry grove
#

there

#

@queen plank

mental cypress
#

Did you already send your code that you're working with?

queen plank
wintry grove
#

so sniskus, you get the plugin datafolder, make a new folder and inside you make your custom yml, then using the above method you save it so it doesnt delete

#

yeah

#

JavaPlugin#saveResource saves the resource and avoids it from getting deleted

#

if thats the problem

queen plank
#

It worked before though lol, before I made the save function lmao. It is the save function that is the problem, trying to implement it rn so I can use it. I thought the files not saving was the cause of my original NPE so I tried fixing it.

wintry grove
#

in FileManager?

queen plank
#

The save function? Row 290

wintry grove
#

weird

#

then idk

thick kestrel
queen plank
# wintry grove then idk

I tried the function you sent and did this plugin.saveResource("/Settings.yml", true);. Though it is still not saving?

sharp hemlock
#

Does anyone actually know how to keep a chunk fully loaded all the time in spigot? I've tried and tried but cannot seem to get it work. I've tried

Chunk#setForceLoaded - Doesn't work
ChunkUnloadEvent wait 2 ticks load again - Doesn't work
I've tried NMS keeping the chunk forcefully loaded - Doesn't work

wintry grove
queen plank
sharp hemlock
#

and make sure its in the jar

sharp hemlock
queen plank
#

It doesn't? I was certain it did...

sharp hemlock
#

me to, but nope

queen plank
#

Huh...

sharp hemlock
queen plank
sharp hemlock
#

do you have it compiling into the jar file

queen plank
#

Ya

sharp hemlock
#

and did you confirm

queen plank
#

This works fine settings = new File(folder + "/Settings.yml");

sharp hemlock
#

saveResource copies the file from the jar

#

into your plugin data folder

#

You know that right?

queen plank
#

...no?

#

I can load the files from the .jar, then I want to be able to change them and save them again?

#

I thought saveResource did that, but I guess I was not clear enough when explaining what I wanted

sharp hemlock
#

you wanna make changes during runtime in the config?

queen plank
sharp hemlock
#

and then save that file

queen plank
#

Yeah

sharp hemlock
#

Ohh

#

use FileConfiguration#save

#

to save changes

thick kestrel
#

personally I like sf-cfg and it autosaves and loads on chanegs

queen plank
#

That works

sharp hemlock
#

no problem

queen plank
#

Though the file is empty

sharp hemlock
#

make sure you save the file from the jar folder

queen plank
#

It isn't loading now lmao

#

Yeah...uhh

#

How do I do that to a sub folder?

sharp hemlock
#

no ur doing it wrong

#

check if settings exists

#

if it doesn't exist, saveResource (transfer file from the jar to the disk)

#

and then keep running code and load it

#
settings = new File(folder + "/Settings.yml");
if (!settings.exists()) {
        plugin.saveResource("settings.yml, false");
}
settingsConfig = YamlConfiguration.loadConfiguration(settings);
settingsConfig.set("Effects.Positive.speed", false);
settingsConfig.save(settings);
robust flower
#

@thick kestrel just tested the lib using Java 16 on paper 1.17.1, everything worked out, could you share more of your code so I can try to replicate it?

thorn cape
#

How can I reset a world easily? I've been trying to just disable auto-save and then Bukkit.unload(world, false) but it doesn't seem to work. Any suggestions?

hard wigeon
#

oh and delete the files

#

restarting isn't strictly necicarily, but I've had it try to save stuff to the new one on me

thorn cape
hard wigeon
#

sure, try that

dusky harness
#

how can i get a location that "moves" itself closer to another location if it's too far? (bukkit)

for example with ```
X - - -



      • O
        if `O` needed to be next to `X`, `O`'s location would change to
        X - - -
  • O - -


#

i feel like i could do something with normalize & multiplying that but idk what to multiply it by

#

(100 block range btw)

#

googling skills ๐Ÿ˜Ž

pure crater
#

why cant u just do math and just plugin in numbers with the distance formula

#

and do the opposite

#

lol

dusky harness
#

me small ๐Ÿง 

thorn cape
dusky harness
#

๐Ÿ‘€

hard wigeon
#

Anyone here ever written raw bytecode, and if so what's the best way to get used to / start to fully grasp it?

#

(I'm looking to make a bytecode based tool)

slow kiln
#

How do you actually guage when something isn't optimised like for one player using this plugin it uses this much, at what percentage would be concerning. this is the spark profiler

https://prnt.sc/22eb7za

wheat carbon
#

optimize by testing

#

put a hundred players on the server to see how it performs

#

then you will know if optimization is necessary

slow kiln
wheat carbon
#

well if the percentage is worryingly high with only one player on then of course that's a good indicator

#

0.13% isn't very high for one player

#

but you don't know how it scales with more players

#

you have to test

#

as you get better with experience you may be able to spot areas which need optimization even prior to testing

#

but that comes with experience, not necessarily something that's easy to teach

thick kestrel
#

I think its because I used static

#

Im trying to fix it but I dont know how to make dependancy injection 3 way

#

but your class seems to be static

#

config class

thick kestrel
robust flower
thick kestrel
#

?dependency injection

#

dependency injection

neat pierBOT
cinder nimbus
#

is there a easy way to convert a string like "&4RED TEXT" to a component, with red text... but without knowing exactly the text or colour....

so i have a config with messages in them and i want to read the messages and send them to the user but i'm not sure how to add the colour to the text as Component.text("the test") doesn't convert the &4 into colours.

broken elbow
cinder nimbus
#

right ok ill take a look at them, thanks

neat pierBOT
broken elbow
#

@cinder nimbus see third one ^^

cinder nimbus
#

thanks

broken elbow
#

you'll have to use the adventure one because there's 2 one for bukkit stuff

#

and one for adventure

cinder nimbus
#

ok

graceful hedge
cerulean birch
#

how do i fix pom.xml not finding/giving me errors on certain plugins

#

i.e in my <reporting> i have some plugins

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-report-plugin</artifactId>
        <version>3.0.0-M5</version>
      </plugin>```
and the artifact id/version arent being found
rancid bronze
#

What's the best way to handle saving players in your opinion?
Option 1 is to use a cache and save on leave/load, but that means whenever they load we need to get all their entries, and whenever they leave we need to remove all their entries + reinsert them (in case they removed friends)
Option 2 is to save their friend list to cache in case they want a list of friends, but whenever they remove/add a friend we make a database call. Which means if someone joins with 100 friends and doesn't do any modification we only make 1 call

#

The downside of option 2 is that a player could spam mysql calls by adding/removing friends

#

Downside of option 1 is that we have to do a lot of requests on leave/shutdown and join

graceful hedge
#

Hmm are you familiar with soft caches as well as expiring caches, and then with an appended removal callback? That might be something to look into?

rancid bronze
#

But how would that work with mysql?

#

I'd still have to make the database call in the end

graceful hedge
#

Yes of course, well wouldnโ€™t you do it asynchronously anyways?

rancid bronze
#

Right but I don't want to send 100 calls of to the database for no reason

graceful hedge
#

Yeah well, just to say it, today we got an absurd amount of memory.

rancid bronze
#

Right but in theory what would be the better option?

graceful hedge
#

I donโ€™t think itโ€™d be such a biggie to do a lot of request on join and shutdown

#

After all itโ€™s not during session

rancid bronze
#

Yeah but it would also be on leave

graceful hedge
#

Yuh, just schedule an asynchronous task and make sure they canโ€™t join again before that task is completed

rancid bronze
#

Right but the downside is I'd be making tons of calls for no reason

#

Lets say a player with a 1000 friends joined

#

Didn't remove/add any friends

#

when they leave we need to wipe all their friends and reinsert every friend back

#

even though they didn't do anything

graceful hedge
#

Why would you need to wipe and readd everything?

rancid bronze
#

Because I'm dumb and just realized that

graceful hedge
#

๐Ÿ˜…

rancid bronze
#

How does this sound

#

2 maps

#

one to store when they joined, and one i modify through the session

#

when they leave I do a comparison and remove any friends that aren't in the end of session set

#

or is there a better way to do it

graceful hedge
#

Yeah that could work

rancid bronze
#

Any other ideas?

graceful hedge
#

Hmm let me think a bit

rancid bronze
#

alright

graceful hedge
ember drum
#

What causes my permissions to not appear in permission handlers such as LuckPerms?

lyric gyro
cerulean birch
#

how would i go about replacing 1.12 protocol with 1.8 in a server jar

queen plank
#

So I have some different GUIs for my plugin, and I want to know which GUI the player has open. So is there a good way of telling what inventory they clicked? I want to do this without using the title since I want the same title for some of the GUIs.

cerulean birch
#

.equals()?

ember drum
lyric gyro
#

you can just add your permissions in your plugin.yml, the way bukkit works will make LP register them "automatically"

queen plank
#

Thought == was the correct method to compare them

#

But that didn't work lol

#

Thanks

cerulean birch
#

I think == simply runs .equals or something similar, not sure

#

It should only return true if the actual inventory objects are the same object (assuming it uses the default equals)

queen plank
#

Wait

#

Nvm

#

It does not work

#

Im a dummy dumb

#

I added || 1 != 2 next to it just to show the GUI in-game

#

Imma try again lol

#

Ok it works lmao, thank you again

cerulean birch
#

That was a rollercoaster

thorn cape
#

Hey is anyone experienced with the spigot/bukkit world loading an unloading features. I have been trying to setup a way to unload and load worlds after a minigame on my server is ran, but I keep getting IO errors about the files being locked by another process after the first trial. (DMS open)

thorn cape
clever ridge
#

So. I actually get no error in the console, but nothing works.

Here is the code:
https://pastebin.com/rT15ws09

ClassFile: neonowlgery.*************.core.lobby.events.JoinEvent.java

#

Did I mess up something?

#

(oh yes, and the stars are censors, due to the stars are censoring the server's name)

clever ridge
#

Thank you! ๐Ÿ˜„

#

It works now!

broken elbow
clever ridge
lyric gyro
#

no offense but why would we care about it?

clever ridge
#

Well.. Nobody may know, who loves to leak here. I specially hate leakers, so I censor everything that is too important.

lyric gyro
#

leak? what is there to leak?

#

a server that isn't even out?

#

again I mean no offense, I just don't get it so to me it seems pointless

cerulean birch
#

I donโ€™t see why itโ€™s a big deal that he took 3 seconds to censor out something that he doesnโ€™t want other people seeing/knowing

thick kestrel
#

how is this an invalid event: @EventHandler public void onKill(PlayerDeathEvent e, Player player) { exp.addExp(player); String killed = e.getEntity().getName(); String killer = player.getName(); e.setDeathMessage(ChatColor.RED + killed + " has been slain by " + killer); }

cerulean birch
#

You donโ€™t put a second argument in there

#

Itโ€™s just the event thatโ€™s a parameter

lyric gyro
cerulean birch
lyric gyro
#

that's why i'm asking

cerulean birch
thick kestrel
#

using Event changes nothing

cerulean birch
#

???

#

Take out the Player from the method arguments

thick kestrel
#

I need player to show killer

cerulean birch
#

event.getKiller()

#

You canโ€™t have multiple arguments in an event method

#

Bukkit doesnโ€™t work like that sadly

thick kestrel
#

but I also need player to pass into addexp

broken elbow
#

is it not Player#getKIller?

cerulean birch
#

Player p = (Player) event.getKiller

cerulean birch
thick kestrel
#

exp.addExp(player);

cerulean birch
#

?

thick kestrel
#

this is a leveling system

cerulean birch
#

Ok

thick kestrel
#

Ill figure a way around it

cerulean birch
#

You can use methods on the PlayerDeathEvent to get the different players involved

thick kestrel
#

fix it thanks

compact tartan
#

https://paste.helpch.at/ekedacepex

How can i fix the error "Dependency 'me.clip:placeholderapi:2.10.10' not found"
On these lines:

        <dependency>
            <groupId>me.clip</groupId> Error
            <artifactId>placeholderapi</artifactId> Error
            <version>2.10.10</version> Error
            <scope>provided</scope>
        </dependency>
broken elbow
#

but I really doubt it

compact tartan
#

Idk how, but when i committed the code to GitHub it fixed it.

broken elbow
#

yeah bcz its xml it would work even if it was all in one line

cerulean birch
#

how different is 1.8 protocol from 1.12? i.e how much/what would break if i made a 1.12 server jar accept 1.8 players

robust flower
#

just use viaversion and viabackwards, profit

cinder forum
#

stonks

lyric gyro
#

no need for vb

cerulean birch
cinder forum
#

wait what ๐Ÿ˜ณ

cerulean birch
#

im trying to convert/fork a 1.12 server jar, into a 1.8

robust flower
#

why would you do that

cerulean birch
#

i'm a special breed

robust flower
#

how about just use paper 1.8?

cerulean birch
robust flower
#

but seriously, you gonna suffer a lot, every mc version changes a bunch of stuff internally

cinder forum
#

why not, lower version = performance profit

cerulean birch
#

im trying to do this to a non-bukkit

cerulean birch
robust flower
#

yeah I got ya, my point remains, it'll be very hard to properly convert it, or at least doing such feat would be very hard for my standards

cerulean birch
#

wasn't there no major changes until 1.13? so 1.12 should be fine, no?

robust flower
#

combat update on 1.9, right?

cerulean birch
#

yes

robust flower
#

they reworked the combat system

cerulean birch
#

but i dont think that part is even implemented

#

ok currently

#

my main problem is making sure the actual player connection is fine

#

like, the player can join peacefully

#

i dont wanna just edit the PROTOCOL_VERSION = NoInline.of(754); values without knowing what it may fuck up or fix

robust flower
#

Bardy is the one who is more knowledgeable about this matter I guess

cerulean birch
#

who bardy

robust flower
#

BomBardyGamer

cerulean birch
#

fun

robust flower
#

he's making a mc server as well which is not a fork of bukkit

cerulean birch
#

well

#

it seems to be 1.18

robust flower
#

yes, I'm not telling you to use his code as a guide, I'm telling you to use him as a guide

cerulean birch
#

yeah ik, just mentioned it lol

#

so when does this bardy show up in here

robust flower
#

i have no idea, but you can try pinging him (maybe?) or PMing him

cerulean birch
#

Hey @weary hill, legend says you're pretty knowledgeable on minecraft protocol/etc, would u happen to how much I need to change to a 1.12 server jar (glowstone) to make it a 1.8 jar? mostly in terms of player connections/joining protocol/handing etc

formal crane
#

i am trying to make a simple loop but it doesnt exactly work, is runs 10 times at once instead of a delay. But it needs to run once every 60ticks 10times

            Bukkit.getServer().getScheduler().runTaskLaterAsynchronously(rsChatManager.get(), new Runnable() {
                public void run() {
                    try {
                        create(new File(int_random + ".json"));
                        Bukkit.broadcastMessage("Test");
                    } catch (IOException e) {
                        System.out.print("Er ging iets mis!");
                    }
                }
            }, 60);
        }```
weary hill
#

you can easily find the versions that you're looking for on that page

cerulean birch
#

Aight thanks

shell moon
hoary scarab
tight junco
#

i'll be honest the top one will probably reach the max number before the scheduler runs

graceful hedge
#

Just a bit puzzled why not simply BukkitScheduler::runTaskTimer ๐Ÿ˜…

#

And then with a MutableInt or smtng

lyric gyro
high edge
#

Not really, things have been improving if you compare it to earlier versions, still not the best, but at least we're getting somewhere

river solstice
#

is html turing complete
is css turing complete
is html + css turing complete

#

any hot takes?

wheat carbon
#

no

river solstice
#

r u even turing complete

wheat carbon
#

yes

river solstice
wheat carbon
#

html can't emulate a turing machine

river solstice
#

html + css tho

wheat carbon
#

yes

#

maybe

river solstice
#

you're right, it is

compact tartan
#

https://paste.helpch.at/iyesawotoz.java
Hey, this is my code to create a new placeholder, in the main class: i register it with

new Expansion().register();

But it doesn't work in-game

Console has this line:

[15:34:05] [Server thread/INFO]: [PlaceholderAPI] Successfully registered expansion: LostKingdom
high edge
#

and what's the placeholder you're parsing?

compact tartan
#

%tps%

high edge
#

%LostKingdom_tps%

compact tartan
#

ahhh, thxx

heavy wadi
#

I have a plugin that adds custom item/xp dropping logic for when a player dies.
Now I want to be able to toggle this behavior on/off depending on the world / the world guard region or the kind of damage that caused the player to die.
Is the following config excerpt understandable?

remove_inventory_on_death:
  chance_per_slot: 1.0
  # ... a bunch of other settings such as % of stack size to drop per inventory slot etc.
  filter:
    world:
      - world3_nether
      - world3_the_end
    worldguard_region:
      - my_region_id
    damage_cause:
      - LAVA
      - VOID
use_worlds_as_allow_list: false # used as deny list by default
use_worldguard_regions_as_allow_list: false
use_damage_causes_as_allow_list: false
high edge
#

ew yaml

lyric gyro
#

is here a ticket place

heavy wadi
#

y'all do non-yaml configs for your plugins? ๐Ÿ‘€

lyric gyro
#

java.net.MalformedURLException: no !/ in spec after the latest paper update I am getting this error when I try to access an external jar file

heavy wadi
# lyric gyro ?

What do you mean by that? If you need help with a plugin, ask in the plugin-specific support channel or in #general-plugins if there is none.

tight junco
graceful hedge
#

Since yaml is easiest for spigot/paper server owners and server admins thatโ€™s why I do indeed choose yaml for configs. Itโ€™s quite a nice "language" although too flexible imho.

topaz elm
graceful hedge
#

Iโ€™d love yaml if the specs specified comments to be attached to nodes

pulsar ferry
#

Maybe one day

graceful hedge
#

๐Ÿ™Œ

topaz elm
#

toml over yaml anyday

#

JSON if it had comments

cinder forum
graceful hedge
#

Toml is nice but itโ€™s a bit weird how it flats nested key to value mappings out

graceful hedge
#

Altho ugly

high edge
#

hocon best

warm steppe
#

0/

graceful hedge
#

Yeah hocon is probably the way to go

#

Altho korm ๐Ÿ˜Œderp

icy shadow
#

welcome to the korm fields

graceful hedge
#

<insert korm fields meme here>

slow kiln
#

Does anyone know if Pterodyctal doesn't support Hikari?

lyric gyro
#

(taken from elsewhere)
2. Make sure there is no firewall blocking the connection from 172.18.0.0/16 to 172.18.0.1
3. Use 172.18.0.1 or 172.17.0.1 instead of localhost as database host address ( only if the database is on the same machine )
4. Make sure that the user can connect from 172.18.0.0/16 to the MySQL server. You can achieve that by creating the database user as 'username'@172.18.%.% . If you used the internal database management of Pterodactyl, you can ignore this step

icy shadow
#

lol

#

Small world

lyric gyro
#
public static void scoreboard() {
        for (Player player: Main.getPlugin(Main.class).getServer().getOnlinePlayers()) {
            String title = Main.getPlugin(Main.class).getConfig().getString("scoreboard.title");
            Scoreboard scoreboard = ScoreboardLib.createScoreboard(player)
                    .setHandler(new ScoreboardHandler() {
                        @Override
                        public String getTitle(Player player) {
                            Bukkit.getLogger().info("Getting entries");
                            return title;
                        }
                        @Override
                        public List<Entry> getEntries(Player player) {
                            EntryBuilder sb = new EntryBuilder();
                            for(String str : Main.getPlugin(Main.class).getConfig().getStringList("scoreboard.body")) {
                                String bodyText = PlaceholderAPI.setPlaceholders(player, String.join("\n", str));
                                sb.next(bodyText);
                            }
                            return sb.build();
                        }

                    })
                    .setUpdateInterval(2l);
            scoreboard.activate();
        }
    }``` When i run this code it does not create the scoreboard, i'm using ScoreboardLib in 1.17.... Hard to explain
topaz elm
#

static

lyric gyro
tight junco
#

avoid abuse static CB_fingerguns

broken elbow
#

how do I clone a different branch again? I basically have cloned the main branch and its set up to the remote main but I also want to have another branch cloned locally and can't seem to find out how. now that I think about it, I Do have premium gitkraken. might look at that

lyric gyro
#

git checkout other-branch?

broken elbow
#

ah right

#

thanks

lyric gyro
#

Is it possible to update a plugin if you have only the Jar and no source?

#

The original developer cannot be contacted (trying tho)

hushed badge
#

its possible

robust flower
lyric gyro
#

Code?

lyric gyro
#

pla.playEffect(pla.getLocation(), Effect.HEART, 2);

#

'playEffect(org.bukkit.Location, org.bukkit.Effect, int)' is deprecated

#

how can I fix this?

dense drift
#

d;spigot player#playeffect

uneven lanternBOT
#
void playEffect(@NotNull Location loc, @NotNull Effect effect, @Nullable T data)```
Description:

Plays an effect to just this player.

Parameters:

loc - the location to play the effect at
effect - the Effect
data - a data bit needed for some effects

lyric gyro
#

I tried it

#

didnt work

#

How would I fixi t?

dense drift
#

Try 2.0

lyric gyro
#

try what

#

huh

thorn cape
#

When I load a world right before my minigame starts (it waits 5 seconds then teleports players) it does not render the blocks. If you relog or leave and ender the world again it loads the blocks. I was wondering if anyone knows whats going on here or how to fix it?

ebon whale
#

,0

#

drops something on keybard whoops xD

high edge
#

probably cause that's not the potion effect's name?

chilly saddle
#

I have an ItemStack thats being pulled from config.yml, it is always pulled from the config.yml the same way ever time

When i used the /data command on the 2 seperate stacks in this video and compared them using a string comparator online they 100% has the same /data

My question is, why are these ItemStacks doing this? https://www.youtube.com/watch?v=HBMoQmz1wlA

This also happens on restarts as well where items arent able to be stacked? If i need to provide code i can as the projects on github, but i seem to always remember having this issue with ItemStacks

lyric gyro
trail burrow
#

I'm having trouble adding a new line to my enum class, no matter where I add the line or what line it breaks everything after it???

high edge
#

Probably a ; instead of ,

trail burrow
#

that was it, didn't notice that

#

Thanks

somber gale
#

Is it possible to change the text colour for placeholder text in input fields?

I have this weird issue where my input is displayed in the right colour, but the placeholders aren't...

#

I think I found it

thorn steppe
#

hey

#

i need rebuild the server expansion for fix a error with the software what im using

#

how i can rebuild a expansion?

#

i tryed but it doesnยดt compile correctly

#

it compile 4 me "caffeine" library

#

.

#

i need fix this error;

java.lang.NullPointerException: The expansion version is null!
young lance
high edge
#

And why exactly do you need to compile it yourself?

thorn steppe
#

for fix

#

a error with the software what im using

high edge
#

And what's the error

thorn steppe
#

its a strange error

#

with the expansions what havent the @NotNull on the version works

#

i want delete the @NotNull and compile for test if works

#

but when i go to compile, it compile another thing

#

it doesn`t the Server expansion

#

can anyone tell me how I have to compile it?

cinder forum
#

Hi guys, I want to get chunk in which is player and save it in own format but only part which player can see (so no underground), is that possible somehow?

lethal plaza
#

When essentials will be 1.18?

broken elbow
thorn cape
tiny grotto
#
TextComponent message = new TextComponent(String.format("%sBasic %scolors", ChatColor.of("#6D9293"), ChatColor.of("#C08251")));
sender.spigot().sendMessage(message);

Why does this show the default colors instead of the selected hex colors? (MC: 1.18.1)

dense drift
#

Wtf is that jumbo

tiny grotto
#

wdym?

dense drift
#

Let me introduce you to Adventure

#

Why string format

tiny grotto
#

adventure doesn't work in 1.18

#

The hover does not work with MiniMessage

dense drift
#

Dont use mini

tiny grotto
#

Same for the normal builder

#

it's a known issue

tiny grotto
tiny grotto
thorn steppe
dense drift
#

Shit

broken elbow
#

Balls

high edge
#

Torture

thorn cape
# thorn cape When I load a world right before my minigame starts (it waits 5 seconds then tel...

I'm still having issues with this. I have increasing the delay before teleportation, loading the chunks before and after a player teleports to the world. Nothing seems to fix it other than manually teleporting between worlds after its loaded or relogging when in the world. Currently I am using Slime World Manager but this issue seems to occur even if I use the Bukkit api. I have checked with them to see if they know anything about it and it doesn't seem so.

trail burrow
#

@thorn steppewhat expansion are you trying to fix?

thorn steppe
#

all what contains @notnull, for example Server expansion

spare musk
#

wheer

#

re

#

where can i download vote party for free

trail burrow
#

I'm sure there is a working Server expansion for all versions of MC

haughty parrot
thorn steppe
trail burrow
#

@spare muskit's on sale for $7 right now, and there is no place you can get it for free and get support here

#

@thorn steppewhat version of Minecraft are you using?

thorn steppe
#

with the software called Mohist

light ice
#

Anyone know if there's a problem using spigot-1.18.jar in your plugin?

leaden sinew
#

Is there a fox crouch event?

lyric gyro
#

FoxCrouchOnDeezNutsEvent

light ice
#

Created a backup of my 1.17.1 plugin and then replaced the build path spigot jar with a 1.18 version but it has created a lot of errors

trail burrow
#

@thorn steppeso your running a spigot/forge server?

leaden sinew
#

I think I found it EntityPoseChangeEvent

trail burrow
#

did you try all of these

#

I would go back one version at a time till it works

#

the first 3 or 4 may do the trick

thorn steppe
#

mm okay

#

i go to try it later, i cant now

trail burrow
#

if not have you thought of Magma, it has less issues with spigot plugins

thorn steppe
#

yes, but it have more bugs with mods

#

and im more interested on mods

trail burrow
#

yes I know hard to make things work with so many bugs in things

thorn steppe
#

how i can configure my compiler (IntelliJ) for compile a expansion?

#

idk

trail burrow
#

if setup right just click build

#

Ctrl + F9

light ice
#

Anyone? I used spigot-1.18.jar in my build path but it has created lots of errors?
For instance it doesn't recognize JavaPlugin?

robust flower
#

I have a question, how do I get a reference (if it's even possible) the Executor of the main thread (context: running java console application)?

#

I'm building a lib and I would like to run some Runnables in the main thread, so I think the solution above is the best way of doing that, but I'm open to other ideas

thorn steppe
trail burrow
#

ok

leaden sinew
lyric gyro
#

mixin ๐Ÿ˜Œ

lyric gyro
robust flower
# robust flower I'm building a lib and I would like to run some Runnables in the main thread, so...

More details: Basically, I'm making a configuration library that does all the heavy lifting without user intervention (https://github.com/SecretX33/sc-cfg), it already works for Bukkit (minecraft) but I'm looking into making a module for general purpose Java applications as well, and one of the features this library provides is a way to run annotated methods whenever the configuration file is modified, automatically (the code for that is here https://github.com/SecretX33/sc-cfg/tree/main/common/src/main/java/com/github/secretx33/sccfg/storage) using Java WatchService API.

In Bukkit, I can schedule the method runs from the single threaded executor that WatchService uses to the main thread using the own Bukkit API, but for general purpose Java I need another way of getting access of a executor that is able to run things on the main thread, because by default all the annotated methods should run on the "main thread" of the platform, which in console Java is just the main thread, unless specified in the annotation used to mark the method as a "method that should be run when the configuration is reloaded".

I just want to know if that's possible, and if so, how can I get the/a reference for the/an executor of the main thread.

robust flower
lyric gyro
#

I mean the main thread doesn't have an Executor

#

it's just a Thread

#

Your issue is gonna end up being synchronization, running it on the main thread is simple enough you have a couple options. Can make some sort of queue

#

Well jk really one of your only options

robust flower
#

fine, but is there a way to run things on the main thread from another thread

lyric gyro
#

the thing is that, for a "main thread" to act as an executor and run tasks dispatched from other threads, it needs to run in a loop, constantly looking for said tasks on a queue

#

that simply does not apply to every program

robust flower
#

so that is not consistently possible, correct?

lyric gyro
#

Yes it is

#

Your main thread needs to be accepting tho

#

As she said it would need a loop

robust flower
#

Which doesn't make sense in my context

lyric gyro
#

Why are you running it async in the first place?

#

I mean while(!queue.isEmpty) {

robust flower
# lyric gyro Why are you running it async in the first place?

Because those methods are scheduled directly from the single thread that watches the folder for specific file modifications (the configuration files), and those methods are scheduled to either be run asynchronously (using ForkJoinPool), or synchronously (using dark magic)

#

and by dark magic I mean either the solution that you guys have, or none, so I'll just add a "it's not possible" section is the API documentation

robust flower
lyric gyro
#

Ah I guess just donโ€™t do it sync

#

I mean it also depends on what you count as "main thread", or rather, on what the consumer considers as main thread

#

maybe they have their own task scheduling system

#

I'd advise taking an Executor as "mainThreadTaskDispatcher" or something, whatever

#

It may or may not fit all solutions.. but hey it's as flexible as you might get it to be ccatrainbowshrug

robust flower
robust flower
lyric gyro
#

let me rephrase

#

you take as parameter somewhere an Executor that would do the job, and is provided by the client

robust flower
#

I see, but I think annotations can't have Executor as parameters, I guess, so all async it'll be

#

since the method itself is not even invoked by the client's code, I would have to provide the executor myself, which would bring us back to the first issue

lyric gyro
#

I mean there's an annotation processor somewhere which is triggered by the client somehow

#

right?

robust flower
#

when the client uses Config.getConfig(Class), it'll trigger the load of all those classes, which will make his stuff get scanned and filtered by the presence of the annotation

#

I guess I could add another annotation for a method that provides the executor of the main class, but I just can't be arsed

lyric gyro
#

anyway

#

conclusion: mutability bad

robust flower
#

100% agree with that

worn jasper
#

We can also ask questions unrelated to bukkit here right?

#

just making sure

lyric gyro
#

yes

queen plank
#

Is there an easy way to make stackable items un-stackable? I tried some NBT-tags but had no luck

lyric gyro
#

yeah so long as they have different NBT it should be fine

icy shadow
#

different NFT

broken elbow
#

don't mind me just right click saving all your NBT tags

lyric gyro
#

lol

queen plank
#

Yeah, I have a config file which I load an ItemStack from. There is an option to make it unstackable. So everytime that item generates it should not stack if the option is on. So, what NBT tag shoul I use? Or do I have to use a custom one and generate a randon int or smth?

dusky harness
#

you could use PDC and then put a random int

#

ยฏ_(ใƒ„)_/ยฏ

queen plank
#

PDC?

dusky harness
queen plank
#

Ahh, ok

dusky harness
#

d;spigot ItemMeta#getPersistentDataContainer

uneven lanternBOT
#
@NotNull
PersistentDataContainer getPersistentDataContainer()```
Description:

Returns a custom tag container capable of storing tags on the object. Note that the tags stored on this container are all stored under their own custom namespace therefore modifying default tags using this PersistentDataHolder is impossible.

Returns:

the persistent metadata container

queen plank
#

Thank you!

dusky harness
#

np

light ice
#

Well, I got the Spigot 1.18 API down, but now there's a few things that aren't there, like ChatColor, ChatMessageType, and TextComponent

#

What do we use instead?

cinder forum
#

Bukkit (which is in Spigot) should have ChatColor package ๐Ÿค”

#

but I know earlier was BungeeCord ChatColor package used for HEX so maybe

dusky harness
#

isn't bungee api transitive in spigot api?

light ice
#

I figured it out, I was using just the normal "spigot-api-1.18.1-R0.1-SNAPSHOT.jar" when I need to use "spigot-api-1.18.1-R0.1-SNAPSHOT-shaded.jar"

light ice
lyric gyro
queen vector
#

Why won't intellij let me create java classes and packages ๐Ÿ˜ญ

#

and none of the things are being auto completed

cinder forum
#

error msg or something?

queen vector
# cinder forum error msg or something?

Cannot run program "C:\Users\mavxyz\.jdks\corretto-15.0.2\bin\java.exe" (in directory "C:\Users\mavxyz\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\213.5744.223\bin"): CreateProcess error=2, The system cannot find the file specified

#

I tried using openjdk and it still didnt work

cinder forum
#

well the InteliJ is trying to use java but Java is not existing in that location

#

(Java that use in that project)

queen vector
#

but I downloaded it through intelij

cinder forum
#

when you go to C:\Users\mavxyz\.jdks\corretto-15.0.2\bin\ is java.exe there?

queen vector
#

yes

cinder forum
#

try to restart InteliJ then

queen vector
#

alright, its indexing the jdk

cinder forum
#

okay, nice ๐Ÿ˜„

queen vector
#

omg, it worked! thank you so much ๐Ÿ˜ญ โค๏ธ

cinder forum
#

๐Ÿ‘

dusky harness
#

to serialize spigot objects (specifically ItemStack) outside of the spigot config, can I just use #serialize and #deserialize on them? and on the result of that I deserialize the values if it is an instance of ConfigurationSerializable and if so, repeat

#

since there are so many different types of items

#

(using gson btw)

#
fun ConfigurationSerializable.serializeSafely(): Map<String, Any> = serialize().map { (key, obj) ->
    if (obj !is ConfigurationSerializable) {
        return@map key to obj
    }
    return@map key to obj.serializeSafely()
}.toMap()
```maybe this could work?
#

uh

#

idk about deserializing tho ๐Ÿฅฒ ๐Ÿฅฒ

#

anyone know what i could do? (serializing bukkit itemstacks)

hoary scarab
lyric gyro
#

I'm fairly certain Bukkit does save all of the NBT

#

99.9% sure

hoary scarab
#

I couldn't get it to but I was parsing as json.

lyric gyro
#

d;paper itemstack#deserialize

uneven lanternBOT
#
@NotNull
public static @NotNull ItemStack deserialize(@NotNull @NotNull Map args)```
Description:

Required method for configuration serialization

Parameters:

args - map to deserialize

Returns:

deserialized item stack

lyric gyro
#

Myes

dusky harness
#

wait

#

does it use reflection?

#

wait no

#

yes

#

yes

#

it does

dusky harness
#

well

#

i used a fork of that

#

and had to adjust it

#

but

#

after 2 hours of changing the code i got it

#

lol

clever ridge
#

So basically... I made a private <class>, that imports the class without making the imported class's one void's static. That is fully okay, right? Well... lpb.createMenu(player); doesn't works for some reason. I mean, I am working with GUIs right now, and for some reason, the main menu doesn't opens the profile menu, and if I import each other into both classes (aka Profile is imported into the main menu, and the main menu is imported into the profile, because it has a back button), it just crashes the plugin. It will not be able to run, and I already ran out of ideas of what could possibly make this error. Fun fact: the editor shows no errors.

#

The private import looks like private LobbyProfileMenu lpb = new LobbyProfileMenu();
The event looks like

@EventHandler
    public void onInventoryClick(InventoryClickEvent e) {
        InventoryView inv = e.getView();
        Player player = (Player) e.getWhoClicked();
        if (inv.getTitle().equals("Jรกtรฉkmenรผ")) {
            e.setCancelled(true);
            int slot = e.getSlot();
            if (slot == 45) {
                lpb.createMenu(player);
            }
            if (slot == 48) {
                player.sendMessage("this message tells the player that they are already in the lobby, but this one, and the closeInventory one below also works.");
            }
            if (slot == 50) {
                player.closeInventory();
            }
        }

    }
#

(also, the private import is at the top of the class)

high edge
#

Can I suggest you use a gui library?

#

A good one is

#

?mf

neat pierBOT
clever ridge
#

Aaaah damn. I do not understand gradles.

warm steppe
#

??

clever ridge
#

You read it right.

#

I. Do. Not. Understand. Them. .-.

high edge
#

Understand what?

clever ridge
#

Gradles

clever ridge
formal crane
#

Whats gradles?

clever ridge
#

These build.gradle files

rich geyser
#

After almost a decade of people asking for persistent stats, I made an "addon plugin" for MobArena that just collects and writes some basic stats from all sessions into a database. Naturally, people want to see these stats, but the age old problem of exposing the data for arbitrary queries comes up, and some of the requested queries are hyper-specific to one server. I figured the right solution would be to give server owners a way to just write whatever queries they want instead of making me implement - potentially hundreds of - one-offs. Is that a thing in PAPI land? Is there an expansion that allows server owners to write arbitrary queries for a target database?

#

... or can I not expect to have "server owners writing their own queries" and "positive results" in the same sentence? xD

high edge
#

Yikes

rich geyser
#

I mean, that was the "failure" of SQL after all. The people it was targeted at didn't actually start using it because it wasn't as "human friendly" as they thought it would be. No offense of course ๐Ÿ˜›

dense drift
#

There's the mysql expansion but idk if it works

rich geyser
#

Ohhh

dense drift
#

But I assume that nothing stops you from executing a query received as argument from a papi placeholder

#

Just sanitize it or whatever the process is called and I guess you are fine

#

I would personally make a config where they can define placeholders that are basically queries identifier by an ID.

queries:
  kills: SELECT ...```
And then `%mobarena_stats_kills%`
rich geyser
#

Yeah I thought about that exact approach but from a more general perspective. So not specific to the stats addon.

dense drift
#

Could work imo

rich geyser
#

I think I also dug myself into a bit of a hole with the way I split things up. The stats addon is a separate plugin, and the PAPI expansion is its own thing as well. So to make it work in the current structure, I'd need to expose some sort of querying API in the stats addon that the expansion could use. But I think I'd rather go a bit wider and aim for something more general that others could make use of.

dense drift
#

A smal suggestion, if you can make a longer query for showcase, show them this yaml trick

example: >
  SELECT .. FROM ..
  WHERE .. AND ..
  JOIN ...```
Basically that `>` will turn new lines into spaces.
rich geyser
#

Ah yes! I've used that for some gnarly stuff before. Thanks for the tip ๐Ÿ™‚

dense drift
#

This would be perfect for servers that want to add specific things

rich geyser
#

Yeah, the whole thing sprung up because I added like a "total kills" stat, but then someone wanted "total kills this week", etc.

dense drift
#

Plus, sql is easier to learn than java ๐Ÿคทโ€โ™‚๏ธ so they can make their own things pretty quick

high edge
#

Who doesn't want to query every time a placeholder is parsed

dense drift
#

Only if something to avoid this was invented ๐Ÿ˜ฌ

#

Oh wait.. there is

rich geyser
#

Yeah caching would be necessary ๐Ÿ˜›

rich geyser
#

Thanks for the input! I'll see what I can find time for when Christmas rolls around ๐Ÿ™‚

graceful hedge
#

Garb :0

cinder forum
#

Hi,
I'm trying to save block data (basically just block name) around the player in chunk, 8 blocks up, 8 block down
Let's say player is on Y 63
That means I want to save data of chunk from Y 55 to Y 71
What is best way to do that? (no WorldEdit)

high edge
#

just have a loop and write, those few blocks aren't really that severe

night ice
#

Please ping me when replying๐Ÿ™‚

high edge
#

That's an 8 year old issue

#

So that probably answers you question

night ice
#

So u are saying it should be fixed?

dense drift
#

Look at what worldguard does

formal crane
#

How would i loop through a config list and do something for each UUID thats in it? i tried the following code but it won't work:

            List<String> il = new ArrayList<String>();
            ItemStack skullI = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
            SkullMeta im = (SkullMeta) skullI.getItemMeta();
            im.setOwner(String.valueOf(Bukkit.getPlayer(uuid)));
            im.setLore(il);
            im.setDisplayName(Format.chat("&6" + p.getName()));
            skullI.setItemMeta(im);
            inv.setItem(0, skullI);
        }```

Also the for loop is giving this error: https://paste.helpch.at/vevuzobuve.cs
#

My List looks like this:

  203211a5-56e8-47ef-8d7d-07c306ebbd9e: 163974
  uuidofplayer2: 25584
  uuidofplayer3: 25894
  uuidofplayer4: 589584
formal crane
tardy palm
#

So i got some more questions about domains:
- i actually want my own mail domain, is there a site you guys recommend?
- Is buying a site domain on google domains the smartest move?

molten wagon
#

is particle BARRIER replaced in 1.18?

thorn steppe
#

License violations were found:

#

when i try to build PAPI

#

why?

broken elbow
#

well

#

there's a particle called block_marker rather

molten wagon
dusky harness
broken elbow
molten wagon
broken elbow
#

just use Particles.valueOf and try catch. if it doesnt find Barrier, it means you have to use block marker.

molten wagon
thorn steppe
dusky harness
#

yes

thorn steppe
#

okay

slow kiln
#

Is creating an Asynchronous task everytime a block is broken bad?


 private void runEnchants(BlockBreakEvent e){
        Bukkit.getScheduler().runTaskAsynchronously(instance, () -> {
            for(EnchantBase enchant : enchantStorage.getEnchants()){
                enchant.handleBreak(e);
            }
        });
    }

Like this? Or does anyone have better way?

lyric gyro
#

it's not inherently bad but... what does that do and does it need to be done async? also keep in mind that any attempt at cancelling or modifying the event is futile, as the task will fire one tick later

broken elbow
#

yeah. what does EnchantBase#handleBreak do? Sounds like it should be done sync otherwise bad stuff might happen

molten wagon
broken elbow
molten wagon
#

hopper in block form big no no

#

XD

sharp hemlock
#

Might also add redis support as well in the future for you redis users as well

lethal plaza
#

Who can explain me this? required: String,List<subcommandinfo>,List<subcommandinfo>,String found: String,List<subcommandinfo>,String reason: actual and formal argument lists differ in length

broken elbow
lethal plaza
#

How? ๐Ÿ˜„

#

i am using two strings and two list ๐Ÿ˜„

dense drift
#

The error literally says whats wrong

lethal plaza
lyric gyro
#

what

#

the method takes a string, two lists and another string

#

you're passing it a single list

lethal plaza
atomic echo
#

Show the code where you're using it

lethal plaza
#
 @Command("mightyclass")
public class commands extends CommandBase {
    public commands() {
        main.commandarray.add(new commandsinfo(
                            "mightyclass",
                            List.of(
                                    new subcommandinfo ("help","123","Get command help"),
                                    new subcommandinfo("create","name","create your class")
                        ),

            "/mightyclass [subcommand] [compiler]"
                )
        );
     } ```
atomic echo
#

There's only 1 list there

#

You have new commandsinfo(String, List, String) there

#

You need to give it another list

lethal plaza
#

i am giving up ๐Ÿ˜„

robust flower
#

programming isn't for everyone, don't feel bad, there's nothing wrong in giving up

lyric gyro
#
    public void onInventoryClick(InventoryClickEvent event) {
        Player p = (Player) event.getWhoClicked();
        p.sendMessage("2");
        Inventory inventory = event.getInventory();
        ItemStack clicked = event.getCurrentItem();
        if (clicked.getItemMeta().getLore().equals(ChatColor.GREEN + "" + ChatColor.BOLD + "ยงaReinforced Rune")) {
            p.sendMessage("1");
            if (p.getItemOnCursor().equals(Material.IRON_BOOTS)) {
                p.sendMessage("3");
            }
        }
    }}
Why wont it work?```
lyric gyro
#

If youโ€™re learning networking tho itโ€™s whatever

graceful hedge
#

RabbitMQ ๐Ÿ˜Œ

sharp hemlock
lyric gyro
#

Ik imo shouldโ€™ve added redis support before making your own sockets.

#

You do you tho

graceful hedge
#

yeah, redis pub/sub (I assume that's what you'd use) is quite sophisticated as opposed to your own ducttaped mq

lyric gyro
#

Rabbit these nuts mq plur

graceful hedge
#

๐Ÿ˜

dense galleon
#

hardest question ever asked here

#

How would you go about creating some algorithm which once a command is ran, it randomly creates a shape like this on the ground?

#

I know it consists probably of three loops (one for each X Y Z coordinates) but like

#

How do I have it get a shape like that, without having weird floating blocks?

graceful hedge
#

maybe noise

#

or like

#

the things normal minecraft world gen uses

graceful hedge
#

๐Ÿ˜ณ

versed skiff
#

hey there, when I open an inventory inside of an InventoryClickEvent, the event basically stops working until i relog. any ideas?

versed skiff
#

yeah

dusky harness
#

๐Ÿค” did you try putting a print statement at the very beginning of the method?

#

hm

versed skiff
#

yeah yeah I did

#

doesn't send

dusky harness
#

what if you close the inventory before opening the inventory?

versed skiff
#
 e.getWhoClicked().closeInventory();
                new BukkitRunnable() {
                    @Override
                    public void run() {
                        EnchantInventory enchantInventory = new EnchantInventory(null);
                        enchantInventory.loadMenu((Player) e.getWhoClicked());
                        Inventory inventory = enchantInventory.openInventory((Player) e.getWhoClicked()); // Opens the inventory
                        inventory.setItem(12, item1);
                        inventory.setItem(10, item2);

                        inventory.setItem(14, EnchantInventory.BookForEnchant(new Explosive()));
                        inventory.setItem(15, EnchantInventory.BookForEnchant(new Explosive()));
                        inventory.setItem(16, EnchantInventory.BookForEnchant(new Explosive()));
                        cancel();
                }.runTaskLater(plugin, 1L);

this is what I'm doing

rustic swift
#

Someone knows how to hook your plugin with some cron thing?

#

I want to make a schedules plugin

dense galleon
dense galleon
#

I stole the code for minecraft explosions and I am altering it

graceful hedge
dense galleon
#

works like a charm huehue

woven comet
versed skiff
#

nope

woven comet
#

yeah was just curious since ive previously had this issue before and wanted to see if anyone had helped with a fix yet

formal locust
#

Guys can anyone help me with this problem?

night ice
night ice
lyric gyro
formal locust
night ice
formal locust
#

ok

night ice
#

So... The issue is you are calling the config even before its getting intialized or saved

night ice
#
public class Main extends JavaPlugin {

    private Plugin plugin;
    private String prefix;
    @Override
    public void onEnable() {
        new Gamemode(this);
        new Creative(this);
        new Survival(this);
        new Spectator(this);
        new Adventure(this);
        new PlayerTeleport(this);
        new KBStick(this);
        saveDefaultConfig();
        prefix = (plugin.getConfig().getString("Prefix"));
        System.out.println(Util.chat("Core enabled"));
    }
    @Override
    public void onDisable() {
        System.out.println(Util.chat("Core disabled"));
    }
}
formal locust
#

oo

#

Thnx :)

night ice
night ice
formal locust
#

okok

#

;--; this error came out

dusty frost
#

which line is line 25

formal locust
#

prefix = (plugin.getConfig().getString("Prefix"));

dusty frost
#

i have a feeling i know

#

yea

lyric gyro
dusty frost
#

so put this there instead of plugin

formal locust
#

ok

night ice
dusty frost
formal locust
#

@night ice @dusty frost Very thanks it is working now! โค๏ธ

lyric gyro
#

its customizer

#

owls

night ice
#

Also... If u are gonna use the plugin anywhere else.. Its safe to point plugin to the class...

plugin=this;

lyric gyro
#

everything used to work

night ice
dusty frost
#

oh yeah I thought that was your plugin lmao

lyric gyro
#

hm

dusty frost
sand minnow
#

Hey, is anyone where good with CSS and HTML, I ran into a problem that my media print rules are getting overwritten and I can't style the print view of the website. I'm out of options :/

formal locust
#

@night ice Can u help me with this please

#

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

#

this line is giving error

night ice
#

Could you please show me what's the error

#

@formal locust

formal locust
#

ok

#

The method registerEvents(Listener, Plugin) in the type PluginManager is not applicable for the arguments (JoinEventVanish)

#

@night ice

night ice
#

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

#

the comma

formal locust
#

oo

#

@night ice

#

;--;

night ice
#

whats the error...?

#

like null pointer? illegalArgument?

#

also provide the code too

formal locust
#

null pointer

#

and its about registering event

night ice
formal locust
#

o

#

import me.xylo.hgstaffutils.Utils.Util;
import me.xylo.hgstaffutils.commands.gamemode.*;
import me.xylo.hgstaffutils.commands.knockbackstick.KBStick;
import me.xylo.hgstaffutils.commands.randomteleport.*;
import me.xylo.hgstaffutils.commands.vanish.JoinEventVanish;
import me.xylo.hgstaffutils.commands.vanish.VanishCommand;

import java.util.ArrayList;

import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;

public class Main extends JavaPlugin {

    public ArrayList<Player> vanished = new ArrayList<>();
    private Plugin plugin;
    private String prefix;
    
    @Override
    public void onEnable() {
        new VanishCommand(this);
        new Gamemode(this);
        new Creative(this);
        new Survival(this);
        new Spectator(this);
        new Adventure(this);
        new PlayerTeleport(this);
        new KBStick(this);
        saveDefaultConfig();

        prefix = (this.getConfig().getString("Prefix"));
        System.out.println(Util.chat("Core enabled"));
    }
    @Override
    public void onDisable() {
        System.out.println(Util.chat("Core disabled"));
    }
}

#

import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.plugin.Plugin;

import me.xylo.hgstaffutils.Main;

public class JoinEventVanish implements Listener {
    
    Main plugin;
    
    public JoinEventVanish(Main, this) {
        this.plugin = plugin2;
    }
    
    @EventHandler
    public void onJoin(PlayerJoinEvent e) {
        Player player = e.getPlayer();
        for (int i = 0; i < plugin.vanished.size(); i++) {
            player.hidePlayer(plugin, plugin.vanished.get(i));
        }
    }

}

night ice
#

the code is wrong

formal locust
#

watttt

#

;--;

night ice
#

you can't assign this there...it will point to the same class..moreover, there is no plugin2

formal locust
#

o

night ice
#
public class JoinEventVanish implements Listener {
    
    private final Main plugin;
    
    public JoinEventVanish(Main plugin) {
        this.plugin = plugin;
    }
    
    @EventHandler
    public void onJoin(PlayerJoinEvent e) {
        Player player = e.getPlayer();
        for (int i = 0; i < plugin.vanished.size(); i++) {
            player.hidePlayer(plugin, plugin.vanished.get(i));
        }
    }

}
formal locust
#

hidePlayer and showPlayer is also asking hidePlayer(Player)

#

but i made it plugin, player

dense drift
#

d;spigot player#showplayer

uneven lanternBOT
#
void showPlayer(@NotNull Plugin plugin, @NotNull Player player)```
Description:

Allows this player to see a player that was previously hidden. If another another plugin had hidden the player too, then the player will remain hidden until the other plugin calls this method too.

Parameters:

plugin - Plugin that wants to show the player
player - Player to show

night ice
dense drift
#

Yeah

#

But it probably calls the right one internal

night ice
dense drift
#

Yup

night ice
#

Hey a bit of mathematical doubt...

https://imgur.com/a/i0ZBsdR

I would like to create a bounding box like this...i have the mid point and radius that needed...so anyknow how to get other 2 points?

lyric gyro
#

radius?

night ice
#

like...the bounding box should have a size right?

lyric gyro
#

what measure do you have exactly?

#

because radius is probably the most inadequate term for this lmao

night ice
#

I can get the mid point of the rectangle...

lyric gyro
#

you can?

night ice
#

means...i would xD

icy shadow
#

you can't

lyric gyro
#

okay let's

#

roll back

#

what do you already have?

#

what is known?

night ice
#

i only have the location where the entity will spawn...i want to create a bounding box of where the entity got spawned as the mid point or centre

lyric gyro
#

so you only have the center

night ice
#

yeah

lyric gyro
#

then where does the size come from?

night ice
#

its configurable...

lyric gyro
#

so then it is known

night ice
#

apparently yeah

lyric gyro
#

lol piggy

#

ok

wheat carbon
#
1. get center
2. get coordinate 1:
    i)  add "radius" to x component of center
    ii) add "radius" to z component of center
3. get coordinate 2:
    i)  subtract "radius" from x component of center
    ii) subtract "radius" from z component of center
4. u have 2 corners, make a bounding box with them```
#

sorry i'm an asshole

lyric gyro
#

i thought you were a pig

#

good to know tho

wheat carbon
#

pig that strongly resembles an asshole

#

do those instructions look right to u?

lyric gyro
#

absolutely