#help-development
1 messages ยท Page 254 of 1
to not instantiate a bunch of those objects
ah well theres a reason its a set, and that is that the names of the effects dont matter, also, each of those effects should get instantiated since each of them does something unique on the world.
what im doing is extending effectPreset and writing the functionality in those classes
then im looping over the set and trigger them
internally its actually handeled via a <string, effectpreset> map but thats cuz there's 'secondary' effects
uhh i think i lost you
?paste
what im asking is how do i best sort/assign the configurationSections to the classes extending the preset
well doesnt it work to give a configurationsection to each of those classes?
well yes. Each of the classes expects a different structure, but in the top there's a entry that gives the type of the effect
im just really not sure how to create and assign the map of those effects
Hey, I have a question concerningarrow damage calculation :
Multiply that by the arrows damage (defaults to 2) and then round it up (always) to the next integer.
If it is a critical, add a random whole number between and including 0 and (previous amount/ 2 +1). (my understanding of critical in the context of arrows is the bow must be fully charged)
Add enchantment damage.```
I found this, but I'm not sure it's relevant in 1.18.2 or above anymore, or what "arrow damage" is, is it always 2 ?
the effect arrows might have different values
I heard magic damage gets added at the end or something, not affected by velocity
I'm trying to make my custom damage handling, but for arrows, I'll need to use velocity (as to not allow players to spam floppy, but damaging arrows)
cant u just print out arrow type and arrow damage to console and spam ur bow for 3 minutes
(?)
arrow type is irrelevant
I'm trying to find out how the damage is calculated according to arrow momentum
or even, how and where that momentum comes from. Still sqrt(xmotion2 + ymotion2 + zmotion2)?
ah, ok
is momentum still multiplied by it?
My question was not at all about getting the damage, I already know that method
It's about how momentum modifies that damage value to output one that scales with speed
likely. I'm trying to check but i cant find the source rn
I think I found it, google hid it well before the first page though. Weird that reddit posts about this come out before the mc wiki does
right blast chamber
i forgot about that
some people thought it fun to build a railgun
just to be clear, blocks/tick (in z) is given by arrow.getVelocity().getZ
either tick or second
it returns the block the arrow is in
oh nvm was looking at the wrong thing
thanks anyway ^^
in placeholder api?
java.util.ConcurrentModificationException: null whats this shit
happens when i remove an item from a List
dont remove an item from a list when iterating over it
i see
unless it's a concurrent list
tfw I don't want to use bootstrap but I was using some stuff I liked from bootstrap
has anyone used MiniMessage? it seems that new lines are not uh working
they're not being displayed even though I added either empty components or used the correct tags
eg java MiniMessage mm = MiniMessage.miniMessage(); Component lore = mm.deserialize("<dark_gray>stuff</dark_gray><newline><br>"); lore.append(Component.empty()); lore = lore.append(mm.deserialize("<dark_gray>more stuff</dark_gray><newline><br>")); lore = lore.append(Component.empty()); not a single new line is displayed lol
is that actually a thing in mm
@molten hearth Does it work in a chat message?
<newline> or <br>
either
hm let me see one sec
and yeah
<br> doenst render I saw it in the Kyori discord
newline is the kyori newline its broken
oh yeah
it works in chat
just not as a lore
wadafuc
jank
no it only takes a component
Go ask in the devs discord i guess
I did but its quite desolate
i just remembered that they use minimessages by default so i would guess they know
oh yeah, does sqlite accept byte[] as a collumn, if it does is it just BYTE as the name in the statement
it turns out I got scammed and it does indeed accept List<Component>
now I dont understand why c.text(...).append(c.empty()).append(c.text(...)) works on the other hand but whatever
have some mercy
the guy just doesn't wanna go to paper discord
can you blame him
๐จ I'm just really scared of paper discord excuse my incompetence
I've been in there once man
๐
its its own lib
It is for many things my frien
fren
just paper use it by default
and their reason is "minecraft are removing & colouring"
ยง
they can take away my amp-based coloring system from my cold, dead hands
that
if they remove it, im not upgrading
Components aren't that bad
i will stay however many versions behind
They are though.
Annoying and unnecessarily lengthy.
components are sort of annoying to deal with
honestly I probably have some of the most stupidly overcomplicated implementations of components
because I thought it would be cute to have book-based displays
that was a bad idea
I feel you.
I mean they look cool, just don't try to translate them, use a resource pack with a different font or use bedrock crossplay
or customize them in general
PR it into spigot then. ๐
pr paper into spigot, let's have a laugh
april fools spigot is now paper and paper is now spigot
what the hell are my neighbors doing
Nah, april fools would be md_5-chan.
man I need to get a house
what would that even look like
people who claim high density apt blocks are the future can suck it
also did you all notice that md is now in christmas mode
15 years in, can't wait to get out
Spigot Christmasification when?
u dont need spigot for that
we need the logo to become snow instead of water
the game has an christmas easteregg
really?
Nah, it's ice hanging out of the spout, and snow piled on top.
thats better
if u play it at the right time you WILL notice
where to find it? I've been playing like for 4 hrs daily
ohh.. got it
is it possible to get from the server console each line? that i can send it to a website?
look up remote shell
Anyone know how I could fix a problem similar to this one? https://www.spigotmc.org/threads/preparesmithingevent-custom-result.469769/
My custom result gets properly set but I cannot take out the result item from the smithing table.
The problem is that the recipes are generated dynamically so I cannot just register the recipes with bukkit.
Is there anyway I can fix it?
I've seen this post but i tried its sollution and it didn't work: https://www.spigotmc.org/threads/preparesmithingevent-setresult-buggy.507584/#post-4171530
Anyone have any ideas?
Hello, I do not find how to do with the API to give a goat horn by specifying the sound. Any ideas ?
Idk if there's API for that, at least I can't find anything for it. Might have to use nms
There was a PR that didn't get merged
๐ฉ a shame
whera i can find this pr ? on hub.spigotmc.org ?
Do I just have to register a recipe with bukkit, like is there no work around
ho
private boolean playerRegistered(UUID uuid) {
AtomicReference<Boolean> isRegistered = new AtomicReference<>(false);
plugin.getServer().getScheduler().runTaskAsynchronously(plugin, () -> {
try {
PreparedStatement statement = plugin.getConnection()
.prepareStatement("SELECT * FROM cosmicbans_bans WHERE UUID = ?");
statement.setString(1, uuid.toString());
ResultSet results = statement.executeQuery();
isRegistered.set(results.next());
} catch (SQLException err) {
err.printStackTrace();
}
});
plugin.getLogger().info("Player registered: " + isRegistered.get());
return isRegistered.get();
}
even when there is a column for the user in the database, it returns false
it has been doing that since I made it asynchronous
was working perfectly fine before
Flight toggle on sneak
FeelsStashMan
well I need it to be async
I am using JSON and GSON to serialize data for my plugin, but I am getting an InaccessibleObjectException. Does anybody know how to fix this? Code and stacktrace below. https://paste.md-5.net/uyegopahaq.java https://paste.md-5.net/okuquqejar.cs
Hello, anyway to integrate a search function in a GUI ? I would like something for search a player and refresh the list of players found when tiping ?
very sad, no response
?jd-s
i dont remember what the wait time said was
I think how people typically implement that is a slot that starts a search feature (wether sign, chat message etc) and once recieved the input it will reopen the gui and set it by the search
no way to use the search function when we are in inventory creative like that ?r
Creative inventory is client side
I'd recommend using a chat message, since inventories are scuffed to work with, but like the other person said you can use things like books, anvils, etc
Though anvils have a char limit
Like 16 iirc
i thought that got changed to 50
cuz isRegistered.get() returns before the async part is executed
Not a clue
and how can I avoid that?
Anyone know what packets are sent to the client for the main rendering when a player logs on or loads a new chunk?
gson doesnt know what to do with that file
it tries to deserialize it using reflection but its not smart enough to actually set some fields accessible or smth
I don't get it though because this works perfectly fine https://paste.md-5.net/alubidinug.cs
looks like it doesnt if it throws that exception
wheres line 57 too
and why are you creating two gson objects on every method call
those objects are very costly so have it as a field
could you show the PlayerData class?
BungeeCord:
Any event that is fired when the player quits the proxy? ive tried using ServerDisconnectEvent, but it fires when i switches a server too...
.
Guys,how can I change the plugin's code?Decompilation gives errors
Im trying to decompile CoreProtect 2.14.4
look for the github
Most of the code is missing
๐คทโโ๏ธ
tf am i looking at
That's the wrong github 
dude ๐
what
https://github.com/PlayPro/CoreProtect/
It's not missing?
I need 2.14.4
But why
It has only 20.1 an higher
and whats line 57 in your listener class?
Because version of my server is 1.12.2
gson.toJson(tribe, writer)
Backport the latest version then
Extra work comes with being on outdated versions
where tf do you see that?
The PlayerData class is the one that works fine
But I just want to change one line...
didnt ask that
Then decompile and fix the errors yourself
bro thinking its PHP
?
Or find the commits on the github page
https://paste.md-5.net/uyegopahaq.java This issue happens in the TribeCommand class
bruh what a mess is this plugin
private boolean playerRegistered(UUID uuid) {
AtomicReference<Boolean> isRegistered = new AtomicReference<>(false);
plugin.getServer().getScheduler().runTaskAsynchronously(plugin, () -> {
try {
PreparedStatement statement = plugin.getConnection()
.prepareStatement("SELECT * FROM cosmicbans_bans WHERE UUID = ?");
statement.setString(1, uuid.toString());
ResultSet results = statement.executeQuery();
isRegistered.set(results.next());
} catch (SQLException err) {
err.printStackTrace();
}
});
// wait for async to finish
while(isRegistered.get() == null) {}
plugin.getLogger().info("Player registered: " + isRegistered.get());
return isRegistered.get();
}
it returns false even when the player is in the db
I am confused, very
i told you did you even listen
I asked how I would do the thing you told me to do
What do you want to know?
wat
fourteen be helping everyone in here
That's a bad way to do it
you might wanna google CompletableFuture
how can i use Entity PLayer in 1.19.2?
or use callbacks
cant find any code about it
as in?
Decompile and check. That is how you work with nms
then whats a good way?
theres the problem, do you want your tribes_folder do be serialized?
Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.
if you dont, declare the field as transient, then gson will ignore it
are you using spigot or spigot-api
i used to use EntityPLayer in 1.16.5
What's the point of making it async but then freezing the main thread anyway
but cant anymore
?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
spigot api
Spigot api doesn't contain nms
you need to use spigot then
It never has
ahhh
then what do i have to use?
Spigot
what dependence
run build tools, remove the -api from the dep
im getting flashbacks to css man
spigor.jar?
it isnt one
JSON GSON Problem
No. Use maven or gradle
run buildtools, then import spigot not spigot-api
ok ill try
Would you mind hopping in the thread I just made?
I am trying to make a trading system where you can trade with another player with the command /trade <player> and it will open a GUI and you can put the items you want to trade on the left side and the right side is always the other player's items and if you accept, both players get the items on the right side of their GUI which is the other player's offer and if you cancel, both players will get the items on the left side of their GUI. Both players must accept for the trade to be made but only 1 needs to cancel to cancel the trade. For an example, this will be like Hypixel Skyblock's trading system for items only. I have tried multiple things but I just cannot seem to get it to work. Does anyone have a good way to do this?
world's longest sentence
Open a GUI for both players. Allow them to put items in to their own half and add a confirm button
;-;
Listen to the inventory close event to cancel the trade etc
thats what i tried to do
yea
it keeps doubling ppls items and like canceling when u put an item in the gui
use a CompletableFuture, which also removes the need for an AtomicRef
2: close your connection and statement
- Don't freeze main thread with a while loop
sorry one more question
help is it transient final or final transient?
how can i download build tool
?bt
right there
is also fixed with that cf
Hey i tried to download this plugin https://www.spigotmc.org/resources/clicktpa.62596/
But when a player who isnt OP tried using it, it says "you do not have the permmision to use this" there was a video with it but its in spanish and i dont understand a thing but the video dose show how to fix it i think, heres the vid https://www.youtube.com/watch?v=C7GclnbyyKA
private boolean playerRegistered(UUID uuid) {
CompletableFuture<Boolean> future = new CompletableFuture<>();
plugin.getServer().getScheduler().runTaskAsynchronously(plugin, () -> {
try {
PreparedStatement statement = plugin.getConnection()
.prepareStatement("SELECT * FROM cosmicbans_bans WHERE UUID = ?");
statement.setString(1, uuid.toString());
ResultSet results = statement.executeQuery();
future.complete(results.next());
statement.close();
results.close();
} catch (SQLException err) {
err.printStackTrace();
}
});
// wait for async task to finish
while(!future.isDone()) {}
return future.join();
}
something like this?
oh no no
Doesn't have to be :kekw:
Don't wait a future to be done. Return the future
#help-server and give the player the permissions
i dont know how to give player permmisions tho
huh
i dont want them to be OP bc it kinda ruins the server
BungeeCord:
Any event that is fired when the player quits the proxy? ive tried using ServerDisconnectEvent, but it fires when i switches a server too...
When you're working with a CompletableFuture, the entire point of it is that you don't know when it's going to complete, just that it will. You're meant to use the CompletableFuture<Boolean> as your return type.
You can then invoke methods on the result of it such as .thenAccept() or .whenComplete()
Answered you in help server
However if you're querying from a ban table, I don't know if your goal is to be doing this to check if a player is banned, but if you are... you should probably do this synchronously anyways but in the AsyncPlayerPreLoginEvent
um
Unable to access jarfile BuildTools.jar
this masage pop up when i type java -jar BuildTools.jar --rev 1.19.2 in to cmd
you can either do:
private void ifPlayerRegistered(UUID uuid, Runnable callback) {
Bukkit.getScheduler().runTaskAsynchounously(plugin () -> {
// will close connection and statement afterwards
try (Connection conn = plugin.getConnection(); PreparedStatement ps =
conn.prepareStatement("SELECT * FROM cosmicbans WHERE uuid=?;")) {
ps.setString(1, uuid.toString());
if (ps.executeQuery().next()) { // the player is registered
callback.run();
}
} catch (SQLException e) {
e.printStackTrace();
}
});
}```
or
```java
private CompletableFuture<Boolean> isPlayerRegistered(UUID uuid) {
return CompletableFuture.supplyAsync(() -> {
// same logic, return the boolean value
});
}
isPlayerRegistered(someUUID).thenAccept(val -> { // this will run when the db call finished, not blocking the main thread
if (val) { logger.info("got em"); } else { logger.log("nah"); }
})```
use eyes
thanks for the help, I will try them out
open cmd -> find jar location -> navigate to location of jar using cd in the cmd, i.e. "cd D:\spigot\buildtools"
-> run the command in that directory
-> profit
-> invest
-> sell
-> profit
@tardy delta if I just run the methods from inside AsyncPlayerPreLoginEvent, then they are already running async tho right
?paste
https://paste.md-5.net/apewuqosav.cpp
what about in this case?
I just need to update database values and not return anything, that is all
are you talking about whether to run it async?
i just have a class that does all db operations in sync and then i have a wrapper that uses the async stuff
that code is part of a command (/ban command)
basically bans the player in db
Question does I'm able to set with the Crossbow meta the charged state?
so what are you asking?
I just wanna make the code run async thats all
wrap it using a a cf or bukkit scheduler or smth?
so just.. put the whole thing inside a scheduler and thats it?
Unsupported API version while loading plugin
Is strange how the recipe api is made. If you make an furnace recipe and use gold_ore (with custom metadata) it break the cocking time if you change it for the custom recipe.
I know if the player for example learn the recipe self it keep metadata on the recipe, but the api not allow you force same recipe to the client.
So seams you has to use nms or is it other way around it?
#runTask, #runTaskAsync
uhh that could work yes, i hope you wanna check if that db call actually succeeded
Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {}); ima just put the code inside this scheduler and hope it works
I have think on the issue for long time and try find a way around it, only way I see it is the plugin register same server recipe again with new key or use nms to register custom furnace recipes.
I not get way the api not allow itemstacks as ingrediens (when minecraft own sorcecode seams to understand it).
what to code my guys?
essentialsX recode
whats the prob with the normal one?
the problem with the normal one is that its normal
yes
command classes called Commandlowercasecommandname
its build system (gradle) is a nightmare
if it a mess no one can copy it and claim it is your own code lol ๐
gradle best
It's not gradle that is the fault there I'd guess
It's how it's being used that is the issue
go import it into an IDE and see how many warning/errors you have
settings.gradle being the only fucking kotlin file
lol
who can i kill for this
@wet breach You still trying to help me with that MySQL issue? ๐ ๐
Still better than CMI
whats cmi?
Essentials but paid
concurrent modification ixception
BUT ITS A`SYNC
whats wrong with you
@EventHandler
public void testtest(PlayerInteractEntityEvent e)
{
Player p = e.getPlayer();
Entity en = e.getRightClicked();
if(p.getItemInHand().getType() == Material.SHEARS)
{
if(p.getItemInHand().getItemMeta().getDisplayName().equalsIgnoreCase(ChatColor.GOLD + "kidnap"))
{
p.setPassenger(en);
}
}
}
why this does not work?
like villiger and horse,llama working but not for golem or rabbit
it will not be ChatColor.GOLD on the item. It will have been parsed
no i have a item that have ChatColor.GOLD
you also probably want https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractAtEntityEvent.html
declaration: package: org.bukkit.event.player, class: PlayerInteractAtEntityEvent
but p.setPassenger(en) did not work
@sterile token I wanna see you figure out the code for this one :)
you seem to be missing your inventory
texture pack shenanigans
Guys, i have a plugin which runs on 1.18 and I want it to run it on 1.19.3,
Does anyone know how to do it??
makes it look neater :)
do you use nms in it
No
doesnt need updating, should just work
basically the steps are:
- try and see
- fix issues
- repeat
Doesn't work
?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.
there would be an error somewhere in logs
then it won;t work on 1.18 either
Let me try again then
this seems fairly basic unelss i'm thinking about it wrong
Are you free to talk? I need some recommendations for my command framework.I have been looking ages for some command framework which i like the designed. But i have been successfull
my command framework is done
lol
wanna look
Oh this looks lovely
Even hid the player inventory like Mcc Island
3 paginable lines
all linked together under the same page
yea isn't that just a list
Make it a component and follow OOP ๐
It's all a component <3
PaginatedComponent with slots
code looks a bit long but it should be understandable
a selection is just a wrapper for a List<Integer> slots
you can make a MultiSelection which just merges multiple selections, useful for weird shapes
shapes and hollow shapes for stuff like borders n all
Was looking for a gui thing thatd support resource packed menus
Wym widespread engine
popular / open-source
Hello, I'm developing a Spigot plugin, where I'd like a connection to a MongoDB database (I was following along this guide: https://www.spigotmc.org/wiki/using-mongodb/#using-the-mongodb-driver-in-your-server). The JAR file build and stuff are fine, only when I put it in my server's plugins folder, it gave me an error:
java.lang.NoClassDefFoundError: com/mongodb/MongoException
I already did my own research and clicked on every link I could, here are some things I've tried:
- Changing the startup command to
java -classpath "server.jar;lib/*" org.bukkit.craftbukkit.Main
* Gave me an error,
Caused by: java.lang.ClassNotFoundException: org.bukkit.craftbukkit.Main```
- Changing `java -classpath "server.jar;lib/*" -jar server.jar`
* Gave the same error as error #1
- Tried shading the driver in but failed, as the shading plugin wasn't working for me...
I've tried a few more things, but those ones failed as well. So now I'm kinda stuck and I don't know what to do. If you could help me I'd greatly appreciate that.
I can also just do something a lot more basic type deal
you need to ensure that the MongoDB driver JAR file is on the classpath when you run your program.
Ah not really
But honestly should be
Also made it in like a few hours
Do you mean in the 'lib' folder? Cause it is
i mean JAR file or maven dep
Yes the JAR file is on the classpath
Let me try that
BaseMenu menu = new BaseMenu(player.getUniqueId(), Component.text("Test"), 6);
BaseLayer layer = new BaseLayer(menu);
menu.addRenderable(layer);
Button button = new Button(new ItemStack(Material.DIRT), (event) -> {
event.getWhoClicked().sendMessage("you clicked on the dirt. are you proud?");
});
layer.applySelection(SlotSelection.of(12, 13, 14), button);
menu.forceUpdate();
menu.open();
It did not work (idk if im allowed to ping u)
That's cool
Does it support visual components though
aren't those just inventory titles?
you can change titles on the fly
Yeah but having components to manage that is much cooler
I have elements that are a lot more complex than buttons if you want htose
like MultiSwitch and all
Uh ye
Did you make it specifically to be used w resource packs or?
Got it
Hello, i have a event handler antiFortification(PlayerInteractEvent e) that works for ops only for some reason. How do i make it work for all players?
hi, i made a compass that tracks a player... i made it constantly update the itemmeta but the item always goes up and down in the hand... is there a way to solve this?
give code and we'll tell you.
public class RightClickBlock implements Listener {
@EventHandler
public void antiFortification(PlayerInteractEvent e) {
Player p = e.getPlayer();
log.info("8");
//only handle right click
if (e.getAction() != Action.RIGHT_CLICK_BLOCK) return;
There is no 8 or 7 showing up in terminal
The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.
For example, only executing code if the main hand was used:
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
return; // do not progress past this point |
}
// provide functionality
}
i dont think that is for my usage
im handling clicks on blocks, not every interaction of a player (i think)
?
a plugin that adds secret ways to dupe
my main class
public class MyPlugin extends JavaPlugin {
public static Logger log = Bukkit.getLogger();
@Override
public void onEnable() {
...
//register event
getServer().getPluginManager().registerEvents(new RightClickBlock(), this);
...
}
right clicking with your main hand on a block calls the event
wtf i am left clicking and its working
?interactevent
The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.
For example, only executing code if the main hand was used:
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
return; // do not progress past this point |
}
// provide functionality
}
you need to check the hand
im switching to this rq to see if it solves it
onPlayerInteract and antiFortification can only handle left clicks for non ops for some reason
turns out, the freaking spawn protection in server.properties was messing it up
is there an event that calls when u lodestone a compass?
PlayerInteractEvent probs
ye i took that
Hi guys, what is the common way to handle registration of events that doesn't exists in older versions of spigot?
try catch?
if they don;t exist they will be ignored
lol, I was expecting smth more complicated. But i guess that's works too
you register a listener not the events
You'll get a missing class exception though ;p
oh imports
Imports don't exist at runtime, but the server won't know that the class exists as a method parameter
Recommend spigot command frameworks
what is the best api for http request?
the built in one
Java 11's HttpClient API is great
Does anyone know why when I add a regeneration potion effect to a player, my client has the effect and my hearts show the regeneration animation, but my health doesn't actually go up?
Might it have to do with the fact that I apply the effect every 4 ticks for 20 ticks duration?
if (currentTick % 4 == 0L) { // Every 4 ticks we give people regeneration
val entities = LocationUtils.getEntitiesInCircle(totemLocation, RADIUS) // This also includes the totem
entities.keys.filterIsInstance<LivingEntity>().filter { it in owner.team }.forEach {
// TODO: maybe find a better way to handle potion effects ?
// We give them regeneration
it.addPotionEffect(PotionEffectType.REGENERATION.createEffect(20, 1))
}
}
base regen only heals every 2.5 seconds apparently
which is like 50 ticks
Hey guys how i can use BukkitScheduler in bukkit beta 1.7.3?
runTaskLater doesn't exist in this version
scheduler.runTaskLater(auth.getInstance(), () -> {
}, 3L);
Can i randomize an Integer[] {} with numbers in it?
scheduleSyncDelayedTask I think
Thanks, I'll try
whats the build in one?
Choco said it
ah okay thx
?md-5
bukkit beta 1.7.3
jesus
I lied to you a little...
Its Infdev 20100618
But api like beta 1.7.3
Could make sure of an IntStream if you really wanted to
IntStream stream = IntStream.generate(ThreadLocalRandom.current()::nextInt);
int[] array = stream.limit(10).toArray();```
Or be sane and just use a for loop to skip the Stream all together, but really it's up to you
auth.getInstance is null
public static auth getInstance() {
return auth.instance;
}```
It's still not defined
?
auth.getInstance() still returns null. You haven't given your private auth variable a value
Can you rename it to Auth plz
No ๐
yes
just woke up not long ago. Today is my day off ๐
Hi, I am trying to create a custom font to create custom guis but when I try to set the image file to something like 300 the character becomes invalid
How can I fix that
How can i add items from all entrys out of an enum via an for?
Loop through YourEnum.values()
how would I print a 'รก ' to my console? it keeps sending ร
Try starting server with -Dfile.encoding=UTF-8 flag?
is there a way of getting tipped arrow potion type when I've got an entity instance of the arrow?
Arrow#getBasePotionData()
Does it also include potion potency?
I checked with arrow.getPotionEffects too, but that doesn't seem to work
it has isUpgraded
ah thanks
https://paste.md-5.net/umizovolac.java All the information is in this,
Error line 87*
line 88 is referring to line 64
Cannot invoke "BetterServer.util.LanguageUtil.getMessage(String)" because "this.e" is null
you don't initialize LanguageUtil e;
What should I initalize it to?
You have to initialize your LanguageUtil in the on enable method
I would suggest adding modifiers to your fields and also to read about java conventions
alr
Because how do you relationate the LanguageUtil with a letter "e" ?
So you can read java conventions from here
?conventions
public void getMessage(String e) {
e is not very descriptive.
well i got a good reason for that though, yk how people use evnt instead of event?
Ive searched up every way to make an HTTP Post and cant figure it out, im trying to do it for tebex.
Any ideas how id do this?
yeah what im trying to hell him
In java use http client and read about tebex rest api
With that you should be done if need something else, you can either ask here or on tebex discord
alr
how do you set a player's PermissibleBase?
I'm trying to
public void getMessage(String e, CommandSender p) {
if (p != null) {
switch (this.getConfig().getString("Language")) {
case "en" -> {
InputStream langfile = this.getResource("messages.properties");
Properties lang = new Properties();
try {
lang.load(langfile);
} catch (IOException ex) {
throw new RuntimeException(ex);
}
p.sendMessage(lang.get(ChatColor.translateAlternateColorCodes('&', e)).toString());
}
}
}
}
But it's returning:
[23:56:23] [Server thread/INFO]: &4&lThis command is currently disabled, if you wish to override this command you are free to do.
the problom is its not translating to color
How can I get rig of this banner stuff from Itemstack description?
clear the meta
I need meta for Banner pattern
fixed it
anyone know when player head images in tablist were added to minecraft/spigot?
Good evening, I am designing my auto complete system for my command framework that I am making. And I would like to achieve that you can make it as you see in the example. Where index, would be the index of the argument to which the completions would have to be applied. And completations would be the list of completions that will be suggested with the corresponding index. And was looking to hear different ways for making this designed or others
public class TestCommand extends Command {
public TestCommand() {
super(stuff here);
getCompleter().register(index, completations);
getCompleter().register(0, List.of("Alex", "Clue", "Ethan")); // Example for making user names suggestions
}
}
nvm
use the ItemFlag HIDE_POTION_EFFECTS, for some reason banner patterns are on it
whats the most efficient way to store entire inventories into a database?
I am trying to make a player vaults plugin and am having issues storing all the item data efficiently (enchantments, name, nbt tags, amount)
Does anyone else maybe know another solution for this?
Hey, how could I make an entity passenger of another entity?
Dismount it from it's current entity and then remount it to the new one.
hi, is there a way to hide the join message only for the player that joined?
hey is there a way that say a player has vaults.5 vaults.10 and vaults.20 permission nodes, then I get the maximum one (vaults.20) and then put 20 as the value of a variable?
all I can think of is to just put if conditions for every number but even that would just catch the lowest one
You'd have to cancel the join message for everyone then send it out to everyone except the player.
ye i thought of that
but idk
event.setJoinMessage(null)
you can just set the join message to null on the event
That'll prevent everyone else from getting the message though.
isnt that what they want
No, they want to not see their join message when they join, but they want everyone else to see it.
ah, yeah you would set the message to null and loop over online players
Which is the true way to show usage?
/give [user] [item] <amount>
/give <user> <item> [amount]
user and item are required and amount is optional
2nd one
I usually use
<> for multiple arguments
() for required
[] for optional
convention is <> for required, [] for optional and seperate options with |
i think
^^
Is there any verified source on that? I'd like to change it If that's the convention.
the source is that every one uses that format
Option-arguments are shown separated from their options by <blank> characters, except when the option-argument is enclosed in the '[' and ']' notation to indicate that it is optional.
Arguments separated by the '|' ( <vertical-line>) bar notation are mutually-exclusive.
One of my other plugins uses <XYZ> for required, <?XYZ> for optional and <XYZ/ABC> for mutually exclusive
I think using a ? makes sense too
That being said I didn't write that part and it probably dates all the way back to 1.8 days
I was actually told that () is for required, that's why I'm using it.
() is a rather rare form I'd say
I dont recall having seen () very often
Fair enough
Looking at the /help screen of the current game I'm running the running scheme seems to be [<XYZ>] for optional arguments, <XYZ> for required and (ABC|DEF|XYZ) for list of options
Idk, I have seen [] way more than () so thats what I use
the most widely used is [] and <> but people do use the other stuff
{} ๐
ok thats just evil
/kick {uuid}-^player^ /reason/
/kick REQUIREDuuidREQUIRED OPTIONALplayerOPTIONAL WHYEVENCAREreasonWHYEVENCARE
LOL
at that point, just use that format
Syntax is: /claims %s set global|<group> <action> <person> allow|deny is another format I use. This time made by me
<> being non-literal and when it is absent it is an literal argument
And that format has no optional arguments, instead different syntax layouts are used for each variations of including non-optional and optional arguments
How can i place a spruce sampling with id 1?
What is the targeted version and what is your goal there?
1.12.2
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
how bad is it to use a singleton
its either that or pass this dependency through like 10 classes down
My opinion?
yeah
Most of these guidelines are absolutely stupid
fair enough
I dont see the downside to using singletons except funni conventions but I feel like breaking a convention if it makes it more readable is better
If the people that follow them to the letter would see my code they would perish instantly. But really it is easier to have a flat hierarchy than a a very deep one
I dont want to do constructor(Required req) -> constructor(Required req) -> -> constructor(Required req) -> -> -> constructor(Required req) -> -> -> -> constructor(Required req) -> -> -> -> -> constructor(Required req) -> -> -> -> -> -> constructor(Required req) -> -> -> -> -> -> -> Ahh finally I can use req only had to add it to like 10 constructors
hmm yeah I agree
looks like smth copilot would do
is there an event that fires when u open another page of a book?
or is it client side?
most likely clientside
๐
As the book's NBT contains the entire text of the book
but is it 100% client side or might there be an event?
bruh
alright update: I love the singleton pattern I must stay focused and never use it again it quite simply just seems too glorious to me
it makes sense for latency reasons
Hmm i need someones opinion... i am planning to add a PrepareGrindstoneEvent ... like the PrepareAnvilEvent .... but wouldn't it be better to have a super Event like PrepareItemResultEvent or smth like that ?
u probs should do both and have the prepareitemresultevent as a interface, but im not sure if that would plaz nice with the prepareanvilevent
*play
damn german keyboards
you could toggle it if you want to xD
It would fit with the PrepareAnvilEvent since it just extends it from:
PrepareAnvilEvent extends InventoryEvent extends Event
to
PrepareAnvilEvent extends PrepareItemResultEvent extends InventoryEvent extends Event
probably better name would be PrepareInventoryResultEvent or just PrepareResultEvent
last one sounds too ambiguous imo
PrepareWorkStationItemEvent
but otherwise it sounds fine. I just couldnt be bothered to check the dependency chain on anvilevent
ah or that
is an anvil also a workstation ?
villagers would say no xD
hmmm seems a bit long ... but i think "PrepareInventoryResultEvent" is good too ?
yeah that probably works
this is worse than java
they help you to go up and down ^^
yeah
thats the reason its amazing
\๐
I enjoy being able to write huge files without having to split it up and write broken html with it still workign
\๐ณ
also JPanel can be used like a webbrowser - that is to display html as a 'webpage'
this seems very legit
is there any property a block can have for it to be pass-through
cya
how can i tell entity where to go? (just like pigs with carrot on stick)
pathfind goals?
how do you make clickable text (that runs a command) in a written book?
hey is there a way that say a player has vaults.5 vaults.10 and vaults.20 permission nodes, then I get the maximum one (vaults.20) and then put 20 as the value of a variable?
all I can think of is to just put if conditions for every number but even that would just catch the lowest one
try having falling blocks with the texture of the block you wanna be able to pass through
which one is better for class name - TeleportRunnable or TeleportationRunnable?
TeleportTask
what is the intention of the class?
omg thanks
There are other interesting topics there too
uhh so I realised this is not possible with chests
so im trying with an armor stand but it seems if I set the meta to visible and the armor stand to invisible its still fully invisible
I saw
how can i detect bow pulling maximum
.
you can get teh players effective permissions and search for all that startwith vault.
You need to make sure your plugin loads after placeholderapi
i have PacketType.Play.Server.ENTITY_VELOCITY packet,
i can do .getPacket()
how can i get velocity values from it?
EntityShootBowEvent has getForce()
max value is 1 which would mean they pulled it all the way back
ty
OMG TY
Cast the getPacket() to PacketPlayInEntityVelocity then you can use getVelocity
there is not such type
PacketPlayOutEntityVelocity says "Inconvertible types"
this is PacketContainer
For PacketContainer, you can do packet.getEntityModifer(/*world*/).read(0).getVelocity()
Any way to fix this?
maven-shade-plugin has detected that some class files are
present in two or more JARs.
All I did was add this to my pom.
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-beta.2</version>
</dependency>
Here is what im running to cause this:
package shade:shade
run mvn clean package instead
Also that should be just warning, but you can always exclude conflicting dependencies
- META-INF/MANIFEST.MF
jackson-core-2.14.1.jar, jackson-databind-2.14.1.jar, kotlin-stdlib-1.4.10.jar define 1 overlapping classes:
- META-INF.versions.9.module-info
jackson-annotations-2.14.1.jar, jackson-core-2.14.1.jar, jackson-databind-2.14.1.jar define 1 overlapping resource:
- META-INF/LICENSE
jackson-core-2.14.1.jar, jackson-databind-2.14.1.jar define 1 overlapping resource:
- META-INF/NOTICE
maven-shade-plugin has detected that some class files are
present in two or more JARs. When this happens, only one
single version of the class is copied to the uber jar.
Usually this is not harmful and you can skip these warnings,
otherwise try to manually exclude artifacts based on
mvn dependency:tree -Ddetail=true and the above output.
See http://maven.apache.org/plugins/maven-shade-plugin/
it fixes most of it EXCEPT manifests
Hey, i'm using vscode and i was wondering if there was any way to make my extracted .jar land directly in the plugins folder ?
how are you packaging the jar
Any way you would implement that would be more complex than simply moving the jar file
how can i detect that entity have metadata
originally i was using package shade:shade
but epic suggested clean package instead
Too vague
Afaik there is "output" property in maven shade plugin
Might be wrong rho
i want to summon lightning when damaget's metadata is arme
Do you mean their name?
tanks, how did you even know
whats that website where you can find different names for mojang/spigot mappings
i love you
no cuz the damage is arrow
I looked at the javadoc
so i set metadata of arrow to arme when player shot bow with maxed pull
so noone has a solution to this i assume then
and want to summon lightning when player got hit by arrow that has arme metadata
What did you store the metadata as?
You can ignore that message, Herobrine
It shows up rather frequently when you're working with Shade but it's mostly harmless in a plugin
Ah okay, but why wont it add the new dependancy for me to access then?
<dependency>
<groupId>net.dv8tion</groupId>
<artifactId>JDA</artifactId>
<version>5.0.0-beta.2</version>
</dependency>
Doesnt seem I can access this whatsoever
Can you post the whole file
That's cool
If you could, please. I pasted that dependency into one of my projects and was able to access everything fine
File doesnt appear either.
This is what I was running to generate my jar file, do I need to run something else?
package shade:shade clean
just clean package should suffice. The shade stage already runs by default when you package
depend, not depends. Or soft-depend. The s always screws me over
I really should make it an alias or something
Just use the annotation compiler ๐
ew no
It's on central, yeah
you learn something new every day
ive got 1 question, why is your source + target 11 in compiler plugin but 8 in properties
nope
what error(s) do you get
[WARNING] Discovered module-info.class. Shading will break its strong encapsulation.
[WARNING] JDA-5.0.0-beta.2.jar, ServerPlugin-1.0-SNAPSHOT.jar, annotations-13.0.jar, commons-collections4-4.4.jar, jackson-annotations-2.14.1.jar, jackson-core-2.14.1.jar, jackson-databind-2.14.1.jar, jna-4.4.0.jar, kotlin-stdlib-1.4.10.jar, kotlin-stdlib-common-1.4.0.jar, nv-websocket-client-2.14.jar, okhttp-4.9.3.jar, okio-2.8.0.jar, opus-java-1.1.1.jar, opus-java-api-1.1.1.jar, opus-java-natives-1.1.1.jar, slf4j-api-1.7.36.jar, trove4j-3.0.3.jar define 1 overlapping resource:
[WARNING] - META-INF/MANIFEST.MF
[WARNING] jackson-core-2.14.1.jar, jackson-databind-2.14.1.jar, kotlin-stdlib-1.4.10.jar define 1 overlapping classes:
[WARNING] - META-INF.versions.9.module-info
[WARNING] jackson-annotations-2.14.1.jar, jackson-core-2.14.1.jar, jackson-databind-2.14.1.jar define 1 overlapping resource:
[WARNING] - META-INF/LICENSE
[WARNING] jackson-core-2.14.1.jar, jackson-databind-2.14.1.jar define 1 overlapping resource:
[WARNING] - META-INF/NOTICE
[WARNING] maven-shade-plugin has detected that some class files are
[WARNING] present in two or more JARs. When this happens, only one
[WARNING] single version of the class is copied to the uber jar.
[WARNING] Usually this is not harmful and you can skip these warnings,
[WARNING] otherwise try to manually exclude artifacts based on
[WARNING] mvn dependency:tree -Ddetail=true and the above output.
[WARNING] See http://maven.apache.org/plugins/maven-shade-plugin/
Only warning
add it to ur plugin.yml
using depends in your plugin.yml they literally just said it lmao
does it build
i mean yea
you can ignore it then
i have the BufferedImage
so its building but not adding jda?
yes
have you reloaded maven
how do i do that
wait no i found a button called reload all maven projects
go onto the maven tab on the right, press the reload icon then
How can I display skript variables on holograms(Holographic Displays)?
ask skript
๐
how can i show image on a map
in 1.8.8
i doubt many people here would know
there is no setMapView in 1.8
Hey, I'm trying to reward a player upon destroying crops but the event "BlockDropItemEvent" is not being helpful on that.
Example: destroys crop and drops 4 potatoes, but the event for some reason is only showing 1 potato on the ItemStack.
(Image attached below)
Code:
if (block.getType() == Material.POTATOES) {
player.sendMessage("" + e.getItems());
for (Item i : e.getItems()) {
ItemStack ii = i.getItemStack();
player.sendMessage("" + ii);
if (i.getItemStack().getType() == Material.POTATO) {
harvestingXp = i.getItemStack().getAmount() * 12;
break;
}
}
}```
how to fix this to return the actual amount dropped by the crop?
ok nvm
for some reason it drops 2 itemstacks, 1st with the actual 1x drop, the 2nd with the rest(rng involved)
MapView map = Bukkit.createMap(/* world */ null);
map.addRenderer(new MapRenderer() {
@Override
public void render(MapView map, MapCanvas canvas, Player player) {
canvas.drawImage(MapPalette.imageToBytes(/*bufferedImage*/));
}
});
player.getInventory().addItem(new ItemStack(Material.MAP, 1, map.getId()));
I didn't test it at all
Try it and see
Beautiful
Idk I didn't test it
why would you want to support them
you are not gonna talk me out of supporting it for 1.8
Gonna have to use like XMaterial or something
Also why 1.17 instead of 1.19 lmao
what server version do you use for testing most stuff
I have a 1.8 server and a 1.19 server
ok stop
ive got a 1.17.1, 1.18.2, 1.19 and 1.19.2 but i test most of my stuff on 1.19 for some reason
that reminds me
i need to get a 1.19.3 server
@EventHandler
public void onDamage(EntityDamageByEntityEvent e) {
if (e.getEntity() instanceof Player) {
Player player = (Player) e.getEntity();
if (e.getDamage() >= player.getHealth()) {
if (e.getCause().equals(EntityDamageEvent.DamageCause.ENTITY_ATTACK)) {
if (e.getDamager() instanceof Skeleton) {
Bukkit.broadcastMessage(player.getName() + " was goinked by a skeletons arrow!");
} else {
Bukkit.broadcastMessage("Cause: " + e.getCause() + " | Damager: " + e.getDamager().getType());
}
}
}
}
}
could someone help me out and explain why getting killed by a skeletons arrow produces neither of these results?
iirc if the arrow damages you, it registers an arrow or projective one of them as the damager not skele
Yeah the damage cause would be projectile
so
@EventHandler
public void onDamage(EntityDamageByEntityEvent e) {
if (e.getEntity() instanceof Player) {
Player player = (Player) e.getEntity();
if (e.getDamage() >= player.getHealth()) {
if (e.getCause().equals(EntityDamageEvent.DamageCause.PROJECTILE)) {
if (e.getDamager() instanceof Skeleton) {
Bukkit.broadcastMessage(player.getName() + " was goinked by a skeletons arrow!");
} else {
Bukkit.broadcastMessage("Cause: " + e.getCause() + " | Damager: " + e.getDamager().getType());
}
}
}
}
}
would work
@EventHandler
public void onDamage(EntityDamageByEntityEvent e) {
if (e.getEntity() instanceof Player) {
Player player = (Player) e.getEntity();
if (e.getDamage() >= player.getHealth()) {
if (e.getCause().equals(EntityDamageEvent.DamageCause.PROJECTILE)) {
// Get the Arrow entity that dealt the damage
Arrow arrow = (Arrow) e.getDamager();
// Get the LivingEntity that shot the arrow
LivingEntity shooter = arrow.getShooter();
if (shooter instanceof Skeleton) {
Bukkit.broadcastMessage(player.getName() + " was goinked by a skeletons arrow!");
} else {
Bukkit.broadcastMessage("Cause: " + e.getCause() + " | Damager: " + shooter.getType());
}
}
}
}
}
Might need to add some type checking to make sure or you'll get exceptions
like the projectile might not always be an arrow
And what means %s ?
and getShooter might be null if it wasn't shot by a living entity
that is an artifact from my translation system
It's short for 'string', which is a fancy way of saying 'a bunch of letters and numbers that make up a word or phrase'. So if you see %s in some code, just think 'Hey, this is where I put a word or phrase' and you'll be good to go!"
?paste
i.e. that string is sent by https://github.com/Geolykt/Presence/blob/main/src/main/java/de/geolykt/presence/PresenceBukkit.java#L582, where as the i18n lookup is done by https://github.com/Geolykt/Presence/blob/40e316ee746d04f6e1f393b99a5b07d3f556ca5c/src/main/java/de/geolykt/presence/i18n/LocalisationContainer.java#L44
How would I check if itโs been shot by a dispenser?
Since the dispenser is a material right?
I would imagine it would always be a dispenser if getShooter is null
I can't think of another not living entity that shoots an arrow
how do you check if something is null or not null normally
Make and if statement checking if (shooter == null)
if that's true you can assume it's a dispenser
Actually it looks like getShooter returns a ProjectileSource so you can probably just check if it's an instanceof Dispenser
getShooter can also return null spontaneously from my testing
Hey there, I tried creating an addon for a plugin called Ultra Customizer and it gives me this error while building:
https://cdn.zetax.dev/XLZ8eBKuLC24
Does anyone know how to fix that? I added Spigot and the Plugin as a module, so it should work, right?
How did you add Spigot as a dependency
I added it in this menu, that's how someone told me to do it https://cdn.zetax.dev/2YCZBYW1hZm1
use maven or gradle
How would I set that up
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Pft, that is the looser's way
I'll try that ๐
Instead of depending on spigot-1.19.3.jar you should depend on https://hub.spigotmc.org/nexus/content/repositories/snapshots/org/spigotmc/spigot-api/1.19.3-R0.1-SNAPSHOT/spigot-api-1.19.3-R0.1-20221210.230846-9-shaded.jar
?bundler being the cause
smh my head
?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
Yeah that is it
I'll read through it :D
Anyone have an idea how I can make villagers accept items regarless of their display name and lore?
Or ItemMeta in general
Thatโs what I thought
I could remove the meta when itโs placed in the slot and then re-add it when itโs taken out
Was Tag.NON_FLAMMABLE_WOOD removed or just renamed?
removed
Why
mc removed it
Okay, so I tried setting a project up with gradle, and I think it imported just fine, but how do I build the jar now? The build thing doesn't seem to do anything or am I understanding the button wrong? https://cdn.zetax.dev/my2NQPu1lHOH
are you running gradlew build
I just tried the intellij build button on the top right and the Tasks > build > build task so far
press control twice then type gradlew build
Done
that will build it
File didnt update and nothing new appeared afaik
where are you checking
it also wont rebuild it without changes from what i remember
Seemed logical to check there, but if it's wrong please correct me https://cdn.zetax.dev/L5Wx1AYFxvRM
build/libs is teh right place
The built jar in the libs folder only contains the example code even after changing the code and building it
?paste ur build.gradle
Just restarted explorer and now it shows the right file? Not sure why but it does now, but the addon.yml is still not there
use the spigot repo and the api you are trying to hook into's repo
implementing files should be a very last resort method
You mean use github repos as dependencies? Or is repo some java word I don't know
Sorry if it sounds dumb
repo = repository, most apis/libs have their own repository that you can add to not need to impl files
whats the ucus api name?
Repos are a collection of many artifacts that can be loaded with build tools
I only have access to the UltraCustomizer jar, not any repo, at least as far as I know of as it's a paid plugin
they would probably have an api somewhere online
https://ultracustomizer.com/wiki/api that's the wiki for it
Ultra Customizer is the ultimate Styling Solution to make your Server Unique. You can easily create your own GUIโs, Commands and Scripts with an incredibly simple GUI based editor. Additionally you can edit any message on your Server with just a few clicks to make your Server feel 100% unique.
That's a different plugin
that is a weird plugin if it doesnt have an api on a repo
They told me to add the jar as dependency
The fewest plugins have their API on a repo
But to advertise the API and not mark the maven repo? That is rarer
but change your build.gradle to
plugins {
id 'java'
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
maven { url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
compileOnly 'org.spigotmc:spigot-api:1.19.3-R0.1-SNAPSHOT'
implementation files('libs/ucus.jar')
}
test {
useJUnitPlatform()
}
๐
oh also your addon.yml should be in the resources folder
I'm looking for a way in the spigot api to figure out if a block is dependent on another block? For example, torches and signs require the block they are placed on, which can be to the side or below, and redstone wire requires the block below
Thank you :D
The build works great now! Thank you very much
directional isn't it, since directional blocks can also be trapdoors etc
How would I process a list of objects from a yaml config?
spawnLocs:
- world: world
x: 0.0
y: 0.0
z: 0.0
yaw: 0.0
pitch: 0.0
- world: world
x: 0.0
y: 0.0
z: 0.0
yaw: 0.0
pitch: 0.0
I was trying for (ConfigurationSection section : config.getList("spawnLocs")) but it doesn't work
Use getMapList or if it was getListMap
it would be Map<String, Object> not ConfigurationSection
ohh, alright, then cast every object to the correct type like string or double yeah?
Ye
alright, thanks for your help ๐
Remember its gonna be boxed types
So you will have to convert to primitive ones manually
(int)(Integer) value ?
I would make a configuration serializable object which would use to read and write
ohh
Dependent blocks
To make it clear why you need to do that in case you were curious, it's to avoid null exceptions
makes sense
Hello
