#help-development

1 messages ¡ Page 867 of 1

icy beacon
#

We almost share birthdays

pure stag
#

I was too lazy to create a separate interface for lambda

tender shard
icy beacon
#

23rd

#

l;ol

tender shard
#

oh hehe

echo basalt
tender shard
icy beacon
#

Less goo

icy monolith
#

How do i make a 5 second delay in my code. Can some one give me the real way of doing it. I see so many different ways and it is confusing me as most had issues or didnt work that i tried.

tender shard
ivory sleet
#

Eh

pure stag
ivory sleet
#

EnumMap, or IdentityHashMap

tender shard
#

@jagged quail My birthday is on feb 22 and ZBLL's birthday is on 23rd. We expect that you make us a salt cake then

icy monolith
#

I tried one of thoes

river oracle
icy monolith
#

didnt work

tender shard
river oracle
#

please no encourage

#

that's just bad advice at this point

icy monolith
#

so i want an example of how you acualy do it

remote swallow
ivory sleet
#

myea I suppose if its gonna get de-enumified

remote swallow
#

the de-enum pr doesnt actually de-enum it

#

it just deprecates it

ivory sleet
#

yeah

#

Then thats fine no?

tender shard
#

I always use this if I wanna have Material as key:

    public static <K,V> Map<K, V> createEnumMap(Class<K> keyClazz, Class<V> valueClazz) {
        if(keyClazz.isEnum()) {
            return new EnumMap(keyClazz);
        } else {
            return new HashMap<>();
        }
    }
ivory sleet
#

to use an EnumMap

echo basalt
#

Runnable = () -> void
Supplier<T> = () -> T
UnaryOperator<T> = (T) -> T
Function<T, U> = (T) -> U
Predicate<T> = (T) -> boolean
BiFunction<K, V, U> = (K, V) -> U
BiConsumer<K, V> = (K, V) -> void

icy beacon
ivory sleet
tender shard
#

a saltcake. ein Salzkuchen. a cake that consists of salt

tender shard
icy beacon
#

Please explain your motives

tender shard
ivory sleet
#

@remote swallow but yeah given what u said

#

EnumMap is fine for Materials, no?

river oracle
minor junco
#

Longest method name is histroy

ivory sleet
icy beacon
tender shard
icy beacon
#

I was outrun

pure stag
#

doesShorterNameExistThatEquallyConvaysTheBehaviorOfTheMethod -> isTooLong

river oracle
tender shard
#

createEnumOrNormalMap(...)

tender shard
#

that sounds as if it would return a LinkedHashMap if one passes LinkedHashMap as parameter

quaint mantle
#

Java 8 optional api kinda sucks

tender shard
#

i have seen lots of hate against java's optionals - why?

ivory sleet
#

Java Optional is suboptimal

#

bevause its just a null wrapper

tender shard
#

what else is it supposed to be?

quaint mantle
ivory sleet
icy beacon
pure stag
#

this is the same as using NotNull, Nullable, etc. annotations, they seem to be there, but they don't seem to give anything

ivory sleet
#

the issue is that there is no
PresentOptional extends Optional
AbsentOptional extends Optional
@tender shard

icy beacon
tender shard
#

hm idk Kotlin also uses java's Optionals so I guess at least the kotlin devs don't think java's optionals are that bad lol

quaint mantle
#

i might use it

ivory sleet
#

Mye

#

I dont like googles stuff a lot

#

but they have robust code

quaint mantle
#
public abstract class Optional<T> implements Serializable {
  /**
   * Returns an {@code Optional} instance with no contained reference.
   */
  public static <T> Optional<T> absent() {
    return Absent.withType();
  }

  /**
   * Returns an {@code Optional} instance containing the given non-null reference.
   */
  public static <T> Optional<T> of(T reference) {
    return new Present<T>(checkNotNull(reference));
  }

  /**
   * If {@code nullableReference} is non-null, returns an {@code Optional} instance containing that
   * reference; otherwise returns {@link Optional#absent}.
   */
  public static <T> Optional<T> fromNullable(@Nullable T nullableReference) {
    return (nullableReference == null)
        ? Optional.<T>absent()
        : new Present<T>(nullableReference);
  }
}```
tender shard
ivory sleet
#

Yea

#

the PROS of having those subtypes is that u get compile time null safety regarding evaluation, preconditioning, analyzation etc

tender shard
#

did somebody mention kotlin

ivory sleet
#

Yea

icy beacon
#

hi itsm e

tender shard
#

mario?

ivory sleet
#

Kotlin has good nullability

icy beacon
#

I wish I was mario

ivory sleet
#

Or better than java as of now

tender shard
#

unfortunately it doesnt work well for java <> kotlin interop

ivory sleet
#

Yeah, well

pure stag
#

why Entity dont have getDropExp method?

ivory sleet
#

Java has expressed a willingness to address type nullability

#

or well, better nullability just with valhall

tender shard
#
val entry = JarFile("asd.jar").entry("non-existing.yml")

Should not work, entry should return a ZipEntry? and not ZipEntry

hollow oxide
#

can you explain a bit more

ivory sleet
#

just gonna take like a decade

icy beacon
#

entry is just gonna be of ZipEntry? type

shadow night
tender shard
#

entry is a ZipEntry

icy beacon
#

Uhh one sec

#

Where did you get the entry method from

tender shard
#

it says it might return null but kotlin claims it's a JarEntry!

icy beacon
#

Ah it's from java standard

#

Well look at the method signature, it doesn't specify nullability

#

So kotlin assumes notnull

#

That's the problem with working with some java libs

tender shard
#

but it should assume Nullable if there's no NotNull annotation

icy beacon
#

You gotta trust the docs, not the signature

ivory sleet
#

Type! means it doesnt know if its null or not

#

unlike Type?

icy beacon
#

I thought Type! means explicitly not null?

ivory sleet
#

it does?

tender shard
icy beacon
#

Yeah you are saying it doesn't know

#

I'm confused

tender shard
#

otherwise this should not compile

#

it should force me to use .? for toString

icy beacon
#

Nah String? has a toString afaik

#

And all nullables do actually

#

Will do "null"

tender shard
#

well then at least this should not work

zealous osprey
#

ok intellij?
Why is the profiler weird like that?

icy beacon
#

Yes, getJarEntry is from a java library, in which you don't have to specify nullability

#

So Kotlin assumes it's not-null, but it technically can be null

tender shard
#

and hence kotlin should treat it as Nullable / JarEntry?, unless it would be annotated with @NotNull

icy beacon
icy beacon
#

But it doesn't treat it that way for some reason

quaint mantle
#

guys, so its Preconditions.checkArgument for null arguments right

tender shard
#

yeah kinda weird, because the docs clearly state that they respect both jetbrains annotations, and guava annotations, and some more

quaint mantle
#

cause that's what i was told

quaint mantle
#

then when do you even use Preconditions.checkNotNull

tender shard
quaint mantle
#

google

river oracle
#

checkNotNull isn't necesarily ideal cuz it throws NullPointerException

tender shard
#

I only see it using boolean methods

river oracle
#

instead of IllegalArgumentException

river oracle
#

they're all boolean

tender shard
#

so how would one be able to pass null there

eternal night
river oracle
#

because you compare parameter != null

#

you don't pass null you compare for a null

tender shard
#

well null != null will be false ofc

river oracle
#

yeah so it triggers the precondition and the method dies and throws IllegalArgumentException

#

we just explains Google's Preconditions#checkArgument

tender shard
#

what's funny though is that Float.NaN == Float.NaN is false

river oracle
#

shhh leave the weird shit out of this

quaint mantle
#

yeah and

quaint mantle
#

I get a stupid intellij warning

#

and it's rly annoying

tender shard
#

what does it say

quaint mantle
#

something is always false

river oracle
#

the always true and always false when combined with the annotations

quaint mantle
#

^

river oracle
#

its really fucking stupid but either ignore it or disable it

eternal night
#

ignore it

river oracle
#

I just disabled it

quaint mantle
#

damn

hazy parrot
eternal night
#

this is somewhat correct if you were to use intellijs compilation

#

they inject those preconditions/asserts for you

#

based on the annotation

quaint mantle
#

im not doing that

river oracle
eternal night
#

but because you are hopefully sane

#

yea

eternal night
tender shard
#

btw in kotlin you dont need weird third-party Preconditions classes, you just use check(...) 😛

inner mulch
#

how do i get all the experience points that a player has?

eternal night
#

the intellij compiler does

#

any normal one doesn't

tender shard
river oracle
eternal night
#

Exactly xD

inner mulch
#

i dont find any useful methods

quaint mantle
#

what if i just make my own preconditions argument

agile hollow
#

how can i make a printed tnt break only 1 block?

#

1 type of block*

river oracle
#

because it would still be always true or always false according to intellij

quaint mantle
#

no

#

like

tender shard
# inner mulch how tho?

https://github.com/mfnalex/JeffLib/blob/master/core/src/main/java/com/jeff_media/jefflib/ExpUtils.java
Basically you do int required = 0;
int targetLevel = player.getLevel()
for(int i = 0; i < targetLevel; i++) {
required += getXpRequiredForNextLevel(i)
}
required += player.getCurrentXp() // or however it's called

GitHub

Avoid writing the same code over and over again - use JeffLib for your Spigot plugins! - mfnalex/JeffLib

tender shard
#

oh wait I also got a getTotalXpRequiredForLevel method

quaint mantle
#

Conditions.notNullArgument(Object, Msg)

tender shard
river oracle
quaint mantle
#

yeah but if I disable them, what if I accidentally make a constant condition in actual code

river oracle
#

boolean algebra isn't that hard if you end up with an always true or always false you should just know by looking at it

tender shard
#

fuzzy logic

#

Temperature.WARM

river oracle
#

you should never really end up with code that does

A || B && C && B || D || E && F
tender shard
#

looks like a bash script where you're piping a lot of things

river oracle
#

This is the type of stuff we had to do in Discrete Math

#

it'll never appear in the real world and if it does please fix your code

tender shard
#

don't mention math here

#

99% of people here hate math

agile hollow
#

how can i make a printed tnt break only 1 type block?

hoary light
#

Guys some know how I'm can do custom error text without other API?
Because it doesn't write my own custom text error

public static void sendPlayerToServer(Player player, String server, Plugin plugin) {
        try {
            ByteArrayOutputStream b = new ByteArrayOutputStream();
            DataOutputStream out = new DataOutputStream(b);
            out.writeUTF("Connect");
            out.writeUTF(server);
            player.sendPluginMessage(plugin, "BungeeCord", b.toByteArray());
            b.close();
            out.close();
        } catch (Exception e) {
            player.sendMessage(ChatColor.RED + "Here my custom text error");
        }
    }
tender shard
tender shard
tender shard
echo basalt
#

ByteArrayDataOutput

tender shard
#
try(ByteArrayOutputStream b = new ByteArrayOutputStream(); DataOutputStream out = new DataOutputStream(b); ) {
  out.writeUTF("Connect")
  out.writeUTF(server)
  player.sendPluginMessage(plugin, "Bungeecord", b.toByteArray());
} catch (Exception e) {
  // Oh no!
}
#

no need to handle closing stuff yourself with try-w-resources

hoary light
#

okay

slender elbow
#

i mean there isn't really a reason to use twr on a BAOS

echo basalt
#

BAOS's close method does nothing

eternal oxide
#

still good practice

fallow gyro
#

Sorry, I asked this yesterday, but I'm still unsure how to do this. How can I read the text on the side of a sign the player clicked on?

I understand it's possible to read the line once I've done sign.getSide(), but I'm unsure how to get the side from an event? Thanks if someone could help me with this.

dry hazel
#

just cast the BlockState to Sign and access it from there?

hollow oxide
#

how should i save class data?

exemple: i want to save the GUI i've created throug reloads and updates (so it should be out of the jar)

public static class GUI {
        private Map<Integer, ItemStack> dictionnaire;
        private String nom;
        private final int taille;
        public GUI(String nom,int size){this.nom = nom;this.taille = size;this.dictionnaire = new HashMap<>();}
        public void affiche(Player player){
            Inventory inventaireFictif = Bukkit.createInventory(null, this.taille*9, this.nom);
            for (Map.Entry<Integer, ItemStack> entry : dictionnaire.entrySet()) {
                inventaireFictif.setItem(entry.getKey(), entry.getValue());
        }player.openInventory(inventaireFictif);}
        public void enregistrement(Player player){
            Inventory inventaireFictif = Bukkit.createInventory(null, this.taille*9, "modif "+this.nom);
            for (Map.Entry<Integer, ItemStack> entry : dictionnaire.entrySet()) {
                inventaireFictif.setItem(entry.getKey(), entry.getValue());
            }player.openInventory(inventaireFictif);}
        public void enr(Inventory inv){
            ItemStack[] contenu = inv.getContents();
            this.dictionnaire = new HashMap<>();
            for (int i = 0; i < contenu.length; i++) {
                ItemStack item = contenu[i];
                if (item != null) {this.dictionnaire.put(i,item);}
            }}
        public String getname(){return this.nom;}
        public void rename(String ne){this.nom = ne;}
    }}```
lethal knoll
#

Guys can you think of any reason why the diffficulty of a world might be null?

fallow gyro
# dry hazel just cast the BlockState to Sign and access it from there?

Sorry, I should have included some more code. When I try this, I do have access to readLine(), however this method has been depreciated with the new double sided signs. Instead, there is a method to getSide() from the Sign, however this requires me to enter an enum for the sign side, and I'm unsure how to get this value from a blockFace (Or however else I am meant to get it). Thanks!

lethal knoll
#

Is this a bug?

#

[16:58:25] [Server thread/ERROR]: Error occurred while disabling bloodmoon-advanced v2.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.Difficulty.getValue()" because "difficulty" is null
at org.bukkit.craftbukkit.v1_20_R3.CraftWorld.setDifficulty(CraftWorld.java:1032) ~[spigot-1.20.4-R0.1-SNAPSHOT.jar:4020-Spigot-864e4ac-c9c2453]

lethal knoll
#

I can yes

#
    @Override
    public void stopBloodmoon(World world) throws BloodmoonStopException {

        if(world == null){
            throw new BloodmoonStopException("World is null");
        }


        Bloodmoon bloodmoon = this.bloodmoonRepository.get(world);
        if(bloodmoon == null){
            throw new BloodmoonStopException("Cannot find registration of bloodmoon for this world");
        }

        bloodmoon.setBloodmoonState(BloodmoonState.IDLE);

        //reset difficulty
        if(configService.changeDifficulty()){
            world.setDifficulty(bloodmoon.getOriginalDifficulty());
        }

}
worldly ingot
#

Or just whitespace in general

lethal knoll
#

I run this when the plugin disables

chrome beacon
#

Make sure getOriginalDifficulty doesn't return null

eternal oxide
#

yeah, you probably stored a null difficulty (before worlds loaded)

lethal knoll
#

hmm, checking

#

but wait, it say's this:
Cannot invoke "org.bukkit.Difficulty.getValue()" because "difficulty" is null

chrome beacon
#

Doesn't change what I asked

#

difficulty could simply be the param you supplied

lethal knoll
#

Okay, checking

eternal oxide
#

^ the value you are passing is null so the set can;t get teh value.setDifficulty(bloodmoon.getOriginalDifficulty()

lethal knoll
#

yeah it might be actually

#

I found I didn't set original difficulty, so checking now

#

Okay that seems tob e it

#

thank you very much

minor jetty
#

how to register sword as block

#

Goal is to spawn this sword as falling block

echo basalt
#

use armorstands instead

young knoll
#

^ you cannot register sword as block

#

Because sword is not block

kind hatch
#

Would also recommend ItemDisplays over ArmorStands

minor jetty
young knoll
#

I mean you could

minor jetty
#

Here you go

young knoll
#

But you’ll have to replace an existing block

minor jetty
#

Or add grass with sword texture as id 69

minor jetty
minor jetty
echo basalt
#

physics

kind hatch
echo basalt
#

item on head or sumn

minor jetty
kind hatch
#

Ah, guess you're stuck with armorstands then. :sadge:

young knoll
#

At least they have those

#

Kek

icy beacon
#

Apparently if you backtick-escape a variable name in kotlin you can get away with a LOT of shit

rotund ravine
#

Ye

young knoll
#

Thanks I hate it

icy beacon
#

I thought it was only that you could use keywords'

#

Lol

#

Apparently it's just a super escaper

shadow night
#

Can it escape the police after robbing a bank too?

icy beacon
#

Yes I think

pure stag
#

how do I get the amount of experience I get with an entity? I kill him through the damage method, he does not throw the event and does not throw the experience

tender shard
tender shard
#

e.g. an instance of LAPD

#

should work

shell robin
#

ups

#

i changed channels

#

sorry

fallow gyro
remote swallow
#

thats the enum it wants something of

fallow gyro
remote swallow
#

its just an enum

#

if you have the block face its just math

#

if anything you can listen to sign change event

fallow gyro
#

Thanks, but what sort of math would I be doing? I feel like there's probably a method for getting a SignSide without computing player position relative to the sign etc

young knoll
#

Not atm

#

But there could be

fallow gyro
remote swallow
#

no, after its edited

fallow gyro
young knoll
#

Feel free

fallow gyro
young knoll
#

I can probably throw together a PR for this fairly quickly

#

Hopefully™️

fallow gyro
#

Coll, I'd massively appreciate that if you could.

#

If not, I'd be happy to request this as a feauture myself.

river oracle
#

if not that's probably a bug

young knoll
#

It does but you can't easily go from the clicked face to a sign side

#

afaik

fallow gyro
river oracle
#

can probably just complete that one

young knoll
#

Is there?

#

neat

fallow gyro
#

However, I do know multiple other plugins which are still able to read text from a sign on the side it was clicked on, although I'm unsure if they're using depreciated methods to do this.

young knoll
#

Yep found the ticket

river oracle
#

it can be computed still you just need to do some math

young knoll
#

You can make a method to get the side yourself

#

Just needs math + the signs facing dir

river oracle
#

its not terrible math either just a tad annoying

young knoll
#

I assume Mojangly has a method for it

river oracle
#

let me look

young knoll
#

So imma just look into hooking that

fallow gyro
#

Alright. Honestly I won't mind too much if the method I make isn't perfect, since hopefully what I'm asking for will be implemented into Spigot in the future anyway

river oracle
#

@young knoll


public boolean isFacingFrontText(Player player)```
young knoll
#

Cheers

#

that should be easy

river oracle
#

yeah basically just a switch lol

#

on a boolean

fallow gyro
#

Oh so are you implementing this now? Thanks so much if so

river oracle
#

it'll take prolly a day or so to get merged though

fallow gyro
#

Not a problem at all. You guys are awesome for doing this so quickly. I have other things I can work on in the meantime anyway (Such as more important things like picking a new IDE font). Thanks!

river oracle
#

if you're interested in the actual code yourself here is how Mojang does it

        if (this.getBlockState().getBlock() instanceof SignBlock signBlock) {
            Vec3 signHitboxCenterPosition = signBlock.getSignHitboxCenterPosition(this.getBlockState());
            double d = player.getX() - ((double)this.getBlockPos().getX() + signHitboxCenterPosition.x);
            double d1 = player.getZ() - ((double)this.getBlockPos().getZ() + signHitboxCenterPosition.z);
            float yRotationDegrees = signBlock.getYRotationDegrees(this.getBlockState());
            float f = (float)(Mth.atan2(d1, d) * 180.0F / (float)Math.PI) - 90.0F;
            return Mth.degreesDifferenceAbs(yRotationDegrees, f) <= 90.0F;
        } else {
            return false;
        }``` bukkit should have most of this exposed
fallow gyro
young knoll
river oracle
#

I always just assume server owners wouldn't wanna do that

young knoll
#

True, but devs can for testing

#

Dangit 1 checkstyle issue

#

I was so close

river oracle
#

L

remote swallow
#

just get the checkstyle plugin

river oracle
#

I want 50% of ownership of this PR coll

young knoll
#

effort

river oracle
#

for the amazing reference

young knoll
#

lol

#

I'm sure I could have found it myself :p

river oracle
#

no

#

shut you could have not

#

I am your savior

#

or since your canadian saviour

young knoll
#

Well you can give advice

#

getTargetSide seem like a good name?

river oracle
#

why not computeSignSide like the request said it sounds fancy

#

in all seriousness though

young knoll
#
/**
 * Get the side of this sign the given player is facing. <br>
 * If the player is not facing this sign at all, the back side will be returned.
 *
 * @param player the player
 * @return the side the player is facing
 */
@NotNull
public SignSide getTargetSide(@NotNull Player player);
river oracle
#

not to be that guy since I'm usually shit at this, but wouldn't it be getTargeted vs getTarget

young knoll
#

Sadly there is no isFacingBackSide, so we kinda just have to assume

#

hmm yeah that makes sense

#

idk tho

young knoll
#

I think getTargetBlock is a method

river oracle
#

might have to implement that yourself tbh

young knoll
#

merp

river oracle
#

in all seriousness just assuming its the back is bad

young knoll
#

Hmm

#

True

#

But nullable enum method makes me sadge

river oracle
#

let's see how mojang does it

#

one second

#
level.getBlockEntity(pos) instanceof SignBlockEntity signBlockEntity
#

they just check to make sure they even looking at the block

young knoll
#

Yeah

#

It returns false otherwise

#

So I could raycast to see if the player is looking at the block ig

river oracle
#

si senor

#

oh my bad yes sir

#

don't ban me

young knoll
#

Alternatively, player.isFacing(tileState)

#

kek

turbid crescent
#

any infos about 1.20.5?

young knoll
#

It's not out yet

chrome beacon
#

It's not released yet

young knoll
#

Is it

young knoll
turbid crescent
#

bro.. i mean is there an ETA?

river oracle
chrome beacon
#

Ask Mojang

river oracle
#

MD is actually ahead of mojang in releasing it

#

he's pretty fast like that

turbid crescent
#

ah lol that was just a snapshot, thought it was a stable release

#

nvm

young knoll
#

kek

#

Jokes aside only mojang has an ETA

river oracle
#

you sure MD is a guru he might too

#

the ETA guru

turbid crescent
#

yea i know, just mixed smth up

young knoll
#

Huh the sign tile entity stores who is editing it

#

Could expose that too mayhaps

river oracle
#

how tf has mojang still not changed this

#
    public static void tick(Level level, BlockPos pos, BlockState state, SignBlockEntity sign) {
        UUID playerWhoMayEdit = sign.getPlayerWhoMayEdit();
        if (playerWhoMayEdit != null) {
            sign.clearInvalidPlayerWhoMayEdit(sign, level, playerWhoMayEdit);
        }
    }```
eternal night
#

not that they care

#

useless optimization for their target group

river oracle
#

fair

#

I need to update mache to the latest

eternal night
#

Same

#

its a terribly annoying update xD

#

given how much they fucked around in the network code

river oracle
eternal night
young knoll
#

Brain cannot find out how mojang checks if player is facing a certain block

#

... assuming the even ever do that

river oracle
#

check BlockSign#use

#

it provides the position of the use

young knoll
#

right now to figure out where that is called from

#

:p

river oracle
#

BlockBehaviour#use
ServerPlayerGameMode#use
ServerGamePacketListenerImpl#handleUseItemOn

#

from the looks ofit

#

that should be the entire call stack

young knoll
#

Now what is the spigot name for that

#

kek

#

?mappings

undone axleBOT
gaunt talon
#

Hey guys, I have a problem with "Material", Deepslate blocks are considered as "air" as you can see :

eternal night
#

set the api-version in your plugin.yml

young knoll
#

^

gaunt talon
#

I will try thanx

#

so for spigot 1.20.4 I set api-version like this :

remote swallow
#

no

#

just 1.20

gaunt talon
#

This is what I had done in the past but it created errors when the plugin was used in 1.16

eternal night
#

Well if you develop against the 1.20.4 api obviously that won't work in 1.16

gaunt talon
#

the server said that the api version was invalid (when I put 1.16 in the plugin.yml and the server version was also 1.16)

river oracle
#

yeah but did you build against 1.16

gaunt talon
#

yeah I think

#

I wil try

ashen vessel
#

I feel stupid for asking this but I cant find the solution, onBlockBreak is firing twice per block broken. Any idea?
https://paste.learnspigot.com/kufenukika.csharp
If the block is not on y-level 99 it fires once, but it fires twice if it is on y-level 99

EDIT: New discovery, its a oneblock skyblock and it only happens when I break the specific generator block. Is there a chance the plugin itself is calling the event? Should I see if I can find an Event its calling itself to get a better read

rotund ravine
ashen vessel
#

Is there an easy way to find what its calling? or will I just have to get in contact with the developer?

young knoll
#

You can technically print the current stack trace

ashen vessel
#

Ill have to look into how to do that haha but Ill look around, thanks!

rotund ravine
#

Thread.currentThread().getStackTrace()

ashen vessel
#

Thanks

echo basalt
#

new Exception().printStackTrace lmao

shadow night
#

just Exception Exception at line bla bla?

slender elbow
#

Thread.dumpStack() my beloved

icy monolith
#

How do i do a player specific veriable. For a toggle command that toggles something only for the player

hazy parrot
#

Can you elaborate a bit

#

You can get player from onCommand arguments

icy monolith
#

I want to save a Boolean veriable that is specific to the player. So i have a command that only toggles it for that player and not globaly for everyone

young knoll
#

map

#

or pdc ig

remote swallow
#

depends if it needs to be changed while player isnt online

icy monolith
remote swallow
#

will you want other people, ie staff to modify it while a playe ris offline

icy monolith
#

Its a staff command that enables block breaking

#

for the player that excecutes it

#

it works right now, but it is server wide

remote swallow
#

pdc is fine for that then

rare rover
#

okay so i'm working on an enchant system for a prison server, and i came up with this:

#

if this a good way to go? Everytime the player breaks a block it will find the enchants that aren't level 0 and will loop all of them executing the execute method on them

subtle folio
#

kotlin is such a weird language

rare rover
subtle folio
# rare rover how come?

it feels wrong to loosely interchange what looks like variable assingment and one liner functions, whilst also having the entire annotation framework turned into keywords

#

though I do like the parameter naming

rare rover
#

yeah i thought it was weird at first now i kinda like it

subtle folio
#

are all those functions private?

rare rover
#

no

subtle folio
#

or are they all public without needing public

rare rover
#

they're all public by default

subtle folio
#

yucky

rare rover
#

need to specify private if you want them private

#

like java

subtle folio
#

no

#

without specification it become package-private iirc

#

same for variables

rare rover
#

true, but most people still use the private keyword

subtle folio
#

cuz readability 😛

rare rover
#

ye

subtle folio
#

and technically private and package-private are two different things

rare rover
#

yeah

#

private and protected

subtle folio
#

wait wtf is that a keyword todo

rare rover
#

yeah TODO throws an exception if you execute it

#

saying its todo

subtle folio
#

😭

#

i’m going back to scala

hazy parrot
#

I don't get what's wrong with it lol

subtle folio
#

it’s different and not my cup of tea ¯_(ツ)_/¯

rare rover
#

anywayyss, is this a good implementation

#

i'm wanting to loop all the enchants that are on the pickaxe and executing the execute method

#

for every block

#

i've never made a prison with kotlin so, i've only made them in skript 💀

wintry lynx
#

Yo i got splosion problems

#

I made some custom items and such but i have 2 issues.

#

One: the explosion doesnt damage the player who caused it

#

Two: the explosions doesnt drop all items (It acts like a creeper explosion)

young knoll
#

?nocode

undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

wintry lynx
#

Its a spigot method question

young knoll
#

I mean it is

#

Are you spawning an explosive entity

wintry lynx
young knoll
#

there we go

wintry lynx
#

I forgot there where aternative ways to create an explosion, sorry bout that lol

young knoll
#

Passing a player probably makes them immune to it

#

Since they caused it

#

As for drops, that's controlled by the yield which is only available in the event

wintry lynx
#

Yea but tnt stores player cause and deals damage so why does this one make them invunerable?

wintry lynx
young knoll
#

You can with an entity

#

You could just spawn a primed tnt with a fuse of 0/1

wintry lynx
young knoll
#

Could make it invisible by default

wintry lynx
#

Thanks a ton!

young knoll
#

setVisibleByDefault op

wintry lynx
young knoll
#

Yeah it’s been marked like that for a while

#

I guess md may still change it in the future

sullen marlin
#

can probably be removed

#

it was more to see if the method design was good

young knoll
#

Gotta have a timeline for moving stuff out of unstable :p

wintry lynx
#

Also the Yield uses a float so im guessing is a 0-1 value?

#

1 being 100%

elder harness
#

I'm trying to serialize my ItemSTack object using GSON. When I try to do so, I get the error java.lang.UnsupportedOperationException: Attempted to serialize java.lang.Class in the console. Here is my code: https://paste.md-5.net/iguwitozay.js

young knoll
#

You’d have to check the contents of the map

#

Perhaps it doesn’t want to serialize something in it

elder harness
#

It should be serializable. The map that is created is from Spigot ItemStack's method

young knoll
#

Means all the values are configuration serializable

#

Doesn’t mean gson can handle them though

#

If I had to guess it’s the meta

elder harness
#

What do you mean with "configuration serializable"

sullen marlin
#

you need to implement a gson type adapter to handle ConfigurationSerializable

young knoll
#

It’s a Bukkit interface

sullen marlin
#

I'm sure there's hundreds out there because everyone wants json instead of yaml because ??????

young knoll
#

Snbt api when?

young knoll
#

Not for config

#

For data, maybe

shadow night
#

Eh, ig

young knoll
#

Yaml is picky about spaces

#

But json is picky about {}[]

shadow night
#

Also, does bukkit provide some nbt api

young knoll
#

Pdc

#

Technically

shadow night
#

I mean like, generally

#

Reading, writing

young knoll
#

No

#

NBT is an implementation detail

shadow night
#

Yk, these days plugins do a lot of random stuff you can't prepare for

young knoll
#

And?

shadow night
#

I need to store data in a format that is not easily editable by the user

slender elbow
shadow night
#

And db sounds overkill for two values

slender elbow
#

like, yeah, it's picky about entirely different data types

young knoll
#

I mean it’s similar to yml

#

You gotta make sure your spaces are right vs you gotta make sure your brackets are right

slender elbow
#

i s'pose

young knoll
#

You can also store data in plain binary

slender elbow
#

base64'd gzip

young knoll
#

Or use an NBT library like jnbt

shadow night
#

Hmm

young knoll
#

Worldedit also has their own NBT api

#

It’s called linnode or something

shadow night
#

Linnode? Heard that somewhere

young knoll
#

Lin-bus

#

My mistake

shadow night
#

Linnode is prob something different lol

young knoll
#

It’s one of the classes in the api

#

And probably something else too

shadow night
#

Lol

ashen vessel
wintry lynx
#

Now i have a new problem... How does one set the explosion size. 💀

young knoll
#

Wait wtf

wintry lynx
#

I can do it using world.createExplosion() but the issue is I cant set its yeild. I can use world.spawnEntity(PrimedTNT) but then I cant set the size

young knoll
#

setYield is the radius

#

10/10 naming

wintry lynx
#

No? its the amount of blocks that drop

young knoll
#

Not on the entity

wintry lynx
#

Wait... So both are the same name? But different things

#

-.-

young knoll
#

Yes

wintry lynx
#

😀

#

Thats... Wonderful

young knoll
#

With the entity you’d also have to use the event to set the actually amount of blocks dropped

wintry lynx
#

Yea I started using an event with metadata to track

young knoll
#

Make sure to remove the metadata

#

Don’t want to be leaking memory

wintry lynx
#

Wouldnt it be removed with the entity?

#

or is there something I dont know

#

Why is there a sad face ;-;

hollow oxide
#

can i make a player AFK watching its packets? how can i see packets? how do i interpret them?

young knoll
#

Metadata isn’t removed automatically

#

Pdc is though

#

You could listen for packets to see if a player is afk

#

But events work fine

hollow oxide
young knoll
#

Use a packet listener api from protocollib

#

Or again, just use events

hollow oxide
shadow night
#

Why

wintry lynx
shadow night
#

Same

young knoll
#

Kek

shadow night
#

But it shall go away after a restart

#

Iirc

young knoll
#

Well yeah

#

But it’s still a memory leak

shadow night
#

Ig

hollow oxide
young knoll
#

It is

#

Their latest build should support 1.20.1

hollow oxide
#

k i'll check it out

wintry lynx
#

This makes sense now lol. This is memory usage

subtle folio
#

blud closed 2 google chrome tabs

wintry lynx
#

True

peak depot
#

does event priority Monitor take less memeory on PlayerMoveEvent then priority normal?

young knoll
#

No

vapid grove
#
@EventHandler
    public void onPlayerToggleFlight(PlayerToggleFlightEvent event) {
        if (event.getPlayer().getInventory().getChestplate() != null &&
                event.getPlayer().getInventory().getChestplate().getType() == Material.ELYTRA) {

            if(isInHub(event.getPlayer())){
                event.setCancelled(true);
                event.getPlayer().setAllowFlight(false);
                event.getPlayer().setFlying(false);
                StringFuncs.toInfo(event.getPlayer(), ChatColor.YELLOW + "Hub", "Elytra use has been restricted due to abuse.", true);
            }
        }
    }

Any reason why this isnt disabling the use of an elytra?

young knoll
#

You shouldn’t have to mess with flying

#

That’s unrelated to elytra

vapid grove
young knoll
#

EntityToggleGlideEvent iirc

hollow oxide
#

what method should i use with protocol lib to listen to any packet?

#

found it

#

Parameter is not a subclass of org.bukkit.event.Event Compiling and running this listener may result in a runtime exception
why?

civic sluice
hollow oxide
#

how?

hollow oxide
#

thx

#

sometime i wanna die :D

#
package fr.axsc6_l.wamasterv3.Listener;

import com.comphenix.protocol.PacketType;
import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.ProtocolManager;
import com.comphenix.protocol.events.ListenerPriority;
import com.comphenix.protocol.events.PacketContainer;
import com.comphenix.protocol.events.PacketEvent;
import org.bukkit.entity.Player;

public class packet {
    ProtocolManager manager = ProtocolLibrary.getProtocolManager();


    manager.addPacketListener(new PacketAdapter(plugin, ListenerPriority.NORMAL, PacketType.Play.Client.CHAT) {
        @Override
        public void onPacketReceiving(PacketEvent event) {
            Player player = event.getPlayer();
            PacketContainer packet = event.getPacket();
            
        }
    });
}
```halp
tender shard
#

can I get a classloaer in kotlin outside of a class?

rare rover
#

hmm, would it be a good practice to make a batching system for prison enchants? I dont really wanna run enchants on the main thread but i might have to deal with it

short plover
rare rover
#

cuz i ain't making an async task everytime the player breaks a block

rare rover
naive loom
hollow oxide
#

my doc is litteraly under, give me more if you do have it

young knoll
#

Yeah you need to be inside a method

short plover
young knoll
#

You can’t operate on variables just in the void of a class

grand flint
remote swallow
#

makes perfect sense

#

will this work?
code
try it and see

grand flint
#

minusten told him to do sum

#

and he said idk

civic sluice
#

Methods

tender shard
#

in java I'd do Class<?>, what should I use in kotlin? KClass<out Any> or KClass<*>, any why?

fun getCoreLogger(clazz: KClass<*>): Logger {
// or
fun getCoreLogger(clazz: KClass<out Any>): Logger {
#

syntax highlighting broken?

civic sluice
tender shard
#

huh weird, if I escape it, the escape shows up

#

only information I found is that e.g. Nothing is not a subtype of Any

civic sluice
#
fun getCoreLogger(clazz: KClass<*>): Logger {
// or
fun getCoreLogger(clazz: KClass<out Any>): Logger {
young knoll
#
fun getCoreLogger(clazz: KClass<*>): Logger {
// or
fun getCoreLogger(clazz: KClass<out Any>): Logger {
#

Looks fine to me

tender shard
#
fun getCoreLogger(clazz: KClass<*>): Logger {
// or
fun getCoreLogger(clazz: KClass<out Any>): Logger {
fun getCoreLogger(clazz: KClass<*>): Logger {
// or
fun getCoreLogger(clazz: KClass<out Any>): Logger {
#

wtf

#

I have copied exactly my text from above

civic sluice
#

Jep, wtf

tender shard
#

well discord moment

young knoll
#

It’s because you had a * before the code block

tender shard
#

ooh

#

right

#

ok anyway, KClass<ASTERISK> or KClass<out Any>? and why?

#

I know that nullable types wouldn't be out Any but I will never have nullable class objects

safe silo
#

guys need help im really new to dev and decided to do primitive things as editing simple plugins,and for some reason i cant setup depen always getting error,can someone help me?Im using intellij idea

hazy parrot
#

*, out Any would be same as ? extends Object

#

Generally * by design means you do have no idea of generic type

tender shard
hazy parrot
#

While out is used to narrow it

tender shard
#

I'll just go for * because it's next to the ? key which I would have used in java lol

hazy parrot
#

Ig is just design choice, same as you can type ? extends Object in java

#

¯_(ツ)_/¯

safe silo
tender shard
#

did you add the repository?

#

it's not maven central

safe silo
quiet ice
safe silo
#

im ukrainian and at my language there is no community to watch video or find people to speak

tender shard
#

into the <repositories> section

quiet ice
#

I recommend using https tho

#

http won't work by default

tender shard
#

it claims my repo is only 0.1 GB lol

#

that is not true

safe silo
#

reload maving projects or?

remote swallow
#

that isnt the repo url

quiet ice
hollow oxide
#
ProtocolManager manager = ProtocolLibrary.getProtocolManager()
``` manager is null

pom:https://hastebin.skyra.pw/xalufafabu.htm
young knoll
#

Mark it as scope provided

tender shard
young knoll
#

You can’t shade it

safe silo
young knoll
#

Protocollib needs to run as a separate plugin

tender shard
safe silo
tender shard
#

i dont see any error there

quiet ice
safe silo
#

im really sorry for beeing stupid but sadly at my language no peoples to speak at all

tender shard
#

mvn clean package -U

#

does this help?

safe silo
#

let me try

tender shard
quiet ice
#

I mean there are a few Ukrainians here so you aren't alone

#

But they'll be much rarer than the germans

safe silo
#

Could not transfer metadata org.bukkit:bukkit:1.13.1-R0.1-SNAPSHOT/maven-metadata.xml from/to dmulloy2-repo (https://repo.dmulloy2.net/repository/public/): Connection reset
org.bukkit:bukkit:1.13.1-R0.1-SNAPSHOT/maven-metadata.xml failed to transfer from https://repo.dmulloy2.net/repository/public/ during a previous attempt. This failure was cached in the local repository and resolution will not be reattempted until the update interval of dmulloy2-repo has elapsed or updates are forced. Original error: Could not transfer metadata org.bukkit:bukkit:1.13.1-R0.1-SNAPSHOT/maven-metadata.xml from/to dmulloy2-repo (https://repo.dmulloy2.net/repository/public/): Connection reset

hollow oxide
safe silo
quiet ice
tender shard
quiet ice
#

Actually yes you have

#

Strange

safe silo
quiet ice
#

Might be the wrong one? I can't check the link atm though

quiet ice
#

Hm, they had that repo already

#

But with maven there is no other explanation (other than something on the transport being broken)

safe silo
#

i got this plugin from github and didnt change any single line of code

#

just wanted to compile it see if i can do this and change some things as colors etc but i cant even compile xD

quiet ice
#

Jesus how do they have this many stars

#

I really ought to invest in the offline market

safe silo
#

this plugin from 2012

#

peoples give stars

tender shard
#

even my chestsort repo got 83 stars and the code is shit

young knoll
#

Investing in the offline market seems counter intuitive

#

Since they don’t want to spend/ don’t have money

safe silo
#

anyone got idea what i have to do to fix my problem?

quiet ice
#

I guess I am just too familiar with the fact that all my non-mc projects are VERY dormant

elder grove
#

Hello, how can I set a persistent rotation on a nms npc? I've tried setting rotX and rotY, swinging the main hand, all of those after I sent PacketPlayOutEntityHeadRotation and PacketPlayOutEntity$PacketPlayOutEntityLook, but I can't seem to get it work, each time the npc unloads and loads again, the position is changed then what I've seen, any suggestions?

wary harness
#

any one can hhelp with this mysql error

    at me.mraxetv.beasttokens.libs.hikari.pool.HikariPool.throwPoolInitializationException(HikariPool.java:596) ~[?:?]```
hollow oxide
#

where do i find a 1.20.1 version of protocol lib?

safe silo
#

dev reps

#

try

#

doesnt work for me for some reason

hollow oxide
#

thx

safe silo
#

bro can you help me to fix dependencies problem?Im just trying to edit already builded plugin cant figure out how to install dependeces at intellijidea @hollow oxide

hollow oxide
#

send your pom

safe silo
#

what is pom?

#

Oh damn sorry sorry just 3 am haha losing my min

hollow oxide
#

pom.xml

safe silo
#

ok nvm i fixed it somehow no red error but got another problem xD

hollow oxide
#

what version of protocol lib are you using ||and what minecraft version||?

safe silo
#

im badly understand what libraries i have to add and how to project

eternal night
#

next time conclure pepe_hand_heart_2

#

third times the charm

#

oh my god

ivory sleet
#

PLS

eternal night
#

FOURTH TIMES THE CHARM

ivory sleet
#

legit

eternal night
#

I BELIEVE

ivory sleet
#

?ban @errant isle cross post, advertisement

undone axleBOT
#

Done. That felt good.

eternal night
#

Lets GOOO

paper viper
#

🔨

eternal night
ivory sleet
#

dont say anything

young knoll
#

How much have you had to drink

eternal night
#

^

ivory sleet
eternal night
#

I'd love to know xD

hollow oxide
safe silo
#

i have version for 1.20.4

#

no way you dont have for 1.20.1

hollow oxide
#

idk

#

i have the jar for the 1.20.4

#

but not the dependency

#

which is quite dumb

safe silo
young knoll
#

Oh they released an entirely different jar

#

Interesting

hollow oxide
#

yup

#

but the 5.1.1 page for the jar is down

#

and i can't put 5.1.1 in the dependency

#

wanna kms

safe silo
#

[ERROR] No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: pre-clean, clean, post-clean, validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy. -> [Help 1]
org.apache.maven.lifecycle.NoGoalSpecifiedException: No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: pre-clean, clean, post-clean, validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-site, site, post-site, site-deploy.

#

what thats mean?

hollow oxide
#

compilation problem

#

try to clean... maybe

#

send your pom using hastebin

safe silo
#

Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field 'com.sun.tools.javac.tree.JCTree qualid'

#

error i got

hollow oxide
#

yup i'm to bad for this xDD

safe silo
#

im too

#

bad as hell

#

first day of my life doing this thing

#

no video or something

#

i just want to edit plugin i got from opensource at github and thats almost impossible...

hollow oxide
safe silo
#

we will become better together

#

there is sadly no tutorials or something

hollow oxide
#

yup didn't searched tho

#

https://hastebin.skyra.pw/oyenusuquv.htm

i'm on minecraft 1.20.1

can't update the dependency above 5.1.0
I know that 1.20.2 uses the 5.1.1
I found 2 different repo and IDK which is good
I have the 1.20.4 jar

and it's not working

inner mulch
#

im looking for the 5.1.1 too but the site is down :/

young knoll
#

Guess you can try PacketEvents instead

safe silo
#

spend shit tons of time for nothing and its 4 am,time to cry and go sleep

young knoll
#

?services

undone axleBOT
quaint mantle
#

I might be over thinking it, but when should I allow a user to pass in a null parameter

inner mulch
#

whenever you dont need a parameter

quaint mantle
inner mulch
#

you can take a null parameter, if you dont need this parameter, if you need it and take a null, it will be a nullpointerexception?

young knoll
#

The spigot api generally only allows it when it has meaning

#

In a lot of cases it’s used to remove or clear something

quaint mantle
#

hmm

river oracle
#

If you want scuff nullable parameters I'm your guy I was originally a python developer I'm an expert

quaint mantle
#

idk

river oracle
#

public void run(Object... parameters);

Thank me later kid

quaint mantle
#

yeah im prob over thinking it lol

#

ima just allow it

river oracle
#

what are you even doing

#

I was simply making a joke Object... parameters is a fucking horrid idea

quaint mantle
#

ik

#

lol

#

its just a rly small detail

river oracle
quaint mantle
#

nah im saying like, lets say:

boolean Repository#containsId(String id) something like that

river oracle
#

if you have a shit ton of parameters though just make sure you mark things with annotations and doccument the method it's easier to keep track of in those cases

young knoll
#

Oh yeah well how you gonna remove an items custom name huh

quaint mantle
#

well I mean if i were to design a never pass in null library

#

i would just do

#

.removeDisplayName();

young knoll
#

Okay well yeah

#

But that’s another method

river oracle
young knoll
#

Muh bytes

river oracle
#

generally though I'd avoid it where it makes sense

#

it works with MC because we know the client will always have a backup

#

and if it doesn't it's not on the server to fix it

river oracle
wraith dragon
#

Does anyone have any open source projects that showcase ImIllusion's minigame structure?

quaint mantle
#

lmao

#

better ask Illusion himself

#

but I'm pretty sure he made a tutorial on it on his github

wraith dragon
#

im like

#

having a brain error

#

I thought taking a look on an implementation would clear things

#

@echo basalt 👉 👈 are there any projects that use your minigame structure that are open src?

#

having a hard time understanding the task related stuff

dawn hazel
#

anyone know what the max value a furnaces CookTime & BurnTime can have?

river oracle
#

for fuel or what

#

or recipes

dawn hazel
#

nvm

river oracle
#

alr

young knoll
#

Probably the int limit

#

Unless it’s a smaller data type internally

river oracle
#

as far as recipes go there is no limit, but yeah the actual fuels are hard coded iirc

#

I wish mojang would just switch that over to registries or something

#

also makes me wonder why they haven't done such a thing for brewing stands

young knoll
#

villager trades

river oracle
#

oh I didn't see that message lol

river oracle
young knoll
#

They are stored as just a big map in the code

#

Very cringe

river oracle
#

ahhh yes

wintry lynx
#

Anyone know how i can extract the hover events?

river oracle
wintry lynx
#

😭

river oracle
#

you'll have to deserialize the Component into json

#

essentially gotta tear it apart into its Data object form

#

which depends on which component API you use

#

if you use BungeeChat you can tear it apart into a BaseComponent, but then you have to loop over the component until you find the events

wintry lynx
#

I wish getKiller would return the entity that killed the player not just another player if it was pvp

river oracle
#

than you can simply get the inflictor of the damage

wintry lynx
river oracle
#

holding the entity reference itself could be dangerous

#

so be careful with that

wintry lynx
#

Wait why?

river oracle
#

memory leaks

#

if the entity despawns or goes away and you hold the instance it just sits there in memory and doesn't magically dissapear

wintry lynx
#

Oh no I meant like a reference as in how event.Player would receive a reference to the player involved with the event

river oracle
#

since you know its specific to the player you want

wintry lynx
#

🤦‍♂️

river oracle
#

the smell of paper

wintry lynx
#

Im smort

rare rover
#

Vanilla Components = Not Chad
MiniMessage = Chad

#

Fr

#

Today I learnt luckperms has support for minimessage

#

Which is awesome

river oracle
#

MiniMessage just parses into components :P

rare rover
#

Ye ik but vanilla components are bulky asf

#

And minimessage fixed that

river oracle
#

Sure but who does that I myself use my own parser or Minedown

#

Still doesn't work well for going in reverse though

rare rover
#

Tf is minedown

#

Never heard of it

river oracle
#

Like minimessage just different syntax

#

Same capabilities pretty much

rare rover
#

Ohh

#

Looks interesting

quaint mantle
#

Hey guys I want to save inventory to MYSQL database
Is it good way to save on database? I mean encode every itemstack in inventory

echo basalt
#

Yeah that's pretty much how it works

#

MySqlPlayerDatabase uses NMS to serialize its items

#

InventorySaver uses the bukkit object output stream

#

they're both valid approaches

vapid grove
#
if(day < currentDay){
                        item.addUnsafeEnchantment(Enchantment.DURABILITY, 1);
                        itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
                    }

The itemstack isnt showing the enchant glint, any idea why?

#

Note: The item is a Stained Glass Pane

echo basalt
#

are you setting the item back?

vapid grove
#

wait

#

no im not

#

cause i am

#

unless im missing a step here

#

item#setItemMeta is being done

echo basalt
#

inventory.setItem ??

vapid grove
#

yes

echo basalt
#

I'll need more code

upper hazel
#

found a "bug" - why when you press shift and click on a diamond in the stove, diamonds from the player's inventory and in the stove itself are stacked in the stove, ignoring the click cancel event.

vapid grove
#

i can send the whole code snipped hold on

#

?paste

undone axleBOT
vapid grove
#

before you say my code looks horrible yes i know lmao

echo basalt
#

your code looks horrible

vapid grove
#

honestly if you can tell me ways to improve my coding that would be awesome

echo basalt
#

Please make a .of method for WeightedReward

#

Map.of is also a thing

vapid grove
echo basalt
#

this might mean nothing to you but every time you {{}} it creates a new class that is never garbage collected

echo basalt
#

Why is your map static on the PlayerData class

#

I'd use dependency injection

vapid grove
#

but ill research on this

echo basalt
#

?di

undone axleBOT
echo basalt
#

It's just a constructor

#

Instead of checking slots in your GUI you can, for example, make a Selection interface and just pass a mask

#

You already use a mask for PatternUI

vapid grove
#

huh

upper hazel
#

why when you press shift and click on a diamond in the stove, diamonds from the player's inventory and in the stove itself are stacked in the stove, ignoring the click cancel event.

echo basalt
#

For example this is how I do my menus :)

vapid grove
#

huh

echo basalt
upper hazel
echo basalt
#

yep

mossy spoke
#

hey guys looking for a plugin for 1.8 spigot which adds a homing bow

#

can't seem to find any

#

looked everywhere

echo basalt
#

Make one then

#

Or adapt an existing one

sullen marlin
#

Wdym

#

getConfig()

#
BukkitWiki

The Configuration API is a set of tools to help developers quickly parse and emit configuration files that are human readable and editable. Despite the name, the API can easily be used to store plugin data in addition to plugin configuration. Presently only YAML configurations can be used. The API however was designed to be extensible and allow ...

echo basalt
#

homie's deleting messages

shadow night
#

Yo guys, I have an external app that can control my server through my plugin like another plugin would, but I'm now thinking, to make events and other small things work properly, I would probably need to somehow wait/sleep the whole main thread for it to wait for the program. Tf am I doing wrong

echo basalt
#

or you just fire nothing

#

and let the ticks pass

shadow night
#

Nah man, the program gotta do shit tick-on-tick, like a plugin, because that's kinda what I'm doing

ocean hollow
#

If a player enters a chunk, will it be immediately loaded? I mean, if you check through PlayerMoveEvent whether a player is in a new chunk, then it will immediately be loaded with an entity and all that?

echo basalt
#

if the server can't keep up

ocean hollow
#

badly

#

and if I have an Entity, I can’t access it if it’s in an unloaded chunk?

#

or can I get it by UUID?

echo basalt
#

Don't think so no

shadow night
#

You could theoretically just not let people into unloaded chunks, right?

sullen marlin
#

?xy