#help-development
1 messages · Page 234 of 1
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
you can fetch statistics of offline players
yeah but i mean on several servers
and yes it would depend if they need it centralized however from experience usually rewards are per server
f.e. on a bungee system
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
for some reason
EntityDamageByEntityEvent gets called when you damage citizens npcs
how can i detect if its a legit player without api and stuff
Because npc is entity
I can't open docs rn, but you can probably check if getentity is instance of player
I think instance of player would return true if the npc is a player npc
if (event.getEntity() instanceof Player)
it is
If not, all citizen npc's have a metadtat of npc attached to them I believe
check if the entity has the metadata NPC
Maybe with event priority and ignoreCancelled you can achieve that
But yeah the metadata is a better option
will isOnline work
why not just grab its uuid and check it for a player ?
ok looked at the docs
check the npc is instanceof Creature
since NPC extends creature
players don't
isOnline does that
Citizens NPC's are ServerPlayers not NPCs
I don't see serverplayer in the api
ServerPlayer is NMS
just hasMetadata("NPC") on the player?
^
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
not possible without extras
still not
would have to modify the client or trick around with mods or custom resource packs
so how do plugins do it
plugins can't without a resource pack
but they can tho
or client mod
Can they
what plugin in specific?
Never seen a plugin like that
I don’t think they can even with a resource pack.
with a resource pack you can fake it
Like a texture that covers their items?
they dont do that
yep
huh
Ah
so how do they do it
we already told you
?/
"they dont do that" - "so how do they do it"
its actually more easier then you think
you don't need any mods or resource packs for this
dont say now there is some sort of margin where you can push the players inventory out
dont let me think at css lol
thats not what he meant
my head is hurting
he want the players inventory to be gone
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
That’s just not a thing right
Right, with a big bar half way down?
I’m not tripping
https://github.com/ItsLewizzz/DeluxeHub/blob/master/src/main/java/fun/lewisdev/deluxehub/inventory/InventoryBuilder.java for example ive used this plugin in the past
that has guis
That only makes the top half.
they just use the players inventory aswell just like frostalfs said
???
✨ they dont ✨
Talking about player inventory, Not chest
yeah player and crafting etc. is gone
Unless you open your own inventory or an inventory that isn’t a chest, then you won’t see those GUI elements.
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
but wouldnt there be a big bar in the middle
sure, but the player doesn't know unless they are familiar with the intricacies themselves that it is still two separate inventories
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.
imma check what deluxehub menu looks like one sec
with players skin and crafting table? no. you dont even see that when opening a chest
He’s talking about that small spacer texture between chest guis and your own gui.
I’m guessing he means the thick bar separating the inventories which yeah you can’t do anything about
ok i was basically wrong the whole time, it just does it normally
You can with a resource pack, but again, it’s purely cosmetic.
probably could use a custom resource that shifts the inventory to look like there is no space there
ill just do it by normally adding the inv
but, that still wouldn't change that there is still 2 separate inventories but would make it less noticable with a custom resource pack
oh, i mean you can put items in there too
I thought that was a bug that was patched a while ago?
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?
;-;
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?
close the connection ig
or its not your plugin
I want the connection to stay up
it is my plugin
but it closes if noone is online
a connection pool like hikaricp could be useful
use a connection pool as stated above
fourteen beat me to it
2nd time
changing that setting is not the appropriate way to solve it
better luck next time
;-;
it isn't hard to use a connection pool or to fit into your current code
ok
Or make a dummy request every few minutes as a hacky workaround
it took me like 5 days to set up the sql on my plugin xd
How would I make a display name blank?
hikaricp needs like nearly no code to be used lol
" "
is that the blank unicode character
the is essentially the premise in what a connection pool does, but in a more efficient way
uh no idea, id just try a space
okey
does it have to be blank? pretty sure you could just hide it instead
unless you talking about the inventories still
im just talking abt an item for a filler in a men
like black stained glass
and it not having any name
Yeah I mean there isn't really another way. Sure you can extend the timeout for the connection but you don't wanna make it infinite
well you can't make it infinite
TCP sockets have a timeout and the max you could set it is 35655 seconds
"heartbeats"
well 10 hours doesn't sound too bad :)
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
Ya. Also making 10 dummy requests (or whatever many connections you have in the pool) every 10 minutes is no effort anyway
how would i hide display name of item
call them heartbeats or keepalive pings and ur suddenly a lead coder.
excuse me?
Like hide what
how what
do you want
I didn't know you were still talking about inventories, you just need to use a space
alright
but if it was like an item on the ground, you could hide the name plate
But... but... "dummy" 🙁
but you can't quite do the same in the inventory without some packet hacks
dummy is not cool
Dummy is perfect as a placeholder for something reasonable
while you could do this, it doesn't bypass the hard limit for tcp sockets to be open
like https://dummy
hard limit, timeout is not a hardlimit
all tcp sockets have a hard limit set by the OS to stay open
this says no
but still somewhat since gateways might drop them.
it says it depends on the context
it either client or server may crash its recommended
thats atleast what i understood
it doesn't say no
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
then how does a timeout of 10 hours fix that.
because your definition of timeout isn't always used in the same context
But it's used as a wait here as usually right?
and it doesn't fix that, I just said the max you can set the limit on a TCP socket is that long
but why does that relate to keeping the connection alive?
Because eventually the OS will force close it
So why the timeout in relation to keeping the connection alive?
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
--remapped is crashing with build tools
your log showed it was finding no projects. perhaps your git is failing
wdym?
or you are not doing a full clean build, ie no folders
your log gets as far as searching for projects
that folder (I hope) is not on your desktop or in OneDrive
where is the log?
wait
he posted it a few hours ago
.
java -jar BuildTools.jar --remapped --rev 1.19.2
I'll try it
Maybe smt changed idk
oh perhaps your maven is at issue
nope
because you don't have MAVEN_HOME set most likely
this is where yours is failing (maven) https://pastebin.com/56CYyYVe
or don't have maven on the path
mvn is on path
yeah it does not apply it now
but it ain't crashing
be sure mvn will execute from the buildtools folder
I installed mvn with choco, it downloaded its own from static.spigotmc.org or smt
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
it seems it downloaded its own maven though, I'll try setting MAVEN_HOME
k
oh
lmfao
set MAVEN_HOME to C:\ProgramData\chocolatey\lib\maven\apache-maven-3.8.6\bin
it still failed
wierd place for your maven to be
installed with chocolatey
a package manager
at command prompt type mvn -version
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"
needs \bin
weird you are using a package manager on windows
I prefer to use a package manager
why are you using an alpha version of maven?
That's the latest version
I asked choco to upgrade to latest
because I was a couple versions behind
I use 3.6.3
that isn't latest version
latest version is 3.8.6
you are using an alpha version that isn't suitable really for production
I use 3.6.3 as well
I'd suggest you downgrade your maven version to a non alpha
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
sup i working on custom gui with document https://www.spigotmc.org/threads/advanced-resourcepack-mechanics-how-to-create-custom-items-blocks-guis-and-more.520187/
could someone tell me how does it works and is it gonna work on 1.8.9?
shouldn't work for 1.8.9
oh so on what version minimum
I don't know, though I do think these features are not <1.13
think custom model data came in 1.14
ok. can someone explain how its working? like what i need to do to see it
you need to make a texture pack
i have but like do i need to name smth or what like how it will know what is name of conatiner
You should learn about texturepacks first
i know cus i making a lot i know optifine and .properties
bu ti dont know how this works
Does it build without --remapped ?
yes
that makes no sense then
it does, they are using the latest stable version now
instead of the alpha version of maven
also they fixed their MAVEN_HOME variable
No he says it still doesn;t work. Normal build does, --remapped kills it
.
Buildtools always worked
--remapped killed it
now its just not remapping
ok...doesn't answer my question
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
well its still correct if that is where their home is
windows doesn't care which way the slashes are
yes his path is wrong
well yeah that end part
his maven is installed with teh version in its path
so that error is old, we need a new log
well its a package manager, don't know it so it could be using symbolic links
but a new log would still help
alright I'll send one in a second
twenty two minutes later
twenty six
28
you should find the cause and fix it.
you have two people trying to help you
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?
Tab complete args start @ 0 right?
why do you need to get the index of the args
i'd save inventories in binary or base64
Args.legnth is 1 args[] is 0
how do I do this xd
binary??
that seems difficult
How would I be able to load a config with utf-8?
all arrays in java start at 0
ik dumb question lol
cant you give a charset to the reader?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
YamlConfiguration.loadConfiguration(new InputStreamReader(plugin.getResource("file.txt"), "UTF-8")) lol
so for the inventoryFromBase64 method, it takes in a String called data... how would I get the right inventory from this and what would I put in? Also, would this save if the plugin is disabled/enabled
that says success?
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
[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
im wondering why i was using udp on a chat application lol
maybe thats why it was not working
Can I somehow make Walkable Falling Blocks?
nothing wrong with using udp if you don't mind the messages being out of order sometimes
when the server goes down, all of the data that is stored in RAM is lost, will this be lost too or does it save until the server starts up again
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?
also, I still dont understand how I can save invs and stuff
PlayerInventory inv = player.getInventory();
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
@wet breach IT WORKS
that is stored in ram and will disappear if you restart server
save it to a file or database
yea I want to save it in my mysql database but I dont think it has that type of data
https://bukkit.org/threads/mysql-store-player-inventory-in-database.186344/ This might work, you will have to modify it a little to work with every inventory though

either store their contents in a PDC chunk
or put them in a DB
personally I would just store them in the spawn chunk PDC
i hear pdc a lot I needa learn abt it xd
?pdc
thx
bump
I completely forgot what the documentation website was, could someone enlighten me?
?jd
well you obviously have to save the stuff to your file
yes but mysql doesnt have an inventory data type ;-;
dont save it into mysql
yes ik im trying to use pdc
what other documentation site would there be?
dont use pdc for that lol, just use a file
how
BLOB
...
oh gulp sql
why not just files aaa
I was just saying if they really want mysql
how do I use files aa
nope, I make custom plugins for my server so I dont need one

what
I dont need a config to change stuff
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
The... other one? xD Idk, I'll look it up and come back
yes agree confusion for starters
are talking about the wiki?
that is like the only other thing I can think
wonder if the bot has a wiki link
?wiki
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
welp it does
Ahhh, probably? I honestly can't remember, I've been away from spigot for a while lol
Ah, no, no.
I uninstalled Opera, which had all the links on it too...
yeah wouldn't know what documentation site you would be referring to
there is https://wiki.vg
for protocol stuff
then you have the now unofficial minecraft wiki
and then there is bukkit stuff over on the good old bukkit forums
Oh wait, I've recalled. They're the javadocs, I just wasn't recognising them because the sidebar tab wasn't showing
lol
well you have the links for them above
pay yourself
🤔
i want to start making stuff agein haha
can you pay myself? 👉👈
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...
tf was i doing
wish there was a cure for add thb
me casually throwing a bunch of code into a test project
argh, does anyone know how to bring up this sidebar?
doesn't seem to appear in the latest website
Use the search bar
yes i am the 1.7.10 guy because 1.7.10 pays alot
yes but the sidebar is so convenient though
oh also hey there o/
1.7.10 was the golden age of minecraft tbh
the night design was better thb
Hot take the combat kinda sucked
no it sucks
mojang too scared to make another combat update
Got nothing to lose
MAYBE...
But it's just like one of those old cartoons that are straight up garbage but you used to love back in the day
reflection hehe
attempted to wrote a whole reflective pojo mapper
but the reflection was too less flexible
and now
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
😳
yeah don't think the maven repo site is going to have that
Does a boat/boatchest being placed fire an EntitySpawnEvent?
oh hello there! familiar namess
it will check in all defined repos for your remapped jar
in order
how can i check if a user is between 2 coords
math
i meth cant do
no repos are defined
theres literally no repo tag
probs a default maven
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
great
I just need to figure out why it's not fuckin running the plugin
hm?
org.spigotmc:1.19.2-R0.1-SNAPSHOT:remapped-mojang:jar was not found in https://repo.maven.apache.org/maven2
here it is
the rest is just project desc n stuff
?bootstrap
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
dahell is spigot.version
Its a property I made
?cba
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.
I need to use remapped-mojang otherwise the remapped stuff doesn't work
can you show your pom though, your actual pom
install the remapped jar then
go look in the .m2 to see what sort of path you need then
That's the whole pom - project name and description
(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
@wet breach he's aying he copid off that website btw
it doesn't give a complete pom
true
what?
this is my pom
complete
copy pasted
then it's dumb.
We would love to see the whole thing to actually try to understand the issue. We are not trying to steal your shit.
I know you are not, I do not want to share useless data
ok, but the site you keep linking, doesn't give a complete pom
stop determining what is useless and let us decide that please
@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.
this is where a lot of problems occur
yes
k
try setting maven compiler version to 3.10.1 and maven shade to version 3.4.1
do you get a new error?
no
what maven version is the IDE using?
hmmm
ok
you are going to add this to your settings.xml file
<repositories>
<repository>
<snapshots>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
</repositories>
not having looked at your entire conversation, it looks like your buildtools has failed to install spigot as a dependency in your local repository
me trying to make a webserver in java
it did install @spark pagoda
is it in .m2?
is the maven installation you have for chocolatey definitely looking at %USER_HOME%/.m2 for the local repository?
yep
does the spigot folder actually contain folders for each version with the jars inside them ?
no
when he said his settings.xml is empty he meant it is zero bytes
what's inside 1.19.2-R0.1-SNAPSHOT?
<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>
I missed a tag
surround the repositories tag with
<profiles> </profiles>
oh
that was my bad for missing that lol
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
ctrl + enter does nothing
here is a link for the full settings you could put in there
https://maven.apache.org/ref/3.3.3/maven-settings/settings.html
even explains all the options 🙂
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>
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
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
yeah
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
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
did you try building again since updating your settings.xml file?
I tried using -U and it still didn't work, if I remember correctly -U forces updates
that's why frostalf is telling you to add the snapshot dependency update policy to your settings.xml
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
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
it should not fail when it doesn;t find it in teh maven repo, it should press on and search local too
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?
since you are using intelliJ, have you tried clearing caches?
I'll try
I'll do that
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
lol
re running bt
depending on the speed of your internet and processor see you 2023 Q3 maybe?
it should be fairly quick
almost done
i7 babiiiiiiiiiiii
if you've deleted the local repository it'll have plenty of fun re-downloading the entire dependency graph before compiling
what's the failure
Have you considered your IDE might be infested with a demon 😳
need to set a delay
Cleaned out all caches and redoing it
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
IDEA is the demon
when it works it's amazing it's just that when it doesn't it breaks with undefined behaviour and confusing errors
what does mvn verify (running in command prompt, with IDEA closed) say?
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
well that looks like the local repository hasn't been deleted
I deleted everything tho
here's what i'd do
0. Close IDEA
- Delete
%USER_HOME%/.m2 - Run BuildTools
- Go to the project directory in Command Prompt
- Run
mvn verify -X - Investigate the inevitable failure
oh true, it could be that the failure is actually cached outside repository/
done every step apart -X
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?
yeah
i.e. can I safely use playerOne == playerTwo
should be
yay :)
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
does the run-time class of a player actually implement equals()?
ah, looks like it does
you can check UUID
don't use it tho
it does an UUID check AND an entity ID check
a player will always be the same player or I am like super dumb
you are right
this doesn't work for player objects
a player instance is always the same
a player object obtained earlier can be different later
works for worlds too
content wise
you sure?
Cause iam like 99% sure it won't as it will just be mutable
does their location and what is in their inventory or anything of that not change with the player?
and other things like that
@wet breach it's mutable
so it changes for said player, but you only are given one player object across the board.
would they be different objects on the heap
an object obtained earlier doesn't necessarily mean it will equal the same object later if you obtain that object again
well yes but does reference equality hold for the same actual player
yeah and you obviously never messed with caching either
ok, that isn't the point
a cached player object from the past, will not always equal a player object obtained in the future
it doesn't magically update
It will since it's mutable
it won't
Are you not aware of mutable object like at all?
it updates magically if the memory address is the same obviously
are you not aware of how caching works
^^
Are you not?
How would you even cache a player
you would have to clone each field and create a new player object.
even hashCode is UUID-based for players
Y’all got me gigglin ngl lol
there are some things in the player object that will not update if you have it cached. So no the player object will not always equal the player object in the future
well i'm not asking whether they'll be equal
show me such a case where the mutable object which points to one memory address won't.
im asking if they will have the same memory address
Still doesn't work after wiping .m2 out and re-builtooling thing
for players yes
Bukkit.getPlayer("IkeVodooo") == Bukkit.getPlayer("IkeVodooo"); // true
it will. Just ignore alf
if one is cached and the other is obtained later no
frost
Untrue
the only way that is possible
if you hold a reference to a player that has quit
like
Player ikeQuit;
Player ikeOn;
ikeQuit == ikeOn; // false
that isn't the only way it is possible
whats this about 👀
ignore it.
no u
I don't have time to keep showing people implementation specific things just because they can't fathom something
if you want to choose to not believe it, that is up to you
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.
i have a feeling you guys have misunderstood weak references and caching
I haven't
im just going to guess and say that there's only one of each player in memory
that is valid yes
As i said
doesn't mean you can't have a player object in a list that is no longer valid
if said player has left or you cloned it somehow.
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
Players are stored in a weakhashmap so if you hold a reference trhey are not cleaned up
unless you too store is as a weakreference
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.
why isn't new ItemStack(ItemStack) creating a new instance of the itemstack?
it should
well in newer version i does but i doesn't in 1.8

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
make a clone of b first then
feed clone of b into the method
the way you are doing it currently is doing object referencing
or just a = b.clone()
that would work
alr thanks
how can i store data in a block?
https://prnt.sc/upfr119uOVlW
Returns true
If it’s a TileEntity PDC’s are your friend
You can't store it within a normal block
But you can use this: https://github.com/JEFF-Media-GbR/CustomBlockData
how can i check if a player is between 2 locations
cube
use BoundingBox
Or try to understand this https://stackoverflow.com/questions/21037241/how-to-determine-a-point-is-inside-or-outside-a-cube
how on earth config.getKeys(true) has the key I am looking for but when I try to get the value I get null
How are you getting it and what key
And how does the config look
Tag me for a response
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
If u put true to false dors it have it
but when I try to get the value with this method config.getString("Mesajlar.veri-alınıyor") it returns null
https://prnt.sc/Q9ID8QbdX_zA this code's output
let me printout the other way for u
what
Forget what I just said lol
https://prnt.sc/22azVuI9s8SW @rotund ravine
Did putting true to false print the correct value?
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
M
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
I’m drunk ask tomorrow
Make sure the file is saved in UTF8
(The config)
"Mesajlar.veri-alınıyor" is not the correct key, you have a UTF-8 char in the real key
ah I was reading the wrong one
Does anyone know what I should put as the "plugin" or "MainInstance" in .runTaskTimer(plugin,delay,period)
how can I check that in sublime text
I used to use np++ just switched sorry
I'd suggest changing your - to _ just to make sure snakeyaml isn;t being silly
Your plugins main instance
Could you give an example?
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
^ Use this if you want to pass it to another class
If you're still in your main class use this
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
change - to _ in the key
let me try to get another one thats key does not have _
makes no sense then
I wanna try it with another key that has no special (turkish) char in it
also try equalsIgnorecase
so reference equality does not necessarily hold if one of the player objects is stale
alright, equals(...) it is, thanks :)
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
depends on what you are iterating in that chunk first off
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
didn't see anything in the API docs to do this
all I saw was a way to get BlockData
Depends on what you are iterating inside the chunk
if you are iterating blocks, Block has a getLocation() method for it
i am iterating coordinate integers
if i do event.setQuitMessage(null); no message will be sent right?
this didn't seem to return the correct values either
ok
why?
because I'd like to check each block in the chunk - didn't see an alternative strategy
yes, but I can iterate through the snapshot via coordinates using getBlockData
is iterating through snapshots less ram intensive than normal chunks or just world getblockat?
like does it make a big difference?
More RAM Intensive? Definetly
seems to me it does - i was using getBlockAt previously and hitting serious perf issues
snapshots let you process chunks using a separate thread from the main thread
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
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
chunks are not super large either
thanks for the responses !!!
well other then multiplying by 16
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
its just mod 16
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
Do you mean chunkX * 16 + offset?
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() => -53chunk.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)
If you want the coordinate inside a chunk from a world position you can use
coord & 15
For example x = 18 -> x = 2
hmm not exactly what i'm trying to do - I am iterating through a chunk snapshot and turning that back into a world location
What’s your current code?
i'm probably being really dumb, but I still don't understand the * 16 adjustment, unless getChunkAt is not doing what I think it is
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;
}
What do you think it does?
If you do getChunkAt(1,1)
somehow by asking this question you have unlocked what's going wrong for me
Get the chunk of the block at 16,16
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
Hold on lemme read your code
err... wait, if that's true then getX should be something else
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
maybe i'm fundamentally apart here - are the coords passed to getChunkAt not the same as "global coordinates"
gotcha. so chunks are like giant 16x16 blocks
Yep
and that's why the offset is there... okay mystery solved for real then lol
that is one way to do it, or another way to say it they are the floored coords / 16
So you need to multiply chunk coords by 16 to get the chunk origin
Yep
Or bitshifted by 4 to the right
to the left
ok went to double check you were right, coords are bitshifted right for the chunk coords
bitshifted left for the normal coords
hey, I made my first plugin, how do I get a test server to try it out?
On your own combuter
?buildtools
Build spigot and run it
appreciate it, thanks
Np
No
Rip
Depends on which compiler
this is why sometimes bitshifting is handy
anyways, thanks all for the help - code is now working as intended 🙂
also depends how the math is setup too
as in how you typed it all out
However some bitshifts are different to their equivalent algebraic operations
and whether or not the compiler is smart enough to pick it out properly
Any decent JIT most likely tends to pick it out properly
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
Javac at the very least does not touch bitshifts unless it is a constant expression
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
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
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
Yeah, almost all ops take the same amount of cycles - at least on modern CPUs
shifting 4 is faster
but you know that is just a function we already know about ahead of time 😛
+ for example is as fast as | (technically OR is a bit faster but only by sub-cycle amounts - so ignorable)
alr, will doing this allow me to make a quick server that others can join? Im pretty new to this
Um kinda
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
i just want to quickly test and show my plugin to a friend
Ah
iirc java's square root actually ends up being faster than quake's fast inverse sqrt
You'll have to open a port on your router so he can connect
and possibly call your isp
i think you can set up some sort of hole punching to do p2p ?? never tried
