#help-development

1 messages ยท Page 1041 of 1

tardy delta
#

lol

pseudo hazel
#

that is also a database?

twin venture
#

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?

river oracle
#

Why is it hard to save itemstacks

#

This seems like a skill issue ngl

wet breach
#

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

river oracle
#

Why are we even insistent on saving items as strings

twin venture
pseudo hazel
#

the kit system

river oracle
twin venture
#

so it save ,rarity , type , and name , and itemstacks as a serlized string

wet breach
#

if they want to do it that way they can, there is nothing wrong in doing so

twin venture
#

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

pseudo hazel
#

how long is it

wet breach
#

jk lol

river oracle
#

Might exceed whatever data type limit redis uses maybe

#

It looks like it's cut off

twin venture
#

then how i can go about it to fix it?

wet breach
#

have no idea, but ironically mysql can be used like redis though

twin venture
wet breach
#

just to point out that stuff already exists that works with many many examples and tutorials for it

river oracle
wet breach
#

create a loop that keeps adding characters

#

XD

twin venture
wet breach
#

I mean its quick and easy way to find out

river oracle
#

It's literally as valid as my suggestion

#

Just easier

twin venture
#

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

river oracle
#

There is a community license

#

Use IntelliJ Community

twin venture
#

alr

wet breach
#

or use Netbeans

#

the creator of spigot and myself use netbeans ๐Ÿ™‚

twin venture
#

it should send the entire content

#

but its not

river oracle
river oracle
#

But I am Core ||inventory related|| contributor to the spigot projedt and use VSCode and IntelliJ

#

Clearly i also have very high status

twin venture
#

is Redisson better ?

wet breach
river oracle
#

To core ||loser|| of the spigot project

wet breach
#

lol

wet breach
river oracle
twin venture
wet breach
#

I could probably complete your project in an hour with mysql

twin venture
#

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

wet breach
river oracle
twin venture
#

and apply the edits to all servers

#

mysql can do that easly .. ๐Ÿ™‚

river oracle
wet breach
#

its not like mysql is slow either, they could probably literally just be fine with mysql for everything they have right now

twin venture
wet breach
#

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

twin venture
#

in the past i were stuck with bug for entire week xD

#

got it

#

gonna use mongodb or mysql

wet breach
#

mysql has memory only db engines as well, so it can be used similarly like redis

twin venture
#

i think mysql can do the job

wet breach
#

also, if you learn mysql well enough, you can even get mysql to do stuff for you before you even query for it ๐Ÿ˜›

twin venture
#

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?

wet breach
#

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

twin venture
#

thanks ๐Ÿ™‚ thats better

wet breach
#

on lobby, anytime edits are done to the kits file, plugin uploads to DB

wet breach
#

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

twin venture
#

can i extends it even futher and make it so it work with all cosmetics?

#

they also have .yml file

wet breach
#

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

twin venture
#

yes exactly

wet breach
#

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

twin venture
#

can you send a toturual on how to upload the whole file?

wet breach
#

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

twin venture
#

oky ๐Ÿ™‚ seems easy

wet breach
#

since this is mysql

#

you could probably easily find tutorials on blobs and many of them

compact haven
#

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"}

code: https://pastes.dev/2rmYnjDb5B

smoky anchor
compact haven
#

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?

tardy delta
compact haven
#

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:

twin venture
#

i tried to install intellij idea comunnity , it breaks everytime my entire project give red errors , i imported everything and reloaded maven

#

๐Ÿ˜ฆ

drowsy helm
#

Did you invalidate caches

tardy delta
#

what red error

twin venture
kindred valley
#

is it possible to use older versions of spigot on project

chrome beacon
#

Yes

kindred valley
#

with maven

chrome beacon
#

Set the spigot version to an older version in your pom

kindred valley
#

i only see 1.20

smoky anchor
#

run BT

#

with the correct version argument

kindred valley
#

what is bt

smoky anchor
#

How do you get your server jar ?

#

?bt

undone axleBOT
chrome beacon
#

Bt is only required for nms

chrome beacon
robust ginkgo
#

Is there something wrong with this bit of code that would cause an error with beehives?

#

I should've used a paste site huh

chrome beacon
#

Yes

#

?paste

undone axleBOT
kindred valley
smoky anchor
kindred valley
#

what should i add to import this

brittle geyser
kindred valley
#

What reflection

robust ginkgo
kindred valley
#

I cant open buildtools

chrome beacon
tidal kettle
#

hey this is not how you register event ?

chrome beacon
#

?maven

undone axleBOT
smoky anchor
# chrome beacon Yes

Aaah, guess I just forgot about that lmao
I've been always running BT 'cause I access nms from time to time

chrome beacon
#

You forgot the s

tidal kettle
#

bruuuh thx

smoky anchor
chrome beacon
#

?conventions

kindred valley
#

Why cant i execute the jar

young knoll
#

Is it on your desktop

kindred valley
#

ye

young knoll
#

(If it is I recommend putting it in a folder)

kindred valley
#

didnt work again

young knoll
#

ยฏ_(ใƒ„)_/ยฏ

#

Make sure youโ€™ve got it spelled right and all that

kind hatch
#

Make sure it also has execute permissions.

#

Windows might have prevented it from executing.

twin venture
#

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) ?

chrome beacon
kindred valley
smoky anchor
#

Get new BT and just run the UI if you can't get this to work ?

kindred valley
#

What tis UI

icy beacon
#

@blazing ocean what gui lib do you use

smoky anchor
smoky anchor
#

wdym

torn shuttle
kindred valley
kind hatch
#

What do you need craftbukkit for?

#

It only exports spigot by default

kindred valley
#

i am trying to run a source code

#

it has craftbukkit imports

kind hatch
#

You mean NMS?

kindred valley
#

Idk what is it

restive ledge
#

How can I make my command be accessible to anyone on the server? WHich permisson do I have to use?

kind hatch
#

You donโ€™t set one

restive ledge
#
commands:
  suicide:
    description: Take your own life ingame.
    usage: /<command>
    permission: *
young knoll
#

Set the permission to be default: true

restive ledge
#

oh

young knoll
#

Or just set it to not have one

restive ledge
#

i have to pass a string

#

?

kind hatch
restive ledge
#

nope it built

smoky anchor
kind hatch
alpine urchin
#

We should abolish that name

#

it should be called NM

kind hatch
#

You need to use the spigot dependency instead of the spigot-api dependency if you want to access craftbukkit methods.

kindred valley
#

how do i do that

kind hatch
#

Change the dependency in your pom

kindred valley
#

whats the difference between it and api spiลŸgot

kind hatch
#

Additional access to craftbukkit methods.

#

And mojmaps if you want

young knoll
#

(Mojmap is 1.17+ iirc)

kindred valley
kindred valley
#

Isnt this it

#

@kind hatch

summer scroll
kind hatch
blazing ocean
robust ginkgo
#

Should forcing BlockState.update be able to crash the server?

#

I'm assuming it's not, but just to be sure

short drift
#

What's the most efficient way to get nearby blocks around an entity? I want to place something on top of the blocks.

spice burrow
short drift
#

Yes, basically.

spice burrow
#

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);
          }
        }
      }
    }
short drift
#

Oh, okay. So you pre-calculate and then you only get the blocks at the specific coordinates.

#

That's nice.

spice burrow
#

yea, handy thing I found awhile ago and I use it quite often

short drift
#

Thank you for the tip!

spice burrow
#

np! im sure you'll be able to adjust it for what you need

short drift
#

Wouldn't X, Y, Z result in better cache utilization?

river oracle
spice burrow
short drift
#

Okay. Just asking in case there's some trick in there I'm not aware of.

spice burrow
#

Yea, nope not that I know of ๐Ÿ˜‚

pseudo hazel
#

usually it doesnt matter, until it does

#

if you know what I mean

#

like for logic reasons or early returns

blazing ocean
pseudo hazel
#

likw if you are searching for something that tends to be low down, you would iteratoe over Y in the outer most loop

blazing ocean
#

as it uses component titles

blazing ocean
#

they use paper/a custom paper fork internally

#

and they need component titles

icy beacon
#

do you have a fork

blazing ocean
#

yes but not for spigot

icy beacon
#

for fucks sake

#

im staying on triumph

blazing ocean
icy beacon
pseudo hazel
#

imagine using paper if all you need is component titles

icy beacon
#

^

spice burrow
#

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

blazing ocean
#

they use it for countless other reasons too

#

one of them being easy to fork

icy beacon
#

they shouldn't :frown:

blazing ocean
#

except they do

pseudo hazel
#

well yeah

#

I mean they make their own servers

blazing ocean
#

yeah

pseudo hazel
#

they can do whatever they want

blazing ocean
#

totally up to them

#

like interfaces used to be an internal lib

pseudo hazel
#

but I like my plugins to be as widely accessible as possible

blazing ocean
#

and they don't have to listen to what a person on the internet says

blazing ocean
pseudo hazel
#

yes

#

but im not

blazing ocean
#

yeah i was talking about them

pseudo hazel
#

yeah I already said that

#

anyways im just meming ๐Ÿ˜

#

and I am jealous that paper has that one specific feature

icy beacon
#

why is g*tb*kkit still a thing like they are straight up distributing spigot jars and have been doing so for years

young knoll
#

It's more up to Mojang to do something about it

icy beacon
#

their footer is partly broken, and the API link is the same as the pricing link (why tf do theyeven have a pricing??)

river oracle
young knoll
#

He needs to rebase to 1.21

#

smh

novel parrot
#

This is what I tried first, not called when a falling block lands.

twin venture
#

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

trail coral
#

is there a way to remove the last entry (first one inserted) from a linkedhashmap? i may have repeating keys and values aswell

dawn karma
#

Hello

#

Who implemented the CraftToolComponent ?

#

I think there is a problem

blazing ocean
#

?ask

undone axleBOT
#

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!

dawn karma
#

/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

young knoll
#

?jira

undone axleBOT
turbid flame
#

Improper cleanup of chunk at (-1, -1). Reusing NMS chunk

What might cause this warning?

torn shuttle
#

is there a known bug around setting mobs to be invulnerable in 1.21?

inner mulch
#

i thought it was a bug too

torn shuttle
#

ok wtf

#

that changed

#

thanks

#

that actually sucks

inner mulch
#

yeah

#

full invulnerability needs to be coded by urself :(

azure zealot
#

Hello Guys is there anything like an MinecartDerailEvent?

trail coral
#
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

blazing ocean
#

config.getList()?

chrome beacon
#

getStringList?

blazing ocean
#

wiat that's a thing?

chrome beacon
#

Yes

azure zealot
#

is there anything like an MinecartDerailEvent?

chrome beacon
#

No I don't think so

trail coral
hushed spindle
#

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

chrome beacon
#

Looks like you forgot to remap

#

?nms

hushed spindle
#

i used the remap argument yes

chrome beacon
#

Not that part

#

You're either not building with maven or missing the special source plugin

hushed spindle
#

oh you mean this

chrome beacon
#

That's the dependency

hushed spindle
#

got specialsource too

chrome beacon
#

And how are you building

hushed spindle
#

like the run command?

chrome beacon
#

Yes

#

Also that special source is quite out of date

#

2.0.3 is latest

hushed spindle
#

mvn clean install -P remapped -T 1C -DskipTests -P exportToServer

#

ill see if that changes anything

#

(it didnt)

chrome beacon
#

Just run mvn package

#

Without arguments

hushed spindle
#

ill try that later i gotta make dinner

#

thank you for helping out though i really appreciate it

twin venture
#

if i want to get the current time stamp

#

Timestamp.from(Instant.ofEpochSecond(System.currentTimeMillis()))

#

how i can do that?

slender elbow
#

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

torn knot
#

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

tardy delta
#

?codeblock

undone axleBOT
#

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() {

    }
}```
tardy delta
#

we stopped doing naming conventions?

trail coral
#

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

icy beacon
undone axleBOT
trail coral
acoustic pendant
#

Hey, i am trying to store a list in mysql but not sure if I'm doing this right...

#

Could someone tell me?

shadow night
trail coral
twin venture
#

just the TimeStamp of now (the current moment of speaking.)

hushed spindle
tardy delta
trail coral
#

i did it already thandd tho

#

you have to add a bool (path, bool)

tardy delta
#

to the Writer? yes, but Files.newBufferedReader uses more efficient methods of writing

trail coral
#

wdym

tardy delta
#

its also considered more modern api

trail coral
#

i use a bufferedwriter

#

and pass a filewriter as args

quaint mantle
#

Can you not translate strng's to hex codes anymore? My method just randomly broke

green prism
#

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()
                    )
            );
tardy delta
#

wats the format

pseudo hazel
#

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?

icy beacon
#

yeah you better do that

#

otherwise users gonna download yo plugin and not know wtf is wrong and why it's not starting up

pseudo hazel
#

yeah okay I thought maybe its not allowed to link to other plugins or smth

carmine mica
#

ShapelessRecipe doesn't work with ExactChoice RecipeChoice on spigot

green prism
chrome beacon
#

?paste

undone axleBOT
hushed spindle
#

its a multi module project so i assume you just mean the pom of the 1.21 module

short drift
#

Can I raytrace targets that are air?

#

Or would that return null?

rough drift
short drift
#

If my raycast target is Material.AIR, would the raycast return null?

#

Or should I raycast the block below which is not air?

grim hound
#

Is there any way to detect that the offhand switch was clicked, even without any items to switch?

scarlet gate
#

What is "Generation" in BookMeta?

chrome beacon
#

Written books can be copied

#

I believe gen is which copy

rough drift
#

?try

#

?tryi

#

?tryit

chrome beacon
#

Like a copy of gen 1 is gen 2

#

?tas

undone axleBOT
rough drift
#

omfg

chrome beacon
#

You good vodoo

scarlet gate
#

You were clearly leading by example lmao

rough drift
#

I've been looking at javap dumps for the past 3 months

scarlet gate
rough drift
#

I have went insane

rough drift
queen patrol
#

Can anyone tell me which placeholder I should use to open my delux menu gui with command/tpa

chrome beacon
short drift
#

But thank you for that pearl of wisdom.

hushed spindle
#

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

twin venture
#

are you using nms or spigot-api in your pom (if you are using maven?

#

?nms

hushed spindle
urban crest
#

Im a noob at programming, how do I compile plugin code into a jar file?

short drift
urban crest
#

IntelJidea

pseudo hazel
#

are you using maven build system?

urban crest
#

yes

short drift
#

It simplifies things.

urban crest
#

ok

hushed spindle
# hushed spindle both, with mojang mappings

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

slender elbow
#

?mappings

undone axleBOT
hushed spindle
#

i think i get that but then why does it work fine for non 1.21 and suddenly breaks with 1.21

urban crest
#

i need 1.8

#

is there a way to add it

blazing ocean
#

don't use 1.8

#

?1.8

undone axleBOT
brazen badge
#

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.

stiff grove
brazen badge
# stiff grove Iโ€™m not sure that I understand what you wanna do, can you give a little bit more...

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

slender elbow
#

i went to italy once

#

met some very nice people

#

will definitely return

digital nova
#

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

stiff grove
slender elbow
digital nova
#

i'm truly special

#

i'm actually an idiot

#

how did i read the src like 5 times and miss that method

stiff grove
#

Happens

wintry dagger
#

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๐Ÿ˜ƒ

slender elbow
#

: the practice or activity of betting : the practice of risking money or other stakes in a game or bet

nova notch
#

basically dont add a crates system with bs rigged rates

remote swallow
#

does that mean you can make it not rigged but very clear instructions to make it rigged

real lagoon
#

If you win all the times you play, even if you win a block of dirt, is not gambling because you can't lose

wintry dagger
#

And it also applies to ingame currency?

nova notch
real lagoon
nova notch
#

that is still gambling

wintry dagger
#

Lottery would fall into gambling then, no?

nova notch
#

uh anyway idk if in game currency would count assuming the only way to earn the currency is in game

worthy yarrow
#

gamble on who wins

nova notch
#

i would assume that'd be fine

wintry dagger
#

Scratch off tickets? Gambling?

wet breach
#

Also to note gambling like lottery has a lower age limit then say playing slots as well

real lagoon
#

Theoretically if you can't win money isn't gambling

wet breach
#

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

real lagoon
#

Lol

#

Life is gambling

wet breach
#

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

novel parrot
#

So the original Mario Party wasnโ€™t gambling but the later versions areโ€ฆ

wet breach
#

But it depends whose rules we go by lol. US is what i know but other countries have more strict rules on it

devout otter
#

update

#

nick plugin works

#

im so happy

#

its not even funny

dire jacinth
#

does anyone here know how i can make a craftbukkit plugin for beta 1.7.3 (CB1060)? i cant find much

sullen marlin
#

Same way as normal

#

What exactly is your issue

dire jacinth
foggy raptor
#

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.

sullen marlin
tepid turret
#

How would I name an inventory with component msgs
as in adventure lib support <red> and stuff

golden tulip
#

The Menu i think (That by then I can "edit" a block)

sterile breach
#

Hi, Configuration phase is an event? I don't find it in spigot api

sterile breach
sullen marlin
#

?xy

undone axleBOT
twin venture
#

iam trying to learn on using gradle how i can fix this?

lost matrix
harsh ruin
#

Is there a event that triggers when a item gets added to your inventory?

twin venture
#

i have it , but i don't think i have spigot 1.20.4

#

i didn't use buildtools

quick sun
chrome beacon
#

Also add mavenLocal and find a 3rd party plugin for remapping

chrome beacon
#

It already has a release build

quick sun
#

Need the 1.21 PR thatโ€™s approved but not merged yet

chrome beacon
#

Oh well start by cloning the 1.21 branch

#

Then build every Spigot version from 1.16 and above using BuildTools

quick sun
#

Oh didnโ€™t know about BuildTools

chrome beacon
#

Then use the mvn package command to build

quick sun
#

Aight will look into it, Ty!

chrome beacon
chrome beacon
quick sun
#

I see

chrome beacon
#

Also it's not quite every version from 1.16

#

I just don't remember which ones you can skip

tender shard
#

1.20 eg compiles 1.20.1

chrome beacon
#

You can take a look in the project and see what it uses

shadow night
#

1.20 -> 1.20.1
1.20.3 -> 1.20.4
1.20.5 -> 1.20.6 iirc

tender shard
#

Yeah usually those versions that got updated within a day

wintry dagger
#

Which of these would you guys categorize as โ€gamblingโ€ and not be allowed as a spigot plugin?

  1. Raffle - lottery system, winner takes it all.
  2. Scratch-off tickets with instant win, configurable prizes
  3. Slot machines, configurable symbols and payouts
  4. Blackjack, configurable payouts
  5. Wheel of Fortune, configurable rewards
  6. Lucky Blocks, you mine a block to win configurable rewards
  7. Coinflip
  8. Higher or Lower
twin venture
#

?nms

iron night
#

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}}

mellow edge
short drift
#

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);
sullen marlin
#

What's with the random 0.5?

short drift
#

I should drop that?

sullen marlin
#

Why'd you add it?

short drift
#

In a futile attempt to try to make things work?

#

I'll try removing it.

sullen marlin
#

Also what's head location?

short drift
#

Also, it seem |- in spigot.yml isn't working anymore after 1.21 update.

sullen marlin
#

Not working for what

short drift
#

This was working on 1.20.6.

#

Did something change in 1.21?

sullen marlin
#

Not intentionally

#

Open a bug report

#

?jira

undone axleBOT
short drift
#

Okay.

#

Is the raycast not able to hit air block as target?

sullen marlin
#

Defeats the point doesn't it?

short drift
#

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.

sleek estuary
#

How do I read this?

tall dragon
remote swallow
tall dragon
#

depends what ur looking for.

tall dragon
sleek estuary
tall dragon
#

??

#

ur question makes no sense lmfao

#

its the only logical answer

sleek estuary
wet breach
short drift
#

@sleek estuary Have you tried asking the plugin author?

tall dragon
sleek estuary
sleek estuary
short drift
#

๐Ÿ˜†

wet breach
#

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

tall dragon
#

you can see how much time your plugin takes in a tick. and the average or it.

sleek estuary
#

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.

tall dragon
#

if they open the dropdown you can see exactly whats taking a long time

#

ask them to send you the whole report.

wet breach
sleek estuary
wet breach
#

are you doing DB accesses from the main thread?

sleek estuary
#

Maybe he uses it on a separate server

sleek estuary
#

async

short drift
sleek estuary
short drift
#

Those values are not really going to help you much.

wet breach
# sleek estuary no

I wouldn't be concerned about it then. Odds are they don't know how to properly diagnose a plugin causing lag

slate surge
#

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?

wet breach
#

they just see the color red and go oh that must be bad

tall dragon
#

yea.. exactly

remote swallow
astral pilot
#

what's the alternative for Material.LEGACY_BOOK_AND_QUILL

remote swallow
astral pilot
#

thanks

chrome beacon
#

Huh why

short drift
#

Why do people use BungeeCord?

#

Seems kind of pointless.

chrome beacon
#

It's a proxy

short drift
#

I know what it is.

chrome beacon
#

Sure we have the transfer packet now

slate surge
#

i want to maintain some old code which is hard to migrate over to velocity( i dont know velocity api) thats why

chrome beacon
#

But that hasn't always existed

slate surge
#

hmm

#

umm

chrome beacon
slate surge
#

i dont wanna port to velocity

#

i replied to "Why do people use BungeeCord?"

chrome beacon
#

Ah

slate surge
#

also

#

where did InitialHandler moved to? it is not in the net.md_5.bungee.connection package?

short drift
#

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}.
slate surge
#

@short drift any1 suggestions on how to add custom handshake?

#

any*

short drift
#

Here's one round of raycast attempts. Was trying to hit green blocks, hit red instead.

wintry dagger
#

iโ€™d love to know if thatโ€™d be allowed to know if itโ€™s worth pursuing

pseudo hazel
#

they are all gambling by definition but idk what the rules are with in game money

wintry dagger
pseudo hazel
#

idk what the rules say

#

can you link the rules page for resources?

wintry dagger
#

โ€Resources containing the following themes will be rejected.
Gambling
Drugs
Guns, weapons, or similarโ€

pseudo hazel
#

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

remote swallow
#

what would a lawyer do there

#

just email md and ask

#

?support

undone axleBOT
short drift
#

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.

quick sun
#

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]
dusty totem
#

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.

river oracle
river oracle
#

@kind hatch I still don't understand why this happens

wintry dagger
quick sun
#

after downloading it and starting it for the first time, it worked but I cancelled it to look something up then it stopped working

pseudo hazel
#

in game money is fine at first, until some server owner uses your plugin combined with another to turn real money into virtual money

dry forum
#

can anyone recommend a good scoreboard library

blazing ocean
pseudo hazel
#

packetevents ๐Ÿคก

umbral ridge
#

md5Boards

blazing ocean
umbral ridge
#

โ˜• ๐Ÿšฌ

trail coral
#

anybody have a guide on text displays and display entities?

pseudo hazel
#

what do you want to know about them

trail coral
#

lmao

sleek estuary
#

how i rotate the head

trail coral
#

what the fuck are you even doing

#

๐Ÿ˜ญ๐Ÿ˜ญ

blazing ocean
quick sun
#

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?

young knoll
#

No

#

You can run multiple at once via command line but that might melt your cpu

quick sun
#

I see

#

trying to compile oreobfuscator is harder than I thought ๐Ÿ˜ญ

sullen marlin
#

Just delete support for the versions you don't need

quick sun
#

in the pom.xml?

sullen marlin
#

Yeah

sleek estuary
blazing ocean
#

idk why you pinging mme

quick sun
#

holy shit

sullen marlin
#

Probably a modules section

quick sun
#
        <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

sullen marlin
#

Probably in the nms directory pom

quick sun
#

yup

sleek estuary
blazing ocean
#

ok

sleek estuary
#

how i rotate the head

trail coral
sleek estuary
blazing ocean
#

use display entities

remote swallow
#

1.8

trail coral
#

hes on 1.8

blazing ocean
#

update

trail coral
#

when you spawn it

sleek estuary
trail coral
#

fix the axis and pitch

sleek estuary
#

the hoe is forward and the head is turned the other way around. does this solve the problem?

trail coral
#

make the armorstand visible

#

for a second

#

and see how it looks rn

sleek estuary
trail coral
#

its turned sideways

#

thats why the hoe is like that

sleek estuary
sleek estuary
trail coral
#

here

#

thats why jts upside down

#

and the hoe is just like that on small armorsyands

sleek estuary
trail coral
#

bro

#

youre doing it the wrong way

#

hes looking back

sleek estuary
#

without headpose ok

river oracle
#

The life of a 1.8 developer

#

Depression agony pain

tardy delta
#

what kind of thing is that?

trail coral
#

tbh for minions he would still need to use armorstands so

#

doesnt matter the version

tardy delta
#

scarecrow?

trail coral
#

working away

tardy delta
#

ah child labor, thats what the party loves

river oracle
trail coral
#

the children yern for the mines

tardy delta
#

see, + 20 social credit already

trail coral
tardy delta
#

those clouds look like windows 7

blazing ocean
#

๐Ÿ˜ˆ ?

trail coral
#

theyre ass

blazing ocean
#

๐Ÿ’€

#

you can literally do almost everything with them

#

you have full control over everything and even animations

tardy delta
#

you only need to be a designer for that

#

or you get some weird ass shit

blazing ocean
#

yea i mean

#

it takes some skill

short drift
#

Returning true in Predicate for raycast does not stop the raycast?

#

I'm getting rays passing through walls.

midnight vector
orchid iron
#

Can i spawn a mob with packets and give it mob ai?

blazing ocean
#

obligatory why are you using internals here

midnight vector
#

@sleek estuary

bold oriole
#

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)

blazing ocean
midnight vector
blazing ocean
#

why are you โ˜ ๏ธ reacting me

midnight vector
blazing ocean
#

whar

bold oriole
#
<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>
blazing ocean
#

?whereami

spare sky
#

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)

https://i.imgur.com/GHGRqib.png

quick sun
#

Ok so I just compiled the 1.21 Pull request of orebfuscator but the commands sadly dont work, anyone maybe knows why?

quick sun
kind hatch
#

?fork

undone axleBOT
#

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.

quick sun
#

I see, sorry

tidal kettle
#

?paste

undone axleBOT
tidal kettle
#

hey i got this, iamge.png exist but i got this error :

#

someone has an idea why this don't work

eternal night
#

you can load a CachedServerIcon using Server#loadServierIcon and pass the icon

tidal kettle
#

like this?

eternal night
#

Also useful adventure tip, Component.text("text").color(color) can be written as Component.text("text", color)

#

Yea

blazing ocean
tidal kettle
# eternal night Yea

idk why but when i name server-icon.png, it work but with my code, it didn't work....

eternal night
#

hm?

#

I mean, you need to pass the returned instance from loadServerIcon to the event setter

tidal kettle
#

uh?

eternal night
tidal kettle
#

i don't put the loadServerIcon in the onEnable? x)

eternal night
#

you do

#

but you need to store the returned value

#

and then event.setServerIcon(theVariableYouStoredTheCachedServerIconInOnEnableIn)

tidal kettle
#

oo

#

i see

#

work now , thx you ๐Ÿ˜„

amber dawn
#

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

dusty totem
#

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

tardy delta
#

wha-

tardy delta
#

dunno what an EventListener is, i only know Listener

#

if youre gonna register listeners, you gotta provide an instance yourself

dusty totem
#

yeah Listener

amber dawn
dusty totem
#

if we have 2 players doing stuff, will the plugin create only one instance of the Listener or two separately?

amber dawn
#

@drowsy helm i installed buildtools

dusty totem
#

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.

tardy delta
#

im assuming you want to handle multiple players

dusty totem
#

yeah but base on this information how many instances will be created?

#

it will be a singleton, transient, or session?

spice burrow
#

thereโ€™s tons of docs are forums explaining how to use them and add packetlisteners, etc

amber dawn
spice burrow
#

make sure the artifactId is spigot and not spigot-api

amber dawn
#

<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>

spice burrow
#
      <dependency>
          <groupId>org.spigotmc</groupId>
          <artifactId>spigot</artifactId>
          <version>1.21-R0.1-SNAPSHOT</version>
          <scope>provided</scope>
      </dependency>
amber dawn
#

i tried it before but throws an error

#

ima retry

shadow night
#

You need to build the version using buildtools

amber dawn
#

ye but what path do i select, sorry im not expert

spice burrow
#

or you could use paper

amber dawn
#

damn thanks

spice burrow
#

dope

#

np

shadow night
#

In the spigot support channel

#

Mentioning paper

#

Absolutely inacceptable

sleek estuary
#

This plugin was a custom order

spice burrow
analog ether
#

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 ?

dry forge
#

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?

tardy delta
iron night
# real lagoon You need to listen to events

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?

short drift
#

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.

short drift
#

You are, but not enough for it to be the block at player.

wet breach
#

you need to use the players trajectory

short drift
#

Trajectory? Well that's just interesting.

#

Tell me more about this "trajectory" ๐Ÿค”

#

It's on Player is it?

wet breach
#

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

short drift
#

Or does it come from PlayerMoveEvent?

wet breach
#

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

short drift
#

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?

wet breach
#

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

short drift
#

@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?

wet breach
#

all entities that can move have velocities

short drift
#

Right.

wet breach
#

basic algebra will get you by with the whole velocity thing with distance over time given speed

short drift
#

toBlockVector?

wet breach
#

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

umbral ridge
#

Yes

wet breach
#

a player is only 2 blocks high?

short drift
#

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");
    }
}
#

๐Ÿค”

#

?

mortal hare
#

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

wet breach
#

you mean if they jump?

wet breach
#

you would still know their trajectory

#

you could spread the grid to be 4x4

#

but that doesn't change the players height

tardy delta
blazing ocean
wet breach
#

sure, but that isn't the question at hand

#

or what is the issue anyways, accuracy

mortal hare
# blazing ocean ```kt return when(obj) { is Int -> "int $obj" is Long -> "long $obj" ...

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?

wet breach
#

idk what you are asking

blazing ocean
#

give a code example

mortal hare
#

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

wet breach
#

well, interfaces do require you to implement what is in them but you can also extend them which is kind of their purpose

blazing ocean
wet breach
#

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

mortal hare
#

but wouldnt the visited class would downcast the extended visitor

echo basalt
#

generic time?

vernal oasis
#

I know there's player.isBlocking() but is there a way to get shield break and lower events?

icy beacon
#

what is this

chrome beacon
#

Guilds

icy beacon
#

damn never see nthat

ripe falcon
#

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 ?

quaint mantle
#

could someone help me over at help-server please?

vernal oasis
torn shuttle
#

is setSeeThrough for the text display for the background specifically?

young knoll
vernal oasis
torn shuttle
#

is there a setting in these that will make them render in front of entities even if they're behind them?

grim hound
#

How can I set-up a bungeecord proxy on my pc for testing?

vernal oasis
chrome beacon
#

There is no difference

young knoll
#

Well you can check if it's disabled

#

Presumably doing so with a 1 tick delay in the damage event would catch everything

chrome beacon
#

Grab the Bungeecord jar run it and configure it

vernal oasis
#

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?

mortal hare
#
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

real lagoon
mortal hare
vernal oasis
young knoll
#

You could have a timer that runs each tick and fires your own custom shield start blocking and shield stop blocking events

mortal hare
#

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

twin venture
#

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

vernal oasis
twin venture
#

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
twin venture
#

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?

vernal oasis
#

A win effect class that has a method in it for the win effect

twin venture
#

its an abstract class

vernal oasis
#

You can extend / implement it no?

twin venture
#

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?

vernal oasis
#
twin venture
#

it will be like this inside the cosmetics.yml file

grim hound
twin venture
#

cosmetics:
AnvilRain:
name: &EAnvilRain
type: WinEffect
game_mode: SOLO
game_type: NORMAL
..etc

vernal oasis
chrome beacon
#

Not sure what more you want

twin venture
#

i was thinking about adding a abstract method to load it from config directly
like so .. but add config

chrome beacon
#

Bad questions get bad answers it's really that simple

vernal oasis
hot reef
#

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?

chrome beacon
#

?paste

undone axleBOT
chrome beacon
#

Try avoiding sending text as images

twin venture
#

something like this might work no?

#

and i only need to do load

#

and set the config

#

instance

vernal oasis
#
    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

twin venture
#

yeah thanks

vernal oasis
#

That's a set but you can reverse it for whatever

hot reef
vernal oasis
#

return plugin.getConfig().getString(key);

This would give you the key

twin venture
#

what if i would need 2 Astrount configg , one solo , one double

vernal oasis
#

static FileConfiguration config = CUU.getInstance().getConfig();

For config thingy

#

You could either name them differently in config

#

Or

#

Do something like

tardy delta
# twin venture

in my opinion, the effect should only get the specific ConfigurationSection that it needs (as a field or whatver)

vernal oasis
#

Cosmetic:
Astronaut:
Solo:
Name: blah blah blah
...
Duo:
Name:...

vernal oasis
#

Make sure to do tabs correctly

twin venture
#

or maybe do , cosmetics:
cosmetics:
NORMAL:
astrutntutnt..
name: testest

vernal oasis
#

You could do that

spice burrow
#

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?

vernal oasis
#

Id do whatever is going to be the same then a
Solo:
Color: red
Duo:
Color: blue

Kinda thing

remote swallow
tardy delta
#

^

vernal oasis
#

I think they were called clans at first?

mortal hare
#

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