#dev-general
1 messages Β· Page 199 of 1
gerald
Yeah that's it
the germans dont want war! nobody wants war!
Right
Who else
inspector goole
Lol
mrs birling
But the way some of these cranks talk and write now, you'd think everybody has to look after everybody else,
eva smith
tragic
πππ
Tragedy
What is a crank?
we're such nerds
old fashioned word for idiot i think
ah
Eric birling was drunk. Alcoholic
had non consent sex π¬
alcholohic
alcholohickery
arthur birling is basically andrey
alocholock
true
@desert horizon
Speaking of which
lmao
elarafx
π
@heady birch hm?
im ok with elarafx π
niall called you a fascist
ππ
Since when do I want money?
My stuff is free you tool
I present you: the evidence
that is not real
Photoshopped
typical corrupt media
@prisma wave His stuff is free
is it
Andrey breslav
Now hes gonna claim hes being framed!
and i suppose wer'e supposed to believe that andrey's stuff is free too are we
Do me a favour and leave me out of those stupid jokes of yours... Especially when it involves a ping. That stuff pisses me of
niall typical old man who cant change his views smh
always thinking of capitalism
never socialism
niall is responsible for firing eva smith
very true
disgusting man
very unfortunate
what question did u get in the exam
started a chain reaction of unfortunate events π―
Nah π€·ββοΈ
-_-
What does gcs include?
exams
secondary school exams
ah
What did you put to question 07.3, 2015 GCSE Combined Sciences June Series
lmao
Edexcel or AQA
combined science yuck
^^^
aqa
I'm open for jokes but there are a few things I really can't take and being accused of wrong things is one of those types.
Like for real.
Noted
typical niall

Me? I didn't even accuse
π
no
What game?
bad game
Yes, I know we would play the game among us. but what game
work on elara
interpreter
I really want some free time π
π
Still waiting for the barry emoji leaderboard
andrey breslav colorized
ππ
Fuck tornadofx
fyck u
π
blue
Rod Johnson >>>
logical right shift
ull see the colours
It slowly goes up to Blue and then to @prisma wave color
I want to set my username to be springniall, like springrod
elara chad colour
yeah I guess
chad
chad colour
yup
nope
highest is this one
well there are higher but nobody has reached them yet
perhaps
tier 10 soonβ’οΈ

next year
does anyone have hte last colour reached?
@obtuse gale
A dead person?
π³
Technically a dead person has seen their last colors
π₯Ά
π₯Ά
God another Goland update
protecting the citizens of the united kingdom
These people update like every 4 days
lol we wish
i feel very protected
cus u on an island with 10 people on it
Then whose at your window alex?
π₯Ά
O.o
come to bham and u suddenly not safe
π―
smh all these new games all copied from mc
trouble in mineville
Nah thats from some TTT shit
every game concept can be brought back to minecraft
I forgot the games name
block hunt
every game concept can be brought back to minecraft
Yea I think thats because minecraft is in a sense a very easy to use game engine
Atleast thats how its mostly being used
very easy to use
spigot
spigot
π
very easy to use
nms
I mean its litrallly a scenario where you only have to work on the logic
Everything else is handled for you
A client and server already exists
Not much
bed time for me. gn π
Try rewriting a whole minecraft gamemode to Unity with multiplayer suppourt
start learning go
Youd spend more time on mechanics not specific to your gamemode rather than on what actualy matters for your gamemode
i just started learning c#
Lovely
public Void PrintLine()
i just started learning c#
Learn Learn rust
Void is invalid
you're invalid
its still void
Subroutine main
public namespace void ____PrintLine(string _Cool, List<string> _CoolList)
() => {} that's a pretty sexy syntax
use var
AHAHAHAH
Rust is cool as well
Fortran >>
bracket style
if (blah)
{
}```
^
Thats the conventional way in c#
Rider auto converts to that when you use java convention
easier to read
Jetbrains is love, Jetbrains is life
also probably because it's the convention for C too
It is a common tactic by developers forced to meet certain amount of lines per day! using allman encourages the pressuring of work place programmers. Stop using AllMan!
nooooooooo
Similarities
Stream this track to make your dreams come true: https://open.spotify.com/album/3LkfiPWP9GuifMOoePGxqW
We asked for your favorite lost memeββYOU ANSWERED π βWE WANT HAVE A DREAM KIDβ ... now we present to you this extended version while swinging our hips from side to side in a...
F#
E-L-A-
ra
Sometime's I really hate emoji's
C?
else -> {}?
else if not not else if ->
Beautiful
π
Well I kind of abandoned one of my plugins because I ended up with $$$$$$$
@steel heart What mod are you making?
Oooh sounds cool, might wanna ask frosty, he was trying to make an Ark plugin and it didn't work so maybe a mod
Looks great to me xD
got it after copy + pasting from stack overflow lol
val result = set.any { triple -> triple.toList().all { map[it] == "Thing" } }
are test files considered part of a project? 
in reality my question is "do I have to add license info to test files too?"
@steel heart How dare thy copy my idea
But RP ew, I was planning on not using an RP for the dinos
are maps not considered Collections?
Hi, does your plugin support a function of Multiverse? For example I want the plugin to work only in certain worlds.
There is the plugin I'm talking about -- https://www.spigotmc.org/resources/messageannouncer.5408/
#general-plugins probably
Kotlin question, I might just be being dumb but
game.activePlayer = game.players.elementAtOrNull(game.players.indexOf(game.activePlayer) + 1)
?: game.players.first()```
in the indexOf call its telling me that since game.activePlayer is both a var, and nullable, it cant smart cast and might be null, but I dont think I can do anything about that can I?
In theory it shouldn't be null, since you handle it properly
its mutable tho so its saying it could change
Assign it to a variable idk 
rp?
Resource pack
Ah
Well I mean kinda meh to make it with a mod, since that'll ofc allow you to make it perfectly
yes but Im stuck at this stupid model
sigh*
but if you want to make ark into a plugin, im defo in
Well you could, but the mechanics would be so limiting since mc gae
yh the mobs would be hard to make
I was thinking of just making them entirely out of armorstands, basically counstruct a model with them
rip performance
Indeed
well it wouldn't be dumb if it wasnt for every entity ticking constantly
They are planning on changing to a better engine now, so performance should increase drastically in the upcoming updates
Link the repo, but I've no idea when it comes to mods
Frcsty
Im actually basing this mod of something else which isnt entirely ark inspired. But if you want we could actually try replicate ark more exactly or if that does matter to you.
So long as it's dinosaurs 
yh u're a fan too?
Who isn't a fan of dinosaurs
Asteroids
oof
π
@hot hull invited
well its forge
mhm
well Im struggling with this currently https://cdn.discordapp.com/attachments/695431668944732270/759552214460792862/2020-09-27_01.05.56.png
model angles
Nah it's gonna be a fully detailed trike shlong, just for you Gaby 
helo can somoene please help me with make please and thankyou :)) How me draw a Char over top of current map in item frame thankyou please
I guess you are asking for a lib?
well im using johnnys map lib, but I need to edit a pre-existing map
well what I need to do is put a Char ontop of a map, like write the letter onto the map, over the top of what is already there
I have it from an event,
I get it from the PlayerInteractEntityEvent, cos I can get the itemframe which is an entity, and from that I can do my checks and then cast it to MapView
Can johnny's lib use existent maps?
nialllib
I suppose I could try and get the renderers from the pre existing map then just add it to a new map with johnnys lib
Too many Ls
would anyone find a serializing lib any use
I suppose this migth work
val newMap = MapBuilder.create().addRenderers(mapView.renderers).addRenderers(renderer).build().createItemStack()
How does it stop the player mark from being shown on the map?
My understanding of git, I could create a private remote and later delete that remote, then add a new public repository as a remote. And it will retain the commit history won't it? Just nothing like issues or wiki (which I don't intend to use on the private repo)
@prisma wave
Should do yeah
Should do is a little ambigous π
If the public repository is brand new then I'm pretty sure it will sync the history fine
context? so kiteboard- has its issue tracker and wiki here: https://github.com/Niall7459/KiteBoard-Documentation
I want to make private KiteBoard repo. Then in future delete the private one, and move code to kiteboard-coumentation
That way all the issues and wiki pages are preserved
Ah
Not sure how easy that will be
I think you'll probably get a "refusing to merge unrelated histories" error
so you'll probably need to force push the code or something
someone cleverer probably knows a way to merge them
Clown
π€‘
Do you know a site where i can buy paysafecard with paypal ?
The point of PSC is so it can't be traced, paying with paypal would do just that..
PSC = paysafecard Zeltuv..
are you good with modelling etc
I heard frostys a pretty good model
π
oh well thats why he looks like a dinosaur
I tried BlockBench or whatever the fuck it's called a while back and I mean I did alright
have you tried tabula?
Tabula?
PSC = paysafecard Zeltuv..
@hot hull rly
yeah
wtf i didn't know
sotp mocking
lol
tabula is the mod isnt it?
I kinda wanna get into modelling but I sucked at it last time I tried
Theres a thing called crayfishes table or something
I forgot
maybe crayfishes bench?
something like that
for minecraft models
yeah, I mean I use tabula since then you dont need an additional program
But I heard block bench is also really good
is c# hard? Cos I kinda wanna try something but it needs C#?
I mean not that hard
I just felt it to be confusing because you have different naming conventions
Its quite similar to Java but with some kotlin features
If you are familiar with both of those it should be pretty easy to get started
if you use rider it will auto convert java conventions to c# conventions as you type xD
I mean at the end of the day Aj3douglas isn't one of the "proffesional spigot plugin devs"
:bigkek:
Me
hi o/
is it possible to set an Itemstack has a livingEntity metadata / get the Itemstack from a metadata ?
what
^
^
^
^
I mean. i can add an Itemstack to an arrow metadata (successfully), and after i want to get back this itemstack from the arrow's metadata (metadata can't be cast to Itemstack)
value()
projectile.getMetadata("feMainHandItem").get(0).value();
like this ?
we love npe
IndexOutOfBoundsException actually
Well an IOFBE and an NPE when you tried to get the value 
:what:
if (projectile.hasMetadata("feMainHandItem")) {
System.out.println(projectile.getMetadata("feMainHandItem").get(0).value());
ItemStack itemStack = (ItemStack) projectile.getMetadata("feMainHandItem").get(0).value();
Even with this ? I can maybe just check the length of the metadata
Who was that again, who likes making documentation?
Anyway, this is some good doc: https://hasteb.in/afodezuh.xml
XD
Andre I think
NPE not possible in languages like Rust
Or just use kotlin, ez claps
It's possible in kotlin
The println is just a check of datas,
π
Yeah kotlin is a poor solution
BM, not the point smh
Well yeah it kind of is the point?
Yes it is
π₯Ά
Anyway thanks Soldier and everyone (without @ Γ¨wΓ©), it's really useful ^w^
npe is very nice in java. tells you exactly how to solve the problem
The only 2 languages that reliably stop NPEs are rust and Elara
C optional::?
Elara interpreted though
not for long
Native??
Optional.ofSomething(lol).isMaybePresent()
Option::Some, Option::None, Option::Maybe
can't segfault in rust
Or elara
I had to read that twice, I thought that was french for a min :(
public boolean maybe() { return maybe; }
oui oui Mitch
baguette?
sigh
oooohohoh baguette
I swear literally none of those words are french
end procedure;
segfault, rust and elara looked french ;-;
is that elara?;
if so that's pretty cool;
will elera allow multiple varargs
How would that work
unlikely
^
Seems like a pain to implement
And use
And understand
And read
Etc
it would certainly be op
Just use a list or an array I guess?
groovyjure
[1, 2, 3]
Something like this could be cool tho
someFunction(String a, String... b, String... c) { }
someFunction("weeb", "weeb1", "weeb1"; "weeb2", "weeb2")
Homoiconic
[{[{1}]}]
hmmmm
make it type
make type an enum
Type::Int(3)
Type::VarInt(1, 2, 3)
They call me master at language design for a reason π
what's the reason
lol(Consumer<String...>... lol, Consumer<String...>... lol2)
π
if I only was good at math
add generic var args
No
why not
class CoolClass<T extends CoolType...>
it does
uh yes it does
Explain
it makes more sense than ever
Tell me how
because it forces the params to be T...
T[0] getT0
and the fields
π
make it sql like
class Cool<T where = SomeType>
class Cool<T where LIKE SomeAbstractType>
class Cool<T> where T = SomeType
we already have that
wait what
Union and intersection types are a thing in elara
Leeeeeeeeeeets go
type Result<T> = Some<T> | None
noice

damn I wish I could use Elera in my forge mod
struct or object
what
struct or object
both
record
no
cordruct
you people scare me
well I mean
With kotlin would u usually put your extensions in a seperate class
not class
python is nice init alex
file
Its better to keep it to where it needs to be used
π©
ok
@steel heart mediocre
Nice pun init
What is?
@heady birch if the extension is on one of your classes, it should be in the same file
Otherwise usually in a file dedicated for extensions on that type
Eg Strings.kt for String extensions
Is what I usually do, pretty sure that's convention
Graphics2Ds.kt
Β―\_(γ)_/Β―
Extensions_g2d.kt
No
@steel heart python's simplicity is nice but I don't like dynamic typing & having to write functions in order
ig
Is it fine to use!! when I 99.99% know that variable aint changing
Ehh
"Do not create files just to hold "all extensions of Foo""
Example?
But that sucks
Is it fine to use!! when I 99.99% know that variable aint changing
@heady birch prefer requireNotNull and checkNotNull if there's a possibility an NPE could be thrown
Also finally having some results with tornadofx
But
External themes dong seem to work
So I just went w1ith the one on the demo
mhm
I'd use a temporary variable + Elvis operator instead of !!
Tornado fx has a dsl for that as well
Swing synths π
No chance anyway really
More kotlin bloat.
Hey Hey people who can make a plugin for free?
Probably does some
Dynamic data in a static language π
if its small
Dynamic data in a static language π
Whats the dynamic data here?
CSS
Stylesheets dont change?
I mean there's no type system or anything in CSS
Yes!
Expressing it in a static language sounds annoying
. # are kinda types π
strongly typed CSS
wth
null check
You sure
None of that Intrisics stuff
Does SASS take precedence into account the same way as CSS?
Doubt it
Hmm
var local = something.getSomething()
if (local == null) {
continue;
}``` pretty sure it will compile to this
Ok
Intrinsics is only for exception throwing checks iirc
what
Hey everyone I need help
#relatable
private fun calculateTrackAlpha(track: RadarTrack): Float {
val percentSweepRotation = track.elapsedSinceInterrogation() / (screen.radar.sweep.sweepPeriod * 2000).toFloat()
var alphaVal = 1 - percentSweepRotation
alphaVal = alphaVal.coerceAtLeast(0.0f)
alphaVal = alphaVal.coerceAtMost(1.0f)
return alphaVal
}
Poor performance
@charred violet don't ask to ask, and wrong channel
@heady birch what's wrong with that performance
@prisma wave Hey send me to the right channel I'm disoriented here
What's your problem?
I've already found the right channel
4.8 seconds
Kotlin isnt even making my javadocs poeprly
Kdocs
you use Dokka to make docs?
I mean the /** comments
When i do it normally it adds @param and all that
@prisma wave why is elara not mentioned in ur services request π
i hope u realise that elara is the new wave and pays well.
The @param and other tags are not generated because the recommended documentation style for Kotlin is to refer to parameter names from the doc comment text using the [foo] syntax, rather than to document them using explicit @param tags. You can check the Kotlin standard library documentation to see how this style is used.
@onyx loom good point
Or spring
I wouldn't say I'm proficient with spring
Do not doubt yourself
Whenever I use spring I end up with at least 30 chrome tabs on stackoverflow
Lol
Ofc
gives all answers necessary
But spring = much more Google searches than normal
import * is op
no
Music: Noisia - Seven Stitches
In this video (Part 1 of 932) we show you how to create an integer in C++.
who hasnt seen that
Haha
So, y'all already know that more than 3 billion devices run Java (including but not limited to Computers, Printers, Routers, Cell Phones, BlackBerry, Kindle, Parking Meters, Public Transportation Passes, ATMs, Credit Cards, Home Security Systems, Cable Boxes, TVs...)
But did you know that Java is a class-based, object-oriented programming language that is designed to have as few implementation dependencies as possible?
π₯Ά
So, y'all already know that more than 3 billion devices run Elara (including but not limited to Computers, Printers, Routers, Cell Phones, BlackBerry, Kindle, Parking Meters, Public Transportation Passes, ATMs, Credit Cards, Home Security Systems, Cable Boxes, TVs...)
The EVM is the most downloaded software to date
Cap
throw new EleraChadTelliingTruthException
catch (EleraChadTellingTruthException e) {
}
IDE for Kotlin? ;o
π
I guess will be a new IDE for all kindas of languages
or a web ide
Could be web ide because of the WASM
RUST compiles really good for WASM
and the UI Framework I guess is Kotlin JS because could be the same that they are using in Space
Recording brought to you by American Express. https://americanexpress.io/kotlin-jobs
Learn about how we are using Kotlin in the new JetBrains product Space.
Resources:
KotlinConf website: https://jb.gg/fyaze5
KotlinConf on Twitter: https://twitter.com/kotlinconf
Kotlin websi...
My mistake, is Kotlin React
So this is something new that they are using internally π
I need a "THIS IS NOT A LEGAL ADVICE" moment
Say my project is licensed under GNU GPLv3 but I want to make use a library (that I'll have to shade and relocate) licensed under the MIT License; do I have to change my project's license to MIT? Because it does state that The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software., the "Software" being "this software and associated documentation files". But it also states I can use, copy, publish, modify, distribute and/or sublicense it too.
The fuck do I do π¦
MIT is GPL compatible, so you shouldn't
THIS IS NOT A LEGAL ADVICE
This for sure applies here
lmao I'll ask on EngineHub
I know they know their shit
Still, not a legal advice lmao
how can I turn Material#getData which return Class<? extends MaterialData> into SpawnEgg?
Spawn egg materials don't
aaa
Spawn egg materials don't specify no MaterialData class
So I guess your best bet is to get the ItemMeta off the ItemStack and meta instanceof SpawnEggMeta? π€·ββοΈ
is for pre 1.11 where SpawnEggMeta doesn't exist
EntityType.fromId(item.getDurability()); this should work
You say pre 1.11 so I'm assuming 1.8.8
There is Material.MONSTER_EGG whose data is SpawnEgg.class... and there's Material.MONSTER_EGGS whose data is MonsterEggs.class
π
monster_eggs is for blocks infested with silverfishes
xd
how can I turn Material#getData which return Class<? extends MaterialData> into SpawnEgg?
anyway... on that
ItemStack#getData should do, doesn't it?
lol neat
Anyone used unity before?
Just tryna work out how tf to scale things :/
Send the error
no error
just tryna work out how tf it works lol, cos from what I can see I can only control the scale of an object
Pretty sure you've used unity before?
and changing the scales good and all, but like what do I do if I want the size to be like X wide
Since each like 3d object i put in has a different size to start with, so
Unity 2?
Where do I get such future technology
Does it come when I get internet 2 too?
Just tryna work out how tf to scale things :/
@obtuse gale
Check the transform component
I know how to scale things, its moreso like how do you know how big to make things in relation to others
You can only have relative transformation with parent-child relations
You can place a gameobject inside another
And the child would scale relative to the parent
Or ofc, you make make your own script to handle that
I mean like
one sec
If I create a cube, its much smaller than a plane even tho both scales are the same, which makes sense, since its scale and not size, so like is it just a bunch of trial and erroring until you get the right size? What do I do if im tryna recreate something that actually exists in?
Use the editor tools and resize as you want
All the transform properties can be changed using tools instead of direct editing
hm?
Look to the top left for the transform tools
You should have tools like move, scale, rotate, multi-tool
One you select a tool and a gameobject to work with, You can change the transforms pretty easily
Make sure you have gizmos turned on in your scene view
yeah I know how to like change the size and stuff, its just like say I want something to be like 2 meters, how would I do that since obviously we dont have like meters/units/whatever
The scene view grids represent a unit
smallest grid size is supposed to be assumed as a meter I think
Anyway brb
Exams
Ill be back in 2 hours
He will be back
In 2 hours
In two hours
He will be back
Is he back
OWO what
π
right, and is there a way to like set something to be X units big?
@obtuse gale
You can use grid snapping. Hold ctrl while using the transform tools
is there a website or any way that can i sell plugins without paypal account
Or just make a paypal account?
Where you from?
Damn, I guess you could use your bank account, I wouldn't trust spigot with that tho
Oof
its bad
Move countries 
thats the best way i think
Deffo lol
π
Poor guys
π
soon
i have made many phone calls with andrey
he seems reluctant (obviously)
but i think we will get through to him eventually
he's in denial that elara is better than kotlin
a tiny tiny bit
the interpreter supports variable declaration of integer and string literals
and you can do print(something)
and let's be honest you don't really need anything else
i'm just wondering how much effort it'd be to fork the base ij platform
Types are still in the works for the interpretter
Probably easier just to make a plugin
Mhm
well you do both
oh right
Is IJ open source?
Ah
sorta
other jetbrains ides like rider, and webstorm are just ij, without the java, and with their specific language plugin
I assume
if it's not like that, we can definitely make it like that for elara, because it makes sense imo
you develop the plugin, and apply it on the base ij project
Mhm, we might also want just a plugin variant since Java interop is planned
the plugin can also still be used in ultimate
They definitely share a common base platform, not sure if all the jetbrains ides are "ij" or if they've got some in-house "base" which IJ and all the others are based off of
since most of of them have slightly different semantics
from what I've heard, the base is intellij
a key distinction however, is that intellij community/ultimate does not necessarily = "intellij"
community/ultimate, like their other ides, are built off the intellij platform
and i believe that platform is open source
Ah
because android studio exists
Makes sense
is android studio os?
so yeah, just look at that wording, I'm pretty sure to make an ide, you make a plugin, and then hardcode that plugin into the base intellij project thingo
then that plugin can still be used in ij ultimate
Sounds simple enough
elara plugin for ij when
as soon as possible
yup
Hi, I would like to know why I can't serialize my itemStack to String using these function please '-'
Do itemStacks hava condition(s) to be serializable ?
Context : https://pastebin.com/jGtL71LN
Serializer :https://pastebin.com/3wK5z3pH
It shows me this, so the item isn't null or AIR.
> [15:29:36] [Server thread/INFO]: ItemStack{GOLDEN_SWORD x 1, UNSPECIFIC_META:{meta-type=UNSPECIFIC, display-name=Β§aLevin Sword, lore=[Β§fCoursing with electric energy,, Β§fthis magical sword has been struck by lightning., , Β§fΒ§nSlots Β§8:, Β§f- Β§aMain hand, Β§f- Β§eOff hand, , Β§5Magical damages Β§8: Β§a9 Β§8/ Β§e2, Β§5Distance magical damages Β§8: Β§a9, Β§eAccuracy Β§8: Β§a70 Β§8/ Β§e17], custom-model-data=0, internal=H4sIAAAAAAAAAJVT204CMRAdDcYK4iW8aUz8AB9WYoI+InghkYQAb8aYsjt70d0W29nF/Xu7LGhMwGLSvjRnzsw5Z1oFYFD1sUeYjPMpwo6eSeUxqPs4CHPd5QkPUMPps3Nxvvq8MDjysRtp6vPgF/5mHb5m8NILcMgJLdT7Pq6gba7EGh0DJd8ekcew5TA48LEjhaaIUoqksHSql9XjMBUeKqiQSpFBw4yKMc9vkWaIYhRK0lC5chzDf1zK3twnM2DbdVPF3RzOCmTL3MvWOo+KcUZTRA+2r515dUdFtIFpCyPmgTIt5GzC4/j7+T5SuJRnnvoywwQFWThrRRCfhbcUWqCNsk8vEFLhg+JZRPmy4V7hp49C2zTsGrUhV4kFdlLu7hA/UiPL63NNqPInzNDsQHO+P0PUJiUuXFtLVnL1ulCLMYvE689faBNx970M42+SwzKlf+x34dWd4JN4kQp8AZgX06WVAwAA}}
> [15:29:36] [Server thread/INFO]: java.io.NotSerializableException: org.bukkit.craftbukkit.v1_16_R2.inventory.CraftItemStack
You have to use BukkitObjectOutputStream
Instead of ObjectOutputStream ?
Yes
Gonna try this
It seems to work, I suppose I use BukkitObjectInputStream too instead of ObjectInputStream
Indeed
Yep, it works, excepted for BukkitObjectInput
When i want to unserialize, I got this
java.io.StreamCorruptedException: invalid stream header: EFBFBDEF
public static ItemStack convertStringToItemStack(String data){
// deserialize the object
try {
byte b[] = data.getBytes();
ByteArrayInputStream bi = new ByteArrayInputStream(b);
BukkitObjectInputStream si = new BukkitObjectInputStream(bi);
ItemStack obj = (ItemStack) si.readObject();
return obj;
} catch (Exception e) {
System.out.println(e);
}
return null;
}
So it returns null
How are you serializing?
Use YamlConfiguration's serializer from Bukkit, then use Common's Base64 to convert it to String and vice versa
I need to get this serialization lib out dont i
Which one?
niallSlib
fun encodeItem(itemStack: ItemStack): String {
val yamlConfiguration = YamlConfiguration()
yamlConfiguration["item"] = itemStack
return String(Base64.encodeBase64(yamlConfiguration.saveToString().toByteArray()))
}
fun decodeItem(encodedItem: String): ItemStack? {
val yamlConfiguration = YamlConfiguration()
yamlConfiguration.loadFromString(String(Base64.decodeBase64(encodedItem)))
return yamlConfiguration.getItemStack("item")
}
Hmmm.. Does it generates yaml files in the plugin folder ?
no
Doesnt yamlconfiguration just use BukkitObjectOutputStream and BukkitObjectInputStream?
Yes, but does all the job for you
ah
it seems that using my code make some "?" inside squares etc
This kind of thing
Encoding problems?
Let him finish typing xD
nah 
Sorry I take time and I don't really know how to explain quickly XDDD
so yep, encoding, but this is without the base64 thing
I use this class
https://pastebin.com/y8ZDhqBw
I don't use the 2 lasts functions
A member of staff has requested I move your pastebin.com paste to our paste.helpch.at!
Why not just use the functions i sent you?
kotlin
^
fun encodeItem(itemStack: ItemStack): String = public static String encodeItem(@NotNull final ItemStack itemStack)
Oooh
yes added the not null annotation because that's basically what it'd look like
I see, kotlin uses fun (ahah funny) but it's the only difference on these functions
Heres the same in a better language
let encode-item = (ItemStack itemstack) => {
let yaml-configuration = YamlConfiguration()
yaml-configuration["item"] = itemstack
return (Base64 |> encodeBase64 yamlConfiguration.saveToString().toByteArray()) as String
}
π
the fuck is |>
ugly
Necessary
Elara programmers are plumbers
I mean the same expression as the kotlin version could have been used there
for legal reasons that's a joke
From PewDiePie's song xD
Ohhh xD
I mean that makes all plumbers Elara programmers
Pretty high standards for those people

@old wyvern why's the pipe operator used there?
I don't understand everything in your functions, (and writed some shit lmao when trying to convert into java).
And these functions must be used before I try to (un)serialize them right ?
public static String encodeItem(final ItemStack itemStack) {
YamlConfiguration yamlConfiguration = new YamlConfiguration();
yamlConfiguration["item"] = itemStack; //some shit
return String(Base64.encodeBase64(yamlConfiguration.saveToString().toByteArray())); //shit there to
}
public static String decodeItem(final String string) {
YamlConfiguration yamlConfiguration = new YamlConfiguration();
yamlConfiguration.loadFromString(String(Base64.decodeBase64(encodedItem))); //same here
return yamlConfiguration.getItemStack("item"); //same here
}
We could just have something similar to companions
Tbh I don't think using YamlConfiguration is the best idea probably
Of wait
yamlConfiguration["item"] = itemStack; is yamlConfiguration.set("item", itemStack); iirc
lol
π
oh yeah
lemme check sec
Tbh I don't think using YamlConfiguration is the best idea probably
Why not?
yep that's it Matt
Isn't that gonna serialize it to yaml?
Serializes to a weird string
If you just want to serialize the ItemStack, just use Java serialization and then you can write wherever you want
if you do that you miss up on a bunch of NBT shit, iirc
and I use MANY nbt
YamlConfigurator was the only one i tried that kept the item perfectly
Without overcomplicating ofc
public static String encodeItem(final ItemStack itemStack) {
YamlConfiguration yamlConfiguration = new YamlConfiguration();
yamlConfiguration.set("item", itemStack);
return String(Base64.encodeBase64(yamlConfiguration.saveToString().getBytes()));
}
public static ItemStack decodeItem(final String string) {
YamlConfiguration yamlConfiguration = new YamlConfiguration();
yamlConfiguration.loadFromString(String(Base64.decodeBase64(string)));
return yamlConfiguration.getItemStack("item");
}
Method calls expected on the returns, but Why this ? '-'
and add a Try Catch for the decode.. Okay ^^
Yeah it gets bloated in Java
java very fat
imagine not being able to just std::ifstream configFile("./config"); to declare and define the variable and open the file
Okay it seems that I'm not the only spy
I can't get import org.apache.commons.codec.binary.Base64;
: Caused by: java.lang.ClassNotFoundException: org.apache.commons.codec.binary.Base64
There are other Base64 encoders, I use the one from commons that is on Spigot, but you need to add spigot, not the api
For some reason Spigot relocates it org.bukkit.craftbukkit.libs.org.apache.commons.codec.binary.Base64
I have no idea
so i replace the import
why wouldn't they
I don't see the point of relocation on the main Jar
And @reef maple you can either add spigot and use the one in the Jar or use a different encoder
Or include commons yourself
I don't really understand. Do I have to add some dependencies ?
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.15</version>
</dependency>
You can use this instead of using spigot's if you want
Alright, I'll try this one
The import stills the same right ?
import org.apache.commons.codec.binary.Base64;
Yeah
Ok same problem, event after dependency update and import
