#help-development
1 messages · Page 1817 of 1
what problem?
before you tell why i use old ver , i dont this is only for test .. :
i tried all version
same problem
the api is working and recognized my maven
but the spigot is not
You can;t import both in the same pom. Theres no way for Intelij to know which API you want to use
oh api and spigot
did you run buildtools for 1.8.8?
188, 189 is clientside only
i downloaded 1.12.2 , 1.13.2 , 1.16.5
spigot 1.8.8 you get by running buildtools
api gets downloaded from spigot
run buildtools and build 1.8.8
In that case you need to build the package via buildtools
can you help me fix the problems please?
I assume that #help-server is a better place to ask that question
oh my, are you ignoring me?
Distinguish 1.17 and 1.18 NMS (Maven)
?bt
i just downloaded it .. and its works fine [the buildtools]
thank you anyway ..
Well you also need to run buildtools
wait i have a question
With --rev 1.8.8
thats 1.16.5
^
bt should also install the artifacts to maven local
Are you sure that they are not there
yeah, they are there ...
I don't see what the issue is - you know what you are doing so ???
that seems to fix the issue thanks 😄
would getHighestBlockYAt(x, z, HeightMap.WORLD_SURFACE) be out of ceiling of the nether?
How to use .yml for saving data?
how do i do that with maven?
https://paste.md-5.net/acomomufoj.rb
can someone help? never tried tab complete before and im confused
It tells you in the forum post #announcements
If that is possible on maven it is def. possible on gradle
maven uses teh specialsource plugin to remap
Use paperweight...
no?
i know, i tried but it give me errors when i use 1.17.1
what error
is it possible to have a timespan like "5 minutes", "3 seconds", "2 hours" for a command arg
Yes, but you'd need a parser
"There was a failure while executing work items
A failure occurred while executing io.papermc.paperweight.tasks.FixJar$FixJarAction
Cannot invoke "String.charAt(int)" because "internalName" is null"
Does it work on 1.18 tho?
it work on 1.18
Aha
but how can i make sure that api features on 1.18 will work on older versions?
I'd say it's an issue with the java version of 1.18
i use 1.2.0
and it gives the error
- in paper chat they said that it have no support for versions like 1.13
Yeah, mojmap is only there since 1.14
how?
still i cant use 1.14
yes, but spigot does not support it neither
special source works only on 1.17, right?
1.16.5? (maybe) and 1.18.(1) should have it too
well, 1.14.4 (or 1.15, idk)
iirc yes
either way mojmap is rather new
oof. is there any detail of HeightMap?
What do you mean and what are you trying to achieve?
i'd like to have support for 1.13-1.18 or at least 1.16-1.18
how can i do that with gradle?
1.13-1.18 is impossible, that far is clear
yes
pom.xm- wait you use gradle idk
yes
this is... way too brief.
maven have each pom.xml for each module if you want lol
Well, you Just use spigot mappings on modules for 1.13,1.14.4 and mojang mappings on 1.17+
unless you'd go with spigot -> official -> searge -> mcp, but I don't know anything that exists for this
that's great, how to do that?
Well, perhaps minimappingsviewer has something for that
Gradle has build.gradle for every module as well
well, spigot mappings arent too bad on > 1.17
it's like, would there be more blocks above a WORLD_SURFACE?
nms should be compileOnly
@quaint mantle
if i'm making a function
to convert it to a timespan
what would the returning type be
TimeSpan doesn't work
Duration
oh
Is there a PersistentDataStorage for 1.8.8 plugins?
my server is 1.8 :P
update
especially with the log4j bug people should not use that version
can i run a 1.18 plugin on a 1.8 server
obviously not
bruh
Muh PvP
how can i make autocomplete work for second args?
pvp exactly
.. help?
Streams moment
I'd avoid using custom data structures
No, they imply that this issue is caused by the streams api
Why have you made your own bimap
Which may very well be the case, but I would say that it is a programmer error on whoever coded #getEntry
You see, there is a difference between
Object o = map.get(key);
and
Object o = null;
for (Map.Entry<Object, Object> e : map.entrySet()) {
if (e.getKey().equals(key)) {
o = e.getValue();
}
}
assert o != null;
this is my favourite example because I closely work with a codebase that uses latter approach far too often
iam using the code above to check y , yaw and rotate an entity
armorstand in this case
I’m still wondering why you’ve made your own bimap
Well, the important thing is what the bimap does
the impl of the bimap is at fault, not the caller code
so any suggestions to make it betteR?
Use the bimap from guava
is it the same usage?
or should i change the whole code?
the Bimap i use have 3 values
Also, I'd get rid of the asserts, that'd improve the performance by the factor 2
ok
You want a map with 1 key and 2 values?
Just use a normal map and make a class that holds the 2 values
Then use Map<K, Map.Entry<V1,V2>> instead
That also works
I overuse the Map.Entry interface tbh
for testing puprose like this : ?
Could I take a look at your Bimap class? I want to be sure that we are actually suggesting the right thing
?paste
Otherwise you'd have 200 screenshots, those fellas can be enormous
private List<Entry<K, V, V1>> data = new ArrayList<>();, well that explains the shoddy performance
what is different?
lul
can you explain a little bit why its bad?
public void replace(K key, V value1, V1 value2) {
if (!getEntry(key).isPresent())
return;
Entry<K, V, V1> entry = getEntry(key).get();
entry.setValue1(value1);
entry.setValue2(value2);
this.data.set(getDataIndex(key), entry);
the this.data.set[...] is useless here
i didnt make that class , a friend i know did make it and he told me that i can use it .
anyone here worked with spigradle? if yes, how to change debugSpigot mc version?
I would advise not using it
I'd avoid using that class, it is an optimisation nightmare
There are major cardinal sins that were committed here
do you have any better alternative?
We already told you
Anything with a complexity of O(1)
Map<K, Map.Entry<V1,V2>>
i tried that
gave me more errors xd
more i tried to fix more new errors apear
The other solution would be to rewrite the bimap class to have a runtime complexity of close to O(1), should be rather straightforward
Damn why not just Multimap
Don’t those require the values to be of the same type
oh right
public interface Multimap<K, V> { yep
Just make a class to hold the two values
^^
Or map.entry
generics are ugly so
Ah yes, using highly specialised records
any way to change the damage ticks
ive seen it before
on those pvp servers
they have it so like every damage registers
no invincibility period
what is the best way that won't cause any lag ?
i tried to use packets / to spawn / rotate entity but it didn't work out well for me ..
We already told you to fix your data structure
The importance of the proper data structures are underrated by many for some reason
thx
thanks will do
ik this is more an intellij thing, and ik its simple, but why does it remove the ability to add a class when the pom.xml is added? its super annoying. also, it doesnt highlight text in those classes
uhhhhhh, screenshot?
thats odd
its just right clicking package
can you show me your project window?
if you wanna keep it private, DM me it
seems like a maven loading error
yeah thats a maven loading error
its supposed to look like this https://gyazo.com/c78a374cfbfe76f2701b58a9386b1b26
yours doesnt have the main or java directories 🤔
o
try forcing them in and see if it fixes itself
yeah because there's supposed to be a resources folder for your pluginyml too, it might be better just making a new project with maven from the start so it creates the directories properly
normally i dont need a main or java folder
thats... not good
wait so how would the whole thing look if it was set up correctly
ik about the blue classes
but like whats the structure
eagerly awaiting sirionblatt's essay
Hey, I have a question!
I use IntelliJ to make a plugin and now I'm trying to make one using Spigot 1.18.1. The problem is, that somehow IntelliJ does not recognize it or something, because none of the Classes and methods can be used (like JavaPlugin or Player and so on), it just says that this does not exist.
Any help?
thats my question
i have no idea
have you run buildtools
Is your SDK set?
imagine having to use build tools
imagine
No buildtools and my SDK is Java 17
ive only ever used it for NMS, other than that my ide auto imports it from the repo
weird
invalidate caches?
spigot or spigot-api
spigot
aight you need buildtools for that
Extract resources from unknown directory structure
but with spigot 1.17 it works
Correct
does anyone know off the top of their heads what the intarray is for on 1.8 PacketPlayOutEntityDestroy? It takes an int..., is that for multiple entity ids or something else?
btw would the path in plugin.yml be any different with the main and java
im assuming it would be the same
nope
Uhm I am not really that advanced in Plugin developing, what should I do with this?
just follows package path
Your using maven right? (pom.xml)
maven best
how would i convert collection<players> to arraylist?
Currently not but I heard it is really useful
new ArrayList<>(thatCollection);
or
new ArrayList<>(Arrays.asList(thatCollection));
ahh lol
you could do it via iteration, but people who do that are psychopaths
feel kinda dumb know
the parenthesis in new ArrayList<>() are to set initial values
Hello I have a problem with my plugin. So I want create one file for each arena if in the config the multi arena is allow. But when the file default.yml is created I want add a defaults config with a arena.yml files the ressources of the plugin. I have a Null pointer exeption why ? Can u help me plz...
My main class EBuild:
https://www.toptal.com/developers/hastebin/disuveroya.typescript
so you can pass a List of soemthough through it
Is there a way without maven? Just use spigot-api for the library?
How are you importing the spigot-api then?
gradle?
You know what
imma hook you up with something
its gonna save you life
File -> Settings
okay?
look for this plugin
and just remake your project, you can just put your old class files into that new project
dw I spent literally 5 mins yesterday being confused why the following was throwing an error, and ive been using java for 2 years
byte = 5 >>> 1
whats one dark theme lol
lol
that plugin automtically import spigot-api in gradle or maven
One Dark theme lmao
Thats cool, ill try it, thanks
dark mode is darker than white mode yes
the psychopath intellij theme
i need to add my goku backgroun to intellij again
i used to have goku as my backgroun untill i had to reinstall intellij cause new nvme
Hello I have a problem with my plugin. So I want create one file for each arena if in the config the multi arena is allow. But when the file default.yml is created I want add a defaults config with a arena.yml files the ressources of the plugin. I have a Null pointer exeption why ? Can u help me plz...
My main class EBuild:
https://www.toptal.com/developers/hastebin/disuveroya.typescript
what the fuck is that link
@noble lantern so with this plugin do I have to have the extern spigot library or should I just leave it?
scary
hastebin
hmm what would this mean then java no suitable constructor found for ArrayList(java.util.Collection<capture#1 of ? extends org.bukkit.entity.Player>)
ig its something with types, but i have no idea how to fix it
whats toptal
it automtically imports it
hastebin they got bought out by someone
ah
search on the net hastebin u will see
Show code?
bruh why did u put the highlight thingy on the code block for an error
would it be possible to code plugins / mods in python?
lol
WHY NOT
ok thanks
do I have to do anything after I installed it? because the spigot classes still aren't recognized
You needed to make a new project
oh ok
and then choose "Minecraft"
it will be on the right
and then just transfer all your class files to that new project
and from now on use that plugin when you create then
yeah its type
you first need to convert the Collection of player to a List of Strings
Cause List<String> isnt List<Player>
is there a way to do that without a loop?
you can use lambdas and use method referances (::)
thats about as short as you can get
idk if theres a built in way but thats how i always convert my Lists
i feel bad for anyone that joins this server lol
What should I put into
GroupId
ArtifactId
Version
?
i just do it like this
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
what is that intellij background
groupid = com (net, io etc)
Artifact = name of Main Class/Jar
Version = anything
i told you i was adding goku back
Who on earth would actively encourage an auto clicker like that
okay thanks!!
are u talking to me
autoclicker what?
Mhm
hehe
You can also just fill in jibberish and then edit the packages and main class yourself i do that because its naming is a little weird
rip people that dont have autoclickers
Okay :)
i dont like com.burchard36.plugin.Plugin as my package class which is what it does normally
fun fact
My IGN is buchard36, but i made a typo when signing up on spigotmc
so im buchard37 to the spigot community lmfao
how would i get the name from the player class thingy?
Player#getName()
getName?
not sure if that was mc related
last week i tried out a class extending YamlConfiguration and i think im in love
so damn awesome to just this.getString
instead of having to referance a YamlConfiguration object
no one can help me -_-
sorry what did you need help with
I create a discussion fil
How would I set a block to andesite in spigot 1.8? On 1.8 the block id is stone:5.
im getting this error now, i think i know how to fix it but im not sure if there is a better way
String result = new String()M
if(keys.size() == 0) {
result = players;
}
else if(keys.size() == 1){
result = keys;
}
return result
Iirc setTypeAndData
Return Collections.emptyList at the bottom
Or null if you want
or just return players
^
Initialize
process
return
You should make a static getter in your main class to
getOnlinePlayerNames
why do i feel like thats a default method but ik its not
Ianswered you
what would that help tho
how can I like display the enderpearl cooldown on other items
So you dont have to rewrite this method every time you wanna use it
like the thing thats on shields aswell
eg:
Isnt that already displayed?
hm?
like the white bar htat scales down
when using an enderpearl
nms it is then
lol
how do you make entities hit faster
cuz if i have 0 max damage ticks
they kind of just hit slowly anyways
nope no need!
There’s a method for it in modern versions
it was p.setCooldown
wheres the fun in that?
even better, just rewrite minecraft with the changes you want
it cant be that hard can it?
famous last words
no ones made one yet written from raw java with mc protocol
so, its kinda hard
not that hard
but kinda hard
best way to make item glow like its enchanted 1.13+
ItemFlags
wouldnt surpise me if hypixel did it but kept the jar secret lol
you mean enchant and hide enchant?
My bad
Add unbreaking and then use ItemFlag.HIDE_ENCHANT
yes
well maybe they did
but a public one i mean
ahh
or add infinity cuz unbreaking might be useful
wait
i cant see what else they need like 20 devs for
isnt there a empty enchant nbt
so they can post pokemon memes?
well paper and spigot have 70+ contributers and its just for patches
welllll thats also a posiblty
Make a custom enchant.
its 2 lines of code though
add enchant, add item flag
Yes but doesn't add any "useful" enchants
i think there is a empty enchant nbt...
i mean chances are that shiny item is just going to be used as a gui item
or some type of item that isnt usable like that
but do those 70+ contributers work 40 hours a week on paper?
unbreaking on a flower wont hurt no one
uhm idk
maybe tbh
whats the spigot 1.8.9 maven import btw
they never sleep anywhere
wait till people convert flowers to netherite swords and duplicate them
1.8.9 is a client only version
well the 1.8 one then
either way unbreaking 1 wont hurt anyone if they manage to somehow do that
which isnt possible to do iirc (flow enchants transfered to sword)
1.8.8 is last 1.8 version.
The most they could get from it is a small amount of xp with a grindstone
ah i forgot about grindstones
ok so is it 1.8.8-R0.1-SNAPSHOT
3 not 1
Not sure on that. Might just have to go look at the pom
uhmmhmmmm
you cant add null to an inventory
lol
UHMMM FFS
i was about to say that
i thought it was something usefull
im used to looking at the top for my error not near the bottom
or how there can be null InventoryClickEvents
Like yeah im 100% gonna wanna know when someone isnt clicking an item
public class CommandCustomGiveTabCompleter implements TabCompleter {
@Override
public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
List<String> keys = new ArrayList<String>(SplyMain.getHashmap().keySet());
List<String> players = new ArrayList<String>();
Bukkit.getOnlinePlayers().forEach(player -> players.add(player.getName()));
if(keys.size() == 0) {
return players;
}
else if(keys.size() == 1){
return keys;
}
return null;
}
}
``` this code should be making the second arg the list keys right?
BUT IT IS NOT
IT SHOULD WORK THEN
that is the worst troubleshooting
when you dont have a error
im cursed
i rarely get errors (not to flex)
so im just stuck sitting for hours writing debug logs
that is sad
my latest plugin has like 200 lines of debug logs
xd bruh
do you need something
are you okay?
think i would go insane
especially if it was 7am
?
oh wait my log time
LMAO
i think thats queue to go to bed though if i dont recognize 7pm on thee
i almosed dox'd myself too
i was just gonna strait up send my latest.log file
._.
im off to bed before i send my chrome cookies lmfao
._____________.
ooh fun
https://www.toptal.com/developers/hastebin/ekisefufoj.md
I am suprised how fast this loading is though
mmm yummy
i was gonna show the generation logs but
nowhere let me upload theyre too big LMAO
wym?
do ya know how i could fix that then @noble lantern
Just post it here on discord. It will generate a text file.
lol
why lol
Did you fix the additem null error?
2mb logfile
pog
LMAO
that was because i wrote splyfof instand of the item lol
ah
if im being deadass honest
ive never done tab completors
so i couldnt help you with those
ya know who has?
Im sure Adelemphii or Conclure has, i saw edgar in here too and coll
one of those 4 will know maybe
they prolly lurkin
Optic too maybe
but hes mobile L
How can i put data on items? (Obs: Spigot 1.8.8)
but how will i run my server without using a 6 year old version!!111
UWU but hypixel uses it so it most mean its good UWU
how can i register custom enchantment without nms 1.13+
doesn' twork
trying to make something like this
doesn't work as expected
so basically
if their health is above 1
it just shows all dark red
if it's elss than 0.5
it shows all light red
and else it shows all gray
it doesn't work properly
Could someone explain to me pls how #rotateAroundNonUnitAxis works, since Im getting some weird and unexpected results
why does
getMaxHealth returns their max possible health, how do i get their true max health currently
getAttribute(GENERIC_MAX_HEALTH).getBaseValue i believe
how can I put some jar files in final plugin jar using maven?
maven shade plugin
I tried directly put those jar files in "resources" it just broken after build x
hm I am checking it out
Im trying to create a circle out of particles in the direction the player is looking in with a certain radius and distance from the player.
And I've been delving in the realm of matrices and such, then I found #rotateAroundNonUnitAxis, but instead of that Im now using #rotateAroundAxis(Vector, Angle)
But the issue is still there that it rotates around ~0,0,0 cause Im using the direction the player is looking in, gotta set it differently
I would use a polar change of coordinates
doesn' twork
Wdym
it doesn't work?
@noble lantern i got it to work lol, the problem was that i was changing the list based of keys when it should have been args
Welp, it seems that I was just an idiot, I had some "remnants" of my previous attempts in my code, like a crossproduct where there shouldnt have been one, whoops
Nvm still F'ed
I have code that does something similar
Just trying to remember
Youre trying to make a circle from a vector thats normal to it
Well that was my original idea, to have a line, take a point from it, create a normal vector and rotate it, while always taking the tip of the vector as a point to spawn a particle, yet that doesnt seem to work in any way.
Now I've been trying to understand #rotateAroundAxis(Vector, Angle)
A circle in 3D is parameterized by six numbers: two for the orientation of its unit normal vector, one for the radius, and three for the circle center .
Heres some mathematica code
You might be able to use this
Its really annoying
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.Listener;
import org.bukkit.plugin.java.JavaPlugin;
public class BlocksRemoving extends JavaPlugin implements Listener {
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (cmd.getName().equalsIgnoreCase("start")) {
Player player = (Player) sender;
if (sender instanceof Player) {
Block blockloc = player.getWorld().getBlockAt(-1, 65, -155);
if ( blockloc.getType() == (Material.IRON_BLOCK)) {
blockloc.setType(Material.AIR);``` anyone know why the block isnt setting to air?
?paste
ooooh
Btw player.getDirection or smt gives the unit normal
So you need to multiply it or whatever to get a distance
uh sorry but I still unclear about how to use maven shade plugin
ik
Im still looking where some final math is on that site you sent
Cause that would be exactly what I want, yet the maths is spread around alot of links
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>${project.basedir}/libs/a.jar</include>
<include>${project.basedir}/libs/b.jar</include>
</includes>
</artifactSet>
</configuration>
</execution>
</executions>
</plugin>
It probably no the right way but I dont know what's the problem
how do i add attribute modifiers to itemstack in 1.13?
Have you any experience in multivariable calc?
That’s the equation
that looks familiar or rather doable
Your biggest issue will be finding the zenith and azimuth angle, but you can use the dot product rule with some vectors to get andles
The projection of û onto î and û onto k
Could you send the link to the site you're on, cant seem to find it
So i downloaded the file
Hi! How are you?
I want to know why im having the error "Unhandled exception: MalformedURLException" on the throws of my method? When im throwing a custom exception that extends "MalformedURLException"
**Method where error its shown**
public void load(File file) throws LoadException {
ClassLoader loader = URLClassLoader.newInstance(new URL[] { plugin.toURI().toURL() });
}
Exception class:
public class LoadException extends MalformedURLException {
public LoadException() { }
public LoadException(String text) { super(text); }
}
Any ideas why happen?
And put it into the wolfram player
ah, the player
cause I was looking trough the sphagetti of it
Idk why they use that notation for zenith and azimuth angles
Should be phi for zenith and theta for azimuth
Well if I figure it out or not, thx for being so helpful <3
because .toURL throws MalformedURLException iirc. actually i'd need to test
ClassLoader will not throw a LoadException because it cannot convert a MalformedURLException to your type
You need to catch the MalformedURLException and throw your LoadException
This is because MalformedURLException does not extend RuntimeException, which is why you need to explicitly catch it
(or just pass the exception along with a throws)
So i need to create a runtime exception and them probably it will disappear the error?
I think they want their own exception to appear instead of MalformedURLException but i cant be sure haha
Yeah
Then you need a try-catch block
.
I want to use the throws and then when you use the library you try catch the method
try {
abc
} catch (Exception e) {
throw new MyException(e);
}
Thats why i didnt use that
Always use the ctor that accepts an exception/a throwable. Do NOT invoke toString on the exception
Its a very interesting and fun mathematics problem! Multivariable calculus can really help with these problems
So its not possible to extend an exception, to then using it with "thorws ExceptionClass"?
correct
Omg thats why i prefer cs
Because the JVM doesnt know how to convert the exception to your type
Its a very simple OOP
OOP?
Object oriented programming
Ahh ok
You cannot convert from Class A to Class B without providing instructions
Unless Class B is super class A
There is, we’ve told you
.
.
Because i want to throw that exception but with diff name
Right, we literally told you
.
Yeah but i cant use try catch
Yea you can?
Because its a library
In my library people should try catch the methods themselves
The message you cant change it
and your exception does not extend RuntimeException
You can still use “throws MyException”
With extend RuntimeException or not its the same
Because the same error occur
Your exception cannot extend RuntimeException if it extends MalformedURLException
public void myMethod() throws MyException {
try {
abc
} catch (Exception e) {
throw new MyException(e);
}
}
Ohh that its what i want
how do u add an effect with hideparticles
-.-
But my exception what need to extends?
how would I use reflection to invoke a method like this? T is generic only to that method. https://gyazo.com/e5980dba8d9ea3ad337f56b253331c61
do I just use #getMethod("a", int.class, String.class) and it convert it?
🥄
🥄 🥄 🥄
Why try catch? Isn't the whole point of throws for that?
@quiet ice ? Can you answer this im not quite sure
Converting from one exception to another
Your exception can extend anything.
But it need to extends MalfromURL?
👍
Throwable, Exception, Error, RuntimeException whatever you please
Asking about your attempted solution rather than your actual problem
Allright thanks
Also, for god's sake, use Java's library for exception and not your own
Not sure what the purpose of using your own exception is
Not very good practice in general
Exactly, and I don't understand why 100% of libs do not use things that already exist in the standard JVM
So don't be one of the 100%
It's just a pure waste of time
Thats a whole new sentence dawg
We saying it doesnt make sense to use your own exception
People will not understand what LoadException means
Always these excuses
They will understand what MalformedURLException means
And why spigot have custom exceptions? mnns
No sense
I dont think spigot does?
Yeah
?jd
public class InvalidDescriptionException extends Exception {
private static final long serialVersionUID = 5721389122281775896L;
public InvalidDescriptionException(Throwable cause, String message) {
super(message, cause);
}
public InvalidDescriptionException(Throwable cause) {
super("Invalid plugin.yml", cause);
}
public InvalidDescriptionException(String message) {
super(message);
}
public InvalidDescriptionException() {
super("Invalid plugin.yml");
}
}
There u have sir
java.lang.Exception
org.bukkit.event.EventException
org.bukkit.configuration.InvalidConfigurationException
org.bukkit.plugin.InvalidDescriptionException
org.bukkit.plugin.InvalidPluginException
java.lang.RuntimeException
org.bukkit.plugin.AuthorNagException
org.bukkit.plugin.messaging.ChannelNameTooLongException
org.bukkit.plugin.messaging.ChannelNotRegisteredException
org.bukkit.command.CommandException
org.bukkit.plugin.IllegalPluginAccessException
org.bukkit.plugin.messaging.MessageTooLargeException
org.bukkit.metadata.MetadataConversionException
org.bukkit.metadata.MetadataEvaluationException
org.bukkit.plugin.messaging.ReservedChannelException
org.bukkit.plugin.UnknownDependencyException
Not too many exceptions
Oh yea youre right
They use their own exceptions because you would not be able to interpret the original exceptions
Well, you can use IllegalStateException in 80% of the time, but eh
@glossy scroll
I'm pretty sure I messed something up, or geogebra is just being weird
Cause that doesnt look like a circle.
Geo says it's the cross
What are you trying to draw?
circle in 3d space, martoph has provided this link:
https://demonstrations.wolfram.com/ParametricEquationOfACircleIn3D/
A circle in 3D is parameterized by six numbers: two for the orientation of its unit normal vector, one for the radius, and three for the circle center .
.
This draws a half circle, just increase to 2*Pi ```java
public static void halfHorizontal(Player player) {
double radius = 3, secRadius = 4;
double every = Math.PI / 30;
Location loc = player.getEyeLocation();
for (double rad = 0; rad <= Math.PI; rad += every) {
double x = radius * Math.cos(rad);
double y = secRadius * Math.sin(rad);
double rotateX = Math.toRadians(loc.getPitch() + 90);
double rotateY = Math.toRadians(-loc.getYaw());
Vector rotate = new Vector(x, y, 0);
rotate.rotateAroundX(rotateX);
rotate.rotateAroundY(rotateY);
Location finalLoc = loc.clone().add(rotate);
player.spawnParticle(Particle.FLAME, finalLoc, 1, 0, 0, 0, 0);
}
}```
a circle around a point, a vector has no location
.
Yours does not have the ability to be in any orientation
Its a fixed orientation
simple, just use teh location you want the circle instead of the players eye location
We want any orientation
surely he'd want it in a single plane
Use your vector v in the q= equation
Instead of nxu
Do i need to use reflections for looping inside a jar to check it any classes extends a custom class?
I'm having a hard time understanding which Libraries I actually need, I updated my server from spigot 1.17.1 to paper 1.18.1.
Do I need to add the paper 1.18.1 library here?
Do I need to remove anything?
https://imgur.com/a/0BK44ZP
@zealous osprey also remember that P(t) is from R to R3
Not really
u mean like this?
You get 3 outputs
but that doesnt take the radius into account
Is there any way to send that geogebra to me?
or u just want the circle to be rotated
.
Thats what we want
We have the math
Just trying to fix the geogebra
I will probable use the JarFile, JarEntry and isAssignable from right?
doesnt seem like it
ok gimme a sec to copy
?paste
No, you'd need ASM:
https://paste.md-5.net/sahekezoxu.cs then do a quick lookup with result.superName.equals("com/example/ExampleClass") or something like that
can anyone help me make some simple worldgen?
Technically you do not need the classnode (ClassReader suffices to obtain basic metadata about a class) for that but eh
Right i will check it
Oh actually, that code has a few issue so you wont be able to copy&paste it, but the general gist of loading a classnode is there
What mean 0xCA?
brb
0xCAFEBABE is a magic header present at the start of each class
They are the class identifier
not really, it just junk data for our purposes - a bit like hashbangs but the OS does not care either
(just note that this is a gross oversimplification - the header has it's uses)
if I have a config.yml file that has this:
test:
test2: 'hello!'
how do I access the value of test2
wouldnt it be getConfig().getString('test.test2')?
"test.test2"
cast an ItemStack to a custom class
that's dumb
I dont know why but it could be java syntax
Because ' is for chars
oh ok ty
Basically 16-bit integers
You cannot really represent "test.test2" as a 16 bit integer, which is why it does not compile
public void load(File jar) throws MalformedURLException {
ClassLoader loader = URLClassLoader.newInstance(new URL[] { jar.toURI().toURL() });
}
I have already made a loop of the directory now i need to loop inside the jar?
I get stucked there
Amazing java syntax not working btw
||It looks like this is something the service API can handle||
No
Because i want to load custom jars only if they extend a custom class
Thats why btw
So exactly something the service API was meant to be used for!
I dont think its exists on jdk 1.8
Oh yes, it does
Really?
Yes, though given that it requires a descriptor file it may not apply for your usecase, but perhaps it does, which is why I put it in a spoiler initally
@zealous osprey i got it working but geogebra is dumb so i just used mathematica again
it doesnt know how to interpret vector multiplication which gives a parametric curve
So the maths provided from the link should work as intended?
If I may ask, since I am somewhat confused, im assuming that the angles define the vector which then creates a normal vector of length r, right?
So it's using pitch and yaw
But in radians
Hey folks, I'm looking to decrease the amount of NMS code in my plugins. The 1.17 and 1.18 posts mentioning opening PRs to add to the Bukkit API where one would currently need NMS. Are there situations where it definitely would not make sense to put things in the API, but rather keep them NMS only, or is everything welcome? Currently using NMS to spawn particles for only one player, spawn invisible magma cubes for only one player and to modify a player's GameProfile.
Correct, so the azimuth angle will be the yaw and the zenith angle will be the pitch
if im not mistaken
just whatever pitch and yaw correlate to this
also be careful because minecraft's angles are slightly different from real world angles
AND that minecraft is Y-up, not Z-up
- Player.spawnParticle
- Spawn entity and hide it from player
- Currently impossible on spigot, but, paper has profile api.
How so?
so you'll need to swap the Y and Z values in the functions provided
👍
Making some food rn, Ill test it out in like 30 mins or so
you can put in the code
and see what happens
im just saying you may have to swap some sins and cosines
i can help with that once you get there
otherwise your cirlces may be displaced by 90 degrees :)
O.o I did not know about the Player#spawnParticle(), will check that out. For point two, does this affect things like block placing where the magma cube is for other players? i.e. those that cannot see the magma cube. And for point 3, does that mean I could open a PR on spigot? I.e is it welcome there
@zealous osprey if you need to know the cross product with respect to the zenith and azimuth angles, here you go
{-Cos[[Theta]] Cos[[Phi]],-Cos[[Phi]] Sin[[Theta]],SuperscriptBox[RowBox[{"Cos", "[", ":03b8", "]"}], "2"] Sin[[Phi]]+SuperscriptBox[RowBox[{"Sin", "[", ":03b8", "]"}], "2"] Sin[[Phi]]}
oops
where theta is the azimuth and phi is the zenith
Javas vectors have an inbuilt crossproduct method
oh of course
thats right
actually minecraft vectors haha
java vectors are collections
for whatever reason
Well yea, bukkits vectors
cuz c++ dynamic arrays are called vectors
i dislike that
What executor should i use for I/O?
wow, wth
is jansi not in spigot anymore?
who is jansi
it's just console coloring, was it replaced with something else or just removed?
(org.fusesource.jansi)
oh
hey, could anyone help me with my location?
I'm sure I'm doing it wrong
@Override
public void onActivate(Player shooter, Integer level, Location loc, World wrld) {
double xAxis = loc.getBlockX();
double yAxis = (loc.getBlockY() + 1);
double zAxis = loc.getBlockZ();
Location newLoc = (wrld, xAxis, yAxis, zAxis);
}
I get an error for every variable in newLoc
(wrld is defined correctly but I'm not sure about the xyz cords)
add new Location before the '('
thanks ;D
Also why are you using the wrapper type integer
Mmm maybe
Im done eating, gonna see if I can code it up now
And this is still the following equaltion, right ?
Problem with client sided blocks, let me thread this as not to clog this channel up
@zealous osprey yep!
actually
the theta and phi are swapped on my end
because i prefer that notation
I think this is more accurate to minecraft
Hello guys, I'm looking for a way to disable the built-in vanilla night skipping mechanism (the message "1/2 players sleeping"). Does anyone know if this is possible? If it's not possible, would it be possible to disable the message, maybe programmatically with a plugin? The thing is, we use our own sleeping system and the vanilla message is very misleading.
When changing phi is weird
seems like it's rotating on 2 axis ?
oh yea youre right
let me see
OK
@zealous osprey this is the minecraft equation
all you need to do is swap Y and Z
btw what's t, Im assuming it's the change in time, but it cant be
that looks sick
t is "time"
really
its just the step size
so at each t you get one point
depending how many points you want, you have a different amount of ts and you increase t by increments
t goes from 0 to 2pi
if you want 12 equally distributed points
you would make a for loop
t increments by 1/6 pi each time
and you would do that 12 times
ignore the phi
i just wanted to see it combined haha
do BukkitTasks stop when the player does /reload ?
im debugging my plugin, but ive just realized that every time i /reload, im not stopping my runTaskTimer
will that cause memory leaks?
Afaik yes they do
Is there a list of playable sound effects to listen to?
oooh
Btw what I wrote down now is the following, I hope I got the order of operations right, since I've noticed that they are sometimes funky:
this was literally the first result on google... https://minecraft.fandom.com/wiki/Category:Sound_effects
method names?
yeah and it countains about 49 out of 1000s of sound effects...
they are reflecting the vectors of the function for simpler reading
then keep googling
im here to help people with code not google things for them
I mean the playsound command has tab complete
fuk corcles
literally just use your eyes
signum?
signum ?
its in ur n method
Still have to add the timesteps aswell, but I dont know what signum is or means/represents, maybe I know it, but under a different name, since the defined names seem to vary alot between german and english
do i need to stop BukkitRunnables on plugin disable? im doing /reload to debug my plugin, but im afraid the BukkitRunnables might cause memory leaks
phi is the circle with the vertical line
theta is the circle with the horizontal line
it just returns -1 when the value is negative, 1 when the value is positive, or 0 when 0
hopefully thats clear
yea, the zenith and the azimuth as you showed somewhere above
yup, so I need to increment t as it is the steps between the points
correct
so basically signum is the same as x/Math.max(1,Math.abs(x))
but not quite because i forgot about values >0 and <1 when i typed that
help, it says Caused by: org.bukkit.plugin.IllegalPluginAccessException: Unable to find handler list for event org.bukkit.event.Event. Static getHandlerList method required!
but i declared that method
x==0?0:x/Math.abs(x)
Seems to work wonderfully, just need to change C to the current possition of the player, or rather a point on the line following the eyeDirection()
Thx <3
I have a plugin for skipping night when not everyone is sleeping, only a percentage have to be in bed to skip. However when I change the time with the plugin it causes the day cycle to get stuck. This is code im using to set time, is there a different I should be doing this?
why are you doing it in a task?
Yep so C is the center of the circle
So wherever you want that to be
Id love to see a screenshot in action :)
I think I still am messing up some of the directions, but it's definitley a lot closer than I cam using a sphere and a plane
Make sure you swap y and z
I dont remeber
I have touch this plugin in about a year
*I havent
help plz Caused by: org.bukkit.plugin.IllegalPluginAccessException: Unable to find handler list for event org.bukkit.event.Event. Static getHandlerList method required!
Current state of it
the delay you have is 3/4 of a second so maybe you wanted a pause? idk, just looked a little odd.
show code, sounds like you are trying to write a method that responds to every event
I think its so the skip isnt instant, kinda like sleeping already does in the game
i have two custom events, and one custom event handler, what to show?
The problem lies in the fact that it casues the game time to get stuck
oh ok, didn't know it was a custom event
i have this class which i use with custom event:
package com.aregcraft.customstevechaos.event;
import com.aregcraft.customstevechaos.CustomSteveChaos;
import lombok.NonNull;
import org.bukkit.Bukkit;
import org.bukkit.event.Event;
import org.bukkit.event.EventHandler;
import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;
import java.util.function.Consumer;
public class EventListener<T extends Event> {
@NonNull private final Listener listener;
private EventListener(@NonNull Consumer<T> handler) {
listener = new Listener() {
@EventHandler
public void on(T event) {
handler.accept(event);
}
};
}
public static <T extends Event> EventListener<T> create(@NonNull Consumer<T> handler) {
return new EventListener<>(handler);
}
public void register() {
Bukkit.getPluginManager().registerEvents(listener, CustomSteveChaos.getPlugin());
}
public void unregister() {
HandlerList.unregisterAll(listener);
}
}
maybe it's the problem?
you just neeed to add the static getHandlerList like it's asking for and have a static handlerlist in your event class
i added
it literally have that method
Why does ENDER_PEARL into Material.getMaterial(args[0]) results in null?