#help-development
1 messages · Page 601 of 1
because that doesn't contain the duration or amplifier
it only has isExtended or isUpgraded
they are really bad
but no way to get the actual duration of the potion
But they are fancy
The more I fix my book formatter the worse the code looks. It's a mess already
books are the spawn of satan
that's why I personally make sure to burn down every public library I come across
and leave a calling card saying "Mojang"
lmao
Yeah. In the experimental branch they have a getPotionEffects() : List<PotionEffect> method which would be what you need, but not in the current main distribution of Bukkit
I confused the two
hello i have a error
Experimental best branch
the error
Your world is locked
man I'm so sleepy
Make sure there is no other process accessing it
quick someone say something that will wake me up
check general - it will make you mad enough to be awake
stupidity puts me to sleep
My world is locked?
well but misplaced GUI elements should make you furious
Yes
Do you have another server running
Or a stuck java process
sudo reboot
server restart now
yes, check if it runs afterwards
otherwise check systemctl for autorunning server instances
when i go into the class without a source its just a blank page
man I really need to finish this npc system but I am just so damn sleepy all of the sudden
Does anyone know how much dots the letters are widened by making them bold? Or does it differ between letters?
thanks 🙏
I don’t know I just got here man
arent the normal letters and the bold ones in the texture pack?
it's the default texturepack
Wallahi they are 😭 🙏🏿
Well that is the default dot width. Question is if the increase is the same for all of them
Yessir
would you know how i could do it with nms then
and by how much? 1? 2?
It varies
As soon as I read this I became sleepy fuck you
you just said it's the same D:
The default dot width is 1
For duels is it more efficient to make a new void dimension for each duel then delete after, or to create one void dimension with all the duels?
I’m trippin balls currently
I bet my bed is so soft and perfectly cool right now
ye I figured
Both r wrong 💯
I just washed everything down to the pillows
Die
What is right? 😭
got some nice reading to do too, the kind that really makes your eyelids sink on their own
Zip files babyyyy
Have 1 or 2 worlds with a bunch of arenas
and before you know it you've been on the same page for an hour and just fell asleep, so you set it aside and actually go to sleep
Real (I’m at my lowest rn)
looks like it's the same increase. Probably 2 dots
Some people belong in hell
Who knows gang
man do you feel like you could just get up and go brush your teeth right now
Do I always have to do this to access the console?
@torn shuttle you are an npc
No I'm at a resteraunt
idk, depends on how you run the server
non-pwnable character, you know it
Thanks for proving my point
stop checking your discord at the restaurant you antisocial loser
Meh &k is not the same anymore :(
Valid 💀
Revert to legacy, become one with the hidden one become one with god forget these Satanism versions above 1.7
how high are you, Sainte?
I don’t know I just got here
I have a question: Can I use location.getBlock() in an unloaded chunk or do I have to manually load the chunk?
it will load it afaik
U can do it
that will load the chunk
ok 👍
It will even load it when called async for some reason
And the loading will fall back to sync
exception
there are use cases for it behaving like that
Why the fuck is my name sainte who is sainte
The error always comes when I try to look at the console
as in?
well i think i kinda got it
doing math in async and accessing a block in sync
for (Map.Entry<ResourceKey<Potion>, Potion> entry : BuiltInRegistries.POTION.entrySet()) {
System.out.println(entry.getKey().toString());
System.out.println(entry.getValue().getName(""));
System.out.println(entry.getValue().getEffects());
System.out.println("-----");
}
very scuffed, why is this not in spigot yet lmao
well if it requires a switch to sync anyway then I'd expect a developer to do that "manually"
It is. On the experimental branch
yeah ik
Like I said. It's coming lol
but how is it so late
Certified thug
No one bothered to add it
why make a change that adds extra steps
never expected to use nms to get a potions duration
To make it consistent with other functions that end up throwing exceptions when called async
at this point such a change would probably cause a lot of issues
I mean sure. But you could argue people shouldn't have abused that in the first place
it is what it is
Mojang didn't care either when they took this away 😢
Revert you shall
It seems like you try to boot up a new server each time
they took this away?
yes when they introduced booster rails
no I mean, it doesn't work anymore? like what happens now when the track dead ends like that?
you just go off the rail and don't continue further?
don't you remember what that contraption used to do?
That was the old way to max-boost minecarts
well it has other purposes
and yes I know it was the old way to max boost minecarts but I am not sure who really cares that isn't a thing no more just as long as most of its functionality is retained lol
Well I remember that change. It even had a "sorry :(" in the patch notes behind the bugfix
and it broke so many rollercoasters
yeah but that is what change does
they didn't become super broken, just needed to add some boosters in there
and it allowed coasters to be more compact
coasters
wait that's not wrong, is it?
yeah I just dug this up because we were talking about the inconsistency in behaviour when you access functions async that should be used sync
And it was mentioned that it would "break so much at this point"
Yeah that's why I said "just let it throw an exception" like other functions do when accessed async
Abusing inconsistencies is certainly not the right way.
Just like expecting the collector to return a modifiable list. It currently does but states that you can't expect that to always be the case
Returns a Collector that accumulates the input elements into a new List. There are no guarantees on the type, mutability, serializability, or thread-safety of the List returned; if more control over the returned List is required, use toCollection(Supplier).
Would bet some things would also break once that changes
lol
possibly but there is already a variety of other ways to ensure some of that stuff yourself as well
which wouldn't necessarily require the collector itself to do it
I'm aware of that. You can add an ArrayList constructor to the collector aswell.
I would just guess that a lot of people are like "ah perfect, it's mutable - I'll stick with that"
how can i get the duration from a spigot itemstack tho lol
you mean the potion duration?
yes
get the potion meta
im talking about vanilla potion duration
which isn't possible to get in spigot rn
so i've accessed all potion durations from the registry using nms
now i just need a way to get the correct one
Oh. Yes probably
like
i need some way to use a spigot potion itemstack
to retrieve the duration
from the nms registry
Hmm
last entry of effects it seems
Unfortunately potion type is not keyed
well
i've noticed
all the MobEffectInstance names
are just the potion effect type sometimes prefixed with long_ or strong_
so I could just add those strings if isExtended or isUpgraded is true
Worth a try
that's easy to workaround with reflection as there are constants
I mean u have liskov’s substitution principle and producer consumer covariance and contravariance
Going by principles it should be all you need
i’m sorry but that gets a 🤓
I was just arguing that location.getBlock() async should not sync load the chunk and instead fail with an appropriate exception
Wouldnt that be caught by async catcher?
no
or what does async catcher do? It returns to sync and loads the chunk
Is that what it shall do?
It throws an error
It catches if a method is invoked on the wrong thread thus yielding an exception
Well then it does not do that
I just tested that 2 days ago on 1.20
on both spigot and paper
Hmm alright, then I’d consider it a bit of broken api almost
Because it should at least instead of loading the chunk asynchronously
Hm I've gotten an error from that vefore though 🤔
Tho if the chunk is alr loaded I suppose its fine
Ah yes my bad, but that’s what adds up to the indeterminacy right?
yes, I would have expected an error
Yeah, either the behavior for asynchronous invocation should be documented appropriately(probably javadocs) or just yield an error, which could be documented also but yeah
first works second doesnt work why?
See that stick
It uses recipe instead of recipe2
and that there is why we use descriptive variables
oh tyyy
I never worked with custom recipes and I don't get what's wrong with that stick. Can you elaborate?
why is it blank
Wrong recipe variable
bro still doesnt work
Give yourself the recipe so you can see it in the recipe book to check
I thought you meant he can't use Material.STICK twice lol
Always helpful
install the other bytecode decompiler plugin @young knoll is gonna say in a minute
ecd?
Enhanced class decompiler
thats what im using
Make sure to set up file associations properly in preferences
made sure
i clicked on default 20 times
just to be sure
first one works second doesnt works any idea why?
@dire bluff
recipe give @s *
Are you on 1.stupid
bone
@dusty herald
I’ll take that as a yes
am i about to get banned?
ty gn 😦
If the channel was as serious as the description states we would have a lot more bans. We often end with offtopic-discussions
update mc version
Are you all assuming or is it save to say that he's on 1.8?
click s to save
assuming
"are you on 1.stupid", no response
what is stupid
8
fair enough
/shrug
1.8 (╯°□°)╯︵ ┻━┻
Then the command definitely exists
yea it exists
Iirc it’ll even let you tab complete custom recipes
Does the other one
and weven the working one doesnt
It’s hard to say much without more info
Are there any errors
Is the code on the server up to date
i found it
just my bad
i forgot that i changed a '' in the item meta and i already had the item from previus plugin
and now i feel stupid
my brain fked up im doing it like 45 mins
and today is my bday lul
who pinged me lol
lol
When I put my code inside a Bukkit.getScheduler().runTaskAsynchronously(...) it takes 300 sec vs 4 sec when running on the main thread. Is there a better solution for running code async or am I doing something wrong? I am not using the Bukkit api apart from doing stuff with ChunkSpanshots (created before the async block) within the task, my logs are re-incapsulated in a Bukkit.runTask.
Sounds odd. Do you have more than one core? Did you check which lines are the one that take up most of that time?
These are my specs (in french):
bump
The first step is iterating through all the blocks in the ChunkSpanshots and doing checks with their material type. That takes quite some time alone
2 cores? that ain't much. I suppose it says 4 threads?
yeah
But it shouldn't matter too much I think
How many blocks are we talking?
228 x 50 x 225 block region. But it 'only' takes 4 sec on main thread
And the only difference between sync and async is that you are running sync on the world directly and async on a snapshot?
yes exactly
Creating the snapshots on the main thread takes no time (very little)
Yep, just took 6 sec on main thread with the snapshots
odd. Sounds like your async thread is paused most of the time
Are we forced to use Bukkit.getScheduler().runTaskAsynchronously(...) and is there any benefit? Or are there other ways to run async?
Can you try to create the snapshot in the async thread aswell? Or does bukkit prevent that? Maybe the shared resource is what makes it so slow
You can also create a new Thread
Idk if that breaks anything though
Yeah I don't thats 'allowed'
You can use any of the normal java methods
The scheduler is just there for convenience
Snapshots should be made sync
Hmm then this delay is pretty weird
maybe all your cores are busy with the ide etc.
Try closing everything except mc and the server
Hello, this error occurs when I try to make an ItemFrame entity spawn, is this a bukkit bug? I didn't find anything on web.
The cause comes from here: https://prnt.sc/hIQw8FHXAhkB
Error (Cannot invoke "net.minecraft.server.v1_8_R3.EnumDirection.opposite()" because the return value of "org.bukkit.craftbukkit.v1_8_R3.block.CraftBlock.blockFaceToNotch(org.bukkit.block.BlockFace)" is null) : https://code.alwyn974.re/bironujaxo.apache
But that would be a horrible developer experience, don't want to close my ide everytime I want to test
well then get better hardware I guess. For now I just wanna see if that even results in an improvement
I'll try
if it does not I am kinda out of ideas though
tf
what was the result?
I'm not sure if it worked in 3 sec async or if it was still the previous build running in sync. But now I'm trying again and still takes forever
well now you reopened everything, right?
So if it takes forever now and you did not change the build then you probably not have enough cores
You can give the server process a higher cpu priority. That will however slow down other things on your machine
Alright, I also get this: java.lang.IllegalStateException: zip file closed
But normally async tasks are stopped on plugin disable right?
Plugin generated an exception while executing task 405
Good question. Never tested that
I assume, because why else would we need to provide the plugin reference when scheduling tasks
would make sense if they don't or do it too late
Maybe synchronous operations are stopped before asnycronous ones are stopped and that's why you get that issue
Anyway I gotta sleep now. I guess you have something you can test. (CPU priority / close other things). Also keep an eye on RAM usage. I really think the issue is somewhat hardware-bound here
I just tested, async tasks continue after plugin disable
For duels is it more efficient to make a new void dimension for each duel then delete after, or to create one void dimension with all the duels? ||sorry for asking twice I had to go before I could understand an answer||
One dimension
What does the provides property mean in a plugins.yml? https://github.com/IntellectualSites/FastAsyncWorldEdit/blob/main/worldedit-bukkit/src/main/resources/plugin.yml#L7C24-L7C24
Basically that plugin can mirror the WorldEdit dependency
It provides all of what WorldEdit has to offer without it needing to be installed so plugins can depend on WorldEdit without having to explicitly depend on FastAsyncWorldEdit too
It's rare that plugins have to provide anything
wonder how thats handled on pape
paper
been as they dont use that format anymore
oh it doesnt have a paper module
Is there some way I can spoof ping to my localhost XD
how can i get a string from a custom yml file ? Not config.yml
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Is there a plugin that supports 1.20 and let's you interact with NPCs to choose which server you want to join on a proxy server type setup like bungeecord?
Is there a website to look at on how to set it up?
Thank you.
Thanks, that makes sense. Its so rare its not even in the wiki: https://www.spigotmc.org/wiki/plugin-yml/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
hey guys, can anyone help me on this? im trying to edit the item result from the anvil on the PrepareAnvilEvent, but its not working. it works just fine if i want to edit the first or the second
event.setResult()?
ty
i tried setting the result, getting the item from the result and editing it, getting the item and editing and using it to set the result
none of those worked
@EventHandler
public void onAnvil(PrepareAnvilEvent event){
AnvilInventory inventory = event.getInventory();
inventory.setMaximumRepairCost(999999999);
ItemStack firstItem = inventory.getFirstItem();
ItemStack secondItem = inventory.getSecondItem();
ItemStack resultItem = inventory.getResult();
if(firstItem != null && secondItem != null && resultItem != null) {
System.out.println(inventory.getResult().getEnchantments());
firstItem.addUnsafeEnchantment(EnchantmentWrapper.DAMAGE_ALL, 10);
secondItem.addUnsafeEnchantment(EnchantmentWrapper.DAMAGE_ALL, 10);
resultItem.addUnsafeEnchantment(EnchantmentWrapper.DAMAGE_ALL, 10);
inventory.setResult(resultItem);
System.out.println(inventory.getResult().getEnchantments());```
it does change on the console
but it doesnt on the game
hm
so why does setResult() exists on the AnvilInventory?
Not really the right chat but whatever
probably for a custom anvil inv
can i give a custom data to the result item, but it gets removed when the player clicks? without using another method
you'd probably need to change it in the click event
is there a way i can iterate through the names of the files in my jar's resources folder?
yes? i think? but fuk if i remember what it is off the top of my head
I have a method
this is why I typically don't give immediate help because this will end up as my response if I don't spend the time remembering
This obviously saves the resources to disk but I'm sure you can adapt it to do whatever you want
It's an old plugin I don't like to maintain anymore
Did you wontfix your own issues
yes
the heists one was for a valid reasoning, that it had been implemented in another plugin
but the omni one was bc I was too lazy to figure it out
you dont like to maintain any tho
that doesnt count
oh okay
:(
He’s too busy rebasing component PRs
I have to do it again but I'm waiting on another Spigot PR that I figure will be approved before mine before I do it
Save myself some work
turns out putting out some customizable npcs and inventories is not a 20 minute adventure morty
Can I just confirm, after setting up NMS mappings, I have to revert it back to it's obfucasted form afterwards?
Just saw this in a post:
"This means that you must only use the remapped-mojang jar for development and must remap your plugin prior to distribution."
so if I'm using maven, there'll be some settings somewhere that does it automatically?
yep
sweet thanks
Special source is for maven
is there even special source not for maven?
So the post is outdated?
"For those not using Maven you can download SpecialSource to help you do this here, and we encourage the creation of instructions/tools for other build systems."
I think you can run it manually
I'm guessing some maniac maybe ported it to gradle somehow
I mean it was 2 years ago
But it’s also a maven plugin
Or is special source already implemented, and I just have to use it
Having a laugh
its already implemented you just need the configuration
explained on
?nms
we love alexs blog here
This is the type of post that sleepy me needed to have a good giggle
Hmm yes the floor here is made out of villager
I need to lobotomize my test environment
I don't even want to count how many worlds it currently has
it takes forever to boot
40 worlds
Minding his own damn business
Unlike SOME people
u wun go bruv?
bruv ill kick ur arse so hard yu'll think its chewsday of next week!
bruv i'll kick yer arse so hard on 1v1 rocket league your computer will set itself on fire out of shame, swear on me mum
talk shit get hit by my rocket car
so, how do i edit nbt data?
nbt api or nms
and if i need to use NMS ItemStack, please help me introduce the dependency
?nms
if the plugin is meant to work on multiple versions use nbt api
how do i add it
big brain, was wondering why my npc wasn't working, just forgot to add it to the list of entities
idk how to deal with dependencies
then you will need to learn
i downloaded and ran the buildtools, but how do i insert the mojang mappings into the project dependencies
you need to run the command to download the mappings through buildtools
i ran java -jar BuildTools.jar --rev 1.21.1 --remapped, i think the maps are somewhere in this folders
but idk how to insert them into the project dependencies
that is listed in the link that was given to you just a few minutes ago
add the dep to pom.xml
LLL"LL
time to call it a day
usually I would but I have to be at the gym 12h from now
go now
Hello, I have an error in my hologram api, can someone help me?
Well
I finally figured it out
this is the most scuffed shit
but I now I can finally read a vanillas potion's duration and amplifier
using nms
String registryPrefix;
if (potionData.isUpgraded()) {
registryPrefix = "strong_";
}
else if (potionData.isExtended()) {
registryPrefix = "long_";
}
else {
registryPrefix = "";
}
// Use NMS to get the potion's duration and amplifier
List<MobEffectInstance> effects = BuiltInRegistries.POTION.get(new ResourceLocation("minecraft:" + registryPrefix + potionData.getType().name().toLowerCase())).getEffects();
for (MobEffectInstance effect : effects) {
// Get spigot potion effect type from NMS potion effect type
// Parse the last string of text after the last period and before the last apostrophe
String nmsName = effect.getEffect().getDisplayName().toString();
String spigotName = nmsName.substring(nmsName.lastIndexOf(".") + 1, nmsName.lastIndexOf("'"));
PotionEffectType potionEffectType = PotionEffectType.getByName(spigotName);
// Multiply the potion's duration or amplifier by the duration
int duration = effect.getDuration();
int amplifier = effect.getAmplifier();
if (potionData.getType().isUpgradeable()) {
amplifier *= multiplier;
}
else if (potionData.getType().isExtendable()) {
duration *= multiplier;
}
meta.addCustomEffect(new PotionEffect(potionEffectType, duration, amplifier), true);
}
holding.setItemMeta(meta);
Can I ask anyone to send me some specific folders that are downloaded by buildtools so that my buildtools would skip this step as I have permanent error with donwloading some libraries?
Hey, would anyone be able to do a code review of my plugin? It's not finished yet but it's been so long since I've worked with Java and I want to figure out if I'm on the right track https://github.com/lthoerner/betteranvils
Also, related question: are there any built-in tools for managing config files, or do I just have to use a YML parser?
?configs
See this wiki page on how to use custom configuration files: https://www.spigotmc.org/wiki/config-files/
Maybe don’t use standard out
Hello everyone, can you somehow explain how to implement communication between the same plugin on different servers (Velocity). For example, I have a Board class in one plugin, how can I get it from another server?
?fork
SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.
applies for Velocity too
Just why nms?
Spigot has Attributes
bruh?
I know you can for Entities, not sure about items
I believe you can as attribute modifiers apply to slots so are for items
whats going to return null?
I see
Yeah it seems reading the base attribute is missing from the API
hey someone give me redactor were i can took my code for you)
i dont remember site name
https://paste.md-5.net/wawuwaluta.java - someone help how update armorstand location synchronizing it with the back of the horse)
I bad in vectors in math
you only need the horse location. getDirection and subtract it from teh location to move it back
i need do this use vector not teleport
why?
teleport and move are the same thing over short distances
if you are trying to add a seat to a horse its not going to be smooth
teleport and movement through vector are not the same sense of movement
you mean velocity
will it be smooth?
no
yes
this
neither is going to be smooth
demm
maybe this code can help ? - https://paste.md-5.net/arelobecid.java
i dont know how update for my class
I used the EntityDamageEvent to cancel the destroying of items, but when an item lands in the void it just disappears, how can I check that?
damage type VOID
it just doesn't trigger the event at all
is there some kind of entity spawn event but with reason given?
like spawner, natural etc
Probably, because yk endermites
Spawner has it's own event
Something like EntitySpawnFromSpawnerEvent?
declaration: package: org.bukkit.event.entity, class: CreatureSpawnEvent
epic thats what i want
I do not really know to what value should I set this parameter?
player.player.playSound(player.player.getLocation(), Sound.MUSIC_DISC_11, THIS PARAMETER, 1.0F);
because if I set it to Float.MAX_VALUE is basically irapes
player.player 🤨
(that is a custom GamePlayer class)
0 makes it slower and deeper and 2 makes it faster and higher
not pitch, but volume
Well 0 = silent and the higher it goes the louder it gets
thank you
How to get all Materials (from Material.values()) that are not disabled and have the disable thingy as an item?
I still get them even with such a filters:
.filter(Material::isSolid)
.filter(Material::isItem)
.filter(Material::isBlock)
Disabled item???
Yeah like moving piston material
!isLegacy()
doesn't work
Material[] selectiveMaterials = Arrays.stream(materials)
.filter(Material::isSolid)
.filter(Material::isItem)
.filter(material -> !material.isLegacy())
.filter(Material::isBlock)
.toArray(Material[]::new);
i still get these disabled items
isObtainable?
no such method
Oh I thought there was
See the deprecation note on that one
Ah je that's isItem. nvm
ah
perhaps it would work best for you to create a set of materials that you want to filter out that are not filtered by default
there are a lot of these
get the client lore and check to see if it has the word disabled in it
._.
or make a list
is that just purely client side?
idk I didn't do any research maybe it's in the server side lore
ehh this is very far fetched but maybe this would work
because technically it's not enabled by a feature
lol
I thought about that but I don't know what the fuck that is lol
isEnabledByFeature is for the experimental datapack stuff
That's in ItemStack#?
It's in Material.
However there is currently no experimental datapack
I didn't even know you could disable items to begin with
Yeah
can we find the impl of this method somewhere
?stash
tbh i've visited this site like 20 times and i still don't know where stuff is lol
I tried searching it but I couldn't find anything with my 5 seconds of googling
this is in 1.20
All the impl stuff is somewhere in CraftBukkit
It’s in 1.19.4
how do you even disable items in the first place
Datapack
Material is an enum and thus has no craftbukkit impl
oh okay that explains why I'm so confused
It’s likely in CraftMagicNumbers
ok actually i didn't need to search that far it was in Bukkit lol
that seems like it would work perfectly for this issue though
i'll try looking for it
yay
Its so early
I got woken up
it's definitely not a server side lore
this is the impl
so it's deeper it seems
getHandle returns a nms version of the class right?
i'm going to the nms mapping browser
ok actually though
craftWorld.getHandle returns what
i assumed it returned net.minecraft.world.level.World
but there's no enabledFeatures in that
Hey guys ! I got 403 on BuildTools ! Did you know why ?
Loading BuildTools version: git-BuildTools-2836244-160 (#160)
Java Version: Java 17
Current Path: /Users/anthony/Documents/Build/.
git version 2.39.2 (Apple Git-143)
SwartZCoding
seaflyscontact@gmail.com
Picked up _JAVA_OPTIONS: -Djdk.net.URLClassPath.disableClassPathURLCheck=true
java version "17.0.3.1" 2022-04-22 LTS
Java(TM) SE Runtime Environment (build 17.0.3.1+2-LTS-6)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.3.1+2-LTS-6, mixed mode, sharing)
Attempting to build version: '1.20.1' use --rev <version> to override
Could not get version 1.20.1 does it exist? Try another version or use 'latest'
java.io.IOException: Server returned HTTP response code: 403 for URL: https://hub.spigotmc.org/versions/1.20.1.json
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1997)
at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1589)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:224)
at org.spigotmc.builder.Builder.get(Builder.java:828)
at org.spigotmc.builder.Builder.main(Builder.java:309)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)
I didn't understand why because if i open the link directly on chrome, i saw the json file
i've actually been getting 403 as well today when compiling my api's javadocs
even though the actual error is 404 lol
one sec
Can't get source to work on some stuff 😂
removing the <links> section helped for me
but idk what to do for you
it's very weird
yes can't do anything it's a buildtools jar 😂
all you can do is wait or try clearing your dns cache
it returns WorldServer
yes lets wait :sad:
oh wow, this indeed works:
.filter(material -> material.isEnabledByFeature(Bukkit.getWorlds().get(0)))
so that means there were experimental things already in 1.19.3?
weren't they introduced in 1.19.4?
and also how would you do the same in 1.19.3 where there is no such method
alrighty
Or just, stop using 1.19.3
better if i move to newer version then
gguys how i can make a unmovable item from the inv
You use the inventory click event and cancel it
ah ok thx
can display effects with custom name using ENTITY_EFFECT packets?
Hey guys how do I retrieve and update config.yml value in other plugin from my plugin?
just set the path and treat it like a custom config
using Fileconfiguration?
I mean I can't find a way to get this part
Plugin plugin = ```
Bukkit.getPluginManager().getPlugin("PlaceholderAPI") for instance
It may be null
So null check
Can I find a text tutorial how to to set up local database for a plugin?
just search up one for java in general
doubt you'll find any plugi nspecific ones
anyone have any idea how to stop EntityPlayer from literally dropping everything once killed
oh
so for the server it's still a zombie?
yep
Does an EntityDeathEvent fire?
custom damage?
then you shoudl raise your own events, if you want them to fire
@SuppressWarnings("deprecation")
@EventHandler
public void onPacketInSound(PacketSentEvent event) throws Exception {
if (event.getPacket() instanceof PacketPlayOutEntityMetadata) {
...
}
}
im trying
i tried completely spoofing the data
so the client wouldnt think that the entity had died
changing field "b" to 0.111111111111
I have an event handler for block break for spleef.
@EventHandler
private void onBlockBreak(BlockBreakEvent e) {
if (!game_running) {
return;
}
if (e.getBlock().getWorld() != world) {
return;
}
if (e.getBlock().getType() != Material.TNT) {
if (SBHManager.plugin.buildModeEvent.buildmode.contains(e.getPlayer().getUniqueId())) {
e.setCancelled(false);
return;
}
e.setCancelled(true);
return;
}
if (block_break || SBHManager.plugin.buildModeEvent.buildmode.contains(e.getPlayer().getUniqueId())) {
e.getBlock().getDrops().clear();
return;
}
e.setCancelled(true);
}
This is in 1.8 papermc, however it's spigot dependency for the plugin, which is why I'm asking here.
How do i stop the items from dropping? e.getBlock().getDrops().clear() doesn't seem to be working.
If it's too old version to get help with i understand.
Does anyone know how to stop it from dropping the block?
so the thing is, the client still see the drop IF and ONLY IF the zombie were killed by melee+ ranged attacks
can anyone help with github packages?
(which is fireable by bukkit)
What if the zombie burns to death?
there's no fire damage
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/block/BlockBreakEvent.html#setDropItems(boolean)
Does that exist in 1.8?
declaration: package: org.bukkit.event.block, class: BlockBreakEvent
ofc it does
well then that's the solution for him
how do you check that? is it part of the docs?
i developed plugins back in 2012
but on what? If I do e.setDropItems(false) it shows an error.
send me the stack trace
if you enable it and it dies through fire, does it still drop items?
Also shouldn't there be an EntityDamageEvent and EntityDeathEvent even when it's fall damage etc?
the class this function is in is named Spleef, pretty sure that's irrevelant. You probably meant class of event, yes it's BlockBreakEvent.
Cannot resolve method 'setDropItems' in 'BlockBreakEvent'.
That's not an error yet, that's just intellij though.
well
because
1.8.8
implementation
does not have the ``setDropitems` method
Then why did you say it exists @gray talon ?
what am I supposed to do then? Is there a way to do it?
"method"
the only useful method in that class back then
is GETblock()
yep u can
here's how
wait
isnt e.getBlock().getDrops().clear(); supposed to work
welp it wont
so use this
Objective objective = scoreboardlobby.registerNewObjective("ScoreboardLobby", "ScoreboardLobby", ChatColor.DARK_PURPLE + "" + ChatColor.BOLD + "MASTER" + ChatColor.WHITE + "" + ChatColor.BOLD + "MC");
objective.setDisplaySlot(DisplaySlot.SIDEBAR);
Score SpazioVuoto = objective.getScore(""); //blank space
Score ScrittaPlayer = objective.getScore(ChatColor.GOLD + "" + ChatColor.BOLD + "" +"Nome: " + "" + ChatColor.WHITE + NomeGiocatore ) ; //NOME SERVER NELLHEDER
Score Rank = objective.getScore(ChatColor.GOLD + "" +ChatColor.BOLD + "" + "Rank: " +ChatColor.WHITE + "" + " " );
Score PlayerON = objective.getScore(ChatColor.GOLD + "" + ChatColor.BOLD + "" + "Online: " + "" + ChatColor.WHITE + "" + GiocatoriOnline);
Score Social = objective.getScore(ChatColor.GOLD + "" + ChatColor.BOLD + "" + "Social: " + "" + ChatColor.WHITE + "" + "/Social " );
Score Votaci = objective.getScore(ChatColor.GOLD + "" + ChatColor.BOLD + "" + "Votaci: " + "" + ChatColor.WHITE + "" + "/votaci" );
Score Sito = objective.getScore(ChatColor.GOLD + "" + ChatColor.BOLD + "" + "Sito: " + "" + ChatColor.WHITE + "" + "www.mastermc.it" );
Score Ip = objective.getScore(ChatColor.WHITE + "" + ChatColor.BOLD + "" + " mastermc.it" );
SpazioVuoto.setScore(11);
SpazioVuoto.setScore(10);
Rank.setScore(9);
ScrittaPlayer.setScore(8);
SpazioVuoto.setScore(7);
PlayerON.setScore(6);
SpazioVuoto.setScore(5);
Social.setScore(4);
Votaci.setScore(3);
Sito.setScore(2);
SpazioVuoto.setScore(1);
Ip.setScore(0);
why I do not pass the empty spaces in the
it doesn't seem to be working. game_running is true world is the same, and it is tnt. Block_break is true
if (block_break || SBHManager.plugin.buildModeEvent.buildmode.contains(e.getPlayer().getUniqueId())) {
e.setCancelled(true);
e.getBlock().setType(Material.AIR);
return;
}
doesn't that remove the animation? what else is different?
it breaks other plugins
sucks
I don't really mind that, I'm slowly starting to manage my server with just a few plugins like LuckPerms and my own.
block.getLocation().getWorld().playEffect(block.getLocation().add(0.5, 0, 0.5),
Effect.STEP_SOUND, block.getType(), 20);
thats it
add animation back
it will add sound back too
which empty spaces? not passing them where?
hm
well
dont use like that
thats bad practice
let me give u this
why is step_sound the right one though? just curious.
use this quick lib
change vn.giakhanhvn to org
wait nvm
i need to remove this
package vn.giakhanhvn.skysim.sidebar;
import java.util.ArrayList;
import java.util.List;
import vn.giakhanhvn.bukkit.api.Bukkit;
import vn.giakhanhvn.bukkit.api.entity.Player;
import vn.giakhanhvn.bukkit.api.scoreboard.DisplaySlot;
import vn.giakhanhvn.bukkit.api.scoreboard.Objective;
import vn.giakhanhvn.bukkit.api.scoreboard.Score;
import vn.giakhanhvn.bukkit.api.scoreboard.Scoreboard;
import vn.giakhanhvn.bukkit.api.scoreboard.ScoreboardManager;
import vn.giakhanhvn.skysim.user.User;
import vn.giakhanhvn.skysim.util.Sputnik;
public class Sidebar {
private static ScoreboardManager manager = Bukkit.getScoreboardManager();
private Scoreboard board;
private Objective obj;
private List<Score> scores;
public Sidebar(String name, String identifier) {
this.board = manager.getNewScoreboard();
this.obj = board.registerNewObjective(identifier, "");
this.scores = new ArrayList<>();
obj.setDisplaySlot(DisplaySlot.SIDEBAR);
obj.setDisplayName(name);
}
public void add(String s) {
Score score = obj.getScore(Sputnik.trans(s));
scores.add(0, score);
}
public void apply(Player player) {
for (int i = 0; i < scores.size(); i++)
scores.get(i).setScore(i);
player.applyScoreboard(board);
}
}
here
i removed the User field
on 1.8.8 yes
Alright, tysm
my server core is 1.7.2
used packet tricks to let 1.8.8 -> 1.20 user joinable and 1.20 mobs accessible
so any mad engineers want to help me?
You'll have a hard time finding support for dead versions here
Why 1.7 lol
most reliable
😃
🤣 most funny guy
This is why server cores are a mistake bros locked in 9 years ago and can't escape
at least i can handle concurrent chunk load without any hiccups
Mmmk
and i hate newer versions so idc about those thing
doesn't look like they need support tbh :D
Why objective c
macos gui
Ah
Im trying to draw transparent images to map
but it makes the transparent parts see the map
im drawing this
I found a function online that takes each pixel and draws it
but
Yeah that adds up. That's what transparency shows on maps. You would have to draw pixel by pixel and ignore alpha pixels
It draws like this
oh
easy
here's the function
public void drawImage(MapCanvas cv, int x, int y, Image image) {
@SuppressWarnings("deprecation")
byte[] bytes = MapPalette.imageToBytes(image);
for(int x2 = 0; x2 < image.getWidth((ImageObserver)null); ++x2) {
for(int y2 = 0; y2 < image.getHeight((ImageObserver)null); ++y2) {
byte color = bytes[y2 * image.getWidth((ImageObserver)null) + x2];
if (color == (byte) 0x00000000) continue;
cv.setPixel(x + x2, y + y2, bytes[y2 * image.getWidth((ImageObserver)null) + x2]);
}
}
}
// bonus
protected BufferedImage res(BufferedImage originalImage, int targetWidth, int targetHeight) {
BufferedImage resizedImage = new BufferedImage(targetWidth, targetHeight, BufferedImage.TYPE_INT_ARGB);
Graphics2D graphics2D = resizedImage.createGraphics();
graphics2D.drawImage(originalImage, 0, 0, targetWidth, targetHeight, null);
graphics2D.dispose();
return resizedImage;
}
im testing it
why is it rainbow
I was trying to understand whats happening
most of it being black and white I didnt understandd
this is what it looked like with rainbow
use this function to remove transparent bits
I did
it should work most of the time
it worked
see it worked
yeah
how to speed up the update of army armor in this code so that it guides behind the horse - https://paste.md-5.net/oqijibomab.java
i can help everyone except myself
armor stand*
explain your problem
armour stand*
I do "2 sittings"
at the horse through the armor stand, but since the horse is moving, the armor stand should also move, but it still does not have time
eh
like
the armorstand
lags behind right
like it still moves
but slower
am i correct
yes
really MMS?
do you have CraftBukkit in your classpath/maven/gradle
i cant spoonfeed u on this one but let me make it clear
your armorstand is lagging behind because of 1 reason
i call it tick chunk
let me draw it out
wait a moment
i use code from this plugin but i dont think what plugin use NMS https://www.spigotmc.org/resources/twoplayerhorseriding.89058/
got it
i take code for move armorstand but dont know how he update
location
in this plugin
lagback?
no
it make sense
the thing is
if you want the armorstand to teleports
at the same moment your horse moves
either use TickStartEvent on paper or sth
or
create your custom Horse entity
and teleports the armorstand at the beginning of the horse's update method
what will be if i use vectors
here's how i would do it (1.8.8)
public void t_() {
super.t_();
teleport();
}
for move
too inefficient
vectors are sine and cosine
too many of them will add up
to a significiant chunk
Which
this exists?
what this i not was see this event
the fuck is your english
only if you're using Paper API
you're russian arent you
yea
i recognize the moment you type ")"
i mean
translate this sentence
"Use Paper API if you want to use the TickStartEvent event"
?fork
SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.
eh i not obaut this
?
so this plugin use event too?
this plugin suffers the same lagback you're experiencing
as far as i can tell
oh
Paper has the same scheduler system
onTICKSTART
read this diagram
or sketch
I'm making a plugin to order. Do you think it's possible to ignore this problem if the order for a horse costs 16.55 with other add-ons?
w h a t
ok
who could help me with github packages?
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
e
I want to publish a library on github and I have this problem, although I have tried many tokens [INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ library --- Uploading to github: https://maven.pkg.github.com/Xemii16/YeLibrary/com/yecraft/library/1.1-SHAPSHOT/library-1.1-SHAPSHOT.jar Uploading to github: https://maven.pkg.github.com/Xemii16/YeLibrary/com/yecraft/library/1.1-SHAPSHOT/library-1.1-SHAPSHOT.pom [IJ]-1-MojoFailed-[IJ]-source=LIFECYCLE-[IJ]-goal=deploy-[IJ]-id=com.yecraft:library:jar:1.1-SHAPSHOT-[IJ]-error=authentication failed for https://maven.pkg.github.com/Xemii16/YeLibrary/com/yecraft/library/1.1-SHAPSHOT/library-1.1-SHAPSHOT.jar, status: 401 Unauthorized [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4.208 s [INFO] Finished at: 2023-07-05T15:45:10+03:00 [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project library: Failed to deploy artifacts: Could not transfer artifact com.yecraft:library:jar:1.1-SHAPSHOT from/to github (https://maven.pkg.github.com/Xemii16/YeLibrary): authentication failed for https://maven.pkg.github.com/Xemii16/YeLibrary/com/yecraft/library/1.1-SHAPSHOT/library-1.1-SHAPSHOT.jar, status: 401 Unauthorized -> [Help 1]
you have no credentials in your settings
which?
~/.m2/settings.xml
your url looks wrong. remove the /YeLibrary from the end
just from your settings.xml
The same
what deploy are you using?
mvn deploy -Dregistry=https://maven.pkg.github.com/Xemii16 -Dtoken=GH_TOKEN
does not work :c
its what I use
so long as your password is a valid token in your settings.xml
must be a token not your github password
so it's a token
when I use Player#getTargetBlock(Set<Material>, int), how do I get the blockface to place a block at that point? or does it work in a different way I don't understand?
oh gosh
do u want it?
maybe, but I dunno how
you think I understand anything?
yes
well, you might be wrong
well, I've heard of raycasting
forward until you hit a wall
rayTrace is teh spigot method
so how i can make it?
im stuck in 1.7 you know
i write libraries for my use
so idk how the API has grown
time for seppuku
i sent u the sidebar snippet down there
change vn.giakhanhvn.bukkit.api
to org.bukkit.