#help-development

1 messages ยท Page 104 of 1

drowsy helm
#

so i can pause the thread

tardy delta
#

or while(response == null && !timeout) Thread.yield()

drowsy helm
#

yeah might just yield

#

probs easier

tardy delta
#

lets see if rabbit hasnt escaped again

drowsy helm
#

okay sick

#

cross server parties working beautifully

tardy delta
#

my math working beatifully too

drowsy helm
#

what are you making that lib for btw?

tardy delta
#

making a math expression parser just for fun

sacred mountain
#

LETST GO

#

ITS WORKIng

drowsy helm
#

yoo nice

tardy delta
#

Math.pow impl is horrible lol

sacred mountain
tardy delta
#

250 lines

drowsy helm
#

Math.pow pog

#

just did it in 1

sacred mountain
#

wow

#

pro

echo basalt
#

return future.get(timeoutSeconds, TimeUnit.SECONDS)

sacred mountain
#

can someone suggest how i should detect if a player has cooked an item? should i add a pdc to the itemstack if a player puts it in a furnace/cooking block

#

and then when they take it check it against the same player

#

or is there an event or easier way

drowsy helm
#

oh thats a thing?

#

thanks

drowsy helm
#

jesus

#

why

sacred mountain
#

how do i detect if a player shift clicks a cookable item into a furnace slot 0

echo basalt
#

my man

sacred mountain
#

and it actually makes it there

echo basalt
#

break down your question

#

and figure stuff

#

How can I detect if a player shift clicks

  • a cookable item
  • into a furnace
  • slot 0
sacred mountain
#

no bc i've tried this yesterday with the craft one and it doesnt work

#

shift clicks into a slot, not actually clicking that slot

tardy delta
sacred mountain
#

is there a way to check where it's going

tardy delta
#

what were they on

echo basalt
#

if it's shift click

#

otherInv

echo basalt
drowsy helm
tardy delta
#

same lol

echo basalt
#

I once had to refactor a project full of those

#

was fun

#

why is my intellij crashing

tardy delta
#

lets not take that as an if

echo basalt
#

ternary is an if

tardy delta
#

:bonk:

echo basalt
#

the solution was setting the flag bit to 0

drowsy helm
#

fancy if statement

echo basalt
#

or something

iron glade
tardy delta
#

my math is fancy

#

quite

sacred mountain
echo basalt
#

lmao

#

why tf did I type play lol

tardy delta
#

discord acc hacked

sacred mountain
#

fr

echo basalt
#

if your isBlank() already does string operations the performance hit will be negligent

#

it's also simpler to understand lol

drowsy helm
#

what are you gonna use the lib for Fourteen?

echo basalt
#

sometimes I'm such a performance freak lmao

drowsy helm
echo basalt
#

I can imagine myself getting accepted into some bank as a java dev and optimizing every single algorithm by like 25%

#

I wasted 4 hours optimizing a raytracing algorithm for a 2ms improvement

drowsy helm
#

i didnt realise how inefficient my code was until i started working for a 3k+ concurrent player server

#

really brings out the worst in your plugins

echo basalt
#

worst part about the raytracing algorithm is that it was being run async so

#

ยฏ_(ใƒ„)_/ยฏ

drowsy helm
#

i tried my hand at raytracing

#

shit is hard

echo basalt
#

benefits of being paid hourly

echo basalt
#

the annoying part is that the hitbox can be smaller depending on the frame's image

#

if it's 80x80, then anything between 81 - 128 will be empty and should be considered invalid

drowsy helm
#

made this cpu based raytracer a while ago

#

was pretty fun

echo basalt
#

also that the frame's hitbox changes depending on rotation

drowsy helm
#

i hate working with itemframe images lol

echo basalt
#

I got a whole API

drowsy helm
#

is it working?

echo basalt
#

works a bit like C#'s winforms

#

where you can add labels, buttons

#

working on a template system so you can load image templates with buttons from a .yml file

drowsy helm
#

should make a html renderer for minecraft maps pog

reef lagoon
echo basalt
sacred mountain
#

why is the getDurability method on itemstack deprecated

drowsy helm
#

its in itemMeta now iirc

echo basalt
#

Damageable

echo basalt
sacred mountain
drowsy helm
#

yeah minecraft's default one is shit

echo basalt
#

and made multiple color matching algorithms so you can pick the best for color fidelity

drowsy helm
#

cast it to Damageable

echo basalt
#

one's a bit more tuned for human eyes

#

the other makes more sense mathemathically

drowsy helm
#

the whole rendering pipeline for maps are a bit whack tbh

echo basalt
#

images render within 0.01ms

drowsy helm
#

async?

echo basalt
#

yes

#

all async

#

colors are also cached when comparing

#

so the first image might take 100k ns

sacred mountain
echo basalt
#

but all the others would take about 9k ns to match and convert

drowsy helm
echo basalt
#

9k ns = 0.09ms

drowsy helm
#

sheesh nice

#

caching is so powerful

echo basalt
#

not using minecraft's algorithms is so powerful

drowsy helm
#

+1

echo basalt
#

I also got raytracing working sub-ms

#

the margins are 9-13k ns

#

but sometimes they reach 100k ns idk why

drowsy helm
#

speaking of slow. My redis server is in america and minecraft server is australia

echo basalt
#

probably some concurrency stuff idk

drowsy helm
#

get like .5ms latency lel

drowsy helm
echo basalt
#

could be

#

I only perform like 1 raycast per block

drowsy helm
#

man i wish we had pointers

#

my code would be so efficient

echo basalt
#

then grab the block it hit and expand the raycast one final time to the distance between the ray location and the frame border

#

ensuring I can actually get what pixel I'm looking at

drowsy helm
#

did you use marching cubes

echo basalt
#

idk what's that honestly

#

it was like 6am and I was obsessed with optimizing code

#

I didn't even sleep

drowsy helm
#

raytracing algorith to get hit points efficiently

#

wait your raytrace would be orthographic anyway right

echo basalt
#

ehh I just made my own shitty version of it

#

code is basically

#

pseudo because I can't bother

tardy delta
drowsy helm
#

just for fun?

tardy delta
#

ill see what future brings

#

maybe implement in into a discord bot command or whatever

drowsy helm
#

could make a graph plotter

#

that would be fun

tardy delta
#

mmh

#

javafx ๐Ÿค“

boreal seal
#

guys i got an question guys

#

spawning random stactures not sure where to start

#

i want to spawn stractures and remove on the on stop

sacred mountain
#

how do i get an items pdc if it has no itemmeta

boreal seal
#

now removing them wont be an issue probably making a list of locations and removing them

echo basalt
#
Vector start = eyeLoc
Vector direction = normalize(...);

Vector end = start + direction * maxDistance
Vector step = direction;

Location currentLoc = start
CanvasFrame chosenCanvas = null

outer:
while distance(start, end) > 0.1:
  for(Canvas canvas : canvases)
    chosenCanvas = canvas.getFrameAtBlock(currentLoc)

    if(chosenCanvas != null)
      break outer

  currentLoc += step

if(chosenCanvas == null) // no frame 
  return null;

BlockFace face = chosenCanvas.getFace() // grab face from yaw
Location frameLocation = chosenCanvas.getLocation() - normalize(face.getDirection) * 0.4999  // almost half a block, but still inside same block

double axis = faceX == 0 ? frameLocation.z : frameLocation.x
double hit = faceX == 0 ? currentLocation.z : currentLocation.x

currentLocation += largeStep * abs(axis - hit)

// check currentLocation depending on the axis, compare to frame bounds etc
boreal seal
#

but how would i sapwn them in first place?

echo basalt
#

this is my crappy canvas raytracing

tardy delta
#

hmm how do i make this a sneakythrow?

echo basalt
#

I used to just make the step hella tiny until it hits a pixel

echo basalt
tardy delta
#

i believe this works

timid jetty
#

quick question if I cancel a EntityPickupItemEvent does that stop the item from being picked up?

echo basalt
#

ayo @drowsy helm should we make a html renderer in minecraft

sacred mountain
#

if an itemstack has more than one item and u add a pdc do all of the items have the data

echo basalt
#

it's a solid idea now that I think about it

drowsy helm
#

i would if i had time lol

echo basalt
#

I already got clicking working

#

just make a selenium browser thing

#

and play with it

drowsy helm
#

is it easy to render css content though?

#

ah yeah

echo basalt
#

or we can just convert the .html file to a png and render it

drowsy helm
#

would be easy for basic components

#

probs no js or anything

echo basalt
#

implement scrolling

#

what if I implemented papi support and just like

#

sold it on spigot for 20$ ๐Ÿ˜‚

#

name it like "InteractiveBoard but well written"

drowsy helm
#

lmao

echo basalt
#

I was thinking on making a "but well written" series

drowsy helm
#

not a bad idea

#

you'd probs get alotta hate lmao

echo basalt
#

where I rewrite popular plugins

#

like essentials and builder's utilities

#

to have actually decent code

drowsy helm
#

sounds like a lotta upkeep tbh

echo basalt
#

hire slaves idk

drowsy helm
#

only reason i dont make public plugins is because i dont want to keep them up to date

echo basalt
#

I tried making a premium plugin

#

5 months in and 0 sales

drowsy helm
#

eek

tardy delta
echo basalt
#

no criticism so no bugs to fix :D

#

oh yeah deadlines suck

#

Here's a project, do it in 1 month
starts in May, finishes mid-August

tardy delta
#

especially those at school smh

echo basalt
#

I only got one last year of school

tardy delta
#

starting 3 years college now ๐Ÿฅบ

drowsy helm
#

working for actual servers is much better money aswell

echo basalt
#

hypixel didn't like my schedule

#

and maybe my code idk

#

so can't relate

#

well ig I have a job where I just fuck around with my code and get paid well

#

hourly rate and they want experimental stuff no one else has ever done

#

so I get to waste 5 hours refactoring code and I can charge big bucks

drowsy helm
#

i love doing stuff no one has done before

tardy delta
#

made my own Validate class ๐Ÿค“

drowsy helm
#

thats basically the entrie server im working on rn

echo basalt
#

I'm also a little shit and decide to make client-side mobs that collide with client-side blocks because I can't bother making a map management system

sacred mountain
#

when a player opens a furnace and they clck on a slot in their inventory is the inventorytype still furnace

sacred mountain
#

oh

echo basalt
#

getInventory is not getClickedInventory

sacred mountain
#

well im just having trouble detecting if a player puts an item in a furnace slot 0

drowsy helm
#

which event are you using

sacred mountain
#

inventoryclickevent

#

the problem is that they can shiftclick, right click, shiftrightclick, normally place

#

i just wanna check if they actually get the item into the furnace

drowsy helm
#

why not use InventoryMoveItemEvent

#

then you can get destination

sacred mountain
#

bruh thats a thing

#

damn

shadow zinc
#

I'm cringing so hard https://youtu.be/YpS0Jh5yqIw

How to write horrifically awful Java code!
Complete Java course: https://codingwithjohn.thinkific.com/courses/java-for-beginners

Any fool can write good Java code, but it takes an expert to create truly awful, unreadable, impossible-to-maintain Java code. That's what we'll be learning in this lesson!

What makes code bad? There are many ways yo...

โ–ถ Play video
tardy delta
#

why does he have a CatFeeder

shadow zinc
#

lol no idea, he mad programmer

tardy delta
shadow zinc
#

๐Ÿ˜ข ๐Ÿ”ซ

tardy delta
#

let just take a byte[]

shadow zinc
#

Variables class for everything

quaint mantle
smoky oak
#

its a global variable

#

i thikn

shadow zinc
#

yep

tardy delta
#

char[][] iirc

quaint mantle
#

right xD

drowsy helm
#

I've seen worse code

tardy delta
#

lmao "many programmers forget that you can have multiple statements on one line, you just have to seperate them with semicolons ;-;"

#

truly mad

timid jetty
#

is there any way to get the item dropped after using Player.dropItem(1) for the purpose of applying pdc

shadow zinc
drowsy helm
#

what pdc are you setting?

ornate mantle
#

do spawn eggs trigger CreatureSpawnEvent

timid jetty
drowsy helm
#

are you trying to apply it to the entity or the itemstack itself

#

if the latter just set it beforehand

timid jetty
#

well its in the scope of it being an entity, for things like itempickupevent

smoky oak
#

rate my terrible code and suggest an improvement if you can think of one. The reason for the triple nesting is because its a separation into block material - instance of one such material block - list of items near that instance

ArrayList<ArrayList<ArrayList<ItemStack>>> droppedItems = RStructHandler.scanStructure(struct,new Material[]{Material.LODESTONE});
event.getPlayer().sendMessage("First item is: "+droppedItems.get(0).get(0).get(0).getType());
shadow zinc
#

bro this is the best advice ever https://youtu.be/YpS0Jh5yqIw?t=397

How to write horrifically awful Java code!
Complete Java course: https://codingwithjohn.thinkific.com/courses/java-for-beginners

Any fool can write good Java code, but it takes an expert to create truly awful, unreadable, impossible-to-maintain Java code. That's what we'll be learning in this lesson!

What makes code bad? There are many ways yo...

โ–ถ Play video
young knoll
drowsy helm
#

theres another event for it tho iirc

smoky oak
#

still

#

is there a better way to do this

tardy delta
#

ij complaining that i cannot save a name in a Optional<Optional<Optional<String>>> wtf

shadow zinc
smoky oak
#

rephrase

#

can anyone tell if theres a simpler/better way to do this

#

what im doing is scanning a structure, finding all blocks of certain materials - that list makes up the first list - then for every instance of one such material - second list - it gives all items directly above that block - third list

quiet ice
sacred mountain
quiet ice
#

InventoryDragEvent, InventoryClickEvent and a lot more

quiet ice
sacred mountain
#

oh

#

what's this then

#

and the destination type can be furnace and everything

#

what do u think the best listener for what i wanna do is

smoky oak
#

iirc nbt blocks can be inventoryHolder

sacred mountain
#

oooh inventoryclickevent MOVE_TO_OTHER_INVENTORY

#

action type

tardy delta
#

ij fking stupid

sacred mountain
#

lmfao

tardy delta
#

"the call to nullable always fails" no intellij :/

sacred mountain
quiet ice
young knoll
#

Iirc you can attach a file writer to your plugins logger

quiet ice
#

Why would you force an argument to be null

tardy delta
#

uhh i got my reasons

quiet ice
#

Also the name is very misleading

tardy delta
quiet ice
#

If you do not wish to hack into the logger, no - not possible

#

There is no event

quiet ice
#

issue is that might not work on all plattforms since paper exposes a SLF4J logger

tardy delta
#

@Contract("!null -> fail") means that it will fail when providing smth notnull right?

quiet ice
#

!null -> fail means that it throws an exception if object != null, i requires object to be null

#

Gotta catch 'em all

echo basalt
#

I always read the @Contract annotation as if it was like a muscle contraction

#

always got hella confused

#

like ig that's how the code pulls itself together?

tardy delta
#

why does it tell it always fails then lol

quiet ice
#

The contract annotations is much nicer then it can be

quiet ice
tardy delta
#

ide cannot infer that, it can either be null or it cannot

quiet ice
#

(or throwable) as well as any listeners

quiet ice
echo basalt
#

there's one thing I kinda hate about java

#

but it makes sense in a way

#

the Optional<T> class

#

like

#

pass a nullable arg?

sage patio
#

I can't remove something fron an ArrayList in a for loop yea?

echo basalt
#

but at the same time it expresses that the param is optional

tardy delta
#

its first value is null and its set in the loophttps://paste.md-5.net/upunamezot.cs

quiet ice
#

The Optional class is nice if you wish to pass nullable stuff in the ConcurrentHashMap

tardy delta
ivory sleet
#

Myeah tho according to Java Optional should in principle only be used for returning types

quiet ice
echo basalt
#

then what's the fucking point

smoky oak
#

https://paste.md-5.net/atexekunit.cs
the return array has one entry in the first layer (im passing one material) and zero entries in the second layer. can someone tell me why? do i need to call .copy() ?

ivory sleet
#

Yeah its stupid

echo basalt
#

I'd understand for stuff that doesn't like null values yet you need to pass an empty variable

#

I guess it's just a gateway for java 8 methods

#

which I kinda despise given I started coding on java 6

#

lambdas are nice, but streams, mapping optionals and all those 1-line replacements for native functions are not

ivory sleet
#

Also its quite sad Java doesnโ€™t have any future plans to enhance control and safety regarding nullability

tardy delta
#

thats a lot of validations lol ๐Ÿค“

echo basalt
#

even then I find myself using anonymous classes a lot less often nowadays

#

I guess consumers are the only thing I still do anonymally

young knoll
#

Why you gotta do streams like that

echo basalt
#

Waste of performance and ends up taking more time to read

#

It's easier on the brain to understand a for loop

young knoll
#

Meh

echo basalt
#

Unless you're converting a set to a list or something

young knoll
#

I mostly use them at startup

iron glade
#

Good thing not every brain is the same

echo basalt
#

But then again the constructor serves that purpose

#

Why call 20 methods that abstract all your code when you can just write simple code

ivory sleet
#

When project valhalla finally delivers and when stream impl pipelines become intrinsic candidates its gonna be worthwhile to migrate entirely

echo basalt
#

I'd rather to a loop to check a list, than to stream it, filter, map, orelse

sharp flare
#

#getRelative checks are expensive right when done on every X ticks

#

Trying to convince someone to cache it instead

echo basalt
#

I advocate for simple code which is why I abstract a 100 line project into 49 different classes

ivory sleet
eternal night
#

I mean, depends

#

if you just filter and map, sure a for loop can still hold up

echo basalt
#

Streams also loop the entire collection which is pointless if you only care about 1 element

ivory sleet
#

Rarely the case a stream is more efficient apart from readability

echo basalt
#

Readability sometimes

eternal night
#

don't think anyone is claiming streams are a performance gain xD

ivory sleet
#

Fair

echo basalt
#

Big streams might be worth it

#

But small stuff is not

ivory sleet
#

Parallel ones Ig

eternal night
#

I mean, sorted, skip, take

#

those are my usual reasons why I move to a stream

#

map also just feels nice

ivory sleet
#

flatMap ๐Ÿ˜ฎโ€๐Ÿ’จ

#

Just do be waiting for valhalla

eternal night
#

same

#

tho not really for streams ๐Ÿ˜‚

ivory sleet
#

Hehe

eternal night
#

I just wanna allocate my vectors on stack

#

thank you very much

echo basalt
#

I just hate those people who abuse java8 features

#

I saw some code at a job

ivory sleet
echo basalt
#

that went something like

public boolean isFull(Team team) {
  return Optional.ofNullable(teamPlayers.get(team)).map(l -> l.size() >= team.getMaxSize()).orElse(false);
}
#

and I'm like

#

wtf

ivory sleet
#

Lol

eternal night
#

look at sponge API xD

tardy delta
#

tf

echo basalt
#

so I rewrote it

#

and then rewrote it even further down to 1 simple line

#

but I had to change backend for that

#

even though my method is technically 5 lines

#

in practice 3

tardy delta
#

Map<Team, List<UUID>> uh oh?

echo basalt
#

it's much cleaner

echo basalt
#

each Team now has its own list

tardy delta
#

why not storing the members in the team?

echo basalt
#

instead of like 3 different collections

#

not my code

tardy delta
#

smh

echo basalt
#

but it was made by someone that sometimes frequents this channel

#

so now I hold a grudge

#

I'm paid to clean up code, not to make garbage

echo basalt
#

oh god I hate this code

#

not touching it

eternal night
#

Cool kids just teams.getOrDefault(team, Collections.emptyList()).size() <= team.getMaxSize()

echo basalt
#

but probably mudability

tardy delta
#

cool kids store the members in the team and use a hashset :(

echo basalt
tardy delta
#

^^

eternal night
#

yes xD

#

tho that requires a change in data structure

#

also fluent naming style ftw

tardy delta
#

how does team.getMaxSize() gets calculated?

eternal night
#

better be a constant

sacred mountain
#

ive tried a bunch of things and i cant seem to find an easy way to check if a player has put an item in a furnace slot

echo basalt
#

I believe it's a constructor param

tardy delta
#

team::isFull kekw

eternal night
#

default boolean isFull()

#

yes

sacred mountain
#

oh well gonna just furnaceextractevent

tardy delta
#

i hope team.getmembers returns a copy ๐Ÿ‘€

echo basalt
#

I'd need to add extra encapsulation for that

smoky oak
sacred mountain
#

yeah i figured that, but then i have to add data to the itemstack using pdc or something, but if the furnace already contains items that will cause issues, etc

smoky oak
#

how so

echo basalt
#

just add a string tag with UUID.randomUUID

#

makes it unstackable

sacred mountain
#

yeah thats not what i want

#

i'm trying to keep it vanilla as possible and oyu cant edit the data of individual items in a stack

echo basalt
#

or be stupid like me and client-side most of the data anyways

sacred mountain
#

unfortunately they all merge when u combine them in the inventory, or don't stack at all

echo basalt
#

client-side lore is so handy for stuff that has placeholders or configurable items

young knoll
#

Would it not be better to store the uuid as two longs in pdc

echo basalt
#

sure it saves like 63 bytes

sacred mountain
#

i use mfnalexs morepdc api

echo basalt
#

or some stupid negligent amount like that

young knoll
#

Perfect

sacred mountain
#

more persistentdatatypes

young knoll
#

My precious bytes

echo basalt
#

mans gonna have to buy more floppy disks

reef lagoon
young knoll
#

The only annoying thing about client side lore is creative mode breaking everything

echo basalt
#

easy fix

#

just remove the lore from the real item

#

and add into the fake item

tardy delta
#

ij assumes some stupid contracts smh

echo basalt
#

that's literally how it works

smoky oak
#

@echo basalt lemme dumb it down then
ArrayList<ArrayList<Object>> list1
ArrayList<Object> list2
...
list2.add(new ItemStack)
list1.add(list2)
list2.clear()

my question is, does list2.get(0).size() return 0 in this case, and if yes, would it be fixed by doing list1.add(list2.clone())

echo basalt
#

mutable ye

young knoll
#

The real item wouldnโ€™t even have the lore if creative wasnโ€™t wack

echo basalt
#

deal with it

young knoll
#

No :(

young knoll
#

Iโ€™m suing Mojangsoft

echo basalt
#

just crank up Akon's Smack That and get coding

sacred mountain
#

well i guess it works now

young knoll
#

Ooh quest system

sacred mountain
#

theres a lot more as well

tardy delta
#

poor rewards :(

sacred mountain
#

got these to do

young knoll
#

Iโ€™ve wanted to make one of them for a while, but I could just never wrap my head around the logic it would need

sacred mountain
#

the last one is gonna be a sheep fricker because im so mature

tardy delta
#

same, i only managed to make skills

sacred mountain
#

its gonna be pain to program tho

young knoll
#

Brain too smooth for quest

echo basalt
#

I tried making quests

sacred mountain
#

lmfao

echo basalt
#

the backend is hell

#

I made an objective system once and that was hell

#

implementing all objectives at once tho

smoky oak
#

i mean

sacred mountain
#

progress so far but i need suggestions bc my brain is getting smoother

echo basalt
#

but then again quests might actually be easier

smoky oak
#

i set a array list that had a object

echo basalt
#

given I last tried uhh

#

4 years ago?

sacred mountain
#

lmfao

#

before i even started probably

reef lagoon
echo basalt
#

around june 2018

ivory sleet
#

Yes @smoky oak

sacred mountain
#

the backend isnt too bad tho

echo basalt
#

proof

reef lagoon
#

lame

ivory sleet
#

And yes clone would fix it

reef lagoon
#

do it softcoded

smoky oak
#

k thx

sacred mountain
#

thats it

echo basalt
#

oh god where are your listeners

sacred mountain
#

can create quest like this

sacred mountain
#

theyre quite simple tbh

young knoll
#

The heck would the database entry for that be

ivory sleet
reef lagoon
#

o that's cool

young knoll
#

Player, QuestID, ObjectiveID, progress?

#

Idk

reef lagoon
#

wtf is this lol?

sacred mountain
#

i forgot itemstacks

#

have a builtin amount

drowsy helm
#

if a player has an inventory opened and is dced does InventoryCloseEvent get called?

sacred mountain
#

so i added my own, ill remove that at some poit

#

itemreward class has 4 constructors for different item types: my server custom item, itemstack, material (which is where the amount thing came from), and a banknote item from anotherp lugin i made

reef lagoon
#

seems pointless tho

#

why not just the itemstack

ivory sleet
#

Yes @drowsy helm

twilit roost
#

how to make FallingBlock fall slower?

echo basalt
#

oh hell naw fallingblocks are pain

#

I'd rather make them clientsided than to use the api

drowsy helm
#

too easy, thanks

twilit roost
sacred mountain
#

has to be registered by the server, not just have the meta/pdc data

smoky oak
#

@ivory sleet why's ArrayList#clone() returning Object?

sacred mountain
#

just so players dont fuck with it

echo basalt
#

that's java

#

just do new ArrayList<>(list)

ivory sleet
#

But yeah you can use what Im said

echo basalt
#

Java's Object#clone return object

#

so

#

either that or you clone the list

ivory sleet
#

Yeah altho you should be able to override the type

echo basalt
#

uh not really no

ivory sleet
#

I mean yes

reef lagoon
#

Damn I should learn basic oop

echo basalt
#

mismatched type

#

since the super class defined the method, you can't do much

ivory sleet
#

Cloneable -> Object so any derivatives of Cloneable can return any subtype of Object

echo basalt
#

hm maybe yeah

ivory sleet
#

which iirc for instance bukkit does

boreal seal
#

guys

echo basalt
#

would make some sense

boreal seal
#

intelliJ

#

wtf this is

echo basalt
#

press insert

boreal seal
#

insert?

ivory sleet
#

^

twilit roost
echo basalt
#

numpad 0

smoky oak
#

the keyboard key

#

its a typing mode you set

boreal seal
#

thanks

sacred mountain
#

i used to rage whenever that happened

smoky oak
#

it makes you override instead of instert text

#

like

sacred mountain
#

yeah i thought intellij was bugged

echo basalt
#

I used to restart intellij whenever

sacred mountain
#

LMAO Smae

smoky oak
#

a|bc pressing d normally does abd|c

twilit roost
boreal seal
#

thanks alot lmao

echo basalt
#

idfk

smoky oak
#

in this mode it does ad|c

echo basalt
#

do your thing

#

add slow falling potion effect

twilit roost
echo basalt
#

add counter velocity

twilit roost
echo basalt
#

override the nms class and empty the move method

twilit roost
#

entity.getType()?

#

if(entity.getType()==EntityType.Zombie)

tardy delta
#

why should instanceof give issues?

echo basalt
#

I prefer instanceof

#

it's null safe

tardy delta
#

arent they extending some entity class then?

echo basalt
#

they are extending the nms entity yeah

#

but getEntityType would still return the bukkit type

#

so it's irrelevant

tardy delta
#

and nms implement api so should be safe ig

icy beacon
#

why does intellij give me this warning even if it's 100% not null?

smoky oak
#

idk

#

just ignore warns

#

lol

tardy delta
#

Bukkit.getPlayer is declared as @smoky tinsel

icy beacon
#

this happens all the time

#

kinda annoying

echo basalt
#

because getPlayer might return a different value the second time you call it

icy beacon
#

but it's suuuuch an edge case

tardy delta
#

also use Bukkit.getPlayerExact

icy beacon
#

why so?

tardy delta
#

Bukkit.getPlayer("fourteen") will return player with name fourteenbrush too

icy beacon
#

i'm using a uuid for this method, and getPlayerExact only accepts strings

tardy delta
#

ah thats an uuid

icy beacon
#

yeah

echo basalt
#

weird naming

icy beacon
#

true

tardy delta
#

didnt even see you checked != null lmao

icy beacon
#

xD

tardy delta
#

dont call it twice anyway

echo basalt
#

rename it to reporterId

tardy delta
#

and resolvedDate isnt a Date ๐Ÿค“

icy beacon
icy beacon
icy beacon
echo basalt
#

I just prefer to be safe with my naming

#

playerName, playerId

icy beacon
#

you do have a point though

#

maybe i will rename it

echo basalt
#

I just realized I've had my AC on while my window was open for the past 2 hours

icy beacon
#

yeah i'll rename it to reporterUUID thx

echo basalt
#

double the power bill

tardy delta
icy beacon
#

ah yes

echo basalt
#

fuck I accidentally punched my desk

echo basalt
#

almost jammed my finger too

icy beacon
#

what the fuck is going on

#

i was typing like 30 minutes ago and suddenly shoved my ring finger into the keyboard

#

i don't even know how that happened

#

but i ripped off the delete button

echo basalt
#

speaking of typing

#

today I learned that I can do like 130wpm with my keyboard now that I got used to it

icy beacon
#

๐Ÿ˜ฎ

echo basalt
#

I usually do like 90-100 with other keyboards

icy beacon
#

that's quite sick

echo basalt
#

I guess low-profile keyboards are fast for typing

icy beacon
tardy delta
#

laptop keyboard ๐Ÿค“

#

love my setup

echo basalt
#

yeah mine is like a laptop keyboard

icy beacon
#

oof

echo basalt
#

mx keys

#

even paid 20$ for the wrist rest

smoky oak
#

okay i know i asked this before but should i pass my javaplugin instance to every class or make a static field in the main class to access it

echo basalt
#

so you're asking

#

dependency injection vs singleton

#

well

#

dependency injection ofc

tardy delta
#

Hot setup

echo basalt
#

I haven't used a singleton for the past like 2 years

tardy delta
#

i hate small screens meh

#

atleast its a lil bigger than my 13 or 14 inch laptop now

echo basalt
#

my new monitor might arrive today honestly

wet breach
tardy delta
#

hehe i stole my moms monitor for her work

echo basalt
#

let me just

#

prepare the setup real quick

smoky oak
wet breach
icy beacon
#

is there a good non-file-based way to retrieve persistent data from offline players? for online players i'd use pdc, but from what i know, pdc for offline players returns null

tardy delta
#

its pixel sharpness or whatever thats called sucks bruh

eternal night
#

offline players don't have PDC yet

tardy delta
#

nearly a lil blurry

icy beacon
eternal night
#

if you wanna access data for offline players

#

don't store your data in the PDC

#

you are using the wrong tool for the job

icy beacon
#

that's... why i'm asking.

eternal night
#

oh

#

I mean, DB ?

icy beacon
#

overkill

eternal night
#

any SQL or nonsql

wet breach
#

Depends what information you are needing

eternal night
#

sqlite

#

h2

tardy delta
#

loading player files on your own ๐Ÿค“

icy beacon
#

just a couple booleans lol

tardy delta
#

yaml

icy beacon
eternal night
#

wtf do you mean "none file based" xD

wet breach
icy beacon
#

i can do files but i'm too lazy for that

tardy delta
#

db is file based too lol

eternal night
#

you are persisting data

tardy delta
#

everything is files

eternal night
#

persisting something is done through files

icy beacon
shadow zinc
#

just use a pastebin

tardy delta
icy beacon
#

when a report is resolved, the player associated with it should get a message. but if the player is not online, i need to remember that player and then send the message when they get online

eternal night
#

carve it into wood ๐Ÿ™

echo basalt
shadow zinc
#

paint it on the walls

icy beacon
#

so my thought was to use pdc and add a boolean/string/whatever and check for it on join, but offline players don't have pdc

tardy delta
#

dang

echo basalt
#

my favorite part is the mousepad

tardy delta
#

minecraft fan

icy beacon
eternal night
#

I mean, where are your reports persisted o.O

echo basalt
#

monitor at the left is getting replaced like tomorrow

eternal night
#

just persist that there ?

wet breach
echo basalt
#

or today idk

icy beacon
#

yamlconfiguration with all reports

eternal night
#

doesn't world have PDC too

tardy delta
#

1 i got no place for three screens on this table
2 i could go sit in my bedroom but theres no wifi there lmfao

eternal night
#

or is that a paper thing

icy beacon
#

yeah chunks have it

echo basalt
wet breach
icy beacon
#

that's kinda hacky, no?

eternal night
#

I said world

#

not chunks

echo basalt
#

my main fiber gateway is at my living room

tardy delta
eternal night
#

indeed world is also a persistent data holder

echo basalt
#

then I have a connection through the walls into my room

#

that goes into a wireless access point / switch

eternal night
#

which, I'd argue should be used instead of the spawn chunks

echo basalt
#

that goes into my pc

tardy delta
#

wifi upstairs sucks so hard

echo basalt
#

that way I can play clash of clans

#

on my room

#

with 5 bars

wet breach
tardy delta
#

coc man

eternal night
#

spawn chunks can change ?

#

they certainly could go away lol

echo basalt
#

only thing I need now is a cellular repeater because I get like 3G on my room

icy beacon
#

honestly i'm just thinking of giving up and making a file where

resolvedReportIds:
  - 205
  - 207

so that the player will later get online, and the reports will get fetched by those ids (the reports already have ids so that's not new)

echo basalt
#

I get like 150mbps 4G+ at the store and only like 10kbps on my room

echo basalt
smoky oak
#

db

wet breach
icy beacon
#

easy food access and fast internet

wet breach
#

which makes your point moot

echo basalt
#

easy food access
bold of you to assume I buy food

eternal night
#

maybe, in the end, storing stuff in a PDC is stupid if you need it persistent globally

echo basalt
#

instead of ordering food every single day

icy beacon
eternal night
#

maybe suggesting PDC usage for something like this in the first place was a not smart idea

#

lol

echo basalt
icy beacon
#

uhhh

wet breach
#

regardless of which is used, whether it is the world pdc or the spawn chunk pdc you will need to regularly prune the pdc

echo basalt
#

basically make your own bootleg sql

wet breach
#

the only other way I can think of, is to make use of custom achievements

eternal night
#

I mean yea

#

but the requirement of "no additional storage" just

#

why

echo basalt
#

idk I hate yml for database

#

takes too long to open once you actually have a decent scale

wet breach
wet breach
echo basalt
#

custom file

twilit roost
#

fallingblocks are invisible when falling?

wet breach
#

more like opaque

echo basalt
#

fallingblocks are janky

#

I hate em

#

I made a throwing blocks feature for a youtuber

#

and it took me like 10 hours

#

just to get something that doesn't despawn after 2 seconds

#

Just listen to System.err

tardy delta
#

nailed me

tardy delta
#

hope that means what i think it means

sacred mountain
crisp steeple
#

that wonโ€™t work because exceptions already get handled by bukkit

sacred mountain
#

timedeo big fan

#

(fr)

ashen quest
#

whats the most effecient way to store xyz, i want to make it as minimally space taking as it can be

agile anvil
ashen quest
#

i dont want doubles, ints work

round elbow
#

hello, I downloaded and run buildtools and i now have the Spigot 1.19.2 project
I did what is said in readme.md and compiled it using mvn install
I got two jars
one with the api and one with the spigot + nms without the api
how can i have both in one jar
Image
i added them to a project of mine and they work properly as long as i do both, is there a way i can combine them?

ashen quest
#

ints is 4 bytes iirc?

agile anvil
#

If you're xyz don't need 8 bytes each, you can stretch down the bytes arrays and only use the number of bytes you need for each, and create a separator byte

agile anvil
ashen quest
#

so ill just store a 3x4 int array?

#

whats the thing with bitwize i remember someone saying

#

like u could do smth with the ints to make em into one or someshit i dont remember

agile anvil
#

Easiest way is to store 3 x 4 bytes arrays

#

But you can make it shorter

#

for instance 1 byte can store 256 possibilities

grim ice
#

anyone knows of some complicated topic worth learning?

#

something related to cs tho

eternal night
#

how did your deep dive into neural networks go xD

grim ice
#

it wasnt that deep

#

but i got it

agile anvil
#

And CS you mean theory ? or pratic also count?

grim ice
#

both

eternal night
#

I'd always suggest going into hardware a bit

#

always pretty good to know at least the basics

grim ice
#

e.g how pieces work?

ashen quest
ashen quest
ashen quest
#

try making a hand controlling thing, where your hand uses a glove with a gyrometer to control your pc

#

with gestures and stuff

grim ice
#

tf

ashen quest
#

i did it and its so cool i (made it in my class) i showed it to my class and i felt like the god that day

#

my crush was like just surprised (she is my gf now ๐Ÿ˜Ž idk how a nerd like me got one)

eternal night
#

get a nice micro processor kit

#

build your own clock

#

and pipe some bits around

#

thats fun

grim ice
#

u have to buy 50% of what ur doing here

ashen quest
#

it has a ton of cpp

#

or whatever clone of cpp arduino uses

grim ice
#

a gyrometer and an arduino

#

hm

agile anvil
#

I recently read a lot about nanotechnology, how is a sensor made, how works a cpu. Worth the time, and you can enlarge your research to how it is going to improve, why are SoC more and more common, and more

#

Or I also had a great time learning about Quantum Computing, Quantum cryptography

#

hf

grim ice
#

alr ty

agile anvil
#

You mean the screen effect of an elder guardian going from top to bottom screen ?

#

Well I guess it's that sound, the name makes sense

#

didn't you try?

worldly ingot
#

That's the sound, yes

hasty prawn
#

The wiki probably

#

Or Choco he's a good source too

grim ice
#

uh actually

#

i have a question

#

i wanna make a macro recorder and player

#

i thought about making a frame data class, and on every frame, i capture the mouse, position the keyboard button clicked and the mouse button clicked

#

then adding it to a class

#

which implements List

#

something like

#

FramePackage

tight tundra
#

One message removed from a suspended account.

grim ice
#

it contains all the frames in the last 1 second

#

then that class, i add to a list

tight tundra
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

glossy venture
#

pretty sure blockplaceevent is called before you get to set the text

tight tundra
#

One message removed from a suspended account.

glossy venture
#

and otherwise the sign text might be sent after the block place

tight tundra
#

One message removed from a suspended account.

#

One message removed from a suspended account.

glossy venture
#

idk listen to sign text event

#

yeah think so

tight tundra
#

One message removed from a suspended account.

hasty prawn
#

SignChangeEvent

wet breach
#

by not having them to begin with

#

not sure what exactly you are doing, but should be careful with zips in java otherwise you might accidentally introduce a zip exploit via your plugin. But it sounds like you are doing something either out of order, or you are not checking if the file handle is still valid

#

is it too large for discord?

#

there is a file size limit

#

if a zip file isn't being used then you wouldn't be getting zip file closed errors

agile anvil
#

Zip file closed error usually appears when your software doesn't have the correct writing/reading/executing permissions

wet breach
tight tundra
#

One message removed from a suspended account.

wet breach
#

you will typically get I/O errors or exceptions if its a permission problem

young knoll
tardy delta
#

smh

tight tundra
young knoll
#

Also the only time I get zip file closed errors is when messing around and reloading plugins at runtime

#

Via /reload or plugman or whatnot

tight tundra
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

agile anvil
#

&

#

Between the placement of the item in the craft and the result display

tight tundra
#

One message removed from a suspended account.

#

One message removed from a suspended account.

agile anvil
tight tundra
agile anvil
#

I don't understand yours x)

tight tundra
#

One message removed from a suspended account.

agile anvil
#

You'll have to test but my guess is that it is fired even if there is no existing result

agile anvil
tardy delta
agile anvil
#

so do '&' not "&"

tight tundra
#

One message removed from a suspended account.

#

One message removed from a suspended account.

agile anvil
#

Using bukkit tasks

glad prawn
#

Any method to get all sheep colors?.

agile anvil
tardy delta
#

runTaskTimer

agile anvil
#

You'll want to use Repeating Task

#

?scheduling

undone axleBOT
agile anvil
#

Wait

#

Loop over what ?

#

No

#

Loop over what ? x)

#

Explain the feature you want step by step

iron glade
#

Is there a reason you need to loop

#

do you have multiple items

agile anvil
#

So you want to loop all player's items and if one has the pdc do something ?

iron glade
#

What have you done with those items already? Are they in a GUI or smth?

#

sure

agile anvil
#

How can they get this kind of item?

#

Is it given through a command? Is it an item they can pickup? ... ?

safe hatch
#

How can I put a custom skull into an inventory with for example an arrow to the left or to the right

safe hatch
#

ok, thanks

sterile token
#

Random question is posible to recreate spigot without using minecraft-sever?

agile anvil
#

Yes

#

You just have to follow the exact same minecraft protocol

sterile token
#

Oh ok

agile anvil
sterile token
#

I ask because if you recreate it you wont have mojang copyleft issues

#

Or yes!

#

Can u confirm it please

agile anvil
#

Mhhh, I'm not sure. I'm not familiar with US laws sorry

sterile token
#

Oh ok

#

Because mojang doesnt allow to redistribute their code and if you are creating your own server side you are not using their code in theory

agile anvil
#

That's right

#

But you're still using their protocol

#

idk if it's considered in the copyrights

sterile token
#

They cannot i think

eternal night
#

look at the glowstone project lmao

#

that is literally what they are doing

vocal cloud
#

Isn't there also minestom

eternal night
#

there is a million server implementations out there

#

more or less developed

#

minestorm mostly focuses on barebone so you can reduce the server to as little as you need

sterile token
#

Hey

wet breach
# agile anvil But you're still using their protocol

Protocols can be copyrighted, however that doesn't prevent their use if you implement the protocol yourself. Think of it more like a specification more then anything. You can't create a copy of their protocol for whatever else, but you can freely implement it as long as it is used as intended. Lets also not forget the fact that the MC protocol is built on top of TCP and UDP protocols which mojang doesn't own the rights to ๐Ÿ˜›

sterile token
#

So if you dont use minecraft sever package they cannot apply law right?

#

Because you are not using their source codes

wet breach
#

it depends

sterile token
#

How they would apply law by a sever package made by your self or team

#

๐Ÿ˜‚

wet breach
#

you can't copy their code. This is why clean room implementation is a thing

#

just because you coded it yourself, doesn't mean you didn't copy

sterile token
#

You dont understand frost I mean

#

I saying that mojang cannot fuck you If you are just doing your own sever side implementation

wet breach
#

basically, you would need to make your own server code without ever looking at how mojang did it

#

second, you will still need to implement their authentication library as well

#

since that is part of DRM

agile anvil
#

Laws aren't True or False, there is always a way to put you down

river oracle
#

If you make it without ever looking at their code they can't really do anything to you

sterile token
#

Ok

#

Thanks to all

river oracle
#

I mean you might end up with similar concepts but in the end it's different

sterile token
#

I just want to know if they can fuck me up doing own sever side impl without seeing their code

#

Just following their protocol

agile anvil
#

I bet they won't even take a look at it

river oracle
#

Probably not unless it gets massive lol

sterile token
#

I wont do it

#

But maybe in a future after studied programming and being really skilled maybe I can give a try

#

Because i do that first thing I would make is implementing PMC (Plugin Messaging channel) without player connection

icy beacon
#

any non-deprecated way for this?

tardy delta
#

its deprecated cuz you should use Bukkit.getOfflinePlayer(UUID)

#

but you cant so its fine

icy beacon
#

alr

#

and i'm literally gonna get the uuid off of this reportee lol

agile anvil
tardy flame
# agile anvil Just as a warning

Yeah that's why you should first to try getting online player, if you don't get it you get with saved players in world file and if that doesn't work then no player

#

It doesn't require Mojang services at all

icy beacon
#

yeah i make sure that the player is not online, if they are online i just grab the uuid

tardy delta
tardy flame
#

Does it!?

icy beacon
#

oh that makes it even easier

tardy delta
#

yes looked at impl

tardy flame
#

That's cool

#

Idk why I have built a method for that before

#

Maybe it was changed

#

Or maybe I am an idiot

#

?cba

undone axleBOT
#

OpKarol#5694 definitely regrets to for the most part inform you that unfortunately, they essentially are unable to definitely assist with definitely your enquiry, which essentially is fairly significant. Please simply really ask again later or possibly kind of ask someone else about this enquiry, demonstrating that the person that ran this command generally regrets to kind of inform you that unfortunately, they for the most part are unable to generally assist with actually your enquiry in a subtle way. Thank you very sort of much for kind of your time and the person that ran this command specifically wishes you a really good day, so the person that ran this command really regrets to actually inform you that unfortunately, they literally are unable to definitely assist with very your enquiry, or so they particularly thought.

tardy delta
#

is there an efficient way i can apply a Supplier<String>... to a string, like String::formatted does?

#

stringbuilder ig

echo basalt
#

supplier returns a string?

tardy delta
#

ye

echo basalt
#

it doesn't run an action on it

tardy delta
#

nope

torpid sapphire
#

is there a way to show the durability bar on an unbreakable item?

echo basalt
tardy delta
#

basically same thing as the other method but i wanna use suppliers

echo basalt
#

uhhhh

#
String[] contents = new String[placeholders.length];

for(int index = 0; index < placeholders.length; index++)
  contents[index] = placeholders[index].get();

isNull(o, message, contents);
#

or if you like lambdas and all

tardy delta
#

this would work ig

#

String.format go brr

echo basalt
#
String[] contents = Stream.of(placeholders).map(Supplier::get).toArray(new String[0]);
river oracle
#

Java streams

#

Now that I know how to use it I use them everywhere lol

echo basalt
#

I hate em

river oracle
#

I actually like streams purely because they look better

echo basalt
#

and take 5x longer to compute

tardy delta
#

they re slower

vocal cloud
#

People who use them then pass in an atomic gunSelf

echo basalt
#

I actually made a PR to the terrible-plugin repo to use atomic everywhere lol

river oracle
#

Lpl

chrome beacon
torpid sapphire
#

so id have to implement my own unbreakable system by cancelling PlayerItemDamageEvent

#

or just not show the durability bar

#

also, can i somehow figure out the name of an item that the client shows? i want to add a prefix to the item name

agile anvil
#

Why do you want to show the durability bar ?

torpid sapphire
#

im implementing a tinkers construct type durability system, wanna make broken tools unbreakable but still show the bar to make it easier to see that theyre broken

agile anvil
icy beacon
#

the terrible-plugin repo is so good, i decided to clone it with intellij and it froze for like 20 minutes

tardy delta
#

sighs doubles..

#

is there a way to fix this?

#

Math.round?

torpid sapphire
hazy parrot
icy beacon
#

idk is it nullable? check the annotation

#

well if the getString javadoc doesn't say anything contrary then idk

#

one sec

#

If the String does not exist but a default value has been specified, this will return the default value. If the String does not exist and no default value was specified, this will return null.

#

saveDefaultConfig in onEnable

#

and just add the value like you'd do with a normal yml file in resources/config.yml

tardy delta
#

atleast my exceptions work

icy beacon
#

why are you forbidding multiple of the same operators

tardy delta
#

my loop stuff is a lil fucked up

waxen plinth
#

Can I see your code

tardy delta
#

i was only allowing <x operator y> in the beginning and i still have to change stuff

#

lemme do some push

icy beacon