#help-development
1 messages · Page 1501 of 1
it's trying to load like the ban or ops list
will do
Then in your onEnable add getServer().getPluginManager().registerEvents(this, this);
I need to change this for public class Sunriseuch implements Listener ?
no add it
extends JavaPlugin implements Listener
extends JavaPlugin, implements Listener
no comma
grammar 😛
Done?
yes
you could also just have googled the things i told you to google
I know it's something easier for you but I'm learning and all it's so confuse
or followed the link conclure sent you
I did
Thanks ^^
if you have problems with stuff we tell you to do or link for you, you should ask about it
Now I need to see how I can do a title login
Because I was looking on YouTube and there's not tutorials
it's pretty unintuitive on spigot
it's like player.spigot().sendtitle or sendmessage or something
titles are simple, player#sendTitle
is that on the player player now? or am i confusing it with the action bar
action bar is spigot
i remember something is super annoyingly tucked into the spigot() shit
noob
player.sendTitle("title", "sub-title", -1, -1, -1)
UCH
TOTALEN KRIEG
A little PSA for those publishing to MavenCentral, with Gradle. Some things have changed compared to Gradle 6 (Gradle 7 for Java 16 now). Here's a fully working configuration https://paste.md-5.net/mutiyowavi.nginx. Happy publishing 😄
For a friends server
oo ty for this
I've also opened a ticket so they can update their docs, they still use the maven plugin which is no longer available
Err forgot one thing, under artifact at line 50, you need to add javadocJar 😄
Oops
Just noticed that error on the nexus repo manager 🙈
🥲
shame on you
Now just to figure out how to disable strict linting in the javadoc plugin :/
In maven it's easy, but I havent yet seen how to do it in Gradle
Okay, so i've been trying for a long time but I can't figure out how to make a grindstone remove lore on an item.
I think I need to replace the slot 2 with the item without lore, but tbh idk how to do that
see if there's a prepare grindstone event or something
I got an inventoryclick even and test if the click is in grindstone
@ivory sleet This one should now work fully, without erroring if Javadoc is missing 😄 https://paste.md-5.net/liyatesota.nginx
I made custom enchants, but no way of displaying them so i'm using lore to just tell the player the enchant is there. Is there a way of displaying the actual enchant? BEcause I dont think so
and so when a plyer grindstones a custom enchanted item it removes enchant but not lore, and i dont want that
hmm
is your custom enchants plugin shit
because I need a not-shit custom enchants plugin
and haven't found one
ur asking for alot
i'm a pretty demanding guy
there was one that was almost not shit
i think it was maintained by geolykt
but it had some cancerous issue with it that I don't quite remember
So, Im pretty new to coding plugins, and Id like to know how to remove items that contain a specific character, specifically the * symbol, as on this server Im on, it has player heads enabled, but we also have bedrock support, so you also get their heads, which start with a *, yet when you place it down, it causes a lot of lag.
Point is, how do I delete items that contain the * symbol in their name? Sorry if this is the wrong chat to ask questions about code :/
Do you need to use lore to show custom enchants in 1.16?
yeah
enchants are displayed by their translation keys
since the client doesn't have values for custom enchants in its locale, it can't display them
maybe with a resourcepack that overrides the en_US and other language mappings, but I haven't seen that done so I don't know if it's possible
hm
Well, you can do things like this in a resourcepack
"entity.minecraft.bee": "Beeralis",
mm, is that specific to a single language mapping, or does it override them all globally?
English lang file
you'd have to modify and bundle in all of the language mappings in the resourcepack, or people using other languages wouldn't be able to see the enchant
Just the .lang files, right?
myeah
which I suppose is viable if you do it automagically, but I don't know how copyright and that shit goes with that
iirc bundling in mojang lang files is kind of a gray area at best
You can bundle them with a plugin?
Most people in the server where this will be used use English, anyway
well, you could bundle them in a plugin, but I don't see much point in it
as you need the resourcepack to be used by the players, not the server
Wait, you can't setCalcelled an inventoryCloseEvent?
it's not cancellable, no
aw
best you can do is reopen the inventory after the event
which means delaying a player.openinventory call by 1 tick
Im trying to give a player back his items from a GUI if he closes it by accident
Like in the crafting table, to avoid deleting items
what does that have to do with cancelling the close event
I tought i could just do a workaround by avoiding it closing the inventory
updating my minigame plugin and when I right click any wants it throws this
[14:50:32] [Server thread/ERROR]: Could not pass event PlayerInteractEvent to CWD v1.0-SNAPSHOT
org.bukkit.event.EventException: null
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot-1.17.jar:3099-Spigot-c9cea60-e2f5ea3]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[spigot-1.17.jar:3099-Spigot-c9cea60-e2f5ea3]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:589) ~[spigot-1.17.jar:3099-Spigot-c9cea60-e2f5ea3]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:576) ~[spigot-1.17.jar:3099-Spigot-c9cea60-e2f5ea3]
at org.bukkit.craftbukkit.v1_17_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:499) ~[spigot-1.17.jar:3099-Spigot-c9cea60-e2f5ea3]
at org.bukkit.craftbukkit.v1_17_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:466) ~[spigot-1.17.jar:3099-Spigot-c9cea60-e2f5ea3]
at org.bukkit.craftbukkit.v1_17_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:462) ~[spigot-1.17.jar:3099-Spigot-c9cea60-e2f5ea3]
at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1591) ~[spigot-1.17.jar:3099-Spigot-c9cea60-e2f5ea3]
at net.minecraft.network.protocol.game.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:28) ~[spigot-1.17.jar:3099-Spigot-c9cea60-e2f5ea3]
at net.minecraft.network.protocol.game.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:1) ~[spigot-1.17.jar:3099-Spigot-c9cea60-e2f5ea3]
at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:30) ~[spigot-1.17.jar:3099-Spigot-c9cea60-e2f5ea3]
at net.minecraft.server.TickTask.run(SourceFile:18) ~[spigot-1.17.jar:3099-Spigot-c9cea60-e2f5ea3]```
at net.minecraft.util.thread.IAsyncTaskHandler.executeTask(SourceFile:151) ~[spigot-1.17.jar:3099-Spigot-c9cea60-e2f5ea3]
at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[spigot-1.17.jar:3099-Spigot-c9cea60-e2f5ea3]
at net.minecraft.util.thread.IAsyncTaskHandler.executeNext(SourceFile:125) ~[spigot-1.17.jar:3099-Spigot-c9cea60-e2f5ea3]
at net.minecraft.server.MinecraftServer.bg(MinecraftServer.java:1124) ~[spigot-1.17.jar:3099-Spigot-c9cea60-e2f5ea3]
at net.minecraft.server.MinecraftServer.executeNext(MinecraftServer.java:1117) ~[spigot-1.17.jar:3099-Spigot-c9cea60-e2f5ea3]
at net.minecraft.util.thread.IAsyncTaskHandler.awaitTasks(SourceFile:134) ~[spigot-1.17.jar:3099-Spigot-c9cea60-e2f5ea3]
at net.minecraft.server.MinecraftServer.sleepForTick(MinecraftServer.java:1101) ~[spigot-1.17.jar:3099-Spigot-c9cea60-e2f5ea3]
at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1030) ~[spigot-1.17.jar:3099-Spigot-c9cea60-e2f5ea3]
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:307) ~[spigot-1.17.jar:3099-Spigot-c9cea60-e2f5ea3]
at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: java.lang.NullPointerException
also note I changed computers so could be some library thing
Caused by: java.lang.NullPointerException
send the stack trace of the NPE
all of the stuff you've sent so far is useless and has no useful information
the line after the caused by
how?
It's the rest of the error
that is not the full error
ah
you cut it off
you cut the important part off
always and every time include the full error
didn't realize I didn't sorry
Im dumb
@granite stirrup o.o Could you please help me to fix that? xd
it's mad at this chunk
for (Entity e : p.getWorld().getNearbyEntities(p.getLocation(),7,16,7)) {
if (e instanceof ArmorStand) {
if (ProjectileInfo.TornadoTeam.containsKey(e)) {
if (!ProjectileInfo.TornadoTeam.get(e).equals(teamName)) {
Location entityLocation = p.getLocation().clone();
entityLocation.setY(e.getLocation().getY());
if (entityLocation.distance(e.getLocation()) <= 6) {
if (p.getLocation().getY() >= e.getLocation().getY() - 1) {
return false;
}
}
}
}
}
}```
it just said that the for () line was where it's come from
what errors
well
either p is null
or getWorld is null
neither of those should be easily achievable, though
I also refer to p higher up in the method
split each . onto its own line, or enable helpful null-pointer exception messages on your server
wait it also says
"Caused by: java.lang.NullPointerException: Cannot invoke "java.util.function.Predicate.test(Object)" because "<parameter2>" is null"
get the full error
Wait
The plugin dosen`t load
It tells me "An internal error occured..." @granite stirrup
show the error
StatusEffects.java:492
thats this
that is line 492?
the for() is
it's not just checked
You definitely have an odd error
the exception is happening in the server source
i don't have 1.17 sources so I can't really check what it's trying to do
I have never seen an error like that
sec
813 is the iterator ```java
public void updateAdjacentComparators(BlockPosition blockposition, Block block) {
Iterator iterator = EnumDirection.EnumDirectionLimit.HORIZONTAL.iterator();
while (iterator.hasNext()) {
EnumDirection enumdirection = (EnumDirection) iterator.next();
BlockPosition blockposition1 = blockposition.shift(enumdirection);
if (this.isLoaded(blockposition1)) {
IBlockData iblockdata = this.getType(blockposition1);
if (iblockdata.a(Blocks.COMPARATOR)) {
iblockdata.doPhysics(this, blockposition1, block, blockposition, false);
} else if (iblockdata.isOccluding(this, blockposition1)) {
blockposition1 = blockposition1.shift(enumdirection);
iblockdata = this.getType(blockposition1);
if (iblockdata.a(Blocks.COMPARATOR)) {
iblockdata.doPhysics(this, blockposition1, block, blockposition, false);
}
}
}
}
}```
why is it even in that method. Its supposed to be searching entities
thats possible, or a skull
Its looking like you may have found a bug (MC). Remove/comment out the code inside your loop and see if the error is still thrown
it's the for loop itself not the contents
thats why I asked you to comment out the internal code to be certain
I did
can you call just p.getWorld().getNearbyEntities(p.getLocation(),7,16,7)
no for loop
that throws the error
is there something special about where your player is? like very low down in teh world, or some odd block near?
nope
one thing that maybe could be it
is that when I was setting up the world it threw an error related to the world so I gererated a single player world and copied the file in and it worked
So its possible some corruption in your world somewhere
That would make sense
as no code you have should be capable of throwing that error
imma redo my server setup
just delete yoru world folder and let it be rebuilt on startup
Heyyy, could somone help me with my headplugin?
i don`t get a head when i execute the command :(Ü
you should quit while you're a head
badumtish
i'm a pretty funny guy
Ehh i get heads, but only when i put hin the name if other players, when i do /head i don`t get one x
You seem very bored lol
You’ve been trying to help people for hours
are you generating from an old set of configs?
i think spigot needs more api features to interact with nms really cuz if they did then no one would use nms
most of the time when I'm sitting here I'm usually waiting for something else to happen
Well too bad spigot will always depend on nms lol
get on those prs.
right now for example I'm waiting for my maven project to reimport
I don't think so?
i think u should be able to send packets for example without nms in spigot
just followed this https://www.spigotmc.org/wiki/spigot-installation/
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
you should do it then lol
Sending packets is easy
do you know now much api that must be covered then if you try to provide api for nms?
xD
Idk, i only get a head when i do /head and a name, not when i do /head.
cant i dont know how to XD
..bruh
there's already an api for nms
Quick question would you do if (this.plugin.getConfig().getBoolean("test.enable") == true) to check if its true or would you do test.enable.true
it's called reflection
yeah but that wont work on java 16
without that flag and in future versions its gonna be removed
neither would an api, then
Spigot should just not override nms classes and force it into nms. Shoulda just included it all in the src
when did you last build your server jar?
yeah but thats illegal
but that breaks a lot
like for 1.17
a lot of package names changed
it aint really an api if it breaks a ton
lol
If that was illegal they wouldn’t be able to use nms at all.
tbh like an hour after it came out so that might be it
they dont use nms lol
they patch nms
You do know that spigot is just override nms classes
Not illegal
I just ran up a new 1.17 and it generated fine
Lol show me where it’s illegal
if you have nms code in your code its illegal
laws are for pussies
real men use copyright as toilet paper
ur dumb
thats not true lol
you can use the packets still
Yea like what lol
no i meant u cant distribute it lmao
no u cant
They could’ve easily put nms src in there
you can distribute code that uses NMS, but you cant distribute code that has it
Then applied more patches than they do
ur not allowed to distribute nms
if u distribute spigot its illegal
that isnt even the point im getting at..
cuz it contains nms
gstudios is probably talking about bomp's "Spigot should just not override nms classes and force it into nms. Shoulda just included it all in the src"
If your module contains actual nms code, yes its illegal to distribute
but if it uses it, its fine
correct
it just cant copy it
as for what bomp actually means, I'm not sure
clone nms code into the spigot namespace? reimplement nms functionality with fresh code?
tho the spigot jar contains nms so u cant distribute it
that's not why I don't think
it is
it is
I thought it was because bukkit shut down
bukkit was shut down because of it
That is why spigot is built on your PC. so long as no code ever leaves your PC its "legal"
being legal is overrated
paper has a better solution tho
"better"
it doesnt take as long as buildtools to
it is
Nms is ass
So is everything built on it
so you mean a full server reimplementation
yeah, there's plenty of projects out there that do that
the thing with them is that they all die before maturing
Yes ofc
anyway spigot cant just rip out nms and put it in they code
or turn into forge
with blackjack and hookers too
which is probably still in 1.12
forge dont have 1.17 yet
the core issue is that mojang pays a big team of developers the big bucks to put together shit
That’s somewhat true but there are some that are well in the works and doing well
if you don't piggyback on nms, you need to re-do all of that yourself in a similar timeframe
fabric doesnt support every mod tho
some mods only support forge
thats why its not a thing to switch to yet
i will switch once every mods
including Phosophor's
if you can't keep up, you end up using temporary solutions and accumulating maintenance debt
will support fabric
and eventually you run into the issue that mojang is working on 1.18
and you're still on 1.12
.
with draft rewrites for 1.14 and 1.16
Has somone 3 minutes for helping me with my plugin? xd
test.enable, but you don;t need to use the == true, as its already a boolean returned
lol
Myplugin dosent work as it should, i only get a head when i put in /head and a name, not when i only do /head to get my own head :c
i cant believe how quick optifine and fabric updated to 1.17
but I need to check if they set it to true or false
oh thats a person, I thought it was some bot with stars
it took like 1 day
i actually don't understand how Gradle can be this abysmal for me lol. 
> changes plugin version in parent build.gradle
> builds project, generates VeinMiner binary with name including updated version
> plugin.yml still contains old version
like... wat
gradle cache presumably but how tf do I tell it to stop caching that?
Use stern words
write the number in your plugin.yml manually 🙃

can't trust machines to do anything right
Clearly not :((
never had that issue
i just use maven
.gradle/caches
i dont mind the speed
maybe try deleting that
ping Conclure, he's gradle
xd
COuld ypu help me please? xd
@ivory sleet you're gradle
LIke, HELLO!? r u high? https://i.imgur.com/LWykMmJ.gif
can ping him
Oh hello
But then how would it know if its true or false?
java does it for u
it returns a boolean

if is a true/false test. you are using getBoolen method
it set to true but isn't doing anything I want it to when its true
show some actual code
?paste
if u wanna check against false its if (!statement) { if you want to check against true its if (statement) { not == true or == false
am updating it manually. fuck Gradle. lol
Gaydle
mvn for life!
you know speed is the smallest benefit
Could somone help me? xd
compared to the other benefits it gives
@worldly ingot anyways
processResources {
doFirst {
file("${buildDir}/resources/main").listFiles().each {
delete it
}
}
def name = shadowJar.archiveBaseName.get()
expand "pluginVersion": version,
"pluginMain": "${rootProject.group}.${name.toLowerCase()}.${name}Plugin",
"pluginName": name
}
I useed something like this to delete the old cached files.
ayyyy 1.17 fixed performance issuess with servers on my pc :)
my fan dont go high
i am very seriously doubting that 1.17 improved performance at all
if anything it's probably from slightly to severely worse
yeah, addDefault doesn;t do what you think it does
it did
all that just to tell gradle to fuck off?
my fan isnt going loud
you are the guy who said 1.14 outperforms 1.16
like a jet engine
What does it do then? Doesn't set the it to true automatically?
you are literally the last fucking person I will take a performance analysis from seriously
its for setting defaults if a value doesn't exist.
lol yeah tbf gradle is good when it works but it's beyond hell when it doesn't
the only optimization I heard is that plugins dont have to use reflection anymore to set fields for packets
in nms
they can pass to constructor directly
just use set
and it would be a little faster
yeah but my fan in my pc isnt going like ultra jet mode when running mc and server
rebuilt, resetup the server, didn't have the generation error, imma try my code
and the server actually runs
XD
i think mc ran in its backup java ?
cuz i dont have openjdk java
and it says mc is running with that
It's still isn't sending the message
You'll need to show more code then. like if you put a message at the top of the event does it show? ie is the event even being called?
also, you are doing this in the PlayerJoinEvent, that mesage will never be seen as they player isn;t actually online yet
@wraith rapids actually normally mc and the server uses more cpu than that so cpu usage is better
I've got a delay on it
@granite stirrup you're wrong
?
then test the event is actually running, if not make sure that class implements Listener and you registerEvents on it
for me it normally uses like 30% for server and 45% mc for cpu usage
that is an useless metric
The event is being called
well yeah fps isnt better but
Could somone help me please with this:
package sircapalonge.cbsystem.commands;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.SkullMeta;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.Arrays;
import java.util.stream.Collectors;
public class Headcommand implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (label.equalsIgnoreCase("head")){
if (!(sender instanceof Player)) {
sender.sendMessage("§8[§eBeecraft§8] Du §3kannst §8diesen Befehl §3nicht §8nutzen.");
return true;
}
Player player = (Player) sender;
if (args.length == 00) {
player.sendMessage("§8[§eBeecraft§8] Du hast §3erfolgreich §2" +player.getName()+ "§3 Kopf §8erhalten.");
player.getInventory().addItem(getPlayerHead(player.getName()));
return true;
}
player.sendMessage("§8[§eBeecraft§8] Du hast §3erfolgreich §2" + args[0]+ "§3 Kopf §8erhalten.");
player.getInventory().addItem(getPlayerHead(args[0]));
return true;
}
return false;
}
public ItemStack getPlayerHead(String player) {
boolean isNewVersion = Arrays.stream(Material.values())
.map(Material::name).collect(Collectors.toList()).contains("PLAYER_HEAD");
Material type = Material.matchMaterial(isNewVersion ? "PLAYER_HEAD": "SKULL_ITEM");
ItemStack item = new ItemStack(type,1);
if (!isNewVersion)
item.setDurability((short) 3);
SkullMeta meta = (SkullMeta) item.getItemMeta();
meta.setOwner(player);
item.setItemMeta(meta);
return item;
}
}
I only get a head when i put in /head and a random name.
Not when i do /head, when i do /head i should get a head but i don`t :c
atleast i can run a mc server and mc together now
?paste
You are going to have to show more code then. What you have now is fine from what I have seen
ElgarL it was world corruption and/or a bad build of spigot
whats the issue?
you have to tell us code, the issue
etc
good
give us info
I mean there isn't much else to show here is how I register the event ```java
getServer().getPluginManager().registerEvents(new OnJoinEvent(this), this);
There isn`t an issue, the problem is, that i donÜt get a head when i do /head, only when i do /head an a random name.
for the second time, use a pastebin, dont just paste huge blocks of code into chat
setOwner doesn't necessarily complete the profile and textures for an offline player
and java getConfig().set("test.enable", "true");
that is called an issue
lmfao
also, you dont do if (label.equalsIgnoreCase("head")){
how are you delaying? as all that code is fine
delete that
i need help make server minecaft witch plugins
Oke o.o
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable() {
@Override
public void run() {
player.sendMessage("test");
}
}, 200L);
wait can u combine plugins?
thats fine too
like make a plugin thats just a mash of other plugins thats opensource?
Yeah so I'm a bit confused on the issue
Do you thionk that i should work now?
i wonder how old the bukkitscheduler is
I'd say throw it all on paste and I can take a look, but nothign you have shown is wrong so far
?paste
@paper viper Now nothing works, bcause there are two errors o:
what errors?
also have you learned a bit of java before
U are using the string of true
Not just true
ah
get rid of the copyDefaults
Ehhh not really, no o.o
I watched lots of videos, but not really java, no :c
my bad haha
also in yoru registerConfig you could just replace that whole method with saveDefaultConfig()
saveDefaultConfig() will make teh dataFolder and copy the config from the jar to the folder if it doesn;t already exist
@proud basin you have a wonderful chin
lmao
Ok oh thank you
it complements your nose
lastly, reverse the lines in yoru onEnable for config() and registerConfig()
genuinely 5/5 combo
you want to create it before you update it
Wtf lmao
so I don't need if (!getDataFolder().exists()) in registerConfig
Nope
Interesting
the method is named poorly
aw
it's actually saveDefaultConfigIfNotExists()
...
but i guess saveDefaultConfig was shorter so they made do with that
lambo
to be precise createFolderAndCopyConfigResourceIfNotExists()
That's way to long
pretty much
no actual saving takes place
it just copies an embedded resource
which is why it's the only bukkit config 'save' method that doesn't nuke comments
Yeah but I think for the memes
should change it to that just for the response from the paper devs when they are like wtf
lol
Would anyone know how to fix ```Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.2.4:shade (default) on project World1-6Utils-Plugin: Error creating shaded jar: Problem shading JAR E:\project\Intellj-IDEA\Git\World1-6Utils\target\World1-6Utils.jar entry com/andrew121410/mc/world16utils/sign/screen/pages/SignPage.class: java.lang.IllegalArgumentException: Unsupported class file major version 60
where paper 1.17
Not out yet - you can see the development in their discord (they are streaming it)
not released yet
see this shitty reddit thread for what's up
That error is listed in the forum post linked in the #announcements
Oh
Is there any other way to comment in yml other than #
no
No
^
how can I add a space between each config line like ```
water: true
candy: true```
you can't if you are saving it
oh
Changing to 3.3.0-SNAPSHOT for the maven shade plugin fixes it
What is the other way than saving it?
im trying to change fish to they always think they are in water but i dont really know how can someone help me
there is no other way
if you save it all comments and spacing is removed
wym
a config copied from the jar is saved just as it is, with all comments and spacing.
If you make changes to the config via code and save it all comments are removed.
i only gave my 1.17 server 1gb of ram and its 20 tps
and im like on the worst hardware XD
so type the config manually in the config.yml?
yep
There still isn't spaces
you have to add them. Format it however you want
just don;t change settings via code, nor call save()
well just don;t call save()
so I put ```yml
test:
enable: true
yes
test:
enable: true
water:
enable: true
``` so like this
yes
Mine isn't working out when I replace the 1_16_R3 to 1_17_R1
yea no there isn't spaces still
are you still calling save() ?
maybe 🙂
u cant just replace it and expect it to work
🙂
I did that from 1.15->1.16 and it's Revisions? Must be something with 1.17?
Or do I just, well, fix the things that tail after it?
yeah packages changed in nms 1.17 i think
yes, 1.17 uses mappings
which means that everything is no longer in the same package
but actually in the packages that mojang uses
Can I get a doc or a change guide on it?
Thank you! 🙂
i dont think there is one
nms isnt a api
or apart of spigot
it mostly should be avoided
Is there a better way for BlockEvents or MobGeneration than NMS?
u can spawn mobs without nms
yep
I'll be seeking a different tutorial then!
nms should always be a last resort.
Is there a method to convert tick into seconds?
If only there was some way to expand the API to cover packets
I guess ima do some math to make one
how could i use NMS in 1.17 i have never tried using it before but my friend asked me to try and code him something to change axolotl and dont really know what im doing
yeah the math is easy
If your server is running with no lag at 20 tps, its 20 ticks to a second
ok
(ticks*(0.05*60))
ye
so seconds / 20 ?
ah ok
2 seconds is 40 ticks
2 * 20 = 40
40 / 20 = 2
hm how am I gonna put a variable then L as it would count it as part of variable
what
this is for bukkit schedule
you dont need to convert an integer into long
what are you trying to do
convert seconds into ticks
seconds*20
multiply by 20
yes I know that
it surely can't be that difficult
but then I need to do timeL
what are you concretely trying to do
no you dont
no, you don't
I can't just put time
hey i just said that
i had a comma
and an apostrophe
public int ticksToSeconds(int ticks) {
return (ticks * 20);
}
public float secondsToTicks(int seconds) {
return (seconds / 20);
}```
LOL
don't listen to this guy
that's exactly right!
he doesn't know anything
?
good job idkidk123123!
oh wait did i do something wrong in it?
I can't put a comma you know that
long myLong = 20;
20 is an int literal
however
java upcasts it to 20L automatically
the same will happen when you are calling a method that wants a long
like runTaskLater
the int is automatically converted to a long
assuming 20tps
well technically u can make it accurate
run your server faster with this one simple trick! public static final int TPS = 25
public static final int TPS = Integer.MAX_VALUE
so I should just do long time = seconds * 20
oh
or just runTaskLater(plugin, () -> {code}, seconds * 20)
cod
no need to make a variable
cooked code
how would i edit an entity
entity.remove()
my server is like loading 1 chunk per 2 seconds 🤣
Bukkit.shutdown()
if you wanna be a professional, use paper and use their Server#getTPS method
https://papermc.io/javadocs/paper/1.16/org/bukkit/Server.html#getTPS()
declaration: package: org.bukkit, interface: Server
1.17?
ye
tps can fluctuate, it doesn't really matter
the best you can do is schedule something asynchronously, so tps doesn't affect it
how old is the bukkit scheduler
as old as bukkit
wow old
was reading about whatever the fuck happened to bukkit earlier and jesus christ its a rabbit hole
legal is bullshit, basically
yes
to sum it up really it was just illegal cuz it contained nms
your mom contains nms
same as urs
what
Yea its a maven project that i imported from eclipse
Making sure it still works
Got no errors in the IDE
You need to make an artifact
XD
if youre not cringe and you use intellij you can double click this 😳
and find the maven package button
then you throw salt over your shoulder
hippity hoppity in a circle 5 times
draw a pentagram with virgin blood
and hit the package button
quick question how could i use ' in config.yml because it just message up when its in a string
oh I'm allowed to use "
what i used ' ' without \
yaml is weird about being human friendly
so it lets you escape ' with another '
which is dumb
you can use double to wrap a string, then use ' inside
ayyy a epic 2 chunks a second
or escape it
also that
the annoying thing about yaml is that it tries to be too human friendly
leading to like 50 different ways of doing things
What is this 1.17 bug which keeps world loading @ 0% - is it loading something else first?
looks dumb though because now its don''t
how can i edit an entity in 1.17
please elaborate on what you mean by "editing an entity"
i want to make it so axolotl think they are always in water so they just swim everywhere
use \' or "string that isn't broken"
Is there a way to build to a specific folder with maven in intellij?
real men use don\u0027t
i want to make it so axolotl think they are always in water so they just swim everywhere
whats 0027?
UTF-8 code for '
You would have to edit the blocks i think..
that still messes it up
you dont need to repeat your question nor should you ping me thanks
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/LivingEntity.html#setSwimming(boolean)
declaration: package: org.bukkit.entity, interface: LivingEntity
which did you use?
\'
use unicode like a real man
with quotation marks you can put almost anything in there so long as its not another quotation mark.
either
' don''t '
or
" don\u0027t "
iirc u need double qoutes for the latter
a
LMAO HE CANT GET ME
or yaml No-Permission: "&cdon't" Should work
its obviously " 🙂
i think omitting the " s lets you use special characters all you want but I can't fucking remember
yaml and its fifty fucking trillion syntaxes for a string
so i believe ' < u use these for unicode and stuff and u use " for strings
oh thats how it works in python or something idk
\u is unicode
bro i'm actually confused lmao
no i meant it allows u to use \u
ah yes
so what should I use
any
the one above I showed you will work
arguably "don't" is most readable of them all
what if i liked 'don''t' :)
¯_(ツ)_/¯
is there anything new in the new api
we really need to have a packet api in spigot
string: |
don't
I mean it wasn't any major additions to the api
I mean the api is kinda meant to abstract away the need of using packets
you aren't supposed to need to send packets
aha works
hiding entity's u do
man screw yml
yes, well, the api doesn't support doing that
cuz the api only does hiding player for a player
so we kinda need a packet api for spigot
or just a pr to add that functionality to the api
thats broken on 1.17
packets aren't part of the core spigot api because they change wildly from version to version and there is no way to keep them constant
wrapper?
still not constant
how did protocol lib do it then
protocollib's interface is not constant
it still can change from version to version
Do you guys start your plugins at 1.0.0 then go to 1.0.1?
0.1.0 -> 0.1.1
I start at 0.0.1
real men only have 1.0, because real men get everything right on first try
Some start at 0.0.1, some start at 1.0
but i start 0.0.1 for beta or alpha
thats what i do too
Anyone else having issues with changing the player attack speed attribute? It always resets back to default after the first hit for me :/
0.1.0 for release
1.x is generally used for release
and if u release like a major build or something u could do 1.1.0
i like major.minor.patch
and release is a minor update?
minecraft 2
mostly 0.1.0 tho is just bugfixes and improvments of 0.0.9
what
the patch is used for tweaks where for instance the api doesn't change, minor might have an impact on api or how the api should be used and then major which basically is like new features I guess.
then do you go to 0.0.2?
the first full release of the project is definitely a major update
even if nothing changes from the last patch
it marks a milestone in the project's lifecycle
it entirely depends on the changes
What if its just like a config update?
Then we need to think about it, is it a new config feature? Does it have an impact on the api? What consequences will it have? etc
Yes, no, It won't have any as it would allow them to customize more
At the end of the day you decide yourself. But be reasonable about it.
agh I don't know
I consider patches mainly to fix and tweak bugs and optimizations.
hm
just use a build number and increment it with each change
like 1.0?
that 1.0 would imply that there is a smaller increment than 1
there might be a 1.1
or a 1.2
with 1, there can only be 1 or 2
no in-between
if you have in-betweens, you need to decide whether an update is major (increment the bigger number) or minor (increment the smaller number)
i don't know anymore
so the solution is to have only one number
Would a config update be a major update?
one that you don't need to think about
no
you start at 1
then you go to 2
then you go to 3
no in-betweens
no dots
just a number
but what if it's a like a small update?
then you also increment it by 1
there is no distinction between small or large
if there is, you need to make the choice
which is what you're having trouble with
also doable
in the only public plugin I have, I use a pretty fringe versioning scheme
plugin version, paper build it was written against, nms version it was written against
like 2.3.1 484 1_16R3
or you have builds instead of versions like some other projects.
Build#1 Build#2....
but i am not a fan of that
yeah, that is what I was describing earlier
it's less informative, but because of that, it's less effort
i would handle it like chapter of your project.
chapter 1 = 1.0
an update to chapter 1 = 1.1
an update to the update to chapter 1 = 1.1.1
next chapter = 2.0
hm ok
So since Im already have 1.0 out I would go to 1.1
^^
ok ok
I want to make my own placeholder in my plugin (without PAPI) so if the lang.yml sees {player} it'll use the players name. Any suggestions on how to do something like this?
String::replace
o papi!
omg ok this first step of the code going back to ofustaction to go to miencraft objects sucks, tbh should have waited till it was fully ready.
Ok dope just released the update thank you @hybrid spoke
I have a question: Is it possible, to create custom recipes, with custom items?
I created some custom items, and i want to use them as ingridents. Could somone please tell me if that is possible and how?
not with spigot/bukkit afaik
You can
You can using the RecipeChoice#ExactChoice, I'll find a javadoc link quick;y
you have to use an event iirc
Anyone know much about gradle 7?
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Wait, i send what i have coded, i want that instead of emeralds blocks, the recipe uses enchanted emeralds blocks:
You would set the ingredient using the top javadoc link, and you would put a RecipeChoice using ExactChoice in with your itemstack and that has to match exactly
Oh i can`t send screens here.
You would need to verify
Okay, wait tysm for your help, altough i don?t really understand what i have to do o.o
Does anyone know how to include a dependency from a modular project in gradle 7?
you mean the module itself?
Yea so I have 38 projects in one solution and I am trying to add the dependency from one to the other,
In gradle 6 it was
complie(":<projectname>")
Yes, i created it like that.
But now i don`t know how to use a custom item as a ingridient.
implementation(":<NAME>") i guess
Replied in DM
are you in your settings.gradle or in your build.gradle?
also are you in your dependency {}?
build and yes
i made a whole plugin for custom recipes
supports RecipeChoice (exact and material) and multiple choices
meant implementation 'name'
yes
it takes it and accepts it on the refresh but the project does not see the dependency
ugh hm, i don't like gradle. @ivory sleet could help you i guess
make sure your settings.gradle includes your module
grADle (gaydle) is to complex
@quaint mantle for custom recipes, you should honestly just use a separate plugin instead of hardcoding it within yours (unless you're gonna publish it)
oh snap
the 'project' declare might have done it
let me update the 38 plugins and see
I'm trying to copy a file from the resources folder but get this instead.
Error: https://paste.md-5.net/ituheyuvel.bash
Code: https://paste.md-5.net/elawohofix.cpp
so its not in the jar
that's not the jar is it
So werid lol
fiiiiiiiiiiiiiirst of all
lol u can run viaversion on fabric its called viafabric
why
what do you mean by that?
the final jar doesnt have it
So it works but gradle does not like it give me ui errors, but complie is fine lol
use a decompiler
okay, i'll try.
he can just look into the zip
or that
o.o
on the jar but not in your destination folder, right?
so why are you trying to get it from plugins/TheOnly-MobCoins/categories/armor.yml
hey, I coded a plugin, built it, and added a copy of the jar to /plugins folder in my server, but when I run pl on console it says 0 plugins installed. Is there anything else I have to do?
did you restart
yep
ahh i get it now
did you look in the console for the error
any errors?
still pl returns 0
so just get from categories/armor.yml
none that I saw
look closer
ah i see
do you have a subclass of javaplugin? did you add the jar correctly?
?paste if you're gonna send an error here
my plugin.yml isnt in the jar for some reason
ah sorry
that was a text wall
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
just building and duplicating
plugin.yml is listed in my source packages next to the two classes in the plugin
the plugin.yml should be on the root of the plugin folder or whatever
ill try this, ty
@hybrid spoke Conclure at your service
Hi guys; so I have a file structure coupled with my config.yml
However, my other configuration.yml files are not being created by bukkit when I run my plugin. Do I need write a script that creates this? Is it not sufficient to simply add these files to your resources section with default values?
Plugin#saveResource
So, I'd have something like this:
[config.yml]
|
[config2.yml]//not in the directory
|
[plugin.yml]//not in the directory
|
+ [config3.yml]//not being created
|
[config4.yml]//not being created
I'm not sure how to interpret what you're saying
Where do I do this? I don't create these files in the code; I created these files externally in my IDE & have them packaged with the jar via Maven
Hey, using fastasyncworldedit in 1.16 or so whats the best way to load a schematic, paste it at a location and then loop the paste region finding certain blocks?
I've been trying to use its api but the docs are useless for it.
There's no decent docs explaining how to do things at all.
I mean, whenever I try and build using fawe it just doesn't wanna work at all.
Just make sure to use the fawe edit session instead of the worldedit one
yup, listen for the tab complete event and cancel it for that specific command
@ivory sleet I tried what you said at the start of my plugin via the following lines:
``` plugin.getConfig().options().copyDefaults();
plugin.saveDefaultConfig();
plugin.saveResource(plugin.getDataFolder().getPath() + "\\capturables\\Nations-Config.yml", true);
plugin.saveResource(plugin.getDataFolder().getPath() + "\\capturables\\Town-Config.yml", true);```
However, I am now running into this problem:
java.lang.IllegalArgumentException: The embedded resource 'plugins/nationsatwar/capturables/Nations-Config.yml' cannot be found in plugins\nationsatwar-0.0.1-SNAPSHOT-shaded.jar
Finally, I am using the maven build goals 'compile package'
I just wish there was more resources on doing it you know?
Actually, any resources of worldedit will be the same for fawe
The only thing that will change will be the edit session
and that's mentioned in their doc
Which docs is best to follow then?