#help-development

1 messages · Page 27 of 1

crude estuary
#

and how is that a help-development Question?

sterile token
#

Im #AntkMCHoster and im more #VPSteam

#

I find really shity using a web panel to manage mc servers

quaint mantle
#

Hello, I would like to upload the version of spigot 1.19 to my server that is hosted by a page and when uploading the version it gives me an error, how should I do it? Any moderator who can help me or let me contact you by md to explain my event in more detail @worldly ingot

crude estuary
#

Dude

#

Stop

sterile token
#

@ivory sleet please solve this he is being impatient

#

Sorry for ping my mate

crude estuary
#

and he got Obsessed with Choco

sterile token
late sonnet
#

not sure why is asking here and not in the support of the panel...

misty ingot
#

@worldly ingot I just want a way so I can find the difference between 2 such timestamps in seconds OR miliseconds

crude estuary
#

or the Hosting

#

xD

sterile token
crude estuary
#

Excelente?

misty ingot
sterile token
#

Lmao all obsess with Chocó

#

😂

late sonnet
crude estuary
#

no, i was Joking with him, because he Wrote it in Spanish

sterile token
#

I tríed to write excelent but the corrector changes

misty ingot
late sonnet
#

Ahhh el español es un bonito idioma.. mas facil es explicarme asi...

but well

quaint mantle
#

Hello, I would like to upload the version of spigot 1.19 to my server that is hosted by a page and when uploading the version it gives me an error, how should I do it? Any moderator who can help me or let me contact you by md to explain my event in more detail

sterile token
late sonnet
#

late xd

misty ingot
#

basically, can I subtract one of these (^) values from another such value and get the difference in miliseconds?

crude estuary
#

the Dude is Still Going

late sonnet
#

im sure they are not reading the channel...

quaint mantle
crude estuary
#

what is wrong with him?

late sonnet
#

or its a scam

sterile token
#

😍

late sonnet
#

7 messages.. and 6 are the same

sterile token
kind hatch
crude estuary
#

i'm Just Gonna DM him to tell him to Stop

late sonnet
sterile token
#

Dont lsot your time pbt

crude estuary
#

i've got Plenty of Time now

quaint mantle
crude estuary
late sonnet
#

wait what?

quaint mantle
crude estuary
#

He Just Spammed

sterile token
#

@worldly ingot stop bruh he is looking for a ban

#

He is dhouting it

crude estuary
#

Waiting for Someone to Figure out a Completely Unexplained Problem

late sonnet
quaint mantle
sterile token
#

Sorry for saying this in Spanish but is for him to understand

@quaint mantle usa un traductor

ancient plank
#

writes better than verano sometimes does tbh

crude estuary
#

xDD

quaint mantle
#

sorry i mean i'm trying to load BuildTools to load spigot 1.19 on my server but if i load it the server tells me there was a failure

crude estuary
#

that's a Different Problem

sterile token
#

Oh wait

#

Nothing to do with mc hosting

#

😂 😂

crude estuary
#

Yeah, right?

#

xD

sterile token
#

Lmao i was on fire I just wanna swear him

crude estuary
#

no, Family Friendly Channel

sterile token
#

Yeah I know I counted 4 times to 10 because if not I was going to get banned

quaint mantle
kind hatch
sterile token
#

If you dont know english its really diff to help

crude estuary
sterile token
#

My message got deleted

crude estuary
#

and Come on Dude your Description is in English

quaint mantle
crude estuary
#

and That's a Different Error

kind hatch
sterile token
#

Is get bukkit com site ilegal?

crude estuary
#

i think he's Just Uploading BuildTools

sterile token
crude estuary
#

at this Point

kind hatch
#

I don't think so, at least not based off what he said.

#

He could have uploaded one of the jars in the Spigot folder instead of the jar that's generated in the parent directory.

quaint mantle
quaint mantle
# kind hatch Which file are you uploading?

Try with the two files which is the executable .jar of BuildTools and then on my computer prepare the file with the cmd for which is the version to have it and try to upload it and there it gives me an error to what is the upload of the file

kind hatch
#

I stand corrected. Mans is trying to run the BuildTools jar. 💀

azure hawk
#

how can i save an inventory so when i join the nether e.g. i have items and when i join overwold i have different items!?

crude estuary
#

💀

quaint mantle
#

I am really doing what the support of my page told me

crude estuary
#

then ask them

#

not us

sterile token
kind hatch
# quaint mantle ?

Have you ran BuildTools on your personal computer? Because if you have, you will have a file structure like this. The highlighted file is the one you want to upload.

quaint mantle
#

This was what they told me Hello Manuel! We have several templates when creating servers such as Paper, Forge or similar. Once the server is created, you can upload any version of the server you want, as in your case, Espiga. I have done a little search and at https://www.spigotmc.org/link-forums/spigot-buildtools.88/ you can download the BuildTools and get any version of Spigot which you can then upload to the server using the File Manager. For it to work properly, you will need to refresh this file to server.jar. Another option is to search directly online for the specific version. I hope I have resolved your doubts. Kind regards, Alexander Q.

kind hatch
quaint mantle
kind hatch
#

But, have you ran BuildTools already? Or is that what you are having issues with?

quaint mantle
#

I will explain it in more detail

sterile token
#

MANNU please use a translator

#

Its will be easier for us to help

quaint mantle
#

It's what I'm doing

eternal oxide
#

run Buildtools. Build the version you want.
Rename the jar to server.jar and upload it to your host.

quaint mantle
#

I am going to explain myself in better words, what I did was contact the technical support of my page to upload other versions of the server, which I wanted spigot, they answered me by uploading the BuildTools.jar file and that is what I did, once uploaded, I changed the name of the file to server.jar, which was so that the console would detect that it was a version and the console proceeded to execute the version for me, it began to download the content of the version, and once It is loading, an error occurs to me, which tells me that there is something wrong, it has given me an error when loading the content, but once I go to file, after doing everything mentioned above, I get all the spigot installed folders and many more , which is the content of what I have uploaded but it does not let me turn on the server, I have also tried to upload what you mentioned before spigot-1.19 which is already done with the cmd and there it gives me the error
Failed to get multipart form data from request. @kind hatch

crude estuary
#

Stop Pinging People

eternal oxide
#

you do NOT upload buildtools.jar to your host.

crude estuary
#

and don't just Upload BuildTools to a Server as a Server

#

Exactly

crude estuary
#

That too

quaint mantle
quaint mantle
eternal oxide
quaint mantle
# eternal oxide <#741875845089722499>

I have been told to communicate through this channel, so until a person who sends more than you tells me otherwise, I am not going to change the channel.

crude estuary
#

You're not Being Reasonable

#

You know that?

eternal oxide
#

We have all told you what you are doing wrong. you will get no more replies in here as this is the WRONG channel. Go to #help-server

kind hatch
crude estuary
#

i think Choco told him

#

idk why

kind hatch
#

Maybe cause the channel was dead. Offtopic stuff happens all the time when nothing is going on in the channel.

crude estuary
#

oh

#

didn't know that

tender pond
#

Sign not Editable

lavish folio
#

thanks

vague berry
#

for commands i got some arguments should i use a switch or
if args[0].equals"blabla"

azure hawk
#

?paste

undone axleBOT
azure hawk
kind hatch
#

Oh god. Arrow code.

azure hawk
#

whats arrow code

#

lol

worldly ingot
#

.
.
.
.
.
.
.
.
.

kind hatch
#

Your code. Literally looks like an arrow.

worldly ingot
#

Indentation looks like an arrow

dusk flicker
#

yikes

azure hawk
#

ok and!?

dusk flicker
#

oh

#

dear

#

god

#

?cleancode

#

?clean-code

undone axleBOT
kind hatch
#

It makes a little harder to read and understand compared to guard clauses.

dusk flicker
#

okay that wiki needs some help lol

worldly ingot
#

There's no snippets in that article. Nobody is going to read that

#

;p

kind hatch
#

Understandably, it is a personal choice and will make little to no difference on performance, readability is a good thing to strive for when writing code.

worldly ingot
#

Case in point: I didn't even read it

abstract sleet
#

Consider using return statements instead of nested ifs, that’ll help clean things up.

dusk flicker
#

I took a second look at that article and said nope Lol

hasty obsidian
#

does anyone know how to set custom armor bar values?

wind tulip
#
    public static ItemStack parseItemNBT(String rawNBT){
        if(rawNBT == "null") return null;
        CompoundTag nbt = null;
        try{nbt = TagParser.parseTag(rawNBT);}
        catch(CommandSyntaxException ignored){}
        
        net.minecraft.world.item.ItemStack nmsItem = net.minecraft.world.item.ItemStack.of(nbt);
        return CraftItemStack.asBukkitCopy(nmsItem);
    }

Getting this error even though I have TagParser imported

kind hatch
azure hawk
abstract sleet
abstract sleet
azure hawk
#

its not that hard to understand

#

its still java

#

ur handling it like another language

#

tf

hasty obsidian
#

meta.setAttributeModifiers(Attribute.GENERIC_ARMOR, 2); anyone know what to put after the 2, I have no idea

abstract sleet
#

Someone made a program in C which looks like a donut and once ran, generates a spinning donut.
Does not mean because it is C it looks like every other C program

hasty obsidian
#

yes

azure hawk
#

your just to angry about my coding style

dusk flicker
#

Chill out dude

abstract sleet
#

I’m absolutely fuming man

azure hawk
#

if so than dont help me

#

its that easy

abstract sleet
#

I can’t contain it

dusk flicker
#

Firstly, thats a badly coding style. I wouldent even consider it a coding style. You are nesting 7 if statements

dusk flicker
#

How would that be hardcoding?

wind tulip
#

the opposite is softcoding

wind tulip
#

but that sounds like hardcoding to me

dusk flicker
#

this is just about nesting if statements

abstract sleet
#

Isn’t hard/soft coding to do with unconfigurable software features?

dusk flicker
#

basically

#

this could somewhat considered hardcoding in fairness to Wonk

abstract sleet
#

The user isn’t willing to clean up their code so I doubt anything thrown at the wall is going to stick.

dusk flicker
#

All I will say about that code is. 1- Should be cleaned up; will make it easier to find errors
2 - make debug statements and see what actually happens

azure hawk
#

hi guys can anyone help me that doesnt have a problem with how i code! ^^

kind hatch
#

A potential problem is that your logic for checking argument length is inside a check for argument 0. You should check for argument length first, then check the argument values afterwards.

E.G

if (args.length > 1) {
  if (args[0].equalsIgnoreCase("Something")) {
    // Do Stuff
  }
}
```vs
```java
if (args[0].equalsIgnoreCase("Something")) {
  if (args.length > 1) {
    // Do Stuff
  }
}

You might run into an ArrayOutOfBoundsException if you use the latter approach.

dusk flicker
#

I dont want to have to look through multiple paragraphs to find one thing

azure hawk
#

the outcome is the same

#

it just triggers you

#

wtf

#

cant you leave me alone with how i code

dusk flicker
#

No, it just makes our job annoying so we don't want to help with that

azure hawk
#

i just wanted help and now im getting bullied over how i code xd

dusk flicker
#

welcome to programming

#

I already said what I recommend you do; make some debug statements and see whats actually going on

abstract sleet
#

Nobody’s bullying you. We’re trying to help you and you are acting all defensive.

#

Completely ignoring any and all advice.

drifting halo
#

so i'm serialzing adventure components to plain text and that results in: test §x§f§f§0§0§0§0@darkeyedragon§r yeet
but it just shows as white, any clue why? (it should be red)

abstract sleet
#

Can’t do nothing without code 🙂

sterile token
abstract sleet
dusk flicker
drifting halo
#

its not related to adventure though... its literally a string at that point

dusk flicker
#

are you running any plugins?

grizzled oasis
#

Hi, I want to ask how faction plugin can do the prefix thing only for some users to see?

drifting halo
#

nothing that deals with chat

abstract sleet
#

Are you on 1.19?

drifting halo
#

.1

abstract sleet
#

I wonder if the secure chat thing has anything to do with it

dusk flicker
#

hmm. My only idea is that color is stripped from the default chat; like you would have to edit the chat format to include a ChatColor option

drifting halo
#

hmm its the preview event

sterile token
#

Hi im having some issues because Im keeping track of a Set<Claim> where i save there each owner uuid, location, cuboid, etc. But when im doing /ps info its telling that i need to own a claim when i already have a claim

Command: https://paste.md-5.net/ohoguxorom.java

#

I deleted the other

grizzled oasis
sterile token
grizzled oasis
grizzled oasis
abstract sleet
#

Add some debug logs to your code so you can track logic flow.

abstract sleet
drifting halo
sterile token
grizzled oasis
abstract sleet
sterile token
#

because owner uuid from claim and sender uuid are the same

#

😂

#

Its really weird i will look more in details

kind hatch
kind hatch
#

Smth of the sorts. It's not mine though.

torn badge
kind hatch
#

I'm aware, I just took someone's code and remove the nested if else chains.

torn badge
kind hatch
#

They wouldn't help us out so I had to do it myself. 😛

gray merlin
#

when onWorldChange is called, is the player still on the previous world, or is it on the world it changed to already?

kind hatch
#

The world they changed to.

abstract sleet
abstract sleet
gray merlin
torn badge
#

It’s PlayerChange!D!WorldEvent

abstract sleet
#

If it implements cancellable then I’m quite certain it’s before the teleport

gray merlin
torn badge
#

So it’s past

gray merlin
#

My method is called onWorldChange, but I meant PlayerChangedWorldEvent.

torn badge
#

The world is already changed

kind hatch
#

PlayerChangedWorldEvent#getFrom()

vestal dome
kind hatch
#

Implying the world they came from.

abstract sleet
glossy scroll
glossy scroll
#

are you sure its being converted to a text component?

torn badge
gray merlin
#

There's too much information here, and I got confused. So the "player" itself is still on the old world at call-time, right?

sterile token
#

Who is tagging me?

drifting halo
abstract sleet
glossy scroll
#

what method are you using?

vestal dome
#

Hey would he want to change the event?

torn badge
gray merlin
vestal dome
#

He is just looking on how the event works.

sterile token
gray merlin
#

Is there any method that is called before the player changes worlds?

kind hatch
abstract sleet
gray merlin
drifting halo
# sterile token player.spigot().sendComponent(TextComponent); are u using that method?

no, i'm using the event

@EventHandler
public void onChatMessage(AsyncPlayerChatPreviewEvent event) {
    var message = event.getMessage();
    var matcher = pattern.matcher(message);
    if (!matcher.find()) return;
    int startIndex = matcher.start();
    int endIndex = matcher.end();
    var result = matcher.group(0);
    var legacy = LegacyComponentSerializer.;
    var start = legacy.deserialize(message.substring(0, startIndex));
    var end = legacy.deserialize(message.substring(endIndex));
    var mention = Component.text(result).color(TextColor.color(0xff0000));
    var finalComponent = start.append(mention).append(end);
    event.setMessage(legacy.serialize(finalComponent));
}
sterile token
#

Okay weird, never done that

gray merlin
glossy scroll
#

why do people keep using var 😭

sterile token
drifting halo
#

cuz lazy

gray merlin
glossy scroll
#

its like the 3rd time ive seen it in the past two days

abstract sleet
drifting halo
#

not if you use a proper IDE

abstract sleet
#

Besides.

glossy scroll
#

its not that

#

its just that its dumb

drifting halo
#

yeah imagine using language features

kind hatch
vestal dome
#

Who uses var to everything in Java? Even if you're lazy that's gonna hurt the readability of your code.

gray merlin
#

I spoke with someone a while back about var... If I was doing the code review, I personally wouldn't allow it to go forward if it had var. If it was just a little, i'd change it and allow the PR, but if it were too many, just no.

abstract sleet
sterile token
#

To compile var take more time, because i need to replace it to the correct type during compile time

#

😂

drifting halo
#

yeah cuz plugins take so long to compile

kind hatch
glossy scroll
#

i mean saying "i use var cuz im lazy" and no real explanation just tells me everything i need to know lol

abstract sleet
#

I’m not going to bother spending more time throwing suggestions at people who don’t listen.

#

It’s been provided, take it as you wish.

sterile token
#

So its better to use variables like this: private/protected/public String/int/long/etc varName;

abstract sleet
#

@gray merlin what do you think about using player teleport event?

glossy scroll
#

also i have no clue what im reading there

#

since you use var

#

so i cannot help you

drifting halo
abstract sleet
#

You’re expected to open their project up in a modern IDE 🤣

glossy scroll
#

right, and it tells me everything i need to know lmfao

gray merlin
vestal dome
#

What the

drifting halo
#

not my problem you use eclipse

abstract sleet
#

….?

glossy scroll
#

what

#

no its the fact we have to use an IDE at all to read it

#

we simply will not do taht

sterile token
#

Also i want to know if annotation processors are always being executed for example Lombok

kind hatch
sterile token
#

Because if not intellij will complain about calling getters/setters that doesnt really exists when you not compiling

abstract sleet
#

I encourage you to do a little searching for why you shouldn’t use var, especially in your particular instance. Up to you.

#

I’m certain there’s a brilliant stack overflow answer outlining some points which are relevant to you.

drifting halo
#
@EventHandler
public void onChatMessage(AsyncPlayerChatPreviewEvent event) {
    String message = event.getMessage(); //THIS IS A STRING
    Matcher matcher = pattern.matcher(message); //Probably a Matcher IDK i dont use an IDE
    if (!matcher.find()) return;
    int startIndex = matcher.start();
    int endIndex = matcher.end();
    String result = matcher.group(0); //String cuz var is illegal
    LegacyComponentSerializer legacy = LegacyComponentSerializer.legacySection(); //LegacyComponentSerializer LegacyComponentSerializer
    TextComponent start = legacy.deserialize(message.substring(0, startIndex));//TEXT COMPONENT YAYAYA
    TextComponent end = legacy.deserialize(message.substring(endIndex));//TEXT COMPONENT YAYAYA
    TextComponent mention = Component.text(result).color(TextColor.color(0xff0000));//TEXT COMPONENT YAYAYA
    TextComponent finalComponent = start.append(mention).append(end); //TEXT COMPONENT YAYAYA
    event.setMessage(legacy.serialize(finalComponent)); //VOID 
}

there you go, happy now?

sterile token
abstract sleet
glossy scroll
drifting halo
#

thats great!

glossy scroll
#

what are you trying to do again

sterile token
drifting halo
#

color text

glossy scroll
#

a bit more specific?

abstract sleet
#

Their color codes appear white in chat.

kind hatch
#

Hex color codes within chat previews.

glossy scroll
#

oh ok

drifting halo
#

color @mentions
but the color doesnt appear in chat but is present when debugging

#

but shows as

glossy scroll
#

let me look at Bukkit

kind hatch
#

Did you run that through ChatColor#translateAlternateColorCodes()?

glossy scroll
#

shouldnt be a problem

#

the event should be able to convert that to a chat component

echo basalt
#

I swear I've seen darkeye somewhere else a few years ago

kind hatch
#

It can since he has the section symbol printing to chat.

drifting halo
#

i'm everywhere

echo basalt
#

Like 4 years ago

#

Type of thing

kind hatch
#

Minecraft automatically converts it, but it won't show visually.

drifting halo
#

yeah i've been around for over a decade for mc stuff

vestal dome
#

Why does Hopper.getInventory().setContents(ItemStack[]); not work

drifting halo
#

define doesnt work

vestal dome
#

Doesn't set the items.

chrome beacon
#

Did you forget to update the blockstate

vestal dome
#

Nop.

#

I have a thread opened.

#

Even

chrome beacon
#

Show your entire code

#

?paste

undone axleBOT
drifting halo
#

ShowCode™️

tardy delta
#

©️

kind hatch
#

®️

glossy scroll
#

the thread in question:

drifting halo
glossy scroll
#

idk im just confirming

#

you're also using deprecated api

#

that is draft

drifting halo
#

could at least work

sterile token
#

Who is tagging me lmao?

#

😡

worldly ingot
#

So in a way, yes

#

Instrumentation is very, very useful

sterile token
#

Okay, so when i open my IDE and use Lombok, its being executed in background right?

drifting halo
#

annotationprocessors are black magic, theres like no good documentation on those

glossy scroll
#

@drifting halo can you paste your message here

glossy scroll
#

so i can try to see smt

#

the one with the section symbols

drifting halo
worldly ingot
#

The annotation processor runs at compile time and actually generates them

#

APs and instrumentation are extremely complex topics

#

You need a strong understanding of bytecode

drifting halo
#

i made an annotation processor a while ago to put all my permissions in a permissions.md file, took me like a week to figure out how tf to even get it working

#

from annotations

worldly ingot
#

I mean in some situations you're fine to just write a normal program. I did it recently. I automatically document VeinMiner's protocol with annotations, but I just use reflection

sterile token
#

I ask because im planing to design my own command framework

#

So i want to learn about annotation processing

glossy scroll
#
{"extra":[{"text":"test "},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"color":"#FF0000","text":"@darkeyedragon"},{"bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false,"text":" qfdsfd"}],"text":""}```
zealous osprey
#

That moment you learn about java streams and the ".map()" function uwu
Never want to go back to not using them

gray merlin
#

Would this be correct?

@EventHandler
public void onWorldChangedPre(PlayerTeleportEvent event) {}

@EventHandler
public void onWorldChangedPost(PlayerChangedWorldEvent event) {}```
drifting halo
glossy scroll
#

yea if im being honest idk what the chat preview is for?

#

it just shows a preview if your chat message above your text box right?

drifting halo
#

alter chat but allow it to still be signed by the client

#

something like that

kind hatch
#

It's really just a good debugging tool. Great for checking color codes without sending a message.

glossy scroll
#

but does the preview get shown to the client?

kind hatch
#

Yes, if they have them enabled.

drifting halo
#

apparently not

glossy scroll
#

this is new to me lol, 1.19.1 and all

kind hatch
#

It's a client setting.

ashen quest
glossy scroll
#

?1.8

undone axleBOT
kind hatch
ashen quest
#

cmon man i know it sucks but my work server uses it (i work for em)

glossy scroll
#

tell your boss to upgrade then lol

ashen quest
ashen quest
#

basically saying "people who use guns, just dont use guns" its not that ez xd

glossy scroll
#

i mean

#

your code is literally the thing

#

thats throwing the UOE

abstract sleet
#

OldCombatMechanics

ashen quest
#

true

ashen quest
abstract sleet
#

It’s a plug-in 🙂

ashen quest
#

oh

ashen quest
harsh totem
glossy scroll
#

what's at that line then?

ashen quest
#

which one

abstract sleet
#

No need to run 1.8 except for very specific cases, servers which require it would have a team of developers working on the software

glossy scroll
#

?stacktrace

#

?st

#

Caused by: java.lang.UnsupportedOperationException: Unsupported nms version
at com.annihilation.core.npclib.api.Util.getNMS(Util.java:34) ~[?:?]

#

whatever

ashen quest
#
public static NMS getNMS() {
        if (nms == null) {
            try {
                String version = VersionUtils.getVersion();
                String name = "net.techcable.npclib.versions." + version + ".NMS";
                // Bukkit.getLogger().info(name);
                Class<?> rawClass = Class.forName(name);
                Class<? extends NMS> nmsClass = rawClass.asSubclass(NMS.class);
                Constructor<? extends NMS> constructor = nmsClass.getConstructor();
                return constructor.newInstance();
            } catch (ClassNotFoundException ex) {
                throw new UnsupportedOperationException("Unsupported nms version", ex);
            } catch (InvocationTargetException ex) {
                throw Throwables.propagate(ex.getTargetException());
            } catch (Exception ex) {
                throw Throwables.propagate(ex);
            }
        }
        return nms;
    }
glossy scroll
#

see look at that

#

you found the answer

ashen quest
#

ohhh

#

tysm

drifting halo
#

@glossy scrollgot it working by setting chatevent too ig the preview stuff is just that, preview, who wouldve thought

drifting halo
#

yeah idk how to deal with that tbh

glossy scroll
#

(You dont!!!)

drifting halo
#

well not rn i guess

glossy scroll
#

Only way to do it is to have an annoyong “this message was modified” icon

#

Which is much more intrusive than a system message

drifting halo
#

mojank moment

sterile token
#

Plugin issue when server is started again

ashen quest
#

what font is on the ?paste site

abstract sleet
ashen quest
#

oh bruhh

golden turret
ashen quest
ashen quest
gray merlin
#

Can we detect when a server has crashed and do something before it closes? this is very stupid to ask, it's probably "no", but yeah...

ashen quest
#

I think you can use the plugin's onDisable, thats called when the plugin shutsoff

wanton ravine
#

hello how can i add spaces when typing a line in /znpcs conversation?

gray merlin
abstract sleet
gray merlin
#

Thank you.

ashen quest
abstract sleet
#

Wrong channel as well

wanton ravine
ashen quest
abstract sleet
#

They probably have a support link on the plug-in description page

#

If not send them a PM on the forum

ashen quest
#

what theres pms in the forunm?

abstract sleet
#

Yeah, I think it’s called conversations or something in xen foro

#

Next to Akers

#

Alerts.

tardy delta
#

whats the $s supposed to mean in the default chat format? "<%1$s> %2$s"

ashen quest
abstract sleet
#

sure, but what does the $s mean?

#

It’s present in both parts

hard socket
#

how do i fix this format?

tardy delta
#

DecimalFormat

hard socket
#

I just use getHealth()

tardy delta
#

#.##

#

new DecimalFormat("#.##").format(decimal i guess)

#

for two digits after comma

buoyant viper
#

String.format("%.2f", health) 😎

hard socket
#

alr thx

buoyant viper
#

and might just be what format does under the hood but idk

upper vale
#

String.format is slightly slower but it’s pretty negligible

#

Honestly I prefer it lol jsut easier to type

tardy delta
#

String.format gave me those LF characters

azure hawk
ashen quest
abstract sleet
#

Stop being so ignorant.

somber sequoia
#

Hey, I'm having issues with creating a inventory menu, players are able to double click a item and pick it up from the inventory which is not supposed to happen, what even do I need to cancel for that?

abstract sleet
azure hawk
somber sequoia
azure hawk
somber sequoia
azure hawk
#

That automatticly cancels the second

somber sequoia
#

?

azure hawk
#

Only cancel the first

abstract sleet
#

That’s wrong advice.

azure hawk
#

Not InvetoryDragEvent

somber sequoia
#

ong

#

im cancelling both and the issue is still there

abstract sleet
#

Stop giving them wrong advice.

somber sequoia
#

what you mean i have to cancel only the first one

#

makes no sense

abstract sleet
#

Ignore that lol

somber sequoia
#

ya bet

#

so is there anything else i have to cancel

abstract sleet
#

I can’t remember off the top of my head though if I remember correctly there are 4 or so of them to cancel. It’s quite a mess so I recommend using a GUI library instead

#

Try search the Java docs for inventory related events and you should find a few which apply to your use case

somber sequoia
#

can i send you a screenshot of all the inventory events and you would tell me which one i have to cancel

azure hawk
somber sequoia
#

i really dont want to use gui libs

lost matrix
azure hawk
#

Look

#

Thats what im saying

abstract sleet
#

Since when was this the case? I have always come across code that cancels multiple events.

somber sequoia
#

so it only cancels for that inventory

lost matrix
abstract sleet
#

If the one event happens to be the only one required then I apologise for stating otherwise.

#

I probably shouldn’t be providing advice in an area I have little to no experience in

lost matrix
#

Never had any issues

somber sequoia
# lost matrix Then you are not cancelling the event when you should

this is what im doing right now

    @EventHandler
    public void onInventoryClick(InventoryClickEvent e) {
        if (e.getClickedInventory() == null) {
            return;
        }
        if (!e.getView().getTitle().equals("test")) {
            return;
        }
        if (e.getRawSlot() > 54) {
            return;
        }
        e.setCancelled(true);
    }

    @EventHandler
    public void onInventoryDrag(InventoryDragEvent e) {
        if (!e.getView().getTitle().equals("test")) {
            return;
        }
        for (int i: e.getRawSlots()) {
            if (i < 54) {
                e.setCancelled(true);
                return;
            }
        }
    }
tardy delta
#

7smiles code always lookin' fancy uwu

lost matrix
azure hawk
#

You are still cancelling the whole Event

#

Because your event.setcancelled(true) isnt in an if Clause

somber sequoia
somber sequoia
azure hawk
#

Nicr

#

Then change it lol

#

To that what i told u

lost matrix
lost matrix
somber sequoia
#

im pretty sure that this can also be the cause of why people can shift click items into the gui

lost matrix
#

The last slot of a 6 row inventory is 53 btw. Not 54

somber sequoia
#

oh yeah sorry

lost matrix
tulip owl
#

How can i run a runnable when a variable is a specific value? I want to broadcast a message after the player has logged in and the resource pack has loaded.

lost matrix
tulip owl
#

I mean, I could use a database to store their logged in status and message sent status but that sounds like a lot of work

lost matrix
tulip owl
#

Ah, so using a hashmap

lost matrix
#

Or does it have to be persistent over restarts

lost matrix
tulip owl
#

nah, doesn't need to be persistant

lost matrix
#

Just a hashset will do.

tulip owl
#

👍

quaint mantle
#

is there a way to simply make a custom config file that uses yml

lost matrix
#

Im searching for the article

tardy delta
lost matrix
quaint mantle
#

oh wow

#

it is that simple

#

thank you

small current
#

how can i work with configurable percentages in my plugin

#

like this

#

what should i do to get a random material from this by the percentage

lost matrix
#

You can also gen one between 0.0 and 100.0

small current
lost matrix
small current
#

like what

#

what if all of them are false

lost matrix
#

Like a List<PossibleBlock>
where PossibleBlock has the fields

Material material
double chance

Then iterate through the list and check every element

lost matrix
small current
#

that is not how it should be

tardy delta
#

record PossibleBlock(Material material, double chance) {} uwu

lost matrix
small current
#

i want to set a block

#

to like random with this chances

#

they might not add up to 100

zealous osprey
small current
#

cause none of the plugins i used force you to

small current
#

there is no way of it not

#

try 1 tick later

gray merlin
#

Can we not serialize Entity?

small current
#

no

eternal night
#

barely anything in the API is meant to be serialised

lost matrix
small current
#

how should i do the percentage chances then

#

the block type will be set to at least one of them
and the percentage is the chance

gray merlin
eternal night
small current
#

thats not possible

lost matrix
gray merlin
#

Oh, I thought it was some acronym for something of the sorts. My bad.

small current
gray merlin
#

Can I find NBT data docs somewhere though?

zealous osprey
#

There is a NBTAPI plugin that you can use if you need to work with nbt

lost matrix
zealous osprey
tardy delta
gray merlin
#

Thanks

chrome beacon
#

If you want to make custom nbt tags it's recommended to use pdc

#

?pdc

zealous osprey
chrome beacon
#

oh just call one of the save methods on the entity

eternal night
#

I mean, paper-api has that already. if you wanna just use NMS without a third party lib you can just look at the impl there

small current
#

like it should have 5% chance of it being emerald

#

but 20% stone

#

but it should be one of them

lost matrix
tardy delta
#

List<PossibleBlock> as 7smile7 said

#

and then use a random i -f that whats you mean

#

forgive me my bad typing im on a new keyboard

small current
#

and then use poll ?

#

thanks

lost matrix
small current
#

what is that then

#

what is a weight

tardy delta
#

the chance?

minor fox
#

Do scoreboard team names have any character limits?

lost matrix
eternal night
#

I'd wanna say you can set the replacement item in the consume event ?

small current
#

the poll might return null ?

eternal night
#

but that might be paper-api

lost matrix
small current
#

so if it doesnt add up to 100 what should i do

lost matrix
#

you can have
X: 250
Y: 250
Z: 500

Then it will be 25% X 25% Y and 50% Z
But there is no limit to your weights

lost matrix
#

Show some code pls

glossy scroll
#

another weighted collection idea

eternal night
#

if you cancel it I doubt setting the item has an effect

glossy scroll
#

i made this one

#

it has some utility methods

eternal night
#

well

#

you can modify an event whenever

glossy scroll
#

maybe smile's does too but he took them out

eternal night
#

but the server may not respect those modifications

#

when you modify it

#

e.g. cancel a damage event, set the damage. Not like the server now applies that damage

eternal oxide
#

when you cancel the event any changes you make to teh event are cancelled too. The event will do nothing. You have to make all changes yourself

#

yep

#

There is only one instance of each player

ornate patio
#

How can i reset the overworld, nether, and end from within a plugin

#

well

#

is it possible to like

#

unload the worlds?

#

hmm

#

or what if i create another empty void world

#

teleport all players there

#

then delete the overworld nether and end files

#

wait so

#

is the overworld, nether, and end seperate from each other in spigot?

#

hmm ok

#

sure ill do that

#

but one more thing

#

how does one reset a world

#

how would i delete

#

just delete the folder?

eternal oxide
#

you can;t unload the primary worlds

ornate patio
#

oh really

eternal oxide
#

you have to delete them in onLoad, IF Bukkit.getWorlds().isEmpty()

ornate patio
#

can I do it with multiverse?

eternal oxide
#

You can in onLoad, at startup. not once the server is running

ornate patio
#

i havent used multiverse at all

eternal oxide
#

worlds stay loaded on a reload

grim ice
#

does anyone here know forge? if you do then please ping me tbh i dont know many coding servers so

#

💀

chrome beacon
#

What version are you on?

grim ice
#

1.8.9

#

now i get flamed

#

im just tryna use mixins man

#

mixins work in intellij

#

but not in mc

eternal night
#

mixins on spigot ?

grim ice
#

no

#

in forge

dusk flicker
#

?1.8

undone axleBOT
ornate patio
#

and then delete those worlds and create new ones when necessary

grim ice
onyx fjord
#

can i check if its raining on weather change (without counting snow)?

tall dragon
#

pretty sure rain and snow is the same to minecraft

#

just depends on the biomes temperature

onyx fjord
#

ah fine

twilit pulsar
#

I have not learned item stacks well yet.
I was wondering how do i make so lets say my itemstack thing is called Food
How do i make so the food is enchanted with Unbreaking 3

#

Its not food but its a stick

#

@EventHandler
public void onPlayerJoin(PlayerJoinEvent e) {
Player player = e.getPlayer();
if (player.hasPlayedBefore()) {
ItemStack sword = new ItemStack(Material.STICK);
player.getInventory().addItem(sword);
player.sendMessage(ChatColor.GRAY + "Welcome To " + ChatColor.GOLD + "KnockBackFFA");
}
}
}

#

Like how do i make so the Stick is enchanted with knockback 2

#

For example

tall dragon
#

well add the enchantment to it?

twilit pulsar
#

ye

#

And can i also Change the name to the stick

#

So its like KnockBackFFA

#

or something like that

eternal night
#

basically you get a copy of the item meta of the item stack

twilit pulsar
#

Thanks friend

eternal night
#

store it in a variable

#

mutate it

#

and use setItemMeta to feed it back

onyx fjord
#

can i cast GameRule.RANDOM_TICK_SPEED to int?

tall dragon
#

uhh no?

onyx fjord
#

oh hold on

eternal night
#

casting an enum constant to an int is my fav hobby 🙏

onyx fjord
#

WE DONT TALK ABOUT IT

tall dragon
#

same tbh

onyx fjord
#

i forgor getGameruleValue

eternal night
#

lmao xD

tall dragon
#

i make plugin by just casting my main class to whatever i need

#

works so well

onyx fjord
#

(int) "1"

#

wait what

#

isnt it like safe rn?

#

i know perfect code quality

onyx fjord
#

solved

#

😴

glossy venture
#

is this how to query MongoDB?
db.getDatabaseClient() gets the com.mongodb.client.MongoDatabase from an abstaction i made

#

BDoc is a BsonDocument wrapper

quaint mantle
#

I am planning on working on a Staff plugin. I want to be able to do /staff and come into a kind of 'staff mode' where i have items in my inventory to tp to players and punish them. But I don't know how to check if the staff mode is active or not, can someone tell me how i should check that?

subtle folio
#

?learnjava

undone axleBOT
glossy venture
quaint mantle
noble lantern
#

theres

#

a few different ways

#

that way is right

#

but, theres another right way that makes it take in another bson document was a predicate

#

one sec

glossy venture
#

now

noble lantern
#

sec

#

i actually have like a one class file i use to handle mongodb on another project i use

glossy venture
#

i abstracted a lot of shit away

#

at least database login

#

and different types

noble lantern
#

ah its called projection

#

my bad

#

I had a few issues with MongoDB searching and isnerting without using them

glossy venture
#

whats a projection

eternal night
#

like a view ?

noble lantern
#

sec

#

getting code example

glossy venture
#

?

#

oh

noble lantern
#

no it specifically searches for that value

#

directly

#

well

#

i cant remember

#

its been a while exactly what i did for the projections

#

i just wrote it once and forgot about it ngl

glossy venture
#

i may look into it

#

but if this works

#

for now

#

its fine

crisp steeple
#

🅱️Son

glossy venture
#

bobuxson

noble lantern
#

ugh atlas being slow

#

one sec

noble lantern
# noble lantern

data structure inside the mongodb as im sure the 2 diff email fields was confusing

noble lantern
glossy venture
#

lmao

river oracle
glossy venture
#

whats the difference between a filter and a projection tho

river oracle
#

it's easier for testing

noble lantern
river oracle
#

Use Mongo Compass

noble lantern
glossy venture
#

aight thanks

noble lantern
#

I dont access the front end often

#

i only used it for rn just for the example of code snippet

#

i use POJO classes

#

so i never have issues with mongo where i need to check data

#

thats why i was suprised when my filter and projection fields were different

#

i guess projections take priority

glossy venture
#

hm

#

when i search google

#

its talking abt operators

#

is there like a query language for mongo

#

which is abstracted away?

#

by the java driver

noble lantern
#

OHH

#

i remember now

#

okay so when inserting data

#

in the past

#

you had to do some weird string bullshit

#

it was like

#

set("$set", theData);

And then you had to transfer over its _id too it was ugly

#

this just prevents all that

#

i assume its added lower into the api too, where it may do it without needing to specify the excludeIf in projections

glossy venture
#

so projections just handle data transfer

#

so you only update the values you want

noble lantern
#

yeah it strips the _id essentially

glossy venture
#

the filter selects the shit and the projections transfer data?

noble lantern
#

so you can anonymously get the object by strictly values, and not bound by _id

glossy venture
#

ah

#

thats really nice

eager jacinth
#

Yo guyz, I have a question. Does any1 use ORMLite? How to define there a one-to-many relationship? Is it even possible? Or is it a bad idea to use this lib?

noble lantern
#

yeah its a pain without it, you have to manage the _id yourself without which is weird

chrome ferry
#

just a simple regex question, but based in java. how would i make it so you it doesnt match the ending : next to the }

noble lantern
#

gotta make particlesss

eager jacinth
noble lantern
#

oh never heard of it, i always use something like hikari or something

glossy venture
#

so burchard is this how i would query one user by uuid?

noble lantern
glossy venture
#

ayy thanks bro

noble lantern
#

thats how it is in my code

#

another example of it here

vast raven
#

Does break in nested loops breaks all loops?

noble lantern
noble lantern
#

for () {
for () {
return; // only in this for
}
}

#

other for will iterate

vast raven
#

To break a specific I need to use like sectionToBreak:

noble lantern
#

never used the markers before

#

that would be an alex question maybe

vast raven
glossy venture
#

so youre converting the data object into json

#

and then do shit

noble lantern
#

yee

#

ignore my new Gson in that code if there is

#

ik bad practice i was lazy at the time lol

glossy venture
#

lmao

noble lantern
#

but yeah, pojo with MongoDB is rly nice

glossy venture
#

oh shit

noble lantern
#

thats why i always yell at people use mongo when theyre working with an OOP language

glossy venture
#

yeah

noble lantern
#

never need to deal with any complicated stuff if using gson

next stratus
#

Hey, I'm working on a kinda overflow inventory but I can't work out how to detect when a item can't fit into the players inventory what's the best way to do this?

noble lantern
#

and

#

when you addItem

#

it returns a hashmap

#

if the hashmap is empty all items were added

#

hashmap is the map of items not added

next stratus
#

I mean, what event would you listen to?

noble lantern
#

This would be something you do when adding items

#

if your listening to this yourself youd have to make your own event

#

i dont think anything for that exists

#

ill check

next stratus
#

In a way I want a PreItemPickupEvent 🥲

noble lantern
#

Why wont EntityPickupItemEvent work?

#

if getRemaining > 0 -> inventory is full more than likely

#

PlayerPickupItemEvent is deprecated, so just check if EntityType is PLAYER for that event

next stratus
#

I mean that returns the int doesn't it

noble lantern
#

yes, of items leftover after the player picks up the item

next stratus
#

I wanna find the actual stack

brave sparrow
#

getItem()

noble lantern
#

^

next stratus
#

I'm typing too fast sorry

noble lantern
#

getItemStack is a method of getItem

#

i assume it returns 1 of the item

brave sparrow
#

I don’t think so

#

I’m pretty sure it returns the exact item stack representation of the item entity

#

Amount included

noble lantern
#

maybe, docs arent to specific on it but would make sense for it to do that

brave sparrow
#

But you’ll know the appropriate remaining amount from the event anyway

grim ice
#

fucking hell

noble lantern
#

oh no

#

run guys

grim ice
#

gpg: skipped "XXXXXXXXXXXXX": No secret key
gpg: signing failed: No secret key
error: gpg failed to sign the data
fatal: failed to write commit object

noble lantern
#

told you run z_aCRYYY

grim ice
#

HELP

noble lantern
#

is it?

grim ice
#

i googled

noble lantern
#

nono

#

IS it google

#

like oauth?

#

orrr?

#

what is it

#

it looks like a google oauth error lol

#

or an APK signing error

#

Or

#

Github commit error

#

its likely that

#

is it that hex?

grim ice
#

github commit error

#

help me

noble lantern
#

Didnt you have this issue a few days ago?

grim ice
#

i beg

noble lantern
#

Or was it someone else

eternal night
#

github commit error kekw

noble lantern
#

Someone had the same issue a few days ago

#

idk the solution but i think it was alex who helped them

eternal night
#

you most likely have a gpg configured that you just don't have

grim ice
#

I DO

noble lantern
#

i use github desktop GIGACHAD

grim ice
#

I JUST MADE 3 MORE ONES

#

AND NONE OF THEM WORK

#

MAN

eternal night
#

depression

subtle folio
#

gd 😎

eternal night
#

did you configure it ?

subtle folio
#

gd?

solid cargo
#

wait kind of new to nms. does something made on spigot will work on paper?

chrome beacon
#

Yes

dusk flicker
#

untill they break it yes

gray merlin
#

Is there really no way to run the plugin within the IDE, and debug it normally?

#

It's a huge setback to have to scrape the logs everytime

chrome beacon
#

You can do that

#

The Paperweight userdev plugin for gradle makes it easy

dusk flicker
gray merlin
#

... I was told it was impossible, and because of that, i've been spending way too much time on my bugs...

#

Well, thank you guys! I'll look at it.

gray merlin
chrome beacon
#

It's Paper

#

A fork of Spigot

#

You will have to be a bit careful with the methods you use to maintain spigot compat

eternal oxide
#

The wiki that Rack linked is for Spigot

chrome beacon
#

Yeah

crisp steeple
#

assuming you are setting the meta back on the item yes

ancient plank
#

Cheemsy

eager jacinth
#

Yo, guyz! Has anyone used ebean? Is this a good lib (orm)? Or is it better to use smth else? 🥴

severe turret
eager jacinth
gray merlin
#

I'm not being able to install the 1.7.10 version of NBTApi

#
<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>org.example</groupId>
    <artifactId>AOSPlayerManager</artifactId>
    <version>1.0</version>

    <properties>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
    </properties>
    <dependencies>
        <dependency>
            <groupId>com.github.azbh111</groupId>
            <artifactId>craftbukkit-1.7.10</artifactId>
            <version>R</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>2.9.0</version>
        </dependency>
        <dependency>
            <groupId>de.tr7zw</groupId>
            <artifactId>item-nbt-api-plugin</artifactId>
            <version>1.7.10</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <repositories>
        <repository>
            <id>codemc-repo</id>
            <url>https://repo.codemc.org/repository/maven-public/</url>
            <layout>default</layout>
        </repository>
    </repositories>


</project>```
#

Here's my POM... is something wrong?

severe turret
#

What's the problem

gray merlin
#

The nbt api dependency doesn't appear in the maven dependency browser in intellij, and doing it manually doesn't work

#

Is there something wrong with my POM there?

severe turret
#

run package goal

gray merlin
#

i have

severe turret
#

and send the output of terminal

gray merlin
#

For sure

carmine nacelle
#

bruh.... bee UUIDs change every time they exit/enter the hive 😐 are u fr

gray merlin
#

Really, there's only this. Unresolved dependency: 'de.tr7zw:item-nbt-api-plugin:jar:1.7.10'

severe turret
#

well

#

There's no repository for it?

gray merlin
#

Ah, I thought the version was the mc version, but no.

#

What's the 1.7.10 release of the nbt api?

onyx fjord
#

That's for sure

gray merlin
#

Fifth person to tell me that. It's a requirement, not a personal choice.

severe turret
#

You're going to have to ask the author

onyx fjord
#

Requirement to what

gray merlin
#

The server i'm developing the plugin for runs on 1.7.10, it's not really up to me.

severe turret
#

Because apparently listing your latest maven dependency

#

is overrated nowadays

onyx fjord
#

If it doesn't support 1.7, it doesn't

#

I don't think dev will add support

gray merlin
#

It mentions that it does

severe turret
#

this works

#

kacper

#

the api is for 1.7

river oracle
#

1.7 xD wtf

severe turret
#

actually

#

iots not

#

1.17

#

nvm

river oracle
#

people still use 1.7

#

myes

severe turret
#

theres not a version

#

for 1.7

river oracle
#

you better be getting paid like 5 grand to code something on 1.7

carmine nacelle
#

lmao