#help-development
1 messages · Page 287 of 1
soon™️
now rather than latter
🥳 take action seize the day
@Data
@AllArgsConstructor
public class PlayerData {
private final String name;
private final int numberData;
}
this is all you need if you use lombok
if the data doesn;t change just use a Record
god damn I forget about records -_-
public record PlayerData {
private final String name;
private final int numberData;
}```
jdk 16. i sure hope everything doesnt shit itself
it should still work with 1.8 right
yep
here is oracle's official example
record Rectangle(float length, float width) { }
what happens within the {}
how can i create a persistent data container instance?
how would i put values into records and take them out?
all of the data is immutable
You shouldn't ever need to
Though I suppose you could look at PersistentDataHolder class
it's interface
Check bukkit impl
you cant put, it's immutable, you just create it via constructor
ohh
thanks
np
this didnt work - same issue as the image
would still like to know how i can insert into nested maps :)
Your map definition is wrong
Fix your Map definition and you shoudl use getOrDefault of computeIfAbsent
thank you!
how do i get block's relative location to the chunk?
chunk.getBlock() also exists
ty
guys can any1 who has experience with resource packs and hosting them help me with smth
just ask your question
i have returned.. and i am now confused.
ok so.. im storing a UUID, String, Int and Double in a record. How would i get the Int and Double when checking against the UUID and String?
How can I host a resource pack on my Dedicated server so players can download it?
you'd need some kind of web server on that dedicated server
there are also some plugins which can host a resource pack but they're usually plugins that generate their own pack
you should just use mcpacks if you don't have a web server already, it's much simpler
how do I do this 🤓
go lookup nginx or apache, but if you don't really know how it'll be much better to just use something like dropbox or mcpacks
alr ty!
do i need to check if a pdc has a key before trying to remove it?
no
k ty
is there a way to print all pdc keys and values?
there's getKeys, but to get values i also need types, is there a way to get them or do i have to know?
I believe you have to know the type
😔
Why do you need to do that?
i just wanna print out that info for debug purposes
Just print the nbt then
how? (i dont use nms)
You can force the data command to be run
oh thats a good idea ty
pdc gets shown on the nbt tree?
oh damn
Yeah PDC is stored as nbt
btw in what file is chunk pdc stored?
Probably in the chunk nbt
yeah how can i read that?
i just thought that would make sense, where else would pdc be stored lol
You're going to need nms to access that one
i don't need to do that from code, i just wanna check if data is getting stored correctly
like via command or through file
can priority be any number -128 - 127 (byte) or does it have to be 0 - 5
oh wait
so i think i can use any number
isnt it enum?
ohh
something i think would be cool is not having to type priority = EventPriority.LEVEL
just needing to type EventPriority.LEVEL would be cool
then it would have to be called value
@NotNull
public BukkitTask runTaskTimerAsynchronously(@NotNull
Plugin plugin,
long delay,
long period)
throws IllegalArgumentException,
IllegalStateException
Asynchronous tasks should never access any API in Bukkit. Great care should be taken to assure the thread-safety of asynchronous tasks.
Schedules this to repeatedly run asynchronously until cancelled, starting after the specified number of server ticks.
Parameters:
plugin - the reference to the plugin scheduling task
delay - the ticks to wait before running the task for the first time
period - the ticks to wait between runs
Returns:
a BukkitTask that contains the id number
Throws:
IllegalArgumentException - if plugin is null
IllegalStateException - if this was already scheduled
See Also:
BukkitScheduler.runTaskTimerAsynchronously(Plugin, Runnable, long, long)```
how do i use this?
i got this from javadocs
also, how do i get access to the plugin from a completely different class?
?scheduling
iirc you could use ClassThatExtendsJavaPlugin.getInstance()
its not there
ah, must have been a method
set a private JavaPlugin var called instance to this on enable and write a getter
?di is better though
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
um, i am confused
private JavaPlugin instance;
@Override
public void onEnable() {
instance = this;
}
public JavaPlugin getInstance() {return instance;}
oh ok
public static JavaPlugin thisPlugin;
@Override
public void onEnable() {
thisPlugin = this;```
i am using this code
its a static variable though
make it a not static variable also
i should be able to do MainClass::thisPlugin to access it, right?
whats the point of not making it a static variable then
my brain isnt working, wrong person to ask atm
in order to access a non static variable u need the javaplugin object already
the javaplugin object means u dont need tbe variable xd
also, how do i use the getInstance method?
where do i get the main class instance?
do this but
make it private
the .getInstance is a getter int he main class
and put a public static getter
make the variable static
i need to do object.getInstance()
private static variable
public static getter
yeah
then u can do Class.getInstance()
that is what i am doing right now @maiden thicket
i know
public JavaPlugin getThisPlugin() {
return thisPlugin;
}```
make it static
oh yeah
public static JavaPlugin getThisPlugin() {
return thisPlugin;
}```
ok then
yeah
im pretty sure they do the same thing
okay
in block piston event, are #getBlocks() blocks already moved or not?
WAIT
BukkitScheduler scheduler = Bukkit.getScheduler();
scheduler.runTaskTimerAsynchronously();```
extend event says Get an immutable list of the blocks which will be moved by the extending.
runTaskTimerAsynchronously() takes an instance of Plugin not JavaPlugin
if you mean it saying plugin that is just a di var
JavaPlugin implements Plugin
oh ok.
other one is the same
question
does it use redstone ticks or game ticks?
a game tick is supposed to be 1/20 of a second, right?
Yes
yeah probably game ticks nvm.
How do you guys sync data between bungee servers? E.g. so player on server1 can pay someone on server2 and monetary values gets synchronized across network? I'm using MySQL.
I can think of 3 solutions:
- When modifying data - flush them to SQL immediately - and when reading data - never cache data and always query DB for fresh data (possibly resource intensive, lot of queries for everything)
- Sync data in time intervals periodically - higher probability for some data collisions if the change occurs on both servers simultaneously
- When data changes, use Bungee Plugin Message protocol and inform other servers to update their values
Probably 1
Combination of 1 and 3
Higher frequency data 3, lower frequency data 1
If you have option you shouldn't use mysql for that
Mysql is a perfectly acceptable database for that lmao
You don’t need Redis for that
Redis would be a good alternative to bungeecord messaging for 3 though

I need to study what Redis is, I worked only with MySQL so far. From what I've heard its in-memory database
MySQL databases are plenty performant enough to handle a high throughput of queries, and it stores that type of data very sensibly
Redis is an in-memory high throughput key-value database
But it acts as separate server app, right? It doesn't mean its tightly coupled with one of the Minecraft server instances
It’s a database server like mysql
It’s fast but it doesn’t necessarily represent structured data in as clean a manner as something like sql or mongo out of the box
It’s primarily a key-value store with pub sub
Cool, I will check both variants. I was thinking about utilizing ORM for my data model, but something less chunky and more performant may be viable option for very frequent syncs of data between servers
Depends on what you mean by very frequent
If it’s less than hundreds of queries per second mysql will handle that just fine
No need to overengineer it
i maked a lobby plugin but when i use Main.plugin.saveConfig();
the spaces gone in config.yml
original:
# ______ _ _____ _ _ _
# | ____| | | / ____| | | (_)
# | |__ ___ _ _ __| |_ __ ___| (___ | |_ _ _ __| |_ ___ ___
# | __/ _ \| | | |/ _` | '__/ _ \\___ \| __| | | |/ _` | |/ _ \/ __|
# | | | (_) | |_| | (_| | | | __/____) | |_| |_| | (_| | | (_) \__ \
# |_| \___/ \__,_|\__,_|_| \___|_____/ \__|\__,_|\__,_|_|\___/|___/
license: "yOuRaWeSoMeLiCeNsEkEy"
join:
message: "&8[&a+&8] &e%player%"
title: "Welcome,"
subtitle: "%player%"
quit:
message: "&8[&c-&8] &e%player%"
void-spawn:
enabled: true
y-level: 0
bungeecord-npc:
skyblock:
server: skyblock
towny:
server: towny
spawn: {}
reloaded:```yaml
______ _ _____ _ _ _
| ____| | | / ___| | | ()
| |__ ___ _ _ | | __ | ( | | _ _ _| | ___ ___
| __/ _ | | | |/ _ | '__/ _ \\___ \| __| | | |/ _ | |/ _ / __|
| | | () | || | (| | | | __/) | || || | (| | | () _ \
|| ___/ _,|_,|| _|/ _|_,|_,||_/|__/
license:
join:
message: '&8[&a+&8] &e%player%'
title: Welcome,
subtitle: '%player%'
quit:
message: '&8[&c-&8] &e%player%'
void-spawn:
enabled: true
y-level: 0
bungeecord-npc:
skyblock:
server: skyblock
towny:
server: towny
spawn:
world: world
x: 21.699398164988985
y: 4.0
z: 49.143611878006034
yaw: 103.1334
pitch: 8.976903
this there something in spigot for getting the server mspt?
or is that even a thing in paper and spigot servers?
someone can help
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
You should also take a look at the two links above
This code worked yesterday, and now it suddenly doesn't anymore. It's supposed to break the blocks which the exp bottle hits. No errors.
public class XPBottleBreakListener implements Listener {
@EventHandler
public void onHit(ProjectileHitEvent e, ExpBottleEvent x) {
// Breaks blocks hit by xpbottle
if (!(e.getEntity() instanceof ThrownExpBottle)) return;
Block block = e.getHitBlock();
if (block == null) return;
block.breakNaturally();
//x.setShowEffect(false);
//x.setExperience(100);
}
@Override
public void onEnable() {
// Plugin startup logic
System.out.println("Starting up...");
getServer().getPluginManager().registerEvents(this, this);
getServer().getPluginManager().registerEvents(new XPBottleBreakListener(), this);
}```
I rebuilt multiple times but no luck
The only change I made compared to yesterday was adding ExpBottleEvent x in onHit()
[18:44:50 ERROR]: Thread Craft Scheduler Thread - 4 - FirstPlugin failed main thread check: block remove
Yeah you can't do that
can i not change blocks asynchronously?
Because that's not how the event api works
No
rip
i am trying to change a lot of blocks
You're not experienced enough to deal with async things. Keep your plugin sync
?workdistro
^ Use that
so i need Main class to <pluginName>Main true?
This will help with spreading the load so the mstp doesn't drop too much
okay.
?
I have no idea what you're trying to say
Did you even read that page
Now my main class named Main i need rename my main class to <pluginName>Main?
Generally it's <pluginName>Plugin
okay
still spaces gone @chrome beacon
how others plugin make that
@chrome beaconfrom what i read so far from that link, i assume it is still executing in the main game thread but it is executing a very small chunk of the task each tick instead of trying to do it all at the time.
Yeah
that would be kind of slow though.
If you want it to be faster you can get a better CPU
Yes
like another overworld?
Yeah use the WorldCreator
in RAM of course.
i dont want it to be stored in storage.
does each world use its own cpu thread?
or run on the same thread?
A bit of both
what about mass changing blocks?
Just use work distro
?workdistro
Hey guys, trying to create a shading building with maven, but the new library doesn't executes at the server
https://paste.md-5.net/ejebihihiw.xml < my pom.xml
yes, the libraries is inside the builded .jar
gson is already provided in Spigot 🤔
?flags
Aikar's garbage collection flags: https://aikar.co/2018/07/02/tuning-the-jvm-g1gc-garbage-collector-flags-for-minecraft/
Thanks
Any errors? What do you mean by "doesn't execute"?
how do u check if location is a slime chunk?
Chunk#isSlimeChunk
great
NoSuchMethodException, as if the library isn't included
no errors
i need the newer version
how do i know in a block/entity explode event if exploded block will drop an item?
you don't
will BlockDropItemEvent be called if block is exploded by creeper or TNT?
no
i wanna make a specific block drop a specific item, how can i do that?
you could manually drop it in the explode event if the blockList contains that block
yeah but how do i know if that block was going to drop or not?
Then you need to relocate it
Well, I didn't mean build errors, but stacktraces. Post the full NoSuchMethodException stacktrace, and post the FULL pom.xml.
it calls the EntityExplodeEvent with a yield of 0.3, and then later it calculates for each block whether to drop it or not based of the yield
is there an event for when an anvil or sand or gravel falls?
starts or ends falling?
doesnt really matter, but i want to know both initial and final location
yes
but how do i know it's final location?
when it starts falling or when it lands?
when it lands
EntityChangeBlockEvent ig
nah
could be change
let's check, I still got craftbukkit open
as there is an EntityBlockFormEvent I'd assume that
I can only find that one in EntitySnowman
it could be any of the three so check them
but how can i know the initial location of the falling block (where the block started the fall) in the ENtityChanageBlockEvent?
you have to track the FallingBlock
when it spawns
or if YOU are spawning the block add it's spawn location to it's PDC
no im not
Then you need to tell us what you are doing so we can tell you which is best
i am storing block coordinates and i need to change them whenever a block is moved, and falling is a way to move so i need to track it
then track ALL spawning FallingBlocks
You can read teh original location from your data when it lands
maybe i can track all falling block spawns and write their initial coordinates into their pdc and read it on entitychangeblock event?
just as I said to do
yeah thank you very much
you can't
why?
well it makes no sense
he can in the EntitySpawnEvent
yes sure
but he asked specifically how he can get it from the other event
you gotta create a Map<UUID,Location>
add it's initial Location to it's PDC. Then ALl FallingBlocks will have that entry upon landing
The fun thing about this method is that, to my recollection, it just sets a boolean and that's it
Death is handled by the server, not the entity itself. It kind of just marks itself for death
That method is effectively raising a white flag
does anybody know why this is happening: when creating a resource and adding imgur gifs, some work, some dont.
they show up correctly in the rich text editor but in preview & reality they just show up as [IMG].
i looked into it and it seems like the spigot proxy doesn't want to give out that image somewhy.
can anybody help?
Yea @buoyant viper I'm just gonna remove Base64 decoding support and leave it as a TODO comment lmao
There's a size limit. I think it's 4.5MB or something like that
i see
If it's not 4.5, it's 4 for sure
does world#getAllLivingEntities() return all living entities or just those in loaded chunks. And If is the latter is there anyway to get all living entities
only loaded
unloaded are assumed dead
You definitely don;t ever want ALL entities
would easily kill your server
Fair enough lol
In that case, how heavy is it to listen to a chunk load event?
If the logic itself is light inside of it
Spigot turned my gif into [img] today so i had to click edit and then save changes without changing anything and that fixed it
yeah "toBeRemoved" or sth lol
spigot's "kill" method or how it's called also just says "Marks this entity for removal" or sth and everyone's always like "ugh whut"
I recently tried it and the limit for resources is 8mb
No not resources. GIFs
ooh ok
although I just checked for resources again, and now it again says 5mb is too large? maybe the limit is only 8mb for premium things
How can I extinguish players?
then do respawn(), teleport them back and give them back their items and XP
that's definitely the cleanest solution, yeah
or spawn a water block under them for one tick
or teleport them into the next nearby ocean, then teleport them back next tick
just bi creative 🌈
a hahah a ha ha ha ha so funny
I thought it was funny
poor choco
I laughed
Kick them with a message to rejoin, delete their player data file
They won't be on firr anymore
Fire
is there some sort of program that allows me to make custom models specificly the json part quicker? Im not tryna type that shit out
Yeah definitely. BlockBench
if (args[0].equalsIgnoreCase("disband") && plugin.getKingdoms().containsKey(player.getUniqueId().toString()) && plugin.getKingdoms().containsValue(kingdom) && player.hasPermission(kingdom + ".disband")) {
for (Player p : Bukkit.getOnlinePlayers()) {
plugin.getKingdoms().remove(p.getUniqueId().toString());
}
PermissionAttachment attachment = player.addAttachment(Kingdoms.getProvidingPlugin(Kingdoms.class));
attachment.unsetPermission(kingdom + ".disband");
player.sendMessage(ChatColor.WHITE.toString() + ChatColor.BOLD + kingdom + ChatColor.GREEN + ChatColor.BOLD + " disbanded");
return true;
}```
im trying to remove players from a hashmap called `kingdoms` when the player does `/k disband` using a for loop. am i executing this correctly?
Unless you mean actually creating like the <item>.json file to point to the model file, in which case no there's no program to do that automatically, but ideally it's just one extra line
Yeah that looks fine but it's going to remove all players
how would i make it remove just the people in that kingdom?
I love you so much, thanks a bunch!
check if that player is in the kingdom, if they are remove them
When trying to get jedis values while running for loop pulling jedis values for something else, it throws me
[12:16:42 ERROR]: Could not pass event PlayerInteractEvent to Plugin v1.0-SNAPSHOT
java.lang.IllegalStateException: Please close pipeline or multi block before calling this method.
is there a way to handle it?
EpicEbic
Today i tried that plugin
But it uses ProtocolLib so i installed it
Then randomly everyone getting kicked for Timed Out
When I see console it says plugin is made for older version
.
U rem me?
Yesterday.
it either has stuff that is version specific or they have a version check
1.8-1.16.5
check the main class and see if it has version checks
And I'm using 1.18 because if i use older then worldguard won't work
iirc worldguard has a 1.16.5 version
In server plugin folder?
But it's not workin
in the plugin
using Eclipse ?
any ide with a decompiler would work
you pretty much just need a way to read the .class files
Trying to survive on this project 💀
hey can someone help i can't find the code responsible for calculating whether a block should survive an explosion based on yield
?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!
i did
What code you have so far?
event.blockList().removeIf(it -> {
if (isNotCustomBlock(it)) {
return false;
}
it.getWorld().dropItemNaturally(it.getLocation(), item.unwrap());
return true;
});
I have this code for checking whether a block is custom or not. It currently drops the item with 100% chance, but i want to do it based on yield the exact same way vanilla does
i was browsing craftbukkit sources, but i couldn't find the code responsible for it
its because no craftbukkit code even touches this kind of behavior
that is all NMS and its likely hard coded
so i have to look inside minecraft server's sources?
yea, but be honest with yourself here, do you reallllyy need NMS to do this
what is preventing you from making your own system
no i don't wanna nms
Random is fairly easy implement
minecraft uses java's built-in Random?
don't see why it wouldn't
no reason to go overboard with something so trivial
you can just seed SecureRandom or Random with the current time and call it a day
k thanks, ill do it that way
if you care about security use SecureRandom and make sure to make your seed somewhatunique
with something so trivial though seriously don't worry about it
k
I have a problem that some of my plugins wont show up at /plugins its prob something i have forgot but please tell me
wtf does that say
IIRC newer versions have their own "random" class
this is my error https://pastebin.com/5MXfTczp
ill look into that
show plugin.yml
does it actually say "main: net.minecraft.server.Netstaffchat"?
and how is that class actually called?
np
meine frau
I'm a dude
Mein mann
guys is it possible to create a custom event without the use of a command? (i wanna make an event where if a player reaches a certain coordinate point, they get teleported somewhere)
oh wait theres a player move event, i didnt even realize xD
tyty
🤨
I have to make a core which can sync multiple proxies togethers
I mean what all those words mean
webhooks are channel specific iirc
try specifying Content-Type request header (application/json) with connection.setRequestProperty
also idr how javas io actually works but u might need to flush the output stream before trying to send the connection so connection.getOutputStream().flush(); before getInputstream(), but hopefully just Content-Type should fix
Just use some proper libraries
sometimes its more fun to suffer
At least for json, that's horrific
400 means usually that your json payload is bad
Also manually writing json is... Meh
ah i remember what a webhook is, thought it some that embed on a webpage
how can i break a block without dropping it?
Set it to air
Minigames and ranks/messages/punishments/etc
You dare question the great Verano?
I'd have a small question about log4j. Should I create an Own class which contains my logger or just throw it into an existing class?
Usually you have a static variable in each class that points at a class corresponding logger
And then in case you unit test you append log filters yk
Hello, how can I get entities in unloaded chunks? Iterating through Entity array doesn't work!
would be fun if you could do a switch on an iterable
You would need to load the chunk first, if thr chunk is unloaded a mob is classed as dead so not in the entity array
like switch (functions.getRegisteredBeginLetters()) {}
hi , i have a hard time understanding this :
iam using gson to save Prestieges to json file , but when i try to load it :
i get this error :
Unable to invoke no-args constructor for interface dev.skypvp.api.model.Prestige. Registering an InstanceCreator with Gson for this type may fix this problem.
i was able to fix it using :
this.gson = new GsonBuilder().setPrettyPrinting().registerTypeAdapter(Prestige.class,
new PrestigeInstanceCreator()).create();
my Question is , will this load all Prestieges , or no ?
wdym will this load all prestiges?
if you deserialize the whole json file it should
entities in unloaded chunks are unloaded
youll have to load the chunk
but usually you dont process stuff in unloaded chunks because it has no point for the current players or server anyways
so what are you trying to do
I am trying to get all dropped items by a player in the overworld
queue them in a list
Wouldnt that mean the chunk is loaded
if you drop something and go away its unloaded
You could also perform your task on chunk load event
yeah that sounds like a better ideaa
I want to automate it
check that list
for what
for persional use
wdym
I need it to find some items I lost a long time ago and I have no idea where they are
why would they be gone? those chunks haven't been loaded
check all chunks you have created for items
and teleport them back
or just cheat new items lol
you might be able to use some kind of external world tool
to scan all region files
that is exactly what I wanted to ask
but dealing with raw files is a problem
in that case, either read the region files or load each chunk on a running server
might be a library for reading anvil rg files
How can null come out? How do I fix this?
inventory items which havent been explicitly set are null
to fix it, just do a null check
Thats just intellij for you, you can ignore it
It wont ever be null at runtime
intellij doesnt know if event.getInventory().getItem() returns the same thing twice
we know it does but intellij doesnt
also do item.getType() == Material.WRITTEN_BOOK
.equals better
no looks worse
no?
guess imma use .equals for longs
i hope the jvm optimizes that
you know what i mean
for you
damn
== is faster because .equals has the overhead of a method call
yeah
.equals does the same as == for enums
== checks if both objects are in the same memory location so you cant check 2 strings with it
I didnt say to check 2 strings
I said to compare enums
but where is the difference? i mean almost same
.equals is more verbose
lol i said it here
and overhead but i bet javac or jvm optimizes that out
yeah probably optimized out
also == is safer when theres a possibility of null being returned
true
bruh what
file name too long?
oh wait
it may think that whole thing is the file lol
nvm what the fuck
oh wait
i need to split the args
bruh
Lol
guys this does not work
dont do this
holy shit it actually registered the server
no way
but I made it in first line on screen
yeah sorry didnt see
ignore me
just ignore the error
intellij doesnt understand the logic
did you remove the null check
maybe try to use one variable
ItemStack item = inv.getItem(10);
if (item != null) {
item.getType()//...
}
is this the same code you sent?
line 85
orbyfied i really wanna know what you're making \👀
try using one var
i might've forgotten already
server network infrastructure
for fun
dynamic server nodes
also coldlib
the container shit
like spigot related?
the server network is bungee and purpur
coldlib is general java shit but also some bukkit utils
ooh nice
but oracle is not forwarding my porxy port or something
proxy
wait could it have smth to do with this non existent server i declared
java.lang.IllegalArgumentException: Invalid BSON field name uuid - Mongo being mongo
😡
Why mongo is so asshole some times 🤔
Is it possible to block all slots except for certain ones?
bruh its listening on ipv6
why the fuck is it listening on ipv6
yeah just check if the slot is blocked and then cancel it
thanks
@glossy venture did you register a string with spaces as a command?
here
why
wait nvm
oh nah i fixed that
oh
Did I understand correctly?
yeah
yes
want nvm as long as you check that the clicked inv is the top inv
so getRawSlot for top inventory, getSlot for down inventory?
getRawSlot gets the slot over the whole view, starting with the top i think and going down
getSlot gets the slot number in the clicked inventory
thanks
You're probably going to want an && here, no?
Because that statement will always be true
int slot = 11;
if (slot != 11 || slot != 47) { }
// Boils down to
if (false || true) { }```
Bro do you have mongo db experience?
He?
Are you drunk? tho
🤔
the person you were reacting to wasnt reacting to your mongodb message
or were you just asking if they had mongodb experience?
i assumed you thought they were reacting to your message
cause you reacted to their message
minion325 (he/him)
Bro whats is he trying to say? I dont understand i mean he answered something none related to what i ask?
What do you need with mongodb?
java.lang.IllegalArgumentException: Invalid BSON field name uuid
Im either dumb or mongo is trolling
code?
Because the uuid field exists on db, so he cannot tell me that
try profile.getUuid().toString()
Mongo supports uuid, its telling me that it cannot find the property "uuid" but on the db is the property on the document
idk uuid might just be a reserved name?
no, no i dont think so, i was using it before and was working perfect
Is that all rows in profiles collection>
?
oh you need to specify an update
if you want to replace the whole doc use replaceOne(..., new UpdateOptions().upsert(true))
Wait im replacing it?
otherwise, findOneAndUpdate(Filters.eq("uuid", uuid), Updates.set("abc", 69))
nah, mongodb expects the second param (where you are passing in the whole document) to be an update operation
And what about i need to update the whole properties? I wont be able to use Updates.set()
so it looks at it but uuid is not a valid operation so it throws shit
use replaceOne(Filters.eq("uuid", uuid), document, new UpdateOptions().upsert(true))
But that will re write the whole document, not update only the modified fields
Or im wrong?
then you have to keep track of the modified fields and manually save each
i dont think mongodb can do that for you
but doing an upsert replace is faster than having mongo set each field
yeah
No no, i mean that using findOneAndReplace there is no issue with the field uuid
no it wasnt complaining about the Filters.eq, it was complaining about the update operation not being valid
findOneAndReplace just replaces the whole doc
Ohhh ok
no need for an operation
Oh i thought the issue was caused cuz of the wrong operation
yeah it was
but replace doesnt take an operation
it just takes the whole document
it wasnt because of the Filters.eq("uuid", ...) though
yeah
okay it weird
For some reason, when i leave before running async task to save the doc into the db and removing the profile from the Map, it putting a boolean to false, but when i rejoin the boolean is still true
Thanks, nothing i fixed it
this is a certified bruh moment
How can I get color from Dye?
now the fun thing is that i cant see the exit message
What are you doing?
trying to start a server with ProcessBuilder
You have to cast it to something i dont remember what object exaclty
Check the dye object, it should implement/extend others objects
you can only use that on legacy materials i think]
Isnt called DyeColor?
check jd for classes implementing itememeta
Colorable is only for blocks
I'm trying to spawn a boat that the player cannot move. My thought was to spawn a boat with an entity inside, then place the player inside but the boat automatically places the player as the driver. Does anyone know a way around this? Perhaps an entity the boat wont automatically push to the back?
you could just try to get it from the material name
well I think I just make big switch that check color based on Itemstack dye
or this approach
are you fucking kidding me
thats the whole point
you dont have to extract every single library twice
(its a sym link to a shared folder)
Paper 💀
ok guys time to fork paperclip and fix this shit
already 2 january
Tests whether a file is a directory.
The options array may be used to indicate how symbolic links are handled for the case that the file is a symbolic link. By default, symbolic links are followed and the file attribute of the final target of the link is read. If the option NOFOLLOW_LINKS is present then symbolic links are not followed.

yeah paperclip doesnt do that though
Files.isDirectory(...) returns false when called on a sym link on Unix or Linux systems
By default, symbolic links are followed and the file attribute of the final target of the link is read.

lmao i gnore eveyrthgivn
what was it xD
the symlink wasnt linking to the correct directory
it was linking to a non existent one LOL
aight thanks for saving me like an hour of work
no problem 
wait bruh it still doesnt work
but now i know there must be smth wrong with the symlink
I haven't actually tested it, but at least judging from the javadocs, the code should be functional

bruh
libraries isnt even a symlink
its red
what the fuck
p is real
libraries is weird
ayy i fixed it
symlink had to be to absolute path
wtf I've restarted IDE and this happen
Is it indexing
ClassNotFoundException: io.socket.client.IO
whats the issue with my pom.xml?
i made the plugin with mvn clean package.
and thats my dependencies in pom.xml
<dependencies> <dependency> <groupId>org.spigotmc</groupId> <artifactId>spigot</artifactId> <version>1.8.8-R0.1-SNAPSHOT</version> <scope>provided</scope> </dependency> <dependency> <groupId>io.socket</groupId> <artifactId>socket.io-client</artifactId> <version>2.1.0</version> </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> <version>2.11.0</version> </dependency> </dependencies>
you need to shade socket io with the maven shade plugin
can you give me an example for that please?
it works, the file size is 1.2MB is that normal?
bro what the fuck does this stupid thing mean
oh shit it might be an unused import
Your jar will get larger if you include a bunch of dependencies in it
yeah my bad
Listen on BrewEvent, get the block's state and cast to BrewingStand and then use #setBrewingTime
lmfao
Is there a way to make a mushroom be plantable in 15 light level, or make the sky light level be 12?
there is not a single mf occurrence of net.md_5.bungee.api.plugin.Listener
placeblockevent and dont cancel it maybe?
same thing on PotionEffectType.CONFUSION => nausea
true
but still shit
fucking Enchantment.DAMAGE_ALL and shit though
spigot link to what
what the fuck exit code 130
in my case i used a block populator, what looks like is when the populator try to place a mushroom at 15 light level the event is canceled
just uncancel the event?
but i dont call a event in a populator, i used limitedRegion.setType()
so you do following
maybe use BrewingStandFuelEvent
no wait
in BrewEvent you cast the block state to a BrewingStand and then use #setBrewingTime
+1
+1
what is the best way to get the targeted entity of a player?
what do you mean with targeted entity?
raytrace
+1
the entity a player is looking at
like @tender shard said: raytrace
welcome to minecraft
my bad
spigot
but an inventory type? something like that?
wait
exist?
use that ig
have fun doin this mess lol c:
xd
do a debug thats easier
you need to change the item?
?jd-s
declaration: package: org.bukkit.block, interface: BrewingStand
and do it
idk much about inventory holders tho
maybe its the brewing stand already?
maybe its useless
holder like Knuffe said
+1
block
and then u cast it to brewing stand
the state getState()
no wait
inventory.getHoler().getState()
blockstate
no I think its correct
getBlockState?
lol the forum lied to me :c
needs a brew.update at the end though
when you set the time left it will probably make the UI jump instead of making it go faster too
last time i did this i just ticked the brewing stand myself
damn spigot make better brewing api and then we can talk again xd
does use nms tho 😄
ouf
yea its pain
thanks
PLEASE
Feature requests linked above
Are there any other blocks that need a similar thing?
Aren't campfires instant
no
they do indeed
Anyway, open a JIRA ticket or two please
i dont know how, @last temple do it xd
different account
im fluffy now so that makes me extra fluffy :p
pov you missed 1 update xd
havent played properly since like 1.12-1.13
ye like now there's a nautilus shell and a heart of the sea that makes a conduit??????
like wtf is any of that
also nautilus isn't even a mob
😂
yeah new feature
I'd like to contribute to spigot but it feels like so much work
same
send ss
just put whatever, not really relevant for features
thanks
Great english
Are you a cat?
What does e.registerIntent do?
as per the docs, delays the event until all intents are completed
@last temple yeah im sure not exists a thing like rank in forum or role here for contributors, you can check Stash and check last "merged" PR for the people how send things
I was having issues find the doc for it sorry 😭
but dang, super powerful. Now I need to refactor all my code #fun
asynchronous my beloved
So does that mean I can registerIntent then interact with the event asynchronously?
public List<Location> getHollowCube(Location corner1, Location corner2, double particleDistance) {
List<Location> result = new ArrayList<Location>();
World world = corner1.getWorld();
double minX = Math.min(corner1.getX(), corner2.getX());
double minY = Math.min(corner1.getY(), corner2.getY());
double minZ = Math.min(corner1.getZ(), corner2.getZ());
double maxX = Math.max(corner1.getX(), corner2.getX());
double maxY = Math.max(corner1.getY(), corner2.getY());
double maxZ = Math.max(corner1.getZ(), corner2.getZ());
for (double x = minX; x <= maxX; x++) {
for (double y = minY; y <= maxY; y++) {
for (double z = minZ; z <= maxZ; z++) {
int components = 0;
if (x == minX || x == maxX) components++;
if (y == minY || y == maxY) components++;
if (z == minZ || z == maxZ) components++;
if (components >= 2) {
result.add(new Location(world, x, y, z));
}
}
}
}
return result;
}
Heya^^ I would like to know why this only draws 3 faces of the cube(see in picture) and what I need to change to make it draw all 6.
I'm trying to spawn a boat that the player cannot move. My thought was to spawn a boat with an entity inside, then place the player inside but the boat automatically places the player as the driver. Does anyone know a way around this? Perhaps an entity the boat wont automatically push to the back?
try addPassenger instead of setPassenger
is registerIntent only on BungeeCord? I can't find the method in spigot
GPT told me to remove the component check, but that also did not work
Hey uhm, do you know why this throws out a NullPointerException?
RayTraceResult t = p.getWorld().rayTraceEntities(p.getLocation(),p.getLocation().getDirection(),distance(p));
if(t.getHitEntity() != null) {
Entity e = t.getHitEntity();
p.sendMessage("" + e.getName());
e.teleport(p.getLocation());
}
maybe out of range?
I am 100% sure that the hitbox was in the raytrace
I'll see if it was the distance
I checked it, the pig was 100% in the range
p is the player
I tried the same with a range of 100 blocks and it didn't work
you are going to always get the same result. Its going to colide with the player as you are starting within th eplayers BoundingBox
so what should I do instead?
use teh method that accepts a predicate
why would it return null then tho. jds specify it only returns null if no hit is found.
oh wait so
the strange thing is if I look into the air it happens what Elgar said
it returns me
also, are you sure your pig is actually in the direction the player is facing?
but if I look at an entity I get the error
yes it will always return you
yes
no only if I don't look at an entity
if I look at an entity I get the error
if you are using the players location not Eye location it's going to be looking in a flat plane in the direction the players model is facing, not the direction you are looking
I did that and I don't get the error anymore but now it always returns the player
yes, start in front of teh player not at the players location
how can I do that?
getEyeLocation().add(p.getEyeLocation().getDirection())
alright let's try this
Hello, I comment something guys to see if you can help me.
I am using the following:
event.getBlock().getDrops().iterator().next();```
In 1.19 it works without problem, but in 1.12 it gives me yaml Caused by: java.util.NoSuchElementException
happens with NETHER_WARTS
Why does it work with one version and not with another?
Different return in 1.12?
How does 1.12 work in this respect? I have worked very little with older versions and how can I get the drop I need?
I just checked and it seems to return the same Collection<ItemStack>
do you have an api version in your plugin.yml?
//push
yes, 1.13
Well the error says you have no elements in your returned Collection
Is there a list of tasks/methods that spigot can do asynchronously?
exactly, but it should have elements, it's very rare
So it doesn;t error every time?
then you have a block which has no drops in 1.12
so check first with .hasNext()
By faces I mean edges
With NETHER_WARTS it does not work, with the other blocks it does, at least the ones I have tested
test your iterator has elements before moving the pointer
but NETHER_WARTS should drop drops no? 🤨
change your for loops to < instead of <= (I guess)
nah that can;t be it
Does it work for you with NETHER_WARTS without any problem? I do not understand
I've not tested it, but then again I'd never assume an iterator has elements
You must be finding a situation when spigot returns no drops, so you must check your iterator first
I already checked it, but it is not a solution anyway, since it should drop drops, at least in 1.19 it does, in older versions like 1.12 it does not, I do not know if it is normal or something I am doing wrong, I did not play minecraft in those versions
You are getting the error because you are not checking your iterator
Why would that help?
it wouldn;t, I was wrong
Yes, but I have already solved it, the question is why in 1.19 the nether wart drop drops according to the java code that I am doing and in 1.12 it doesn't? Do you understand me?
event.getBlock().getDrops()``` This code returns a collection of ItemStack in 1.19, but in 1.12 it tells me that it is empty, what is the reason? That's what I want to know
No clue very few people touch 1.12 anymore
Alright, still cannot fix it tho somehow. Been trying to find that for like 2 hours searching the web and asking GPT
I'd guess it's in your code for displaying the particles
Neh its just using the List in a for loop drawing all particles
The problem must be somewhere in the conditions
If I remove those completely, im getting the full cube and that even with all 6 faces
What does this error mean? I've never encountered it before.. https://paste.md-5.net/adiwezeyux.cs
did you reload?
T is null
What even is „t“
^
At least rename „t“ to „result“
I would call it „raytraceResult“ or sth
yeah okay
But t is not the target
yes I know
t in your code is the raytraceresult