#help-development
1 messages · Page 251 of 1
this is so stranger..
print out lastClick instead of printing out delta
print out lastClick and you'll see why lastClick is not between 0.19 and 0.21
yee
because it's probably 918526175 or sth lol
wow great. now gradle does not include ANY .class file in my .jar
what the fuck
okay I'll commit it now, maybe someone has any ideas
maybe someone has any idea, you could simply clone it and head to the Example-Plugin folder to reproduce it https://github.com/JEFF-Media-GbR/JeffLib/issues/18
Would I need to spend hours running BT in order to test the output?
no
you simply go into the Example-Plugin folder, all dependencies are declared in proper repos in the build.gradle
it should work right out of the box. except for the fact that it doesn't work ofc lol
Time to copy over the gradle wrapper files and go bug hunting
go bug hunting over my parser lmao
that would be very helpful 🙂
I've been spending an hour on this now lol
at least it should work directly, I didn't add mavenLocal() to the build file
I sadly have very few gradle projects made by myself these days (most of them have been migrated to in-house buildchains), and no using minimize and relocations
It's the include directive I guess
yeah but it says "include" so AT LEAST those things should be there, right?! 😄
Whatever you want to do, you don't want to use that keyword
but I need to specify that minimize() should ignore certain classes from being excluded
Did someone say gradle
yes
According to https://imperceptiblethoughts.com/shadow/configuration/filtering/ include controlls the final jar and not the relocation process. So that is the cause of our issue
I also fucking hate how the minimize() option has an exclude option, but not include? like wtf, why would someone EXCLUDE something from minimize? It should have an INCLUDE option, not EXCLUDE
hm I'll quickly read it again
I found the solution
you have to EXCLUDE classes in minimize to make them INCLUDED
shadowJar {
relocate('com.jeff_media.jefflib', 'me.username.jefflib')
minimize {
exclude 'com/jeff_media/jefflib/internal/nms/**'
}
}
that's the most stupid naming scheme ever
I have to EXCLUDE stuff from being EXCLUDED
Include means whitelist, exclude means blacklist
that is the most sensical naming scheme ever...
"include" should ALWAYS include the mentioned files
I want to INCLUDE those files in the .jar so I tell "minimizeJar" to "include" them
Yes, and as the default is to include everything, and that default does not make sense if there is at least one include thingy, so it throws away the default
well anyway, thanks, it's working now 😄 and as always in gradle, only took 1.5 hours to find the solution
the idea is basically "if you want to include something in the .jar, then add it to the exlude section"
The idea actually is "if you want to exclude something from the minimize process you exclude it"
I know
but that's just ridiculous
excluding it from that process makes it included in the .jar
Consider relocate/minimize as sub-tasks - which doesn't make all too much sense but that is gradle for ya
yeah I know the reason behind it, it just makes no sense to the reader of a build.gradle file on first glance
it could also just be other way around
for example like this, it works except for the relocation ```gradle
shadowJar {
relocate('com.jeff_media.jefflib', 'me.username.jefflib') {
include 'com/jeff_media/jefflib/internal/nms/**'
}
minimize()
}
I use "include" and "minimize()" and it works as expected
when moving the include into the minimize() thing, expecting it to the same thing, it now does the opposite
that's stupid
that is because only "com/jeff[...]/nms/**" is being relocated. Minimize works differently now that the two packages are seperated by a larger margin, mostly caused by how fragile it is
I never use minimize (be it in maven, gradle or elsewhere) due to that fragility
Hello! I'm trying to serialize a list of objects from my config file, but I can't manage to do it. I guess the problem comes from the fact that objects are in a list and the list is not serialized, is that correct ? How can I fix this easily (maybe without making a serializable list class ?)
Here is the config:
# Setup cooldowns for commands here
cooldowns:
- expression: 'nation leave'
duration: 1m 30s
aliases:
- 'n leave'
And here is the code that causes problem:
private static void SetupCommandCooldowns()
{
List<Object> list = (ArrayList<Object>) KokiriaSettings.getCooldownsConfig().getList("cooldowns");
for (Object obj : list)
{
CooldownableCommand cooldownableCommand = (CooldownableCommand) obj;
Error:
java.lang.ClassCastException: class java.util.LinkedHashMap cannot be cast to class net.dgwave.kokiria.objects.CooldownableCommand (java.util.LinkedHashMap is in module java.base of loader 'bootstrap'; net.dgwave.kokiria.objects.CooldownableCommand is in unnamed module of loader 'Kokiria.jar' @2e647244)
at net.dgwave.kokiria.modules.CommandCooldowns.SetupCommandCooldowns(CommandCooldowns.java:35) ~[Kokiria.jar:?]```
My serializable class:
@SerializableAs("CooldownableCommand")
public class CooldownableCommand extends SavedCommand implements ConfigurationSerializable {
double duration;
public CooldownableCommand(String expression, List<String> aliases, double duration) {
super(expression, aliases);
this.duration = duration;
}
public CooldownableCommand(Map<String, Object> args) {
String expression = "";
List<String> aliases = new ArrayList<>();
double duration = 0;
if (args.containsKey("expression")) {
expression = ((String) args.get("expression"));
}
if (args.containsKey("aliases")) {
aliases = (List<String>) args.get("aliases");
}
if (args.containsKey("duration")) {
duration = ((Double) args.get("duration"));
}
this.expression = expression;
this.aliases = aliases;
this.duration = duration;
}
public double getDuration()
{
return duration;
}
public static CooldownableCommand deserialize(LinkedHashMap<String, Object> args) {
String expression = "";
List<String> aliases = new ArrayList<>();
double duration = 0;
if (args.containsKey("expression")) {
expression = ((String) args.get("expression"));
}
if (args.containsKey("aliases")) {
aliases = (List<String>) args.get("aliases");
}
if (args.containsKey("duration")) {
duration = ((Double) args.get("duration"));
}
return new CooldownableCommand(expression, aliases, duration);
}
@Override
public Map<String, Object> serialize() {
LinkedHashMap<String, Object> result = new LinkedHashMap<String, Object>();
result.put("expression", this.expression);
result.put("duration", this.duration);
result.put("aliases", aliases.toArray());
return result;
}
}
please dont check contains and then get
you didnt do config.set("some-key", cooldownobject) too
you just set a list of config sections
I am not sure to understand, sorry
Oh ok I see
call get, assign it to a local variable and check if its not null
That's not the issue here though, right ?
Oh so it would be different, I didn't know that
If I could get these values without serialization that would be good too, I just can't find a way to access values inside a list.
//push another one
something like config.getList("cooldowns)[0].getFloat("duration")
List are indexed, they don't have keys
Yeah I used index ?
I mean it's an example, but my list is a list of objects
you tried to use .getFloat on the returned object
you have to cast it to whatever object it is first
# Setup cooldowns for commands here
cooldowns:
- expression: 'nation leave'
duration: 1m 30s
aliases:
- 'n leave'
- expression: 'nation join'
duration: 1m 30s
aliases:
- 'n join'
that is a List of Maps
What kind of object does the List returned by getList contain ?
did you register that class as being serializable?
I did
and are you even calling set with your custom object?
im not talking about extends configserializable
No I didn't call set, I assumed it would be serialized like this in the config. I'll try with set, but is there a way to get it from config without serialization ?
declaration: package: org.bukkit.configuration.serialization, class: ConfigurationSerialization
a serialized object set in teh config would not look like that
how are you setting your object to config then? manually setting all primitives?
Okay thanks that 's the issue then
I'm upping this question though
Object
Does anyone have experience with removing smoke particles from a wither entity?
a generic untyped Object
yes, with a warning
In the case of the config.yml I sent above, could I cast config.getList("cooldowns")[0] to a map or something
So that I can get the values of "expression", "duration" etc
yes
List<CustomCooldown> cooldowns = config.getList("cooldowns", CustomCooldown.class /* idk if this is a thing */);
cooldowns.add(new CustomCooldown(1));
config.set("cooldowns", cooldowns);```
dunno why its a list and not a map tho
and use ConfigurationSerialization.registerClass(CustomCooldown.class)
in a static block would be the best thing
What types would the Map have ? String and Object ?
yes
Alright I'll try this, thanks for your help everyone
i dont have the capability to test the following rn so could you answer the following?:
Does PlayerCommandPreProcessEvent also disable bungeecord messages??
nvm, solved it myself
why are you trying to type enum things in a normal class
in an enum
public enum not public class
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
dont think you should hardcode those locations
You’re using the API version and not the full version
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
for 1.12 add
<repositories>
<repository>
<id>minecraft-repo</id>
<url>https://libraries.minecraft.net/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.mojang</groupId>
<artifactId>authlib</artifactId>
<version>1.5.21</version>
<scope>provided</scope>
</dependency>
</dependencies>
Been using GameProfile really far back.
Remove -api
Did you build it with buildtools?
Do that
is there an event, if a player jumps while falling / in the air? so such as an elytra start but without an elytra or smth on?
you could see if the jump thing works? It is the statistic increase event
me being sad cuz i added three lines of code which cause extra overhead
Hi! I'm trying to set cooldowns for commands coming from other plugins. Is there a way to check if a command has been executed or not (for example, when trying to go spawn while in not allowed zone, command wouldn't be executed, so I don't want to add cooldown for the player). Maybe plugins send message error to players that we can detect, idk ? (I'm guessing there is no solution but we never know)
PlayerCommandPreProcessEvent? seems like a viable solution
Depends which plugin but it's easily doable
That's what I am using; but I can't check if the command will be executed by the plugin
you'd have to tap into an API then otherwise use your best information to guess
Which plugins? All plugins? Or specific plugins
When plugin sends message to player to tell him that command did not executed, can it not be detected ?
No specific plugin
So all plugins
wait couldn't you use reflection to get into the command map and then attempt to find the plugins commands
Yes
That's going to lead to a disaster
For example, if I use /tpa Y2K
and Y2K refuses the tp, can it be detected ?
Just use a plugin that has cooldowns
I could check the color of the message lol and assume red is error
Yeah sure
But for Towny for example some commands don't have cooldown
Towny has an API anyway but I wanted an easy way to add cooldown to any command
I just wanted to be sure that I wasn't missing some "player.senderrormessage" thing
Why would they need to?
Also isn't towny open source? I imagine you could build a custom version quite easily with cooldowns
Hi guys, I'm building a plugin that can save the last location of players before they teleport to different world.
For example, if they were at coordinate (0, 10, 0) in world_survival, it will save the coordinate when player teleport to world_nether
and when player teleport back to world_survival, plugin will teleport player to the saved coordinate
I currently have no idea how to build this mechanism
Is EntityDamageByEntity or EntityDamage event called first? In other words, if I modify the damage in the first event and then get it in the second, will it be the modified damage?
Or are there any ways to force event priorities?
Fun little secret, neither are called first
When an EntityDamageByEntityEvent is called, EntityDamageEvent listeners are also invoked
The latter extends the former, so by hierarchy they're both called at the same time
If you're listening to EDBEE, you're just listening to a very specific type of EDE
okay
TL;DR: It still boils down to your EventPriority
Then I guess I should do everything in one EDE to minimize risks
EventPriority?
you can set that?
You can, yeah. In the annotation
@EventHandler(priority = EventPriority.LOW)
public void yourListener(EntityDamageEvent event) {
}```
@EventHandler(priority = EventPriority.LEVEL)
LOWEST called first, HIGHEST* called last
whats monitor for
ah
(that's why I said "HIGHEST***** called last", because MONITOR is actually called last)
If you're changing the event or world in any way, you should not be doing it in MONITOR
im guessing that would be used in chat to discord log stuff
Another good use case for it, yes
I'm coming back, but isn't there a way to get the value returned by onCommand when a command is executed (in an event listener) ?
technically there isnt an actual way to check if the command passed or not because not every one uses return false, they return true and send their own message
?
What do they do with the returned value
I mean, it's a way to make the player perform the command, it's not called when the player sends a command by message
Or if it is, how can I get the result ?
?paste
someone please help me out I am trying to update the json value every time someone breaks a block so if the playerGold value is at 0 every time they break a block it should add 5
heres the code: https://paste.md-5.net/butigopexa.java
heres the error: https://paste.md-5.net/esidewezip.nginx
Caused by: java.lang.ClassCastException: class java.lang.Double cannot be cast to class java.lang.Integer
at me.kingchoices.AncientWorld.Events.BlockBreak.onBreak(BlockBreak.java:29)
How are you casting it
You can just use Double#intValue
OMG that's so sad ;-; I didn't realize but another problem rises it won't add the number
I should definetly start to read conversations
double add = playergold + 5; jsonObject.put("playerGold", add);
still printing 0.0 instead of the 5 im adding in it
double add = 5d + playergold; jsonObject.put("playerGold", add);
still printing out 0.0
5.0d not 5d
Anyone help?
double add = 5.0d + playergold; jsonObject.put("playerGold", add);
same issue
Perhaps save the location to a persistent data container before teleporting to the world
how?
are you still getting a cast error?
I've got a utility PDC class I made, you can use it in to store locations (in a stringified form) in a player
no I am not getting any errors but however the math is not working not sure why
the value i have in json file is 0.0 every time a player breaks a block I am trying to add 5.0 to that value in the file
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
here you go
are you saving teh file after changing the value?
umm..okay
No I will try that right now
just use pdc.set(player, key, location), key bring a String, and location being a stringified form of a Location object
and pdc.get(player, key) to get it back ^^
no, make a separate class and put it there (to avoid confusion and keeping code clean)
I see

?namingconventions
XD
Ig no
upper camel case for class names
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
https://paste.md-5.net/rafakurege.java
not sure how I would save the file
I feel like I would need to change code completely using Writer to save file or am I wrong?
public class MyClassName {
private final MainClassName plugin;
public MyClassName(MainClassNme plugin) {
this.plugin = plugin;
}
}
@potent ibex
hmm okay
i would guess you need a file writer to write stuff to the file
also from my short attempt at json you shouldnt need to save
that's what I was wondering jsonObject.put should do the saving
yeah, i would give file writer a go and see if that makes it write to the file
I'm trying to make a throwable dagger and it works fine, but the armorstand hitbox is causing problems. Any idea how to avoid this? If I set it to marker, velocity doesn't do anything
how do I register other plugin's placeholder in my own plugin?
with placeholder api?
check the PlaceholderAPI. methods
if you just need online_players check the Bukkit.getOnlinePlayers().size(); method
🤔
I having some issues with my command flow, for some reason the server is telling me that the command i created was not found but only happen when i dont have the permissions - To clarify my command flow register them thru spigot command map
I have added many debugg messages but i cannot understand what is happening
now how should I add placeholder in gui item lore?
for instance, if you mouseover to grassblock icon in UI, its lore should includes %some placeholder%
meta.setLore(Arrays.asList("ur name: " + PlaceholderAPI.setPlaceholders(player, "%player_name%"))
Ahmm..
how do you add that statement in here
ItemStack stack = new ItemStack(type, amount);
ItemMeta meta = stack.getItemMeta();
meta.setDisplayName(name);
meta.setLore(Arrays.asList(lore));
stack.setItemMeta(meta);
return stack;
}
add a comma after lore
then the "ur name: " + PlaceholderAPI.setPlaceholders(player, "%player_name%"
the placeholderapi part works but player part doesn't work
cannot resolve symbol player
you would need a player instance
woah.. it's so complicated
not really
how would I add player instance?
add Player player to the method constructor
then add a player instance to the where you call the method
private static ItemStack buildItem(Material type, int amount, String name, String... lore) {
Player player
ItemStack stack = new ItemStack(type, amount);
ItemMeta meta = stack.getItemMeta();
meta.setDisplayName(name);
meta.setLore(Arrays.asList(lore, " " + PlaceholderAPI.setPlaceholders(player, "%player_name%"));
stack.setItemMeta(meta);
return stack;
}
something like this?
thats not the constructor
private static ItemStack buildItem(Player player, Material type, int amount, String name, String... lore) {
ItemStack stack = new ItemStack(type, amount);
ItemMeta meta = stack.getItemMeta();
meta.setDisplayName(name);
meta.setLore(Arrays.asList(lore, " " + PlaceholderAPI.setPlaceholders(player, "%player_name%"));
stack.setItemMeta(meta);
return stack;
}
Cannot resolve method 'buildItem(Material, int, String, String, String)'
player part would work but the other codes get messed up
you need to add a player instance to where you call that method
you cant have a placeholder there then
you would have to get the placeholder some other way
placecholder api requires a player instance to get the placeholder return
Do you really need a playerholder there, just use player.getName()
player name was just an example
they dont have a player instance in the first place
Can someone tell me what is the minimum/maximum world height in the latest version please?
I actually need placeholder for # of online player in particular world
lower is y-64/-65 highest is y319/320
Bukkit.getWorld("worldname").getPlayers().size();
Google your question before asking it:
https://www.google.com/
Thank you.
this works! now how would I add that to lore?
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
I should rly study java before plugin 😂
?learnjava!
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming. https://media.discordapp.net/attachments/694661573125472256/998143126373941248/6n0v4g.gif
Yes 100%
yeah
Hi, is there an easy way to keep a chunk loaded for X seconds ?
Will world.loadChunk keep the chunk loaded more than 1 tick and if so for how long ?
Just listen for chunkunload event and see if it's your chunk. If so cancel until you don't need it loaded anymore
@wet breach It's back. 😭
At this point, I probably need to rewrite those connection classes. Like, this has to be something with my code at this point.
Loaddatabase line106
Probably missed something. But yes highly recommend rewriting so that every method isn't doing its own connection
Would also recommend a method responsible for doing the query part too because you don't really need all them methods having that either. Just need to feed the query you want it to do
So this should only leave 2 methods that have try blocks for anything possibly 3
Is there a way to do that so I can still access the ResultSet? I know I can return a ResultSet, but it needs an open connection to read it for some reason.
Not counting initialization chexks
Yes
Not home right now. Currently at work. Is your code on GitHub?
Alright, the repo should be public. https://gitlab.com/Nothixal/hugs
I'll push the changes here shortly.
:p
Thanks. So world.loadChunk won't keep the chunk loaded ?
I read somewhere in the bukkit docs that chunk would only be unloaded if requested manually after world.loadChunk
It will load it. But if there is no players nearby. It will eventually unload. So best to listen for unload event anyways to prevent it unloading if you still need it loaded
Alright thanks
What's the easiest way to seperate the online players into four "groups" (I already have a team method and object etc. set up) using a for loop?
Note: I already made sure the number of online players will always be divisible by four
you get all the players and forEach through them
maybe Collections.shuffle them first
You could sublist.
or use classic for loop and when i % (sizeofList / 4) == 0 , make a new group
i got a really crap solution but i mean:
int i = 0;
for(Player p : Bukkit.getOnlinePlayers()){
int playercount = Bukkit.getOnlinePlayers().size();
if(i < playercount*0.25){
//add to team 1
}
else if (i < playercount*0.5){
//add to team 2
}
else if (i < playercount*0.75){
//add to team 3
}
else{
//add to team 4
}
}
since it will always be divisible by four this should work
you could just make i = 1 and count up, when its 4 at the end of the method reset it to one and do it that way
then you dont need it to be 4 at all times
oh god I am stuck in the html center align memescape again
ah of course it was bootstrap again
I might have to get rid of bootstrap
Tailwind ❤️
I should probably just not use a framework or something
Tailwind is great. Highly recommend
every time I get stuck on something it's because some framework is overriding something in the backend without me realizing it
Put !important on all custom css lol
I'm pulling bootstrap off wish me luck
next you'll be telling you also use ligma
Tailwind is weird looking by default and the docs kinda sucked their examples always use a quadrillion classes
But if you're willing to give elements a hundred classes it's pretty gud
I really don't want to do that because I am declaring every element via js
Lmao
Sounds like pain
Relatable
At least use Vue or smth
I hate jsx so I write my elements with JS
it's a webapp so I need a lot of custom generated stuff to be happening all the time
Svelte (:
I was using templates but then I got 3k lines of templates and found myself having to copy paste hundreds of elements
lmao yeah
but yeah I am done doing this with styles that I do not know what they do in the backend, I don't even particularly need complex styling
yes
https://magmaguy.com/webapp/webapp.html is what i'm working on
I remember once found myself re-creating some premium plugin's web backend to test my programming skills
nice
AH BRUH
why is it so goofy
chug_jug.mp3
nah im just digging in files of your webapp
mm
autofill suggestions
how bad of an idea is it to make this responsive by using a percentual width and a percentual left margin?
because it seems to work
wdym
Should be fine long as no-one tries to view it on a pez dispenser
damn that's my core audience
top right sound better tho
why?
muscle memory for me for example
this is as sane as people who do css top: 50%; bottom: 50%; left: 50%; right: 50%;
wait top right what
oh nothing in the screenshot that I posted is correct aside from the fact that the card itself is in the middle
I just yoinked bootstrap out so now I have to go back and reapply the same styles but without bootstrap
ah the main container?
why does it have col-5 on it?
because bootstrap was in it up until a few minutes ago
bootstrap is ass fr
as far as I am concerned, bootstrap is like jquery, a poisoned apple
a shortcut to doing something real quickly but the second you need complexity you realize you don't know enough about the inner workings and it becomes a struggle to figure out why the behavior you are expecting isn't happening
tbh even custom css is easier than bootstrap
I started using bootstrap because it made me not have to think too much about the look of individual elements of the page, I'm not a designer nor do I aspire to become one
it looks like a website
no
there is a difference between this
and this
with bootstrap you are essentially in between
but more towards the first
the first looks like it could be rendered in a terminal lol
so I'm between a website from 98 by some dude and a website designed by a mutlitrillion dollar corporation?
damn that's pretty good
maybe I should sell my website
i guess but some dude on codepen with 2 free hours can do the same too
also I dont think this company is very successful
it hasnt been updated in 3 years and they removed the apple logo probably due to copyright
there is also no company info when you google it
and picasso could make a drawing worth several millions of dollars in just a few minutes, just because someone can do it quickly doesn't mean you can replicate their skill just as fast
there is however a dictionary description for "runlet" lol
idk I think you can
people sell fake picasso paintings to bozos
I doubt the people faking them are taking as long as picasso did to replicate his style
they're not they're taking a lot less time
im sure its easier when you're copying and not using your imagination lol
yeah for sure, art forgery is a fast and easy process with no effort put into it
I was thinking about using my printer to start doing it myself
lmao
idk maybe if you find some blind grandma you can sell her a picture
but painting it prolly takes a bit of time
just do it over and over and ez
@torn shuttle what do you think about this framework
I mean I already recreated most of the style with no framework
Do wider container
still trying to figure out what's up with the container getting shorter but it's well on its way
I generally aim for 1280px wide
just become a padding enjoyer
what like this? @onyx fjord
i feel like there's too much space lol
Now something needs to be done with green buttons
this neck is how long those buttons feel
idk I ripped off the color palette from https://codepen.io/havardob/pen/ExvwGBr
A recreation of this Dribbble shot: https://dribbble.com/shots/16755073-Almeria-Neobank-Dashboard/attachments/11802960?mode=media ...
One way is to add image behind each button and by that making it wider and taller
Another way is to use a drop-down perhaps
I would personally just display an icon for each category
one of those images from that one site maybe
I forgot the name
they made buycraft icons
CRAFTILLDAWN
do they still exist
I don't have codepen near me so can't visualize for you
near you?
Yeah no codepens unfortunately
oh
Yk how coding on phone is
tru
man why the hell is my toolbar like 15 pixels too wide
CSS?
it has no padding, it has no margin
border?
sure but the top one aligns just fine
Is that second one inside of a container div?
hm I think it might be my row css but it's just set to 100%
The width?
is that bootstrap?
is this a public site?
not bootstrap anymore, code is not currently live because the page is too unfinished
we learnt workin with bootstrap today lol
I dropped bootstrap earlier, it was causing too many issues
Pain
Well, that means it's either overflowing or the width is actually larger than what you think it is.
well the screenshot shows it's overdrawing
You think you could put the code on netlify as temporary hosting? It'd be a lot of back and forth otherwise.
I would like to but this is like a small detail on what is becoming a very large nearly pure js project
it probably wouldn't run anyway because I was relying on page requests to load some of the content so technically it sources templates from multiple pages
Hmm, you think you could ?paste the html and css relating to that section?
because I was in the middle of redoing the entire project 50% of the code is across 15 html pages and 50% is across 15 js pages which create page elements so I'm not sure it will help
Ohhh.
I think I narrowed it down to it being my row class
oh
yeah I got it
it's two things, the border is thicker which would be almost entire fine except the content is aligned using margin-left 50% so when the borders are of different thicknesses the difference builds up to that offset
I guess I'll stick to using the same border width, I don't know that I will find a better way of center aligning these in a way that is responsive without it being a headache
Are you using a css reset file?
reset?
actually hold on this is a part of the issue but it's not even the whole thing
Basically some css at the top of the of the file that removes the default styling of the browser elements. It's also common to change the box-sizing property, since it gives you better control over styling.
no
Well, there is a property called box-sizing that is responsible for the calculations of an element's width and height. By default, it includes the padding and border as part of the calculations, which an lead to some elements looking bigger than what they should be.
oh now this is interesting
I think I found the actual issue
when I apply the border to the bottom box it eats up inner space but when I apply it to the top box it expands outwards
If you set box-sizing: border-box;, it will ignore the padding as it starts it calculation at the border instead of at the content box.
how do I define if the border expands outwards or inwards?
See, it's been so long since I've used the default stylings, I've forgotten those types of rules.
I don't think it actually expands like that. I'm pretty sure it can only expand outwards.
As per the box model.
You can only really go outwards.
fuck it, you know what, close enough
I'm not even sure of how I did this one
it's not at all what I was trying to do
You should really take that css property and apply it to everything. It makes everything easier to work with and more in line with what you would expect.
Hence, the reset file.
I see
Oh yea that's standard
Hey
Have I to use this here
ExampleEvent exampleEvent = new ExampleEvent("Msrules123"); // Initialize your Event
Only one time
on the plugin load
Or every time before i call the event
So do I need to use a MySQL server to connect all server in auth me?
once in enable, but remember to register it, USUALLY. If you want to do event manipulation that's something entirely different.
I usually use this, in onEnable:
getServer().getPluginManager().registerEvents(new EventXY(),this);
also events normally call themselves by whatever is in their arguments, once again, thats different if u are working with ur own event
uhm why the hell does this happen???
looks like a client bug tbh
gonna need more context than a screenshot
well, I also got more scuffed things it does
for example if I kill it, it is just continueing existing without hitbox
Seems like minecraft does not like FallingBlockEntities with the EntityType Shulker huh?
well how am I supposed to diagnose that now
with serverLevel.addFreshEntity(testShulker, SpawnReason.CUSTOM);
is ur testshulker a object of the shulker class?
it might not correctly draw the connection between ur fallingEntity and entityLiving
this is a bit outside my expertise tbh
well isn't it outside of the expertise of just about every single person?
yeah
well I cannot see why it would get the player in this state to be honest
like neither Shulkers nor FallingBlocks should have any functionality connected to that state
is there any event getting called when a player enters this state? maybe I can cancel that
well this list contains even less since it only has direct subinterfaces
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/Event.html
declaration: package: org.bukkit.event, class: Event
yeah I cannot find anything related in there
yep seems like there is no event for crawling
[15:45:08 ERROR]: Could not pass event StandardPaperServerListPingEventImpl to test v1.0
java.lang.IllegalStateException: PluginServerPingEvent may only be triggered synchronously.
Any idea
?
don't trigger it off main thread ?
or, maybe more applicable, define the event to be ran off the main thread
as I presume you are recieving whatever you define a PluginServerPingEvent off the main thread
one of the event parent constructor takes a boolean
declaration: package: org.bukkit.event, class: Event
sry i dont know how and where to use that
why does this throw UnsupportedOperationException?
^
invoke the parent constructor in your custom event type
Here???
PluginServerPingEvent callEvent = new PluginServerPingEvent(event);
Bukkit.getPluginManager().callEvent(callEvent);
no usually you do it in the impl e.g.
could you may send me an ... code?
public final class MyCustomEventOffMainThread extends Event {
private final String someData;
public MyCustomEventOffMainThread(final String someData) {
super(true);
this.someData = someData;
}
}
yea
idk why you'd call super(false) but eh
I am having trouble following your question
ugh I just realized gradle still fails to exclude classes from minimize
because of the error I tought
well no
shadowJar {
minimize {
exclude 'com.jeff_media.jefflib.internal.nms.**'
}
relocate('com.jeff_media.jefflib', 'me.username.jefflib')
}
any idea why none of those NMS classes are included in my jar?
you call super(true)
may only be triggered synchronously.
and true would be async
yeah and I wantit sync
you are triggering this off the main thread
Well do you tho
well this will fix it
but that means the event is off main thread
e.g. plugins listening cannot mutate the world etc
they'd need to jump back to the main thread before doing so
false is not working
obviously not....
false means "hey I promise I will only call the event on the main thread"
oh true is working as you said
ok so weirdly I could not find any documentation about crawling online
while true means "hey I promise I only call it off the main thread"
should I use then true everywhere?
only for events you call off the main thread
off = not in
yes
it doesn't whats better
that depends on the context of the event
would it make sense to call BlockBreakEvent off main thread ? no
tell that to fawe

nd Entity damage?
ok
so I set it to false?
or just nothing
if something happens off the main thread
use your human brain to think about if async makes sense or not
do you want players to be damaged at some random point in the future
😕^3
?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.
my dog is not working
yo Jägermeister guy
do you really want me to detail why that is
do you have any idea why the hell the game feels free to put me into crawling state when walking at a shulker?
on command:
if command is "/plugins" or "/pl":
cancel event
message "Wist je dat Panda's eigenlijk gebaseerd zijn op Elma."
With what should I replace event.setMotd("")
Why is the EntityDamageEvent not working?
The first 5 minutes it works
But after then it just stops working
Ive set the event priority to highest
no error
nothing in console
but it stops working
And is there a way to check if events get unregistered
And if so say from which plugin / line of plugin
Other plugins won't unregister your listener
why is it then not working anymore
I made an output to the chat
And when I start the server
the output comes
but after ~ 5 min not anymoer
no
Then we can't help
that not workhttps://paste.md-5.net/eferiramaq.java why?
did u tell ur plugin to load after vault
Yeah like that
but it isn't working
Make sure to do a full server restart
i made
any errors?
please use PreparedStatements
i hope that random id is not user input or i would have fun sql injecting your database
https://www.spigotmc.org/wiki/connecting-to-databases-mysql/, mysql here doesnt matter tho
I'm losing it
it's almost decent, why is it like this
whats bad about it
red line clips on right side
I am using border-box this time which fixed the previous issue and I think it should fix the current one too
ahh had that too
Did you apply it to all elements?
*, *::before, *::after {
box-sizing: border-box;
}
yeah
what if you set the width smaller or margin-right negative?
html {
height: 100%;
position: relative;
font-family: "Open Sans";
background: var(--background-color);
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
.-.
and I mean it works for the other elements and it even affects this issue
lmao
send me css and html lol
It should be box-sizing: border-box; not box-sizing: inherit
By default, it will inherit the default style which is content-box.
like before there is basically no way to send it nor is there html
ahh ;-;
no, it works correctly when I inherit from html
also I did try that
I know the border-box works because this is not the only thing border-box affects
this is what it looks like without it
Hmm. Can't say I've had this issue with that property before. Must be something else then.
i know how it feels man 🥺
it fits perfectly when I don't modify the margin
Oh, you're modifying margin.
isn't border-box meant to contain that?
college today
or is it just padding?
No
i have some issues with border-box too
It's meant to work around the border and padding. Refer back to the box model.
The blue box is the content. (AKA the content-box)
The border is the stage above padding.
So when you set box-sizing to border-box, it now treats everything inside of the border box as the new content box.
//push
The cool thing about it is, you can still use padding like normal.
so its not around the margin?
i guess thats why my stuff never wants to display next to each other
ok I guess I just used padding to do what I needed then
I really need to stop using margin then
anyways my media queries are overwriting eo ig
When you use border-box, the CSS rules change a little bit. You use margins to space your elements, and padding for everything else.
?tryandsee
:/ it kinda works but the bow accelerates instead of staying the same speed
i'm more so asking for advice on how to make it better
There's also weird margin rules that exist. However, it's very circumstantial. E.G. Collapsing Margins
really the only core thing my margins are doing is centering my content
the big cards
And that's a valid common usecase.
other than that I basically just use them to space content vertically which I think is correct
I like the little visual tab I put on the script, that's pretty neat
nice little visualization of groupings
anyways do you guys maybe know how i can place three figure elements with 2 next to eeach other?
You got an example image?
trying some shit with float and inline-block but ig grid is the best
uh trying smth like this but know when i make my screen wider, suddenly a third pops up
next media query should put three next to eo
i guess we took over the channel now 🏴☠️
Is the third image on a row below those images or is it hidden until the screen is large enough?
https://paste.md-5.net/useduyaxuj.java this code is for making a homing bow, but because i'm modifying the velocity, iit makes it accelerate instead of staying the same speed... any tips on making it better?
if i make it bigger they all start to display next eo
Yea, but is that content supposed to wrap or be hidden when the screen gets smaller?
uh ig wrap means that it goes to to the next line, ye it should
i could maybe use grid with grid-template-columns 1fr 1fr or smth
Then either grid or flexbox will work for you. You might want to use grid if you want a more modern approach.
i cant modify the html tho and i dont have an element surrounding all those images
pain
brr
sadly didn't have time to really do any coding today. Will have to go to sleep here soon and then back to work 😦
there is always tomorrow, hopefully will have more time lol
however the weekend is my day offs though
Tmw 3 days later.
What's your html look like for that section?
hmm settings figure > * to block doesnt do anything
oh ye cant you just force elemnts to be underneath eo?
i guess thats not how im supposed to do it but anyways
By default, all elements should be created on a new line of sorts. So those images without any css should be stacked on top of each other.
bumping this down
Oh, I didn't realize floats were this simple.
depends on what elements are being used really
If you define a width and a float on the figure element, then it should give the functionality you want/need.
smth like this
True, should have said most elements.
Not a max width. Just a normal width.
Then change the margin. 😛
im wondering where it is smh
Check your dev tools. It'll show it on the element you hover over.
hmm looks like default
maybe you could try using calc()
Margin of 19.2px 40px 25px
width: calc(100% - 60px); height: calc(100% - 60px)
not working
margin: 0 together with width: 50% makes it like this but i still need a margin right
this is how the assignment shows it
Then use the shorthand margin syntax.
too much cats lmao
you can specify which margins you need
Now you just gotta adjust your width.
margin-left: margin-right: etc or use what shadow said
downside of doing it like this, is that it matters on the viewport specs
had to include <meta name="viewport" content="width=device-width, initial-scale=1">
dunno what it does but whatever
i only know initial scale sets that users dont need to zoom
it says that the width should be no more then the width of the viewport
and the scale is at a factor of 1
Viewport really just refers to your screen size and what it can currently display on it.
hmm
Does it need to be exactly like what he did? I would hope not, as there are different ways to accomplish things in CSS.
dunno if i would get less marks but i saw him once creating something related with the width of the individual elements at 50%
They must of been in containers then.
Because like frostalf said, if you set it to 50% in this case, it will use the viewport.
Instead of the parent element.
Best approach for doing my placeholders would be to use Pattern or just String.replaceAll("%placeholder%" ,value) ?
replace and use String#replace not replaceAll
replaceAll is for regex, the name is just chosen stupidly
well would replace not just replace first placeholder in string
ok
something like that?
PreparedStatement stmt = con.prepareStatement("INSERT INTO players VALUES(?, '?')");
stmt.setNString(randomID, player.getName());
The first value of that method needs to be a number that's associated with the question mark you want to replace.
randomID is an integer.
nah first param is the position of the ? mark
Be that as it may, you shouldn't be using a variable for that parameter.
String query = "INSERT INTO player_data VALUES (?, ?, ?, ?, ?, ?, ?)";
PreparedStatement statement = connection.prepareStatement(query);
statement.setString(1, "MyString");
statement.setBoolean(2, false);
statement.setInt(3, 1);
//etc etc
That parameter works off of the ? you have in your query.
@fervent prawn
whats screen in @media doing tho?
@kind hatch@tardy deltathank you so much.
Благодарю от всего сердца!
screen is the media type
ah default is all
Has anyone encountered this issue before? Maven says that my POM is missing, even though it is NOT
[WARNING] The POM for com.mrkelpy:Commons:jar:1.0 is missing, no dependency information available```
StackOverflow is down, too, so yeah pain.
your jar is named commons?
do you have dependencyreducedpom set to false?
First time i hear of that to be fair...
If you're going to rename a class, don't just change one part, always use IntelliJ's refactor. You must change both the file name and the name in the class. IJ refactoring will do both for you in the future.
Oh wait
it started working again
well nevermind I guess, I was blessed by the code gods.
Quick question that probably won’t get answered LOL. How would I spawn an armor-stand in for only one person. What I mean is sending an NMS packet to a specific player so only one client has the armor-stand. How would I do this in 1.19.2? Thanks
In spigot of course
hideEntity
questionnnn
regarding async threading
I run a command, inside it I run async schedule, can I schedule a normal sync task inside the async task?
yes
ty md
should be part of javas libs
scheduler.runTaskAsync(() -> {
// async stuff
// go back to main thread
scheduler.runTask(() -> {
// sync stuff
});
})```
okiee
I have to since I need to do the get method in the bukkit api
and idk how risky that is
since it gets offline player
so I rather do it risk free
https://github.com/SpigotMC/BungeeCord/blob/5467e3a8424fdc4b72a26fc35d9a0432333fa4b2/protocol/src/main/java/net/md_5/bungee/protocol/packet/PlayerListItem.java#L139 just curious, why was this changed from int to Integer (as well as ping below it)
I guess this is part of internals but it ended up breaking BungeeTabListPlus lol
because its nullable now
oh, makes sense lol
how do i dynamically add servers on runtime with bungeecord?
Where can I find a download for spigot 1.19.3 .jar files
BuildTools
Where is that
?bt
How do I install that
Lord read
I did
Just use paper then oh nvm they probably aren't updated
yeh
just wait for paper so you don't have to run a java command in console
otherwise you could read its pretty well explained
nowhere
its really not it tells me to open something and never tells me how
it probably doesnt tell you to open "something"
so what is it that you are not able to open?
I think buildtools docs are actually good I don't get whats hard to read
if your sturggling with understanding a specific section paste it I am happy to explain
people just never read it from the beginning
it does explain every step in detail lol
I mean I usually skim, but I can... I know java and how jar files work
hey alex I'm curious do you need to run SQLite fetches async?
you should do any file or database stuff async unless it's in onenable() or ondisable()
🥳 I got an actual commission lol
finally something I actually will finish and post for portfolio
Hi
does anyone know how can i use simplescore with multiverse plugin?
???
plz anyone help me i beg u
wrong place to ask for that, ask in #help-server
hello :3, someone know how to convert the player location to map location ? i've tried with :
int s = 1 << worldmap.scale;
int i = worldmap.x;
int j = worldmap.z;
int x = Mth.floor(location.getX() - (double)i) / s + 64;
int z = Mth.floor(location.getZ() - (double)j) / s + 64;
return new int[] { x, z };
1_19_R2 comes with funny changes to the CLientboundSetEntityDataPacket
MapView or the map pixels :3
<.< you mean % ? or wdym ¿
hahahaha okay :3
mmm i'll try ty ^^
noup still not working :(
function generateEvents(button) {
button.innerHTML = ""
button.append(getTrashIcon())
button.onclick = function () {
scriptZoneButtonClearer(this, function (){
generateEvents(button)
})
}
...
}
I just want to take a second to point out that this is code that I, a human, wrote, and that it totally works
js and html? <.<
I have this line on 1.19.2 spigot: ((CraftPlayer) p).getHandle().playerConnection.sendPacket etc. the playerConnection class doesn’t seem to exist because it doesn’t show up in InteliJ and says can;t resolve symbol “playerConnect”
((CraftPlayer) p).getHandle().connection
@long zephyr Sorry that doesn’t seem to work either
you must use mojang mappings, otherwise you only get the obfuscated names.
https://blog.jeff-media.com/nms-use-mojang-mappings-for-your-spigot-plugins/
@tender shard Oh ok thanks
Hi! Does plugin.getCommand work with aliases ?
If my command is "wild" and has "rtp" as alias, will plugin.getCommand("rtp")
return me the same command as plugin.getCommand("wild") ?
Is there any better way to get all Classes from plugin then this chunk of code? private List<Class<?>> getPluginClasses(JavaPlugin plugin) { List<Class<?>> result = new ArrayList<>(); var file = FileUtility.pluginFile(plugin); if(file == null) { return result; } var packageName = plugin.getClass().getPackageName(); try(var inputStream = new JarInputStream(new FileInputStream(file))) { JarEntry entry; while ((entry = inputStream.getNextJarEntry()) != null) { try { var name = entry.getName(); if (!name.endsWith(".class")) { continue; } var classPath = name.substring(0, entry.getName().length() - 6); classPath = classPath.replaceAll("[\\|/]", "."); if (!classPath.contains(packageName)) { continue; } result.add(Class.forName(classPath)); } catch (Exception ex) { FluentApi.logger().error("Could not load class", ex); } } inputStream.closeEntry(); } catch (Exception ex) { FluentApi.logger().error("Could not package", ex); } return result; }
Thanks and sorry haha
I can't get the command executors of other plugins commands right ?
I do it like this, where the "clazz" parameter is any given class belonging to some plugin
Bukkit.getPluginCommand("wild") returns whatever would run when you enter /run
then you can call getEcecutor on that
Oh interesting thanks
Also, I have issues with commands being case sensitive sometimes and sometimes not
are you including uppercase commands for some reason?
I think I understood that commands are case sensitive when ran from chat but when I cancel the event and run player.performCommand it seems that it's not case sensitive
Is that correct ?
What do you mean by including uppercase commands ?
I don't really get this
I forgot to send the link of my code lol
1 min
Nevermind on my previous statement, was thinking you were talking about something else.
So what is the issue you are running into then if they are being case sensitive? You can just throw the string toLowerCase etc
and then e.g. you do ```java
List<String> clazzesOfMyOwnPlugin = ClassUtils.listAllClasses(MyListenerClass.class)
where "MyListenerClass" can be ANY class from your plugin, doesn't matter which one
it only returns their name so you can throw them into Class.forName when needed
otherwise you'd force-load all classes, that sounds like a very bad idea
ye it looks like better approach thanks for code
I need to delay command, so I'm trying to match the correct command with the player's message. However, I don't want to match a command with a different case if that doesn't correspond to the same command
So at first I tried commands and it seemes that they were case sensitive
But then when i cancel the commandpreprocess event and use player.performCommand 5s later to delay the command, it seems that commands are not case sensitive anymore
commands should not be case sensitive, so lower case them all
Yeah but if the player use /SPAWN
And I lowercase it when trying to match, it will match with /spawn. But /SPAWN won't work so it will be delayed even if command doesnt exist
/spawn is working
And sometimes /SPAWN works I don't get it
you lower case compare, then use their original command to process
?
however /spawn and /SPAWN should be identical commands