#help-development
1 messages · Page 1861 of 1
Yea i see what he meant now
it does matter, that was his whole point
plus that is more or less the standard
As in, it works for pre-1.17 to not have remapped classifiers, so I was thinking he meant the program is gonna get fucked or wat for not using it
how can i show a block fracture at a certain location?
Now I get this
Ok the import works, right step forward lol
what is a block fracture?
the display of a block breaking
would you want to work with a project that is a, ab,ab..., zb,zc? i doubt someone would want to work with it
ah. I think you can only get it using NMS
I wont, im using the remapped versions myself lol.
alr, and how would i do that exactly?
then thats the point of remapping :p
no idea, sorry 😄
As in my point was, you probably wont die not doing it, since you have not been dying pre-1.17 trying to do it.
its alr!
so, who knows how to display a block crack using nms or protolib (if possible with protolib)?
I don't think so
<classifier>remapped-mojang</classifier>
then switch to using it 😛
^ insert this line to your spigot dependency in pom.xml
well there's more needed than just that
He said he built it
my blog post about remapped: https://blog.jeff-media.com/nms-use-mojang-mappings-for-your-spigot-plugins/
With buildtools
ok
yeah but special sauce is needed too
check th elink I sent above
ok
bruh I just realized that launchProjectile() doesn't require a Vector I am dumb it would have worked better without it lol
Specialsource is only needed after compilation
new type of link spotted?
elink!
if you want to run it manually, sure. but who wants to do it manually when maven can do it automagically?
F
Even the "automagical" method comes after compilation i think
Package phase or around that time
it's on compile stage IIRC
oh yeah, it's package
but package is the step that gives you a .jar anyway
noone will ever only compile but not package a plugin
ok ran build tools and added classifier but now I can't find entityenderman
His problem is trying to use bukkit's World instead of the nms one
It is now just Enderman
So how to fix the enderman
anyone know what protocollib packet is used for when a blockstate updates?
Weird show pom.xml, specifically the spigot dependency
ok
does anyone know how i can show a block fracture to a player?
You still dont have the remapped classifier installed im afraid
Did you use the --remapped flag
yeah
I copied the whole command from here
Maybe reloading the ide can solve the problem
Check your .m2 directory if the remapped mojang jar is there
.m2/repository/org/spigotmc/spigot/1.18-R0.1-SNAPSHOT/
You mean the directory where I used the command?
Not that
(the .m2 directory should be located in your user home)
oh ok
The remapped jar changes most of the names that you are likely accustomed to with normal NMS.
I found this one
yeah that imports it
did you reload the pom changes ?
Yeah I can find it there
Yeah
https://pastebin.com/xASLXttL could someone tell me why some of my messages in the chatResponse() method are sending twice?
What messages are being sent twice?
Also, is there anywhere else you are calling your chatResponse method?
nope
how can i create a bossbar?
Bukkit.createBossBar ?
Constructor of enderman consists of two parameters
Still, what messages are sent twice?
creating an nms custom entity without understand the api/nms *uff
is there a way to get the default values, or is there a list with the default values? https://hub.spigotmc.org/javadocs/spigot/org/bukkit/attribute/Attribute.html
declaration: package: org.bukkit.attribute, enum: Attribute
is there a better way for running db queries async every time than just calling the bukkitscheduler?
i believe someone wanted it to get added at Material class ^^ take a look there
even when I changed it, it tells me expression expected
CompletableFuture :D
Do you know java? That's a class, not an instance of a class. Capitalization matters!
depends
i saw people telling to use a callback but im not sure if that would work
You could use a Dedicated worker thread (or worker thread group), just beware that this might have unforseen consequences
Would your method after query need to be synced with server tick?
I didn't notice that, but still I got the old error again
Check enderman's constructor
my method puts the retrieved object from the db into the cache and returns it
What comes after kind of matters
what is wrong here? java manager = ProtocolLibrary.getProtocolManager(); manager.addPacketListener(new PacketAdapter(this, ListenerPriority.NORMAL, PacketType.Play.Client.BLOCK_DIG) { @Override public void onPacketReceiving(PacketEvent event) { Player player = event.getPlayer(); PlayerStats stat = playersStats.get(player); event.setCancelled(true); stat.mineBlockEvent(event); } });
org.bukkit.plugin.InvalidPluginException: java.lang.NoClassDefFoundError: com/comphenix/protocol/events/PacketListener
Caused by: java.lang.NoClassDefFoundError: com/comphenix/protocol/events/PacketListener
?paste
smh paste thing says something wrong
Isn't that the first half life level?
Unforeseen consequences
this is basically what i'm doing rn
https://paste.helpch.at/iceyavaceh.java
yes
thats the entire error
it takes an NMS world, not a bukkit world
obviously
NMS will not use bukkit worlds^^
here is the full error https://paste.md-5.net/ajadebipiq.sql
How can I find NMS worlds
I assume it is #getUser(UUID)? My question was more of what are you gonna do with the user afterwards
((CraftWorld) world).getHandle()
I'm having a hard time following your code. I see what you are going for, but I don't see your re-entry points for these checks.
Walking through the logic, if they are in the map and type the string "null", they will be sent an error message. Like, are they supposed to keep typing things until they pass the check? Where's the reprompt saying you messed up, try again?
is there something wrong with returning something from a method async?
nothing, but what you do with it afterwards determines how you might want to async it
hello? (full error: https://paste.md-5.net/ajadebipiq.sql)
add protocollib as a depend or softdepend
Not taking but 5 seconds to look into the suggested completions, is a #getWorld method.
super(((CraftWorld) world).getHandle().getWorld())
how exactly do i do that?
i'm doing all my db stuff async
plugin.yml > depend: [ProtocolLib]
but you were asking how you should do it right?
yes
k
yep so for example, if you are not going to perform anything in sync with the server tick (like placing a block etc.), then CompletableFuture is a good candidate.
I feel like you can use cf anyways, even if you intend to have those operations lol
done, now what?
done
and what about the bukkit scheduler?
install the new jar and try
wdym install the new jar?
bukkit scheduler has this not-so-good thing of not being able to return values
I may be wrong, don't quote
anyone here has some experience with armorstand animating with packets?
so, most of the time I prefer cf
so i install the latest version?
Yes exactly
what
to be honest, im not very fond of this code due to how messy and complicated it is. do you know of any other better solutions to my problem?
so return CompletableFuture.supplyAsync(supplier)?
where the suplier will handle the db stuff
if the bukkit scheduler would return values, then it'd be blocking in principle
so passing callbacks here and there is quite necessary
sadly chat responses are kinda painful to code
i dont know how to use them : (
and messy
That's why I asked how are you gonna use these User instances
if you goal is just to use them in chat
chances are you don't need bukkit scheduler
just completablefuture till the end
completable future is as confusing as useful for network/db stuff
i'm getting them for different uses
like when you need a user object for like chat channel things, it checks the cache and the db and immediately return the user and does stuff with it
I got a nice class if you want to create reactive actions based on users chat messages if that was what you needed
done, now what?
lol..
Well you could try playing around with the Conversation API. I think it can be used for things like this, but a better approach might be just having your logic in the AsyncPlayerChatEvent.
That way you only need one map for players that are currently in "typing" mode and can work off that.
not sure what you mean by "reactive actions based on users chat messages" i just need something that will ask a player a prompt and then the player types the prompt in chat
they are god tier 😄
yeah i looked into the conversation api. looked complicated
it is...
sadly
totally understand why most people still use AsyncPlayerChatEvent
conversation is probably useful for rpg where you chat with npc or the server or anything other than player i guess
hey, i'm having few issues animating with stands, as you can see the more i shrink down the circle the shakier the animation gets. How should I handle animations so this stuff doesn't happen? https://imgur.com/a/MYhgLRC
the wiki doesn't tell me how to use plugin messaging on bungee
my objective is creating an item that rotates on itself
@quaint mantle i get an error from int status = container.getIntegers().read(0); (error here: https://paste.md-5.net/wokeredipu.rb)
code?
use container.getBlockPositions or something
but
wat
playerdigging has an in
instead of the pos it takes 3 doublesiirc
wait a minute
or maybe it was another packet
hmmm
i yeeted out protocol a while ago
what ver r u on blinky?
ok so it takes a block position
latest
or is it the wrong packet
that should be the right packet
send me the url kill
here you try to read an integer
armorstand animating
thats not the same url as i was usin :desolate:
send yours
yea you can treat it as an int
btw what do you need this packet for? I can't think of any use
maybe custom mining?
yup
net.minecraft.server.v1_16_R3.PacketPlayInBlockDig@45d86a2b[
a=BlockPosition{x=-167, y=63, z=-234}
b=up
c=START_DESTROY_BLOCK
]
doesnt match it
whats c?
an enum of some kind?
so im trying to use nms for nbt data but it seems like ItemStack.hasTag() and ItemStack.getTag() dont exist anymore?
or am i stupid
@quaint mantle what the heck is 'c' here? an enum?
net.minecraft.server.v1_16_R3.PacketPlayInBlockDig@45d86a2b[
a=BlockPosition{x=-167, y=63, z=-234}
b=up
c=START_DESTROY_BLOCK
]```
yes, i think
You shall look at mc sources or wiki,vg
tried that
for creating a bank with vault, what's the difference between #createBank and #createPlayerAccount ?
2 different pages with 2 different fields which didnt match with that
and also whats the enum type? byte?
Hello, what versionbof java i use for Minecraft server 1.8.8?
java 8, #help-server
and (again) how do i compare it?
@quaint mantle tried lookin on the wiki and the fields dont match, so:
- how do i get c (as in .get||[insert type here]||())
- how do i compare it with something else?
The packet methods are generally pretty nasty, they aren’t APIs for developers to work with
You’ll have to figure out what the appropriate method name is
Where i download It? I have java 17
If there isn’t one you’ll have to use reflection
Java 17 should work fine
Im installing fawe and dont work
What does your error say
for spigot 1.8.8 you can't use java 17
Higher Java versions can be used to run applications compiled for an older version of Java
The reverse is not true
Newer versions of spigot has java checks preventing usage of newer java
help me for can use fawe please
i were 4 hours trying it works
for know the function of your plugin and if i like it i will download
its not even released yet XD
@worldly steppe in this case it appears that the plug-ins themselves are requiring Java 8, so you’ll need to use Java 8
for when it will be released i will download
You have to get an installer for Java 8 and run it
send me directly url for download please on the page i enter for download are like 1000 options and i dont know
For all those people who find it more convenient to bother you with their question rather than to Google it for themselves.
Just Google it
It’s the first option
Thdre are many
@quaint mantle how do i get c and how do i compare it?
dude, do you not know your operating system? and also for the 3rd time
windows x64
I already answered this above, if you can’t figure out how to look at the methods of the class you probably shouldn’t be messing with NMS yet
it is strange that the Windows distributions use .tar.gz though
PathfinderGoalSelector doesn't work for me
well its an enum
can plugin messages be faked by client?
depends on if the client has the ability to send plugin messages
umm, isnt the channel open between player and server?
in which case it might not matter
since the server verifies a lot of what is sent by the client
so i don't have to worry about players faking plugin messages?
if u dont know then don't reply
uhhh no
I'll reply if I feel like it
thanks
I still have a bit of knowledge to give regardless of whether or not I know the full answer
like how server security works in the first place
.
ah
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
this appears to be just between the server and itself/proxies
not client and server
it is possible that it isnt a network and it isnt bungee
Here’s the way it works:
Client can send plugin channel messages to server, server can send plugin channel messages to client
Bungeecord piggy backs on top of that protocol for messages the server sends to the client that are tagged for bungeecord
alex c is some sort of enum
The client can send plugin messages but it can’t pretend those messages came from the server
but i dont know what type
Then you would compare the value against that enum
Look at the class
i am trying to make proxy enable proxy mode on spigot servers
its bad if someone fakes that
eh you go ahead and explain that shit to Tree then @brave sparrow
I have too many questions
The client can’t fake it @vestal moat
even when there is no proxy at all?
there are 2 wiki pages with 2 different inputs and both are different
Why would you be using a bungeecord channel with no bungeecord
Brb actually
who knows? maybe user uses proxy? or maybe not
whats the difference between PreparedStatement::executeUpdate and ::execute? i'm updating stuff in the db
I'm at a loss. Everything in this method is returning something valid. Even the #grant() method is returning that it's been granted. This has led me to believe one of many things.
- Maybe my namespaces are improperly setup.
- There is another packet I should be using. (Which I'm currently unaware of)
- There is another packet I should be sending alongside the current one. (Kinda how you have to send the TIMES packet alongside the PacketPlayOutTitle if you still send titles that way)
- I'm missing a crucial part of the advancement packet. Maybe I've just created it improperly and it's not functioning to its fullest.
- The functionality of advancements have changed somewhat between 1.16 and 1.18
- Advancements in 1.18 are just broken.
https://paste.md-5.net/gixepogaqo.java
hey! for some reason, my vault dependency is not loading
there is no way that the client is being verified as the server
this is my setupeconomy method:
if (!setupEconomy()) {
this.getLogger().severe("Disabled due to no Vault dependency found!");
Bukkit.getPluginManager().disablePlugin(this);
return;
}
private boolean setupEconomy() {
if (Bukkit.getPluginManager().getPlugin("Vault") == null) {
return false;
}
RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
if (rsp == null) {
return false;
}
econ = rsp.getProvider();
return econ != null;
}```
and for some reason, it says that is not loading
i mean owner not user, sorry
what kind of owner? the server owner? is also just a client
Quite simple. Either you don't have Vault in your plugin's directory or you have an outdated version.
You can get the latest version here: https://www.spigotmc.org/resources/vault.34315/
server owner
maybe its just a server not a network
i have the last version, and it is in the plugins folder, look
/about vault?
Is Vault a dependency in your plugin.yml
If it's not Version 1.7.3-b131 then it's not the latest. You also want to make sure that you have Vault as a softdepend in your plugin.yml.
i have it as depend
What is your economy plugin
i downloaded the latest version and keep the same error
you mean the one i created?
I mean what economy plugin is installed on the server
Do you have one that you created? That actually integrates with vault? Because Vault needs an economy plugin like EssentialsX in order to be loaded for some reason.
mine, minespaceskills
So that's why there is an error
You're not registered as an economy plugin
oh
You wanting to see code for it? Or a plugin for it?
So there is no economy plugin that vault knows, which means setupEconomy fails
how can i make my plugin so vault knows it?
Issue with this wont load as a plugin.
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
🤷 from what I know they're just hardcoded in to vault. Google it
oh, thanks !
Well you’d use the Chat listener, Then you’d check the string of the message for [item], then do your null checks.. and if the player has an item in hand use the #replace() method to change the prefix to the item name?
Of use that ^ 😂
You have to make your plugin act as the economy provider. Which means that you now have to create a class that implements Economy and handle all of those methods. Or alternatively you could install an economy plugin if your plugin isn't going to handle all transactions from every plugin on your sever.
Here's the javadocs for Vault if you are going to make your plugin a provider.
http://milkbowl.github.io/VaultAPI/
@EventHandler
public void onChunkLoad(ChunkLoadEvent chunk) {
if (framePlaced && (chunk.getChunk() == blockChunk)) {
frameLocation = location.clone().add(0.5, 1.03125, 0.5);
frameLocation.setPitch(-90);
if (spawnFrame()) {
itemFrame.setItem(frameItem);
} else {
framePlaced = false;
}
}
}
If statement still not evaluates to true when chunks values are the same. But i have the exact same statement for a ChunkUnloadEvent and it evaluates to true
please see #help-server
wait, how many things can you use components with?
just messages or do item names also work?
Internally everything is chat components
This is why string based methods are deprecated in Paper
Yeah both are just api versions of mojangs chat components
Anyway in spigot the chat components are pretty limited to chat
Maow's list of reasons why Bukkit is bad: <pending but you best believe that's gonna be one>
Spigot could use more man power
you mean contributors?
Yeah
I'd love to do that
but I'm like
ill
rn
and I have a project that I'm actually supposed to be working on
that other people are depending on me for
that is also Spigot related
anyone know what c is here?
net.minecraft.server.v1_16_R3.PacketPlayInBlockDig@45d86a2b[
a=BlockPosition{x=-167, y=63, z=-234}
b=up
c=START_DESTROY_BLOCK
]
well probably an enum
have you tried seeing what the PacketPlayInBlockDig::toString method does?
How would one change the light level of a block without changing it to the LIGHT material?
i know it is an enum, but not what type of enum
you should probably look at the toString to see what field it's printing after c=
you can then track that field back to its type
to see which enum it is
I know in intellij you can hold Ctrl and click on the enum to see what class it's in and what datatype it is
Block face (if I remember correctly)
i think thats what b is
c is an Action
sadly i only know the client-sided names for this stuff tho so
i downloaded essentialsX and says that rsp (A method is null)
hey can someone gimme a bit of help with worldguard?
blocked-cmds flag just does not work.
it sends the 'this command is not alolwed in this region' and still runs the command anyway.
I'm using worldguard 6.2 for 1.8.1
no errors in the console btw
this is what happens on using /spawn
Right, there’s no registered service implementing Economy
Is your /spawn command using an event rather than a command executor?
de-op yourself?
It seems unlikely that if it was permissions allowing them to bypass the restriction that it would still tell them the command is blocked
i added essentialsX
that is a economy plugin right?
so, what plugin could i use?
EssentialsX should work
it says setPermission
not economy
should i delete setPermission as i'm not using it?
Yeah
is there a way to remove the anti knockback netherite armor gives people?
you can use Attribute and generic_knockback_resistance i guess
how do i get an enum from a field
the type is EnumPlayerDigType
how do i get c from here?
net.minecraft.server.v1_16_R3.PacketPlayInBlockDig@45d86a2b[
a=BlockPosition{x=-167, y=63, z=-234}
b=up
c=START_DESTROY_BLOCK
]
is that even java
That’s not the class
Those are the fields of the class
What are you using for an IDE
eclipse
so the code would be EnumPlayerDigType digType = PacketEvent.getPacket().get???????();
what replaces ????????
is it Byte?
Im trying to setup spigot 1.18.1 for 1 hour now, can some1 explain it to me?
I used Java 17, did not work
I used Java 16, did not work
No, the spigot api
intellij idea
kk
is there any way i could run a method in game?
I think all I need is the correct java version + the build.gradle
like if i wanted to make a /plugin:execute <function with params> command
I mean yes but why?
What are you trying to do
Okay, I want to setup Buildtools, if I type java -jar BuildTools.jar --rev 1.18.1 the following error appears:
Found version
{
"name": "3388",
"description": "Jenkins build 3388",
"refs": {
"BuildData": "f31eb04b918592f66c6edd17c9b5998383581ae5",
"Bukkit": "129c3c540c6394cf80ed066e45ef09abd21cd448",
"CraftBukkit": "fb92f345d941cbee4aaa9ca6c0178ad02b16f2e8",
"Spigot": "9fd34ab9cabf8e5c4881a718dabe836cbb5ffb27"
},
"toolsVersion": 138,
"javaVersions": [61, 61]
}
*** The version you have requested to build requires Java versions between [Java 17, Java 17], but you are using Ja
*** Please rerun BuildTools using an appropriate Java version. For obvious reasons outdated MC versions do not supp
i wanted to make a thing for debugging and stuff
Well unless you want to mess with reflection I would just directly call the methods in the command executor
Hi anyone know how to execute a Spigot server with a specific Java version??
Because my networks has an 1.17.1 survival server and i cannot execute without Java 17
And i cannot execute 1.8x server without java 1.8
BTW
anyway does anyone know what function id use to get c?
anyone knows how to get the 1.18.1 jar with the actual good stuff in it, since like the thing i get from build is useless, i saw people saying i need to extract stuff
What is the best way to get donations. I mean a link. And not paypal
Wrong channel
Ok sorry
anyone?
i was wondering if anybody knew how some servers get that black fade in fade out affect when teleporting?
it can be seen on like, mineclub
i can try get a gif, hang on
hello, what code i use for my start.bat for spigot? i want to specify an location where java is, because i have java 8 and 17, can someone send me the command for write on the start.bat? i were searching me and someone else 1 hour 30 min and nothing
where is java installed on your computer?
%PATH_TO_JAVA% -Xmx4G -Xms4G -jar server.jar
"C:\Program Files (x86)\Java\jre1.8.0_311"
"C:\Program Files (x86)\Java\jre1.8.0_311" -jar server.jar
try that first
assuming your jar name is server.jar
and the xmx?
try this first, make sure that works
help, how can I setup BuildTools for the 1.18.1
java -jar BuildTools.jar --rev 1.18.1 does not work for me
dont works
you gotta download java17
I have
ok make sure you use that one instead, instead of writing java -jar you gotta use %PATH_TO_JAVA_17% -jar
so find where java17 is installed
okay
write pause on the second line
C:\Users\Miguel\Desktop\LorigaCraft Network\Lobby>"C:\Program Files (x86)\Java\jre1.8.0_311" -jar spigot.jar
""C:\Program Files (x86)\Java\jre1.8.0_311"" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
C:\Users\Miguel\Desktop\LorigaCraft Network\Lobby>PAUSE
Presione una tecla para continuar . . .
anyone have a list of MC permissions?
add \bin\java after jre1.8.0_311
in your start.bat
how lol
so it should be like C:\Program Files (x86)\Java\jre1.8.0_311\bin\java
second image is correct, just wrap it in quotation marks "
before -jar add -Xmx6G -Xms2G
nono
but feel free to change the numbers appropriately
you already have something listening on that port
I cant use -jar
ohh
it has to be the path to the executable
"C:\Program Files\Java\jdk-17.0.1\bin\java" -jar BuildTools.jar --rev 1.18.1
how i see what is?
task manager
i dont know what is occuping the port
with \java.exe it does not work too
are you sure that's the right install path?
you literally save my life i were im really not exagerating 7 hours with that and dont works im very grateful.
C:\"Program Files"\Java\jdk-17.0.1\bin\java.exe -jar BuildTools.jar --rev 1.18.1
now i try the xmx
that should work
i love you <3
like nohomo but yk what i mean lol
yeye
me also ☻
npnp
for use fawe on lobby, im not doing very very big constructions
what ram you recomend me to put?
imagine, the maxium blocks i will do by one time will be like 100000 but small posibility
and the badje
but fawe renderize chunks and dont do lag
*badge
how many ram can i put? @digital drift
ok tsmmm
Hox can I get these imports?
Are you using Maven or Gradle
Gradle
?bt First run BuildTools and build 1.12.2
I just installed buildtools for my 1.18.1 spigot project
Those imports are for 1.12.2
Yes, but I think it should be possible with the 1.18.1 buildtools too, right?
And also idk why but I cant use BuildTools
Look, it got installed
That's 1.18.1
It won't work for those imports
Im just watching a tutorial
...
I think the 1.18.1 should have similar imports
NMS changes a lot
how do i calculate the relative ^ coordinate if i have player object>
okay, but I still dont have it for the 1.18.1. As you can see, I installed it but I cant use it
Wait I just noticed are you just trying to set header and footer
what?
The import is for the PlayerListHeaderFooter
https://github.com/The-SourceCode/Advanced_Bukkit_Coding/blob/master/Episode_24/TabList/src/me/tsccoding/pretutorial/PreTutorial.java
I want to recreate this
But my problem is, I cant even use BuildTools in my 1.18.1 spigot project
You don't have to do that anymore
Boolean parameters in the PotionEffect constructor
Use player#setPlayerListHeaderFooter
- I still cant use BuildTools even after installing lol
You already used BuildTools
This screenshot shows that you used it and it worked
BuildTools isn’t an API
^
It’s a program that generates a spigot.jar
Also those imports won't work unless you're on 1.12.2
yea, thank you
BuildTools is just as the name suggests a Build Tool for creating the spigot jar
okay
what version are you on?
1.13+
look at the LocalCoordinates NMS class
Relative coordinates to what
So, if I use player.setPlayerListHeaderFooter(); the Strings are my text lines and I can animate them with the timer, right?
You don’t need NMS
Yeah
i know, but im telling him to look at the class because thats the one with the code
Vec2 var1 = var0.getRotation();
Vec3 var2 = var0.getAnchor().apply(var0);
float var3 = Mth.cos((var1.y + 90.0F) * 0.017453292F);
float var4 = Mth.sin((var1.y + 90.0F) * 0.017453292F);
float var5 = Mth.cos(-var1.x * 0.017453292F);
float var6 = Mth.sin(-var1.x * 0.017453292F);
float var7 = Mth.cos((-var1.x + 90.0F) * 0.017453292F);
float var8 = Mth.sin((-var1.x + 90.0F) * 0.017453292F);
Vec3 var9 = new Vec3((double)(var3 * var5), (double)var6, (double)(var4 * var5));
Vec3 var10 = new Vec3((double)(var3 * var7), (double)var8, (double)(var4 * var7));
Vec3 var11 = var9.cross(var10).scale(-1.0D);
double var12 = var9.x * this.forwards + var10.x * this.up + var11.x * this.left;
double var14 = var9.y * this.forwards + var10.y * this.up + var11.y * this.left;
double var16 = var9.z * this.forwards + var10.z * this.up + var11.z * this.left;
return new Vec3(var2.x + var12, var2.y + var14, var2.z + var16);
}```
@vale ember
not really
i believe var1 is a 2d vec of (yaw, pitch) or the reverse... not too sure which
var2 is just the location of the player
the rest is just vector math
Help
um so var1.y is yaw or pitch?
i believe var1.x is yaw and var1.y is pitch
and if it doesnt work
then just reverse em
(corresponds to xRot and yRot in the entity class)
And then bukkit has its own Vector class you can use for the cross product
0.017453292 is Pi/180 as well
its the same as Math.toRadians
actually i want to calculate it only for specific axis (x, y or z) depending on passed argument, so i don't think vector will help me
huh?
double toValid(@NonNull final Player player, @NonNull final String string, @NonNull final Axis axis)
you can still use this
Bukkit.getPlayer
is there a site that compares mappings of all the diff services like mcp yarn mojmap etc
Something like this ? https://timcloud.ddns.net/mapping/
if I recall MiniDigger has a much better website for it
This only does Mojang to Spigot and Spigot to Mojang, but supports many more vers https://minidigger.github.io/MiniMappingViewer/#/
MiniMappingViewer
And prints errors all the time I were using it ... That's why created my own tool ... Also useless to not know obfuscated names
Explain MCP and yarn
yarn is fabric mappings and mcp is... mcp mappings
i thought maybe someone here had an all-around mappings viewer
Well if there is an mapping-file for translation I can add this too
if someone have a little bit free time, can you say, if this will have big impact on perfomance?: https://paste.md-5.net/naxoxegiqo.cs (a little bit off context, but still)
When i create a Plugin with maven, is craftbukkit automaticly included? Because of the license
Looks very difficulty... Do you just want to have the tabcompletion feature ?
hey, i need some help. for some reason i can't start MySQL server in XAMPP and in the logs it doesn't send any error, could someone help me?
There are 20 errors listed in the screen
yeah, it is, i am making annotation-based complex command creating api, i just wanted to know if loops will have huge impact?
what?
Depends on the size of arguments but I do t think so
not too much (< 5)
i checked the logs and didn't find any error
Port, dependencies ...
uhm i didn't delete nothing and before were working
Try google, either way this isn't the purpose of this channel.
?
Wdym included
It would be compiled with your plugin if you told maven to do that... Which you shouldn't.
If you set it to provided, then it won't be.
I didn't Set anything
should abbreviation names be all uppercase? like class GUI or Gui
personally id use all uppercase, not sure if they have something for that in conventions
https://stackoverflow.com/questions/2236807/java-naming-convention-with-acronyms this has a good answer in my opinion
the problem is that java mix them, and i am really confused, like XMLFormtter and HttpClient
Weird
This is what I see in that post, basically what I follow https://cdn.rackdevelopment.tech/img/rdE96fvSSO.png
How are you building this
I Just build IT with build artifatcs

has anyone here worked with tokenenchant and made a custom enchant? If so how the fuck do you get stuff from the config? It's such a bad system and I just wanna get 1 value...
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
dont use the build artifacts
Why?
I know but i do not know how to so that
the maven tool bar on the right corner
would be here, but say maven
Might be a bit different, not sure of IDE changes ive done
Is there a good Tutorial fro maven?
there's https://www.spigotmc.org/wiki/creating-a-plugin-with-maven-using-intellij-idea/ but it doesnt go too much indepth
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
youtube is prob a good place to start
OK thanks
Full class, so we have the correct line numbers
Probably using getInstance(), and then from there you can use the plugin's object to get any configuration file you need.
I keep getting a null pointer exception from this line, I think I've covered everything but I cant find the null pointer
if (event.getAction() == Action.RIGHT_CLICK_AIR & player.getItemInHand() != null & player.getItemInHand().getType() == Material.EYE_OF_ENDER & event.getPlayer().getItemInHand().getItemMeta().hasLore()) {
This is inside a playerInteractEvent
I got it in the end but god i hate vk
What's wrong with that
hm?
wtf &
well thats why
(constructors exist)
I worked out how to do it another way after trying a few different ways and it was annoying
Huh
wdym
should be using two &&
oh duh lolol
i mean you should use &&, not &
Don't use &, return after each statement
Harder to read and debug
Oh ok
It's not wrong but it is better to atleast separate the statements by line so you can know exactly which statement is wrong if something goes wrong
Also yes ik it's personal preference
Just my opinion
Fair enough
Also for a while loop you would want to have them both in one statement
It makes the loop logic easier to visualize
yeah that loop needs work, no method even under that lol
I meant && is definitely what you want for a while loop, you don’t want to have a bunch of breaks inside to replicate that logic if you don’t have to
Just knew I had an operation with && in a specific project for an example
spigot or paper or purpur ?
Never heard of it
yes
Paper. But thats not a developer question
not clean spigot for sure
oke thnks
Hello, this is another thread (yay?) :3
Anyways i have done a whole core system based on stuff being stored in bungeecord(SQLite) and servers are synced through redis messages
well away from that i need your help in the friends command
even though it's easy to create especially that my core has ranks, bans, mutes, etc.. the issue is caching player prefixes, names and colors
I can't cache all of them for just the friends command, a player could have alot of friends i don't want to cache a whole network players for the friendlist and im pretty sure if i query them all the times it will take alot of calculation and time and i need suggestion
How much should I obfuscate my jar?
yes
obfuscate the file name
obfuscate the plugin.yml
Just write your plugin in another language and then when they try to decompile it with a Java decompiler it won't work 
funni
Being serious dont obfuscate your plugin at all
why?
open source your plugin
technically can do this
it wont do anything
That is pointless and will make debug harder
That's too much work retrooper
then dont obfuscate
Why
let users learn from your project code
Hey, does anyone have any idea How I can read out the real time with java and play it back via my plugin?
get the current date
new Date().toString()
It's a prem plugin though...
ok
ok
ok
I put months into this
ok
ok
ok
i put a year into my open source project
md5 put years into spigot
thats not a great argument
How i can do it?
like md said
new Date().toString()
md5 too
Cool kids use the new java 8 time api
how do you think he kept the forum up
Just beware that you do not use the Instant class
Hi, i'm making the nms entity and i want to override movement method from nms. Which method is it in 1.17.1 api?
It is usable for everything, but not timekeeping
I don't think you understand what i meant when I said put money under the table
ok
But anyways
ok
from there?
im serious
Really cool kids use LocalDateTime
send your paypal then

it is a good timestamp
Yes, but you cannot display that timestamp because it misses the timezone field
hm, well. therefor ZonedDataTime seems to be right
I've been doing some stuff via DataInputStream/DataOutputStream lately, and I wanted to ask how high the failure chance is when I use it to read my data with FileInputStream at onLoad and write my data onDisable via FileOutputStream? Like, is it realiable enough that I can put all my eggs in a basket or should I add a few redundancy layers to it?
I've been thinking of putting the output of the DataOutputStream into a CheckedOutputStream and then multiplexing it to 4 or so FileOutputStreams which in turn have their own CheckedOutputStream attached to it, but this surely is overkill
How would a loader work?
if there is a possibility for the data you need to become corrupted or missing, then it is generally a good idea to code in ECC if possible or some sane way to handle such scenarios and everything not implode.
Yeah, I could use real DBs, but I love doing flatfile since I have more or less full control over all the mistakes I do
you don't need a real DB for ECC, you can do it with flat file too.
and with DB's you have full control still as well?
probably I guess
either way, a lot of people don't think about data being missing regardless of the format they decide to save data in
Ok and how i can change it to MEZ?
just use the local time/default system wall clock, it's the least likely to be the wrong one
and how i can do that?
DateTimeFormatter formatter = null; // Build your own one via DateTimeFormatterBuilder
formatter.format(LocalDateTime.now(Clock.systemDefaultZone()));
SimpleDateFormat isoFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
isoFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
Date date = isoFormat.parse("2010-05-23T09:01:02");
Well you got both time and date
how to add/revoke/check if some advancement is done?
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.html#getAdvancementProgress(org.bukkit.advancement.Advancement)
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/UnsafeValues.html#removeAdvancement(org.bukkit.NamespacedKey)
declaration: package: org.bukkit.entity, interface: Player
declaration: package: org.bukkit, interface: UnsafeValues
Well, that'll call when it's completed, but if you want to check if some advancement is done at any time, you'll have to Player#getAdvancement() and invoke the criteria methods there
Beat me to it, ye
#getAdvancementProgress(). I was close
Everything to do with a player's progress is in there https://hub.spigotmc.org/javadocs/spigot/org/bukkit/advancement/AdvancementProgress.html
@graceful turret when going to those links, make sure to bookmark that Javadoc link. In the upper right it has a search bar you can use 🙂
Hey, I'm creating my own entity nms and I need to check if it's in motion. Therefore, I would like to override the entity movement method and call an event. Anyone know which method can be responsible for the movement in api 1.17.1?
How do I get the number of blocks passed through PlayerMoveEvent?
yeah, i have it, but what if I push the entity and it changes position? Then it won't happen. Unless I have to anticipate all such situations and also call an event?
well your other problem is there is no event for entities moving
except for the player of course
no becauss it wasnt my main that ran it, i have an alt that has no perms at all.
its not my plugin.
sorry for the late replies i was out
and im also in the wrong channel my bad
This is not what Saftige was asking for. MEZ is a timezone.
How can I create a registered command from a string in config
Usually having dynamic commands is a bad thing though. What exactly are you trying to do?
If you'd like the date in MEZ, you can do LocalDate.now(ZoneId.of("Europe/Berlin"))
Are you looking for the distance between two points or are you trying to count the number of blocks a line passes through?
thanks
Im making a plugin sort of like my command
where the user can change the name of the command and the contents that the command sends
This sounds like Essentials' customtext command with a lot of extra steps.
Is it still recommended to use the Minecraft Development plugin in Intellij or is it outdated already?
https://plugins.jetbrains.com/plugin/8327-minecraft-development
Minecraft Development plugins are bad, instead, simply set up your own projects
Essentials tends to break alot of datapacks so I try not to use anything from them
How many blocks has the player overcome
it is up to date, you can use it dw
Alright. I'd first make a command which takes some key to send a message with. A configuration file might look like:
mykeyhere:
- "Line 1"
- "Line 2"
- "Line 3"
After loading the configuration up, one could take the first argument of the command and look up the list in the appropriate configuration section:
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
YamlConfigration myConfig = /* load your config here */;
if(args.length < 0)
// error out
if(!myConfig.contains(args[0])
// error out
List<String> messages = myConfig.getStringList(args[0]);
sender.sendMessage(messages.toArray(String[]::new));
}
This is only an example to get you started with. There are some more things you'd want to implement before putting this out in production.
For your users, they could configure a dynamic alias in the commands.yml
Location to = /* ... */;
Location from = /* ... */;
double distance = to.distance(from);
thanks
I already have the onCommand stuff and all the logic setup, I just dont know how to register it so that the player sees blue text rather than red
the examples I and geol provided sets the timezone in two different ways. There is probably like 5 different ways to do it. Just depends which you really need. You can even use the Calendar object.
I know about the commands.yml but id rather the user not have to go and find it in another file. I wanna have it all set in one file for them
The ways provided are not concise and dated. Using the LocalDate class will give the OP exactly what they were looking for in a compact piece of code that is to modern convention. In Java <7 Calendar would likely be the preferred way, but all of that is slowly getting deprecated now.
The user inserting aliases into the commands.yml file is the best way for you to do this. If you want the server to recognize the dynamically configured alias, you'd have to insert an entry into the server's CommandMap implementation.
The last I remember of this, you'd have to do some extremely dirty reflection to get this to happen. You're welcome to browse what is exposed by the Spigot API, though. JD here https://hub.spigotmc.org/javadocs/spigot/org/bukkit/command/CommandMap.html
Not sure what you mean dated. And the example I provided is concise. What wasn't clear to understand from it? Second deprecated doesn't mean unusable. Two different things. Third, it would had been better if you just stated you didn't like the other examples provided and stated the way you showed is the way you like to do it.
He wants to get the Date, not parse it. Your example does not answer the question.
Deprecated means they're taking the feature out of the API in the future. You should migrate to something else. It will not be supported in future versions of the API.
sure whenever Java gets around to doing it, this isn't a new thing. You can use it until you can't no more so just pay attention to when it does get removed 🙂
doesn't make it less valid of code to use in the meantime
I doubt they will remove it anytine soon
Yeah, but in 10 years when you aren't maintaining the code it will be a pain in somebody else's ass. Use the best option for your current version, which is certainly not the much more difficult to use Java 1.2 time classes lmao
yeah let someone else 10 years from now worry about it when you are not even there anyways 🙂
Terrible mindset, this guy probably licenses his plugins under a non-GPL compatible license.
Like, perhaps it will get removed, but If so that will be by next decade
I use MIT
pretty sure its GPL compatible
No it isn't.
It is, go look it up again 🙂
MIT requires virtually nothing which means GPL is the more strict license
But it GPL doesn't hinder what MIT requires either
and that is just credits
GPL is only really compatible with itself
Factually incorrect.
Which is why it sucks
Factually incorrect. It is a great license.
until it touches non compatible code for GPL 😛
Factually incorrect. If you use the Spigot API you must license your under GPL. Since GPL is more restrictive than MIT, MIT is an incompatible license to put your code under.
So I ignore it
Well, until I am sued my license's stand 🙂
This is the issue in your reasoning: you can ignore the law
Dangerous man. If you believe you could fight off the GPL Foundation's lawyers then you're welcome to do so
They don't go after people for other people's works for free XD
Yes they do.
no they don't
Factually incorrect.
is there a way to remove all instances of something from a list instead of just the first found
If anyone defending the GPL would sue Software which uses a permissive license they would be in ??? Territory
alright well you can believe what you want. I don't let randoms tell me otherwise that don't show their proof and just say its fact 🙂
Collection#removeIf
GPL is a good license sometimes, just some are unaware of the ramifications that it means for some downstream parties which most don't consider
The FSF offers assistance and advice to any other copyright holder who wishes to enforce GNU licenses. But we cannot act on our own where we do not hold copyright. Thus, be sure to find out who are the copyright holders of the software, and report the violation to them.
That doesn't say free
Doesn't say paid.
says offers assitance and advice which literally almost all lawyers do if you don't intend to pay them
they will guide you in the right direction but nothing more
Factually incorrect. This guy has never talked to a lawyer before.
You literally have not dealt with law firms have you?
Everything has a cost
unless they are going to do the work pro bono then its not free
Three members of my family are bar certified and practicing lawyers.
sure, and every once in a while they might do some pro bono work for their firm because its good for image
Almost never.
Oh, so they don't work for free either then 🙂
Simply because you are representing someone does not mean that they are the one paying you.
FSF has shit loads of money. They have their own legal team because they can afford it.
Where would they get the Money from?
FSF
No Institution that has Money would Like to Spend it for No good cause
This guy doesn't know what the GPL license is.
The FSF created the GPL license to promote FOSS.
Going after Bukkits MIT Community would severely destroy their image
Factually incorrect.
the last case I can recall FSF being part of, was against Cisco in 2008
You didn't recall that, you googled it.
It would just lead to a Frature betweeen Hardcore GPL-ists and Hardcore MIT-ists
I hate infectious licenses
I use MIT because I understand once I release something open source wise I have very little control to begin with
not that I believe everything should be MIT
Nope, that's just the last major suit that got coverage.
So yes, it would destroy their image
Just because it is the only thing that you could find on Google, doesn't mean it was the last thing that they ever did.
Why would it not
because they have No Image to begin with?
God I hate using discord with a 32 kbits connections
Buy better internet.
I see this BK person is another one of them people
It suffices for IRC, Not my fault you are Not using it
Doesn't suffice when you have to download upwards of 20 gigabytes of data daily. I guess we have different use cases.
"this BK person" lmao
Nothing wrong with it. Your phrasing is unusual.
BK is your name, and you are a person. I am quite positive you are not a bot
If they are a bot, we have issues
Nah I deal with bots the same way certain others act 😛
I just ignore them until they leave 😄
That works I guess
well I don't have powers here so the best I can do 😛
Calling me a person is redundant since it is implied I am a person.
It is unusual to redundantly say things.
except we are on the internet where bots out number the human populace probably like 10 fold
Factually incorrect.
source?
Define a bot.
we already have more devices then humans 🙂