#help-development
1 messages Β· Page 2228 of 1
Hence why i said they're masochists
java or kotlin.
Then I'd only store the network weights so the hackers couldn't see the src of the check
Java
get out
I always wanted to do ml stuff
yeah it's going to be a big undertaking, did that anticheat run off netty by any chance?
Alternative for BlockPlaceEvent#getItemInHand()?
It had 2 layers. One on the proxy and one on each minecraft server. And a Hazelcast server to do the computations (async).
And they injected a netty pipeline ofc. In 1.8 it is really important to check TCP sandwitches and packet order.
They also sent ICMP packets to the client to detect lag spoofing
impressive, how did it send the processed data back? using redis?
And i dont think they used any spigot events at all. It was all protocol based.
ah
I think there was a kafka stream queue. Or direct comm with hazelcast events. Cant remember
probably a dumb question but I can't figure out where to get the source code for Spigot-Server or Spigot-API, https://hub.spigotmc.org/stash/projects/SPIGOT/repos/spigot/browse/CraftBukkit-Patches/0003-Spigot-Configuration.patch#18, this is the closest thing I found and this references some org.spigotmc package but I can't find the source for it π
inb4 firewall blocks the response
Just run BuildTools. It installs all sources in your local maven repo.
Other than that ?stash is the gateway
?stash
ah cool, didn't notice that
is there a way to see/clone these repos without having build tools? just curious
?contribute
You can find information about contributing to Spigot at the following links:
https://www.spigotmc.org/wiki/cla/
https://www.spigotmc.org/wiki/guide-contributing-to-spigot/
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/README.md
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/CONTRIBUTING.md
If you want to fork spigot then you should take a look here
ah okay, thanks a lot
?paste
bit crap at java, how do i fix this?
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
so uh... what's going on here?
its final which means you have to initialize it to null immediately so you get a ton of errors
In spite of redis popularity concerning pub/sub, it isnβt what it really is nor was intended for initially, kafka, rabbit or sth like active is much more horizontally scalable in the long term if you need an event service of some sort
(Hazelcast can process high throughput so it is scalable enough, probably more than redis, and when j19 with virtual threads/fibber releases itβll be even more powerful)
Set it in a constructor
Can anyone tell me how to get to these methods in 1.19?
import net.minecraft.world.item.ItemStack;
ItemStack nmsItemStack = null;
&
import net.minecraft.nbt.NBTTagCompound;
NBTTagCompound compound = new NBTTagCompound();
Which methods?
I mean variables xD
net.minecraft was removed completely now the question is how I can use this again or differently
just make build tools remapped
how do i do that again?
i'm sorry, but my java isn't the best, perhaps an example can kickstart my memory??
Using moj maps is almost a prerequisite when developing nowadays ^
is it available via maven or do i have to compile it myself
you run buildtools with the remapped argument
the same way you did for 1.18
This is in the current post on spigot but this does not work
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<classifier>remapped-mojang</classifier>
<scope>provided</scope>
</dependency>
you need to run buildtools remapped first
ok
isnt java 19 already out?
Early access
?bt
Oh thanks
you can add the prefix, ?buildtools
@sterile token
Allright thanks
Why did you dye your dog?
Java 19 wot
it's a homodog
Supporting pride month :3
you should create a grindr profile and meet some dudes if you really want to support it lol
Don't mean to necroreply but do you mind sharing how you did it π
Can someone give me a project, anything just trying to improve
if (!player.hasPermission(Hub.instance.getConfig().getString("lockchat.bypass_permission") && commandLockchat.globalmute) {
}
it says && cannot be in a boolean BUT
I have used this line of code before and worked perfectly
Is it maybe spigot api updated?
Write an economy system that works over multiple nodes
spigot API has nothing to do with java π
xD
&& has nothing to do with spigot
but could you please help me figure out why
you are trying to && a string and boolean
you are missing one )
Still the error. I understand the error but what I dont understand is that ive been using that same exact line in another code and it worked
where did you put the ) ?
he's missing a ')'
player.hasPermission(Hub.instance.getConfig().getString("lockchat.bypass_permission")
?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.
i'll give you a minute
but again, why did it work before and not now
because it isnt valid java syntax
.
syntax errors are so easy to fix I don't think anyone is gonna sit here and tell you considering your IDE and compiler should tell you exactly where your missing the syntax at
I KNOW
Player#hasPermission is a boolean, they are just missing an extra )
^
Yes I put it in the wrong place. Thank you for the help.
told ya just a ) missing lmao
and thats why I asked where you put it
you doubt him now but he will be a 10x developer in a year
just watch
Any% speed run π
Lmao
its possible
I have 10 monitors 3 keyboard and mouses all hooked up to seperate computers I actually had surgery to add multiple extra hands to my body and segmented my brain in a fashion where I can concentrate on 3 things at once at max mental capacity which is a 333.33x developer. So I end up being a 1000x dev
wow
I can confirm this. I was the surgeon who did the surgery
Now you may be wondering how many IQ points do I have that I can do this. Well I've taken multiple online IQ test to confirm my IQ is greater than the range they can test. Its so high they can't evne place me on the bell curve
if you do 2 iq tests and both result in 80 points, you now have 160 IQ
its basic math
I've done so many online IQ tests that My IQ is growing
I actually sometimes set up a monitor to take IQ tests so I can gain more IQ
i hire people to do the iq tests for me
You have to say you're Mensa so you can sound like an arrogant jerk 
true
Mensa actually won't let me in because I'm so much smarter than all of the other members they were scared it would make mensa less welcoming to the other arrogent jerks
idk about english but in german mensa is also the word for the place where university students go to eat food
I'm pretty sure this guy is trolling but he's a mod and he's very obnoxious
As a Capri sun
Yea btw guys I scored an IQ score that could get me into mensa but I rejected the offer
Clearly not in Mensa
Btw idk about you guys but if I joined a group and google looked like
my google only shows places to eat
mensa is
All its good for is food anyways
still only about food lol
essen gesund ja
mensa is a group of people with planet-level IQs that will be worn out by their parents before they reach college
how much to get into mensa? 130?
yes
They claim you need to be in the top 2% of IQ's
not much more, a few points it would seem
Although you can cheat your way in apparently
IQ tests are a very poor method of determining intelligence
Any ideas on how to cancel the mechanic of villager -> witch? π€
so far I've thought about
public void onEntityTransformEvent(EntityTransformEvent event) {
if(event.isCancelled()
|| (TownyAPI.getInstance().isWilderness(event.getEntity().getLocation()))
|| !(event.getEntity().getType().compareTo(EntityType.VILLAGER) == 0))
return;
TownBlock tb = TownyAPI.getInstance().getTownBlock(event.getEntity().getLocation());
if(!tb.getPermissions().mobs) {
event.setCancelled(true);
}
}
(it has some stuff from Towny but that already works ||i think|| so dw)
But it just despawns the villager without spawning the witch xd
idk how to keep the villager in there
granted this thread is outdated
Does the TownBlock have mob spawning enabled?
- doesn't really solve the issue bc spawning a villager back in place would reset the trades/profession
yeah dw, that part works, already tested it... kinda lol
actually I'll just delete the towny thingies
but the entity is not taking damage, is it?
unsure how the mechanics are implemented
if that doesn't work you'd need to check out NMS
what is NMS? xd
oh
its a last resort if the API doesn't contain what you need
and no other sources have solved the issue
Does canceling the lightning damage fix it?
not sure, will try the 2 options
thats what i was curious about
I imagine it should since they technically it's the damage from source lightning that causes the transformation
@EventHandler
public void onEntityDamageEvent(EntityDamageEvent event) {
if(event.getCause().equals(DamageCause.LIGHTNING))
event.setCancelled(true);
}
should be enough right?
nope, actually it does nothing xd it literally just cancels the damage
and doesnt work for pigs either
you can use == for Enums
ty, actually was wondering if that was the right way of comparing xd
You can see I did !(event.getEntity().getType().compareTo(EntityType.VILLAGER) == 0)) above xd
compareTo lmao
don't
boolean isStoneBread = Material.STONE == Material.BREAD;
that's how you compare enums
yeah xd
I changed it to (event.getEntityType() == EntityType.VILLAGER)
Guess who forgot to register the Event π€‘
omg I'm so dumb
yeah my code worked before lol
@EventHandler
public void onEntityTransformEvent(EntityTransformEvent event) {
if(event.isCancelled() || !(event.getEntityType() == EntityType.VILLAGER)) return;
event.setCancelled(true);
}
That is good enough lol
That's what I thought
I'm getting a console error saying that my plugin is out of date, even though I wrote it in the same api version as my server is running
show your plugin.yml
version: '${project.version}'
main: treposts.ne.nuclearkat.main.Ne.NuclearKat.Main
api-version: 1.19
authors: [ NuclearKat ]
description: Trailor repost rewards
commands:
tr:```
What spigot version u using as dependency
what is that plugin name
I messed up with this project so the name is what the package is supposed to be called,
spigot is 1.18.2 I believe
alright
You can even go lower since its backwards compatible
Is there a way to set the same tab completer for several commands without doing getCommand("command")setTabCompleter(...); for all of them?
I generally make a base TabExecutor class, then extend it for every command I want
have a standard tab completer in your BaseCommand
then override in any special cases
alright thanks
u dont need xampp i think
How would i iterate over multiple values in a yaml list that is laid out like this:
abilities:
-
name: Ability
description: Placeholder Description
-
name: Ability 2
description: Placeholder Description
im completely lost and dont know what to type as the question for google because i keep finding unrelated problems
thats not valid yaml
dont do it like that
what would the correct yaml be
i have a list of abilities with a bunch of values under it
abilities:
ability1:
name: Ability
description: Placeholder Description
ability2:
name: Ability 2
description: Placeholder Description
well a yaml validator says its valid, but I'd question it
like that
that is correct ^
then u can do config.getConfigurationSection("abilities").getKeys(false)
which will give you a set that contains ability1 and ability2
u can use those in a loop to load each ability
sure
How could I make my Spigot Plugin send data to my Bungeecord Plugin?
use the messaging channel
= (
I know
getLogger logs it
first one goes through the logger, second one straight to java console
println prints it
https://pastebin.com/mG0d54zC
bungee.chat.ComponentSerializer.parse got exception when parsing a json sent to players to BaseComponents.
when ACTION in CLICKEVEVT is empty, this will occur.
it logs it to the log file
not a lot
but it also prints it to the console
if you're just debugging
println is fine
just make sure it doesnt end up in production code
<relocation>
<pattern>com.zaxxer.hikari</pattern>
<shadedPattern>me.saif.backpackplus.hikari</shadedPattern>
</relocation>
should i do that^
different versions or something idk
i actually faced an issue where my plugin had an older version of a lib
and another i was testing had a newer version
the newer one kept throwing exceptions
cant rem what exception
did a relocation and fixed
does sender.getName() return anything for console?
okay
Is there a way to force my tab completions for a command?
as another plugin has the same command and its tab completions override mine
just found out by accident lol
all your commands should really be prefixed with your plugin name
like /we for worldedit
How would I make a console send a command on a gui click event?
anywhere you can use an API to perform actions, but Bukkit.getConsoleSender I think
its console so no /
alright cool
I'm having a bit of trouble with the gui protection as well, I dont want people taking items out or putting them in
cancel both the click and drag events
I've got a switch statement for a one row gui, would I set it cancelled there?
InventoryClickEvent and InventoryDragEvent
Is there a way I can have a custom resource pack on my server but have it only apply to certain players?
(like a plugin or setting or something like that) (The server is version 1.19 spigot)
You could try not setting a resource pack on the server and using this to get a specific client to switch to a resource pack https://hub.spigotmc.org/javadocs/spigot/org/bukkit/entity/Player.html#setResourcePack(java.lang.String)
is this a genuine concept?
possibly
i can understand why it would be good practice
it keeps your commands unique and under your plugin
aka /lp for LuckPerms, /we for worldedit, /wg for worldguard
alrenatively you can make your plugin assert it's dominance by registering commands 1 tick after the server starts and remove anything frmo the commandmap that conflicts with ur plugin
Essentials be like
altho it does have its alt cmds
like /e<command>
essentials is really old though. before there was any conventions
people were just throwing things at the wall and seeing what stuck
how do I make a placeholder for my Spigot plugin
like for placeholderapi?
Yeaper
the API usage page and other tutors only mention how you could use other Placeholders within your plugin, but not how to make your own placeholders
nevermind, I got it
@minor otter you listen for the event and check if it has to do with leaves and then cancel it
How could i disable players from writing /server <server> until told otherwise?
you cant, however, you can change the response the server gives
Ahh. How could i do that?
should be by editing the onCommand method of whatever that /server command is
Ok will check later
and why? cant you just use components?
after debugging i noticed that when i setCurrentItem() nothing happens. any ideas?
public void tradeGet(InventoryClickEvent event){
if (event.getClickedInventory().getHolder() instanceof Villager && event.getSlot() == 2){
event.setCurrentItem(getRandomItem());
}
}```
getRandomItem() does work and it does return an itemstack
I was debbuging like this:
public void tradeGet(InventoryClickEvent event){
if (event.getClickedInventory().getHolder() instanceof Villager && event.getSlot() == 2){
ItemStack item = main.getRandomItem();
System.out.println(item);
System.out.println(event.getCurrentItem());
event.setCurrentItem(item);
System.out.println(event.getCurrentItem());
}
}```
and I got this:
```[10:24:00 INFO]: ItemStack{GOLD_BLOCK x 17}
[10:24:00 INFO]: ItemStack{BREAD x 6}
[10:24:00 INFO]: ItemStack{BREAD x 6}
unload and delete the file
means it doesnt actually set the item. what did you click? also did you try to use the slot to set the item in the inventory?
?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.
Why are you using unmapped
Well yeah
Read the 1.19 spigot release post or find mfnalex web guide for it
idk whats the problem but shouldnt you call the event before the cancelled check
and what is the problem exactly?
Hi, someone knows how to get the precise health value of a player ? getHealth() method returns a rounded value and it's not what i'm looking for
I need to store cooldowns for users on the server for the plugin, so to store it i think ill use sqlite (which i havent used before so im new to it) but what do i do when creating a table if i dont know how many records there will be, do i have to predefine the size?
getHealth shouldn't be rounded
didn't think about it thanks
of course not
but for simple things like cooldowns, why not just use the player's PDC?
It returns a value rounded to 0.5
hm interessting
But you can take like 1% or 2% of damage sometimes
yep but it's not showing with that method
I guess you could go for NMS
CraftPlayer is the implementation of Player
Player is just an interface
So when you use it in your code there is no difference
I mean they might be on a fork which rounds health
speed
DiggerItem
which ShovelItem, PickaxeItem etc extend
Don't screenshot code
also sent the entire class in a paste
we need context
?paste
ur prob in the wrong scope
the NMS itemstack does have getItem
probably a { too much or a } left somewhere
How are you building your plugin
Make sure you're actually using maven
so it remaps back
?paste
That's your pom
Why are you putting a method in a another method
Also haven't we told you like 100 times to learn some basic java before spigot
umm
can someone tell me
why my resources folder
isnt being copied into my jar
bruh
im not using spigot tho
imma send my pom
tell us
?paste
You skipped the special source plugin
i have 5 json files
in my resources folder
but when i decompile the jar
i cant find any of them
and when i try to use them in my code i cant
this is my pom
thats amazing
they arent doing spigot
so why are you here?
yes
that was said earlier
stop me?
its just a general question
bruh
this is for spigot related..
Make sure your resources folder is in the right location and that your file actually is in it
well to be fair the intellij discord requires a spare phone to chat in
it is
java discord is pretty good
outside of your IDE
the channel topic does say "ask other questions here"
nope its completely right
learn one at a time?
It's not impossible. I did learn both at the same time when I started. I do not recommend it
@chrome beacon so um
learning java is essential to even begin to use the spigot api
what do i do
hm put the project on github and I can take a look
check if the dir is in the jar. try to not explicit add the resources folder since it is already mavens default. otherwise try to not explicit add *
7smile told me
to
and directory isnt in jar
because it wouldnt eitherway
the files get copied but the folder doesnt (in normal cases)
not in my situation
man wtf
its been a day and i still cant fix such a simple issue
im almost just gonna upload the files to my website
and get them from there
...
try it
otherwise try to use a different plugin
- directory isnt in jar
- still nothing
- still nothing
Ur still having that problem?
Did u create a new project and see if it adds resources to the jar?
so either try a different command just like mvn clean dependency:copy-dependencies package
or another plugin just like maven-assembly
a
Did you invalidate caches and restart?
yes
Yeah that's it
reflection π
Just read his code and was like where's the set accessible
Reflection is cool but i hate using it
lives:
some-uuid: 8
another-uuid: 5
player-here: 1
uuid-four: 0
I have a config that's formatted like this, and I want to get everyone whose lives are at or below zero. I tried to do config.getStringList("lives") but it just returned an empty list
reflection is awful
A section?
What's the exception
What's that
Print all declared and regular fields
a list's children start with -
But will doing an access like "lives.some-uuid" to retrieve 8 break if I convert it to a list?
U should really use a db
I know but I just want to make this work for now
Well u need to go thru all then keys of the section and get the value if it's at or less than 0
sqlite
A flatfile db is faster than mysql
So format the config like
lives:
- some-uuid: 8
``` and then getStringList, iterate through that doing getInt("lives." + x)
I always opt for that when plugin doesn't have to be cross server
I know, but this is a private server with <20 people, and I want it to just work now, instead of taking days to learn how to use a DB
No ur format befor e was fine
I know I should use one, and I will convert it to one in the future, but I am trying to fix this now
how to use that tho
Oh ok
But yes getInt is the way to go
Alr I will try thgat
OHH
Obfuscation
Ur using remapped filed name
N o or p is the speed field
Probably p
32?
Speed is a float
Let me see how u printed it
So it's one of the first
Did u send all?
No i mean
The declared fileds are first
Extend the class
https://github.com/Luziferium/leet-translator/blob/main/pom.xml example pom
mvn clean compile assembly:single
And use the field
Compile andnsee whatnit changes to
Best way tbh
Since it's protected
Ye
I realized hence why I deleted
Just extend and do this.speed
And compile
Then decompile it and see what the name is
Or look at tje class without mappings
https://nms.screamingsandals.org/ use this if u need
still
i used ur whole build tag
and replaced some values with my own
but its same
Get a new pc bro
i love life
the files are copied to the classes folder
in my project
but not to the jar
ffs
isnt there some app or smth
that makes class files into a jar
:(
U can just use intellij build articfacts
no
How do I make perms for my Bungeecord commands
Can someone help me how to host repository and change the pom file? I got jars from the owner who abandoned the plugin
Host repository?
Are u making something for ppl to deoend on?
Like a plugin with an api?
Is that what u wanna do?
i've recently seen a Sign exploit that is allowing players to somehow run a execute command via a TileEntitySign? How is this ran, how does it work, and how can I design a plugin to patch this exploit?
[Tue 07:37:47 INFO Minecraft/TileEntitySign] {example player} issued server command: /execute at @a run fill ~ ~ ~ ~60 ~10 ~40 air destroy
I want to have them on my webserver
you mean like host the repo on the webserver?
Ah I'm not sure how you'd do that
with git?
Because i'm remote 1/2 of the time
Are you able to do the exploit?
no unfortunately I, nor anyone else I know can replicate it
If u really gotta do something, use intellij artifacts
we would need more infos
Where did u see tje exploit then
tf is dat
As far as I'm concerned this was fixed in one of the 1.8s π€
server console?
How ppl built jars before maven
Urs?
Are you sure it's not something u saw online?
I mean something like
<repository>
<url>repo.botprzemek.com/apis</url>
</repository>
and then
<dependency>
...
</dependency>
nah
because owner abandoned it and SSL certifiacate expired i cannot use it
Its a purpur server running 1.17.1
Ah I'm not sure how that'll work
still needing help, why is my resources folder not being copied to the jar
are there any possible fixes? i know that not being able to replicate the exploit is quite fundemental to fixing it but, any possible solutions?
No one knows
Bruh what
wtf
So it's supposed to work
Weird π€
You could try cancelling any right click on a sign π€
Check ur maven settings
im crying
does this help you?
Forget that ur using spigot
doesnt matter
clear lagg:
how can i prevent minecart from being removed when clear lagg passes
and that forum is just about that kid having a weird structure anyways
bruh?
Isn't sonatype paid?
Start over again and try with a clean project
search for the delta then to identify ur problem
then it's his setup
lol wdym setup
Send pom
tysm im not on pc sorry for stupid questions
so i had a dig thru NMS and saw this under TileEntitySign (or in moj mappings -> SignBlockEntity)
ion know what i can do with this tho
i guess i could check if a commadn sender instanceof like TileSignEntity but that doesnt implement CommandSender so kind of lost there
@agile anvil
That won't let them execute without permissions?
^?
but hasnt this been fixed years ago?
Nit for purpur maybe
does someone by chance have a tutorial to get started into generating custom capes by plugins?
capes?
yes?
you can't
but cant i apply skins including capes to players. is it not possible to get the default skin of said player and then alter the cape info
You can done it by using resource pack but it will not be the same as minecraft cape.
fake a banner to the players back
thats locked to the block grid though
nah before i use banners im going to directly alter the skin itself
and add it as an arm badge or on the back
i dont think the server actually has any jurisdiction on what happens with the cape
it must
its a client thing no?
from my understanding
armor stands
the server draws the skin and cape info from the skins.minecraft.net server and then passes them to the clients
where would you put the banner on the armour stand
xD
always that head thing
nah like ive said before im going to use armor stands or other shenanigans
im going to put it onto the player skin directly
since actual capes would interfere with this, prob as arm badge
sooo um
in my jar
japanese looks like dis
in JLabels
but
in my ide
it looks normal
why
How can I do a temp ban? I know how can I do the ban but what I can use to do a temp?
isnt there a method that takes a date as parameter?
declaration: package: org.bukkit, interface: BanList
Wdym?
add it date when it should expire
look at the constructors
https://docs.oracle.com/javase/8/docs/api/java/util/Date.html
?
Find a way to translate a string like "5d6min34sec" to a Date. Google should help you easily
depends on how he inputs the date
This is arabic
I'm using player.launchProjectile(Fireball.Class)
Is there a way to set the projectile speed?
Either use the method that accepts a Vector (length is the velocity) or apply a velocity after you spawn it
Oh so something like this then?
Fireball fireball = p.launchProjectile(Fireball.class);
fireball.setVelocity(new Vector(0,0,0));
kinda. you are setting a velocity of zero
Yeah it was just for the example haha
fireball.setVelocity(fireball.getVelocity().multiply(2));
Oh I see, thank you!
Making changes to any World objects Async is either blocked or not recommended
Is there any good way of teleporting a player riding an entity without dismounting him?
teleport the entity too π
It's not possible to teleport a vehicle (not even with NMS)
ok so the Item class has a method called .getOwner()
declaration: package: org.bukkit.entity, interface: Item
what does this mean
it usually returns the uuid of the owner of the item
but what does that mean?
what if i break a block?
entity which threw it ig
whose the owner of that item
null?
you i think?
I think thats for picking it up. only the owner can for a set amount of time
cuz you broke it
it's nullable
https://gyazo.com/657afb53d0ba067de774dd15e020bcb2 Why I am getting this and no : Wed Jun 22 14:58:15 CEST 2022 ?
Player player = event.getPlayer();
player.getInventory().clear();
if (!plugin.getConfig().contains("players." + player.getUniqueId())) {
plugin.getConfig().set("players." + player.getUniqueId() + ".name", player.getDisplayName());
plugin.getConfig().set("players." + player.getUniqueId() + ".banned", false);
plugin.getConfig().set("players." + player.getUniqueId() + ".muted", false);
plugin.getConfig().set("players." + player.getUniqueId() + ".time_ban", 0);
plugin.getConfig().set("players." + player.getUniqueId() + ".time_mute", 0);
plugin.getConfig().set("players." + player.getUniqueId() + ".reason_ban", "N/A");
plugin.getConfig().set("players." + player.getUniqueId() + ".reason_mute", "N/A");
plugin.saveConfig();
}
if (plugin.getConfig().getBoolean("players." + player.getUniqueId() + ".banned")) {
if (plugin.getConfig().getString("players." + player.getUniqueId() + ".time_ban") == "0") {
String reason_ban = plugin.getConfig().getString("players." + player.getUniqueId() + ".reason_ban");
player.kickPlayer(ChatColor.RESET + "[" + ChatColor.LIGHT_PURPLE + "Pranction Ban" + ChatColor.RESET + "]" +
" \n Raison : " + reason_ban.toString() +
" \n DurΓ©e/Date : " + ChatColor.BOLD + "Permanante");
} else {
String reason_ban = plugin.getConfig().getString("players." + player.getUniqueId() + ".reason_ban");
player.kickPlayer(ChatColor.RESET + "[" + ChatColor.LIGHT_PURPLE + "Pranction Ban" + ChatColor.RESET + "] " +
" \n Raison : " + reason_ban.toString() +
" \n DurΓ©e/Date : " + ChatColor.BOLD + plugin.getConfig().get("players." + player.getUniqueId()) + ".time_ban".toString());
}
}
aaa
java jumpscare
alr imma take ur word on it
reason_ban is a configuration section
also conventions pls
So I created a plugin that creates npcs but I get an error when I run the plugin.
This is the error:
can we see what ur config looks like?
did u use mojang mappings?
u need to use the plugin to reobfucate ur code
The remapped???
b6fe2775-5c19-404e-9df3-3c08a237c168:
name: Program132
banned: true
muted: false
time_ban: Wed Jun 22 15:01:24 CEST 2022
time_mute: 0
reason_ban: 'Insultes. '
reason_mute: N/A
yeah
plugin.getConfig().get("players." + player.getUniqueId() + ".time_ban".toString())
you closed the bracket after player.getUniqueId() instead of toString
so its getting the uniqueId of the player which is a memory section PLUS the .time_ban
what does this mean???
pls use ide to debug next time, cuz we cant help you with that every time
What?
if (plugin.getConfig().getString("players." + player.getUniqueId() + ".time_ban") == "0")u cant conpare strings with ==
it means that you put the bracket in wrong position
Ah yeah I know it works now !
great gg
Yeah I know as well, I will fix.
config.get("").toString() -> config.getString("")
is that forge?
No that's nms
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-obf</id>
<configuration>
<srgIn>org.spigotmc:minecraft-server:1.17-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<reverse>true</reverse>
<remappedDependencies>org.spigotmc:spigot:1.17-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
<remappedArtifactAttached>true</remappedArtifactAttached>
<remappedClassifierName>remapped-obf</remappedClassifierName>
</configuration>
</execution>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-spigot</id>
<configuration>
<inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
<srgIn>org.spigotmc:minecraft-server:1.17-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
<remappedDependencies>org.spigotmc:spigot:1.17-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
</configuration>
</execution>
</executions>
</plugin>
do u have that in ur pom?
i know but his classes seem like forge one's
i think he got the wrong classes
theres not a literal Player class in minecraft
its only in spigot
it is called EntityHuman
or whatsoever
he used mappings but didnt reobfuscate
oh alr
Those are mapped
Yes
which jar file did you put in your plugins folder?
?paste your pom.xml as well
hewwo @river oracle
deleted users have no rights
Go straight to Jail! Do not pass go. Do not collect 200 Bitcoin!
Can I detect which blocks are being exploded as a result of World.createExplosion()?
NMS is so weird
i really need to know if api code calls events or not
fun
everytime menu is initialized
THAT FIELD which getInventory() uses IS FINAL
HOW TF
api code = craftbukkit code = NMS code, so yes.
was wondering if that dude could use a listener
does anyone else have issues with building 1.19 from buildtools
it can build a jar but i cant seem to get nms to work with it
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
how can field which is declared final in CraftInventory can change via OBC
i literally open the same craftinventory
and i get two different instances of Container
magic
number is Object.hashcode()
what inventory are you opening?
Im trying to open merchant inventory by implementing custom Menu class
but still
it makes no sense
that final field would change in craft inventory
it works fine
its just that the instances are changing
i would like to use merchant inventory like a chest container
where you can store items inside its slots
Pretty sure Merchant inventory is created each time its accessed
im not creating inventory via Bukkit.createMerchant()
i have implemented my own NMS merchant menu class
which works fine
and you can store the items
but somehow bukkit messes it up
and changes the object inside that field
What actual issue are you having? Not getting the same inventory opened when you expect it?
yes
im doing something wrong but i cant figure out what, maven keeps being unable to find nms dependencies
it opens different inventory container
im only able to access 1.16 and 1.17 but not above
instead of the one i provided
its hard to explain here since the definitions of Inventory in OBC and NMS are different
and mixed matched
why does intellij keep suggesting i turn random classes into records?
InventoryView -> InventoryMenu
Inventory -> Container
In mojang mappings
Afraid I've not done anythign with custom Entities
if it only has final fields it can be converted into a record
have you run BuildTools for 1.19?
makes sense
i have
are you using Maven?
yes
?paste your pom
i had buildtools run its stuff for all the versions i want to use in a separate folder and i put that folder in my project build path
sec
then you are not using Maven
you just included teh jars BuildTools produced and didn;t read the bootstrap I linked
?bootstrap
Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.
Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163
i mean i also tried using maven but its unable to find any of the artefacts
What should I add to my Hub-Core plugin. Now I have vanish lockchat and freeze
my dependencies
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.17.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.18.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.16.5-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.17.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.18.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
cuz intellij stupid and it doesnt understand that we do not want to expose fields
Those are fine, so long as you have not manually imported any jars in your project
You will not get Mojang Mappings though
would manually imported jars really break anything though
i just removed em and maven still isnt doing its thing
You also can;t include spigot like that. Multiple versions in teh same pom is going to explode
You need to use Modules to use multiple versions in one plugin
i also tried simply replacing spigot-api with spigot which said the same thing
Cannot resolve org.spigotmc
1.19-R0.1-SNAPSHOT
the emoji lol
Which better. In coding plugins
Skript
Or
Java Coding
Note :- I'm a PHP & python & mc bedrock plugins developer so I have a background of programming
that says you didn;t run buildtools for 1.19
Why ?
and i think its because there are errors with it
if there are errors it did not build
skript is only good if you dont know java but its much slower
i know but why is the question lol
No clue, you've not shown any errors
Yes I don't know java I only know
Variable
Conditionals
and you should never use skript on bigger serious servers
Probably java version?
Then if you want to do plugins you should learn it I imagine
So do I move to skript until I learn Java or no ?
using java 17 also
it would give errors much sooner if im not using the right java version
Athlaeos pls answer
its at the very end, the spigot jar builds just fine
use skript if you absolutely have no other choice
but java is better
Yes I have no choice
When I learn Java I will move to spigot API
Is that okay ?
You need to delete the contents of your buildtools folder and run it again
Yup
ill try that
Mmmm
Lifesteal SMP probably
No man , but because I want to make a Minecraft server and my school vacation will end soon and , yeah the idea reached
skript is quite literally just if you dont want to learn java to make quality plugins and more so just want a feature implemented regardless of speed
its like using python to make an enterprise backend
π
what kind of plugins are you looking for anyway, im sure they're out there
ones where you dont need skript
imagine having holiday already
gotta get a blood check lol cya
No need, I can assure you you do have blood
Mm, so I can use skript for temp time or not ( Just until I learn JAVA )
You could? I mean it really depends on what you want to do
I have finished like 30% or 40% of java
And I don't think they enough to make a good server , right ?
that doesnt even make any sense
if you understand Classes, Objects, Instances and dependency Injection you are good to go
not to forget methods
Inheritance, interfaces as well
Okay Idk that
Not essential to start
do you also understand multithreading with a three layer model?
well inheritance yes
Design patterns are also nice
Thats all for later
GG
Okay so if I know
Classes , objects , methods , inheritance , and the basics
I can make plugins for my server
If that
I need to know only one yhing
nope its just ketamine flowing in there
So Classes, Inheritance, Objects, Instances,dependency Injection
Thing*
Know about those and you can do it
Okay they become 3
e
If you know about Objects Instances will not be difficult and that also leads into dependency Injection
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
But thx elgral you have made me java & plugin development start easier , thx man
Many here have started with less knowledge π
I started with copying absolutely everything ever brainless
you will cope with it later on
just do it
stackoverflow dude kekw
I learnt it later thru books after getting the motivation by doing brainless things
Yep a good google-fu, putting "Java" before everything will get you there.
will it?
go to pet adoption shelter
Worked for me
private static Bitch bitch;
public static Bitch getBitch(){
if(bitch == null) bitch = new Bitch();
return bitch;
}
i mean wtf
my 4th result gave me "How do I install Java" π
That's some nasty sudo code
lets code da bitch
what does bitch mean btw
female dog
oh
i really do be a singleton
or very nasty woman
if bitches can fly my neighbourhood will be an airport
oh
i aint got no nasty woman
hot dog actually
I eat a lot of bitches every day
my head is hurting from cpp
What you don't enjoy header files?
hurting from pointers
pointers debugging is the most painful thing in life
how is deque pronounced?
i always pronounce it like "de-queue"
but this guy im watching pronounces it like "deck"
Bro u cant make bitch private π
guess what
im privatizing the publicized bitch
Bitch is my property
Whats most reasonable way to gather "Player Camera Direction" and whats a function to return this? Preferraby 2 axis points
Basically, how rotated player is.. I mean
get the pitch or the yaw idk which one
Player#getEyeLocation().getDirection()
Get eye location and get pitch and yaw
whats getdirection returning?
A vector
a Vector of Pitch and Yaw
oh
Vector form of pitch and yaw right?
yep, unit Vector
I was using some utils from apache and was using 1.18, but when I switched up to 1.19, it no longer include apache, what should I do?
use guava or add a depend for apache 3
should I shade the apache?
I believe its on the server, but you'll have to check
its just not in the API anymore
alright, i'll test it.
thanks btw
wait
If I use apache 3, what happens to server below 1.19?
Will it throw CNF exception?
As foreshadowed with the 1.18 release, commons-lang has now been removed from the API. Plugins will not yet be broken as it is still included with the server, however it will eventually be removed in a future release. Please consider switching to Google Guava (which is a supported bundled API) or using your own copy of the much more recent commons-lang3.```
okay
So I'm using Choco UpdateChecker, and it uses commons-lang, specifically NumberUtils class.
if it were me, I'd add the commons lang as a library in the plugin.yml
Would it be better to switch to google guava?
alright
adding it to the library entry in plugin.yml will make spigot download and use that lib in 1.16+ prior to that will will use teh bundeled lib
i'm trying to add support for version below 1.16 too
below 1.18 has the commons lang included in Spigot
The path is different
ah its using a shaded version
how do we shade api's while using kotlin
apache 3 import is like this import org.apache.commons.lang3.math.NumberUtils;, and the previous version is without the 3 on the lang
i get NoClassDefFoundError exception when i try to shade any api
Then either update to 3, or stick with old and add the lib to the libraries
Kotlin, no idea