#help-development
1 messages ยท Page 2280 of 1
You shoulnd use deprecated methods, altogught they work
But you shouldnt use them
Becaue they are deprecated for a reason
ok thx
its probably deprecated because of paper adventure shit
It really depends
Who uses shity paper
๐
Spigot support is bitten paper supprt
They server is dead lmao
gradle paper user api thing is easiest way to get remapped nms + full api
so thats why
but it is fucking annoying
that they deprecate
so much shit
the adventure is shit
regarding chatcolors and "legacy" strings
yeah
chat components
and now how to replace the resulting water bottle (Material.POTION) with another item?
cancel the event and set the item in the main hand
and if there were several empty bottles in the hand?
ooh
cancel the event and add the item to the inventory
pretty sure minecraft just adds the water bottle
to the first slot
hahaha i checked that. No. Event faster
?
but may be slower in some cases
any good text component api neither spigot/bungeecord nor shity adventure api?
idk how you would make a good one, its always more annoying to use than ChatColor.RED + "hello"
its useful and nice sometimes
a bottle of water appears later than the end of the event
oh
so cancelling doesnt work?
it should
no
bruh
and by the way value of "org.bukkit.entity.Player.getTargetBlockExact(int)" is null
if it throws an error it wont work
i forgot to check for null
also make sure to use the one with FluidCollisionMode (org.bukkit.entity.Player.getTargetBlockExact(int, FluidCollisionMode))
FluidCollisionMode.ALWAYS?
you can only fill bottles with source blocks
but you could
id use FluidCollisionMode.SOURCE_ONLY
oh yeah you gotta decrease the amount of items in the main hand
and add your own item
if (event.getAction() == Action.RIGHT_CLICK_BLOCK && player.getTargetBlockExact(4, FluidCollisionMode.SOURCE_ONLY).getType() == Material.WATER) {
ItemStack item = event.getItem();
System.out.println(item.getType());
if (item == null || item.getType() != Material.GLASS_BOTTLE) {
return;
}
event.setCancelled(true);
for (ItemStack i : player.getInventory().getContents()) {
if (i == null) {
continue;
}
if (i.getType() == Material.POTION) {
i.setItemMeta(meta);
i.setType(Material.DRAGON_BREATH);
break;
}
}
}```
if (event.getAction() == Action.RIGHT_CLICK_BLOCK && player.getTargetBlockExact(4, FluidCollisionMode.SOURCE_ONLY).getType() == Material.WATER) {
ItemStack item = event.getItem();
System.out.println(item.getType());
if (item == null || item.getType() != Material.GLASS_BOTTLE) {
return;
}
event.setCancelled(true);
item.setAmount(item.getAmount() - 1);
for (ItemStack i : player.getInventory().getContents()) {
if (i == null) {
continue;
}
if (i.getType() == Material.POTION) {
i.setItemMeta(meta);
i.setType(Material.DRAGON_BREATH);
break;
}
}
}
if (event.getAction() == Action.RIGHT_CLICK_BLOCK && player.getTargetBlockExact(4, FluidCollisionMode.SOURCE_ONLY).getType() == Material.WATER) {
ItemStack item = event.getItem();
System.out.println(item.getType());
if (item == null || item.getType() != Material.GLASS_BOTTLE) {
return;
}
event.setCancelled(true);
item.setAmount(item.getAmount() - 1);
player.getInventory().addItem(myItem);
}```
yeah
world generation is server sided right? if that is the case can't I change world generation to add my ores to be mined instead of crafted?
?
Yes
Yes, yes
but it still lights up yellow, like Deprecated
Work
Item names are using ยง as color tag. They aren't formatted as JSON. (taken from the forum)
ChatColor#stripColor
no; well if they worded it weird then yes
are you trying to remove the color?
Nope
if they mean extract as in remove (making the text white) its stripColor,
but I assume you are trying to actually get the color value
oh
@eternal night Ok i have re-written it to use 2 wide blocks. This dramatically decreases the amount of node objects cause i am now just reusing them each time by caching them after i create each one.
https://paste.ollieee.xyz/alewifihup.csharp
The add to tree looks a bit shit and messy though - not sure about re-writing it...
its gonna look less like a tree now, its gonna look just like a really messy graph
Only 256 + the root node objects are made this way
how is memory holding up ? xD
i am just re-writing the logic that loads it from file to load it straight to the tree, one sec
hopefully amazingly 
obv. because it returns a string
watch it be worse
dont say that
i just tore my hair out 3 times over
shit
its broken
i dont get the correct value out xD
http://192.168.1.6:9000/request=message&message=This%Is%A%Test
gives me a
Cause it's hosted on my java webserver i guess that it's an exception from java
Not sure if %I is something that is valid
It should be %20 or something like that iirc
ok
will check
I am using % to split words in a message
seems like javascript was formatting the url accordingly
% is an escape char for URLs
http://xxx.xxx.xxx.xxx:9000/request=message&message=Acesta%este%20un%20test!
and still returns me a 400
https://host/?request=message&message=This Is A Test would be something valid
I really recommend using a proper browser
will look into how i make my url
i will see if making a json and putting that in the url would help
or see how tf I can make a valid url with some content in it
You should familiarise yourself with the GET scheme
How do I reload the config?
hello i want to make a way for people to get the discord and youtube playerhead and when they place and right click on the head they get a message in chat. how can i do this in spigot
?plugin-description-file
You will have to use events and skulls with textures (in your case discord texture and youtube texture)
is there a way to use regex to filter results from a query in SQLite?
Elaborate a bit more
Like you want to filter or sanitisalize the sql request before sending to the db?
I dont know how to write it the name of proccess is but a process where they scape all characters for being used in sql request
I need to filter a column, like
SELECT name from playerdata
```but instead of just grabbing all the results and then filtering them, I'm wondering if it's possible to just filter within the query
I feel like you could google this question
You can use for example:
SELECT name FROM playerdata WHERE uuid='uuid here'
And there you are filtering all the names and only return the one that match that uuid
Is that what you mean?
I have and I've come across things like REGEXP, but I'm not too sure if that's the right direction
Have you tried it?
But what do oyu want to filter bruh
๐ค
Eplain me mike
I dont understand what he means by filter
Because for filtering results you can use diff SQL combinations
๐ค
instead of filtering by a string I want to filter through regex
WHY?
No need lmao
๐
You are reinveinting the wheel when it already exists
Dont lost your time
I don't think you understand
Yeah and a plus im not english native speaker
Okay ignoring the guy who doesn't understand regex try using the regexp function
Also for filtering fetchs you can use diff SQL combinations
I dont dont know what he want s to do
Do you know what regex even is lol
I don't know how to enable it. the documentation says it's not a native function
Yeah is used to filter things for example they use it on web forms to check if emails input is really an email
And lot of things more
and how would I do that? that's basically what I'm asking
Not doing spam, but is a good website for learning diff languages
https://www.programming-books.io/
Essential Programming Books.
ok how?
ok
Because its really diff to use an api without knowwing the basics form the language you are coding
And also you wont understand what we explain to you
its a 34GB file
text file
i also just fixed my thing :)
lemme test it now
where the heck is pdf tutorial
oh nice
I cannot find the command in the discord
tho that doesn't tell me how many hashes are in that file xD
yeah well lemme iterpolate
Use a thing that allow to calculate
wat
Or is not possible
yes that's what I was looking for
thanks
around 809 million if i interpolate the file size
WHich is the command
okay ๐
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
lul
?pluginyml
was the 5GB number for 2 million too ?
yea
aahh
lul
its err
the file read time
makes it painful
well, 6.5s for that
it was faster to read it all and then add it all tho weirdly
but more mem
ill do a 10m run
it doesn't see, to be hitting my disk like at all 
Use Rust
3.2GB for 10 million entries
Sort the entries and then you can binary search them
Deleted.png
Whats the most efficient input method
finger
Input as in input stream?
or scanner.. etc
What are you inputting:0
Probably a buffered reader
InputStream#readAllBytes is quick
ah
hmm its not on this bench mark
What's the difference between waterfall and bungee cord?
Waterfall is a fork of bungeecord and
iirc is entirely dropped
(In favor to velocity)
Do I have to save the instance of a Listener if I want to unregister it later?
Depends
And what's the difference between paper and spigot
speed and API features
Does it also stop server crashes caused by hackers using hack clients? Cuz I heard it does
fuck it - im gonna use the big file
Paper is a fork of spigot and afaik they are much more into adding stuff that makes the api more accurately representing the notchian impl and yes ofc speed if possible
I mean if hackers are crashing your server you've got other issues.
Will paper stop it?
they fix more bugs than spigot does
challenge the "hackers"
an anticheat might
Ask them
I'm not using any anti cheat
Paper also introduces bugs by fixing issues so paper could cause problems as well
Yeah, well sometimes they just push issues to the spigot jira/stash but guess that counts as well 
bruh why cant i catch an sql exception which isnt included in the throws thing..
lets catch Exception then
Well
Guys can anyone recommend a good anti cheat which prevents hackers crashing the server
thats my usual approach instead of catching 5 individual ones
whitelist
Define good
Google is a powerful tool
People use wurst clients "nocomcrash" to crash the server
Oof
It should stop hackers from crashing the server
what version is your server
1.16.5
Limit packets sent from clients
Im on their wiki and they are themselves saying that its patched in 1.18.2
How?
use NCP, they should have a fix for that
disabling offline mode is a good thing too ๐คก
Using a plugin that does that
U know any?
Google probably does
Paper?
does it matter?
What did who patch?
ok, google "nocom crash wiki"
if (Bukkit.isOfflineMode())
System.out.println("aha get rekt");
System.exit(0);```
method doesnt exist sadly :(
dont you write servercrasher?
Just check the config
37,4% of the servers one of my plugins runs on are in offline mode
probably bungeecord server
Could be behind a proxy
37,4 do you have 1000 servers maybe
500
tf
It's when the proxy is in offline mode that the issue starts
Dam
i have 63.6% in offline mode
oh damn
i have 0 in offline mode ||cuz i have 0||
F
but well, its a plugin for minigames
mine is one for boss mobs
whats your highest core count
56 if I'm not missing any
ha, 64
@eternal night when i get to 66 million it just stops going any further and grinds to a halt
there is an "Other" part of the piechart and i cant see what it consists of
Some quite big numbers tho
well then you won
100
idk what you are doing but i think thats the limit for me
Yes nocomcrash doesn't work in 1.18.2 but it also says some anti cheats disable it so does anyone know an anti cheat which can disable nocomcrash I'm on 1.16.5
it says some disable it, so google for it
we wouldnt be doing anything else to answer your question
how can i edit the text when i hover this?
you have a "BSD" Operating system on one of your plugins being run? ๐
I think thereโs like a server ping list event or sth
Or maybe that doesnโt do it
sadly not
own server doesnt count
Can a Mod help me?
I have found a stupid MF on spigot that thinks he is funny pls just ban him and delete his Rates he write every time the same it doesn't even make sense
https://www.spigotmc.org/threads/spigot-webserver-for-minecraft.554053/#post-4403041
https://www.spigotmc.org/resources/โป๏ธ-โ-advanced-wings.103308/
https://www.spigotmc.org/resources/server-maintenance-server-wartung.101708/
User Name : ScaredDev
His Profil
https://www.spigotmc.org/members/scareddev.720099/
I Reportet him 3 Times
ScaredDev is a member at SpigotMC - High Performance Minecraft
This really isn't the place to ask for help lmfao
Yes, but otherwise I don't get any feedback :/
because it looks like spigot support doesn't care a bit
Would Vulcan anticheat disable wursts nocomcrash?
Yeah
Iโd have looked into it if I were a mod on forums, though I think as mike pointed out you came to the wrong place, maybe start a convo with one of the forums mods
I looked at the profile and noticed they wrote the exact same bad review 3 times, so I reported them for false reviewing... wish I could do more, I hate people like that.
knowing german does help with that tho
Thanks
the funniest thing i know this guy because i was on his discord just banned me and now probably thinks he can take revenge with something like that
yeah, sad thing is that it works
people will see that one bad review over the multiple perfect ones and not download
I mean one thing you can do is to just reply and state the truth behind x review
Yes, that should repair it sufficiently enough
yes :( I had worked extra on the wing plugin for 3 days it has its own resource pack with custom item id with custom mobs and custom drops
yes but do you think someone would read through why it was rated 1 star xD
I mean I would
I usually do tbh
And Iโm a very pedantic customer
every sensible person would, and if they dont its probably one of those guys who comment badly without testing properly
Lol they have a discord link in their bio.
10 million was about 30 secs
speed
@quaint mantle may I pm you?
Yea the binary search isn't doing too well with insertion
tho tbf that is expected
yes you xD but that doesn't mean that the others are like that too
what is your read/contains time ?
Yes sure why not?
No but realistically most customers who are serious will
nano seconds
Yes ... that's right, it's just another thing that's useless and annoys me
oh sorry lemme check
Understandable, it sucks but hopefully someone angelic with permission can yeet those reviews
@quaint mantle the plugin list on ya profile is more empty than the 'girls that like me list'
It's not about quantity, it's about quality
thats what she said yes
my plugin list has 3 plugins in it, one with a peak of over 500 servers, quality is everything tbh. the third plugin will also take off, i can feel it ๐
My plugin for the web server has 350 downloads
When you buy n install 4 of the same anti cheat plugin that says it catches 25% of all hackers so it becomes 100% cause quantity ๐
intellij console fucked up the formatting but its 61.2 something seconds
it was probably a mu
it did take 60s to load that time tho
for 10 mil ?
Yea lol my binary tree shit is gonna be horrible xD
in terms of writes that is
it flies around 100ms for inserting 10k elements lol
oooh yeah
Ask away
this.config = new FileHandler(this, "config.yml", true);
this.task = new ClearPokemon(this).runTaskTimer(this, 0L, config.getLong("Time"));
getCommand("pcreload").setExecutor(new ReloadCommand(this));
this.getLogger().info("Has been enabled");
}
@Override
public void onDisable() {
this.task.cancel(); // once plugin is disabled, stop the task by calling it
this.getLogger().info("Has been disabled");
}
@Override
public FileHandler getConfig() { return this.config; }
}```
i have an issue but its not programming :)
https://media.discordapp.net/attachments/729827668559659019/997217496211923034/untitled.mp4
How to make such a teleportation effect like his?
(:
ollie has issues with girls
so this I have a reload command and it runs with the executor
but
it's not reloading the time path within the config
it just reloads the message
Yes thatโs because youโre saving the old value of the time path
getLong("blah") wonโt magically update
Itโs like youโre setting it to a variable only once
No automatic updates
how would I make it to be able to change when i do the reload
Bro
?pdf doesnt work
๐คญ
Look conclure
?pdc
Oh
Sorry for tag =><=
Looks like slowness/blindness
Or sth
hai guys
thats cool
whatchyall up to
i wanna drink but theres nothin to drink :'(
Bear grylls
Or in confused
Trolling again?
No no
Really
Im not native speaker
Remember...
Oh shit
That means another thing
MY bad conclure

wanna see
And your library to send messages over servers without relying on any connections at all?
:0
I couldnt figure the protocol
i left my beer in the freezer overnight lol
And them i realized that protocol changes between versions
Oh you are an afortuna that shit should exploded

nah its glass
just use plugin messages
damn docker
hup wheres code i wanna see code
Na i use redis now, because i figure a free host for redis
And is like inifnite
Until they close the website
fun
๐ฌ
Yeah in railway lmao
I just create random projects and just them a redis database service
And thats all
Conclure
Im helping a friend and we are trying to figure how to start the runnable with the timer value updated
Sorry for thi dumb quetion but im in dought
๐
Yeah i already told him
Is this the same as the guy above????
Yes my friend yuwhere helpingthing
i would keep a referance to the BukkitRunnable itself not the BukkitTask
I already told him to stop it
you can cancel the Task and re-init it with new value
Allright i dont really know the diff he just have that code and i just reused it
Yes
But the problem is that he has a reload command
And a getter for the task in main class
i would keep a reference to ur Mom
Basically only store ClearPokemon
Allright better idea
Thanks you all
and call runTaskThingy and store that as non-final
other one make it final
you can cancel task and re-init it that way
Idk if bukkit has a better way to do it
but its just what came to mind
Thatโs the best choice
yeah defo ugly
BAN
?ban
Syntax: ?ban <user> [days] [reason]
days is the amount of days of messages to cleanup on ban.
Examples:
?ban 428675506947227648 7 Continued to spam after told to stop.
This will ban the user with ID 428675506947227648 and it will delete 7 days worth of messages.?ban @Twentysix 7 Continued to spam after told to stop.
This will ban Twentysix and it will delete 7 days worth of messages.
A user ID should be provided if the user is not a member of this server.
If days is not a number, it's treated as the first word of the reason.
Minimum 0 days, maximum 7. If not specified, the defaultdays setting will be used instead.
i dont rly use bukkit schedular no more so i forgot how it works slightly

same with bukkits command bullshit
Yeah i dont use them as much
i dont even think i remember how to write a normal spigot command anymore
Bukkit shchedules runs a runnable right?
yeah
How do you write them?
If i can know
Because im creating a lib and i need ideas
Skidding time ๐คญ
make an api wrapper for my api

that is an api for another rest api
and that rest server links to another rest api that from there executes the api methods you need
thats basically what every spigot plugin library is
Imagine that i will make a storage api for working over the mongo api
that will be another api
cause your doing it on top of
all the libs of mojang
then the libs of minecraft
then the libs of bukkit
then spigot
<other bullshit forks here>
and finally your lib
welcome to java hierarchy where the stack size is big but our ram usage is bigger
yeah
Mojang
- Their abstractions
- Their delegations
- Their wrappers
- Netty
- Packet spam
- Byte encoding/decoding
- Packet spam
- Netty
- Their wrappers
- Their delegations

dont forget the 20 events called in between each step

i wonder how many sys calls a mc server does a second
has to be fucking crazy
maybe like 3k?
dont worry about it
idk now im kinda curious
but idk how to figure that out so your right dont worry about it
Verano
Wrong channel
why does building docker images suck
My bad
Could always run it in a profiler to get some idea
oh shoot true
I always forget what i have copy on the thing
i bet intellij would even say it too ngl
Donโt want to be that guy but here x)
it's probably safer that way

I said sorry bruh, i just dont know what i have on my papers copy-paste
๐ก
Lol
I accidentally press enter
im trying to use armor stands to place text above a player by having the stand ride the player, but when the stand rides the player the players nameplate disappears, any advice?
http://proxy.civ-server.cloud:19999/
i love netdata
Sorry for ignorance but arent used teams for setting up player things on top of his head?
when i tried that it had like a 0 stuck under the name
and it renders only like 10 blocks away
Or they are used for name tags?
Isnt a specific packet for render the name tag?
๐คทโโ๏ธ ive been working in skript only so far for this thing
On skript
Skript or Spigot API (Java) ?
Yeah skript and spigot api are diff things
Skript is an interpreter which has is own pseudocode
if i can do a plugin to enable the nametag
ill do that
i just need to get the function
I straightly recommend plugins over using skript
Also something strange but console has operator permisions right?
Im asking that because when i do a permissions check the console bypass it
It has all permissions
Basically is type operator ahaha
iirc it just returns true regardless when you use hasPermission
hey! I have my own parkour plugin which has a time counter, but there is an issue with it when it comes to people purposely using a lag switch, which basically allows these players to teleport on the server side. They would for example switch their laptop to airplane mode and turn it back off. what would be the best way to catch players doing this?
@noble lantern Into:
public static List<String> convert(List<String> messages) {
return messages.stream().map(BurchAPI::convert).collect(Collectors.toList());
}```
Kick players who dont respond in the right amount of time
I could technically check for ping if it's constant, and if out of nowhere goes too high, i could stop the timer for them
Lag = kick
If theyโre idling in a similar enough position for a long time enough, isnโt allowed to fly and isnโt on ground
Or sth
Might have to do some other checks besides that
i dont think the BurchAPI:: is needed
.map(convert)
You need to include the class name
Fr?
If it were an instance method you could use this::, but yeah, you need a type
Otherwise it's a variable
This isn't a scripting language, Imajin. lol
I think classname because its a satic method
Agree
BECAUSE RUST IS BASICALLY A SCRIPTING LANGUAGE 
lazyness that methods years old haha
Runs faster than Java. Is compiled. What were you saying?
i just copy paste that method over and over for years now
@sterile token so could i do something like a server jar mod to make the nametag show?
why does building docker images fucking suck
Wait wait, mods != plugins
C++ runs faster than Java but you're also going to fuck up a hell of a lot more and shoot yourself in the foot. It ain't about speed 
They are made with diff apis, so they need diff execution enviroment
Rust is way safer than C++.
I dont really know because i dont code mods
ill take a looksie
Love how you get triggered over the fact you need ClassName::
In theory you cannot run mods with normal spigot jars
Cause it freaking sucks
Please someone with more knowledge confirm it
iirc you could statically import the class
wow that 300kb library took 2 minutes to install
And then skip that
if i edit the open src and compile why would it not run
everything is faster than java
Normal spigot doesnt support mods, if you want to use mods you have to implement it yourself
Pyth-โฆ
be honest tho who rly wants to write python
There are some shity implementions for mods and plugins around
any way to save a schematic or something for my solo spawn cage so that way I can just plop it around at multiple places?
imajin, probably
besides him
Def imajin
World edit?
im hack it into the server jar ๐ good luck me
Also this channel is for plugin questions
yes
bro i just wanna build a docker image why does it need so much shit
have a saved build
Oh you wanna use world edit api
and plop it around
Like???
I dont really want to use external plugins
why you need a java websocket to build a docker image
because
Nested dependencies >:)
Cry i guess
dont worry about it
its just base ubuntu image tho
thats why
FROM ubuntu
should I just use setblock in a function or is there a more effective way?
Hebe guess itโs pretty bloated as well
So want to make your own schematic system? I will advice you the next phrase
"Dont reinvent the wheel when already exists"
Happens all the time tho
@cunning canopy
sometimes for schematics you do need to reinvent
Re-invent the wheel, but with more squares!
you sound like a backend developer
theres only so much speed you can squeeze out of fawe api
thats what literally every plugin developer is
is a backend developer
you do 0 front end
ur frontend is an inventory gui 
Programming is looking like javascript, they get tired of reinventing new frontend and backends frameworks. Now they are with javascript enviroment execuction
๐
yep and even then its just an array of bytes
oh im gonna find some bugs alright
loool
is C++ alot faster then java?
im prolly just gonna sue docker for making me wait so long ngl
yes and no
If the right person does it
yes
if not, no
java can be fast even if you throw it down a mountain and lock it in a dark room for 2 years
basically the question I am asking is: is java really optimal for game dev?
No
Ok yes
haha
back end is viable
argument time
this
front end tho do something else
Front end is a pain in the ass
Java is good for game dev depending on teh game
like c++?
coding an AAA title with java swing guys
minecraft
lets goo
like c++ is the goto language?
actually nvm worst example of a good java game
for games
funny because thats what notch did lmao
laughs in unity
thought unreal was cpp
Unity is likely getting trojans and adware ๐
which is harded. C# or C
yeah i dont like unity
C
C
*harder
C
C# is just microsoft java
ehh
and has less features
uglier yah
I tried making an operating system in C once
C is literally just assembly with brackets
I got to the file system and gave up
oh my god this image finally built
most operations are 1:1
C is the closest langauge to the CPU so its gonna be the fastest
high level wise*
unless you find something even closer to it than C
HolyC
Impossible
yes, it compiles to machine code when java on the other hand runs in a "vm"
.
I write in assembly ๐
stickers still exist
FAWE
WorldEdit API*
there has to be a way without it?
World#setBlock
thanks
build it all with packets never interact with world 10000% speed
when you type Class#blabala is that to indicate blablabla is a method of the class?
yes
instance method
holy fuck why is that actually smart tho
just send fake blocks to the server and client on place
its smart if you hate yourself
and only save the blocks to the file on stop or ever like 5 mins or smthn
and bam async chunk operations
ezzz
Entities dont exist
holy cow my docker image worked
simulate them too
or do they
just recreate the entirety of minecraft in minecraft
imagine making a client canceling all those packets
im so proud of myself for this ngl
you would just see a bunch of players do nothing
Hello,
I don't understand why the game drop me 1 diamond when I asked in my plugin code to have a certain amount (it's minimum 2)
hello, we dont either. provide some code
By the way, in my console, I tried to debug but I got the right number
show code for setting drop amount
if (JobsHelper.isOre(block.getType()))
{
if (!event.isDropItems())
{
event.setDropItems(true);
}
else
{
Collection<ItemStack> stacks = block.getDrops();
for (ItemStack stack : stacks)
{
int stackAmount = JobsHelper.getOreAmount(stack.getAmount(), extendedPlayer.getJobLevel());
stack.setAmount(stackAmount);
System.out.println("[AkadreamPlugin] new stack amount: " + stackAmount);
}
}
int experience = JobsHelper.getExperienceFromOre(block.getType());
extendedPlayer.addJobExperience(experience);
player.playSound(player, Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1.0f, 1.0f);
player.sendMessage(ChatColor.GOLD + "+" + experience + "XP mรฉtier");
}
That was in coming
1.19
you should use the EntityItemDropEvent
i forgot its exact name
its similar to that
older versions dont have this even tho
its relatively new (~1.15ish i beileve)
Hmm
declaration: package: org.bukkit.event.block, class: BlockDropItemEvent
well, you print out the stackamount, but not the list nor the item
I was using BlockBreakEvent because is better corresponding to what I want the player do
you can listen to both
in BlockDropItem even just store the blocks in a list/hashmap from BlockBreakEvent
and change amount if Block exists i nthat list
if not ignore it
Doing your event like this also gives support for stacker plugins too
It's a bit of a stretch xD
which is why i push you to use this event, as its what a lot of ppl reccomend now a days
modify drop on BlockBreakEvent
You can but its weird sometimes
and breaks functionality with other plugins sometimes
only use it on older versions that dont have BlockDropItemEvent
Either that or you can cancel block drop even for that block and just drop it yourself
or
setDropItems(false)
then drop an ItemStack at broken blocks location (The list of block drops you have there)
that way is prolly easier tbh but just note functionality suffers with other plugins
the event.getPlayer of BlockDropItemEvent is the player who broke the block ?
yes
windows 95
Ok thanks
Unix?
TempleOS is my favorite distro
Lmfao
W opinion
THis is also a cool one: https://en.wikipedia.org/wiki/Red_Star_OS
korean government os
ultimate censorship
wha
why are you obsessed with hacking lol
i know of another distro but i cant link it
I didn't mean hacking as in penetrating
Haha
where the least hacky way to do something likely breaks functionality for third party plugins
That's why I try to avoid them
Only ones I don't have the time nor energy to do is the backwards version compatibility
well if your making a public plugin its where the issue arrises at
but if its for my server im gonna do some of the most hackiest shit
cause ik no one will look at my code
i cant beileve how easy it is to write docker images tho wtf
like
There is a problem with that event. When I check what type of block broke, I alway have Material.AIR
How are you doing it show the code
@EventHandler
public void onBlockDropItem(BlockDropItemEvent event)
{
System.out.println("[AkadreamPlayer] block drop event");
Player player = event.getPlayer();
ExtendedPlayer extendedPlayer = AkadreamPlugin.getPlayer(player.getName());
if (extendedPlayer != null)
{
System.out.println("[AkadreamPlayer] bloc drop event: extended player not null");
Jobs playerJob = extendedPlayer.getJob();
if (playerJob == Jobs.MINER)
{
System.out.println("[AkadreamPlayer] bloc drop event: job miner");
Block block = event.getBlockState().getBlock();
System.out.println("[AkadreamPlayer] bloc drop event: " + event.getBlock().getType().name());
if (JobsHelper.isOre(block.getType()))
{
System.out.println("[AkadreamPlayer] bloc drop event: block is ore");
List<Item> items = event.getItems();
for (Item item : items)
{
int stackAmount = JobsHelper.getOreAmount(item.getItemStack().getAmount(), extendedPlayer.getJobLevel());
item.getItemStack().setAmount(stackAmount);
System.out.println("[AkadreamPlugin] new stack (" + item.getName() + ") amount: " + stackAmount);
}
int experience = JobsHelper.getExperienceFromOre(block.getType());
extendedPlayer.addJobExperience(experience);
player.playSound(player, Sound.ENTITY_EXPERIENCE_ORB_PICKUP, 1.0f, 1.0f);
player.sendMessage(ChatColor.GOLD + "+" + experience + "XP mรฉtier");
}
}
}
}
oh btw idk why but im like 99% sure you owe me starbucks for some weird and stupid reason that im not allowed to disclose
use BlockState.getType not getBlock().getType
might work that way
cause
that is the state of the block BEFORE it broke
and that event is after
I'm having troubles with the using of the WorldGuard's API, like just checking if a Player in PlayerMoveEvent is in a region, IntelliJ says that can't find any classes in the dependency.
Ok
I understand
But I don't understand this choice in the APi
Because obviously the block will most of the time be AIR
well it does say this in javadocs
hi, how can I do something when an entity dismounts from another entity?
Ok ok, i should have to read more the javadoc
Because intelliJ don't show me the doc
thats why you handle anything for your Block needs in BlockBreakEvent
and pass your results to drop item event
Nah, like, I've a map, and I need to check whenever a Player is lands off in the water, but not generic water, I'd prefer using a code that works only in a region.
How are you importing it?
Uhmmm
might be an even for it
Hmm'ok why not
@coral oyster https://hub.spigotmc.org/javadocs/spigot/org/spigotmc/event/entity/EntityMountEvent.html
declaration: package: org.spigotmc.event.entity, class: EntityMountEvent
Since IntelliJ is strange with dependency, after trying using Maven, and the project structure, I'm using the system path in the pom with a lib folder in the pl with worldguard jar into it.
ah thanks
yeah dont use sys path
you install jar files
using mvn install-file
how would I cancel and restart a task with the new config
https://maven.apache.org/guides/mini/guide-3rd-party-jars-local.html
Its the first command
Thanks for the help, it's working very well now
and then you import it normally without system scope
awesome ๐
Actually, why it wouldn't work with Maven, it doesn't ring me a bell.
wym?
system scopes are heavily deprecated in maven
compiler even warns several times for it
If you give an eye into the docs of WG, there is the Marven import with repository and dependency, but actually it doesn't work, maybe is IntelliJ which gives you a lot of problems with dependency.
your looking at an old docs then it worked for me
sec
Errors are given even with Maven some times.
so I tried this code:
public class playerLeaveEntity extends EntityDismountEvent {
public playerLeaveEntity(Entity what, Entity dismounted) {
super(what, dismounted);
System.out.println("entity dismounted from another entity");
}
}
but the playerLeave entity doesn't seem to get called. I'm new to Java so is there something really dumb that I have done wrong?
In the newest version of WG docs there is the maven import, it doesn't work for me, so I tried using the system path and that does work.
idk
what the
never seen an event created like that before but
alright
Ehm
First of all.
Show your pom
Search a class where use the event.
Then write @fresh templetHandler, create a public void method like onDismount(here insert the event and event after) and that's it.
poor even
AHAHAHAH
A sec.
Actually I work on a project helping a friend through a screenshare with AnyDesk.
I'm spamming him to send me that pom.
like this?
@EventHandler
public void onDismount (EntityDismountEvent event) {
//code runs here
}
You made it finally.
thanks
one more thing
that class that method holds needs to implement Listener
you should rly read the guide i sent
Bad news, here it's 1:13 and he turned off his pc now, so let's continue tomorrow.
And register the event.
this guide
alrighty
Idk where are you from, I can fix it tomorrow at 2 pm
See you after 13h so.
yep it does
thanks for the help ill read up o n the guide you sent
In your main class, into the on Enable, register the listener.
So I'm working on a plugin I haven't worked on since 1.17
I've updated it with spigot 1.19 now
And when I export the jar and put it in the plugins folder for a 1.19 server, it doesn't seem to load on the server
How do I detect player movement that is only done by the player?
what version java should plugin be made in
You should use the newest version possible, although you might want to support multiple versions if you plan on uploading it
is the process of supporting multiple versions just strictly using in common features
or is there an easy way to be sure of compatability
what do you mean?
You use the oldest API you want to support, for example: if you want to support 1.16 - 1.19 you use the 1.16 API
gotcha
yes
If you're not using java 18 then it's illegal obviously
Intellij doesn't let you dl open-17
wat
Last time I checked it was because it's "unsafe". Like I care about safety
How do i change the name of a file built with gradle?
Sounds simple but i cant find anything online, im only able to change the baseName which seems to only change the first part of the projects name
-all i assume comes from my shadowJar task im running
i just want it to be named server.jar without versioning and additions
oh it wont work doing it globally had to do it inside the shadowJar task
weird
As a side note, might be worth to have a separate copy task that does the renaming
While loosing version information might be fine now it may not always be
yeah not a bad idea tbh
I just wanted a jar named server.jar so i dont gotta work with versioning for auto deployments server.jar is just simpler
By chance how would i copy the task?
oh fairly easy
Yea very straight forward
You should be able to use the shadowJar tasks output directly to avoid guessing file names
Another question:
Is there a way to configure gradles daemon somehow to be faster upon first compilation? Maybe by disabling its caching somehow im able to get a faster compile time?
The daemon is essentially uselss to me since this is just a quick docker task to compile the project from git
Its on the servers end
i could do it in gradle definatly, not sure if its readily possible this way
LOL
bro ๐
@noble lantern thats why we have environment variables
๐
Yeah
it was first thing i did lmao
yeah its still indev rn lmfao
Oh atleast you are faster
i forgot i had my token in that cause im lazy and dont wanna login with ssh
now i gotta make another and change my script smh
burch
whas does thtat script?
Oh lmao i need to get blocks from a cuboid
I really messed
๐ฎโ๐จ
loop through
Loop through is really open...
Pulls from github, compiles with gradle and moves the server jar to ptero server root directory
Why not use a ChunkSnapshot
instead of a Cuboid
loop through every x, y, z
^
