#Parsing YAML to Vector

1 messages · Page 1 of 1 (latest)

native flame
#

The setter returns this. Could this be causing problems for snakeyaml?

#

Parsing YAML to Vector

#

For now I'll make my own vector class which is very inconvenient because I have to convert it back into the bukkit vector to use it. If anybody has advice I'd really appreciate it. I've also tried using jackson before but couldn't get it to work so if anybody has an example project I could look at that would be great

void ocean
#

hum

#

Why do you use the variable ?

#

use getX()

native flame
#

What?

void ocean
#

Oh you meant write

#

oh

#

Just do new Vector(x,y,z);

native flame
#

I have a yaml file

vector:
  x: 1.0
  y: 1.0
  z: 1.0
void ocean
#

yeah you save offset in it

#

then you want to get them back in a vector

native flame
#

Yeah. I'm using SnakeYAML because offset is not the only property

void ocean
#

This might help you

#

i guess

native flame
#

Yeah this is the only thing I could find. His issue was that the property was private so snakeyaml can't set it.

void ocean
#

But, in your case it is "protected"

native flame
#

I'm confused because like in the first screenshot I sent there's a public set function

void ocean
#

Yeah, but i guess they will try to edit directly the variable

#

not using the set methods

#

And because it is protected you can't access it

native flame
#

I've used private properties before that had setters and snakeyaml worked fine

#

the only thing I can think of is that the setter returns this

void ocean
#

Yeah

#

I mean is it a problem ?

native flame
#

Yeah that's why I'm asking here :)

void ocean
#

No i mean is it a problem that it return "this"

native flame
#

Oh I have no idea

#

that was just my only guess

void ocean
#

well i see

#

umm

#

no

#

i don't see at all

native flame
#

Hmm this reddit comment seems like it's saying so