#help-development
1 messages ยท Page 2150 of 1
I do use it because its easier modify your pom.xml than it is to download a new version of a dependency and import
that too
but its not "bad" to not use maven
there's no benefit not using maven or gradle
not all dependencies are in the maven repository though
ik u can add dependencies from local jars as well but I feel like it's harder to set up
I mean thats pretty simple still
It works well. Thank you very much.
No prob
What I'm saying is the use case matters
Exactly but there is veey little benefit when using it for simple plugins
Maven is like so fucking simple to use and set up and anyone who says otherwise is either dumb as fuck or trolling and their opinion doesn't matter
Ig thats one way to look at it
Literally you click a button in intellij and you can type like 2 lines into pom.xml and something works
It is ismple to use and i do use it but I didnt always use it so i can understand why some projects wont benefit from it
hello, I got a question about some blockdata. Is it possible to power a block, other than a redstone related one, through code.
If you power a block using a repeater that is facing to the block, then placing a redstone wire behind it will power that too.
Can you replicate that without the initial repeater? By powering that block or something?
I want to illustrate it but cant post images here.
My goal is to power all the redstone that is touching a diamond block.
What I tried is checking all directions of the given block and then power all redstone blocks/wires/repeaters that are touching the block.
Although if I power a repeater or a redstone wire, it will instantly turn off because the block gets updated if it touches another redstonewire.
declaration: package: org.bukkit.event.block, class: BlockRedstoneEvent
maybe listen to this even and cancel it if the block is next to the diamond block?
or set the current to the old current
because i dont think its cancellable
hi i have added Vault api to my plugin but i don't get economy....
do you have an economy plugin like essentials installed?
yes
do you mean in pom.xml?
depending on that plugin will make that it loads before your plugin loads
did not now that you needed somthing in there to
so if you wanted to use classes of it, that they are loaded
Can you update a GUI inventory with an async task?
No
doing api stuff async breaks it
Dang it ๐
Why do you want to?
but i don't need it to get so when i type code i get econo...
you could also soft-depend: [Vault] so your plugin still can be used even when vault isnt installed, that will require manual checking for vault too
Updating GUI every 4 ticks, I had an async with same rate so I thought maybe I can use the same task...
Nah just do it sync
if i want to take money i need to type in my code economy.takemoney or somthing but econo don't show up
you will have to use another sync task
or go back to the main thread in the already existing async task but idk if thats a good practice
If you're getting the data to uodate it from the async task you can do Scheduler#runTask() inside the async task
Beat me to it
do you have vault set as a dependency for your project?
like with maven or gradle
yes
Paste your pom.xml and plugin.yml
then it should add the packages to your project
and you clicked the reload button so all errors are gone?
yes
show what completions you get when you type Economy then
Lol
it shows up now?
with big e yes but Economy.withdraw... don't work
can you just paste all your code so we can have a look?
also ${project.version} doesnt work in plugin.yml afaik
}else if(e.getView().getTitle().equalsIgnoreCase("Ban This Noob")){
switch(e.getCurrentItem().getType()){
case BARRIER:
sandtak2.openMenu(player);
break;
case WOODEN_AXE:
//Get name
String name = e.getClickedInventory().getItem(4).getItemMeta().getDisplayName();
Economy.
//Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "eco take " + name + " 1000");
//player.getServer().getBanList(BanList.Type.NAME).addBan(ChatColor.stripColor(name), "I said so", null, "The code god");
player.sendMessage(ChatColor.GREEN + "Tatt penger fra:" + ChatColor.YELLOW + name);
break;
it does
oh
look at the guide
you have an economy variable in your main class right?
this?
public static Economy getEconomy() {
return econ;
}
i wouldnt make it static
lol everything with static will work
but i have that in main file
public class YourCommand implements CommandExecutor {
private YourPlugin plugin;
private Economy economy;
public YourCommand(YourPlugin plugin) {
this.plugin = plugin;
this.economy = plugin.getEconomy();
}
//your onconmmand method here
}
uhm plugin.getEco?
when registering your command you do setExecutor(YourCommand(this));
"this" refers to an instance of the Main class / plugin
that will pass your plugin instance to the command class so that you can access methods in your plugin class from the command
remove static from the economy variable in your main class as well as the getEconomy method
so i can't have one line code?
what do you mean one line code?
i only need to take 100 from a player
yes but to do that you need to access the econonmy in your plugin class
to access the econonmy in your plugin class, you have to get it from your main class
I showed you above how you pass the econonmy from your main class to your command class
then you can do eco.deposit() and eco.withdraw() in one line
and how do i do that?
statement.executeUpdate();
is used to update the db when it's running async, right ?
I need some help explaining on how to run a db in async mode, I already have it set up, the problem is I'm not getting any data back.
It's returning null.
This is the code I use, and I have it when a player join, it loads his data and it doesn't work for some reason, I need your guys help.
how do i get the saturation amount of a food item?
Use system. Out. Println to print the data frm resultset
java.lang.NullPointerException: Cannot invoke "java.lang.Long.longValue()" because the return value of "java.util.HashMap.get(Object)" is null
at org.andrej.utils.Economy$2.run(Economy.java:83) ~[?:?]
at org.bukkit.craftbukkit.v1_18_R2.scheduler.CraftTask.run(CraftTask.java:82) ~[spigot-1.18.2-R0.1-SNAPSHOT.jar:3488-Spigot-b6d12d1-d48f2d1]
at org.bukkit.craftbukkit.v1_18_R2.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) [spigot-1.18.2-R0.1-SNAPSHOT.jar:3488-Spigot-b6d12d1-d48f2d1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
at java.lang.Thread.run(Thread.java:833) [?:?]```
this is the error i get
So I'm trying to stop the player from dealing damage when they have a specific tag applied however it does not seem to be registering the event, did I do this code right?
public void onPlayerDamage(EntityDamageByEntityEvent damage) {
Player player = (Player) damage.getDamager();
if (player != null && player.getScoreboardTags().contains("Sprint")) {
damage.setCancelled(true);
}
}
Is the data in the table?
Oh wait... I forgot to register the event.
ResultSet. GetString("uuid")
does it ?
@quaint mantle Thanks for the help.
well
Well?
Is uuid a primary key?
It doesn't seem so from that pic
Uuid should be a primary key and not null
I'm seeing null entries below the first
it is.
CREATE TABLE player_data(
uuid VARCHAR(32) PRIMARY KEY,
money bigint,
chips bigint,
teams VARCHAR(16)
)```
@humble tulip This, right ?
Isn't maven useless if the dependencies aren't in the maven repository
because then if the API/dependency gets updated you still have to download the new version
afaik running build tools gives you the spigot sourcecode right?
i suggest using CHAR over VARCHAR
What's the difference ?
oh okay
yes but dependencies aim to provide api for you that doesnt break with every new update
wdym
oh
well if that is true for every dependency why do you need maven
Caused by: java.net.ConnectException: Connection timed out: connect
[19:58:15] [Craft Scheduler Thread - 555/WARN]: at java.base/sun.nio.ch.Net.connect0(Native Method)
[19:58:15] [Craft Scheduler Thread - 555/WARN]: at java.base/sun.nio.ch.Net.connect(Net.java:579)
[19:58:15] [Craft Scheduler Thread - 555/WARN]: at java.base/sun.nio.ch.Net.connect(Net.java:568)
[19:58:15] [Craft Scheduler Thread - 555/WARN]: at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:588)
[19:58:15] [Craft Scheduler Thread - 555/WARN]: at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
[19:58:15] [Craft Scheduler Thread - 555/WARN]: at java.base/java.net.Socket.connect(Socket.java:633)
[19:58:15] [Craft Scheduler Thread - 555/WARN]: at com.mysql.cj.protocol.StandardSocketFactory.connect(StandardSocketFactory.java:156)
[19:58:15] [Craft Scheduler Thread - 555/WARN]: at com.mysql.cj.protocol.a.NativeSocketConnection.connect(NativeSocketConnection.java:63)
[19:58:15] [Craft Scheduler Thread - 555/WARN]: ... 14 more```
Now I get this shit..
as said modularity, transitive dependencies and it becomes way easier when we work together with for instance git/mercurial
it is also easy to update dependencies when they need to be updated
in other words if they present an api breaking update where eventual, deprecated methods might be removed and so on
think thats mostly by convention?
the extra bits on the double allows for decimal precision
do : if(event.getdamager instanceof Player)
Anyone tell is this some exploit
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
all gui plugins are throwing
that error
like some one is trying to click slot 8114
litterly same error in all plugins which have gui
like someone is sending some falls packets
- 1.16.5
- not spigot
- contact the author
something is going on there but only really the author could verify exactly
Git airplane
it wouldn't be clicking on slot 8114
because the index length isn't even the inventory size
Why the heck would a plugin be trying to get an item in slot 8114 
mathemathically calculated slots
smh
HEllo!
Im working on a Bungeecord plugin and im wonder how to get health from a ProxiedPlayer?
Doubt you can
Considering, it's a proxy
Ah, is there a way to get the onDeath event then?
its a proxy, legit none of those exist
you need to get it from the spigot server, and if you want it on the proxy then get the data there from the server somehow
if thats plugin messaging channels, redis, etc
there are some proxy actions you can do from the spigot side
think it is weird all plugins which have gui throw this error
log file is huge
Ohh channels
Good idea
nope, advancedenchantments just throws it a lot
Can you paste an example of another plugin throwing it?
How do I get a player by UUID in bungee cord
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Try it with regular spigot and not that really ugly custom fork 
if it was up to me I would
Doubt it, considering f3 is clientsided; also why would you want too
Try it locally. To me that looks like an issue with that fork
We already fixed it. Turns out we just forgot to register the event.
that happens a lot lol
How can i opena signed book with custom text
right click
believe packetcustompayload has something with it
im not exactly sure why its even possible, since it seems like something that should be controlled by the client
how can i check if a falling block is at roughly the same location as the player head or feet
or actually i dont need to do that
well yeah, but idk why its even possible for the server to make the client open a book
but ik that it is possible
ty
Im trying to add skin onto NPC
I tried using Mojang session server website to get "Texture" and "signature" and also mineskin.org
Neither of those worked
Now Im trying to print those values, and looks like my Config cannot read the value ??
Config For Textures:
public default String getSkinURL(String inConfigName){
return ConfigManager.getNPCSkinConfig.getString(inConfigName);
}
Texture Getter:
String texture = getSkinURL("goldHoarder");
In Config:
IMAGE VVV
(yes I do end " at the end of the line)
How can I make a boat move faster, I've tried PlayerMoveEvent and VehicleMoveEvent, but they get triggered by me setting the velocity within them, so I have no way of telling when the player has actually stopped moving
Is there a better way?
I have tried hardcoding the values in rn, so it looks like it's something to do with config
also 3D Layer is not enabled?
How do I make a PluginMessageListener in Bungee
has anyone got a good minecraft skin editor? i'll need it for making custom heads
skindex
how do I use Maven to fix it?
ty but how could i make sure that my skin is rotated to north? because if i use the head and its not rightly oriented in the skin it wouldn't show up correctly in-game
not sure 'bout that
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
?pmc
above link
you wont orient the skin, you will orient how the head is placed ingame, you will set the blockdata for it by setting the directional to whatever direction is required. https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/block/data/Directional.html
Thanks. I found this helped more tough https://www.spigotmc.org/threads/tutorial-advanced-plugin-messaging-spigot-bungeecord.53440/
Can someone tell me how to put getConfig()... in a seperate file (e.g. command)
Have a reference to your plugin instance
You can use dependency injection for this
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
thx
if(!hasShop(shopOwner))
return;
if(isShop(chest))
return;
String playerId = shopOwner.getUniqueId().toString();
allShops.remove(shops.get(playerId).get(shopId));
shops.get(playerId).remove(shopId);
NamespacedKey key = new NamespacedKey(BlockEconomy.getPlugin(BlockEconomy.class), "id");
chest.getPersistentDataContainer().remove(key);
chest.update();
}```
how could i remove key from persistent data container? I have code like this.
now i see it
Anyone know of a plugin that will send an afk player back to spawn?
if i have a directory in my plugins folder called "kits" for example and i want to use
f.createNewFile();``` how would that work since test/demo isnt a directory? i tried this and it says the directory doesn't exist but ive used this EXACT code before and it created the directories automatically (its in a method which is why theres no try catch)
mkdir?
How do you convert Bukkit.getOnlinePlayers() to a player array? Simply casting it gives you a ClassCastException
.toArray
doesnt that create a file if its in your project>
Im having trouble with my server. When I quit the server in a world, the inventory doesent save. But if i switch worlds before quitting the server, the inventory saves. What could it be?
might wanna do sth like
if file does not exist:
- create parent file as directory
- create file
i mean you can check if files exists and if not them create folder like i prefer json lol
yes
Hello?
no
so if they wanted to, they could put a json structure and itd be yaml still
but u can use gson library and them it's so much easier
yes lol
mye or just use what bukkit alr offers
but anyway
that returns an object array
im asking how to cast it to a player array
IntFunction<T[]>
i have a qustion, how could i check if player right click at chest?
player interact event than check if right click then block check
perhaps the interact event, if there arent any better ones
does it not only work on the entity?
player interact works on everything
thanks
declaration: package: org.bukkit.event.player, class: PlayerInteractEvent
Represents an event that is called when a player interacts with an object or air, potentially fired once for each hand. The hand can be determined using getHand().
if you only want it to be fired once make sure you filter it properly
how could i chech if it's right hand?
yeah think so
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
can't, need to post on 20 posts.
boutta jus spam grejfgagljy on posts.
nah dont
what you want me to do tell them they got nice hair
like why i need 20 ๐
Idk, make serious posts at least
i can't
I mean thats how the system works
ye
Yeah I'm spamming in the comments.
well Im just a discord moderator here, but I strongly discourage you from going to other unsuitable places to spam there nonetheless
because spigot isn't supposed to be a market place
Should make a channel "Development Request"
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
๐ cope
yeah ive been told 6 times
still aint got 20 posts
and this discord mod will get mad if i spam
no most people would get mad if you spammed
not just the discord mod
because its annoying and unhelpful
so how tf i comment.
like I said imma jus say they got nice hair and eyes
to get 20 posts why don't you contribute something if you have a problem with the policy go elsewhere use that brain of yours and figure it out
for once I do agree
but well, we havent gotten that far yet altho theres just a proposal that we are debating
how could i check if player has item in hand?
Player#getInventory().getItemInMainHand() gets you the itemstack in his hand i believe
then just compare to whatever u need it to be
Anyone know how to set a custom tab list? (Header & Footer)
f.createNewFile();```
gives this error ``` [21:27:56 WARN]: java.io.IOException: No such file or directory```
This takes in a string though? What about multiple lines?
you can probably use \n for a second line. though not sure on that
alright
File file = ...;
if (!file.exists()) {
file.getParentFile().mkdirs();
try {
file.createNewFile();
} catch (IOException e) {
//handle
}
}
//here file should exist on the disk in case it didn't before
it worked ty
2 spaces ๐คข
yuh google coding style be poppin /s
if(!(player.getInventory().getItemInMainHand() instanceof ItemStack)) how could i check if item in hand is null? i have code like this.
you dont need to check if its an itemstack
if (p.getItemInHand().getType() != null) shpuld i do stuff like this
i ussually do if(player.getItemInHand() == null || player.getItemInHand().getType().equals(Material.AIR)) // item is air.
not sure if hes using a sufficient version for that
since he also does not call getInventory
for the player hand
thanks.
yeah inventories are really inconsistent with this for some reason
Unless the API has changed since then, Material is an enum so use == and no it canโt be null
.isAir() should probably be used, although i donโt see how someone could ever be holding cave air
Hello so im currently getting this error https://paste.helpch.at/esifipakaw.sql And heres the class it that is the cause i cant find anything wrong that would cause thyis problem https://paste.helpch.at/raseteyugu.java
you're looking at the wrong class
net.devcowsoftware.networkcore.core.spigot.commands.spawn.SpawnCommand
is not
net.devcowsoftware.networkcore.core.spigot.storage.database.db.core.tables.SpawnTable
Iโll take a look
Itโs the vet last one for getting x thatโs causing it for a null player when it get yo yaw and pitch with the same player
hey completely unrelated to spigot but does anyone know off the top of their heads if there's a way to make an html link (<a>) that doesn't lead anywhere but also doesn't make the browser go to the top of the existing page?
maybe I should just be using buttons
yeah I'll just do buttons, whatever
YO
yo
yk how locations have exact locations like it's 5.0, 5.0, 5.0 not 5.4545, 5.6576, 5.24?
some would argue 5.45 is more exact that 5.0
yes but since the block is one whole thing it takes up the whole location
right?
what if i want player.getLocation() to be like that too
round it or decimalformat
then use player.getLocation().getBlock().getLocation()
I still hate my physics teacher for this
fuck geometry
fuck physics too
but physics is interesting
and the history of it
orbital mechanics are interesting
KSP teached me more about physics than school did in 12 years
taught*
wtf is KSP
kerbal space program
tbh i would personally deliver a medal to someone that makes me understand vector math
well it's actually extremely simple
a vector is basically a "direction". let's imagine you have two points: x0 z0 and x2 z3. let's call the first point "spawn" and the second point "destination". to get the direction from "spawn" to "destination", so simply calculate "destination minus spawn".
so:
spawn = 0|0
destination = 2|3
now you wanna calculate 2|3 - 0|0
You simply now calculate 2-0 = 2 and 3-0 = 3
So the direction from 0|0 to 2|3 is 2|3
if now "spawn" is at 1|2, you instead do
2|3 - 1|2
so 2-1 = 1
and 3-2 = 1
so from 1|2 to 2|3, the direction is 1|1
basically 1 step in the x direction and 1 step in the z direction
ye im sorta familiar with this part. but what does stuff like normalizing rlly mean
yea
complex way to explain it
so c would be sqrt(2*2 + 3*2)
normalizing means you turn that vector so that c equals 1
hm if only I could draw something rn
i dont rlly understand that yet
okay I will get a pen and paper in a minute or 5
Simple explanation. A vector has a length, which is a sum of all its values. Normalizing shrinks all those values so they total 1 or less
17176: <modelName>primoard</modelName>
17177 <txdName>primoard</txdName>
17297 <Item>
17298: <modelName>hellion6str</modelName>
17299 <txdName>hellion6str</txdName>
17404 <Item>
17405: <modelName>npwheelchair</modelName>
17406 <txdName>npwheelchair</txdName>``` Anybody know some regex to get everything EXCEPT whats inside <modelName> tags
what's the best way to track an item like i'm making a duels plugin and i want all items in duels to have like a tracker so if u have an item from duels outside of a duel it removes it
is this like spigot or forge
ive never seen anything stored in .xml in spigot
its neither it is a more general question about regex
?pdc
sure
Iโll reply to this message in a few minutes
2^2 + 3^2*
oh yeah that's what i meant of course
or just 2*2 + 3*3 is what i think he meant
but squaring it is the correct way of showing it
yea
We'rent they confused about normalization? This just looks like a diagram of what a vector is
I mean to understand normalisation you need the length 
normalization makes the vector a length of 1, used for direction vectors
Yes...? But this doesnt really showcase the normalization part
well he aint done yet
that is the boring part tho
ยฏ_(ใ)_/ยฏ
@tender shard how bout we take this to a thread
else i dont know what to make of it soon
vector named "v" length 4
---->
v.normalized()
->
Vector(10,20,70) normalized becomes (0.1, 0.2, 0.7)
I was about to type out some elaborate config issue only to realize I had my config name wrong 
so we have two vectors: x1 at 2|2 and x2 at 6|4. The "difference" between these two is 6|4 minus 2|2 which results in 4|2.
The length of our vector now is sqrt(4*4 + 2*2), which means it's roughly 4.47. So, to normalize this vector, we have to turn this into a length of one. So, simply divide both the height and the length by 4.47 and we end up with a vector that has a length of one:
4 / 4.47 | 2 / 4.47 = (roughly) 0.9|0.5
(because 0.9*0.9 + 0.5*0.5 is ROUGHLY 1)
there's probably some youtube videos that explain it in a nice way
so if i understand correctly normalizing just makes the length roughly 1 but lets you keep the direction.
basically a vector is just "calculating with more than dimension" lol
yes
normalinzg makes the length exactly 1
and the direction stays the same
yes
ah okay
?paste
length of 1 is good because you can multiply it with a length if you want to go a certain direction x amount of times and it will be accurate
You can think of the length as a speed indicator
yes
imma need to experiment with this a bit to see if i really understand when i get home.
thanks a bunch alrdy guys
if someone says something like "direction", in 99% of cases they mean a "normalized version" of the difference between "destination" and "origin" vector
because obviously if you stand at 0|0 and you look at 10|10, it's the same direction as if you stand at 0|0 and look at 455|455
the direction is the same, the only difference is the distance
a direction is like the "angle" at which you are looking
while the "difference" is the "angle" + "distance"
for example:
forward direction vector (0,0,1)
when you multiply this vector by x, you go x far in that direction
vector = new Vector3(0,0,1);
player.position += vector * 50; //will go 50 units forward
I don't think they are looking for code examples but more like what it actually does / what it's for
okay. but u guys know jump pads right
they shoot you in the direction you look
but if you look down for example most plugins will still shoot you upward
hows that done then
Player#getEyeLocation().getDirection()
ye but if u look down that direction will shoot u downward no ?
get the Y rotation of the player and then convert it to direction vector
if the Y component is negative, invert it
sure, you're using 3D vectors
to ignore the "height" (looking up/down), simply set the Y value of the vector to 0
if you don;t want up or down, you just setY(0)
i dont want to ignore height tho
its a direction, not position
then invert Y if its negative
remember
ye thats prolly it yea
don't jumppads ignore the "height"?
depends on the plugin i guess
they simply get your X/Z direction, and then boost you up with a Y velocity of 1 or sth
I thought jump pads had a specific Y
most i experienced did not.
probably depends on the game(mode) and plugin etc
the jump pads usually add their own upward force and ignore how high the players looking right?
anyway, vectors per se are extremely simple. it's just calculating with 2 or 3 or N dimensions instead of 1
ye i think i kinda get it.
in "normal" math, the difference between B and A is "A - B".
In a two dimension vector (x and y) it's just: the difference between B and A is "(Ax|Ay) - (Bx|By)"
And a normalized vector is where sqrt(x^2 + y^2) is exactly 1
Lol hard to explain but easy to understand if your math teacher isn't total shit
if you cut the y value from the direction vector, you would need to normalize again right?
the math i got at school never rlly got this advanced tbh
isn't that like 7th grade math?
if you want it to remain 1 yes
hm well idk, I finished school 10 years ago lol
idk what 7th grade rlly means for me
sebastian lague has some good tutorials on this i think
was 7th grade for me
I guess every school is differnet
he uses unity as his platform but the explanations are good
@tall dragon LOL
7th year of after you first started school
Hello
if you start school with 6 years old, then 7th grade would be classes for 13 year olds
ah dang hello minion
I think since im in australia 9th grade is 8th grade in the us
Coincidence seeing you here

yea, no i never got that
indeed. indeed
I just checked, in germany vector stuff is like 9th/10th grade so for 15-16 year olds
Do you have your own servee now?
no
so I learnt it about 12 years ago lol
Ur a dev?
just hobby dev
Nice :D
Oh wow
not exactly. but i was interested in learning how it works.
and i think i got the hang of it
https://mathinsight.org/vector_introduction#:~:text=Definition of a vector,its tail to its head. this is a perfect explanation for the basics
A introduction to the concept of a vector as an object with magnitude and direction.
well i went to a carpentry school after 8th grade.
guess they didnt think vectors would be important
that's reasonable, it'd be very hard to come up with a real life scenario where a carpenter would ever need vector math lol
especially in these times
my workstation is a pc with 2 screens
and the machine does the work
This is honestly the first config issue I've had in ages it won't save for some reason I have a similar util to this, but for some reason my updated version of it just won't save
Maybe its how I nested my methods?
Method triggered
https://pastebin.com/awU6rtsh
Methods called from triggered method
https://pastebin.com/neZtYGaJ
Config save method (Works as intended in other places)
https://pastebin.com/1CchBiVG
what exactly doesn't get saved?
the value that is assigned from addExperience
it should go into setExperience and add values accordingly the debug statements confirmed that the values are being added but not fully saved
I'm wondering if it could be where I placed my save statements?
hard to imagine what all those things do in the first place
e.g. this "configUtils" things
figured out my issue
some weird bug where 100 is force assigned each time no matter what I think I might have left debug somewhere
lord knows I gotta figure this out though
time to figure out where the fuck this 100 is coming from
logic error lmfao just forgot an if statement
Hello guys, how can I input data from user WHILE being able to print stuff? I want to make smthing like the spigot server console (when u simply run the jar)
easiest way would be to just use a separate thread for your "input console" things that prints to the same output stream as the original program that started this prompt
html is the language of the devil
That's JavaScript. HTML is a lot nicer
HTML itself isn't so weird
what sucks is that every browser renders it slightly different
either I dump everything on the same html page or I rely on ajax requests to get html fragments to load content from other "pages"
it's super messy structure-wise if you are trying to do something even a little complex in a single page
it's not hard to write but until I just gave up and started collapsing everything I was spending more time scrolling than doing anything else combined
but I guess I got it to work in the end, gaze upon my magnificent webpage and despair mortals!
hbo max
they copied it from me
๐๐ฟ ๐๐ฟ ๐๐ฟ
nah man I'm a charitable person
then only insult them on twitter
I think of the poor multibillion dollar industries that just need that extra boost
I did write it off as 3 billion dollars donated to charities in my tax forms though, still waiting to see if that gets approved
in all countries that I know of, you can only deduct donations from your taxes if the "company" you donated to is a non-profit organization
they barely make billions of dollars, it's basically charity
fun fact: my father runs a charity too (for molested children) and sometimes people apply to get funds from them because for example they lost all their money at gambling and now they ask the organization to at least buy them a new tv or sth lol
is this the grindset I keep hearing about?
wtf does grindset mean lol
oh boy
it's dangerous to learn about grindsets and sigma males alone, take this! https://youtu.be/1-HfTnvy26A
no "3d sound" = no listen :<
yeah you're clearly not a sigma male
I'm an alpha femboi
lol
you're a ligma male
and you're a toilet
name: Rust
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
at least I have a 10/10 grindset
I will have to look at urban dictionary now
I bet Alex doesn't even own rare fish.
Oh, so you're also uneducated in the rare fish market.
my asterisk is pesces. I'm my own fish
Us rare fish enthusiasts are seemingly rare these days.
lol
sorry I can barely hear you losers from the top of my grindset superiority
english is weird
for real, english is one of the worst languages. they always invent new words when they could just use existing words lol
Sorry I can't hear you losers from the sound of my sigma uncle production factory.
doocshznozzle
hehehe
is that a word
why the fuck do they say "nostril". every other language I know just calls it a "nose hole" or "hole in the nose"
Douchenozzle.
what do you even think a language is
^
well javascript definitely wouldn't qualify
man can you imagine someone invented the word nose when you could say face triangle
//! A module for error handling.
use std::io;
pub trait Panics<T> {
/// Consumes `self`, then returns the stored value, else panics with the given message.
/// # Examples
/// ~~~
/// use cnsl::error::Panics;
/// use cnsl::stdin;
///
/// let name = stdin::preadln("Enter your name: ").panics();
/// ~~~
fn panics(self) -> T;
}
impl<T> Panics<T> for io::Result<T> {
/// Consumes `self`, then returns the stored value, else the error message.
/// # Examples
/// ~~~
/// use cnsl::error::Panics;
/// use cnsl::stdin;
///
/// let name = stdin::preadln_raw(b"Enter your name").panics();
/// ~~~
fn panics(self) -> T {
self.unwrap_or_else(|err| panic!("{}", err))
}
}
so shmexy,
so many fucking comments
i hate spigot's documentation
so i pledged to make mine incredible
elaborate
YEAH
add more priorities or just make it a short?
highest priority runs last
face triangle could also be the chin of the "sigma male" video you sent
actually kinda makes sense
yeah the highest priority runs fucking last for some fucking reason
highest priority is last so it has the most impact
once you get it, it does make sense but like
nose hole could also be the hole from a piercing in your nose, specific words describe specific things
at least how I deal with stuff the highest priority is always done first
if its a high priority, its important and should be able to overwrite existing logic
yes, obviously the word I mentioned was just an example lol
I understand it once it makes sense, but like; how its described is just shit
the lowest one is the only one that actually describes it, saying being the low importance and should be ran first
though it would be lovely if there were more priorities. or just make it a short
people come up with specific words when they realize they keep referring to one thing frequently enough that they get tired of having to describe it in order for people to understand what it is
and with the actual Enum description that is Represents an event's priority in execution sounds to me like the highest would have the first execution, rather than the other way around
yeah exactly, so I just wonder how many times english people talk about nostrils and how many times people wrongly thought they were referring to people who removed their nose piercings
let me help you with that
in latin there are like so many words that mean the same thing and still people didn't die because of them. "agere" means "to do", "to trade", "to happen", "to act", "to play" and still people seemed to be fine for a few hundred of years lol
that's because it took them a few hundred years to slowly develop improvements
huh? they were like 1000 years ahead of their time
no, they were exactly where they were in their time lol
so are we, thousands of years later
after rome died, everything went to shit in europe and west asia for like 1000 years
the church of the flying spaghettimonster is the only religion that wasn't at least indirectly responsible for people getting killed
if you want to count religions that have been around for less than 15 years and have basically no following I'm sure you'll finds lots of cults that haven't killed anyone (yet)
#general ig
is there any way to get the player yaw
getEyeLocation?
okay got that working
but
how do I set the player's yaw
ew, packets and protocol lib
you can also just teleport them
that forces the yaw
man I am finding myself having to generate IDs in html, I think I'm in too deep
they are riding something so can't really do that
I mean you can but by the time you try to you have entered janktown
forcing player vision absolutely sucks anyway
What would the packet name be for a player trying to use wasd on a mount?
1.16.4 to be exact
would it be client bound or server bound? since the entity does not move by itself
its always client bound
this is server dev
or could it be server bound o.o
oh wait im dumb
actually wouldnt that only show when the entity moves not when a player tries to move?
wait
which could it be!?
i've messed with that movement code from modding
afaik the entity copies the movement from the player
so checking if the player has a vehicle while it moves is probably what you want?...
the client never sends those key presses
but a phantom does not move by default
it instead sends a move packet
whats the name of the move packet?
that packet contains the previous location and the to location that the player moved to
Player move packet for players
The player does not move though?
if it is on an entity they technically still do
it just isnt visible?
man packets are just
Ok ty I have enough information for now!
have a good day
Yeah I remember breaking my head for hours until I realized that through a lot of testings
Priority = I come first, no "I come last"
highest is last as it has most precedence and last say over the event
so do the event listeners before that still run?
yes
having it at the highest priority means it just gets the last "decision" on the event
v confusing when other event buses ive used consider high prio to be "i run before other handlers"
and not "i have the final say over other handlers"
Can someone please explain the parameters of arrayCopy() method
of which class?
if its java.lang.System#arraycopy its p simple
src is ur input array, dest is ur output array, srcPos is the position u want to start copying from the src array, destPos is the position u want to start copying into in the dest array, and length is how many objects u want to copy
System
javascript is the only language where things work on the first try and I feel like complaining that they did
JavaScript is amazing tbh
idk about that one
I mean you can do anything with it rly
javascript is just java in bad
JavaScript is java without stupid oop
I just spent 20 minutes trying to figure out how to get a div, remove one of its children, add another child and add a new parent between the two childs and the overarching child and god it's all so dumb
Bruh
you can also do java without OOP
Smh
well, "without"
W3C schools exists
And well intellisense also helps
I know it exists, I have 20 tabs of it open right now
IntelliSense is ๐๐
Intellicode ๐ฅต ๐ฅต ๐ฅต
I sort of got it working but the main issue is that the thing I'm trying to do is dumb to start with
I was just trying to be clever about it so I could go to bed faster
๐ฅต๐ฉ๐ฅบ
Tabnine ๐ป
IntelliJ
"smart"
if(args.length>0){
StringBuilder message = new StringBuilder();
for(String arg:args){
message.append(arg+" ");
}
ItemStack item = player.getInventory().getItemInMainHand();
ItemMeta meta = item.getItemMeta();
PersistentDataContainer data = meta.getPersistentDataContainer();
if(data.has(new NamespacedKey(PDS.getPlugin(),"message"), PersistentDataType.STRING)){
player.sendMessage(ChatColor.RED+"The Message is already stored");
player.sendMessage(ChatColor.BLUE+"Message: "+data.get(new NamespacedKey(PDS.getPlugin(),"message"),PersistentDataType.STRING));
}else{
data.set(new NamespacedKey(PDS.getPlugin(),"message"),PersistentDataType.STRING,message.toString());
item.setItemMeta(meta);
player.sendMessage(ChatColor.GREEN+ "Message Stored");
}
}```This code is suppose to store a message in the PDC of the item but instead is just disables the plugin
meh whatever I progressed with my webapp and it's actually starting to take shape
You making a webapp with Java?
no, the classic html+css+js
Anyone have any idea why this isn't working? I'm trying to disable dyeing of a leather armor
@EventHandler
public void onLeatherArmorCraft(PrepareItemCraftEvent e) {
if(e.getRecipe() == null)
return;
if(e.getRecipe().getResult().getType() == Material.LEATHER_HELMET ||
e.getRecipe().getResult().getType() == Material.LEATHER_CHESTPLATE ||
e.getRecipe().getResult().getType() == Material.LEATHER_LEGGINGS ||
e.getRecipe().getResult().getType() == Material.LEATHER_BOOTS) {
e.getRecipe().getResult().setType(Material.AIR);
}
}
declaration: package: org.bukkit.inventory, interface: CraftingInventory
instead of attempting to modify the recipe itself (which won't work anyway)
oh thank you!
@EventHandler
public void OnLeatherArmorCraft(PrepareItemCraftEvent e) {
if(e.getRecipe() == null)
return;
if(e.getInventory().getResult().getType() == Material.LEATHER_HELMET ||
e.getInventory().getResult().getType() == Material.LEATHER_CHESTPLATE ||
e.getInventory().getResult().getType() == Material.LEATHER_LEGGINGS ||
e.getInventory().getResult().getType() == Material.LEATHER_BOOTS) {
e.getInventory().setResult(new ItemStack(Material.AIR));
}
}
It works now
๐
is there any way to make sure that my Listeners are called after the Listeners of another plugin?
not really beyond event priority
I have a plugin which edits mobs, wanna make another which edits mobs but with a lower priority. would it suffice to check for the tags I add to some spawned entities in the higher priority plugin and otherwise let the changes I make in the lower priority plugin be overwritten?
how do I check if a player is in a portal
Using two far ends of the portal
minecraft portal
I mean, the player is in the portal when they touch the portal block
I got two ends of it, i want to check if the player is in that portal
you could also try https://hub.spigotmc.org/javadocs/spigot/org/bukkit/util/BoundingBox.html
declaration: package: org.bukkit.util, class: BoundingBox
Make sure you have the correct bounds
I do
Idk how the bb is constructed you might have to expand it
E.g it might be two dimensional if it just takes the floored cords of the two blocks
how do people work with nms? is it even possible to read it?
mappings
how can I remap it? its a pain rn
was there ever something called the packetverifier in spigot pre 1.8? found some old code that seems to mention it existing, and setting packet handlers inside a craftplayer object
thanks Cipher ๐ ๐
@tender shard why do one of the "Recent Comments" redirect to a viagra shop xD
how can I add invisible ligths that follow a player
I also want to change the colours (red and aqua, from the lantern thing) AND intensity
I was thinking of spawning invisble lanters around the player
depending on the version I believe there is a Light block
1.18
yh u can just place light blocks then
?paste
https://paste.md-5.net/hoheyoliri.xml I followed the guide but it doesnt work. the things from nms show up red
what did you import
Its in the paste at the bottom
i dont think you are using NMS
You didn;t follow the instructions correctly. you used the wrong dependencies
So im currently expirencing this https://paste.helpch.at/uhasagosuc.sql
And it says its inside here https://paste.helpch.at/jiyasizahe.cpp
but i cnat figure it
do you have such a db?
portals:
- ==: io.github.vinesh27.vclasses.entities.Portal
effects:
- ==: PotionEffect
effect: 22
duration: 500
amplifier: 1
ambient: true
has-particles: true
has-icon: true
startBlock:
==: org.bukkit.Location
world: world
x: 60
y: 60.0
z: 60
pitch: 0.0
yaw: 0.0
items:
- ==: org.bukkit.inventory.ItemStack
v: 2975
type: STONE
amount: 32
- ==: org.bukkit.inventory.ItemStack
v: 2975
type: COBBLESTONE
amount: 32
commands:
- /spawn %p%
- /help
endBlock:
==: org.bukkit.Location
world: world
x: 60
y: 50
z: 50
pitch: 0.0
yaw: 0.0
Why does getting the portals list return an empty list
?notworking
"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.
nvm i found the issue, i was getting a List<Map>rather than a simple List<>
How can I enable 2nd Skin Layer on NPCs?
so I am trying to make a plugin that hides all hoppers from players that are more than 10 blocks away from the player, is there any way of doing that without having to loop through an absurd amount of blocks?
So I have two ends of a portal, and I am checking if its the portal the player went through.
When I check using BoundingBox, it returns false. That is because the location of the player is 1 block ahead
So what should I do?
?bing TabCompletion
Bing your question before asking it:
https://www.bing.com/
thx
who uses that shit
bing to hit the bong
๐คฆโโ๏ธ
bing chilling
I use remapped nms
and I'm not sure if I got it right
my tab completions aaa
uhh idk
everyone uses normal mapping..
okay i applied a hacky fix, now it works for one direction but doesnt for the other
https://www.spigotmc.org/threads/nms-show-second-skin-layers-mojang-remapped.545726/
found this code
might work ๐
PlayerPortalEvent doesnt provide the coordinate in the portal. (It gives the block ahead of the portal, messes up when axis come in the game). How can I get the location in the portal
the portal event shoudl give you the actual portal block the player interacted with
i m using PlayerPortalEvent
test the entity one
the player one is Called when a player is about to teleport because it is in contact with a portal which will generate an exit portal.
I want it to be cancellable
so the player doesnt go into the portal if it matches the condition
then check the from location
its 1 block ahead of the portal
it should be the portal block
it isnt :(
not the player Location, use the event.getFrom()
Yes I am using that
sec I'll have to start my IDE to test it
why when i click at chest in playerInteractEvent the block is null?
on the right, the location of the portal, near the chat is the one getFrom returns
show code
public void playerInteractListener(PlayerInteractEvent e) {
Player player = e.getPlayer();
if(!e.getClickedBlock().getType().equals(Material.CHEST))
return;
Chest chest = (Chest) e.getClickedBlock().getState();
if(!shopManager.isShop(chest))
return;
String shopId = chest.getPersistentDataContainer().get(shopManager.getKey(), PersistentDataType.STRING);
player.sendMessage(shopId);
player.sendMessage(String.valueOf(shopManager.getShopCount(player)));
}```
does it throw an NPE?
java.lang.NullPointerException: Cannot invoke "org.bukkit.block.Block.getType()" because the return value of "org.bukkit.event.player.PlayerInteractEvent.getClickedBlock()" is null
at me.placek.blockeconomy.listeners.PlayerInteractListener.playerInteractListener(PlayerInteractListener.java:25) ~[BlockEconomy.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor430.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:75) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:git-Paper-186]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]``` error also
do a null check
thanks i missed that
doh had to restart. my dev server had the nether disabled so no portaling
sadge
how do u print all the blocks in a BoundingBox? I think i m onto something here
can it be converted to a Collection
with this event, it gets the portal from the bottom left corner
portals are a predictable size though, those from the game that is
easiest way is to just detect the obsidian that outlines the portal
I am making a plugin which gives player items when he goes through a portal. And I am having problems detecting the portal. I have two ends of it
then you know that the inside dimensions is the portal
@EventHandler
public void onPortal(PlayerPortalEvent event) {
event.getPlayer().sendMessage("Block: " + event.getFrom().getBlock().getType().name());
}```Reported teh portal block teh first time, then it was always air
and not actually teleport
yea i tried getting the material as well and it returned LEGACY_AIR(10) smth
did u set api version to 1.18 or whatever
tf
i wonder if reducing one block from the player's vector would work
but i need to calculate how to reduce it depending on the axis
how does one add fake lights around a player
like the light glows but doesnt show
something like a fake lantern (so i can change colours) but I also want to change intensity
@golden kelp ```java
@EventHandler
public void onPortal(PlayerPortalEvent event) {
event.getPlayer().sendMessage("Found Portal: " + !findPortal(event.getPlayer()).isEmpty());
}
public Set<Block> findPortal(Player player) {
BoundingBox box = player.getBoundingBox();
World world = player.getWorld();
Set<Block> portal = new HashSet<>();
for (double x = box.getMinX(); x <= box.getMaxX(); x ++) {
for (double y = box.getMinY(); y <= box.getMaxY(); y ++) {
for (double z = box.getMinZ(); z <= box.getMaxZ(); z ++) {
Block block = world.getBlockAt((int) x, (int) y, (int) z);
if (block.getType() == Material.NETHER_PORTAL)
portal.add(block);
}
}
}
return portal;
}```
ty
So what it will do is return a Set that contains all the Purple portal blocks thing?
it will contain a Set of any portal blocks your player is in contact with
ooh
fancy fancy
so it returned the Set, now I make a boundingbox using my portal coords to check if its that portal?
public Portal getPortal(Player player) {
for (Portal portal : vClasses.getPortals()) {
Set<Block> blocks = findPortal(player);
BoundingBox bb = BoundingBox.of(portal.startBlock(), portal.endBlock());
for (Block block : blocks) {
if (bb.contains(block.getLocation().toVector()))
return portal;
}
}
return null;
}
public Set<Block> findPortal(Player player) {
BoundingBox box = player.getBoundingBox();
World world = player.getWorld();
Set<Block> portal = new HashSet<>();
for (double x = box.getMinX(); x <= box.getMaxX(); x ++) {
for (double y = box.getMinY(); y <= box.getMaxY(); y ++) {
for (double z = box.getMinZ(); z <= box.getMaxZ(); z ++) {
Block block = world.getBlockAt((int) x, (int) y, (int) z);
if (block.getType() == Material.NETHER_PORTAL)
portal.add(block);
}
}
}
return portal;
}
You have your portal start/end, so create a BoundingBox and check .overlaps on any block from the Set
why any block?
BoundingBox.of(start, end).overlaps(Set#get(0).getBoundingBox())
public Portal getPortal(Player player) {
for (Portal portal : vClasses.getPortals()) {
Set<Block> blocks = findPortal(player);
BoundingBox bb = BoundingBox.of(portal.startBlock(), portal.endBlock());
for (Block block : blocks) {
if (bb.overlaps(block.getBoundingBox()))
return portal;
}
}
return null;
}
you only need test teh first blocvk found
oh
you are not going to be in contact with more than one portal
what if two purple block thing
So currently i have an issue where when i do the spawn command the first time it tps me too spawn if i wait 5 minutes then do it again it pulls this
Error: https://paste.helpch.at/enebuhiwux.md
CoreDatabase: https://paste.helpch.at/qeremibaku.cpp
SpawnTable: https://paste.helpch.at/ororobeken.cpp
SpawnCommand: https://paste.helpch.at/ufoviziseq.java
they will be connected, so the same portal
am i drunk or does Set not have a get method?
u mean the set right
yes
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "me.sihab.customcommands.CustomCommands.getCommand(String)" is null
what is this error?
show plugin.yml
No command of that name in your plugin.yml
and show your code
oh thanks
java.lang.reflect.InaccessibleObjectException: Unable to make field private volatile java.util.logging.Logger$ConfigurationData java.util.logging.Logger.config accessible: module java.logging does not "opens java.util.logging" to unnamed module @11d0811e what that error means?
Sounds like you are trying to serialise stuff that should not be serialised
It gives a full Set sometimes, and sometimes its empty
check for bounding box?
public Portal getPortal(Player player) {
for (Portal portal : vClasses.getPortals()) {
Set<Block> blocks = findPortal(player);
BoundingBox bb = BoundingBox.of(portal.startBlock(), portal.endBlock());
player.sendMessage(Arrays.toString(blocks.toArray()));
if(blocks.size() == 0) {
player.sendMessage("ZERO FAM");
return null;
}
if(bb.overlaps(blocks.iterator().next().getBoundingBox()))
return portal;
}
return null;
}
returns empty when i went from nether to overworld
Ohh
its if u go from certain direction
i dont understand why people always use ::size() == 0 instead of ::isEmpty
because isEmpty does not always check if the size is 0
:o
then?
where I can get all blocks list?
Material Enum isBlock
use your main class instance
to use the getConfig method
I recommended you to learn Java
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
ty
how
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
learning java
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
wrong person ๐ฆ
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Does anyone know any way/api to light up the area around a player. Id also like it if theres
-Intensity Changing
-Colour changing (Aqua/Red as Lanterns have that)
im confused
I am using 1.15.2
public class MyPlugin extends JavaPlugin {
public void onEnable() {
new ClassThatUsesPlugin(this);
}
}
public class ClassThatUsesPlugin {
private final MyPlugin plugin;
public ClassThatUsesPlugin(MyPlugin plugin) {
this.plugin = plugin;
}
}```
@urban kernel
And if it is your Event/Command, add the this paramter when registering
so either PacketPlayOutLightUpdate or https://github.com/HexoCraft/AddLight
in the onenable thingy
create the constructor for the class that requires your plugin
Can I change the color (if I am using lantern)
idk, are there different colors of a lantern?
okie, how do i use getPlugin() in Discord.jav
java
well then try it out
i mean does it use lanters for the light?
same thing
I want to make it follow the player
getConfig()*
look it up, you have the source.
otherwise just sent them a packet
Yea ill have to use packets unfortunately
domain is kinda sick
cheers
pass your plugins config thro the constructor of Discord and assign it to a field
then use it
u lost me at thro
through better
i mean u lost me as in i stopped understanding what u where saying
youre tryin to get your plugins config in the Discord class?
yessir
class MyPlugin extends JavaPlugin {
void onEnable() {
new Discord(getConfig()).doSmth();
}
}
class Discord {
final PluginConfigFile config;
Discord(PluginConfigFile config) {
this.config = config;
}
void doSmth() {
//
}
}```
so when making an instance of the Discord class, it gets the config through the constructor and sets it as a field
to use it when neede
with doSmth(); do i replace it with getConfig()?
so i can pull discordLink out of config.yml
if you look at the Discord class above, it has a config field so why not getting your stuff from there?
what the fuck are they
is there a way to control which nbt tags are sent to the clients
private, public, protected
ahah
What does protected really do?
makes it accessible from subclasses
mate what are you doin with that getConfig method
i told you to use the field
public void getConfig(){ return config; }
he just wants to get stuff from the config
i think my ide is broken