#help-archived

1 messages · Page 15 of 1

subtle blade
#

initial vs. maximum

#

Initial should never equal the maximum lol

sturdy inlet
#

C:\Users\dimit\Desktop\MiniCraft>java -Xmx1024M -Xms1024M -jar spigot.jar nogui
Picked up _JAVA_OPTIONS: -Xmx512M
Error occurred during initialization of VM
Initial heap size set to a larger value than the maximum heap size

C:\Users\dimit\Desktop\MiniCraft>pause
Press any key to continue . . .

it says that now

keen compass
#

@subtle blade its perfectly fine to have them set as the same

subtle blade
#

But you should not

keen compass
#

all that happens when it is, is that dynamic allocation does not happen

subtle blade
#

Just once is enough

keen compass
#

it is actually more efficient to allocate for MC then to dynamically allocate since you don't get back that ram it consumes anyways

#

also have to wait on it to expand its ram limits as well

sturdy inlet
#

i need helpppp

subtle blade
#

We see your question

fleet crane
#

Just leave xms alone

#

Remove it

sturdy inlet
#

me?

subtle blade
#

Yes

sturdy inlet
#

omg thank you

wanton delta
#

so i found... something

#

EntityArrow is resetting my firetick

subtle blade
#

Likely sets fire ticks every time an arrow hits an entity whether or not it's on fire, which seems like a bug imo

#

Let me confirm that

wanton delta
#

Honestly i think so

#

because im cancelling the combustion event to handle combustion myself

#

it doesnt happen with melee

median wing
#

What's the enchantment of Fortune called

#

can't seem to find it

wanton delta
#

LOOT_BONUS_BLOCKS

median wing
#

Ah thank you

wanton delta
#

so heres what i got in my debug frame

subtle blade
#

That's where I ended up as well

wanton delta
#

I'm baffled why j is equal to -20.....

#

when in the first pick....

#

its clearly 160

#

is this somehow a timing issue?

subtle blade
#

¯_(ツ)_/¯

wanton delta
#

this is going to make me go insane

#

can i zoom out of intellij

#

is that possible lol

#

OH

#

I understand

subtle blade
#

Dunno. I'm in Eclipse

wanton delta
#

I'm setting the fireticks once the event is called

#

the event is called AFTER J is set

#

is that

#

a bug? should that be that way?

autumn crater
#

does spigot not support « » properly?

wanton delta
#

like... byte manipulation?

#

I think i'm going to just use Entity#setOnFire

#

but this is nuts lmaoooo

#

im 99% confident if that variable declaration was moved after the event being called i would be fine

minor spruce
#

what's the problem?

wanton delta
#

me?

minor spruce
#

yea

wanton delta
#

so i have an entity being shot with a fire arrow

#

i am cancelling them being combusted by the fire arrow, so i can handle it myself

#

what is happening though, is spigot is extinguising the player immediately after i do this

minor spruce
#

oh no

keen compass
#

probably would help if you showed the code you are using

golden vault
#

havn't been following too closely but could you cancel the fire arrow event then do your stuff on the next tick?

wanton delta
#

this is my interpretation

#

@golden vault i could but i feel like thats a dirty solution, would this be a worthy PR?

#

j should be defined after the event is called

#

maybe i'm overlooking the reasoning for why j is defined there

#

but i dont see a reason why it shouldnt be moved

minor spruce
#

wheres the code where you handle it yourself?

wanton delta
#

heres an imgur album

#

i'm trying to prove spigot is overwriting the value i set instantly

keen compass
#

would need to see how you have it coded

wanton delta
#

it shouldnt matter

#

im using entity#setFiretick

#

you can see it is set to 160, but only for a very brief moment

keen compass
#

debug frame is nice and all

#

but it doesn't tell me what you are doing wrong

wanton delta
#

i'm not doing anything... wrong?

keen compass
#

you wouldn't know unless you had it peer reviewed, obviously something is wrong

#

whether it is your code or its some kind of quirk

wanton delta
#

i dont know what you want to see.... im setting the fire tick... debug says i am

#

what else do you need?

#

im not setting it back to 0

#

that i have confirmed

#

with other things

keen compass
#

the class file where you have it coded to cancel the event and then you setting the fire ticks etc etc

minor spruce
#

oh i see, so it gets the fire ticks before the event is called, so changing it in the event has no effect because it sets the fire ticks to whatever they were before the event anyway?

wanton delta
#

exactly

#

well im canceling the event all together and using setFireTick myself

#

and the reason im not providing snippets is because its a very large chunk of code

#

that spans accross 3 or 4 different methods

keen compass
#

doesn't bother me none in how large of a code piece it is. But most here won't be able to effectively help without seeing what exactly you are doing to compare with your debug frames

wanton delta
#

im not providing code snippets.... its a lot of code and all that matters is i know i'm setting the fire tick to the correct value and im not setting it after that

#

i appreciate your interest to help, but there is no reason to see the code when the problem isnt with my code

keen compass
#

ok, my point is this you are saying you are using entity.SetFireTicks() it does matter in how you are obtaining the entity reference and whether or not you have the correct entity object you are trying to manipulate.

wanton delta
#

i'm using the exact same way with melee and it does not produce the same effect

#

so i know im using the correct entity in that regard

#

line 337

#

this plugin isnt even mine, to be fair, im just updating it

keen compass
#

does the bow have enchants that you are testing with?

wanton delta
#

like ive said, line 337 gets executed so yes

#

it does

keen compass
#

line 316 is where 160 is coming into play

wanton delta
#

oh

#

im sorry

keen compass
#

level of the bow is 2 which times 80 gets your 160. So the enchant code is conflicting with your projectile one

wanton delta
#

in my version

#

i manually set it to 160 to rule out the amount

#

normally it would be correct

minor spruce
#

is that problem solved?

wanton delta
#

no

#

i was just saying the 160 is correct

#

it just doesnt show in github

minor spruce
#

ah ok

#

when the entity gets hit by the arrow, i know you cancel the fire damage, but does the arrow damage still apply?

wanton delta
#

yes

#

ill have to double check but i think i handle arrow damage too

#

which gives me an idea to maybe handle fire there but for now im focussed on this

minor spruce
#

by the looks of it, that method you're looking at only sets the fire ticks to what they were before if the damage isn't applied, which makes sense

wanton delta
#

you are correct....

#

(thanks for that observation, that helps)

#

but idk if that is an intended behaviour so to speak

minor spruce
#

well if you cancel the damage, it makes sense to revert back to what you had before

wanton delta
#

true

#

then that makes it a weird timing issue which is naf

minor spruce
#

i should probably go to sleep now lol, but good luck with solving your issue

wanton delta
#

thanks you helped with me understanding the problem better

keen compass
#

this is why being able to look at code helps us in helping you 🙂

wanton delta
#

well he actually got that from the spigot code not mine... id argue it didnt help at all. lol

#

and besides my greatest worry from sharing the code was questions about how it worked

keen compass
#

why would that worry you?

wanton delta
#

its a lot of code that has a lot of moving parts

#

beyond that its not even mine to begin with, so sometimes i may have trouble answering stuff myself

golden vault
#

I understand that completely. Explaining other peoples code can be quite difficult, however if you try to anyway you will tend to learn and understand the code better.

keen compass
#

^

wanton delta
#

i understand

#

what im more frustrated about is the timing of this code -_-

keen compass
#

well, if its a timing issue, you could wait a tick to re-apply fire ticks

wanton delta
#

thats the problem

#

im in a static method

keen compass
#

does it need to be static?

#

o.O

wanton delta
#

yea i think so

#

scheduling 1 tick later does the trick but still makes me mad lol

keen compass
#

I think I may know how you are getting that -20

#

because I don't think its suppose to be negative anyways o.O

#

nvm didn't look at it right, but I did find a different spot where ticks are set for the fire

wanton delta
#

like ive said, ive triple checked that my own plugin wasnt the interference

#

so i have that covered

#

i know why it happens now

#

I got around it by checking for projectile damage in the EntityDamageByEntityEvent

#

and setting the damage to 0.000001 which still allows my plugin to handle damage while allowing for fire to be present

#

without scheduling for the next tick

ocean anvil
#

Anyone know if it's possible to access multiple CraftItemEvent results? Like when a user uses Shift+Click? At the moment I can only seem to get the first item crafted

storm vessel
#

I am trying to use my custom domain for Dynmap. I changed the dynmap port to 80, but I am unsure of what type of DNS record I will need. play.elyriamc.com links to my server on port 25565, but I want map.elyriamc.com to link to the Dynmap site on port 80

ocean anvil
#

If you want to point to a specific port you'll need to use an SRV record I believe

#

Not sure if you need to be using SRV but that's the only one I know of that works

storm vessel
#

I don't know if it's really a "specific" port though, seeing as how 80 is the http port

#

if I type localhost into my browser with no port it automatically connects

ocean anvil
#

Oh, you shouldn't need any manual port setting then, since Minecraft will automatically go to 25565 when given a standard URL, and the browser will automatically go to 80 - so just use an A record or a CNAME or something, right?

storm vessel
#

I guess. I am pretty new to creating DNS records

#

How should I setup the A record?

ocean anvil
#

As far as I know, an A record just takes an IP address and nothing more - what're you using to set them up?

storm vessel
#

Google domains

#

It says "invalid record count" when I try that

ocean anvil
#

I haven't used google domains but afaik you'll have name, value and ttl columns?

storm vessel
#

Yep

#

for name I have map, ttl is 30m, and value is my IP

ocean anvil
#

That should work fine

#

You might have to wait a while for your local DNS cache to update, so even if the record worked you may not be able to connect for a while

storm vessel
#

It won't let me hit enter

#

Invalid record count

ocean anvil
#

could you show me a screenshot?

storm vessel
dusky herald
#

Create a new record, A keep ttl at default

#

Set the Data to your servers IP Address

storm vessel
#

It wont let me do that

#

Still says "invalid record count"

dusky herald
#

What IP are you putting in it?

#

I'm not going to connect anyways, you can remove the IP later from comments if you want

#

Actually

#

Delete the entire play record and try adding it again

storm vessel
#

Is there a reason i can't use a synthetic record?

dusky herald
#

It looks like you're adding more than one entry to the data, maybe that's why it keeps throwing errors

storm vessel
#

I don't see why that wouldn't work

keen compass
#

you don't need an srv record if you are not changing the port mc uses. By default the client will attempt to connect to 25565 if a port isn't entered after the domain

storm vessel
#

I got it to work with the synthetic record

dusky herald
#

Just do play / A / 1h / <IP Address>

storm vessel
#

I already have my server domain up and working

#

This is for Dynmap on port 80

#

And it works now

dusky herald
#

Okay, you dont need to reference port 80

storm vessel
#

As far as i can tell

keen compass
#

just do a cname off of play

dusky herald
#

Just the IP address again

agile jungle
#

You could also reverseproxy it

dusky herald
#

Browser works off port 80 regardless

storm vessel
#

Oh wait

#

The only thing is that the synthetic record redirects to my local IP. It is blatantly in the url. I don't know if freely advertising that would be the best idea

dusky herald
#

And just make sure you have the ports forwarded correctly for the web server too, same way you did the MC server

storm vessel
#

Ok, thanks

dusky herald
#

Well, if it's in the URL

#

That could be a domain / or website issue

#

The website would have to be updated in your config to use the domain name as well

#

Sometimes at least, not sure for dynmap

keen compass
#

is the server home hosted ? o.O

dusky herald
#

It could be on a dedicated server

keen compass
#

that would be ideal

frigid ember
#

Guys so I have been using HashMaps for a while, and in Java 8, you can just initiate them right then and ther efor example.

HashMap<Integer, Double> map = new HashMap<Integer, Double>();

I want to know when would the hashmap be initiated first, by doing that, or initiating it in the onEnable function.

#

cos I always feared when I access it it might be null

dusky herald
#

@frigid ember its initiated the same as like in the co nstructor.

frigid ember
#

but my main function

dusky herald
#

And it's not null

frigid ember
#

main class*

#

has no constructor

#

wait oh

#

i understand

#

yeah

dusky herald
#

Its initiated like you used a constructor

frigid ember
#

so then its before onEnable for sure

dusky herald
#

Yeah

frigid ember
#

since to call onEnable

dusky herald
#

It wont ever be null

frigid ember
#

u need an instance

#

Yeah

#

Thanks.

#

@dusky herald and another question

#

what is the difference between doing
ArrayList<Integer> i = new ArrayList<>();

#

do u need the argument in the second

dusky herald
#

Nope

frigid ember
#

ArrayList<Integer> i = new ArrayList<Integer>();

#

so there is no difference

#

dang, ive wasted my whole life

#

xd

keen compass
#

<> just means its also an Integer and ( number) sets the size of the array initially

dusky herald
#

You could do it as List<Integer> I = new ArrayList(); too

keen compass
#

you can leave it blank to initialize at JVM defaults

frigid ember
#

Ok

keen compass
#

or set a number there if you already know the size you need which is more optimal as the JVM doesn't need to spend time expanding the array because it wasn't large enough to begin with 😉

frigid ember
#

can you show ane xample

#

of setting the size

#

I am confused.

#

Setting the size of an arraylist?

keen compass
#

ArrayList<Integer> i = new ArrayList<Integer>(5);

#

would set the array at size 5

frigid ember
#

alright

#

what error do you get if u exceed

dusky herald
#

Almost seems pointless to me

frigid ember
#

the limit

#

do any of you know?

dusky herald
#

Why not use a regular Integer[5] at that point then?

#

Or it can still expand?

frigid ember
#

I just never knew arraylists let you limit.,

dusky herald
#

Or just int[5]

frigid ember
#

Just something new to learn.

#

¯_(ツ)_/¯

keen compass
#

The way I showed will initialize at that size but still allows for it grow

#

the way Blackveiled showed is similar except it won't grow

dusky herald
#

Yeah

frigid ember
#

Yea Ik

#

ok

#

so... what is the point of limiting

keen compass
#

the limit is 2,147,483,647

frigid ember
#

if it grows anyway

dusky herald
#

But it's better to do fixed arrays if you always know its gonna be that size

keen compass
#

because arrays are backed by int

frigid ember
#

the limit is 2,147,483,647
@keen compass Integer.MAX_VALUE

dusky herald
#

Lol

keen compass
#

@frigid ember Queue's don't always have allow for all objects to wait in line. If you wanted to say a Queue is full you could impose a limit to make things wait for the Queue to clear up

#

Queue's generally use an array of some sort to implement

#

also if you wanted to ensure your array didn't go haywire and started consuming a bunch of resources

#

you could set a limit to ensure it wouldn't go beyond a certain point if its not expected that it should

frigid ember
#

ok

dusky herald
#

I want all the arrays

#

int[5][5][5][5][5][5][5][5][5]

#

Arrays for days

keen compass
#

if you initialize your array at the beginning the JVM doesn't spend time guessing how large it needs to be so it will add objects, stop, expand array and then add objects again. If you already know the starting amount you could start it from there instead.

#

its not a requirement, but helps speed things up especially when you deal with large arrays lol

frigid ember
#

Alright

#

ima make my size Integer.MAX_VALUE

#

jk

dusky herald
#

That wastes memory

frigid ember
#

ik

dusky herald
#

🙂

frigid ember
#

so it was a joke

dusky herald
#

Or was it

frigid ember
#

Let's say I am creating a really really large server.

#

In java.

#

And I deal with so many players, more than Integer.MAX_VALUE

#

lets say i tried storing all in an arraylist

#

them im fucced

dusky herald
#

ArrayIndexOutOfBoundsException

keen compass
#

You would get index out of bounds exception

#

or if your JVM wants to throw a curve at you, you just might get a buffer overflow exception lol

frigid ember
#

ik id get it

#

Ik what exceptions id get

#

what is the best way to temporary store this amount of users

dusky herald
#

ExceptionException

frigid ember
#

temporary store

dusky herald
#

Define temporary

frigid ember
#

what would you recommend

#

temporary as, an example, when they leave, I don't want to have their data anymore

#

as if they never existed

#

kinda like a mc server

keen compass
#

but if you had to deal with the limits of the integer, it can get a bit complicated but its pretty easy. And that is you would just make use of 2 arrays and combine them together when you need the data. The hard part is keeping organized in way that both are in sync together lol

dusky herald
#

Use HashMap?

frigid ember
#

it temporary stores all online players

#

hashmap has no limit?

dusky herald
#

And remove them when they leave?

#

A hashmap is like an array list

keen compass
#

hashmap has the same limit

frigid ember
#

exactly

dusky herald
#

But you can pull the player by their UUID

#

You could do like

frigid ember
#

but if over Integer.MAX_VALUE

#

players

#

ik it sounds unrealistic

keen compass
#

you just create a second array

frigid ember
#

but its good to prepare or know how to handle it

#

is it not possible to automate it

dusky herald
#

Map<UUID, PlayerData>

frigid ember
#

thsn constantly adding new arraylists

keen compass
#

anyways odds are you are not going to hit the int limit with the amount of players XD

dusky herald
#

I mean

frigid ember
#

or maps

dusky herald
#

You'll never hit 2.147 billion online at a time anyways

#

So, I think you'll be fine

frigid ember
#

LMAO

#

haha

keen compass
#

no game server has yet either

#

so if yours does you would have broken the world record

frigid ember
#

What is double limit

keen compass
#

which currently eve online holds that record if I recall 😉

frigid ember
#

why did java set the limit to 2 billion whatever

keen compass
#

Java didn't. That is the limit of a 32 bit integer

dusky herald
#

It's the length of a 64 bit data type

#

32*

#

Wait

#

Yep

#

32 bit

keen compass
#

since most of the stuff in java was created before 64 bit came about, most everything is backed by the integer

#

when 64bit came out, they added the long, but since 32bit was still popular, they didn't create alternative arrays and what not to be backed by a 64bit address space

dusky herald
#

64 bit's limit is way higher (2^64) versus 32 bit 2^32

keen compass
#

yep

#

if you really wanted to you could change the JVM source

#

and just change the backing of the address space to 64bit 😉

frigid ember
#

ooh

#

wait a sec

dusky herald
#

And then also, ints have negative values too so

frigid ember
#

if i use a long on a 32-bit system

#

what happens

#

double is 64-bit tho

dusky herald
#

Uh, look up data types

frigid ember
#

so its confusing

dusky herald
#

They show you how many bits they are per data type

keen compass
#

double does not use a 64bit address space

#

it may be 64 bits, but that is because it uses 2 32bit address spaces

frigid ember
#

Ok.

dusky herald
#

Just think, like file size

grave crest
#

NEED halp

dusky herald
#

Or memory

#

1 int = 4 bytes

#

1 double = 8 bytes

#

Etc

keen compass
#

1 byte = 8 bits

dusky herald
#

So basically, to conserve memory, you would want to appropriately use data types

keen compass
#

indeed

dusky herald
#

Like, dont use Double if you dont need to

keen compass
#

you could specify int16 as well if you wanted a smaller int

dusky herald
#

Or, keep as many things Local as possible

keen compass
#

?ask

worldly heathBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

frigid ember
#

ok

grave crest
#

so can i get help from someone

dusky herald
#

And the data types are even more important if you ever plan to use MySQL

grave crest
#

this is my code

#

so this code

frigid ember
#

@dusky herald I do use MYSQL

grave crest
#

sets ur tab name and name tag

#

but it has 16 char limit on the name tag

#

idk how to fix it

keen compass
#

why do you loop through the online players twice?

grave crest
#

can someone help me

frigid ember
#

oh yea

#

`why

dusky herald
#

Lol you beat me to it

#

Put the Scoreboard board outside of the loop

#

And get rid of 1 loop

frigid ember
#

yea

keen compass
#

to get around the limit, make a new line

grave crest
#

that wont fix the 16 char problem

frigid ember
#

initiate the scoreboard out of the loops

dusky herald
#

16 char is all you got

grave crest
#

no there is way to get more than 16

dusky herald
#

I dont think there is?

#

Lol

grave crest
#

in spigot forums they said u can use prefix + main + suffix to get 48 char

#

but idk how to use them

#

hypixel got over 16 char on their name tag

#

so its possible

#

this is 1.8 picture

#

more than 16 char

frigid ember
#

@dusky herald do you know wgat <+ means

#

i just figured out

#

it existed

keen compass
#

prefix and suffix doesn't count towards the limit on the line

frigid ember
#

haha

dusky herald
#

<+?

frigid ember
#

i accidentally did double <= value

#

ij says no error

grave crest
#

they dnt?

frigid ember
#

lmao

dusky herald
#

Ahhh

frigid ember
#

<+*

#

i mean <+

dusky herald
#

Less than or equal to

grave crest
#

well they said they do

frigid ember
#

ik <=

#

<*

#

<+*

#

weird right

#

fuc ij

#

lmao

dusky herald
#

Keyboard issues? Lmao

frigid ember
#

i thought i was dumb

#

and never knew it existed

#

lol

dusky herald
#

Then what have you been doing?

frigid ember
#

i tried to do <=

#

then keyboard fuced up

#

and did <+

#

and i saw no error

#

lol

dusky herald
#

Lmao

frigid ember
#

k fucin operators

#

fam

grave crest
#

can anyone focus on my issue

frigid ember
#

frostalf lmao

#

IK OPERATORS

keen compass
#

the only way to get past the limit is to use the prefix and suffix with the line

#

the main line itself has a 16 character limit

grave crest
#

<=, >=, !, ||, ==

#

there is more

keen compass
#

you are going to have to do checks yourself to ensure what you want is in the proper place

frigid ember
#

yes

keen compass
#

bitshift operators are awesome

#

fastest way to do math in java or simply change numbers without much processing 😛

dusky herald
grave crest
dusky herald
#

lol

grave crest
#

thats when i use prefix

#

I GUESS u were wrong prefix has a limit

#

16 char

dusky herald
#

He never said it didnt

keen compass
#

the only way I have known to get around the limit is to make a new line

#

that is blank

dusky herald
#

You'll get 16 chars per

keen compass
#

if anything go find a scoreboard plugin that supposedly exceeds the limit and see how they do it 😉

#

generally easier if you can find an open source plugin

frigid ember
#

@dusky herald weird question, when initiating doubles, many people initiate differently, some people just initiate integers like
double a= 100;
some people do 100D(D is optional but is there areason to do it, cos you waste your time lol) and some people do 100.0 like me

#

is there a reason why people

#

do it so different

#

maybe im missing something

dusky herald
#

Doesnt really matter

frigid ember
#

ok

dusky herald
#

It's still a double

frigid ember
#

yea

#

why do they do it then

#

adding the D is useless

#

they wasted one character

#

lol

keen compass
#

Double and double are different. One is boxed the other is unboxed. same goes for 100d and 100D

dusky herald
#

Double is just a wrapper class for a primitive double type

keen compass
#

the second version is just convenience especially if you were going to translate it to a different data type anyways

frigid ember
#

i mean a class

#

its not primitive

dusky herald
#

double is primitive

frigid ember
#

Double* is not

dusky herald
#

I said primitive double type

#

Lol

frigid ember
#

he said Double and double are diff

#

so yea

#

Double isn't

dusky herald
#

They are. Double is a wrapper class. double is a primitive data type

keen compass
#

^

frigid ember
#

Double.getClass()

#

oh

#

ur right

#

haha

#
Integer i = new Integer(5);
        
int i = new int(1);```
#

the second line will give an error

#

that's what im tryna say

keen compass
#

because you already defined i

#

can't define it again

dusky herald
#

using new int is incorrect anyways

frigid ember
#

oh

#

yea

dusky herald
#

And int isnt an object

frigid ember
#

still erorr

#

yea

#

i said Double is an object

dusky herald
#

int i = 1

frigid ember
#

yes

#

IK java lmao

#

im just tryna make sense of some stuff

#

that made no sense

#

to see if they have a reason

dusky herald
#

The wrapper classes are useful for certain things.

#

They have utility purposes

grave crest
#

HERE wanna see some example of java

frigid ember
#

why does an arraylist not let u enter in int

grave crest
#

I AM GOD

dusky herald
#

Becayse

frigid ember
#

@dusky herald

#

like

#

int.class

dusky herald
#

It only takes objects

keen compass
#

because int is not an object

frigid ember
#

ok

dusky herald
#

No primitive data types

frigid ember
#

its just annoying converting Integer to int soemtimes

grave crest
#

imagine getting chunk banned

frigid ember
#

haha

dusky herald
#

Just cast it

keen compass
#

you don't need to convert Integer to int o.O

dusky herald
#

Or dont convert it at all

naive goblet
#

Lmao

dusky herald
#

Doesnt really matter

frigid ember
#

i like having it as int

#

looks hotter, hotter than my wife

#

ok lets go to #general

dusky herald
#

It's better to use primitives anyways

frigid ember
#

that is what i say fam

dusky herald
#

And use the classes as you need them

frigid ember
#

btw, u said only use double when u need it

keen compass
#

and then do the fancy boxing and unboxing unnecessarily like many do and then cast it anyways at the end 😄

dusky herald
#

versus an int

frigid ember
#

so i should use floats more

#

what about vs float

lofty otter
#

using the lowercase or uppercase d both creates the primitive type not the wrapper

dusky herald
#

Pick the data type based on the range you expect to utilize.

naive goblet
#

Why make an unnecessary cast

#

Only cast if it’s needed

frigid ember
#

cos int is so hot

#

jk, alright

keen compass
#

floats are more resource intensive fyi.

frigid ember
#

really

dusky herald
#

and have even less precision

frigid ember
#

wow, but they are not as acurate

#

yea

keen compass
#

more so that its actually used as a measurement for your CPU in how many floating points it can calculate 😉

frigid ember
#

double means double precision

naive goblet
#

You should probably use BigDecimal for that or something

#

(Precision)

frigid ember
#

?

#

i spelled precision ryte.

keen compass
#

also to note, if you need to turn a float into an int, make use of the rounding functions to round your float. Otherwise you can end up with unexpected numbers. for instance 0.0000000000001 can still equal 1 which is weird sometimes

naive goblet
#

Yeah (:

frigid ember
#

alright

keen compass
#

usually it happens when you do the casting

naive goblet
#

System.exit(0); is still most useful code here

frigid ember
#

yes

#

Math.round()

#

usful

#

what does Math.abs stand for

dusky herald
#

Absolute

keen compass
#

absolute

frigid ember
#

oh yea

tiny dagger
#

0.1 + 02! = 0.3

keen compass
#

means remove the signs

frigid ember
#

sorry, I don't do school in English here.

grave crest
#

i found a solution i am gonna check the player name and if the player name length is aboe 16 the extra char will then be shown as suffix

naive goblet
#

It means the muscles obv

keen compass
#

lol

frigid ember
#

Ik what abs does

#

Just i never knew what it stood for.

grave crest
#

how is the solution

lofty otter
#

float can only store powers of two nicely

keen compass
#

there is all kinds of math functions in java

lofty otter
#

so 0.5 is fine

#

wait

dusky herald
#

Math.round() is garbage

frigid ember
#

Ok

lofty otter
#

ah yes

keen compass
#

if you get a run on float, it will generally be appended with a 1 sometimes too

lofty otter
#

so 0.5+0.25 is fine

keen compass
#

also another weird thing of java

dusky herald
#

Use +.5 before you do round

lofty otter
#

but if you go off the additions of 2s

#

then it messes up

dusky herald
#

😂

#

If you dont add .5 before round it will lower

#

2.99999999 becomes 2

lofty otter
#

you mean 3

keen compass
#

that is if you have it round down. It can also round up as well

frigid ember
#

IKR

dusky herald
#

Wrongggg

frigid ember
#

I was so mad when that happened

dusky herald
#

2.99999 rounds to 2

frigid ember
#

2.99999999 becomes 2
@dusky herald so annoying

#

this float is ass

#

it succs ass

keen compass
#

no, I meant there is a function to round it up

lofty otter
#

Math.ceil

keen compass
#

you could also use Math.min as well or Math.max

lofty otter
#

those dont round

frigid ember
#

guys I learned a lot of math because of java

lofty otter
#

they just get the smaller or bigger number

dusky herald
#

Ceil does the opposite of what I'd want it to do

frigid ember
#

🙏 java

keen compass
#

nope but you can combine them with round though

frigid ember
#

before for me, all math functions, seemed like part of java

#

Like I thought Math.abs was "invented" by java

#

lol

keen compass
#

lol

frigid ember
#

im like

#

u smart

keen compass
#

fortunately in java unlike say the C languages you don't have to worry about pointers 😉

frigid ember
#

use c++ boiz

lofty otter
#

i mean the Math package is part of java...

dusky herald
#

You could use c# too

#

Lol

keen compass
#

lol

frigid ember
#

It is, but its all basic math

#

Not like they are some math scientists

#

its nothing

keen compass
#

as basic as you want it to be

dusky herald
#

Or if you really wanna be tough just code in binary

keen compass
#

well that would be just setting everything to a byte array

frigid ember
#

people like my jsloader bro

keen compass
#

and then doing bitshifting on those bytes

#

XD

frigid ember
#

i code in assembly

#

x86 tho

#

I enjoy it

keen compass
#

until you have to mess with compatibility between intel and amd

frigid ember
#

use MASM

lofty otter
#

there is no compatibility lmao

frigid ember
#

I use Microsoft assembly

#

iont even know the full name

lofty otter
#

or just join the rest of us in 2020 and use java or c#

frigid ember
#

I use them anyways

#

Assembly is nice

dusky herald
#

I program in msdos

frigid ember
#

what is that

keen compass
#

msdos is fun sometimes

#

miss them old days of 3.1

frigid ember
#

im proud

#

the first resource that got a like

dusky herald
#

MSDOS is old school

frigid ember
#

and 2 even

dusky herald
#

That's what it is

frigid ember
#

I am new school

keen compass
#

the only annoying part of msdos is when you are making a program and there is in an error in there somewhere

#

and then you have to go hunt through it all to find it

frigid ember
#

That applies to all coding

keen compass
#

while true, back then there was no IDE's

dusky herald
#

Woo 3 more hours til I go home

frigid ember
#

yay]

keen compass
#

you literally programmed the 1's and 0's and if you had a 1 in the wrong place odd things happened but the hard part was figuring out where you went wrong though. Its not like it underlines it for you and says hey this is not right

frigid ember
#

and its 2 am for u

#

@dusky herald

#

what are u doing outside

#

ma guy went CLUBBING

#

ahaha

dusky herald
#

I'm at work?

#

Lol

frigid ember
#

at 2am?

#

oh..

dusky herald
#

Yeah

frigid ember
#

um

keen compass
#

now a days with IDE's its so much simpler other then the abstracted higher languages being much nicer at times to work with

frigid ember
#

weird mf

dusky herald
#

People work at night y'know

frigid ember
#

not fulltime tho

#

unless youa nurse or some shit

#

lol

keen compass
#

there is many jobs that work fulltime at night

#

IE security

frigid ember
#

ight

dusky herald
#

My view rn

frigid ember
#

face reveal

keen compass
#

ah crane operator or just the driver

frigid ember
#

They’re the crane

dusky herald
#

The seat is the driver and operators seat

keen compass
#

ah

dusky herald
#

It's just a rough terrain swing cab crane

#

100 Ton (US Tons) capacity

fleet crane
#

discord while working

dusky herald
#

That's like 90k kg

#

I'm not even doing anything at work 😂

lofty otter
#

are we gonna see some headlines tomorrow

keen compass
#

well, I operated tanks. That is the heaviest equipment I used.

dusky herald
#

In the military?

keen compass
#

no outside the military because I love having me a tank on the road 😉

#

yes In the military lol

dusky herald
#

I drove Strykers around before, the M1133s at least

#

I hated them

keen compass
#

I hate strykers

dusky herald
#

Lmao

keen compass
#

they break without touching them

#

you look at it wrong and something breaks

dusky herald
#

Basically

#

M1133 is the MEV version

frigid ember
#

i have no followres

#

so do me a favor

keen compass
#

one of things I loved about the military is when it comes to some of the random tests they do

dusky herald
#

And btw I've been out for a few years now, I hear tanks and I think of a lot more things than just the vehicle tanks lol

keen compass
#

My brother got to be part of the test of, can a bradley turret fit on a M113

#

sure enough they managed to fit a bradley turret on a M113, but turned out it wasn't very effective though

dusky herald
#

Or they go crazy at the end of the fiscal year

keen compass
#

yeah that was part of my job

dusky herald
#

I remember I was giving medical support for a range

#

Shooting off AT-4s

#

And we had I recall about 110 rounds

keen compass
#

lets spend 1-2 million dollars on items and not only on items but I have to justify why I need said items as well

dusky herald
#

Of the actual AT-4 round, not the 9mm tracers

keen compass
#

AT-4 rockets can be fun

dusky herald
#

Yeah I just remember hearing nobody has ever seen so many rounds at one range lmao

#

Or they coulda just been fuckin with me idk

keen compass
#

so, one of the tests btw I actually got to see not in person but on video which the Army tries to keep covered up. Is the test of dropping an abrams out of a globemaster

dusky herald
#

Idk what a globemaster even is tbh

grim sapphire
#

army bois? 😮

keen compass
#

C-17

dusky herald
#

Okay

#

Never heard that name before haha

grim sapphire
#

(hooyah from a fellow sailor 😉 )

keen compass
#

Well, lets just say the Army will not attempt that test ever again

dusky herald
#

Hooyah lel

keen compass
#

it was the most expensive test considering the tank was a complete loss

dusky herald
#

Army says hooah

#

As much as I hated saying it

sturdy inlet
#

Hey i was wanting to take my server from 1.15 to 1.8 and unsure on how to do this

keen compass
#

used to be HUA until the panda organization trademarked it >>

dusky herald
#

Lmao

#

Jacked

keen compass
#

it stands for Heard Understood Acknowledged. Changed to Hooah so the sound stayed the same lol

dusky herald
#

Yeah, I do remember that at least

#

I just didnt know about the trademark part

keen compass
#

yeah, Army didn't think it needed to do that

#

but then the Panda organization trademarked it and used it against the Army lmao

dusky herald
#

Idk how an abbreviation can even be trademarked

#

Lol

keen compass
#

idk just know that is why the Army had to change the spelling on their slogan

#

of course this time around Hooah is trademarked

dusky herald
#

I definitely dont miss the Army.

keen compass
#

anyways, in case you were curious about that tank test. The reason it came about is because the Russians dropped a BRD out of plane with a crew and safely parachuted it to the ground

dusky herald
#

Makes sense, Russians are fuckin crazy

keen compass
#

the math for the Abrams being parachuted wasn't exact. In other words in theory it could work. In reality, it didn't. It just came smacking into the Earth like no other and basically obliterated.

dusky herald
#

They probably designed it to support the weight of the tank

#

Which is a flaw

sturdy inlet
#

ебать тебя

#

вы гей

keen compass
#

BRD that was dropped didn't weigh 75tons battle ready either

dusky herald
#

It would have to be designed to withstand the shock load force of the tank

#

At least 5x the weight of the tank

#

So 75x5 around 375 tons

#

Would probably be about how strong you want your chute to be

sturdy inlet
#

does anyone know like a generator i could use to put my serrver discripton

keen compass
#

well, the chutes deployed just fine, just didn't slow the tank like they needed too since all the chutes couldn't take up all the surface area it needed without taking space from the others.

dusky herald
#

Ah

#

I was thinking they broke

#

Yeah youd need a big ass parachute

keen compass
#

yeah, well Army tested it just so they could say yeah we tried it, didn't work

#

but a tank costs like $5mil per though so it was just one big expensive test to just figure out, yeah we can't do that

#

well $10mil now if you factor in inflation lol

dusky herald
#

Just to show power...be like yeah we can just drop these boys and fuck your shit up real quick

keen compass
#

it would be cool if we could just air drop tanks anywhere

dusky herald
#

Air dropping wouldnt work that well anyways

#

Youd have to do it in large open areas

keen compass
#

I know for fact if we could, the Army would be air dropping them on mountains XD

#

for now, we have to use C-5 galaxies to get them in the mountains lol

dusky herald
#

Lmao

#

But anyways, large open areas because you cant control your landing

#

It's just gonna go where it drops

#

Lmao

keen compass
#

yep, and then if the rigger didn't rig them chains right, your vehicle will also go rolling away 5 miles or so away

#

😄

dusky herald
#

Rigging is fun

#

I do that too

#

But I was a medic in the army 😂

keen compass
#

currently most vehicles are not straight air dropped unless they are light vehicles. If they have armor they just do a runway drop. But those runway drops can be funny though

#

especially if its not your supplies they are dropping

dusky herald
#

Rigging at my job is more fun anyways

#

Bullrigging shit can be exhausting but fun

keen compass
#

lol

dusky herald
#

Satisfaction of shoving 30k lb valves in ways you never thought possible 😂

#

In tight ass places lol

keen compass
#

I went through Air assault school. So I got to learn how to rig stuff to helicopters. I thought I was just going to learn how to jump out of helicopters and just repel in etc. Nope, you get to learn how to do loadouts for various vehicles, how they have to be attached etc.

dusky herald
#

Definitely more advanced rigging practices here than the Army does, since Army likes to keep it simple

#

But

#

It's all relative anyways

keen compass
#

yeah, have to keep it simple

#

not everyone is exactly smart in the Army >>

dusky herald
#

Army doesnt give a fuck about safety either

keen compass
#

you know, I have almost died in the Army mostly because of other soldiers and while state side as well.

dusky herald
#

"Yeah we did a risk assessment, only a few of us might die, that's worth it"

keen compass
#

I have had a grenade thrown at me, fortunately I had a bunker for cover. I have almost been ran over or squished by a tank 3 different times.

dusky herald
#

People not paying attention

#

And I guess someone didnt like you

keen compass
#

I have had a soldier have a runaway machine gun and decided to walk with it, instead of just leaving it on the ground and just watch it like you are supposed to.

dusky herald
#

Or made a big uh oh

#

Lmao what a tard

#

The funny thing about rigging outside the Army is

keen compass
#

I went to the range with uparmored humvee's and we were doing our range qualifications for the .50 cal on the humvee's

dusky herald
#

Everyone I work around thinks they know how to do it, just cause they know basic stuff lol

#

And also ignore the fact I'm the only one here qualified to do it atm lol

keen compass
#

so we have 2 lanes, but 1 lane operates at a time while the others on the other lane just sit back and wait. Well we were doing our night training portion. So someone had the bright idea to not only mark the targets with green chem lights but also mark the vehicles with green chem lights. Generally not a big deal though because your targets are in front of you. Well my humvee got shot up with .50 cal rounds because the guy on the turret decided to shoot left -.-

#

yeah basic stuff helps

#

but doesn't mean you are an expert at it

dusky herald
#

That's Army logic right there

keen compass
#

or qualified to just randomly hook things up because you think it should work

dusky herald
#

Make it all green fuck it lol

#

Lol, we had a guy who was always like I know what I'm doing

keen compass
#

yeah until someone dies or nearly dies

dusky herald
#

And I was helping him and he asked to rig it his way

keen compass
#

then you will think otherwise >>

dusky herald
#

And I told him no and to suck a dick because it would literally invert

keen compass
#

not usually a good thing to have happen

dusky herald
#

And he goes and gets someone and says I'm not doing it right

#

And I say only, show him how you want it then

#

So he changes it all and everyone looks at him like hes a fucking dumbass

keen compass
#

lol

dusky herald
#

Lmao

#

It's like he got a bright idea

keen compass
#

you know its one thing if its just you and someone else. But when you have everyone else disagreeing with you that should clue you in that just maybe what you are doing isn't quite right

dusky herald
#

But forgot Center of Mass still exists

keen compass
#

how can you forget that o.O

dusky herald
#

Easy

#

Hes not qualified to do the job

keen compass
#

lmao

frigid ember
#

@dusky herald i got a question

dusky herald
#

That's pretty much it, this is stuff you never had to be certified or anything to do in the past

frigid ember
#

when catching an exception, is it better to specify which exception, or is it ok to just use Exception generally

#

does it affect performance

dusky herald
#

It all changed because people died a lot from stupid bullshit

#

Specify the exception

frigid ember
#

or anyone can answer

#

Performance wise affect?

keen compass
#

Generally its better to catch the specific exception so that you don't accidentally catch exceptions you didn't want to catch

frigid ember
#

Generally its better to catch the specific exception so that you don't accidentally catch exceptions you didn't want to catch
@keen compass ignore that part

#

ignore that case

#

but

#

generally

#

why not just use Exception when i only expect one exception

#

like instead of a null

keen compass
#

there is no performance difference other then, if its not your exception it won't register

frigid ember
#

Sometimes I am unsure what exception Iw ill get

#

If I try to access a config value that doesn't exist

keen compass
#

But you don't have to handle the exception if you don't want to either btw

frigid ember
#

what exception do i get

#

lets say its a boolean

#

what exception do I get

#

null right?

hoary parcel
#

Just try catch throwable everywhere

dusky herald
#

Your exception depends on how you're trying to retrieve it first.

hoary parcel
#

No exceptions anywhere in your code then 😂

frigid ember
#

Boolean val = getConfig()...

#

so i know if the value exists

#

i catch a null

#

right

dusky herald
#

Boolean cant be null

frigid ember
#

I've always just used Exception, but I wanna specify

hoary parcel
#

Expected behavior should never raise exceptions

frigid ember
#

so it will just be false

#

?

dusky herald
#

It either is Null like it doesnt exist

frigid ember
#

I JUST SAID

dusky herald
#

Or true or false

frigid ember
#

u said it cant be null

#

then u said it can be null

dusky herald
#

You said "if I know it exists"

#

Then it cant be null

hoary parcel
#

Just always call config with default values

keen compass
#

if a boolean is null you will get a null pointer exception

frigid ember
#

so that I know if it exists

hoary parcel
#

Way less hassel that way

frigid ember
#

if the Boolean value doesn't exist

#

in the config

dusky herald
#

If it doesnt exist, then its null

frigid ember
#

exactly

#

so nullpointer

#

ok t

dusky herald
#

Then you get NullPointerException

frigid ember
#

y

#

why is it called nullpointer

hoary parcel
#

If Sure hope you don't try to catch a nullpointer exception...

#

Because objects are pointers

keen compass
#

because the pointer that is expected to have data doesn't have data and therefore its an exception

frigid ember
#

Ok

hoary parcel
#

C# calls it null reference, might be a bit more clear

lofty otter
#

you only get a nullpointerexception when you try to call a method or field on an object that is null

frigid ember
#

thanks forstalf

#

Yeah

lofty otter
#

just having a null object doesnt cause an NPE

#

you have to try to do something on it

frigid ember
#

ik what is FRICIN IS

dusky herald
#

You can also

frigid ember
#

you guys explain the wrong thing

#

I just asked about the name

dusky herald
#

Just do a Null Check

lofty otter
#

or use Optionals

frigid ember
#

ik how null pointer exceptions work

lofty otter
#

theyre much better than excessive null checking

dusky herald
#

Then you wont get a null pointer exception

frigid ember
#

Ok

#

IK

#

i just asked WHY ITS CALLED

#

nullpointer

#

lmao

#

thanks for the answer

#

frostalf

dusky herald
#

You can also

#

That's all I got

keen compass
#

lol

frigid ember
#

lmao

#

you guys give me a whole introduction o java

#

lmao

#

Just try stick to answering what was asked

#

cos you were explaining what a nullpointerexception is

dusky herald
#

I just think it's funny how some people ask questions like

frigid ember
#

and more

#

lmao

#

and im like, I JUST ASKED WHY ITS CALLED NULLPOINTER

keen compass
#

well, I think we are in common agreeance we don't just give answers. We like to ensure that you get all the necessary information with why the answer is what it is or why it is.

dusky herald
#

Hey I'm working on a plugin what does main extends JavaPlugin mean? Just help me out I dont want to learn a lot of Java, reading is boring so just tell me how to do this

frigid ember
#

i didn't ask that

#

I could ask, why did they name the class JavaPlugin

dusky herald
#

I wasnt talking about you

frigid ember
#

and not Plugin

dusky herald
#

Lol

frigid ember
#

then you: JavaPlugin is the superclass

#

your main class must extend it

dusky herald
#

Because JavaPlugin extends Plugin

frigid ember
#

add its directory in its config

#

see u did it again

#

lmao

#

oh

#

good explanation actuall

#

they coluldn't think of another name

dusky herald
#

PluginBase mb

#

Close enough

lofty otter
#

you dont need to use those classes

#

you can just directly implement Plugin

keen compass
#

Plugin is Ambiguous without some kind of identifier.

#

also it depends if Plugin exists already too

lofty otter
#

but by extending JavaPlugin / BasePlugin they do some of the work for you

dusky herald
#

I know his point though

#

But why is it called JavaPlugin

lofty otter
#

because they needed another name

keen compass
#

Because its a Plugin made in Java 😄

dusky herald
#

Isnt that as ambiguous as calling it Plugin?

lofty otter
#

they need a name that isnt Plugin

dusky herald
#

😂

lofty otter
#

so they came up with JavaPlugin

keen compass
#

pretty much

dusky herald
#

"I'm coding a plugin in Java, fuck it JavaPlugin"

frigid ember
#

@dusky herald will this give me an error

lofty otter
#

BukkitPlugin wouldve probably been better

frigid ember
#
 boolean val = getConfig().getBoolean("bar_enabled");
 val = (val == (Boolean) null) ? true : val;```
dusky herald
#

PornHub

frigid ember
#

I want default to be true

dusky herald
#

Put it before?

#

If(getConfig().getBoolean("bar-enabled") != null)

frigid ember
#

what

#

Ok

#

that looks ugly

lofty otter
#

and you dont need to cast the null lmao

dusky herald
#

Probably is

#

I'm on my phone

frigid ember
#

u cant do that

#

u must cast to bolean

#

you must

#

¯_(ツ)_/¯

lofty otter
#

the null?

frigid ember
#

yea

lofty otter
#

wtf

frigid ember
#

open IntelliJ

#

i get error for doing this

#
if(getConfig().getBoolean("bar_enabled") != null) {
            
        }```
#

u need to cast null to (Boolean) null

dusky herald
#

Oh sorry try

lofty otter
#

oh i know why

dusky herald
#

getConfig has exists right?

lofty otter
#

because a primitive type can never be null

#

so that null will never happen

dusky herald
#

Just do exists("bar-enabled")

frigid ember
#

so it will be false

lofty otter
#

because that method cannot return null

frigid ember
#

exists doesn't exist