public void spawnBorder(Particle particle, int minX, int minZ, int minY, Chunk chunk, Particle.DustOptions Colro) {
for(int x = minX; x < minX+17; x++) {
for (int y = minY; y < minY + 1; y++) {
for (int z = minZ; z < minZ + 17; z++) {
chunk.getWorld().spawnParticle(particle, minX, y, z, 10, Colro);
chunk.getWorld().spawnParticle(particle, x, y, minZ, 10, Colro);
chunk.getWorld().spawnParticle(particle, minX + 16, y, z, 10, Colro);
chunk.getWorld().spawnParticle(particle, x, y, minZ + 17, 10, Colro);
}
}
}
}
```I have this code here, which places particles around the placed block of a chunk, basically outlining a chunk. However, how would I be able to make it go up several blocks? (the particles) I have not yet found a way to make that happen. Only breaking my code trying to
#help-development
1 messages · Page 1148 of 1
Do they not already go up several blocks
public void invoke(Player p) {
BlockState state = p.getLocation().getBlock().getState();
state.setType(Material.AIR);
state.update(true, false);
return;
This command, when used on some floating redstone, causes the redstone to drop, despite update's second boolean being set to false. Why?
Does anyone know why this event is called for all monsters and even for an experience orb, but not for the warden? Thanks!
This only seems to affect redstone.
for (int y = minY; y < minY + 1; y++) { have you tried increasing the +1 in this line
A lot of new mobs uses new AI that is different from others, they never fires this event and you can't handle their target via API, because it's stored in their "brain" memory which is currently in NMS only.
It's kind of worked? It just stops making one part though..
I would assume it's because of the speed they get spawned? However, what function from the bukkitRunnable would be the best to use here?
💀
@ choco
xD
runTaskTimer?
i feel like im going out of my mind
doesn't work with flowers for example
What if you just do Block#setType(air, false)
You're spawning way too many particles, that's why it's not rendering a portion of it
run that outside localhost and see how hard your network gets DOS'd
You're spawning at minX, minZ, maxX, and maxZ, sure, but you're still looping over every block in the chunk, you're just spawning the particles on the edge
So you have like 16 particles in one block (that's why they look so thick)
The client will only render so many particles, so that's why it's culling them :p
worst I've seen was like 200mbps worth of particles per client :p
was working in class and ran out of data within a couple minutes
Just make a thicker texture
World world = chunk.getWorld();
int maxX = minX + 16, maxY = minY + 16, maxZ = minZ + 16;
for (int x = minX; x <= maxX; x++) {
for (int y = minY; y <= maxY; y++) {
for (int z = minZ; z <= maxZ; z++) {
if ((x != minX || x != maxX) && (z != minZ || z != maxZ)) {
continue;
}
world.spawnParticle(particle, x, y, z, 10, Colro);
}
}
}
same thing
Your loop should look like that, then it should generate a horizontal wireframe for you. I think
If I did my math right, anyways
I mean you could probably optimize that loop for sure to have less iterations, but in its simplest form, that would work
use IntStreams instead
This is why hypixel has performance issues
the optimized form is pretty simple too, I believe
you just loop all the values between min and max separatedly instead of in a nested loop, and do the spawning of the particles for all the sides
Yeah. Just couldn't be bothered
You're right though
is there a way i can like fire an event or something from a different class to run some code without static abuse
if (checkVersion(args)) {
//runs code from diff java file
}
}```
Delaying it in a runTaskTimer has not fixed the problem, it still cuts out some of the particles
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Read the other replies
I have not read those, one second
for (int y = minY; y <= maxY; y++) {
world.spawnParticle(particle, minX, y, minZ, 1, color); // Edge 1
world.spawnParticle(particle, minX, y, maxZ, 1, color); // Edge 2
world.spawnParticle(particle, maxX, y, minZ, 1, color); // Edge 3
world.spawnParticle(particle, maxX, y, maxZ, 1, color); // Edge 4
}
for (int x = minX; x <= maxX; x++) {
world.spawnParticle(particle, x, minY, minZ, 1, color);
world.spawnParticle(particle, x, minY, maxZ, 1, color);
world.spawnParticle(particle, x, maxY, minZ, 1, color);
world.spawnParticle(particle, x, maxY, maxZ, 1, color);
}
for (int z = minZ; z <= maxZ; z++) {
world.spawnParticle(particle, minX, minY, z, 1, color);
world.spawnParticle(particle, maxX, minY, z, 1, color);
world.spawnParticle(particle, minX, maxY, z, 1, color);
world.spawnParticle(particle, maxX, maxY, z, 1, color);
}
it is quite the lengthy code to write, I'll give you that lol
You’re spawning more particles than the client can render at once (16k)
Would explain a lot, let me change that
I feel like streams would actually be more readable in this case
Which is rare
map every edge and generate a line between
how do I get the progress of an advancement? like the advancement seedy place has multiple criteria, but only 1 has to be met, but stuff like hot tourist destination also have multiple but only one is required
hell no
that would look horrible in Java
rangeClosed, but yeah
I'm more used to look at the classic for each, would be nice if I wanted to make the particles spawn in parallel tho
You don’t want a range
I could compose the streams and do #parallel on it, then chaos
You want only the 2 x and z values
Technically you could also do
for (int x : new int[] {minX, minX +16})
or some way with packets would be acceptable too
thats not enough information
like I wanna make something where I can show the progress of an advancement
AdvancementProgress#getRemainingCriteria()?
so I need to know how many required steps an advancement has
that always shows regardless of if the advancement is actually completed, so if I combine it with checking if the advancement is complete, I have a nice way to know after the fact..
Hmm yeah it only has an isDone
thats kinda dumb because the advancement specs have a requirement which I think actually contain the info about how many things need to get done
but the api can only retrieve the name of all criterias of an advancement and whether they have already been completed
which is kinda limited
?mappings
Compare different mappings with this website: https://mappings.cephx.dev
yeah it seems like there exists an AdvancementRequirements, which is a list of list of strings which have info about how they should be completed
but idk how to get that without nms
If you go in with some NMS and get the AdvancementProgress from CraftAdvancementProgress
You can get more from that
java.lang.NullPointerException: Cannot invoke "me.czr.crazyEnvoys.CrazyEnvoys.getConfig()" because the return value of "me.czr.crazyEnvoys.CrazyEnvoys.getPlugin()" is null```
why am i getting this error
Exactly what the error says. #getPlugin() is returning null.
no i get that but idk why
?paste your code
This sounds like a possible PR.
that would be even better
ideally the Advancement class should jsut have this list<list<strings exposed
Shadow is volunteering
runs
or the advancementRequirements class if you wanna spend too much effort
Idk, I could attempt it, but I haven't really messed with advancements all that much.
I've just realized that as of 1.21, the Luck enchantment seems to be missing from the Spigot API. What's up with that?
Luck isn’t an enchantment
Also I think now there is a Luck arrow that can be given from a villager? It's always been a thing, the icon for it was a 4-leafed clover
Luck of the sea was separate
Where are you calling #getPlugin()?
Oh right that was. Well I always had luck for items when I wanted an enchantment that had no effect.
And it was separate. Idk where they went
Like I said it’s probably luck of the sea
@young knoll for clarification, even with '//perf neighbors off', a worldedit brush still causes adjacent redstone to pop
We renamed them to not have terrible names
wasn't it minikloon that constantly used this
int[] iterations = {-1, 0, 1};
for(int x : iterations) {
for(int y : iterations) {
...
}
}
Fair enough, must have been it. Thanks.
I've not done any spigot work since 1.19 so I'm playing catch-up now.
Idk ask minikloon
Hmm, nothing looks off to me.
I don't use this method though. I'd recommend dependency injection and see how that works out.
If I have to expose internal methods, is that usually bad design
with some help from paperweight-userdev this sems to work fine for me, thanks for helping out again ConsoleMessenger.log("REQ: " + ((CraftAdvancement)a).getHandle().value().requirements().requirements());
its a bit janky but good enough
For reference, what does this print out?
in the case of advancements with multiple actual requirements (like hot tourist destination, it prints all of them in a separate list: i.e. [[criteria_1], [criteria_2]] and for advancements with just one required one, like seedy_place, it puts them all in the same sublist, i.e. [[criteria_1, criteria_2]]
which according to the wiki means that I can just count the amount of sublists to determine the actual amount of criteria that need to be completed
under requirements
and that seems to be correct from the output I got
Does that mean AdvancementProgress#getRemainingCriteria().size() was just what you needed?
Or is there a little more to this?
no
this does not take into account the difference between advancements that have multiple crits but only 1 required vs multiple crits but all are required for the advancement
since the criteria.size just lists all possible criteria
the requirements are actually needed to know what is actually the minimum of things to complete
without it I have no way (apart from hardcoding it) which advancement fall under which category
i.e. seedy_place needs only criteria, but for for like monsters_hunted you need them all to get the advancement
but both specify multiple possible criteria
if that makes sense
Is there an easy way to view example data of those advancements?
I want to see the structure of it and sometimes the wiki examples don't do it justice for me.
and ofc craftbukkit just returns the requirements and criteria listed in the json
Ah, ok. I see now.
Requirements having more than one sublist make a multi-criteria advancement.
Key thing being that each sublist only contains one unique criteiron.
Hey it worked
That's just great. Private access.
Does this mean I would have to create a patch that makes it public? Or would that just break things?
i took it from the Advancement itself
I dont know if the requirement changes when progressing
so I didnt bother with the AdvancementProgress
im assuming only the criteria actually update with the progress
and then get checked against the requirements map
which is just stored here for ease of access
i guess
I think that is what's going on.
and there its just a record
Ah wait, so is this just as simple as exposing it on the parent advancement class?
hello i'm trying to put fire above the glass and here is my code.. can someone help? when i try another block everything goes ok
package com.blocks.flintonglass.events;
import com.blocks.flintonglass.Main;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
public class FlintOnGlass implements Listener {
private static final Material[] FireBlocks = {
Material.GLASS, Material.STAINED_GLASS
};
@EventHandler
public void onI(PlayerInteractEvent event) {
Player player = event.getPlayer();
if (player.getItemInHand() == null) return;
if (player.getItemInHand().getType() == null) return;
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
if (player.getItemInHand().getType() == Material.FLINT_AND_STEEL) {
if (event.getClickedBlock() != null && isFireAble(event.getClickedBlock().getType())) {
Block blockY = event.getClickedBlock().getRelative(0,1,0);
if (blockY != null) {
Bukkit.broadcastMessage("§c§lFIRE!!");
blockY.setType(Material.FIRE);
}
}
}
}
}
public boolean isFireAble(Material block) {
for (Material fireAble : FireBlocks) {
if (block == fireAble) {
return true;
}
}
return false;
}
}
Assuming you see the fire for at least 1 tick and it vanishes again:
the game might auto-remove fire from glass next tick would be my guess since glass isnt "burnable".
check BlockFromToEvent and see if the getBlock is fire, and getToBlock is air.
If so, this is cancellable. (but in the case of fire on glass may have to cancel it each and every tick perhaps)
reflection
ezpz
@pseudo hazel Is this what you would be looking for?
yeah pretty much exactly
NamespacedKey.minecraft 
Yipee
Well, thankfully it is easy to expose.
I'll create a PR shortly, but we'll have to wait and see if it'll get accepted.
awesome, thanks for the effort 😄
Normally we expose things by just making them public
Since minimal diff
Is that good coding practice? Probably not but shh
thou must not upset the mindiff
Would this not be the appropriate way to do it?
Since there is already a way to get the values?
I wonder if value.display can be reused
Yeah
Although idk if a List of lists is an ideal return type
Yea, I figured that would be brought up, but I'm not sure what else to put it as since that is what is returned.
The first #requirements() returns an NMS class and we can't use that one.
Only one way to find out. :kek:
@young knoll I went ahead and made the PR. Would the current update be a better approach instead of just using a list of lists?
in some servers it works without any plugin
is that because of the server jar or version
Probably works if dofiretick is off
from server propertis?
or gameRule
Gamerule
still same
Redstone is still bugged. How do you avoid causing chains of redstone to break when updating a block in this version?
context?
If you have floating redstone and update one of the dust to another block, it triggers a chain of all the other redstone popping
well yh thats called block updates. Give this a try https://bukkit.org/threads/how-do-i-stop-block-updates.462941/
@valid burrow Not possible in current version.
Redstone has a unique new update mechanic separate from normal physics.
geyser for you
fuck that imma just
why is discord butchering 10-bit color again
makes my images look like they're being rendered on a washing machine lcd
Oh yeah switch statements exist
Or whatever you call that bastardized Kotlin version of them
ah shit I need to optimize these
a when 👍
400k blocks ish
watcha makin
code
It's fixed now was just throwing proxy compile issues when I'm not trying to build the proxy >:/
working on recap forms now
I’ve always wondered if it would be feasible to detect if the player was in a fully enclosed building
Efficiently
are you making a thing to run java plugins on bedrock or what is this
nah we're running geyser and we have some custom modifications n stuff
is geyser the one that lets bedrock connect to java clients or other way around?
I'm in the process of setting up a multiple world with plugins for java and bedrock atm.
It allows bedrock clients to connect to java servers
fucked up my branches so I spent like 20 mins looking on how to restack these with our fancy work tools
(it was a single command)
lmfao my code ran so hard it crashed the dedi
it's like 5am my lead dev ain't up to restart it ffs
pro tip: if you're writing a chunk system make sure to have a size counter, don't get lazy and map every location
how much did you map?
400k blocks
but I was doing size checks every second
and this is like an 8 core 2013 xeon iirc
thats not that much, how did it crash it? OOM?
4 core xeon
maybe
it has like 32gb total ram, 4gb process
ah 4gb process
lovely cpu
I recommend next time utilizing memory mapping if you really want to map that much to dump some of those objects to the cache
I'm tryna optimize from a huge List<Location> into a more appropriate structure x)
nah I'll just have a size counter
we almost never map it back to a list
When we do we immediatelly filter within a radius so chunking it out is a better approach
as we're less cpu-bound
🤔 interesting it maxes out ram and cpu
eh this is fine
how am I maxing out 5 cores if the machine only has 4
iirc its threads i think
if its a vm with more cores in the server that's possible
how the fuck would that work
I'll blame hyperthreading and assume we have 8 logical cores
correct
i have 32 core and 64 logical
so a 4 core could if needed use 6 if they are avaliable
The good thing of a crash loop is that you don't need to restart your server to test changes
it just does it for you
welp this never fires
VM's allow you to spoof the amount of cores then what there really is
I can create a VM right now with 16 cores when I really only have 4
ideally you shouldn't do this because you will have a degradation of performance
I checked it on a ptero instance
@remote swallow @echo basalt those are Threads
no they're screenshots
No they're screenshots
No they're Screenshots
been struggling with encoding a damn position for the past hour
istg for some reason I can't just << 8 & 0xf like twice
shl 8 and 0xf in kotlin
L
and.. we're out of disk space on the work machine
latest.log is 250mb wow
I think my issue is ()'s
java doesn't struggle as much because && and ||'s have priority
grateful for windows programmer calculator rn
bossman gonna wonder why I'm charging 10$ for each character I type
What event is the event that generates/loads the blocks in a chunk
AFAIK there isn't one you need a custom chunk generator
ChunkPopulateEvent? But generator is better
can anyone help me im trying to get rid of the numbers circled using placeholderapi
can i not send images here?
?img
Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.
Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org
can anyone help me im trying to get rid of the numbers circled using placeholderapi
okay sorry for the wrong channel
does anyone know why json doesn't keep order if i serialize/deserialize it?
gson
i just have a list inside a map
i don't use adapters or anything
it's the default
Looks like gson doesn't handle a specific order
You'll need to write your own adapter for it
hmm
i can use an array instead
string arrays should keep the order no?
it's a string list as of now
it converts it into an array list it seems
i think the order is alright
but the socket is sending it in an unordered way
Is the order important?
General curiosity thing.
As spigot doesnt take a cut of paid plugins i was wondering, as a dev, why ads to other sites selling plugins aint allowed in ur plugins.
Dont get me wrong i dont hate it, just generally curious as i always assumed spigot took a cut was the reason
People would start advertising to bypass rules
Would be my guess
Such as Spigot price limit
someone has any idea
guys, do you know how to make command suggestions show player names?
i know mojang has something that works only for visible names in tab
i don't wanna just use Bukkit.getonlineplayers and spoil someone with vanish
i think i'll look into some bukkit commands
ah nevermind, i followed how mojang does it, and it's just playerList.getplayernamesarray
what is the protocol to get all sounds?
Return null will suggests online players
Unless the server has disabled that
guys
i used to use
public class CustomMobs extends PathfinderMob {
public CustomMobs( Level world, Location loc) {
super(EntityType.AXOLOTL, world);
setPos(loc.getX(), loc.getY(), loc.getZ());
//TODO Auto-generated constructor stub
}
}
to create custom mob using pathfindermob (entitycreature) but when i updated to 1.20.4 i no longer able to do that
class org.obsidan.zombieapogalipse.CustomZombie.CustomMobs cannot be cast to class net.minecraft.world.entity.animal.axolotl.Axolotl
this is a error
is there anyway to fix this?
i aready did but still error:
Show code
@EventHandler
public void onCommandssender(AsyncPlayerChatEvent e){
Level level = ((CraftWorld)e.getPlayer().getWorld()).getHandle();
CustomMobs mob = new CustomMobs(level, e.getPlayer().getLocation());
level.addFreshEntity(((CraftEntity)mob.getBukkitEntity()).getHandle(),SpawnReason.CUSTOM);
}
are you remapping
sure
i have other class
package org.obsidan.zombieapogalipse.CustomZombie;
import org.bukkit.Location;
import org.bukkit.persistence.PersistentDataContainer;
import org.bukkit.persistence.PersistentDataType;
import org.obsidan.zombieapogalipse.Behavior.BreakAnyBlockGoal;
import org.obsidan.zombieapogalipse.utils.Keys;
import com.google.common.base.Predicate;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.PathfinderMob;
import net.minecraft.world.entity.ai.goal.target.NearestAttackableTargetGoal;
import net.minecraft.world.entity.monster.Zombie;
import net.minecraft.world.level.Level;
public class OverrideZombie extends Zombie{
public OverrideZombie(EntityType<? extends Zombie> entitytypes, Level world, Location loc) {
super(entitytypes, world);
setPos(loc.getX(), loc.getY(), loc.getZ());
//TODO Auto-generated constructor stub
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
protected void registerGoals() {
super.registerGoals();
this.goalSelector.addGoal(1, new BreakAnyBlockGoal(this));
Predicate<net.minecraft.world.entity.LivingEntity> customPredicate = entity -> {
PersistentDataContainer datadamager = entity.getBukkitEntity().getPersistentDataContainer();
if ((!(datadamager.has(Keys.ZOMBIE, PersistentDataType.BOOLEAN)))&& (!(datadamager.has(Keys.INJECTED, PersistentDataType.BOOLEAN))) ) {
return true;
}
return false;
};
this.goalSelector.addGoal(2, new NearestAttackableTargetGoal((PathfinderMob)this, net.minecraft.world.entity.LivingEntity.class ,0, true, false, customPredicate));
}
@Override
public void aiStep() {
super.aiStep();
}}
it extends zombie and it working fine
?paste the error
but when the pathfindermob have extremly error
So I don’t see you override the method I mentioned
can you guide how to override getCraftEntity?
Just override it to return a custom CraftEntity class
Which is just an empty class that extends one of the CraftEntity classes
bruh idk what the method getCraftEntity returned hmmm
so hard to find
I think it’s getBukkitEntity
i find it out
but
public CraftEntity getBukkitEntity() {
return this.getBukkitEntity();
}
uhhh what should i do with this
i relized this method doesn't exits bro
the only i see is getBukkitEntty
and getCraftEntity hmmm
Yeah getBukkitEntity is the one you override
ohhh
but the type of my class is PathfinderMob also this is .class how can i get the CraftEntity one how to cast it can you guide me pls
when i tried "this" is say Type mismatch: cannot convert from CustomMobs to CraftEntityJava(16777235)
public CraftEntity getBukkitEntity() {
return this;
}
You need to make a custom class that extends the appropriate craft class
I admire your patience
I think CraftMob is the equivalent to PathfinderEntity
hmm so i will make a class that extends the livingentity then return to that classes?
bruh it used to be very easy
but after the update
;-;
none of this has changed in over a decade lol
but how the method stopped working bruhhhh
It’s because we changed how we map NMS entities to Bukkit entities
No more giant ugly nested if statement
Could someone explain to me how to do AFK lobbies in Apex Legends as and what is needed?
Huh what
Eh?
hmmmm
Is there a line missing with the exception?
Like NullPointer, Cannot cast ... to ... or something like that?
this is being chopped off considering it starts with tEntity
full off error
is your zombie meant to be an axolotl?
yes
back to 1.16.5 i just this method to create the same entitypathfinder with ustom entity model
like many type
but when i upgrade to 1.20 it got an errors
cfile = new File(Envoys.getPlugin().getDataFolder(), "config.yml");
config = YamlConfiguration.loadConfiguration(cfile);
sender.sendMessage(Colorize.colorize("&8[&cE&4n&cv&4o&cy&8] &ePlugin Reloaded!"));
}```
anyone know why this isnt working? am i just using a really outdated way to get the config file
What is not working? We cant read minds
nvm just me being stupid sorry
Its fine, sometimes everybody is a bit stupid
Anyone know how to avoid redstone popping on the current update?
popping?
me being stupid was sumn else uhh do you know why its not reloading?
Tell me what happens and what should happen and we can talk about it?
put a new magazine in
I love your commentary tbh xd
what do you mean by reloading
like if you update the config its supposed to reload new data you put in
example
changing Message: "&8[&cE&4n&cv&4o&cy&8] &ePlugin version: 1.1" to Message: "&8[&cE&4n&cv&4o&cy&8] &ePlugin version: 1.2"
then reloading
should output the 2nd one
How are you using the config
Show the code of you reading from/using the config
and when are you reloading the config
on command /envoy reload
sender.sendMessage(Colorize.colorize(config.getString("versionMessage")));
no
its a subcommand class
public Void perform(Player sender, String[] args) {
if (args.length == 1) {
if (Bukkit.getPlayer(sender.getDisplayName()) != null) {
sender.sendMessage(Colorize.colorize(config.getString("versionMessage")));
}
}
return null;
}```
You're using the old config instance
So what did you change
public Void perform(Player sender, String[] args) {
if (args.length == 1) {
if (Bukkit.getPlayer(sender.getDisplayName()) != null) {
FileConfiguration config = CzrEnvoys.getPlugin().getConfig();
sender.sendMessage(Colorize.colorize(config.getString("versionMessage")));
}
}
return null;
}```
moved the config instance into the perform
so it re-gets it every time
or should i load it straight from the file
And in your reload command you set the config instance?
cfile = new File(CzrEnvoys.getPlugin().getDataFolder(), "config.yml");
config = YamlConfiguration.loadConfiguration(cfile);
sender.sendMessage(Colorize.colorize("&8[&cE&4n&cv&4o&cy&8] &ePlugin Reloaded!"));
```
Did that reload message get sent
yes
of which
can anybody explain why they are using Void instead of void
reload command
Consumer or Something like that?
it gives an error about clashing
Interesting
So you're not changing what getConfig returns
??
getConfig still returns the old config
im just following the tutorial 😭
i was thinking that
sendTitle is deprecated what should I use
loading it from the file should work then ye?
if its deprecated it should still work
Read deprecation note
It tells you
File cfile = new File(CzrEnvoys.getPlugin().getDataFolder(), "config.yml");
FileConfiguration config = YamlConfiguration.loadConfiguration(cfile);
sender.sendMessage(Colorize.colorize(config.getString("versionMessage")));
}```
will this work
No
y
am I silly
Ah yeah
why are you jumping through hoops to load a config.yml ?
1.8.8 only has one override for sendTitle and its deprecated
1.8.8 💀
That will work but isnt a good idea
you can still use deprecated
sendTitle() with times was added later
most of the time
I knwo but I hate the fucking warning
(a) Update, (b) it's fine. Suppress the warning and use the method
trust me ur gonna get stupid warnings everywhere
thankis
Plugin#reloadConfig()
only got 2 so far
how many files
:o
I mean it's not stupid. It's a warranted deprecation. The default times are subject to change if Mojang feels like it lol
It's undefined internal behaviour
We don't backport features to 10 year old versions
You're the problem here, not Spigot
drinking coffee and smoking
If you want to maintain a 1.8 fork, you are more than welcome to
That's one of the benefits of Bukkit being open source
Choco let's rewrite the entire jar and make everyone happy
Just don't expect us to guide you through the forking process and how to go about doing things
thanks
allat just to not get a warning
you're getting ahead of yourself. I'm only talking about backporting a single method
for my own plugin. nothing about forks or you guys
I actually never thought that cb could be closed source and it would still work because api
But now I thought
And I'm making a paid modding API
Yes. Backporting a method involves creating a fork lol
how
You are forking from the base branch to create commits
could I not just write nms
That works too
I mean, yeah, you could use NMS. But that's not forking the software to backport a method
Just send the packet yourself
thats not what I meant sorry for the misunderstanding
Just manually write the bits onto your network adapter using your hands
I dont have a 1.21 dev environment open but would anyone happen to have the code for sendTitle up
?stash has
can i ask why your avoiding using sendTitle
I figured out I need the time that the recent versions bring
true just use the deprecated one
Because of a warning that could be supressed
💀
timing*
You're not updating anyways
Lol
no sorry
sender.sendTitle("hi", "hi");
btw Spexx are you okay buddy?
the only thing i update is windows
this looks cool but I'm not sure where to look to see decompiled and mapped code
why are you avoiding sendtitle
what is the issue with it
is it just because of the error
?nms
I require the timing
?stash
stash should have it
Then use the recent versions
oh shit thank u I didn't know where to look to find craftplayer
?stash
/* function not doing anything */
boolean isClaimChest = connectDB.isClaimChestInChunk(chunk.getX(), chunk.getZ(), e.getBlock().getLocation().toString());
if (isClaimChest) {
e.setCancelled(false);
connectDB.removeClaim(chunk.getX(),chunk.getZ());
e.getPlayer().sendMessage("§dYou've removed a claim chunk chest, chunk unclaimed.");
}
/* connectDB.isClaimChestInChunk() */
public static boolean isClaimChestInChunk(int chunkX, int chunkZ, String ChestCoords) throws SQLException {
try (PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM claims WHERE chunkX = ? AND chunkZ = ? AND claimChestLocation = ?")) {
preparedStatement.setInt(1, chunkX);
preparedStatement.setInt(2, chunkZ);
preparedStatement.setString(3, ChestCoords);
ResultSet rs = preparedStatement.executeQuery();
Bukkit.broadcastMessage("True or False? " + rs.next());
return rs.next();
}
}
```Whenever I try to break the claim chest, nothing happends? the Database does contain the right data
you are making db calls in the BlockBreakEvent?
The boolean variable is calling the db, yeah
Top line
very bad idea
Oh.. Why?
db access is extremely slow. Its going to lag your server every time someone breaks a block
Even if i'm using sqlite?
sqlite is a mix of file and memory storage, but yes
as for it not finding a claim, you provide too little information
debug your claimChestLocation
It does find the claim, it doesnt trigger isClaimChest
It has been returning true or false though? When making a SELECT query
It does in other functions, atleast.
you are calling it twice so the second rs.next() is false
isFound = rs.next();
sysout...
return isFound();```
That could be one thing. I'll be sure to test that when i'm home
Wouldnt it be better to store some sort of information in the chunk itself with PDC?
The chunk extends from PersistentDataHolder, so it would be possible
(Depends on what you need to store)
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Chunk.html
declaration: package: org.bukkit, interface: Chunk
any idea why this error happens on the latest spigot release only? https://pastebin.com/beAGGxmm
Pastebin
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
something to do with enchants
it happens inside the api/impl itself
pepelaugh
ah i see

Jira and stash are the same login to sign into stash you need to sign the cla
Forums and jira are different logins
i didn't sign that which makes sense
Steps to recreate?
Also don't use an expiring pastebin
oh boy, this might be complicated since it's in the gui
i'll see
also i forgot about the expiring pastebin, one sec
After reading the code and exception would say:
Create Item
Add Item Flag
No Enchantment
Error?
Yea
WOWOWOWOW
i fixed the pastebin, in a few moments i'll try to recreate the issue
Maybe this is why PRs exist? To get feedback before pushing broken stuff?
im working on a pathfinding system that applies multiple filters to validate movement between nodes.
example filters:
- WalkableFilter: walkable path for entities, requires a solid ground
- NoHarmFilter: avoids dangerous materials such as fire, lava, wither roses and magma blocks.
- JumpDownFilter: basically jumping down from a cliff with a given max height
the issue arises when, for example, the target block at the end of a jump-down is a harmful block (e.g., magma). if we strictly enforce all filters to pass, legitimate jump-down paths are blocked due to the WalkableFilter. on the other hand, ignoring the harmful block validation could lead to dangerous paths being marked as valid or other side-effects.
looking for input on how to resolve this conflict between filters to ensure that valid paths (like jump-downs) are not blocked, while still avoiding dangerous materials when necessary.
code context:
what "PR reviewers", there was no PR
that was the joke 
oh, I thought the joke was that no one can see PRs
guess there are multiple applicable jokes
would have been a good one too yea lmao
at least its a quick fix i am sure the slime will get to it soon
This has not fixed it, nothing happends
show your code
The function or the blockbreakevent?
function
/* Block Break Event */
@EventHandler
public void onBlockBreak(BlockBreakEvent e) {
try {
Chunk chunk = e.getBlock().getChunk();
boolean claimed = connectDB.chunkClaimed(chunk.getX(), chunk.getZ());
boolean authorizedPlayer = connectDB.playerAuthorized(e.getPlayer(), chunk.getX(), chunk.getZ());
e.getPlayer().sendMessage(e.getBlock().getLocation().toString());
if (claimed) {
boolean isClaimChest = connectDB.isClaimChestInChunk(chunk.getX(), chunk.getZ(), e.getBlock().getLocation().toString());
if (isClaimChest) {
e.setCancelled(false);
connectDB.removeClaim(chunk.getX(),chunk.getZ());
e.getPlayer().sendMessage("§dYou've removed a claim chunk chest, chunk unclaimed.");
} else if (!authorizedPlayer) {
e.setCancelled(true);
e.getPlayer().sendMessage("§cThis chunk has been claimed by someone and is protected.");
} else {
e.setCancelled(false);
}
}
} catch (SQLException ex) {
ex.printStackTrace();
}
}
/* Function */
public static boolean isClaimChestInChunk(int chunkX, int chunkZ, String ChestCoords) throws SQLException {
try (PreparedStatement preparedStatement = connection.prepareStatement("SELECT * FROM claims WHERE chunkX = ? AND chunkZ = ? AND claimChestLocation = ?")) {
preparedStatement.setInt(1, chunkX);
preparedStatement.setInt(2, chunkZ);
preparedStatement.setString(3, ChestCoords);
ResultSet rs = preparedStatement.executeQuery();
return rs.next();
}
}```
Little side note: everything works, besides the if(isClaimChest)
no errors
method looks fine now
I've got a feeling it has to do with if(!authorizedPlayer), because I keep getting that message
instead of it first checking isClaimChest
I fixed it, spelling mistake somewhere. 🤦♂️
that's a lot of code
what about a golden ticket system, give each filter the golden ticket every n seconds so they can evaluate the path
mojang if i remember correctly implements priority
so if you have a conflicting filter consider prioritizing which filter /pathfinder to go first
in our case that would just change the order of the filters, but in the end all have to pass to mark the position as valid
i still think it's a priority issue
i thought about introducing a filter aggregator which basically merges the results so that all filters together act as one big algorithm instead of single results
the path should change as it's found dangerous or not
so when a lava block is found, recalculate, go around
i don't know the exact implementation of what you're working with, but i assume this should work
just that in the current state all filters have to pass. the conflict is still there. the landing point could be dangerous (the filters dont know each others result).
so i thought about dynamically changing the target position which is to be evaluated, means that JumpDownFilter overrides the position to validate for the following filters
but that could also have downsides and changes the filters responsibility from just providing feedback to then consciously influencing the path from outside
create a unified accessor then
in what way?
so the end result is the result of all your filters
yes thats what the filter aggregator is meant for. basically we have that already just in a way, that if one filter fails, all do
this was my approach, but i feel like this might not be the way or im steering into a dead end
https://github.com/patheloper/pathetic/compare/trunk...filter-aggregator
and if i imagine how a* works correctly, you'll need to apply your filters at each possible node
thats exactly whats happening
it doesnt
but i was too lazy to debug yet and that really breaks up our filter logic
so i was seeking for other perspectives
we can help so much, you're the one who is heavily involved in this project
it looks clean tho, so that's nice
and i think thats the main problem lol. im way too involved to see a simple solution
well, if it's just a filter then each filter should run at each node
the result of a fail should make the pathfinder look for another
yeah thats the fundament of the filters
if the path is innaccessible it should stop near the path it fails
i just need to find a way to merge the results and make them build up on another without knowing eachother
but it should work without knowing each other
i mean a fail does change the result no?
maybe your filters sits at a wrong level
f.e. validating the jump position with the noharmfilter, then jumping down shifts the position to the landing position, but the validation of that position only happens at the next iteration, or technically spoken after all the air blocks which are considered as "the jump"
and if that fails, we would need to traverse back to find an alternate route
i think thats the main problem im trying to describe
á filter conflicts
mojang has a jump controller/look controller/move controller
maybe your jump should be separated
wait nevermind, it shouldn't matter
i'm not familiar enough with your project to be helpful
you are, you're giving me points to think about. sometimes it helps to just speak about it
Location1:
world:
x:
y:
z:```
i want to save locations to config how do i loop through to find the next available save slot
like if location1 is taken it goes to location2
save a list
we've had 2 problems to begin with. f.e. what happens in dead ends, how do you traverse back and when do you stop traversing. for that i thought about having control points which are introductory positions of new path routes, f.e. climbing a mountain, dropping down, new terrain etc. so that you can jump back to that control point and retroactively mark the examined positions as not traversable
maybe that could be the solution for the filter conflicts, or at least a part of it
progressively
can you explain that a bit further?
if i think more about this, maybe it doesn't help you at all
you've probably built a different system entirely
so there might not be much for you to learn
most likely. what information would you help to understand this more?
i still think a filter should change the position, no matter what other filters say
but in that case, why should a filter, which only responsibility is to filter, change the internal position?
but don't you try to filter in order to change what happens with the path?
yes, but in order to validate
i mean, i've had the same approach with the filter aggregrator, that there is one mutable context shared over all filters, but i dont really like the idea of filters changing the context
- that adds a whole new layer of complexity
this is out of my ability to help you, you're way more familiar with the project that i am with the pathfinding subject
alright, but thanks for your input :)
you're welcome, sorry i can't be more helpful
all good tho, you did enough
how does luckperms make it so when you type /lp applyedits XXXXXXXX --force the --force is red
Brigadier stuff
whats brigadier
minecrafts command shebang
iirc you can use it for your own commands but im not sure how
There are a couple of apis that wrap it
alright
guess Im not using it then
this shi way to complex
sounds, at least
guys, is 420 lines in my command class normal
or am I doing something wrong
cuz tbh thats a bit high
the amount of lines should never be a determining factor
its always about the contents of those lines
well
as long as the class does only one thing it's fine
explain
a class shouldn't do a and b
thats undefinable
??
i mean it shouldn't be a lamp and a tv screen
thats a strawman
Anyone know how to avoid redstone popping on the current update? It’s not safe to update floating redstone
what is redstone popping
right
well redstone isnt supposed to be floating
nor is it supposed to "pop"
so whatever bug you relied on it seems might have been fixed
probably thats why is pops 🤔
maybe try in purely vanilla to see if its still there
Can I save config file to just a list without any index? Like this:
- VALUE 1
- VALUE 2
- VALUE 3```
no
Yes
👌
how
Just do set(“path”, yourList)
they dont want a path
yes
They said index
yeah you failed to read his question
they mean path
aint that the same thing?
no
wait no how is it not the same
index would be 1,2,3,4,5
Index is what spot in the list an item is in
fair enough
so I cant save it without a path, yes?
no
no
0 😨
?
list didnt start from 0

declaration: package: org.bukkit.configuration, class: MemorySection
Hey, I did have same problem and followed what you said and it works well, but I don't really understand why this fixes the problem, could you explain me?
Seems like typeHierarchyAdapter handles inheritance but we do send an ItemStack not a subclass of it
CraftItemStack?
Maybe...
Set<String> cfgSection = config.getConfigurationSection("EnvoyLocations").getKeys(false);
int newSize = cfgSection.size() + 1;
String newLocString = ("Location" + newSize);
Location playerLoc = sender.getLocation();
double x = playerLoc.getX();
double y = playerLoc.getY();
double z = playerLoc.getZ();
config.createSection(newLocString);
String world = playerLoc.getWorld().getName();
config.set(newLocString + ".world", world);
config.set(newLocString + ".x", x);
config.set(newLocString + ".y", y);
config.set(newLocString + ".z", z);
CzrEnvoys.getPlugin().reloadConfig();```
anyone know why this isnt working?
save()?
I mean if you're not 100% sure its an ItemStack and because ItemStack could be a CraftItemStack you'd want a ItemStack hiearchical adapter
wdym
You need to save your config
does reloadconfig() not do that
Well every ItemStack is a CraftItemStack no? I mean on server side
alright ty silver
not every ItemStack is a CraftItemStack but ever CraftItemStack is an ItemStack
🤔
ItemStack is really fucked up just trust me not worth a look even
but yeah not every ItemStack is guarenteed to be a craft one
paper mostly fixes it, but not fully because they didnt' convert it to an interface, not like they really can without breaking stuff
versionMessage: "&8[&cE&4n&cv&4o&cy&8] &ePlugin version: 1.2"
#----------------Envoy Locations-----------------------
EnvoyLocations:
Location1:
world:
x:
y:
z:
#---------------Envoy Types-----------------------------
EnvoyTypes:
Basic:
Amount: 5
Mythic:
Amount: 10```
this is how i want the structure of my config.yml
now when i add stuff to it it goes like this
```versionMessage: '&8[&cE&4n&cv&4o&cy&8] &ePlugin version: 1.2'
EnvoyLocations:
Location1: {}
EnvoyTypes:
Basic:
Amount: 5
Mythic:
Amount: 10
Location2:
world: world
x: 86.96358662674324
y: 108.7746653204343
z: 81.81185904532282
Items?
oh ok, maybe that's why I have the error when I try to save an ItemStack from player inventory but I could save a created ItemStack from plugin
Do you mean your comments got removed?
yeah new ItemStack create a bukkit ItemStack but stuff retrieved from the server is usually a CraftItemStack, CraftItemStack itself is a somewhat horrible implementation around NMS ItemStack
yea
and the gaps inbetween
is there a way i can stop that
Writing your own TypeAdapter would fix everything
a reflection type adapter wouldn't work for ItemStack
so its not like there's a choice
you have to write one and if you want to serialize non bukkit stacks you have to register it as hiearchical
Gson TypeAdapter? I have one to serialize and deserialize ItemStacks, idk where is your problem with that?
I have no such problem I don't even have an ItemStack adapter
I have something called ItemSpec i use
and I have my own polyglot serialize deserialize system
but ItemStacks could cause issues if you don't reigster your type adapter as hiearchical
wdym by the normal type adapter
the ReflectionTypeAdapter?
I'd avoid that internals are subject to change using the ReflectionTypeAdapter is unstable at best
Nah your own TypeAdapter without registration as hiearchical, i registered it with registerTypeAdapter
And i dont have problems with that
oh yeah it should work so long you don't throw a CraftItemStack through it
?paste
I have something like that, but i didnt try to pass directly CraftItemStack
And? Thats not the question
I just said write your own
The implementation behind that is your own business
the person in question is writing their own but using the API
I never said "use mine"
yeah I give up here yada yada whatever
the point is that if you are going to write an adapter for the api itemstack, it should be registered as a hierarchical type adapter
I can create a new livingEntity type with NMS right but is it possible to change the logic of a specific object at a specific time ?
i read information obaut this and i cant 😦
then here's another question how to make the mob move in the direction where the player who is sitting on it is looking?
do real move
dont vector manipulation (if pussble)
(he doesn't know basic math)
ik this isnt spigot but im banned from papermc, is there a ComponentBuilder in the way of like a StringBuilder where you can append components
With kyori components you can just append them to each other
how

rad can I have 5 bucks
no
rude
if u append do u have t ostill put a \n
give me 5 bucks and ill give sou 5 bucks back
.appendNewline
crazy
lynx can I have 5 bucks
oh wait i am in paper
to fund my plugin dev work
i didnt even realise lmaoo
lmao
lynx you must be rich from all the paperwork you do (🥁)

broke af sorry
that sounds like a you problem
^^
what if you borrowing that five dollars is what is keeping them from being homeless
still sounds like his problem
it doesnt get appened and it says Result of 'Component. append()' is ignored
what
it says this
Component component = Component.text("hi").append(...)
yeah but i have a for loop
why cant i just do comp.append
oh append returns a new comp
comp = comp.append is fine
If you know that you are doing that Component.text() returns a mutable builder
Component.text((builder) -> ...)
yeap
what about this
i spawn a textdisplay right
but it only spawns facing south
why doesnt it spawn where i look or something
You need to rotate it
Or set the billboard to center, it’ll just always face the player this way
hello just one little supid question, can we had Persistant data on a player ?
that's work good ? like, i can had balance on a player with Persistant data ?
Do I understand correctly that to make the code execute in a thread other than the main Minecraft thread, I need to create a Thread object?
Sorry, I'm a newbie
Why not just use the built in methods? ie: runTaskAsync etc
and i have an other question what is the value I put in when I create NamespacedKey ? I don't really understand what it's for knowing that we check the value of the key afterwards like Java getPersistentDataContainer().set(.... ....) and getPersistentDataContainer().has(.... ....)
(comes from the bukkit scheduler btw)
Didn't know about this method
What's better?
Depends on how much thread control you need, most cases async methods are fine
the key is always the same
and global
?pdc
okay but we never check this key right ?
You use the key to get the pdc
if you wanna get the balance you check the value
Okay, so the code run by this method should not affect the TPS?
Tbf unless you're running heavy iterations or like world gen shit, you'd probably be fine on the main thread
It already handles a lot, whats a little more
okay if i understand correctly the key is called when you use the variable that we created ?
we don't see the key but it is in the variable and check with
pdc is just a fancy map wrapper
Well, I have a heavy SMP, and I'm trying to save any time for the main tick
i need it for my custom enchants x)
i begin in the world of minecraft plugin thanks all for helping
NamespacedKey is the key used to associate a container with an object, then you use said key to obtain the container
Like I said it's just a fancy map wrapper
ooh i understand
Key will always be a namespacedKey object, though the data stored can differ
Check persistentDataType in the docs, also check that pdc link that was sent
?pdc
i already checked but i need an explanation with a dialogue cause i don't understand english very well
Like I said prior, unless you're doing like heavy iterations or world gen stuff you're probably fine on the main thread
already checked ty x)
Just think of it as a regular map, though there are nuances to the type of data stored, iirc primitives are managed quite easily, but for rather complex pieces of data, you'll need to do some extra stuff, I'm also pretty sure that link has an explanation of more complex data types
I mean
i already used it and it work but i had some questions on some point
Go on
Sure mane gl with the project
tyy
type shi
typa shit i been on
rotating the transformations n shit
shoutout bukkit
It’s literally not even Bukkit
fawkkkkkk
The transformation uses JOML objects
in general shoutout bukkit tho
Also you can just rotate the entity itself, rather than the transformation
Java OpenGL Math Library
It’s a lightweight math library specifically designed for use with OpenGL in Java applications, providing data structures and mathematical functions for 2D and 3D graphics. JOML offers classes for vectors, matrices, quaternions, and other mathematical operations that are commonly needed in graphics programming, making it easier to handle transformations, projections, and various geometrical calculations efficiently.
If you're working on a Java project that involves OpenGL, JOML can be a handy tool to streamline your math operations!
Can you give me an example of how to set a rule on a diamond tool?
I have looked at the Toolcomponent page but can't figure out how to use it!
How might I change the way an item is held
For example someone is holding a custom item
That item is held differently than a sword perhaps
it depends on the parent for the item
(in resourcepack)
I kind of want to to be like a map but closer
if you use blockbench you can edit how its displayed in the hand
What if I don’t want the actual parent item to be a map
the parent only really effects how it's held in the hand and the animation played
otherwise you don't have any other option
That’s tough
why cant you change the parent?
I’m doing a gem thing
And I want the hands to like be together in prayer
While holding it
🙏
Kinda like that
yeah i get that but why cant you change the parent
Maps are destructible
I’m using a nether star currently so it isn’t destroyed
like i said, the only thing setting the parent does is how the holding animation effects it
it doesn't change how the item interacts
So if I set the parent to a map, it’ll still have the properties of a nether star?
Im slightly confused
the parent in the resourcepack sense only tells the game how to render the item
nothing else
I see, thanks for the tip. Where can I set the parent in blockbench?
