#dev-general
1 messages · Page 165 of 1
alex true but I guess people gets missleaded when in reflection to get those you'd call getMethod or getDeclaredMethod
lol
love how we both instantly thought Niall as soon as I mentioned Spring
ye
bruh im so confused what the pattern even is for this code clash thing
||reverse the numbers||
well yea
||the first number is how many there are||
|| first number is the amount of items after it ||
nice one
zsh: command not found: brain today alright
hey who reckons I'm gonna get pinged and DMed a lot with my current status lol
a setter should be enough, I'm thinking of going all in with a UnaryOperator and Consumer as well
🙄
this is pretty cool lol
yea it is
just switch to Kotlin maybe? @steel heart xD
they should make an intellij plugin tho so i can get auto complete
lisps are just one of those annoying, useless things in the world, a bit like wasps
lmao
@surreal quarry share code
I am not very good at this xD
||reverse the numbers||
||first number is length||
||^^^^||
||shall we just talk in spoilers now lol||
imagine having 100 devs
100 devs?
I knew what to do
||no I have auto spoiler thing||
but I didn't know the java methods to do it xD
ah
|| @steel heart you bot ||
||its convenient||
||how?||
Also joined late but that's just an excuse
||less clicks||
||what you running? MS-DOS? lol||
||(println (join " " (reverse (sort list))))||
||yo mom||
What I've been meaning to ask was
||did somebody say Python time?||
line 32
Does kotlin have some sort of class names?
Like String.class.name() in Java or whatever
something comparable
what
https://hasteb.in/rexeheja.cs <- I think something swrong has to be with lore tho
String::class.java.name ?
I mean it uses the java name, I meant like the kotlin version of those?
OK So its
me.freshpeppermint.utils.ItemUtils.getItem(ItemUtils.java:27) ~[FreshCrates.jar:?]
Material material = Material.getMaterial(main.getConfig().getString("custom-items.<customitem>.customdiamond.material".replace("<customitem>", customitemname)));
that line
@empty flint if it's a jvm class, it's the same
@prisma wave sorry just had to leave that as I realised I added my school publicly available for the internet to see lol
oh lol
this one was hard lmao
lol the challenge was the smallest code size
one more
^
Ye
send link
U guys know why this code's giving a null pointer error at line 27?
So i have this in my listenr class I know the listener class aint the problem:
ItemUtils.giveItemToPlayer(player, ItemUtils.getItem(main.getConfig().getString("customdiamond"), 1));
And here is my itemUtils class:
https://hasteb.in/uquhaziq.java
my config:
custom-items:
customdiamond:
itemname: "&eHello"
material: DIAMOND
data: 0
lore:
- "&7Hello"
- "&7You yoo"
customdiamond1:
itemname: "&eHo"
material: DIRT
data: 0
lore:
- "&7Hello"
- "&7You yoo"```
config is null, or customitemname isn't valid
^
private static FreshCrates main;
public ItemUtils(FreshCrates main) {
ItemUtils.main = main;
}
what
Does anyone know how to make rank voucher scroll with arcane vouchers ?
like between ranks. Mvp,MVP+,MVP++ and you just get 1 of them ?
aint nobody answering and this channel is alive rip
we're all playing a game lmao
just us 3?
i guess
im not good but its fun
^
no Im serious
so am i
I fkn got 0%
fr lmao
¨lol
my code wont work :(
should've used clojure 
anyone interested in helping me for a second?
ah
sure I can assist in development
well gg
I did it now with much boilerplate
u had 19
show me
System.out.println(s.split(" ").length % 2 == 0 ? ""+arr[arr.length/2-1]+arr[(arr.length/2)] : arr[arr.length/2]);
Can't
or msntg
what the
also my clojure skills are not so good
i tried to do the last program in clojure
ye
Needed the docs at least 4 times
ah
@prisma wave how would I go about making a list of strings into a list of pairs or better yet a map where every even index is the key and every uneven one is the value?
trying to parse a command using Clikt framework and I can't figure out how to get a map from arguments.
But I can get a list of strings
and I want to have a list of pairs instead
and make those pairs into a map eventually
Uh I think you could use windowed() or group()
And then just map the Lists into Pairs
yaaa
Uh I think you could use windowed() or group()
@prisma wave I think I have to use zip. Dunno how to get the index via group.
But how do I get every even element and every odd element into a list?
cursed
@ocean quartz is the markdown messages gonna be a plugin/papi extension type thing or a library ||or both||
Lib
ayee
awesome
^
since you got the code for it already, but it might be hard to implement as an expansion
%markdown_{message}% or something maybe
hard thing would be to allow other placeholders i think
I have no idea how to implement it as an expansion but the lib will be legit just Message.create().parse("**your** markdown").send(player)
does #parse have a vararg param as well?
like if you want to send multiple lines of messages
No, just one
Though the correct way to use would be something like:
final Message message = Message.create();
final MessageComponent component = message.parse();
// Then here you decide what to do
component.send();
component.asBaseComponent();
component.toString();
to implement it as a exansion,
public String onPlaceholderRequest(Player player, String identifier) {
return Message().create().parse(identifier).toString()
}```
that might not be exactly right but you get the idea
then you would just do %markdown_**markdown** __message__% or smth
well Matt I guess you'll support \n then?
Need to think about that xD
The same way minecraft does
#development for support
o
ill help you there
1.16
its pretty hot
I missed it to be honest it is literally the only version that I didn't inform myself about lmao
By the way check out the new bingo update on #showcase, if you want give me a few suggestions.
you may already be planning this, but try to clear the map first
The map is not there
or maybe make it so it doesn't give you that map until its prepared to look like the bingo board
Its just because it was there from the previous test
ah ok
Anything else?
I don't know if to make the horizontal and vertical lines match the diagonal one or to do the opposite
Like the thickness of the line when you find the full line
i think i like the horizontal one better
but it might just be personal preference
Yeah but like idk it doesn't show the item behind almost at all
And it has to be a 3 player podium like win so 3 lines can be completed
Yeah I don't know why I read diagonal lmao
Its not that easy tbh on a 128x128 canvas to make the lines look good haha
?
or is it somehow all done via code
Code code
damn nice
It uses Image from the java Graphics selects random items and draws them on the background that is already saved in the folder and can be changed
@steel heart you deserve a medal
Then the green tick is another file you can change and the red lines are drawn with the Graphics too
🏅
damn thats cool
ive been wanting to figure out that image editing stuff for a discord bot lol
but ive just been too lazy and too busy
I mean money drives it its for a client lmao
ah that'll do it
I would have not gotten myself into it alone too haha
It was like intimidating at first
But yeah it is not too difficult just 13 hours of coding lmao
Most of that was trying to draw the red lines hahaha
yea i feel like once i got the basics down, i would be able to do it, i just gotta jump into it and actually figure it out lol
Yup
I need to use another api but can't figure out how to use it
As that one has way more features with maps
hello i want to ask one more simple question
Umm, is the inventory slot on GUI :java Inventory MainIsUpgradeGUI = Bukkit.createInventory(null, 36 is from 0?
nope
is it from 1?
Yup 36 is right
kay thanks
Wut?
In real time code, slot starts at 0
> Inventory MainIsUpgradeGUI = Bukkit.createInventory(null, 36)``` but it's from 1 in this code
Anyway, I used to make smth with map before: https://gfycat.com/cleverequalarkshell
That is the inventory size and the size is a normal number starting from 1
Btw got the new map api working
Why is it not loading as a gif e.e
need a higher tier
Yeah anyway that gif is scuffed lmao
Let me upload the video link
If you could resend it so it shows up that would be great
Ty
uh hello
That’s pretty neato
what is lava + water generator event?
like when it generate a cobblestone
i want to cancel the event tho xD
@EventHandler
public void OnDestroy(BlockFormEvent e, Island i) {
UUID player = i.getOwner();
Player p = Bukkit.getOfflinePlayer(player).getPlayer();```
vault is the best dependencies xD
Wait why onDestroy() has another argument other than the event?
You should setup a method to get the owner of the island from the player object or something along those lines
^
also i don't think the event has anything to do with vault unless im missing something
yeah same I think he imported BlockFormEvent from Vault maybe(?) other than that I don't see it used.
also i don't think the event has anything to do with vault unless im missing something
@surreal quarry look the player p
not vault?
thats a spigot method
or bukkit or whatever you wanna call it
declaration: package: org.bukkit, interface: OfflinePlayer
not vault?
@surreal quarry it's casting UUID
from UUID To Player
and also im using 1.8 xD
That is bukkit getting the offline player object from the uuid
also you should not get the player directly there and first run a check if the player is online
actually
if (e.getBlock().getType() == Material.STONE || e.getBlock().getType() == Material.COBBLESTONE && i.getMembers().contains(p.getUniqueId())) {```
im checking the member is in the owner team
Will avoid any errors down the line even if it is minor
yes ik
I don't know how you are handling the members but it could still contain the player uuid even after being offline if not handled
ghost ping :))
Not again 🤣
we talking about 1.8 users?
Somebody pinged?
user deleted message
Who pinged me?
@jesus01
pinged me
RedEpic#7542
@ocean quartz Editor for what exactly?
Frost can you please get rid of the idiot who keeps pinging everyone randomly?
Gaby is on it
we talking about 1.8 users?
@obtuse gale I'm one of it , why?
yes
@RedEpic#7542 who the fuck r y
R u
Stop aj.
ok 
hi has anyone used redirectplus
@distant sun Why you call me stoopid? 
Why not @hot hull
Looking for some help getting this setup
Can't seem to get it to work for my server smh
oof
Okay 😣
» Give the helpers some details
» Ask suitable questions
» Be polite
» Wait
Explain "can't get it to work". Is there an error, does it not download or is your machine on fire?
Or have you been hacked
Does gradle import different dependencies for source files and test files?
aparently it does
testCompileOnly("dependency...") in case anybody is wondering
@prisma wave Oh wise one, I humbly seek your Kotlin wisdom:
I have the following extension function for org.bukkit.Effect
operator fun Effect.get(identifier: String): Effect? {
return Effect.valueOf(identifier)
}
It is located in a .kt file in my src/main/<irrelevant packages>/util package and works fine when I use it from the source folder.
In my src/test/ folder, however, I can't use the function at all aparently. Not even if I define the extension function in the test script file. I can import it manually from the util package but it stays unused and the call
Effect[value] or even Effect.get(value) gives the compile error Unresolved reference: get
Any ideas why that is?
Oh I think I see now why it doesn't work. The extension function doesn't extend the static Effect but an instance of the Effect enum...
eh
I dont like the way ive currently got it setup so i can work on the same project on two PCs
cos I always forget to commit changes to git so then ive gotta grab my laptop and do it
im gonna try using a remote server or something
Host your files on a remote server instead of git
yeah...
idk how well IJ will play with that but hopefully its nice
since I dont wanna have to like re-open the project everytime
Probably easy if you have a nas
nas?
ah
Hi I have eclipse mc built in server and i wonder what VM arguments i need to add to remove the mc server default gui
like
-nogui
on .bat file
why eclipse
i tried todo it on IntelliJ haven't found a tutorial for this
i am trying to do like live debuging and building i saw my friend has it like a built in server and the plugin recompiles and load its self to the server
maybe that
@empty flint because it's an extension upon an Effect member not the companion object yeah
There's an existing kotlin function that will do basically that
enumValueOf() or something
enumValueOf() or something
@prisma wave Can't find it
enumValueOf<Effect>(string)
that'll be it
also that original function you posted btw @empty flint can literally just be this: ```kotlin
operator fun Effect.get(identifier: String) = Effect.valueOf(identifier)
Effect.Companion.get*
me love expression functions lol
Effect.Companion.get*
his original one usedEffect.getso I just used that
That would have to called already on an instance of Effect
yeah ik
also when I quoted that, your original message contained double backticks, which is redundant, which may be helpful if you're on mobile
you can just use `single backticks`
fair enough
yeah Effect.Companion.get would mean that it's a factory function right?
does Kotlin have its own equivalent of getResourceAsStream btw?
It would simply mean its part of the Companion object of the class being referred to, as in not the part of an actual instance of the class
A factory function would mean you are creating an instance of something I presume, which isn't happening in this context as its trying to get a Enum value
It would simply mean its part of the Companion object of the class being referred to, as in not the part of an actual instance of the class
A factory function would mean you are creating an instance of something I presume, which isn't happening in this context as its trying to get a Enum value
yeah true
does Kotlin have its own equivalent of
getResourceAsStreambtw?
@jovial warren in what class?
Can I ask why Skull doesn't have itemmeta, then how can I set the name? NBT?
ItemStack it = new ItemStack(Material.SKULL_ITEM, 1, (short) 3);
// it.hasItemMeta() <-- false
You can still do getItemMeta iirc
Heresy
I just saw it in a help server... I'm disgusted
So I'm using this to "pretiffy" materials, however it only capitalized the first part, any other methods which capitalize every word?
StringUtils.capitalize(String.join(" ", item.getType().name().split("_")).toLowerCase())
kotlin
@hot hull wordutils.capitalizefully
Also, just replace _ with space instead of using two functions.
Oh yea smart
Day 1 Without a DI container: How do I improve this
@heady birch HELP
in Java you use Class#getClassLoader and then ClassLoader#getResourceAsStream
https://github.com/JetBrains/Exposed/tree/master/exposed-spring-boot-starter look what I just found
this is so good
being able to use Exposed instead of fucking shitty JPA
I hate regex 🙃
I hate dependency injection
JPA good
I haven't had to deal with any dependency injection harder than Spring
DI is nice
nah fuck JPA
@jovial warren not that I know of
but eveeyone loves n.java
I hate dependency injection
@heady birch
@prisma wave ah okay
n.kt much better Kali
N.clj
yeah JPA for me is just inconvenient, since I can't use data classes (which would make sense the way JPA is designed), I have to provide a default argument for all the params, and I have to manually annotate each one with @Column since my columns are defined differently to the default data types
@heady birch no I mean the Java Persistence API lol
do you guys reckon intellij will play nicely with files on a server? Or am i gonna have to re-open the project every time
I just can't get my head around it
I wish something existed that meant I could just open up intellij on my laptop and my project from my pc is instantly there
you can use data classes
Just kotlin ruining the experience 🙂
@heady birch fuck you
you can use data classes
yeah but you need to provide a default argument for every parameter
there's a kotlin plugin that adds jpa support
wait what
and anyway, personally I find Exposed much cleaner and nicer to work with, though it was made in Kotlin for Kotlin so... yeah...
I wish something existed that meant I could just open up intellij on my laptop and my project from my pc is instantly there
@obtuse gale thats what github is for
yeah but you need to provide a default argument for every parameter
not sure about that
I keep forgetting to commit and stuff from one pc tho
Ideally id like everytime I save it would automatically go to the other pc
which is why i was thinking a remote server, but i doubt ij will play well
just save the files to dropbox or something lol
Hmm shouldn't it load it?
i feel like intellij will make me re-open the project everytime then bm
Well anyway the new api is working like a charm
it should refresh the files
not sure about that
@prisma wave JPA strictly requires a default no-arg constructor for some stupid reason on all entities
now to work out how to setup dropbox lol
Thanks
@jovial warren which is what the kotlin plugin does
also
it makes perfect sense
how would it instantiate an entity without it
I didn't think it was the one that was supposed to instantiate entities
I thought that was my job
...
so I can provide the correct values
not if it's an entity being loaded from a database
but what if it's one being created and put in to a database
then you would instantiate it yourself
exactly
???
but why then would it need a no-arg constructor if it already has all the values it needs?
saves trying to work out which value is which
JPA is designed for beans
which have a no arg constructor as part of the spec
ah
Does anybody know why regexr stops after the first match?
can you actually create a bean of an object btw? I know it sounds like a stupid question since objects only have a single instance but ya never know lol
probably a bad idea
@empty flint
using+ can make it match more than 1
thats not just regexr tho thats regex in general
I mean Nial do you need their instance kept?
Oh hello there
using
+can make it match more than 1
@surreal quarry I know that, but if there are more than one matches in a string it usually tells you all the matches
due to the global flag
nah tests are where you need it to work
I tried to restart it 3x times
epic try file > clear caches & restart
nah tests are where you need it to work
@surreal quarry Well yes and no. I don't want to match the whole test string, just want to split a string according to the matches
yea but tests are what accurate test the regex
Any solutions?
for example this shows it matches everything
I updated the git to the latest
but it doesn't actually
Unistalled then install the latest one
yea but tests are what accurate test the regex
@surreal quarry I realize that but it's just not feasable in my case
AHH
help
I just downloaded some intellij plugin and now theres an anime girl in the bottom corner of my intellij
AJHHHH
lmao
I just downloaded some intellij plugin and now theres an anime girl in the bottom corner of my intellij
@obtuse gale hm
ah ok blocky
Is there a thing like a negated group?
I want to match any character that is not a ", but I want to match an escaped \"
[^"] just matches for not " and will also not match \", but I need it to match \"
I am noticing with intellij & dropbox when I click on a class it takes like 3-4 seconds before the class is like 'loaded' and is coloured
not enough rainbow
Chained functions for builders are better
what?
builder pattern is not idiomatic
.setY()
.setZ()```
Kotlin's builder pattern is alright I suppose
???
CC noob
I mean I love builders ngl but idk whether builders really fit in with Kotlin
Whats the kt pattern?
DSLs
English
Domain-Specific Languages
val embed = buildEmbed {
title = "Hello"
description = "Blah"
footer = "blah"
color = Color.BLUE
}```
Mhm
Javascript lol
val embed = buildEmbed {
title = "Hello"
description = "Blah"
footer = "blah"
color = Color.BLUE
}```
never knew builders were SAM
eyy dropbox actually works
Whos sam
SAM builders are actually really nice
its not perfect - you do have to open/close the file for it to update
but its pretty good
@distant sun SAM stands for Single Abstract Method
Javascript lol
@heady birch except javascript is actually better in this regard because what you get is actual data, a map
true
Named params allow you to have 2 methods with the same params tupes
Doesn't work for everything but it's useful with json apis obviously
So you can do method(param = true, param2 = false) and it will know which one to use
Nike
basically SAM conversions are for converting this: ```java
@FunctionalInterface
public interface Function<T, R> {
T apply(R value);
}
public class Main {
public static void main(String[] args) {
Function<Whatever, Whatever> myFunction = something -> { whatever }; // I think lambdas like that are allowed in Java not sure
myFunction.apply(whatever);
}
}
to this: kotlin
fun main() {
val myFunction = { whatever }
}
hard to explain but it just works
¯_(ツ)_/¯
fucntion
@prisma wave did I get it anywhere near right?
function
imagine knowing how functional interfaces work
https://kotlinlang.org/docs/reference/java-interop.html#sam-conversions @distant sun read here
I'm terrible at explaining lol
lol
SAM stands for Single Abstract Method @obtuse gale
also how do you not know how functional interfaces work? lol
if you're trying to write java code that's wrong
idk
just never learnt them lol
@prisma wave did I actually do well at that example?
okay
wow from that comparison especially, Java is definitely not something I miss lol
exactly
value -> {}
``` vs
```kotlin
{ value -> }
still need a way to get ⛏️ in unicode
and Kotlin has 3 lines compared to Java's 5 (excluding empty spaces and the functional interface declaration)
\⛏️
@obtuse gale wdym?
ive got an emoji in a string and I want its unicode
Function<Whatever, Whatever> myFunction = something -> { whatever };
val myFunction = { whatever } both 1 line
lol
don't ask to ask
ask your question
https://www.spigotmc.org/threads/advancement-creator-rapid-advancement-creation-library.293465/
is this require a resource pack? I read about advancement while ago but don't remember if they do require resource pack to be install or not
OOff can somebody help me out with the following regex?
Sure borz, what are you trying to do?
is this require a resource pack?
No @meager cairn
Nice class name 
DontCareFieldPosition
this "is a" sam\\"ple reg\\'ex 'text with' spaces on your: screen and "has es\"ca\'ped quotes"
I need a regex that gets me all the spaces that are not between quotes, but the tricky part here is that I need to ignore escaped quotes. I have tried to do it with lookahead and stuff but it doesn't seem to be working very well. Another rule is that if the space is next to the word "on", it's ignored and if the space is next to a ":" or "," character it's ignored except if those caracters are escaped.
this is what I got so far
it has a couple of errors
nwA\" on \"worldA: "displaynam\"eA and b" is supposed to be one single match
oh sorry I forgot to say, I need either all the spaces so I can split the string there, or all the tokens so I can just put them in a list, idc which way
I feel like I fell into a rabbit hole and made this whole thing so much more complicated than it needs to be
Anyone else having shadow spazz out occasionally? Mine just fails to delete a class from time to time, but after I rerun it, it works just fine
Oh I think I made some progress: (([^\s"':,]|\")+|"(([^"]|\")*)"|'([^']*)') @old wyvern
now I just need to match the "on <word>: " thing
Holy xD. ok lemme catch up with the specifications you gave
hold up
here u go
current best
if you check out the last link
all the matches are tokens I need to parse
but
I just need to combine a certain combination of tokens
namely the word "on" should merge with both tokens on either side of it. So i.e. nwA\" on \"worldA becomes one single token instead of the 3 it currently is
and the same with the ':' character
otherwise it's done
and idk if I should maybe do this part in kotlin
I mean you them separately later on right?
You should have named groups for each type of token
how do named groups work in regexr? Idk how to do that
You can refer to https://github.com/ElaraLang/Elara/blob/parser/src/main/kotlin/io/github/elaralang/elara/lexer/TokenType.kt If you'd like
but how do I declare variables in regexr?
isn't that what the TokenType essentially does?
No, its just a easier way to create the huge | part of named regexes
so you want me to do this in kotlin?
That would be easier to work with, writing a rather large regex is usually hard to maintain
@old wyvern can you maybe explain to me why this matches?
shouldn't [^ "':,] exclude anything starting with "
1.8 tho
@hot hull I feel attacked by that tip...
well screw you too then 😄
❤️
how did you make the lore dynamic?
I mean how could I not 
I also have custom mob support, custom drops support, spawner tax, spawner stacking, and a shit ton of neat features 
Have I also mentioned the entire activation and spawning system is custom
@empty flint
That matches coz of this part (([^ "':,]|\"|')+)
You need to double escape the /
rn it considers the " as escaped
ah got it
((\\")|(\\')|([^ "':,]))+This is possibly closer to what you wanted there right?
Yugi, you just mashing your symbols section of the keyboard?
😢
Hm no something doesn't seem right with the escaping
(?<nq>([^\s"':,]|\\"|\\')+) doesn't match \"worldA
Try the regex I gave ya
specifically \\" matches \" of course but not with the +
order matters
It tries to match the first or block to be valid
Right, I think I finally got the words down
Awesome
It tries to match the longest input it can, right?
can I re-use defined groups?
oh I can
neato
alright so this is my regex, right?
(?<word>((\\"|\\'|[^\s"':,])+)|(((?<!\\)")((\\"|[^"])+)((?<!\\)"))|(((?<!\\)')((\\'|[^'])+)((?<!\\)')))
simply called "word"
these are the matches
but now if I just append (\s*:\s*(\k<word>))?
I'd expect this to match, right?
whitespace, :, no whitespace, word
and I know that both "worldD" and value\"D are already matched as words
So what gives, @old wyvern ?
(Also sorry if I'm bothering you too much, feel free to tell me to fuck off and solve it myself)
https://paste.jaims.dev/iduwodinur.nginx
Is that what Kotlin builders should look like. not sure if it works yet, still gotta test it, but is that the general syntax
ah alr
I DID IT!!!
(((\\"|\\'|[^\s"':,])+)|(((?<!\\)")((\\"|[^"])+)((?<!\\)"))|(((?<!\\)')((\\'|[^'])+)((?<!\\)')))((\s+on\s+(((\\"|\\'|[^\s"':,])+)|(((?<!\\)")((\\"|[^"])+)((?<!\\)"))|(((?<!\\)')((\\'|[^'])+)((?<!\\)'))))?(\s*:\s*(((\\"|\\'|[^\s"':,])+)|(((?<!\\)")((\\"|[^"])+)((?<!\\)"))|(((?<!\\)')((\\'|[^'])+)((?<!\\)'))))?)?
Chonker
rofl
good luck to whoever gets to debug it
fuck you, future Blocky
I am making his life miserable
Yeah without your tip that the order matters I would have struggled for another couple of hours before giving up. Thanks a lot, Yugi!
good luck to whoever gets to debug it
@empty flint https://www.debuggex.com/ 🤣 https://i.imgur.com/ie4hy9C.png
Test your regex by visualizing it with a live editor. JavaScript, Python, and PCRE.
it doesn't seem to know lookbehind?
ah nvm gotta switch on the PCRE
yo that is actually hella useful, thanks gaby
Anyone knows how to make automations/inspections do this on fix
@NotNull
public Object get() { return null; }
instead of
public @NotNull Object get() { return null; }
or if there is a nice regex to fix that with one click
That should be a setting yeah
I don't think you need regex, there should be an option somewhere ;o
uh I kinda tried everything and its still not rly functioning
or I mean the most relevant options like in code style etc
Is there anyway to dynamically add to an old configuration with YAML Configuration? (IE: So you don't have to reset a config)
uh yeah? just make a new key?
Or what do you mean by reset a config?
Why would you have to?
mackenzie depends on what you want to add
Let say I updated the config, I wouldn't want to have to reset it to get the latest config options.
make an autoupdater or something
why would you reset it? just add the new key and save to file
Yes, but how. I need examples, or references.
Yes, but how. I need examples, or references.
@lavish notch Do you know how to set a value?
He knows
^
Then do that but for a new key.
I was wondering if there was a easy way, or if I literally have to hard code some shit for each option
You might have to pseudo hardcode
I was wondering if there was a easy way, or if I literally have to hard code some shit for each option
@lavish notch Probably hard code
or maybe not
I mean the config is as hard coded as it has to be, right?
ConfigMe does that :P
The keys aren't dynamic, they are static
ew configme
I'm trying to get off ConfigMe
ah
as it inflates file size by 300kb
I mean do like this
ConfigMe is good
You could check how they do it
ConfigMe is good, yeah - but the 300kb, no thank you.
That's small
a nice all in one lib
What does it add to file size?
More than configme
oh well the one I use takes 2,2mb or smtng iirc
if you want to try it out I have a shaded version
becasue dependencies are fucked up in the repo one
but it has other features like a fkn lot
It matters for me as my internet is awful so uploading 1mb actually takes a bit of time 😢
I get 0.1mb upload lol
wth
That sounds similar to mine
and 2mb download
Whilst I've got y'all, might yous have an answer to another one of my questions:
https://www.spigotmc.org/threads/spectator-perspective-viewing.458627
Make your own spectator mode
How would I make my own?
You up to give me a crash course to packets?
Uh I think there exist some good tutorial out there
Conclure, that'd be a bitch to make :p
I just want to make a smooth freeze feature, non of that shakey stuff client side with the cancelling of movement.
Well okay so basically you'd send a packet through casting a player to craftplayer then invoke getHandle and then get the connection and then invoke sendPacket
I'd recommend protocollib
okay so this is w/o (just nms)
Player player = ...;
((CraftPlayer)player).getHandle().playerConnection.sendPacket(...);
thats the packet types
Wait so why don't you just use the spectator mode?
I am
Idk he didnt like the view perspective feature
Maybe look into this
that might be what you're after
although some of that code is pretty wack it should give basic understandings of how to create your own spectator mode
no but like the code snippet he got
player.spigot().setCollidesWithEntities(false);?
yeah that disables entity collision
but in hypixel spectator, you can still click on player's to view them.
then make that work
and I don't want that.
maybe they have a click listener or something
just prevent what you dont want to happen
start with a HashSet of UUIDs
just prevent what you dont want to happen
Wow, really? - being sarcastic lol
I mean its not that hard if you dont want to make it hard
Mackenzie, you're overcomplicating this
@hot hull I just want a smooth freeze
So PlayerInteractAtEntityEvent doesnt even get fired?
No.
Is there a UUID or some other form of salt per world, which is completely inaccessible to the client?
Well... tbh I can't remember - all i recall is event.setCancelled(true) didn't work
I think pogmoment that once a player login they receive a unique session id
although thats just while they're online
mackenze let me see through docs
i'm making a server sided mod that prevents villager trade reroll, but allows ppl to change the profession
the thing is, i'm using the entity UUID which is viewable by the client, without any "salt" per se
@lavish notch uh I mean the teleport event seem to have support for this https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/player/PlayerTeleportEvent.TeleportCause.html#SPECTATE
declaration: package: org.bukkit.event.player, class: PlayerTeleportEvent, enum: TeleportCause
but cancelling doesnt work either?
uh you might have to implement custom spectator gamemode then
@vestal grove is that a problem though?
The user can easily determine trades
i'm basically forced to opensource the mod because it's on a large public server
it isn't a huge problem
but I feel it'd sit better with the owners if they knew ppl couldn't determine stuff that is serverside
i'm basically forced to opensource the mod because it's on a large public server
Huh?
it's going on github
Yea but why public?
wat
Is this a private plugin, or a spigot plugin?
so they know i'm not backdooring
bukkit
so yeah spigot
does the world UUID get sent to players?
on join or somethign
I don't think so
as i said, i'm using entity UUID to seed a Random
ok
ig i can just add the two longs together
I mean I doubt anyone will bother with that, also would knowing that give you much of an advantage?
not really but you could probably set up a script to just quickly kill villagers if they didn't have good trades after calculating them from a uuid
granted it's pretty simple to also just check
as long as the world UUID isn't sent, it's fine though
i just used the modulus of the World UUID MSB and the Entity UUID MSB to seed the random
why do people dislike python so much?
Yeah I mean sometimes python can be kinda annoying to debug but I did work with it like a lot and really appreciated it
it's really easy
it's really fun
surprisingly fast too
yup
Is there anything similar to unit in Java?
cc*
🙃
it's great
@prisma wave i don't wanna flood development cause its active so im moving here
which remote configuration are you sayin to use
nice
Hi
BM do you always leave the startup flags or just add them back when you need to debug
alright cool
Finally a proper request in #738969308746612766
👀
he had a 140k member discord lol
had?
has*
its called lover fam
ah yes
CC I was thinking making methods return null with the wrapper class Void idk if its an actual wrapper class anyways. I mean yes its dumb but oneliners 
Ew null
Objects,requireNonNull{ }
do you guys recommend MiniMessages? Like for a private plugin.
Yeah its nice
@prisma wave help this man
That can’t take 12
Maybe it has libs like guava or smtng
ish
@winter iron your problem is simple
your main class uses classes that are from libraries
when the class gets loaded, pdm hasn't run so those classes can't be found
solution: do everything in different classes or inside onEnable AFTER pdm runs
override fun onEnable() {
PDMBuilder(this).build().loadAllDependencies()
lang = LangFile(this)
refundGui = RefundGui(this)
purgeInventoryGui = PurgeInventoryGui(this)
commandManager = CommandManager(this)
commandManager.register(RefundInventory(this), PurgeInventory(this))
server.pluginManager.registerEvents(PlayerDeath(this), this)
serverVersion18OrLess = isServerVersion18OrLess()
saveDefaultConfig()
selectDatabaseType()
if (config.getBoolean("autoPurge.enabled")) {
purgeTask = AutoPurgeTask(this, config.getString("autoPurge.purgeByTime", "1h") + "")
server.scheduler.runTaskTimerAsynchronously(this, purgeTask, 0L, config.getLong("autoPurge.interval", 72000))
}
if (isEnabled) {
enabledMessage()
} else {
server.consoleSender.sendMessage("&bInventoryRefund has been disabled!")
}
}
so pdm runs first
Forgot it’s kotlin
or is that not right
send the full class
=paste
Please use a paste service to share configs, errors, code and long logs.
• HelpChat Paste
what's the error you're getting
you need to wait for the dependencies for load
your code isn't
it returns a CompletableFuture
ugh anyone got a few examples for MiniMessages please? And sorry for jumping in your conversation LOL xD
so should I do PDMBuilder(this).build().loadAllDependencies().thenRun {}
no
you'd have to do all of the initialization inside the thenRun
or, you can just block with join()
yeah
that'll possibly lag the server at first tho
@static zealot
what's the error
You sure he can use kotlin when loading it?
should be possible
thats what i was maybe thinking
Cc how did you work around that?
the thing is Conclure that if I use MiniMessage.get().parse("text") it returns a Component. Do I have to convert that to a string?
you just have to make the compiler remove all the null checks at first @steel heart
@winter iron what command are you running to build?
build copyJarToServer




