#help-development
1 messages · Page 539 of 1
The code works. The unicodes are set ingame.
It just doesnt color the username on tab
Even when I try with just some simple text, it doesnt color it either. It colors the prefix but when I end it with another color code it doesnt colors the players username
The player name is probably treated differently then. You'll probably have to look for a method that changes the player name.
declaration: package: org.bukkit.entity, interface: Player
IIRC, that only changes the name on the tablist.
I think that is the goal
Hmm. Imma give it a try
Since when is that function a thing though?
At least 2014
You might want to try Team#setDisplayName()
Oof. I never even saw that function
yeah that was actually it
Thanks 👍
hey can anyone help me with PlotMe plugin?
its a small issue but i cant seem to figure it out
Hello. I am currently developing a small plugin that adds passports. And I'm worried about the caching. I want the passports to be available at any time, not only when the player is on the server. I use LoadingCache to do this. But I'm more worried about the other thing: should I keep CompletableFuture<Optional<Passport>> in the cache, or should I keep a simple Optional<Passport> there instead?
private LoadingCache<String, CompletableFuture<Optional<Passport>>> cache = CacheBuilder.newBuilder()
.expireAfterWrite(15, TimeUnit.SECONDS)
.build(CacheLoader.from(this::getPassportFromDatabase));
public PassportManager(DataSource dataSource) {
super(dataSource);
// create table
}
public CompletableFuture<Optional<Passport>> getCached(String playerName) {
try {
return cache.get(playerName);
} catch (ExecutionException e) {
throw new RuntimeException(e);
}
}
public CompletableFuture<UpdateResult> save(@NonNull Passport passport) {
return builder().query("INSERT QUERY")
.parameter(stmt -> /* set values */)
.update()
.send()
.thenApplyAsync(updateResult -> {
/* update cache */
return updateResult;
});
}
private CompletableFuture<Optional<Passport>> getPassportFromDatabase(String playerName) {
return builder(Passport.class)
.query("SELECT QUERY")
.parameter(stmt -> stmt.setString(playerName.toLowerCase()))
.readRow(row -> /* create passport object */)
.first();
}
}```
Wrong channel
You don't need to keep an optional in the cache. It's either in the cache or it's not
use a nullable password
and why an expiring cache
15 secs is kinda trash
ah wait its a cache with futures, nah man
Hello! im looking for a person who would like to build a survival server with me, I already have the server running, and need someone who can configure the plugins, and make it special, and different from others, everything will be 50% 50% shared, and im paying for the plugins and the host, please someone serious, who can work and wont be childish and leave the project, its important, thanks and sorry for the spam.
?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/
99% of 14yo guys would do it for free
does it have one?
java.lang.NullPointerException: Cannot invoke "Pants.shit()" because "gutConents" is null
idk i use mm
whats mm..
mythicmobs
ohh
in my opinion best mob creation plugin
can you send me a good video with it?
i use aternos i hope its on ther
ill maybe switch
can you customize drops?
like boss drops
for mm guide ?
i can't im not configuration plugin files
ye
so no customizable drops?
cus i use it for bosses
that spawn and when die drop a token
common to legendary
thats why i want chances
like 5% leg
30% common
yk
u can set custom drops in mm with custom displayname, custom lore ,custom enchant, custom attribute
with editing configuration
cus i got the items ready
yes
SOMEONE HELP ME ? CAN I SWING PLAYER HAND FOR PLAYER HAND ?
player.swingMainHand();```
i use this but this event using e.getItem method
please surround code in ```
omg
soz
LivingEntity#swingOffHand()
How what?
like this
java should be replaced with yaml ^^
I thought they were sending java snippets sorry
didn't saw what they are trying to send
Well they should move to #help-server
so you're not wrong to assume they were sending Java code
yeah probs
People are deploying Minestom on kubernetes
idk if minecraft servers should run as docker images
help me at ''help-server'' maybe
It's fine if it's small minigame servers and such
Which Minestom is perfect for
Minestom is probably stripped down like PocketMine and Nukkit right?
PocketMine and Nukkit are for Bedrock though
(those are for bedrock) and from what I heard they both don't really have vanilla survival features
They have more features than Minestom ships with
Minestom comes with a great API for implementing what you want and need on your own
Yeah for minigames that's perfectly fine
It's more like a bare bones API than an actual server implementation
as long as you don't need too many survival features
Yeah
is there an easy way to add ''drop percentages'' to your code
like i got a boss mob
and it drops 5 items
common to legendary
but idk how to change the drop percentage
but its from a plugin called ''bosslands'' which doesnt have any guides
idk how to make an spigot discussion
nope
lol
ah
already did
lmao
You don't need the extends Object
I have a BlockDisplay moving smoothly
im using Shulker to make it walkable
but in some scenarios the one shulker is out of bounds for the BlockDisplay -> creating a uncovered place where player can fall through down
im trying to make something, that lists me with all the required positions, that will be used to hold the player on set BlockDisplay
alternatively one radius from the BlockDisplay, yet only if e.g.: x isn't whole number -> add support shulker there
if it is whole number -> don't add support shulker there
my current attempt [results in all shulkers being stacked in one]:
https://paste.md-5.net/hiqapuceda.cs
Isn't it also an issue if you walk against it with your head?
I did something like that with custom fallingblocks but yeah... I kept getting pushed into the crawling-position
well yee
potentional thing to handle, but I have a potentional solution for that
did you manage to do so?
No
I froze the project because of this issue
Did that like over half a year ago
oh okay :D
imma try to work on it (ehm with GPT help)
Lol
Well, the main problem is the collision
I did a lot of hacky stuff to get the fallingblocks stuff working, which ended up senseless because of displayentities
This included using reflection to change hardcoded stuff with entities
makes sense
Fallingblocks worked out, shulkers stuck tho
I thought of that ceiling problem like so:
- get the material on the location
- spawn the shulker there
- set back the material
this makes the shulker invisible
therefore you have the collision block inside the moving block
problem is with block that have smaller height
Wait what? Were speaking of the crawling issue right
oh
I haven't experienced that problem yet :D
You walk against the shulker with your head, you get put in crawling, no matter what you do
Good luck, please tell me if something works out
I broke my head down a lot for that
Yeah lets see
The only reason I keep Optional in the cache is because I want to check if the passport even exists in the database or not. I can't store null values in the LoadingCache. And I can't store null values in the LoadingCache, so I have to send a query to the database all the time
It's just for tests
ah I see that makes sense
For some reason when I click one of the wools in the inventory, all 4 of the messages are sent to the player
I just want the message that correlates to the wool to be sent to the player
no breaks
how do I delay it by a tick?
?scheduling
Use a scheduler
Why the delay though?
on god
This event is called when a player clicks in an inventory.
Because InventoryClickEvent occurs within a modification of the Inventory, not all Inventory related methods are safe to use.
The following should never be invoked by an EventHandler for InventoryClickEvent using the HumanEntity or InventoryView associated with this event:
HumanEntity.closeInventory()
HumanEntity.openInventory(Inventory)
HumanEntity.openWorkbench(Location, boolean)
HumanEntity.openEnchanting(Location, boolean)
InventoryView.close()
To invoke one of these methods, schedule a task using BukkitScheduler.runTask(Plugin, Runnable), which will run the task on the next tick. Also be aware that this is not an exhaustive list, and other methods could potentially create issues as well.
^^ Taken from Javadoc
oh I did not know. Never ran into issues
bump
You need to give us more info than that
also follow naming conventions
?conventions
What do I put where it says plugin
An instance of your "Main" class (whichever class extends JavaPlugin)
This is what I'm doing to register the smithing recipe but its not registering and sends no error in the servers console
NamespacedKey t1KeyTirFrostDay = new NamespacedKey(this, "first-tirfrost-day");
NamespacedKey t2KeyTirFrostDay = new NamespacedKey(this, "second-tirfrost-day");
NamespacedKey t3KeyTirFrostDay = new NamespacedKey(this, "third-tirfrost-day");
RecipeChoice tirFrost0Day = new RecipeChoice.ExactChoice(TirFrostItem(0, 1));
RecipeChoice tirFrost1Day = new RecipeChoice.ExactChoice(TirFrostItem(1, 1));
RecipeChoice tirFrost2Day = new RecipeChoice.ExactChoice(TirFrostItem(2, 1));
Recipe upgradeT0T1TirFrostDay = new SmithingRecipe(t1KeyTirFrostDay, new ItemStack(TirFrostItem(1, 1)), tirFrost0Day, T1Upgrade);
Recipe upgradeT1T2TirFrostDay = new SmithingRecipe(t2KeyTirFrostDay, new ItemStack(TirFrostItem(2, 1)), tirFrost1Day, T2Upgrade);
Recipe upgradeT2T3TirFrostDay = new SmithingRecipe(t3KeyTirFrostDay, new ItemStack(TirFrostItem(3, 1)), tirFrost2Day, T3Upgrade);
getServer().addRecipe(upgradeT0T1TirFrostDay);
getServer().addRecipe(upgradeT1T2TirFrostDay);
getServer().addRecipe(upgradeT2T3TirFrostDay);
this is the code for the "TirFrostItem" variable: https://paste.md-5.net/umenosutez.cs
Yeah, I'm changing everything to that
would anyone help me with one particular thing
so basically
i have a game loop
it calls two methods render() and update()
I'm not sure how well the recipe system works with meta data
right now the game loop speed is not being limited
but it burns the cpu usage really much
other recipes seem to work fine
is there any way to limit the cpu usage to the game
its only those that dont
consistently
sleep between updates
are we talking about a game or about a game plugin?
thread.sleep isnt consistent
wdym by not consistent?
it sleeps for the amount of time you provide
but it doesnt guarantee it that it would sleep for that much time
it could sleep for much longer
Yeah but usually not by much
thus update times could be inconsistent
Minecraft uses sleep just fine
LockSupport.parkMillis?
usually thread.sleep doesnt support low amounts of millisecond ranges
hmm
you see i have this console application that im currently working on c++
and i use console as a renderer
and it really works
it could go up to 900fps
are you using opengl?
well, whenever I use std::current_thread::sleep_for(targetFrameTime-deltaTime) i get max up to 60 fps
due to windows timer resolution of 15 ms
and I wonder how other game engines implement this kind of capping behaviour
you could just sleep every few ticks instead of every tick
do you mean combining delays with sleeps
like do an if statement and skip first sleep if the tick is even or odd or smth
?
yup or a counter
that like makes a few ticks one tick 🤔
?paste
that's an interesting idea, it could help by a bit i think
im so glad i have a SetTargetFps
lemme try to implement this
?
i heard that even SFML has inconsistent frame limiter
I added a BukkitScheduler to player.closeInventory(), but now when I click the items in the inventory, nothing happens. https://paste.md-5.net/moronehada.java
i spent this whole damn day asking AI and searching google how to fix this
to no avail
i never realised how fucked up computers are at timing things
Why you are creating many Main instances?
.runTask(new Main(), player::closeInventory);
ouch
TCC told me to do that
that will error and do nothign but break your code
you only have one instance of your main. The one Spigot creates
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
?main
And instead of runTask you maybe need a runTaskLater
I mean you could do precise timings by having a while loop and using System.nanoTime() that will lead to super high cpu usage though. For any computer -> user interaction I would just use sleep
that is what i currently do
but thats seems wasteful
it is
i mean switching sleep and delays seems to help
it dropped the cpu usage to 8%
but my frames now are inconsistent due to weird fuckery of sleep
whenever i set targetfps to 60
it makes my fps go to 33 fps
but whenever i increase to 63
oh elgarl, this is some fun keyboard
I can;t remember the last time I looked at the keycaps 🙂
i switched from mechnical to membrane
just because my relatives cant bother with them
anymore
I once saw a very nsfw keyboard - can't post that here though
any ideas why that's the case
1000/60fps = 16.66ms 1000/63fps = 15.87ms
16.66ms-frameDelta causes to have 33 fps on average
whenever 15.87ms-frameDelta somehow boosts fps up to 63 fps on average
lmao
with sleep
It was full of hentai faces during ... fun💀
you will find it if you search for it on google though
bump
the horizontal enter keys are the american ones, all us keyboards have 1 line enter, but most uk ones have a double line
Why have your own thread when you want to sync it?
Or does your thread produce some output that you want to sync at the end?
makes sense
In that case just make a scheduler for next tick
eh ok
what happens if you just do a normal sleep?
I mean you said it's problematic but how problematic?
i do a normal sleep
thats legit website
imagine having an antivirus 💀
its just that its anonymized
without any workarounds. Just a 1000/60 ms sleep
i've switched them over to crafting recipes, but how do I make it so the meta data has to be equal for it to give the output?
i did std::chrono::sleep_for(std::chrono::milliseconds(1000/16))
why 16?
because it consistently sleeps for 16ms
You can listen to the prepare craft event and check the meta data
even if work have been completed
Use RecipeChoice.ExactChoice
earlier in the loop
i am
im using shapeless, will it work if i use shaped?
meh
1000/60
i have no idea what causes this
it seems the lower the ms the better it runs
but its should be opposite
63 fps cap runs faster than 60 fps
no matter what 😄
try /120. Does that somehow double it? 😄
now its 64 fps
but that's reasonable
since timer resolution had hit maximum
probably
8.33 ms is low enough for a sleep
well if that works your fps setting just has to do 1000/fps*2
Idk how far this will work
but i have no guarantees if that would work on other machines you know
1000/400 probably won't give you 200 fps
infinite fps hack
You have your counter so you can adjust the value until you reach the amount required (if possible)

It will sleep for 8ms and not 8.3, so that probably yields the 64 fps instead of 60.
yup
what if you sleep with 1ms?
If you really want to get it to 60 fps, then I think you need to count how long one frame actually needs and then sleep for however much time it has still left.
or you just pretend that 64=60. Some games run way to stable on 60. They probably do the same
tha'ts what i do
i get the delta time of render time
Whats the best minecraft version to make plugins on (with backwards compatibility)?
Makes no sense if you have a constant for the sleep time then
then i do sleeping
that's just for testing
sleeptime was not constant
i did frame delta subtractions
it works for 64 frame cap but not for 60
frame count literally doubled with 64 cap enabled
because of integer truncation
that's with frame delta subtractions
sleep 8ms for two frames, then 9ms for one frame, this will give you an average sleep of 8.333 if everything else takes 0ms to execute
I can;t sleep a fixed value
i dont get it
why would it help with this
(8+8+9)/3=8.33333
does someone know how i add a delay for a command to execute the 2nd task like
p.sendMessage...
3 sec Delay
p.sendMessage...
so what
?scheduling
every 3 frames you sleep 1ms longer
yeah
runTaskLater
The whole problem started because the sleeps aren't consistent. A 1ms sleep isn't guaranteed to not be longer than 1ms
thx
yea but i still dont see why is that a problem
to FPS limit you measure how long it takes you to render each frame, this is an ongoing process. you take the average of those times and sleep between to fit 60 per second.
Yea, I think i had to mess with this problem as well a while ago. Didnt read you previous chat tho.
you will not hit 60 unless your render is very accurate in timing
That's why I told you. I know you weren't here
well i did
without sleeps
^
I mean a really bad idea would be to make a while loop which measures time each iteration, and as soon as it goes over your delay you will break it 😂
Likely all you did was stop rendering until the next second once you hit 60
that's what he did but it consumes loads of CPU
yea understandable
Does NOP in assembly consume cpu? Probably does
a tiny bit
is there a way to call NOP in c++?
i wonder how browsers handle this type of problem
whenever i visit gpu accelerated website cpu usages goes up
but whenever i switch to static page
it drops down
that's logical
but i still dont get it how it works, but i would never will
it probably uses multiple threads
to handle multiple events of actions
and whenever some action requires refresh of a screen, then its being updated
instead of refreshing every time
like in a game
eh i give up
its a side project after all
i would just stick with sleeping
So you could do a 7ms delay
of 64 fps cap
and then do your nanosecond loop
how could i know if 7ms delay would be slower or faster than the 8ms one
thank you chatgpt, saying that my method doesnt exist smh
chatgpt sucks
i feared that it would takeover programming scene
its a clown who doesnt understand nothing about programming
Sleep might be inaccurate but I doubt that it will be inaccurate by more than 1ms since that's pretty long for a cpu
it mixes everything with python code
except CTRL+C and CTRL+V from websites
nah it just tells some stackoverflow bullshit
it surprisingly good at assembly
ye
but fails at high level languages
They are using the population of programmers to teach AI how to program, and foolishly everyone is doing it.
every conversation is logged and AI goes over it to learn
i need to correct gpt-3 at least 10 times to give me at least something barely useable for me
it really wouldnt replace programmers any time soon
10 years at teh outside is my estimate
Make your money now as it won;t be long before you will have no jobs
https://learn.microsoft.com/en-us/windows/win32/api/timeapi/nf-timeapi-timebeginperiod
or you use the functions delivered by windows - if they can't do it nothing can
i was thinking about Kernel32.Sleep kekw
well it is inaccurate by 1ms in 1000/64 and 1000/60 truncated milliseconds so 😄
and it is by a lot
well then windows.h is the way I guess. Or you could at least give it a try
tried it
same shit
Did you try the timer?
🤔
It should fire every given amount of milliseconds
and then you would do your tick
maybe that's precise
if that thing ain't precise either then I'm out of ideas
does Player.isOnline() check if the player is authorized with mojang or if its playing on the server
https://discord.com/channels/850844430830534696/1113555359110545579
does anyone know why this is happening? class is null in DHAPI
Hologram hologram = DHAPI.createHologram("test", ((Player) sender).getLocation(), lines);
Caused by: java.lang.NoClassDefFoundError: eu/decentsoftware/holograms/api/DHAPI at me.paradis.main.commands.CommandManager.onCommand(CommandManager.java:27) ~[Kitpvp98-1.0.jar:?] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.19.3-R0.1-SNAPSHOT.jar:?]
#unknown ?
full error: https://pastebin.com/AYCeT185
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
using latest version
<dependency>
<groupId>com.github.decentsoftware-eu</groupId>
<artifactId>decentholograms</artifactId>
<version>2.8.1</version>
<scope>provided</scope>
</dependency>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
well you got it installed with the right version?
i tested older versions and got the same result
this was working about 2 weeks ago, didnt change anything
What plugins should I implement into my skyblock core with island raiding such as like API’s
https://github.com/DecentSoftware-eu/DecentHolograms/releases
latests is 2.8.1 if im not mistaken
let's say i log off the server, i change my name and i join back
how can i get the name i used to have before the change?
gotta save it
although, isnt there a usercache.json file
where it keeps track of an old name??
mh
I am trying to make a plugin that allows you to change how far down the platform is for water bucket clutching. I built 4 platforms, but don't know how to make them all disappear while one is still there.
yes, mine contains this json {"name":"JakeWithRizz","uuid":"4d829d76-d9ed-4aa8-a2ea-87e003be660d","expiresOn":"2023-06-30 20:57:17 +0000"}
what does the expiresOn part mean?
here is the image
that it will be removed from the cache or smth?
if the player doesnt login for a while ig
or does it still use the "formerly known as " message
Does anyone recommend a good way to set a spawn point for raiders on an island. We have an island core and the spawn point must be a set amount of blocks away from the core chunk. However, We have it to where users have to set their spawns for the raid
anyone?
Yeah, that’s what I have them do. I have them run /is raid spawn
Is DecentHolograms installed
[23:27:45] [Timer-0/WARN]: Exception in thread "Timer-0" java.lang.IllegalStateException: EntityDamageEvent cannot be triggered asynchronously from another thread.
[23:27:45] [Timer-0/WARN]: at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:572)
timer.schedule(new TimerTask() {
@Override
public void run() {
for(Player plr : Bukkit.getOnlinePlayers()){
if(isAffected(plr)){
plr.sendMessage(String.valueOf(getOxygen(plr)));
subtractOxygen(plr);
if(getOxygen(plr) <= 0){
plr.damage(damage);
}
}
}
}
}, 0, interval);
I'm trying to damage a player in a Timer thread but it says that I can't do that in a separate thread. What do I do?
?scheduling
TimerTask?
just throw the damage line in a lambda
um yeah, why are you even async in the TimerTask
public void start(){
scheduler.runTaskTimer(plugin, () -> {
for(Player plr : Bukkit.getOnlinePlayers()){
if(isAffected(plr)){
plr.sendMessage(String.valueOf(getOxygen(plr)));
subtractOxygen(plr);
if(getOxygen(plr) <= 0){
plr.damage(damage);
}
}
}
}, 0, interval);
}
what am i doing wrong
it's not running
we dont know. did you run start()? what does isAffected do? is getOxygen <= 0? is the damage > 0?
yeah
it worked before switching to BukkitScheduler
but I'll debug it
hm it triggers only once
interval too high?
oh
dont use timer
its old api
im not using it anymore
when i log something in the console with the SEVERE level, how do i make the whole log red
including the time
and yellow for warn
colours in logs are bad
I think you’d have to mess with the logger for that
why
But it’s best to just leave it
most consoles don;t support colours, but files definitely don't. It makes reading the log files a pain
you can but it's really difficult with log4j and without triggering Papers annoying nag.
on Spigot it's easier, but you will be harassed by every paper user
im using spigot
are you releasing the plugin?
no
you have to create your own appender
Isn’t it already red
I've never actually looked
Pretty sure severe is red
I don;t get errors in my logs so never noticed 😛
At least in my command prompt
you run paper though
maybe its cuz im using 1.8
theyuse jline iirc
True I don’t remember what happens on spigot
oh 1.8 doesn;t even have log4j
what does 1.8 hav
to add colours just create your own class that extends ConsoleHandler in 1.8
override the publish method
I think 1.8 supports colours, just to the consolecommandsender
super easy then
clearly green
sender.sendMessage(ChatColor.RED + s);
how do i make it severe
that's the joke
Idk what you’re on that’s blue
you have to use logger#
is there not bukkit.getlogger in 1.8
ill be honest i know nothing about any api differences in 1.8
like i know nothing abt plugin dev for old versions lmfao
ouch
how u make it red tho
I remember when 1.8 was the accepted version to develop for :p
Is there some way to get the uses of a service?
is severe not red by default for you
nope
isnt that just your terminal
idk man this is why i dont run fossil versions though
Can’t wait for the day we have legal users on this discord running a version that’s older than them
both windows and linux it worked like this for me
NO
Spigot or a fork?
as in on recent versions it color coded red by default for severe
nitrospigot
what is that lmao
Don’t worry about it
1.7 1.8 performance spigot
never heard of that one
I know it’s red on paper 1.19, but I don’t remember if it is on spigot
search it
It’s basically the same performance patches that have been floating around for years with a fancy name and a several hundred dollar price tag
And some buzz words like async and multithreaded
ill be honest i do run paper servers so that could be it
any sort of testing of anything i do is on paper
multithread 💀
cause thats what most people use (or derivatives)
no its not
i know the developer i have a custom fork of a custom fork
what site
builtbybit
idk
Well
At least it’s $15 and not $200
exactly
Wtf does good ender pearls mean
wait you bought it?
i bought a custom fork of it from the owner for 40$ and he updates it with shit when i need it
here are some of the basic options
noleafdecay: true
pearls:
fencegates: true
string: true
cobweb: true
taliban:
stairs: true
slabs: true
cobblewall: true
bed: true
endportal: true
piston: true
egg:
fencegates: true
string: true
cobweb: true
snowball:
fencegates: true
string: true
cobweb: true
disable-mobai: true
invalid-location-crash-patch: true
handle-block-operations: true
async-hits: true
unload-chunks: true
tcp-no-delay: true
static-protection-damage-reduction: false
ping-command-enabled: true
oh lord
it removes pearl glitching too
What
you paid 40$ for what again
taliban is a type of ender pearling
an ender pearl plugin and
But hey it adds a ping command
you're a sucker
async hits
What does async hits even mean
oh yeah
plain and simple, you're a sucker
and the knockback
you punch async
is so smooth
placebo effect
tf
Why does that need to be async
way too much time took in a tick
don't you know? async makes everything better
It’s not like damage calculations are gonna nuke your tps
for smooth hits
Wonder if I could sell a fork that just makes random pointless stuff async
yuo can sell a pointless fork
what
...
haha
💀
Exactly you gotta have those async join and leave messages
its really good on performance
adds a bunch of events too
like
EquipmentSetEvent
alex's armor equip event be like
Jesus fucking Christ
Look at the code
I want to shoot myself looking at that
that is the joke
yeah its great
Jk @ivory sleet always codes like that
of the plugin
(Real)
over 20k lines of just \n
$40 for that software is stupid, but making things asyncrynous makes sense
I mean
how is it stupid
Maybe
the performance is insane
There’s a reason paper doesn’t just make random shit async though
I'm sure Hypixel could use something like that with how badly a lot of their shit runs
im not just saying the performance is good for the sake of saying its good
Or spigot even
absolutely not
It would probably fix the issues with appearing to be right in front of the person you're fighting to them while you're eight blocks away
Hypixel already has an in-house fork
And making stuff async won’t magically fix ping
yeah theres also editable knockback values
That's definitely not entirely ping
look
current-profile: default
knockback-profiles:
default:
knockback:
horizontal: 0.385
vertical: 0.34
extra-horizontal: 0.38
extra-vertical: 0.085
friction: 2.0
vertical-limit: 0.38
hit-delay: 20
slowdown: 0.6
comboVel: -0.2
combo: false
comboHeight: 1.5
potions:
async: true
distance: 0.5
offset: -20.0
speed: 0.05
async potions
for ptpvp
potpvp
and the example I'm thinking of was a good like two second fight where I was too far away to hit the guy but he could hit me
thats gotta be a joke
okay that makes no sense
thats so stupid
async splash potions
they run asynchronisly n shit idk
all that does is slow down the potions and for absolutely nothing potions arent laggy
the knockback is the sell point
yeah when theres lots of people..
Aww man I can’t wait for async item dropping
potions sinply are not a real source of lag
TRUE
not sure why but this causes null err with p. even though all posibilities lead to it being set to something not null
or even better async picking up just so we can have more possible race conditions
EntityEvent?
You can;t, it's abstract
in acf, I want a command to complete with all online players
doListenerStuff
but I want to accept any offline player as a parameter
Ah
ah
do I just make a command completion called like online players or something?
Reminds me, spigot should throw an error if you try to listen to an abstract event
is there one already built in
(If it doesn’t already)
getKiller can be null
^ gotta check those nullability annotations
it also has these
idk what they mean
async-swings: true
quad-thread-cows-and-other-mobs-like-rabbits: true
Hold up
quad-thread-cows-and-other-mobs-like-rabbits
Wtf is that setting name and wtf does that even mean
i guess it uses 4 threads on cows and rabbits
(he doesn't know)
let me refer to the manual
lets put all kinds of crazy config entries in spigot (that do nothign) and sell it for $40 . I'm sure md_5 won;t mind
Why tf cows and rabbits specifically
its for spawners it says in the manual
?????
Yeah tbh spigot settings names aren’t verbose enough :p
these too
pearl-particles: true
damage-player-for-pearling: true
pearl-antiglitch: true
critical-block-tali-pearl: true
suffocation-prevention: true
no-invis-one-dot-eight: true```
Why the hell would you need four threads for spawners
Only cows and rabbits
Idk man they have some really advanced ai compared to pigs
spawning or spawners?
i mean it does say other mobs like
both
wtf does this do
per-player-mobai-asynchronous-task-completion-on-rendering: false```
yeah
Ignore the Purpur stuff
So advanced
Actually, a pig has more lmao
Sometimes I forgot you can ride pigs
yeah
Because who ever does that
because no one ever has a reason to
Only reason I've ever seen is entity speed only working with pigs
Anyway
I want to be able to have other plugins implement this interface so that I can loop through all of the implementations when checking something for an event
How should I do that
why does this not work
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
Player player = e.getPlayer();
String hello = "H";
hello += "e";
hello += "l";
hello += "l";
hello += "o";
String greeting = "";
for (char letter : hello.toCharArray()) {
greeting += letter + "\u0007";
}
player.sendMessage(greeting);
}
it says e is not defined'
That's a joke, right?
Learn java and wtf is that hello
That's why I think it's a joke lol
This is what peak hello world looks like
Add it to deluxeasyncjoinmessage++
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
Player player = e.getPlayer();
String greeting = "";
for (char letter : hello.toCharArray()) {
greeting += letter + "\u0007";
}
player.sendMessage(greeting);
}
thats insane
you should be banned from java
hwid banned
what is the default sound volume value ?
1 ? 2 ?
1? Idk
I think it's a float
Hey MD when will spigot have “quad-thread-cows-and-other-mobs-like-rabbits”
thhe custom form already has it
fork
yeah, it's a float
💀🔫
i try it got too quiet
I think it’s 1, idk
1F is loud enough for me
Pitch is also weird, different sounds seem to have different default pitch values
Because Mojang
More like Mojangk amirite
whats difference 1 and 1F ?
There isn't
Nothing in that context
compiler will infer 1F if you put 1 when you compile it since that's what the method takes
alright
I know lowercase b is Boolean
(byte)
PR it
Do I use my own registstration system or can a service somehow be used for that?
I have no clue how services work if that was a stupid question
Too long, that’s 6 whole characters!
You would need a registry
what
yoru own registry where others register their class
I thought you were talking about the vanilla/Bukkit class
I mean it’s essentially the same
pretty much
They just boil down to a map in the end
this may actually be an xy issue. Why do you believe you need them to register using yoru interface?
bro can u check my code ?
in dm bcs i don't wanna write here and i have problem for this code
are we really that bad?
I guarantee you do not have any code we have not seen many times before
No one is going ot steal your plugin.
But it’s the next hypixel!
I can honestly say I've never even logged into hypixel
not from u
alright wait
what is the problem?>
last time I saw you had issues with the water block flashing so you now have a watering can
no errors but not work
item2 and itemd2?
itemdata
you could have a service
You could make like a registration service
where the other plugins would grab your registration service and use that to register their implementation
code looks fine. you need to add debugs as it's probably not getting there
Sysout best debug tool
i did with broadcast
that works too
yes i can't get broadcast message
Anyone here like messing with Vectors? I have a basic shotgun vector randomizer that for whatever reason always fires right-of-center.
then it's not reaching that path in your code
public Vector randomizeVector(Vector direction, float accuracy) { return direction.add(new Vector(Math.random() * accuracy - accuracy, Math.random() * accuracy - accuracy, Math.random() * accuracy - accuracy)); }
somewhere earlier you are consuming it
you need to subtract half accuracy or your vector is going to be biased
Ahhhh, makes sense. Will do, thank you.
Works beautifully. Thanks <3
i found a problem
i change material water to pumpkin work
but how can i get water ?
theres pumpkins in minecraft?
yes
😄
what do you mean by get water?
since when
show me a picutre of a pumpkin
how can i interact with water ?
i want to right click water
😄
so theres no pumpkins im guessing
i change the event block type pumpkin from water
and my code work
You can’t right click water
It doesn’t have a hitbox
You would have to raytrace to see if water is in your line of sight
you need to detect the click on AIR (null) then iterate the player line of sight upto 5 blocks to detect water
You probably want right clicks on blocks too
Incase they are interacting with the bottom of a shallow pool of water
yep
old code, shoudl not use getData anymore
ty
look at post #13 I linked
13 is better
13 is better because it uses the player line of sight
13 will also work if looking into deep water
Can someone give an example of how to use Entity.setMetadata()
It allows you to store data on entities that other plugins can access
But it’s lost on restart, if you want it to persist use PDC instead
try not to use it
oh i thought it was nbts
MetaData is leaky
Iirc it’s also kind of leaky implemention wise
how do i edit nbts then
ok thx
Deprecate metadata when
Isn’t it leaky
but we have pdc
It's not meant to be persistent data
It's meant to allow for inter-plugin communication without explicitly depending on them
sus
I remember being told it was leaky. Had it explained but I can;t remember
I like to use VanishNoPacket as an example. Actually a lot of vanish plugins have adopted this technique.
public static boolean isVanished(Player player) {
for (MetadataValue value : player.getMetadata("vanished")) {
if (value.asBoolean()) {
return true;
}
}
return false;
}```
VNP attaches a lazy metadata value that evalutes to one of its methods
why
So that you don't have to explicitly depend on VNP. Most vanish plugins assign this metadata
couldnt that be shortented to return value.asBoolean()
single session values
You could but what if there are multiple metadata values? What if there are two vanish plugins for some reason?
you do the loop so return the first instance
What if the first one is false but the second is true?