#help-development

1 messages ยท Page 2283 of 1

ornate patio
#

Hello I have a question I am developing a shop with a minecraft gui we can add buttons writeable with spigot / Bukkit or I have to pass with forge, can you enlighten me please thanks in advance

rare flicker
#

you can make inventory UI's

#

or if you're really cracked at plugin dev do smth fancy with fake armorstands and packets to have a 3d menu

#

but if you want a menu like minecraft's escape menu you'll have to use mods

worldly ingot
#

It depends entirely on what you mean by "button"

#

On the server side you're restricted to vanilla inventories and listening for click events. So in that sense, yes, you can create a button and you can texture it with a resource pack. You can also make use of negative font widths and inventory titles to render a custom background texture in an inventory, but you're still limited to static textures and a fixed inventory size. If you want custom inventory rendering for a custom button with highlighting, yes, you will need a client-sided mod

#

If you just want a simple button in an inventory, you can use items

rare flicker
#

negative font width?

#

pretty fancy way to make a background, wasn't even aware that this was a thing

wary harness
#

is this comming from spigot

#

Is there any settings to allow more packets to be sent

tardy delta
ornate patio
rare flicker
#

๐Ÿ‡ซ๐Ÿ‡ท par exemple si tu veut faire un shop ou tu vends 5 de fer, fait en sorte que l'itemstack du lingot de fer dans ton menu soit de 5 @ornate patio

eternal oxide
#

@vivid cave I filled out the rest of that packet java ClientboundRespawnPacket respawn = new ClientboundRespawnPacket( nmsLevel.dimensionTypeId(), // dimensionType nmsLevel.dimension(), // dimension nmsLevel.getSeed(), // Seed serverPlayer.gameMode.getGameModeForPlayer(), // playerGameType null, // previousPlayerGameType nmsLevel.isDebug(), // isDebug nmsLevel.isFlat(), // isFlat true, // keepAllPlayerData serverPlayer.getLastDeathLocation() // lastDeathLocation );

worldly ingot
#

Did you find it in BT?

eternal oxide
#

Yep you were correct it was the old name

worldly ingot
#

Yeah I'd figured that was the case. I hope all mappings are dropped in favour of Mojang mappings in the future

#

Right now it's a mangling of both lol

quaint mantle
#

Sup, I have a plugin which depends on a non-plugin library (I put the library in plugins/lib)
I added -cp C:\path\to\server\plugins\lib\* to the start command batch file, but it still throws classNotFoundError

eternal oxide
#

Windows search couldn't find the sky for looking.

ornate patio
eternal oxide
#

Same, I like Mojang mappings

quaint mantle
#

it fails because it cannot find a class in the library

#

it should be loaded to the classPath right? it is the right directory it's in.

valid solstice
#

Hello, how do you make a player invisible without removing any of their armor, weapon, and offhand

vivid cave
#

but like isn't there a way to say "you're controlling that new player now"

eternal oxide
#

Not that I can see

solid cargo
#

Whats the diff between AsyncPlayerChatEvent and PlayerChatEvent? One is run on the server thread or sum like that?

worldly ingot
#

PlayerChatEvent on the server thread, AsyncPlayerChatEvent on a separate thread

#

You should use the async one over the main thread one pretty much every single time

solid cargo
#

To fight chat reports is there a one which is better?

worldly ingot
#

What chat reports?

river oracle
#

None

#

It's not out yet

#

Can't remove something that doesn't exist bozo

worldly ingot
#

And we're also not going to encourage you to do it here either when it does come available ;p

#

You're on your own if you want to disable a player safety feature

river oracle
#

I'd happily help when the time comes but why bother worrying about something that hasn't been included yet

solid cargo
#

So im completely on my own for now?

worldly ingot
#

Yes

river oracle
#

It's not out yet so there's nothing to even do

solid cargo
#

Resources that fight it will get removed?

river oracle
#

Nah likely not

river oracle
#

Then you can't even deploy those changes since the updates not even out on spigot or minecraft

worldly ingot
#

We won't remove them from the platform because that's not really our responsibility. If you want to disable that feature and harm your users, you're welcome to do that. We have other potentially EULA-violating plugins as well. Though we're not going to encourage you to publish it because we're not going to actively go against Mojang here

vivid cave
worldly ingot
#

But you're really fighting a non battle

eternal oxide
#

I just like to get everythign right ๐Ÿ˜‰

vivid cave
#

^^

#

thanks so much for all your efforts!

solid cargo
#

Idk had idea of disablin via chat event -> cancel message -> broadcast it instead

#

Will try that when spigot 19.1 is out

cunning canopy
#

if I have a location like this (0, 0, 0) any way to make it so that I can subtract a block

#

like the way the player is looking

#

if that makes any sense at all

river oracle
solid cargo
glossy venture
#

how is the player chat reports player safety

worldly ingot
#

THEN WHY ARE YOU DISABLING IT? KEKW

#

Are you dumbasses reporting yourselves?

glossy venture
#

potential autocensor or smth

#

if they ever implement that

worldly ingot
#

JAVA DOESN'T HAVE A FILTER

#

Well, it does, but it's controlled by the server owner

#

It's had a configurable filter for like 3 major versions now

solid cargo
worldly ingot
#

bro

glossy venture
#

i know but with the path microsoft is taking it may have one, its also nice to have more control over the chat system

worldly ingot
#

That's the stupidest shit I've ever heard

#

You calling 911 on each other too?

solid cargo
#

YOU NEVER FUCKING KNOW

old cloud
#

Some packets that deal with containers use the "State ID" field. Can someone pls explain what that field is supposed to do? Because I don't get it.

worldly ingot
#

Don't play with fire if you don't want to get burned. It's really not that hard

glossy venture
#

well why not disable it

cunning canopy
#

I am teleporting a sheep on top of a players head. When the player looks up the sheep is blocking the view. How can I like make it go a little backwards once you look up?

worldly ingot
#

The last recieved State ID from either a Set Container Slot or a Set Container Content packet
It's really just an arbitrary number

quaint mantle
# quaint mantle Sup, I have a plugin which depends on a non-plugin library (I put the library in...

I found this. https://bukkit.fandom.com/wiki/Using_External_Libraries_with_Plugins
I don't want to shade the library because I want to use it in multiple plugins.
I tried adding the classPath argument in the batch file: -cp "C:\path\to\server\lib\*" (Where the jar of the library is in the /lib folder). This did not work (ClassDefNotFoundError for a class in the library used) (I tried many variations of -cp path none worked)
I saw some stuff with "instructing the classloader to load the class" but that seemed too much for such a simple task.

worldly ingot
#

It's to make sure changes to an inventory are linear

solid cargo
#

Anyways. Take this, choco, to calm the fuck down

worldly ingot
#

I'm calm, but I'm just dealing with stupidity daily lol

#

I've got 3 dogs myself

worldly ingot
#

I mean you can ignore it

merry plover
#

how to use for discord bot?

worldly ingot
#

They're inbound packets that use it

old cloud
#

Ye, but what does the client do with that information?

somber sequoia
#

yo is there any way to get the plugin version

#

cant figure that one out

worldly ingot
#

Not sure what the client does with it

#

You could probably send 0 for the state id. Again, I'd imagine it's an ordering thing

old cloud
#

ok lol, well thanks for the info

worldly ingot
#

Otherwise if you're using a custom library that you wrote, yeah, you'll have to shade and relocate it

#

Or, alternatively, make that library a plugin and have your dependents depend on it

naive bolt
#

what event would be fired on dripleaf falling

#

if their would be

cunning canopy
#

How do I hide an entity for certain players

cunning canopy
#

thanks

worldly ingot
cunning canopy
#

any other options?

lost matrix
cunning canopy
opal juniper
#

That it is new and not thoroughly tested and also could change syntax

#

but personally, it seems likely to stay

cunning canopy
#

so it means it can be ok to use afterall?

opal juniper
#

its deprecated so that you can see it in the IDE - just so that you know there are caveats with using it

cunning canopy
#

okay

#

will it work with older versions of the game?

opal juniper
#

depends when it was introduced

#

it has been there for a little while but not that far back

cunning canopy
#

how far back we talking?

reef lagoon
#

Why is it always always equal to 0 when i divide it?

eternal night
#

your list as best has one entry

#

1 / 2 = 0 in java int division

reef lagoon
#

I'm so stupid

lost matrix
reef lagoon
#

just the location of "list"

#

ty anyways

cunning canopy
#

any way to see on the docs when a method was introduced?

lost matrix
cunning canopy
#

yes it definitly would

#

considering a whole ton of the playerbase is stuck in 1.8

lost matrix
#

75% are on 1.17 and above. Even 1.12 has a bigger playerbase than 1.8

#

And writing plugins for 1.8 is an absolute nightmare. You can throw practically half of your code in the trash.

cunning canopy
lost matrix
cunning canopy
#

what is bstats?

lost matrix
cunning canopy
#

if I understand correctly this is a plugin?

lost matrix
#

Nope. Its a statistics tracking library. People usually shade it into their plugin to track usage.

cunning canopy
#

oh

#

but

#

wat about the major pvp servers

#

It isnt guaranteed that those use bstats?

vocal cloud
#

No, it's just highly likely they use a free plugin that contains bstats within it.

lost matrix
# cunning canopy It isnt guaranteed that those use bstats?

No its not guaranteed but very likely. Also people that want to play on big pvp servers will hop onto the handful of established 1.8 pvp servers that are still up.
1.8 is a bubble where everyone thinks that the whole world is playing 1.8 while in reality they are a minority.

vocal cloud
#

It's also tech debt that keeps these servers on those versions. If most were to make a new server today it would undoubtedly be on a much newer version.

cunning canopy
#

ok so I should go for the new version playerbase?

lost matrix
cunning canopy
#

I understand

#

Will I as easily be able to get in new players?

eternal oxide
#

Depends how good you make your server

cunning canopy
#

ok let me rephrase

#

as esay

#

easy

#

oh nvm

#

I did say that

#

ok

#

but how far back should I support

eternal oxide
#

again, depends on how much you want to struggle. Newer teh API, the better it is

#

back to 1.16.5 covers about 90% of the player base?

cunning canopy
#

cool

glossy scroll
#

new API is added almost every day

#

eh, rather every week

quiet ice
#

Myes, but rarely is that new API of use

last swift
#

Iโ€™m utilizing Multiverse to have multiple worlds, but upon teleporting the player via player.teleport() and then setting their gamemode to spectator via player.setGamemode(), the player ends up in survival mode since Multiverse sets the playerโ€™s gamemode automatically. However, I donโ€™t want to switch the gamemode for the world to spectator since I end up teleporting other players to the world and want their gamemode to be survival. Is it possible to force a playerโ€™s gamemode and override it over Multiverse? Hope that makes senseโ€ฆ

eternal oxide
#

manage-gamemodes in Multiverse config I believe

sterile token
#

๐Ÿค”

#

Because the rules said that the plugins should work without ethernet connection

#

๐Ÿ˜‚

valid folio
#

Hello! I wanted to know if i typed unicode correctly

#

{"providers":
[
{"type":"bitmap","file":"custom/admin.png", "ascent":7,"height":7,"chars":["๊ˆ"]}
{"type":"bitmap","file":"custom/VIP.png", "ascent":7,"height":7,"chars":["๊ˆ"]}
]
}

lost matrix
sterile token
#

They are so fkcing amazing

#

Becaue spigot break his own rules

#

Because spigot must use internet to work

#

๐Ÿคก

vocal cloud
#

Bstats doesn't make you require an internet connection lmfao.

sterile token
#

thru the air?

vocal cloud
#

If it can't it doesn't. Simple

sterile token
#

๐Ÿ˜ฌ

lost matrix
vocal cloud
#

Use your brain. If there's no internet it doesn't do anything

#

Therefore it doesn't require internet

sterile token
#

But im saying what said spigot rules

#

๐Ÿ˜‚

valid folio
#

No. I spelled it incorrectly when i do this alone {"type":"bitmap","file":"custom/admin.png", "ascent":7,"height":7,"chars":["๊ˆ"]} i works, but when i do both of them it doesn't. And yeah i want to know if i done that incorrectly. And how to fix it

sterile token
#

They are so funny lmao

quiet ice
quiet ice
#

Sure, the website requires internet connection - but this is about plugins

eternal oxide
#

bstats breaks no rules. it fully works without the internet. Its your fault you can't see the website ๐Ÿ™‚

sterile token
quiet ice
#

Yes

sterile token
#

My bad

valid folio
sterile token
#

Im really dumb

valid folio
#

I have no idea how it works in general

lost matrix
sterile token
#

7smile each {} is an object right?

lost matrix
#
[
  {},
  {},
  {}
]
lost matrix
sterile token
#

Oh ok

#

Its more or less similar to yaml

#

In yaml they are called ConfigSection in json they are just object

lost matrix
sterile token
#

Oh i figure yeah because they are the same

#

But json uses more characters for saving data

valid folio
#

@lost matrix

#

{"providers":
[
{"type":"bitmap","file":"custom/VIP.png", "ascent":7,"height":7,"chars":["๊ˆ"]},
{"type":"bitmap","file":"custom/VIP.png", "ascent":7,"height":7,"chars":["๊ˆ"]},
{"type":"bitmap","file":"custom/VIP.png", "ascent":7,"height":7,"chars":["๊ˆ"]}
]
}

sterile token
#

And i think that json is fasther than yaml when came in terms of data savomg

valid folio
#

Is hat right format?

valid folio
#

Ok i'am really thankfoul

sterile token
#

So you ill have an array "providers" and them 3 objects

#

No problem if need something else just ask it here

#

Have a good day

#

Oh lmao im starting to hate paginated/paged menus

cunning canopy
#

how would I go about letting an arrow pass through an entity

lost matrix
cunning canopy
#

would it be possible to see if an entity was hit by an arrow

#

and shoot it out with the same velocity?

lost matrix
#

What you can do us listen to the event, cancel it and teleport the arrow forward at the end of the BoundingBox.

#

Requires some math.

#

Using the angle and BoundingBox dimensions.

cunning canopy
#

oh

#

seems like there is a

#

entity.spigot().setCollidingWithEntitiesFalse

last swift
dull whale
#

anybody know a good lib for spawning shapes/effects with particles?

quaint mantle
#

Just come in here and ask 7smile7

#

hes a genius

lost matrix
#

objection, heresay

vocal cloud
#

Yet not a discord helper

lost matrix
vocal cloud
#

Maybe it's cause your PFP involves touching grass and we can't have that here.

eternal night
#

its greenscreen

ivory sleet
#

We do have โ€œcandidatesโ€ although there was a while since last time we discussed newcomers to the team ๐Ÿ˜›

quaint mantle
#

You make it sound so professional

ivory sleet
#

Do I?

quaint mantle
#

Yes

ivory sleet
#

Hmm

quaint mantle
#

i guess we are a "Team" but i wouldnt like put that on my resume

ivory sleet
#

Lol

lost matrix
vocal cloud
#

Imajin pretending the other helpers don't exist

quaint mantle
#

False.

#

I dont put myself above everybody

#

Its just my personality

quaint mantle
vocal cloud
#

You don't need to put yourself above everyone if they don't exist

ivory sleet
#

Proceeds to be supercilious/s

lost matrix
vocal cloud
#

Time to create a lib/s

carmine valley
#

hey guys, I get this error when I try to run the command /play 1

the error: https://prnt.sc/dI063YO1vKvB

the code:

public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if(sender instanceof Player){
            Player p = (Player) sender;
            hub = p.getLocation();
            if(args[0] == "1"){
                p1 = p;
                p1Lives = 3;
                plugin.addPlayer(p1);
                plugin.updateScoreboard();
            }else if(args[1] == "2"){
                p2 = p;
                p2Lives =3;
                plugin.addPlayer(p1);
                plugin.updateScoreboard();
            }else{
                if(p1 != null && p2 != null){
                    p1.setBedSpawnLocation(SetLocationCommand.getFirstLocation());
                    p2.setBedSpawnLocation(SetLocationCommand.getSecondLocation());
                    p1.teleport(SetLocationCommand.getFirstLocation());
                    p2.teleport(SetLocationCommand.getSecondLocation());
                    p1.addPotionEffect(SLOWNESS);
                    p2.addPotionEffect(SLOWNESS);
                    TitleApi.sendTitle(p1, ChatColor.GREEN + "" + ChatColor.BOLD + "3", "", 0, 20, 0);
                    TitleApi.sendTitle(p2, ChatColor.GREEN + "" + ChatColor.BOLD + "3", "", 0, 20, 0);
                    Bukkit.getScheduler().runTaskLater(plugin, () -> {
                        TitleApi.sendTitle(p1, ChatColor.YELLOW + "" + ChatColor.BOLD + "2", "", 0, 20, 0);
                        TitleApi.sendTitle(p2, ChatColor.YELLOW + "" + ChatColor.BOLD + "2", "", 0, 20, 0);
                    }, 20);
                    Bukkit.getScheduler().runTaskLater(plugin, () -> {
                        TitleApi.sendTitle(p1, ChatColor.RED + "" + ChatColor.BOLD + "1", "", 0, 20, 0);
                        TitleApi.sendTitle(p2, ChatColor.RED + "" + ChatColor.BOLD + "1", "", 0, 20, 0);
                    }, 40);
                    Bukkit.getScheduler().runTaskLater(plugin, () -> {
                        TitleApi.sendTitle(p1, ChatColor.DARK_AQUA + "" + ChatColor.BOLD + "Brawl!", "", 0, 10, 0);
                        TitleApi.sendTitle(p2, ChatColor.DARK_AQUA + "" + ChatColor.BOLD + "Brawl!", "", 0, 10, 0);
                    }, 60);
                }
            }
        }
        return true;
    }```
#

main class: ```java
public final class MCBrawl extends JavaPlugin {

private JGlobalScoreboard scoreboard;

@Override
public void onEnable() {
    System.out.println("MCBrawl loaded successfully!");
    getServer().getPluginManager().registerEvents(new Knockback(this), this);
    getServer().getPluginManager().registerEvents(new DoubleJump(this), this);
    getServer().getPluginManager().registerEvents(new Misc(this), this);
    getCommand("play").setExecutor(new PlayCommand(this));
    getCommand("SetLocation").setExecutor(new SetLocationCommand());
    scoreboard = new JGlobalScoreboard(
            () -> {
                return "&e&lMCBRAWL";
            },
            () -> {
                return Arrays.asList(
                        "",
                        "&6" + PlayCommand.returnFirstPlayer().getDisplayName() + " : "
                                + "&r&a" + PlayCommand.returnFirstPlayerLives(),
                        "",
                        "&6" + PlayCommand.returnSecondPlayer().getDisplayName() + " : "
                                + "&r&a" + PlayCommand.returnSecondPlayerLives(),
                        "",
                        "By IR3DX",
                        "@R3D#0404"
                );
            }
    );
}

@Override
public void onDisable() {
    System.out.println("MCBrawl disabled successfully!");
}

public void addPlayer(Player p){
    scoreboard.addPlayer(p);
}
public void updateScoreboard(){
    scoreboard.updateScoreboard();
}

}```

valid folio
#

What does this mean?

lost matrix
#

First of all

args[0] == "1"

Dont compare objects with ==. This will pretty much always be false.
Use .equals() instead

carmine valley
#

edited that

sterile token
#

What the heck is com.tuinity:tuinity?

quaint mantle
#

Tuinity server jar

lost matrix
sterile token
#

Oh ok

#

Thnks

#

Amazing repo i find

#

Instead of using build tools for spigot jars

#

I can use that

lost matrix
carmine valley
lost matrix
eternal night
#

Just distribute mojang code 5Head

sterile token
#

I will use it for coding plugins faster, so i skeep the proccess of building every spigot locally and then install it to local repo, etc

carmine valley
sterile token
#

If you are on linux you can copy everything like marking the text and pressing right click

eternal night
sterile token
#

Its public

#

I mean i can use every artifact from the repo

eternal night
#

So you are publicly distributing code you don't own nor have a licence for ?

sterile token
#

๐Ÿ˜‚

#

what what

carmine valley
sterile token
#

the repo is not mine

eternal night
#

ah

sterile token
#

I find it on google

#

And i asking if illegal to use it for coding

#

๐Ÿค”

alpine urchin
#

duckduckgo users rn

#

:c

eternal night
#

Well, the repo itself is not legal to be up

#

if it distributes mojang code

alpine urchin
#

yeah vague area

sterile token
#

what means redistrubite mojang code

eternal night
#

Well, you can just download the server from there

alpine urchin
#

sharing mojang code

sterile token
#

Because the spigot itself redistrube mojang code

eternal night
#

it does not

#

that is why you run build tools

alpine urchin
#

should

eternal night
#

and why you are building the server on your local system

alpine urchin
#

he prolly didnt

sterile token
#

spigot uses mojang server internally to work

eternal night
#

OH LOL

cunning canopy
alpine urchin
#

buildtools downloads mojang code on your pc

eternal night
#

using something != distributing something

alpine urchin
#

and modifies it

sterile token
#

Okay because i have a community with friends and we want to have a private repo with the spigots artifacts all together

alpine urchin
#

ok

sterile token
#

So then we dont depend from 3rd party repos

#

And also for uploading our custom libs

#

That my final point

eternal night
#

should not be an issue to have a private repository. Tho also like, just use paperweight userdev ๐Ÿ˜›

sterile token
#

That the repo i find

#

Can u take a look

#

Also here is redistributing mojang code ๐Ÿค”

sage patio
eternal night
#

Yea I know that repo

sterile token
#

It not mine repo

#

Its also a nexus repo

eternal night
#

Well, don't use it /shrug

serene onyx
sterile token
#

what lynx?

eternal night
#

Well use a proper setup for nms

sage patio
sterile token
#

More or less i would need a private repo for setting up all our artifacts and spigot, spigot-api, nms etc

serene onyx
sterile token
#

They are just for the money

eternal night
#

They might not, but respecting their licence is just like

sterile token
#

Imagina if they dont care about pay2win servers

#

๐Ÿ˜‚

eternal night
#

decent behaviour

sterile token
#

I know happen the same with eula bruh

#

Most minecraft servers breaks eula rules

#

And mojang doesnt care that why

#

We also dont give access to that private repo they only will be used by our custom plugins

#

And thanks lynx you always answering i really appreciate that

#

๐Ÿ‘

eternal night
#

Yea if it is a private one you should be fine ๐Ÿ‘

sterile token
#

I never thought about that

eternal night
#

I mean, as long as the source does not contain the server jar xD

sterile token
#

Oh ok

eternal night
#

coding against it is not the same as distributing it

sterile token
lost matrix
sterile token
eternal night
carmine valley
buoyant viper
sterile token
#

So lyn if do public the repo and only upload the spigot and spigot-api artifacts i wouldnt break rules?

eternal night
#

Yea

#

Well

#

spigot includes the entire server

sterile token
#

Hmn yeah that why

lost matrix
sterile token
#

Its so diff this

#

Because legal proccess can literally break your mom

#

๐Ÿ˜ฌ

lost matrix
undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

eternal night
#

the spigot minecraft mapped jar still contains the entire server

#

in 1.18

#

no ?

#

isn't that how spigot does NMS

young knoll
#

Yes

eternal night
#

yea

young knoll
#

So does the unmapped one

eternal night
#

but yea, spigot just shits them back together

#

so people don't have to define mojang libs manually

sterile token
#

Col have you read all what we talking ? hehehe

#

I think its a interestic topic

#

Maybe i open a thread

lost matrix
sterile token
lost matrix
carmine valley
sterile token
#

Allright thanks to all lynx, smile and coll

lost matrix
carmine valley
#

just a simple if null then return "" ?

sterile token
#

I will talk to my friends and try to find a solution for this. Because we must need a private repo for hosting all the spigot artifacts because it a mess if not

lost matrix
sterile token
#

also why now yaml warns about nulleale

#

Its a mess using that spigots

#

I couldnt find a way to not care them without adding an annot

unborn kiln
#

Is there a way to get the number of enchants on an item in a persons hand?

sterile token
cunning canopy
#

is entity.spigot().setCollidesWithEntities(false); still a thing?

sterile token
#

Also have you checked if exists in the jd-.s from your version

cunning canopy
#

1.16-1.19

sterile token
cunning canopy
#

I cant find it in 1.19

unborn kiln
cunning canopy
#

does it mean its gone?

sterile token
#

Because maybe exists on 1,19 but not on 1.16

sterile token
lost matrix
lost matrix
#

crunch from @waxen plinth

carmine valley
# lost matrix A null check could help.

so I wrote that java if(PlayCommand.returnFirstPlayer().equals(null)){ player1Name = ""; }else{ player1Name = PlayCommand.returnFirstPlayer().getDisplayName(); } if(PlayCommand.returnFirstPlayer().equals(null)){ player2Name = ""; }else{ player2Name = PlayCommand.returnSecondPlayer().getDisplayName(); } but I'm not sure where it should be properly placed

#

just in my onEnable method?

cunning canopy
#

where can I download spigot 1.19 api

carmine valley
#

didn't you tell me to use .equals earlier?

lost matrix
carmine valley
cunning canopy
#

where do I get the api dependencies?

lost matrix
cunning canopy
#

spigot

lost matrix
#

What do you mean by "get"?

cunning canopy
#

I mean download

#

dependencies

lost matrix
#

You should let maven handle pulling transitive dependencies

cunning canopy
#

I am using intellij ideas build artifact thingy

#

where I downloaded the 1.8 api jar file

#

for spigot

buoyant viper
#

๐Ÿ™

cunning canopy
#

so where can I get the 1.19 one

delicate lynx
#

please use maven or gradle

lost matrix
cunning canopy
#

doesn't IntelliJ idea use maven when building artifacts?

quaint mantle
#

Its its own build system i think

#

Which of course can use the maven repo

cunning canopy
#

I think it uses ant

#

after seeing the build logs

#

that good enough?

quaint mantle
#

Just use maven or gradle ๐Ÿ˜’

cunning canopy
#

how do I get started with maven?

cunning canopy
#

you can get plugins for intellij?!

quaint mantle
#

๐Ÿ’€

cunning canopy
#

how

quaint mantle
quaint mantle
#

plugins

#

Explore

#

"minecraft dev plugin"

cunning canopy
#

is there any settings I need to alter with when installing

#

like what next

quaint mantle
#

Nope

#

Create new project

cunning canopy
#

can I just copy in my old project without changing the structure afterwards?

quaint mantle
#

Sure

cunning canopy
#

how do I build with the new plugin?

carmine valley
vocal cloud
#

No lol you run mvn package

quaint mantle
#

The run button works

vocal cloud
#

If you've set it up

#

And don't install

cunning canopy
#

since when is a folder called a package?

opal juniper
#

since forever in java

quaint mantle
#

Forever

opal juniper
#

and other langs

cunning canopy
#

anyway to set it up so that the generated file goes in another "package"?

sterile token
#

You mean for example your project having mongo-driver inside your plugin?

carmine valley
sterile token
cunning canopy
#

setting the target folder to another folder

sterile token
#

Oh uingmaven?

cunning canopy
#

ye

sterile token
#

I have the solution

#

1 sec

carmine valley
sterile token
#

Let me find it

sterile token
#

Wait please

#

I help one and then the other

carmine valley
#

take your time

sterile token
#

@cunning canopy add this:

<build>
  <plugins>
    <plugin>
      your plugin setting here
      <configuration>
        <outputFile>path/to/folder</outputFile>
      </configuration>
    </plugin>
  </plugins>
</build>
cunning canopy
#

add this where?

sterile token
#

send me your pom please

cunning canopy
#
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>Mgames</groupId>
    <artifactId>mgames</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>Mgames</name>

    <properties>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>

    <repositories>
        <repository>
            <id>spigotmc-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.19-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
</project>
inland axle
#
            try {
                while(Bukkit.getScheduler().isQueued(task.getTaskId()) || Bukkit.getScheduler().isCurrentlyRunning(task.getTaskId())){
                    Thread.sleep(500);
                }
                Thread.sleep(500);
            } catch (InterruptedException e) {
                Breadwars.logger.log(Level.SEVERE, e.toString());
                return;
            }```

is this ok for checking whether my task is done? could there be an issue with a reused task id?
cunning canopy
sterile token
inland axle
#

wdym

delicate lynx
#

why on this planet are you using thread sleep

inland axle
#

to put the thread to sleep

sterile token
#

You shouldnt do that

delicate lynx
#

absolutely not

sterile token
#

You can block the main thread

inland axle
#

it's not on the main thread

delicate lynx
#

use the scheduler

inland axle
#

that sounds like alot of effort

sterile token
# cunning canopy thanks

If you are using the maven-shade-plugin it will generate many jars so you can add path/file-name.jar to only move the output for a specific jar

delicate lynx
#

well if you're not open to trying, good luck!

inland axle
#

I just scheduel things then wait

sterile token
#

If you dont listen is all what we can tel lyou

#

We are explaning how to do it...

#

@cunning canopy coould you understand? Sorry for pinging

inland axle
#

arl but good idea to just call a function when task exit

cunning canopy
#

ye

cunning canopy
#

I am new to maven

#

and have no Idea how pom.xml works

#

but I think it works

#

apparently maven is denied access to the folder

#

any clues?

inland axle
#

did you run it as root earlier?

cunning canopy
#

im on windows...

sterile token
#

But some days before started to work

#

I just ended up that maven was crazy

cunning canopy
#

and the solution is?

sterile token
#

I dont really know

#

I just leave that shit alone and some days after started to work

#

Maybe ask here because lot of people here uses maven, then can help you

#

Sorry matter

carmine valley
#

@sterile token did you take a look at my code?

sterile token
#

But be patient

#

Im a bit bussy

#

Sfran what are trying to do ?

#

I dont understand

#

If you dont want to create with colores remove the .color()

#

and that all

delicate lynx
#

what the fuck is that code

sterile token
inland axle
eternal oxide
#

ChatColor.RED are teh codes, etc

#

you want to pull a color code from a string?

sterile token
#

Safran if you want the colored thing just do sout of ItemStack#getDisplayname()

#

ChatColor#translateAlternativeColors('&', "colored string") ill apply the color

eternal oxide
#

Why do you want the color? are you comparing the string or something?

#

and you want it to have teh same colour as the item

#

do you know if the colour code is the first character in the name?

sterile token
#

Sfran

#

The method name could be wrtten wrong

#

i just writed by hand on discord

#

That method i told u

#

Is usally used to convert the colored text that use this "&4Red text" into the spigot color

eternal oxide
#

try ChatColor.getByChar(Char)

#

pass in teh first char of the string

#

name.charAt(0)

#

this will only work IF the Name has the color code as its first Char. If there is other formatting like bold, it may not be a color char

#

what is the exact text in the string?

#

the custom name you are trying to fetch the color from

sterile token
#

Yeah he doesnt explain really well

#

Or atleast we dont understand what he wants

#

Either that nor he is trolling us

#

๐Ÿ˜‚

eternal oxide
#

I understand what he wants but yeah, lackign

sterile token
#

neither me

#

Im native spanish speaker

eternal oxide
#

if the first Char is not a color code I'm going to guess he's using RGB colors

sterile token
#

Ohh

#

that why

#

That is diff

brave goblet
#

Are you using ur server om ur pc or?

sterile token
#

Off topic question

#

hahahah

brave goblet
#

no

eternal oxide
#

pulling an rgb is more code than I have time to explain here right now. Too busy

brave goblet
#

cause then he can just copy the name to clipboard with the hex values or what ever

sterile token
#

Yeah rgb are not simply

brave goblet
#

with the ยง symbol

sterile token
#

let me find a tuto for using rgb bro

#

be Patient and wait me

eternal oxide
#

actually its rgb so shoudl be 7 characters?

sterile token
#

I finx that tuto

eternal oxide
#

yes but there is a control code

#

so 7 or 8, I forget

#

lets say 7

#

so Chatcolor.of(first 7 characters from name)

sterile token
#
public static String translate(String message) {
  if (FlameChat.getServerVersion() >= 16) {
    Pattern pattern = Pattern.compile("#[a-fA-F0-9]{6}");
    Matcher matcher = pattern.matcher(message);
    while (matcher.find()) {
      String color = message.substring(matcher.start(), matcher.end());
      message = message.replace(color, ChatColor.of(color) + "");
      matcher = pattern.matcher(message);
    }
  }
  return ChatColor.translateAlternateColorCodes('&', message);
}```
#

I find that also

eternal oxide
#

yep 7 chars

sterile token
#

Elegar is that okay?

#

I find that for him

quaint mantle
#

Hi :D I have a world creator plugin but i wanna make permissions. That means if e.g. player creates a new world, then the player who createt the world will be given the permission world.owner and he can delete it and so on. But how do i do that. I have to use for() or smth like that and save every players permissions IN EVERY WORLD in the config. I know im overcomplicating this(i hope i do so xd) so do you guys have any suggestions? Thanks :P

eternal oxide
#

that shoudl give him enough to work from

#

it uses regex, all he needs is to get the first match

sterile token
#

Hmn i dont still what he wants....

#

๐Ÿ˜‚

#

I dont know if want to translate the hex into ChatColors

#

Or what the heck

eternal oxide
#

he's trying to pull an RGB code from the custom name of an Item

#

he wants the md5 ChatColor.of(7 char rgb color pulled from Item Name)

quaint mantle
#

Hi D I have a world creator plugin but i

eternal oxide
#

yes

sterile token
#

Hmnn still confuse i think rgb are not for me

#

neither hex

eternal oxide
#

you need the first 7 chars of your String

sterile token
#

He need regex for that

#

I understand know elgar

eternal oxide
#

ChatColor.of(name.subString(0,6)) I forget how to use substring without looking it up

#

Yes, your color is an RGB

eternal oxide
#

it takes up 7 Characters in teh name

#

You only see a color once displayed

#

but its 7 characters long defining it

eternal oxide
#

Yeas, again it has a control character to indicate its an RGB

#

so like #ababed

quaint mantle
#

oh wow thanks for ignoring me

#

:D

#

bitch

vocal cloud
#

You're welcome

eternal oxide
#

kinda busy... bitch

vocal cloud
twilit wharf
#

I am getting this super weird error when opening a gui, I am using a wrapper btw (RedLib)

wicked remnant
#

Am i correct in understanding that 1.8.8 used gson 2.3.1?

eternal oxide
vocal cloud
twilit wharf
#

here is the code if you wanna take a look, I didnt find anything on my own

#

I know where the issue is coming from

vocal cloud
#

The error in there mentions get first available plot or something

twilit wharf
#

yeah

vocal cloud
#

Check for recursion because obviously it's calling itself somewhere

twilit wharf
#

yeah, the first available plot method ran a System.out.println for debugging which is where the error ended

vocal cloud
#

Well what's choose plot line 97?

twilit wharf
#

menu.open(player);

#

ok so

#

I figured out

#

where everything goes wrong

#

so

#

when the player clicks on a item in the inv, it closes the inv, then loads their plot. When they close the inventory, the plugin checks to see if they have a plot loaded, if not reopen the menu

sterile token
#

Mike do u have experience with paginated menus

#

Im really exaust lmao

#

I cannot even see paginated/paged menus

#

Because they are really to deal with them or atleast for me

vocal cloud
#

Yes, there are libs if it's too difficult for you.

#

Guava has some great methods for splitting arrays into pages and then you just need to add the indexing system if you want to do it yourself

sterile token
#

I think i dont understand how they works

carmine valley
#

hi guys, whenever I try to build my project it tells me that one of the packages I imported (JAR) does not exist even though I imported it to my project

#

how can I fix that?

lost matrix
lost matrix
azure hawk
#

how can i make it so that e.g. when i make a command and execute it, and then like a message comes up with "Do you realla wanna do this [Y/N]" and then you can type in chat y or n and if you dont type that in like 10 secs the process is beeing cancelled

carmine valley
eternal night
cunning canopy
#

I used minecraft dev plugin in IntelliJ to setup my plugin project. Is there any way to change the path that the jar file will be put in?

lost matrix
lost matrix
carmine valley
#

literally just a jar file that I specified the path to

lost matrix
lost matrix
azure hawk
carmine valley
#

no errors until I hit run

sterile token
lost matrix
# carmine valley I did

Then build your artifact. If your IDE has no problems with your imports then everything should be fine.

vocal cloud
#

If you're not using someone's library you really want to write a utility class for it.

lost matrix
lost matrix
cunning canopy
#

I used minecraft dev plugin in IntelliJ to setup my plugin project. Is there any way to change the path that the jar file will be put in?

cunning canopy
#

it did not work

sterile token
#

Using maven you can set the output file route

shadow night
#

Is there some kind of list with all items?

sterile token
lost matrix
# cunning canopy I used minecraft dev plugin in IntelliJ to setup my plugin project. Is there any...

With maven? I would configure the maven shade plugin.

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>3.something</version>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>shade</goal>
                    </goals>
                    <configuration>
                        <finalName>${project.artifactId}-${project.version}-something</finalName>
                        <outputDirectory>../guide</outputDirectory> <- Here
                    </configuration>
                </execution>
            </executions>
        </plugin>
sterile token
#

But it said that he doesnt have permissions

#

It used to happen to me but i leave the error alone and days after test it again. And it was fixxed

#

๐Ÿ˜‚

cunning canopy
vocal cloud
#

Not the best idea to do it that way but it can be done.

sterile token
#

๐Ÿ˜ฌ

hot wolf
#

The InventoryCloseEvent also gets triggered when a player dies, is there a way to tell if that was the reason for closing the inventory?

vocal cloud
sterile token
#

Also mike its really painful deadling with paged menus i didnt thought it was so painfull

lost matrix
sterile token
#

The library feels me really ugly

vocal cloud
#

Write your own library

sterile token
lost matrix
sterile token
#

Okay

vocal cloud
#

If the server gets moved or deleted it'd be a pain to get it back, not to mention building a release

sterile token
#

I dont know i just use the outputfile to not to chnage the intellij screen open the server and doing that ass-ole things

vocal cloud
#

Honestly I'd just use Gradle and setup tasks to automatically run it on a server for me.

sterile token
#

Gradle != Maven ==><==

vocal cloud
#

Gradle > maven

sterile token
#

I dont think

#

In terms of compilations i dont agree

#

It take more time for doing simple compiling phases

lost matrix
#

In theory you can also use the surefire plugin and write java code that gets executed

<plugin>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.22.2</version>
    <configuration>
        <includes>
            <include>SomeCustomTask.java</include>
        </includes>
    </configuration>
</plugin>
lost matrix
vocal cloud
#

For smaller projects yes.

#

I'm just saying that if you want to do crazy stuff like copying hoo-ha's around the best method would be using Gradle. Performance isn't as important to me atm.

lost matrix
#

We should all just use ant

cunning canopy
#

I used to

#

until you guys said use maven

vocal cloud
#

Maven is fine.

lost matrix
vocal cloud
#

"back in my day we built the jars by hand"

cunning canopy
loud mauve
#

who know how to do like this
a command that take from you economy from (essentiels plugin) and give you claim from GriefPrevention plugin

lost matrix
lost matrix
vocal cloud
#

You have been E X P L A I N E D

loud mauve
#

@lost matrix can i do it at same CMD

vocal cloud
#

Yup

vivid cave
#

how to activate chat preview?

#

(sorry if this question is frequent)

vocal cloud
#

As in when it shows up on message? That's a client thing isn't it?

buoyant viper
#

its a server.properties option iirc

#

and client

#

idk

#

might go both ways

mighty aurora
#

Quick question. So I was looking at the spigot wiki(I'm working on learning to make as well as making plugins) and I was looking at the code on the GUI page(https://www.spigotmc.org/wiki/creating-a-gui-inventory/) and I noticed that in the section of code that is the call to open the GUI he uses ent

        ent.openInventory(inv);
    }```  I was wondering what the ent means?
buoyant viper
#

entity

#

HumanEntity

#

specifically

lost matrix
mighty aurora
#

ah ok

river oracle
#

๐Ÿ’€

buoyant viper
#

oh wait he dont know what a parameter is

#

?learnjava

undone axleBOT
quaint mantle
#

Sorry if this is a weird question but I've just been trying to find a friend who's decent at coding who is available to call sometimes and help me code some simple stuff. I'm making a server that is really important for a certain community because something really dumb happened on the server the community was using and now it's unusable. The server is so important that I decided to learn coding and create a replica of the specific function the server has that I was using. It's going well but there's like one or two parts I need help with but I can't really use a tutorial and I also would like to understand coding more by calling with 1 on 1 help so I can improve the server more. I know no one knows me but if anyone wants to help out some random dude I would really appreciate it

eternal oxide
#

What is the "community"?

quaint mantle
#

Hypixel parkour speedrunning

lost matrix
#

version?

quaint mantle
#

I'm coding using 1.8.8 since I use 1.8.9 to do parkour

#

I want the server to be for all versions

eternal oxide
#

You are going to be very out of luck

quaint mantle
#

Preferrably

eternal oxide
#

General questions and help we can give, but nothing 1.8 specific as our answers are almost guaranteed to require a more modern API.

quaint mantle
#

Well I just want a friend

sterile token
#

is possible to convert that into a lambda exprension

lost matrix
sterile token
#

lambda isnt the one that uses for example Player::getName ?

eternal oxide
#

no lambda is ->

quaint mantle
#

I mean thats method reference lambda

sterile token
#

Oh ok

#

lambda expressions uses the "->" okay

#

I thought that lamda was when you use that what i sent on top

#

My mistake i get mixed

eternal oxide
#

Well you were kinda close

sterile token
eternal oxide
#

it is most often used in lambdas

sterile token
#

Its pretty amazing for reading about ava things

#

Oh lmao im messed with paged menus

#

I still cannot do atleast 1 simply but functional code

zinc sedge
#

how can i kick a player after is totem was used?

  @EventHandler
    public static void EntityResurrectEvent(EntityDeathEvent event) throws InterruptedException {
        if (event.getEntityType().equals(EntityType.PLAYER)) {
            if (!event.isCancelled()) {
                if (AfkCMD.isAfk.contains(event.getEntity().getUniqueId())) {
                    Player player = (Player) event.getEntity();
                    TextComponent tc = Config.tc;
                    tc = tc.append(Component.text("AFK-Schutz wurde aktiviert!", NamedTextColor.RED));
                }
            }
        }
    }

this is my code rn, but it just kicks the player before the totem gets activated

sterile token
zinc sedge
#

but that doesn't change anything does it?, i mean my code kicks the player i want it to kick but like too early

sterile token
#

You kick the player before or after?

#

Or what is your issue exact?

tranquil dome
#

Is there a way to get which enchantment is shown in the enchantment table preview or to get the enchantments that were added as a bonus after enchanting?

sterile token
#

You can do what i told so when he use the token add to map with boolean true, and then on respawn check if contains the uuid and kick it

#

๐Ÿค”

lost matrix
sterile token
zinc sedge
quaint mantle
#

Bruh

sterile token
#

Map<UUID, Boolean> its even more simply

full forge
sterile token
#

Oh yeah you are right fishy

#

Its even more simplier than what i said

tranquil dome
noble lantern
tranquil dome
lost matrix
hollow tinsel
#

in a lifesteal plugin i payed for there is a bug where when you relog to the server it resets your health to full and im wondering if anyone could help me fix it, i think its 1 of 3 codes

@EventHandler
public void onRespawn(PlayerRespawnEvent e) {
setPlayerHealth(e.getPlayer(), getPlayerHealth(e.getPlayer()));
if (getPlayerHealth(e.getPlayer()) == 0)
setPlayerHealth(e.getPlayer(), 20);

or

public void setPlayerHealth(Player p, int h) {
p.getPersistentDataContainer().set(this.Life, PersistentDataType.INTEGER, Integer.valueOf(h));
p.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(h);
p.setHealth(h);

or

public void setPlayerHealthNoUpdate(Player p, int h) {
    p.getPersistentDataContainer().set(this.Life, PersistentDataType.INTEGER, Integer.valueOf(h));
    p.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(h);
}
lost matrix
hollow tinsel
#

if im going to be honest, i dont know how to code plugins all i did is download eclipse and im looking through to see if i could fine it, i have the source code but have no clue how to check sorry lol

wet breach
#

if instead you actually want someone to do it for you then here is this

#

?services

undone axleBOT
hollow tinsel
#

ah ok ty

#

sorry for wasting time

#

wait sorry again but would this be the listener?

@EventHandler
public void PlayerJoin(PlayerJoinEvent e) {
if (e.getPlayer().getPersistentDataContainer().has(this.Life, PersistentDataType.INTEGER)) {
if (getPlayerHealth(e.getPlayer()) <= 0) {
setPlayerHealthNoUpdate(e.getPlayer(), 8);
return;
}
setPlayerHealth(e.getPlayer(), getPlayerHealth(e.getPlayer()));
} else {
setPlayerHealthNoUpdate(e.getPlayer(), (int)e.getPlayer().getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue());

delicate lynx
#

look in your plugin's main class

hollow tinsel
#

all thats in the main class is the recipes and items

lost matrix
#

The main class is irrelevant. All you need is right there in the join event

hollow tinsel
#

} else {
setPlayerHealthNoUpdate(e.getPlayer(), (int)e.getPlayer().getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue());

is it this?

#

if i remove that?

#

it looks like its overriding the getplayerhealth

rare flicker
#

I've been peeking around at enchantments and stumbled upon this

anyone has any idea what they mean by "start at"?

flat leaf
#

anyone here have any idea why the worldedit API wouldn't be giving me the correct blockdata when retrieving a block from a loaded clipboard (that was loaded from a schematic)?

#

on 1.19, using world edit beta 7.2.11-beta-01 on the server and API version 7.3.0

#

if I paste the schematic in game things like chests have the correct items, but getting the BlockState using the API doesn't have the same outcome

tender shard
#

weird, but you're probably better off asking on their discord. IIRC they have a discord

flat leaf
#

I wonder if maybe the block entity is counted as an entity

#

alright yeah I'll head over there, thanks

twilit wharf
#

I am using a wrapper for GUIS btw (RedLib)

vocal cloud
#

Yes as I said before the issue is right here.

#

You map the line -> code and figure out what line is giving the error.

#

I bet if you add some simple logging this issue will be over very fast.

worldly ingot
#

My goodness that's a lot to be doing in a constructor

vocal cloud
#

Indeed

buoyant viper
#

lol

worldly ingot
#

Seems like a misuse of a constructor tbqh. That could definitely be a static utility method at least

vocal cloud
#

Also when pasting code please include everything (Ctrl+a) so we can match errors to lines YanSigh

twilit wharf
#

oh yeah, my bad

#

I found the fix, it was super weird. Thanks for you help

vocal cloud
wet breach
# tender shard IIRC it's always 1

I think it is worded wrong because really what it means is the minimum level. However, depending on settings or what gets modified, the minimum level can be different then 1. For the most part however, you are correct

tender shard
#

I always thought it returns the value that's the "min level" for this enchantment

#

and IIRC there's none that doesn't start at 1

#

but no idea lol

wet breach
#

however, if something changes the starting level of an echanment, then it wouldn't necessarily be 1 anymore

tender shard
#

true

#

I just wonder who'd say "the minimum level for my custom enchantment is 2", that doesnt really make sense

wet breach
#

that is what I meant, is that it should be named as minimumLevel, and not starting level lol

tender shard
#

yeah that would make more sense

wet breach
#

Since there is a method for maxLevel, but no EndLevel ๐Ÿ˜›

quaint mantle
#

@wet breach

#

answer his question computer nerd

wet breach
#

well RAM isn't persistent unlike

#

HDD or SSD

#

correct

#

RAM = Random Access Memory. Can't be random if it never changes ๐Ÿ™‚

noble lantern
#

hey gais

#

how do i say hai but as guys format

#

because that dont look ight lmao

noble lantern
wet breach
uncut cobalt
#

I got a question about guis, is there a way to customize the way guis appear?

noble lantern
#

What would be a good & simple way to authenticate communication between 2 servers?

I have a proxy server with a few other servers that hooked into it via websocket connection

Rn i just have UUID as the server ID and then a passphrase (encrypted ofc) on both ends as well as IP verification (IE if the connecting IP mismatches a configs IP for that server it disallows the connection), i assume this would likely be good enough? Or is there some standard way this is done

noble lantern
#

Theres afew things that come to mind when you say that

uncut cobalt
#

Like you can create a gui such as the inventory of a player, a chest, a beacon, etc

#

Is it possible to create a totally new GUI that Minecraft does not have

noble lantern
#

Not without forge no

uncut cobalt
#

like edit the buttons and appearance

noble lantern
#

You are stuck to the InventoryType enum types

uncut cobalt
#

Ah rip

#

Thanks though :)

noble lantern
#

However

#

There is soemthing you can do to replicate it

uncut cobalt
#

How?

noble lantern
#

There is a way to make images appear in a GUI

#

IDK the way to do it, im sure google knows though

#

but ive seem some pretty crazy stuff with it

inland axle
uncut cobalt
#

Ah okay thanks

noble lantern
#

I do have rate limiting both in code and through cloudfare

noble lantern
#

I was thinking maybe some ssh key type thing but im not sure how tf thats done

#

So i was thinking just a static encrypted keyphrase would be fine enough maybe

inland axle
noble lantern
#

i dont decyt no need to

#

decrypt*

#

I cache the encrypted passphrase for the server rn on startup

inland axle
#

wdym

noble lantern
#

sec lemme explain

#

On start

  • run through config.json on proxy (Contains server UUID, allowed IP, and raw string passphrase)

  • Encrypt pasphrase with a public encryption key shared between both servers (The sending server will encrypt the password for the proxy)

From there server 1 connects to proxy, and then the proxy checks the config.json encrypted passphrase against the provided one

inland axle
#

well the server1 would need to know the public key ahead of time

#

or you would need to use a certificate

noble lantern
#

Yes they both know the encryption key

its not even rly needed i just didnt wanna send the passphrase in raw text

#

The only thing server1 doesnt know is the password

#

which the proxy knows

noble lantern
inland axle
#

yeah

#

what they use for https

#

but if you can just upload a public key it's alot less hassle

inland axle
#

but if they are legit they will know?

noble lantern
#

Well i already am gonna be using ssl for my websockets

Rn theyre just running in ws (http) instead of wss but once i setup with SSL, i guess i could borrow the priv key from ssl and use that?

noble lantern
#

I know pterodactyl just uses a token system to link between daemon and theyre containers, thats why i setup what i have rn

#

The servers are only ever going to be hosted by me

inland axle
#

I think they use the token to make a symetric key

noble lantern
#

i just wanted to prevent someone from reverse engineering my proxy and gaining access to the game servers, as the CLI will be used to manage certain aspects of it

noble lantern
wet breach
#

you can issue certs to each of the servers that connect to the proxy

#

if the server doesn't present a valid cert, then its not one of your servers

noble lantern
#

By chance is there any lib or native way in java to handle those certs?

#

i see

#

CertificateFactory

#

and

#

X509Certificate

wet breach
#

yes

#

you can issue certs like you would unique passwords too

noble lantern
#

for passwords i kinda just create and set them in config files on both servers

wet breach
#

so like each user can have their own cert, all derived from the key on the proxy ๐Ÿ™‚

noble lantern
#

i assume i would do the same with cert? just manually give them to the servers i need?

#

Actually i can setup a linking system where i use a cli to create a server, and on first connection it send the cert that way

#

i think that may be a lot nicer

wet breach
#

Well wouldn't want to do that, otherwise anyone who connects gets a cert ๐Ÿ˜›

inland axle
#

lol

noble lantern
#

well it woul be a setup command in cli

#

and it only allows new connections for linking within a few seconds

#

and it will send a UUID and ask for linking confirmation

#

if uuid doesnt match the servers uuid dont issue cert

inland axle
#

if you trust all servers completely symetric is still fastest

wet breach
#

I still wouldn't issue certs like that. That is similar to how WPS works and the reason it is flawed

noble lantern
#

So just manually assign them then after creation?

inland axle
#

how many nodes are you handling?

noble lantern
#

Depends

#

it will be 1-3 at the start

#

can be 50-100 in a few years time

#

They handle individualized game servers, the proxy allows safe communication between 2 game servers (If i manually connected them without the proxy, the networking would become a giagantic web and hard to manage, then proxy handes requests like server1 sends message to server2, and the two are never connected to each other) as well as easy admin interaction

#

im gonna look into creating certs in java rn

wet breach
#

this guarantees that the server you setup, is the one that you want authorized. While although the odds of someone trying to infiltrate your network setup, never hurts to be secure anyways ๐Ÿ˜›

noble lantern
#

Yeah i doubt anyone will ever even find this IP to this server but i just wanted to be safe

#

cause if proxy gets accessed all servers are at risk

wet breach
#

well someone will find it, all ip addresses are public

noble lantern
#

Yeah but chances of them knowing what its for are slim

wet breach
#

its just a matter of who manages to scan it first. But I was saying more or less someone trying to actually spoof being an mc server on your network lmao

noble lantern
#

ohhh

wet breach
#

unless this is some other kind of setup

#

what I said would still be true in a way, and they would have basically have to wait at the right time where you were setting a server up to attempt such things with what you were wanting to do

noble lantern
#

and they would have to know the UUID

#

becuas eonce it connects there would be a message

"Server with <uuid> is attempting to link, accept linking and send cert (Y/N)"

#

so theyde have to know the new servers UUID (Which is normally created seconds before sending linking requests)

#

but imm just do manual

wet breach
inland axle
noble lantern
#

yeah its a handshake

#

It connects and directly sends the request when the socket opens, in facts its actually the opening connection message

#

Basically the flow would be:

#

On proxy (Server ID is the user friendly string of the server, basically just its name)

server create -serverid 5 -passphrase/cert cert -server_ip 192.168.0.1

And from there it will allow new connections and send

Now accepting new connections for 15 seconds, please start the game server you are wanting to link

On game server -> java -jar server.jar -> Auto connects to proxy on startup and sends its uuid (Will use HKF like frost said i like that idea better)

After the game server connects, on proxy:

Received a connection from 192.168.0.1 and it is identifying itself as <fingerprint/uuid>. Should this link be accepted, and a new cert signed for this machine?

When the game server restarts its connection it will then send the cert it was issues as authentication

#

I honestly dont think anyone would be able to MIT this as it would happen in mere seconds, someone would need to know the game servers hkf/uuid, as well as the game servers IP addres and be able to fool a manual review of the link

#

unless im dumb and dont know how web security works

#

(Might be the case ^)

inland axle
lethal ermine
#

I downloaded a source code of a plugin and loaded it on intelliJ idea and built it with gradle config but I cant find the build for some reason!

noble lantern
#

Connection wont ever leave until receiving server received its cert

lethal ermine
# lethal ermine I downloaded a source code of a plugin and loaded it on intelliJ idea and built ...

9:12:37 AM: Executing 'build'...

Task :clean

Task :compileJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

Task :processResources
Task :classes
Task :jar
Task :assemble
Task :compileTestJava NO-SOURCE
Task :processTestResources NO-SOURCE
Task :testClasses UP-TO-DATE
Task :test NO-SOURCE
Task :check UP-TO-DATE
Task :shadowJar
Task :build

BUILD SUCCESSFUL in 24s
5 actionable tasks: 5 executed
9:13:02 AM: Execution finished 'build'.

noble lantern
#

Its in build/libs

lethal ermine
#

o thank you!

noble lantern
#

sorry for that first passive-aggressive message i misread your msg lol

inland axle
noble lantern
# inland axle so the connection is within the lan?

RN Actually yes but in the future, i may need to run more game servers on another vps

My current configuration uses 2 IPs IP1 is used for my auth and proxy ip 2 is for game servers (They run on port increments of +1)

inland axle
#

client server starts ssl/tls connection with server (the servers certificate is known to the client ahead of time)
client requests a certificate (it gives a random uuid to the server )
request is displayed on the server with the uuid
request is accepted
certificate is sent to the client

noble lantern
#

yep except for UUID ill use host keys

flat leaf
#

thanks

#

lmfao

noble lantern
#

what discord lmao

#

paper?

inland axle
#

papercord is great

flat leaf
#

no, enginehub

noble lantern
#

epic world gen discord??

flat leaf
#

they made worledit and shit

noble lantern
#

ohhh them

#

they were helpful with me when i had issues with world edit api so theyre +1 with me

flat leaf
#

I actually just got an any% ban (or maybe kick)

#

I asked a question slightly wrong and instead of trying to figure out my question they basically just bitched about it

#

I asked like two questions and every one of them was responded with very passive aggressively

#

this shit is why people don't make github issues these days

noble lantern
#

I dont make github issues bc theyre so slow

wet breach
#

enginehub?

noble lantern
#

world edit