#help-development
1 messages ยท Page 525 of 1
Hey. For some reason the only thing that prints that I actually see is RETURNING. Not sure if this is because of threads or not but the server freezes when this method is executed
Possible to get player's info when player query motd?
no
Oh thats sad
why are you using a CachedRowSet?
and not a ResultSet
Because returning a ResultSet is bad
^
Yeah I dont really know much about the future stuff. Im just trying to run a SQL query async
oh well its probably stuck in the get then
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
Yeah thats where I narrowed it down too but I have no clue why. Literally was working flawlessly before I converted to async
nothing is running async
you run something async and you block it on the main thread, that just runs it sync
either work with a callback or return a future
Well I want to return a future but I dont understand it. I dont understand why the get is freezing and how to fix it
calling join or get on a future forces it to run, blocking the main thread
Because get forces it to block until complete
because your database call takes x hundred milliseconds where a server tick should only take 50 at max
You should be chaining something like thenAccept
its a very small call though. Im only doing this is because it might need to run the method many times in a small period of time
you have to return the future, then use whenComplete((result, ex) -> {code})
I prefer thenAccept
e.g.
CompletableFuture<ResultSet> queryDB(String query) {
return CompletableFuture.supply(() -> {
try (Connection conn = ...; PreparedStatement ps = conn.prepareStatement(query);
ResultSet rs = ps.executeQuery()) {
return rs;
} catch (something)
});
}```
smh
Can you even safely return a future with a resultset
should store a supplier imo or some kind of functional interface where parameters may be passed to ::fromEnum in theory
the resultset should be auto closed once outside the try with
well you generally shouldnt return a future with a resultset???
should have concrete methods for your db interactions, not just some generic ones that return an async resultset ๐ค
what are you making
I usually have a factory like class with a create method
In the BasicEuclideanComparator , do you really need the square root?
Because no matter if I compare 4 to 5 or 16 to 25, the outcome will be the same, won't it?
I think you can just compare the square sums without taking the root. Would save some performance.
what are you even making
I just copypasted wikipedia math, optimize as you wish
Why not. Also you are already having Class<> instance in enum, then you are calling getName on that class again, then getting instance with forName
It's redundant, just return Class<>
You're literally performing graphics operations in the CPU so I doubt saving those extra 2 clock cycles for a value that would be cached would be as big of a deal as just doing gpu magic
variable argument constructors ๐ฅฒ
Ah ok xD
I also think supplier would be better here
hmm yea maybe
In color science, color difference or color distance is the separation between two colors. This metric allows quantified examination of a notion that formerly could only be described with adjectives. Quantification of these properties is of great importance to those whose work is color-critical. Common definitions make use of the Euclidean dista...
play with the math
i heard square roots take a lot of performance, but maybe that was just back in the day
How I know when the player do a right click on a player?
at a low-level they do
if you can avoid it, just do that, but we arent living in 1990 anymore
but overall they're negligible compared to idk
PlayerInteractEntityEvent
all the chunk checks the server does every tick
Alr thx.
same types for every class type?
i don't see you are passing any data in your example
would a spigot 1.7 plugin be compatible with 1.8 automatically
Is there any other way to handle the executeQuery method being ran many times in a small period of time because I looked online and Im going to have to change a lot of code for this.
just don't make 1.7 plugin 
can u just help me instead of saying shit like this
no
ik this isn't 1.7 but https://howoldisminecraft189.today/
Minecraft 1.8.9 is 7 years, 5 months, 1 week old!
use a connectionpool like hikaricp, which has multiple connections opened at the same time to achieve a higher throughput
yeah and
1.7.10 is old
yeah im using hikaricp rn but implemented after I realized the lag would come but I havent been able to test if it would hold up
so? its a simple question i asked
So your saying hikaricp would manage it good?
try it and see
atleast better than a single connection
i dont mean like simple shit like if it was a fully built plugin should there be differences other than the 1.8 api just has more functions
Who plays 1.8.9 in 2023 โ ๏ธ
We can disable damages from some "blocks" like wither rose on entities?
you think good enough? I need it to be able to handle like 80 queries almost in the exact same second
You can check the source from EntityDamageEvent
you can tweak some settings, should look at their docs
unless you use NMS I can't think of any game breaking changes between the two
thanks
what db are you using though
didn't 1.8 introduce 2 hands
no
its 1.9 afaik
That's 1.9
ah
MySQL
I play MC with my foot.
fine
so it will work fine?
ye
alright thanks
For my example, what it can be ? https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/EntityDamageEvent.DamageCause.html I am speaking about the cause of the damages.
For a wither rose?
Yeah.
Wither I'd assume
Is there a way to distinguish these inventoryCloseEvents:
- a player closing their inventory (with for example escape)
- another inventory opening which closes the old one automatically
?
Alr.
Not to my knowledge.
You could keep track yourself with a hashmap of sorts
You'd have to already be keeping track of inventories they have opened.
but nothing built into the API
i think you can check when the inventory closes, see if its the players current inventory with an if statement, then do an else and that means it was automatically closed
Hmmm I do have an activeinventories hashmap which I can get the viewers per inventory of.
I'll look into that, ty :)
I believe the player's inventory is CRAFTING
we need both
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.
funky list
oh wait thats hot
it doesnt work
restart ur discord
wth
lol
restart discord
BOO
AH
yap, that was it
it doesnt work for me :c
please automod h1 asap ๐
alr
PLSEASE HELP MY PLUGIN NO WORK
ctrl + r?
best way to insult people
AA
ur serverlist hurts me
based
:c
LEARN KOTLIN
wheres ur folders at conclure
lmao
my first 110 servers are sorted into folders
the rest 50 arent
sort them
Yeah doesn't seem to work, sadge
effort
this is a sane server list
yeehaw
heeheeheeha
- here
- we
- go
<em>boo<em>
everyone basically. The largest servers out there run on 1.8
lol
how is it false
Oh damn it does? I might switch hmmm
I do have 3k lines in code tho so maybe that's a bit much
not true. Take a look at skyblock for example
Considering clients.
?nms
*some but not most.
Does paper plugin development also bring it's performance upgrade?
i dont know why all these guys hate 1.8 so much its just a version get over it
Small ones. Yes. Big ones. No. They are scared of making changes.
no it brings you the urge to commit suicide


async spigot
yes, yes, much 1.8 usage going on
source
inb4 "bstats isnt on every server"
u guys are talking to ghosts
funny
That statistic is completly invalid for your argument. It doesnt take in account the
Ah yes, cause we just pulled the numbers out of our ass.
u dont understand english
i guess
My dms with my friend is in every chat this is so weird
yes a lot. isnt all. 10 small pieces of cake is the same as 3 big.
how is minecraft playable for more then 5 minutes if its not pvp
hypixel has like 25k average, it used to be over 100k
insane thing called survival
people actually play that
yeah
because i dont have a server? Probally?
not everyone spends their entire life trying to click quicker
crazy world we live in full of robots and drones
Vanilla survival is boring asf imo but its popular gamemode rn
thats where plugins com ein
Hypixel is the exception though.
plus pre made maps
Oh okay is an elephant small or big. Tell me. Without a scale. Tell me. Its impossible without including other data
That is the basics of using data
properly
Ok, but comparing an elephant (your average server) to the size of a planet (hypixel) is just absurd.
You are supposed to compare reasonably.
i can also call my 1080 high end if i only compare it to gpus older then it self
cant wait for hypixel to inevitably stop releasing new stuff on 1.8 and slow move away for it
thats what they are working on right now. Skyblock is being updated during the next 3 months
I never said i licked the 1.8 trend
its just
a fact
anyone know why i get this issue?
[20:21:48 ERROR]: Error occurred while enabling RSCore v1.2.5 (Is it up to date?)
org.bukkit.plugin.IllegalPluginAccessException: Plugin attempted to register me.data.redstonepvpcore.listeners.Banker@5382f0d while not enabled
at org.bukkit.plugin.SimplePluginManager.registerEvents(SimplePluginManager.java:533) ~[server.jar:git-Carbon-"38757d2"]
at me.data.redstonepvpcore.RSPVPCore.loadEvents(RSPVPCore.java:73) ~[?:?]
at me.data.redstonepvpcore.RSPVPCore.onEnable(RSPVPCore.java:43) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:334) ~[server.jar:git-Carbon-"38757d2"]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:319) ~[server.jar:git-Carbon-"38757d2"]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:395) ~[server.jar:git-Carbon-"38757d2"]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:382) ~[server.jar:git-Carbon-"38757d2"]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:341) ~[server.jar:git-Carbon-"38757d2"]
at net.minecraft.server.v1_8_R3.MinecraftServer.s(MinecraftServer.java:368) ~[server.jar:git-Carbon-"38757d2"]
at net.minecraft.server.v1_8_R3.MinecraftServer.k(MinecraftServer.java:332) ~[server.jar:git-Carbon-"38757d2"]
at net.minecraft.server.v1_8_R3.MinecraftServer.a(MinecraftServer.java:286) ~[server.jar:git-Carbon-"38757d2"]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:302) ~[server.jar:git-Carbon-"38757d2"]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:527) ~[server.jar:git-Carbon-"38757d2"]
at java.lang.Thread.run(Thread.java:748) ~[?:1.8.0_312]
less people are joining 1.8 pvp and more are joining the 1.9pvp stuff and crystals and whatever, at some point everyone that plays 1.8 will move on and either leave minecraft or update
Wtf is Carbon?
spigot fork
yh at some point. a point that we didnt fully reach tho
sadly
i also enjoy coding for newer version wayyy more
but 99% of people i work for or with are working with 1.8
Oh good god, I just realized it's also 1.8
do u get it at startup, if so make sure you load the plugin after redstonepvpcore.
doesn't really make sense
See upper errors.
redstonepvpcore/rscore is the plugin erroring.
different work envriorment id say no clue how to spell envrioremnt
environment
environment
oh just realized RSCore is redstonepvpcore lol
Well, you can ignore them until they finally move away from spigot.
yeah sorry, just shortened the name
cant wait for paper hard forking
Truly one of the moments in minecraft history.
its getting closer now hanger is out
It seems like it is trying to register events even though the plugin is somehow not enabled yet. Idk how your code looks but u might wanna consider delaying event registration
to point the obvious
well it fixed my issue
with the player closing the inventory
so that is great :)
I am just getting dizzy by the 148 warnings and yellow lines. Is there a way I can disable those?
or would it also be an option to upgrade to their non-depricated paper versions?
You can either convert to paper methods, or just put a bunch of @SuppressWarnings("deprecation") everywhere.
Sure but then it won't run on spigot
I see, hmmm I mean it will only be used on my own purpur server
which is fork of paper
aka. spigot support is not needed as far as I know
ty for the info tho
?whereami
?fork
SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.
they dont have one ๐
red flag
?nms
this is fine
@EventHandler
public void onInteractEntity(PlayerInteractEntityEvent event) {
Player player = event.getPlayer();
FileConfiguration config = this.plugin.getConfig();
if (event.getRightClicked() instanceof Player target) {
ItemStack item = event.getPlayer().getItemInUse();
if (item != null && item.hasItemMeta()) {
ItemMeta meta = item.getItemMeta();
PersistentDataContainer container = meta.getPersistentDataContainer();
NamespacedKey key_cps = new NamespacedKey(this.plugin, "cps");
NamespacedKey key_playerinfo = new NamespacedKey(this.plugin, "info_plr");
if (item.getType() == Material.CLOCK && container.has(key_cps, PersistentDataType.DOUBLE)) {
cpsPlayer(this.plugin, player, config);
} else if (item.getType() == Material.PLAYER_HEAD && container.has(key_playerinfo, PersistentDataType.DOUBLE)) {
informationPlayer(this.plugin, player, config);
}
}
}
}
``` To check the current item that used the player, what I could use (the method) ?
?jd-s
If I am asking, I do not know.
player.getInv().getItemINMainHand()?
I'd use the #getItemInMainHand() method as #getItemInUse() apples to thinks like food and potions.
Alright thanks.
I was browsing the JD for you, just needed the link..
But just why I get twice ?
private void informationPlayer(Main plugin, Player player, FileConfiguration config) {
player.sendMessage("Yo");
}
private void cpsPlayer(Main plugin, Player player, FileConfiguration config) {
player.sendMessage("Bad boy ?");
}
?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
}
Oh nice thanks.
Hello ๐ I would like an advice.
I have two differents classes in my plugin with PlayerQuitEvent
The first one TP the players home when he leaves the server
The second one does something else, but need the player to be home
How can I do to make sure that the first event processing is finished before executing the second one ?
whatever you do the player will not be teleported before your second listener is called
server has to tick for the teleport to happen
Hiya, im using custom model data with a resource pack but one of my items isnt displaying the texture instead is just a empty item.
Is it possible to make a block appear as one material for one player and another for a different player using packets?
E.g obsidian appears as bedrock for certain players
Yes but it's not easy
How do you do it?
https://github.com/mfnalex/lunatic/blob/master/bukkit/src/main/java/com/jeff_media/lunatic/internal/ServerListPingEventFactory.java Imagine lmao. ServerListPingEvent got 4 different constructors between 1.18 and 1.19.4
does anyone have a simple, not overengineered r cumbersome way to just deal with a command executor that has a bunch of sub commands
ACF or just switch/case on the args
I use a map
whats acf
You need to handle the map chunk packet
how, can you show?
Have you by any chance done it before or could show me an example of how please?
Good luck finding one that's open source
How can i stop the server from sending map updates? (I'm making my own custom map item)
I can send an update with ClientboundMapItemDataPacket, but the server just sends another map update every 3rd tick of so, which just overwrites what i recently sent..
I've already tried removing the MapRenderer and adding my own with an empty render function, but that doesn't seem to help
This is all I do
MapView mapView = Bukkit.getMap(mapId);
mapView.setLocked(true);
mapView.getRenderers().clear();
How do I add a string list to this? https://hub.spigotmc.org/javadocs/spigot/org/bukkit/persistence/PersistentDataType.html
can anyone help?
Resetting Spigot-API to Bukkit...
error: No such remote: 'upstream'
HEAD is now at 01d18206 Add non-mutative getCrossProduct method to Vector.
Applying patches to Spigot-API...
fatal: Resolve operation not in progress, we are not resuming.
Applying: POM Changes
gpg: skipped "BuildTools devcodedred@gmail.com": No secret key
gpg: signing failed: No secret key
error: gpg failed to sign the data
fatal: failed to write commit object
Something did not apply cleanly to Spigot-API.
Please review above details and finish the apply then
save the changes with rebuildPatches.sh
Error compiling Spigot. Please check the wiki for FAQs.
If this does not resolve your issue then please pastebin the entire BuildTools.log.txt file when seeking support.
java.lang.RuntimeException: Error running command, return status !=0: [C:\Program Files\Git\usr\bin\bash.exe, applyPatches.sh]
at org.spigotmc.builder.Builder.runProcess0(Builder.java:1055)
at org.spigotmc.builder.Builder.runProcess(Builder.java:986)
at org.spigotmc.builder.Builder.main(Builder.java:731)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)
Im trying to build spigot 1.8.8 but it wont work for some reason
So you just don't add a Renderer at all, and instead of using the Bukkit MapCanvas of the map (which you get in the render function), you make your own byte[16384] buffer which you pass in the Packet?
mhm
alrighty, will try that
I want to add 3 filters to a hopper.world:193:64:-130: Player: 0b605717-d3a0-4cd4-8b67-3af1eb6449ca Location: World: world X: 193 Y: 64 Z: -130 Options: Suction: false BlockBreak: false AutoSell: falseSo there be a key of Filter with lists of Void, Whitelist and Blacklist. Like how EpicHoppers work
Wait, I just noticed that is for items and blocks, not config. I cannot think right now. Time to look at my code
A list of strings can already be used in a config
Ok, this is what I have in the correct file. From what you see here, how do I write a list to a config? I know I will need to add a method to this? https://paste.md-5.net/qipujatuze.java
config.set(path, list)
So I just add the list? Thanks
I was about to ask about that as well
My network[download] Got error: The read operation timed out. Retrying (2/10)...Cannot have plugins that uses the internet to verify from urls like Jeff's plugins
I should not be using this channel for this but I will say this, slow internet is like h***, I think some of you know what I mean
What did you do?
but you know the constructor signatures at compile time?
wondering about some kind of map which holds a game creator, which needs to be registered before
i remember 7smile once sent smth good here but thats years ago :(
ye that will suck when more parameters are introduced
(dunno if thats really scalable) but you could just have a functional interface which acts as a creator and accepts all possible param types and each game constructor only uses the ones it needs ๐
GameType.GAME_WHATEVER(id: 1, (gamedata, loc, smthElse) -> new WhateverGame(id))
kinda sucks but i cant think of better things at the moment
enum GameType {
BEDWARS((id, data, loc) -> new BedwarsGame(id, loc)),
SKYWARDS((id, data, loc) -> new SkywarsGame(data)),
X((id, data, loc) -> new X(id));
func<T extends Game(int, GameData, Loc)> func;
Game create(int id, GameData, Loc) {
return func(id, data, loc);
}
}```
was thinking about smth like this
why dont you just create those game classes first and then wonder about how to do the dispatching
okay question
How can i convert a MapCursor into a MapDecoration?
Edit:
Nevermind, I found how Bukkit does it.
For anyone that needs this in the future:
new MapDecoration(Type.byIcon(cursor.getRawType()), cursor.getX(), cursor.getY(), cursor.getDirection(), CraftChatMessage.fromStringOrNull(cursor.getCaption()))
what about you show some constructors
public void spawnNextStructure(DungeonStructure dungeonStructure) {
if (structureDeque.size() == 5) {
DungeonStructure structure = structureDeque.removeLast();
structure.remove();
}
structureDeque.addFirst(dungeonStructure);
dungeonStructure.generate(lastestStructure.getNextPasteLocation().toLocation(Bukkit.getWorld("world")));
lastestStructure = dungeonStructure;
}``` any suggestions?
whats lastest supposed to mean
also Bukkit.getWorld("world") probably means overworld, not sure if you can change the name but Bukkit.getWorlds().get(0) is also overworld, then nether and end and custom worlds etc
anyways does anyone knows what this bar on the right in vscode is called? kinda want it in jetbrains products
this thing exists but its kinda wack
as i said, im disapointed by myself
why do you really need an enum tho
how do you need to lookup the game
but how are you deciding the game type
user input?
and you dont have any surrounding scope to get those constructor params from?
only works with plugins here lol
Lambdas work great
no clue how many games you have but id start from a point where you receive an id and a GameData and some custom params
ClassName::new creates a Supplier<ClassName>
method handle
could accept any possible type and let the lambda decide but that goes brr
help me conclure lol
hai
I think the design is just sort of wrong to begin with
If you have to use reflection to solve your problem, something isn't designed correctly
bruh discord bugged lol
i restart it and suddenly it changes my volume to 80%
fuck my ears
That seems like the least convenient way to do it
Is there a way to tell when a player enters a structure like a shipwreck?
https://paste.md-5.net/yuxuxifodi.java
the message is sent but im not convinced the packet is, any ideas?
If that's a respawn, player.spigot().respawn()
perhaps there's some event for when a structure is created
and you could mark down its bounds
and then check if a player enter's those
idk if that's the case though
There is
so maybe you could do something like that @storm scaffold
Minimap
got it
also called uhhh Map Mode on VS
wish i could set the CodeLens display to the right side
like i can in intellij
faster than scrolling sometimes
something tells me i should measure how much those console.logs clutter up the apps start time
its already fucked up cuz electron but whatever
wait wha am i in help dev
I've been messing around with the
player.getInventory().addItem();
I cannot figure out how to use NBT tags for 1.8.9
*get
๐ I am unfortunately a perfectionists. I always get rid of them when I build the project for production
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/ItemFactory.html#createItemStack(java.lang.String) Maybe this helps
declaration: package: org.bukkit.inventory, interface: ItemFactory
Oh 1.8.9
yeah I know it complicates things
Pretty sure that using nms would be the only solution
what is nms?
Basically the original mojang server code that is hidden from the spigot api
Alternatively you could also execute the vanilla give command. That's way easier and doesn't require you to use nms
Biggest pain ever
When people don't say gnu/linux?
Pretty sure it's /, that's how it's written everywhere
It does
It's gnu software plus the Linux kernel
What NBT tags are we talking about
The give command drops you the item, and I plan on using it for a GUI. I've seen hypixel use NBT tags on just about any item.
Any vanilla NBT data should be available in the API
For custom data we have PDC, but not in 1.8
So you'll have to use NMS or something like NBTApi
Upon adding the filter GUI to my hopper plugin, I ran into a issue. I see why people are keep posting that new GUI thread
So I had to re-write the whole thing
Just the GUI at least
Can I target a block caught in an explosion and delete it or delete its drop?
Yes
Which event do I need to look at to do that?
BlockExplodeEvent and EntityExplodeEvent
In there there should be a collection or list that contains blocks in the explosion
You would go through that to find the one you are looking for
So I have been looking at those events, and I grabbed the blocklist from them. However, I don't know how to make the block drop nothing. I tried block.drops.clear, but that didn't work.
Remove the block from the list and manually set it to air
bastionBlock.getDrops().clear();
e.blockList().add(bastionBlock);```
Oh, that's a good idea. I will try it out rn
The drops you get from getDrops() is a copy. Modifying that won't do much at all
(just as a future note)
(Sadly)
That's a shame. No way to setDrops?
Once again beating me
You can change the drops just dont use the methods from the events to do it
drop naturally ?
You can change drops with the BlockDropItemsEvent
However Iโm not sure if that only fires when a player breaks the block or not
ChatGPT and the docs tell me it only fires when a player does it
At minimum there is itemspawn event
what is the point of this
why not just use pdc?
Because itโs older than pdc
I mean maybe it can provide some useful stuff
Since not all NBT is exposed in the api quite yet
While api exists, it doesnt mean better necessarily
So its nice if there is options to choose from sometimes
fair enough
Unaware of any missing un-exposed NBT values
I had a PR for that but I'm waiting for 1.20's ItemType/BlockType changes
Monster spawners and spawn eggs are difficult and up for constant debate
What's wrong with monster spawners and spawn eggs
Is it a matter of ItemMeta vs ItemType?
They basically require the concept of virtual entities
Just hard to get the NBT of an Entity onto an ItemMeta
You need an Entity, but you can't have an Entity unless it exists in the World
At least as far as Bukkit is concerned
you can't do can break and can destroy yet?
Nop
Not that it gets used much because itโs an adventure mode thing
honestly if I ever do need it might just be easier to call /give ๐
I might be using it soon ๐
we're making dungeon typa things for my server
instead of using some nbt library or nms
wdym
you can't access vanilla nbt with pdc's
and you can't reimplement block breaking and placing
because its adventure mode
so they wont have a mining animation
Just use survival mode
ugh
Instead of relying on the server to do something if those are set. You would create those values and do all the checks and changes yourself
Hence remaking
right but then I'd have to use survival mode
ill just wait
it's gonna be a 1.20 server anyways
we're just starting dev early
hopefully ๐ค the unenuming will happen at the beginning of 1.20
Glad to know choco also has evil plans PR plans
Is this a server you are running?
Then you dont have any problems just imaginary ones then
not that concerned about it anyways
You are free to change the server code as you see fit
You'll be fine
ewwww
then I have to like
make sure to merge upstream commits occasionally
could never do that
ill be patient
Only if you want or need the upstream changes
also losing support because im running on a modified server
and like
not worth
But you can just make patches of your changes so you can always reapply your changes when updating
spend a couple nights porting everything
this is what I'm doing right now
as I mentioned above
I'm actually kinda excited to port everything it'll be fun
messing with the new api
And you wouldnt necessarily lose support. Just you would require different kind of support
true
Anyways i have some work to do. Ironically not changing tires lol
No. I have to do wheel end services which involves the hubs
Nein
for (int i = 1; i<20;i++) { i-- //:) }
Oh boy look whose back
hehe

E
to make people cry
okay mr debugger
i wrote that in discord
atleast i put the semicolons in the for loop
plz react with the emojis
public Inventory inventory = Bukkit.createInventory(null, 45, ChatColor.YELLOW + "BetterInventoryManager V");
Hello how I can make that if it equals any string from arraylist?
ArrayList<String> RedAppleTree = new ArrayList<String>();
RedAppleTree.add("red_apple_tree_stage_1");
RedAppleTree.add("red_apple_tree_stage_2");
RedAppleTree.add("red_apple_tree_stage_3");
RedAppleTree.add("red_apple_tree_stage_4");
RedAppleTree.add("red_apple_tree_stage_5");
RedAppleTree.add("red_apple_tree_stage_6");
RedAppleTree.add("red_apple_tree_stage_7");
if (!furnitureMechanic.getItemID().equals("red_apple_tree_stage_1")) return;
list.contains
like that? Then it asking me for an object
if (!furnitureMechanic.getItemID().contains(RedAppleTree.contains())) return;
you are checking if it contains something, so if (RedAppleTree.contains(furnitureMechanic.getItemID())
and follow naming conventions
?conventions
ohh okay thank you
EPIC SEARCH INDEX
https://www.spigotmc.org/wiki/crash-course-to-java-part-1/
https://www.spigotmc.org/wiki/crash-course-to-java-part-2/
https://www.spigotmc.org/wiki/crash-course-to-java-part-3/
https://www.spigotmc.org/wiki/crash-course-to-java-part-4/
https://www.spigotmc.org/wiki/crash-course-to-java-part-5/
(If i pinged you with this message read them starting at the top, will help you getting started)
I write complete code in discord from my phone all the time while at work 
mans copying my search index
true
I added the imports into my code it seemed fine with my IDE.
import de.tr7zw.nbtapi.NBTCompound;
import de.tr7zw.nbtapi.NBTItem;
However, trying to compile my code I get a "package de.tr7zw.nbtapi does not exist". I even after I downloaded the jar and placed it into my spigot plugins folder. I also file -> project structure -> Modules -> dependencies -> there's a + symbol -> I added the jar file into the list. I also added "depend: [NBTAPI]" on my plugin.yml
hello, i asked this question a few days ago but was suggested a very old plugin that does not work anymore. I am trying to make a plugin that spawns an npc on a creative plot, when the npc is clicked it will open the creative menu and players will be able to take what they wish from the menu. I am having extreme difficulty finding a way to open the creative menu when the npc is clicked. if anyone has any ideas or a solution it would be much appreciated
There is no way of opening that inventory I'm afraid
*afraid
pretty sure there's no way to force-open that gui
unless you make a custom gui but then you won't have any scrolling
Since its a lib that does nothing on its own and isnt a plugin. You need to shade it into yours
French expressions are so weird
wdym shade it into mine?
RIP, thanks for your answers
It means include all the Lib's classes into your plugin
its a lib or a plugin
or use the libraries feature in plugin.yml
they have both
hmm
I wonder what a .jar would look like if we like
rendered all the bytes as an image
and added some padding
imillusion is about to make the Matrix
6am thoughts
it'd be quite goofy tho
because at the end of the day it's all a bunch of bytes
so like what if we read bytes 3 by 3 and made an image out of it
and just render it as a square or something
let me mock up a project real quick
probably noise
I wonder if you could see a pattern
earlier today I tried making a lib folder and move the jar into it but it would pop up a screen and said something long the times refactoring and it would let me push the buttom
here's the output
well I tried adding .zip file for the lib and end up with a Empty Library
This is used for antimalware stuff as a way to create a signature
Or fingerprint
But it does sometimes create some interesting images
and like 30 lines of code later it just looks... yellow
I wonder what happens if I have an image embedded in it
Obviously have to be into abstract stuff though cause it isnt going to like create no fancy art lmao
watch me write cursed java code to paint the mona lisa
would be hard to get the correct size
well
So java is yellow we learned
But yeah, rendering the bytes of compiled stuff as an image is a good way to create a fingerprint because it is extremely difficult to change something in it and still retain the exact same bytes
And instead of checking all the bits you would just see if it renders the same image and could check it against another one that is known to be good
but that's literally as efficient as just storing the original file
followthis https://github.com/tr7zw/Item-NBT-API/wiki/Using-Maven#option-2-shading-the-nbt-api-into-your-plugin
Not really. In terms of bits per pixel isnt going to be a 1:1 ratio
unless you're omitting stuff it kinda is?
Its more like 8:1
my 1ish mb jar created a 640x640 image
that's about 400k pixels, multiply by 3 bytes per color and it's around 1ish mb
Its not 3 bytes per color
r(255) g(255) b(255)
What does the image look like ?
And you are right for rgb its 3bytes
4 if you add a couple more options
4 if you add transparency and all
here's what an mp4 looks like
those lines are weird
forbidden sawdust
Woo, what a nice image and its one of a kind too
How do you choose the dimensions?
Do you fill it line by line or column by column
line by line
Got pretty lucky on this one I guess with all the lines
Just the right size
forbidden speed
just messing around
excel file.. interesting
wait the dimensions aren't square
i'm an idiot
those are the minimum dimensions of my jframe
When I add
<dependency>
<groupId>de.tr7zw</groupId>
<artifactId>item-nbt-api-plugin</artifactId>
<version>2.11.2</version>
<scope>provided</scope>
</dependency>
It's properly indented. I get "Dependency 'de.tr7zw:item-nbt-api-Plugin2.11.2' not found :39". I made sure it was Within <dependencies> and under the spigotmc <dependency>
NVM
I reload it
smort
The odds of something generating the same image is like almost impossible
well this image is literally just a representation of the binary data so
it's not an odds thing
it's just an image hash
type thing
it's all fun and games until you bring jpeg compression in
then things can change
but until then this is just a copy of the file but rendered as an image
Yes but since we are not changing the data and only displaying it in another format. It isnt something you can easily fool. Unlike in programming where you can manage to fit the bits in the right place when you change something but still executes or trying to fool a hash which does change the data.
This makes it extremely harder and the check for comparing images is typically faster then comparing the bits individually
hm
what if you had an obfuscator that could like
tweak the image in a lossless format
and then you'd like
embed that obfuscated image in your jar
which would be a representation of the code within it
and then... obfuscate your code and compare against the image
that sounds like an overengineered hash
I could think of a use in qr codes but cameras aren't that accurate
Holy shit you just accidentally.made a ghost client detector if you usea data analysis tool with it
Q
it literally just represents the bytes as an image instead of as a binary blob
the image is the same size as the original file so
you can analyze memory with tools like process hacker as well
find strings and shit
You need to remember any tool needs to be user a friendly.
An image looks nicer for an end user haha
probably causes a performace overhead, time to do some tests
Does anyone know how to move a piece of code that (uses bookAPI not sure if this matters) to a universal config.yml or something similar to make it easily editible to the average server owner?
will provide code that i want to move if needed.
saveDefaultConfig(); ?
or ConfigurationFile i think its called
I think json is better for configuring.
json is terrible for configuration
a normal person can actually write yml files unlike json which takes ages and is annoying to type
json is not made so that humans can write in it
json is fine for some stuff
Just to read and edit yeah
What is the simplest way to have separately loaded worlds with their own datapacks, scoreboards, chat, etc. be isolated from the other worlds on the same server? So to essentially have the worlds be as if they are on a separate server without that actually being the case?
Just run another server
The overhead and time required to split everything isn't going to be worth it
Bungee and multiple servers
Yeah I figured that when starting to get some of the mentioned things working but was hoping that I maybe just miss an easy solution
Alright I guess Iโll have to look into bungee as I have no experience with that. Thanks for pointing me in the right direction
?bungee
odd not linked
Be sure to follow ALL the instructions, even the section at the end marked Post-Installation https://www.spigotmc.org/wiki/bungeecord-installation/
will do, thank you!
Most plugins are global and not encapsulated.
yeah each plugin needs to handle that themselves usually
does any1 know how to get spigot + nms for 1.8.8 i get error if i try to do it via buildtools
Well what's the error
Resetting Spigot-API to Bukkit...
error: No such remote: 'upstream'
HEAD is now at 01d18206 Add non-mutative getCrossProduct method to Vector.
Applying patches to Spigot-API...
fatal: Resolve operation not in progress, we are not resuming.
Applying: POM Changes
gpg: skipped "BuildTools devcodedred@gmail.com": No secret key
gpg: signing failed: No secret key
error: gpg failed to sign the data
fatal: failed to write commit object
Something did not apply cleanly to Spigot-API.
Please review above details and finish the apply then
save the changes with rebuildPatches.sh
Error compiling Spigot. Please check the wiki for FAQs.
If this does not resolve your issue then please pastebin the entire BuildTools.log.txt file when seeking support.
java.lang.RuntimeException: Error running command, return status !=0: [C:\Program Files\Git\usr\bin\bash.exe, applyPatches.sh]
at org.spigotmc.builder.Builder.runProcess0(Builder.java:1055)
at org.spigotmc.builder.Builder.runProcess(Builder.java:986)
at org.spigotmc.builder.Builder.main(Builder.java:731)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)
this
Please check the wiki for FAQs.
If this does not resolve your issue then please pastebin the entire BuildTools.log.txt file when seeking support.
^^ This is for modern versions
right i was just getting the buildtools command to get a log
?bt
what command line are you using?
java -jar BuildTools.jar --rev 1.8.8
java.lang.RuntimeException: Error running command, return status !=0: [C:\Program Files\Git\usr\bin\bash.exe, applyPatches.sh]
Hey that might be stupid question butt, thoes snowball is a living entity?
No
get the location
it does not have any eye location
forge think otherwise
ya ok i will try to figure something out
Unlike a player or a living entity the eye location (head) isn't separate from the body
Snowball is a CommandSender??? Wtf xD
all entities are
Vanilla allows you to execute commands as any entity
btw what program is that?
Intellij
IJ builtin
Ahhh
That might be an ultimate thing
ye
thx
Whatโs the diagram for player look like
private final Set<Duels> currentDuels = new HashSet<>();
}
public class Duels {
Bukkit.getPluginManager().registerEvents(signEvent, this);```
I will add more code to sign events and i only showns a bit of the Duels class.
Do I need to extend duels for it to be able to create events? or listener, can I just invoke it
I wonder what Auduience interface does
it's for Adventure
^
what
Audience is basically message receivers or sth
In spigot?
as said, first diagram was paper, second one is spigot
So, I will have events in both signevents and duels, duels is invoked from signevents
any class that has event handlers needs to implement Listener (marker interface)
I have it working in spigot somehow
Don't ask
nvm
if you are calling them explicitly, dont need it
but not 1.19 right?
Oh ok
@EventHandler methods will be invoked from spigots side
Iirc yes but I'd have to recheck my projects when I get home
I use mock bukkit and their all at 1.19.2
IIRC everything below 2.X.X works on spigot but the latest (or at least 2.145.0+) need paper-api at least on test scope
yeah because of chat preview or chat reporting or sth like that
it had to do sth with that
Hmm might be on older version
Why does paper do sum with chat reports er whatever
I'm assuming they have some patch to make them work
i dont think they do
I only remember I once had some issues with mockbukkit when they told me to use 1.19.2 because they haven't updated to 1.19.3 because of "<some issue I forgot>"
?paste
here's what happens if you don't add paper to test scope ๐ฅฒ https://paste.md-5.net/piyomaquwo.sql
here's what happens if you use paper-api but 1.19.3 (too new for mockbukkit): https://paste.md-5.net/arovabulun.sql
and yeah that's why I have to use paper-api 1.19.2, but only on <scope>test
one can continue to use spigot-api for the actual classes
To check if a player has an anti kb, I saw some servers were checking velocity but why?
?paste just finding the paste
Setvelociy to 0,0,0 in damage event
Wait
You can tp forward
https://paste.md-5.net/ihawupatol.java
So, I want to create a duel system, how do I create the duel class with the Start function invoked and all the varibles set, awaiting the next player to click a sign, then start the event, and how would I reset the event?
And how I get the velocity of the player?
player#getVelocity
And for example, the normal velocity should be at what?
Depends on how the player is moving
can you change someone's skin without protocol lib? i tried the docs but i cant seem to find anything
With gradle you need to have mock bumkit above spigot
Then it works idk abt maven
^ just so this does not get drowned, btw, its a fighting event im trying to make, triggered by clicking seprate signs, I would like the option to be able to add more players if i wanted
0.1
technically its 0.10000000149011612
but, 0.1 should be fine
Yes. You'd change the player info packet
So if I create a command, get a velocity of a target if it's higher > 0.1, that he has an anti kb?
no
you asked what is normal velocity
I gave you what that is, and that is if they are walking
doesn't that change the player's name too
Ah.
So when they are running ?
running is 30% faster
also these numbers assume no status effects as well
or anything else acting upon the player
Not if you only modify the skin
?
If you don't know how velocity works you probably shouldn't make an anticheat (which I assume you're trying to do)
now to answer your question in regards to anti-knockback
and why velocity is checked
if they are supposed to get knocked back, then that means they should have a velocity going away from the attacker
Not an anti cheat.
if that velocity is 0 or near 0 then that means they have anti-knockback
then what are you trying to do?
Commands.
I have no idea either, but as you stated it seems they don't know how velocity works or what it even means lol
^
oh that code is a mess
Bro I only shared a snippit
like 3 lines that are unrelated
and? The code is still a mess
Well, ignore the sign place event
ok
anyways, I was told I need to create class's as apart of a hashSet to have my varibles reset properly
I assume you're going to have one sign listener per duel then
I dont really know how to do that.
also, the playerInteract event is the thing that trigger the duel
it should run the function, set the first player, and await a second player, or any number of players i waant
Umm, only one duel can happen at a time
so yeah
Seems like bad future proofing but sure I guess if you only want one duel per server ๐คทโโ๏ธ
um, why we extending signevents?
and why are you implementing listener when these appears to be you want to be extending events instead
huh? which one
Duels
i impliment the listener so i can register the events
Duels plugin moment
in the first place
I get this but it appears you want custom events
the SignEvents
when creating a custom event class, you don't implement the listener there
No, sorry i didnt mean that
I meant
that events will kickstart the duel
the duel will remain till either player dies, then a new hash set is made, I think thats how it works
ok....that doesn't appear to change what I have said still
Why do you use a set to store a single value?
there is just all kinds of wrong going on here
Yeah I'll just skip this one... too tired to try and decipher this
because i was told to here
lol
I had a issue with the varibles resetting
and the people here
its so confusing
people here tell me one thing
then another batch of people wonder tf im doing
Yeah your code is confusing
^
what is in my code thats confusing
well, part of this could be due to lack of understanding in appropriate organization as well as object programming
on whos part? im just listening to the people here
yours
lmao, so dont take the advice here ?
ok, i will assume it was faulty advice originally
and ill listen to what you suggest
i know ill need a hashmap or smthin along the lines
have to realize that everyone here is just voluntarily providing help. It is a community
the general approach is correct
why would you need a hashmap for 2 objects?
Edgar said that you would have the class registered with a hashmap or set
He probably assumed you wanted more than one duel
oh, one of the classes to hold the duel objects right yeah
Well I wanted to reset everything after a duel occured
i been having issues with that
the varibles
seems that one player is always null, while the other is always full
after the first event
the first event works fine
then whenever you click a sign
ok what variables?
it assumes your player 2
player1 and 2
you do realize that variables in an object go away when said object goes away
wdym?
a class, is an object
Is there a way to make shulkers not interactable? Like making an armor stand a marker.
I'm using them to make a chest glow, but because of the shulker, I cannot open the chest
why would a class go away?
yeah, i dont get what your saying
Because you don't understand object oriented programming yet
"go away"
I am not talking about anything advanced
is there another term?
like, when spigot registers events, are new instances of the class created at diffrent moments
is that what your talking about?
you can have more then one object of a class. A class doesn't just exist only just 1 at a time
right, so, currently the same class is remaining, which is a issue, i want everthing to reset
lets not worry about the events class, you need to separate this logic out from there because that isn't the place for it.
no idea
the event class should only be used to initiate the start of or the creation of your object invoking it through your manager class
m8 idk something to make it easier for a normie
right, so my issue lies with the thing im trying to do, and the fact im doing it ewith events
well, its just not organized properly is all
you should have a manager class which will hold the hashmap of all the duels
then you will have a class that is the duels. It should take in as parameters 2 player objects as you are wanting
the manager currently is signevents and the duel class is duels
then in your event class, it should create those duel objects as well as possibly having an event initiate the destruction of said objects
I have to adjust it to fit my code lol\
Would it be acceptable to like, the first player clicks a sign, it creates a duel object with the first player already loaded
then
when the second player clicks
it loads the second player and starts it
The purpose of the manager class here is just to hold the collection really and maybe have some convenience methods in relation to said collection
your duel class should take in 2 player objects
I recreated that scrture with my code, I need to add in the rest tho, like the events, your code was a broad outline. I need help here to construct the fundamentals
Right well, the two players wont come in at once
two seprate events will occu
so, to make this possible you need to have a list in the manager class that gets set when a player clicks a sign then
your event should check this to ensure the player isn't already in there, if not add them
Shoukd I use a hashset or map
hashmap
yeahm hashmaos have keys
since order is not really needed here you don't need a set
Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "/playergui " + p.getName()); dont found
I do not believe so
If you are using 1.19.4 you could try to use DisplayEntities
but hopefully as I am telling you this though, it is clicking how the classes are organized and work together
but still keeping logic contained so it doesn't interfere with each other
you should end up with a class where the variables you are wanting so called reset, is a non-issue because they go away as soon as the object is not needed no more
Do you know how I could make displayentities invisible?
IE the duel ended, so a duel object is gone
private final HashMap<UUID, Duels> currentDuels = new HashMap<UUID, Duels>();
is this a good start?
why UUID?
What shoudl I have?
i was thinking about putting the players uuid there
I suppose uuid works
for now
hard part is unique id's
can't have more then 1 of a key
whats the method called
unless you mean just make a UUID for the duels
the pitfall of this is that at some point you need to wrap around
well, you are constantly incrementing
that works until you hit the limit
no they shouldn't
if you have to restart your mc server everyday then you have issues that need to be addressed
I ran MC servers without restarts for months at a time
well it does hurt sometimes because you lose whatever optimizations the JVM and OS have done for the program while it was running and now needs to restart that process
yeah because you have something going on that shouldn't be
either a badly coded plugin or something else
wait, should I have a UUID array or smthin? like, how would it know, that when two players are added
it is to start
because your duels class should have the 2 players already
can't add a duel object if it doesn't have what is required to create the object in the first place
this is why I said the duels object should have 2 player objects as parameters
So it waits for two players to get loaded in the system
then starts
and maybe a safety check to ensure that both objects are not the same player to prevent some weird bugs accidentally ๐
ill do that soon
