#help-development
1 messages · Page 2222 of 1
I think you'd have to manually check them
!??!
uhh
but I'll do it right now because it seems useful
👀
👀
NMS just does checks for that
ping me or something if you have created it
xd
-2 -2 -2 -1 -2 0 -2 1 -2 2
-1 -2 -1 2
0 -2 0 2
1 -2 1 2
2 -2 2 -1 2 0 2 1 2 2
this are the offsets you have to check
same for Y+1
not that hard to check
so I think I'll just throw this into an array and then check those blocks
but of course one would also have to check for "blocking" blocks
this did not work. gives error on the return
well you are not supposed to "return"
its not code to just drop it, it tells you how to get the OfflinePlayer
?paste your listener class
you're checking if the player is null but then proceeding anyways?
Probably https://paste.md-5.net/buxakesona.java
Edit: fixed.
okay this is getting a bit nasty
private static final class EnchantmentTableBookshelfPosition {
private static final Set<EnchantmentTableBookshelfPosition> POSITIONS = new HashSet<>();
private final int x;
private final int z;
private final int blockingX;
private final int blockingZ;
static {
POSITIONS.add(new EnchantmentTableBookshelfPosition(-2,-2, -1, -1));
POSITIONS.add(new EnchantmentTableBookshelfPosition(-2,-1, -1, -1));
POSITIONS.add(new EnchantmentTableBookshelfPosition(-2, 0, -1, 0));
// ...
}
private EnchantmentTableBookshelfPosition(final int x, final int z, final int blockingX, final int blockingZ) {
this.x = x;
this.z = z;
this.blockingX = blockingX;
this.blockingZ = blockingZ;
}
}
couldnt you just check the blocks around the enchant table
or does it need to be a specific pattern
this is the pattern of acceptable bookshelves
but you also have to check that there is no other block inbetween
for example when -1 -1 is a torch, then the shelves at -2 -2, -2 -1 and -1 -2 won't work
hm
why not just store an array if you're just iterating?
an array of ints or an array of EnchantmentTableBookshelfPositions?
latter
yeah sure I could do that. but first of all I want it written down nicely before I worry about that
guess u could also use a multidimensional array no?
yes but that would look very nasty
but might be more efficient 🤷♂️
no
unnoticeably
unless you check this 6 hundred thousand times per tick
if you only ever cared about performance in java you'd code everything in one class
yeah and call your classes and methods a.b()
I mean I agree, but on the other hand only cause not everything we do in Java is as optimized as it could be, doesn't mean we have to shit on everything else does it? 😂 (Not saying u should do it different here)
The only thing I'm just thinking is if everyone works in a way like this, it kinda adds up. (Even tho taking this as an example is prolly the worst I could do but you probably get where I'm coming from)
smh
Can someone please take a look whether this looks correct? lol
static {
// First row
POSITIONS.add(new EnchantmentTableBookshelfPosition(-2, -2, -1, -1));
POSITIONS.add(new EnchantmentTableBookshelfPosition(-2, -1, -1, -1));
POSITIONS.add(new EnchantmentTableBookshelfPosition(-2, 0, -1, 0));
POSITIONS.add(new EnchantmentTableBookshelfPosition(-2, 1, -1, 1));
POSITIONS.add(new EnchantmentTableBookshelfPosition(-2, 2, -1, 1));
// Second row
POSITIONS.add(new EnchantmentTableBookshelfPosition(-1, -2, -1, -1));
POSITIONS.add(new EnchantmentTableBookshelfPosition(-1, 2, -1, 1));
// Third row
POSITIONS.add(new EnchantmentTableBookshelfPosition(0, -2, 0, -1));
POSITIONS.add(new EnchantmentTableBookshelfPosition(0, 2, 0, 1));
// Fourth row
POSITIONS.add(new EnchantmentTableBookshelfPosition(-1, -2, -1, -1));
POSITIONS.add(new EnchantmentTableBookshelfPosition(-1, 2, -1, 1));
// Fifth row
POSITIONS.add(new EnchantmentTableBookshelfPosition(2, -2, 1, -1));
POSITIONS.add(new EnchantmentTableBookshelfPosition(2, -1, 1, -1));
POSITIONS.add(new EnchantmentTableBookshelfPosition(2, 0, 1, 0));
POSITIONS.add(new EnchantmentTableBookshelfPosition(2, 1, 1, 1));
POSITIONS.add(new EnchantmentTableBookshelfPosition(2, 2, 1, 1));
}
first numbers are the bookshelf location, second numbers are the block that must be checked whether its empty or not
this looks like youre checking the very corner blocks arent u?
Yeah I think corners are not counted as they are No LOS
Im not sure whether theyre counted or not, but if theyre bordering the others they are most likely irrelevant
that happens sometimes for some reason
wtf lol
I've seen that happen and thought it odd
second and forth row literally the same thing
good to know. I thought they were not
without shelves its just 5
oh yes, but place others and the corners get cut off
oh yeah, 4th row must be 1 not -1
yes, but not if they have bordering blocks
cause then theyre out of sight
at least it should be
no
as you see, it's now level 12 and 3 in the upper left corner
yea okay, minecraft wiki says the same thing
so if you built it without corners and then add corners the level increases?
yes, check my last 2 screens
good
low key always lived in a lie
the sand in that picture would ONLY block the missing corner shelf
now it didnt work at all, the head did not open the guy just got into my inv
show me
?paste
nothing wrong with that code
yet when I open with /target, and click the head it does not take me to the next gui and just says "specified player is not online"
well that would say the player is not online
it seems like a shelf can have more than one "blocking position" and it's only blocked when all those positions are occupied
erm why does it have a random number in it?
what class is that from?
BlockEnchantmentTable
thx
this is how they check for the blocks iirc
bruh
the bookshelves are check usually done in the container class
i really hope obfustication makes it look like that
otherwise we know why updates take so long
obfuscation only renames the fields
oh god
show
gotta open 1.19 holupo
why are they multiplying by 2 instead of bitshifting?
so they got new devs then?
because they're idiots
i need to become a minecraft dev
i once tested bitshifting vs multiplication and it was basically equally fast
some compilers optimize it
I then googled and found out that the CPU itself will simply use bitshifting when possible
Because realistically it’s getting optimized at a lower level yeah
might depend on the year of cpu tho i could imagine
so whoever thinks "Hm should I replace this with a bitshift instead for performenace" is just wasting their time
i really hope that the code really isnt that bad.
bro why dont you use mojang mappings >.<
they gotta have a team of people to make the code look like shit
I use gradle groovy
pain in the ass to setup
why is minecraft code so bad
I just can't bother
AngerManagement
Object2IntMap
well if the entities are still used outside of this class for the
ykw ill just use rust to explain
bruh the angermanagement class is purely made for the warden
AngerLevel has warden sounds hardcoded
what the hell
0 abstraction 💀 and you wonder why it takes them so long to make updates
if the entire codebase is that bad
They used to use PathfinderGoals
That’s the case with most microoptimizations
had nice abstraction but it was janky
does mojang need devs?
I wasted an hour theorizing about branchless Math.abs
some
dude i made a stringbuilder and appened a million characters
it was slower by 15 seconds
wanna know why? because i didnt bitshift
what is that supposd to mean
shit, yeah that's a rookie mistake. You should get an AbstractBitShiftingStringBuilderGeneratorFactory to get a BitShiftingStringBuilderGenerator that you can use to create a BitShiftingStringBuilder, then use that to append your character a million times
true true
he was workin on bukkit
then went to mojang
StringBuilder gets a lot of its code replaced at runtime by native code in the JVM anyway
y'all are seeing it from the wrong perspective
gpu-optimized stringbuilder
512 bit string manipulation
Which class is this, I wanna see how much the obfuscation changed it lmao
I wonder how the work environment is there. I can't imagine working with a game that is supposed to have a notoriously awful code base
Warden
They passively improve it
Which class though
r u def
probably WardenEntity or EntityWarden
idfk I'm not a fancy tool user
I’ll take a look
I’m not a fancy tool user either I’m on my phone lmfao
It’s just Warden, I found it
What’s the game rule to disable elcytrafly check?
folks at #help-server might be better help honestly
we just code the gamerules ourselves
I THINK it works like this btw. The gold block has to be free for the gold ore to work, and the lapis block has to be free for the lapis ore to work
dreamwastaken code 💀
I'm pretty sure George actually does most of the coding I don't think dream knows very much
wait
sumo_sex_plugin what the fuck
yea
this gotta be fake
he made a really weird plugin a while ago
there was a whole twitter thread about it
I have some contacts that used to work for Invadedlands and work with dream
let me see if i can find it
they don't go that low in terms of quality
apparently he sent this sex plugin to a minor or something
lol who are you talking about
and wtf is a sex plugin lmao
and why didn't i have the idea to do a sex plugin
Let’s go shift in this corner step bro
Dream the popular minecraft youtuber or never mind the popular speed run cheater
bruh
never heard of him I think
he made the manhunt videos that got like semi-popular and he also cheated on speedruns
no shot
hm shit this is also not true
I don't understand how the enchantment table bookshelf thing works
so fuck it
Use one bookshelf
And try it
well the funny thing is
one bookshelf doesn't do shit lol
both, no shelf or one shelf results in max level 5
when you add a second shelf you're up to level 7
lmfao
Should just be in the table code no?
at least you tried, not sure if you gave up yet
the table code is extremely weird
Bruh
public static boolean isValidBookShelf(Level var0, BlockPos var1, BlockPos var2) {
return var0.getBlockState(var1.offset(var2)).is(Blocks.BOOKSHELF) && var0.isEmptyBlock(var1.offset(var2.getX() / 2, var2.getY(), var2.getZ() / 2));
}
like WTF is the offset between var1 and var2
how can the offset between the enchantment table and the bookshelf also be a bookshelf
EnchantmentTableBlock
package?
That's actually weird
net.minecraft.world.level.block
Kk
Cuz id assume that will be near 0 0 0
I don't understand this whole offset thing at all
The offset that is
I mean the offset between the shelf and the bookshelf should be sth like 0,0,-2
but they directly check the block at the offset position, makes no sense to me
It's checking 0,0,2 for a bookshelf😂
like i have a table at 100,64,100 and a shelf at 100,64,102. the offset would be 0,0,2?!
why are they checking the block at 0,0,2?
or am I missing sth here
Cuz realistically it's never a bookshelf
Ok here’s how it works
What would be a good service for Bungee <-> Spigot communication?
go place a bookshelf at 0,0,2 ans see if it affects the level
Redis
The enchantment table is checking for a valid bookshelf at (x, y, z), you understand that so far right @tender shard ?
I mean, an offset of 2 makes sense. There's a block of space inbetween the bookshelf and the enchanting table, so....
obviously
var1 is the position of the enchanting table
var2 is the offset from the table to each bookshelf being checked
Ahh
wtf
So it adds iy
why are they using a BlockPos for an offset, that's just confusing
It then computes whether the block at var1 + var2 is a bookshelf
yeah that makes sense now
I of course thought that a BlockPos is a block position in the world and not just the offset
Lol
alrighty then I can just translate this to regular bukkit code, and lets see whether it works lol. thanks
BlockPos is basically Vector rather than Location
yeah the name is so stupid
because it's literally block POSITION
should be called just Vector3
why?
because it has the pub/sub system
That would’ve been a pain to figure out without the variable names
why not make usage of netty?
Plugin messaging requres an online player
Oh u wanna use netty
U can ig
It'll be more difficult than redis tho
Depends on ur usecase
just short time information like updating server states and money for players
because it's way more complicated imho
Use redis for that
in that case each server requires its own channel doesn't it?
or should i use a channel for a specific kind of information?
I found this one:
https://stackoverflow.com/questions/54178462/how-does-redis-pubsub-subscribe-mechanism-works/54243792#54243792
private static final int[][] BOOKSHELF_OFFSETS = new int[][]{
{-2, 0, -2}, {-1, 0, -2}, {0, 0, -2}, {1, 0, -2}, {2, 0, -2},
{-2, 0, -1}, {2, 0, -1},
{-2, 0, 0}, {2, 0, 0},
{-2, 0, 1}, {2, 0, 1},
{-2, 0, 2}, {-1, 0, 2}, {0, 0, 2}, {1, 0, 2}, {2, 0, 2},
{-2, 1, -2}, {-1, 1, -2}, {0, 1, -2}, {1, 1, -2}, {2, 1, -2},
{-2, 1, -1}, {2, 1, -1},
{-2, 1, 0}, {2, 1, 0},
{-2, 1, 1}, {2, 1, 1},
{-2, 1, 2}, {-1, 1, 2}, {0, 1, 2}, {1, 1, 2}, {2, 1, 2},
};
Finally this looks fancy lol
Wait wdym
he means you can do this
public static final int[][] BOOKSHELF_OFFSETS = {
{-2, 0, -2}, {-1, 0, -2}, {0, 0, -2}, {1, 0, -2}, {2, 0, -2}, ...
without new int[][]
since always
👀
^
Wow
swear i tried it before and it didnt work
this will not work in expressions though.
for(String name : {"mfnalex"})
will not work
It has to be in the initial declaration
declarations
You can’t do it in assignments
this only works like this
for(String name : new String[] {"mfnalex"})
also why is this idiot using an array if he only stores one name
what a jerk
@NotNull
public static String camelToKebab(@NotNull String name) {
StringBuilder result = new StringBuilder(name.length() << 1);
@tender shard
cry
im pretty sure one of your blockdata methods had like 8 bitshifts
Why would you bitshift the length of a string?
so the stringbuilder never has to grow
I'm not good enough to understand that
Ye that's the bytearray of the string right?
Ok but why do you shift by one bit?
I ♥ bytes
thats 9 characters
18 bytes
the stringbuilder will have to grow the internal array, because this wont fit
See i told you I'm not good enf😂
just listen
.
so the stringbuilder creates a new array and uses that one instead
Ohh
with the array's capacity at currentArray.length << 1
bitshifting once to the left just means multiplying by two
its so much faster tho
Won't the compiler fix that?
nope
I thought it made optimizations like those
dude i made a stringbuilder and appened a million characters
it was slower by 15 seconds
wanna know why? because i didnt bitshift
If u divide by 16, it can bitshift 4 times
java doesnt optimize shit
for utf-16
Utf8 is 1char =1byte then
yeah
utf-16 = unicode transformation format, 16 bits
utf-8 = unicode transformation format, 8 bits
2^16 = 65536 possible characters
Utf16 has emojis 8 does not?
i guess
Ah
That makes sense
8 has emojis. It uses control codes to double up bytes
whatever elgar says is right
So basically 2 chars is one emoji in utf8?
char != byte
control code and 2 bytes
Hm
Depends heavily on the CPU and the JVM
It doesn’t matter if the compiler does if the JVM optimizes the bytecode
I swear the jvm is magic
how
The JVM optimizes like a beast
Any sufficiently advanced technology is indistinguishable from magic
rust
wanna know something cool about rust
String is an owned, growable string, like a stringbuilder in java
Box<str> is a non-growing string, with ownership
Is string+= faster than stringBuilder.append?
hell no
Intellij tells me to use stringBuilder.append whwn I use the former
string += toAppend means string = new StringBuilder(string).append(toAppend)
strings are immutable
it has to
dont worry its optimized
its just a warning that your code is bad
Uhhh
I’m not sure about it allocating a new StringBuilder
String += is significantly slower than using a stringbuilder
look at the bytecode
What abt something like "sql statement stuff here" + some variable + " more sql stuff there"
That’s why people use stringbuilder
Is stringbuilder append faster?
optimized by the compiler
no difference
Yes
Ok
Specifically in the case where you’re appending to a string in a for loop or something similar
how do i force a wheat seed into a brewing stand
mojang's code is so weird
if you set the maxStackSize of an item to > 1, it is not enchantable anymore
Can't u get the inv and set the item?
oh is it that easy
well
would it also be possible to be able to have the user directly put the seed into the brewing stand
like a normal drag and drop
You can’t let the client do that
But if it fires the appropriate event, you could allow it to happen
can i abuse inventoryclickevent?
Potentially
is it possible to retrieve the url from the plugin.yml of another plugin
I need it so that i can expose the plugin list and the links to theme on server webpage (aka i am building a rest api)
declaration: package: org.bukkit.plugin, class: PluginDescriptionFile
JavaPlugin#getPluginDescriptionFile() -> #getWebsite()
thank you
No. Just be aware of that notice
You notice that a lot more when the player is in creative mode, but you will notice it in survival mode too
R u setting it to null?
How would I go about making an armor stand go up and down smoothly a specified amount of blocks in a loop? If anyone could help that'd be greatly appreciated. Sorry if I come across a bit rude.
Well u would have to use a runnable
i'm using it and i don't see any issues, even in creative
Then u tp it up the increment each tick
kk, tysm
Well ur fine
sick
@EventHandler
@SuppressWarnings( "deprecation" )
public void onClickBrewingSlot(InventoryClickEvent event) {
if (event.getInventory() instanceof BrewerInventory) {
BrewerInventory inventory = (BrewerInventory) event.getInventory();
// If the slot is one of the three potion slots
if (event.getSlot() >= 0 && event.getSlot() <= 2) {
// If the item is a seed
if (event.getCurrentItem().getType() == Material.AIR && event.getCursor() != null && SEEDS.contains(event.getCursor().getType())) {
ItemStack droppedItem = event.getCursor().clone();
droppedItem.setAmount(1);
event.getCursor().setAmount(event.getCursor().getAmount() - 1);
inventory.setItem(event.getSlot(), droppedItem);
event.setCursor(event.getCursor());
event.setCancelled(true);
}
}
}
}
I'm trying to allow the player put seeds into the brewing stand
and it works and all
problem is if I try to put seeds in slots 0, 1, or 2 of my OWN inventory with the brewing prompt open it'll just make the seeds on my cursor disappear
trying to put it here makes the item teleport to the brewing stand slot, and if it's already full it'll just delete items from my cursor
so I finally put this together into a method.
?paste
Is possible to hide a block and unhide it?
Player#sendBlockChange
basically how do I distinguish between the brewing part and my own inventory
Atm in using an oddy way, setting the block to air and then by the location setting up to the old block
InventoryView#getTopInventory and getBottomInventory
Its for the protection block hide and unhide command
what do you think mfnalex*?
wait where do i get inventoryview
for example in an InventoryClickEvent
InventoryOpenEvent, InventoryCloseEvent too
or from Player#getOpenInventory
I'm trying to check if the slot clicked is between 0 and 2
event.getSlot() >= 0 && event.getSlot() <= 2
but like- how can I make sure its slots 0-2 in the brewing stand and not in the player inventory
By the view
Get the top inventory
need a manhunt plugin asap
?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/
He?
!!!
hold up im lost
event.getInventory() instanceof BrewerInventory && event.getClickedInventory() == ???
InventoryClickEvent#getView#getTopInventory()
ah
so like this I'm assuming
event.getView().getTopInventory().equals(event.getClickedInventory())
yeah that checks if you clicked the top inventory
great
but you also must always think of the InventoryDragEvent too
I was wondering if it is possible to make a gui that is bound to a keybind in bukkit or I need to make it as a mod?
Probably going to have to make a mod. Keybinds aren’t accessible through the API.
Normally, plugins that want to give off the illusion that they use keybinds just use the PlayerSwapHandItem, or whatever it is actually called, event.
The only “keybinds" you can really use are the Drop Key or the Swap Hand Key. I’m not sure if there are other ones that have events tied to them, but if there isn’t an event, you’ll have to rely on mods for whatever functionality you are looking for.
well thx for responding to me
client doesn't really tell the server what keys they pressed
uhh
it sends a packet for whenever you press F
small price to pay in some servers
I forget what the F key does
offhand
ah, well for most things key presses are sent
even if you're not holding anything, packets still get sent
that's the best part
you can cancel the packet / event and it's smooth
No client-side 1 tick item bullshit
Your welcome
key presses are in packets too or can be lol. Point being, is you generally can't listen for specific key presses rather just events/actions from packets
If need extra help just dm me or ask it here
I wouldn't say verano is the most helpful guy out here
it is handy to have the packets that way, but sometimes it is better to listen for key presses, for example when moving 😛
so just ask here
Why lmao?
You always saying bullshit about me
Im not idiot i could be dum but not ...
Just a ask / reply ratio
I talk shit about everyone, not you in particular
We got no beef, I'm neutral
Hmn yeah i can see it....
Lmao dont play with someone smoked
Smoked i can be really agressive
So maybe i would have to take a relax and not hurt anyone
doubt you will hurt me
lmao i cannot smoke Marihuana anymore
I lift tires for exercise 🙂
I don't smoke or drink
Oh that its what you must do
I got a job recently where I change out semi tires off trucks and trailers 🙂
my fastest time on a truck, is 33 minutes changing out all 10 tires 😄
Sounds fun
did you hear of alt+f4?
By day I'm an intern at a school
jobs include passing ethernet cables through walls and replacing projectors
by night I'm coder man
they pay me $20.50 an hour to change tires, I don't even have to take the tires off the rims either
I don't get paid 👍
that is illegal then
using interns to replace skilled labor is illegal in the US
and it's mandatory for my type of education
that pretty cool, do they pay a rasonable amount?
I only get paid for my coding stuff at night
he works for free on that not knowing any better, but then again I don't know which country they live in and by the sounds of it they are not in the US
in the US it is illegal to have interns do work on their own that isn't for the purposes of teaching
ehh
I abuse the system a bit
by doing coding stuff whenever classrooms are busy
and leaving early on sunny days when the shawty feels like going for a swim
now while although most interns are paid in the US, companies can pay them a significantly lower rate
so there is that
but they still for the most part get paid lol
interns by law must be unpaid in my country lol
but companies are obligated to pay for food and transport costs
which ends up to like 200$/mo
except since I work at a school, and live across the street, I get nothing
well in the US there is a way to not pay interns, but its a very fine line that is easy to get in trouble for, so most businesses just pay interns so they don't get in trouble
Ehh
what the heck are interns?
the amount of cuts I go through during work days would not make it worth the money I'd receive if I were in the US
my hands end up getting scratched / cut like 2-3x per day
they are people that not certified or possess the skills for the job, and they are used to teach them the skills or help them get certified. So they get to learn with someone who is skilled.
In technic school we have some people known as "assistants" which repair computers, do internet staff
I wish I wasn't certified
went into a programming course with 5 years of experience just to get a degree
there is no degree for programming
Well I'm getting an associates
IT programming / management
Allright, but they must be paid for what they do. Because they are also learning but the most important thing is that they help on universities, etc
For example, wiring ethernet cables, etc
> Internship in programming
> mounting electrical and network sockets for 6 hours straight
caught covid midway, gotta work 9 hours / day now 👍
system made to fuck me over but nothing I can do
well typically because they don't have those skills or certifications their work typically tends to be of lesser quality or it takes twice as long to complete a job. So there is ways to not pay an intern, however in the US too many businesses kept getting in trouble for abusing this system so most places that hire interns typically pay them, but they get to pay them significantly less for some fields
also sorry for chaging topic, but is the same this?
- if (!condtion-1 && !condition-2)
- if (!(condition-1 && condition-2))
yes
not-one and not-two is the same as not-(one and two)
if (!(argument.getPermission().isEmpty() && sender.hasPermission(argument.getPermission()))) {}
And is returning true
The 2 conditions are true, i already debbuged it
uhh
wtf
if it's empty then you can't really get it
I guess it returns true by default
drop the ()
that its incorrect
no its not
Because dropping the (!(condition-1 && condition-2)) ill make the code negate only the first condition
Hello! I'm new to plugin and resource pack development and wanted to know if this is a good way to do this.
OK so I wanna add an a set of items and mechanics attached to those items (scuba gear that allows one to breath for a bit longer underwater), I don't wanna make a full on mod, just a resource pack to add the items with their recipiew, and I think I need to add stuff to a plugin to make the items have the effect (a bunch of setRemainingAir calls to manually set the "higher" oxygen capacity)
Is this approach a good idea? Or is this massively overkill and can be done just with the resource pack?
You need like that
Because the texture pack only is used to give a texture to that custom recipe
its your choice rather to make it through plugins or resource packs
He need the 2
?
cuz of this
resource pack != texture pack
Oh
They are diff
I didnt know my bad
yeah that's why I'm asking, can a resource pack do something like player.setMaximumAir()?
I legit can't find much documentation on resource packs, most I get is from Microsoft for bedrock edition
No
Please only use the resourcepack only for textures, and do everything else in plugins
do you mean datapacks?
it will save your time
that what i told him or not?
you cant code through texture packs
@vale stag
oh they are called datapacks, sorry
Using texture pack, you only give textures to items
please no 💀 datapacks are literally a million chained commands
yeah use plugins
ok, thanks!
you could extract it from the client jar ig
Yeah the jar sources are obfuscated
oh...
I have already tried
I think it because i use a moded 3rd party client
I ill try extracting from the original one
yeah no
do the original one
lmao
lol
didnt i told to not being rude
Sounds like you are trolling
dude its a joke i stfg
Dont joke its not a good momment
i feel like everyone here has their sarcasm sensors burnt out
shut up who ask you?
wait wait im just trolling
Dont ban me
Its was all a joke
I never get mad when someone is rude
I just ignore them
.
The 2 conditions are true, what can be happening i already tried many times and im exausted
lol didnt realize this is in helpdev
Holy shit, when did i say that
Oh lol
I thought i were on general
My mistake
sir, im not trolling lol
gui lib to make something like this easily?
^^
paginated
the heads are the "page contents"
and orange glass
i know but rn i dont wanna work on making something
Yeah there are pagination libs out there
i tried spigui
i dont understand how to do this with it
ah wait
i figured it out 😂
How to get the ID of a task inside that task?
super.getTaskId()
what did you do
It's the opposite method for hidePlayer so it makes sense.
You may want to look into how some vanish plugins handle this. Because, if you want players to not be hidden on the tablist, but invisible to other players, you may need something a little more advanced.
Alternatively, you could overwrite the tablist, but then you run into issues with interfering with other tab plugins.
the serialize() method on CraftPlayer is a joke lol
public Map<String, Object> serialize() {
Map<String, Object> result = new LinkedHashMap();
result.put("name", this.getName());
return result;
}
it's working exactly as intended
you hide a player, then show it again. what did you expect to happen lol
^ this
check out how all those vanish plugins do it
for example, first thing that comes to my mind: send all players a packet that you changed the gamemode to spectator
^
oh wait then the name in tab is italic
And at the bottom of the tablist
declaration: package: org.bukkit.entity, interface: Player
what do you mean not shown?
On the tablist.
You may want to also look into scoreboard teams and add the player to one when they are "invisible" That way it may not entirely screw up their position in the tablist.
How can I change the color of potions in 1.8?
declaration: package: org.bukkit.entity, interface: LivingEntity
might want to try that
The setColor method doesn't exist in 1.8
1.8 is also not supported anymore either
Officially?
yep officially hasn't been supported for like a decade
I meant here, by spigot.
yes here by spigot
the reason it is an exception is due to the fact that many people use 1.8 and has to do with security. Spigot could have chosen to not do that, but that was MD's decision. Support for 1.8 does not exist and hasn't for a decade or round about
Perhaps I misunderstood. I thought you meant there was an announcement or something that said 1.8 will no longer be supported on the forums or something.
its technically not supported I mean no updates are being pushed other than that security fix exception
omg log4j is already 7 months ago
ik its crazy we still get people in here asking if its fixed too lmao
just because people choose to use an outdated software does not mean other people are obligated to provide support for something they purposely chosen to use despite it being outdated. That is just ignorant
[IMG]
[IMG]
imgur:
- code (https://imgur.com/c6ffAVI)
- console errors (https://imgur.com/sAncb8S)
42 row has some errors...
new resource guys
🥳
definitely gonna use this in my next plugin!
Can't wait to implement it in my projects.
I've already added it
though I keep gettin g an ArrayIndexOutOfBoundsException
I hope I'm not doing anything wrong
or if this is intended functionality
why did you copy paste my answer?
point being from the above conversation for you, is you can wait till someone chooses to help but you also might not get help at all due to the fact it is really outdated. Typically it is up to you to figure it out with whatever problems you have because some of us here don't even use those versions anymore and don't remember all the various API's that exist or don't exist for that version.
Ended up with the multi dimensional array :o
Looks good tho 🙂
bro that guys code looks like he shot an arrow into the middle of it
Don't question it. He's a world class developer.
ShapedRecipe tpBow = new ShapedRecipe(new NamespacedKey(getPlugin(), "Teleport Bow"), new ItemStack(BowUtils.createTeleportBow()));
tpBow.shape("AAA", "ABA", "AAA");
tpBow.setIngredient('A', Material.ENDER_PEARL);
tpBow.setIngredient('B', Material.BOW);
Bukkit.addRecipe(tpBow);
What is my error here?
I get nothing from the build console, nor the game console.
true he just released the most useful resource i've seen in a while
He went out of his way to make it public!
only thing I would think of that would be causing that is if your code isn't even being run
you definitely got a console error that says Invalid key. Must be [a-z0-9/._-]
I mean it's in on Enabled.
No caps?
oh in the key
so that's no problem, but a space in the key is a problem
Nope still not getting my item when trying to craft it..
send your latest.log
build log? or server log?
server log and full code
I got multiple files.. to keep things organized ish..
Code related to the recipe.
If you want help, you should paste your code
If not solve it alone
if i have multiple plugins for just my own use connecting to a mongo database, would it be beneficial to just make one plugin to connect with and have my other plugins use that plugin to access the database?
Oh good question, never thoguth about it
Yes, my internet went out, need to wait to get on my computer again.
It would reduce duplicate code amongst your plugins, but your plugins then no longer become standalone. They now have to rely on an API or external jar that has those methods.
not really beneficial if you ever plan to release those plugins
But for personal use its wrong
Would also most likely come at the cost of not being able to use different databases per plugin
And what about perfomance?
Why not? You can do that anyway
It'd be roughly the same. Maybe a millisecond or two longer if you need to make a call to an API in another jar.
Allrr thanks
Depends on how your api handles it, but if it was just going to connect to 1 database then you're stuck to that one. If you allow access to different databases then it doesn't seem much different to me than just having a connection per plugin
I figured it out, it was nothing wrong with the recipe, is was my other stuff for enchants.
In my case i will create a lib, so its even more easier coding plugin (not a plugin, a vanilla java lib)
I've thought about this myself once, I don't really think it's really worth it though, as being able to run things standalone sometimes really is a blessing
^ this.
Also people, if you need to deploy some databases for testing you can use https://railway.app it allow you to create multiple project with database services, enviroments, webhooks, add members, etc
Keep in thoguht im not doing spam, just trying to help people
Just run your own local DBs
In my case i dont like having lot of things on my pc. And doker dont fit me really well
love how the cloud is still being advertised even though there isn't anything special about it for developers
this looks cool
I dont know, im figuring how to deploy a NodeJS, but for the momment i use their database services for teting
In the case of using that website, i didnt figure how to deploy a nodejs app
but in regards to developers, the cloud doesn't mean anything. It is still a server
Yep
But idk i see useful for some people, but its not amazing
what annoys me with places that use the cloud to advertise as a developer is not telling me the hardware specs
agree, most of the time they dont say what specs you have
it would be really useful them telling you have x bandwith for limit (before your app goes down), x cores and threads, etc
well really all i need it for is a currency, i have a currency for each player but need the currency in multiple different plugins
so i thought having a core plugin for getting players coins would do
all the plugins i make are strictly for my server
Did you have any concurrency problem?
For example, player leaves lobby server, and he joined a new server but his data was not udpated, because he joined a minigame server faster than the process of saving data from lobby and loading it into minigame
this is one of the reasons for using caching mechanisms. Specifically expiring caches
with an expire cache you would solve that problem @sterile token
redis is a cache server that does have expiring cache features
For saving concurrency problem i load only 1 global cache and them work over it
however you don't need redis for this
I jut realized hen you told me that
Can u send an example?
So i can understand better :D
well spigot has guava shaded in which has expiring cache mechanisms
the cache handles it
you just tell the cache handler what to do when it encounters an object not in cache
IE where to pull it from
then everything else accessing the cache just uses the cache methods to get the object. If it is expired, cache handler goes and pulls the object to put in the cache
if its in the cache already not expired yet, it just gives that instead
Is it async?
I mean in the way of how it pull
If he pull the data async or how
Because non async database things can make the main thread slower or even block it
or im wrong?
you can create a custom method to return stuff from a db and then have that cache handler call that method
org.bukkit.plugin.InvalidPluginException: java.lang.NullPointerException: Cannot invoke "com.yanesagrybnow.colornickname.ColorNickname.getConfig()" because "com.yanesagrybnow.colornickname.ColorNickname.instance" is null
why does it give me this when my config is not null ?
Probably because you are using a static instance of your main class to access a config.
instance seems to be null
I am assuming you are not instantiating an object you are trying to use
public ColorNickname() {
instance = this;
}
Why? Just use the class itself as it's own instance at that point.
Something like CompletableFuture<> right?
why are you using a singleton pattern here?
you can, but don't necessarily need to do that
It recommend to use DI instead of singleton
but if not, it doesnt be async
What should I do or replace?
use DI
that isn't true at all
you can have a method that spins up a thread to fetch DB stuff
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
Hmn, exmaple please im dumb
synchronized void getDBInfo() {
Thread something = new Thread();
//override run method put code in the run method, then call something.start() return db stuff etc.
}
you don't have to use the synchornized key word
but you might depending on how it is done and what is accessing it
Im eeven dumber
I don't use mongo so wouldn't know
explain the synchronized keyword to me
I thought that keyword made the code run on the main thread. (If it's already on another one)c
Allr dont worry frost
synchronized will make everything else wait to run the method until it is done running for whatever called it first
very handy to use for things like lists in other threads
or when needing to access a list in another thread
public static ColorNickname getInstance() { return instance; }
@Override
public void onEnable() {
instance = this;
I change it to this, still same error
am I a static abuser
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
read that
But I dont understand, I have been using this method for configs for some time now
Never given me an error
READ
while true it is unnecessary in the way you are using it
singleton pattern isn't for to be used with everything
If you dont read it carefully you wont understand it
There are many ways to do the same thing with code.
Only a handful will give you stability and reliability.
Normally the ones that follow the conventions
Static has a time and a place. However, for spigot plugin development, you will seldomly use it.
they been told how to resolve it, they are just refusing to do it a different way which that is beyond the scope of this discord if they refuse to do what was stated 😛
Can i use JDA with in Spigot?
So can i make something similar to DiscordSRV like that? with JDA though?
Yes
like what im tryin to ask is can i combind jda and spigot into 1
Idk what you mean by combine, but you can definitely use the JDA API in a spigot plugin.
yeah that's what im trying to say
thanks
BTW discordsrv is made with jda
Could not initialize class error
at Colorize.sendMessage(player, Message.NO_PERMISSION);
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.yanesagrybnow.nicknamecolor.Message
at com.yanesagrybnow.nicknamecolor.Command.onCommand(Command.java:17) ~[?:?]
Sorry for asking, but have learn the basics about java before starting with plugin?
No
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.
So that means you cant help me with my question or
LMAO you shouldnt be doing plugins without being learned the basics of java
It's not that we can't. It's that you won't understand what we are suggesting since you don't understand the underlying language.
If you dont know basic java, its impossible to help because its like talking to you in chinese
You gotta learn to walk before you can run.
Great comparison. Java and chiense
chinese
It's just, it does not require me to learn java before just making some basic plugins. And the question still remains about the error, if you cant solve it or dont want to just say that instead
Except it does.
just do like codecademy course
i mean you still wont understand until you apply but
better than not having any idea
if he dont want to learn it, the best is to go and do our things
word
Read the first 25 pages of the Java book by Oracle and so much will make sense.
How do you check if a BlockPos is reachable by an entity in NMS? This horse is programmed to go next to the nearest source of water but the idiot just faces the wall. If I get rid of the water behind the wall the horse will go to the water farther away instead
Agree with you. It the best way of learning basic java
Must be pretty hard for you Verano
He?
You read a book and now you are educated yet when someone who knows less asks for help with a matter he is not familiar with, you laugh
you will need to make your own pathfinding to detect such things
I've already created my own pathfinder goal and everything, just wondering if theres a built in method to see if a block is reachable
wow
not that I am aware of
hence you will need to make your own thing to detect that
take a week and do it
damn
I dont know why people nowadays are like crystals lmao
You just say something and they get mad
Crystals?
I think he meant snowflake.
Obviously
Hey guys. I'm using Player#setSpectatorTarget to set the player to spectate another player.
The problem is that the target is a passenger of another entity and when I set the player to spectate, it simply refuses to spectate and starts to teleport the player instead of spectating.
It only spectates if I dismount the entity. I can't show a lot because I have NDA
NDA?
Real NDA that you signed or verbal agreement?
Non Disclosure Agreement
Tbh, as long as you don't give out details about the project, you should be fine. When it comes to code, it'll depend on the NDA, but you could likely get away with sharing what you have here.
Or take that specific part and make a standalone plugin out of it.
Well, it happens literally in the place the NDA says to not leak
then how people gonna help
I said what is the problem
Well it's a little hard to take an explanation at face value without seeing the code.
Maybe just do it via DM, how it would know that so share some part of code to someone
The code is literally I setting the player to spectate another player
but the target is mounted in another entity
So instead of spectating, the player starts to teleport each x blocks to the target
Maybe try making the player spectate the target first, then have them mount the entity.
Or if they are already mounted, dismount them, add the player, then remount them.
is it a common problem not to be able to find anything with ClassGraph in Spigot plugins?
depends how you are using it
but just because something says it can do something, doesn't necessarily mean it actually can. Big difference between saying such things and actually testing such things
it isn't feasible to test all possible scenarios 😉
much easier to say it can though
well, I suspect that Spigot might not load all the classes inside my plugin into the classpath
namely the classes that aren't referenced anywhere apart from reflection
that is because it doesn't. It loads the main class you specified in the plugin.yml hence why it is necessary to specify it there
yeah, that makes sense
and then from there, it is on your plugin to load the classes it uses
No way it worked!!!! Thanks
that's what I'm trying to do, but I'm not entirely sure how I can in this scenario
Now, how can I make a chunk not to unload like the spawn chunk?
would I have to look up the classes from the JAR files myself? assuming I even can
depends on how you are trying to do something really. I haven't used classgraph before, and it makes some bold claims in everything it says it can do. Obviously it has never encountered a custom class path loader though
so...it seems it can't do everything 😛
yeah, but the same story goes for trying Class.forName(...) as well
but that again also does make sense
because afaik, neither of these implementations will scan another JAR file than that of the running application(?)
can't find something if it doesn't get loading onto the path until it is needed
as I said, only thing that spigot loads is the main class specified by the plugin.yml. everything else loaded is done by the plugin not spigot itself
yeah, so when I do a new instance of these same classes, it'd work fine
yep
but then all of my boilerplate abstraction stuff will be useless
well I can't help you with that problem 😛
What is the denominator of entity velocity? Is it meters per second? Is it meters per 500ms? Per 100ms?