#dev-general
1 messages Β· Page 206 of 1
nope
you ever used JavaScript 1.0?
ah it's quite cool
I've not used it for anything fancy but it seems pretty cool
Apparently it's very flexible
I was asked to upgrade someone else's plugin from 1.8.8 to 1.16.3
- No source code available, I got the compiled jar given instead, and the decompiled code is a nightmare
- I'm 10000000% sure the original source was a nightmare, decompiled nice code isn't really that bad...
- I think it would have worked anyway, no upgrading required lmao
- help
- please help
Never accept a project if you don't have the source is what I learned quickly.
don't change anything you don't need to
Updating will probably just be changing material names and a few method names
Leave everything else if it's a mess
this 100% works on latest
it barely makes use of bukkit at all, other than commands and sending messages
only thing I'll do is just add an api-version lmao
Really wanting to write this config stuff in Kotlin but people might want to use it in Java π©
Suffering
interop
isn't the kotlin -> java interop kinda bad tho
like extension functions are weird, certain things dont work at all im pretty sure
Not really, the problem is just in case of Spigot needing to shade Kotlin because of a lib
ah ok
bruh what is this conversation
I code = I go on github and steal code xD
whenever I have to type I prefer laptops tbh
Everyone is just saying things
ew
nahhhh
that github shit
also I'm pretty sure its Frcsty not Frxsty
demoted from what?
oh being staff is like being a member with just more random pings and friend requests
Then we'd need to demote most staff 
Coding is basically getting code from others and adapting
that's boosting
Why Frosty? lol
yah that's what I said Matt
if you want to never do something good then copy code from Frosty xD
elara ide&
/elara
@obtuse gale ElaraLang*
elaranguage
you should make your own language
yeah xD
discord doesn't let you quote a quote
you should make your own language
@pseudo owl its called elara ...
Will elara have a feature to sync with github automatically
@obtuse gale no
they are actually making it xD
is it a actual language
because that's what an IDE or Git is for @obtuse gale
true
SO many features
print function π
Elara is going to be the language with most promised features ever and never actually to become true
lol
- delete everything because it doesn't work and restart
we've already done that
- go to 1
^
:(
and elara wont release
it will
Mark my words
Even if it takes is 20 years
It will release
Int x = 4
@obtuse gale no thank you
COULD UUSE existing language FOR INCREASE PRODUCTIVITY such as rust for examples
so my grandchildrens can see the elara
let x = 4
i'm happy now
COULD UUSE existing language FOR INCREASE PRODUCTIVITY such as rust for examples
@heady birch ok
the same
There is only 2 number types
Int and Dec probably although the names might change
Let for everything
let str = "hello"
probably
We have print function
Adding
Subtraction multiplication division
Number
No decimals allowed
@prisma wave which languages you are using to make elara
@pseudo owl at the moment we are using Go for the runtime
@obtuse gale yeah I think that will work but without the semicolons
so whitespaces?
oh its nice
is the language conventions dashes
why not camel and lower camel
^
why not camel and lower camel
@surreal quarry we wanted a gimmick
Basically
But I think it looks alright
yea its not bad
i wish all languages wouldve just stuck to one naming convention but theres so many now that it doesnt really matter
Nah
It's cool that they're unique
Are variables a thing
@obtuse gale let is for variables
for anything
isnt let for everything
but its elara
let = for elara
π
correct me if im wrong but isn't let also for functions
yeah i think
thats all I was trying to say is that let is for everything in elara
Indeed it is
Super first class functions
I was tempted to make let for everything
i.e structs too
But that seems dumb
i think its okay but idk
βΉοΈ
correct me if im wrong but isn't let also for functions
@surreal quarry
let is for any data, functions also being a form of data in elara
also, lazy arguments 
let or = (Bool a, lazy Bool b) => {
if a => return true
else => return b
}
b arg is evaluated only when b is requested
Elara good
that's pretty cool tbh
indeed
Quite a lot of optimization potential
List.filter can avoid evaluating its predicate if the list is empty, etc
The real difficulty is figuring out how to implement that on the JVM
lambdas
wdym?
it would be called only once inside the function
right before the first usage
Ah yeah true
we could have something like
class LazyArgument<T> {
private T t = null;
private Supplier<T> supplier;
public LazyArgument(Supplier<T> lazyT) {
supplier = lazyT;
}
public T get() {
if (t == null) {
t = supplier.invoke();
}
return t;
}
}
that's probably best
Although I'm not sure how significant the overhead would be there
At the moment the interpreter can just pass the Command rather than the Value
true true
ayy π― π―
:(
@frigid badge do you know Go
lemmo go fast
Golang.go
how similar is go to java or kotlin for example
To elara?
elara not even OO is it
Not entirely
Its multi paradigmn
add smart casting
@heady birch
We have the match block which does something similar
Some<T> | None π
π₯°
Better nullability handling 
is enum?
or rather, no nulls
no enum
compile to PURE null check
π
native machine code
If memory β is empty =={ ?@8!
will elara support like dependencies with gradle and stuff or how will all that work
π«
But gradle compatibility will probably be good too
for JVM we would probably have to have it work with gradle and maven as well
No maven
interop with jvm languages or not
π«
Why?
maven gross
Also it's not technically necessary
π«
interop with jvm languages or not
Yes
Leiningen supports dependencies from maven repositories but is a separate build tool for example
Leiningen ?
hmm
I guess we could work something like that out
Its probably better to have it work with gradle itself tho and later work on the build tool
@frigid badge do you know Go
@prisma wave who knows maybe I do....
maybe you don't
Schrodinger's Lemmo
you dont need to know go to contribute
Ehhh
just PR some whitespace to the readme
just PR some whitespace to the readme
@surreal quarry
π
biased voters i showcase as susual
yes
CHANGE them to green upvotes NOW that is a fair vote in my opinion
no one knows a fair vote better than me. believe me
no
Can we make this the most downvoted showcase ever please
make elara run on quantum computers is a must
@frigid badge
Yes!
Thanks
Have you watched that movie where the world ends due to quantum computers? xD
"The Mandela Effect" I think
The Elara Effect
First trailer for The Mandela Effect
Cool thumb nail
nial
Whats elara file extension?
No thanksπ
like main.c .h
Lol
.elaraelaraelaraelaralang
π βΉοΈ
tuff
:))
Purple πͺ
Down with the Niall
Niall that's a "feature"
#MakeHelpChatGreatAgain #DownVoteNiall
I have yet to try my example in practice, I think it has good prospects
Just wait till you tube channels start teaching it π
Niall purple
also don't spam the upvote button xD
All classes must implement the throwable
funny will get mad at you
plugin tutorial shows java smart cast by niall
no one:
absolutely no one:
Niall's classes: extends Exception
: Exception()
Oh can they tell when you upvoteyour own?
Niall should rly become a youtuber making java tutorials. They are the best
but what if class extends other class
it actually spams him xD
Eg JavaPlugin extends Exception
cant you implement throwable?
xD
Well I would implement it
implends
He would remake spigot
@frigid badge now if I use redis, could that replace mysql ?
Actually
@static zealot kindly remove your "upvote", thanks
He would remake the jdk
@static zealot kindly remove your "upvote", thanks
@prisma wave K
reasonable
Object replaced with Exception
I am not going to let the final keyword get in the way of quality programing
ok
niapl; Java void public main instanceof
Elara: match packet ChatPacket => lg π
he's going to remove the final keyword himself
Rust as well rust + elara good
@steel heart no
Kotlin ok- java not good with match
well you can
If only you could switch class smart cast
unless your data is really small or something

So I should use mysql for storage and redis just for the tcp socket so I can update data between servers right?
why is this emoji a thing? :))))
Where do you get these emoji`s
oh you don't want to know
:stutter: Never work for me π«
.


//Nialls first pattern
try {
throw packet;
} catch (ChatPacket chatPacket) {
//smart casted. "chatPacket" is an instance of ChatPacket
} catch (OtherPacket otherPacket) {
}
I like it
I came up with this ages ago
Bruh java legit has smart casting fr
I'm proud of you

thanks for linking another one for me to downvote :)
all down voters are
oh he took it down.
its still there
It's kind of neat though
Niall you have a very great chance of getting into Oracle as an employe
Yo ever thought about generics for annotations?
π³ as in how would that work?
@interface lol<T> {
Consumer<T> consumer() default t -> {};
}
``` or smtng
hmmm
So I was thinking like this:
class idk {
@Handle(clazz = PlayerJoinEvent.class, consumer = event -> {})
@EventHandlerInstance
EventHandler handler;
}
its very dumb
then
EventHandler.register(idk.class)
Decided to do it in Kotlin, config is already going to be nicer cuz of the operator function
O nice
2mb config lib, let's go
Don't use it in Java 
You suck
I do 
Just run your own fork and shade it into the server jar. Then you can enjoy small jars (:
You too
Yo this tut is so good https://youtu.be/hCMVx9ywBqA
This clip shows how to transfer data over TCP socket without single byte loss. Code contains two user defined function, that create packet and read packet;
- CreateDataPacket()
- ReadStream()
@heady birch KiteBoard says it supports 32 chars but only displays 30 out of my 31 chars
i have a mysql server that i store player informations
and i have to get data on ex. basic events
#1 should i get data from mysql everytime
#2 or getting data first from mysql, saving it via hashmap or something like that after then getting data from hashmap
Definitely use a cache
I know LP uses caffeine to handle caching, and luck generally knows what he's doing.
Yeah load on startup, save on interval.
public SimpleCache{
private static Map<String,Object> simpleCache = new HashMap<>();
public static <T> T getValue(String key, Class type){
//todo check contains here, if map doesn't contains key, throw not found exception
Object val = simpleCache.get(key);
return (T)val;
}
}
should i make my own cache class?
cache libraries are a little bit confusing
should it not be T used where you have object, and no cast in the return?
idk i just found on stackoverflow and reference that
btw thanks
@hasty flower Are you using colours? character limit include colours.
or spaces " "?
Guava :)
Guava is pretty nice since it's already implemented into bukkit
π€’
Hey^^.
I want to listen to one specific Event using the PluginManager#registerEvent method, but that takes an EventExecutor. I couldn't really find what I should pass in there. May someone help me in here?
#registerEvents
@frigid badgeI may need your expert advice in a minute if thats ok
what's it about
If I've got like a base API, then different applications that use said api, do I have them all in the same repo? Do I make a different repo for each? What's the normal way to do it
Each application does the same thing, just on a different platform kinda thing
Well ideally you'd use modules for different platforms
Tf is a module lol
Someone smack this man
and then maybe explain him what a module is ?
Nah, just smacking
@obtuse gale you can use subprojects and have a different jar for each platform
Maven modules or whatever you'd call them, you've probably heard of those
Even IJ also have that "module" term π
Why does minecraft source not behave
java.io.FileNotFoundException: minecraft:venice/splash.png
like what?
if i go into a different file it exists
Is that a texture pack?
it's a splash page
so it shows up when the instance is loading
but i don't want to go any further if i can't seem to load files as something is clearly wrong
as i will need more assets later on
splash = new ResourceLocation("venice/splash.png");
``` ^ the line it complains about
@frigid badge efficient map/shapefile rendering. I have base map cached in buffered image. Also lots of map "features" I currently store their bounds and get them when click is detected. Need some cool hashing method to easily get whats at X, Y without looping through thousands of objects and checking bounds
spatial hash e.g
i have some problem any body help me ?
first i say sorry for my bad english
im from turkey
i send a stringlist message
how i do that
have color support
loop over the list and color each string
no no no so like this
messages:
- "&cHey there"
- "&cThanks for using my plugin"
for (String msg : msgs) {
p.sendMessage(ChatColor.translateAlternateColorCodes('&',msg).replace(cname, name));
return;
}```
that is work ?
Don't return
That changes nothing it should still work
doesnt work
There is no time to wait! Ask your question @brittle depot!
What is the placeholder to see the online players (example: 50/100)
And here I was there
What doesnt work
?
Ok that wasnt cool
im just try helping
A member of staff has requested I move your message to a paste,
Most likely beacause it contains a config/error/code snippet.
Whats new in java 15?
records
text blocks too iirc
Hi,
I got this message when i want to compile (shaded) my plugin with org.apache.commons inside my pom.xml (dependency and plugin).
Usually the compilation ends with 3 files with one shaded with more weight, now all the files are exactly the same, without changes in the pom.xml
Any idea of what can do this ? '-'
https://paste.helpch.at/dalurunahe.coffeescript
Do you want the pom or the error generated in minecraft after the try ? (I known about the miscompilation only after the error on my serv)
On the plugin, it seems not find the classes :/
Oh, nevermind, the problem comes from that I get the original jar in the plugin folder and it use it (with a different name, I didn't see it before ^^)
@frigid badge efficient map/shapefile rendering. I have base map cached in buffered image. Also lots of map "features" I currently store their bounds and get them when click is detected. Need some cool hashing method to easily get whats at X, Y without looping through thousands of objects and checking bounds
@heady birch seems like you already have the solution?
but can you provide a better explanation of what you mean
Well @frigid badge really just a good way to structure a map application
Map
MapLayer
MapPanel e.g
best way of caching all those bounds (surely quite a bit of memory) - considering only caching whats in the viewport. Then even harder repainting only what needs repainting (dynamically sized map objects) path2d best bet
is your current system slow then?
i belive there is no like Map in java that auto sorts by values?
There's one that sorts by keys iirc?
doesnt help me since i can have 2 same keys then
or I'm thinking of a list possibly
i need map
"2 of the same keys" what. that's not how maps work
if i switched key/value it would break it
duh.
What's your use case? Feels like you're trying to do something wierd
well you bringed out that treemap that sorts keys that i dont need to sort?
leaderboard
i kinda want faster way than current one
problem is also i cant get index of some entered key
If you want faster then you don't want to use streams
Why are you using a map for a leaderboard?
what should i use then?
Don't you want a list?
Normal for loop
how would the loop look then?
Kotlin forEach: 2345.5ns
Kotlin for: 341.7ns
Java stream: 7951.1ns
Java for: 378.4ns
interesting
neat, TIL
any idea how i can change my current stream Matt?
Hmm i guess you could apply some fast sorting algorithms to it, idk much though, only one i know is bubble sort 
well i kinda iant good with algorithms
Hmm I has idea
There are a few examples if you search for it on stack overflow
Though how often does the map change?
You could cache the sorted map (that you sorted with a stream) then do sortings whenever data changed
https://docs.oracle.com/javase/tutorial/collections/interfaces/order.html
Make a model class containing the Player and their score, implement comparable, store in a List, and sort? Feels like it's not that bad actually
am I crazy? That should work right?
Sorting a map by value is a bad idea
Hmm i guess you could apply some fast sorting algorithms to it, idk much though, only one i know is bubble sort
@ocean quartz Collections.sort
You basically never need to implement a sorting algorithm yourself
As long as the language is vaguely modern
yeah see my link
Make a model class, implement comparable (not difficult), then store said model in a list and just Collections.sort
so i would make new class that would contain idk UUID and value? and then store that in list that i would later on sort somehow?
Interesting you quoting my message made it change the emote
BM don't let me forget to do relocations for PDM π©
Eh
but i kinda don't want to rework my entire work π¦
Piggy has already done most of the work i think
oh
but i kinda don't want to rework my entire work π¦
Welcome to developing. You need to refactor stuff all the time. Currently I'm in the process of completely rewriting my bot from scratch. A simple change like that won't take too long
but i did it twice already π¦
and i realy have no idea how i could do it properly.
eh
will see
and make it π
probably a good idea to make class(object) like you said for player and its value π then just sort list of them
refactoring is arguably more important than writing
I say that as a massive hypocrite
But it's true
Begging to differ, if you have no code written, you can't refactor it
not with that attitude you cant
^
well its already written so i guess its a refactor π
lmao fair enough
Begging to differ, if you have no code written, you can't refactor it
@umbral mica a skilled refactorer can make something work with as little as 1 line
interesting
File template
Yes
Java
Cant delete

Also if you contribute to an already-written project I guess
Just emptied it seems to work
What the heck is this java module stuff
Caused by: java.lang.IllegalAccessError: superclass access check failed: class com.sun.javafx.scene.control.ControlHelper (in unnamed module @0x3ee56503) cannot access class com.sun.javafx.scene.layout.RegionHelper (in module javafx.graphics) because module javafx.graphics does not export com.sun.javafx.scene.layout to unnamed module @0x3ee56503
What is a java module?
what on earth
0xcafebabe
insert gradle plug here
gradlefx
btw is making an api as easy as just making a public class and methods?
@half harness pretty much
FactoryFinder.find(CoolFactory.class)
@half harness usually you want a layer of abstraction in there though i.e. separate interface/impl
@half harness usually you want a layer of abstraction in there though i.e. separate interface/impl
welp i have no clue what that means :/
If you don't know what an interface is, you shouldn't be making an API.
Interfaces are a core part of java
ok
make your api class private
dkim; public interface
@prisma wave who are your favourite programming orgnisation or favourite programmer?
foiled my plan
"<your organisation> shares 10 points on why gradle should never be used"
very subjective
Personally I'd say you should probably avoid anything above 200-400 likes unless you have a good reason, but generally the smaller the better
=yeet @onyx loom
I've a slight question to ask, so this website which is managed by the bus transporting company here, is honestly fucking trash, (unresponsive), so I'm wondering if there's anyway I'd be able to get access to their api or someshit. Should I send them an email or what? (So I could whip something up for myself cause it's annoying af)
what's the website
Well the location search bar spazzes out a lot, assuming it caches data, meaning you have to open a new tab instead of just being able to refresh and it'd let you change the destination
it's made using wordpress lmfao
Not surprised to be honest, like it takes 4 tabs to search for the buses so I can get home
Which means what exactly
only the station/location bar uses an 'api'
That's what I need probably
You think I'd be able to email them about something for this?
Since I know I wouldn't let some 18 year old mess with my shit lol
I mean just email lol
Thank you for your wisdom kind Lemmo
here's some documentation https://arriva.si/wp-json
idk if it contains any useful endpoints though
Not gonna lie, I've honestly no idea what I'm looking at, but I'll google it when I have the chance
probably best is to scrape it
the token is just a timestamp
probably any timestamp within a certain range will work
let me test that
just have to find out what they do with the timestamp to form the token
Much love Lemmo <3
okay so
the token gets send within the initial request
in the html document
the token & timestamp have to match and have something in common with each other
Ugh, can't decide this, so I really want to write the config lib in Kotlin, but idk if i should cuz it'd limit it to mostly Kotlin only
If any of you were to use a config lib i made would you use it in Java?
if it's a good library yea
@hot hull I'd love to dissect the entire application but can't right now, let me know if you still don't have a way tomorrow and I'll have time to dissect it π
says u
@frigid badge I'm legit busy af for this and the next week, so I doubt I'll have much time to look into it
ah okay then I'll probably try and do some def legal things
Kek Lemmo
Changing the project location doesnt make a difference at all
Cant remember how Ifixed it before
what version
latest
ah weird
like the latest latest
but it happened before
If I delete a project then re-create it 2 or 3 times
Anyone know what to call these tag things where you have a solid background with text over it in the nametag?https://i.imgur.com/spcX4A1.png
https://i.imgur.com/4NkQqup.png
Oh, so it cant be achieved through a plugin or something?
Not sure
@ocean quartz if u wrote it in kotlin, how limiting(?) would it be for using it in java? i dont know much about kotlin -> java
at the end of the day its ur choice ofc, but save urself the pain from java 
Well, if it's a plugin, that's 1.4MB more to your Jar
Well, some do, for example I don't use coroutines for the simple fact that the jar gets close to 5mb
insert pdm here
any way of finding Levenshtein distance that's built into spigot?
i.e in an apache util
a what what what
leviosa?
Math.floor(loc.distance(otherLoc)) π
@frigid badge ah yeah i know what those mean lemme just whip up a little solution in rust java kotlin elara c# and clojure and I'll publish to central
nah it's fine, I ended up just shading commons-text which is pretty small
lmao
π¦
i.e in an apache util
@prisma wave Well well well
Look who couldn't survive without depending on apache
apache > * > google
Mixins in Fabric API are great 
Hey don't judge me i am having fun
Ooo you can even change textures
@prisma wave use fuzzy wuzzy
Do barrier blocks cause any lag in a server when used?
They can but that would be client sided afaik
Not plausible it would cause any server lag
Okay.
Tbh would probably only cause lag to the client if the player is holding the barrier item
we all know odd people exist, even in minecraft
how do I get the length of a string list?
getConfigurationSection().getStringList().
isn't it just .length
no
at least for arrays im pretty sure
yes
.size maybe
np
the path in the config
so like
path:
to:
list:
- "some"
- "other"```
`getConfig().getStringList("path.to.list")`
something like that
thx once again! π
π
How do I get placeholders?
If I have a config and you can put %name%, and it replaces that with e.getPlayer().getName(), how do I do that?
String#replace(old, new)
ah thanks!
so like "%name% is a player".replace("%name%", player.getName())
π thx so much
@heady birch It's 31 chars counting color codes &6PvPing&eMC &7β &fpvpingmc.net
It cuts off the t in .net
Cant write just PvPingMC.net ?
no
you just can't do that
alrighty
how do i setup like a git repo for one thing, but multiple platforms for it kidna thing
modules or whatever its called
do I just make like a multi-module IJ project somehow
A shit ton of event waiters, and .queues
It seems you have discovered callback hell
indeed
Might want to see if you can refactor into a less arrow-y thing lol
also indentation whack lol https://i.imgur.com/v7WEGHM.png
@hasty flower If you upgrade to 1.13 the limit is considerably larger
@hasty flower What kiteboard version
@obtuse gale doesnt JDA allow allow you to map stuff like that so you donβt have to experience a callback hell?
Depends
I mean RestAction#flatMap would solve it in most cases
what does that do
Something I want to ask here is would be removing the if statements from the schedulers loops worth it and provide a improvement to how the code is ran or is it obsolete
For example if I have a Boolean of βupβ which depending on if itβs true or false depends if the code does y++ or yβ
As I could in theory have 2 separate loops which activate depending on if itβs up or down or just one which loops over that if statement within it
@hasty flower What kiteboard version
@heady birch Latest Version (3.2.2)
@hasty flower If you upgrade to 1.13 the limit is considerably larger
@heady birch It should still work with 32 chars on 1.8 no? It works with featherboard but that plugin is laggy
@oak coyote afaik 1 bigger task is usually better as the compiler has a better chance of optimising things
alright good to know
depends on your computer, project size, build tool
for example, gradle can build almost instantly if the file exist and the project is small because it compiles only the changed files
Eclipse doodoo 
u doodoo
we all doodoo
U have doodoo
U2
what does that do
@obtuse gale
Itβs a Function<T, RestAction<R>> so you could pass in this for example:
sendMessage(βidkβ)
.queue()
.flatMap(Message::delete)
instead of
sendMessage(βidkβ)
.queue(msg -> msg.delete())
Essentially it allows you to create sort of a builder pattern instead of nesting it
Can we detect the player hand that shoot an arrow ? I can get the bow but not the hand (and if both hands got the exact same item, I can't see which hand did that)
Can't you only shoot bows from the primary hand?
I donβt think
No, you can shoot from the secondary hand if your main hand can't shoot
If you have a sword in your main hand, you can shoot with the arrow in the off hand
I think you might need to do some packet listening to achieve a good design of your problem
Mh okay.
Did he actually say this wtf
JavaPlugin
Whoever said that is possibly the dumbest person alive, whether it's true or not
That's literally the point of object oriented programming????
Exactly lol
it's possible it refers to specific classes like 'Player"
where changes in the implementation may lead to other plugins having incompatibilities
so it is generally deferred behavior.
Found it lol
Anyone sane wouldn't be implementing Player anyway
Also, that's not Bukkit's responsibility - it should define a contract for an interface, and if an implementation breaks the contact, that's their problem
Exactly
i think you can still do it, but it's just not commonly done
I have never encountered any problems with implementing inventoryholder, and all my search there was people saying "can cause problems" but never tell which problems
Now true InventoryHolder is presumably an internal class, but if that's the case:
- why is it in the API?
- why not make an alternative that isn't "use a HashMap"
That's such a dumb idea
sadly i've seen so much dumb stuff in the community, i've gotten used to it
you need to make stuff fool-proof
I remember when people used to implement InventoryHolder which caused weird side effects really
@steel heart The side effects are?
So just because the LuckPerms API is all full of interfaces does that mean you should go around implementing all of them?
Completely violates the open closed principle too
and some projects (eg: bukkit) weren't thought out that well
they were maintained for a long time and eventually became worse and worse
extra bodges, extra mess-ups, extra unwanted behaviour
The idea of interfaces and stuff like that if so you can extend on them and create your own implementations, that's the whole point of OOP
oopoop
spigot bad in conclusion
You can argue the same for many things, Bukkit uses NMS classes and implements stuff, "The original minecraft server was never meant to be implemented by APIs, creating bukkit was never intended" Lol
Matt iirc there is certain blocks that implements it and I think that it was messing with the event part but I donβt really remember just know that itβs a bad practice
The problem is, there's no better practice
There is ?
Apart from encapsulation which is extremely verbose
Just keep the inventory instances and compare?
Messy
Never had any issue with it, would not consider it bad practice either, it's an intended part of the language lol
How is it intended?
It's probably a bad practice because nms is messy and it could break, but it should be fixed rather than discredited imo
I've never had any problems with it
Because inheritance is part of Java (i was talking about how it's part of the language)
That's not my point though
Idk I had some issues with it well I mean if you havenβt encountered it perhaps it was just me
Oh yeah Matt thatβs true
The server keeps an instance of the inventory, why keep another instance
Indeed
Like bm said if it causes issues fix it instead of discrediting it
Not really, ever seen how a cpp library is structured? You have the header files which are analogous to the interfaces (they define the signatures and declarations of classes and functions, but don't contain the actual implementation source), and then the translation units that "implement" (define) those functions and classes. When you work with the library, you interface with the header files, and compile with the compiled library binary. Now cpp is way more resistant and stronger than that because "it tries" to do as much as it can at compile time, and while there are workarounds to it, just because you can doesn't mean you should.
I think of APIs as bridges between my software and another software that already implements the API, and unless something is explicitly marked as "should be implemented by the end user", it's because the other end will take care of it.
Just because inheritance exists in that form and someone uses interfaces instead of exposing the actual implementation (using bukkit and cb as an example, due to legal reasons), doesn't mean you should use it in that form.
Yeah I fixed it with comparing ==
So basically removed InventoryHolder and it worked
So just because the LuckPerms API is all full of interfaces does that mean you should go around implementing all of them?
So no, I don't think you should do that.
Fefo good point
Not really, ever seen how a cpp library is structured? You have the header files which are analogous to the interfaces (they define the signatures and declarations of classes and functions, but don't contain the actual implementation source), and then the translation units that "implement" (define) those functions and classes. When you work with the library, you interface with the header files, and compile with the compiled library binary. Now cpp is way more resistant and stronger than that because "it tries" to do as much as it can at compile time, and while there are workarounds to it, just because you can doesn't mean you should.
I think of APIs as bridges between my software and another software that already implements the API, and unless something is explicitly marked as "should be implemented by the end user", it's because the other end will take care of it.
Just because inheritance exists in that form and someone uses interfaces instead of exposing the actual implementation (using bukkit and cb as an example, due to legal reasons), doesn't mean you should use it in that form.
@obtuse gale
The open closed principle says that a class should be closed for modification, but open for extension. Extending a class is the simplest way of doing that. Bukkit saying that classes shouldn't be extended is dumb
Thanks for the XP btw
^
lmao
Use InventoryHolder if you think itβs good Iβm personally discouraged from it
Not really, ever seen how a cpp library is structured? You have the header files which are analogous to the interfaces (they define the signatures and declarations of classes and functions, but don't contain the actual implementation source), and then the translation units that "implement" (define) those functions and classes. When you work with the library, you interface with the header files, and compile with the compiled library binary. Now cpp is way more resistant and stronger than that because "it tries" to do as much as it can at compile time, and while there are workarounds to it, just because you can doesn't mean you should.
I think of APIs as bridges between my software and another software that already implements the API, and unless something is explicitly marked as "should be implemented by the end user", it's because the other end will take care of it.
Just because inheritance exists in that form and someone uses interfaces instead of exposing the actual implementation (using bukkit and cb as an example, due to legal reasons), doesn't mean you should use it in that form.
@obtuse gale The open closed principle says that a class should be closed for modification, but open for extension. Extending a class is the simplest way of doing that. Bukkit saying that classes shouldn't be extended is dumb.
thanks for xp btw
also never used cpp
Basically a public interface that isn't supposed to be implemented is dumb
so thanks for info π
i need to learn interfaces, abstraction etc
just too lazy π
they're ez
Yeah it's pretty straight forward
Afaik itβs used to represent an InventoryHolder as a block holding an inventory iirc, like Beacon etc. I donβt know but the underlying implementation doesnβt like when you messing with that and implement InventoryHolder for inventories. Most cases I think it would work fine to implement it but I came across a scenario where it didnβt work. Anyways itβs not really smart to implement api interfaces unless stated as that can cause weird and unwanted side effects
Just because Player interface exist and you want to add a method to it doesnβt mean you implement the Player interface
Anything I missed?
ew javascript on backend
Will check
@heady birch I believe it only does 30 chars when you use colors because if I use no color codes it fits 32
Does bukkit allocate memory or does something special for each plugin?
I thought about using a system similar to papi expansions but with 'plugins' and now I'm thinking if there will be any advantage over using normal plugins
It just loads them with the classloader nothing more
Great
@onyx loom I'm laying in bed and I get a random pong, like damn there's 5 other people who are online and I get pinged ;(
Yes yes
Gradle 6.7
Time to test this org.gradle.vfs.watch=true stuff
gradle 2

Isnβt that what like forge is using?
Only old forge
Any thoughts about netty over Javaβs nio?
netty is nice
I mean it seems fairy popular but whatβs the actual benefits? It does the same NIO as java right?
i'm not too sure about java's nio but netty is mostly pipeline based, and definitely nonblocking
the pipelines are pretty nice
Yeah pipelines are sexy
Netty
Yeah, Niall would you recommend my future oracle employee?
Yes
"apache" employee
Lol
how do i set target as %player% placeholder that can be used in the config ?
Player target = Bukkit.getPlayerExact("args[1]");
//action goes here.
player.sendMessage(Utils.chat("List.player-added"));```
this is my current code
(for the target)
String#replace("%player%, target.getName())
dont bully me
o
ruight
my brain
String#replace("%player%, target)
@onyx loom and that's it ?
target.getName()*
dont bully me
you came to the wrong place then my dude xD
@sxtanna
you came to the wrong place then my dude xD
xDDDD
ah yea
references the object u can use the method on
it's pseudocode
lets say Player#getName(), in ur case thatll translate to target.getName() for example
Class#method means execute method on an instance of Class, whereas Class.method implies that method is static
yeah, it saves doing whateverYourPlayerVariableIsCalled.getName()
o
kk thx
Player target = Bukkit.getPlayerExact(args[1]);
player.sendMessage(Utils.chat("Banwave.player-added"));
String.replace("%player%", target.getName());```
is dis right
?
Hey friends, if I run bukkit async tasks, will they also run on the same CPU core as the minecraft server is primarily is running on or can it make use of multiple cores for this kinda stuff?
Async is ran in a different thread
Alright so if I wanna do somewhat resource intensive stuff (in my case read player advancements and stats from files and store them in a mysql DB) it should not impact my server ticks in any way, right?
Yup ;p
Hey, I want to host a minecraft server on my pc with some plugins where can i install bukkit/spigot? (that is safe)
@oak onyx https://papermc.io/ Just download a jar and run it
(Paper is a fork of Spigot that adds huge performance improvements. Most servers use it)
Oh ok also another question i see tons on videos on setting it up and they use getbukkit.org
no
is that one safe aswell?
NO.
Ok got it
That website can expose you to legal issues
oh
(Redistributing non-distributable code aka the mojang server code)
legal stuff aside, there isn't really a reason to use paper over bukkit tbh. Bukkit used to be what everyone was running but that was 5+ years ago
The jar that paper gives you is really small, it makes the changes to the vanilla server on your computer, which is legal
So first run will take a long time while it actually makes the server jar
For you as a server owner, paper is pretty much the same as spigot but with some performance improvements slapped on top of it
I'd say a bit more than "some"
You basically need all of Paper's optimizations in order to run a server on a modern version of MC with more than like 5 concurrent players
Well I am just making it for me and some friends on a 1v1 server
We just want to be able to copy the 1v1 arena so we don't have to rebuild it
With world edit
I repeat, there is no reason not go with paper. All plugins that work on Spigot will work on paper as well.
Ah ok
Paper is also more convenient to install since you really just have to doubleclick the executable π
Uh you'll need to allocate more ram than the default 256mb or whatever, which needs a start script
Ok but how is paper different from getbukkit.org how is that site Redistributing non-distributable code aka the mojang server code
That is?
When it says "Patching vanilla jar..." that's applying the code changes.
Oh ok
Basically when you run the server jar, it'll first download the vanilla minecraft server, then apply a bunch of changes
Which is essentially Spigot build-tools.
Honestly, don't worry about the legal stuff if you're just hosting a server on your local PC for you and a couple friends.
getbukkit on the other hand is distributing pre-built versions of the server software, which is against Mojang's license since it contains their code
But i am safe from virus when using papermc
But yeah you don't really need to worry about it
As long as you don't download sketchy plugins, yes
Yup!
I don't see a 1.8 version?
Yes, make sure to download from that official website and only use plugins that have good rating and positive reviews - use some common sense π
Ok will do
Ah i see 1.8.8
By no support that mean no small updates right? But that will patch major exploit problems?
Nope. They won't be backporting anything to legacy versions afaik
Ok
Spigot doesn't even do that.
?
Can you get in a vc real quick?
nope
like on the downloads page?
Yea like at the top it says you can download the latest versions of paper or waterfall here and i clicked paper 1.16.3 right below that
You need to click on a build to download (why they don't have a latest button, idk). Click where it says #231 at the top
Ah ok
Spigot doesn't even do that.
@frail glade neither does mojang :kekw:
Hey^^
I'm currently searching for the field name of the GameProfile of a EntityLiving. It was bT in older versions (1.8?) but that changed and I can't find anything related to that for my version (1.16.3).
Well between 1.8 and 1.16.3, I would be surprised if the obfuscation maps AND the class's structures were the same LMAO
@gentle coyote EntityHuman#bJ
Thank you. I just found that Paper has an integrated PlayerProfile-API which I try to use for now
Why tho lol
Oh wow the limit is still set to 16 chars? Player#setListName accepts names that are longer. I hate everything
I thought that I heard that this limit was increased by now
How in the hell
oh no
||
