#help-development
1 messages · Page 1777 of 1
im kind of new to plugins , so any help would be great idk :/
Hello
just make a field in the config file for the overworld name and grab it from there using the Bukkit#getServer()#getWorld(plugin#getConfig#getString("world.name"))
How can i do that on the plugin saber factions in one world you can't claim land but in other yes?
Checked--> org.bukkit.Location.Location(@Nullable World world, double x, double y, double z)
I think you can technically use a hacky method to get the main world
Interesting
How can i use a string to create a item stack with a material named in the string?
You need to listen for the BlockBreakEvent
Check the getDrops()
In your case probably replace them
lol i will remember this! :)))
get it from the string and convert it to a material
Material.matchMaterial
thx a lot , ill try it soon
how do i convert to material lol
i havn't memorized the whole spigot api yet hahah🤣 
just like everyone said
It might be worth looking up how to listen for events
lol
1?
uh oh that dint work:
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event)
{
String PlayerName = event.getPlayer().getName();
Bukkit.broadcastMessage(ChatColor.RED + "for debugging ONLY ");
Location location = new Location(Bukkit.getWorlds().get(0), -206, 71.500, 47, -90, 0);
event.getPlayer().teleport(location);
}```
just the one i picked
Delay a tick
as in?
Delay the teleport 1 tick
like this ```java
itemstacks.put(filename, new ItemStack(Material#getMaterial(JsonValues.getValueMaterial();)));
and remove the semicolon
i was confused about that lol
how do i delay a tick i never di it ;-;
?scheduling
Smh you're fired
Don’t get banned then 5head
how can i make it deal with nulls
if the material is null how can i make it print a error to console
ahh fuck that thats gonna be a problem later
if Item == null?
Maybe a little yeah
Bukkit.getScheduler().runTaskLater(plugin,()->{},1L);
Where the lambda would be your "command"
isn't there more simplified version i remember maybe?
That is the simplified version
An instance of your main plugin class
oh...
Actually I guess I should say the instance
yeah
it tells me to make my instance a object tho?
braces are better for bigger code
runTask already has a delay
i'm curious i can't remember exactly how do you save Tasks to list?
i wont be doing it anyways
you are in for a treat
im already in my main class
Oh thank God youre talking about Main and not Singleton vs DI
Also, using static here is not needed and dependency injection is the preferred method
i was gonna say that too
lol
oh now you're lame 
Singleton is fine for the Main class instance
Since you only make one anyways
Like Int Number = BukkitRunnable... ?
anyways what do do now?
DI IMO with the main instance is just such a mess
if you think its a mess, then use guice or smthing
im in my main class alr
I've had this conversation with Conclure about this and never got any definitive answer for why one is better than the other
I agree DI is better for basically all class implementations, but when it comes down to the plugin instance it doesn't really matter
name of Main Class
Well no, it doesn’t matter
its there
But teaching people to use static for one thing means they will use it for others
this works
works
So you're saying never to use static 
I mean technically you never need static
It’s just that it happens to be handy sometimes
Make a plugin with all static
store all your instances in an interface :pepe:
lol
theres a dude who stored his plugin instance inside an enum
Like what the fuck
lmfao

UH!??
smh
Everyone knows you gotta use a record
people using that tutorial
theres a tutorial with that??
Hopefully not
Stores Plugin in Plugin there stored in Plugin...
LMAO
tbh, plugin instance inside an enum is not really much different between just making it static
sooooooo
mwoa
meow
Serialize the plugin instances to bytes and store it in a database
Rawr xd
Rawr UwU
indeed not funny
when is discord going to add pat emojis

Pap pap
Hey, I am trying to get a maplist with materials and amounts from a config file.
Other things in the config file work.
I've tried to sysout-print the size of config.getMapList("test.items") but it is 0 and the MapList is empty. Is there sth wrong with my yaml syntax?
The Maplist in the config: https://www.toptal.com/developers/hastebin/hizozirize.yaml
How can i do that on the plugin saber factions in one world you can't claim land but in other yes?
Ask the plugin dev
i had to ask is it possible to put nothing as displayname on a item
like "";
i mean like complete Nothing
fx "";
closed off no space
No
Ok
An empty string will be ignored
then i gotta change it to space
have you tried through properties.maven.compiler ?
Thanks guys 
<properties>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
</properties>``` as opposed to configuring the maven compiler plugin
should be said, I don't use maven so Idk if that'd fix it
I presume you've tried invalidate caches and restart
do you have jdk 16 installed btw?
does someone know how to fix this?
ah yeah
whoever added this into java:
if (entity instanceof Player player) {
player.sendMessage("auto casting!");
}
is a god for me
Yes very nice
when setting an item to the player it returns this NPE:
Caused by: java.lang.NullPointerException
at org.bukkit.inventory.ItemStack.<init>(ItemStack.java:68) ~[server.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.inventory.ItemStack.<init>(ItemStack.java:46) ~[server.jar:git-Spigot-db6de12-18fbb24]
at io.github.hexab.hub.items.impl.EnderButtItem.getItem(EnderButtItem.java:57) ~[?:?]
at io.github.hexab.hub.listeners.PlayerListener.lambda$onPlayerJoin$1(PlayerListener.java:41) ~[?:?]
at java.util.Arrays$ArrayList.forEach(Arrays.java:3880) ~[?:1.8.0_282]
at io.github.hexab.hub.listeners.PlayerListener.onPlayerJoin(PlayerListener.java:40) ~[?:?]```
any solutions?
did nothing lol but pog it was fixed
Material material = Material.getMaterial(plugin.getConfig().getString("items.Enderbutt.item"));
ItemStack item = new ItemStack(material);```
this is line 56 and 57
try adding debug message
for material variable
and see if it outputs as null or not
maybe your configuration classes are not set up properly
oh
nevermind
im stupid
i found the cause
it happens
yeah LOL
the e and in enderbutt is capitalised for the path
whilst the config was undercase
i've wasted 8 hours thinking why my plugin wasnt working, to only find out that the the cause for it was that I uploaded the patched version to the world folder
nice.
LOL
extend and make it thread safe?
you can make anything thread-safe :)
.getLocation() returns new location object everytime, but the pulled values to create that object are not from volatile or atomic fields
thus the info in the location objects could be stale
public Location getLocation() {
return new Location(this.getWorld(), this.entity.locX(), this.entity.locY(), this.entity.locZ(), this.entity.getBukkitYaw(), this.entity.getXRot());
}
idk
its probably because minecraft uses
cursed trigonometry
for pitch and yaw
wiki.vg states that it doesnt follow classical trigonometry rules
I see
i would love too see if paper could implement async player move event
but it would require lots of work probs
holy yeah
whats the point
Async AsyncChatEvent
Everything async
movement is not async, and a lots of thing relies on movement aswell
Async entity AI when
lol
All attempts of async entities or worlds always led to world corruptions so
Yeah it’s a shame
well, to make things like this it would require to rewrite the server software from scratch.
AI is the heaviest thing atm
AI is not parallel?
The problem that is rewriting from scratch is even harder
yes
Mojang could achieve so much if they remade the game
yes? What did you except lol, it hardly depends on world
But that wouldn’t be profitable
Well, they did Bedrock
On c++!
well it makes sense, since everything else related to entity information is on main thread
However noone likes bedrock or any other attempt of full minecraft recode
I mean people are kinda into minestom
Playing Bedrock after playing Java edition feels like playing GTA Definitive editions after playing OG versions lol
Everything goes ok except client reimplementation
I'd actually give a shot in a multithreaded server implementation in C# or Java if it wasn't for the case that multithreading is incredibly excruciating to test
C# would be nice
yeah
rust
Does rust have multithread capabilities?
I miss all the little things from C# that java doesn’t have
yuh
yes, like any decent language? At least Google says yes
ah okay cool, I mean certain languages are to most extent meant to be single threaded although with functionality of running stuff async like js and dart ig
❤️ Check out Lambda here and sign up for their GPU Cloud: https://lambdalabs.com/papers
📝 The paper "Image Super-Resolution via Iterative Refinement " is available here:
https://iterative-refinement.github.io/
https://github.com/Janspiry/Image-Super-Resolution-via-Iterative-Refinement
🙏 We would like to thank our generous Patreon supporters wh...
jesus fucking christ
64x64px images are being converted to hd images without blurry artifacts
Yep
Oh
And it has funny side effects like ThisPersonDoesNotExist
i used ESRGAN in 2019
imagine this technology for game texture streaming
How can I detect if a player is speeding (using cheats)
Not easily
im using packets
packet level checks
Join my AntiCheat testing discord: https://discord.gg/HhfYb9G
How to code a minecraft anticheat.
How to code a speed check.
Also how to not get your reproductive organs stuck in a washing machine.
Many thanks.
would I check though if their speed is faster than like 0.2?
scary
You gotta account for legit ways of going fast
packets could be manipulated that way the server couldnt see the true player's speed
it could prevent simple cheats
but its useless for more advanced ones
what you could check instead
is to have VL system
by checking the time travelled between two locations
it is pretty much just variables and checks
Gotta get spigot to implement that PlayerCheatEvent
do a PR
so would their first location be where ever they start then second is where the end?
SpigotPlayerVacdetectEvent
but you need to make implementations for every type of movement speeds
Speed = Distance / time
Distance = point 1 - point 2
then I'm already getting their two locations
Also im using these, Location locationLook = new Location(world, xLook, yLook, zLook, yawLook, pitchLook); Location lastLocationLook = getLocation() != null ? getLocation() : locationLook;
but i have a method that checks for the location
I'm doing this for experience
i mean you can if you got experience
he clearly doesn't
All anti cheats must combine into one
johnan
Is he someone that actually knew how to make tutorials
i wouldn't say he is professional clearly
I tried to detect fly with player.isFlying when I was a noob
lol
It didn’t work 😢
🤣
yes check if player is flying hacking lmao
player.isFlyingHacking();
PR plz
it would be great additional API plugin
I’ve never actually used an anti cheat, I just randomly check on players
The hackers are usually painfully obvious on a PvE server
i remember that back in the days
if player is sus send to jail
most server think it is a waste
well if they arent having fly mode then they clearly hacking or floating
My brain says a fly check would be easy
But I’m not even close to a anti cheat person, so probably not
i admit i bypass an anticheat by using float hacks
back then i were young
they only check if the player went up
so i slided forward to islands in air with float
people have evolve like anticheat so that won't work anymore
fly check is not easy due to latency and spoofing of onground packet field
Can’t you just like
Check if they are in the air and at a relatively constant y level
Ban them anyway
check for lag
Or take into account ping and lack of movement
it possible to win ageinst hacks
its not
Maybe I’ll try to make an anti cheat one day... probably not though
its cat and mouse game
no
just like Antiviruses can't beat all of the viruses
it limted
I much prefer gameplay plugins anyway
if clientside kernel level anticheats couldnt beat hard cheaters, what would make serverside anticheat so special
you make a server side anticheat
serverside anticheats couldnt work with 100% accuracy and efficiency at the same time
since movement is all clientside
movement could be interpolated into separate packets
and voila
clearly you're far off
if movement is not clientside, why latency doesnt effect the gameplay
server receives those position packets
and then checks them
but what if packets are manipulated in that way
server couldnt be sure
if he's cheating
you check if the packet legit to server
packet drop will just be ping drop
packet drop is not just a latency thing.
packets couldnt arrive at the server, due to connectivity issues
in order that server protocol expects to
no packet no change?
what if the client deliberately sends those packets out of order
how would you prevent that
the only way is to play guessing game of VL's
still Check if it is legit
The best anti cheat would probably be:
- Only auto ban in extreme cases
- Stick to kick and log most of the time
- accounts for ping
- configurable
- maybe some level of machine learning
for example client send onGround boolean with positional packets to the server
but most of the hacked clients deliberately inject their own code to prevent that
You Check if Packet is legit to the server stuff
that still wouldnt be as accurate as client information
as i said due to connectivity
it's a cat and mouse game, sure you can patch hacked client
VLs are not the solution to cheating. VL are probability calculator how suspicious the player is
how hard it is for you to figure it out
I do understand your concept
what i wanted to say that's is impossible to detect cheats with 100% accuracy unless hacked client made a mistake in their own code
HELP
the only problem could be if the server itself lag
but i guess you can check the TPS
?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. Create a thread in case the help channel you are using is already in use!
idk why my plugin stopped working
all i did is add a new command
and it started showing this error on start and plugin doesnt work ```[00:50:50 INFO]: [BwCore] Enabling BwCore v1.0.0
[00:50:50 ERROR]: Error occurred while enabling BwCore v1.0.0 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "online.shakiz.BwCore.BwCore.getCommand(String)" is null
at online.shakiz.BwCore.BwCore.onEnable(BwCore.java:13) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:332) [patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:407) [patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:359) [patched.jar:git-PaperSpigot-"4c7641d"]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:318) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:408) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:372) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:327) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:267) [patched.jar:git-PaperSpigot-"4c7641d"]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:563) [patched.jar:git-PaperSpigot-"4c7641d"]
at java.base/java.lang.Thread.run(Thread.java:833) [?:?]
[00:50:50 INFO]: [BwCore] Disabling BwCore v1.0.0
[00:50:50 INFO]: Stopped BwCore...
[00:50:50 INFO]: Server permissions file permissions.yml is empty, ignoring it```
1.8 😮
@mortal hare if the server crashs and ban all there should be a reserve method for that time
command is not in your plugin.yml (the one thats in the jar)
You almost certainly did not add it to the plugin.yml
still learning java in general, but making plugins as well, new to this so if i ask something dumb, plz just point it out
im just wondering how i can use fee to deduct player hp, and also check that their hp isnt too low to die in the process
fly:
description: Toggles fly mode.
usage: /fly username
this is what i added to the plugins?yml file
fee?
if the server crashes how would you invoke the method which is tied to the server
what is fee lol
save data and backups
just variable
getCommand("fly").setExecutor(new Fly());
@mortal hare i mean if someone manage to crash your whole server RIP F
?paste your plugin.yml
heal:
description: Heals player to max health
usage : /heal username
feed:
description: Heals player to max health
usage: /feed username
gmc:
description: Sets player's gamemode to creative
usage: /gmc username
aliases: c
gms:
description: Sets player's gamemode to creative
usage: /gms username
aliases: s
gmsp:
description: Sets player's gamemode to creative
usage: /gmsp username
aliases: sp
bangui:
description: bans players with a gui
usage: /bangui
online:
description: shows online players
usage: /online
enchant:
description: enchant's players' hand item
usage: /enchant enchantment level username
aliases: et
fly:
description: Toggles fly mode.
usage: /fly username
ok
see the error?
but it simple logical steps Sir
plugin.yml
look at yoru list of commands. you can see the error
what
but not Anymous
just a Minecraft player
just look at it in teh paste
conclure do u mind if i msg u instead
well you're kinda right in some way. you can patch packet crashers fully, but movement hacks are hard to detect, and its more of probability game whether the player is truly cheating
Not Everything is complete impossible
yeah
if (label.equalsIgnoreCase("tribute")) {
if (!(sender instanceof Player)) {
sender.sendMessage("Console can't use tribute.");
return true;
}
Player player = (Player) sender;
notsurehowtodeducthp```
any ideas, im clueless how to do remove hp
you ignore the illegelment packet and accept legit packet
and also check for the fact they have sufficient amounts
oh ty
Check for offline player is online?
just used the api
good job
what ?
ty
import org.bukkit.Bukkit;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
public class Fly implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (args.length == 0) {
Player p = (Player) sender;
if (p.getAllowFlight() == false) {
p.setAllowFlight(true);
p.sendMessage("§dYou have enabled flight.");
} else if (p.getAllowFlight() == true) {
p.setAllowFlight(false);
p.sendMessage("§dYou have disabled flight.");
}
}
else {
Player target = Bukkit.getPlayerExact(args[0]);
if (target != null){
if (target.getAllowFlight() == false) {
target.setAllowFlight(true);
sender.sendMessage("§denabled flight for "+ target.getDisplayName()+".");
}
else if (target.getAllowFlight() == true) {
target.setAllowFlight(false);
sender.sendMessage("§ddisabled flight for "+ target.getDisplayName()+".");
}
}
else if(target == null) {
sender.sendMessage("§cPlayer not found or offline.");
}
return true;
}
return true;
}
}
yes that the way to it
works 😄
gtg sleep gn everyone and thanks :D
yeah if player is null then they're not online
then it will return null if player is not on server
yeah
gl
🙂
Someone quick tell which Event is for Checking Item Move?
is it InventoryMoveItemEvent?
tried this and it ended up not working properly
i will try quick
what is item move
Gonna need to be more specific
i wanna check if item is gonna be moved by player in inventory
InventoryClickEvent
InventoryClickEvent mostly
look for comments, there's additional info
like the comment section?
yes
i'm curios is there another way?
just wanna know more
Usually the usage of a map indicates some sort of registry/manager/cache/repository class
So encapsulate the map and create a class with the functionality you desire
OOF ok thank you
none of their fix fixed it all it did is made it worse
Then just pass the instance of that class (:
its weird how if I sprint and jump holding it down it only counts once
for it to go off it has to be jump and sprint etc..
I have to spam it
Whats the best way to get folders in order from the source folder to a file?
I was gonna do a recursion method but feel like there is something better.
Ex; source-folder/folder-1/folder-2/file.file
I want to get a list in order so I can check if the folder exists.
or if anyone has a better idea then going through all folders checking if they exist then using mk.dir(); createNewFile()
Maybe Files class got some method for that
like Files::walk if im not wrong
altho that one might actually do it the other way
just call mkdirs(), it will create teh tree
File f = new File(Path);
YamlConfiguration Config = new YamConfiguration.load(file)
Yeah but when ever I use mkdirs() on a file it always makes the file a folder.
yes Parent is Folder
yeah but that would only get folder-1
lets say the file is in folder-6 it wouldn't get all the folders before it.
given
source-folder/folder-1/folder-2/file.file
Ex;
new File("source-folder/folder-1/folder-2/file.file").getParentFile().mkdirs() would create the necessary directories which in this case would be source-folder if not exists, folder-1 if not exists or folder-2 if not exists
Ill try it. I also found some method in Files that I am gonna try.
yeah
if you can
use Files and Path over File
as File is obsolete and has some problems
Files::createDirectories might be your friend
and Files::exists as well as Files::isDirectory
also you can get a path instance by File::toPath Paths::get or Path::of iirc
Yeah checking out Files.list(path)
pog
JarFile 😓
here is my terriable attemp
``
public static void CreateFolders(File File_Input) {
if (!File_Input.getParentFile().exists() && File_Input != null) {
File_Input.getParentFile().mkdirs();
try {
File_Input.getParentFile().createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}
}
``
C# coder?
me?
yeah
i got no knowledge of any C,s
ah okay
cake?
but nice try Sherlock
Then why no follow java conventions
:))
i like cake
:(
cuz C# function name convention is like GetMyCakeNow(true)
which type of cake
UpperCamelCase < lowerCamelCase
i were Following a Tutorial on clean code
flying cake is pretty tasty
hmm, mind linking me?
Hope it wasn’t a java tutorial
i hate inconsistency
same lol
Then don’t

unpopular opinion: idc if they are not the language specific conventions as long as they are consistent across an api
Yeah that’s fair
OTG uses C# style {}
Although if you are working anywhere in business you probably want to follow language conventions
If(Something)
if(Something2)
no baskets 😂
itsvollx I wholeheartedly respect UpperCase when it comes to class names, but you should follow java naming conventions to the letter as it makes it easier for other java devs to read your code etc
well yaa
I mean you do you but yeah 😄
👍
Alright new language: no upper case ever
i'm trying to learn clean coding
Not even in strings
No1 will kill you if you refuse to follow it so no worries in case you disregard
yeah clean code is hard because it has a very big sense of being a subjective topic
though in object oriented programming we do have some soft things you might want to consider
best way i saw was keep it simple and readable
That’s why I make my code take daily showers
yeah
any way to stop an item from dying in the void?
simplicity is good I agree
EntityDamageEvent doesn't work with void damage for some reason
lmao
It should
works with cactus/lava/fire and everything else
snake_case_prevails_ssssss
But does it fire for Items?
Weird
me?
how would one do that
Sysout the damage cause
if Entity is Item
cancel
also this is my code rn
@EventHandler
public void onEntityDamageEvent(EntityDamageEvent e){
if(!plugin.getCrownManager().isRunning()) return;
if(e.getEntity().getType() != EntityType.DROPPED_ITEM) return;
ItemStack itemStack = ((Item)e.getEntity()).getItemStack();
if(!plugin.getCrownManager().isCrown(itemStack)) return;
plugin.getCrownManager().setCrownState(CrownState.DAMAGE, null, ((Item)e.getEntity()), false); //Re-teleport
e.setCancelled(true);
}
it works with everything but void
actually quite clean, nice
the only thing i can say is make a variable for the cast
Nitpick time
but its good in general
Pretty sure you can just do event.getEntityType
maybe the void Delete item?
then there won't be any damage
Maybe wanna use more explanatory variables and make the entire function on the same abstraction level if we’re being pedantic
I came here for help with the event not my code quality
it shouldnt?
cause item is like any entity
I mean
This is Mojang
but idk
not if it does Item Remove
i can try depugging out the damage
No Damage if it doesn't exist
heh?
Check if there any damage
if not...
then it is deleting item
output Entity Item Damage
i just wanna be 100% sure
ye ye i'm doing that rn
try with lava too XD
did you try with Bukkit.broadcastMessage();
use broadcastmessage
why?
no
It doesn’t take any less time than sysout
yea
paper flames you for not using logger btw
well true
But Console ... System.out.print
@ivory sleet
public List<File> getFoldersFromSource(File f) {
List<File> folders = new ArrayList<>();
try {
List<Path> paths = Files.list(Paths.get(f.getPath())).filter(path -> new File(path.toString()).isDirectory()).collect(Collectors.toList());
paths.forEach(p -> folders.add(new File(p.toString())));
} catch (IOException e) {
e.printStackTrace();
}
return folders;
}
Files.list(path)
Only works if the file is already generated 😦
my server told to use to Logger instead of System out put
Yeah paper liked to yell at me while debugging
yapperyaps, what are you trying to do now again?
Fricken nerd
lol
exactly
I mean I could always attach a debugger
List<Path> is the output of Files.list()
But meh
i thought people said mock bukkit gets the job done but its "bad'
you know
yeah it could better in some angles
Yes i understand, but that doesnt explain why still lol
it actually doesn't output with System out on my pc on spigot
get all folders from source to the file I want to create
but it does work just fine for automating tests
until i click on console
but the first one is better
Yeah true
im thinking of setting up automated testing
lol
I pop the disk tray as a debug output
yeah its so helpful
What's the difference between Accel and Delta?
delta like the difference between two values?
@sleek pond any updates?
yea
i got Creative way Store Items into List Before it falls into the void
I mean if damage doesn’t work then you gotta use a runnable
path -> new File(path.toString()).isDirectory())
you can just do path -> Files.isDirectory(path)
Don't pay attention to TELEPORT PODIUM and DAMAGE
👍 doesn't fix that Files.list() requires and already created folder/file
those after it said teleport i dropped the crown into the void
where should i look?
and FIRE_TICK is me setting it on fire
No I'm not.
No, im fine with Files.list()
im just saying that you should try to use one or the other cause converting back and forth will make ur code messy
did it output?
no ofc it didn't
there isn't a sysout
look at the more detailed screenshots
ok then not
public static List<Path> getUncreatedDirectoriesFromFile(Path path) {
if (Files.exists(path)) {
return Collections.emptyList();
}
List<Path> uncreatedPaths = new LinkedList<>();
parent = path.getParent();
while (!Files.exists(parent)) {
uncreatedPaths.add(parent);
parent = parent.getParent();
}
return uncreatedPaths;
}```
@stone sinew
Idk, is this what you're looking for?
so what do I do
no whiles lol
But yes kinda
running a runnable every tick is such a waste of resources
Use a runnable and check if the item is below y 0
there's nothing wrong with a while loop
Do a runnable every tick and destroy the server performance. obviously
Whats wrong with while lol
Yes because checking a single thing is gonna nuke the sever
Files::list does some iteration also
you never know how many crowns I have
Maybe anyone can craft one?
Idk
Alright then, cover the void in lava
Java moment 😳
like the difference what would be stored in them two
well
delta is the difference
as simple as that
the value is usually obtained through |a-b|
@limber mica
anyways wym by accel?
Merging the code so no one gets confused.
public List<Path> getFoldersFromSource(File f) {
try {
return Files.list(Paths.get(f.getPath())).filter(path -> new File(path.toString()).isDirectory()).collect(Collectors.toList());
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
``` ```java
System.out.println("Testing file system...");
String path = ConfigManager.get().getSourceFolder().getPath();
for(int i = 0; i <= 6; i++)
path = path+File.separator+"Folder-"+i;
ConfigManager.get().getFoldersFromSource(new File(path)).forEach(p -> System.out.println(p.toString()));
java.nio.file.NoSuchFileException: .\Folder-0\Folder-1\Folder-2\Folder-3\Folder-4\Folder-5\Folder-6
still dont know what you're trying to achieve here
@sleek pond
https://papermc.io/javadocs/paper/1.16/io/papermc/paper/event/entity/EntityMoveEvent.html
OR
ProtocolLib and listen for incoming EntityMovePackets..
declaration: package: io.papermc.paper.event.entity, class: EntityMoveEvent
Basically what you did above... but without the while loop
Why??
why is this implemented in paper but not spigot
Why do you want to make your life harder??
you're so confusing some times yapperyaps
ask spigot why no EntityMoveEvent
u guys are spigot
because it would lag the shit out of spigot
considering how often it might be called
Because PlayerMoveEvent is laggy enough and if Paper prides itself on optimization they wouldn't add an even laggier method xD
They did tho, it has one.
Yapper you good?
I guess paper got it way more performant due to asm generated event executors
spot on
Using a BlockingDeque - is this queue.offerFirst(queue.take()); equivalent to "take without remove"?
what implementation?
LinkedBlockingDeque
ops wrong person
lol nw
getFirst should work
then listen to packet Item move
getFirst is the simple peek at the top without removal
then the fuck is offer
wait it possible to Override the Void Deleting item?
or well head rather than top but yeah
JUST insert terrible solution here
i wonder
Yea but then it doesnt wait if the queue is empty
Make Joke Solves Problems, i joking
Doing more than you. :)
At least I'm not pinging in my replies.
wait if the queue is empty?
I want "take" but without removal so basically while(queue.isEmpty());
atless you're speaking your mind :))
atless
take(): Retrieves and removes the head of the queue represented by this deque(in other words, the first element of this deque), waiting ifnecessary until an element becomes available
like
what does the for loop have to do with it xD?
...
im confused by what you're asking sorry
Deque#getFirst would just throw you an exception if the instance is empty
Yes thats exactly what I want, I just want to wait if the queue is empty until an element is there
ah I see
Yeah take blocks
Shouldn't this queue.offerFirst(queue.take()); exactly do that? I mean its kinda dumb but idk any other way without a while loop
but why do you want to offer the queue the first as the first
check index of one?
Why not just assign the Helmet a team, give it a glowing affect, then just upon entity item damage teleport the item?
I think I'll do that you know
Thanks I knew it would work!
better than what some of this lot has suggested
SpinAndDrain is typing...
Basically, I want a normal queue and I want to wait if it is empty. If I use take on a normal BlockingQueue, then I cant be sure that the element is inserted at the head again - that is the reason why I took a BlockingDeque because it provides insertion at both head and tail.
here some ideas
How will that help if the void still doesn’t trigger the damage event
Right I havent said that - I want to insert the element back into the queue because I dont need it at the moment I'm retrieving it
And there is no takeButDontRemove
why not remove?
Yea I thought it would be more performant like that
then save?
its not
ok, then I'll just use a while loop
i would get the index of the Player who left, and..
move all Players one down after that number?
if you wanna sort them ofcouse
Because I don't need it there
does anyone know how I would be able to give a world data?
Basically I mean like to generate a new world that's a map.
Like an arena or something.
basically I want to generate a world that's a copy of a world or something
Just copy the folder and then createWorld to load it
but how do I let the getWorld know which file to load>
createworld*
Don’t need to getWorld
nah use createworld to load
how do I pass in the data then?
copy the Files
but how do I let the line know to use the file?
You give it the name
the same name as the file?
like ./worlds/arena1?
FileUtils.copyDirectory(old Path, new Path)
I'm just really confused lol
It would actually go under https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Bukkit.html#getWorldContainer(), Coll
could I see like a small example or something?
Where worlds are stored is actually configurable, so while by default it's in the root of the server, they may be placed elsewhere
Choco is typing..
you use Java Api to copy and paste files and directory
Ah, well there you go you can use that
Never knew you could change that
For a server to be connected to bungee, does bungee cord have to be true in spigot.yml?
so I should do something like:
World duelsNewWorld = server.createWorld(new WorldCreator(fileName));
??
Pretty much
so one last time because I'm really slow how do I let world creator access the file?
With the name of the folder
or where should I put the file?
You just type the file name basically
You should put the file where all your other world folders are
but I mean like say I use a host, where should I put the file then?
Same place you would if you hosted it yourself
you mean copy world files to?
essentially
oh
I mean I want to send the world files to shockbyte, do you know where in shockbyte I should put them? like under what folder?
The root folder is the default
Copy world Files to Path
if Files exist Then Not
this is auto copy and paste 👆
then load world
same place those are located, all the other world folders should go
On shockwave it litterally just says put it in the spigot folder nothing else
shockbyte*
I'll try that really quick
yeah
YourServerFolder / YourWorldName
All world folders should go in the default directory (same place you fine world, world_nether) and then you just type the folder name for the WorldCreator thing. That’s all you basically need to do
no it's fine
i would glad help with what i can👍
also would I use "s or no "s
like "arena1" or arena1 ?
If Folder is arena1 then it must be arena1
alright
exactly has written
I just tested with the regular world file and it's giving an error
oh makes sense
is it possible to unload Default world?
No
I have a question, if multiple people are using the same arena would it unload the world?
like if there was multiple arena1's
You can’t have folders with the same name
so would I just have to have a lot of world folders?
the Files is the Data
or could I make and delete new ones based off of the orginal folder>
You can do that, yes
yes
What
I mean folder
copy world and paste world somewhere
A world contains many files, what file are you referring to
I meant the folder
Yes each world is a different folder
Copy it
Java API
could I make a new folder with the same data everytime someone runs the command?
would I also be able to delete said folder when the fight is over?
Copy world and paste world with new name
Yes, you can unload and the delete it
oh ok
i'm curious is it possible to load the world somewhere from like Worlds/word2?
i haven't checked
also is it possible to load a world with a name like:
test #4
?
cause it doesn't use " 's right?
Should work
Folder name: test #4
World duelsNewWorld = server.createWorld(new WorldCreator("test #4"));
bro you told me not to use " 's lol
" " is string
you need it
the 2 " " is to contain the text in String
if you don't know this i recommend java tutorials
I do but I asked you if I should use it and you said no lol
.
.
Be patient
He meant that the world folder name gotta be the same inside the string
it takes a String mean you need "The Name here"
yeah wisdom thank you 🙂
yeah no need to be salty
this isn't a salt factory 
true
i just not the best wording things
you know accel
'
New
How can i get the BlockFace, if i have only the block. My method before this is in 1.17 with
<block>.getBlockData().getAsString().split("facing=")[1].split(",")[0].toUpperCase();
'
goodness
now that is some cursed code
their code is simply too advanced for us
getConfig().getLocation("location").getBlock().getBlockData().getAsString().split("facing=")[1].split(",")[0].toUpperCase();
Oh no cursed code
If you ever want to feel good about your coding
Decompile random plugins on the latest release page
Not yet, I'm taking a break right now but I'll start again later
great idea dont give up or let it get you down
embrace it and remember to take breaks
i believe you can do it!
and learn 100% with time
writes it binary 
possible the worst thing ever
then worse
quantum pc states
plugin.getServer().broadcastMessage(format("&6ROULETTE &8» &f" + player.getDisplayName() + " &7has just won &adouble &7their money in the &6Roulette Game &7(/roulette)")); anyone know why this gives me the message:



