#help-development
1 messages · Page 1586 of 1
well yeah but like plugin.yml?
name: Nectar
main: com.ankledev.nectar.main.Main
version: 0
api-version: 1.17
commands:
discord:
permission: nectar.regular
spawn:
permission: nectar.regular
say:
permission: nectar.staff
warn:
permission: nectar.staff
kick:
permission: nectar.staff
mute:
permission: nectar.staff
ban:
permission: nectar.staff
vanish:
aliases: [v]
permission: nectar.staff
mtp:
aliases: [modtp]
permission: nectar.staff
s:
aliases: [staffchat]
permission: nectar.staff
who:
aliases: [whois]
permission: nectar.staff
setrank:
permission: nectar.moderator
toggledev:
permission: nectar.admin
no the plugin.yml isnt needed.
well i havent disabled autocomplete
im talking about ur actual code, for the tab complete.
o?
i just cant see the commands that i have assigned permissions to in plugin.yml, despite having the plugin to run the command
yeah
have u tried restarting ur server/??
since /rl can bug out things
and it isnt recommended
hm,
if i do this, how did it return if it false
if(!boolean) return;
add the exclamation point
....
bro, im gonna sound like every toxic dev ever when i say this but its true,
Please learn basic java...
oh i misunderstand
i agree
tbh im still learning java but like, i do have a background knowledge of it
cuz yeah ill admit it, im new to java, BUT at least i know some what on what im doing, i already figured out how to make guis with different clicking methods and etc, so, kind of feel super accomplished about that,
i already do if (!boolean) return; but its executed another code
same but i dont have as much as u
can i ask u something?
lol
i could of lied and said i have more than u :D
:D
ayo ima spit my plugin.yml problem into #help-server again! hope i dont get called a retard again :D #WAP
ok good i can ask u since ur dead silent af for no reason,
Please use https://google.com/ please, im fr begging u, if u dont know the basic boolean values and how to use them, PLEASE for the love of god, use youtube or use google!
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
LOL, rip u, well gl bro
i have a question as i have made a task that is setup on a timer and i am trying to get it setup in the onEnable to be able to run it but how would i pass in a player from the main class so that it can access the things needed 🤔
Can you be clearer. Do you want the player instance in the onEnable or get it from the main class into another class?
this here https://i.imgur.com/Otpi21A.png
Dont run the player instance through your constructor
okay guess back to the drawing board on how to get the player stuff i need into the task
guys do attribute flying speed affects the speed of elytra? or does this attribute applies on player ?
no the player.setFlySpeed method on effects the player if they are allowed to fly
so attribute modifier doesnt work right?
hi, so im trying to make it to where a specific person cant enter a certain region (my base) im assuming i could make it to where they get tped when they enter a certain radius of my base but i was hoping that there is a plugin side solution instead, does anyone know what i could do (im willing to install any plugin or anything like that if i need to for it to work)
(WorldEdit) + WorldGuard has that function
WorldGuard does it, WorldEdit is just a dependency for it
I dont really know the command out of mind right now sadly
ahh i see, ill download worldguard then, do you know what i should look up to be able to find how to do it?
you disable passthrough when you make a new region im pretty sure
Okay so, here's how you should be able to do it:
- Select a Region with WE
- Run command /rg define [RegionName]
- Run command /rg flag [RegionName] entry deny
After that you can add a Owner and Member to Regions using: - /rg addowner [Region] <PlayerName>
- /rg addmember [Region] <PlayerName>
I think this is how it works, just scratched that out the back of my mind @true sorrel
You can also read up more here:
https://worldguard.enginehub.org/en/latest/regions/commands/
https://worldguard.enginehub.org/en/latest/regions/flags/
okay thank you so much! how do i create the region cause i dont have one set yet?
- Select a Region with WE
- Run command /rg define [RegionName]
ahh i see ty
will this make it to where no one can enter my base or just the specific person cause i only want to deny entry for one specific person
o:
whats the best way to get the players actual fall distance? player.getFallDistance() can get spoofed and could cause issues
Oh that would block every1 except the people you added as Owners / Members
I am not entirely sure if there's a way to make it denying for only one person tbh
how can i do this? i cant access seconds
int seconds = 3;
new BukkitRunnable() {
@Override
public void run() {
seconds--;
if (seconds != 0)
player.sendMessage("teleporting in " + seconds + " seconds...");
else
player.teleport(blabla);
}
}.runTaskTimer(BetterWarps.instance, 0L, 20L * 3L);
also, how do i stop the timer?
ahh i see, well i will just add everyone but that player XD
it wont let me send a pic in this channel but i dmed it to you @tacit storm
you probably have to convert it to an AtomicInteger or put it inside your BukkitRunnable but not your run method
also you can use a returning method of the class just like #schedule bla bla and get the returned int/BukkitTask
Back to my yesterday issues, I need somehow to create a module for version 1.16.5 and 1.17.1, the thing is 1.17.1 requires Java 16, how can I create a module that support those version?
what about stopping the timer?
Put the seconds into the local variable of BukkitRunnable, and to cancel the runnable simply just this.cancel()
new BukkitRunnable(){
int seconds = 3;
@Override
public void run(){
....
}
}.runTask...
thanks
bump
.
what type of module
Maven/Gradle has ability for multi-module project
[14:31:17] [Server thread/ERROR]: Could not load 'plugins\Hello.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:160) ~[server.jar:git-Spigot-a93cbb1-7a6c3c9]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:144) ~[server.jar:git-Spigot-a93cbb1-7a6c3c9]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.loadPlugins(CraftServer.java:383) ~[server.jar:git-Spigot-a93cbb1-7a6c3c9]
at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:185) ~[server.jar:git-Spigot-a93cbb1-7a6c3c9]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:809) ~[server.jar:git-Spigot-a93cbb1-7a6c3c9]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[server.jar:git-Spigot-a93cbb1-7a6c3c9]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_291]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
... 7 more
just use any one of those build tools
read the thing bud
your plugin.yml is invalid
maven, I need to get a method for each version
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
i need to name it plugin.yml?
huh?
Please learn how spigot api works
It's basically a wrapper
i did\
can u rather explain what you are trying to do?
myyy typo
do u know java and basic spigot api and how it works?
i named it plugins.yml
yes
I want to rotate armor stand head, but that requires craftbukkit method, and I want to support version 1.16.5+
any recommendation for an "error" sound effect? i dont really remember all minecraft sounds
use reflection
or abstration
I don't want to use reflection because I want to expand it later.
you can just set java 8 as your project sdk
I use interface right now, but I got problem with the java version
it will work
uh, ArmorStandMeta exists but idk if it has a method for it
just the server needs java 16
I use the build tools
uhm
?
you can compile your plugin on an older java version
and it will run on a 1.17 server
since java is backwards compatible
Here's the error https://paste.md-5.net/aqiqowowiz.rb when I tried to use java 8 on the projects sdk
as far as i remember, old bytecode type can work on newer JVM but not at older
while launchin the server, use java 16
but on development use java 8
It can't even compile
your issue will be fixed.
huh?
That's compilation error
i'm using maven, yes
send full log
so if you need to update for that single class, just update your java version to 1.16
that's the full log, one error only
...
oh one sec
you using intellij to compile?
okay cool

i dont understand
hey I'm not really sure how tab complete works
@Override
public List<String> onTabComplete(CommandSender sender, Command cde, String arg, String[] args) {
List<String> list = new ArrayList<String>();
if (args[0].equalsIgnoreCase("pay")) {
for (Player player : getServer().getOnlinePlayers()) {
list.add(player.getName());
}
} else if (args.length == 0) {
list.add("pay");
}
return list;
}
this is what I have so far but this doesnt work
set your java compile version up to java 16
aglerr, you could create your own mask class
did you also set it to the command?
more like "register" it to your command?
how can i do that?
lmao
this.getCommand("bits").setExecutor(this);
this.getCommand("bits").setExecutor(this);
on accident
in your project structure under project
this.getCommand("bits").setExecutor(this);
this.getCommand("bits").setTabCompleter(this);
fixed thanks
ok bye
so change the sources and the dependencies to 16?
do you have JDK 16 installed?
yes i do
You using intellij?
yes
click on project
no :)) ignoring good
sorry don't mean to ignore you i just dont understand
okay what do you see inside "Project"
shut your mouth mr. parrot
yep it's working now
ok encryption library
thank you so much
Alright, Have a nice day!
for both of you
Ayyy it’s backpack man
whats the best way to make a double only have 8 decimal places instead of 20? I can only find ways to round it but i dont want to round
Wait, I think I've a method for that
first google result
DecimalFormat df = new DecimalFormat("#.#####");
df.format(0.912385);
Here you do
Replace the #.##### with how much numbers and decimal places you want
who is the backpack man
why does it return a string?
@summer scroll
You can always use Double.parseDouble()
Cool!
hey I have a problem with my plugin, it should get random items from the config, but sometimes it doesn't work, it gives 2 different errors, and sometimes no error (and then it just works).
Error 1:
https://pastebin.com/pzHDnTwf
Error 2:
https://pastebin.com/S5SFL3Pd
The part of the config that fits this:
https://pastebin.com/v3byugih
Error 1 means you clicked out of the inventory
so you clicked no inventory
Dont use the inventory title to check the inventory
you should implement a custom inventory holder
and wtf is this code
??
have you heard of a loop?
and also, @wooden fable Please just use a loop
oh
Recursion 
recursion is a stupid loop
get stackoverflow'ed
most of the time it is
there are a few instances where it is not
People when then first try recursion
public void doRecursion(){
int i = 0;
System.out.println(i);
i++;
doRecursion();
}
comes into a google and type Why do I get StackOverFlow exception while doing recursion

im making a fake server hosting with skript :)
because bored af
and skript is the easiest to use
Random rand = new Random();
for(int i = 0; i < 27; i++) {
int randomNum = rand.nextInt((max - min) + 1) + min;
ItemStack RandomItem = new ItemStack(Material.matchMaterial(Main.plugin.getConfig().getString("PackMachine.p." + randomNum)));
}
``` is this better?
couldnt you cache the rand variable?
🥲
@Override
public List<String> onTabComplete(CommandSender sender, Command cde, String arg, String[] args) {
List<String> list = new ArrayList<String>();
if (args[0].equalsIgnoreCase("pay")) {
for (Player player : getServer().getOnlinePlayers()) {
list.add(player.getName());
}
} else if (args.length == 0) {
list.add("pay");
}
return list;
}
this still doesnt work
is there anything wrong?
Possibly
why cant you do recursion forever?
Probably not that trivial tho
do I have to do something in plugin.yml?
Ye
yes
this.getCommand("bits").setTabCompleter(this);
public final class BitEconomy extends JavaPlugin implements Economy, Listener, CommandExecutor, TabCompleter {
I mean it’s nice for readability
also gives you the prompts
while just typing doesnt
Pretty sure it does prompt you, just that you will get prompted with a lot more
it doesnt suggest me anything in JavaPlugin without me doing this.
How can I send the world loading screen to a player?
Hmm I haven’t touched IntelliJ in a week or so, can’t remember
Isn’t that entirely based on client
Hmm maybe
pretty sure it is
I thought there might be a packet that gets sent?
I want it to be like /bits <tab complete - pay> <tab complete - online players>
Oh and your current code was?
im gonna go now
Cya
its 9 am
^^^
havent slept yet so im gnna go
there we have it. check if the args length is 1
First of all, you probably want to use StringUtil.copyPartialMatches
not 0
here is a typically example https://github.com/Luziferium/AsyncSpawnMob/blob/master/src/main/java/de/luzifer/asm/commands/tabcompleter/ASMTabCompleter.java
Mye checking 0 is redundant
it will not work*
Sorry for the current person getting help, would this work? https://www.spigotmc.org/threads/force-loading-screen.53971/#post-605148
but it should auto complete before you write the args
Very true
It will axilirate
It should work in theory
hitting the space = another arg
iirc spaces are included in args
Well they’re trimmed before you get to look at that
testing
What version?
arrays start at 0 :/
but not the length
It works now
java starts counting from 0
not all
lua 🤡🤡
I have this now:
https://pastebin.com/raw/QNPXm083
Same errors, sometimes it works and sometimes it doesn't...
But
The inventory isn't always filled
I understand now why people hate lua
Now my next simple question is, how can I run a Runnable on a seperate thread (it doesn't access any bukkit/spigot interals). Should I use java threading?
no. you won't need to create your own thread. you could either use the bukkit async scheduler method or CompletableFuture
Is the bukkit async scheduler, I need to always be on it's own worker thread it's doing some API operations that take seconds to completed and can't block the main thread
i would prefer completablefuture
Is this feature in Bukkit too?
Ahh yes I have heard of it thankyou.
he asked if CF is a feature in bukkit
Oh yeah right
not if there is such a feature in bukkit
I mean you could wrap an executor
thats what CF does
CompletableFuture.runAsync(()->{},runnable-> Bukkit.getScheduler().runTaskAsynchronously(plugin,runnable)); iirc
That is if you want to use the Bukkit scheduler with CF as it’s totally possible
but unnecressary
Yea wouldn't that be redunant
@broken hare what exactly are you trying to do?
run something async
Exactly what?
CF#runAsync(runnable) is totally fine
No it hugely depends on what you’re doing async
For instance doing if you’re IO it’s preferred to pass a custom fjp to the CF
Yes it just API stuff
If it’s minecraft/spigot api related, pass the Bukkit scheduler wrapped in an executor
So what do you suggest I was gonna use runAsyncTask?
I mean necessarily not
It doesn't need to access bukkit internals or spigot
What stuff specifically?
Like calling a public API, how specific do I need to get?
Idk just curious
Ohh it's just a geocoding api
It may need to call one bukkit internal, is that okay. It would just be to do a teleport?
Oh then it’s probably fine with the CF and the common pool
Is that possible could I call a sync task from a async task?
you can run that within the CF on the main thread with #runtask
Yes ^
This is probably non of your interests but I am just going to publicly blame all spigot devs that use the common pool when doing async stuff that regards IO. 🙂
So its okay to call teleport in a worker thread?
Idk maybe that has to be triggered on the server thread
I need to do this because the IO stuff takes 10 secs and if I do this on main thread it will block it
You’re not doing IO?
Yes first then I want to call a teleport
use the AsynchronousFileChannel if you are doing something with IO
Hmmm okay
I don’t know I use array list with callback thing and in the async when it completes the thing that i need i add the thing that works only on sync stuff from the async thread to run without any issues
You could always teleport on a sync task if everything else fails
But how if I want execute stuff in a worker thread?
Myes that’s good if you’re manipulating a file frequently.
You do all your resource intensive stuff off-thread and use the Bukkit Scheduler to run a task in the next tick that teleports the player
~ or if you are using a CF you can teleport the player in the callback
I am doing network stuff
So I execute a sync task from a async task
yes
No spring
Ah
Is there anything in spring to help?
Wait this plugin of yours uses spring?
Ah yeah, I mean spring is ridiculously humongous but that gives more context on this problem.
But just do what geol said or well luzifer also probably mentioned lol
Okay will do
Also about IO and the common pool. Thing is a lot of bad plugins mess with IO frequently and use something like CompletableFuture#run/supplyAsync(lambda) which is the same as CompletableFuture#run/supplyAsync(lambda,commonPool) and that slows a lot of other things down, like parallel streams since they also use the forkjoinpool common one and also all other plugins which use CF with the common pool to do heavy computations and so on. That’s usually why we prefer to have our own fork join pool when dealing with IO which should be handled async.
Also for anyone who reads this the fork join pool works by having several workers stealing smaller tasks from each and another. IO tasks can be large thus reducing the effectiveness of the common join pool.
is there any way to remove the id and nbt tags from an item? using it in a gui. also, can i add the enchantment effect somehow? without seeing any enchantment info in the hover popup
there is an Itemflag to hide enchantments
what about id and nbt
what id?
You can't hide these
Tags can be hidden with packets but might cause sideeffects since the client doesn't know the data
ahh you right
Hi,
I would like pro's opinion about an issue,
I need to regularly update an armor stand customName, but the thing is that most of the time it spawns in not populated area which means that the chunk unloads
I have thought about 2 solutions:
Prevent chunks where I have my armor stands to unload (which doesn't feel optimized)
Only update the armor stand when the chunk is loaded, this one would be better but I actually can't get to keep updating my armorstand when I get back to the chunk after it has been unloaded even though I keep my armor stand instance in memory
Can't you get an entity in a world by it's UUID ?
I pretty sure you can
declaration: package: org.bukkit, interface: Server
Here
Store its UUID instead of its instance
And get it whenever you need to use it with this method
should i use addEnchant to an item meta, or addEnchantment to an itemstack? and why
probably addEnchant since it doesn't check if it's a legal enchantment
That would have been great, sadly i'm in 1.8 😭
Pretty sure that’s in 1.8 also
:outdated:
:feelsbadman:
can't wait for 1.18 so I can troll people by pretending I thought they had a typo
lol
xd
You can use a switch statement instead of if
But i have no idea how to do this more efficiently
EnumSet
what am i seeing here
Hey! Quick question: I'm in the process of creating something that places a few blocks. Among these blocks are glass panes. I would like to work with multifacing for the glass panes in order to connect them with the surrounding blocks. I have already programmed the following:
BlockData glassData = glass.getBlockData();
MultipleFacing facing1 = (MultipleFacing) glassData;
facing1.setFace(...);
Which blockface value must be set to connect the slices to all blocks?
I have a question,in the server,properties file,what is the use of this line
Would I have to purchase a domain like with a website?
#help-server and just leave it blank
oh sorry
when do you remove these recipes o.O
like, onLoad ?
I mean, this should technically only happen when players join that had these recipes unlocked
but you were on the server?
Seems like it
well, let me try to reproduce it
yeah idk I cannot reproduce your error. I was able to remove it perfectly fine without the error message.
[13:37:30 ERROR]: Tried to load unrecognized recipe: minecraft:white_concrete_powder removed now. I can get this error after I crafted white concrete powder -> enabled the plugin -> reconnected
is the plugin on Post world?
huh ?
I mean, this is what we were suspecting earlier
this error should pop up when a player is loaded that had the recipe unlocked earlier
it isn't
but it will only happen once
after the player was loaded the now faulty data is not stored anymore
is there a way to configure unlocked recipes for a player onJoin?
https://papermc.io/javadocs/paper/1.17/org/bukkit/entity/HumanEntity.html#discoverRecipes(java.util.Collection) and https://papermc.io/javadocs/paper/1.17/org/bukkit/entity/HumanEntity.html#undiscoverRecipes(java.util.Collection) in combination with https://papermc.io/javadocs/paper/1.17/org/bukkit/entity/HumanEntity.html#getDiscoveredRecipes() should allow you to do that
is paper api and bukkit api different?
If I spawning armor stand with packets, how can I make the armor stand follows player head movement?
yes. paper api is based on spigot api
but introduces a bunch of new methods, utilities and systems
I'm guessing listen to player move event and send head rotation packet? but will that gonna hurt the performance?
Well idk if player move is really the best call, concerning you are working with packets you might be fine just running an async timer each tick
is there a download for the jar of paper api or is it the same as the spigot api jar?
So sending an async packet each tick is the way to go?
you cannot use paper api without running a paper server
also who "downloads" an API ?
just use your maven/gradle build system
I think, that I found the problem, but it I don't have any idea how to solve it. When I try to cast the nms Entity to my class, I get this error
java.lang.ClassCastException: class notURL.RedstoneExpert.TridentGamesLobby.Spigot.Meteorite.Meteorite cannot be cast to class notURL.RedstoneExpert.TridentGamesLobby.Spigot.Meteorite.Meteorite (notURL.RedstoneExpert.TridentGamesLobby.Spigot.Meteorite.Meteorite is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @5c6c8692; notURL.RedstoneExpert.TridentGamesLobby.Spigot.Meteorite.Meteorite is in unnamed module of loader org.bukkit.plugin.java.PluginClassLoader @49449d7c)
Are you running two instances of your plugin ??
did you accidentally shade in your plugin in the other plugin?
ty
no, this happened after restart
geol might be right then
nah, this is a memory leak
oh right
how can I get the item frame then?
Yea, then it is a shading issue
both doesn't work
if restart is bork reload is bork too
can i use paper docs for spigot plugin
nyes
PlayerInteractAtEntity, you can get the entity from there
It works, although with unindended side effects
iirc ItemFrame is an entity
well, not all methods you will find in paper docs are available on spigot
I said left click, this is for right click
you can also not publish plugins to spigot that use paper specific versions and hence not run on spigot only servers
an item frame is an entity, not a block
Paper has a LOT of methods deprecated and it will point you to methods that do not exist on spigot
^^
can you describe it, because i didn't understand what you mean by this
what is JDT xD
Eclipse Java development tools, technically the eclipse compiler though
o ok
ty
?jd You should be able to point to this though
Umm I guess EntityDamageByEntityEvent?
I will try but I don't think this will be called because this is a fixed item frame
so it can't be broken
according to the javadocs this is an itemframe that was set fixed
When true it's not possible to destroy/move the frame (e.g. by damage, interaction, pistons, or missing supporting blocks), rotate the item or place/remove items.
So it can't be damaged.
yeah it doesn't trigger the EntityDamageByEntityEvent
so how can I detect a left click?
tricks
either trying via nms and or packets or set another invisible entity over it and redirect the click
does somebody have any knowledge on gradle here?
GodCipher, is it fine to have a async task timer that runs each tick to send a packet to the player? Basically I want to make armor stand head follow the player head rotation.
?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.
you won't need to do it async
Basically im trynna create a client and in order to do that i need to use cmd line and gradle. Now, even if i just run gradlew without any other arguments i get this error:
FAILURE: Build failed with an exception.
* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at https://docs.gradle.org/4.9/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
FAILURE: Build failed with an exception.
* What went wrong:
java.lang.ExceptionInInitializerError (no error message)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
why's that?
why would you? first i dont know if NMS is actually thread safe, second its redundant. the call would take longer than doing it sync.
stacktrace gives me this:
https://paste.md-5.net/yojafojuti.cs
and the performance? for the server its just like calling a middle sized method. after that everyting is clientside
i think @ivory sleet can help you
he always fights for gradle so he have to know it
Alright, are there downside calling packets each tick? We're talking about 50+ packets being sent each tick.
it is load on the internet connection
but many packets are sent every tick event in vanilla
not really. if you think of the playermove packet, event whatever, thats 500 times more frequently
and still runs perfectly
"perfectly"
from what i know, it is sent also every tick, but i can be wrong
but still if i am wrong, the only other option is to send it every frame and that is still way less then 500 time more, but still, it should be ok, because for example all entities are sending their position every tick
a packet is sent if a certain action has been done
String[] list = {"uuid.5","uuid2.3","uuid3.0"}
list[0].split(".")[0]
why it return error of index out from bounds? (list[0] return "uuid.5")
can you send us more context?
i use for loop for insert uuid of players and his kills from database
after sort
i need to get it out
but i cant do split
ok i will try
@ivory sleet could you help me with this?
stacktrace gives me this:
https://paste.md-5.net/yojafojuti.cs
nope
This error happened
when i just typed gradlew
Explains why
No arguments nothing else
What's wrong?
You understand?
Cuz i clearly dont lol
This happens basically everytime i use gradlew with arugments or without arguments
I tried to create listener via protocol lib and every player sends the packet exactly 20 times per second when they are moving
whatsu mean why no IDE?
I have eclipse and intellij
i use em both
mainly intellij
Okay but using IntelliJ should fix that I think
But like the error happens just when i open cmd and type "gradlew"
That shouldnt be connected with my ide
I dont
But the thing is, this error started appearing randomly, before when I used eclipse and did this kind of stuff it worked perfectly
Hey is it possible to create an entity without spawning it and without using NMS?
Idk I mean I'd love to fix it doing whatever needed but I rly dont know what to do
Cuz gradlew is a relative path to the ./gradle/ path where a gradle wrapper jar is located
But my suggestion is to use an ide
It will do most of the setup for you
Yea but like I dont understand the "use an ide", do I need to change the path or smthing?
I was using eclipse stuff before to decomp the workspace
I was trynna create a client
Then the error first appeared
Thanks, it works
Yeah it’s a weird error
Well yea the thing is it didnt happen before but then randomly started to happen
yeah, when they are moving. otherwise the server or more like other players wouldn't get that information
That’s why I can’t really tell exactly. But how’s your workspace directory looking?
would be pretty dumb to send moving packets if there is noone moving
I mean I dont have a workspace yet, i just needed to change the build.gradle a bit and then define the directory there, then i went to cmd to run a decompWorkSpace or smthing like that
And then it first appeared
also i am not sure if the packet listener is limited, since the bukkit event is being called several times a tick
Wait is this with forge or fabric?
forge
If im right they will tell u to f off pretty much when asking this kind of support
Give it a shot
Anyways it’s strongly advocated to use IntelliJ for both fabric and forge fyi, so they might also pick on that
So you mean just changing path or smthing?
I dont know "how to use" intellij in this case
I've been just following a tutorial currently and done what they did.
I have no idea how I should do smthing different than the tutorial showed in order to fix my issues.
maybe, but it is how minecraft works
when there are no movement, client will send 1 packet per second
but not a movement packet
(you can find this at minecraft protocol documentation or find it when experimenting with protocol lib)
ofc the connection have to be hold
https://youtu.be/JOTH1eDP99Y @vital ridge
This tutorial series will cover building a Minecraft Mod from scratch using the Forge API! In this episode, we setup our workspace and install the software needed to get started.
--- Important Links ---
● Java JDK 8: https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
● Minecraft Forge MDK (1.15.2): http://files.minecraf...
even if there is no interaction
Best I could find which might help
it sends a movement packet, this is log from listener that I created 5 minutes ago that logs only movement packets
[12:24:30 INFO]: [TridentGamesLobbyPlugin] 851
[12:24:31 INFO]: [TridentGamesLobbyPlugin] 852
[12:24:32 INFO]: [TridentGamesLobbyPlugin] 853
[12:24:33 INFO]: [TridentGamesLobbyPlugin] 854
[12:24:34 INFO]: [TridentGamesLobbyPlugin] 855
[12:24:35 INFO]: [TridentGamesLobbyPlugin] 856
[12:24:36 INFO]: [TridentGamesLobbyPlugin] 857
[12:24:37 INFO]: [TridentGamesLobbyPlugin] 858
[12:24:38 INFO]: [TridentGamesLobbyPlugin] 859
[12:24:39 INFO]: [TridentGamesLobbyPlugin] 860
[12:24:40 INFO]: [TridentGamesLobbyPlugin] 861
[12:24:41 INFO]: [TridentGamesLobbyPlugin] 862
```(the number is just some number increasing every packet, so it was easier to check, that when player is moving, he sends exactly 20 packets)
and this is quote from documentation
> Vanilla clients will send Player Position once every 20 ticks even for a stationary player.
hmm.. that doesn't make any sense to me. if it would be a ping packet to see if the player is still connected, okay. but a movement packet even if the player isn't moving?
i also don't have any idea why it works as this
i understand why server does similar thing when replicating entities to client, but here I don't have any idea, because the server should be the one with the correct data, so if client is standing on block, that server doesn't have, the server should be true and the client should fall anyways
but this is just how minecraft works and if you will be listening to the packets instead to the event for some reason, be sure to know, that movement packet ≠ player has moved
Hello I need help with item frames placing:
ItemFrame itemFrame = (ItemFrame) target.getWorld().spawnEntity(target.getLocation(), EntityType.ITEM_FRAME);
itemFrame.setVisible(false);
itemFrame.setFixed(true);
itemFrame.setPersistent(true);
itemFrame.setItemDropChance(0);
itemFrame.setItem(item);
itemFrame.getPersistentDataContainer().set(FURNITURE_KEY, PersistentDataType.STRING, itemID);```
and what is the problem?
strange. are you sure that protocollib isn't just doing weird things? is it actually minecraft/nms/craftbukkit?
yeah true. a player can stand on a block which isn't there for the server.
Oh man I'm sorry
I think I got the response
I would like to spawn invisible item frames
but I think I need NMS
because currently you see them visible and then they become invisible the next tick
because I can't create an entity and spawn it after without NMS, right?
define create entity
you can spawn the entity and modify it right after
that would take less than a tick
you can only modify existing entities - not make new ones
i think, that protocol lib is correct, because as i saied, the documentation says also this
which documentation? the one from protocollib? xd
you can maybe use world#spawn() where you can specify function, that will run before the entity is added to the world
minecraft is just weird
Oh thank you very much @waxen barn
at least serversided
is there a way to let a class only be extended by 1 other class?
This works perfectly, thank you very much @waxen barn
nope as far as i know
and why do you need it?
if you want to make public framework and avoid abuse there, this sin't the way to go, because java is really easy to decompile
Make a reactive system.
yea i saw something like a sealed class in C# and thought maybe java could do something similar
Also yeah notify and wait is kinda oldish
Also synchronized
Actually what are you trying to do?
?jd-b
Uh
?jd-bc
java has something as c# sealed and that is final, but disable extending the class by any class (and the sealed also does this as far as i know)
yea but it should be extended by one other class
but yea thanks
You said with bungee sysdm? Maybe explain a little bit more detailed heh
wait, what is the difference between sealed and final?
fina for a class prevents any other class from deriving it, sealed is a way to whitelist only certain explicitly declared classes to derive from it.
oh, ok
Okay but can’t all this be done or AsyncPlayerPreLoginEvent, like you send a pmc message and await a response
Or well you would need that listener
Yeah
Uh I’m on phone so can’t give you a concrete example but uh maybe someone else can give you further assistance
so basically you want to achieve something like:
send request for the servers name a player is on
"Please wait OKAY?!"
received server name
"Okay, here we go."
and why exactly do you have to wait?
Yes
Alright
It’s async in respect to all other threads
Or it executes the given runnable async rather but yeye
Just search consumers
there are not only consumers
It’s just a function which you pass to something and is at a later point of time executed
yeah just like a runnable
^
As far as I know, java doesn't have native labdmas support rather runnable and a consumer
supplier, function, bifunction, consumer, biconsumer...
kotlin is the best for top level functions
there are many functional interfaces
We can consider functional interfaces to be first class function objects in the way Java treats them
you can use a consumer
doesn't most of them implement consumer
yes kotlin best
interface implementing interface
pog
no they actually dont
interface extending interface
A functional interface is just an interface with a single abstract method and thus the lambda is allowed
interface A { void lol(B b, C c, D d); } even that would allow a lambda
depends on what you are trying to do
ahh that one interface looks rigged .-.
so ready up a consumer which accepts later on the player to send the message
Or (B, C, D) -> Unit (;
ah another question,
I can do this right?
private void something(String eh) {
new Thread(() -> System.out.println(eh));
}
but i assume you have to keep track of the players request with the player so nobody else gets the response of your request
Yes
yeah
but you have to start the thread
^
oh yea, thanks for reminding i totally forgot to add .start()
i'm doing all mysql tasks in new thread ik not the best idea
how can i change a players skin via a command ?
You should use an executor service probably sushant
by creating such a command
ik but like what is it called?
ah, bungeecord-
Reusing resources are good mostly
like player.setskin?
you are just trashing your CPU
well
as conclure said use an executorservice
Well take a look at the Executors class
its gonna take just bunch of more time
CF or ForkJoinPool
not you
So I have a javafx project and I tried to wrap the javafx dlls using the build artifact but it seems to do nothing. I may be doing something wrong but im not too sure.
oh lmao
are you at right place brother?
@plain scroll google for it. first google result will be your solution for sure
Yes I am
Serious Spigot and BungeeCord programming/development help | Ask other questions here are you sure?
oh well
"Ask other questions here"
Programming questions are allowed I guess
Ask other questions here
I mean they don’t suit any other channel better
that shot came back real quick
JavaFx is different tho, I mean if it was swing it was ok cuz it was inbuilt
Lmao
some of the jdks doesn't have JavaFx pre installed
I have never used javafx, tornado and that stuff.
I’m using jdk 8 so it’s built inside
why do you even want to wrap them
they are in the jar anyways
not for that lol
jfx is a great framework for professional application development
swing is for smaller applications
maybe he is developing instagram 2.0
I barely know anything about JavaFx all i know is to create a javafx application, you must extend Application class from JavaFx at the main class
Because when I give the user the exe file I don’t wanna have to give them all the dlls with it
imagine not using react-native or something like that ):
electron
ah
Isn’t that for mobile development exclusively
fuck electron
yeah
I think react native can be convereted into a web packagge
Ah
fitted to my answer about instagram 2.0
Probably ye
Swift
So yeah that’s why GodCipher
Swift is pretty poggers I heard
are bossbars async?
Used it 3 times and never touched it again
Koto probably not
ty
Vaadin
Is there a reason why you never used javafx
Never bothered
he was probably minecraft addicted while learning java
welp, i never learned the so called app developer. Just learnt backend-application development and HTML, JS and CSS web development
combied all those and became fullstack
Probably lol, I mean kotlin is also quite persuasive
Javafx isn’t even that hard
depends
you are probably not even handling with webservices and design patterns just like MVVM
I mean, I think I'm the best kid living inside country.. I'm just 15 years old and I know the concept of progamming and other stuff.. I feel proud about it
.-.
Web servers I will be
smoochie
Yeah that’s it’s a good starting age
inside what country?
You could write a small shell script that downloads zulu (https://www.azul.com/downloads/?package=jre-fx) and runs your jar using the just downloaded JRE. I am fairly sure that zulu supports JFX natively
hm
Hello! How to get the instance of SimpleCommandMap?
In order to be able to register() a command
Have you used this before?
nope, but from looking at it it looks like a standard OpenJDK which I have used before
Hi.. im try to make changes in craftbukkit but have this error on compile..
the error says about "implement the inherited abstract method" but the method is implemented in CraftEntity (all the class with the error use extends of CraftEntity then dont know why still show the error
not at all. You are supposed to download it automatically via a script on the user's machine, unpack it and invoke your JFX-dependent jar via that JRE
Is this new Library Loader feature only in 1.17 or is it in 1.16.5?
Believe 1.17 exclusive
Yes
Okay, it seems like it'd be really useful to use with Hibernate/H2 etc to reduce jar sizes. But I also currently support back to 1.14
Oh nice, that looks like exactly what I'm looking for
(:
Is this what you mean @ivory sleet https://github.com/slimjar/slimjar
I use Maven and there doesn't seem to be any Maven documentation for it
You know good plugin to disable phycics (water,lava,gravel,sand,itp)?
@slow oyster oh yeah my bad it’s hardcore gradle (since it uses a gradle plugin)
What is support ecoenchants?
Contact @covert valve
Discord link pls
@ivory sleet know of anything similar for maven
Hmm sorry I don’t
im trying to test something but its too big for my shitty pc
how could i try it anyways?
i already crashed my server, 6 times out of 7 attempts xd
What are you trying to test?
Hmm surely there has to be a runtime dependency downloader library somewhere
yes
block.getLocation().add(1,1,1).getBlock().setType()
forEach Blockface
but i would have to do that for each block
like 25 times
if its 5x5
blocks have faces?
I just used shadowJar to do it and works!
You shadowed in the JRE?
Hey! Quick question: I'm in the process of creating something that places a few blocks. Among these blocks are glass panes. I would like to work with multifacing for the glass panes in order to connect them with the surrounding blocks. I have already programmed the following:
BlockData glassData = glass.getBlockData();
MultipleFacing facing1 = (MultipleFacing) glassData;
facing1.setFace(...);
Which blockface value must be set to connect the slices to all blocks?
Does somebody have any expierence with gradlew? I cannot use gradlew at all in my cmd line, every time i do this error shows up:
https://paste.md-5.net/itonalixoj.cs
Like something is wrong somewhere in general
I can run gradlew with or without arguments and the same error keeps popping up
what gradle version is this ?
how can i check this>?
also did you modify your ~/.gradle/gradle.properties
na i dont think so
gradle --version
ive never touched them
to get the verison
as far as i know
No
Screw them they can download java themselves
Gradle 4.9
------------------------------------------------------------
Build time: 2018-07-16 08:14:03 UTC
Revision: efcf8c1cf533b03c70f394f270f46a174c738efc
Kotlin DSL: 0.18.4
Kotlin: 1.2.41
Groovy: 2.4.12
Ant: Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM: 16.0.1 (Oracle Corporation 16.0.1+9-24)
OS: Windows 10 10.0 amd64
Oh also
I have a jre 1.16
But i heard you need to have 1.8
Can that be the case?
idk I am running gradle 7.1.1 with 16.0.1 adopt jdk
wrappers are overrated
not using the wrapper leads to bigger issues
hmm, maybe it is like gradle is a compatibility trash can that redefines how they do things every other day
in 90% of cases it is gradle and java on agreeing on stuff
KK im on latest gradle now
can it start your daemon ?
does using gradlew help ?
e.g. the project you are using, running what geol suggested
I cant do anything with gradlew
The same error
So what should I do?
It worked before tho
It just stopped working at some point
I dont remember me messing up anything tho
well check your systems gradle.properties
~/.gradle/gradle.properties
maybe that file contains some funny properties
~ not regocnized
are you on windows ?
yep
C:\Users\<username>\.gradle\gradle.properties
or %userprofile%\.gradle
$HOME/.gradle reigns supreme
gradle.properties is not exactly in gradle folder
its in another subfolder
but idk where xd
I mean or I just dont have the properties
btw, is it possible to make custom entity extending EntityInsentient render as armor stand on the client side?
Hey! Quick question: I'm in the process of creating something that places a few blocks. Among these blocks are glass panes. I would like to work with multifacing for the glass panes in order to connect them with the surrounding blocks. I have already programmed the following:
BlockData glassData = glass.getBlockData();
MultipleFacing facing1 = (MultipleFacing) glassData;
facing1.setFace(...);
Which blockface value must be set to connect the slices to all blocks?
@eternal night I tried to just type gradle in my cmd and it started a daemon but the build failed:
FAILURE: Build failed with an exception.
* What went wrong:
Executing Gradle tasks as part of a build without a settings file is not supported. Make sure that you are executing Gradle from a directory within your Gradle project. Your project should have a 'settings.gradle(.kts)' file in the root directory.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 9s
I understand that but its talking bout a root directory
wheres exavtly the root directory?
root directly of your project
I have 2 gradle places
I mean how is it even associated with any of my projects I just wrote gradle in cmd line
without doing anything first
yes that doesn't work
running this in a dir without a gradle project obviously fails
because there is just no project
i ran it in my project folder, something is now going on
i mean the build is in progress
sweet
In fg3 and in fg4
yeah but gradlew fails
And Idk how tf im supposed to get the wrapper
I mean i dont even understand what it is
gradle wrapper --gradle-version 6.0.0
should create a wrapper for you
in the project
how to get player from InventoryMoveItemEvent
@grim ice not possible, because no user interact with that event..
Called when some entity or block (e.g. hopper) tries to move items directly from one inventory to another.
How to prevent a player from moving a itemstack in his inventory?
oh
can you explain?
i dont understand how am i supposed to use this for that
declaration: package: org.bukkit.event.inventory, class: InventoryClickEvent
the documentation is rather clear
How could I make it so I can give myself an item with custom NBT tags, and then check what those tags are set to later?
PDC
uhm
You have linked me the wrong link
this is InventoryClickEvent, not Interact
?
inventory interact is an abstract parent class
which, afaik, cannot be listened to
so
quick q: does anyone know if there is a utility method to quickly check if a location is under open sky or if there is a block above it?
@EventHandler
public void onmoveeee(InventoryClickEvent e){
if(e.getCurrentItem().isSimilar(Star)){
e.setCancelled(true);
u think this would work?
Okay yea I downgraded and everything keeps failing and I'm pretty done I've been on it for like 5 hours and I'd want to just burn my pc at this point
Like something is VERY VERY fcked
some where
I know there’s a method in nms magma, doubt exposed in api
Lol
probably
give it a tryyy
okay
@eternal night Im sorry for the ping, but im making a plugin that involves gui so it uses the same event to check if the item is clicked
and if i make it cancel the event when clicked it will break the plugin right?
i just want the player to not be able to drag the item to his inventory, but he should be able to click it]
No it wont
You need to cancel the event after certain checks (to detect if the inventory clicked was your gui)
So you cant move things around
You can check if the inv clicked was ur gui by checking for a certain title or some other way
Well thats not a good check since the same itemstack can be anywhere
Okay in that case ur right
so whats the problem?
You can still move stuff around?
Any errors?
If you cancel the event then he cant
he can't if i close the inventory right
oh
will
e.getWhoClicked().closeInventory();
stop him from that
@paper viper Wait, that wouldn't work for custom NBT tags given by the /give command, for example, or would it?
Or vise versa?
if (e.getClickedInventory().contains(Go)) {
if (e.getSlot() == 7) {
if (e.getWhoClicked().getInventory().contains(new ItemStack((Material.AIR)), 1)) {
if (e.getWhoClicked().getInventory().contains(new ItemStack(Material.DIAMOND, 8))) {
if (e.getWhoClicked().getInventory().contains(new ItemStack(Material.PORKCHOP, 16))) {
e.getWhoClicked().getInventory().removeItem(new ItemStack(Material.DIAMOND, 8));
e.getWhoClicked().getInventory().removeItem(new ItemStack(Material.PORKCHOP, 16));
e.getWhoClicked().getInventory().addItem(new ItemStack(Material.PIG_SPAWN_EGG));
e.getWhoClicked().closeInventory();
}
}
}
}```
that is my code right now
I want the player
What?
to not be able to drag stuff around when he trades the items
Hmmm, it doesn't seem to be
Never thought of that actually
That's what I want