#help-development

1 messages ¡ Page 1327 of 1

sacred mountain
#

i'm trying to generalise something for a library

wet breach
#

its fine as long as you know what it is your casting. All the warning means is that the compiler can't guarantee that what you are casting is indeed correct.

Vector<Integer> vecI = (Vector<Integer>) vec;

in this example, this would throw the same warning or should. If vec on the right is a string, it would cause a ClassCastException.

#

but the compiler has no way of knowing since type erasure and generics and all that fun stuff

#

The proper thing is to avoid using raw types, but sometimes its unavoidable

thorn isle
#

Vector 👴

sacred mountain
onyx fjord
#

antipopup is 5 megs, noone ever complained

#

dw even jdk has unchecked casts

worldly ingot
#

Am I dumb and only just clueing into the fact that this actually has a purpose besides being a shit code style?

switch (...) {
    case A:
        int i = 0;
        break;
    case B:
        int i = 1; // Compile error, 'i' is already defined
        break;
}

switch (...) {
    case A: {
        int i = 0;
        break;
    }
    case B: {
        int i = 1; // Compiles fine, the 'i's are in different scopes
        break;
    }
}
#

Like I understand it. The {} provides additional scope. It's just this with a switch:

{
    int i = 0;
}
{
    int i = 1;
}

but my brain just never put two and two together

thorn isle
#

the reason i do this is because back in the day intellij wouldn't allow folding cases unless you wrapped the case in brackets

worldly ingot
#

I just thought the {} looked like ass in a switch case so I never did it lol

#

and served no other purpose

thorn isle
#

i think it makes a bit more sense than not using {} since that makes it behave the same as it does with if

#

and switch case is just if-else-if-else

worldly ingot
#

Fair point as well

#

Now 11 years of Java later and I'm like "Oh, right... {} is just a scope definition, of course you can use it in a switch and it has practical use, dummy"

thorn isle
worldly ingot
#

Can't be having too much girth in one case

sly topaz
#

I don't think I ever did use {} in a switch

#

I remove them from anywhere I can

#

but I am the type of person to do this:

for (var some : things)
  if (some instanceof Thing thing)
    doStuff(thing)
thorn isle
#

horrible

shadow night
#

disgusting

visual lagoon
worldly ingot
#

A crime only worse than using var in a for loop

slender elbow
#

@worldly ingot

#

I have fun java quiz :)

worldly ingot
#

Oh okay

slender elbow
#

ONLY FOR CHOCO if you are NOT choco DO NOT ANSWER

worldly ingot
#

Oh shoot. Let me get my id

slender elbow
#
class Foo<T> {
  <V> List<V> emptyList() { return List.<V>of(); }
}

var emptyList = new Foo().<String>emptyList();

what is the full type of emptyList

worldly ingot
slender elbow
#

choco face reveal

worldly ingot
#

List<String> thonk Hold on, am I being tricked

slender elbow
#

hehehe

#

it is not!

#

it's just erased List raw type :D

#

:) :D

worldly ingot
#

thonk but why

#

Cause var erases the type because nothing was added to it?

#

So it's weakly typed?

slender elbow
#

nothing to do with var, var is just inferring what the method returns

worldly ingot
#

But it returns <V> and <V> is String!

#

WHY DO YOU DO THIS

slender elbow
#

:D

worldly ingot
slender elbow
#

which means this compiles just file List<Long> l = new Foo().<String>empty list()

worldly ingot
#

I DON'T LIKE THAT

slender elbow
#

:DDD

worldly ingot
#

omg it's because Foo is typed

#

I hate that so much

slender elbow
#

yes foo is type parameterised

worldly ingot
#

I don't like Java anymore

young knoll
#

Does that mean you are going to rewrite the hytale server in python

pure dagger
#

how to serialize blockstate? i need to copy a reigon and paste it somewhere else, like worldedit does

#

keep the chest contents etc

lilac dagger
#

you could read the blockstate for all it has

#

inventories have item stacks that are serializable

#

i don't think there's a straight forward way

young knoll
#

The Blockstate itself contains all the data

lilac dagger
#

maybe nms?

young knoll
#

And BlockState has a copy(Location) method

pure dagger
#

but i need to save it as text

#

i guess worldedit might not do that

young knoll
#

Worldedit uses NBT

pure dagger
#

isnt nbt and blockstate the same thing

young knoll
#

Technically you can convert it to NBT as well using the Structure system

#

No, BlockState is a java object, NBT is a data format

pure dagger
#

how to convert that

pure dagger
#

ohhh

#

i have an already made solution

#

?

#

didnt know

lilac dagger
#

pretty much

#

yeah this is great

pure dagger
#

is it designed to dynamically create the structures, for example by a command?

lilac dagger
#

you need 2 locations

#

then you can save it to a file via an output stream

pure dagger
#

cooool

thick flare
#

Hello, I hope you're having a good day. I would like to purchase the ShopGui Plus extension, but since I live in Turkey and don't use PayPal, I can't buy it from the website. How can I purchase it?

sacred mountain
vast raven
#

?paste

undone axleBOT
short pilot
#

would it be wiser to add recipe through code itself or to make a helper datapack that my plugin installs on its own, that will have the recipe ?

young knoll
#

I mean, doing it through code is easy

#

So why not

haughty ledge
#

i am trying to get vault for my sever can someone help me

sullen marlin
#

What are you having trouble with?

haughty ledge
#

so i cant find the right version of vault

#

for 1.21.11

sullen marlin
#

Any version should work

haughty ledge
#

on the website ?

sullen marlin
#

Sure

pure dagger
#

what to throw when a passed argument is not null but it's field is null and shouldnt

#

?

#

NPE?

umbral ridge
#

yes

#

or use Optional

#

to avoid null

slender elbow
#

that's not really the answer to the question

#

them the question becomes "what should I throw if the optional is empty"

umbral ridge
#

ok smartass

slender elbow
#

IllegalArgumentException sounds pretty fit for that either way

umbral ridge
#

I think EmilyException sounds better

ancient plank
umbral ridge
#

what is the right side of bed?

slender elbow
#

the top side i would say

sacred mountain
#

or be me and have no error handling, if theres an error i just add a bunch of println

#

then my future self gets annoyed at my lack of code quality

#

and the cycle repeats

thorn isle
#

Optional is snake oil

umbral ridge
worldly ingot
#

NOT ALWAYS, but sometimes

slender elbow
#

maybe

little canyon
#

can someone pls help me adding Protection stones compatibility to oneblock's chests?

chrome beacon
#

What part do you need help with

slender elbow
#

the part with adding Protection stones compatibility to oneblock's chests

hazy mist
#

hi guys i need help with a really simple thing i started changing open source projects and i need help figuring out a thing with treet populator can anyone :d

chrome beacon
#

What part do you need help with?

hazy mist
#

can i send the code here?

chrome beacon
#

?paste

undone axleBOT
hazy mist
quaint mantle
#
messages:
  commands:
    on: "<green>Whitelist is now turned on"
    off: "<red>Whitelist is now turned off"

I have this code in my default config file, when I run the plugin and the default config gets copied and saved to the plugin folder, for some reason it turns into this?

messages:
  commands:
    'true': "<green>Whitelist is now turned on"
    'false': "<red>Whitelist is now turned off"
#

can anyone help?

green gyro
lilac dagger
#

does that mean you can use on/off for boolean types?

#

i didn't know

slender elbow
lilac dagger
#

that's nice

#

i didn't know

slender elbow
#

though that is yaml 1.1 and was changed in yaml 1.2 but it is still a mess

thorn isle
#

yeah we should all switch to toml that is also ass and nobody uses

#

but to be fair yes yaml is horrible

#

in being "human friendly" with all this nonsense like Y passing for true and guessing types like numbers vs strings, it's very much not "programmer friendly"

slender elbow
#

fortunately i just use jackson and everything works well

#

it's not like i'm manually parsing it

robust helm
thorn isle
#

it's yaml for hippies

robust helm
#

its yaml without the bad

thorn isle
#

and without much of the good, and with some of the bad like dates, and with some extra bad that wasn't in yaml like the near-zero adoption

robust helm
#

if u ask me, a subset with yaml would be nice

#

where the bad is removed

#

but ig it couldnt be inplemented as a subset

thorn isle
#

imo the main problem with yaml is that it's so flexible, with like 100 ways of doing multiline strings

#

if it was reduced down a bit, it'd be better

robust helm
#

i think the only good thing in yaml is the
key:
subkey:
format

slender elbow
#

anchors and aliases schnitzel

robust helm
#

what

thorn isle
#

yaml supports referencing already-defined items through anchors, which is very powerful and useful, even if a bit troublesome to parse

robust helm
#

oh cool shit

weak wasp
#

I would accept yaml if it didn't have a total mental breakdown because I hit the TAB key.

mortal vortex
#

TOML supports dot notation in the files themselves yeah? Seems better than yaml

#

YAML suffers the same problem like python, to know what "subheading" you're under, you have to check the indentation.

#

Like:

foo:
  ... #imagine we had 100 lines here
  bar:
    ... #imagine we had 100 lines here
    fizz:

if ur in fizz, u would have to scroll up like a LOT to see that ur actually in foo/bar/fizz.

ivory sleet
#

i mean yea, but technically you can use flow style for yaml

#

which is basically json

worldly ingot
#

At which point you might as well use JSON

wet breach
#

well, yaml is a superset of json so makes sense

mortal vortex
#

TOML is superior and all plugins should use it.

#

I actually fail to see a difference between TOML and ini thouguh

#

toml doesnt feel like a language, it just feels like a parser impl for toml

wet breach
# mortal vortex I actually fail to see a difference between TOML and ini thouguh

main difference is that ini has no formal specification therefore anything using the ini format does so in their own way and has limited hierarchical support. All values are strings. Last two things are not really an issue, main issue is the fact everyone has their own implementation of ini so its not the same from one thing to another.

#

I am a fan of ini myself, mainly because even with yaml, I treat everything as a string anyways which tends to make things easier in the long run at least for me

mortal vortex
#

ohhhh i see

buoyant viper
#

me when i uh

#
[Section]
Key=Value```
pliant topaz
#

is json a valid option here?

mossy dock
#

Hello everyone, quick question, the plugin that I believe is called “ValhallaMMO” gives the player / server access to a thing named “/skill”. which is a skill tree. Is there anything about it that makes it so I can either:
A) Disable /skills with a command like /disableskills
B) Make something in the plugin that let’s me make that
C) Do something else that makes that happen

(Context, this is for a server where I want to make a minigame, but there is no way to make it so people can’t just 1 shot every mob in it.)

drowsy helm
#

and havent you asked this question like 5 times

sullen marlin
#

Yeah I said permission one of those five times

mortal vortex
native gale
thorn isle
slender elbow
#

.properties looking real tempting

buoyant viper
#

Key=Value is simply the best

lilac dagger
#

it works for static configs

young knoll
#

Pfft

#

Just use .txt

thorn isle
#

towny type of shit

lilac dagger
#

my addon plugins have a simple addon.txt to find path to main class

#

the rest of the information is given by annotations

fathom fable
#

Wow

thorn isle
#

cue in my rant about plugins like bentobox fumbling together their own "addon" system when javaplugin and dependencies through bukkit are much more reliable and standard

lilac dagger
#

you can make addons via javaplugin too

fathom fable
#

just use configs like

commands:
  prq:
    name: 'prq'
    description: 'RDQImpl Commands'
    aliases:
      - rq
    usage: 'rq <admin | bounty | main | perks | quests | ranks>'
    argumentUsages:
      1$: 'lut["prefix"] & "&7/" & alias & "&c<admin | bounty | main | perks | quests | ranks>"'
    errorMessages:
      malformedEnum$: |
        lut["prefix"] & "&7The value &c" & value & " &7is not one of (" &
        iter_cat(constant_names, (constant_name) => "&c" & constant_name, "&7, ", "&cNo values available") &
        "&7)"
      playerNotOnline$: 'lut["prefix"] & "&7The player &c" & value & " &7is &cnot online"'
      playerUnknown$: 'lut["prefix"] & "&7The player &c" & value & " &7has &cnot played &7on this server before"'
      internalError$: 'lut["prefix"] & "&4An internal error occurred"'
      notAConsole$: 'lut["prefix"] & "&cYou can only execute this command in the console"'
      notAPlayer$: 'lut["prefix"] & "&7This command can only be executed as a &cconsole"'
      malformedDouble$: 'lut["prefix"] & "&7The value &c" & value & " &7is not a valid &cdouble"'
      malformedFloat$: 'lut["prefix"] & "&7The value &c" & value & " &7is not a valid &cfloat"'
      malformedLong$: 'lut["prefix"] & "&7The value &c" & value & " &7is not a valid &clong"'
      malformedInteger$: 'lut["prefix"] & "&7The value &c" & value & " &7is not a valid &cinteger"'
    permissions:
      missingMessage$: 'lut["prefix"] & "You\sre lacking the permission: " & permission'
      nodes:
        command: 'raindropquests.admin.command'
        commandAdmin: 'raindropquests.admin.command.admin'
        commandBounty: 'raindropquests.admin.command.bounty'
        commandMain: 'raindropquests.admin.command.main'
        commandQuests: 'raindropquests.admin.command.quests'
        commandRanks: 'raindropquests.admin.command.ranks'

lut:
  prefix: '&8[&1Admin&8] &7'
thorn isle
#

good

young knoll
#

What's with the keys ending with $

fathom fable
#

Expressions

#

You can literally program inside of them

#

awesome guy, who is pretty perfect at what hes doing with Config files

thorn isle
#

i don't like whatever that is

fathom fable
#

you just extend a java class with ```java
/*

  • MIT License
  • Copyright (c) 2023 BlvckBytes
  • Permission is hereby granted, free of charge, to any person obtaining a copy
  • of this software and associated documentation files (the "Software"), to deal
  • in the Software without restriction, including without limitation the rights
  • to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  • copies of the Software, and to permit persons to whom the Software is
  • furnished to do so, subject to the following conditions:
  • The above copyright notice and this permission notice shall be included in all
  • copies or substantial portions of the Software.
  • THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  • IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  • FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  • AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  • LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  • OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  • SOFTWARE.
    */

package de.jexcellence.configmapper.sections;

import de.jexcellence.gpeee.interpreter.EvaluationEnvironmentBuilder;
import de.jexcellence.gpeee.interpreter.IEvaluationEnvironment;
import org.jetbrains.annotations.Nullable;

import java.lang.reflect.Field;
import java.util.*;
import java.util.function.Supplier;
import java.util.stream.Collectors;

public abstract class AConfigSection {

private static class DefaultSupplier {
private final Supplier<Object> supplier;
private final Set<String> fieldExceptions;

public DefaultSupplier(Supplier<Object> supplier, Set<String> fieldExceptions) {
  this.supplier = supplier;
  this.fieldExceptions = fieldExceptions;
}

}

private final EvaluationEnvironmentBuilder baseEnvironment;
public final IEvaluationEnvironment builtBaseEnvironment;
private final Map<Class<?>, DefaultSupplier> fieldDefaultSuppliers;

public AConfigSection(EvaluationEnvironmentBuilder baseEnvironment) {
this.fieldDefaultSuppliers = new HashMap<>();
this.baseEnvironment = baseEnvironment;
this.builtBaseEnvironment = baseEnvironment.build();
}

public EvaluationEnvironmentBuilder getBaseEnvironment() {
return baseEnvironment.duplicate();
}

/**

  • Called to decide the type of Object fields at runtime,
  • based on previously parsed values of that instance, as
  • it's patched one field at a time. Decidable fields are
  • always read last, so that they have access to other,
  • known type fields in order to decide properly.
  • @param field Target field in question
  • @return Decided type, Object.class means skip
    */
    public @Nullable Class<?> runtimeDecide(String field) {
    return null;
    }

/**

  • Called when a field wasn't found within the config and a default could be set
  • @param field Target field
  • @return Value to use as a default
    */
    public @Nullable Object defaultFor(Field field) {
    return null;
    }

/**

  • Called when parsing of the section is completed
  • and no more changes will be applied
    */

public void afterParsing(List<Field> fields) throws Exception {
for (Field field : fields) {
if (field.get(this) != null)
continue;

  DefaultSupplier defaultSupplier = fieldDefaultSuppliers.get(field.getType());

  if (defaultSupplier == null || defaultSupplier.fieldExceptions.contains(field.getName()))
    continue;

  field.set(this, defaultSupplier.supplier.get());
}

}

protected void registerFieldDefault(Class<?> type, Supplier<Object> supplier, String... fieldExceptions) {
fieldDefaultSuppliers.put(type, new DefaultSupplier(supplier, Arrays.stream(fieldExceptions).collect(Collectors.toSet())));
}
}


and it iwill automatically read, save whatever you want to do
#

anyway gtg

mossy dock
pseudo hazel
#

why not

thorn isle
#

you can, this is what mcmmo does as well

#

and it's the standard way of doing it

native gale
#

Also it feels like I'm not the only one who did that

mossy dock
pseudo hazel
#

ah

#

so you mean how to save information based on a player

#

i.e. set if a player has skills enabled or not like a preference

worldly ingot
#

They want to disable the skill upgrades people have applied. e.g. if the player unlocked skills that got them permanent +50 damage or something, they want to temporarily disable that while they're in a minigame, then re-enable it once they've stopped playing the minigame

#

I mentioned this yesterday, this seems like a question you should be asking in the Discord of the plugin author, which I linked yesterday

#

For the record, the way you're asking the question, Regris, seems to imply you just want to disable the /skill command, which isn't what you want to do. You should ask your question more clearly when in that Discord server

young knoll
#

I was getting ready to issue an advertising ban until I saw the username…

#

Or maybe choco is just trying to sell his new commission service 👀

worldly ingot
#

👀 Maybe

wet breach
#

for the minigame, now everyone has it disabled when they join

worldly ingot
#

Not what they want. If they just wanted to disable the menu to upgrade their skills, it would be a permission.

#

They want to disable all the upgrades they've already made

wet breach
#

Well not sure how the upgrades are handled, typically done via permissions

#

so you would just strip all those in another group specifically for the minigame

#

usually a bit easier if said minigame is in a different world

worldly ingot
#

If only there were a Discord where this person could ask the authors of the plugin more directly if there were permissions to control it, or to ask for a feature to be implemented to accomplish what they need. And if only there were a moderator of a Discord that sent the invite code to that server not once, but twice

#

✊😔 if only

wet breach
#

if only

umbral ridge
#

if only

thorn isle
#

the way mcmmo does this is it adds worldguard flags that disable/enable it in certain areas

#

could also be done with permissions using luckperms region contexts if the skills plugin supports that

#

entirely depends on the skills plugin however

#

there have historically been horrible hacks like perworldplugins that'd hijack other plugins' listeners, but for something like attack damage stats, that's not going to work

young knoll
#

I mean it would if they added damage via the event rather than an attribute

#

But that would be weird

mighty dock
#

yo is anyone good at making smp like infuse and all that kinda plugins caus ei need custom abilities and a plugin maker that is not going to charge me over 60 bucks it is a big plugin but i need someone to make a it that is great with abilities and custom weaponms like infuse that kinda stuff dm me if u can ill pay

thorn isle
#

lol

slender elbow
#

you might wanna go to kids' birthday party if you're going to pull such a clown act

worldly ingot
#

That's crazy

#

?services

undone axleBOT
worldly ingot
#

But if your budget for a custom server is 50 bucks, you're up for a rude awakening. The cost of the server host itself will probably only last you about 2 months

#

The cost of labour is substantially more

thorn isle
#

(i will put it into gemini)

mortal hare
#

i dont get it why everyone is obsessed with monorepos so much nowadays. put everything in monorepo they say... until someone needs to do access control, reinvent and manage their tooling that sits on top of already existing revolutionary package called a git "repo". Seriously wtf? just because google does it doesnt mean you should
THEY DONT EVEN USE GIT!
STOP MIMMICKING SOMETHING THAT DOESNT EVEN MAKE SENSE FOR YOUR SCALE OF PROJECTS!

eternal night
lilac dagger
#

I separated my minigames into distinct projects and if the engine gets a breaking change i have to go and recompile every minigame with the changes

#

I'll still stick to this approach due to how modular it is

#

I can put any number of minigames in any package i want which is really cool

thorn isle
#

but yeah it definitely adds extra friction

#

and works only for like ABI breakage, for api breakage you still have to run around refactoring calls and shit

#

i think paper tried to get into some kind of automated refactoring system with a complicated name related to trees that i don't remember, but i don't think anything ever came of it

#

as an alternative to "just asm it at runtime bro"

#

because in 1000 years when someone actually gets rid of the material enum, people have to switch away from enumsets

dry hazel
#

it's called openrewrite

smoky anchor
#

\o I'll ask here too 'cause I feel ppl here are more helpful :D
Hytale changed the annotation lib. they went from checkerframework to javax.annotation
I remember I set IntelliJ to use the checkerframework by default and now I can't find the setting
Anyone know where it is ? :D
For example it affects this:

dry hazel
#

settings -> build, execution, deployment -> compiler -> add runtime assertions for notnull-annotated methods and parameters -> configure annotations...

smoky anchor
#

got it working, ty very much

buoyant viper
#

hytale discord is so Hhhh to ask for support in rn still cos its all dumbos that cant figure out how to play co op

smoky anchor
#

Well I asked in Hytale Modding
But there's still a lot of beginners

lilac dagger
#

does hytale have the server incorporated in the client like minecraft does?

lilac dagger
#

in minecraft you can just open a server from within the client

#

i see

#

so they have to make a server to play together

pseudo hazel
#

I mean its kinda the same

#

the client world is just a server

#

in hytale you cant have a client in a world without a server

#

downloading the hytale client also downloads HytaleServer.jar, which is the server

young knoll
#

Hytale does support UPnP though

#

Granted it didn’t work when I tried it

worthy prism
#

Anyone here doing commisions?

pseudo hazel
#

?services

undone axleBOT
rich bay
#

One question: When are you allowed to upload premium plugins?

chrome beacon
#

?premium

undone axleBOT
rich bay
#

I mean plugins that cost money.

chrome beacon
#

yeah read the thread

rich bay
#

oh okay (:

ancient plank
#

I love upnp

sullen marlin
ebon igloo
#

Hi,
I have an issue with BlockLocker on my Minecraft server.

The plugin correctly sends the message:
“You cannot use this block, it is protected by …”
but the chest still opens anyway.

The server is running Spigot/Bukkit (not Paper).

Is this a known issue with BlockLocker on Spigot/Bukkit, or is there a fix for this behavior?

Thanks in advance.

drowsy helm
drowsy helm
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

drowsy helm
#

just chuck it on imgur

ebon igloo
#

here

drowsy helm
#

Yeah nothing really stands out

#

I would recommend contacting the dev

ebon igloo
#

ah..

drowsy helm
#

also you are using paper

#

you said you're not

ebon igloo
#

im not

#

its just a paper plugin

chrome beacon
#

You are though 💀

drowsy helm
#

you need paper to run a paper plugin lol

ebon igloo
#

yes but we dont care

#

the problem is with a bukkit pluginĂš

ebon igloo
sullen marlin
#

?whereami

drowsy helm
#

paper works differently to spigot

#

it can affect how a plugin interacts with the server

#

BlockLocker has a discord on their plugin page I would highly recommend asking there

ebon igloo
#

ok thx

delicate grotto
chrome beacon
#

Well that's a lot of reflection for no apparent reason

#

Also how much of that is just vibe coded 💀

young knoll
#

Oh yeah all the worldedit stuff is reflection

#

Maybe they didn’t know how to add dependencies at compile time so they asked the ai for a workaround…

drowsy helm
#

not sure why you need reflection for that

#

Also your plugin will most likely be removed if its for Paper only

thorn isle
#

spawning a very powerful explosion might work better with e.g. protection plugins, though if it's too large, it can become a performance issue

slender elbow
#

no such thing!

#

all explosions, even huge ones, complete within the timespan of one single tick

young knoll
#

Big explosions also look ugly as the ray casting system breaks down after a certain point

native gale
vast ledge
#

It's completely vibe coded with ChatGPT seeing from the fact that the file paths are included at the top of each file

fallow hawk
#

Well I guess it isn't that bad

young knoll
#

Looking at the source I don’t think it uses any paper specific code

fallow hawk
#

Is the github loading for yall

young knoll
#

And it has a regular plugin.yml

#

So it’ll probably run on spigot

fallow hawk
#

Yeah it should

#

Apart from the reflection it seems fine even if vibe coded

somber kelp
#

Hello! I dowloaded plugin and TotalVirus flag it what I can do now?

#

Can i add on srv?

chrome beacon
#

If you're worried you can send the link for the plugin here

somber kelp
#

ImageOnMap

#

From spigot

chrome beacon
#

Yeah that one is fine

somber kelp
#

Okay, Thanks!

lilac dagger
#

optic's plugin is the better option here

thorn isle
#

they finally updated imageonmap?

#

incredible

#

i remember dropping it like 5 years ago because their horrid, colossal nms "core library" didn't look like it would ever get an update

buoyant viper
#

u usually use LOOPH's ImageFrame

#

oh wait Map

#

duh, not expressly the same

lilac dagger
#

no i meant to check for viruses

#

or rather force ops and such

#

i should've been more specific, my bad

olive lance
#

Before ai we had help development before help development we had irc

buoyant viper
twin kiln
#

Ok, so this may be a very dumb idea, but im not sure:
I wana have some 'permision system', but /op wont do, so i remove the default /op, give everyone max and then accept or deny for example place block requests based on a custom permission system, and make the server not send that surtain commands exist (like /whitelist and /stop) to pepole without the permission.
Is this a very bad idea or is it a good one? And if its bad, how would you do it instead?
So a very clear goal: i need to give players permissions, but the 0-7 system in ops.json or whatever its called wont do, i need like /perm <player> <permToGive> for pepole with the perm for that, with the server itself having every perm ofc.

smoky anchor
twin kiln
#

🤯

#

lol

rotund ravine
#

Just use luckperms

#

Easy api

#

Easy editor

#

Easy everything

twin kiln
#

Wait i remember fabric server having that too, is that the same thing or something different? (and yes i know that this is the spigot discord, not fabricmc)

hybrid spoke
twin kiln
hybrid spoke
wet breach
twin kiln
#

yea, but like i can imagine that giving everyone max op is not a good idea, but if i deny non-allowed packets its good?

hybrid spoke
#

oh wait, you want to give everyone op?

wet breach
#

Just use luckperms or groupmanager

buoyant viper
wet breach
#

Both deny perms by default unless given

twin kiln
#

thats what i said in my first message lol

twin kiln
hybrid spoke
hybrid spoke
# twin kiln this

just.. don't. stores also don't give everyone manager permission, just because there is a sign with "DO NOT ENTER"

#

you want to just limit their actions, not grant them full access AND THEN limit their actions

twin kiln
#

mkay, ill get to work i guess

acoustic pendant
#

Hey, i'm trying to set ghost blocks only a player can see by using the sendBlockChange() method, however when a player interacts with this blocks they dissapear, how can I make so they do not dissapear if a player interacts with them?

chrome beacon
#

You can take a look at how it's implemented in CombatLogX

acoustic pendant
#

Do I need to use packets no matter what?

slender elbow
#

yes, because the server will otherwise send back the current existing block

acoustic pendant
slender elbow
#

no, the server will still send the block data back

acoustic pendant
slender elbow
#

sure, i mean you will see the real block flash before you get the fake one again

#

and you'd also need to account for other environmental factors that resend the real block that aren't just interacting with it directly

#

which also depends on what the real block is

acoustic pendant
#

I was thinking to put the player in adventure mode whenever they get inside these blocks so, I think that would fix it

acoustic pendant
#

I guess I'll use packets then

thorn isle
#

iirc the server also sends the whole chunk you're in occasionally, so you might have to filter the MAP_CHUNK packet or follow it with another block change also

distant cosmos
#

How did you guys learn the bukkit api? By reading the javadocs?

chrome beacon
#

Javadoc and reading other projects source code

#

And youtube videos

#

A bit of everything really

lilac dagger
#

spigot forum helps too if you're in a pinch

hybrid spoke
#

"how do i...", "what if i just...", "is it possible to..."

halcyon light
#

Am I allowed to publish a pluign that uses the paper api on SpigotMC?

chrome beacon
#

Plugins on Spigotmc should run on Spigot

halcyon light
#

That's what I figured. What should I do if I want to migrate an existing plugin from spigot api to paper api? Can I still keep the resource up with a disclaimer on newer versions, and have those newer version downloads as links to another platform?

lilac dagger
#

i don't think so

#

you could maybe add support for spigot as well

#

unless there's something missing in the spigot api

halcyon light
#

Hm, I dont really want to maintain two versions.

#

For the features I want to implement I would need the paper api

lilac dagger
#

you can have a paper/spigot module

halcyon light
#

What do you mean by that?

lilac dagger
#

i use their command registry system since they broke the command map way

#

this is a paper module

halcyon light
#

Oh I see. I'll have to look more into that, thank you

#

Do you or anyone else know where I can find official rules on this though? Because I also wouldn't mind just migrating to paper and another platform, but still having my resource up on spigot with a disclaimer to find new versions on another platform.

lilac dagger
#

i don't no

worldly ingot
#

Anything posted on Spigot should still work on Spigot

halcyon light
#

Makes sense, thank you Choco.

buoyant viper
#

oh shit i thought u were @mortal vortex bc i saw the pompompurin pfp

vast ledge
#

Same xD

chrome beacon
#

same 💀

vast ledge
#

Today I learned I recognize most people here via pfp

pseudo hazel
#

makes sense, usually I remember peoples names by their faces

dawn flower
#

why can't i change the yaw of an armorstand and right after change its pose?
⁨⁨⁨```java
lookAt(knight, enemy);
Vector direction = knight.getLocation().getDirection().multiply(0.2);
Location location = knight.getLocation().add(direction);
location.setPitch(0);
knight.teleport(location);
animator.update();

default void lookAt(ArmorStand stand, Entity target) {
Location standLoc = stand.getLocation();
Location targetLoc = target.getLocation();

double dx = targetLoc.getX() - standLoc.getX();
double dz = targetLoc.getZ() - standLoc.getZ();

float yaw = (float) Math.toDegrees(Math.atan2(-dx, dz));

standLoc.setYaw(yaw);
standLoc.setPitch(0);

stand.teleport(standLoc);

}


⁨⁨⁨``update``⁊⁊⁊ changes the armorstand's pose. everything in this works except the fact that it looks in a different direction. i know ⁨⁨⁨`lookAt`⁊⁊⁊ isn't the problem because ⁨⁨⁨``yaw``⁊⁊⁊ in it is -90 which is correct
lilac dagger
#

why's dx negative?

#

i think it's the -dx that changes the yaw

#

or is not applied at all?

dawn flower
#

I checked in the debugger and the yaw it outputs -90 which is correct, but the armorstand's yaw is 0

lilac dagger
#

hmm, maybe try nms

dawn flower
#

it's weird, sometimes it looks in a 45 degree angle and sometimes 0

lilac dagger
#

try putting different yaws to the stand

#

static values

#

too see if teleport actually works as expected

#

if not you might have to use nms

dawn flower
#

nope, tried hardcoding -90 but still. i'll look into nms

lilac dagger
#

this is what i use to convert a vector to yaw

#

if you're getting negative yaw when it's positive in f3 you can put the sign before Math.atan2

#

doing it in vector changes the direction of the vector

dawn flower
#

i just tried manually stepping the loop and it looks in the right direction

lilac dagger
#

well, you can try in a different part of the world where the coords are negated

#

try where the x coord is negated

dawn flower
#

for some reason if you make a 1 tick timer that constantly teleports an entity to different locations (e.g. forward) and change its yaw at the same time, it will ignore the yaw change and only move forward until it stops which is when it will apply the changed yaw

#

it will keep that behavior until around 15 ticks

dawn flower
#

replicating it with commands works flawlessly

lilac dagger
#

good to know

#

i remember having to do something similar to villagers on 1.8.8

#

i had to set the look controller to where i wanted to look and apply a very small vector change to actually apply

#

what about that sign

#

did you move it outside?

dawn flower
lilac dagger
#

alright

dawn flower
#

the only difference i can think of between the commands and the plugin is that ⁨setRotation⁊ in NMS changes variables in the entity class rather than changing the entity directly whereas the commands directly change the entity's rotation

lilac dagger
#

are you using 1.8.8?

dawn flower
#

1.21.11

lilac dagger
#

ah

#

on 1.8.8 i had to do this

dawn flower
#

controllerlook?

lilac dagger
#

yup

#

but not on armorstand

dawn flower
#

ah

lilac dagger
#

it's not a creature

#

hmm

#

what about this nms for 1.21.11?

#

armor stand has these

dawn flower
lilac dagger
#

it's mojmaps

#

?nms

lilac dagger
#

use way back machine

dawn flower
#

⁨ <dependency> <groupId>org.spigotmc</groupId> <artifactId>spigot</artifactId> <version>1.21.11-R0.2-SNAPSHOT</version> <classifier>remapped-mojang</classifier> <scope>provided</scope> </dependency>⁊

can't find it

lilac dagger
#

don't forget the remapper

#

but Mob is a bukkit class

dawn flower
#

found this

lilac dagger
#

this one

#

look for head rotation too

#

is that spigot mappings?

dawn flower
#

that's the remapped-mojang one

lilac dagger
#

ah perfect

dawn flower
lilac dagger
#

ah no

#

just apply the code i gave

#

it's my own code

dawn flower
#

alright

#

nope didn't work

#

i need something to directly add nbt to the armorstand

lilac dagger
#

maybe you need to send a packet then

dawn flower
#

how would i do that with nms?

lilac dagger
#

well, i'm pretty sure there's a rotate head packet

dawn flower
#

or protocollib/packetevents to keep things cleaner

dawn flower
lilac dagger
#

i haven't used those, but it should be pretty similar

#

i found this in nms

dawn flower
#

why is it asking for a byte though?

lilac dagger
#

wait, let me check

#

byte b2 = Mth.packDegrees(this.entity.getYHeadRot());

#

i guess there's no reason to send a 32 bit when it comes to 180 to -180

dawn flower
#

and how do i send it?

lilac dagger
#

just put the degreess as byte

dawn flower
#

i mean send the packet

lilac dagger
#

((CraftPlayer) player).getHandle().connection.send(new ClientboundRotateHeadPacket(Entity, byte yawdegrees));

dawn flower
#

same result

lilac dagger
#

oh wow

#

not expected

#

i'm not sure then without checking your code

dawn flower
#

?paste

undone axleBOT
dawn flower
lilac dagger
#

What do you do to move the entity?

dawn flower
#

⁨```java
Location location = knight.getLocation();
Vector direction = location.getDirection().multiply(0.2);
location = location.add(direction);
knight.teleport(location);

#

adding ⁨location.setYaw⁊ won't work

lilac dagger
#

Hmm

#

I'll try to see for myself

dawn flower
#

i did it!

#

sending the position and rotation in one packet fixed it

robust helm
#

what event gets called on anvil land? (falling anvil block -> anvil block)

#

EntityChangeBlockEvent works but doesn't give context on damage caused to hit players or other related info

dawn flower
#

You can use ⁨⁨EntityDamageEvent⁊⁊ and checking if the cause is ⁨⁨FALLING_BLOCK⁊⁊

robust helm
#

hmm but that only works if the anvil hits someone

#

i want to make increase the anvil damage radius

dawn flower
#

use ⁨⁨EntityChangeBlockEvent⁊⁊ and damage every entity in x radius of the spawned block

robust helm
#

yeah sounds like the only good solution

#

ill have to find how to calculate the damaage though

dawn flower
#

2 * (blocks fallen - 1)

#

no clue how you will find the blocks fallen

#

maybe you can keep monitoring the anvil from the second it spawns until it hits the ground

robust helm
#

eeh its whatever

#

sadly now it doesnt respect Anvil#maxDamage etc.

#

but im just coding something silly anyways

#

thanks

dawn flower
#

yw

#

⁨⁨@lilac dagger⁊⁊ sorry for ping; is it safe to send a move+rotate packet every tick for each "minion"? there will be around 30 "minions" per player (possibly more)

that's 600 packets per tick at only 20 players

thorn isle
#

every entity sends a position/rotation packet every tick to every nearby player anyway

#

even if they don't move

#

so you're not doing anything the game isn't already doing

#

it does scale terribly, but computers are fast

lilac dagger
#

Do you change the yaw every tick?

dawn flower
#

no but the entity moves every tick

nocturne wing
lilac dagger
#

But there's no rotation and position packet in one

nocturne wing
#

also i've never seen anyone do this before but

#

did you know that the entity motion is completely out of sync with the client?

#

the server doesn't know what the client's motion values are

#

in order to fix it and make it 1:1 with the client

#

we can run the same encode/decode for velocity which client runs

#

so that the next tick

#

it's 1:1 with the client

dawn flower
#

also now i ran into another problem

lilac dagger
#

Otherwise it'd look weird when it lags

#

I remember playing dbd and when my internet turned off the killer kept going forward

dawn flower
#

since the movement is completely clientside now, doing ⁨Entity#getLocation⁊ returns the original location

nocturne wing
#

yea

dawn flower
#

is there a way to change the location of an entity on the server but without actually sending a packet to the player?

nocturne wing
#

not rlly afaik

thorn isle
#

change it normally and drop the packet with e.g. protocollib

dawn flower
thorn isle
#

most packets yes

#

some packets like block break and block break ack involve sync numbers that have to be ordered and have to match, and dropping those can fuck the client state

#

but dropping entity movement packets is fine

nocturne wing
#

the amount of % of tick time plib takes is crazy

#

packet events 🔥

thorn isle
#

most efficient way is to inject into the netty pipeline yourself, depend on nms to see the actual packet objects passing through it, and dropping them there

#

but generally just protocollib is fine and is much easier to get into

lilac dagger
#

^ that's what i'd do

dawn flower
nocturne wing
lilac dagger
#

Injecting into netty

thorn isle
#

cross version support is always messy

dawn flower
#

difference? (packetevents)

lilac dagger
#

What if instead of applying a vector you simulate the trajectory and set the position manually in the entity via code and let the server handle the packets naturally?

thorn isle
#

what is he trying to do again?

lilac dagger
#

Make the entity look at a position while moving

dawn flower
#

armorstand to be specific

lilac dagger
#

Yup

thorn isle
#

what's with all this clientside velocity prediction

lilac dagger
#

While applying the vector the entity doesn't change where it can look

#

Even with a rotate entity packet

dawn flower
#

nothing will work

lilac dagger
#

I just have generators in bedwars and i change position every tick (in the entity's tick method)

#

And also rotate it

thorn isle
#

i don't think there should be anything stopping you from changing the yaw

lilac dagger
#

If instead of applying a vector direction and instead set new positions gradually there's no prediction

#

Well, i can't tell without running a small test

#

It also sounds weird to me since entities do move head when they are kb ie a player

dawn flower
lilac dagger
#

I also don't like that - in the dx inside the atan2

#

I have a rotate mace plugin made for a friend and i used atan2 to point the mace's tail toward a player

#

And i used - outside the atan2 to match mojang

nocturne wing
#

i have a question

#

how would one implement arena rollback in 1,21+

#

i have no prior experience with modern

lilac dagger
#

My favorite type of rollback is to store block states in an array deque

#

It works on all versions from 1.8.8 to latest

#

You just have to do a little leg work to track all those changes but it's worth it

zealous scroll
#

Is there a way I can distinguish from an organic EntityDamageByEntity event and one generated by LivingEntity#attack

lilac dagger
#

I don't think so 🤔

#

Attack simulates an actual attack

#

But if you do the attack you can turn a flag saying you'll trigger a simulated attack

#

And the next entity damage event can be ignored

#

Since it's all synched it'll be a perfect way to solve it

zealous scroll
#

thats also what i found

lilac dagger
#

Attack and taking damage client side, possible

#

But if you have control over the attack you can do the flag thing

echo basalt
#

you can always do the evil hack of adding that entity id to a set, calling attack and checking it

potent crescent
echo basalt
#

otherwise either packet listening OR bytecode manipulation

lilac dagger
#

If it's a small message just pad it with empty text

#

Minecraft atm isn't a linux terminal 🙁

potent crescent
lilac dagger
#

Unless they added some new effect to text components

potent crescent
lilac dagger
#

Well it's laggy, but it's the only way to do it as far as i know

#

But for tests or controled uses this is fine

#

It's just 30 messages

#

Not should what's the max visible text size

lilac dagger
echo basalt
#

it's a resourcepack thing

lilac dagger
#

Oh wow

#

That's amazing

#

I didn't know

mighty dock
#

anyone good at making ability plugins neeed someone to do me one i ahve it written out already just need someone to make it if ur also good at making coomand plugins i need somone that can do that to i will PAY

#

DM ME IF U CAN

chrome beacon
#

?services

undone axleBOT
buoyant viper
lilac dagger
#

I agree

#

Or more text components

#

Sounds easier

young knoll
#

I mean, you can delete messages

#

But I think it only works with signed ones

echo basalt
#

ah good ol' ability plugins

buoyant viper
#

started working on one and then never got around to the unlock system for them LOL

#

i should update that

echo basalt
#

I did a full one at work

#

active abilities, passive abilities

#

it's basically just reactive events + metadata neatly tied

lilac dagger
echo basalt
#

@buoyant viper here's some code if you want inspiration ig

elfin gale
#

Please help me i'm going insane, some player desync issue on my server. Even AI wasn't able to fix. Paper 1.21.11

#

please private message me and i'll make a clip if possible

chrome beacon
elfin gale
#

okay bye

grave sandal
#

hello there

#

can somebody help me coding?

chrome beacon
#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

buoyant viper
mortal vortex
sly topaz
#

Servers usually do that by using core shaders, spamming chat will work but at the cost of being really annoying

grim hound
#

and just do a gradient over time

#

could probably conjure it up rather quickly

mortal vortex
grim hound
#

people have already said it's core shaders

grim hound
#

before then text rendered normally each frame

#

now it renders once

#

and isn't really re-rendered

#

I mean, it kind of is, but not each frame

potent crescent
grim hound
pure dagger
umbral ridge
#

is it possible to make links clickable in kick menu?

#

is text interactable at all?

chrome beacon
#

I don't think so

umbral ridge
#

alright

grim hound
#

Can you guys still use Libby

#

Can't get it to be found on any maven rep

#

The AlessioDP fork

chrome beacon
#

It's still on the repo

grim hound
#

Also, IJ doesn't load it as valid

chrome beacon
#

It's not on their maven repo

#

so yeah

#

Only up to 1.3.1 is

#

Wait they changed the group id for 2.0.0

#

but yeah 2.0.0 is not on their maven

grim hound
#

goddamnit discord

lilac dagger
#

that's so cool, but can you apply it to only some text?

grim hound
#

(GameTime isn't properly updated in 1.21.6/7 or smthg, or maybe it's the redraws never happening, so this is at 1.21.4)

grim hound
#

creating some kind of magic signature

lilac dagger
#

good if true

grim hound
thorn isle
#

mkv

grim hound
#

but if I could, I'd

mortal hare
#

https://news.ycombinator.com/item?id=40497061
internet: USE microservices, jwt's, distributed computing, decentralized authorization!
meanwhile tech giants: centralized computing, modules, and stateful tokens

unscaled

Here's the thing: neither Google, nor Facebook is using JWT for their access or refresh tokens. The only place they use JWT, as far as I know, is for the ID Token in their Open ID Connect Flow, since this is a mandatory (and terribly misguided) part of the spec.I keep seeing the idea that JWT was designed for Google or Facebook scale being repea...

thorn isle
#

AWS is 10x slower than a dedicated server for the same price

#

ruh roh, you must use stateless horizontally scalable microshlop

#

what do you mean you can just put it in the box?

lament hill
#

How can I cancel rightclicking on clientsided blocks? I can't seem to get a location from USE_ITEM or USE_ITEM_ON

#

I only want to cancel clicks in a specefic area

thorn isle
#

use item on should have the location of the block the item is used on

lament hill
#

But the block is air due to it being a clientsided block

thorn isle
#

shouldn't matter for the location

lament hill
#

Hmm Ill try, thanks

plush rivet
#

plugins can be developed against CraftBukkit alone right?

drowsy helm
#

but there is absolutely 0 reason to do that

plush rivet
drowsy helm
#

yeah, you can

plush rivet
drowsy helm
mortal vortex
#

Like NMS

#

I believe that is his question

ember glen
#

probably

lilac dagger
#

Older Craftbukkit builds are versioned

umbral ridge
#

is it possible to "stall" the AsyncPlayerPreLoginEvent

#

eg. do something async, and then continue the event

#

eg. pull player data from the db (async), and then continue with the event

#

eg.: if player data is loading 2 seconds, I don't want it to complete after the player already joins the game

chrome beacon
#

The event is already async so it won't run on the main thread

onyx fjord
#

Yeah block the thread pretty much

umbral ridge
#

alright thanks

robust helm
#

chat when should i use observer pattern and when use the bukkit event bus?

#

for example i reset the map-cycle-timer that automatically changes the map every 10minutes, whenever the /forcemap command is used. I could listen to my MapChangeEvent or do mapManager.addObserver(this)

drowsy helm
#

But I would say use event bus, since you already have the system at your disposal

grim hound
#

is it possible to remove the Mojang loading screen when a resource pack is applied?

#

like it just, happens

grim hound
chrome beacon
#

For what reason?

slender elbow
#

with a client mod sure

#

also

or resource pack magic
meaning.. you'd need to apply a resource pack to get rid of the resource pack loading screen? that doesn't make a whole lotta sense

thorn isle
#

packet magic no, since the thing is client side

#

resource pack magic yes (just make the texture transparent) but as noted that's kind of putting the cart before the horse

#

it'd only make sense if you're repeatedly reloading the resource pack, since the transparent texture would still be in from the previous loading of it

#

it's still a little bit fucked because things like your chat input get reset at some point during the assets reload

placid rivet
#

how to make commands on paper 1.21.10 since i can't use yaml?

chrome beacon
placid rivet
#

👍

orchid brook
#

Hi Is there a way to detect a left-click on a distant BlockDisplay using ray tracing?

mortal vortex
#
Vector start = player.getEyeLocation().toVector();
Vector direction = player.getLocation().getDirection();

RayTraceResult result = player.getWorld().rayTraceEntities(
    player.getEyeLocation(),
    direction,
    maxDistance, // define this wtv double
    0.5, // cus there isnt a bounding box
    entity -> entity instanceof BlockDisplay
);
mortal vortex
#

probably?

#

wrap it in an event

#

then check entity

#

if it didnt work i wouldnt send it

orchid brook
#

Im gonna try thank

#

I heard that some people sometime use slime for the hitbox

mortal vortex
#

oh u could

orchid brook
#

One last question I see more and more plugins making TextDisplay clickable from far away, but as far as I know TextDisplay has no collision. Do you have any idea how they do it?

#

nvm i found it

thorn isle
#

Use an Interaction entity

pure dagger
#

whe doesnt YamlConfiguration have a constructor like this with defaults?

slender elbow
#

you can just .setDefaults that's basically what that ctor does anyway

autumn zinc
#

How to change block state by coordinates in ClientboundLevelChunkWithLightPacket 1.20.1?

wet breach
slender elbow
#

what

#

it is not redundant if the constructor doesn't exist

wet breach
#

it means you can feed fileconfiguration into yamlconfiguration which can have defaults

#

therefore redundant. Extending means it takes from the base and well extends it, not makes something new base wise therefore everything available in fileconfiguration is available in yamlconfiguration unless overridden

slender elbow
#

YamlConfig does not have a constructor taking defaults

#

you cannot call something that does not exist

#

it only has a no-args ctor

wet breach
#

guess its too much for you

#

it extends fileconfiguration therefore everything available from there is available in yamlconfiguration

#

this includes feeding configuration defaults

#

if you can't figure out how to go from fileconfiguration to yamlconfiguration then it seems you are forgetting basics

#

or you forgot the purpose of extending if you are just going to implement the same in the extended class which makes it well... redundant

#

if you are just going to implement it there, then no use in extending to begin with

thorn isle
#

Constructors are not part of inheritance

#

YamlConfiguration doesn't inherit the constructor from FileConfiguration

#

So while yamlconfiguration does inherit the setDefaults method, there is no constructor that directly provides defaults

wet breach
#

which does the same thing but is a convenience method

thorn isle
#

That's not what the question was about

wet breach
#

its basics really

#

not sure what the hang up is on this

#

or are people just that incredibly dumb?

thorn isle
#

Setting aside that many subclasses do override to deprecate/disable superclass behavior (think immutable collections), it isn't immediately clear from this that you are talking about the "copy constructor"

wet breach
#

but it is true.....everything available in fileconfiguration is available in yamlconfiguration. Both YamlConfiguration and FileConfiguration implement Configuration

thorn isle
#

Except the constructors; problem is you're not mentioning the copy constructor

wet breach
#

its not needed

rough ibex
thorn isle
#

It sounds like you're saying that you can call the fileconfig constructor that takes defaults through the yamlconfig constructor, despite there being no such constructor overload on yamlconfig

wet breach
#

do you not know how to go from base to child classes or something?

#

seems people don't learn basics

thorn isle
#

Try calling the Object constructor from the YamlConfiguration class

wet breach
#

but aside from that, its not needed as there is a method already available for what they are wanting

wet breach
#

got it

thorn isle
#

🤡 my brother in christ

wet breach
#

this seems to be why people fail to understand

thorn isle
#

You can't tell the yamlconfig constructor which fileconfig constructor it should call

#

It will call the constructor it wants to call; you can't affect this behavior externally

wet breach
#

if you don't know how to traverse between extending classes then you failed at basics

#

simple as that

rough ibex
wet breach
#

don't care

rough ibex
#

clearly

wet breach
#

if you take it as an insult that is your perogative not mine

rough ibex
#

okay

thorn isle
#
    public YamlConfiguration() {
        yamlDumperOptions = new DumperOptions();
        yamlDumperOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
        yamlLoaderOptions = new LoaderOptions();
        yamlLoaderOptions.setMaxAliasesForCollections(Integer.MAX_VALUE); // SPIGOT-5881: Not ideal, but was default pre SnakeYAML 1.26
        yamlLoaderOptions.setCodePointLimit(Integer.MAX_VALUE); // SPIGOT-7161: Not ideal, but was default pre SnakeYAML 1.32
        yamlLoaderOptions.setNestingDepthLimit(100); // SPIGOT-7906: The default limit (50) can be easily reached with nested bundles

        constructor = new YamlConstructor(yamlLoaderOptions);
        representer = new YamlRepresenter(yamlDumperOptions);
        representer.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);

        yaml = new Yaml(constructor, representer, yamlDumperOptions, yamlLoaderOptions);
    }

which FileConfiguration constructor does this constructor call?

#

the answer is it calls the implicit no-args super()

#

you cannot tell it to call FileConfiguration(Configuration defaults)

#

because this is the only constructor on YamlConfiguration

#

therefore there is no code path that will take you from YamlConfiguration::new to any line of code in the FileConfiguration(Configuration defaults) constructor

#

therefore you cannot use the FileConfiguration constructor that takes defaults to construct a YamlConfiguration

#

as noted by emily like 1000 comments ago, there is a setDefaults which it inherits, but the question is about the constructor, of which there is none

wet breach
#

so you don't know how to traverse the classes

#

got it

#

that is all you had to say and it would make sense in why you are failing to grasp in why I say it is redundant especially given the fact that there is a method provided to load configurations

rough ibex
#

of course, lowly peasant. It makes complete sense for why a mind such as yours would fail to grasp the most basic and simple concepts, of which i will not explain or justify my reasoning towards! as your brain is too feeble to begin to see the logic in my thoughts. I should not even waste my time explaining my obviously correct position to you, as i know you would never get it, and that is sinply too obvious. and if you cant get it, well... harumph! well, jolly good show of clownery. ta taaa

wet breach
#

seems you have nothing better to do 😉

#

however, no one asked for me to explain anything either. Nor does everything warrant an explanation or just because I make a comment means it must always be accompanied by an explicit one

#

but clearly you want to explain right?

thorn isle
#

sorry frosty my boy, you done did be dumb this time

wet breach
#

if you say so but it appears people don't know how to traverse between parent and child classes

thorn isle
#

i assure you everybody involved in this conversation has a pretty good grasp of what it means that yamlconfig is-a fileconfig

young knoll
#

No but you see

#

Clearly you don’t know how to traverse between child and parent classes

#

And frost clearly does and will kindly explain it for you

slender elbow
pure dagger
#

Lol

#

I don't know what he means actually

#

What is traversing

slender elbow
#

he doesn't mean anything because he doesn't understand the problem and is spewing bs

limber marten
#

Hey guys, what lightweight npc lib do you guys recommend me to use for 1.21.11 pls? I tried https://github.com/juliarn/npc-lib but idk if there's another one

#

ideally I want to shade it, but if I can't its fine

young knoll
#

Just use the new mannequin entities

lilac dagger
#

Awesome 😮

buoyant viper
thorn isle
#

they don't offer much of anything new i don't think

#

one thing that is new with them is that you can use a resourcepack asset for their skin, but i think that might also be doable with playerprofile now on players, i'm not 100% sure

young knoll
#

I mean, it means you don't need to do any jank with a player entity

thorn isle
#

i suppose, but everyone and their grandma has been using something like libsdisguises or npc-lib or citizens for them anyway, so that's not new either

#

in most cases you will still end up needing one of those for the ai side of the npc

#

it does mean that the internals in those libs are probably going to be cleaner

#

and that you can raw-dog it easier yourself, but i still wouldn't recommend it

#

definitely a good addition from mojang though, i'm not arguing against that; spawning fake players has always been a horrible mess

umbral ridge
latent moon
#

im building my own plugin-development-"team", if anyone wants to join me: "https://simplepluginz.de" there is everything like dc, github etc

thorn isle
#

give me a lot of money

latent moon
#

bro its for people who just want to code some plugins, its not paid😂

lilac dagger
#

i'm not sure what i was doing before, but does anyone know how to have jdk show sources and documentation in intellij? I tried this

#

i have openjdk from the apt package manager

ivory sleet
#

i think so ye

lilac dagger
#

i think i found something

slender elbow
#

did you install openjdk-sources or whatever?

lilac dagger
#

not yet

#

where do i find them?

#

awesome

#

i'll install them right away

#

yas

#

got it

#

thank you

ivory sleet
wet breach
sullen marlin
mortal vortex
#

i literally dont even know how to install JDK, I just get Prism Launcher to do it.

#

I also have no idea how to query all my JDK installs on Windows, so I also just open up Prism Launcher, go to the "Detected Java installs" and copy the paths 😭

buoyant viper
#

i just manually install my JDKs 😭😭😭

lilac dagger
#

On windows i just install them manually and set the path to them

#

Except jre 8 which i just download the installer

molten hearth
#

I have one jdk installed then 10 installed by a jdk manager then a bunch from IJ then a bunch from mc probably

onyx fjord
#

U can see them all with alternatives

#

If properly installed

lilac dagger
#

Yeah, you can use 'sudo update-alternatives --config java' to switch between versions

lilac dagger
#

On windows you can just search for path

chrome beacon
#

You can use the path on Linux as well?

#

or did I misunderstand what you meant 🤷‍♂️

wet breach
# ivory sleet i dont wna necro post this, but exactly do you mean by this, im just curious, ma...

so in the case of earlier the reason I said it was redundant is because fileconfiguration is abstract and yamlconfiguration extends it and thus is a concrete subclass. In regards from going between classes that are extended, to go from parent to child also known as downcasting you have to do an Explicit cast. If you want to go from child to parent, you have to do an implicit cast also known as upcasting.

//Implicit cast or upcasting
Parent p = new Child();
p.show(); // Calls the overridden child method
//Explicit cast or downcasting
Child c = (Child) p;
c.specificChildMethod(); // Now you can access child-specific methods

This is not typically ideal but is generally how you go about it if you have no other way. However in the case of what was being talked to specifically. FileConfiguration is abstract and thus can't be instantiated directly, thus the whole constructor deal is moot because it is only there to initialize fields. Yamlconfiguration can be instantiated directly and it has nothing in the constructor and this is done on purpose because it isn't synchronized. It also allows you to re-use the object as well by loading or unloading whatever configurations you want. If you really need the base class then you would just upcast. And if you need to call the constructor for some reason you can use super((parameters)). Since we can use super and the super class is abstract, it is generally wise that a no-argument constructor be provided otherwise super().whatever will fail at compilation.

FileConfiguration config = new YamlConfiguration();
#

learning casting to me is pretty basic. Maybe super() could be classed a bit above beginner as well as abstract classes but that is an entirely different topic I suppose.

#

think that covers everything, doubt any of this you didn't know with the exception of the specifics of those two classes maybe

#

Also, if someone is not happy with yamlconfiguration then you could just extend fileconfiguration yourself and implement your own configuration class

#

that is the more ideal solution since we are not avoiding the whole polymorphism and OOP stuff by just casting everywhere lol

#

also to further note on why yamlconfiguration has no argument constructor is also because child classes call parent constructors automatically

#

if the child has no-argument constructor, it calls the no-argument constructor of parent

#

since there is an implicit call to super() that is added during compiling

#

it can be problematic if we are forcing initialization of fields of the parent if they are not needed

#

and as I stated earlier if you do need them, just use super to call the argument constructor

#

now maybe it is more clear where I said it is redundant ?

onyx fjord
#

not exactly development help - but is there an intellij extension that makes spaces appear smaller (simulating tab behavior)

#

for example for 4 spaces trimming the last one to appear as 3

wet breach
#

turning spaces into tabs based on number of spaces?

onyx fjord
#

somewhere like that

wet breach
#

could you not define that in a template?

#

in netbeans I can configure something like that in the templating or formatting rules

slender elbow
mortal vortex
#

it does tho.

slender elbow
#
class Base {
  Base() {}
  Base(int i) {}
}
class Derived extends Base {
  Derived() {}
}

Derived does not get an "implicit" Derived(int i) ctor, so you can't call new Derived(123)

slender elbow
mortal vortex
#

was revealed to me in a dream

slender elbow
#

i'm sure it was

mortal vortex
#

ty

wet breach
mortal vortex
#

i think ur status is very valid in this situation, i dont think either of u are going to agree here.

wet breach
#

reason here in the api is because its not enforcing loading a file everytime

slender elbow
#

it does not get that ctor generated

#

period

#

what does loading a file have to do with anything

#

you just wanna specify the defaults

slender elbow
mortal vortex
#

thing exists
frostalf disputes 'thing'

slender elbow
#

unheard of

thorn isle
wet breach
slender elbow
#

Derived does not get that constructor created

#

what is there not to understand

#

Derived does not have an int-taking constructor

eternal night
#

I love calling super outside the derived class

wet breach
#

you are not calling super

slender elbow
#

so i cannot pass an int to derived

#

okay megamind where do i call super

eternal night
#

I think frost thinks you are YamlConfig

#

And you think you are someone consuming the yaml config API

slender elbow
#

i think frost forgot spigot api

wet breach
slender elbow
#

why would i

#

it's just the constructor that matters

wet breach
#

so this is all moot

eternal night
slender elbow
#

okay, you tell me right now you are given an api with those two classes
how do you, as a library user, create an instance of Derived by passing an int to it?

#

that is what yesterday's problem is about

wet breach
#

but its not because they misunderstood the api

slender elbow
#

they didn't misunderstand the api

#

they are simply asking why doesn't Spigot's YamlConfiguration have a constructor that takes a Configuration argument

#

because it doesn't

wet breach
#

and I explained it

mortal vortex
#

this is like that time i started an argument with my history teacher and derailed a class for 40 minutes even tho i knew he was right, just because i didnt wanna accept defeat.

slender elbow
#

no you did not

eternal night
#

You could just call set defaults on the yaml config emily

#

All moot

slender elbow
#

lynx i'm keeping the birthday role on you for the rest of times

eternal night
#

You- NOOOO

thorn isle
#

calling setdefaults is the first answer and suggestion emily gave

eternal night
#

(yes I was shit posting)

thorn isle
#

the reason why this became an issue is that frost came in with an undescriptive and on-its-face wrong answer that at best didn't help and at worst mislead

wet breach
#

or loadconfiguration()

mortal vortex
#

frost is right tho

wet breach
thorn isle
#

he is, but the answer was bad

slender elbow
#

the fuck does loadConfiguration have to do with anything

mortal vortex
#

yeah emily needs to pipe down

wet breach
slender elbow
#

??????

#

loadconfiguration is literally just

config = new YamlConfig()
config.load(file)
return config

mortal vortex
#

look im not trying to be sarcastic and petty cus i dont stoop as low as lynx, but you have to understand, this man fought for your country Emily. respect a veteran when you see one.

slender elbow
#

none of the loadConfiguration methods also take any defaults

#

my country?

#

i doubt it

mortal vortex
#

yah mr worldwide overhere

wet breach
mortal vortex
#

Thank you! Ultimatum reached, we can be quiet now.

wet breach
#

anyways, now I wait for conclube since my message was more directed at them

mortal vortex
#

newgens wont understand the veteran life, its ok.