#help-development
1 messages ¡ Page 1327 of 1
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
Vector đ´
yeah i couldn't figure out a way to do it without the weird casting stuff, thanks for the explanation appreciate it
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
the reason i do this is because back in the day intellij wouldn't allow folding cases unless you wrapped the case in brackets
I just thought the {} looked like ass in a switch case so I never did it lol
and served no other purpose
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
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"
i also sometimes do this to make lengthy logic foldable, though arguably you should just move it to its own method if girth is an issue
Can't be having too much girth in one case
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)
horrible
disgusting
u da real art
Oh okay
ONLY FOR CHOCO if you are NOT choco DO NOT ANSWER
Oh shoot. Let me get my id
class Foo<T> {
<V> List<V> emptyList() { return List.<V>of(); }
}
var emptyList = new Foo().<String>emptyList();
what is the full type of emptyList
choco face reveal
byte
Everything is a byte
List<String>
Hold on, am I being tricked
but why
Cause var erases the type because nothing was added to it?
So it's weakly typed?
nothing to do with var, var is just inferring what the method returns
The type of a constructor (§8.8), instance method (§8.4, §9.4), or non-static field (§8.3) of a raw type C [...] is the erasure of its type in the generic class or interface C.
https://docs.oracle.com/javase/specs/jls/se25/html/jls-4.html#jls-4.8
:D

which means this compiles just file List<Long> l = new Foo().<String>empty list()
I DON'T LIKE THAT
:DDD
yes foo is type parameterised
I don't like Java anymore
Does that mean you are going to rewrite the hytale server in python
u da real python
how to serialize blockstate? i need to copy a reigon and paste it somewhere else, like worldedit does
keep the chest contents etc
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
The Blockstate itself contains all the data
maybe nms?
And BlockState has a copy(Location) method
Worldedit uses NBT
isnt nbt and blockstate the same thing
Technically you can convert it to NBT as well using the Structure system
No, BlockState is a java object, NBT is a data format
how to convert that
this is actually great
is it designed to dynamically create the structures, for example by a command?
cooool
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?
yum
Turkey*
?paste
Looking to paste something? Try a code block or one of the following websites:
- https://pastes.dev/
- https://sourceb.in/
- https://mclo.gs/ (best for server logs)
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 ?
i am trying to get vault for my sever can someone help me
What are you having trouble with?
Any version should work
on the website ?
Sure
what to throw when a passed argument is not null but it's field is null and shouldnt
?
NPE?
that's not really the answer to the question
them the question becomes "what should I throw if the optional is empty"
ok smartass
IllegalArgumentException sounds pretty fit for that either way
I think EmilyException sounds better
someone woke up on the wrong side of the bed today
what is the right side of bed?
the top side i would say
pc out the window
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
Optional is snake oil
well i prefer to be on top so that i agree with
I would like to argue that sometimes it's better âď¸đ¤
NOT ALWAYS, but sometimes
maybe
can someone pls help me adding Protection stones compatibility to oneblock's chests?
What part do you need help with
the part with adding Protection stones compatibility to oneblock's chests
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
What part do you need help with?
can i send the code here?
?paste
Looking to paste something? Try a code block or one of the following websites:
- https://pastes.dev/
- https://sourceb.in/
- https://mclo.gs/ (best for server logs)
oh i wrote you in dm
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?
Thatâs a feature of YAML, no way to change it as far as I am aware. You can use âonâ and âoffâ in quotes, but itâd be a lot better to just rename them to something like âwhitelistOnâ and âwhitelistOffâ.
oh
yes! you can also use yes, no, y, n, and all their uppercase variants
though that is yaml 1.1 and was changed in yaml 1.2 but it is still a mess
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"
fortunately i just use jackson and everything works well
it's not like i'm manually parsing it
whats the issue with toml?
it's yaml for hippies
its yaml without the bad
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
man i dont really know
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
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
i think the only good thing in yaml is the
key:
subkey:
format
anchors and aliases 
what
yaml supports referencing already-defined items through anchors, which is very powerful and useful, even if a bit troublesome to parse
oh cool shit
I would accept yaml if it didn't have a total mental breakdown because I hit the TAB key.
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.
At which point you might as well use JSON
well, yaml is a superset of json so makes sense
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
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
ohhhh i see
is json a valid option here?
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.)
Can't you do this with a permission?
and havent you asked this question like 5 times
Yeah I said permission one of those five times
Only if permission exists for said thing. The way they explained it previously was like a time based thing?
Permission exists, as I just wrote in #general + luckperms allows you to set temporary time based permissions, so like, everything is doable either via Java or Skript (if this thing is still a thing)
.properties looking real tempting
it works for static configs
towny type of shit
my addon plugins have a simple addon.txt to find path to main class
the rest of the information is given by annotations
Wow
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
you can make addons via javaplugin too
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'
good
What's with the keys ending with $
Expressions
You can literally program inside of them
awesome guy, who is pretty perfect at what hes doing with Config files
i don't like whatever that is
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
Donât think so, no.
why not
You can, I even explained exactly what permission you should set to what
Also it feels like I'm not the only one who did that
I meant like, how /fly works, you can enable it, and disable it.
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
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
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 đ
đ Maybe
easily accomplished with permissions if you know how to do groups etc. Just make a group that everyone is apart of and set its hierarchy appropriately.
for the minigame, now everyone has it disabled when they join
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
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
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
if only
if only
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
I mean it would if they added damage via the event rather than an attribute
But that would be weird
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
lol
you might wanna go to kids' birthday party if you're going to pull such a clown act
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
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
well, 50 bucks is 50 bucks 𤥠give me a project specification and 50 bucks
(i will put it into gemini)
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!
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
sounds like a job for ci and something like dependabot
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
it's called openrewrite
\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:
settings -> build, execution, deployment -> compiler -> add runtime assertions for notnull-annotated methods and parameters -> configure annotations...
got it working, ty very much
tuff
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
Well I asked in Hytale Modding
But there's still a lot of beginners
does hytale have the server incorporated in the client like minecraft does?
No
in minecraft you can just open a server from within the client
i see
so they have to make a server to play together
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
Anyone here doing commisions?
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
One question: When are you allowed to upload premium plugins?
?premium
I mean plugins that cost money.
yeah read the thread
worked for me, game released and I was immediately in a world with 2 friends :3
I love upnp
10/10 support
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.
this is a #help-server question. but do you have any other plugins that may impede on chest opening?
i will send u all my plugins
i cant send images
?img
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
just chuck it on imgur
ah..
You are though đ
you need paper to run a paper plugin lol
why blocklocker dont work :(((
?whereami
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
ok thx
Hello all, me and my son made the following plugin, and would love some feedback on it
Well that's a lot of reflection for no apparent reason
Also how much of that is just vibe coded đ
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âŚ
I would highly recommend using the world edit API
not sure why you need reflection for that
Also your plugin will most likely be removed if its for Paper only
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
no such thing!
all explosions, even huge ones, complete within the timespan of one single tick
Big explosions also look ugly as the ray casting system breaks down after a certain point
Even the description is vibecoded
It's completely vibe coded with ChatGPT seeing from the fact that the file paths are included at the top of each file
"NukeMyLocation â A true large-scale nuclear blast plugin for Paper"
Well I guess it isn't that bad
Looking at the source I donât think it uses any paper specific code
Is the github loading for yall
Hello! I dowloaded plugin and TotalVirus flag it what I can do now?
Can i add on srv?
Antivirus software is generally very bad at scanning jar files
If you're worried you can send the link for the plugin here
Yeah that one is fine
Okay, Thanks!
optic's plugin is the better option here
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
optic has an image map plugin?
u usually use LOOPH's ImageFrame
oh wait Map
duh, not expressly the same
no i meant to check for viruses
or rather force ops and such
i should've been more specific, my bad
Before ai we had help development before help development we had irc
all of which we have to tell people to ask in Paper
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.
Spigot has its own permission system, use that instead of reinventing the wheel
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)
so we basically flood a lot of people over to paper, effectively killing this chat
but anyway, is that solution good or bad, ignoring that its already implemented
i mean, that really just sounds like the industrial standard. providing permissions for specific actions
Spigot has api to create a permission system. The default is minecrafts limited op level permission.
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?
oh wait, you want to give everyone op?
Just use luckperms or groupmanager
u see, we send them away because they come here already trying to use Paper server or api
Both deny perms by default unless given
thats what i said in my first message lol
this
rational but counterproductive
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
mkay, ill get to work i guess
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?
You need to capture the packet that the client sends using ProtocolLib or PacketEvents
You can take a look at how it's implemented in CombatLogX
I'd prefer not to use those options
Do I need to use packets no matter what?
yes, because the server will otherwise send back the current existing block
What about the InteractListener? Isn't that the same?
no, the server will still send the block data back
I can send the block change again tho
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
I was thinking to put the player in adventure mode whenever they get inside these blocks so, I think that would fix it
Oh, there are another factors? Didn't know that
I guess I'll use packets then
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
How did you guys learn the bukkit api? By reading the javadocs?
Javadoc and reading other projects source code
And youtube videos
A bit of everything really
spigot forum helps too if you're in a pinch
learning by doing
"how do i...", "what if i just...", "is it possible to..."
Am I allowed to publish a pluign that uses the paper api on SpigotMC?
Plugins on Spigotmc should run on Spigot
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?
i don't think so
you could maybe add support for spigot as well
unless there's something missing in the spigot api
Hm, I dont really want to maintain two versions.
For the features I want to implement I would need the paper api
you can have a paper/spigot module
What do you mean by that?
i use their command registry system since they broke the command map way
this is a paper module
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.
i don't no
Anything posted on Spigot should still work on Spigot
Makes sense, thank you Choco.
oh shit i thought u were @mortal vortex bc i saw the pompompurin pfp
Same xD
same đ
Today I learned I recognize most people here via pfp
makes sense, usually I remember peoples names by their faces
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
why's dx negative?
i think it's the -dx that changes the yaw
or is not applied at all?
I checked in the debugger and the yaw it outputs -90 which is correct, but the armorstand's yaw is 0
hmm, maybe try nms
it's weird, sometimes it looks in a 45 degree angle and sometimes 0
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
nope, tried hardcoding -90 but still. i'll look into nms
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
i just tried manually stepping the loop and it looks in the right direction
well, you can try in a different part of the world where the coords are negated
try where the x coord is negated
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
replicating it with commands works flawlessly
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?
the minus? that's not the problem, the problem is the armorstand is refusing to rotate while moving
alright
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
are you using 1.8.8?
1.21.11
controllerlook?
ah
Which class is that in?
use way back machine
⨠<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
found this
that's the remapped-mojang one
ah perfect
this?
maybe you need to send a packet then
how would i do that with nms?
well, i'm pretty sure there's a rotate head packet
or protocollib/packetevents to keep things cleaner
i'll look into it
why is it asking for a byte though?
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
and how do i send it?
just put the degreess as byte
i mean send the packet
((CraftPlayer) player).getHandle().connection.send(new ClientboundRotateHeadPacket(Entity, byte yawdegrees));
same result
?paste
Looking to paste something? Try a code block or one of the following websites:
- https://pastes.dev/
- https://sourceb.in/
- https://mclo.gs/ (best for server logs)
What do you do to move the entity?
â¨```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
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
You can use â¨â¨EntityDamageEventâŠâŠ and checking if the cause is â¨â¨FALLING_BLOCKâŠâŠ
hmm but that only works if the anvil hits someone
i want to make increase the anvil damage radius
use â¨â¨EntityChangeBlockEventâŠâŠ and damage every entity in x radius of the spawned block
yeah sounds like the only good solution
ill have to find how to calculate the damaage though
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
eeh its whatever
sadly now it doesnt respect Anvil#maxDamage etc.
but im just coding something silly anyways
thanks
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
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
You should look into lowering that a bit
Do you change the yaw every tick?
no but the entity moves every tick
interesting
But there's no rotation and position packet in one
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
Ah yeah
also now i ran into another problem
Otherwise it'd look weird when it lags
I remember playing dbd and when my internet turned off the killer kept going forward
since the movement is completely clientside now, doing â¨Entity#getLocation⊠returns the original location
yea
is there a way to change the location of an entity on the server but without actually sending a packet to the player?
not rlly afaik
change it normally and drop the packet with e.g. protocollib
you can drop packets?!
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
ngl
the amount of % of tick time plib takes is crazy
packet events đĽ
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
^ that's what i'd do
are you referring to packetevents, injecting into netty pipeline or protocollib?
cross version support gets messy
Injecting into netty
cross version support is always messy
difference? (packetevents)
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?
what is he trying to do again?
Make the entity look at a position while moving
armorstand to be specific
Yup
what's with all this clientside velocity prediction
While applying the vector the entity doesn't change where it can look
Even with a rotate entity packet
try making task that runs every tick that moves an armorstand forward but in the same loop try changing the entity's yaw
nothing will work
I just have generators in bedwars and i change position every tick (in the entity's tick method)
And also rotate it
i don't think there should be anything stopping you from changing the yaw
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
well there shouldn't but it completely ignores it if you try or moves halfway to the yaw you asked it to
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
i have a question
how would one implement arena rollback in 1,21+
i have no prior experience with modern
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
Is there a way I can distinguish from an organic EntityDamageByEntity event and one generated by LivingEntity#attack
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
yeah
the use entity packet
thats also what i found
Attack and taking damage client side, possible
But if you have control over the attack you can do the flag thing
you can always do the evil hack of adding that entity id to a set, calling attack and checking it
Is there a way to change the color like that in the same message?
otherwise either packet listening OR bytecode manipulation
core shaders
Resend the whole message as often as you want taking over the screen
If it's a small message just pad it with empty text
Minecraft atm isn't a linux terminal đ
Nah its a bad way it will make lag in the server
Unless they added some new effect to text components
I dont think so
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
Can you use these on spigot servers?
it's a resourcepack thing
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
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
the day we get an Edit Message packet will go Crazy
ah good ol' ability plugins
started working on one and then never got around to the unlock system for them LOL
i should update that
I did a full one at work
active abilities, passive abilities
it's basically just reactive events + metadata neatly tied
There's also a structure api
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
I recommend you head over to the Paper discord
okay bye
?ask
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!
it's so crazy how this must be said so often
Did you figure it out though? Looks interesting. But I imagine its just spamming a new line each time, and pushing the old message up, and the new message has the color shifted once over.
Servers usually do that by using core shaders, spamming chat will work but at the cost of being really annoying
simple as
and just do a gradient over time
could probably conjure it up rather quickly
not even a proper answer dude
I mean
people have already said it's core shaders
so uh, update: mojang broke it in 1.21.6
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
Sadly no , ik this way but imagine 30+ players sends messages in the same time
before like 1.21.6/7 something like that it's just a gradient
how to save the structures as Strings though? using SNBT?
I don't think so
alright
Can you guys still use Libby
Can't get it to be found on any maven rep
The AlessioDP fork
It's still on the repo
Maven repository of AlessioDP Minecraft projects
There was a 2.0.0 version released
Also, IJ doesn't load it as valid
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
using basic core shaders
goddamnit discord
that's so cool, but can you apply it to only some text?
(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)
yeah probably
creating some kind of magic signature
good if true
I'm not sure if I can read the previous characters
mkv
but if I could, I'd
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
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...
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?
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
use item on should have the location of the block the item is used on
But the block is air due to it being a clientsided block
shouldn't matter for the location
Hmm Ill try, thanks
plugins can be developed against CraftBukkit alone right?
I mean if you want, sure
but there is absolutely 0 reason to do that
ok but hypothetically I am in a position where I can only do that (beta versions)
yeah, you can
would it be version specific?
wdym?
Would the binary produced be specific to the version compiled against*
Like NMS
I believe that is his question
probably
Older Craftbukkit builds are versioned
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
Pull from db sync in the event
The event is already async so it won't run on the main thread
Yeah block the thread pretty much
alright thanks
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)
Observer pattern is pretty seldom used here.
Use event bus if you plan on exposing a public api. If not itâs just a preference thing
But I would say use event bus, since you already have the system at your disposal
tyy
is it possible to remove the Mojang loading screen when a resource pack is applied?
like it just, happens
some packet or resource pack magic, maybe?
For what reason?
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
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
there is a client mod that does this however, https://modrinth.com/mod/rrls
it's still a little bit fucked because things like your chat input get reset at some point during the assets reload
how to make commands on paper 1.21.10 since i can't use yaml?
Sounds like a question for the Paper discord
đ
Hi Is there a way to detect a left-click on a distant BlockDisplay using ray tracing?
BlockDisplay dont have collision
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
);
This should work ?
probably?
wrap it in an event
then check entity
if it didnt work i wouldnt send it
oh u could
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
Use an Interaction entity
whe doesnt YamlConfiguration have a constructor like this with defaults?
you can just .setDefaults that's basically what that ctor does anyway
How to change block state by coordinates in ClientboundLevelChunkWithLightPacket 1.20.1?
YamlConfiguration extends FileConfiguration. Therefore it would be redundant
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
YamlConfig does not have a constructor taking defaults
you cannot call something that does not exist
it only has a no-args ctor
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
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
if you feed FileConfiguration configuration defaults, and then feed that into yamlconfiguration you will have your defaults
alternatively you can use https://hub.spigotmc.org/javadocs/spigot/org/bukkit/configuration/file/YamlConfiguration.html#options()
declaration: package: org.bukkit.configuration.file, class: YamlConfiguration
which does the same thing but is a convenience method
That's not what the question was about
its basics really
not sure what the hang up is on this
or are people just that incredibly dumb?
This is the hangup because it just kind of isn't right
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"
but it is true.....everything available in fileconfiguration is available in yamlconfiguration. Both YamlConfiguration and FileConfiguration implement Configuration
Except the constructors; problem is you're not mentioning the copy constructor
its not needed
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
do you not know how to go from base to child classes or something?
seems people don't learn basics
Try calling the Object constructor from the YamlConfiguration class
but aside from that, its not needed as there is a method already available for what they are wanting
so the answer is no you don't know how
got it
𤥠my brother in christ
this seems to be why people fail to understand
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
if you don't know how to traverse between extending classes then you failed at basics
simple as that
These insults are just completely unnecessary
don't care
clearly
if you take it as an insult that is your perogative not mine
okay
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
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
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
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?
sorry frosty my boy, you done did be dumb this time
if you say so but it appears people don't know how to traverse between parent and child classes
i assure you everybody involved in this conversation has a pretty good grasp of what it means that yamlconfig is-a fileconfig
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
except the constructors
you don't "go" from FileConfig to YamlConfig, you call the constructor on YamlConfig, the only one there is, that does not take a Configuration defaults argument
he doesn't mean anything because he doesn't understand the problem and is spewing bs
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
Just use the new mannequin entities
Awesome đŽ
fuuuccckkk i need to get around to experimenting with those
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
I mean, it means you don't need to do any jank with a player entity
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
you can always do everything by yourself and end up with something you actually understand and like more
im building my own plugin-development-"team", if anyone wants to join me: "https://simplepluginz.de" there is everything like dc, github etc
give me a lot of money
bro its for people who just want to code some plugins, its not paidđ
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
i think so ye
i think i found something
did you install openjdk-sources or whatever?
not yet
where do i find them?
https://github.com/openjdk/jdk i hope i don't have to zip this
ohh
awesome
i'll install them right away
yas
got it
thank you
i dont wna necro post this, but exactly do you mean by this, im just curious, maybe there's something I could learn ive missed ^^
Currently at work now. But when i get home i will come back to this.
I always just install this as it brings in the jdk too haha
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 đ
i just manually install my JDKs đđđ
That's good to know đ
On windows i just install them manually and set the path to them
Except jre 8 which i just download the installer
Well the problem is you probably have a normal one and you probably have another 20 managed by applications
I have one jdk installed then 10 installed by a jdk manager then a bunch from IJ then a bunch from mc probably
Yeah, you can use 'sudo update-alternatives --config java' to switch between versions
On windows you can just search for path
You can use the path on Linux as well?
or did I misunderstand what you meant đ¤ˇââď¸
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 ?
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
turning spaces into tabs based on number of spaces?
somewhere like that
could you not define that in a template?
in netbeans I can configure something like that in the templating or formatting rules
i mean yeah that's correct and all except that YamlConfig still has no constructor that lets you pass the Configuration defaults despite the fact that FileConfig does, if YamlConfig does not you can't create a YamlConfig instance with it
it does tho.
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)
it does not
was revealed to me in a dream
i'm sure it was
ty
it would if a method in base uses it or field and thus its a matter of calling super to either the method or super to constructor with arguments
i think ur status is very valid in this situation, i dont think either of u are going to agree here.
what
reason here in the api is because its not enforcing loading a file everytime
literally just look at this https://java.godbolt.org/z/e5nWaGGYv
it does not get that ctor generated
period
what does loading a file have to do with anything
you just wanna specify the defaults
i forgot to add extends Base but you can just add that and see how it does not get an "implicit Derived(int)" constructor
thing exists
frostalf disputes 'thing'
unheard of
The reason why your answer got backlash, as I explained yesterday, is that the question was "why does this class not have this constructor", and that your answer was "it has everything its superclass has because it extends it", which is not true for constructors, which are what the question was about
you can call super to the argument constructor. If the base uses that constructor to set fields or methods it will be usable
Derived does not get that constructor created
what is there not to understand
Derived does not have an int-taking constructor
I love calling super outside the derived class
you are not calling super
I think frost thinks you are YamlConfig
And you think you are someone consuming the yaml config API
i think frost forgot spigot api
you also not setting anything in the base either
so this is all moot
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
but its not because they misunderstood the api
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
and I explained it
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.
no you did not
lynx i'm keeping the birthday role on you for the rest of times
You- NOOOO
calling setdefaults is the first answer and suggestion emily gave
(yes I was shit posting)
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
or loadconfiguration()
frost is right tho
no one asked for me to elaborate
he is, but the answer was bad
the fuck does loadConfiguration have to do with anything
yeah emily needs to pipe down
because the base constructor is configuration?
??????
loadconfiguration is literally just
config = new YamlConfig()
config.load(file)
return config
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.
none of the loadConfiguration methods also take any defaults
my country?
i doubt it
yah mr worldwide overhere
lol I don't use my status in such ways
Well said!
Thank you! Ultimatum reached, we can be quiet now.
anyways, now I wait for conclube since my message was more directed at them
𼲠thank you for your service, approaching 6 years serving #help-development.
newgens wont understand the veteran life, its ok.