#help-development
1 messages · Page 1544 of 1
nope/
here we go :p
wtf
vomits
ewwwww
best pic ever
It is not handling the proportions correctly
-_
nuice
jupyter notebook or?
Somebody needs to look into their loss calculations lol
no
cuz the model is not intended to do that
thats why stuff is failing
AI is only good at what they do
lol
yea that AI
is designed
for minecraft
and pixel-ish things
hah what why delete the msg
lol
idk if i am allowed to say that
lol
cuz its nsfw
i wish i got a parterner that is IT/Data Science major , UG or PG
ayyy
university of ghana?
Procter & Gamble
yes
get a professor to help you?
uhh i dunno
im not in colledge
maybe its a good time to learn about colledge tho
getting a professor is hard asf
more knowledge = good
cost money?
not money
Google your best friend 🤣
even if academic stuff you need to write a shit ton of stuff explaining why you cant do it yourself and need a professor
and why cant you go take a billion course to learn it but to find a professor
colledge seems hard
college*
ahh yes a billion cources
somethings
you just cant find it on google
you will need to write a fking thesis after the product is done
like its passed down from ppl to ppl
so that you fufill the responsibility of *sharing the knowledge
aka, its wayyyy easier
Rip
and then if you write a shit thesis , then the professor wont approve it cuz his name is written on it too
*like if you do it the proper way
wait since you are doing Machine learning cant your like change the thing called Major?
xd
and then you need to stand on the stage and get a billion queries with a bunch of professor for your stuff
i can't cuz my gpa is shit
and its third year already
hmm mine is around 3.6 or something
ahh and im struggling for AMCs
its a math competition
AMC10?
i dont like in united states
not really if you good at calculus and matrix
i cant get into famous schools i suppose
just trying to make getting work easier
:/
so you want to go to harvard and mit
nah probably not
im not a genious
genius*
like i am those type of people that knows a little about everything
but not a lot of something
its mostly because im from China, that im trying AMC
competition in China is like 1000 times fiercer than US
i know
and its even worse in India
but in china you can go to tsing hua
or fu dan
i heard my friends say its not that hard
uhh no?
what?
those are like
the best schools
so you are from china?
i see
theres like prodigies back in my Chinese schools
one of them i think
passed AMC8 or 10 at like 4th grade
or so they say
those are like crazy
everyday memorizing math stuff and carry a math textbook in their backpack
but those "genious" are very hard to social with
Theres also a forenign language prodigy
cuz they have that pride
not really
they are kind of normal ppl
depends
btw i coded an AI to finish my final exam
the Forenign language one i think
she managed to know the name of every single ppl in the whole school year
cheated?
ahh yes
you know online exam
yea?
i used network control
to control all the data in and out of my home
to uni server
woah thats really hacky
like how the great firewall of china did
might try it sometime
oh that annoying firewall
really?
like anti-cheat?
yes but like
you need to get the security protocol of the software
so basically you need to pay a employee of the anti cheat software
to let them leak the protocol to you
like just treat it as a password
gg
woahhh
can you seriously hear an accent from THAT?
yea
thats so much better than mine
cuz chinese accent is easy to tell
like unless you are educated from western country when your small
you will have that accent
she's like the top 10% with little accent
true true
in china yes
but like those foreign language pridogy in china and taiwan is just average in britan/usa
indeed
full of accent
accent is not a problem
im wayy better at supressing accent then that
the problem is the organizing ability
the ability to come up with a speech on the spot?
it affects if you can find your partner? A bad accent make ppl dislike you?
XD
not really
cuz your accident is not like those indian people , westerns still can clearly understand what you say
im kinda bad at it, i need more like words to describe stuff
like chinese education on english is corrupted
im bad at english :<
i mean they force you to memorize a billion vocab
indeed
but you dont learn how to use them
not really force
i rather you know 3000 words and use them good
than memorize 10000 words and dont know how to use them
you memorize words by knowing their meaning
and how to use them
uhh thats what i was taught :/
for ppl whose mother tongue is not enlish
english*
you have to like
come up with things in Chinese
not really
and translate them in english
after living in an english enviroment for a long time
and in academic discussion
you do in reverse
cuz all the technical terms are english
when i try to memorize words usually i can do it with other words
but sometimes a chinese definition is very helpful
ofc
stalker?
pictures i need
basically this?
shut the f up
oh ok
get bannedddddddddd
cool
make it send funny emojis to the teachers
but zoom should have anti-virus measures installed
re-code it
re-code it
thats server side stuff
oh you cant?
VPN
you need to hack into zoom server
change computer id
for that to work
lol
that would be a crime
well yea re-coding zoom is like
modding minecraft
no its not
changing the client input
how is it not
its illegal
but no one knows
like cuz your are counterfeiting proof of you not cheating
so its different bc what you are doing is illegal and modding mc is not
XD
nuice
GL
dont get caught
not really
you still need 2 pay
unless you are referring to
tlaucher
idk
but i know that bukkit is legal
i found one thing annoying tho
like you get much video on bukkit stuff
?tryandsee
but like when you want to integrate other stuff
aw no command
into your plugins
you dont find much doc on that
and you spend hours figuring out how stuff work
the doc is pretty good
ohhhhhhhhhh
well you dont look for docs
you use ProtocalLib
are there methods to tell whether or not a player is right and/or left clicking with a certain item in hand
PlayerInteractEvent
tysm
e.getInventory.getItemInMainHand/OffHand
sounds good thanks!
oh and a tip from my experience
to check what item the player is holding
use .getType and check the material
if you check the itemStack sometimes it dont work for some reason
maybe its a typo on my side
you can also specify the details of the idea by getting a reference of them item and itemMeta
@lucid jacinth
hmm ProtocalLib is specialized for NMS
/packets
bkcommonlib seems to be less specilized
youre a legend thank you so much
np
I need help. I came back after retiring from my plugin development times and notice that the method to get the player’s command has changed. I used to do if(label.equalsIgnoreCase(“”)) but now that doesnt work, anyone know how I should do it?
idk if it's that tho
hold on ima just copy paste my other problem and send you the link to a pastebin
I tried instlaling spigot with BuildTools and I got this message, but no install:
Loading BuildTools version: git-BuildTools-e03adic-130 (#130)
Java version: Java 16
Current Path: (the path to the folder)
Please do not run BuildTools in a Dropbox, OneDrive, or similar. You can always copy the completed jars there later
It is that
Assuming you use the class that implements commandExecutor
Guys is 1.8 api worse than 1.16 api, also what to do when your server is on 1.8
you can use the ViaRewind to allow 1.8 ppl to join
oh just onCommand?
yeah then I did
when I do /plugins none of them show up
name: MLGrushQueue
version: 1.0
author: Simo
main: me.Simo.MLGrushQueue.Main
description: An addon for the AdvancedMLGrush plugin, allows for game joining with a command
depend: [MLGrush]
commands:
cmlg-joinqueue: attempts to join the MLGrush queue
that's my lpugin.yml
no plugin showed up?
none
then check the log
your plugin didn't load
that?
cool
you are trying to cast String to Map
"commands are of wrong type"
most likely the - in your plugin.yml
nah nvm
commands: cmlg-joinqueue: attempts to join the MLGrush queue
this is a no no
I think that usually works
you aren't setting the descrpition here
description: "hellooouuw, its me"
commands:
cmlg-joinqueue:
description: attempts to join the MLGrush queue
ok
and the dash is fine?
not sure if the - works, but if you get bullied by exceptions its most likely the -
the command in the plugin.yml have to match the command you declare with getCommand
ywh
IT DOES
sorry caps
another error
the depend section is just for the user to know, right? even if I dont have that plugin installed it should still load?
ok
ok it show up now
good to know that all along that was the problem
and the whole plugin works
nice
who would've guessed that such a small plugin would make me happy
Hello!
I am trying to use yaw and pitch to get the targeted location (at a distance of x blocks). Do you have any idea?
using the players direction they are looking?
yeah that's the yaw and pitch @eternal oxide
and what are you trying to get? just a location, a block, an entity?
just a location
always at a set distance?
yeah
player.getlocation().clone().add(player.getDirection().multiply(distance))
okay thank you!
somethgin close. Have to get location before you getDirection
and how would you do for an entity?
and you may want to use getEyeLocation for the direction component
if you want to find the first entity along the line of sight you use rayTrace
also for the base location, don't you?
no
well depends
if you want to move the player to teh location you are looking you use the players location and add teh direction of the eyeLocation
if you want to raytrace you use teh EyeLocation for both
okay, thank you very much!
So, I think I'm a bit dense,
// At the start of the file
@Command(name="test", desc = "Refer another player!")
// Near the end
@Override
public void onEnable() {
getCommand("test").setExecutor(new IGReferCommand(config));
}
For some reason getCommand returns a null value?
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "com.a_logan.IGRefer.IGReferMain.getCommand(String)" is null
at com.a_logan.IGRefer.IGReferMain.onEnable(IGReferMain.java:40) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[spigot.jar:3096-Spigot-9fb885e-296df56]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:342) ~[spigot.jar:3096-Spigot-9fb885e-296df56]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot.jar:3096-Spigot-9fb885e-296df56]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:492) ~[spigot.jar:3096-Spigot-9fb885e-296df56]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:406) ~[spigot.jar:3096-Spigot-9fb885e-296df56]
at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:554) ~[spigot.jar:3096-Spigot-9fb885e-296df56]
at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:257) ~[spigot.jar:3096-Spigot-9fb885e-296df56]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:928) ~[spigot.jar:3096-Spigot-9fb885e-296df56]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:273) ~[spigot.jar:3096-Spigot-9fb885e-296df56]
at java.lang.Thread.run(Thread.java:831) [?:?]
What is config?
Pretty sure that's not the issue, since it's not getting to the setExecutor
Commands need to be in the plugin.yml
I'm using https://www.spigotmc.org/wiki/spigot-plugin-yml-annotations/ which should do it automatically
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
I never knew that even existed
in which case you do have teh dependency in your pom?
yes you get the same error if its missing from the plugin.yml
Do you have the depend in your pom?
Yeah, like I said, it's only the command that has the issue
# Auto-generated plugin.yml, generated at 2021/06/30 17:23:42 by org.bukkit.plugin.java.annotation.PluginAnnotationProcessor
main: com.a_logan.IGRefer.IGReferMain
name: IGRefer
version: 1.0.0
description: Refer a friend!
author: Eclipse
depend:
- PlaceholderAPI
commands: {}
permissions: {}
I think I'll have a play with that later
@eternal oxide
@Commands(value = {
@Command(name="test", desc = "Refer another player!")
})
That's how you add a command >:C
Dumb part on my side
@eternal oxide I have a little problem with rayTrace 😦
RayTraceResult result = player.getWorld().rayTraceEntities(location, location.getDirection(), 1.02);```
Unfortunately result.getHitEntity() returns the player to me
May be should I do something like this:
RayTraceResult result = player.getWorld().rayTraceEntities(location, location.getDirection(), 1.02,
(Entity target) -> !target.equals(event.getDamager()));```
you could
Hmm I am in front of a sheep but it fires a NPE
Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.util.RayTraceResult.getHitEntity()" because "result" is null
So it means my rayTrace didn't find the sheep
Oh I get it now! I forgot to specify the distance
in fact I specified the ray trace instead of the distance!
Anyone know how they make the buttons in inventories? is it some custom texture stuff?
Buttons? If there isn't a material available in the mc client, it's probably a resource pack
Yeah - i just wondered how you implement it spigot side
Simply just modify the item custom model data.
Hi, has Mc put a "limit" on items' name?
Cause I have a plugin that has some custom recipes with custom items
One of the item's name was "Bacchetta Magica del Fuoco" (quite a long name)
The plugin didn't give any error but when I tried the recipe the item didn't come out
iirc, the max is 16 character
Then I reduced the name to "Bacchetta Magica" and it worked
It's a new feature in 1.17 right?
Cause in 1.16 it worked
I guess they should put an error for this
Cause I spent 2h trying to understand what was wrong
I don't really know much about character limit in spigot api.
If it's worked on 1.16.5 I don't see why it didn't work in 1.17
iirc there is no really item name length cap
Then why does that make not work anymore?
oh yea, i don't think there is character limit for item display name
typo? something other wrong in your code?
Nope, I did some debugging, I just change the name, if I put the long one it doesn't work
Also in 1.16 it worked fine, and I didn't change anything since then
Just put the pl in a 1.17 server
are you maybe checking for the name so the recipe works?
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Server.html#getOfflinePlayer(java.util.UUID)
Takes a Java UUID, what method do you use to get it? fromString returns an error...
declaration: package: org.bukkit, interface: Server
does anyone know in the skin restorer thingy what skins have capes?
you take the uuid from a player or from whereever you stored the uuid
if you have it as a UUID, e.g.:
"8f82e9a4b37f45b5a05c1c89b4ed67a2"
UUID.fromString(string-uuid), perhaps?
No, I'm just using a simple shaped recipe format
I'll send the code in a bit when I open my pc
java.lang.IllegalArgumentException: Invalid UUID string: 8f82e9a4b37f45b5a05c1c89b4ed67a2
at java.util.UUID.fromString1(UUID.java:280) ~[?:?]
at java.util.UUID.fromString(UUID.java:258) ~[?:?]
:(
Oh, you need the - thing
wdym?
4-4-4-4
a uuid contains a -.
183hkjahsdkasd-kwahsdh1ih31
okay
I'm getting the uuid from the mojang api, how do you get the dash?:
https://api.mojang.com/users/profiles/minecraft/infinitewiggles
is it in the center or
a UUID is comprised of 4 Longs, each represented in hex separated with a - for the UUID string representation
you could just use Bukkit#getOfflinePlayer(name) then
yeah but it's deprecated and I've already made it do it
so abff-b026-abcd-88ff
its also contacting the mojang api and returning an OfflinePlayer obj. with everything needed
its just deprecated because it contacts the mojang api
nothing wrong with it
I need to contact the mojang api anyway to check if the user exists, so If I use the other method it means 2 requests to the mojang api
2?
I'm getting the username from user input
so I have to check if it exists before I get the object
#hasPlayedBefore or check if some fields are null
if this is for players who exist on yoru server use the server cache
it's not
hence
What I mean by "exist" is they have played on yoru server
does anyone remember the ALT shortcut for the code formatting symbol in discord?
yeah it's for whitelisting players
apparently backtick is ALT+96
I'm not on windows I can't try
for whitelisting the player don't have to exist
you can just request the OfflinePlayer obj over the method and add it to the whitelist
This would be so much easier if I could just get the UUID object
@Override
public void onEnable() {
this.getServer().getPluginManager().registerEvents(this, this);
Bukkit.addRecipe(getRecipe());
}
public ShapedRecipe getRecipe() {
ItemStack item = getItem();
NamespacedKey key = new NamespacedKey(this,"test");
ShapedRecipe recipe = new ShapedRecipe(key, item);
recipe.shape("S","S","S");
recipe.setIngredient('S', Material.STICK);
return recipe;
}
public ItemStack getItem() {
ItemStack item = new ItemStack(Material.STICK);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName(ChatColor.AQUA + "Bacchetta Magica");
List<String> lore = new ArrayList<>();
lore.add("Test");
meta.setLore(lore);
item.setItemMeta(meta);
return item;
}
but you don't have it
just a simple shapedrecipe, nothing special
so from where do you want to take it?
Well I have it, just without the dash
doing your own thing and do a custom request to mojang isnt the way to go here
2??
why 2??
the only request you have to do is the #getOfflinePlayer(name) method
To tell the user if it exists or not, because if it doesn't, then it's probably a typo
if the user doesn't exist the uuid field have to be null
just check for that
no need for a second request
oh thanks
nvm uuid is never null
oh
isn't there a method like user.hasPlayedBefore() or sth like that
yeah, but they won't have
what r u trying to do exactly?
whitelist a player from user input, but only do it if the player exists (otherwise return an error to the user)
2 requests ig
exists means if he has played before or if he is online?
exists as in is a minecraft account
oh ok
not sure if it works but you could check the uuid from the offlineplayer object with the other getOfflinePlayer(uuid) method
the name would be null
OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer("i don't exist");
if(Bukkit.getOfflinePlayer(offlinePlayer.getUniqueId).getName() == null) {System.out.println("yep, definitely don't");
no. just the one taking a string requests the mojang api.
but iirc getOfflinePlayer(uuid) just looks for the player in the playerdata folder
Do a single lookup by name. then check the UUID thats returned against a generated offline UUID
oh yeah, check if it's this uuid: UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8)
hmmm
I found no Entity.getHealth() how would i get the health?
getAttribute
ah ok thx
Document document = new Document("uuid", uuid.toString());
document.append("name", name);
mSkyblock.getInstance().getMongoHandler().collection.insertOne(document);
}```
this code works but I can't find a way for the life of me to get a check as to whether a user is already in the db.. all the ways I've tried either just duplicate the entry every time i log in or do nothing at all
anyone know a way to check if there's already a db entry under the UUID
Hi, i searched the forums for reloading plugin...and I found some suggested plugin.config.reloadConfig() and some suggested plugin.reloadConfig().
Which should I use?
plugin.config.reloadConfig() vs plugin.reloadConfig()
plugin.reloadConfig() works
@hybrid spoke https://stackoverflow.com/a/19399768/6539296 - You can insert dashes into the UUID using regex
any1 know how to make an arrow damage enderman
ok when i used plugin.config.reloadconfig it didn't seem to reload....
will try plugin.reloadConfig
i was researching for hours but don't know how to make arrow damage endermen
so use that instead. make sure to request to the mojang api async and close every opened connection
And how to have plugin prefix or name in warn or info log?
[06:47:37 WARN]: Couldn't find world bedwars. Either it doesn't exist or is not valid.
I used this :
Bukkit.getLogger().warning("Couldn't find world "+ name + ". Either it doesn't exist or is not valid.");
just put [PluginName] before "Couldn't"
Bukkit.getLogger().info("[AntiAC] Registered " + CheckManager.getChecks().size() + " Checks");
ohh you mean in string ok
?paste
https://paste.md-5.net/okewajutib.cs - Is that okay?
(that's what I was always using)
you have to disconnect the connection in the finally clause
get the Logger for your plugin and the prefix will be appended for you.
otherwise there is a potentially memory leak
oh well didn't knew that
yup it does that
disconnecting in the finally clause? nop
nah I was talking about the prefix
and since you're disconnecting the connection you don't need to close the inputStream anymore in.close();
it does that for you
its redundant and could throw exceptions you don't need
Simplified https://paste.md-5.net/zecuvukape.java
is there something not deprecated for player.updateInventory() ?
updateInventory is not deprecated
It's not deprecated.
but can someone help me? i made a few gui's and how can i check which gui the player is using?
compare the instance of the Inventories
yea but how
Which API version are you using?
1.13
but shouldn't the stream be closed in a finally clause since the close can be interrupted?
You compare the clicked inventory to the inventory you created and opened for them
The stream is closed when the reader is closed, or the object is disposed of
something like this?
yes
but in my GUI class i have different gui's defined
you compare to whatever you need to
:/
You shoudl also be using a singleton for yoru GUI class
so you are not constantly creating new objects
yeah but you have no guarantee that this code will actually run. because of that streams & connections should be closed in a finally clause 
hmm
since the finally clause runs in every case
what code is not guraranteed to run?
incomplete msg sent sorry
but i really have to idea how to check inside an eventlistener which gui the player is using
InventoryHolder is very useful here.
Hi i am adding some feature to the plugin I used to fit my needs and is open source.
I edited like below code but it uses global ones from config and returns true even when its set to false and config reloaded.
Code : https://paste.gg/p/anonymous/df82d0326a88436e8830eae76807b9c2
Config FIle : https://paste.gg/p/anonymous/004bd1f4c22f4720b7ab8c3fb6ebecc7
was in world : world
but in log :
[07:37:57 INFO]: [Unexpected Spawn] Used config: global. for on death and the values is true
[07:37:57 INFO]: [Unexpected Spawn] Used config: global. for bed respawn and the values is true
[07:37:57 INFO]: [Unexpected Spawn] Used config: global. for random respawn area and the values are (-399,399,-399,399)
[07:37:57 INFO]: [Unexpected Spawn] Used config: global. and the values are : [SWEET_BERRY_BUSH, MAGMA_BLOCK, CAMPFIRE, LAVA, CACTUS, FIRE, WATER]
Please help and thank you for you time.
What are you not understanding about comparing instances?
your code inside your second try catch. if the code has any issue and or throws exceptions the reader will not close the stream. in finally it will be closed no matter what
well you could alwasy try (reader = blah) { I guess
no need for a finally then
Can't you assign a title to the inventory and check for the title when a player opens an inventory ?
Why is it bad ?
anyone can name a chest the same
all of a sudden your code thinks they have your UI open when its a chest
Compare instances, or at the least check your inventories and see who is holding a handle to it.

yea you say compare instances but idk how
What's your goal, Brush guy?
possible. would go the saver way. but i am not sure if the finally will be executed if you code crashes before
Yes, @eternal oxide you're right, I didn't think of that 😄
i've two inventories and i need to add different like actions for it when you click on a slot for example
using the try method will attempt to close and dispose of all variables/handles used in it
Do you know what an instance is ?
Have a class that implements inventory holder, or best of just use libs.
create a custom inventoryholder which represents your inventory and compare the holders on any action
well
:(
What about what a singleton is @tardy delta ?
Then were did you stuck ?
attempt but there is a chance that it will not achieve it
it calls every close method so if it fails a finally would too
checking which gui the player is using
they are all instances of the same class
get the clicked inventory.equals(your inventory instance)
you must be storing yoru GUI instances
so compare to each and see if it is one of yours
and then assign different functions to the slots?
that overlaps
overlaps?
the inventory A doesn't involve inventory B, how come they overlap? slot 6 for inventory A is the slot 6 of inventory A, slot 6 for inventory B is slot 6 for inventory B
gui a = new gui();
gui b = new gui();
if (e.getInventory().equals(a)) {
// do stuff
} else if (e.getInventory().equals(b)) {
//do stuff
}
p.s: don't follow this naming convention
@tardy delta You should learn Java first
lmao
what could cause my jar to be missing the plugin.yml, config.yml and me folder when building artifact but not when building it normally?
when you are not using vscode
building using Artifacts does not use Maven
anyone know anything about google gson?
Yeah
is there a way to add a generic property to a jsonobject
something like JsonObject#addProperty(String key, T value)
or another way to get the same thing
Uh no JsonObject, JsonArray, JsonPrimitive and JsonElement don’t work with type awareness, it’s mostly for deserialization
thats unfortunate
It’s really not
It’s the model of json
But anyways what are you trying to do?
The chances are that you got yourself an xy problem
yes but the functionality of combining the right action with the right slot is defined in my listener class
if it's the same for both inventories, extract the code and place it inside the if-else statements(but if it is, you don't need 2 inventories)
how is that a problem ?
if () {
dance
run
sit
} else {
dance
run
watchTheStars
}
that's a very bad example and you shouldn't use it like that, but the code above does 2 identical things and 1 different from each other
if() {
dancerun()
sit()
}else{
dancerun()
watch(stars)
}
@ivory sleet actually i can see why they wouldnt support it. However, the only types that T could be are any of the primitive data types or String
i can do it manually
hello
or even
dancerun()
if() {
sit()
}else{
watch(neighbourgirl)
}
dancerun()
yes, that's what I was gonna comment right now
?paste
WAIT! that was a trick xD didn't see what to watch
only saw the dancerun() outside of the if-else statement
this is my gui class
https://paste.md-5.net/enamohinom.java
Anyone here who can help me with quaternions
so the gui can look different depending which register...() method is used
why do you have a setInventory method
and in my listener i need to check which gui the player is actually looking at
you could just do INV = bukkit do my inventory
wrong naming convention, not sure what you want to do, but you're probably abusing the static, initialize your inventory inside the constructor
fk i was going to ask the exact same question
because i have only one static inventory and the setinventory() sets the static one to the one i want to use
Yes because Json only consists of 5 types really,
strings, arrays, json objects (maps), numbers and booleans (or well null also)
So in this server, whenever I pvp someone its either that the hits are very delayed or that only one in a few even get registered. I ran tests and it’s not client sided. Anyone know if and how I can fix it by writing my own plugin?
/kill @e is a good one
define "delayed or that only one in a few even get registered"
there is a cooldown between each hit
in that cooldown you can't hit the player
I don't want to sound harsh, but I have to do it, at this points it's probably better to pause your project for a while and learn a little bit of java and when you're ready return to continue
its just bukkit related i guess
that sounds so harsh
no
oop
Like I hit him ten times and he gets hit between the 9th and 10th hit
Like were in godmode that gets disabled for a second every 5-10 seconds
well someone says i have to create one instance someone says multiple how can i now whats wrong then
maybe i will find it out if i scroll up, but, what is your goal?
to find which inventory is open
we kinda messed up a little bit upwards talking about singleton and multiple instances >.<
there is not even a single instance needed
you just create your own inventoryholder which is from now on your inventory wrapper. on click you check, if the holder of the clicked inventory and your inventory are the same
Yes, the situation was a little bit different and had (almost) nothing to do with the said class
confusing my confusion
4th edits, for real ^_^
Small question, I'm making an hardcore mode like plugin, currently dead players are invisible with block place break and interact disabled. I would like to create an box around the player under the bedrock layer if possible. Anyone got a clue how to generate those things ?
so i have implements InventoryHolder?
box under bedrock?
Correct
like, placing blocks in void?
just for a second so just 1 hit comes through? sounds like normal minecraft to me
Yea just under the layer
and what do you mean by inventory wrapper? thats just my english that isnt good enough
your programming knowledge isnt good enough
your custom inventoryholder wraps himself around the inventory and represents it by the #getInventory method. also it manages the inventory
dun think that's possible without modding the game
sth that HAS-A sth, and representative of that sth
f.e. Integer is a wrapper of an int
yes
Hmm could always set them in invis boxes high In sky
so the Integer class HAS-A int to manage and represent and wraps it
sth = something?
so true horny
Anyway the main thing I was asking is there documentation about generating custom structure?
its like a bottle full of water. you don't say "can you give me the water?" you say "can you give me the bottle of water?": the bottle wraps the water
ok this more accurate^
so in my case the wrapper would be my GUI class?
sorry i have no knowledge in this XD
Yes
the wrapper IS your custom inventoryholder class (the one implementing InventoryHolder)
okay
as long as it implements the InventoryHolder
if it doesn't it still wraps the inventory
well
i compared it with a bottle of water
and its just that simple
never thought of this "inventoryholder holds an inventory"
just like pullover pull-over
🤣 me neither
i have this to check it
if (event.getInventory().equals(trailsMenu)
where trailsMenu is an instance of my gui thing
thats not how it works
you have to check if the HOLDER of the event inventory is instanceof your custom holder
this class
ah
also don't null the holder
you have to set the holder to "this" since you wanna use your customholder
okay
you might wanna search up inheritance, gui isn't even an instance of inventory, cant be equal
Not like that, its more like there’s a massive hit delay
Or I hit him 10 times and he gets hit once
but if he is in godmode... how would you hit the player?
you can
All your hits have massive delays
Yeah
like skr skr skr skr
So its kinda like that
instead of skr click skr click
if event.getInventory().getHolder().equals(tradeMenu.getInventory()
just ban players with a high ping
still not
No you dont get it its not about the ping
That was just to describe what the problem looks like
lmaooooo, you literally just flipped the error
you mean that in godmode no hit is being done because.. the player is in godmode..
ah
seems like a problem with the performance
like low tps or stuff
Maybe
whats wrong then?
or any plugin blocking the hits
Is there a way to fix it?
now what you're doing is checking if the holder is equal with an inventory
ah .getHolder()
figuring out what is causing it and then probably yees
Hello, can someone help me with this err: java.lang.IllegalStateException: Cannot get plugin for class com.zaxxer.hikari.util.DriverDataSource from a static initializer?
Oh ok
send the full error
Well it might be the mlgrush plugin
?paste
Ill ask the owner to remove it for a sec
you already have getHolder
getHolder().getInventory().getHolder().getInventory().getHolder()........;
if(eventInventory.getHolder() ------->**instanceof**<------- YourInventoryClass) {/*ah yes */}
Can you bypass the 16 character limit?
you've already got this question answered several times. use a prefix/suffix
No I haven’t
did you shade hikari in?
yes, first i checked that
so
if (!(event.getInventory().getHolder() instanceof GUI)) {
return;
}
this not shading
How can i count all columns in mysql?
that's not shading
Like every single column
thats not shading
how were you guys so fast
but ofcourse its instance of my class :/
and what then?
as i said all the time
and now i have to look which inventory specific the player has open and then assign slots where can be clicked on to it
🤡
in java,
ResultSet#getMetaData()#getColumnCount();
query any row
you can use the getInventory() which was implemented
the one i made myself?
so what with that err?
you just did
with checking if the inventoryholder is the same
so if the holder is different its a different gui
probably coming from not shading hikari into your plugin or having it not present on your server
yes, if you don't assign the holder to other inventories.
but how could i like specify a specific table
do a query
The problem is with his class, is that he is creating 2 inventories, one named Trails and other Trade
but it only doesnt work after plugman reload, if i start the server it works fine
he needs to create 2 classes each for each inventory
hmmm
and so its the same inventory every time
cannot be efficient if i have to create a different class for each inventory
hmm
ya so he have to do 2
finally someone who understands my problem 😂
your problem is not knowing what you are doing
we all understood that
just like i don't know what i'm typing
ok this, result set comes from executing a query statement on the table
i dont know that bukkit things very well
i know what that is it just didnt know how to look which inventory of my class is open :/
to be fair, I probably confused him quite a bit in the beginning because I misunderstood a few things, but yes, he needs to revisit some some knowledge
and still dont..
and ofc it is
i do that too for one of my plugins
final ResultSet rs = MySQL.prepareStatement("SELECT all_usertags FROM information_schema.tables;").executeQuery();
i have like 10 different holders
i used something like this
to identify the inventories
like 20 classes :/
Multiple classes don't really effect performance
looks fine, what is this MySQL? a class?
10
depends on the usage
wauw
if that represents your sql connection then it should be correct
or every class contains its own holder?
yea it does
every class implements the inventoryHolder
and then something like this?
I would have put * instead of all_usertags
and in this case I assume the table name is information_schema.tables
ah ok you need to specify the table name
all_usertags is my table name
select * from all_usertags then
final ResultSet rs = MySQL.prepareStatement("SELECT * FROM all_usertags;").executeQuery();
yep
you dont need the ;
maybe idk
but at least sqlite doesn't need that
It will run, but it's recommended to be there
oh
Yep, the JDBC is inserting it by itself if it's skipped and that's the reason they rec to add it (as mentioned above)
nvr heard of MySQL class, is that sth from MySQLConnection or sth
like this and then all implements InventoryHolder
yes
yep
i could send you some examples but you won't understand them and the code is not clean at all
maybe i will
I have a simple menu lib but it's not great for certain applications, I can send it aswell if you are interested