#help-development

1 messages · Page 1140 of 1

drowsy helm
#

I dont remember the exact name of the PE wrapper but it's name will be similar to the wiki vg name

glossy laurel
#

thx

#

how usually does this get updated btw?

#

sent, whatever

drowsy helm
#

very often

glossy laurel
#

ight, cool

drowsy helm
#

retrooper from this community is the dev for it, hes suiper active

glossy laurel
#

right so I've got the wrapper WrapperPlayServerPlayerInfoUpdate

#

how do I find the event

drowsy helm
#

as in how do you listen for it?

glossy laurel
#

yes

drowsy helm
#

and that in your main

glossy laurel
#

just one listener for all packets?

drowsy helm
#

indeed

#

usually you want to have multiple listeneres and just an if statement to discriminate

glossy laurel
#

fair enough

sly topaz
#

brother what are you doing

glossy laurel
#

yes?

sly topaz
#

we told you, use text displays, you're just going to suffer more with packets

drowsy helm
#

Yeah text displays would be a lot easier

#

Just version dependent

#

Blue line?

glossy laurel
#

.

sly topaz
#

why does that matter

glossy laurel
#

just

#

it does

sly topaz
#

you don't see that unless you press F3 + some key combo

glossy laurel
#

trust the process

sly topaz
#

or a hacked client

#

anyhow, you're using Paper right?

glad minnow
#

No Cartboard

sly topaz
#

if so, then just change the player profile

glossy laurel
glossy laurel
#

or to all

sly topaz
#

to everyone

glossy laurel
#

yeah thats an issue

sly topaz
#

you can still use it and just intercept the packet so that you can change what is displayed per player then

glossy laurel
#

whats the point then

drowsy helm
#

That seems like the same thing

#

Just backwards

sly topaz
#

setting the player profile without the API will cause desyncs you don't want to deal with

sly topaz
#

it doesn't matter what the client receives, but it does matter what the server has stored

glossy laurel
#

I dont get it

#

whats wrong with just intercepting it

#

without setting it beforehand

#

I dont even know what I would be supposed to set it to

#

his normal name

#

which it already is?

sly topaz
#

I mean, you could intercept it on join too, it's whatever

#

I was thinking you wanted to change it mid-game

glossy laurel
#

I did

sly topaz
#

then do what I suggested

glossy laurel
#

I dont understand what you are suggesting

sly topaz
#

setting the player profile will send a packet

glossy laurel
#

right

sly topaz
#

you intercept that packet and only change the name for every player

glossy laurel
#

okay but whats the point of the first change on the server

#

if it will be different for every player

sly topaz
#

ig it doesn't matter since you don't want it to be persistent anyway? Hm

#

changing the name requires sending a player info packet, and a respawn packet (among updating a bunch of other stuff)

#

however you aren't changing it in this case but just intercepting the player info packet for each player

sly topaz
#

I am not aware of whether that works properly, but you can try

glossy laurel
#

yk what

#

ill just try it

#

and come back when it doesnt work 💀

#

uhm so

#

how do I change a packet? 💀

slate siren
#

?paste

undone axleBOT
glossy laurel
#

Right i did that

#

But heres the issue

#

Changing game profile name changed both tab and above head

#

How do I only change above head

drowsy helm
#

Unless you also want to spoof the tablist separately

glossy laurel
#

Is that what .setPlayerListName

#

Does

#

Or whatever its called

sly topaz
#

yes

glossy laurel
#

I hate this so much

sly topaz
#

I mean, this is what you gotta do to not see a blue line

glossy laurel
#

Can I somehow make it ride the player 100 blocks higher?

sly topaz
#

what

#

what is "it"

remote swallow
#

Why do you have such an issue with a hit box line

glossy laurel
remote swallow
#

To who

glossy laurel
#

Me

remote swallow
#

You won't see it 90% of the time

glossy laurel
#

I just cant have it

remote swallow
#

Wait untill you find out any servers that use TAB to change overhead name use armor stands and just don't care about the hitbox line because most sane people can tell what the players hit box is

glossy laurel
#

Nah but thats just cap tbh

#

Im pretty sure pvplegacy doesnt do it like that 🤓

sly topaz
sly topaz
#

I didn't think that was all important in newer versions

#

since you don't have to be fast to aim, at least not as fast as one used to

glossy laurel
young knoll
#

What hitbox line are we talking about

glossy laurel
glossy laurel
#

.

glossy laurel
remote swallow
#

Yeah

glossy laurel
#

☠️

#

Why did noone tell me to use armor stands??

remote swallow
#

Because you shouldn't

glossy laurel
#

Cuz ngl, I dont think I saw a blue line with tab

remote swallow
#

And they still have blue lines

glossy laurel
#

Am I tripping then??

glossy laurel
remote swallow
#

Because they tick

#

There is an entity made to do it so use it

glossy laurel
#

I need old version support

glossy laurel
#

Cuz ngl I dont see no blue lines

#

Okay actually fair point

#

Making 2500 armor stands on a good day doesnt seem like the brightest idea

young knoll
#

Pretty sure they also have the line

#

?tas

undone axleBOT
chrome beacon
#

The marker flag might get rid of it

#

since that shrinks the hitbox to effectively 0

#

Will check give me a min

slender elbow
#

nah it still shows the direction vector pretty sure

#

the hitbox size is zero but it still exists

chrome beacon
#

Yeah you're right

#

It just ends up at the feet

slender elbow
#

feet

glossy laurel
chrome beacon
#

ok base plate

slender elbow
#

which is gonna be above your head anyway

slender elbow
chrome beacon
slender elbow
#

the entity exists and is there

glossy laurel
slender elbow
#

it's always gonna be above your head because it's gonna be riding the player

#

and that's where it is

echo basalt
#

it's always gonna give you head

glossy laurel
#

So ur telling me that there has always been a straight line at players head when using tab?

glossy laurel
slender elbow
#

if you play with hitboxes enabled yes

#

most people surprisingly don't

glossy laurel
#

I was waiting for someone to make that joke tbh

glossy laurel
#

I tend to forget to turn them off

slender elbow
#

ok and

young knoll
#

Tab didn’t have it as a passenger

#

Because it would be offset weirdly

#

Pretty sure they constantly teleported it

glossy laurel
warm musk
#

guys how to parse placeholder's placeholder

like %luckperms_prefix output is %img_player% but it does not parses given placeholder

#

how can i parse all given placeholders

young knoll
#

Use papi

#

I believe it’s a single method call

warm musk
#

i already use papi

#

if any placeholder gives another placeholder how can i parse?

young knoll
#

Uhh

#

I mean you can run it though the method twice

#

Idk if papi has a better system for that

warm musk
#

i think run PlaceholderAPI.setplaceholders() twice

#

not good idea

quartz gull
viscid carbon
#

java.lang.NullPointerException: Cannot invoke "me.arkallic.core.manager.TaskManager.getTasks()" because "this.taskManager" is null

#

But its not, It works in another method in the class just not there

sly topaz
young knoll
#

No

#

You can customize the translation of a text display

sly topaz
#

the order of initialization is messing with you most likely

#

make sure that taskManager is initialized before whatever class you are using

viscid carbon
# sly topaz make sure that taskManager is initialized before whatever class you are using

It is. It doesn't register till the player runs the command to open the GUI.

Taskmanager is before GUI

    private final RankManager rankManager = new RankManager(this);
    private final TasksFile tasksFile = new TasksFile(this);
    private final TaskManager taskManager = new TaskManager(tasksFile);
    private final PlayerDataManager playerDataManager = new PlayerDataManager(tasksFile, taskManager, rankManager, this);
    private final LangHandler langHandler = new LangHandler(this);
    private final GUIManager guiManager = new GUIManager();
    private final Listeners event = new Listeners(this);
    private final Commands cmd = new Commands(this);
#
   public void onEnable() {
        tasksFile.initialize();
        taskManager.initalize();
        langHandler.initialize();
        //Commands
        cmd.register("core", new CoreCommand(playerDataManager));
        cmd.register("rank", new RankCommand(rankManager, playerDataManager));
        cmd.register("setrank", new SetRankCommand(rankManager, playerDataManager));
        cmd.register("home", new HomeCommand(playerDataManager, langHandler));
        cmd.register("sethome", new SetHomeCommand(playerDataManager, langHandler));
        cmd.register("deletehome", new DeleteHomeCommand(playerDataManager, langHandler));
        cmd.register("maxhomes", new MaxHomesCommand(playerDataManager));
        cmd.register("tasks", new TasksCommand(taskManager, guiManager, playerDataManager));

        //Listeners
        event.register(new PlayerDataListener(playerDataManager, langHandler));
        event.register(new PlayerJoinListener());
        event.register(new TaskListener(taskManager, playerDataManager));
        event.register(new GUIListener(guiManager));

        //Reload
        for (Player player : Bukkit.getOnlinePlayers()) {
            playerDataManager.register(player.getUniqueId());
        }

        getLogger().info("Core is online!");

        this.saveDefaultConfig();
    }```
#
Caused by: java.lang.NullPointerException: Cannot invoke "me.arkallic.core.manager.TaskManager.getTasks()" because "this.taskManager" is null
        at me.arkallic.core.gui.TasksInventory.createInventory(TasksInventory.java:51) ~[?:?]
        at me.arkallic.core.gui.InventoryGUI.<init>(InventoryGUI.java:19) ~[?:?]
        at me.arkallic.core.gui.TasksInventory.<init>(TasksInventory.java:24) ~[?:?]
        at me.arkallic.core.command.TasksCommand.onCommand(TasksCommand.java:44) ~[?:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot-api-1.21.1-R0.1-SNAPSHOT.jar:?]```
hybrid spoke
#

and where its used

#

?paste

undone axleBOT
viscid carbon
hybrid spoke
#

is the inventory using the TaskManager initialized before the TaskManager is initialized? in like, another constructor or whatever?

river oracle
#

use a debugger

#

or just run sysouts as you approach

hybrid spoke
#

or are you trying to use the same inventory perhaps after a reload?

hybrid spoke
#

there you have your answer

#

that wont work anymore

river oracle
#

:] /reload isn't supported

hybrid spoke
#

rather close the inventory when disabling the plugin for everyone that has it open

river oracle
#

this is why everyone should use InventoryView's instead that way its pretty clear you shouldn't keep em over reloads

worldly ingot
#

Any time I browse the channel there's like a 75% chance he's shilling KEKW

river oracle
#

this one isn't a shill for new API its how I've always done things 💪

#

though... If you don't mind I have some words to say about new API

worldly ingot
#

I just realized... did you review your own CB PR? lol

river oracle
#

yeah I did

river oracle
viscid carbon
worldly ingot
#

You only just removed it from draft status yesterday!

river oracle
#

yeah I'm kinda next level like that

#

just moved from draft status and I already reviewed my own PR

#

the speed is stunning

river oracle
#

it makes it pretty clear about the data etc that should be in that menu

viscid carbon
river oracle
#

I use a similar, but imho less naively implemented approach that does everything based off of InventoryView well in my case MenuScene because I wrote my own equivalent in NMS for my library

#

generally I feel like this gives the best results when it comes to interactable menus

viscid carbon
#

Why did they make inventories api so dumb xD

river oracle
#

its just 8 years outdated

viscid carbon
#

I think its time for an update 😉

river oracle
#

The Inventories themselves shouldn't even be creatable imho

#

but you can use them here regardless kind of as a proxy view

#

just ensure 1 inventory per player

#

and don't save those views unless they store information, in which case they shouldn't be saved as inventories, but some other digestable structure you can use around your code

#

e.g. I have a collector plugin which provides a view of item stacks. I have my
CollectorMenu(SyncContainer)
these SyncContainers store all items that need to be serialized deserialized etc to bytes, and they contain a synchronize method which does the job of syncing all views.

remote swallow
#

I recognise that from somewhere hmmmm

river oracle
#

I'd be concerned for your memory if you didn't remember

sly topaz
river oracle
sly topaz
#

bro has early onset alzheimer's

remote swallow
#

Where am i

manic delta
#

How can I make a player open the inventory of a block (barrel) with code

#

im trying with this but no inventory opens

river oracle
#

Well yeah you only allow it to be opened if it's locked

#

That's just a faulty if statement

manic delta
#

but allow admins to open

#

i know i can use nbt but

#

ehhh

river oracle
#

Use pdc

manic delta
#

what is pdc?

river oracle
#

?pdc

river oracle
#

You can use PDC on tile entities

manic delta
#

damn so i cant just use lock 😭

#

now i have to modify the code again

river oracle
#

I mean you maybe can

manic delta
#

i can clone the inv

#

but i just want to open that inv

river oracle
#

Again not opening is pretty vague

#

I'd need to know exactly what's happening

#

Bad if statement etc

manic delta
#

nope

river oracle
#

Does it appear for a second than go away?

manic delta
#

ive used sout before

#

to check if the problem was the ifs

manic delta
river oracle
#

What version are you programming for

manic delta
#

1.21.1

river oracle
#

Alright give me a few minutes I'll pop open craft bukkit

#

I need to see what's going on here with min dif

manic delta
manic delta
river oracle
#

I think its possible the loc logic may be overriding the opening

river oracle
#

one sec let me check again

#

I might be wrong

manic delta
#

okie

manic delta
#

it is weird, it should work

river oracle
#

depends on how internals of the lock key work

manic delta
#

ye

young knoll
#

Lock just requires an item with the right name atm

manic delta
river oracle
#

I think its some faulty logic

#

I can't replicate this

manic delta
#

yea damn

#

so i need to use nbt 😭

river oracle
#

I got it working with locks?

#

It works with and without the scheduler

#

full minimum def code

    @Override
    public void onEnable() {
        getServer().getPluginManager().registerEvents(this, this);
        getCommand("test").setExecutor(new TestCommand(this));
    }

    @EventHandler
    public void onInteract(PlayerInteractEvent event) {
        if (event.getAction() != Action.LEFT_CLICK_BLOCK) {
            return;
        }

        if (event.getClickedBlock().getType() != Material.BARREL) {
            return;
        }

        final Barrel barrel = (Barrel) event.getClickedBlock().getState();
        if (!barrel.getLock().equalsIgnoreCase("funky")) {
            barrel.setLock("funky");
        }

        if (barrel.isLocked()) {
            Bukkit.getScheduler().runTaskLater(this, () -> {
                System.out.println("here");
                event.getPlayer().openInventory(barrel.getInventory());
                event.getPlayer().playSound(event.getPlayer().getLocation(), Sound.BLOCK_ANVIL_LAND, 1.0f, 1.0f);
            }, 20L);
        }

        event.setCancelled(true);
    }```
manic delta
#

ive tried with scheduler before but ill try with more seconds

river oracle
#

you don't even need the scheduler

#

for me it works without it

manic delta
#

wtf

#

lol

#

mmm

#

why

river oracle
#

because you have some logical error

manic delta
#
@EventHandler
    public void onBarrelUse(PlayerInteractEvent event) {
            if(event.getHand() != EquipmentSlot.HAND) return;
            if(event.getAction() != Action.RIGHT_CLICK_BLOCK) return;
            Block clickedBlock = event.getClickedBlock();
            Player player = event.getPlayer();
            CooldownManager cooldownManager = KobasPub.getPlugin().getCooldownManager();


            if (clickedBlock.getType().equals(Material.TRIPWIRE_HOOK)) {

                if(cooldownManager.hasCooldown("tripwire", player.getName(), 3)){
                    player.sendMessage(color("&c¡Espera un poco para hacer esto denuevo!"));
                    return;
                }

                TripwireHookHandler handler = new TripwireHookHandler(clickedBlock, player);
                if (!handler.isValidBarrel()) return;
                Barrel barrel = handler.getBarrel();
                if(!barrel.isLocked()){
                    barrel.setLock(player.getName());
                    barrel.update();
                }
                handler.powerTripwireHook(true);
                delayedTask(() -> handler.powerTripwireHook(false), 1.5);
                player.getInventory().addItem(barrel.getInventory().getItem(0));
            }

            if (clickedBlock.getType().equals(Material.BARREL)) {
                Barrel barrel = (Barrel) clickedBlock.getState();
                if (barrel.isLocked() && player.hasPermission("kobaspub.inspect")) {
                    /*Inventory pInv = Bukkit.createInventory(null, InventoryType.BARREL, "Almacén");
                    pInv.setContents(barrel.getInventory().getContents());*/
                    delayedTask(() -> player.openInventory(barrel.getInventory()), 2);
                }
            }

    }
#

mm

river oracle
#

my only guess is its not passing your inner if statement

#

I also double checked it works with right click too

manic delta
#

ive modified to this

river oracle
#

I don't think its even reaching that code

manic delta
#

but its printing opened

#

lol

#

look at the chat

river oracle
#

weord

river oracle
#

for some raeson

manic delta
#

but im trying opped and not

#

😭

torn shuttle
#

christ

#

I am actually creating a monster

#

and I can't do anything about that

#

this is sort of cursed

river oracle
#

its 100% with locks

#

you need to use PDC instead

manic delta
#

😢

#

damn

#

ill rewrite the code then

#

thank you for the help!

river oracle
# manic delta 😢

it delegates the open method to createMenu which checks if you have a valid lock

#
    @Nullable
    public Container createMenu(int var0, PlayerInventory var1, EntityHuman var2) {
        if (this.canOpen(var2)) {
            this.unpackLootTable(var1.player);
            return this.createMenu(var0, var1);
        } else {
            return null;
        }
    }```
#

essentially you can't open it without a lock no matter what

#
    public boolean canOpen(EntityHuman entityhuman) {
        return canUnlock(entityhuman, this.lockKey, this.getDisplayName());
    }```
manic delta
#

damnn

river oracle
#

it'd be innapropiate for us to go actually do anything about this too

#

Locks are kinda just blegh

manic delta
#

yea ill have to make it by other way damn

#

thank you so much!!!

river oracle
#

PDC is an easy solution <3 it'll be pretty much a simple drag and drop for the most part

#

anything you're doing with locks can be replaced with a pdc stored string

manic delta
#

yea

#

ill do with that

fading drift
#

what does setMaximumNoDamageTicks do

manic delta
#

thank you so much

river oracle
#

?jd-s

undone axleBOT
fading drift
#

"Sets the living entity's current maximum no damage ticks." doesn't really help

#

what are maximum no damage ticks

river oracle
#

invulnrability ticks I'd assume

#

maximum no damage ticks is pretty much anagolous to the concept of invulnrability I'm assuming its under a different name to reduce confusion between setInvulnrable and this

#

the interanl name is legit public int invulnerableDuration;

fading drift
#

whats the difference between setMaximumNoDamageTicks and setNoDamageTicks

river oracle
#

they are the same

#

it seems

#

not sure why they both exist in the API

fading drift
#

weird

wet breach
river oracle
#

yes

#

they set the same exact field

wet breach
#

of course the set the same field

river oracle
#

oh wait no I fucked up

#

they are named slightly differently lol

#

thanks for questioning me

young knoll
#

But like

#

What do they do

river oracle
#

one is named invulnerableTime and one is named invulnerableDuration

wet breach
#

the first one sets a time period they are invulnerable

#

the second is permanent with no tracking how long

young knoll
#

Then why does it take an int

river oracle
# young knoll Then why does it take an int

if ((float) this.invulnerableTime > (float) this.invulnerableDuration / 2.0F && !damagesource.is(DamageTypeTags.BYPASSES_COOLDOWN)) { // CraftBukkit - restore use of maxNoDamageTicks

#

that's where its duration

wet breach
#

yeah mojang is weird

river oracle
#

the naming is so weird

#

but whatevs

wet breach
#

yeah that too

young knoll
#

So for an entity to be invulnerable the invulnerable time has to be > half the invulnerable duration

river oracle
#

also invulnerableTime ticks down every tick

young knoll
#

What’s the default invulnerable duration

river oracle
#

where as invulnerableDuration does not

river oracle
#

so if you set it to 0 as long as invulnerableTime > invulnerableDuration you can't take damage?

young knoll
#

Is it 0 by default

river oracle
#

its 20 by default

young knoll
#

I see

#

So invuln time needs to be > 10 to actually apply

#

By default

river oracle
#

yeah

#

weird very weird

young knoll
#

That explains why setting it to 1 didn’t work

river oracle
#

that's such a weird calculation

#

that defininetly needs javadoc explanation

young knoll
#

The comment is also interesting

#

We restored the use of it? Was it removed at some point

river oracle
#

yeah it makes me think it was originally removed

#

let me look at vanilla

#

OrbitMC Ftw

young knoll
#

Makes sense it was removed

#

Because like… why

river oracle
#

its legit not used in vanilla

#

this is some weird CraftBukkit thing

#

the field just exists in Vanilla but its never used

#

my guess is this some weird backwards compat play

wet breach
#

you would need to find the commit for it

#

and read the comment

river oracle
river oracle
#

with no further explanation

young knoll
#

I’m just wondering why the heck it was a thing in the first place

river oracle
#

my assumption is mojang removed it in 1.17 and this provides backwards compat

young knoll
#

A simple tick counter for invulnerability makes sense, idk why some weird math would need to exist

river oracle
#

in vanilla now its just the tick counter

young knoll
#

Yeah but I’m wondering why Mojang had it in the first place

#

It must have had a purpose at some point

river oracle
#

Maybe its some notch era thing 🤷‍♂️

#

where he was like oh this is such a great idea

young knoll
#

Imo it would make more sense to remove the patch and deprecate the method (and just have it do nothing)

#

but ¯_(ツ)_/¯

river oracle
#

it also makes setNoDamageTime more ambiguous

young knoll
#

I can’t imagine many

#

Especially since the docs provide no detail on what it does

river oracle
#

I'd imagine anyone who does use it thinks its broken as well

#

and likely dips into NMS

young knoll
#

It being 20 by default is extra weird

#

Means setting invuln time to < 10 doesn’t actually do anything

river oracle
young knoll
#

Yeah idk

#

It’s technically a breaking change

#

But the patch is a deviation from vanilla behaviour, which is also not ideal

river oracle
young knoll
#

Idk

#

Isn’t the invuln time used for the immunity frames when stuff gets damaged

#

Does this make them shorter than they should be?

river oracle
#

I feel like its gotta be pretty unnoticable if no one has noticed, but whether it should continue to be like that is another question

young knoll
#

Presumably it’s 10 ticks shorter

#

That’s a decent amount of time

river oracle
#

ohh

#

this makes so much more sense now

#
// Vanilla
if (this.invulnerableTime > 10.0F && !damageSource.is(DamageTypeTags.BYPASSES_COOLDOWN))

// CraftBukkit
f ((float) this.invulnerableTime > (float) this.invulnerableDuration / 2.0F && !damagesource.is(DamageTypeTags.BYPASSES_COOLDOWN))
#

Vanilla just inlined it, that or my decompiler inlined it because it was never changed and was final

young knoll
#

So in vanilla invuln time also has to be above 10 for it to work

river oracle
#

yeah, again a weird choice, but it seems the only difference is the inline

young knoll
#

Weird but okay

river oracle
#

so it seems the API allows you to modify the weird modifier for the invulnerableTime to work

young knoll
#

Maybe something uses that value of 10 client side

#

Like the red damage tint, idk

river oracle
#

possibly

young knoll
#

Or maybe Mojang just wants 10 to be the new 0

river oracle
#

10 is 0!

#

It gets even weirder though

#

invulnerableTime is never used on the Player

young knoll
#

How do player iframes work then

river oracle
#

20 is applied for all living entities besides a few

#

but everything else is done through yet another field

#

like spawnInvulnerableTime instead of using the already existing one

young knoll
#

Mojank

river oracle
#

also the 10 can't be a client thing

#

the hurtDuration is yet another field for animation the hurt

#
   @Override
   public void animateHurt(float f) {
      this.hurtDuration = 10;
      this.hurtTime = this.hurtDuration;
   }```
#

TIL this is fucking weird and those spigot docs need to be better

young knoll
#

hurtTime

#

hurtDuration

#

How many fields does one need for an iframes system

torn shuttle
#

clearly you've never been in pain

river oracle
young knoll
#

Pretend I have nitro and that’s the actual :mojank: emote

river oracle
#
if ((float) this.invulnerableTime > (float) this.invulnerableDuration / 2.0F && !damagesource.is(DamageTypeTags.BYPASSES_COOLDOWN))

Basically if this statement is false

                // CraftBukkit start
                if (!this.actuallyHurt(damagesource, (float) event.getFinalDamage(), event)) {
                    return false;
                }
                this.lastHurt = f;
                this.invulnerableTime = this.invulnerableDuration; // CraftBukkit - restore use of maxNoDamageTicks

this code runs and the invulnerableTime is updated to the invulnerableDuration which gives exactly half of the invulnerableDuration iFrames

torn shuttle
#

oh no

#

this is really cursed guys

#

I don't know if I should enforce 2-way validation

#

I think I have to?

river oracle
torn shuttle
#

yeah I don't think I have a choice here

young knoll
#

So if you hit something while it’s invulnerable it’s remaining invulnerability time changes?

torn shuttle
#

I picked one hell of a project to stop drinking coke 0 for

fading drift
river oracle
#

that's it

#

its a constant

fading drift
#

oh

#

so I shouldn't ever need to set it unless I change it

river oracle
#

I'd imagine setting it could fuck other plugins over

#

I would avoid setting that value tbh

young knoll
#

Ah I think I see what happens

#

If you deal more damage during the iframes, the difference is dealt to the mob and the iframes are refreshed

young knoll
#

And increasing the duration of iframes isn’t linear

#

With a value of 20 you get 10 ticks of invulnerability (default)

#

If you set it to 50 you’d have 25 ticks

river oracle
#

I still don't really get the point of dividing it in half couldn't you just set the half value

young knoll
#

Yeah idk

#

If it was me I’d just set the actual value

#

Ie a value of 20 would be 20 ticks of invuln, 50 would be 50, etc

#

¯_(ツ)_/¯

river oracle
#
    /**
     * Sets the living entity's current no damage ticks.
     * <p>
     * Setting the ticks value to less than {@link #getMaximumNoDamageTicks()} / 2
     * provides no ticks of invulnerability frames. To ensure invincibility
     * frames actually occur you must set an amount of ticks greater than
     * {@link #getMaximumNoDamageTicks()} / 2
     *
     * @param ticks amount of no damage ticks
     */
    public void setNoDamageTicks(int ticks);
``` I feel like this clarification would help
#

tho I'm going to definitely need to test this before

#

to ensure I'm not tripping

young knoll
#

You can drop the tick speed to test more accurately if needed

#

(Love that feature Mojang <3)

river oracle
#

Ik its great

#

oh stepping would be great here

#

I could also probably use a debugger

#

I'll look at it closer tomorrow If I get time ig

torn shuttle
#

ok

#

I think I have it figured out

#

this is going to be as fun as it will be tricky to make work

#

this is probably the first O(no) notation code I've ever written

#

it's pretty bad 🤡

ancient plank
#

lol

fading drift
#

if I'm using spigot 1.8.8 what would be the best way to place/remove smallish 10x10x10 structures

#

I really don't want to use worldedit and I think the structure api hasnt been added yet

#

should I write my own filetype which is just a big array

torn shuttle
#

who doesn't like iterating through over 3000 elements per 16x16x16 piece of terrain on the lowest end possible, with no real ceiling?

#

actually it's probably way more

#

I don't want to update the math

fading drift
#

what would be the best way to go about it

rough ibex
#

1.8.8
augh

wet breach
#

Always fun when you find weird code with no clear documentation to it lol

glossy laurel
#

How do I shade a plugin into my plugin jar

blazing ocean
#

you don't

glossy laurel
#

How do I shade packet events into my plugin

#

😎

torn shuttle
#

aw hell yeah

#

the infinite city generation is going great

blazing ocean
glossy laurel
blazing ocean
#

If you shade PE, then you'll have to release a plugin update for every PE update

#

aand if you don't, there's no need

torn shuttle
#

ok so now to account for every possible rotation

#

with every single interaction this thing can have

#

I'm sure this will be computationally cheap

#

trust

glossy laurel
#

Okay guys

#

How do I spoof the tab list with packetevents

#

Dont ask why I need to

fair rock
carmine spoke
#

Hi, I'm currently refactoring somethings in a fork of a invs lib, my problem is about the opening/closing menus and setting items during click event, which need to be sent in next tick or it won't work (As warned in the javadocs), so I'm thinking of an approach which what literally does is:
Take the operation -> Schedule it directly to the next tick

Some advantages from my prespective and from what I really want to solve:

  1. Boilerplate code: No need for plugin.getServer().getScheduler().runTask(() -> openInv()) which literally looks like PSVM but being put in every single piece of code.
  2. Consistency: No more guesses whether the item is shown or not, next tick guarantees the item being set.
  3. No more player#updateInventory which literally sends a whole inventory everytime I want to modify a single item?

Cons:

  1. Not consistent in rare scenarios: If the player sent a click/open/close/(set item) event in the next tick and got fired before my scheduled task (i didn't really test if scheduled tasks get fired before the events/interactions made by players).

Pseudocode Example:

Menu{

  void open(Player player){
     schedule(() -> player.openInventory(inv));
  }
  void close(Player player){
    schedule(() -> player.closeInventory());
  }
  void set(int i, ItemStack stack){
    schedule(() -> inv.set(i, stack));
  }


  void schedule(Runnable task){
    scheduler.runTask(task); // BukkitScheduler#runTask runs the task on the next tick.
  }
}

However, as I didn't see it before, does it have any potential drawback would you guys think about? Like for now I don't see anything wrong with this design approach, because literally opening a new menu when clicking an item in another menu is a PAIN even tho it's basic stuff.

Is it poor practice? or the proper way of handling inventory events? (Also I'm 100% sure my invs will only and only be modified from my wrapper, it's not for public btw)

#

Feel free to @mention

carmine spoke
#

PSVM? public static void main args

torn shuttle
fair rock
lost matrix
sullen marlin
#

gimme some of that quantum noise

young knoll
#

Why use simplex noise when you can use advancple noise

torn shuttle
#

who do you think I am doing that boring simplex shit, imillusion?

cedar saffron
#

@echo basalt

orchid brook
#

Im making an auto condense plugin, what event should i listen ? PlayerPickupItemEvent work great, but... if i give people item, is PlayerPickupItemEvent is fired or not ? If not what event should i use instead ?

#

Maybe should i listen SET_SLOT packet with protocolib api ?

pallid escarp
#

How can I disable light level requirement for planting and growing crops?

orchid brook
#

I think u can listen BlockGrowEvent event, check if the block is a crop that has light requirements like wheat / carrot etc and then setCancelled(false) the event, that will ensures the crop will grow no matter the light level

eternal oxide
#

no grow event will fire if its not trying to grow, so has light

orchid brook
#

yep u right idk soo

eternal oxide
#

A grow event only triggers if all conditions for the crop to grow have been met

pallid escarp
#

So basically I have to manually check for all crops in player's range and then execute my custom logic for found crops? Like coding another random tick feature?

blazing ocean
glossy laurel
#

Which field

blazing ocean
#

?

glossy laurel
blazing ocean
#

what are you trying to do

#

"spoof the tab list" can mean anything

glossy laurel
vagrant stratus
#

ahh, packets are "fun" lmao

vivid skiff
#

Is there someway of making this task more efficent, it's currently running async and the metrhod isInViewDistance just calculates the distance from the corpse npc to the target player, but it makes the server lag

    public void run() {
        corpsesManager.getAllCorpses().forEach(corpse -> {
            Bukkit.getOnlinePlayers()
                    .forEach(player -> {
                        if (isInViewDistance(player, corpse)) {
                            if (!corpse.isVisibleFor(player)) corpse.setVisibleFor(player);
                            return;
                        }

                        if (corpse.isVisibleFor(player)) corpse.setHiddenFor(player);
                    });
        });
    }```
chrome beacon
#

Don't duplicate the isVisibleFor call

#

Other than that get us a spark report of the lag caused

worldly ingot
#

Yeah I don't imagine this is the thing causing your issue

slender elbow
#

i mean, a) if it's running async, that code can't cause lag, b) that is likely not thread safe lol

chrome beacon
#

^^

orchid brook
#

is there a way to detect every time a player gets an item ? i know about the PlayerPickupItemEvent but im asking for a way to check for a player receiving an item in any way, including Player#getInventory()#addItem(ItemStack...), i want to make an auto-condense plugin

eternal oxide
#

no, not unless you constantly monitor the inventory using a snapshot

orchid brook
#

So if I understand correctly, I need to perform a task every X time to check the inventory of all players who have autocondense enabled, and then condense items if possible. is this will be resource-intensive ?

eternal oxide
#

depends how you write it

#

every x take an inventory snapshot, pass it off to an async task to compare.

worldly ingot
eternal oxide
#

if it has changed since the last snapshot, condense and update changes

orchid brook
eternal oxide
#

thats up to you to decide

#

however, as you are making changes to the inventory you have to be careful it doesn;t change between the time you take your snapshot, condense and then update

orchid brook
#

I have no idea how much this can impact a server's performance. But anyway while it's in a async task this shouldn't be an issue right ?

orchid brook
orchid brook
torn shuttle
#

I done goofed

#

rewrites are fun

rough drift
torn shuttle
#

yes

#

well

#

it will be once it works

#

right now it's just a bfm

rough drift
#

I love WFC tbh

torn shuttle
#

well

#

so technically I am pretty sure this is so different from wfc that it maybe couldn't be considered 100% that anymore

#

I'm trying to improve on its limitations

#

it uses a border/tag system instead of a list of valid adjacent tiles and it natively supports any individual tile rotation (except when a tile is configured to affect the rotation of tiles above itself)

#

but those are non-trivial differences

rough drift
#

i.e.

#
|  #  |
|  #  |
|  #  |
|  #  |
|  #  |

this makes a 5x5 grid where the center has to be filled on that side

torn shuttle
#

I'm not sure I get that illustration

rough drift
river oracle
#

I love figuring out how stuff works it's one of my favorite things about programming

proper cobalt
#

was gonna ask - the new item displays, how can i set like a nametag above them, like a hologram, just needs to be 1 simple number

river oracle
proper cobalt
#

were chillin

river oracle
#

W

torn shuttle
#

but I do that with tags

proper cobalt
#

Awesome, lets sell this to kids for 50$ a spin

#

(joke)

torn shuttle
#

also not only am I using tags instead of tiles but I allow any rotation

#

which I must say does complicate things

glossy laurel
fading drift
#

how would I save the type of block such as type of log and set it later for 1.8.8

#

I know support isnt offered but I can't hurt to ask

glossy laurel
#

.getType()?

#

or did that not exists 10 years ago

fading drift
#

sets the block but default settings

glossy laurel
#

yeah

#

aint that what u want

fading drift
#

I need to save and set the correct colored clay and orientation of slabs etc

glossy laurel
#

"type of log" 💀

#

very real

fading drift
#

yeah 💀

eternal oxide
#

damage values

cold oyster
#

is there really no way to download resources from spigotmc api without web scraping

young knoll
#

Did getState exist back then

fading drift
#

yeah but no setState so

young knoll
#

That copied all of the blocks data

cold oyster
#

what

young knoll
#

Assuming you want to place it back in the same spot

#

Otherwise I think getData would get you the extra data

fading drift
#

tried getdata and then getstate.setdata and doesnt work

#

just doesnt set the data I guess

soft agate
#

it may sound like a dumb question but i cant find the material for an itemstack material on 1.21

fading drift
#

ill do some debugging

young knoll
#

I believe there was a setTypeAndData or something

native ruin
#

I'm striking lightning on a trident in a projectilehit event and that destroys the trident
I am trying this to stop it, but noticed I the events never get logged, is this another event? if so which one is it?

@EventHandler
    public void dontDestroyTridentPls(EntityDamageEvent e){
        Bukkit.getLogger().info(e.getCause().toString());
        Bukkit.getLogger().info(e.getEntityType().toString());
        if(e.getCause() != EntityDamageEvent.DamageCause.LIGHTNING) return;


        if(e.getCause() != EntityDamageEvent.DamageCause.FIRE) return;
        if(e.getEntity() instanceof Trident){
            e.setCancelled(true);
        }
    }
    @EventHandler
    void a(EntityDeathEvent e){
        Bukkit.getLogger().info(e.getEntity().toString());
    }
glossy laurel
slender elbow
soft agate
#

the material for an itemstack

slender elbow
#

getState returns a snapshot, you need to call BlockState#update

glossy laurel
#

maybe?

young knoll
#

Yeah it’s just getType

fading drift
#

so getstate.setdata and then getstate.update?

soft agate
#

oh thanks

slender elbow
#

getState returns a copy

#

put it in a variable

soft agate
#

ive used it like this:
ItemStack WIP = new ItemStack(Material.GRAY_STAINED_GLASS_PANE);

#

in 1.19.2

glossy laurel
#

that doesnt work?

young knoll
#

Yes that’s still the same

soft agate
#

no

glossy laurel
#

errors?

young knoll
#

Does the material class not exist?

carmine mica
#

how do people not update intellij regularly?

young knoll
#

Well enum but shh

fading drift
river oracle
young knoll
#

Yeah update IntelliJ

soft agate
glossy laurel
young knoll
#

Yes

glossy laurel
#

damn

glossy laurel
slender elbow
young knoll
#

Do you need the toolbox to get the proper version?

slender elbow
#

toolbox 🙏

slender elbow
young knoll
#

Ah

#

How does it differ from the update function in the ide

slender elbow
#

i don't know and frankly i don't care

soft agate
young knoll
#

Yes

glossy laurel
#

Just messed with packets

slender elbow
glossy laurel
#

no clue what I did but it works so 👍 😃

slender elbow
#

idk if toolbox is

soft agate
#

fk uhm im going to update in a sec

young knoll
#

Well over

glossy laurel
soft agate
#

worked fine with 1.19

glossy laurel
#

considering the fact that people use 10 year old mc versions

#

its fine

young knoll
#

1.19 didn’t use java 21

glossy laurel
soft agate
glossy laurel
#

my intellij is 2023.3.4

#

im so pro

young knoll
#

Does IntelliJ follow some sort of quarterly release like eclipse does?

glossy laurel
#

the cause cant be fire and lightning simultaniously

paper viper
glossy laurel
young knoll
#

Does 2023.3.2 refer to Q3 2023?

slender elbow
#

the events never get logged
did you register your listener

glossy laurel
#

and then made it return if cause isnt lightning

#

💀

slender elbow
#

ok that doesn't change the fact that they are logging at the very beginning of the listener and nothing gets logged

native ruin
young knoll
#

?

#

Does it run or not?

native ruin
#

there are some other events that do work

slender elbow
#

you said it doesn't get logged lol

#

so that EventHandler isn't fired

#

but others in the same class are?

native ruin
#

yeah, the trident still gets destroyed, I think its an entity but I can't seem to find an event that logs its destruction

slender elbow
#

that is not what i asked 😭

glossy laurel
soft agate
#

uhm

#

why does 2024 looks like vsc

#

its like exactly the same

young knoll
#

Out of context that’s an interesting statement

native ruin
glossy laurel
slender elbow
native ruin
#

yea

#
public class ChannelInRain implements Listener {
    @EventHandler
    public void onLaunch(ProjectileLaunchEvent e) {

    }

    @EventHandler
    public void onHit(ProjectileHitEvent e) {

    }
    @EventHandler
    public void dontDestroyTridentPls(EntityDamageEvent e){
        Bukkit.getLogger().info(e.getCause().toString());
        Bukkit.getLogger().info(e.getEntityType().toString());
      /*  if(e.getCause() != EntityDamageEvent.DamageCause.LIGHTNING) return;


        if(e.getCause() != EntityDamageEvent.DamageCause.FIRE) return;
        if(e.getEntity() instanceof Trident){
            e.setCancelled(true);
        }*/
    }
    @EventHandler
    void a(EntityDeathEvent e){
        Bukkit.getLogger().info(e.getEntity().toString());
    }
    @EventHandler
    void b(EntityDamageByEntityEvent e){
        Bukkit.getLogger().info(e.getCause().toString());
    }
}
#

onlaunch and hit log

thorn crypt
#

Hey, I want from my plugin to be able to send a player to my bungeecord server called "lobby" and found I could be able to use this :

ByteArrayDataOutput out = ByteStreams.newDataOutput();
            out.writeUTF("Connect");
            out.writeUTF("lobby");
            Player player = Bukkit.getPlayerExact(p.getName());
            player.sendPluginMessage(MyTumble.getInstace(), "BungeeCord", out.toByteArray());

but it never send me to the server lobby

glossy laurel
#

did you register the handlers?

fading drift
#

anyone know the default values of update(boolean force, boolean applyPhysics)

young knoll
#

false, true

slender elbow
#

false, true

#

damn

glossy laurel
#

crazy

#

also wtf are default values

#

bro

#

its all in the docs

worldly ingot
worldly ingot
#

Not fast enough anymore

young knoll
#

Force will override any other block that may have replaced the one the state represents

young knoll
#

And applyPhysics I’m sure you can guess

glossy laurel
chrome beacon
#

They scrape and cahce things for you

fading drift
#

my fault I didn't scroll further enough in the docs

slender elbow
chrome beacon
#

(or so I assume)

young knoll
#

You can do what

#

Are you the doctor

thorn crypt
worldly ingot
slender elbow
#

yeah but like when

#

in an event? what event? in a command?

fading drift
#
                                Block blockAt = player.getWorld().getBlockAt(x, 100 + y, z);
                                blockAt.setType(block.getType());
                                System.out.println("Data: " + block.getState() + " Type: " + block.getState().getClass().getName());
                                blockAt.getState().setData(block.getState());

                                if (!blockAt.getState().update(true, false)) {
                                    System.out.println("failed to set block at " + x + ", " + (100 + y) + ", " + z);
                                }```
#

this isnt setting the state and also doesn't print that fail message

thorn crypt
fading drift
#

example of log

#
[02:25:59 INFO]: set block at 1, 104, 6
[02:25:59 INFO]: Data: REDWOOD UP LOG(1) Type: org.bukkit.material.Tree
slender elbow
#

bro didn't get the whole put it in a variable deal

eternal oxide
#

tree?

young knoll
#

MaterialData

#

We don’t talk about it

#

👀

slender elbow
fading drift
#

like this?

                   BlockState state = blockAt.getState();
                                state.setData(block.getState());
                                if (!state.update(true, false)) {
                                    System.out.println("failed to set block at " + x + ", " + (100 + y) + ", " + z);
                                }```
glossy laurel
fading drift
#

am I tripping?

fading drift
#

let me name my variables better

glossy laurel
#

guys, random question, in sql, if I make a column with a BIGBLOB or whatever its called variable type, which afaik can hold 4 gb, is it gonna take up 4 gb for each element of only how much it actually needs

fading drift
#
                                Block oldBlock = player.getWorld().getBlockAt(x, 100 + y, z);
                                
                                oldBlock.setType(newBlock.getType());
                                System.out.println("Data: " + newBlock.getData() + " Type: " + newBlock.getData().getClass().getName());

                                BlockState state = oldBlock.getState();
                                state.setData(newBlock.getData());
                                if (!state.update(true, false)) {
                                    System.out.println("failed to set newBlock at " + x + ", " + (100 + y) + ", " + z);
                                }```
#

okay this works thank you emily

#

honestly I don't understand how setting it to a local variable changes anything

river oracle
#

It'll only take what It needs

#

The cap is likely 4 gigs

fading drift
#

whats a good file type I should dump a 3d matrix of blocks into

#

is json fine

#

maximum of 1000 blocks

#

only storing type and data

glossy laurel
young knoll
#

Use a schematic :p

fading drift
#

I dont want to use worldedit as an api because first of all they don't offer support and have no documentation for 1.8.8 and two I want to keep the load times short and jar size compact

glossy laurel
#

just hear me out

#

dont use 1.8.8

#

Guys what are your opinions on guessing syntax

fading drift
#

yeah unfortunately that is the bounds of my project and unfortunately cannot be changed

#

as like everyone else here I would love to be on the latest version

#

using java 21

glossy laurel
#

im not gonna lie

#

jar size compactability wont help when your "schematic" files are gonna take up 3 trillion terabytes of space each

fading drift
#

how big will it realistically be

glossy laurel
#

big

fading drift
#

storing 1000 Material objects and 1000 MaterialData objects

glossy laurel
#

material data gets big

fading drift
#

maybe theres a way to only store what I need

young knoll
#

Not really

#

MaterialData was just a wrapper around a byte

glossy laurel
#

oh

fading drift
#

I have all the data I need stored in an object. should I measure up how much memory it takes and it might give me a rough estimation on file size?

#

material is just an int enum and materialdate is just a byte

eternal night
#

MaterialData has been deprecated for eons

river oracle
#

I always forget that BS exists

young knoll
#

Hey it’s better than the magic bytes

river oracle
fading drift
#

did some maths looks like my json file should be about 8KB

young knoll
#

Ofc the new system is even better but yeah

fading drift
#

surely thats better than a schematic library

river oracle
#

I would be cautious with using magic numbers with materials

fading drift
#

only storing them as magic numbers

river oracle
#

Considering yk they're registry backed

fading drift
#

and its not meant to be edited manually, moreover a command will edit the magic json

#

please I need approval before I do something stupid

young knoll
river oracle
#

Well if you're on 1.8.8 cope asf lolllll

#

When there are kids playing 1.8 younger than 1.8 you should probably update

chrome beacon
#

You can use nms to modify the mob goal

unique shuttle
#

Is there a 100% reliable way to detect when a player or the server itself changes the armor?

glossy laurel
#

fr

#

oh wait dispenser

#

hm

#

ur right

unique shuttle
young knoll
#

If you want to detect that too

vagrant stratus
#

?nms

young knoll
#

You need a repeating task

vagrant stratus
#

Ayo guess who's back needing help dab

glossy laurel
#

me?

unique shuttle
#

It's strange that this doesn't exist in Bukkit, to be honest 🐱

glossy laurel
#

but I guess it's kinda fair

shadow night
unique shuttle
#

?whereami

carmine mica
#

once you try to do this, its also kind of a pain to narrow down what even is "armor changing"? bukkit also has ItemStack#setType (super dum), but that is changing the whole type of the armor when you call it on a mirrored stack

#

what about when a piece of armor takes damage, it's changed too, it has less durability

glossy laurel
carmine mica
#

and what is different about taking 1 point in durability damage and me switching between two pieces have have 1 point difference

glossy laurel
#

the other stack having 1 more durability

unique shuttle
carmine mica
#

1 attribute of the stack changed. what about if a command enchants an item in place without it ever leaving the slot

young knoll
#

There’s the PlayerInventoryChangeEvent PR which would allow you to detect any changes inside a players inventory

carmine mica
#

that is also 1 attribute changing

young knoll
#

But its not merged yet

alpine urchin
pseudo hazel
#

whats the goal of this armor system

carmine mica
#

yeah, goals are always going to be different, which is why one event with a set definition of "armor changed" is difficult. everyone's gonna have different definitions of when something changed

unique shuttle
pseudo hazel
#

oh this is about the API itself?

#

hating something a little bit is better than blind love

unique shuttle
#

Paperzzz

vagrant stratus
# undone axle <https://blog.jeff-media.com/nms-use-mojang-mappings-for-your-spigot-plugins/>

Aight so, trying to figure out NMS stuff (ProtocolLib is also fine, but I'm trying to limit dependencies for something so small)
Okay so, I'm trying to support the rest of the demo mode screens + Credits: https://wiki.vg/Protocol (Game Event -> Demo event)

101: Tell movement controls.
102: Tell jump control.
103: Tell inventory control.
104: Tell that the demo is over and print a message about how to take a screenshot. 

I was able to follow the above guide and got that far.

Looking at Minecraft and it uses this.player.connection.send(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.DEMO_EVENT, 0.0f)); (0.0f is the welcome screen (The only one spigot supports))

Looking at CraftBukkit's implementation of Player#showDemoScreen
getHandle().connection.send(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.DEMO_EVENT, PacketPlayOutGameStateChange.DEMO_PARAM_INTRO));

Using the mapped values I get the following code
serverPlayer.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.DEMO_EVENT, 101.0f))

However, for some (likely dumb) reason my own code doesn't work, although it's basically the same but just using the mapped values 🤔

sly topaz
#

I'm confused as to why it is taking a float

#

oh it is a float in the protocol, wonder why

echo basalt
#

Here's the full class

slender elbow
#

:weewoo_red: SHARING MOJANG CODE :weewoo_blue:

#

🚓🚨

glossy laurel
#

jailtime!!!

#

guys

#

how does TAB

glossy laurel
#

set player's display name

pseudo hazel
#

lmao

cedar saffron
#

just leave in shame

slender elbow
#

nah

cedar saffron
#

what ever happened to shame bruh

slender elbow
#

I take the L with pride

pseudo hazel
#

prob cuz you aint verified?

cedar saffron
#

oh yeah ur not verified LOL

slender elbow
#

yeah you're blue and I'm white

cedar saffron
#

whats wrong with blue people?

#

is white better?

pseudo hazel
#

blueist

slender elbow
#

oh dear

glossy laurel
#

emily is from paper

#

shes an impostor

#

dont trust her

slender elbow
#

🥸

cedar saffron
pseudo hazel
#

made out of paper?

#

pog

glossy laurel
#

yeah

#

one water gun and shes cooked 🔫

sly topaz
#

poor Optic, nobody cared about their issue lol

vagrant stratus
# vagrant stratus Aight so, trying to figure out NMS stuff (ProtocolLib is also fine, but I'm tryi...

like what the hell, my code should work. It's literally the exact same except it uses mapped values

NMS: this.player.connection.send(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.DEMO_EVENT, 0.0F));
OBC: getHandle().connection.send(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.DEMO_EVENT, PacketPlayOutGameStateChange.DEMO_PARAM_INTRO));
My code: ((CraftBukkit) player).getHandle().connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.DEMO_EVENT, 101.0f))

carmine spoke
#

@cedar saffron

#

Sorry wrong mention

#

Discord phone 😡

sly topaz
#

is that the only thing the showDemoScreen method does?

cedar saffron
carmine spoke
#

Sigma the what

vagrant stratus
# sly topaz is that the only thing the showDemoScreen method does?
    @Override
    public void showDemoScreen() {
        if (getHandle().connection == null) return;

        getHandle().connection.send(new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.DEMO_EVENT, PacketPlayOutGameStateChange.DEMO_PARAM_INTRO));
    }
``
No difference between it & my code functionality wise, only difference is I have to cast to craftbukkit first
sly topaz
#

well, are you sure the code is being called?

unique shuttle
#

It should work. It's really strange that it doesn't

vagrant stratus
#

Yea, that's why I'm assuming I've done something stupid lmao

sly topaz
#

does the API method work for you

#

if that doesn't either then it might be a thing with your client rather than your code

vagrant stratus
#

🤷‍♂️

#

Eh. Since the rest are just text, I can just send the messages & use the api lmfao

#

Actually, probably not. Don't think I can copy the placeholders 😐

sly topaz
#

I was thinking you were trying to use packets directly to do something else with it

#

what are you trying to do

pseudo hazel
#

how do I look at the source of spigot

vagrant stratus
pseudo hazel
#

I wanna know why my teleport returned false but I got teleported anyways

eternal oxide
#

?stash

undone axleBOT
pseudo hazel
#

ty

vagrant stratus
sly topaz
#

that looks like Skript with extra steps

#

a DSL in the making if you will

vagrant stratus
#

Ehh, it's not programming. Purely config stuff

sly topaz
#

that is always how it starts

vagrant stratus
#

If I wanted to use an actual programming language, I'd just throw in lua support or some shit lmao

pseudo hazel
#

lmao, good to know teleport cause is useless

eternal oxide
#

useful between plugins, sometimes

pseudo hazel
#

wdym

#

it always uses cause.PLUGIN

eternal oxide
#

to signal its a plugin causing the teleport

pseudo hazel
#

yeah but the teleport function doesnt do anything with it

#

and when it changes dimensions it just uses PLUGIN cause

eternal oxide
#

well if its spigot api causing it, yes

#

there are other causes

pseudo hazel
#

right

vagrant stratus
#

please, leave the server

pseudo hazel
#

but like

blazing ocean
#

hehe

pseudo hazel
#

i dont understand then

blazing ocean
pseudo hazel
#

anything that calls craftentity.teleport(location, cause) will either not use the cause or change dimensions with PLUGIN cause

vagrant stratus
eternal oxide
#

it will fire a teleport event passing the cause

pseudo hazel
#

unless its overriden I guess

#

where is that

eternal oxide
#

just debug a telport event listener for the cause

#

then call teleport passing a cause

blazing ocean
#

mod idea

client-side guis without font fuckery
simple example: drawing text in a box:

  • server sends packet to draw text
  • client draws text
  • server calculates text width and adds some padding
  • server sends packet to draw box
  • client draws box

is this a good idea

quaint mantle
#

Would be cool if someone made mod so servers can make client side scripts

blazing ocean
#

you mean like... RCE? 🧌

vagrant stratus
#

oh wait

#

it's dead

quaint mantle
#

Gmod

pliant topaz
blazing ocean
#

i wish dude

vagrant stratus
#

Probably not, gets in the way of bedrock lol

pliant topaz
#

true

blazing ocean
#

nbtui when

#

jsonui vs nbtui

pliant topaz
#

screw bedrock addons fr, why not for java eh?

#

why not just both

vagrant stratus
#

$

#

$$$$$$$$$$$$$$

#

$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

pseudo hazel
#

why would the server decide what the client would draw

pliant topaz
#

for someone as big as microsoft a few millions wouldnt even be a big deal

slender elbow
#

i mean

vagrant stratus
#

They make less if they implement it java side 🙂

slender elbow
#

they are entirely different teams making bedrock vs java

pliant topaz
#

true..

slender elbow
#

like, completely different teams

quaint mantle
pliant topaz
#

atleast raytracing should originally go to java, but sadly opengl was in the way 😭

blazing ocean
pseudo hazel
#

for who

blazing ocean
#

for players?

pseudo hazel
#

wdym

blazing ocean
#

it's just what you can currently do but easier

pseudo hazel
#

why is that cooler than the client drawing it