#help-development
1 messages Β· Page 1588 of 1
that being said, I distrust codemc, so we will disregard the pom entry
Yes
the Bukkit.getServer().getDeclaredField(.. gives me a NoSuchFieldException
that shouldn't compile
i forgot to try{ it
this should still not compile xD
Get it from simple plugin manager
well add the respective catch blocks
HEH,??? it only wanted "Try" and "finally" just a second ago
LOL
K i did some auto stuff
hope this is right π
ima make something to try it lmao
So uh why are you accessing the command map
Field f;
try {
(f = SimplePluginManager.class.getDeclaredField("commandMap")).setAccessible(true);
CommandMap map = f.get(getServer().getPluginManager());
return map;
} catch (ReflectiveOperationException e) {
e.printStackTrace();
}
return null;
Wrote on phone but that should work
How to protect plugin?
what server version are you running
what do you mean
its unrelated to this
well i see net_minecraft_server_1_7
yes, it still is minecraft and this error is caused by me not 1.7
Players can use /pl a
yes
I cant protect this command
#help-server @rain lynx
anyone know whats causing the ArrayIndexOutOfBoundsException?
is args set
have you set args?
i dont get any error in the pom.xml, but i still cant use it... it doesnt exists, at least for intellij
you can see in the code
i cant see if args is set but i''ll assume it is
reload your intellij maven representation
how
because the ArrayIndexOutOfBoundsException is caused by trying to access an index that isnt accessible//out of bounds
oh
open the maven tab -> click the reload like character
You're accessing something out of bounds and you're not showing all the code
so should i put the spawnCannon method above the command
idk that much
but i mean, i would personally lol
anyone know javascript?
if you mean this, i did it several times, and still the same
Yeah what about it
not the place for this
um it is π€¦ββοΈ
where then
probably not the help-development channel
Should be fine here
i just dont see where it relates to serious bungeecord programming/development help
It's development either way
i'm just wondering how to make a javascript website
Did you miss Ask other questions here
besides plugins are made in java
Yeah I can help with that what's the problem ;/
java != javascript
i need help
With?
a website
what about the website
do u have any css tutorial
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
i'm brand new to this plugin dev thing and i get the error The import org.bukkit cannot be resolved and I think it's becuase my server jar isn't in the correct place. my file structure: https://ibb.co/gmT9M8t
W3Schools
what are you trying to import
how would i fix the ArrayIndexOutOfBoundsException? this is the line causing it
You need to add spigot to your pom
org.bukkit.plugin.java.JavaPlugin;
yeah add spigot to your build path or pom.xml
ok thanks
This is obviously not the right code. Make sure you're running the latest version of your plugin
You're not accessing an array here
who keeps reacting can you stop?
anyone know any good forums software
sorry, im just agreeing with them
Now we're getting offtopic go to #general
k
so what version of spigot/paper are you using
because it seems like your server version is 1.7
1.7 :kekw:
Oh
but i am implementing CommandExecutor
thats unrelated to the issue
π€¦ββοΈxd
Did you forget to add the command in your plugin.yml
3 n
Whats bLib line 145
He showed it
is it line 145 though
I already found the issue
This
ah right
whats the issue?
Typo
Youβre trying to retrieve βcannonβ from the plugin.yml, but itβs written βcannnonβ
lmao thank you
Throw a runtime one or sneaky throw
I have an issue with mysql
The url is not working for some reason
It says there is an issue with the input string for the URL as seen in the screenshot
the URL is within a config file
is there an issue with Strings in config files?
it didnt change
yeah so why are you passing (looks like a user using '@'), are missing the jdbs:mysql:// prefix etc
or what are you passing to the connection driver
yeah why are your user and password part of the string ?
how do I format code?
what xD
?paste
The set connection method passes 3 args
the url for the connection
the user
and the pass
Yes but your databaseUrl already contains user and password
Give it a try
Can't you just do throw Expection ("test"); ????
idk if that is your issue /shrug
Actually I looked at my other project
the user and pass go along with the URL within the method
even tho the url may contain the username itself
Rule of thumb tho, you don't wanna include it in your url π
@granite stirrup it has to be unchecked
the super function does not throw any exceptions it self
if it was JavaPlugin#OnEnable throws Exception then it would work
then try-catch it and wrap it in a runtime exception ?
why would it have to be unchecked
also, how do you disable the Bukkit plugin.yml json schema in eclipse?
@eternal night thats what im doing
hello guys and there's a very important question for me and I need some helps.
In 1.16.5,I want to listen the PlayerInteractEvent but I suddenly find that only the left click air and right click block will call the event,left click block and right click air will not call it.What's wrong with it?Or it's my question?Thanks!
The only known issue is that right-clicking into the air without an item in your hand does not trigger the event. Everything else works fine for me, maybe you have some wrong logic in your event listener.
Can anyone tell me how I can add 1.17 support to my plugins? since it's java 16 for 1.17
i made my first plugin but and put the jar file in the plugin folder, but for some reason its not loading up when i execute /plugins. Anyone know why this is happening?
missing plugin.yml ?
there should be errors in the console when starting the server
declaration: package: org.bukkit.scheduler, interface: BukkitTask
You should not link that in here
its saying that org.bukkit.plugin.InvalidPluginException: Cannot find main class `com.TheB2D.IntroPlugin'
any idea how to fix that
well seems like your plugin main class is not where you said it is
ah
your main as defined in yoru plugin.yml is pointing to teh wrong class
are you sure you are working on a bukkit task
also https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/scheduler/BukkitTask.html#cancel() there so we don't even mention such an evil fork ever again :kappa:
declaration: package: org.bukkit.scheduler, interface: BukkitTask
taskID = Bukkit.getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable()
thanks! fixing it now
yikes, imagine still using task ids
Hey I want to change all dirt blocks to tnt in a world.
I tried it with ChunkPopulateEvent but it causes stackoverflow errors and doesnt really work and makes the server lag:
@EventHandler(priority = EventPriority.MONITOR)
public void onChunkPopulate(ChunkPopulateEvent e) {
for (int x = 0; x < 16; x++) {
for (int y = 0; y <= 131; y++) {
for (int z = 0; z < 16; z++) {
System.out.println("Should have changed something");
Block block = e.getChunk().getBlock(x, y, z);
Material material = block.getType();
if (material.equals(Material.DIRT))
block.setType(Material.TNT,false);
}
}
}
}
And writing an own generator also doesnt work because it doesnt contain the default generator.
What should I do to solve this problem?
solved,seems a server issue
that should not make a difference xD
An error occurred while i was starting up the plugin in my server this is what it told me java.lang.UnsupportedClassVersionError: com/TheB2D/IntroPlugin has been compiled by a more recent version of the Java Runtime (class file version 60.0), this version of the Java Runtime only recognizes class file versions up to 52.0 Any idea how to fix it?
So i would install java 16 right?
yea
thanks
first: don't do that on priority MONITOR. MONITOR is only for monitoring NOT manipulating. second, you may wanna use the ChunkLoadEvent. also iterate through y after iterating through x and z.
I mean your stackoverflow issue is caused by editing edge blocks isn't it ?
those would load the next chunk etc
possible
ChunkLoadEvent would replace any dirt block after loading, even though they were modified by a player
The first thing seemed to have solved it, idk why the tutorial meant that
isNewChunk
so you have to be clearer at what you want
it runs everytime anything loads a chunk serverside
So ChunkPopulateEvent would be better for that purpose, right?
you could use setBlock(BlockPos pos, BlockState state, int flags, int maxUpdateDepth) in Level for it
passing in maxUpdateDepth of 0 should prevent updating/generating neighbour chunks
default update depth is 512
flag is respectively 2 | 16 | 1024 (that is at least what craftbukkit uses
which becomes 1042 after bit manipulation
Umm okay what I have now (My code just without the event priority) works fine with a nice tps and everything
... but not for the first chunks in the world
load: STARTUP in plugin.yml?
Solved it
Is there an easy way to loop trough the section I highlighted? I tried making a custom method to do this but it's kinda annoying to use..
Is there any way to make explosions less laggy?
how can I automaticly reobfuscate 1.17 nms in intellij idea?
the easiest way is to have for loop for x and inside of it also for loop for y
and then convert the x and y co slot id
didn't the spigot post elaborate how to reobfs code
I'll try this thanks
i think, that its x + y*9
This should also work thanks
yep, only but using maven plugin or doing it via cmd
for (int column = 1; column < 6; column++) {
for (int row = 1; row < 4; row++) {
int slot = (row * 9) + column;```
if you aren't using a build tool, you should not be coding NMS tbh
at least not post 1.17 NMS
I think you missed a few columns in that loop
missed the outside columns
thanks
Arenβt you only looping 5 columns
yes, its just an example so he can see the logic
I'll modify it a bit to work with others inventory sizes aswell
i am using wired system, that isn't really the best thing that i can use, but it was easiest solution and it is, that I use maven for dependencies, but I compile it using the intellij compiler and I have tons of artifact, that automatically deploy the jars to the spigot servers and I am not maven expert, so I don't know how to do it better
the goal was mostly to make it as easy, that I hit ctrl + F9 and all jars are updated
I guess you could make a compound intellij run configuration
that executes the cmd after you compile your jar
ok, i am going to have lunch and then I'll try it
Is there any way to stop tnt from exploding from lava in newly generated chunks if I would change all dirt to tnt?
i think you will have to alter the generation of a new chunk then
Already did that but there is the possibility that lava is next to tnt on generation
Do you know how a chunk is generated? Is it synchonious(ground to top) or with a certain block order?
Idk I mean that I just replace blocks when a chunk is populated (event)
I want to destroy an entity client side, but somehow PacketPlayOutEntityDestroy is not exist. https://paste.md-5.net/uyiduvafic.cs
are we speaking about new generated chunck or new loaded chunks?
New generated
and you modified it to have tnt in it?
Yes
then look how a chunk is generated because without knowing that. Or you will have to add an event that destroys entities bcs when tnt goes in exploding modes it becomes an entity right? This last method will be inefficient. so try to understand how a chunk is generated ant then try to alter the chunck generation in an efficient way π
https://wiki.vg/Protocol#Destroy_Entity there you go π
wdym?
public void hideEntity(final org.bukkit.entity.Player player, final net.minecraft.world.entity.Entity nmsEntity) {
final PacketPlayOutEntityDestroy spawnPacket = new PacketPlayOutEntityDestroy(nmsEntity.getId());
((CraftPlayer) player).getHandle().b.sendPacket(spawnPacket);
}
I do the same thing as that.
Thats the method used to despawn a cliend side entity π
java.lang.NoSuchMethodError: 'void net.minecraft.network.protocol.game.PacketPlayOutEntityDestroy.<init>(int[])'
Basically sendPacket method but for all online players.
u are using reflection right?
is the class still called that
yeah i think so lynx
Nvm lava cant ignite tnt so I wont be able to fix it I think
I don't
oh
I use 1.17.1 buildtools, do you need to modify the remapped thing?
I don't even use the remapped-mojang
not sure
well before the chunck is generated(in async modus so no problem) you can loop trough all blocks and check if lava is aside of a tnt block. or keep a list of item locs of tnt an check for the laba blocks arround it. Should be simple enough π
No
The superclass doesnβt have that throws declaration for onEnable
@eternal night so I tested out the the method for get Connection
turns out this works
the same way it is done within my code of the plugin
leading me to believe there might be some sort of an encoding issue within the .yml files
If you do not include your user/password in the URL and use ' you should be good
wdym by using ' ?
single quotes
escape a string i think π but then for sql
What are default volume and pitch when using the sound method?
1 i guess
How to Remove a Player from the Tablist?
PacketPlayOutPlayerInfo(EnumPlayerInfoAction.b, npc) doesnt work and PacketPlayOutPlayerInfo(EnumPlayerInfoAction.REMOVE_PLAYER, npc) doesnt exist in the newest version
have a question ,i have a server on 1.17.1 but i see that not that much has come out on it many things are still not updated to 1.17.1 and stayed on 1.17 so i was thinking will mods of 1.17 work in 1.17.1?
yup
is there a way to keep calling some code?
oh ye sry
while loop
openning a thread π
lmao
?
yo dont lol π
just use a timer
or even the bukkit scheduler
a thread π
no.
does it work like onEnable?
a thread is totally redundant and will do nothing than throwing errors because of thread-safety
ok so i will not do that
what exactly do you mean? onEnable is called one time when enabling the plugin
or do you mean inside or at the onEnable method?
my friend told me smtg else
depends how work with it :). async schedulers are tasks i think. basically a complex optimized thread π
async schedulers are a part of an ExecutorService which belongs to a ThreadPool
a piece of code should run whenever the user says a command
but that code is in a different class
didnt they changed it to tasks? I didnt look at the api in year π
forget what i told before
and also not. the bukkit api is not made for multi threading. it will throw concurrent exceptions as long as you don't use thread-safe methods just like broadcastMessage or so on
remove it from ur brain
callback it
like @hybrid spoke he sais use a scheduler π
uhm i dont know what any of this is
how do i do that?
This tutorial will guide you in using the scheduler provided by bukkit. It will allow you to defer the execution of code to a later time. This is not the same as registering a Listener, a block of code which is executed in response to an event in the game. Blocks of code may also be scheduled to be executed repeatedly at a fixed interval, with o...
i dont want it to be called at a certain time
i want a code from a different class
to be called
You shure about that? thins like a not ingame calculation can be perfectly used outside the main main thread?
either just call the method or as i said use a callback. you could use a consumer and accept later on the player which executed the command.
ohk
things like a not ingame related calculation are not bukkit related and not a part of the API.
True, I know that but things from the sync server can be put in a thread to not use the servers resources π. Sometimes for example databases could it be handy.
BTW i asked myself this question maybe you know it. Is it possible to change the server tick rate?
yes ofc., thats always possible and SHOULD be done. any thread freezing operations should be done async.
it is possible. i've even saw a plugin which stated that it does that, but i don't know how.
you can limit the ticks and also increase them since 20 is just the cap.
asking again from a few days back, is there any good way of seeing if someone is using the bedrock edition using protocol trickery without relying on checking specific APIs for it? are there any tell-tale signs?
It still uses the serverβs resources just saying
Threads are pretty expensive
Use them wisely
Executors π
Exactly
^^
Ye
can we be shure they are right? Lower yes maybe but higher than 20 ticks is like yu said just blocked. I for example i made a server api myself would the client be able to handle for example 40 ticks or is it capped at the client on 20 ticks?
?scheduling is the spigot ver
the client doesn't even know the ticks. i am not sure what would happen. could be just like counter strike where a few servers are at 64 and a few at 102-128 ticks
always idd. but how expensive? Do they have a mesurement on it?
You donβt have to set the cap. The issue isnβt that, itβs just how many resources the server has that can run that many ticks. Also, donβt expect anything to be smooth
Depends on how you use them
Btw hereβs a plugin for that
well its a tcp connection but its the cleint that starts it so its the client that needs to give the commands right?
In Spigot, is entity health dealt with in hearts or half hearts (as in 10/player or 20/player)?
Well client and server is different my guy
Half
Thanks
<dependency>
<groupId>me.imaginedev</groupId>
<artifactId>GalaxyShopAPI</artifactId>
<version>v1.0.0</version>
<scope>compile</scope>
</dependency>
<groupId>me.imaginedev</groupId>
<artifactId>GalaxyShop</artifactId>
<version>v1.0.0</version>
<packaging>pom</packaging>
<name>GalaxyShop</name>
<properties>
<java.version>1.8</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<modules>
<module>api</module>
</modules>
What is the packet name to make entity ride another entity?
attach or mount
hmm. so we can see the client and server relationship as a type of queue at the server end. now every tick the server handles requests then? Increasing the tick rate will give a smoother experience. But doesnt the client act like a single world with an own mind with little input from the server then? If we increase the tick rate will the client world view be a little more correcter?
for the client it would be cancer
It will have so many modifications per tick and you would have to rework a ton of things
and the server would literally burn
Mhm
Attach Entity
This packet is sent when an entity has been leashed to another entity.
and for the mount, they only have 1 parameters which is doesn't make sense
Its just all hypothetical. its to understand the inner working of the whole system. Also its quite nice how they have made it π
i think thats the entity which is being mount or mounted to. you can set via the packets what should happen to which entity iirc.
from the wiki.vg, it says attach entity is for leash/lead
https://wiki.vg/Protocol#Attach_Entity
well looks like the have done it π thx for this. Im not gonna use it but looks nice know it can be done π
i've used attachentity in 1.8 since there was no mount packet. now there is, so use that. attach entity should also work since it attachs an entity to another
but there's only 1 parameter on the PacketPlayOutMount
as i said, the packet should have methods to modify it
I don't see the methods to modify the passengers
@eternal night how would I go on about adding single quotation signs in the yml file?
Without manual editing
by manually editing it ? it is a configuration file what
\'
your plugin is not going to provide actual credentials by default is it
Yea, and if their password requires it to be escaped/used in single quotes it is their job
But the url cannot work since it isnt provided as an arbitrary string
Anyone can help me
im making a spigot plugin where there are custom recipes
and
I don't have a clue of how to make a custom recipe
i googled
Then you didn't google good
google harder
Theres a wiki about custom recipes on Spigot
i got a result of Create a ShapelessRecipe and register it with Server#addRecipe(); To listen for what player crafted the recipe, you will have to listen for a CraftItemEvent
"custom recipes spigotmc" and you will get the wiki
Hello guys,
Today I want to show you how to add some custom recipes in to your Minecraft server. Custom recipes add a lot of uniqueness to your server,...
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
bukkit docs LMAO
true but was the first i found idk why lol π should be almost the same
I cannot change the block data of an air block for the life of me. I don't understand. I have a BlockData, and I try to set it to a set of blocks, but the air blocks don't get affected
@eternal night @river dirge
Bukkit's docs could be almost the same but prob won't be
basic things yes. But you are right i maybe had to give him something up to date π
Considering Bukkit is abandoned theres a reason why a lot of stuff is being moved to the spigot wiki
why are you doing '"something"'
wasnt spigot in the beginning not based on bukkit? I dont know the whole story why bukkit did vanished. i tought something about stealing src of minecraft itself?
url: 'myLiteralURL.com'
Im trying to only add '
should be enough
my armorstand spawn code is:
ArmorStand stand = world.spawn(location, ArmorStand.class);
stand.setInvisible(true);
stand.setVisible(false);
stand.setBasePlate(false);
stand.setMarker(true);
DataContainer.setKey(stand, "distracting");
golem.setTarget(stand);
you've set it a marker
Spigot has always been a bukkit Fork
I don't know if spigots yaml interfacing allows for specific use of single quotes
you cant even interact with it if its a marker
Just Bukkit is abandoned and Spigot maintains its fork now
Escape them?
k, any alternatives?
Haven't done that but I'd guess that'd be how
Escaping is ugly if there is string literals
removing the marker
i need to set golem's target
you know why bukkit vanished? Is sponge still used?
Bukkit's team left as it was revealed Mojang owned them and one of the devs filed a DMCA
?dmca
An unofficial explanation of the DMCA can be found here: https://www.spigotmc.org/wiki/unofficial-explanation-about-the-dmca/
That will have some more info
When I use the command from spigot forums to obfuscate nms, it gives me this error
Error: Could not find or load main class net.md_5.specialsource.SpecialSource
Caused by: java.lang.ClassNotFoundException: net.md_5.specialsource.SpecialSource
what should I do?
nope, windows cmd
give it a try in git bash
did spigot wrote all the code or are they still working on it?
Main Pom
<groupId>me.imaginedev</groupId>
<artifactId>GalaxyShop</artifactId>
<version>v1.0.0</version>
<packaging>pom</packaging>
<name>GalaxyShop</name>
<modules>
<module>api</module>
</modules>
<!-- ... -->
<dependency>
<groupId>me.imaginedev</groupId>
<artifactId>GalaxyShopAPI</artifactId>
<version>v1.0.0</version>
</dependency>
api module's pom
<groupId>me.imaginedev</groupId>
<artifactId>GalaxyShopAPI</artifactId>
<version>v1.0.0</version>
<packaging>pom</packaging>
<name>GalaxyShopAPI</name>
<!-- ... -->
<dependency>
<groupId>me.imaginedev</groupId>
<artifactId>GalaxyShop</artifactId>
<version>v1.0.0</version>
</dependency>
https://prnt.sc/1ed5hmz
and heres the error βοΈ
maven people go to work
?paste imagine using
Spigot maintains a bukkit Fork but "bukkit" itsself is not maintained.
As Spigot is built on bukkit is has to be maintained
its not even a lot of code π
you filled the entire channel
did you just link us an error from your IDE π
aint my fault there arent two of em
fam run mvn package and link the output
same
also why is your API packaged as a pomn
gradle == shit
next question, why does your API depend on your implementation π
admittedly mavens error system is fucking shit
LMAO?
idk, if I wanna waste 10 days to update all my project to the next breaking release of gradle I must really enjoy pain
im deadass just learning modules and how they work
why didnt they just rewrote the code? wouldn't it be much simpeler? Then they would own the whole thing?
see
?stash
Yea api depending on impl doesn't make much sense, concerning that your implementation would need to depend on your api to implement the api interfaces
Spigot modifies things but not that much
im deadass just learning modules and how they work
can you help?
would anyone be able to help me with skript?
NO
with modules ? xD
yeah
Go to Skripts discord
skript has their own discord, you should ask there
we hate skript
i cant find it
fake programming
lua x .txt
A site dedicated to serving the Skript community
took me 1 second on google
The point of an API is to segregate the implementation. You only want your implementation to depend on the API, not the other way
might as well be this:
if the event's player's name is "Hi" then
send them the message "&4Bye"
jesus fucking christ im learning modules not using it
I see
well what is real programming? C? Java? Python?
im wondering why its not working i dont care about the implementation
anything but skript
well, you have a root mvn project right ?
I mean isn't Skript technically a language?
yeah
which lists both your API and your impl as modules
As bad as it may be, it still is programming
so both?
I'd hope so o.O
Take Brainfuck for example, that's a programming language. It's not useful at all but it's just kinda there
killer of entity can be someone else besides Player in PlayerDeathEvent?
if (e.getEntity().getKiller() instanceof IronGolem) doesn't work
The problem with skript is it is so used and the performance is crap
People do not care
And most of the skript programmers dont know when to not use skript
java too lol well not super cry but there is some work behind the scenes
People will make entire gamemodes out of skript and wonder why the performance is shit
only time to use skript is to send a message on command
They just wanna get it done. It's a Python situation, just wanna get it done with not as much regard to how it'll actually perform
My performance with my java plugin is amazing doin't know what you're on about
if you aren't running a 10k player network but rather a small server, skript works well lol
Ummmm, of course it is?
But people aren't gonna learn Java
Lmao
Clients are incredibly lazy
I was replying to trolking
Ah
One time I didn't use the reply function lmao
I have seen enough java developers that manage to screw their performance
Well, that's pretty normal
welllll
well performance is c or assembler xd
I knew someone that ran a task every millisecond
the overhead of skript is also being reduced with every other release in which they update their interpreter
and wonder why it caused a performance drop
Async.....?
one day, skript might just be the JS of spigot
No
and there you go
wait, that i even possibe to run it not async every milisecond?
They would do checks every millisecond in an update task
python would open so many door for a server client π
For no reason xD
Sync looping
No scheluding
My update task runs every 5 seconds but its being difficult to me lmao
Like for whatever reason something is meant to run every 30 seconds but it takes 4 minutes and 11 seconds
If I make a recipe with https://www.spigotmc.org/wiki/recipe-example/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
noh dont
shit I could zctually refresh this LMAO https://cdn.rackdevelopment.tech/img/Kizvz61Dds.png
Ohhhh noooo two whole seconds
there we go its now +0.028 s
@dusk flicker add stuff to your website
lazy
ya know what I might actually make an update task in a standalone project
and shade it in xD
add a magical cow
Everything between client and server is done and through packets, no specific queue structure is involved.
If I make a recipe using https://www.spigotmc.org/wiki/recipe-example/ Will I find the recipe in the recipes section thing in minecraft? like in the Green Book thing
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
ye
I believe so
Great
i was thinking of adding spawner support to my shop plugin, since everything runs through PDC's, people wouldn't care if they didnt stack with other plugins right? who cares about stacking spawners in your inventory. now adding spawner stack support to other spawner plugins may be a problem. anyone got thoughts on this
yeah but the server does it process the packets every tick or is it processed directly? The queue was more like a place to store those arriving packets.
they're legit maps on items
lul i have it
i finished it yesterday
LOL
?
imagine not knowing what pdc is π’
i meant the idea
?pdc

actually
declaration: package: org.bukkit.persistence, interface: PersistentDataHolder
rip
lmao
REKT the other way around
@eternal night @river dirge so I was searching for a while now,and cant really seem to find a solution for my issue
Spigot does not provide a built in way to write the single quotes?
idk why you want your plugin to set defaults in a yaml config uses single quotes π’
?
Hmm itβs queued sort of, I mean it intercepts the packet and then if it needs to be done synced then it queues a task to the server thread and so on.
I am pretty sure it is async
How can I send a plugin message from spigot to BungeeCord?
oh shit that exists
May need to check the SnakeYAML docs to see if they have an option for it as its the lib that spigot uses
thx
the url gets messed up if it is not an arbitrary string which it isnt in case of the config file
do you want to add a single quotes to a config file then add them in tthe yml file or if u use it in a predfined string use just an a single quote there π
Its the bungee server
Yes but then have whoever puts the url with fucked characters that need to be escaped add single quotes
You would need to get the data from the server somehow, prob with PMCs
View link:
?pmc
so receiving each pakket is async? but they have to get it to the main thread so we are speaking of a very heavy server then?
Why does this lobby command not work...? https://paste.md-5.net/boboxitiwo.java
It is async in respect to the server thread. wym heavy server?
ooh i thought per client making an async taskπ
any errors, etc Β―_(γ)_/Β―
Thereβs no plausible way it could be done synced
they run their own thread
No
@dusk flicker there is a huge error in the console that says that there is an error in the connect method
in line 15
Client and server just spam packets to each and another. Server intercepts them async using netty, then if it needs to be done synced then it just makes sure itβs done synced. Client itself iirc doesnβt tick (might be wrong) at all, it just reacts to server packets and user inputs.
Hello
will
recipe.shape(" E ", " E ", " S ",
" E ", " D ", " S ",
" E ", " E ", " S ");
work
I don't know if I'm doing it wrong
because i want it to be 9 slots
(all of them)
@ivory sleet and how can i connect the player to the lobby server when he types /lobby?
Implement a bungee command using a bungee plugin is the easiest way
Re-read the docs
okay
or you can just use the connect plugin channeel
You need to re-read the wiki, it says how do set the places. There is only 3 arguments but that represents all 9 slots
"123", "456", "789";
Oh no a troll Is typing
but you already sent your message?
client server is tcp. if they maintain the possibility to stay connected(what they are from the mc protocol) then they an just spamm each other with packets no?
Wym?
samB440 answered it already. i was questioning if the client had a set tick rate too.
the keepalive packet is the important one
yu true
but they should be encrypted so we cant watch the packets sadly π¦
?
I recommend reading https://wiki.vg
after a connection packet is send to the server client. the client has to send an encryption packet. after that i suppose all communication is encrypted so we cant see the contents of the packets π¦
Except if you are in offline mode
thats a thing i didnt know π intresting. the link you gave me is rlly nice. I saw the mc protocl wiki page. I did try to make a connection to a python server client i quickly made and got a respone i was pretty satisfied with that already xd
how do I break a door? It always breaks only half of it
what version are you on
1.16.5
Block#breakNaturally?
yes
is there a way to use world edit's copy feature with my plugin?
Basically I want it so that someone can select an area and then whenever someone enters that area i want to show a message
worldedit api
what is not working
ohk
?paste
use that
π
how can i send a player to a server in BC? i never used BungeeCord before sorry
anyone stupid enough to buy that source is asking for trouble.
what the fuck
the whole naming is fucked com.src4sell.SrC4Sell.Main.onJoinLockdown
nvm
on is lowercase
it
nvm
just the fact that they used Main is enough of a "steer clear" message
Bro dont be toxic
Not making fun of you, criticising code is constructive
Thats not toxic. Main is the name of a class for an executable application, not the name for a plugin class. Simply the fact of using Main shows a lack of knowledge and as such is a clear warning to not buy this code.
okay i know what you mean
A class named Main should only be one of a kind per application, in spigot we already have a class called Main
I guess I could have written a paragraph detailing my reasoning, but anyone competent understood a single sentence.
but does anyone know how can i send a player to a server in BC? i never used BungeeCord before sorry
Plugin messaging channels
there is a specific message you can send to Bungee to transfer a player
okay thanks
You have a null object...
Main.java:46
Might be an idea to fix your package names then
package names are all lower case
classes are capitolized
Field and methods are camel case
Your humility is refreshing. It reminds me not to be an ass, thank you
is there any way to stop my server from doing this?
[16:49:07 WARN]: Excessive velocity set detected: tried to set velocity of entity #12045 to (-0.042823603858886006,1.8,-4.019945958770586).
[16:49:07 WARN]: java.lang.Exception: Stack trace
When I run&jump on a jumppad, this happens and my console is spammed with the above error. Is this something I can disable?
https://romano.eats.dog/HLvp9TbC
Is there a reason you need such a large velocity vector?
can you not make it smaller and still be fun?
yes but if I could keep it like this it would be better
does anyone know how to destroy a door? when I try it always breaks only half of it
Whats the difference between makinga plugin with Java 16 and lower Java versions, and what version should I use (for 1.16 plugin)
NamespacedKey key1 = new NamespacedKey(Onceuncraftable.INSTANCE, "Skeleton");
ShapedRecipe recipe1 = new ShapedRecipe(key1, new ItemStack(Material.SKELETON_SPAWN_EGG));
recipe1.shape("BDB", "DSD", "BDB");
recipe1.setIngredient('D', Material.DIAMOND);
recipe1.setIngredient('B', Material.BONE_BLOCK);
recipe1.setIngredient('S', Material.SKELETON_SKULL);
Bukkit.addRecipe(recipe1);
will this work
@dusk flicker
sorry for ping
ye
I can;t remember if Namespacedkeys accept upper case letters
it can't
bump
pls
java 16 just has some features, that older java doesn't
for 1.17 use java 16
for 1.16 java 8 or 11
oh
based on if you want newer features (java 11) or compactibility with older java
what are the features?
you can also use java 16, but then the server must also have java 16
NamespacedKey key1 = new NamespacedKey(Onceuncraftable.INSTANCE, "skeleton");
ShapedRecipe recipe1 = new ShapedRecipe(key1, new ItemStack(Material.SKELETON_SPAWN_EGG));
recipe1.shape("BDB", "DSD", "BDB");
recipe1.setIngredient('D', Material.DIAMOND);
recipe1.setIngredient('B', Material.BONE_BLOCK);
recipe1.setIngredient('S', Material.SKELETON_SKULL);
Bukkit.addRecipe(recipe1);
WHY ISNT THIS WORKING
anyone can help please
for java 16 it is for example, that instead of
if (commandSender instanceof Player) {
Player plr = (Player) commandSender;
//code
}
you can use
if (commandSender instanceof Player plr) {
//code
}
so it is mostly, that you have some shorter syntax
ooh ok
did you run the file?
the code*
its onEnable
do you have an error message ?
whats Onceuncraftable.INSTANCE
no
1s
replace Onceuncraftable.INSTANCE by this
public final class Onceuncraftable extends JavaPlugin {
public static Onceuncraftable INSTANCE;
@Override
public void onEnable() {
INSTANCE = this;
}
}
if its in your onEnable just use this for your plugin instance
if it's in your onEnable
no its not in my main
but always use at least java 8, because it is required by spigot (older than 1.17), so it will run on every machine, that can run the server and it aded some great features as lambda expressions
What
You can't have more than one JavaPlugin class
I'm guessing he's calling a method in another class from his onEnable
ok π
you don't call the method?
i had two JavaPlugins
lol
but what do i do??
only have one
new recipeMaker(this)
what
You can pass the main class instance to your other class, with that you can use methods from the main class.
how?
its prob like
Class.method
i think i heard that before
No
No, that's static.
It's litterally already in your code
oh
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
oh god di
public static Onceuncraftable INSTANCE;
@Override
public void onEnable() {
INSTANCE = this;
ppl tell me that its pain
oh, he's already using singleton
DI != DI framework
okay
but
what do i do then
Onceuncraftable.onEnable?
or what
If it's public no need
Oh god
hello
Yeah
Just keep one
one in my main one in my other class so i dont flood main class
i dont wanna flood main class tho
so, just remove the other class that extends JavaPlugin
i mean remove the extends JavaPlugin
And copy paste the code inside onEnable if you wish to keep it
but i wanna use onEnable @summer scroll
call the method on onEnable then
Bro
not like that
Give the other class a method to be called on the main classβs onEnable
Donβt entirely extend JP again
and make it static
and what should it be'
Create the object of other class
onEnable lmao
what
Whatever the FUCK were in your second class onEnable
okay, show the whole class
public class Recipes extends what?
the class that you extend JavaPlugin
it was JP
both of them
?paste
Oh hell nah
OOPS SORRY ITS BIG
Use that @grim ice
- Create a RecipeManager Class.
- it has to have a constructor
public RecipeManager(JavaPlugin plugin) - Put your method/code in that class (not in the constructor) to add your recipe.
- in your Main add a Field
private RecipeManager recipies = new RecipeManager(this) - In onEnable call
recipes.addRecipes()
and this is main https://paste.md-5.net/qeqagenuno.java
Okay, remove the extends JavaPlugin on the recipes class.
And create a method that return ShapedRecipe
Just take this
*spoonfeeding * i mean ty
uh
He doesn't want to put all things inside the main class.
It's smart
It's overcomplicating the whole thing
It's good for long term
im trying
Still, right now they just want his custom recipe to work, so they might just do this as a temporary solution, and come back when they actually know java
Okay
Not that i dont know java
its this specific thing
i cant figure out
Hmmmmmmmmm
Bruh, if you knew Java it wouldn't be a pain in the ass explaining it to you
So right now, create a method that return the recipe.
instead public void, make it public ShapedRecipe
Because you're gonna add the recipe on the onEnable.
Just like what ElgarL says, you will call the method on the main class.
or you can keep it like that, and call the method on the main class.
first of all create a constructor with your main class as the parameter
nothing
Cannot resolve symbol 'setIngredient'
imports
Cannot resolve means you are missing an import or you are using the wrong recipe type
this.plugin = plugin;
it will ask you to create a Field for plugin
yes
and i did that
i still have 51 errors
lo;
cannot resolve
literally everything
lol
?paste yoru class
your code is in the class, it needs to be in a method
what method
create one
ok 1s
oh
just implement it in yoru onEnable
jp?
javaplugin
no
that is a local reference to yoru main class
no
only main shoudl extend JP
alr so i remove