#help-development
1 messages ยท Page 1041 of 1
that is also a database?
as i said i have a working system ish , the only problem is itemstack string serlized is not being send to redis ..
anyone can help me fix that?
I gave an example of how it can be useful or makes sense to do so. Also my example while it can be used wasn't necessarily meant to say you should do it that way rather to convey that there are other ways to accomplish what you are wanting and that it may be wise to research those considering you were having difficulties with the design you were trying to implement
Why are we even insistent on saving items as strings
thanks
well its for the kit system
the kit system
Why not save the kits at blobs
so it save ,rarity , type , and name , and itemstacks as a serlized string
my example was literally this
if they want to do it that way they can, there is nothing wrong in doing so
so in lobby for example it load them from the config file first to a map , and then i use this map to send the data to redis
i have that part working , the only part is the string for kit_serlizeiditem is not being send
as you can see
how long is it
oh is that so?
then how i can go about it to fix it?
have no idea, but ironically mysql can be used like redis though
might be longer depends on many things
just to point out that stuff already exists that works with many many examples and tutorials for it
Well first is to see If that's the issue dumb it down and send some arbitrary long sentence andd see I'd it cuts off
naah
I mean its quick and easy way to find out
i have a instanceCreator for the SkyWarsKit class
bcz iam using redis , gson must be used
how i can get free license for intellij idea xD?
its not free anymore
alr
Gross md_5 yeah no thanks that guy is a orange slime should we really be taking IDE advice from him
I mean they created spigot
But I am Core ||inventory related|| contributor to the spigot projedt and use VSCode and IntelliJ
Clearly i also have very high status
is Redisson better ?
but is it high enough
I must go higher
To core ||loser|| of the spigot project
lol
why are you so insistent on using redis?
I mean idk but redis works here but they clearly don't understand it well enough maybe using another tool Is genuinely a better solution
cuz i already have a ish working system , i dont want to recreate it again with diffrent systems
I could probably complete your project in an hour with mysql
i did had a mysql database system to store the kit , and load them but people here told me that its bad to store it in mysql
bcz i need to edit the kits in lobby
only
again not sure who these people are, and literally you would only need a single table and column....
I don't think their issue is reddis moreso the lack of understanding of reddis
You need to fuck with reddis more in a simplified setting
have no idea either way, just seems they been having this problem now for days and all I know is that it can easily be solved with mysql
its not like mysql is slow either, they could probably literally just be fine with mysql for everything they have right now
i think i will use mysql ๐ thanks guys
I mean I do get it that it sucks to switch to something else, but I mean not sure how much more time you want to put in trying to solve your problem lol
redis is cool and all, but just because its a flashy new thing on the street doesn't mean you actually need it or that its going to magically be better
in the past i were stuck with bug for entire week xD
got it
gonna use mongodb or mysql
mysql has memory only db engines as well, so it can be used similarly like redis
i think mysql can do the job
also, if you learn mysql well enough, you can even get mysql to do stuff for you before you even query for it ๐
but can i make it like this :
- load kits when lobby server start
- edit kits in lobby
- save edits
- check if the kits is edited in lobby
- load the new edited kits
time_stamp i think?
yeah, just have a timestamp get updated in the table when the kit blob is updated
set the other servers to check the DB every minute or so to see if the timestamp changed
thanks ๐ thats better
on lobby, anytime edits are done to the kits file, plugin uploads to DB
exactly
now everything gets the kits and stays updated and you only needed to edit a file on your part once the development is done
so makes it super easy
can i extends it even futher and make it so it work with all cosmetics?
they also have .yml file
don't see why not, all you are doing is storing binary of the file and retrieving the binary of the file
so file goes into DB, all other servers are fetching file from DB
yes exactly
no need to mess with strings or parse the file to give to the other servers
we just upload the whole thing and give it to all the servers XD
can you send a toturual on how to upload the whole file?
you would use a bytearray and do getBytes() on the file
and then you would just store it in the blob column
the bytes
and then on the other servers you are getting a byte array, and you just save that bytearray as the files
oky ๐ seems easy
since this is mysql
you could probably easily find tutorials on blobs and many of them
Anyone experienced in overwriting the entity metadata packet? My debug is correct so I'm assuming there's an oversight in writing the new nametag back?
output
[06:22:47] [Server thread/INFO]: [ OUTBOUND PACKET ]
[06:22:47] [Server thread/INFO]: To: SchoolTests
[06:22:47] [Server thread/INFO]: Type: ENTITY_METADATA
[06:22:47] [Server thread/INFO]: Entity Id: 1301
[06:22:47] [Server thread/INFO]: 1
[06:22:47] [Server thread/INFO]: 2
[06:22:47] [Server thread/INFO]: 3: {"text":"[LvL100]","extra":[{"text":" a giant rat","color":"dark_green"}],"italic":false,"color":"white"}
[06:22:47] [Server thread/INFO]: 4: {"text":"[LvL100]","extra":[{"text":" a giant rat","color":"green"}],"italic":false,"color":"green"}
- is your issue the nametag color not changing ?
- this seems redundant
yep that's just filler
I need to write the code that determines the level in place of 1
in the meantime I'm attempting to get the nametag to be set so I'm not worrying about that, unfortunately that's another headache but I have a solution I believe
And yes, the issue is the nametag color not changing
it just seems crazy to me how the json can say all green but it didn't change one bit; that means I'm writing it to the packet wrong or something is overriding it right?
is that the final boss? he looks pretty minimal to me 
haha this is just at the entryway of the dungeon, it's level 100 for testing purposes
there wont be a dungeon though if i cant get this to work D:
i tried to install intellij idea comunnity , it breaks everytime my entire project give red errors , i imported everything and reloaded maven
๐ฆ
Did you invalidate caches
what red error
yeah i got it working thanks
is it possible to use older versions of spigot on project
Yes
with maven
Set the spigot version to an older version in your pom
doesnt show up
i only see 1.20
what is bt
Bt is only required for nms
Intellij won't auto complete it unless you've used it before
Is there something wrong with this bit of code that would cause an error with beehives?
I should've used a paste site huh
that isn't cs wtf
Wow it worked thanks
oya ? is the API on some maven repo ?
what should i add to import this
you can use reflection instead importing it
What reflection
just realized not all methods are in this paste
https://paste.md-5.net/idayabayuh.java
I cant open buildtools
Yes
hey this is not how you register event ?
?maven
Aaah, guess I just forgot about that lmao
I've been always running BT 'cause I access nms from time to time
Use registerEvents
You forgot the s
bruuuh thx
(that's not how we name classes in Java, I would recommend following the naming conventions)
?conventions
Why cant i execute the jar
Is it on your desktop
ye
(If it is I recommend putting it in a folder)
didnt work again
Make sure it also has execute permissions.
Windows might have prevented it from executing.
so i was able to do this :
now how would i make a runnable for example that run every 1 minute (check if the cosmetics is time_stamp is diffrent) ?
Send output from dir
What dir
Get new BT and just run the UI if you can't get this to work ?
What tis UI
@blazing ocean what gui lib do you use
You just double click the jar, it opens up a window.
You can select version in there too.
I cant export craftbukkit
wdym
I've been told I am the load bearing ||beard|| of spigot
i do it but it only exports spigot 1.15.2
You mean NMS?
Idk what is it
How can I make my command be accessible to anyone on the server? WHich permisson do I have to use?
You donโt set one
commands:
suicide:
description: Take your own life ingame.
usage: /<command>
permission: *
Set the permission to be default: true
oh
Or just set it to not have one
Youโre talking about imports so I am assuming you have some sort of craftbukkit code?
nope it built
What is nms
. this is what they sent before
Net Minecraft Server
You need to use the spigot dependency instead of the spigot-api dependency if you want to access craftbukkit methods.
how do i do that
Change the dependency in your pom
whats the difference between it and api spiลgot
(Mojmap is 1.17+ iirc)
how do i add it
.
That's spigot-api, take a look at the artifactId
Yes
Should forcing BlockState.update be able to crash the server?
I'm assuming it's not, but just to be sure
What's the most efficient way to get nearby blocks around an entity? I want to place something on top of the blocks.
are you trying to find all blocks in a given radius?
Yes, basically.
one sec
most definitely a more efficient way of doing this but this is what I do, where spawnLocation is the player's location, and blocksInRadius is a list of locations. sphere and radius is just a param i have
int cx = spawnLocation.getBlockX();
int cy = spawnLocation.getBlockY();
int cz = spawnLocation.getBlockZ();
for (int x = cx - radius; x <= cx + radius; x++) {
for (int z = cz - radius; z <= cz + radius; z++) {
for (int y = (sphere ? cy - radius : cy); y <= (sphere ? cy + radius : cy + 1); y++) {
double dist =
(cx - x) * (cx - x) + (cz - z) * (cz - z) + (sphere ? (cy - y) * (cy - y) : 0);
if (dist < radius * radius) {
Location l = new Location(spawnLocation.getWorld(), x, y, z);
blocksInRadius.add(l);
}
}
}
}
Oh, okay. So you pre-calculate and then you only get the blocks at the specific coordinates.
That's nice.
yea, handy thing I found awhile ago and I use it quite often
Thank you for the tip!
np! im sure you'll be able to adjust it for what you need
When iterating why do you use the order X, Z, Y and not Z, Y X?
Wouldn't X, Y, Z result in better cache utilization?
ty
So true girl
I honestly haven't really put much thought into this, it probably would. Like I said, I'm sure there's a better way of doing it that's just the solution I've found.
Okay. Just asking in case there's some trick in there I'm not aware of.
Yea, nope not that I know of ๐
usually it doesnt matter, until it does
if you know what I mean
like for logic reasons or early returns
it has a hard dependency on paper so you need to fork it lol
likw if you are searching for something that tends to be low down, you would iteratoe over Y in the outer most loop
as it uses component titles
bruhhhhh
i don't blame them
they use paper/a custom paper fork internally
and they need component titles
do you have a fork
yes but not for spigot
fair enough makes sense lol
it's not hard to change it tho lol
cba
imagine using paper if all you need is component titles
^
most of the times im using it though, it's betwen 100-150 so I'm not too too worried and I don't use it that often
...
they use it for countless other reasons too
one of them being easy to fork
they shouldn't :frown:
except they do
yeah
they can do whatever they want
but I like my plugins to be as widely accessible as possible
and they don't have to listen to what a person on the internet says
no need if you're making a server
yeah i was talking about them
yeah I already said that
anyways im just meming ๐
and I am jealous that paper has that one specific feature
why is g*tb*kkit still a thing like they are straight up distributing spigot jars and have been doing so for years
It's more up to Mojang to do something about it
their footer is partly broken, and the API link is the same as the pricing link (why tf do theyeven have a pricing??)
Yell at choco
This is what I tried first, not called when a falling block lands.
how i can make a runnable that check the last_updated from the cached data -> to the mysql one?
and see if the they are not the same , if so update the cached one
or how would it work?
if for exmaple i edit a kit , how would i make it so it update the time_stamp too , and when that happend a runnable will be running that check if the time_stamp is diffrent , if so update local cache
is there a way to remove the last entry (first one inserted) from a linkedhashmap? i may have repeating keys and values aswell
?ask
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!
/give @p book[tool={default_mining_speed:1,damage_per_block:0,rules:[{blocks:"minecraft:granite",speed:6,correct_for_drops:false}]},minecraft:custom_name=speed_6]
For example this command will give you a book which can break the Stone at the exact same speed of an Iron Pickaxe
So it should be the same as
CraftToolComponent toolComponent = ...
toolComponent.setDefaultMiningSpeed(1);
toolComponent.setDamagePerBlock(0);
toolComponent.getRules().clear();
float ironSpeed = 6F;
toolComponent.addRule(blockDurability.getMaterial(), ironSpeed, true);
But it's appear that this code snipped give an "infinite" mining speed
I oneshot every stones (same with other block rules...)
But with my book give command, it's not
?jira
Improper cleanup of chunk at (-1, -1). Reusing NMS chunk
What might cause this warning?
is there a known bug around setting mobs to be invulnerable in 1.21?
it doesnt work when ur in creative
i thought it was a bug too
Hello Guys is there anything like an MinecartDerailEvent?
killfeed_message:
- "1"
- "2"
- "3"
- "4"
- "5"
- "6"
how would i turn this list into a list of strings? or is there a better way of handling it?
the amount of strings in this list is unknown and could be from 1-15
its in a .yml file
config.getList()?
getStringList?
wiat that's a thing?
Yes
declaration: package: org.bukkit.configuration, interface: ConfigurationSection
is there anything like an MinecartDerailEvent?
No I don't think so
yeah thats what i was looking for thanks
how is it that in my IDE the class shows up fine with no problem but on servers it does this
intellij is using the same jar made by buildtools as im using on the server
Not that part
You're either not building with maven or missing the special source plugin
oh you mean this
That's the dependency
got specialsource too
And how are you building
like the run command?
mvn clean install -P remapped -T 1C -DskipTests -P exportToServer
ill see if that changes anything
(it didnt)
ill try that later i gotta make dinner
thank you for helping out though i really appreciate it
if i want to get the current time stamp
Timestamp.from(Instant.ofEpochSecond(System.currentTimeMillis()))
how i can do that?
bruh what
"get the current timestamp" in what form?
Instant.now()
System.currentTimeMillis()
new Date()
LocalDateTime.now()
?
what do you want to do with it
tf is this
genuinely wtf
i have a custom recipe, and it suppose to craft only with nuggets that are "diamond", but it can craft core with gold nuggets, what should i do?
public class CoreRecipe extends ShapelessRecipe {
public CoreRecipe(@NotNull NamespacedKey key) {
super(key, Items.getDiamondOreCore(1));
addIngredient(new RecipeChoice.ExactChoice(Items.getDiamondOreNugget(1)));
addIngredient(new RecipeChoice.ExactChoice(Items.getDiamondOreNugget(1)));
}
}
private static final Material diore_nugget_material = Material.GOLD_NUGGET;
private static final Material diore_core_material = Material.BUBBLE_CORAL_BLOCK;
private static final NamespacedKey diore_items_key = new NamespacedKey(Diore.getInstance(), "diore_items_key");
public static ItemStack getDiamondOreNugget(int amount) {
ItemStack item = new ItemStack(diore_nugget_material, amount);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName("Diamond Ore Nugget");
meta.setLore(List.of("A 1/10 of a diamond ore."));
meta.getPersistentDataContainer().set(diore_items_key, PersistentDataType.STRING, "diore_nugget");
item.setItemMeta(meta);
return item;
}
public static ItemStack getDiamondOreCore(int amount) {
ItemStack item = new ItemStack(diore_core_material, amount);
ItemMeta meta = item.getItemMeta();
meta.setDisplayName("Diamond Ore Core");
meta.setLore(List.of("A 2/10 of a diamond ore."));
meta.getPersistentDataContainer().set(diore_items_key, PersistentDataType.STRING, "diore_core");
item.setItemMeta(meta);
return item;
}
the items are in different class, i just not copy all class
?codeblock
You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
Becomes:
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
}
}```
we stopped doing naming conventions?
is there any way to write to a .txt file without overwriting it?
public void log(String text) {
try {
BufferedWriter writer = new BufferedWriter(new FileWriter(cache_file));
writer.write(text+"\n");
writer.close();
} catch (IOException e) {
}
}
this is what im using but it just overwrites the file and deletes everything that was written before it
?paste for large code walls btw
no one wants to see the entire channel be filled with a singular message
i want to add on to the content thats already in the file
Hey, i am trying to store a list in mysql but not sure if I'm doing this right...
Could someone tell me?
I think some writing classes have an append method
same result
huh
just the TimeStamp of now (the current moment of speaking.)
yeah unfortunately this did not change anything
Files.newBufferedWriter(path, StandardOpenOptions.APPEND) ig
to the Writer? yes, but Files.newBufferedReader uses more efficient methods of writing
wdym
its also considered more modern api
Hi there. Can you please help me?
[19:15:02 ERROR]: Could not pass event AsyncPlayerChatEvent to Identity v1.8.2
java.util.UnknownFormatConversionException: Conversion = 'p'
Error line:
event.setFormat(
this.getFormat(
source,
event.getMessage()
)
);
wats the format
idk where else to ask this; if I have a hard dependency on some other plugin (in this case packetveents) can I put a link to that plugins page on my plugins page?
yeah you better do that
otherwise users gonna download yo plugin and not know wtf is wrong and why it's not starting up
yeah okay I thought maybe its not allowed to link to other plugins or smth
don't extend/implement API types that aren't specifically documented as allowing that.
ShapelessRecipe doesn't work with ExactChoice RecipeChoice on spigot
oh thank you, it contained %%
Could you send your entire pom
?paste
wym
If my raycast target is Material.AIR, would the raycast return null?
Or should I raycast the block below which is not air?
Is there any way to detect that the offhand switch was clicked, even without any items to switch?
Try and see
What is "Generation" in BookMeta?
?tryitandsee
?try
?tryi
?tryit
omfg
You good vodoo
You were clearly leading by example lmao
I've been looking at javap dumps for the past 3 months
Ahh, thank you
I have went insane
fr
Can anyone tell me which placeholder I should use to open my delux menu gui with command/tpa
Sounds like a question for #help-server ?
I tried it first, of course, before asking. But it was inconclusive.
But thank you for that pearl of wisdom.
im gonna ask in case anyone knows, but I'm getting the following error consistently only with 1.21. My project has several modules, one core and a bunch of version-specific ones for nms. The pom.xml for the 1.21 module is consistent with the others (of course, with a different version)
would anyone know possible reasons as to why this could be happening
Makes sense
both, with mojang mappings
Im a noob at programming, how do I compile plugin code into a jar file?
What IDE are you using?
IntelJidea
are you using maven build system?
yes
I recommend you get the Minecraft Development plugin.
It simplifies things.
ok
if it provides any more info, decompiling the 1.21 jar shows that the class ServerGamePacketListenerImpl indeed doesn't exist. how come it's there during compile time but not during runtime?
alternatively, how can i get a player's netty Channel in 1.21
that is the mojang name, at runtime spigot will use spigot's names
?mappings
Compare different mappings with this website: https://mappings.cephx.dev
i think i get that but then why does it work fine for non 1.21 and suddenly breaks with 1.21
it only goes down to 1.12
i need 1.8
is there a way to add it
Too old! (Click the link to get the exact time)
Let me start by saying that I don't need codes, I just want to understand how to do what I'm trying to do (also because it's the first time I've done something like this)
I'm trying to create some kind of generator plugin though with armorstands. so I created an interface:
public interface ArmorStandInterface {
ItemStack generateItem(ArmorStand armorStand, int level);
Player getOwner();
int getLevel();
int getGenerationSpeed();
}
and the class:
@Override
public ItemStack generateItem(org.bukkit.entity.ArmorStand armorStand, int level) {
Material material = switch (level) {
case 2 -> Material.COAL;
case 3 -> Material.COAL_BLOCK;
case 4 -> Material.IRON_INGOT;
default -> Material.COBBLESTONE;
};
return new ItemStack(material);
}
now I would like to understand how to set the owner (then I manage it) and the generation speed (I have already understood how to do the level). Above all, also how to actually generate these items. For the level I used a pdc.
Iโm not sure that I understand what you wanna do, can you give a little bit more detailed description of the functionality?
Basically I'm creating a plugin that generates money (vault api) to the player who placed them through placed armor stands. These armor stands can be improved up to a certain level. Each level has stats, example:
level 1:
0.5 $ /s
if an armor stand is broken by another player, the owner of the armor stand loses half of his balance and the player who broke it gets the armor stand and half of the owner's balance (but these are secondary things)
Now I'm trying with mineral generation
I saw that you are on the minecraft italia server, if you are Italian, write to me privately so we can speak in Italian
does anybody know how to nest nbt CompoundTags within CompoundTags, there seems to be no method to do so
and i believe nesting is a core thing supported by the format
Forza Napoli
just tag.put("foo", otherTag)?
i'm truly special
i'm actually an idiot
how did i read the src like 5 times and miss that method
Happens
On the premium resource guidelines, it says resources with โGamblingโ is prohibited, Iโm curious to know exactly what this refers to, and if any staff can PM me so I can verify that my plugin idea is okay๐
: the practice or activity of betting : the practice of risking money or other stakes in a game or bet
basically dont add a crates system with bs rigged rates
does that mean you can make it not rigged but very clear instructions to make it rigged
If you win all the times you play, even if you win a block of dirt, is not gambling because you can't lose
And it also applies to ingame currency?
"If you win all the times you play the lottery, even if its just 1 cent, its not gambling because you can't lose"
Yes, you pay for the experience
that is still gambling
Lottery would fall into gambling then, no?
uh anyway idk if in game currency would count assuming the only way to earn the currency is in game
gamble on who wins
i would assume that'd be fine
Scratch off tickets? Gambling?
It depends what rules you are going by to define it. In the US anytime real world money is involved it is considered gambling
Also to note gambling like lottery has a lower age limit then say playing slots as well
Theoretically if you can't win money isn't gambling
Theoretically
However in the US that isnt what defined gambling though. But defines what age limits must be set lol
So kids games where winning is more on the skill of the player is gambling but is allowed for kids
So like ring tosses on bottles for example
Basically its about how much skill vs luck is involved
The more skill involved the less its gambling or the more ok it is for younger people lol
So the original Mario Party wasnโt gambling but the later versions areโฆ
Couldnt say never played them
But it depends whose rules we go by lol. US is what i know but other countries have more strict rules on it
does anyone here know how i can make a craftbukkit plugin for beta 1.7.3 (CB1060)? i cant find much
solved it lol, couldn't find a CB 1060 api jar but i have one now
I know RecipeChoice.ExactChoice doesn't work for shapeless recipes, but I was wondering is there any reason it's limited to only shaped crafting recipes? I tried searching past forum posts and discord messages but couldn't find a reason.
It just isn't implemented because the code required isn't straight forward. Feel free to implement and pull request though!
How would I name an inventory with component msgs
as in adventure lib support <red> and stuff
The Menu i think (That by then I can "edit" a block)
Hi, Configuration phase is an event? I don't find it in spigot api
What do you mean?
I'v heard about a new thing by mojang called "Configuration phase" which would put the client in wait
?xy
iam trying to learn on using gradle how i can fix this?
add the mavenCentral() repository
Is there a event that triggers when a item gets added to your inventory?
Dies anyone know how to compile plugins the right way?
Want to compile https://github.com/Imprex-Development/orebfuscator
Then do that?
Also add mavenLocal and find a 3rd party plugin for remapping
Why do you need to compile it?
It already has a release build
Need the 1.21 PR thatโs approved but not merged yet
Oh well start by cloning the 1.21 branch
Then build every Spigot version from 1.16 and above using BuildTools
Oh didnโt know about BuildTools
Then use the mvn package command to build
Aight will look into it, Ty!
You might need the --remapped flag for versions above 1.17
BuildTools is the only official way of getting Spigot
I see
Also it's not quite every version from 1.16
I just don't remember which ones you can skip
1.20 eg compiles 1.20.1
You can take a look in the project and see what it uses
1.20 -> 1.20.1
1.20.3 -> 1.20.4
1.20.5 -> 1.20.6 iirc
Yeah usually those versions that got updated within a day
Which of these would you guys categorize as โgamblingโ and not be allowed as a spigot plugin?
- Raffle - lottery system, winner takes it all.
- Scratch-off tickets with instant win, configurable prizes
- Slot machines, configurable symbols and payouts
- Blackjack, configurable payouts
- Wheel of Fortune, configurable rewards
- Lucky Blocks, you mine a block to win configurable rewards
- Coinflip
- Higher or Lower
?nms
Is there a way to create a recipe that accepts ingredient that doesn't exactly match some item but contains some tags, for example:
Ingredient: {Count:1, id:"minecraft:apple", tags:{type:"huh"}}
Item with such nbt should work: {Count:1, id:"minecraft:apple", tags:{type:"huh"}}
But item with such nbt should also work: {Count:1, id:"minecraft:apple", tags:{type:"huh", something:123}}
You need to listen to events
Well it really depends on what you are doing. If it's real money then ofc this isn't really appropriate
Do I need to do something special when raycasting? I seem to be missing my target by 1-2 blocks.
var raycastStart = headLocation.getBlock().getLocation().add(0.5, 0.5, 0.5);
var adjustedRandomBlockLocation = randomBlock.getLocation().add(0.5, 0.5, 0.5);
var raycastDirection = adjustedRandomBlockLocation.toVector().subtract(raycastStart.toVector()).normalize();
var rayTrace = world.rayTrace(raycastStart, raycastDirection, maxRaycastDistance, FluidCollisionMode.NEVER, true, 0, filterPredicateForRaycast);
What's with the random 0.5?
I should drop that?
Why'd you add it?
Also what's head location?
Also, it seem |- in spigot.yml isn't working anymore after 1.21 update.
Not working for what
Defeats the point doesn't it?
I attempted to create predicate which would check against the location.
But I'm not sure if it's skipped altogether because it's air.
How do I read this?
with your eyes
what if i wanna use my ears
depends what ur looking for.
surely you can use a narator somehow im sure!
If you are in a bad mood, please leave the chat
I wanted to know what I can get from this print
this is a public discord server
@sleek estuary Have you tried asking the plugin author?
well why dont you ask that then?
Exactly. I'm not bad, he seems that way.
Im the plugin author
๐
not sure what good or evil has to do with anything, my point is asking people to leave the chat makes no sense when its a public server
you can see how much time your plugin takes in a tick. and the average or it.
They sent me this print and they say it's lagging, but I don't know what it means because I don't know how to read timings.
if they open the dropdown you can see exactly whats taking a long time
ask them to send you the whole report.
this pretty much tells nothing without the full timings. 200ms might seem like a lot, but in the grand scheme of things it really isn't
Maybe it's the database access
are you doing DB accesses from the main thread?
Maybe he uses it on a separate server
Well... the combined total is how long everything is taking, together.
There's count 3, so you've got 3 things in there being counted in the total.
Then it's taking 0% of your tick time, so it's smaller than can be recorded.
Then there's average value where the issue is showing up, the cumulative time is 197 ms - and the rest of the values are nonsense, honestly.
Those values are not really going to help you much.
I wouldn't be concerned about it then. Odds are they don't know how to properly diagnose a plugin causing lag
Hey! So when a player connects to the backend server of a BungeeCord network, I want to send a custom Handshake packet. How can I do that?
they just see the color red and go oh that must be bad
yea.. exactly
mc server owners are bulls
Ok. thank you
what's the alternative for Material.LEGACY_BOOK_AND_QUILL
declaration: package: org.bukkit, enum: Material
thanks
.
Huh why
It's a proxy
I know what it is.
Sure we have the transfer packet now
i want to maintain some old code which is hard to migrate over to velocity( i dont know velocity api) thats why
But that hasn't always existed
Uh if you're porting to velocity maybe ask in the Paper discord
Ah
also
where did InitialHandler moved to? it is not in the net.md_5.bungee.connection package?
The raycasts are still hitting one off.
On either x or z axis.
Weirdly only stuff in in the upper right quadrant is being hit correctly.
Any ideas what I'm doing wrong?
(Relating particularly to the raycast)
[13:59:52] [Server thread/INFO]: No line of sight. Hit a block: WHITE_WOOL at Location{world=CraftWorld{name=Kuumaa},x=0.0,y=126.0,z=108.0,pitch=0.0,yaw=0.0} while trying to reach location Location{world=CraftWorld{name=Kuumaa},x=-1.0,y=126.0,z=109.0,pitch=0.0,yaw=0.0}.
Here's one round of raycast attempts. Was trying to hit green blocks, hit red instead.
Yeah of course, This would strictly be in-game money
iโd love to know if thatโd be allowed to know if itโs worth pursuing
they are all gambling by definition but idk what the rules are with in game money
yeah, thatโs the thing, i wanna know if itโs still prohibited as a concept, or if itโs exempted considering itโs ingame money
โResources containing the following themes will be rejected.
Gambling
Drugs
Guns, weapons, or similarโ
thats for premium resources
do you want to make a premium resource
?
in any case your idea fall under gambling
but if you are unsure contact a lawyer xD
Hitting something with a raycast seems really hard. 80% seems to just miss.
If I increase/lower on Y-axis it just overshoots or hits the wrong block by undershooting.
My BuildTools are failing saying I don't have git installed while I have it. Anyone had this issue before and can help me?
*** Please note that this is a beta feature, so if it does not work please also try a manual install of git from https://git-for-windows.github.io/ ***
Could not successfully run git. Please ensure it is installed and functioning. Error running command, return status !=0: [C:\Windows\system32\cmd.exe, /D, /C, git, --version]
Hey, which event will be fired when the client connect BungeeCord proxy server?
Currently I'm using ServerConnectedEvent but this probably pointing to the backend Spigot server.
I wish to handle client before he will join backend.
Try running buildtools in a subdirectory e.g Desktop/Buildtools or Documents/BTGUI as dir name examples
its in Downloads
@kind hatch I still don't understand why this happens
yeah that was the plan
Ok wtf I just moved it to Documents anyway and now it works
after downloading it and starting it for the first time, it worked but I cancelled it to look something up then it stopped working
okay then I think its not allowed, but like epic said you can try mailing support to know for sure
in game money is fine at first, until some server owner uses your plugin combined with another to turn real money into virtual money
can anyone recommend a good scoreboard library
fastboard
packetevents ๐คก
md5Boards

โ ๐ฌ
anybody have a guide on text displays and display entities?
what do you want to know about them
how i rotate the head
what the fuckkk ๐ญ
LMAOO
Is there a quicker way for BuildTools to compile all versions from one specific one (in my case 1.17.1) up to the latest than letting it compile one by one?
Just delete support for the versions you don't need
in the pom.xml?
Yeah
how i rotate?
idk why you pinging mme
idk where exactly, in the properties tag?
Oreobfuscator got this there https://pastebin.com/e7Uen8ey
holy shit
Probably a modules section
<module>orebfuscator-api</module>
<module>orebfuscator-api-example</module>
<module>orebfuscator-common</module>
<module>orebfuscator-compatibility</module>
<module>orebfuscator-nms</module>
<module>orebfuscator-plugin</module>
</modules>```
I see
gotta look at them directories
Probably in the nms directory pom
yup
you ping me bro
ok
how i rotate the head
bro show the code
use display entities
1.8
hes on 1.8
update
fix the axis and pitch
the hoe is forward and the head is turned the other way around. does this solve the problem?
its visible
So the problem is the hoe and not the head?
youre changing the headpose
here
thats why jts upside down
and the hoe is just like that on small armorsyands
I want head to look at the plantation
what kind of thing is that?
scarecrow?
ah child labor, thats what the party loves
Erm actually ๐ค
the children yern for the mines
see, + 20 social credit already
-1000 social credit
those clouds look like windows 7
erm akshually ๐คโ๏ธcustom models
๐ ?
theyre ass
๐
you can literally do almost everything with them
you have full control over everything and even animations
Returning true in Predicate for raycast does not stop the raycast?
I'm getting rays passing through walls.
Need this plugin brother
Can i spawn a mob with packets and give it mob ai?
obligatory why are you using internals here
@sleek estuary
i get this error by loading Protocolib
i using Protocolib 5.1.0 in the mc version 1.20.4
[14:40:08] [Server thread/ERROR]: [ProtocolLib] INTERNAL ERROR: Cannot load ProtocolLib.
If this problem hasn't already been reported, please open a ticket
at https://github.com/dmulloy2/ProtocolLib/issues with the following data:
Stack Trace:
java.lang.IllegalArgumentException: Unable to find a field that matches {modifiers=[required: 10000, banned: 1000], type={ type input instanceof interface java.util.Map }}
at com.comphenix.protocol.reflect.FuzzyReflection.getField(FuzzyReflection.java:352)
at com.comphenix.protocol.injector.packet.PacketRegistry.createNewRegister(PacketRegistry.java:188)
at com.comphenix.protocol.injector.packet.PacketRegistry.initialize(PacketRegistry.java:292)
at com.comphenix.protocol.injector.packet.PacketRegistry.getClientPacketTypes(PacketRegistry.java:327)
at com.comphenix.protocol.injector.PacketFilterManager.<init>(PacketFilterManager.java:120)
at com.comphenix.protocol.injector.PacketFilterBuilder.build(PacketFilterBuilder.java:121)
at com.comphenix.protocol.ProtocolLib.onLoad(ProtocolLib.java:183)
at org.bukkit.craftbukkit.v1_20_R3.CraftServer.loadPlugins(CraftServer.java:433)
at net.minecraft.server.dedicated.DedicatedServer.e(DedicatedServer.java:217)
at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:979)
at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:296)
at java.base/java.lang.Thread.run(Thread.java:1583)
@midnight vector ??
? @blazing ocean
why are you โ ๏ธ reacting me
Xd?
whar
i think i need for the 1.20.4 the version 5.2.0 but i cant find the maven repository for it
https://mvnrepository.com/artifact/com.github.dmulloy2/ProtocolLib/5.2.0
why i can't use the 5.2.0
<repositories>
<repository>
<id>papermc-repo</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
<repository>
<id>sonatype</id>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
<repository>
<id>dmulloy2-repo</id>
<url>https://repo.dmulloy2.net/repository/public/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.dmulloy2</groupId>
<artifactId>ProtocolLib</artifactId>
<version>5.2.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>1.20.4-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>
?whereami
I am doing a menu where player can put item but there is only one slot reserved and I am pretty stuck here. I tried listening for move items using InventoryClickEvent but this only works when the item is picked and not moved so If someone has some idea or better some code that I can inspire by that would be fantastic.
Here is how should the menu work: (green lines are u can move the item there and red lines opposite)
Ok so I just compiled the 1.21 Pull request of orebfuscator but the commands sadly dont work, anyone maybe knows why?
This is the error in the server console after trying to execute
https://pastebin.com/iV4p3AYc
?fork
SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.
I see, sorry
?paste
hey i got this, iamge.png exist but i got this error :
someone has an idea why this don't work
you can load a CachedServerIcon using Server#loadServierIcon and pass the icon
like this?
Also useful adventure tip, Component.text("text").color(color) can be written as Component.text("text", color)
Yea
or just text() (import static my beloved)
idk why but when i name server-icon.png, it work but with my code, it didn't work....
hm?
I mean, you need to pass the returned instance from loadServerIcon to the event setter
uh?
i don't put the loadServerIcon in the onEnable? x)
you do
but you need to store the returned value
and then event.setServerIcon(theVariableYouStoredTheCachedServerIconInOnEnableIn)
great variable name
i wanted to change skin to the player with CraftPlayer but i can't find the class, any suggestions on how to change the player's skin
If I create a plugin based on EventListener, does it mean every instance of an object will be created separately for each 'n' request?
Or is singleton
wha-
Intercept the packet
dunno what an EventListener is, i only know Listener
if youre gonna register listeners, you gotta provide an instance yourself
yeah Listener
i'm new to plugin development, wdym?
if we have 2 players doing stuff, will the plugin create only one instance of the Listener or two separately?
@drowsy helm i installed buildtools
I wish to store the player UUID in the Listener so it will be an array or a single object, I need to pass the UUID to another event and check it.
im assuming you want to handle multiple players
yeah but base on this information how many instances will be created?
it will be a singleton, transient, or session?
i wouldnโt recommend working with packets when youโre new to it but if you do use something like packetevents or protocollib
thereโs tons of docs are forums explaining how to use them and add packetlisteners, etc
i just want to import CraftPlayer from org.bukkit.craftbukkit, how i'm searching from hours
show me your spigot dependency
make sure the artifactId is spigot and not spigot-api
<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.21-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.mojang</groupId>
<artifactId>authlib</artifactId>
<version>3.17.30</version>
<scope>provided</scope>
</dependency>
</dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.21-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
You need to build the version using buildtools
ye but what path do i select, sorry im not expert
or you could use paper
๐
Hi, there's a guy who keeps deleting his review and re-post it when I answer on his review. It's the third time in 2 days he does that. Is there anything I can do ?
Hello, so I made a ClickAble Message using TextComponents and I wonder why they wont translate HexColors.
Here is the Code:
List<String> messages = msg.getStringList("tpahere.sent-target-messages");
for (String message : messages) {
TextComponent textComponent = new TextComponent(ColorUtils.format(message.replace("%player%", requester.getName())));
textComponent.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/tpaccept " + requester.getName()));
target.spigot().sendMessage(textComponent);
}
Does anyone have like a colorizer for TextComponents where I can use Hex and ChatColor?
Report them ig
will only be created once
well, now im setting result on prepareitemcraftevent if it matches some of my recipes, but when player takes the result with mouse click the next thing happens for every item in the matrix:
stack.amount = (stack.amount - 1) * 2
how do i fix this?
I noticed that you get slowdown from cobweb way before you can detect you're in it.
Is there any convenient way to detect it more precisely?
Yes, of course. But the effect starts before the block at the player is the cobweb.
Without checking the neighboring blocks?
You are, but not enough for it to be the block at player.
you need to use the players trajectory
Trajectory? Well that's just interesting.
Tell me more about this "trajectory" ๐ค
It's on Player is it?
well unless they suddenly stop, using their velocity vector you should know if they are going to hit cobwebs, even more so if you know how large cobwebs are
Or does it come from PlayerMoveEvent?
not really
but bounding box depending how its implemented only lets you know if something is or is not inside the box
technically you should know all coords of the box as long as you know the two opposing corners coords
Well, I mean. I still would have to compare the collision box with something.
And I only have the to and from.
And it's neither.
Or what would I compare it against?
I wouldn't do any looping, but if you know what is ahead of the player in the direction of their travel and you have their velocity vector you should know when they will hit cobwebs if any
its just a matter of how far ahead do you really want to detect it
@wet breachMy friend, do you mean that there's an actual thing called movement trajectory or some such or do you mean I should get the direction vector of the player and check the next block in that direction?
all entities that can move have velocities
Right.
basic algebra will get you by with the whole velocity thing with distance over time given speed
toBlockVector?
velocity gives you direction and speed, now its just a matter of time and then you have distance
the more time you want to be warned or know of something the further the distance
the distance ends up being further if they are traveling faster as well
12 blocks every so often as they move
and that is just one player
if you know how far out you need to check, you don't really need to loop
you can just check the blocks within a 2x2 grid
Yes
a player is only 2 blocks high?
So, um something like...
public void checkForCobwebs(Player player, double distance) {
// Get the player's velocity vector and normalize it to get the unit vector
Vector unitVector = player.getVelocity().normalize();
// Multiply the unit vector by the distance to get the prediction vector
Vector predictionVector = unitVector.multiply(distance);
// Add the prediction vector to the player's current location to get the predicted location
Location predictedLocation = player.getLocation().add(predictionVector);
// Check if the block at the predicted location is a cobweb
if (predictedLocation.getBlock().getType() == Material.COBWEB) {
// The player is predicted to hit a cobweb
System.out.println("Player is predicted to hit a cobweb");
} else {
// The player is not predicted to hit a cobweb
System.out.println("Player is not predicted to hit a cobweb");
}
}
๐ค
?
i've started to hate visitor design patterns
they couple your interfaces with concrete classes or subinterfaces
imo java 21 switch expressions is better
what do you guys think?
static String formatterPatternSwitch(Object obj) {
return switch (obj) {
case Integer i -> String.format("int %d", i);
case Long l -> String.format("long %d", l);
case Double d -> String.format("double %f", d);
case String s -> String.format("String %s", s);
default -> obj.toString();
};
}
in java 21 you can do smth like this
you mean if they jump?
kotlin's when is better
you would still know their trajectory
you could spread the grid to be 4x4
but that doesn't change the players height
i prefer "int %d".formatted(i) tho
return when(obj) {
is Int -> "int $obj"
is Long -> "long $obj"
is Double -> "double $obj"
is String -> "String $obj"
else -> obj.toString()
}
but for real im wrong or what, if i lets say design visitor interface, and another wants to modify my code, he cant just simply create new class extending previous one that's visited, because if he wants to add visitor functionality too, it wouldnt work since in the original interface passed there will not have specific concrete type he created, right?
idk what you are asking
give a code example
with Visitor interface, you need to define concrete types
right
or concrete interfaces you're gonna use right
what if i want to expand visitor itself
i cant externally unless i modify the code
well, interfaces do require you to implement what is in them but you can also extend them which is kind of their purpose
interface OtherVisitor implements Visitor?
not sure why they would need to modify your interface to extend the interface
what would be required is that something has to implement the extended interface
but wouldnt the visited class would downcast the extended visitor
generic time?
I know there's player.isBlocking() but is there a way to get shield break and lower events?
what is this
Guilds
damn never see nthat
I don't know where to say it but CreativeCategory are not updated with the new creative inventory
do someone know where I can report this ?
could someone help me over at help-server please?
A cat :)
is setSeeThrough for the text display for the background specifically?
Categories are client side now
Is there an nms packet to hook for shield break/lower events?
all of it
is there a setting in these that will make them render in front of entities even if they're behind them?
How can I set-up a bungeecord proxy on my pc for testing?
I mean like someone hits it with an axe and disables the shield
Same way as always
There is no difference
Well you can check if it's disabled
Presumably doing so with a 1 tick delay in the damage event would catch everything
Grab the Bungeecord jar run it and configure it
I guess could check if shield is on cooldown. What about stop blocking? Cuz I know there's isBlocking() but do I just do a looping check for when they stop blocking or is there an easier way?
interface Buzz {
void accept(Visitor visitor);
}
interface Visitor {
visit(Foo foo);
visit(Bar bar);
}
What i dont like about this is that due to how visitor accept() is being included into lets say Buzz class it couples all the Buzz implementations with the types inside Visitor class
A cat that pooped a flower
you're explicitly defining concrete types that would need to exist on the interface
Or maybe a while loop that checks it?
You could have a timer that runs each tick and fires your own custom shield start blocking and shield stop blocking events
now if i lets say implement Buzz i need to be sure to implement Foo and Bar as well because interface is coupled with them
hi so finally i finished Kits , now i need to work on cosmetics same system but only change name , rarity , other stuff it does not have an itemstacks
but the problem is
BukkitRunnable or a BukkitTask?
each Cosmetic have an abstract for example :
-> Cosmetic abstract -> WinEffect abstract class -> DragonDance implement WinEffect
etc etc and i want each Win Effect to have some configuration file that can have :
- name
- rarity
- type
Just use UberItems ^?
i will need to do :
new DragonDance .. new WithchHunt for example ...
etc
lik i need to create a new class instance for every new win Effect is there a better way?
A win effect class that has a method in it for the win effect
You can extend / implement it no?
YES AND I DID
see i have 5 diffrent win effects classes
i need to do new Anvill ... new Astro .. new BlackHole ..
how i can make them confiurable?
it will be like this inside the cosmetics.yml file
Useful as always
cosmetics:
AnvilRain:
name: &EAnvilRain
type: WinEffect
game_mode: SOLO
game_type: NORMAL
..etc
Read the docs and you have your answer
i was thinking about adding a abstract method to load it from config directly
like so .. but add config
Bad questions get bad answers it's really that simple
You can have it read the config and just have one class that does something like
private getCosName(String thing) {
Config.getString("cosmetics."+ thing + ". name");
}
howdy, so I'm coding a plugin that sends players to different spawns based on their team and stuff(see snippet: https://imgur.com/B2OueGU)
and for some reason, it changes their spawn location upon respawn event, but it doesn't send them there, can anyone tell me why?
?paste
yes as i thought
Try avoiding sending text as images
something like this might work no?
and i only need to do load
and set the config
instance
public static void setExists(String itemName, boolean exists) {
String key = "items." + itemName + ".exists";
plugin.getConfig().set(key, exists);
plugin.saveConfig();
}
This is something from my plugin
yeah thanks
That's a set but you can reverse it for whatever
lemme update it rq
return plugin.getConfig().getString(key);
This would give you the key
what if i would need 2 Astrount configg , one solo , one double
static FileConfiguration config = CUU.getInstance().getConfig();
For config thingy
You could either name them differently in config
Or
Do something like
in my opinion, the effect should only get the specific ConfigurationSection that it needs (as a field or whatver)
nvm i found ze bug
Cosmetic:
Astronaut:
Solo:
Name: blah blah blah
...
Duo:
Name:...
yea ๐
Make sure to do tabs correctly
or maybe do , cosmetics:
cosmetics:
NORMAL:
astrutntutnt..
name: testest
You could do that
would you recommend against storing data to the playerinfo file, and on join/leave/plugin disable saving/retrieving that to/from my database? should work fine, no?
Id do whatever is going to be the same then a
Solo:
Color: red
Duo:
Color: blue
Kinda thing
them being call guilds confuses me because i think of servers as guilds from jda
^
I think they were called clans at first?
you cant just extend the visitor interface
it wouldnt resolve the overloaded method with double dispatch
class ConcreteElementC implements Element {
@Override
public void accept(Visitor visitor) {
if (visitor instanceof ExtendedVisitor) {
((ExtendedVisitor) visitor).visit(this);
}
}
}
if you want to extend visitor you need to do this mess