#help-development

1 messages ยท Page 1797 of 1

quaint mantle
#

wdym?

tender shard
#

do you create more than one instance of your UserInfo class while your plugin runs?

young knoll
#

That seems like an easy API method to make

tender shard
#

but I have no idea how to create PRs for spigot

#

all I see is a huge amount of patch files

#

I'm not used to that lol

#

I literally have no idea on how to contribute to spigot

tender shard
young knoll
#

There is a guide

#

First you fork over your personal info to MD, then you do things

tender shard
#

fork over personal info to MD? wdym?

young knoll
#

CLA

tender shard
#

oh yeah I already have that

#

I got access to the internal bitbucket stuff or however its called

young knoll
#

I give him my address and he doesnโ€™t even come over and say hi

#

Smh

tender shard
#

yeah fr

#

I was disappointed too

#

I mean, australia <> Germany, it's only like 15k km distance

#

aaah thanks for that link @young knoll

#

I'll bookmark that

#

I got the CLA but I never saw that link

quaint mantle
#

i have a whole project for forking spigot (i will not say i stole it from paper and remade some scripts), if you want i will give it to you, it kinda easy to understand if you understand everything

tender shard
#

sure, I won't say no to that, would be nice ๐Ÿ™‚

#

but I can't promise that I can do anything useful with it ๐Ÿ˜„

#

I'll probably need some time to even remotely understand how all this patching system etc works ๐Ÿ˜„

young knoll
#

Quick jog

tender shard
#

my guess was good

#

I just guessed it was 15k km

young knoll
#

Nah thatโ€™s for me

tender shard
#

ah okay

young knoll
#

Itโ€™s about the same to Berlin though

#

Thatโ€™s like, the only German city I know

tender shard
#

yeah okay I'm only 500km distant from berlin

#

you probably also heard at least of Munich and Cologne ๐Ÿ˜›

quaint mantle
#

if you want to fork spigot then Paper would do the job but if you want to fork paper then i can give you the 2nd too

tender shard
quaint mantle
#

2nd basically tuinity (i like to steal code :hehe:

#

with some more remade scripts

young knoll
#

All you do is run buildtools with โ€”dev

quaint mantle
#

and more functionality

tender shard
#

oh

young knoll
#

And then open the projects in an ide

quaint mantle
#

yeah

tender shard
#

I'll just check the guide you sent, thanks ๐Ÿ™‚

quaint mantle
#

but i remember it is a lil bit slower than mine?

#

using build tools i mean

#

wait

#

wait

#

wait

#

...

tender shard
#

lol

young knoll
#

Yes

quaint mantle
#

nah just use build tools that Paper repo is only for 1.16.5

tender shard
#

quickly gotta let the dog let out some dog urine

quaint mantle
#

welp use build tools

golden turret
#

?paste

undone axleBOT
golden turret
buoyant viper
#

why in the world does EnderCrystal implement ServerOperator

#

who in their right mind would need to set a crystal as op...

hexed hatch
#

do you not trust end crystals

#

personally I op all of my crystals

buoyant viper
#

id rather op a slime.

sullen marlin
#

All entities do

buoyant viper
#

im realizing that now

#

and i am scared

young knoll
#

Alright new forceop

#

It ops all entities except players

buoyant viper
#

๐Ÿ˜Ž

tender shard
#

yeah but they tend to be very cautious in entering commands

#

but for real, I'd like to know too why entities can be OPs lol

#

I mean

#

why

#

just imagine you're playing on a server for 5+ years

#

only to realize that the admin is actually an itemframe

young knoll
#

Top 10 plot twists in movies

next plume
tender shard
#

sry lol

buoyant viper
#

how would i specify gradle to use the -shaded spigot-api jar

sullen marlin
#

unecessary

buoyant viper
#

true

sullen marlin
#

the regular jar is fine with gradle

buoyant viper
#

but if i wanted to how could i

void copper
#

When i use my command it just prints the usage and doesnt do anything

sullen marlin
#

pointless, it only exists for people not using gradle/maven

#

you would use the shaded classifier though

void copper
buoyant viper
#

shaded didnt even have what i was looking for, rip

young knoll
#

Are you looking for the holy grail

void copper
#

yes

buoyant viper
#

to look at ender crystals with adel

young knoll
#

Should be in the regular spigot dependency

#

In 1.17 or rc3 that is

void copper
#

can i get some help please

tender shard
void copper
#

yes

tender shard
#

show your onEnable and plugin.yml pls

void copper
#

k one sec

tender shard
#

btw what is the command actually supposed to do

void copper
#

add a life to someone

#
@Override
    public void onEnable() {

        // Create Plugin Files
        System.out.println("Loading LifeSteal files...");

        File LifeStealDir = new File("./plugins/LifeSteal");
        LifeStealDir.mkdir();

        File playersDB = new File("./plugins/LifeSteal/players.sqlite");
        try { playersDB.createNewFile(); }
        catch (IOException e) { e.printStackTrace(); }

        File configDB = new File("./plugins/LifeSteal/config.sqlite");
        try { configDB.createNewFile(); }
        catch (IOException e) { e.printStackTrace(); }

        // Create Player Database
        try { playerDatabaseManager.CreatePlayersTable(); }
        catch (SQLException e) { e.printStackTrace(); }

        try { configDatabaseManager.CreateConfigTable(); }
        catch (SQLException e) { e.printStackTrace(); }

        // Load Listeners
        System.out.println("Loading LifeSteal listeners...");

        PluginManager PluginManager = Bukkit.getPluginManager();

        try { PluginManager.registerEvents(new JoinListener(this), this); }
        catch (SQLException e) { e.printStackTrace(); }

        try { PluginManager.registerEvents(new LeaveListener(this), this); }
        catch (SQLException e) { e.printStackTrace(); }

        try { PluginManager.registerEvents(new DeathListener(this), this); }
        catch (SQLException e) { e.printStackTrace(); }

        try { PluginManager.registerEvents(new OnChatListener(this), this); }
        catch (SQLException e) { e.printStackTrace(); }

        // Load Commands
        System.out.println("Loading LifeSteal commands...");

        try { getCommand("startGame").setExecutor(new StartGameCommand()); }
        catch (SQLException e) { e.printStackTrace(); }

        try { getCommand("addLife").setExecutor(new AddLifeCommand()); }
        catch (SQLException e) { e.printStackTrace(); }

        try { getCommand("removeLife").setExecutor(new RemoveLifeCommand()); }
        catch (SQLException e) { e.printStackTrace(); }

        try { getCommand("setLife").setExecutor(new SetLifeCommand()); }
        catch (SQLException e) { e.printStackTrace(); }

        getCommand("info").setExecutor(new InfoCommand());

        System.out.println("LifeSteal has been fully loaded!");
    }
#
name: Lifesteal
version: 1.0.0
main: me.wiggle.LifeSteal.Plugin.LifeSteal
api-version: 1.17

commands:
  startGame:
    description: Start the game with a 5 minute peace period
    usage: /startGame
    aliases:
      - start
      - gameStart

  addLife:
    description: Add an extra life to someone
    usage: /addLife <user> <amount>
    aliases:
      - add

  removeLife:
    description: Remove a life from someone
    usage: /removeLife <user> <amount>
    aliases:
      - remove

  setLife:
    description: Set someones lives to a certain number
    usage: /setLife <user> <amount>
    aliases:
      - set

  info:
    description: Get info on how to start the game
    usage: /info
    aliases:
      - lsInfo
young knoll
#

Thatโ€™s

#

A few try catch

tender shard
#

ugh why do you wrap everything in try statements

void copper
#

its required

young knoll
#

Because sql

void copper
#

yeah

young knoll
#

Donโ€™t know why they didnโ€™t just use one big try catch though

void copper
#

i tried

young knoll
#

Or not make everything throw SQLException

tender shard
#

add a debug statement, like "sender.sendMessage" something at the top of your onCommand method

#

see if that gets printed

void copper
#

ok

tender shard
#

yeah like

#

why

#

public AddLifeCommand() throws SQLException {}

#

how would that EVER throw an SQLExceptoin?

#

the code block is empty

#

it can't throw anything

#

except maybe outofmemory stuff or sth

#

or NoClassDefFoundError or sth

quaint mantle
void copper
#

ok

tender shard
void copper
#

im lolading the server

quaint mantle
void copper
#

i cant send images :bruh:

quaint mantle
#

i wonder if i can force villager to op me

void copper
#

well it sent the message

quaint mantle
void copper
#

i dont have spiggot account

quaint mantle
#

wait

tender shard
void copper
#

and i dont feel like making one kek

tender shard
#

because you check if lives == or or GREATHER THAN 1

tender shard
#

but you didn't check if it's exactly one

void copper
#

[21:51:21 INFO]: Wiggle37 issued server command: /addlife Wiggle37 123

tender shard
#

so nothing happens

void copper
#

and it printed my msg

tender shard
#

yeah you're doing this:

void copper
#

so its stoped somewhere

tender shard
#

if(life == 0) -> no

void copper
#

wow i cant type

tender shard
#

if(life > 1) -> no

#

you don't have a case for life == 0

void copper
#

mk

tender shard
#

erm sorry

#

I meant life == 1

young knoll
#

I imagine either entities also implement some kind of op interface in vanilla

#

Or itโ€™s legacy weirdness from 2011

quaint mantle
#

hmm fireball still an entity right?

young knoll
#

Mhm

quaint mantle
#

so if we throw an ender pearl up and fireball them we will tp to the fireball...?

maiden thicket
#

arrow is shot in water idk

quaint mantle
#

in bedwars i mean

maiden thicket
#

but iccc

#

okie

#

tyty

tender shard
#

here's the answer

#

for the "why are creepers OP"

#

question

#

quoting md_5

#

Since command blocks and the /execute command, entities can run commands and therefore can (in theory at least) have permissions and therefore op status.

young knoll
#

Make sense

#

LuckPerms non player support when

tender shard
#

people stop asking me "why angelchest only work for op" when

quaint mantle
#

Im trying to run build tools but it keeps getting stuck on this (image shown below), any ideas to fix this?

tender shard
#

how long did you wait for it to complete?

void copper
quaint mantle
tender shard
quaint mantle
#

Ive tried that twice already

tender shard
#

okay are you on linux?

quaint mantle
#

and re downloaded the jar

#

I am not

tender shard
#

if so run it with strace

quaint mantle
#

windows

tender shard
#

oh okay

void copper
#

does this work @tender shard


else if (args[0] == null && args[1] == null && lives >= 1) {

young knoll
#

No

#

args[x] cannot be null

tender shard
#

the whole structure of your parsing is a bit off tbh

void copper
#

mk

tender shard
#

you should completely rewrite the whole class

void copper
#

ok

tender shard
#

also as @young knoll pointed out

#

args[n] can't be null

#

if it would be indeed null, you'd get an ArrayOutOfBoundsException before the check could complete

void copper
#

ok

tender shard
#

also what does this part of code do? lifeManager.AddLife(player, parseInt(args[1]));

void copper
#

add a life to the player mentioned

tender shard
#

and how does that code look like?

#

yeah but as said

#

your whole parsing logic is totally broken

void copper
#

im rewriting the class now

tender shard
#

yeah I'll give you a tiny example

#

what's the syntax actually meant to be?

#

can you give an example

#

like /addlife <player> <amountOfLivesToAdd>

void copper
#

yeah that

tender shard
#

okay gimme a sec

void copper
#

ok

tender shard
#
@Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        
        if(args.length!=2) {
            return false; // 2 arguments are needed
        }
        Player player = getServer().getPlayer(args[0]);
        if(player == null) {
            // Show message "player not found"
            return true;
        }
        int lives = 0;
        try {
            lives = parseInt(args[1]);
        } catch (NumberFormatException exception) {
            // Show message "Enter a valid number"
            return true;
        }
        player.setHealth(player.getHealth()+lives);
        return true;
    }
#

something like this as basic structure

quaint mantle
void copper
#

ok ty

quaint mantle
#

it looks cleaner imo

void copper
young knoll
#

๐Ÿ˜‘

tender shard
#

here with added op check:

#
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        
        if(sender.isOp()) {
            // Show "only for OPs message"
            return true;
        }

        if(args.length!=2) {
            return false; // 2 arguments are needed
        }
        
        Player player = getServer().getPlayer(args[0]);
        int lives = 0;
        
        if(player == null) {
            // Show message "player not found"
            return true;
        }
        
        try {
            lives = parseInt(args[1]);
        } catch (NumberFormatException exception) {
            // Show message "Enter a valid number"
            return true;
        }
        
        player.setHealth(player.getHealth()+lives);
        return true;
    }
#

also why do people call it "pyramid"? it's an arrow ๐Ÿ˜„

#

a pyramid has the point at the top, and not at the right side ๐Ÿ˜„

quaint mantle
#

uhhh

void copper
#

you get the point

#

and its cleaner ๐Ÿ’€

quaint mantle
#

the pyramid here isnt vertical

tender shard
#

pyramid/arrow code is NOT cleaner

void copper
#

yes it is...

quaint mantle
#

it looks clearer to me...

tender shard
#

it might look cleaner to you for a tiny method with 3 nested if's without any else statements

#

but in general you want to avoid this garbage as soon as you can

#

also if your arrow pattern would be so much more readbable, tell me why it's not working and why you didn't instantly see the bug...

quaint mantle
#
if (boolean == false) {
    boolean = true
    if (boolean == true) {
        boolean = false
    }
}```
worldly ingot
#

You won't get a job in most self-respecting software companies if you make use of the arrow/pyramid pattern

tender shard
#

true, but I doubt that's something people care about here

#

I can only say: avoid it at all costs uness you're like in a for loop

worldly ingot
#

Even then, continue exists

paper viper
#

watch uncle bob

quaint mantle
#

uncle bob

paper viper
#

Uncle bob is the true chad

tender shard
#

e.g. this is fine:

    private static List<Block> getBlocksInRadiusSquare(final Location center, final int radius, final Predicate<Block> predicate) {
        final List<Block> blocks = new ArrayList<>();
        for (int x = center.getBlockX() - radius; x <= center.getBlockX() + radius; x++) {
            for (int y = center.getBlockY() - radius; y <= center.getBlockY() + radius; y++) {
                for (int z = center.getBlockZ() - radius; z <= center.getBlockZ() + radius; z++) {
                    final Block block = Objects.requireNonNull(center.getWorld()).getBlockAt(x, y, z);
                    if (predicate.test(block)) {
                        blocks.add(block);
                    }
                }
            }
        }
        return blocks;
    }

But for if statements, etc: just avoid it

worldly ingot
#

Oh I see what you mean with for loops. lol. Nested for loops. I thought you just meant a single for loop

paper viper
tender shard
#

yeah sure continue exists and I love it ๐Ÿ˜„

#

just wanted to say

#

SOMETIMES arrow is okay, a little bit

#

but only if there's a reason for it

young knoll
#

SomarLint gets mad when I use more than 1 continue

waxen plinth
#

That's cringe

paper viper
#

thats why i use codefactor

#

lol

tender shard
#

yeah but it has flaws too

#

I once got a repo rated badly because it analyzed some XML code inside a Readme.md and rated it badly because the code blocks inside the readme weren't valid XML because obviously they included stuff like
[...]

unreal quartz
#

you can ignore files

quaint mantle
tender shard
#

just let it run overnight

#

maybe something will happen lol

quaint mantle
#

dont care about it

#

it is apply patches

#

wow ok

#

wait for a few more mins

#

if it still there

unreal quartz
#

how long did you wait for

quaint mantle
#

ur pc is a potato

tender shard
quaint mantle
#

delete ur pc

tender shard
#

at that point

quaint mantle
#

tried deleteing everything and re downloading the jar as well

tender shard
#

what's your specs? ๐Ÿ˜›

#

It merely takes a minute on my PC :/

#

(when everything's been downloaded already)

quaint mantle
#

i forget exact but roughly ryzen 3, radeon rx570 (i think), 16gb ram

tender shard
#

check in task manager whether java is actually doing things

quaint mantle
#

in task manager it shows its taking no resources

#

ok

tender shard
#

e.g. when your CPU is idling, something's wrong

quaint mantle
#

well apart from a bit of memory

#

ur pc is a potato

#

delete it when

tender shard
#

bruh RPG stop and try to help instead

quaint mantle
#

nah dont call me by that name...

tender shard
#

@quaint mantle

#

do you got git bash installed?

#

if so run it using strace

quaint mantle
#

bt automatically download portable git

tender shard
#
strace java -jar BuildTools.jar --rev 1.18-rc3 --remapped
tender shard
#

and also added to PATH etc

quaint mantle
young knoll
#

I mean it does shove a giant warning about portable git at you

tender shard
quaint mantle
#

yea

tender shard
#

I mean of course strace won't fix anything but we might be able to see where it's stuck

buoyant viper
tender shard
buoyant viper
#

the last 2 are not arrow-less bc i just couldnt think of how to make a return; work when it functions differently depending on two different entities

tender shard
#

a few nested if's are no problem

#

but if the whole code indeed looks an arrow, then you might think about refactoring it ๐Ÿ˜„

buoyant viper
#

hmm

tender shard
#

but

#

I indeed like the second version way more

unreal quartz
tender shard
#

because you can instantly see where it returns

unreal quartz
#

i have an old think pad running arch and thatโ€™s getting me through uni just fine

tender shard
# buoyant viper hmm

imagine you want to debug. in the arrowless version, you can just add a debug statement before every return and print "exited because XYZ".

#

so yeah I'd indeed prefer your new version!

buoyant viper
#

true, in order to debug another project i did need to convert to arrow-less lol

zinc spire
#

Does anyone know how to reset map after a game without lag?

tender shard
buoyant viper
#

my arrow-less is also longer i think because of my reluctance to not use braces, lol

#

just feels so wrong

tender shard
zinc spire
#

What do you mean?

tender shard
#

I'd copy the world dir before starting your game, then unload the world, copy over the old world, and load it again. but loading a world WILL cause lag

#

you'd normally just want to use a network and have a separate server for your minigames

buoyant viper
#

ah just realized an issue in my arrow-less, i full-stop if the killer wasnt a projectile

tender shard
#

neither is wrong. I think the arrowless is way better readable

buoyant viper
#

tfw u were incredibly right abt the debugging part, didnt even need to compile yet before i saw it

tender shard
#

but you also have to know: I don't know what you're code is supposed to do, while you alraedy knew it. for me, the arrowless is way easier to read

quaint mantle
tender shard
#

isn't that acccess violation?

quaint mantle
#

ive no idea

tender shard
#

IIRC c00...05 is access violation

quaint mantle
#

Im running it in

#

Documents

#

is that a problem?

tender shard
#

Exception code c0000005 is the code for an access violation. That means that your program is accessing (either reading or writing) a memory address to which it does not have rights. Most commonly this is caused by:

Accessing a stale pointer. That is accessing memory that has already been deallocated. Note that such stale pointer accesses do not always result in access violations. Only if the memory manager has returned the memory to the system do you get an access violation.
Reading off the end of an array. This is when you have an array of length N and you access elements with index >=N.

buoyant viper
tender shard
#

I have no idea, are you running latest BUildTools @quaint mantle ?

quaint mantle
#

yep

tender shard
quaint mantle
#

Ok thanks for trying

tender shard
#

but yeah it can't hurt to try to run it somewhere else

quaint mantle
#

ill give it a try

tender shard
#

e.g. I have buildtools at C:\BuildTools on Windows

#

but tbh

#

it seems like it's accessing RAM it's not supposed to access

quaint mantle
#

i might try restarting my PC also

tender shard
#

oh you didn't?

#

that might always help on windows lol

quaint mantle
#

yea

tender shard
#

but yeah if it would be a file permission problem, you'd get an error message on that

#

just reboot, and try again

quaint mantle
#

k thanks

tender shard
#

np, let me know if you got any new infos

paper viper
#

thats like a super weird error

#

lol

tender shard
#

yeah at least strace showed something

#

they could have waited hours otherwise with no helpful message lol

buoyant viper
#

will Skull#getOwningPlayer call a web request if its owner has never joined the server

tender shard
#

no

#

why would it?

buoyant viper
#

to set the player if a valid one exists

tender shard
#

it doesn't return a player

#

it returns an OfflinePlayer

buoyant viper
#

ik its an offline

#

but just to fill in the value if that player is a valid profile

tender shard
#

you can't know that

#

but no, it won't do any online lookups

buoyant viper
#

just check a username or uuid against mojangs api

tender shard
#

you can't know whether the OfflinePlayer has a valid profile

#

EVERY uuid will return an offlineplayer

#

You can literally do Bukkit.getOfflinePlayer(UUID.randomUuid()); and you'll get a valid OfflinePlayer object

buoyant viper
#

hmm

#

perhaps i should re-think how im approaching right clicking a player head to get the owners name then

#

lol

tender shard
#

well

#

when you have the offline player, you can get the player's name

#

it will however return null if that UUID / player never joined your server

buoyant viper
#

yeah i need to ensure that it will return the name even if theyve never joined

tender shard
#

then you need to call the mojang API yourself^^

buoyant viper
#

rip

tender shard
#

yeah, see this:

buoyant viper
#

i could bypass bothering with ensuring the head has a profile, since theres no way on my server the head wouldnt be from someone already on it

tender shard
#

that's OfflinePlayer#getName

buoyant viper
#

yeah

tender shard
#

may I ask - why would you have a skull from a player who never joined?

buoyant viper
#

/give

tender shard
#

ah yeah okay

buoyant viper
#

but i think that does a lookup

#

heads are weird

tender shard
#

I am pretty sure that the client looks up the textures

#

but not 100%

buoyant viper
#

it could be since the client does freeze up a little when u first get the head

tender shard
#

I made many plugins that simply use OfflinePlayer's or custom base64 skull textures and noone EVER complained about any lags regarding to any web requests

#

also if the server would to the web requests, that would mean servers could change player's textures / skins, which they also can't

#

well, except for sending fake UUIDs/usernames to the clients

buoyant viper
#

was gonna say, SkinRestorer

tender shard
#

hm yeah

#

you should ask in the forums to be 100% sure

buoyant viper
hexed hatch
#

Does spigot support loading structures from .nbt files?

young knoll
#

There is a new Structure API

#

Idk how it works though

tender shard
#

I've seen arrows that don't fit on a 1920x1080 screen without scrolling to the side

#

and I abused arrows too a few years ago^^ that's why I always tell people from the beginning to not do that ๐Ÿ˜„

#

they shouldn't repeat my mistakes

buoyant viper
#

F

#

i just didnt like how arrow-less looked

#

i can warm up to it maybe but i just dont like the look

tender shard
#

btw since 3 minutes, all my paid plugins are finally 1.18 compatible :3

tender shard
#

just imagine how this would in arrow

#
    /**
     * Cancels the actual Item Spawn and gives it to the player that owns this drop
     *
     * @param event
     */
    public void collectDrops(ItemSpawnEvent event) {

        Item item = event.getEntity();

        if(item.getThrower() != null) {
            // Do not collect Player-thrown items
            return;
        }

        ItemStack itemStack = item.getItemStack();
        if (PDCUtils.has(itemStack, Main.IGNORED_DROP_TAG, PersistentDataType.BYTE)) {
            PDCUtils.remove(itemStack, Main.IGNORED_DROP_TAG);
            return;
        }
        Location location = event.getLocation();
        Player player = DropOwnerManager.getDropOwner(location);

        if (!main.getPluginHooks().mayPickUp(item, player)) return;

        if (player == null) {
            if (main.isDebug()) main.debug("  Don't pick up: no player found");
            return;
        }
        if (main.getHopperDetector().isAboveHopper(location)) {
            if (main.isDebug()) main.debug("  Don't pick up: above hopper");
            return;
        }
        if (!EventManager.mayPickUp(player, item)) {
            if (main.isDebug()) main.debug("  Don't pick up: EntityPickUpItemEvent cancelled");
            return;
        }


        event.setCancelled(true);
        Utils.addOrDrop(itemStack, player, location);

    }
young knoll
#

Huh

tender shard
#

by looking at it, I just instantly spot the "return"s and know how far it executes until it stops

young knoll
#

I guess that is one way to auto pick up drops

tender shard
young knoll
#

BlockDropItemEvent

tender shard
#

doesn't work

#

Ever heard of MythicMobs etc? ^^

#

I actually claim that D2I is the only auto pickup plugin that works with 99+% 3rd party plugins

#

BlockDropItemEvent does shit. Only works for vanilla drops, NOTHING else

young knoll
#

Yeah sadly it isn't mutable

tender shard
#

the reason is that is that the list m

#

yeah exactly what I wanted to say

#

lol

young knoll
#

Well it is

#

But only for removal

tender shard
#

yeah well it IS possible to add to it IIRC

#

just the docs say that you must not do that

#

so no plugin does it, for obvious reasons

young knoll
#

Maybe we should fix that

tender shard
#

at least in 1.13 it was totally possible to add drops to the list

#

yeah I wouldn't have anything against that

#

oh btw @buoyant viper

#

you wanna see a real example for the anti arrow pattern? ๐Ÿ˜„

buoyant viper
#

sure

tender shard
#

wait a sec

#

can't paste it here

buoyant viper
#

F

tender shard
#

it's too long

#

wait

buoyant viper
#

?paste

undone axleBOT
tender shard
#

?paste

undone axleBOT
buoyant viper
#

:smug:

#

lol

tender shard
#

that's about 20% of AngelChest's spawn method

#

now just imagine if that would just be nested

#

as said, the remaining method is at least 5 times longer than this snippet

buoyant viper
tender shard
#

that plugin obviously grew over time

#

the method used to be 100 lines long

#

now it's about a thousand lines

buoyant viper
#

what he fuck

tender shard
#

yeah and most of the logic is still inside other methods

#

death chest plugins get quite complicated when it's configurable and also support a thousand other plugins >.<

#

sooo just so you know: the code you posted was no problem. REALLY nested if's will get you problems

young knoll
#

I think the problem is the fact that the list is of item entities, not itemstacks

#

So adding to it would require you to spawn the item externally first

tender shard
#

and plugins grow over time, so better do it right from the beginning

tender shard
#

might be true

young knoll
#

You could change it to itemstacks

#

But then you can't mess with any of the entity properties

tender shard
#

also that would be breaking changes

#

not gonna happen

#

but tbh there's way more important things that could be added

#

e.g. soooo many NMS stuff could be tunred into API

#

for example mobs, holograms, ...

#

unfortunately I don't have any knowledge yet about how to contribute to spigot ๐Ÿ˜„

young knoll
#

You could always make feature requests

tender shard
#

yeah sure but I'm pretty sure someone else already did them

#

tbh

#

spigot's JIRA totally sucks

#

IMHO

#

it's just sooo confusing

#

maybe it's just me

young knoll
#

I think someone wanted me to overhaul the worldgen api

#

Might take a while :p

deep solstice
#

hey so question about packets- is it better to use packets or should I just stick to using the methods provided?

#

ie if i want to do some stuff with bossbars, is using packets better in some sort of way, or should I just stick to the methods provided by spigot/bukkit?

jade perch
#

Should always use api

deep solstice
#

aight cool, thanks!

sullen marlin
young knoll
#

Was it? nice

#

I only remember seeing the structure API

#

Hopefully I can touch the edge of a chunk in block populators now :p

hollow spindle
#

what the heckkkk

#

Surely after writing the next few lines with if (x) and they seem to be the same, it'd be better to code block it off.

lean gull
#

hello everyone! does anyone know how i can learn to make this planet generation with noise? this was made with the plugin SkNoise which is an addon of the plugin Skript and they're both made with java, so i do know it is possible i do not know how to achieve this. if anyone knows a very simple way to learn this without requiring a lot of maths that would be great! thank you!

manic furnace
#

How can i cache a file?

drowsy helm
#

what sort of file?

manic furnace
#

An image

drowsy helm
#

java has a class for images

#

if you load it using that it will be cached

young knoll
#

And noise gen makes my thinking box hurt

manic furnace
drowsy helm
#

depends what your usecase is

lean gull
drowsy helm
#

its going to be some pretty complicated maths, especially a 3d sphere with noise

#

you can probably find a few resources on mapping noise to a sphere (with polys), problem is putting that into minecraft

young knoll
#

Iโ€™d offer you the noise write up Iโ€™ve read but I donโ€™t know where it is

manic furnace
young knoll
#

Hereโ€™s a write up on perlin noise

quaint mantle
young knoll
#

Where were you running it

manic furnace
#

What do you mean?

valid solstice
#

is there an easier way to getting user input without command executor than just making a message listener?

young knoll
#

There is the conversation api

valid solstice
#

ill try that

#

thanks

torn oyster
#

guys when i use worldcreator.createworld the world appears completely transparent

#

on everyone's client side

#

i can't delete the world and restart because its for a minigamer

#

minigame

#

and it deletes and regens every round

#

why is it doing this

tardy delta
#

Are the chunks loaded?

torn oyster
#

well

#

people join the world

#

and it only happens sometimes

tardy delta
#

Yea probably then :D

torn oyster
#

how do i force load chunks?

tardy delta
#

World#getChunk().forlceload() or something

torn oyster
#

do i have to do that for all chunks

tardy delta
#

There was a forlceload method iirc

#

I dunno try loading them in a normal way

#

Are there even blocks? ๐Ÿ˜ณ

torn oyster
#

ye

young knoll
#

Just getChunk will already load it

hybrid spoke
young knoll
#

No

#

At least as far as I know it isnโ€™t

#

Granted chunk does have is loaded methods and such so maybe Iโ€™m wrong

pliant tundra
#
public class EnchantmentWrapper extends Enchantment {
    private final String name;
    private final int maxLevel;

    public EnchantmentWrapper(String key, String name, int level) {
        super(NamespacedKey.minecraft(key));
        this.name = name;
        this.maxLevel = level;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public int getMaxLevel() {
        return maxLevel;
    }

    @Override
    public int getStartLevel() {
        return 1;
    }

    @Override
    public EnchantmentTarget getItemTarget() {
        return EnchantmentTarget.BREAKABLE;
    }

    @Override
    public boolean isTreasure() {
        return false;
    }

    @Override
    public boolean isCursed() {
        return false;
    }

    @Override
    public boolean conflictsWith(Enchantment other) {
        return false;
    }

    @Override
    public boolean canEnchantItem(ItemStack item) {
        return true;
    }
}

i have this enchantment wrapper and from this i created a custom enchant

NamespacedKey key = NamespacedKey.minecraft("experience_book");

        ItemStack book = new ItemStack(Material.ENCHANTED_BOOK);
        EnchantmentStorageMeta esm = (EnchantmentStorageMeta) book.getItemMeta();
        assert esm != null;
        esm.addStoredEnchant(CustomEnchants.EXPERIENCE, 1, false);

        List<String> lore = new ArrayList<>();
        lore.add(ChatColor.GREEN + "Experience I");

        esm.setLore(lore);

        book.setItemMeta(esm);

        ShapedRecipe recipe = new ShapedRecipe(key, book);

        recipe.shape("PP", "PL"); // sus
        recipe.setIngredient('P', Material.PAPER);
        recipe.setIngredient('L', Material.LAPIS_BLOCK);

        return recipe;
```and i have this for a recipe to craft the enchanted book
but when i try to combine the books in an anvil it doesnt let me combine them anyone know how i can fix this?
young knoll
#

Heh...

#

Override the entire anvil system

#

Or just manually combine them

#

Custom enchantments made this way are not properly handled by the game

#

Anvils wonโ€™t combine them, they wonโ€™t automatically work in the enchantment table, etc

pliant tundra
pliant tundra
young knoll
#

Yes

#

And do the math yourself

pliant tundra
#

ok

#

also is the left item the first one in the anvil inventory

young knoll
#

Slot 0 is the left item

pliant tundra
#

is slot 2 the result?

#

im assuming i have to edit that one because i dont see a setREsult functions

brisk estuary
#

there is a guide on slots iirc

young knoll
#

The event had a setResult

pliant tundra
#

oh wait nvm i was looking at the anvil inventory

brisk estuary
#

Guys how could I create a stronger potion? I'm struggling to do it XD, idk which class I must use to do that.

quaint mantle
#

define stronger potion

#

what type of it?

#

just set the level of the potion higher

brisk estuary
#

like a potion that can give you more than one effect and with higher levels

#

should I use the PotionEffect class?

#

or the PotionEffectType class?

#

also, how could I add this effect to an item?

#

for example whenever a player holds a specific item he gets some potion effects

young knoll
#

PotionMeta

#

Just Player.addPotionEffect

brisk estuary
#

oh

#

ok, ty

#
public PotionEffect(@NotNull
PotionEffectType type,
int duration,
int amplifier)
#

the amplifier parameter refers to the potion level, right?

quaint mantle
#

yes...

brisk estuary
#

sorry for the dumb questions, I've just started coding mc plugins

young knoll
#

Also itโ€™s 0 indexed

brisk estuary
#

ok tks

west oxide
#

hey so i have this config file like this

#

and i want to add a new parameter boolean to each uuid

#
  3e8eac9d-c886-47a1-937c-5f0dfdf6114b: iamTheBest```
#

what's best way to do it ?

#

i thought about creating multiple .yml files for each one or formatting 1 into something like this :

  3e8eac9d-c886-47a1-937c-5f0dfdf6114b:
    isNicked : true
    Nick : iamThebest
#

but both wouldnt work (the multpile .yml files would work but idk if its the best way to do it )

eternal oxide
#

if these are nicks for players when they chat it would be simpler to store in the pdc rather than a file.

west oxide
#

but i want to keep it for each player

#

like when someone wants to nick and use the same nick that a player already "owns" they wouldnt be able to

  • idk what pdc is
#
  3e8eac9d-c886-47a1-937c-5f0dfdf6114b: iamTheBest
isNicked:
  -3e8eac9d-c886-47a1-937c-5f0dfdf6114b
``` will this be a good idea to store them ?
buoyant viper
chrome beacon
#

^

#

?pdc

candid galleon
#

I would make the nickname the key

#

and value could be UUID

west oxide
#

why

eternal oxide
#

you need to do a lookup

candid galleon
#

much quicker

west oxide
#

ok i will try

eternal oxide
#

if this is only for online players, store their nick in their pdc, then when they join add their nick and they uuid to a BiMap

quaint mantle
#

|| @vagrant stratus ||

west oxide
#

i can put uuid here right ?

quaint mantle
#

...?

west oxide
#

isNicked.remove(uuid);

#

if uuid is
String uuid = p.getUniqueId().toString();

west oxide
eternal oxide
quaint mantle
quaint mantle
#

too lazy

#

๐Ÿ˜‚

west oxide
quaint mantle
west oxide
#

i tried it and it gave me error

quaint mantle
#

and will return something

#

or null

quaint mantle
west oxide
#

at online.shakiz.BwCore.Commands.Nick.onCommand(Nick.java:33) ~[?:?]

#

java.lang.ArrayIndexOutOfBoundsException: 0

west oxide
quaint mantle
#

didnt add anything to it

west oxide
#

no i did

#

i will try again7

buoyant viper
eternal oxide
#

If you use a BiMap you can insert teh players real name and nick, then do reverse lookups

buoyant viper
#

hmm

eternal oxide
#

allowing for very simple tab complete

#

BiMap<String, String> nicks = HashBiMap.create();

west oxide
#

๐Ÿ‘€

candid galleon
#

tf is a BiMap

eternal oxide
#

a dual Hashmap backed Map

candid galleon
#

oh

#

interesting

eternal oxide
#

nicks.get(playerName) = nick
nicks.inverse().get(nick) = playerName

sweet pike
#

I am extremely clueless when it comes to maven. If I am trying to change the path where the remapped jars (using md's maven plugin), where do I modify that?

<plugin>
                <groupId>net.md-5</groupId>
                <artifactId>specialsource-maven-plugin</artifactId>
                <version>1.2.2</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>remap</goal>
                        </goals>
                        <id>remap-obf</id>
                        <configuration>
                            <srgIn>org.spigotmc:minecraft-server:1.17-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
                            <reverse>true</reverse>
                            <remappedDependencies>org.spigotmc:spigot:1.17-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
                            <remappedArtifactAttached>true</remappedArtifactAttached>
                            <remappedClassifierName>remapped-obf</remappedClassifierName>
                        </configuration>
                    </execution>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>remap</goal>
                        </goals>
                        <id>remap-spigot</id>
                        <configuration>
                            <inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
                            <srgIn>org.spigotmc:minecraft-server:1.17-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
                            <remappedDependencies>org.spigotmc:spigot:1.17-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
                        </configuration>
                    </execution>
                </executions>
            </plugin>```
west oxide
#

hey is it possible to get a player who's displayname have been changed 's uuid ?

#

because i tried and it keeps giving me an error

                    if (usedNicks.contains(args[0] )) {
                        Player target = Bukkit.getPlayerExact(args[0]);
                        UUID targetUuid = target.getUniqueId();
                        String targetOgName = playersList.getConfig().getString(String.valueOf(targetUuid));
                        sender.sendMessage(prefix + args[0] + "'s original name is " + targetOgName);
                    }```

error here
``` UUID targetUuid = target.getUniqueId();```
ember estuary
#

How can i block player movement (WASD/Space) without blocking physics (Falling, Getting moved by water, Knockback, Getting Pushed, ...)

crimson terrace
ember estuary
#

One idea i had: Create an NPC copy of the player, make the player invisible, and make the player ride it.
But then Iโ€˜d have to transfer damage etc. to the player.
Sounds like a lot of work.
Any other way to just block any player input?

west oxide
#
Caused by: java.lang.NullPointerException
        at online.shakiz.BwCore.Commands.Nick.onCommand(Nick.java:74) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched.jar:git-PaperSpigot-"4c7641d"]
        ... 15 more```
ember estuary
#

is there a Vehicle Steer Event?

crimson terrace
#

so I guess the " Player target = Bukkit.getPlayerExact(args[0]);" doesnt work. you tried changing up that line a bit? getting a player by name is unreliable at best

west oxide
#

i have 2 config files
this ````Nicks:
3e8eac9d-c886-47a1-937c-5f0dfdf6114b: uwu

and this 
```3e8eac9d-c886-47a1-937c-5f0dfdf6114b: shakiz
#

how can i link between them ?

crimson terrace
#

what do you mean "link" and what exactly are you saving in them? the bottom one is the name and the top is the nicks?

west oxide
#

and the top one saves the nick

#

i use bottom one to reset nick

#

at least that's what i came up with when trying to make this

crimson terrace
#

you could make it into one config where each UUID has a list attached to it where the first element is always the real name

#

or make one config where the paths are "Nick.RealName" for the real name and "Nick.Nicknames" for the nicks. that would be doable in one config file

west oxide
#

oh yeah true

#

i will still have to do the same thing to get the name of the player

crimson terrace
#

to get the name of the player when you have it saved just getConfig.getString(pathToName)

#

you could even make an onJoin event where it saves the current name of the player who joined in case they change their name

vague swallow
#

Hi, if I try to load a crossbow with the CrossbowMeta

CrossbowMeta.addChargedProjectile(new ItemStack(Material.ARROW, 1))

The Crossbow is loaded but the item looks like the unloaded Crossbow and the players are not holding it in front of them

west oxide
#

it saves it on the bottom config file

crimson terrace
#

good ๐Ÿ™‚

west oxide
#

and then i use it on any class when i need it

crimson terrace
#

wait... are you trying to get a player by the nick they used? so not even their real name?

west oxide
#

that's what am trying to do

#

i want to get their original name

#

it worked on the reset

#

but not on this

#

this is all the class

crimson terrace
#

well Bukkit.getPlayerExact or what you used wont know the nicknames will it

west oxide
#

yes that's what hapenned

crimson terrace
#

you need to get the real name. getting Players by UUID is better tho imo

west oxide
#

ohh yeah true

#

i'll try that

#

wait but i'll still need to use this ?
Player target = Bukkit.getPlayerExact(args[0]);

crimson terrace
#

you will need some way to get the real name of the player, not the nick. or get the player by UUID

#

rn youre trying to get a player called "uwu" even tho thats not their name. its the nick

#

maybe save the used nick inside a config file with a list of uuids which have used that nick? could be bad on a big server or when you use nick a lot...

crimson terrace
#

so that you can get the player uuid by nickname

west oxide
#

is there a way to get the key of a value ?

crimson terrace
west oxide
#

rip

crimson terrace
#

maybe you want to make a hashmap like this when starting up the server? go through the entire config and from that create a hashmap which saves values as keys

west oxide
#

ok i will try that

#

ty so much

eternal oxide
#

Store the players nick in their PDC not a config. Grab it when they login and store it in a BiMap against their real name or UUID. You can then lookup from teh BiMap for every player thats logged in and get their real name and nick.

crimson terrace
#

config can be useful if you intend on storing a list of past nicknames

eternal oxide
#

?paste

undone axleBOT
eternal oxide
#

when a player sets a nick just call the setNickName method

west oxide
#

ooh

#

ty man

vague swallow
#

How can I make an invisible item frame Item?

quaint mantle
sullen marlin
#

jar will be in project.build.directory

#

name is governed by remappedArtifactId / remappedArtifactAttached

sweet pike
sullen marlin
#

same as changing the maven build directory normal

#

<build>
<outputDirectory></outputDirectory>

sweet pike
#

So under here?

sullen marlin
#

yes

sweet pike
#

and replaces it with the compiled classes files

sullen marlin
#

what are you trying to do

#

it is unusual to build outside your project dir

#

copy the jar after the build

sweet pike
#

Yeah but I am developing in mojang mappings, and I am trying to figure out how to make it work with hot swapping

#

but since thats a bit too hard, the least I am trying to do is to automatically move the spigot remapped jar to my plugins folder

sweet pike
sullen marlin
#

you can use the <outputDirectory> specialsource option

#

but again, this is highly unusual because not everyone trying to build your plugin will have the same folder as you

sweet pike
sweet pike
sullen marlin
#

no, put it in the specialsource <configuration> section

#

similar to whatever you are doing currently with whatever you are currently doing to get maven to put it in the directory you want

sweet pike
#

mb im not following

#

are you talking abt this?

sullen marlin
#

yes

#

but for the final execution

#

remapped-spigot

sweet pike
#

<outDir> or special source smt

sullen marlin
#

outputDirectory

sweet pike
sullen marlin
#

yes

sweet pike
#

what do I change to remapped-spigot

sullen marlin
#

add <outputDirectory> configuration

sweet pike
sullen marlin
#

yes

sweet pike
sullen marlin
#

yes

sweet pike
#

It seems to be working, however I am getting an error which is just listing my path

sweet pike
sweet pike
#

It seems as though the really obfuscated jar is being moved to my plugins folder

#

Because when I decompile the jar, this is what i get

ember estuary
#

Hey md_5, is there a Vehicle Steer Event?

#

like when you try to make a horse go forward by pressing w while sitting on it

lavish hemlock
#

you ever feel bes inside

#

yeah, me too

sweet pike
iron palm
#

why i cant get access to the NMS?

ember estuary
#

imported the wrong maven stuff? idk

#

did u put it in the maven file?

iron palm
ember estuary
#

u need those two, yeah

#

but nah

#

<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.17.1-R0.1-SNAPSHOT</version>
</dependency>

iron palm
#

ok...

ember estuary
#

u need that dependency

iron palm
ember estuary
#

and u need to do the buildtools stuff

#

yeah

iron palm
#
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.16.5-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>```
#

oh

#

rigght

ember estuary
#

<dependencies>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.17.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.17.1-R0.1-SNAPSHOT</version>
</dependency>
</dependencies>

#

thats spigot + nms

iron palm
#

ok

#

thanks

ember estuary
#

np

#

btw, do i need a <scope>provided</scope> for the nms?

#

didnt put and it works fine, but idk, maybe i should put it?

eternal oxide
#

yes

ember estuary
#

alright

iron palm
#

btw it cant find my version 1.16.5 after reloading maven

#
        <dependency>
        <groupId>org.spigotmc</groupId>
        <artifactId>spigot</artifactId>
        <version>1.16.5-R0.1-SNAPSHOT</version>
    </dependency>```
ember estuary
#

is it red?

iron palm
#

yea

undone axleBOT
ember estuary
#

add <scope>provided</scope>

#

xD

eternal oxide
#

did you run buildtoos for 1.16.5 ?

iron palm
#

i think i ran for 1.16.3

ember estuary
#

then thats the problem

iron palm
#

well yeah probably

ember estuary
#

So is there a VehicleSteerEvent? noone knows?

#

like maybe under a different name?

#

is it vehiclemoveevent? or does that also trigger when it gets moved or moves by itself?

#

yeah but that doesnt account for physics moving it

#

xD

#

gotta set up a packetreader and listen to steer packets then

#

why the heck is spigot so limited in functionality

#

so many useful packets but only a handful actually are implemented

sharp heart
#

Hello ๐Ÿ‘‹
How to set block facing direction (north ,south etc..) ?

ember estuary
#

is it rlly that hard to implement them all?

#

i dont get it

#

its around since 9 years or so, and still so many packets missing

#

cant use paper, as that wont work on spigot servers

#

cuz u can only use spigot-plugins on paper servers, but not paper plugins on spigot servers

#

xD

#

but not everyone uses paper

#

i want my plugins to be usable by everyone

#

so switching doesnt rlly make much sense

#

unless there is a method to include paper inside my plugin

quaint mantle
#

no

buoyant viper
#

as far as saying it doesnt account for physics moving it... maybe try EntityMoveEvent?

#

nvm EntityMoveEvent seems paper only

#

there does appear to be a VehicleMoveEvent tho

iron palm
ember estuary
#

the thing is, does the vehiclemoveevent also trigger when it moves by itself or by physics

#

cuz i think so

#

and that would make it equally as useless

buoyant viper
#

then i think just using PlayerMoveEvent is what you need

#

and check if theyre in a vehicle

ember estuary
#

nah xD

#

so what im ultimately trying to do, is make the player unable to do W/A/S/D/Space, but still detect him trying to do it

#

and still have physics affect him

iron palm
#

cant use nms
I have this on pom.xml

        <dependency>
        <groupId>org.spigotmc</groupId>
        <artifactId>spigot</artifactId>
        <version>1.16.5-R0.1-SNAPSHOT</version>
    </dependency>

but it cant get the version...

#

i also ran Buildtools 1.16.5

#

Cannot resolve org.spigotmcspigot1.16.5-R0.1-SNAPSHOT

ember estuary
#

restarted intellij?

iron palm
ember estuary
#

hmm

hybrid spoke
iron palm
hybrid spoke
#

also set the scope to provided

late sonnet
#

this and maybe check if when build in buildtools the .m2 has the created dependency (?

hybrid spoke
#

otherwise invalidate caches and build again

ember estuary
# iron palm spigotmc-repo ?

yeah

<repositories>
    <repository>
        <id>spigot-repo</id>
        <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
    </repository>
</repositories>
iron palm
hybrid spoke
#

or force install

hybrid spoke
#

just force install it, invalidate your caches and build again

#

"how do i force install?"
mvn clean install -U

iron palm
#

I dont have .m2

iron palm
#

weird

#

i got to know it can load up version 1.9-R0.1-SNAPSHOT

#

but my api verison is 1.16.5

valid solstice
#

Hello I'm using the conversation api, how'd i cancel the chat event of the input of the player that receives the conversation after the textprompt?

#
@Override
                        public Prompt acceptInput(ConversationContext context, String input) {
                            config.set("perks.detonation.power", Integer.parseInt(input));
                            player.resetTitle();
                            return Prompt.END_OF_CONVERSATION;
                        }```
#

the syntax is messed up in discord...

#

Thanks

valid solstice
ember estuary
#

Does the server calculate player movement by physics (falling, getting moved by water, getting pushed or hit), or does the client (and the server only validates it with a few simple checks)?

hidden tendon
#

Hello, I'm new to development and I am trying to get my intellij setup but I can't find the spigot api to download and import

#

I have gradle and all of it setup

valid solstice
#

Thereโ€™s a minecraft dev plugin in intelliJ, I use that for convenience

#

It uses maven

hidden tendon
#

Ohhh alright, does it have support for kotlin?

buoyant viper
ember estuary
#

oof, that sucks, so thats why theres so many hacked clients xD

#

thx, good to know

buoyant viper
quasi flint
#

minecraft gone dumb

ember estuary
#

same tho, but movement hacks were too high for me

#

i just made bots doing automated tasks

#

xD

quasi flint
#

damage

buoyant viper
#

same tbh, movement is hhh

quasi flint
#

add velocity

ember estuary
#

:D

quasi flint
#

theres ur basic speed

#

or long jump ih

buoyant viper
#

damage hacks dont count

#

smh

quasi flint
#

half a heart

#

then add velocity, even works without damage

buoyant viper
#

any damage is bad.. could be life or death

quasi flint
#

some bhops or on ground speed

ember estuary
#

but entity movement is calulcated by the player right?

quasi flint
#

ye

ember estuary
#

so when a horse gets moved by water, and a player rides it

#

is it then still calculated by the server?

quasi flint
#

i thin client calculates

#

and sends

ember estuary
#

i hope not

buoyant viper
#

i think non-player movement is server?

ember estuary
#

i'll try to find out

#

xD

quasi flint
buoyant viper
#

yeah but the server just receives input requests when ur riding

#

i think

ember estuary
#

that would be great

quasi flint
#

well then why is boat or horse fly a thing?

ember estuary
#

so there is PacketPlayInSteerVehicle and PacketPlayInVehicleMove

#

i wonder what the latter is for then

buoyant viper
ember estuary
#

xD

quasi flint
#

if purely the server handels it

buoyant viper
#

maybe its a mix

#

minecraft is the big fucky wucky

ember estuary
#

a mix? that would be confusing as heck

#

but yeah, as there is an extra PacketPlayInSteerVehicle , it might actually be a mix

valid solstice
buoyant viper
#

when entity is ridden, player controls it, when not, server controls it? idk

ember estuary
#

idk xD

ember estuary
#

what does serverbound mean? That the server sends it? or that he gets it

#

or just that it exists on the server side

#

probably that

young knoll
#

Serverbound means itโ€™s going to the server

ember estuary
#

ah ok

#

so the player sends a steer vehicle packet to the server, and a vehicle move packet to the server

#

is the vehicle move packet just for head-movement of the player?

#

or why would he send two things

#

confusing xD

valid solstice
#

User input in Conversation

gusty bough
#

Hey, Is there a way to paste a schematic at the center of it? (WorldeditAPI)
I want the schematic to be paste at 0,0 and have equal block length on all sides (so centered on 0,0)

sullen dome
#

afaik, a schematic uses the player's position as the middle-pos. so just be in the middle of the schematic, and when pasting it, just paste it at 0 0

gusty bough
#

y but that's all the complexity, players won't make the shematic at the middle

#

So i need to do it myself

young knoll
#

Just divide the length and width by 2 and add that to the paste location

#

Or subtract, whichever it is

gusty bough
#

But it just gives me the center of the schematic

sullen dome
#

that's what you want if you wanna center it

gusty bough
#

i wanna center it at 0,0

#

so i just add or substract the center compared to 0,0 and it should do it?

young knoll
#

Yes?

vernal sonnet
#

Where can I get the spigot 1.18 rc APIs for plugin updating?

eternal oxide
#

buildtools

vernal sonnet
#

Thanks!

rugged tusk
#

hey can someone help me i want to make a timer to time me n my friends during a race using command blocks can someone help me

visual tide
#

this is spigot plugin development help not cmdblock help

iron palm
#

I cant Import 1.16.5-R0.1-SNAPSHOT verison
And idk why help?

lusty cipher
upper glen
#

@vagrant stratus this is link fake

upper glen
maiden heath
#

No

#

You can't fake that

tender shard
#

Is it allowed for plugins to call PlayerDeathEvent?

maiden heath
#

Look at the domain

lusty cipher
tender shard
upper glen
#

1.18.json

#

json it's not exist

summer scroll
#

i guess you can do that

tender shard
# summer scroll sure

well the API docs say this, but I'm not sure what that's exactly supposed to mean:

#

so I guess it is NOT allowed to call a PlayerDeathEvent plugin-wise

summer scroll
tender shard
#

first link^^

#

it's the overview of the API docs

#

btw I'm asking, because MMOItems thinks it's a good idea to call a PlayerDeathEvent right after the original event, which of course fucks up all plugins listening to that event

torn shuttle
#

alrights boys, saddle up, here we go again

#

it's 1.18 time

tender shard
#

sooo I now have to go through the stacktrace to find out whether the PlayerDeathEvent is real or not

tender shard
#
    /**
     * MMOItems thinks it's a good idea to call a PlayerDeathEvent right after the original PlayerDeathEvent was called.
     * This is a very bad idea and there's no way to detect whether a listener gets passed a REAL PlayerDeathEvent,
     * or MMOItems' cursed fake PlayerDeathEvent, except by going through the current Thread's Stacktrace... smh
     * @param stackTrace StackTrace to check
     * @return true when the StackTrace contains MMOItems' classes, otherwise false
     */
    public static boolean isFakeDeathEvent(StackTraceElement[] stackTrace) {
        for(StackTraceElement element : stackTrace) {
            if(element.getClassName().contains("io.lumine.mythic")
                    || element.getClassName().contains("net.Indyuce.mmoitems")) {
                return true;
            }
        }
        return false;
    }
torn shuttle
#

that is a really weird call from mmoitems though, are you sure they're doing that?

mighty pier
#
        String playerPrefix = "";
        String message = e.getMessage();
        if (Utilities.api != null) {
            User user = Utilities.api.getPlayerAdapter(Player.class).getUser(e.getPlayer());
            if (user.getCachedData().getMetaData().getPrefix() != null) {
                playerPrefix = ChatColor.translateAlternateColorCodes('&', user.getCachedData().getMetaData().getPrefix());
            }
        }
        e.setFormat(playerPrefix + e.getPlayer().getDisplayName() + "ยงf: ");
        Bukkit.getServer().getPlayer("Frandma").sendMessage(message);
        if (e.getPlayer().hasPermission("utilities.colorchat")) {
            e.setMessage(ChatColor.translateAlternateColorCodes('&', message));
        } else {
            e.setMessage(message);```
#

it doesnt show the message

summer scroll
#

on the format

mighty pier
#

?

summer scroll
#

set the message on the format

mighty pier
#

how

summer scroll
#

AsyncPlayerChatEvent#getMessage

mighty pier
#

ok

#

you mean String message = e.getMessage();?

summer scroll
#

set it on the format

#

your event.setFormat

mighty pier
#

k

summer scroll
#

so, event.setFormat(whatever + message)

vernal sonnet
#

I ran build tools for 1.18 and it seems to be missing some stuff? It only has META-INF and org.bukkit.craftbukkit.bootstrap now?

#

Ran java -jar BuildTools.jar --rev 1.18

fast onyx
#

I'm getting this error

This is my pom.xml dependencies:

<dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.13-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.jetbrains</groupId>
            <artifactId>annotations</artifactId>
            <version>22.0.0</version>
        </dependency>
        <dependency>
            <groupId>com.github.cryptomorin</groupId>
            <artifactId>XSeries</artifactId>
            <version>8.3.0</version>
        </dependency>
    </dependencies>
#

I don't really know what is happening

#

I tried reloading maven and I don't even get any error on IDE

quaint mantle
#

is Xseries shaded within your jar

fast onyx
#

Mmm

#

Let me Google 1 think wait

#

Done

#

Thanks

ember estuary
#

@sullen marlin what tool did u use to get the MinecraftFont fontData?
You can't tell me u made all 255 chars from scratch