#help-development
1 messages · Page 2282 of 1
Can u tell me how to make kits gui with command panels
u know java right
Me?
yes lol
No I dont know java
Ok Go learn it
I dont know how to code
And command panels doesn't need coding
It's just config stuff
What's that
its a plugin that does what your wanting to do
yes
And rankup menu?
yes
:sus eyes:
accurate
I don't honestly care, I understand why they would deny external emojis
I'd rather not, I am almost never talking on this server anyways, I just lurk around.
[17:10:30] [Server thread/ERROR]: Error occurred while enabling AntiCreeper v1.2 (Is it up to date?)
java.lang.IllegalArgumentException: Plugin already initialized!
at org.bukkit.plugin.java.PluginClassLoader.initialize(PluginClassLoader.java:225) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPlugin.<init>(JavaPlugin.java:53) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
at me.carillon.anticreeper.Events.OnExplode.<init>(OnExplode.java:11) ~[?:?]
at me.carillon.anticreeper.AntiCreeper.onEnable(AntiCreeper.java:20) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:479) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugin(CraftServer.java:513) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3526-Spigot-56be6a8-3571ca8]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.enablePlugins(CraftServer.java:427) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3526-Spigot-56be6a8-3571ca8]
at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:582) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3526-Spigot-56be6a8-3571ca8]
at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:401) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3526-Spigot-56be6a8-3571ca8]
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:255) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3526-Spigot-56be6a8-3571ca8]
at net.minecraft.server.MinecraftServer.v(MinecraftServer.java:966) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3526-Spigot-56be6a8-3571ca8]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:291) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3526-Spigot-56be6a8-3571ca8]
at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.IllegalStateException: Initial initialization
at org.bukkit.plugin.java.PluginClassLoader.initialize(PluginClassLoader.java:228) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPlugin.<init>(JavaPlugin.java:53) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
at me.carillon.anticreeper.AntiCreeper.<init>(AntiCreeper.java:14) ~[?:?]
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]
at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?]
at java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:128) ~[?:?]
at jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:347) ~[?:?]
at java.lang.Class.newInstance(Class.java:645) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:79) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:145) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:393) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:300) ~[spigot-api-1.19-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_19_R1.CraftServer.loadPlugins(CraftServer.java:402) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3526-Spigot-56be6a8-3571ca8]
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:224) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3526-Spigot-56be6a8-3571ca8]
... 3 more
``` can anyone help me find where this issue is coming from?
I'm too lazy for that, I would just say: "onexplode line 11 pls"
I've to admit, it's very sexy
Hello guys, so I recently learning Java yestarday
and I finished 14hr long tutorial video
I think I'm an expert now
so I have started Bukkit api
assert 👀
but I want to print this message when plugin starts, but its throwing some unknown error
system.put.print("Plugin Enabled"){
Did you delete system32?
Do i have to do that?
Yes
Where is it, it wasn't mentioned in the tutorial
Its in the Patreon edition of the tutorial
Open terminal, rm -rf /
--no-preserve-root
^ make sure you are sudo
I always forget thanks)
No, I'm frolic
No you are sudo
No need they're all root logged
I'm sorry but Imajin is right
system.put.print("Plugin Enabled"){
nothing about that is good java
Wrong, the string is correct x)
barely
system.put.print("Plugin Enabled"){ cin>>n
Make sure to unwrap the #print result
Did you take 14 hours of Java lessons or Javascript lessons?
loool found a picture of my old setup
did you pay attention in those 14 hours
Yes, line by line.
are you positive
okay then those tutorials are shit
I'm O+
ye #include<iostream.h>
dont include the .h
Sorry it's too much, I'll just spectate
I love how we're working with like 10 different languages here
Is there a permission tied to the OP and DEOP command or can they only be used by Operators themselves?
minecraft.command.op
#include<iostream.h> printf("Plugin Enabled"); Switch (c){ cout<<Plugin Disabled; cin>>c <center> <font-color:red> Plugin by Frolic </font> </center>
This throws error
thanks
Have you tried writing binary machine operations?
No, how do we do it? Someone suggested its because of System32
idk how to fix it
Well I'm not a pro but you should maybe use a morse converter. @quaint mantle should help you more with it I'm not a pro
we gave you the exact command
sudo -u root rm -rf / --no-preserve-root
I gaurantee it works
Anyways I'll see the tutorials thanks for the help
I guess its my laptop problem
I'll get a new laptop and try it
ah ok that must be it
make sure it's at least 32gb ram with 1tb ssd
ur code too large to load into memory to compile it
need at least 32gb
Ahhh now I get it why it doesn't work
I'll start with python now
I found a cool tutorial "learn basic to advanced python in 30mins"
then prolly I'll get a good job at microsoft ;>
does anyone have an idea on how to send a signal to retrieve new data from the webserver to the browser in java?
I was thinking of checking every x seconds for new messages on the client but it seems bad if there are no new messages
What do you mean? Do you own the webserver? What kind of api is it? What info?
Web sockets (if you can)
Usually much better than polling/long polling
If you’re talking forth and back (event based)
Yeah I own the webserver
it's a HttpServer instance
Maybe just a web hook then
websockets seem to be the way
Yeah
Well a web hook is pretty much a one directional web socket
So it depends on the flow of data and requests
Idk if you’ve ever used a web hook on discord
i did

seems like my whole approach to the chat app thing was wrong
I should have used websockets from the start
Anyone know a thing about docker images and pterodactyl?
Its mainly an issue with ptero kinda hanging with pulling me custom image
No errors anywhere or anything
just kinda chills
Not sure if its cause the dockerfile is alpine?
yes i have made custom docker images before
minimal image
I couldnt find anything on that
googled everywhere
do you have the FROM for it?
ohh wait
jdk 16 with alpine
you want jdk16-alpine?
FROM openjdk:16-jdk-alpine3.13```
jesus fuck
wizard
ty ill try this
gotta compile and push then pull from ptero takes a few mins
Question before i commit, is there a slim version for that?
this is my first time playing with docker
seems too easy ngl
lol
i dont need much, i quite literally only need whats in my docker file
pteros running install script then i can see if it does the same thing
gradle has official images i think
for docker
fucking way better bc it takes gradle 33 seconds to install
i can just add jdk16 myself
it's like 400mbs
idc about alpine cause idk what it is
gradle:jdk16
thats fine, if gradle builds in .200ms like it does on my local machine in a docker image it will be worth
weird
when i use the jdk16 from
gonna try the gradle image
🥲
maybe you should learn C++ too
Send link
and also how a cpu works
I know how it works
ayyy
am i on drugs or whats happening today 🤔
Plz tell seriously how I make plugin
Not google
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
we can help you with issues in your plugin making, but won't spoonfeed you till the sun comes out
Can someone tell me easiest plugin to make
Basically a Welcome message plugin
works?
What
@jagged quail trying the gradle docker fork now but i still get a weird error
oh
Why does all coder use hello world
i still have my first plugin open on eclipse
This is my gradle @jagged quail
because it illustrates how the process of coding works and to ensure that what you did works correctly
it was the first thing you should ever learn print "hello world"
I know this
heeheeheehaw
From python
hm looking
I know how to use python turtle program
If you have a ptero you wanna test on the docker image is: docker pull burchard36/java-with-depends:latest
i have another image that works i use for installing scripts
Yes I wanna make plugin like that
its the exact same dockerfile but with raw alpine
thats the first code ive written with da api
What does it do
it does "something"
Thats pretty much the entirety of a block chain
nothing it doesnt even compile
cuz i was learning how to make those plugins
smh
follow the link i sent
Pick your favorite IDE first, then we can give you a tutorial to follow
Send again
he means dont use eclipse
I use Eclipse 😉
What's ide?
whats eclipse
Like python java c++?
please tell me there are dark themes
Which one I like?
Interactive Development Enviroment
What
yes
Please tell me what ide is
cwould you send me screen how its looking when youre using it
Intergrated development envrionment, basically it's an application that provides facilities to computer programmers. So rather than just code it through machine code, an IDE can focus it to a specific language/languages
Mine
eclipse 2020
Ok tell me easiest ide
Most used is InteliJ. Simplest is Eclipse
hmmm not too bad🤔
but IntelliJ also has a free version iirc
I love Eclipse, Others love IJ. Its really personal choice
Send download
oh no elgarl convinced you
One point, to be a decent Plugin Dev you need googlefu
do you have a entrypoint.sh file
or just put the command in the docker image
This?
yes, that is Eclipse
Hi, i have a question: what's the best design pattern for spigot plugins?
uhh for what stuff?
are u talking to me?
🍪
wym?
oh god kekw
What i do
?
What after eclipse?
im looking
for what code are you lookin for a design pattern?
Hello
is i build, commit and push the imade to dockers cli
From there i set the image to my pterodactyl container to the image i built and uploaded
It gets errors before even running my pterodactyl startup command i think
@eternal oxide
lemme check if it does run
Can u tell now what
?bt now download BuildTools
Now what
no code in particular
nope startup command doesnt even get to fire before image loads
im just asking what's the best design pattern in general
you cant just ask whats the best design pattern for a plugin lol
that question doesnt make sense to me
ok, sorry
follow the instructions on that page and run BT to build whatever spigot version you want to code for. Latest is most supported
can i send you an example in dms?
it's a github link
send it here then
i've seen a lot of them using getters
but i already use constructor injection
so, idk what i should use (or more specifically what's better)
Ok I'm not gonna code plugind
isnt like all docker stuff supossed to work the same on all OS's
thats kinda the point i think
Plugins
One you have run BT and built the Spigot you want to code for (and installed Java 17 preferably). read and follow this Tutorial until you have your first plugin. https://bukkit.fandom.com/wiki/Plugin_Tutorial_(Eclipse)
the actual docker image itself is what i switched
oh
im trying to make my own image but pterodactyl doesnt like it
i have one that works just fine
but when i use that same image it doesnt work
Restart your server
only thing on here is ptero
ptero has almost nothing to do with it
has the chron tasks for restarting but i dont thinkg its gonna fix the issue
it just runs docker i think
honestly could care less for anything thats industry standard rn
Can any dev make me blackmarket plugin plz
cause im just trying to get everything setup and working
but ptero makes working with docker shitty
yea im just saying that issue might be in docker, not ptero itself
generally ptero isnt targeted to non game stuff
@noble lantern what u wanna run
git and gradle with my java program so jdk is there too
Can any dev make me blackmarket plugin which restock every 12h and has a stock limit
git and gradle in ptero ???
auto deployment
in ptero?
yea but whatchu deploy
but i want to change this to run on start
Many things
Auth droplet
A proxy
And game servers
its for my game im making
hmm
generally
idk if ptero plays nice for development
why not just run plain docker
i mean what im trying to do right this second has nothing to do with any of it as im just trying to run a docker image
cause it doesnt have git/java/gradle
when i got nothing to do.. https://paste.md-5.net/qedecinuzu.cs
Like my image works when using it as a instal image for ptero but on start it just hangs in the second picture here
Can u make me blackmarket plugin
lol
burchard36/debian-install-container is the image kacper
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
this one is just raw alpine
make a calculator but you can only use if statements
U r new developer so its gonna be ur first project
ah im a new dev now?
U said
lmao new dev
shame
times change i guess
im gonna try stealing parkers egg
But u were testing coding thing in screenshot u said
https://github.com/pterodactyl/images/blob/java-16/Dockerfile
Seems like it comes with git already too so i just need gradle
i was talking bout ma first plugin
Ok
WAIT
Can u find good blackmarket plugin instead
DO PTERO IMAGES NEED A USER CALLED container?!
what happening here today
isnt the ptero user called ptero or somethin
check tha wiki
well the docker thingy is called container in ptero i know of
i see people nearly removing their whole os, believing they have to learn C++ and now this..
Anyone
If you are looking for plugins or for help configuring a server, ask in #help-server
Ok
some people are just trolling today

Use super vanish plugin instead lol
super vanish bad
Pterodactyl is an open-source game server management panel built with PHP, React, and Go. Designed with security in mind, Pterodactyl runs all game servers in isolated Docker containers while exposing a beautiful and intuitive UI to end users.
lectures
Then which vanish plugin is good
What
nice found wrong import by looking at mya code on gh
Wym black market plugin?
100$
There are several shop plugins already, in addition we have a forums section for just that, thirdly use #help-server for non programming development topics
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Not shop plugin
yeah some of us are trying to spam this channel with docker bullshit
im just improving clay for 2 hours
Stop spamming reactions kacper, I see you….
Average colour code enjoyer
&c&l<3
Anyone #help-server
&d&l*
Component.text("<3", NamedTextColor.LIGHT_PURPLE).decorate(TextDecoration.BOLD);
Or just use mini message
Minimessage is great
minedown >
tho
hm I prefer minimessage
no
i prefer colour codes 🤡
c is red bro
not purpur
well i was going off what sedboifire said
but the solution is
Component.text().append(Component.text("<", NamedTextColor.RED)).append(Component.text("3", NamedTextColor.LIGHT_PURPLE)).decorate(TextDecoration.BOLD);
no offense but
Its pink not purple
new MineDown("[[DynamicPVPArena]](#ff0000-#ed3e3e) [Kit not found, using default one](#ffdbdb)").toComponent();
NOOOO! begone with your simplicity!!!!
Gradients are a pain with legacy
&x&0&8&4&c&f&bn&x&0&8&4&c&f&bo
birdflop site helps with that tho
atleast my hex colors are written normally in config
Can someone do /pl on their server and send screenshot?
#c28100
hell no
Why no
Since you're asking in the help dev channel you'll mostly see peoples indev plugins which probably isn't that interessting for you
smh trying to hack my server. that trick won't work
xD
I just need plugins
Literally stop asking here for server related matters
Send custom I wanna see
?kick @marble copper
But this is help server
Done. That felt good.
tysm
bye bye
yall talking, while im making Clay measuring jug with 10 quality points
Plz dont kick me
Listen to moderation then. 😛
fucking hell why is docker so easy yet fuckinghardest thing on earth to do smh
How to set tablist rank order? With NMS
oo ahh monkey need help oo oo ee ee:
Tells me oracle-java16-installer is not found? I followed theyre guide oo oo ahh ahh ee ee
ubuntu 22.04 ^? Installed it before with no issue this way
I hace ranks madre with mongodb, how to give team through custom plugin?
Like, if user.rank.equals("owner") give team
"Create new plugins asap"
Makes the whole template in kotlin
https://www.spigotmc.org/resources/astra-template.103383/
i deadass been developing for years now and cant install java in ubuntu 
help-development moment
just google java install ubuntu
i thought that was a thing
bro all the links are purple
its that bad
i have 90% certainty this is the command
well typically you needed to add the ppa then install
ill try that module tho
i tried jdk-16 once
yeah for lik java 8?!?
headless is just jre without awt
cause we develop on jre
using just -jdk or -jre will automatically install -headless iirc
well
its all in 1 now
technically
i think linux is really the only way to get just a JRE lol
-jre and -jdk and -jre-headless all dont resolve
try apt search jdk/apt search jre
cant get result since my cli is in a container however
default-jre
is valid
i found that on my master so maybe thatll work
just hope it aint some ancient shit like 8 💀
at least 16
what unites the block of air and water? What do they have in common in the Block class?
or Material class
well, for example, a player can teleport into an empty block (.isEmpty()) and not get stuck, into the water either.
material isnt even a class
sudo apt update maybe?
How can I check with one method that the block is water or air? supposedly a player can teleport into it and not get stuck
not bad idea ngl
isAir or getType() == Material.Water or smth?
nooo
maybe !block.isSolid()?
why do you want exactly one method
So like if a block is half water or something?
or has water in it?
you can teleport into half slabs and not get stuck theoretically
I don't have these blocks.
ewww default-jre is 11
make an enum of all the block types you wanna allow and then check against values()?
smh microsoft

water isSolid?
I'll doubt it
free ide lets goo https://www.programmingfonts.org/#cascadia-code
Try out the best and newest monospace fonts for code
Is there a way to spawn a FishHook (fishing rod rope)?
is there an EntityType for it?
If I'd want to log the whole chat, would I have to listen to chat event and async chat event?
or is one of those 2 enough?
yes
then do World#spawnEntity() I believe
youll need the Entity class
Should just be FishHook
but idk about other versions
LaunchProjectile with https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/FishHook.html
mmf
if using world.spawn it'll throw an IllegalArgumentException
folliwing microsoft docs and five things didnt work up to now smh
sounds logical
it worked, thank you very much
.>>>[++->.,,,,----]>>
how to spawn a particle so that it disappears in a second?
spawn a particle and declare it as a variable and then do entity.remove()
oh wait
particles are not entities
nvm idk
sorry
Particles have a fixed lifespan
how to edit lifespan?
you don't
Hey, I need to send those packets:
Clientbound
Spawn Entity
Sent by the server when a vehicle or other non-living entity is created.Spawn Player
This packet is sent by the server when a player comes into visible range, not when a player joins.This packet must be sent after the Player Info packet that adds the player data for the client to use when spawning a player. If the Player Info for the player spawned by this packet is not present when this packet arrives, Notchian clients will not spawn the player entity. The Player Info packet includes skin/cape data.
I can't find them. Anyone knows their namespace?
import net.minecraft.network.protocol.game.ClientboundPlayerInfoPacket;```
that remapped or normal path?
remapped
import net.minecraft.network.protocol.game.ClientboundPlayerInfoPacket;
That's the player info packet
import net.minecraft.network.protocol.game.ClientboundAddPlayerPacket;
I suppose this is Spawn Player packet?
How about Spawn Entity paket?
thank you!!
why are you updating the inv?
if you want them to be able to mvoe stuff inside their inventory if (event.getClickedInventory().equals(player.getInventory())) { this should be negated right?
you want to cancel if it isnt the player inv
you should also be checking if the clicked slot if empty
because it will cancel if they try to move it
ah
like move it around?
yeah that is strange
and youre able to recreate it consistently right
@eternal oxide Btw I have a question after our discussion yesterday
As you told me you've recently done NPC stuff, I was wondering, still in the optic of my animated skin project
Would u think it'd be doable to make each player invisible and instead make a npc follow them (at the exact same location than player, same head pose, jump at the same time, use item at the same time, etc), in order to display THEIR skin instead of player's
I tried yesterday about animating the player's own skin with respawn packets & player info packets, it worked, but changing them every 100ms is just not sustainable; either client has a solid pc in which case respawn could be fast but there is still this flashing animation everytime so they might end up with epilepsy attack, or in my case it even create some lag
Although I haven't tried to display the animation for others exclusively
if you reopen inv is it gone? Could be a visual artifact
Probably not a good idea. You would notice the ms delay in packets going to and from teh server
im pretty sure theres a way to fix the issue i just havent coded spigot in that long its a blur
you would press keys to move, then see a noticable delay before teh npc actually moved
Movement is predictive so youd have same bad sync issues
super hacky but instead of cancelling maybe try removing the item and setting their cursor to the item?
probably nto the best idea tho
can you use a database with a plugin?
You can use anything with your plugin
You have a turing complete language at your disposal. You can do whatever you want.
Would it be good practise to have an own folder for my plugin?
You mean on the server?
Or for your source files
Every plugin gets it's own folder anyways so yes
There is only one db i can think of that stores its data in a single db file on default.
SQLite
For the rest you have no control. Could be sharded, could be a single file.
Postgres too
Is your question if you can deliver a whole database within your plugin?
No for Postgres it depends
what do you mean depends?
Im pretty sure you can get away with only one db file.
I've managed
With Postgres wouldn't the client need it installed though?
Yes but you will have no idea if you actually have one file present if you dont manage the db yourself.
The user can as well have it sharded. Split on multiple hard drives to increase throughpout
no? Cant I just run it on the server?
The client as in the person using the plugin
Not the mc client
then they would
How would you go about installing something on the clients machine? Sounds pretty illegal to me.
but I am not making my plugin public
Ah well if you've already determined what your client has on their server then use that.
malware 😎
Although, no point in making a file when you can just use the DB the way it was designed
oh I am so dumb
This is the only thing i could think of that makes sense:
https://www.testcontainers.org/
its just been a shit load of time since I used postgres lol
forget all I said
I was mixing them up inside my head
I forgot that postgres have a user and you just connect to the user
whoops
H2 has a single file mode no?
Yes thats what you usually do. Config file with credentials and if the db is not reachable you use sqlite
Sure
do you know any java wrappers for postgres?
never heard of jdbc. java newbie here
Ah. It's basically a common SQL abstraction for java
oh
Someone find the baeldung
I suppose I mean the instance then
You just get the <DataBase Name> JDBC Driver and then do the same thing for every database.
thanks
But like, still confused what you mean with instance
That is gonna let you connect to existing dB
Not start one
I already have a started one on my vps
// This is only needed in older versions
String driverClassName = "sun.jdbc.odbc.JdbcOdbcDriver";
String url = "jdbc:odbc:XE";
String username = "scott";
String password = "tiger";
String query = "INSTERT INTO students values(109, 'bhatt')";
// Load driver class
// This is only needed in older versions
Class.forName(driverClassName);
// Obtain a connection
// Usually you use a connection pool instead (HikariCP)
Connection con = DriverManager.getConnection(url, username, password);
// Obtain a statement
Statement st = con.createStatement();
// Execute the query
int count = st.executeUpdate(query);
System.out.println("number of rows affected by this query= " + count);
// Closing the connection as per the
// requirement with connection is completed
con.close();
How to enter a bot in MC with The protocol?
Prepared statement is sobbing
Yeah and you usually use ps instead
How to code entire plugin with spigot api must be bedwar plugin?
You can take a look at PrismarineJS
But honestly no idea what you are asking
I mean, for making a bot attack to my server for testing antibot plugins
Yes you can only program kitpvp, skywars and bedwars plugins. Everything else is a virus
Just use PrismarineJS
Its NodeJS garbage but for a simple bot attack it will do.
@lost matrix Reckon i could get your insight?
I am trying to parse this huge file of password hashes:value for a school project. I am exploring a sorta network type structure. Each hash is a SHA-1 so 40 chars. Then i split it into 2 character blocks and put it in a network. Then, using a series of pointers, connect them all together using maps on each node.
The problem is, as i recycle these nodes so heavily in the interest of memory saving, each node must have a map of valyes based on the input hash. see code:
https://paste.ollieee.xyz/ivorafazox.csharp
So i wondered if you had any ideas on how to improve this. when i say huge I mean millions of entries. The maps for the values are really consuming a fair amount of memory so need an alternative really
Make one in rust
Is rust fast?
Yup
But I dont know rust
then don't do it in rust
Well for C++ your would need to manually implement at least the ping and handshake protocol
we talking that slow?
Take a look at other open source projects like council clients and see how they do it
And un java?
It's as fast as a bolt
There is probably a library for that out there...
Protocollib?
C is fast
One moment ill take a look at it
Than what
golang?
Go has only one benefit: Coroutines
Than all others
In HTTP is The fastest
The fastest Lang is assembly
Making requests
lol no. Rust and C++ and C are all way faster in the right hands
Everyone knows the fastest language is ruby off rails
Binary IS faster 🥰
in the right hands
is usually the issue
Yeah I only program with my left hand
And compiled for exactly one system
Inb4 jvm rewritten in Rust
I code with The toes
assembly gets compiled to machine code though
Was jk :v
And so does C/C++ and Rust
https://github.com/GeyserMC/MCProtocolLib btw might be smth ?
for your bot
then how is rust that slow?
C/C++ compiles to assembler and then compile to machine code
the only thing slow about rust is the compile time
faster than python?
Python IS slow
PS: You can compile java to native binaries as well. GraalVM
more or less hacky 😅
Coding with The JNI >
Everything is faster than python. Except JavaScript maybe. But they both have nothing on each other when it comes to performance.
Python just uses a ton of C under the hood. Pandas, Torch, Numpy. All of them are written in C.
it
was
irony
XD
Sometimes it is almost like, maybe the speed of a language isn't the only factor to consider 🤔
Why people says Python IS future? Is The future slowest lang
Sometimes it is almost like, maybe the speed of a language isn't the only factor to consider 🤔
its certainly not the only fact to consider
but a fact to consider
yea sure, but python is so successful because it does a lot of things right in regards to syntax
Python is just some glue to let actually fast components speak to each other. And its really fast to write.
^
If anyone creates a Python to C translator I'll use python
whereas writing rust requires a good few months of learning first and then probably therapy from staring at its sometimes (in my opinion) not-good syntax
Pretty sure such a transpiler exists already
Oh
fn OwO() -> bool
Wtf IS that syntax
that I don't mind xD
Æ
the syntax can be painful but its satisfying to just know where stuff goes wrong, not having to deal with random errors at runtime
obviously 👍 rust has a lot of upsides
Rust has good compiler
a pretty neat ecosystem too in terms of crates
I mean i really hate the python syntax to be honest. Im just too keen of strongly typed languages and their explicit but accurate syntax.
Some things i ekil[::-1]
Ok(())
rust 😍
getting main world via plugin object?
Bukkit.getWorlds().get(0)
Result<(), io::Error>
^ it is an implicit contract tho
Is bukkit owned by spigot?
same :(
You mean the object?
spigot
spigot


will this also work? plugin.getServer().getWorlds().get(0)
it is an implicit contract yea
the Bukkit class wraps a static Server field so ye
not defined by the API that world 0 is main world but basically given
One moment couldnt bring myself to read this
First of all: You could implement the composite pattern here so that Tree<V> extends Node<V> because they have pretty much the same properties.
this.SpawnLocations = {new Location(this.plugin.getServer().getWorlds().get(0), 23, -28 ,747), new Location(this.plugin.getServer().getWorlds().get(0), 23, -28 ,747)};
``` Why do I get arrayinitializer not allower here?
This way you can add Trees as a Node to another Tree
Because you are not initializing the array in the declaration.
thanks
new Location[] {}
Yeah this is needed instead
Next thing: Make your fields private
so I can do = new Location []?
new Location[] {} or new Location[fixedSizeLike3]
mmmmhh stupid
using json.simple is kinda on you
I wasn't bothering about formatting stuff rn
- but will do
Node<V> node = nodes.get(sectionString);
if (node == null) {
node = new Node<>();
nodes.put(sectionString, node);
}
Node<V> node = nodes.computeIfAbsent(sectionString, (key) -> new Node<>());
Use Gson or Jackson. I personally prefer the former.
that won't work
yea
Only works if Node has a String as constructor arg
oh right
smh average json.simple user
Noice. And salt it with a type adapter factory for Interfaces, abstract classes, one for records and one for ConfigurationSerializable. Then
you can throw everything against Gson and it just works.
Actually thats something for a new resource thread. Creating the uber Gson instance that can serialize everything.
sounds fun
how to get a Material from namespace, ex minecraft:stone to Material.STONE?
Was thinking about if it takes the whole namespace:key or just the key
can also take a namespace
til
would be depressing if not ngl
thanks
someone is kinda depressed today
kinda
I can't use the dependency with Maven of WorldGuard in the pom.xl, I know that sometimes IntelliJ is strange over dependency, I tried using the system path, and that work, but I can't use some classes.
I dont get why so many people write something in Rust here.
Isnt it like a super niche language? I personally have never touched it.
heeheeheehaw die
def isn't niche
Like I can't get the RegionEnterEvent.
can you provide your pom.xml ?
Arc<Mutex<mpsc::Receiver<Message>>> kekw
Maybe you are using an old version. Show pom.
nothing worser than the java Iterator<Map.Entry<K, RemoveQuery<K>>>
kotlin?

yea
tf is that bullshit
actually its Arc<Mutex<mpsc::Receiver<Box<dyn FnOnce() + Send + 'static>>>>
well just bad typescript
code shall be easy to understand
did u write it
Developing on windows 🤡
i guess i uninstalled rust
bro he aint even using wsl
mye need a new ssd and ill remove my whole os anyways :(
Yea xD
i dont remember fully
but i think microsoft
said that WSL performs better than cmd
in some wiki
Well the FS is better :>
imma use linux 24/7 with new ssd
file system?
what file system
I got wsl2 for docker
😴
whats wsl2 then
wsl v2
wdym
structure or what
linux is well more organized
hashmap doesnt allow nulls for values right?
yes it does
Whether we like it or not (and we don't), file operations in Windows are more expensive than in Linux, even more so for those operations that only touch file metadata (such as stat).
basically
ah thats where npe is coming from then ig
haha
windowz has no btrfs
imagine not being able to take full system snapshot
with ultra small size
I think I have found a way to live update player skin, with no respawn packet (so with no flash animation involved), nor npc:
pl = Bukkit.getPlayer("AlexisBG");
sp = as.getServerPlayer(pl);
destroyPlayer(sp,pl); // sends a new ClientboundRemoveEntitiesPacket(pl.getId())) to sp
removePlayer(sp,pl); // sends a new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.REMOVE_PLAYER, sp) to sp
changeSkin(sp,ptexture,psignature); //same method than yesterday, no packets involved just changing the textures in gameprofile
addPlayer(sp,pl); //sends a new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, sp) to sp
createPlayer(sp,pl); //sends a new ClientboundAddPlayerPacket(sp) to sp```
And it does seeem to work, the skin does change, but... i can't move the player anymore. Also I watch directly in the new skin; seems like i'm not in the point of view of my player anymore. (but it at the same position, pitch yaw etc) @eternal oxide
thats what she-
mainLoop.runTaskTimer(this.plugin, 0L, 1L);
``` this is correct for repeating every tick right?
@eternal oxide do u have an idea whats causing this?
Spigot has an api way of doing that
You can;t send a REMOVE_PLAYER to themselves. it will delete their clients association with their avatar
not for players, setSkin requires an URL, which doesn't contain the signature information. It's for npcs
ok i just did, it's the same
It feels like i spawned another player which is me, but my pov is not this player. Now i can still see my arm (which was of old skin), and i'm stuck in the middle of the newly spawned player
will java be clever if i do:
map.put("kee", 12453);
map.put("val", 12453);
Or will it store two different integer literals
createPlayer(sp,pl); is spawning a new player
it will call Integer.valueOf no?
The default integer pool goes from -127 to 128
So unless you change it, those two will be stored in separate objects
ah ok
is there a way to play animation that plays when right-clicked on tile entity?
org.json.simple enjoyer
how to get fluid?
From your tap
I need to check if the block is water or in water
Block block = player.getTargetBlockExact(4, FluidCollisionMode.SOURCE_ONLY);

Check if its a water block or water logged
how?
- block.getType() == Material.WATER
- ?
ew
Any way to make an entity half transparent
wut
you mean like players
i think thats the only possible entity
Anyone know why Buildtools doesn't decompile every Minecraft class?
Trying to get ClientboundRespawnPacket. Its in teh Mojang-remapped jar but no source in teh world folder of BT
how to send actionbar message?
player.spigot().sendMessage(MessageType.ACTION_BAR, new TextComponent("boo") /*i believe*/)
and to keep sending it, use a runnable
We love SimpleJSON
thanks
player.sendActionBar(Component.text("Action bar"));
smh
Youre in the decompile folder yes, the correct one?
yep
I clean built spigot
there are some decompiled in there but many are missing
Anything that's not modified by CraftBukkit will not be in CraftBukkit's source directory
You have to copy it from the clean decompile directory, work/decompile-xxxxxx/src/main/java/net/minecraft/...
Then past it into CraftBukkit/src/main/java/net/minecraft...
Resolve any decompile errors if necessary, modify to your heart's content
(assuming you're making a patch. If not and you just want to find the file, browse the clean decompile sources because CB doesn't really touch packets much)
its not in any of the folders under work
The respawn packet probably uses Spigot mappings
PacketPlayOutRespawn or something like that
Only newer packets are using Mojang's remapped names atm
Theres actually nothing with respawn in its name in the world folder
Well, no, it won't be in the world folder
net/minecraft/network/protocol/game/PacketPlayOutRespawn
All gameplay packets are in that directory
how does one retrieve the #ItemStack present in the crafting grid from a #CraftitemEvent ?
odd
getInventory().getMatrix() iirc
Indices 0 - 8 go from top left to top right, middle left to middle right, bottom left to bottom right
012
345
678
thanks!
Might be empty in CraftItemEvent. Not 100% sure if that event is called before or after the craft
i'll just check and see
i'm adding custom items but for that i need to cancel the vanilla craft with them
eg: custom ingot using minecraft's iron ingot, i need to disable it from being able to be used in recipes using iron ingots
but for now that looks right
You can just call e.getInventory() and it will already be a CraftingInventory for you
oh