#help-development
1 messages Β· Page 243 of 1
I always identify the items using PDC, e.g. like this https://github.com/JEFF-Media-GbR/ChestSort/blob/master/src/main/java/de/jeff_media/chestsort/gui/NewUI.java
umm.. let me change question. is there any better way to get entities in straight forward from player direction?
π€
ughm you want to get the entities the player is able to see?
well you are using a h2 db and not sqlite
umm... yes. I'm trying to make skill targeting system
I thought you wanted to use sqlite?
hm that's not really possible, the server has no clue about the FOV iirc
var 
ILLUSIo
ahha thank you for answering! π
for h2, you ofc need to use a h2 driver, not sqlite. for example this https://mvnrepository.com/artifact/com.h2database/h2
no 
illusion help me pls
you could ofc just get all entities that are inside the "default fov" but that requires some math that I am currently too tired to think of haha
I'm always lurking
I did realize this many weeks ago
we all have our own menu utils
EntityLocation#toVector#angle(PlayerLocation#toVector) < 70
type deal
doesnt it return radians?
lemme check my gun code
I mean, I'm doing a setup inventory, what's the best way to make it also editable from config?
I don't want to generate new consumers and assign them every time...
But, I don't know how to do it
I made a whole menu engine for that
but it's absolute garbage
and verano wants to copy it
nice
my gui.yml looks like this lmao https://github.com/JEFF-Media-GbR/ChestSort/blob/master/src/main/resources/gui.yml
that's the best I could think of
same haha
ok yeah then just loop over all entities and check if their angle is <= desired angle in radians
you can just use World#getEntities() instead of Bukkit#getEntities()
?paste your whole pom.xml
also use sqlite, not h2
why do you even need a db?
S3 best
Simple rule:
JSON for public plugins, MariaDB + for some things JSON for private plugins
what
did you just repeatedly press the autofill button?
any one can tell why middle click is not working in survival mode when u click in gui
No. I have autofill disabled
;)
Just read something about databases here and stated what the best data-storing methods are in my opinion
Saying json is best persistent data-storing method ?
Mojang "fixed" the creative like drag in survival by completly disabling the middle click
amazing fix
For plugins in general publicity yes
so only way to get middle click to work in gui would be putting player in creative and then after event back to survival
I don't recommend doing that but yes
except for the fact json is not designed for that
Ah and which data-storage is made specificly for minecraft?
Maybe pdc
But I don't like to use PDC
who is talking about mc specificly ?
I am
lol
Most people use mysql or sqllite for public plugins in what ive seen
Mind telling me what makes json soooo great over an actual database
Json as in flat files?
"flat file" sounds like my ex
Yes
Add a clickable component to the page component
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Wrong channel. Use #help-server
It adds it in 2 different pages
Map<Integer, Element> elements = new HashMap<>(builder.getElements());
for(Element element : elements.values()) {
if(element.getAction() == null) continue;
ECompanyCreator action = ECompanyCreator.valueOf(element.getAction());
element.setEvent(listenerSetup(action));
elements.put(element.getSlot(), injectPlaceholders(element));
}```
How can I prevent builder elements from getting modified?
nah he wanted a final plugin
By external people? Or...
what?
How can I prevent builder elements from getting modified?
...
Elements inside builder.getElements(); get modified by the for cycle.
How can I prevent that?
Make hashmap immutable
Is there any custom symbol to make straight horizontal line without spaces?
I mean the convoluted way is to make those elements have an impl that you can instanceof check or a modifiable boolean
try that symbol β
thx
What do you suggest to do that?
I mean arenβt you supposed to mutate the builder? Sounds a bit contradictory
Tbh
Cuz its just an intermediate class anyway
Presupposing youβre using builder in the sense of the design pattern
It is a setup inventory.
injectPlaceholders method replace %example% values to (example == null ? "Undefined" : example).
If I modify the builder, the value will always be "Undefined".
ββββ
=========
I usually also just use ===
?
At this point, what do you suggest to do?
Why not add the elements at the .build() of your builder?
If you're worried about them being modified during the building process
It isn't a lombok builder
wdym
What. I'm talking about the builder pattern
i am trying to add an inventory item, but its not adding and no logs on console
You can also do this as well
static Inventory kitSelect;
static LoyalAddons plugin;
@Override
public void onEnable() {
plugin = this;
commandRegister();
inventoryRegisterer();
ItemSetups.setupMethod();
inventorySetup(kitSelect, ItemSetups.getItems());
}
public void inventoryRegisterer() {
kitSelect = Bukkit.createInventory(null, 9);
}
public void inventorySetup(Inventory i, ArrayList<ItemStack> a) {
for(ItemStack stack: a) {
i.addItem(stack);
}
}```
Can you please take a look, if i miss something, the inventory does not contain the items somehow
Item cannot be null
at org.apache.commons.lang.Validate.noNullElements(Validate.java:364) ~[commons-lang-2.6.jar:2.6]
at org.bukkit.craftbukkit.v1_19_R1.inventory.CraftInventory.addItem(CraftInventory.java:287) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3553-Spigot-14a2382-ef09464]
at me.limpeex.loyaladdons.LoyalAddons.inventorySetup(LoyalAddons.java:29) ~[?:?]```
Now getting this but i actually am adding the items by ItemSetups.setupMethod();
here;
public static void setupMethod() {
setup(diamondKit,
diamondKitMeta,
"Diamond Kit",
0,
Material.DIAMOND_SWORD);
setup(goldKit,
goldKitMeta,
"Gold Kit",
1,
Material.GOLDEN_SWORD);
setup(ironKit,
ironKitMeta,
"Iron Kit",
2,
Material.IRON_SWORD);
items.add(diamondKit);
items.add(goldKit);
items.add(ironKit);
}
static 
The problem is not that...
Let's say I have a CacheInventory.java with inside some builders, at the inventory opening the builder passes me both a Map<Integer, Element> and a CustomInventory instance.
The builder's default schema contains, for example, in a item displayname %company_name% and that's what I want to change, at the same time, I want to preserve that "schema" since after you set the value "Company Name," it has to show it in GUI for confirmation.
If the default displayname is changed, you can no longer do the replace of %company_name% because there is Undefined instead of that
this.elements = new HashMap<>();
builder.getElements().entrySet().iterator().forEachRemaining(entry -> elements.put(entry.getKey(), entry.getValue()));
for(Element element : elements.values()) {
if(element.getAction() == null) return;
ECompanyCreator action = ECompanyCreator.valueOf(element.getAction());
element.setEvent(listenerSetup(action));
elements.put(element.getSlot(), injectPlaceholders(element));
}```
Have a field for if it's been modified already?
I just want to make the builder.getElements() map immutable and was wondering how to do that
Just wrap it with collections.immutableMap
immutable as in you can't add or remove from it?
for(Element element : Collections.unmodifiableCollection(builder.getElements().values())) {
you cant really make it immutable
Immutable as the for loop doesn't change the default builder pattern
at least not to compile time
You should probably rename it to something else, as the term builder is relatively reserved for the builder design pattern so if youβre not implementing that pattern it gets quite misleading FutureMcServer
I'm not sure that I understand what you want to do, sorry
I have no idea how to explain myself
After I replace the placeholders, they changes also inside the builder.getElements().
I just want the builder to remain the same.
Right now, the value is always Undefined even though it shouldn't
private Element injectPlaceholders(Element element) {
System.out.println(LegacyComponentSerializer.legacySection().serialize(element.getDisplayName())); //result in photo
TextReplacementConfig name_replace = TextReplacementConfig.builder().match("%company_name%").replacement(name == null ? Lang.NONE : name).build();
TextReplacementConfig description_replace = TextReplacementConfig.builder().match("%company_description%").replacement(description == null ? Lang.NONE : description).build();
TextReplacementConfig owner_replace = TextReplacementConfig.builder().match("%company_owner%").replacement(owner == null ? Lang.NONE : Bukkit.getOfflinePlayer(owner).getName()).build();
Component injectedDisplayName = element.getDisplayName().replaceText(name_replace).replaceText(description_replace).replaceText(owner_replace);
List<Component> injectedLore = element.getLore()
.stream()
.map(component -> component.replaceText(name_replace).replaceText(description_replace).replaceText(owner_replace))
.toList();
element.setDisplayName(injectedDisplayName);
element.setLore(injectedLore);
return element;
}```
Did I explain myself better, Mike?
Wait is the issue here the undefined or
%company_name% is permanently replaced with Undefined.
Sounds like you have an entirely different issue
It seems to me you're writing everything in the most convoluted way possible. It's extremely hard to understand your code because it's so heavily abstracted.
It seems to me that the %company_name% within the builder is changed to Undefined and when it goes to change it back once the inventory is reopened, it finds Undefined and no longer %company_name% and therefore does not update the value.
That's surely a better explaination of the problem
I would call it customizable lmao
I would use the word convoluted
nice
Mhm
is it called?
oh wait I found the problem nvm
XD
Hey guys, my plugin is not able to detect the main class, idk why, I checked everything, I am using maven
?paste the error
plugin.yml doesnt have the right main class
lightmode?
yeah well it is a long story
or to make it short, I have a screen guard on my monitor which makes it hard to see in dark mode
I saw that question coming π
?
I believe it is getting compiled, or else it would've given that error above
right click the jar and extract to zip or something with winrar
wait a minute, wtf is petal and petal-api
on there stacktrace its using petal api
this one
its a fork of purpur
i just found it
its made by bloom
Hello, is there an Minecraft plugin, that removes the Kill counter under the name of a player?
how can I check that?
check that the package names are still correct
I did
All of them are correct
Hello guys, I have an issue I still haven't fixed, so basically I have a stone block on which I used sendBlockChange and modified it to dirt for example. When I break the block with hands the dirt "cover" breaks like I'm breaking dirt, then the stone appears but breaks by itself 5s after. How can I make the block break when the grass "cover" is broken or how can I make the block only breakable by pickaxe (because with a pickaxe this bug doesn't happen)
you want a full client-sided block system
I can't make client sided things with a plugin
you can, with packet hackery
basically you want fake blocks
so you send block packets
your problem is that the server is sending more packets to correct for desync issues
you just gotta handle them
It's something I've been working with for the past 2 years
Not possible with the API
^
protocollib?
it bothers me because I managed to make everything work with just spigot API without packets modifying; and just this step I can't get it to work
I have no idea how to work with packets in minecraft tho
yes
I made a crappy tutorial and I'm remaking a full nms course that teaches fake entities & blocks
you either wait or you can just read one of the drafts
wait for christmas
the crappy tutorial will probably also help me
ill steal your christmas tree
<Spoiler | Minecraft>
Minecraft's packet system is fairly simple - Running on TCP, Implemented with Netty. Feel free to skip any sections you might already know.
You can find information about Minecraft's Protocol HERE [wiki.vg/Protocol]
<Spoiler | Protocol Stages>
-> Handshake: The client and the server communicate. The client indicates its Protocol Version, what address it used to login, its port and the next stage (Status or Login)
-> Status: Once the handshake goes through, and the status stage is requested, the server responds with a Json string containing the version name, protocol version, how many players are online, the favicon and any other information required.
-> Login: Once the client is ready to login, and requested the login stage, both ends encrypt, and optionally settle on packet compression.
-> Play: When a player is at this stage, the login process has finished and the player is actively playing on the server. This is the most common state.
<Spoiler | Byte formats>
The byte format for NMS packets are quite simple. Looking at the (Protocol)[wiki.vg/Protocol] page, we can understand that each Protocol Stage contains its own registry.
Every single packet contains a Packet ID on its header. The packet ID starts at 0, for the first packet on its dedicated stage. This means that multiple packets can share the same Registry ID, because they belong to different stages.
Each packet also contains a direction: Clientbound (Server -> Client) or Serverbound (Client -> Server). All packet classes are mutual between the client and the server, given the Protocol Versions match. (ViaVersion-like plugins convert the packet contents between multiple protocol versions)
Let's grab some random packet and break it down in a simple way:
[https://imgur.com/a/O7Plb2D]
This packet is broken down into the following contents:
-> Packet ID: 0x3B (16, hex) AKA 59 (10, decimal), which is the ID of the packet in the registry
-> State: Play, which is the Protocol Stage this packet belongs to.
-> Bound To: Client, which means the packet is sent from the Server -> Client.
-> Count: VarInt (Variable integer, basically a fancy format that encodes numbers in a smaller byte length)
-> Entity IDs: Array of VarInt (We write the amount of values in the array in the field above, then write each value separately)
In case you understand concepts easier with code, here's a basic example (this is pseudo-code)
<Spoiler | PSEUDOCODE>
on packet receive(packet) ->
packet_id = packet.readByte() // 3B
entity_count = packet.readInt()
array = new int[entity_count] // create array with pre-set size
for(index = 0; index < entity_count; index++) ->
array[index] = packet.readInt()
// then the client just loops through the array and stops rendering such entities
```,
or, to write the packet,
mob_array = [1, 2, 3]
mob_count = mob_array.length
packet = new ByteBuffer() // just create some packet object with a given id
packet.writeByte(3B)
packet.writeInt(mob_count)
foreach id in mob_array ->
packet.writeInt(id)
where the resulting packet would look like (these values aren't necessarily bytes)
[
3B, -> Packet ID
3, -> Mob Count
1, -> Mob ID 1
2, -> Mob ID 2
3 -> Mob ID 3
]
------------
π
here's one of the drafts
looks like my presentation english
just explaining the basics of packets
I still haven't gotten to write about intercepting, or writing varints to the byte array
this looks painful
smh
fake entities are a lot simpler honestly
can anyone help me with thhis?
show the package structure
,
caps in a package!?!
yer
no I don't think that is the iissue
try refactoring and seeing what happens
because at first I had it in lower case
I've never had an issue with it without caps
whats the issue
wait let me conofirm
If it works then it is a really dumb mistake
WAW I did a really dumb mistake
what you do lol
here in plugin.yml the name is MysticChat
But here I had it MysticPlugin
π€¦ββοΈ
π
well yeah I had it lower cased before but I thought maybe changing it a bit might work
idk so I tried it
but now I have it lower cased
This is so embarrassing
What is the right way to make an API request without holding up the main thread?
I did a very rough timing of a method that I have (which involves making an api request then returning the requests body) and it takes anywhere from 500 to 700ms, which (I think) I dont want running on the main thread since (I think) it would cause lag if called multiple times since (again, I think) that the main thread just waits for my method to complete
My method gets called on the PlayerJoinEvent
Async
cant you run it on the AsyncPreLoginEvent cuz its async already and you can just call it sync in that context
anyone know how to play a sound on a event? its not working for me
huh, I didnt know that was a thing
Ill try it
https://www.spigotmc.org/threads/player-playsound.260386/ Are you looking for this?
?paste the errors then
when im trying to put this: https://cdn.discordapp.com/attachments/1043888821558837329/1047560631907258499/image.png
erorr comes up "Symbol not found"
Is there a way to speed up a bukkit scheduler?
as in?
Like just run it immediately if I have the task
Like say there is something set to run in 7 seconds
Is it possible to run it sooner after I already started it
what is wrong with that code
when im putting Sound.ENTITY_BAT_TAKEOFF
it doesnt work
but it exports
well BAT_TAKEOFF doesnt exist so idk how your using that without an error
it exist
obsfucation
thank
im gonna say its because 1 and 1 arent floats
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_351]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_351]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_351]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot.jar:git-Spigot-21fe707-741a1bd]
... 15 more``` this are the error logs
ah 1.8
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[spigot.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot.jar:git-Spigot-21fe707-741a1bd]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.PlayerConnection.a(PlayerConnection.java:270) [spigot.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.PacketPlayInFlying.a(SourceFile:126) [spigot.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.PacketPlayInFlying$PacketPlayInPosition.a(SourceFile:57) [spigot.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.PlayerConnectionUtils$1.run(SourceFile:13) [spigot.jar:git-Spigot-21fe707-741a1bd]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_351]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_351]
at net.minecraft.server.v1_8_R3.SystemUtils.a(SourceFile:44) [spigot.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:715) [spigot.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [spigot.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [spigot.jar:git-Spigot-21fe707-741a1bd]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [spigot.jar:git-Spigot-21fe707-741a1bd]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_351]``` and this
i dont touch 1.8 so i couldnt tell you whats going on
I see, people still insist on getting help with 1.8
is this code wrong
is this a public plugin or something you making for your server?
for me
just modify the server code directly then
there is no more 1.8 updates
it isn't changing, you are free to do whatever you want without worry
its best pvp
are there any errors?
therefore, why make a plugin for NMS when you can just implement it directly and not mess with reflection
what do you mean
you can change whatever you want in the server code, the reason reflection is used for NMS in 1.8 is because certain things are set to private and not accessibly by normal means
you can remove all that reflection by either going in and making it accessible in the server code yourself or directly implement the plugin into the server code
you said it is for you
better off learning updated NMS stuff and not some outdated stuff
why use 1.8
what is NMS
^ NMS has changed quite a bit since 1.8
for personal projects
"Best pvp"
"best performance"
because more fps when play and the pvp

No cap what was said earlier
uh
I can understand the reason for it, just everyone else can't understand that it means no support or lack thereof lol
oh
nice help
its outdated
why would you expect help for something that is several years outdated?
?1.8
Too old! (Click the link to get the exact time)
However I am helping you
by informing you that if it is just for you and nothing more, then just change the server code
1.8 isn't getting anymore updates so you can change the code however you want without worry about some update
minecraft 1.8.8 is going to preschool
if you also can't understand the reason for reflection or why it is necessary for NMS then you probably should learn the basics of it again
the most commonly desired trait is 1.8 pvp
the main reason reflection is necessary is because in the server code, certain objects, methods and values are set to private and thus inaccessible by normal means
even if we make a perfect plugin
that intercepts packets
and replicates all the 1.8 logic
people won't be happy
unfortunately this is true, however for me the main reason is because there is less code for me to remove that I have no use for depending on the server I am making
however I do update the protocol
Are you going to update it past 1.8 ever?
if I really want a lightweight server
Answered before I asked :3
I make my own or grab one of those afk lobbies that does the logic for me
I feel like making a modular server type deal
where we can disable the full achievement module and have it just... not run
would be great
lol
yeah I don't keep it as 1.8, I just use it as a base code is all
and then I might update some other classes here and there to make them better
frostalf is basically hypixel
the thing with basing off of 1.8 is that half the api is gone
Lol
true, but if you already modifying the server this really isn't a big deal and you can just make your own which I usually do anyways
reinventing the wheel I see
Hypixel could kill 1.8 if they updated too bad it's probably wildly expensive
it probably isn't expensive for them, but they it isn't quite right to compare hypixel though to say that of someone else running 1.8, their code base has diverged so far that it is better to say they maintain their own fork
but unlike everyone else, hypixel is also not coming here to complain about 1.8 either π
or searching for help lol
I mean like
their 1.8 fork is wild
direct color translation on the sendMessage method is something I never expected to see
Have you seen hypixel code?
probably more optimal that way, I mean like I said, no more updates for it so you are free to change whatever you want really without worry about some update
a bit
I keep forgetting who it is, but there is someone here that works on hypixel stuff
uhh
Dctr maybe
but he left hypixel
I remember him from my interviews
minikloon is not here
inventivetalent is not here
codename_b is not here
neither is agent_kid
externizable is not here
dctr left
Damm he left us :(
But it was Agent K that was here and would talk about the hypixel stuff from time to time to clarify some myths π
never spoke tho
I think they used a different discord user
I just clarified as much as I could when I did my interviews
hard to believe
seems like the right guy
I am not saying you don't have the right person
Where did all the hypixsel admins go
how can I speed up daylight cycle?
real world?
they talk within their own dev server
like
they know what they're doing
there is a secret society in regards to MC dev
What
you didn't know about this?
well I guess it wouldn't really be secretive if everyone knew right? lmao
I didn't know there was a secrect society of mc develoeprs
I knew there was a server full of them somewhere
don't feel left out, I am not part of it either π
I just know about it is all π
i dont π€£ I dont think it would be a very good place to be
are you not in it
no ?
and they get easier direct contact with Mojang, as far as I have been told anyways
is here not full of mc devs?
Not sure if MD ever joined it, last I remembered he was invited though
I will eventually find the name
can i stop armour stands being moved by shulkers and pistons etc?
yes
So it's not settable in the armour stand creation?
with shulkers not quite sure how they move armorstands
no, they are entities
really weird there is no messages of them talking here, I am quite positive they have before because I remember routinely talking with AgentK
however they did talk over in paper though π€¨
check its a block interaction and there is probably a clickedBlock method
declaration: package: org.bukkit.event.player, class: PlayerInteractEvent
yea this can give block but before change? yea?
havent checked so dont know
what do you mean after?
i would expect the even to call the block prechange if applicable, if you delay a method a tick and get the block it would give it after a change if applicable
if you click on closed trapdoor, trapdoor is open (but getClickedBlock() give result trapdoor is closed)
delay it a tick or so
correct because any event that is cancellable gives the previous state before anything has happened
sorry I can't delay ;/ it is good but I can't
?scheduling
I know but really I can't ;/
Delaying a tick to get the state after an event is the appropriate solution
if you cant use scheduler, there isnt a good so to say way to get the block after a change has applied
no in my
case
:c
well you haven't explained why you can't delay by a tick
^^
I need actual time when player place block and if player in this time break or place can give bags
they are not going to break or place a block within 1 tick of the event
however I do have another solution
Do not use the block or state from the event and instead grab its location
use that location to use World methods to get the block instance
should give you the updated state as opposed to the previous
isnβt the event called before the state is actually changed though
you know I'm not convinced especially since we're not talking about one player and it can be any player
if have setCancelled() π no
that has no bearing
I just donβt know whether the dispatcher updates state -> call event with old state OR calls event with current state -> cancels if necessary -> updates state
I don't have the implementation up to check and see
my guess is the latter because thatβs just intuitive with a cancellable event, but yeah would need to check impl classes for that
Like surely it doesnβt update state, construct a new Block and BlockState for the event, then if cancelled set it back
A this work PlaceBlockEvent
you could always set a flag for the block in question that you can check for in subsequent event calls for the same block if by chance someone attempts to destroy or build or whatever before your 1 tick delay check
Maybe exists something like PostPlayerInteractEvent?
because thatβd be required for World methods to return a different state than the event parameter
||Please don't defenestrate me for using kotlin, Butttt.......||
Is there a way to stop AsyncPlayerPreLoginEvent#disallow() from logging to the console twice? ```kotlin
@EventHandler
fun onPlayerPreJoinEvent(event: AsyncPlayerPreLoginEvent) {
/* Some unimportant logic here */
val preLoginResult = AsyncPlayerPreLoginEvent.Result.KICK_OTHER
val reason = Messages.getString("Disallow_Join_Reasons.Proxied_Connection_Detected")
event.disallow(preLoginResult, reason)
}
The code above shows this in the console ```python
[12:28:30 INFO]: Disconnecting com.mojang.authlib.GameProfile@5a4a17a[id=71640684-7c0c-41e3-a4d4-87aa6b891fba,name=MrMcyeet,properties={textures=[com.mojang.authlib.properties.Property@5581d26c]},legacy=false] (/127.0.0.1:54564): The service that controls your IP address has disallowed you from connecting to this network.
If you believe this is an error, please contact a system administrator
[12:28:30 INFO]: com.mojang.authlib.GameProfile@5a4a17a[id=71640684-7c0c-41e3-a4d4-87aa6b891fba,name=MrMcyeet,properties={textures=[com.mojang.authlib.properties.Property@5581d26c]},legacy=false] (/127.0.0.1:54564) lost connection: The service that controls your IP address has disallowed you from connecting to this network.
If you believe this is an error, please contact a system administrator
No such thing exists, to my knowledge
in some places it is like this
Doubt it, it probably spams twice because there is two events for that
AsyncPrelogin and PreLogin
Damn, annoying but understandable
bite me
@EventHandler
private void onRightClick(PlayerInteractEvent event) {
System.out.println(event.getAction());
}
not triggering for right or left click air
?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
}
^^ in case you know what's going on here
something's gotta be wrong
why tf isnt this being called for left click air
or right click
;-;
AAAAA
gonna update my server.jar
it only triggers if you are holding an item
i am holding an item
and it doesnt trigger if you're right clicking air with an empty hand but it's supposed to if you left click air with an empty hand
empty hand does not trigger, left or right
i am holding an item though
in your main hand?
yes
what item?
left is supposed to trigger because it sends aswing arm packet
a while back the code changed to not trigger on an empty hand
its client side only now, unless you are holding an item
i am holding an item
If you are holding an item and it's not triggering you have some other issue
I have no idea what the other issue could even be
a skill issue
have you shown us any code?
here
it is registered because it prints the action if i click a block
Makes no sense if you are using spigot
gonna build spigot on buildtools
same result
@EventHandler(ignoreCancelled = false) fixes it
wtf
isnt that the default?
wait now i removed that and it works again
nani???
When Java is idiotic as fuck ^
that was the weirdest bug ever
now it works just fine
same code as before except it works now
I once build my plugin that had MySQL in. I used the shaded file, and MySQL still "didn't had installed driver".
lol java being java
just wasted so much time debugging nothing
Relatable
the new way to do it
i remember then it used to be like getMainHand
why is playerinteractevent set as cancelled automatically if you right or left click air
are you running paper by chance
Paperπ§» mc
yes
but i also built spigot and same thing
paper probably cancel the right click air
I just tested it on Spigot and it all works as expected
mine works now all of a sudden
idk what happened there
but i also found that InteractEvent is cancelled by default if you interact with air because of this
not on spigot

ignore me, it is
Hi, how can i get 1, 2 and 3 considering that A is a location? I mean how can i rotate the A direction by a certain offset to get 1 and 3? (cause 2 is just A direction)
So right now when i type "remove" it does nothing. When i type "add it adds player to hashmap, sends title but then removes them and sends deactivated title right after
I dont understand why
rotate around Y
yes, my question is how can i do so?
Bukkit vector class has all the rotations
Anyone?
what does Timer.clearTimer do?
Removes player from hashmap
Iβve also tried it without using the method, same outcome
perhaps the issue is with the way you tick down the timers?
remove
Iβll turn my pc on and show ive not really used timers before so not sure
does not have a remove from hashmap
What
^^
write the appropriate classes and methods to modify collections instead of exposing them
You're gonna have to simplify that, idk what that means lol
mhm?
or 'this' ?
ah yeah a setter to put into hashmap? That's what you're saying?
Yeah ik i removed bcos i thought it was my methods messing the command up
will do!
Do you know whats up with the command though??
.
It's just a command? What other way could i do it lol
kk
how?
kk, static abuse how??
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
change CommandManager to manager
you have a var being set on instance being created
and whers the private
yeah my bad i feel dumb for that
For this it's forcing me to as hashmap is static
i tried
ah it let me now? Weird, one more question how do i access the hashmap if it's private?
getter/setter's
kk
ye honestly it looks kinda messy
^^
skipping java moments
Not skipping, i swap between, i barely code in bukkit
thanks
Only been coding 3 months
sorry i just feel like this can happen alot on here
no worry
Yeah i get that, but I have the odd day on bukkit as it find it good practice to implement thing's i've learnt into something practical
Maybe a stupid question but what is @urban grotto in place of?
discord lel
don't use annotations like not null if you are not sure how to use them. If you use notnull and you make that thing null, bad things happen
yeah i left it out
so what is the reason for the unchangeable variable?
ahh kk
so if im using this getter in a if statement i need to return it boolean? thats okay instead of Long right? i just remove the 0L?
ah shorting and cleaning
you can make your get method return any type you want
ahh yhyh
well almost any
sound
but it makes sense however to name your get method in relation to the type you are returnning
so if the map holds Integers and you want to return Long
it makes sense then to make the method name getLong()
Would this work to check if player is in hashmap?
just so that it is clear on the type being returned
I need to understand more on what key is
Okay great
so key would me the player.getuniqueid
Great thanks guys
anything really, but ideally you want to use a type that is likely to be unique since the Hashmap can't have duplicate keys
UUID fits that
My TreePopulator suddenly stopped generating trees?
and generally the preferred
Cleaner? π
?paste
How would i do that for args for a command though? I'd understand if it was an event
&& is a thing
... true
and do early returns
idk how exactly your entire code works, but maybe you should check to see if the chunk is loaded first?
yep they r
in fact it worked this morning just fine. But after some coding ( not messing with world gen ) it stopped
this is horrible
prime example of static abuse
very old code frostalf
let it stay that way
I'll re run it and see if my problem has magically fixed
it is in my backup dumpster
add instanceof Player before casting
may produce Cast Errors
ah yhyh
you forgot a return in that permission check
I love how everyone is pitching in to fix their code
β€οΈ
or asking people to make their code for them
π
I'm not??
not you klocodes
Hey so now i did Di, when i registered command it asks for the 3 args
ahh
they are on my block list ironically
bet your block list most be long
so many people to skip to learn proper code writing
just use copilot which generates a whole class for you
yeah cant lie im confused , im on the getters in the main class part
i did alt insert
then went to load them in onenable and it said the result was ignored
getters is ez
private myobject;
public object mygetter(){
return myobject;
}
it is literally just return things
i just removed that
it had an error
"public Timer getTimers() {
return timers;
}
public CommandManager getManager() {
return manager;
}" ???
You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
Becomes:
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
return timers;
}
public CommandManager getManager() {
return manager;
}```
no shet it is null
?paste full code
eg timer = ...
ahhh make an object of
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.
im on a udemy course, on objects currently but i just struggle with this instances etc. It's something i've been stuck on for a couple of weeks :/
How i can solve this?
https://paste.md-5.net/fafuzefega.md
mih.onCommand(mih.java:56)
are you running the command from console by chance
How can I terminate listener?
I running from client
if (secondsleft > 0) {
?
What is NPE
thats not line 56
(cooldown.get(uuid)
i feel like cooldown doesnt contain uuid
so you're getting a npe unwrapping double from Double
Where have you got this "VotedPlayers" variable?
private int cooldowntime = 120;
public ArrayList<String> VotedPlayers = new ArrayList<>();```
if there is no entry this will return null cooldown.get(uuid)
But i running it from client
.
Check if countdown is empty
getOrDefault(uuid, 0)
Is it possible?
unregister
How I can do that?
Thx guys getOrDefault worked
what sound is a good "failure" sound
i have player level up sound for success
oo ty
Is plugin#getCommand() work globally(Every command in the server) or Locally(Internal plugin commands)?
As its tied to JavaPlugin instance I would say "locally"
Usually global things are Server#something or Bukkit#something
Might be wrong tho
Also iirc getCommand just gets command from pluginyml
getCommand() is picking from yml
if you pick a command which is not specified, you will get NPE
hi morice
Thx
?
I found global one
e_0
what your secret?
I have done this and it seems to still despawn the entities
hmm
last i saw was free fava lessons
free java lessons == scam
!=
==
oooo
oh
fava lessons
favaπ
nonono
hey nuker ||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β|| _ _ _ _ _ _ @fluid river
teach me fava
some other day
how
maybe
eplain
f + java?
what does clean do in maven
magic
F# + java
yes
removing everything
huh
i mean if you do mvn clean package
wtfff
it seems to stay tho
how
hey nuker sorry about this ||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β|| _ _ _ _ _ _ @fluid river
wtff
its white ;-;
lmao
how the fuck are you doing this
itsvollx
nuker
only morice did it
look at this NukerFallCola ||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β|| _ _ _ _ _ _ @fluid river
noooo
or vollx ||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β||||β|| _ _ _ _ _ _ @round finch
no
how
can you say whatever still ping someone
why
i can do what i want when i ping people
heh
now do hoe
thats just a ghost ping nuker
yes and
and i can see your editing the message
ok and
and
why am i VERIFIED for you
Betterdc?
hahaha
is that some better discord shit
no comment
developer hecks
never used it
betterdc is against ToS btw
saw a message with
text text (edited) test
now only replace y by an i, and you can call me on my original name lmao
by the way
oh and also
good evening comrades
we are in #help-development π€£
yes we need that dev info here
.
this should be illegal
javascript hax
It just discord bug
dont tell them how
discord is on Chromium isn't it?
no fucking clue
and probably using JS
i thought it was electron
someday ago... I opened a Discord terminal or what
inside Discord itself
so is probably Chromium based
Yaa ya somehow possible
uhh also just a random question Nuker. Is your pfp unicorn from My Little Pony (I don't mean this as any insultment or anything, just ciurious)?
that's a fan art of rarity
it was .gif but i just used one of frames
when discord gave nitro for free i used gif
ah, I thouth it was Flutter Shy or who from My Little Pony
thats sad actually
they should allow us to keep our gifs until we change it π₯²
true
rarity from my little pony
purple is just my favourite color so well
i have a lot of purple stuff in my life
champion ranks, themes and stuff
I like purple as well
but I don't really have many stuff in purple, as of I am a guy, and in our country... being an LGBTQ person is not really allowed, and so, I don't want people think I am an LGBTQ person - and not including the fact how the law controls us, and if you are an LGBTQ person under the age of 18.... all I can say is "run for your life"
Altough then I misremembered the characters.
where do you live
I completely accept that, but I know that most people in my country do not really know many things about respecting other's opinions, so I better be hiding them. π€ͺ
lol
Hungary
if you use FileConfiguration#getString() and the path does exist but it has for example an integer instead of a string, will it return null?
...
?tryandsee
add a https:// to that
ty
it will probably convert the integer into a string, or your IDE will just tell you that "no no icc wrong mΓ frend"
i'm too lazy
the IDE wouldn't know
It embed
:D
bot probably lost its goodies
I simply type in the URL lol
Cause I can remember it
πΆοΈ
^ and on PC dark theme this is completely nothing lmao
goddamn
if i look hard enough
depends on monitor settings i guess
i can see it, otherwise i cant
you can just increase contrast
And vision problems π
Cause I have some...
#veryyey
and everybody say Russia is bad
Hohoooo if Hungary would be as big as how big Romania or Germany today is π
We would get more insults than usual π
I mean... We get jokes about being hungry... What's next actually? πΉ
Revert to 1991 backup
1919 π
@ every0ne why my code not work
whokn0ws
send it in and s0me0ne will help π€ͺ
package anya.szeret.teged;
import org.bukkit.plugin.JavaPlugin;
public class Loader extends JavaPlugin {
public void onEnable() {
// do yer code hearr', my fwend :3
}
}
but hearr', my fwend, start it over π€£
?paste
bumped my java lesson
jokes
btw I did a question in #help-server - I prooobably need an aswner due tomorrow in American time....
totally know java didn't steal it from
https://blog.devgenius.io/9-bad-java-snippets-to-make-you-laugh-82f5018e06e5
dafuq is this code
I can't even read it
D:
someone who has worse code i can steal?
#undeveloperment
but its fun π€£
is it useful to use the "clean" inv mvn clean package or can I just use package?
yea
i guess that depends more on where you work at
I just make plugins for my server lol
if it's just pc with dependencies from repo, you can just use package
u forgot a 0
Clean just deletes target/
why tho?
but for some devs who love to use local repos and work on some machines, it would probably be better to use clean package
that seems useless
no
cuz you know, you will have some stuff which is not needed anymore in your target folder
gradle == terrible
false
it's not me tho
find 2 on this picture
found
"Why" what exactly
why delete it
now find /
because maven can be buggy sometimes so gotta clean that shit
ez
what is this
where's waldo
oh there found