#help-development
1 messages · Page 2242 of 1
the performance is negligible
woah.
not if you are programming for a NASA rocket
If args.length ==1
we will run a spigot plugin for a rocket
this is the sole reason why im used to make enhanced for
The rockets shouldn't matter
fuck the rockets
It's stuff they send without humans that they care abt 100% performance
Like probes etc
But you don't specify any damage or you do ore.getAsBlock().getBreakSpeed(player)
the damage is based on the pickaxe i'm holding
i have an nbt tag with the mining speed
and an enum with all the ore types and their health
fuck the pickaxe
when i create a cosmicore object from a block, i set the health based on the enum constant representing that ore
and each tick i subtract from its health the damage a player does
based on the pickaxe
i agree
how can i activate end exit portal without killing any dragon
im trying to use inventoryframework but im getting an error and i dont know how to fix it
shade it i guess
how do i do that
I literally don't even know why you're listening to a packet for this
That's the whole purpose of BlockBreakEvent lol
uhh
There's also an event for when a player starts breaking a block iirc
block damage event
what about when they stop
And how do you get the damage that do the pickaxe
that'd up to you to decide how u wanna implement it
There is a stop one as well
i stored the damage in the nbt
how can i activate end exit portal without killing any dragon
BlockDamageEvent* BlockBreakEvent is not what we want
my max ram is 4gb and guy is saying my server is spiking up to 6gb
oh that's interesting
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<relocations>
<relocation>
<pattern>co.aikar.commands</pattern>
<shadedPattern>me.fourteendoggo.xkingdoms.acf</shadedPattern>
</relocation>
<relocation>
<pattern>co.aikar.locales</pattern>
<shadedPattern>me.fourteendoggo.xkingdoms.locales</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>``` add this under your <build><plugins> in your pom, pattern is the package of the stuff you want to shade @snow sluice
im using gradle does that change anything?
oh, and the nbt change depending on potion effect/enchants/ect... i guess?
TextComponent component = new TextComponent();
component.setText(event.getMessage());
component.setText(component.getText().replace("[item]", "["+name + ChatColor.GRAY + " x" + tool.getAmount()+ChatColor.RESET + " ]"));
component.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("text").create()));
event.setMessage(component.toLegacyText());```
this works fine, except the hover event part which just doesnt work (nothing when hovering)
no errors in console or anything
anyone knows how to fix it
ah okay ill try to figure it out
no
ty
my system ignores enchants and potions
im wondering how NMS executes packet handling on the main thread
if netty's IO handlers are async
there should be a method
where they pass a runnable to execute in main thread
but i cant find it
Okay, I think I will do with Block#getBreakSpeed() (i need that it depends on potion effect/enchants ect...)
And where do you display the breaking animation, i guess it's depending on the health of your ComsicOre object
can I read the console somehow
One sec
Starting my laptop
MinecraftServer.execute or smth like that
It's in the Server class
Don't use toLegacyText. That makes the entire component a string which removes the hover
like run some code on stdout line
Why do u need to do that?
What else should I use? toPlainText?
making a plugin that can send console output over websocket
Ah
I'm not sure how it's done but you'll have to use a custom logger that sends stuff before it logs
Don't use Strings send the component
add a new consolehandler to the logger
"Required type: string"
Ah ok
Nvm that's the way to go
You will have to use another method
something like this?
Yeah it's MinecraftServer#executeIfPossible
execute works to but executeIfPossible makes sure server isn't stopping
yea, but according to my research that packet handling is so weird and bizzare... They execute packet handling on the main thread with PacketUtils.ensureMainThread() method which throws RunningOnDifferentThreadException exception when code is not executed on main thread, which gets caught and nothing done with it inside Connection#channelRead0() method
it feels like NMS is built on twig foundations
It feels like Mojang has too tight deadlines they're forced to push update after update without patching or improving already existing code
They really shouldn't promise an update every 6 months and focus on improving things instead 🙃
If im correct the code prevents execution if its on netty io thread, and reruns the packet handling code on the main thread via #Server.executeIfPossible()
public static <T extends PacketListener> void ensureRunningOnSameThread(Packet<T> packet, T listener, BlockableEventLoop<?> engine) throws RunningOnDifferentThreadException {
if (!engine.isSameThread()) {
engine.executeIfPossible(() -> {
packetProcessing.push(listener); // Paper - detailed watchdog information
try { // Paper - detailed watchdog information
if (MinecraftServer.getServer().hasStopped() || (listener instanceof ServerGamePacketListenerImpl && ((ServerGamePacketListenerImpl) listener).processedDisconnect)) return; // CraftBukkit, MC-142590
if (listener.getConnection().isConnected()) {
co.aikar.timings.Timing timing = co.aikar.timings.MinecraftTimings.getPacketTiming(packet); // Paper - timings
try (co.aikar.timings.Timing ignored = timing.startTiming()) { // Paper - timings
packet.handle(listener);
} catch (Exception exception) {
am I correct @chrome beacon
Thread synchronization is a nightmare. Handling that all on the main thread is the smartest thing to do
Imagine all the possible race conditions otherwise handling thousands of packets every second
yep
Thread synchronization is nightmare especially with NMS
if you have architecture design with concurrency in mind
its not that bad
Right but nobody truly does because you need a very, very specific design pattern
Read console output
what's the difference between #Server.scheduleOnSync() and #Server.executeIfPossible() will the first one schedule it at the next tick?
uhh like what? xd do I have to broadcast instead of
event.setMessage()?
hm I can't see that method
Same
this is paper method
probs
scheduleOnMain
not onSync
but yea
its paper
method
I'm looking at paper
I also don't see that
Looking in minecraftserver and dedicatedserver
// Paper start
public void scheduleOnMain(Runnable r0) {
// postToMainThread does not work the same as older versions of mc
// This method is actually used to create a TickTask, which can then be posted onto main
this.tell(this.wrapRunnable(r0));
}
// Paper end
BlockableEventLoop
Oh
which Server extends
yeah
when I build a version with the NMS classes using BuildTools, the jar is not recognized by IntelliJ. Can anyone tell me what my error is? this is my .bat
java -jar BuildTools.jar --rev 1.19 --compile craftbukkit --compile-if-changed
I use the craftbukkit-1.19.jar which is created in the root directory.
Try directly doing it with the itemstack#addEnchant
You might want to remove the old one first
?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
yes i did it before
Well do it directly with the item and not meta
You should be using the meta
why
It always works for me without using meta
can anyone give me an example of a .bat that I can use to create a file that will be recognized by intelliJ or tell me where I can get one? I've read through this several times but never got anywhere.
java -jar BuildTools.jar --rev 1.19
Then depend on Spigot/Spigot-API/target/spigot-api-1.19-R0.1-SNAPSHOT-shaded.jar
Like the message above said
ok i test it
would i do that like this?
List<Material> materialList = new ArrayList<>();
for(String s : materialListStr) materialList.add(Material.valueOf(s));```
Hey guys, would it be possible to prevent the eyes of ender to be attracted by any stronghold whose outside of the worldborder ? 🤔
public List<String> checkListForValidMaterials(List<String> stringList) {
List<String> valid = new ArrayList<>();
for (String s : stringList) {
try {
Material material = Material.valueOf(s.toUpperCase());
valid.add(material.name());
} catch (IllegalArgumentException e) {
getLogger().info("Invalid material: " + s);
}
}
return valid;
}
ah tysm! i'll try that
declaration: package: org.bukkit.entity, interface: EnderSignal
oh nice
ah theres a matchMaterial too
Nice, so I could just getTargetLocation() then make a condition to check whether it's outside the worldborder or not ? 🤔
ye
Thanks !
public List<String> checkListForValidMaterials(List<String> stringList) {
List<String> valid = new ArrayList<>();
for (String s : stringList) {
Material material = Material.getMaterial(s.toUpperCase());
if (material != null) {
valid.add(material.name());
} else {
getLogger().info("Invalid material: " + s);
}
}
return valid;
}
without try catch
Hey, so I'm trying to make that clickable text thing in chat and I tried this:
TextComponent snoopalDiscord = new TextComponent("[Discord Server]");
snoopalDiscord.setClickEvent( new ClickEvent(ClickEvent.Action.OPEN_URL, "https://discord.gg/Jzdt65AUxc"));
But I got this in chat. Am I doing something wrong here?
Lil' problem tho, I can cancel the event, but the eye just wouldn't fire, I can't redirect it to the other nearest stronghold right ?
Might have to do it another way, like find a way to remove the strongholds that are outside the worldborder ? I tried filling it with worldedit but the eyes are still attracted to them
Send the component don't convert it to a string
wdym?
You are converting the text component to a string instead of sending it
I am sending it
player.sendMessage(ChatColor.WHITE + " " + ChatColor.BLUE + snoopalDiscord);
player.spigot().sendMessage()
Yeah that's the problem
You're converting it to a string
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
So, what should I do exactly?
Remove .2 from api version
Use this and don't send a string
thx
okay but what I have 2 links in one row?
send multiple messages lol
and what if i want them to be a certain color
that wont put it in a row though
how would i fix this?
im using the example shop
copy pasted it and its giving me errors
Combine multiple text components. Like shown in the link I sent
declaration: package: org.bukkit.entity, interface: Player, class: Spigot
okay, tysm
?checkthedocs
Not trusting that link
?paste
Don't screenshot text 🙃
Looks like InventoryFramework isn't on the server
You need to include it in your plugin
i told that before lol
you literally responded to me how to shade it in gradle
They explain how to do that in the main page README file
sorry i didnt see you told me i didnt have it installed
[16:16:43 ERROR]: Could not load 'plugins\IF-0.10.6.jar' in folder 'plugins'
org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml
at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:178) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:159) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.craftbukkit.v1_18_R2.CraftServer.loadPlugins(CraftServer.java:417) ~[paper-1.18.2.jar:git-Paper-268]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:288) ~[paper-1.18.2.jar:git-Paper-268]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.18.2.jar:git-Paper-268]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.18.2.jar:git-Paper-268]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml
... 7 more```
eee
am i doing it wrong
probably
That's not shading
Scroll down and read 🙂
relocate(
"com.github.stefvanschie.inventoryframework",
"com.xlexih.core.inventoryframework"
)
}```
i did this
How did you build your jar
Use the shadowJar task
Yeah
will the
jar{
destinationDirectory.set(file("D:\\User\\Applications\\MCHost\\servers\\JavaLearning\\plugins"))
}
work for it too?
No idea
Anyways hardcoding that is a bad idea
Did you check your libs folder
yea it is there
set the dest dir of shadowJar then perhaps
^
public abstract class Database<T> {
public abstract String getType();
public abstract T getConnection();
public abstract void close();
}
interface
Interface
but is it?
i feel so dumb yea that worked
<T extends Connection> hehe
public class MongoDatabase implements Database<MongoClient> {
@Override
public String getType() {
return "MongoDB";
}
@Override
public MongoClient getConnection() {
return null;
}
@Override
public void close() {
}
}
it's so i can do this
im always exposing my connection via a ConnectionSupplier which supplies a connection for each storage type
public abstract class SQLDatabase implements Database<Connection> {
protected final HikariDataSource dataSource;
public SQLDatabase() {
this.dataSource = new HikariDataSource();
}
public Connection getConnection() {
try {
return this.dataSource.getConnection();
} catch (SQLException e) {
e.printStackTrace();
return null;
}
}
public boolean isConnected() {
try (Connection connection = this.getConnection()) {
return connection.isValid(2);
} catch (SQLException e) {
e.printStackTrace();
return false;
}
}
public void close() {
if (!dataSource.isClosed())
this.dataSource.close();
}
}
minion, but now you technically expose concretion with your type parameter
just handle the connection internally
I usually abstract the storage
you know how to make a command that turns PVP on and off?
so I create an interface with reasonable methods, and for each database type I write an impl, then whenever I use the facade I should have little knowledge about the implementation that is being used
make a command that toggles a boolean
if the boolean is true, cancel all player to player damage events
if its false do nothing
ugh... why is there not an easy way for this...
You can also use a Set if you want to toggle per player
ye^^
moderator override aaaah
Set<UUID>
I want to make sure that when I make a command it disables pvp for everyone
or on
active
well ye use the boolean then
public interface Database {
String getType();
void close();
}
so something like this is more appropriate?
how would i get the connection tho?
wait actually ik what i'll do
You don’t need to get the connection
Let that be an internal detail for those implementations that do depend on a connection
Ideally your interface hides everything connection or SQL-related
this is how i handle my database stuff
https://github.com/FourteenBrush/xKingdoms/tree/master/src/main/java/me/fourteendoggo/xkingdoms/database
ok i understand
ty
mweh latest commit isnt pushed yet
You're welcome to browse this package as an example
I only have init(), save(), and load() methods
but why though
If I needed to do anything else with SQL, I'd add another action method
i hate it when i have another project open on a different os and i need to close stuff
You really don't need more than 14M blocks/s for a prison core
You don't though ;/
public interface StorageDatabase {
AltPlayer getAltPlayerFromUUID(UUID uuid);
AltPlayer getOrCreateAltPlayer(UUID uuid, String name);
AltPlayer getAltPlayerFromName(String name);
Set<AltPlayer> getPlayersFromIP(String ip);
void insertIPData(PlayerIP playerIP);
}
so is this more appropriate then?
looks good
well if you want, I can show you I dealt with it... but something like that looks good
what if i'd like to have another class that does database stuff?
altho you might wanna have a close and init method
should i create another connection to the db?
such as?
logs or something
mye
ahh ok
you can have another interface for that then
manually
does gitignore excludes files?
i didnt wanna have to connect to the db twice
im confused
ig it's ok to do so tho
fourteen, I believe you can still push gitignored files manually somehow, but w/ for instance intellij it filters those files so that you cant commit them
(with that being said, if you already pushed a gitignored file before it was ignored it wont magically disappear from upstream)
yes
the main reason is what if you want to log with mongo, but want to manage player data with postgre?
in this case it'd be easy since the 2 are independent
true
Yeah you can push gitignored files via the git CLI if you explicitly add them, though it will spit out a warning if you do so
It probably has to do more with loading chunks. You should load balance instead of doing everything on a single tick
Dualboot
and run git add or something
You can also take advantage of Paper getChunkAtAsync to lower to load even further
Ah
idk git cli commands
Ill reset my pc anyways so i need backups of everything
it worked perfectly! tysm!
filter 😢
I can't stop my server
Hey, is the HoverEvent deprecated?
try pause
Ctrl + C it
copied all my minecraft worlds on linux to windows lol
ohh thx
WildStacker is one big shit
copy 😳 😳
no
no bruv
Lmao
that was a joke
that exits any process
i thought that the flushed emojis would be enough
when do you CTRL+V it
copy and paste is shit on tmux
No. Just use the non-legacy constructor
Is that nms or org.bukkit
Hmmmm I'd try snooping around for a replacement
There is none iirc
But I wasn't sure so I just asked
iirc?
If I remember correctly
its the md5 shit iirc?
oh, okay
it is
ig
import net.md_5.bungee.api.chat.HoverEvent;
for some reason u can only use the Hover and Click event using md_5
yep its in the bungee chat api for some reason i will never know
so, should I just use the deprecated version of it or?
You're probably still using the legacy constructor
Use the other one
wdym exactly?
Welp...
Why the doc do not match with the IDE???
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/inventory/InventoryClickEvent.html#getClickedInventory()
I can't get this method
declaration: package: org.bukkit.event.inventory, class: InventoryClickEvent
i second that
what does the error say
one of the shittiest plugins ever
you got any suggestions
no stacker plugin at all, they all suck
i mean what do they even do besides adding those useless holograms?
why would someone need a hologram to see that there's a bunch of dirt blocks on the ground
What does your IDE say
Doesn't exists 🤷
Try invalidating caches and restarting
^
oh, this is what I currently used
spigotLink.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder("SpigotMc.org - Krzheski").create()));
what do I need to change?
You should give it a Content instead of a Component
Content is an abstract class and there are a few option as for what you can give it
I assume you want Text
So give it a Text object
CardConfigStep cardConfigStep = new CardConfigStep(typeParams, sender, cardHolder, cardType);
String randomString = RandomStringUtils.randomAlphanumeric(10);
TextComponent textComponent = new TextComponent(Lang.confirm_card_message);
textComponent.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/creditcard confirm " + randomString));
textComponent.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder(Lang.confirm_card_message_hover).create()));
plugin.getCardConfigPlayers().add(player);
plugin.getCardConfigStep().put(randomString, cardConfigStep);
new ConfirmTimer(randomString, plugin).runTaskLater(plugin, plugin.getConfig().getInt("confirm-cancelled-tickage"));
cardHolder.spigot().sendMessage(textComponent);```
Hi guys, I’m trying to do run_command of the verification command, but nothing seems to happen after clicking the text. This is after I switched to java 16 (I changed the project's java sdk to 16 too)
help me please, olivo ç_ç
okay, ty again
What I said just above applies to your code too 😉
HHAHAHA
So something like this?
spigotLink.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text("SpigotMc.org - Krzheski")));
Didn't work
Yes
okay, btw, what other components are there?
Content or Components?
Content, sorry
Entity and Item
Wait, you can have an Item when you hover on text?
Yeah, that's how the vanilla kill messages work with renamed weapons
oh
Olivo, what do you mean by content? textComponent.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Lang.confirm_card_message_hover).create());
Like this Image I found on Google
Do something like this Maik
Isnt the thing I did correct?
It is
why should I use Maik's thing then?
Nor Invalidating cache and restart worked, Nor removing spigot api from disk and redownloading it
No Maik should use yours
oh, okay
okay I'm stupid right now. Anyone got an idea on how I can supply the exception to the future here?
public static CompletableFuture<Game> fromCategory(QuizBot bot, String fileName, TextChannel channel, Member starter) {
CompletableFuture<Game> future = CompletableFuture.supplyAsync(() -> {
try {
return fromNativeCategory(bot, fileName, channel, starter);
} catch (FileNotFoundException ignored) {
}
try {
return fromRedCategory(bot, fileName, channel, starter);
} catch (FileNotFoundException ignored) {
}
throw new CategoryNotFoundException(); // <-- Obviously this doesn't work. How can I can complete the future exceptionally?
});
}
Can I change texture of Chest?
Like in case of Items and Custom Model Data?
You mean in the inventory?
nah ik how to do that
but overall the Block placed
CardConfigStep cardConfigStep = new CardConfigStep(typeParams, sender, cardHolder, cardType);
String randomString = RandomStringUtils.randomAlphanumeric(10);
TextComponent textComponent = new TextComponent(Lang.confirm_card_message);
textComponent.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/creditcard confirm " + randomString));
textComponent.setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new Text(Lang.confirm_card_message_hover)));
plugin.getCardConfigPlayers().add(player);
plugin.getCardConfigStep().put(randomString, cardConfigStep);
new ConfirmTimer(randomString, plugin).runTaskLater(plugin, plugin.getConfig().getInt("confirm-cancelled-tickage"));
cardHolder.spigot().sendMessage(textComponent);```
Olivo, this doesn't work 🙂
What part doesn't work
What happens when you click it
nothing
nop
I tried to check with a printLn in the confirmcmd section
but nothing
I hid the verification command from the console though thanks to an "antilog", brutally removed with log4j everything that started with creditcard confirm but I don’t think that’s it. I moved to this server from localhost and the only difference was the java 16 but now it doesn’t work anymore
what do you think about, olivo?
Java version shouldn't change anything
Could it be some settings in the spigot.yml/bukkit.yml that I changed?
It worked for me
hmhmhmhmhmhm
Your server could be out of date
You could also have some plugin installed that would mess with chat packets
ChatInjector/Essentials chat
It is possible?
I only need to figure out how to put 2 TextComponets in one row now
Try removing them and test it again without them
Use addExtra to combine two
[15:35:53 INFO]: Plugins (24): AuthMe, BotSentry, bPermissions*, ChatInjector*, CrackShot, CreditCards, Essentials, EssentialsChat, EssentialsSpawn, Identity, LiteBans, PlaceholderAPI, PlugManX (PlugMan), PremiumVanish, ProtocolLib, RealisticSeasons, Scoreboard-revision*, SpigotGuard, TAB, Vault, VehiclesPlusPro, Vulcan, WorldEdit, WorldGuard
add extra where?
AuthMe and PlugMan :kekw:
lmao PlugMan
textComponent.addExtra(textComponent2)
it was chat injector, thanks xd
however what's wrong with that?
No, I’m a vegan
ik haha
I dont see the big deal with putting the server in offline mode tbh. I know it may be against the Minecraft eula but Minecraft included the option to toggle it
It's for running the game when offline ;/
Ik it's not the best thing to do but many of the biggest servers have online mode set to false
Not for pirating the game
well...
wat
Any chatinjector alternatives? To inject external placeholders into essentials chat
tbh i dont even know what that is lmfao
You could just make your own chat plugin
doubt that
^^
many people do
mineberry is kinda dead now but it used to have like 3+k players every day
how to store instances of diferrent classes extending same class in same List?
ah yes pay to win offline mode server
Create a list of the super class
You can pay for ingame stuff but not the game 😂
ikr
i forgot my password on mineland and they asked me to pay to get it changed
SuperClass: LootSkull
Classes : AthenasSkull, PoisonousSkull
List is containing LootSkull but when I do .add I get error that they don't match
password servers 🤮
yeah
they r good though
have to admit, they spend a lot of time and effort into making those servers
but they also make money out of every single thing
public abstract class Animal {
}
public class Cat extends Animal {
}
public class Dog extends Animal {
}
public void someStuff() {
List<Animal> animals = new ArrayList<>();
animals.add(new Cat());
animals.add(new Dog());
}
they use a free auth plugin but ask you to pay for it to be changed? wot
oh I was doing Clazz.class not using new
thx
lol
Like this?
TextComponent spigotLink = new TextComponent("[Spigot]").addExtra(TextComponent songodaLink = new TextComponent("[spigot2]"));
I dont think it looks right
Like that but make it valid Java
wdym?
TextComponent songodaLink = new TextComponent("[spigot2]");
TextComponent spigotLink = new TextComponent("[Spigot]");
spigotLink.addExtra(songodaLink);
addExtra returns void
so, should I just ignore that, oor?
yes
is there a way to get a configuration section as a Map<String, List<String>>
one more thing, what if I want to put the link on a certain word inside a sentence?
easiest thing is to use componentbuilder
how do you get a list of every loaded permission on the server? getPluginManager().getPermissions() doesnt show all of the vanilla ones
Again dumb question from me as always
I have List of all possible options player can be given
Each has its chance ( 0 - 100 )
And I somehow want to give the player something based of the chances
Any ideas?
Assuming something goes wrong while enabling the plugin and I wouldn't like the plugin to be enabled anymore. Is it OK to getPluginLoader().disablePlugin(this); from within the onEnable method?
Yes
yes
👍 thanks y'all!
authme is way funnier lol
Hi! i have a question, i have a command in my plugin that i want to stay out of auto complete. the command is /asigner and when u start typing /a it shows you the command in the auto complete, is there anyway to stop the command from showing up?
sure
listen to the PlayerSendCommandEvent (or whats it caleld) and remove it from the list
alright thank you!
what is that
?paste
it's long
Thats eclipse doing eclipse things
it doesn't do that on the other plugins
Restart your IDE
It's not, unless u want to not see ur account again on a cracked server
I restarted it 100 times
F
one could also just buy the game and not use any cracked servers
your pc will propose you
no
you should use the plugin manager if anything
since the pm will properly deregister everything
wait i did read the sentence completely
System.exit(0);
i thought he said getPluginManager() smh
🥲
Autocompletion indexing the files required for autocompletion
eclipse being slow hehe
what should I do?
It sometimes can take a while (i.e. a minute), but after that it is rather fast
but intellij taking alot more time 😂
Oh good to know! Thanks for the correction!
wait.
It doesn't mean ur a cracked user if you play on a cracked server though. Plus some cracked servers r good
bruh
You can still use the IDE normally, just without any visual feedback as I believe the render thread is blocked during indexing
maybe cuz i only have 8 gigs of ram 😢
yeah suggestions cant be used while indexing because its indexing all the suggestions i think
caching symbols is part of the indexing
but it doesnt block the render thread
It might even be that the IDE as a whole cannot be used - though it will still register keystrokes so I don't really care
right
wait are we talking about intellij?
or eclipse
I know that in eclipse I am getting temporary freezes rather frequently (not too frequently, but still often enough to be notable), though whether those are caused by autocompletion or something else I am not too sure
always fun looking thro my old code 💀
In Intellij i have autocompletion and syntax highlighing for my SQL queries.
It even knows what tables i have in my DB so it corrects me if i misspell the name of a column.
This doesnt look too bad. Its just a wrapper for some low level stuff i suppose.
@Language("MySQL") is fun too
💀
?paste
oof
SEntity.java line 54
Something in here is null.
Make sure that it isnt.
I probably can do that too in eclipse if I would want to set up templates - but I do not do
hm
<li>- is pointless
ye i know
Put it in an <ul> block and it will show up automatically
smh
if (statistics.getMovementSpeed() != -1.0)
thats line 54
<ul>
stuff
otherstuff
</ul>```?
<ul>
<li>A</li>
<li>B</li>
</ul>
You are also using 1.8 with i suppose is NMS.
With stuff like that you are on your own. Support was dropped half a decade ago.
it's annoying
ah mye i was thinking where the <li>s were 😅
a
It only happens like once per session tops
I dont know
html hating hissing sounds
we got a html hater here
Will it stop?
You can disable autocompletion entirely if needed
There is no real alternative. webassmbly is still a baby
I just really dislike web development.
Mainly because of javascript
what is it
it's nice
its not
the colors code
AAAAAA
Window > Preferences > Java > Editor > Content Assist > Auto Activation
Though uh, I'd not recommend disabling it
At that point you might as well use vim
Isnt that a tool to softlock your screen? Didnt know you could write text with it.
Just remember - you can exit it with ad<bvjkklbtjnghnb
Imagine setting a custom exit shortcut...
that looks like the minified js code of most wordpress themes
Though really the claims that you cannot exit vim are a bit overexaggerated - it even says how you can exit it (Just doesn't mention that you need to press a to write text and Ctrl + C to stop doing so again)
Ctrl+C? The default key to go to command mode is escape, isn't it?
Ctrl + C = ^C or ETX (End of text) iirc
Excuse me I can ask questions about worldedit (dev) ?
Why not?
Though the enginehub discord would be a bit more appropriate depending on your issue
use java
instead of js
Well, you are a few years to late in that case
you mean vaadin?
ctrl+c doesn't do anything for me in vim using debian's default settings
yes
Apparently I don't know how recipes work. This is wrong lol
For ShapedRecipe what shape would I need so it has to be a 2x2 in any of the corners?
strange
Meh
String[] shape = new String[] {"SS","SS"};
To be honest I am using fedora, which might do things a bit differently
fedora 🤮
But it is a bit strange that they discard Ctrl + C given that Ctrl + C should send an interrupt signal to the process that is running
This just in, this is literally the only one I didn't try before asking lol
Fedora is the best shit out there
I am running debian on one of my servers - well I don't think it was a wise choice
what's wrong with debian?
Hello, is there been changes in commands in 1.19 or i'm a dumdum ? I'm on paper 1.19, I'm trying to make a plugin, I made plugins in the past, mainly 1.8 and 1.16.
I tried making a basic command to test it out.
package me.scaffus.noopysurvival.commands;
import me.scaffus.noopysurvival.NoopySurvival;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
public class TestCommand {
private NoopySurvival plugin;
public TestCommand(NoopySurvival plugin) {
this.plugin = plugin;
plugin.getCommand("test").setExecutor(this.plugin);
}
private boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
sender.sendMessage("DDDDDDDDDDD");
return false;
}
}
I register it in the main file
package me.scaffus.noopysurvival;
import me.scaffus.noopysurvival.commands.TestCommand;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.logging.Logger;
public final class NoopySurvival extends JavaPlugin {
@Override
public void onEnable() {
new TestCommand(this);
Logger.getLogger("Minecraft").info("[NooLog] Plugin chargé");
}
@Override
public void onDisable() {
}
}
And I added it in the plugin.yml
commands:
test:
aliases: [ ]
description: Test
usage: /<command>
And when I execute it in game, it only sends /test, the usage part. No error in console what so ever.
I'm kinda lost there. Please help 🙂
that might be the reason yeah. on debian, ubuntu, RHEL, and CentOS it's definitely Escape 😄
when making a permissions plugin how do you setup the * permission
I have a small problem and despite my research I am not finding a solution for my version
In google i find this :
Location loc = new Location(world, 10, 64, 100);
RegionContainer container = WorldGuard.getInstance().getPlatform().getRegionContainer();
RegionQuery query = container.createQuery();
ApplicableRegionSet set = query.getApplicableRegions(loc);
But the problem is that I can’t make WorldGuard.getInstance I must have a version too old
I’m trying to see if specific coordinates are protecting
public boolean ifBlockIsProtected(BlockBreakEvent bbe,int x, int y, int z){
Location localtion = new Location(bbe.getBlock().getWorld(), x,y,z);
for (final ProtectedRegion r : WGBukkit.getRegionManager(bbe.getPlayer().getWorld()).getApplicableRegions(bbe.getBlock().getLocation())) {
if (r.contains(x,y,z)) {
return true;
}
}
return false;
}
I know this is not the right method but if you have any way to do this ?
Spigot 1.8.8
Thank you in advance for your feedback 😄
@neon brook @viral pike please make paste links instead of flooding chat
Ok
setExecutor(this.plugin) 👀
spigot itself doesn't support expanding * permissions. LuckPerms for example hacks into the PermissionAttachment or however that class is called, and you'd have to do the same. Take a look at Luckperms code
well why would it work
your class is supposed to implement CommandExecutor
and then you register it to this
not your plugin
alright, could you point me in the right direction of their classes to look at or do you not know
Though as far as I know when I am using vi over on my debian server I can also exit through Ctrl + C
let me check, one minute
Thank you, I forgot the most important x)
which packet is sent to remove a potion effect from the player?
Regardless, fedora accepts both - debian (through SSH and running in vi compatible mode) only Ctrl + C
hm I can't find it right now. The WildcardProcessor.java in luckperms is doing all those replacements but where they are injecting that into the server itself, no idea
If it is running outside of vi compatible mode it also accepts escape
ok
would it be PermissibleInjector.java
bump
Look at how the brains work. Its quite different from the usual AI.
Oh you still on with your horses finding water?
Why InventoryClickEvent#getClickedInventory do not exists...
What does the event class look like ? intellij should allow you to read that by Ctr + clicking it
I know, I checked it there was no ClickedInventory...
beyond that, maybe some lib is pulling a horrible bukkit api version or smth ?
I found all other methods... but not the getClickedInventory
getClickedInvenrmtory has been there for so long th
Change the order in your pom so that spigot has the highest priority
I know...
hmmm yes
🤔 I did add Vault recently...
Change the order in your pom
or exclude it from vault 
Well stupid Vault 😂
cuz nms
You dont need it to be honest. If you just want to find some blocks around you then you can simply implement a
flood filling algorithm. Preferably an async one.
but won't it be slow
i dont understand how the villagers are so fast at finding their target
Im gonna do a hike in the woods with my doggo and after that ill give it another look.
and how do they determine if a block is reachable
okay tysm 🙏
_ _
also
are attribute modifiers "modifiable"
as in
can I store an AttributeModifer from an entity, then later edit that variable and it'll automatically update the entity?
nvm there's no set methods on it lmao
if i store a weakreference to a player, the player instance will be able to gc'd no?
Hello spigot, I have a formal request to you. I am in need of some dire information regarding spigot .
I am actually curious about something though. I've seen lots of custom inventory's and some people do it by creating custom item texutres and filling slots, however, wouldn't simply hovering over the item destroy the effect given that when hovering over an item is all client sided
and layering with title isn't ideal either as you kind of ruin the effect by shift clicking something in. I'm curious if there are any known methods to make the inventory seem less hacky to the end user
There aren't really any better ways
I was curious if you could intercept or send any packets or anything to make it better
No it's client side
oof
there's no other way
I know custom fonts can be used for small textures maybe they can be used for menus too?
I'm not sure what the size limits of them are and how they scale
ah
If you scale them right that should be enough
Or can you even scale them
🤷♂️
Well I know how to layer everything the issue is the slots look hacky any way you do it. hmm guess I'll just do more experimenting
how do i alter the movement speed of an entity in water
if I add an atribute multiplier of -1, the horse I'm riding can't move on land but can move in water
[12:00:30] [Server thread/INFO]: [HeavyWeapons] Enabling HeavyWeapons v1.0-SNAPSHOT
how do i change the version of my plugin? i don't want the -SNAPSHOT there and i wanna change it from v1.0 to 1.18.2-v1.0
It's whatever is in your plugin.yml
is there a noob guide for modding with fabric?
MongoClient mongoClient = MongoClients.create(Project.uri);
MongoDatabase database = mongoClient.getDatabase(Project.database);
MongoCollection<Document> collection = database.getCollection("players");
Document data = new Document("player-name", "maxwell");
collection.insertOne(data);
}```
sir this is spigot
oh sorry!
MongoClient mongoClient = MongoClients.create(Project.uri);
MongoDatabase database = mongoClient.getDatabase(Project.database);
MongoCollection<Document> collection = database.getCollection("players");
Document data = new Document("player-name", "maxwell");
collection.insertOne(data);
}```
any idea
and probably some half-good guide on yt
why the first one actually posts into my database
and the second one doesnt
my head is about to explode because of mongodb
i just figured out why it didnt work i think
and i want to kill myself
so i changed my project directories
i love ij cloning from gh
and ive been trying to copy the plugin from yesterday
over and over and over
XD
.............
I'm trying to develop a world generator that develops world much line in Classic, with terrain and a flat sea around it
What would be the best way to do this?
Generate the bedrock and water, and then afterwards the terrain chunks
or develop it so the terrain generates along with the bedrock? Would that even be possible?
I would overlay the usual noise generator with a sigmoid function
So that it smooths out you mean?
Otherwise you would have a hard cut from normal terrain to suddenly zero
How far back classic are we talking about?
Ah i see
I'm specifically trying to recreate 0.30 style generation
Except, with modern terrain
Any reason why you want the bedrock + water there?
Yess, to make it similar to classic
I assumed I create the bedrock + water using flatworld generation settings
and then generate a few terrain chunks in the middle of it all
Alright... then i would just check simple constraints and have most of those disabled
shouldGenerateNoise()
shouldGenerateSurface()
shouldGenerateBedrock()
shouldGenerateCaves()
shouldGenerateDecorations()
shouldGenerateMobs()
shouldGenerateStructures()
if(Math.abs(x) > maxX || Math.abs(z) > maxZ)
where and how i can put a string of code that always repeats? for spigot plugin
?scheduling
?scheduling
not again
thanks
ok so whats the best way to execute a command string and get if it succeeded
i checked spigot stash and Bukkit.dispatchCommand(...) calls
CraftServer.dispatchCommand
SimpleCommandMap.dispatch
``` and in there it says
stoopid
anyone know a decent way to add a health bar to the warden
like the ender dragon boss bar but track health of a warden
boss bar
and display bossbar to people in a certine radius
create a bossbar and display it to people in a certain radius
What class is that in?
Couldnt you call execute() yourself and override it for commands you need
Like
commandpreprocessevent
dont remember exact name
i tried but that breaks vanilla commadns
ahh
Hello guys, I have a plug-in that manages the format of the chat with this priority (@EventHandler(priority = EventPriority.LOWEST) and another to manage the radio with this other: (@EventHandler(priority = EventPriority.LOWEST)
I have a small problem, they both interact on the chat and I have no idea how to not get them both activated despite I have used setCancelled (true) correctly
First: https://paste.md-5.net/ujulifutoc.cs
Second: https://paste.md-5.net/uqujokituf.cs
Please help
Its cause theyre async events
sorry shouldve been more specific
you can use something like
BossBar bossBar = Bukkit.createBossBar("Warden", BarColor.BLUE, BarStyle.SOLID);
List<Player> playersInRadius = ...;
for (Player player : playersInRadius)
bossBar.addPlayer(player);
Cheers
will have a go later
Can I use § for implementing hex codes in legacy strings?
Your gonna have some communication issues between 2 events if theyre both running async on diff threads
Theyre both gonna complete at different times and arent in sync like normal event execution
didnt work
You shouldnt use double s's
just use ChatColor.of lol
^
i hate people writing their hex thing as &f&f&0&0&0&0
?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.
how can I stop a baby horse from being force-fed to an adult
EntityConsumeEvent
should be a thing
theres PlayerConsumeEvent
I just wondered If I could do
so asume the ladder exists
not a thing
I'm sorry but... How can I fix that? I haven’t slept in hours to finish, now it’s becoming a problem to even say "problem". Could you help me finish please? is the last thing
please
PlayerInteractEvent/PlayerInteractAtEntity it is then sadly
Whats the entire issue? Is it just cancelling the event and its not working?
i paste it and it gives me all errors
i need "Scheduling a Repeating Task"
send errors and code
?paste
well follow the guide
both are executed. That’s the problem
Well yes those events are always executed
Thats kind how the event system works :p
(i mean in my code)
And cancelling async events from another async event isnt gonna go over well for you (At all even)
Yes but the problem is that even if I do event.setCancelled does not erase anything to the other, even if they have different priorities
Create a dummy listener, the async chat event and have its method body only be event.setCancelled
comment out your other chat listeners
see if works then (IE Removes the message sent)
if it doesnt, then you have a bigger issue at hand (Spigot bug, which i assume cant rly be the case)
what are all the items a baby horse can be fed
they eat literally everything
This Minecraft tutorial explains how to feed a horse with screenshots and step-by-step instructions. In Minecraft, you can restore a horse's health by feeding it and you can also speed up how fast a baby horse grows by feeding it food. Let's explore how to feed a horse.
oh k thanks
im sure you'll cry https://paste.md-5.net/gozibunara.java
well
i still want the health regen to work, but I dont want the speed growth to happen
how would I do that?
the baby is already ageLocked
whats the best way to check if a player has joined before
preferably in PlayerJoinEvent
ohhh you could just cancel the Ageable instance that horse has
how do you cancel an ageable what
declaration: package: org.bukkit.entity, interface: Breedable
the horse is already agelocked
the age old question
And it still ages?
if its agelocked, the age doesn't go up natrually
but it still goes up if i feed it
Player#hasPlayedBefore or manually handle it by having a file of joined_players.json
or both
prolly both
wait cant i just use Ageable#setAge(0)
Hmm
idk
method specifically says it prevents the animal from maturing
i mean i just tested it
If the horse still matures, its a spigot bug
bug report when
well i could just set the age to 0 manually for now i guess
onAge { no; }
yeah that would work, just make sure to store the UUID of the horses you want stuck at age 0
ah kk nvm then
!yes;
!yesn't
so yes
wat
!(!yesn’t)
!(() -> return !(new Boolean(2 - 1)))
fuck lambdas
all my homies use Consumer<T>
IE debug
Create a empty async chat listener and cancel it
and if it cancels, you know its something in your code somewhere
They're two different plug-ins
if it doesnt, then maybe you cant cancel that event entirely
javadocs always say
if it implements cancelable
It does but sometimes spigots weird
my brain is almost dead
idk his problem seems to stem from a few different things feel like more info is prolly needed
hm
Prolly just needs debugging
i have a java server with geyser but if bedrock players try to register there cone cheats are not allowed
see what methods are really getting called
lmfao wtf
this just did the exact opposite of what I'm trying to do
now when i feed the baby horse it instantly becomes an adult after one click
@EventHandler
public void onPlayerFeedHorse(PlayerInteractEntityEvent event) {
Player player = event.getPlayer();
if (
event.getRightClicked() instanceof Horse &&
feedableItems.contains(player.getInventory().getItem(event.getHand()).getType())
) {
((Horse) event.getRightClicked()).setAge(0);
}
}
7?
why 7
i thought it was 8
1?
i have no idea how aging works in vanilla minecraft
maybe this will work as playerchatevent
thanks
didnt work
still instantly grew up?
yeah
8 didnt work either
ohh
So .. disable those outside the border of the terrain?
or wait
declaration: package: org.bukkit.entity, interface: Ageable
idk if that would work
it might
i need to make sure that not every adult horse i feed turns into a baby too lmao
i think a baby horse has negative age
scratch it, go back to the first thing i said with PlayerInteractEvent
In C++ we have something we pass as a parameter that is ..., meaning you can pass whatever there, countless arguments if im not mistaking, do we have any of that in Java?
Varargs
damn still didnt work
why is this so hard i thought it would be easy
the horse doesnt turn into an adult instantly tho
