#help-development

1 messages · Page 234 of 1

hybrid spoke
#

sure, but its not always just one single server

#

and they id rather have it somewhere centralized from the beginning instead of later have to fetch it

#

and maybe he wants to insert some sort of afk detection or stuff

wet breach
hybrid spoke
wet breach
#

and yes it would depend if they need it centralized however from experience usually rewards are per server

hybrid spoke
#

f.e. on a bungee system

wet breach
#

if the rewards is specifically for their game time on that server, using the statistic is ideal

#

since the server is already keeping track and storing that for you

small current
#

for some reason

#

EntityDamageByEntityEvent gets called when you damage citizens npcs

#

how can i detect if its a legit player without api and stuff

hazy parrot
#

I can't open docs rn, but you can probably check if getentity is instance of player

blissful topaz
#

I think instance of player would return true if the npc is a player npc

subtle folio
small current
#

it is

subtle folio
#

If not, all citizen npc's have a metadtat of npc attached to them I believe

hybrid spoke
blissful topaz
#

Maybe with event priority and ignoreCancelled you can achieve that

#

But yeah the metadata is a better option

small current
wet breach
#

why not just grab its uuid and check it for a player ?

wet breach
#

check the npc is instanceof Creature

#

since NPC extends creature

#

players don't

small current
eternal oxide
#

Citizens NPC's are ServerPlayers not NPCs

wet breach
eternal oxide
#

ServerPlayer is NMS

hybrid spoke
eternal oxide
#

^

sinful wave
#

How do I open an inventory that doesn't show the players inventory under it?

#

I've seen plugins do this before where it just opens an inventory GUI

hybrid spoke
#

not possible without extras

tardy delta
#

packets

#

nms

hybrid spoke
#

still not

#

would have to modify the client or trick around with mods or custom resource packs

sinful wave
#

so how do plugins do it

eternal oxide
#

plugins can't without a resource pack

sinful wave
#

but they can tho

eternal oxide
#

or client mod

tulip nimbus
#

Can they

subtle folio
tulip nimbus
#

Never seen a plugin like that

sinful wave
#

i have used spigot plugins in the past

#

lemme find one i swear

kind hatch
#

I don’t think they can even with a resource pack.

eternal oxide
#

with a resource pack you can fake it

sinful wave
#

what abt gui plugins

#

like deluxemenus and stuff

kind hatch
hybrid spoke
#

they dont do that

eternal oxide
sinful wave
#

huh

kind hatch
#

Ah

sinful wave
hybrid spoke
subtle folio
#

?/

sinful wave
#

wot

#

deluxemenus uses a resource pack?

hybrid spoke
#

"they dont do that" - "so how do they do it"

wet breach
#

you don't need any mods or resource packs for this

hybrid spoke
#

dont say now there is some sort of margin where you can push the players inventory out

wet breach
#

hide it

#

as in, remove their items

#

temporarily

tardy delta
#

dont let me think at css lol

hybrid spoke
#

thats not what he meant

tardy delta
#

my head is hurting

hybrid spoke
#

he want the players inventory to be gone

wet breach
#

maybe not, but you can treat the players inventory as the gui inventory in that way

#

and they wouldn't think it was their inventory

tulip nimbus
#

That’s just not a thing right

subtle folio
#

Right, with a big bar half way down?

tulip nimbus
#

I’m not tripping

hybrid spoke
#

i hate this kind of guis

#

i never look at my inventory when fucking with guis

sinful wave
#

that has guis

subtle folio
#

You have it's source code..

#

Look at how they do it?

kind hatch
#

That only makes the top half.

hybrid spoke
sinful wave
#

how would they remove the hotbar and stuff

#

and crafting menu and stuff

kind hatch
#

???

hybrid spoke
#

✨ they dont ✨

tulip nimbus
#

The crafting menu doesn’t show when you open a chest GUI

#

Afaik

subtle folio
hybrid spoke
#

yeah player and crafting etc. is gone

kind hatch
#

Unless you open your own inventory or an inventory that isn’t a chest, then you won’t see those GUI elements.

wet breach
#

as I said, they make it appear the player inventory disappeared

#

what really happens is it didn't the items in the players inventory were hidden instead

#

in this manner you would use the players inventory, the bottom portion as part of the GUI window which makes it look like it is all one inventory

sinful wave
#

but wouldnt there be a big bar in the middle

wet breach
#

sure, but the player doesn't know unless they are familiar with the intricacies themselves that it is still two separate inventories

kind hatch
#

Yes, you would need a resource pack to remove it, but you still wouldn’t be able to use that space because there aren’t any slots there.

sinful wave
#

imma check what deluxehub menu looks like one sec

hybrid spoke
kind hatch
tulip nimbus
sinful wave
#

ok i was basically wrong the whole time, it just does it normally

kind hatch
#

You can with a resource pack, but again, it’s purely cosmetic.

sinful wave
#

i guess i never noticed it befor

#

e

#

my bad]

wet breach
#

probably could use a custom resource that shifts the inventory to look like there is no space there

sinful wave
#

ill just do it by normally adding the inv

wet breach
#

but, that still wouldn't change that there is still 2 separate inventories but would make it less noticable with a custom resource pack

hybrid spoke
kind hatch
hybrid spoke
#

idk, would have to try

#

but it looked like one

fresh timber
#

I have a plugin on my server that I made that uses a SQL database and sometimes, it will disconnect because of inactivity. The error tells me the settings to change to fix this but I can't seem to figure out how to do this. Does anyone know where I need to change these settings?

hybrid spoke
fresh timber
#

;-;

flint coyote
#

Did you make the plugin or the server? If the plugin is yours the channel is correct

#

And since it would be weird to say "on my server that I made" when talking only about the server I suppose it's your plugin, isn't it?

tardy delta
#

or its not your plugin

fresh timber
#

I want the connection to stay up

#

it is my plugin

#

but it closes if noone is online

tardy delta
#

a connection pool like hikaricp could be useful

wet breach
#

fourteen beat me to it

tardy delta
#

2nd time

wet breach
#

changing that setting is not the appropriate way to solve it

tardy delta
#

better luck next time

fresh timber
#

;-;

wet breach
fresh timber
#

ok

flint coyote
#

Or make a dummy request every few minutes as a hacky workaround

fresh timber
#

it took me like 5 days to set up the sql on my plugin xd

sinful wave
#

How would I make a display name blank?

tardy delta
#

hikaricp needs like nearly no code to be used lol

sinful wave
#

just a space

#

of an item

tardy delta
#

" "

sinful wave
#

is that the blank unicode character

wet breach
tardy delta
#

uh no idea, id just try a space

sinful wave
#

okey

wet breach
#

unless you talking about the inventories still

sinful wave
#

im just talking abt an item for a filler in a men

#

like black stained glass

#

and it not having any name

flint coyote
wet breach
#

TCP sockets have a timeout and the max you could set it is 35655 seconds

rotund ravine
#

"heartbeats"

flint coyote
#

well 10 hours doesn't sound too bad :)

rotund ravine
wet breach
#

maybe not, but you would need to modify the tcp socket timeout on the server to make it work

#

otherwise the OS will force close it

rotund ravine
#

"timeout"

#

if it doesn't timeout it will be fine

flint coyote
#

Ya. Also making 10 dummy requests (or whatever many connections you have in the pool) every 10 minutes is no effort anyway

sinful wave
rotund ravine
rotund ravine
#

Like hide what

#

how what

#

do you want

wet breach
sinful wave
#

alright

wet breach
#

but if it was like an item on the ground, you could hide the name plate

flint coyote
wet breach
#

but you can't quite do the same in the inventory without some packet hacks

rotund ravine
flint coyote
#

Dummy is perfect as a placeholder for something reasonable

wet breach
flint coyote
#

like https://dummy

rotund ravine
wet breach
#

all tcp sockets have a hard limit set by the OS to stay open

rotund ravine
#

but still somewhat since gateways might drop them.

tardy delta
#

it says it depends on the context

#

it either client or server may crash its recommended

#

thats atleast what i understood

wet breach
#

not a single one mentions the OS cleaning up connections

#

because the OS's of today actually do

#

its not just routers and firewalls that do this

#

linux for example has a hard limit set depending which distro you use

rotund ravine
wet breach
#

because your definition of timeout isn't always used in the same context

rotund ravine
#

But it's used as a wait here as usually right?

wet breach
#

and it doesn't fix that, I just said the max you can set the limit on a TCP socket is that long

rotund ravine
#

but why does that relate to keeping the connection alive?

wet breach
#

Because eventually the OS will force close it

rotund ravine
#

So why the timeout in relation to keeping the connection alive?

wet breach
#

I am not sure what you are not understanding

#

I think your confusion is on the definition of timeout

#

when your definition isn't the same everywhere. OS's like windows and some linux distros have a hard limit in how long a tcp socket can remain open

#

regardless if there is activity or not, they will axe the connection if it hits that hard limit. In most cases you don't have anything running on windows that will come close to the limit to be noticed

#

some routers and firewalls will do the same too, and it isn't that they don't have the ability to keep them running forever rather their limitation when it comes to tracking since not everything is 64bit you know

#

32bits is still used in many places and has its limits especially when tracking connections lol

#

this is why you might notice your router, intermittently drop connections

#

and then within a few seconds continue like nothing happened

#

so yes, by the protocol standard a TCP socket can last forever which I am not saying it can't, I am stating it is the OS's that have limits in places

rough drift
#

--remapped is crashing with build tools

eternal oxide
#

your log showed it was finding no projects. perhaps your git is failing

rough drift
#

wdym?

eternal oxide
#

or you are not doing a full clean build, ie no folders

#

your log gets as far as searching for projects

rough drift
eternal oxide
#

that folder (I hope) is not on your desktop or in OneDrive

rough drift
#

yep

#

C:\Buildtools

wet breach
#

where is the log?

rough drift
#

wait

eternal oxide
#

he posted it a few hours ago

rough drift
#

.

#

java -jar BuildTools.jar --remapped --rev 1.19.2

#

I'll try it

#

Maybe smt changed idk

eternal oxide
#

oh perhaps your maven is at issue

rough drift
#

maybe

#

wait a sec

wet breach
#

or perhaps you need to build first

#

before you can use remapped

eternal oxide
#

nope

rough drift
#

it's downloading it's own maven

#

what

wet breach
#

because you don't have MAVEN_HOME set most likely

eternal oxide
wet breach
#

or don't have maven on the path

rough drift
#

mvn is on path

rough drift
#

but it ain't crashing

eternal oxide
#

be sure mvn will execute from the buildtools folder

rough drift
#

I installed mvn with choco, it downloaded its own from static.spigotmc.org or smt

wet breach
#

then odds are there is no MAVEN_HOME set

#

maven doesn't require installing

#

just need to ensure the bin directory is on the path and that environment variable is set

rough drift
#

it seems it downloaded its own maven though, I'll try setting MAVEN_HOME

wet breach
#

yes you have said that....

#

and I am telling you the most likely reason why

rough drift
#

k

#

oh

#

lmfao

#

set MAVEN_HOME to C:\ProgramData\chocolatey\lib\maven\apache-maven-3.8.6\bin

#

it still failed

eternal oxide
#

wierd place for your maven to be

rough drift
#

installed with chocolatey

#

a package manager

eternal oxide
#

at command prompt type mvn -version

rough drift
#
Apache Maven 4.0.0-alpha-1-SNAPSHOT (47e2d689d687358a85c2cdecc176cac36093817e)
Maven home: C:\ProgramData\chocolatey\lib\maven-snapshot\apache-maven
Java version: 19.0.1, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-19
Default locale: en_US, platform encoding: UTF-8
OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"
eternal oxide
#

needs \bin

wet breach
rough drift
#

I prefer to use a package manager

wet breach
#

why are you using an alpha version of maven?

rough drift
#

That's the latest version

#

I asked choco to upgrade to latest

#

because I was a couple versions behind

eternal oxide
#

I use 3.6.3

wet breach
#

that isn't latest version

#

latest version is 3.8.6

#

you are using an alpha version that isn't suitable really for production

river oracle
#

I use 3.6.3 as well

eternal oxide
#

yep, I only upgrade if I have a bug

#

not had any issues so I'm on 3.6.3 still

wet breach
#

I use 3.8.6

#

haven't had issues

eternal oxide
#

I'd suggest you downgrade your maven version to a non alpha

rough drift
#

wait

#

I think something happened

#

fixed the maven installation

#
Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63)
Maven home: C:\ProgramData\chocolatey\lib\maven\apache-maven-3.8.6
Java version: 19.0.1, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk-19
Default locale: en_US, platform encoding: UTF-8
OS name: "windows 11", version: "10.0", arch: "amd64", family: "windows"
#

doing a fresh buildtools run

#

And nope

#

it does not find my maven

#
C:\>echo %MAVEN_HOME%
C:\ProgramData\chocolatey\lib\maven-snapshot\apache-maven\bin
#

wait what

#

no

#

it's AH

#

Fixed that again

pine cipher
rough drift
#

shouldn't work for 1.8.9

pine cipher
#

oh so on what version minimum

rough drift
#

I don't know, though I do think these features are not <1.13

proper notch
#

think custom model data came in 1.14

pine cipher
#

ok. can someone explain how its working? like what i need to do to see it

rough drift
#

you need to make a texture pack

pine cipher
#

i have but like do i need to name smth or what like how it will know what is name of conatiner

rough drift
#

You should learn about texturepacks first

pine cipher
#

i know cus i making a lot i know optifine and .properties

#

bu ti dont know how this works

rough drift
#

learn vanilla texture packs

#

Well anyways

#

I don't need no remapping

eternal oxide
#

Does it build without --remapped ?

rough drift
#

yes

eternal oxide
#

that makes no sense then

wet breach
#

instead of the alpha version of maven

#

also they fixed their MAVEN_HOME variable

rough drift
#

frost is also built before

#

--remapped just crashes it

wet breach
#

on the stable version?

#

or are you still using that alpha version?

eternal oxide
rough drift
#

Buildtools always worked

#

--remapped killed it

#

now its just not remapping

wet breach
#

ok...doesn't answer my question

rough drift
#

I am using the stable version

#

3.8.6

wet breach
#

which version are you trying to compile for?

#

of MC that is

eternal oxide
#

can you get us a new bt log as your last one used teh bad home

#

C:\ProgramData\chocolatey\lib\maven-snapshot\apache-maven/bin/mvn.cmd which is wrong

wet breach
#

well its still correct if that is where their home is

#

windows doesn't care which way the slashes are

eternal oxide
#

yes his path is wrong

wet breach
#

well yeah that end part

eternal oxide
#

his maven is installed with teh version in its path

#

so that error is old, we need a new log

wet breach
#

but a new log would still help

rough drift
#

alright I'll send one in a second

remote swallow
#

twenty two minutes later

tardy delta
#

twenty six

humble tulip
#

28

rough drift
#

Nevermind

#

I just won't use mappings

eternal oxide
#

you should find the cause and fix it.

wet breach
rough drift
#

I guess

#

Rebuilding and sending log

fresh timber
#

I store all of the data on my plugin so far that I have needed to in a MySQL database. Now I want to save Minecraft inventories. Does anyone know how I can save a Minecraft inventory into my MySQL database or do I need to use a different storage method or what?

atomic swift
#

Tab complete args start @ 0 right?

fresh timber
#

why do you need to get the index of the args

tardy delta
#

i'd save inventories in binary or base64

remote swallow
#

Args.legnth is 1 args[] is 0

atomic swift
#

k

#

so use
switch (args.length) {
case 1:
}

fresh timber
#

binary??

#

that seems difficult

balmy valve
#

How would I be able to load a config with utf-8?

wet breach
atomic swift
#

ik dumb question lol

tardy delta
rough drift
tardy delta
#

YamlConfiguration.loadConfiguration(new InputStreamReader(plugin.getResource("file.txt"), "UTF-8")) lol

fresh timber
wet breach
rough drift
#

Still not remapped tho

#

It doesn't crash anymore

tardy delta
#

well i used to save player inventories like like

inventories:
  player1: "some long ass base64 string"
  player2: "some extra long base64 string"```
#

then just doing Inventory inv = serialize(config.getString("inventories.uuid"))

#

and wdym by would this save if the plugin is disabled/enabled

wet breach
# rough drift Still not remapped tho
[INFO] 
[INFO] --- specialsource-maven-plugin:1.2.4:remap (remap-members) @ spigot ---
[INFO] Replacing original artifact with remapped artifact.
[INFO] Replacing C:\Buildtools\Spigot\Spigot-Server\target\spigot-1.19.2-R0.1-SNAPSHOT.jar with C:\Buildtools\Spigot\Spigot-Server\target\spigot-1.19.2-R0.1-SNAPSHOT-remapped.jar
[INFO] 
[INFO] --- checksum-maven-plugin:1.11:artifacts (default) @ spigot ---
[INFO] 
[INFO] --- checksum-maven-plugin:1.11:dependencies (default) @ spigot ---
[INFO] 
[INFO] --- maven-assembly-plugin:3.3.0:single (default) @ spigot ---
[INFO] Reading assembly descriptor: C:\Buildtools\Spigot\Spigot-Server/src/assembly/bootstrap.xml
[INFO] Building jar: C:\Buildtools\Spigot\Spigot-Server\target\spigot-1.19.2-R0.1-SNAPSHOT-bootstrap.jar
[INFO] 
[INFO] --- specialsource-maven-plugin:1.2.4:remap (remap-obf) @ spigot ---
[INFO] Attaching remapped artifact.
[INFO] 
[INFO] --- specialsource-maven-plugin:1.2.4:remap (remap-mojang) @ spigot ---
[INFO] Attaching remapped artifact.
[INFO] 
#
[INFO] --- maven-install-plugin:2.4:install (default-install) @ spigot ---
[INFO] Installing C:\Buildtools\Spigot\Spigot-Server\target\spigot-1.19.2-R0.1-SNAPSHOT.jar to C:\Users\ike\.m2\repository\org\spigotmc\spigot\1.19.2-R0.1-SNAPSHOT\spigot-1.19.2-R0.1-SNAPSHOT.jar
[INFO] Installing C:\Buildtools\Spigot\Spigot-Server\dependency-reduced-pom.xml to C:\Users\ike\.m2\repository\org\spigotmc\spigot\1.19.2-R0.1-SNAPSHOT\spigot-1.19.2-R0.1-SNAPSHOT.pom
[INFO] Installing C:\Buildtools\Spigot\Spigot-Server\target\spigot-1.19.2-R0.1-SNAPSHOT-remapped-obf.jar to C:\Users\ike\.m2\repository\org\spigotmc\spigot\1.19.2-R0.1-SNAPSHOT\spigot-1.19.2-R0.1-SNAPSHOT-remapped-obf.jar
[INFO] Installing C:\Buildtools\Spigot\Spigot-Server\target\spigot-1.19.2-R0.1-SNAPSHOT-remapped-mojang.jar to C:\Users\ike\.m2\repository\org\spigotmc\spigot\1.19.2-R0.1-SNAPSHOT\spigot-1.19.2-R0.1-SNAPSHOT-remapped-mojang.jar
#

looks like it remapped to me

#

go check your local maven repo for the remapped jars @rough drift

#

but they should be in your buildtools directory under spigot

rough drift
#

they are there

#

Lets go

tardy delta
#

im wondering why i was using udp on a chat application lol

#

maybe thats why it was not working

twilit roost
#

Can I somehow make Walkable Falling Blocks?

wet breach
fresh timber
raw sky
#

I have a huge project, wheres the best place to store my players class (the kit type not a java class), shold I Just make a PlayerManager with a map?

fresh timber
#

also, I still dont understand how I can save invs and stuff

raw sky
fresh timber
#

bruh

#

;-;

#

im not getting the player's inventory

#

im saving extra inventories for storage

#

but separate ones for each player

#

and ones that don't disappear when the server restarts

rough drift
#

@wet breach IT WORKS

raw sky
#

ItemStack[] items = event.getInventory().getContents();`

#

@fresh timber ^

fresh timber
#

that is stored in ram and will disappear if you restart server

raw sky
fresh timber
#

yea I want to save it in my mysql database but I dont think it has that type of data

raw sky
wet breach
wet breach
#

or put them in a DB

#

personally I would just store them in the spawn chunk PDC

fresh timber
#

i hear pdc a lot I needa learn abt it xd

wet breach
#

?pdc

fresh timber
#

thx

twilit roost
gray merlin
#

I completely forgot what the documentation website was, could someone enlighten me?

wet breach
#

?jd

gray merlin
#

Thank you!

#

Oh, wait, not that one

tardy delta
fresh timber
#

yes but mysql doesnt have an inventory data type ;-;

tardy delta
#

dont save it into mysql

fresh timber
#

yes ik im trying to use pdc

wet breach
tardy delta
#

dont use pdc for that lol, just use a file

fresh timber
#

how

fresh timber
#

...

tardy delta
#

atleast hes not saving json in a database

#

i knew a dude

round finch
#

oh gulp sql

wet breach
#

serialize the inventory save it as a BLOB

#

BLOB = binary large object

tardy delta
#

why not just files aaa

wet breach
#

I was just saying if they really want mysql

fresh timber
#

how do I use files aa

tardy delta
#

💀

#

never used the config api?

wet breach
#

see what you done

#

now they are looking for file aa

fresh timber
vocal cloud
tardy delta
#

what

fresh timber
#

I dont need a config to change stuff

tardy delta
#
BukkitWiki

The Configuration API is a set of tools to help developers quickly parse and emit configuration files that are human readable and editable. Despite the name, the API can easily be used to store plugin data in addition to plugin configuration. Presently only YAML configurations can be used. The API however was designed to be extensible and allow ...

#

spigot one is poorly explained

gray merlin
round finch
#

yes agree confusion for starters

wet breach
#

that is like the only other thing I can think

#

wonder if the bot has a wiki link

#

?wiki

undone axleBOT
wet breach
#

welp it does

gray merlin
gray merlin
wet breach
#

well you now possess all the links for documentation

#

for spigot

gray merlin
#

I uninstalled Opera, which had all the links on it too...

wet breach
#

yeah wouldn't know what documentation site you would be referring to

#

for protocol stuff

#

then you have the now unofficial minecraft wiki

#

and then there is bukkit stuff over on the good old bukkit forums

gray merlin
#

Oh wait, I've recalled. They're the javadocs, I just wasn't recognising them because the sidebar tab wasn't showing

#

lol

wet breach
#

well you have the links for them above

round finch
#

how i excute stop being an lazy ass

#

?

gray merlin
#

coffee

wet breach
#

pay yourself

tardy delta
#

🤔

round finch
#

i want to start making stuff agein haha

tardy delta
#

can you pay myself? 👉👈

gray merlin
#

Actually there's a really interesting thing that I've read up about that recently;

#

It seems that there's a drunk soft spot for programming, which both takes off your laziness and improves your thought
Let me see if I can find it...

tardy delta
#

tf was i doing

round finch
#

wish there was a cure for add thb

gray merlin
#

Ah wait, it's just an xkcd

tardy delta
#

me casually throwing a bunch of code into a test project

round finch
#

Buts whole project into throw

#

lol

gray merlin
#

argh, does anyone know how to bring up this sidebar?

#

doesn't seem to appear in the latest website

round finch
#

i saw 1.7.10

#

lol

vocal cloud
#

Use the search bar

gray merlin
gray merlin
#

oh also hey there o/

round finch
#

b1.7.10 days

#

so much modding

#

❤️

#

i mean the start of it

gray merlin
#

1.7.10 was the golden age of minecraft tbh

round finch
#

the night design was better thb

vocal cloud
#

Hot take the combat kinda sucked

round finch
#

no it sucks

gray merlin
#

It does

#

The newest one is better

round finch
#

mojang too scared to make another combat update

vocal cloud
#

Got nothing to lose

round finch
#

MAYBE...

gray merlin
# gray merlin It does

But it's just like one of those old cartoons that are straight up garbage but you used to love back in the day

tardy delta
round finch
#

oh shet sql stuff

tardy delta
#

reflection hehe

#

attempted to wrote a whole reflective pojo mapper

#

but the reflection was too less flexible

rough drift
#

for the reobf on compile

#

org.spigotmc:1.19.2-R0.1-SNAPSHOT:remapped-mojang:jar was not found in https://repo.maven.apache.org/maven2

tardy delta
wet breach
rough drift
#

yeah

#

I don't know why its doing this

gray merlin
#

Does a boat/boatchest being placed fire an EntitySpawnEvent?

#

oh hello there! familiar namess

eternal oxide
#

in order

atomic swift
#

how can i check if a user is between 2 coords

tardy delta
#

math

atomic swift
#

i meth cant do

rough drift
#

theres literally no repo tag

#

probs a default maven

rotund ravine
#

You gotta build via the buildtools

#

my man

rough drift
#

I already used buildtools

#

I have had multiple hours of trying to figure out why it wasn't making the remapped jar

#

now it made it

rotund ravine
#

great

rough drift
#

I just need to figure out why it's not fuckin running the plugin

rotund ravine
#

hm?

rough drift
#

org.spigotmc:1.19.2-R0.1-SNAPSHOT:remapped-mojang:jar was not found in https://repo.maven.apache.org/maven2

rotund ravine
#

yes

#

show me your pom

rough drift
#

the rest is just project desc n stuff

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

rotund ravine
#

dahell is spigot.version

rough drift
#

Its a property I made

rotund ravine
#

?cba

undone axleBOT
#

Jan Tuck#0142 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.

rough drift
wet breach
rotund ravine
#

install the remapped jar then

rotund ravine
#

go look in the .m2 to see what sort of path you need then

rough drift
#

(well and the maven id stuff)

#

that file is missing group/artifact id, version, packaging, name and description keys

#

which I don't want to share

rotund ravine
#

@wet breach he's aying he copid off that website btw

wet breach
rotund ravine
#

true

rough drift
#

what?

rough drift
#

complete

#

copy pasted

rotund ravine
#

then it's dumb.

rough drift
#

from <properties> to </dependencies>

#

it's char by char the same

rotund ravine
#

We would love to see the whole thing to actually try to understand the issue. We are not trying to steal your shit.

rough drift
#

I know you are not, I do not want to share useless data

wet breach
rough drift
#

I know

#

so I gave you what I have

wet breach
rotund ravine
#

@rough drift no worries, we won't even look at the useless stuff. I've gotten so good to look only at important stuff that i simply disregard useless shit. And boy do i tell you that was a mistake when is started reading normal books.

wet breach
#

this is where a lot of problems occur

rough drift
#

last line is a newline

#

Was the extra data really useful @wet breach

wet breach
#

yes

rough drift
#

k

wet breach
# rough drift k

try setting maven compiler version to 3.10.1 and maven shade to version 3.4.1

rough drift
#

nope

#

not working

wet breach
#

do you get a new error?

rough drift
#

no

wet breach
#

what maven version is the IDE using?

rough drift
#

I don't really know how to check in intellij

#

one second

#

my path one

#

3.8.6

wet breach
#

hmmm

rough drift
wet breach
#

you are going to add this to your settings.xml file

#
      <repositories>
        <repository>
          <snapshots>
            <updatePolicy>never</updatePolicy>
          </snapshots>
        </repository>
      </repositories>
rough drift
#

my settings.xml is empty

#

do I need anything extra

wet breach
#

no

#

just add it in there somewhere

#

as long as its before the </settings> tag

#

lol

rough drift
#

yeah

#

k

#

Unrecognised tag: 'repositories'

#

did you mean pom.xml by any chance?

spark pagoda
tardy delta
#

me trying to make a webserver in java

rough drift
#

it did install @spark pagoda

spark pagoda
#

is it in .m2?

rough drift
#

yeah

spark pagoda
#

is the maven installation you have for chocolatey definitely looking at %USER_HOME%/.m2 for the local repository?

rough drift
#

yep

spark pagoda
#

does the spigot folder actually contain folders for each version with the jars inside them ?

rough drift
wet breach
spark pagoda
# wet breach no

when he said his settings.xml is empty he meant it is zero bytes

spark pagoda
rough drift
#
 <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
    <repositories>
        <repository>
          <snapshots>
            <updatePolicy>never</updatePolicy>
          </snapshots>
        </repository>
      </repositories>
</settings>
```copied the settings tag from <https://maven.apache.org/settings.html>
wet breach
#

surround the repositories tag with

#

<profiles> </profiles>

rough drift
#

oh

wet breach
#

that was my bad for missing that lol

rough drift
#

it's fine lol

#

I didn't even know you could do that

spark pagoda
# rough drift

can you open the terminal in IDEA and run mvn help:effective-settings by pressing Ctrl + Enter (the command should turn green)

#

if all is right this should print the actual settings the IDE's installation of maven is using

rough drift
#

ctrl + enter does nothing

wet breach
#

even explains all the options 🙂

rough drift
#
Effective user-specific configuration settings:

<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== -->
<!--                                                                        -->
<!-- Generated by Maven Help Plugin                                         -->
<!-- See: https://maven.apache.org/plugins/maven-help-plugin/               -->
<!--                                                                        -->
<!-- ====================================================================== -->
<!-- ====================================================================== -->
<!--                                                                        -->
<!-- Effective Settings for 'ike' on 'DESKTOP-J3ME3SJ'                    -->
<!--                                                                        -->
<!-- ====================================================================== -->
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 http://maven.apache.org/xsd/settings-1.2.0.xsd">
  <localRepository>C:\Users\ike\.m2\repository</localRepository>
  <mirrors>
    <mirror>
      <mirrorOf>external:http:*</mirrorOf>
      <name>Pseudo repository to mirror external repositories initially using HTTP.</name>
      <url>http://0.0.0.0/</url>
      <blocked>true</blocked>
      <id>maven-default-http-blocker</id>
    </mirror>
  </mirrors>
  <pluginGroups>
    <pluginGroup>org.apache.maven.plugins</pluginGroup>
    <pluginGroup>org.codehaus.mojo</pluginGroup>
  </pluginGroups>
</settings>
spark pagoda
#

okay, so instead of the terminal we're going to use the IDE's maven tab on the right side

#

at the top of the maven tab there should be a Run Maven Goal button

rough drift
#

yeah I did that

#

dw

spark pagoda
#

ok :)

#

the classifier is the bit that worries me then

#

you could try running the build as a maven goal with debug output enabled (-X iirc) and see where it's actually looking for the jar

#

this will generate a lot of output and i'm not entirely sure it's okay to share all of it on discord

rough drift
#

yeah

spark pagoda
#

but the error is caused by it not finding the jar in any of the defined repositories, not just the one it shouts at you about

#

maven is cool and well-made like that

rough drift
#

org.spigotmc:1.19.2-R0.1-SNAPSHOT:remapped-mojang:jar was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced this is the full one btw, forgor to send the rest of it lmfao

wet breach
rough drift
#

I tried using -U and it still didn't work, if I remember correctly -U forces updates

spark pagoda
#

that's why frostalf is telling you to add the snapshot dependency update policy to your settings.xml

wet breach
#

I am basically trying to force maven to not look at central

#

not really sure why it wants to even though we know the jar is in the local repo

spark pagoda
#

my guess is that it actually can't find the jar with the classifier in the local repository and it's just shouting at you about central because maven's errors are stupid

eternal oxide
#

it should not fail when it doesn;t find it in teh maven repo, it should press on and search local too

spark pagoda
#

and it probably does and just doesn't Tell you

#

ike, have you already tried completely deleting the repository folder in .m2 and re-running buildtools?

wet breach
rough drift
#

I'll try

spark pagoda
#

you should also probably just get rid of IDEA for the moment

#

run maven in the command-line directly

#

this way you know exactly which installation of maven is being used and you also know that IDEA isn't sitting there fucking things up for the joy of it

wet breach
#

lol

rough drift
#

re running bt

spark pagoda
#

depending on the speed of your internet and processor see you 2023 Q3 maybe?

wet breach
#

it should be fairly quick

rough drift
#

i7 babiiiiiiiiiiii

spark pagoda
#

if you've deleted the local repository it'll have plenty of fun re-downloading the entire dependency graph before compiling

rough drift
#

um

#

it build failure

spark pagoda
#

what's the failure

sonic goblet
#

Have you considered your IDE might be infested with a demon 😳

wet breach
#

need to set a delay

rough drift
#

Cleaned out all caches and redoing it

spark pagoda
#

well that's because your timers look like this:

discord: |   |   |   |   |   |   |   |
sandbox: |        |        |        |
#

sandbox has a bigger delay but it'll send at the same time sometimes because they're not in sync

#

what you want is more like

discord: |   |   |   |   |
sandbox:   |   |   |   | 
#

give them the same period (660L) and then give sandbox a delay of 330L

#

also this is a really bad way to do it btw

#

you should make a constant list with each of your broadcasts and then make a counter that goes up by 1 every time you want to send one and just send the broadcast specified by that counter

#

and of course reset the counter back to 0 after it's gone through all of them

#

me neither :D

spark pagoda
#

when it works it's amazing it's just that when it doesn't it breaks with undefined behaviour and confusing errors

rough drift
#

@spark pagoda Cleared maven cache, re ran buildtools

#

and it still doesn't work

spark pagoda
#

what does mvn verify (running in command prompt, with IDEA closed) say?

rough drift
#

Error creating remapped jar: org.spigotmc:1.19.2-R0.1-SNAPSHOT:remapped-mojang:jar was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced

spark pagoda
#

well that looks like the local repository hasn't been deleted

rough drift
#

I deleted everything tho

spark pagoda
#

here's what i'd do
0. Close IDEA

  1. Delete %USER_HOME%/.m2
  2. Run BuildTools
  3. Go to the project directory in Command Prompt
  4. Run mvn verify -X
  5. Investigate the inevitable failure
#

oh true, it could be that the failure is actually cached outside repository/

spark pagoda
#

that means either your classifier is wrong or buildtools is not installing the remapped jar

#

oh right i did actually come here to ask a question

#

is it always safe to assume that reference-equality always holds for two Player objects that represent the same actual player?

rough drift
#

yeah

spark pagoda
#

i.e. can I safely use playerOne == playerTwo

rough drift
#

should be

spark pagoda
#

yay :)

rough drift
#

player objects are never deleted

#

so if it is the same player then the check will always be true

#

yes

#

that's checking if its quite literally the same instance

#

not equality

#

its two different things zack

spark pagoda
#

does the run-time class of a player actually implement equals()?

#

ah, looks like it does

rough drift
#

you can check UUID

rotund ravine
spark pagoda
#

it does an UUID check AND an entity ID check

rotund ravine
#

a player will always be the same player or I am like super dumb

rough drift
#

you are right

wet breach
#

this doesn't work for player objects

rough drift
#

a player instance is always the same

wet breach
#

a player object obtained earlier can be different later

rough drift
#

works for worlds too

wet breach
#

content wise

rotund ravine
#

Cause iam like 99% sure it won't as it will just be mutable

rough drift
#

world1 == world2 works

#

same for players

wet breach
rough drift
#

and other things like that

rotund ravine
#

@wet breach it's mutable

#

so it changes for said player, but you only are given one player object across the board.

spark pagoda
wet breach
#

an object obtained earlier doesn't necessarily mean it will equal the same object later if you obtain that object again

rotund ravine
#

A player should always return the same player.

#

As far as i am aware.

spark pagoda
#

well yes but does reference equality hold for the same actual player

wet breach
rotund ravine
#

yes as far as i know.

#

I don't cache players unless i use a weakhashmap

wet breach
#

ok, that isn't the point

#

a cached player object from the past, will not always equal a player object obtained in the future

rotund ravine
#

Why not

#

As i said a player object just returns the mutable player.

wet breach
#

because its cached

#

it doesn't magically update

rotund ravine
#

It's mutable

#

not immutable

wet breach
#

it doesn't magically update

rotund ravine
#

It will since it's mutable

wet breach
#

it won't

rotund ravine
#

Are you not aware of mutable object like at all?

spark pagoda
#

it updates magically if the memory address is the same obviously

wet breach
#

are you not aware of how caching works

rotund ravine
#

^^

#

Are you not?

#

How would you even cache a player

#

you would have to clone each field and create a new player object.

spark pagoda
sonic goblet
#

Y’all got me gigglin ngl lol

wet breach
spark pagoda
#

well i'm not asking whether they'll be equal

rotund ravine
spark pagoda
#

im asking if they will have the same memory address

rough drift
#

Still doesn't work after wiping .m2 out and re-builtooling thing

rough drift
#

Bukkit.getPlayer("IkeVodooo") == Bukkit.getPlayer("IkeVodooo"); // true

rotund ravine
wet breach
rough drift
#

frost

rotund ravine
rough drift
#

the only way that is possible

#

if you hold a reference to a player that has quit

#

like

rotund ravine
#

^^

#

WeakHashMap ftw

rough drift
#
Player ikeQuit;
Player ikeOn;

ikeQuit == ikeOn; // false
wet breach
rotund ravine
#

It is

#

Show me a different way and i'll acknowledge your misinformation

tardy delta
#

whats this about 👀

rotund ravine
tardy delta
#

no u

wet breach
#

if you want to choose to not believe it, that is up to you

rotund ravine
#

I won't since it's unrealistic.

#

It's a mutable object that will be a single instance.

#

If u cache it without a weakreference that's on you.

spark pagoda
#

i have a feeling you guys have misunderstood weak references and caching

wet breach
#

I haven't

spark pagoda
#

im just going to guess and say that there's only one of each player in memory

wet breach
#

that is valid yes

rotund ravine
#

As i said

wet breach
#

doesn't mean you can't have a player object in a list that is no longer valid

rotund ravine
#

if said player has left or you cloned it somehow.

eternal oxide
#

the player object is not reused when a player relogs

#

So instances can go stale

rotund ravine
#

said playe rthen becomes invalid

#

it does not become invalid before connection drops and a new player object for said player is made

#

or you make your own deepclone

eternal oxide
#

Players are stored in a weakhashmap so if you hold a reference trhey are not cleaned up

rotund ravine
#

unless you too store is as a weakreference

wet breach
#

but that isn't the only way either. Lets say you hold the object in the list, and then the player has their game profile update because of the skin. Well your player object in the list just became invalid because it isn't going to auto-update.

rotund ravine
#

Why would it not?

#

Gameprofile is a field in the player object

near citrus
#

why isn't new ItemStack(ItemStack) creating a new instance of the itemstack?

rotund ravine
#

Explain

#

Give code

#

explain the issue

eternal night
#

it should

near citrus
#

well in newer version i does but i doesn't in 1.8

eternal night
rotund ravine
#

@near citrus show code

#

show issue

near citrus
#
ItemStack a = new ItemStack(b);
#

when i try to modify a it also affects b

#

i don't want that

#

b is also an itemstack btw

wet breach
#

feed clone of b into the method

#

the way you are doing it currently is doing object referencing

eternal oxide
#

or just a = b.clone()

wet breach
#

that would work

near citrus
#

alr thanks

onyx fjord
#

how can i store data in a block?

rotund ravine
onyx fjord
#

its a normal block

#

dirt lets say

torn badge
#

You can't store it within a normal block

atomic swift
#

how can i check if a player is between 2 locations

rotund ravine
#

Between like a cubr

#

Or circulqr

#

Or what

atomic swift
#

cube

eternal oxide
#

use BoundingBox

rotund ravine
wide coyote
#

how on earth config.getKeys(true) has the key I am looking for but when I try to get the value I get null

rotund ravine
#

How are you getting it and what key

#

And how does the config look

#

Tag me for a response

wide coyote
#
getLogger().info(config.getKeys(true).toString());

for (String key : config.getKeys(true)) {
    getLogger().info(key + ": " + config.getString(key));
}
```this one prints exactly what I need
rotund ravine
#

If u put true to false dors it have it

wide coyote
#

but when I try to get the value with this method config.getString("Mesajlar.veri-alınıyor") it returns null

wide coyote
#

let me printout the other way for u

#

what

torn badge
#

Forget what I just said lol

wide coyote
#

xd

rotund ravine
#

Did putting true to false print the correct value?

wide coyote
#
getLogger().info(config.getKeys(true).toString());

for (String key : config.getKeys(true)) {
    getLogger().info(key + ": " + config.getString(key));
}

getLogger().info("manually: " + config.getString("Mesajlar.veri-alınıyor"));
#

this is how I get it

wide coyote
#

that is just for inner keys

#

like child or smth

#

should not have nothing to do with that

#

since I have some special chars in the key name I have UTF-8 in my start script

#

I am trying to fix this out for like an hour and I am out of ideas

rotund ravine
#

I’m drunk ask tomorrow

wide coyote
#

lol

#

thanks anyways

#

anyone, please ping me if you have an idea

chrome beacon
#

(The config)

eternal oxide
#

ah I was reading the wrong one

alpine cairn
#

Does anyone know what I should put as the "plugin" or "MainInstance" in .runTaskTimer(plugin,delay,period)

wide coyote
#

I used to use np++ just switched sorry

eternal oxide
alpine cairn
chrome beacon
#

?di

undone axleBOT
chrome beacon
#

^ Use this if you want to pass it to another class

#

If you're still in your main class use this

wide coyote
#

I think I found the issue;

for (String key : config.getKeys(true)) {
    if (key.equals("Mesajlar.veri-alınıyor"))
        getLogger().info(key + ": " + config.getString(key));
}
```when add this if statement to my code it does not print any of the keys including the one it should have print
#

so, for some reason the keys are not equal

#

but how

eternal oxide
#

change - to _ in the key

wide coyote
#

let me try to get another one thats key does not have _

wide coyote
eternal oxide
#

makes no sense then

wide coyote
#

I wanna try it with another key that has no special (turkish) char in it

eternal oxide
#

also try equalsIgnorecase

wide coyote
#

alright, the problem was the special chars

#

but I never had this issue before

spark pagoda
#

alright, equals(...) it is, thanks :)

wide coyote
#

I guess imma just change the the keys...

#

thanks for helping me

glossy prawn
#

i think i don't quite understand how coordinates for chunks work, and can't seem to find the info i'm looking for. if I get a chunk snapshot at a random location, e.g.:

  ChunkSnapshot getRandomChunkSnapshot() {
    int randX = ThreadLocalRandom.current().nextInt(-800, 800);
    int randZ = ThreadLocalRandom.current().nextInt(-800, 800);
    ChunkSnapshot randChunk = this.world.getChunkAt(randX, randZ).getChunkSnapshot();
    return randChunk;
  }

and then I iterate through that chunk, how do I correctly translate back into global coordinates? randChunk.getX() + someXOffset doesn't seem to be what i'm looking for

wet breach
#

most things inside the chunk, is most likely going to have a method for you to get their location

#

therefore no need to manually convert coordinates

glossy prawn
#

all I saw was a way to get BlockData

wet breach
#

Depends on what you are iterating inside the chunk

#

if you are iterating blocks, Block has a getLocation() method for it

glossy prawn
#

i am iterating coordinate integers

atomic swift
#

if i do event.setQuitMessage(null); no message will be sent right?

glossy prawn
#

this didn't seem to return the correct values either

atomic swift
#

ok

wet breach
glossy prawn
# wet breach why?

because I'd like to check each block in the chunk - didn't see an alternative strategy

wet breach
#

ok but blocks have locations

#

not chunk locations

glossy prawn
#

yes, but I can iterate through the snapshot via coordinates using getBlockData

wheat inlet
#

is iterating through snapshots less ram intensive than normal chunks or just world getblockat?

#

like does it make a big difference?

quiet ice
#

More RAM Intensive? Definetly

glossy prawn
wet breach
glossy prawn
#

so I just need to figure out why my coordinates aren't converting back correctly to global format 😅 i'm probably just being dumb somewhere

quiet ice
#

Although usually servers have a strictly defined amount of RAM defined that is rather high, creating a snapshot here and there will make relatively little impact on the heap thanks to GC

wet breach
#

chunks are not super large either

wheat inlet
#

thanks for the responses !!!

wet breach
#

you also have to factor where in the chunk the block resides as well

#

chunk coords gets the chunk at its left bottom corner if I remember right

wheat inlet
#

its just mod 16

wet breach
#

therefore, you could call the left bottom corner of a chunk as 0,0 for x and z

#

so as you traverse the chunk

#

you need to modify keep track where in the chunk, to modify x and z

#

so when you multiply by 16 you get the correct numbers

#

oh lets not forget y as well

vital yacht
glossy prawn
#

to be honest, i'm a little confused about the * 16 offset also.

example test run I just did:

  • Generated two random X, Z coordinates: -53 -72
  • chunk = getChunkAt(-53, -72).getChunkSnapshot()
  • chunk.getX() => -53
  • chunk.getZ() => -72

seems to reflect the true position

#

unless i'm not understanding, my assumption from here is that getBlockData is now relative to the chunk, so a 16x16 grid starting at 0,0, (but true position is -53, -72)

vital yacht
#

For example x = 18 -> x = 2

glossy prawn
vital yacht
#

So then chunkX * 16 + your x coord between 0-15

#

Same with z

glossy prawn
glossy prawn
# vital yacht What’s your current code?
  Location getTreasureLocation() {
    int attemptCount = 0;
    while (attemptCount <= 1000) {
      log("count: " + Integer.toString(attemptCount));
      ChunkSnapshot randChunk = getRandomChunkSnapshot();
      int highestY = world.getMaxHeight() - 1;
      
      for (int x = 0; x < 15; x++) {
          for (int z = 0; z < 15; z++) {
              for (int y = 20; y < highestY; y++) {
                  log("xyz targetblock" + Integer.toString(x) + ", " + Integer.toString(y) + ", " + Integer.toString(z));
                  BlockData targetBlock = randChunk.getBlockData(x, y, z);
                  
                  if (targetBlock.getMaterial().isAir()) {
                      BlockData blockAbove = randChunk.getBlockData(x, y + 1, z);
                      BlockData blockBelow = randChunk.getBlockData(x, y - 1, z);
                      
                      log("coords");
                      log(Integer.toString(randChunk.getX()));
                      log(Integer.toString(randChunk.getZ()));

                      if (blockAbove.getMaterial().isAir() && blockBelow.getMaterial().isSolid()) {
                          return new Location(this.world, randChunk.getX() + x, y, randChunk.getZ() + z);
                      }
                  }
              }
          }
      }

      attemptCount++;
    } 
    return new Location(this.world, -1.0D, -1.0D, -1.0D);
  }
  
  ChunkSnapshot getRandomChunkSnapshot() {
    int randX = ThreadLocalRandom.current().nextInt(-800, 800);
    int randZ = ThreadLocalRandom.current().nextInt(-800, 800);
    log("randX" + Integer.toString(randX));
    log("randZ" + Integer.toString(randZ));
    ChunkSnapshot randChunk = this.world.getChunkAt(randX, randZ).getChunkSnapshot();
    return randChunk;
  }
humble tulip
#

If you do getChunkAt(1,1)

glossy prawn
humble tulip
#

Get the chunk of the block at 16,16

glossy prawn
#

yes, so i am getting the chunk, but my iteration over the chunk is not starting at that location, it's starting at origin of the chunk

humble tulip
#

Hold on lemme read your code

glossy prawn
#

err... wait, if that's true then getX should be something else

wet breach
#

not necessarily

#

getX on chunk object should get you the chunks x

#

so, you know if its 31,29 for chunk, then getX will give you 31

glossy prawn
#

maybe i'm fundamentally apart here - are the coords passed to getChunkAt not the same as "global coordinates"

humble tulip
#

They're not

#

They're chunk coordinates

#

Which are regular coordinates mod 16

glossy prawn
#

gotcha. so chunks are like giant 16x16 blocks

humble tulip
#

Yep

glossy prawn
#

and that's why the offset is there... okay mystery solved for real then lol

wet breach
humble tulip
#

So you need to multiply chunk coords by 16 to get the chunk origin

humble tulip
#

Or bitshifted by 4 to the right

wet breach
humble tulip
#

Ops

wet breach
#

bitshifted left for the normal coords

humble tulip
#

Yep

#

Does the compiler change *2^n to bitshits?

slim igloo
#

hey, I made my first plugin, how do I get a test server to try it out?

humble tulip
#

?buildtools

undone axleBOT
humble tulip
#

Build spigot and run it

slim igloo
#

appreciate it, thanks

humble tulip
#

Np

humble tulip
#

Rip

quiet ice
wet breach
#

this is why sometimes bitshifting is handy

glossy prawn
#

anyways, thanks all for the help - code is now working as intended 🙂

wet breach
#

as in how you typed it all out

quiet ice
#

However some bitshifts are different to their equivalent algebraic operations

wet breach
#

and whether or not the compiler is smart enough to pick it out properly

quiet ice
#

Any decent JIT most likely tends to pick it out properly

wet breach
# humble tulip Rip

for most math operations, the JVM diverts to native code which calls the relevant cpu extension which then essentially does nifty tricks similar to that to bitshifting

quiet ice
#

Javac at the very least does not touch bitshifts unless it is a constant expression

wet breach
#

well bitshifts don't need to be touched usually because it is already optimal

#

you are doing what the cpu would be doing without the cpu doing it

#

I really wouldn't worry optimizing math stuff unless you are doing things like square roots

#

or something to that effect

quiet ice
#

Well yeah, I actually was talking about multiplications/divisions by powers of two being inlined by javac for constant expressions, although the same applies for many other expressions

wet breach
#

multiplication and division the CPU will do better at optimizing then you will exception being some certain math functions that can be done faster if you bitshifted

#

for instance, multiplication for coords

#

since we know they are multiples of 16

quiet ice
#

Yeah, almost all ops take the same amount of cycles - at least on modern CPUs

wet breach
#

shifting 4 is faster

#

but you know that is just a function we already know about ahead of time 😛

quiet ice
slim igloo
humble tulip
#

Ppl on your network can easily join

#

Outside you network, i dont recommended

#

It's better to purchase a server and host it on tha

#

T

slim igloo
#

i just want to quickly test and show my plugin to a friend

humble tulip
#

Ah

spark pagoda
humble tulip
#

You'll have to open a port on your router so he can connect

spark pagoda
#

i think you can set up some sort of hole punching to do p2p ?? never tried

slim igloo
#

All of that stuff is super foreign to me

#

as in I don’t know how to do any of that, there’s no simple solution to testing out a plugin made by myself?