#help-development

1 messages · Page 124 of 1

vagrant stratus
#

lmao

tender shard
#

report this to jira, and upload the Crash.jar you sent me

vagrant stratus
#

Yea, I did

tender shard
#

definitely a bug in spigot that's fixed in paper

#

send jira link pls

vagrant stratus
#

now sleep before I slap you

tender shard
#

I wanna spam "I can confirm" at least once

#

I still have half a beer so I'm online for 10 minutes anyway

vagrant stratus
tender shard
#

oh btw the jira rules say "you also gotta test it using craftbukkit!" but NOONE ever does it so I guess it's fine

vagrant stratus
tender shard
#

but I'll test it with craftbukkit too

vagrant stratus
#

now to upload to spigot cause why not lol

tender shard
#

I've added a comment with some further clarification and the full stacktrace

#

and including confirmation that it also happens in craftbukkit

tender shard
#

well even if it'd be 6am now, I'd still have like 8 hours to sleep

#

but yeah really weird

#

that it's working in paper

#

typical paper thing though, fixing stuff without contributing upstream 😛

vagrant stratus
#

#howrude

tender shard
#

please ping me if there's any stuff about this because yeah it's really interesting

#

usually it's either paper that has a bug, or both paper and spigot, but never have I seen that's only existent in spigot but not in paper

#

btw erm

#

you attached the wrong video, didnt you?

vagrant stratus
#

wait what

tender shard
#

the one you sent still uses /commanditem

#

but yeah

vagrant stratus
#

o

#

meh. same problem

tender shard
#

yeah exactly

#

but I really wonder "wtf is wrong with you" that you didnt include the stacktrace in your report ahaha

vagrant stratus
#

I did though, just not a proper link lmao

tender shard
#

oh lmao yeah I see I see

#

sorry

#

yeah

vagrant stratus
#

ode it causes a crash with the following exception: https://paste.md-5.net/eqaqupayeh.md.

tender shard
#

usually people paste it directly

vagrant stratus
#

fite me

tender shard
#

if at all, i'd fyght yuh

tender shard
#

fun fact

#

I recently bought 2 new frying pans

#

and they are so much better than my old one

#

now I got three frying pans

vagrant stratus
#

:p

tender shard
#

comparing our stacktraces is interesting

#

you used spigot, I used craftbukkit

#

the first three lines in the stack have the same source code line numbers

#

but in playerconnection, it happens in spigot on line 1724 but in craftbukkit on line 1688

#

I didnt know that spigot messes with the connection class

lost matrix
#

There is a discord group designing a new language...

tender shard
#

yeah fuck windows, but also fuck discord

#

why does everyone have gradient profiles except me

#

I mean i dont care about gradients, its just unfair that I dont have it

lost matrix
#

The fk is a gradient profile even?

tender shard
#

check out @slate mortar's profile

#

it's purple to black

#

ours are just grey

lost matrix
#

Unfair

tender shard
#

ikr

lost matrix
#

Geh mal schlafen du Hecht

tender shard
#

optic is still here

#

watch your language

lost matrix
tender shard
#

but yeah okay

#

good night

#

shutdown /s /f /t 0

vocal cloud
#

shutdown now

#

My profile was designed to blind people hes_UwU

torn oyster
#

how would i listen for a player right clicking an NPC I created with NMS

lost matrix
#

Is the npc server side?

torn oyster
#
    public void createNPC(Player p, String name, Location location, SkinWrapper skin) {
        CraftPlayer craftPlayer = (CraftPlayer) p;
        ServerPlayer sp = craftPlayer.getHandle();

        MinecraftServer server = sp.getServer();
        ServerLevel level = sp.getLevel();

        GameProfile profile = new GameProfile(UUID.randomUUID(), ChatColor.translateAlternateColorCodes('&', name));

        profile.getProperties().put("textures", new Property("textures", skin.texture(), skin.signature()));

        ServerPlayer npc = new ServerPlayer(server, level, profile, null);
        npc.teleportTo(level, location.getX(), location.getY(), location.getZ(), location.getYaw(), location.getPitch());

        sendPacket(sp, new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.ADD_PLAYER, npc));
        sendPacket(sp, new ClientboundAddPlayerPacket(npc));

        npcs.add(new NPC(npc, p));
    }```
#

that's my code

#

i'm relatively new to NMS so feel free to correct some stuff

lost matrix
#

Then you need to store the int id when you create it and listen for incoming entity use packets which have this entity id as your target

torn oyster
#

and i already create an id so that's fine

lost matrix
#

ProtocolLib

#

Or you inject your own packet handler into netty

ornate zinc
#
PersistentDataContainer zombiecustomdata = zombie.getPersistentDataContainer();
zombie.getPersistentDataContainer().set(new NamespacedKey(/*here*/).PersistentDataType.INTEGER , 1000 );

@lost matrix what i should use (here) ?

ornate zinc
#

tnx

#

i want use (string , key) key is custom but what about string . its custom too ?

torn oyster
#

how do i make a ServerPlayer face a direction

shadow zinc
#

also its shading all the dependencies inside my library to my project

drowsy helm
#

ClientboundRotateHeadPacket

#

and body rotation is part of ClientboundTeleportEntityPacket

#

        Location location = mirrorEntity.asBukkitEntity().getLocation();
        double mirrorX = location.getX();
        double mirrorY = location.getY();
        double mirrorZ = location.getZ();

        byte yaw = (byte) ((location.getYaw() % 360) * 256 / 360);
        byte pitch = (byte) ((location.getPitch() % 360) * 256 / 360);

        asNMSEntity().moveTo(mirrorX, mirrorY, mirrorZ, yaw, pitch);
        PacketUtils.sendPacketGlobal(new ClientboundRotateHeadPacket(this, yaw));
        PacketUtils.sendPacketGlobal(new ClientboundTeleportEntityPacket(asNMSEntity()));``` complete code if you need
cobalt thorn
#

a question is possible to give a sort of NPC the attribute of health and a hitbox?

drowsy helm
#

definitely

cobalt thorn
#

because i have a system of weapon that need this and making npc with citizen doesn't support it

drowsy helm
#

you just have to setup a packet listener

shadow zinc
#

buoobuoo any idea why my project is shading all the dependencies of my library?

drowsy helm
#

npcs dont trigger any events

#

scope provided aswell?

shadow zinc
#

because they are already shaded and relocated, however, it reshades it without relocating so I get two of the same dependency

drowsy helm
#

is your parent module also shading it

shadow zinc
#

of my library or my project?

drowsy helm
#

wait how exactly is your proj setup

#

you mentioned a parent module right

shadow zinc
#

neoutils shades kyori

#

it has a parent module

#

then

#

I download it from my repo

#

to my project

#

my project shades the library

#

however, it shades all the dependencies inside of it as well

drowsy helm
#

oh wtf

#

thats super strange

shadow zinc
#

yeah

#

and like I said, my library relocates kyori

#

but my project shades it, so I can two kyori packages

drowsy helm
#

even with min jar?

#

maybe diff versions of kyori?

shadow zinc
#

well it minimized the relocated kyori package

#

but not the new shaded one that my package shaded

#

I can remove the shading inside my library and the project shades everything

#

however, I would also have to instruct devs to relocate the packages inside of my library

#

and thats just annoying and a bad design

drowsy helm
#

can you show both poms

lost matrix
#

Dont minimize relocated dependencies.

shadow zinc
shadow zinc
#

so this is my minimization and relocation and shading inside my library

#
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.3.0</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                            <minimizeJar>true</minimizeJar>
                            <relocations>
                                <relocation>
                                    <pattern>net.kyori</pattern>
                                    <shadedPattern>com.neomechanical.neoutils.kyori</shadedPattern>
                                </relocation>
                            </relocations>
                        </configuration>
                    </execution>
                </executions>
                <configuration>
                    <minimizeJar>true</minimizeJar>
                </configuration>
            </plugin>```
ornate zinc
#
PersistentDataContainer bossdata = skeleton.getPersistentDataContainer();
bossdata.set(new NamespacedKey(CustomBoss.getPlugin(),"isBoss"),PersistentDataType.STRING,"true");
```this is in first class and
```java
    @EventHandler
    public void onskeletonDeath(EntityDeathEvent event) {
        if (event.getEntity() instanceof Skeleton) {
            Skeleton skeleton = (Skeleton) event.getEntity();
            if(skeleton.getPersistentDataContainer().has(new NamespacedKey(CustomBoss.getPlugin(),"isBoss"),PersistentDataType.STRING)){
                event.getDrops().clear();
                event.getDrops().add(new ItemStack(Material.DIAMOND_BLOCK , 10));
                event.setDroppedExp(100);
            }else {
                return;
            }
        }
    }
```this is from 2nd class but it didnt work .HEEELP
lost matrix
#
            else {
                return;
            }

Useless. Delete.
2) Add sysouts in your listener to check if A) the event is fired and B) All conditions are met

ornate zinc
#

pls show me an example

lost matrix
#

Of what? Printing debug statements?

ebon coral
#

is there a way to send a brigadier suggestion without having to register the command or anything, just so when something is being typed or something

#

because doing it with the packet requires some type of id, and i am not sure where i can get that if i wanna send it myself.

lost matrix
#

You cant send suggestions for just chat messages

ebon coral
#

no no it's for a command

#

i just don't wanna use the brigadier api

#

or i'm wondering if i can adapt a bukkit command's tab completion to use brigadier suggestions

lost matrix
#

The player asks for a command suggestion and generates the transaction id. You can answer by sending a packet back
with a matching transaction id.

ebon coral
#

does it ask for a suggestion only if the command is a brigadier registered one?

lost matrix
#

I dont understand what you are trying to do.
If you have a custom command system then you need to hook into brigadier to properly support it in spigot.

#

You can intercept the command packet and let the player think that there are more commands than actually registered.

ebon coral
#

ok ok so if a player is tab completing any command will it send a suggestion packet, and only if the command is registered it will respond to it and do something?

lost matrix
#

There is one packet which sends all the commands to the player.

#

It will ask for suggestions if the client knows this command. So if the command node was send in the Commands packet.

ebon coral
#

okay so if the command was just a bukkit command it wont ask for the suggestions packet, it has to be a brigadier registered one which the client knows of

lost matrix
#

No it also asks for suggestions on bukkit commands. Those are send in the command packet as well.

#

Spigot even has a command completion api.

ebon coral
#

okay so if i have a spigot or bukkit command, can i send a brigadier suggestion on tab complete?

lost matrix
#

Sure

ebon coral
#

all i wanna do is have the tooltip or whatever for tab completion

#

how can i do that?

lost matrix
#

Intercepting packets

ebon coral
#

mind elaborating please :>

lost matrix
ebon coral
#

this

lost matrix
#

Ah i see. Yeah this is only possible with components.

#

So you need to listen for requests for your command and intercept them before they reach
spigot. Then you answer with your custom packet. Its probably easier to just use brigadier.

ebon coral
#

haha gosh sounds like it, except that brigadier doesn't really have what i want it to have and adapting it to is iffy- so i'm gonna have to do the first route.

reef lagoon
torn oyster
#
    public void update(Player player) {
        String updatedText = ChatColor.translateAlternateColorCodes('&', PlaceholderAPI.setPlaceholders(player, getFormat()));

        net.minecraft.world.entity.Entity nmsEntity = ((CraftEntity) armorStand).getHandle();
        nmsEntity.setCustomName(CraftChatMessage.fromString(updatedText)[0]);

        sendPacket(player, new ClientboundSetEntityDataPacket(nmsEntity.getId(), nmsEntity.getEntityData(), true));
    }

    public void sendPacket(Player bukkitPlayer, Packet<?> packet) {
        ((CraftPlayer) bukkitPlayer).getHandle().connection.send(packet);
    }```
#

how come this doesn't update?

#

i call the method upon player joining

#

it worked like 5 hours ago too

#

it's for holograms

#

?paste

undone axleBOT
torn oyster
#

(full class)

ashen quest
#

hello guys, i am using intelliJ to make my plugin (to add spigot to it)

everything is fine

plain vapor
#

Hey guys, anyone know why I'm getting null when trying to retrieve a registered service from service manager? I'm trying to get my API service that was registered on my core plugin and use it on another plugin. If I loop through the registered services, it's there and registered all good. The class type I'm trying to access it with matches up perfectly, but still getting null when trying to get the instance. Any ideas?

torn oyster
lost matrix
plain vapor
quaint mantle
plain vapor
old cloud
#

You dont need them. UUID has a constructor that takes 2 longs

quaint mantle
onyx fjord
#

here ig

quaint mantle
#

Thanks

patent fox
#

im using a boss bar but the .setProgress method doesn't work

eternal oxide
#

what are you setting it to?

patent fox
#

1.0

eternal oxide
#

so full

patent fox
#

im trying to make a timer using the bossbar but the progress doesn't update

#

the timer itself works

eternal oxide
#

is your boss bar not already full?

queen apex
#

How to let a user walk 1 block forward with plugin?

eternal oxide
#

default is full when created

patent fox
#

no the 1.0 was just for debug

#

it didn't even update

torn oyster
eternal oxide
queen apex
eternal oxide
#

no its not

#

you could play the walk animation and teleport

torn oyster
#
    public void update(Player player) {
        String updatedText = ChatColor.translateAlternateColorCodes('&', PlaceholderAPI.setPlaceholders(player, getFormat()));

        net.minecraft.world.entity.Entity nmsEntity = ((CraftEntity) armorStand).getHandle();
        nmsEntity.setCustomName(CraftChatMessage.fromString(updatedText)[0]);

        sendPacket(player, new ClientboundSetEntityDataPacket(nmsEntity.getId(), nmsEntity.getEntityData(), true));
    }

    public void sendPacket(Player bukkitPlayer, Packet<?> packet) {
        ((CraftPlayer) bukkitPlayer).getHandle().connection.send(packet);
    }```
#

how come this doesn't update?

#

i call the method upon player joining

eternal oxide
#

for ANY player, or just the one joining?

torn oyster
torn oyster
#

It runs for the player joining

eternal oxide
#

if a player is already online and another joins

patent fox
eternal oxide
#

If you are triggering it IN the join event you may need to delay it a few ticks.

torn oyster
eternal oxide
undone axleBOT
eternal oxide
torn oyster
patent fox
#
this.bossBar = Bukkit.createBossBar(Utils.chat("&aTime Left: "), BarColor.GREEN, BarStyle.SOLID);
this.bossBar.setProgress(0.5f);
eternal oxide
#

Is there a reason you are using NMS to change the stands name?

eternal oxide
patent fox
#

if i add the players after i update does it matter?

torn oyster
eternal oxide
#

ah ok

torn oyster
#

Read whole class for more context

eternal oxide
#

this line looks wrong nmsEntity.setCustomName(CraftChatMessage.fromString(text)[0]);

#

it should not be an array returned from my knowledge

torn oyster
#

nevermind it works now

eternal oxide
#

nope you are correct

torn oyster
#

i iterated over the wrong list to update the holograms 💀

#

anyway how do i hide an NMS npc in the playerlist

eternal oxide
#

you send a remove packet

torn oyster
#

wouldn't that remove the npc

eternal oxide
#

not a remove entity

#

sec let me pull up my ide

#

new ClientboundPlayerInfoPacket(ClientboundPlayerInfoPacket.Action.REMOVE_PLAYER, npc);

torn oyster
#

is there a way to avoid that?

eternal oxide
#

it shouldn;t remove a skin

#

not if you sent their info packet

#

send info packet, add player packet then remove info packet

onyx fjord
#

can i use wg api on java below 17?

#

it screams at me

dusk shell
#

how can i give a player leggings and auto equip them?

eternal night
#

you can simply grab the player equipment

#

and setLeggings

#

i believe

dusk shell
#

like that? player.getInventory().setLeggings(leatherLeggings);

eternal night
#

yea

dusk shell
#

it works, thanks

#

and how can i clear leggings from him?

eternal night
#

should be able to just pass null

#

or new ItemStack(Material.AIR)

dusk shell
#

thx

tender shard
#

way more readable and it uses kewl nms "features"

eternal night
#

then you could write that in the plugin title kekw

tender shard
#

lol 😄

torn badge
#

Anyone have an idea how I could hide a player from other plugins?

#

So other plugins think he’s offline even though he’s online?

chrome beacon
#

Why would you want that

tender shard
#

"vanish plugin"

torn badge
tender shard
#

if you're really crazy you could set the server field in the Bukkit class to your own custom Server object which uses reflection in getOnlinePlayers() to check what plugin called this. Which is a terrible idea.

#

lol

chrome beacon
#

Doing that is going to require much more work than it's worth

tender shard
#

exactly and it would only work for plugins using Bukkit.getServer(), and not for ones using the getServer() method in JavaPlugin

tender shard
#

it was just a joke

chrome beacon
#

Spigot fork with vanish builin 😎

#

Or force everyone to load Mixins with Ignite

torn badge
eternal night
#

no

torn badge
#

So there are multiple Server instances?

eternal night
#

no ?

#

but the fields used are different

#

a plugin has its own reference to the server

#

the Bukkit static state has another

torn badge
#

Yeah but if they point to the same instance it’s enough to change that and inject another one

eternal night
#

but you cannot change the server instance itself

#

it doesn't delegate to anything

#

that is already where the logic resides

torn badge
#

Well that’s right

tender shard
#

well well well

#

you could loop over all running plugins and change their field too lol

eternal night
torn badge
#

I'm just gonna add every other plugin as a dependency

tender shard
#

that's not gonna help anything

#

the proper way is to make your plugin so popular that all other plugins query your api and check if a player is vanished

torn badge
#

Yeah good luck with that one

river oracle
#

Why do you need to touch the server instance for a vanish plugin what

tender shard
#

the only other alternative is to hack into all plugins and change their server field lmao

#

so yeha these are your two choices

tender shard
torn badge
#

Or use a mixin to inject code into the Server class

river oracle
#

I've never done mixins before that'd be a fun project

#

Well actually I have with fabric but not with anything else

torn badge
#

I’m gonna give it a try and test around

tender shard
#

i know exactly nothing about mixin

torn badge
#

That could work actually

river oracle
torn badge
#

Let’s see how many hours I‘m gonna waste for it lol

#

Will report back

river oracle
#

It shouldn't be too bad to pull off I believe in you

#

I say you can figure out mixins in like an hour or 2 at most

torn badge
#

I've worked with them a few times in Forge

#

So shouldn’t be too hard to get going

river oracle
#

I've done like 2 hours of fabric modding so I'm basically an expert at mixins already :P

torn badge
#

Damn, looks like I'm a C++ expert too

river oracle
vivid cave
#

hi, player.getPing() is not accurate enough to me, it takes too much time to update, i think it follows a refresh rate or sth, or its taking into account a too long period before measurement, which is more a Δt than a dt, so not sensible enough to the instantaneous variations of latency
Is there a way to retrieve the timestamp of the last time that player did respond to the server? Like the last received heart beat from the player or sth?
Or maybe is there a way to know how many ticks late the player is?

#

Or maybe is there a way (with or without NMS) to retrieve the whole packet queue and the size of all packets sent to the player which haven't been processed by the client yet?

#

See, I'm just imaginating scenarios that would help me have a more accurate/instantaneous connection status of a player, so please be open minded to anything similar scenarios i haven't stated

tender shard
#

player.getPing returns the ServerPlayer's latency field. The ServerPlayer has a ServerGamePacketListenerImpl field, which in turn has a private static final int field LATENCY_CHECK_INTERVAL = 15000, so yeah that's the ping updating thing. the ServerGamePacketListenerImpl also has a field "Connection" which indeed has a Queue<PacketHolder> to the current packet queue, if that helps

vivid cave
#

oh yes that helps a lot thank you mfnalex!

tender shard
#

np!

#

(that's all the mojang mapped names, and only for 1.18+, in 1.17 it's a bit different)

vivid cave
#

yeah i'm in 1.19 so i have moj maps no worries

#

1.17 be like player.b.a.c.z.d.OwO?()

queen apex
#

How to break a block as player?

queen apex
#

thanks

tender shard
#

For example to get the "Connection" object in 1.18, you do myNmsPlayer.connection.connection

queen apex
tender shard
#

in 1.17 you only need ".connection" once, since ServerGamePacketListenerImpl and PlayerConnection are "one class" where in 1.18 it's split up

drowsy helm
tender shard
#

then sendBlockDamage beforehand

queen apex
drowsy helm
#

yeah use sendBlockDamage then

tender shard
queen apex
drowsy helm
#

you have to calculate that yourself

tender shard
#

yeah, some fancy math lol

tender shard
#

yeah I have some VERY UGLY methods in BestTools to calculate this

#

better dont look into it, the whole code is a huge mess, it was one of my first plugins from 2018 >.<

vivid cave
#

also do you know if its possible to get the remap through reflection too?

tender shard
#

no

#

you have to use the obfuscated names there

drowsy helm
#

remapped names dont persist on runtime

tender shard
#

so, spigot class names and obfuscated method names etc

vivid cave
#

is there a page/document that explicits every mapping?

#

like obfuscation + translation

vivid cave
#

thank you!!

tender shard
#

e.g. here you see:
mojang class name is MoveToBlockGoal, spigot class is PathfinderGoalGotoTarget. Mojang field name is "mob", obfuscated field name is "a"

#

so yeah check the "Spigot" tags for classes, and the "obfuscated" tag for fields / methods

vivid cave
#

alright, tysm 🙂

#

very useful yeah

#

(cuz i like a lot messing around with dynamic java its nice for debugging :D)

tender shard
#

I wish the specialsource plugin would also understand reflections

#

but like, what would it do when using string concat'ing etc

#

it possibly can't work properly for reflection 🥲

vivid cave
#

what is specialsource plugin

tender shard
#

it remaps your NMS stuff automatically

#

you code in mojang mappings and your .jar uses spigot mappings

#

then when you switch from 1.18 to 1.19, you only change your dependency from 1.18 to 1.19 and choose the new mappings file

vivid cave
#

aha okay

#

yeah would be cool yeah

undone axleBOT
iron glade
#

?di

undone axleBOT
tender shard
#

yes, you should use a try-with-resource thing instead

#

or close the connection in the finally block

#
        try (Connection con = DriverManager.getConnection(myConnectionURL);
             PreparedStatement ps = con.prepareStatement(sql);) {
            ps.setInt(1, userId);
            try (ResultSet rs = ps.executeQuery();) {
                while(rs.next()) {
                    users.add(new User(rs.getInt("id"), rs.getString("name")));
                }
            }
        }
#

sth like this

iron glade
#

People be like

Why don't work?

tender shard
#

that's called "try with resources"

drowsy helm
#

try with resources

#

basically closes any variable within the perenthesis after the block is executed

tender shard
#

yes, but you can combine it

#
try(Connection con = ...) {
  con.doSomething();
} catch (SQLException e) {
  e.printStackTrace();
}
tardy delta
#

i did my stuff with a consumer so i only need to do withConnection("SELECT * FROM WHATEVER", (connection, statement)) {/* bla bla bla */}

#

syntax looks weird sometimes but anyways

rare flicker
#

I'm adding custom status effects to the game (essentially like potions effects and you can't get custom ones to render so i did my own system)

Does anyone have any ideas on how i could render the current status effects to the client?

drowsy helm
#

wdym render

#

like the icon in the inventory?

rare flicker
#

anything, scoreboards on the side wouldn't look the best, bossbars would get too much when you have multiple effects, thoses kinds of things

dusk shell
#

alo

rare flicker
drowsy helm
#

just use custom unicode characters

#

obviously would need a resourcepack

rare flicker
#

already have one so no biggie there

drowsy helm
#

you familiar with custom unicode?

rare flicker
#

nope, never touched any

drowsy helm
#

give me a min

rare flicker
#

didn't even know you could add your own, i though there was a fixed set of chars minecraft's supports and that was it

drowsy helm
#

in minecraft/font/ create a file called default.json

{
    "providers": [
        {
            "type": "bitmap",
            "file": "yourexampleimage.png",
            "ascent": -10,
            "height": 10,
            "chars": [
                "\uF801"
            ]
        },
        {
            "type": "bitmap",
            "file": "yourexampleimage2.png",
            "ascent": -10,
            "height": 10,
            "chars": [
                "\uF802"
            ]
        }
}```
tender shard
drowsy helm
#

then in code just use '\uF801' for example

#

nd boom

rare flicker
#

status effects dont last a whole lot

#

and they have particles

drowsy helm
#

but then you would only see 1 at a time

rare flicker
#

achievements can show by groups of 4 tho can't they?

drowsy helm
#

wait can you see multiple toasts

#

at the same time

rare flicker
drowsy helm
#

ah yeah thats definitely viable then

rare flicker
#

they show 4 at a time

#

and i mean, if you have more than 4 you're probably about to die anyways

tender shard
#

like, really annoying NMS

drowsy helm
#

yeah toast nms is ass

#

like major ass

rare flicker
#

never touched any so i didnt know

rare flicker
drowsy helm
#

which character?

#

its the custom one

tender shard
drowsy helm
#

it will display the image

#

refer to the json i sent

rare flicker
drowsy helm
#

yep

rare flicker
#

damn, i though that would be more complicated xD

drowsy helm
#

just change file, ascent, height and chars

#

simple

#

you can do some really cool stuff with it

rare flicker
#

i've seen some ressource packs use it to display potions icons on the potions themselves

#

or even enchants

drowsy helm
#

you can also do custom inventories with them

tender shard
rare flicker
drowsy helm
#

this is how i do my status effects

rare flicker
drowsy helm
#

those yellow icons on the bottom

#

yeah retextured items suck

#

you lose a slot + they are glitchy

tender shard
#

arent those carrots on a stick lol

drowsy helm
#

its supposed to be a flail lol

rare flicker
#

you're telling me

#

that with a unicode char in like, the inventory name, you can texture the whole thing???

drowsy helm
#

yep

tender shard
#

ofc you can

drowsy helm
#

template if you need

#

i made a spigot resource for that method a while back

#

ill try and find it

rare flicker
#

i made custom inventories already

#

but they're made with textured items

drowsy helm
tardy flame
#

Yo guys I'm new to these things and I found something like this. How can I get player's head / or an entire skin into a char so I could display it?

drowsy helm
#

spam click the retextured item

#

your inv will go crazy

tardy flame
drowsy helm
#

its not a character

#

they use regular player heads

#

just remapped

tardy flame
#

What

drowsy helm
#

sec

#

ill get the json for oyu

tardy flame
#

Alry

#

I thought it's just a single char 😦

rare flicker
drowsy helm
#

sorry

#

ill pastebin

rare flicker
drowsy helm
#

?paste

undone axleBOT
rare flicker
#

it's all of them

drowsy helm
rare flicker
drowsy helm
#

you can do some pretty cool stuff with heads aswell

#

they actually store the entire skin data

#

so you can theoretically show the entire player skin

tardy flame
#

Alright thanks

drowsy helm
#

made this a year back with unicode

tardy flame
#

Will try something like that

drowsy helm
#

you can do some really col stuff with it

#

but i cant disclose what I've done elsewhere yet 😮

#

Origin Realms also uses unicode for their invs

tardy flame
#

Wait, but does it override current player head?

drowsy helm
#

yes

#

just use customModelData

tardy flame
#

Okay!!

rare flicker
#

can you make custom model displays with heads a customPlayerData?

tender shard
rare flicker
#

like

#

idk

#

oh shit i'm stupid

#

i can already do that with literally any item and custom model data

drowsy helm
#

lmao

rare flicker
#

its' literally just an item

drowsy helm
#

i was actually working on a system recently to display any image with heads

#

without loading it onto the RP

#

but doesn't work super well unfortunately

rare flicker
drowsy helm
#

yeah

rare flicker
#

or just prevent spoilers?

#

oh alr

iron glade
drowsy helm
#

and also have dynamic images

#

so say I could load an image on demand

iron glade
#

Someone help him

tender shard
#

?learnjava

undone axleBOT
iron glade
#

returns null on getPlugin() Why don't work?

rare flicker
#

also another thing

#

runTaskTimer(plugin, 0) ???

#

wdym 0

iron glade
#

wants to crash the server

drowsy helm
#

doesnt it take 2 variables

iron glade
#

delay and period yea

rare flicker
#

wouldn't that just be a for loop tho

#

yeah that aswell

drowsy helm
#

it defaults to 1 iirc

rare flicker
#

oh then i guess that's fine

iron glade
drowsy helm
#

yeah

iron glade
#

would be good ye

drowsy helm
#

people are allergic to the docs i swear

iron glade
#

apparently he's 13 yrs old, should still be able to read when his IDE highlights something red, idk

rare flicker
#

its literally just an upgrade xD

drowsy helm
#

yeah its a great system

#

you do need negative characters though

#

*if you dont have them already

rare flicker
#

to align it properly?

drowsy helm
#

yeah

rare flicker
#

height is the char itself tho right?

drowsy helm
#

can be

rare flicker
#

wait

#

AHHH

#

ok let's go on a coding frenzy i want this thing implemented by tonight

drowsy helm
#

for inventories

#

ascent is 19

#

height is 256

#

and i think negative 7 offset

rare flicker
#

cuz i absolutely hate this

drowsy helm
#

yeah its pretty ugly lol

rare flicker
#

does the char render above or under items btw?

drowsy helm
#

under

rare flicker
#

YEEESSS

drowsy helm
#

so buttons and such would have to be an invisible item

#

or a retextured item depending on how you approach it

rare flicker
#

or be a retextured item

drowsy helm
#

yeah

rare flicker
#

and the ui not have them

drowsy helm
#

yeah exactly

#

or do something like this

#

where the button is isolated

#

then just render is separately

rare flicker
#

actually i think it's better this way, if you wanna move a button all you need to do is move the item and theres no need to update the char texture

drowsy helm
#

yeah its up to you tbh

#

quite long

#

lol

#

theres a lot of factors

#

including nbt

#

so theres no one answer to that

rare flicker
#

you can put chests in chests in creative

#

and there no theorical limit

drowsy helm
#

^

rare flicker
#

so literally infinity

drowsy helm
#

just use longtext if on sql

rare flicker
#

practically your game crashes tho

drowsy helm
#

varchar(10k) should be fine tho

tender shard
drowsy helm
#

yeah chests can have nbt aswell

#

as in act the same as shulkers

tender shard
#

oh ok

#

then why did I use PDC for this

#

lol

drowsy helm
#

pdc still easier imo

#

can also be used on any item

#

rather than just the 2

tender shard
#

yeah I made this for everything that has an "inventory"

#

enchantment tables, furnaces keep burning in inventory, etc

drowsy helm
iron glade
#

xD

tender shard
#

good idea lol, unless they have a potion

#

also stepping on a furnace should give fire damage

#

or stepping on a stonecutter.....

iron glade
#

holding a campfire for too long should start burning the player

pulsar parcel
#

is this good way to update lines in scoreboard? because I ts not working to me. I have check to see if the method triggers using println to console and number is showing in console, but lines are not updating. I don't now where is mistake. And sorry for my english.
Here is my code and my update method is updatePerLine(): https://pastebin.com/YRwGCmZK
and I am triggering this method in setScoreboard() and then I am using for (Player p : Bukkit.getOnlinePlayers()) {villagerCount.setScoreboard(p)} in my main class (villagerCount is another class)

tender shard
drowsy helm
#

score6apůl

#

?

tender shard
#

you should stick to english names 😄

drowsy helm
#

compiler probs shitting itsel

pulsar parcel
rare flicker
tender shard
#

identifiers can use basically uncide char

drowsy helm
#

i hope that not an actual variable

tender shard
#

you can even call classes $class

rare flicker
drowsy helm
#

or just not updating

drowsy helm
pulsar parcel
drowsy helm
#

i think its shift middle click

tender shard
#

also doesnt do anything

#

at least on spigot 1.19.2

drowsy helm
#

hmm

#

there definitely is a way to do it

rare flicker
#

ctrl middle click for me

#

my bad

tender shard
#

yeah

#

that works

#

thanks

drowsy helm
tender shard
#

scoreboards are such a pain to deal with lol

vagrant stratus
pulsar parcel
drowsy helm
#

also when are you creating an instance of the class

#

    ScoreboardManager board2 = Bukkit.getScoreboardManager();
    Scoreboard board3 = board2.getNewScoreboard();

in the class scope is sussy to me

rare flicker
#

just switching function names

pulsar parcel
vagrant stratus
#

Meh, normalize method names and it's no longer a problem

drowsy helm
#

no I mean ust creating a new scoreboard on the class scope in general

#

but its not static so ig its fine

pulsar parcel
fossil lily
#
[14:50:32 WARN]: java.lang.IllegalArgumentException: Can not set final java.util.UUID field com.mojang.authlib.GameProfile.id to java.lang.String
[14:50:32 WARN]:        at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:167)
[14:50:32 WARN]:        at sun.reflect.UnsafeFieldAccessorImpl.throwSetIllegalArgumentException(UnsafeFieldAccessorImpl.java:171)
[14:50:32 WARN]:        at sun.reflect.UnsafeQualifiedObjectFieldAccessorImpl.set(UnsafeQualifiedObjectFieldAccessorImpl.java:83)
[14:50:32 WARN]:        at java.lang.reflect.Field.set(Field.java:764)
[14:50:32 WARN]:        at me.rhys.general.disguise.DisguiseManager.disguise(DisguiseManager.java:65)
[14:50:32 WARN]:        at me.rhys.general.disguise.gui.DisguiseGUI.lambda$handleClick$1(DisguiseGUI.java:201)
[14:50:32 WARN]:        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[14:50:32 WARN]:        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[14:50:32 WARN]:        at java.lang.Thread.run(Thread.java:748)

I'm trying to set the player's uuid, but its final and I can't change it. Is there any way to get around this?

        try {
            GameProfile playerProfile = ((CraftPlayer) user.getPlayer()).getHandle().getProfile();
            Field ff = playerProfile.getClass().getDeclaredField("id");
            ff.setAccessible(true);
            ff.set(playerProfile, uuid);
        } catch (Exception e) {
            e.printStackTrace();
        }
drowsy helm
#

you are setting it to a String

#

not uuid

#

and why are you trying to change it anyway lol

fossil lily
#

uuid is a string, for a nick system

drowsy helm
#

Can not set final java.util.UUID field com.mojang.authlib.GameProfile.id to java.lang.String

#

not according to your error

#

it needs to be UUID

fossil lily
#

oh im so dumb

#

thanks lmao

boreal python
#

how do I make a chunk of code execute every 10 ticks?

old cloud
pale pendant
#

is there any way for an egg to bounce instead of breaking when hitting the ground?

iron glade
#

Is there another way to check if it's raining on a player besides checking if he has absolutely no blocks above him while it's raining?

eternal oxide
#

check the sky light level at his location

iron glade
#

kinda unexperienced with light levels. 15 is max iirc?

pale pendant
#

16 is max i think

eternal oxide
#

15

iron glade
#

Doesn't placing a torch under the player set it to max?

eternal oxide
#

SKY light level

iron glade
#

oh

tender shard
iron glade
#

so I'd need to check if it's max value for his location to know that there's nothing above him?

tender shard
tender shard
pale pendant
#

how do i do that

tender shard
#

what exactly? cancelling the event? applying velocity?

pale pendant
#

both

iron glade
pale pendant
#

i mean i know how to use e.setCancelled(true);

tender shard
# pale pendant both
    @EventHandler
    public void onHit(ProjectileHitEvent event) {
        event.setCancelled(true);
        Vector velocity = event.getEntity().getVelocity();
        velocity.setY(1); // example
        event.getEntity().setVelocity(velocity);
    }
pale pendant
#

thanks!

tender shard
#

and ofc you can ignore world's with a Dimension of NETHER or THE_END type

iron glade
#

Could also check if block under the player is the highest I guess?

#

for his x-z position

tender shard
#

yes sure, but even if this is FALSE, there might be rain

iron glade
#

yea but I only wanna know whether the rain hits the player

#

/ He's exposed to it

eternal oxide
#

rain falls straight down. You only need to know if you can see sky

iron glade
#

So just stick with the sky light level thing?

#

Then another thing. Let's say I check if it's raining in the player's world, that wouldn't guarantee it's raining somewhere around the player's location. right? Only somewhere in his world

eternal oxide
#

weather is world wide

#

rain/snow

iron glade
#

Really?

#

Didn't know

rare flicker
#

deserts

#

savana

iron glade
#

Then I'd only have to check whether the biome he's standing in is affected, right?

tender shard
#

but skylight also comes from nearby blocks, doesnt it?

rare flicker
#

you need :

To check if the highest block at XZ is under the player
If it's raining in the world
If it can rain in the biome

iron glade
#

Yes, noted all those, I think that's it?

rare flicker
#

To check if the highest block at XZ is under the player
Sylight doesnt work because glass

#

yup

#

that's it

eternal oxide
#

15 = no obstruction

#

day or night

rare flicker
tender shard
eternal oxide
#

I believe

dusk shell
#

elo, im having some problems about variables, i should have a variable that is different for other player. imagine an int variable, for Ryad095 the variable will be 5, for Emma45 8

tender shard
eternal oxide
#

um, glass

rare flicker
# tender shard

then use isPassable and continuously check down until you meet a non passable block

#

or reach the player's y level

#

or -64

#

whichever comes first

tender shard
#

why travel down?

#

checking up makes more sense

rare flicker
#

well

#

you have two ways of doing it

#

start at highest block y and go down to player

#

start from player and go up

iron glade
#

starting from down probably breaks the loop earlier

rare flicker
tender shard
#

yeah usually you have a roof near the player and not 200 blocks above

iron glade
#

Ok so did I get it right that the sky light level won't work?

rare flicker
#

yup

tender shard
#

yes, skylight won't work

#

also there's no isPassable method

rare flicker
#

there is tho

iron glade
#

So just check if block at player location is the highest?

rare flicker
tender shard
#

there's isOccluding but that's only for fully blocking light, so useless. There's isSolid but that makes no sense, e.g. fences are solid but let rain through

iron glade
#

Paper?

rare flicker
iron glade
#

I remember paper having some extra methods there

#

iirc

tender shard
#

oh you call it on the block

rare flicker
#

ye

tender shard
#

I only checked Material

rare flicker
#

wouldnt work because fence gates

#

they're not always passable

tender shard
#

isPassable still doesn't work

iron glade
#

Alright, I'll give it a try and let you know if I have some issues

tender shard
#

fences are not passable but let rain through

rare flicker
#

not if they're open

#

wait what

iron glade
#

that's a gate

tender shard
#

the only proper method is to take this list:

rare flicker
tender shard
#

btw sorry I meant ladders

#

not fences

rare flicker
#

fences arent passable and dont let rain through?

tender shard
#

I meant fences

iron glade
tender shard
#

SHIT

#

I MEANT LADDERS

#

FUCK IT

#

LADDERS

#

so

iron glade
#

?

#

xD

tender shard
#

ladders let rain through but they have a hitbox

#

so, not passable

iron glade
#

I wanna see how long that list is

rare flicker
#

fair enough

tender shard
#

not so long

#

idk maybe 50 materials or so

iron glade
#

uffff

#

so check if blocks above player are either air or one of those blocks letting rain through, otherwise it's not raining on the player?

#

|| block at player loc is highest

dense geyser
#

can someone help me with this method? I'm having trouble understanding what the boolean does? I originally thought it was if the player could use the command or not, so for example "registers hello.perm but in a way where it outlines that the player can't use it (for wildcards)", does it remove the permission instead or something? https://gyazo.com/9bec30cedc58fd288eb75c5b98b9613b

tender shard
# iron glade || block at player loc is highest
    private static final Set<Material> RAIN_PASSTHROUGH = Set.of(...);
    
    public static boolean isInRain(Location loc) {
        int highestY = loc.getWorld().getHighestBlockYAt(loc);
        if(highestY <= loc.getBlockY()) return true;
        for(int y = loc.getBlockY(); y <= highestY; y++) {
            Block block = loc.getWorld().getBlockAt(loc.getBlockX(), y, loc.getBlockZ());
            Material type = block.getType();
            if(!type.isAir() && !RAIN_PASSTHROUGH.contains(type)) {
                return false;
            }
        }
        return true;
    }
#

haven't tested, but yeah, something like this will definitely work

#

Improved it a bit:

    private static final Set<Material> RAIN_PASSTHROUGH = Set.of(...);

    public static boolean isInRain(Location loc) {
        int highestY = loc.getWorld().getHighestBlockYAt(loc);
        if(highestY <= loc.getBlockY()) return true;
        // Check highest block directly. Most of the time, the highest block will already be occluding rain
        if(!letsRainThrough(loc.getWorld().getBlockAt(loc.getBlockX(), highestY, loc.getBlockZ()).getType())) return false;
        
        // Loop from player Y to highest Y
        for(int y = loc.getBlockY(); y < highestY; y++) {
            Block block = loc.getWorld().getBlockAt(loc.getBlockX(), y, loc.getBlockZ());
            Material type = block.getType();
            if(!letsRainThrough(type)) {
                return false;
            }
        }
        return true;
    }
    
    public static boolean letsRainThrough(Material mat) {
        if(mat.isAir()) return true;
        return RAIN_PASSTHROUGH.contains(mat);
    }
iron glade
#

Ty! Currently adding those materials to the set, will try it after that

tender shard
#

you could also use an EnumSet but 1.18 announcements said "dont do that"

iron glade
#

hm

tender shard
#

because everything that implements "Keyed" will "soon"(TM) be replaced with normal classes

iron glade
#

Ah yea, heard of it

pale pendant
snow lava
#

why is i set this tag on my block:
When i check if the block i clicked has this tag it says me false?

#

why if i created this tag that says me that the placed block is true, when i check the tags says me false?

gray merlin
pale pendant
iron glade
tardy delta
#

aa

#

do that in a static block lol

iron glade
#

It can only rain in the overworld right?

gray merlin
#

yea

tardy delta
#

is there some other double value like Double.NaN which cannot be obtained from somewhere without explicitly assigning it, and can be negated?

#

basically looking for a Double.NaN which can be negated

#

maybe i can use Double.POSITIVE_INFINITY

iron glade
#

Any idea how I'd check if a player is standing inside a cauldron filled with water?

tardy delta
#

check the block at their location?

iron glade
#

Oh sick there's a WATER / LAVA CAULDRON material

#

though there's only CAULDRON and I'd have to check somehow if it's filled with water

tardy delta
#

meh i dont think Double.POSITIVE_INFINITY will work

gray merlin
#

Is there a common interface/class between Player and CommandBlock that I can use to cast CommandSender to?

tardy delta
#

hmm Double.POSITIVE_INFINITY == Double.POSITIVE_INFINITY is true

tardy delta
#

why

gray merlin
#

I need to get the Location from where the command is called, and it needs to work with CommandBlocks and Players.

tardy delta
#

if the console sends it, theres no block

gray merlin
#

Yeah, i'll block it from the console, I was trying to get a common one for specifically cblocks and players

tardy delta
#

ConsoleCommandSender is console if you didnt know

#

ig rcon is the same

gray merlin
#

The player has to be op for that i'd imagine?

tardy delta
ornate mantle
#

do the NMS entity classes have a method that runs every tick

eternal night
#

a player is always a server operator

tardy delta
#

if you'd be looking at docs

gray merlin
#

Yeah I just checked

tardy delta
#

the fact that Player class extends it doesnt mean it has op permissions automatically

gray merlin
#

Welp, I can't get the location from there anyways, so i'll just have to go for something else; Thanks anyways!

tardy delta
#

lol

echo granite
tardy delta
#

how did i flaw my logic again

zealous osprey
#

damn you actually used the correct annotation for micro-seconds

tardy delta
#

did i?

zealous osprey
#

normally I just do "micS", to lazy to use the actual thing

tardy delta
#

🤡

ornate mantle
#

how do i do a tick() method for a custom NMS entity?

tardy delta
#

ij will yell at ya

hasty prawn
#

Just make sure you call super.tick()

ornate mantle
torn badge
#

Can a server process multiple player commands in a single tick?

#

Because I'd like to check if a piece of code was called as a result of a command and then get the player that issued the command

wet breach
#

not understanding here

wet breach
#

the from your command class have it set a boolean or some value of sorts

#

then you can easily check from the piece of code where it is coming from

#

or use an enum that gets passed

torn badge
#

The command is not executed from my plugin

hasty prawn
#

xy problem maybe?

#

?xy

undone axleBOT
wet breach
#

you can still listen for commands regardless

#

also, how fast the server processes something is generally not a concern unless timing is important

torn badge
#

But I need to know how often the plugin called that method

wet breach
#

so make a counter

torn badge
#

But what if it gets called from somewhere else as well

wet breach
#

at this point I really don't understand what you are trying to accomplish here

torn badge
#

I‘m having a method in my plugin

#

And I need to know when another plugin calls it from a command

#

Because I need to know who issued the command

hasty prawn
#

How would another plugin's command call your method?

#

If you dont own the other plugin

#

Well I mean but why would it

#

That is not what I mean.

wet breach
#

basically they want to know if a method in their plugin they created is called from another plugins command executor method

hasty prawn
#

I think my point is that it's poorly designed if another plugin is calling your method but the method doesn't require all the parameters to make it useful. I still don't understand what the problem is or what they're trying to solve.

wet breach
#

and this is achievable

rocky pond
#

So, I'm making a mutechat command and everything is okay until I check whether the chat is muted or not in the chat listener.

 @EventHandler
    public void onChat(AsyncPlayerChatEvent e) {
        Bukkit.broadcastMessage(String.valueOf(mutechat)); 
        Player p = e.getPlayer();
        if(mutechat) { // <<< variable mutechat is predefined
            e.setCancelled(true);
            plugin.send(p, plugin.getConfig().getString("chatMutedError"));
        }
    }``` 
I don't know why but whenever I chat the variable just sets itself to false.
if you didn't understand something lmk
wet breach
hasty prawn
#

Thats why I sent ?xy earlier lol

torn badge
wet breach
#

but good news is that what they asked or I think what they asked is achievable, but without further information I can't really direct to an appropriate way

torn badge
#

So I cannot pass any information to that method

rocky pond
#
public class MutechatCommand implements CommandExecutor,Listener {

    private final CleanChat plugin;

    public MutechatCommand(CleanChat plugin) {
        this.plugin = plugin;
    }

    public boolean mutechat;

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if(sender.hasPermission("cleanchat.mutechat")) {
            mutechat = !mutechat;
            Bukkit.broadcastMessage(String.valueOf(mutechat));
                String chatMuted = ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("chatMuted"));
                chatMuted = chatMuted.replace("{sender}", sender.getName());

                String chatUnmuted = ChatColor.translateAlternateColorCodes('&',            plugin.getConfig().getString("chatUnmuted"));
                chatUnmuted = chatUnmuted.replace("{sender}", sender.getName());

                Bukkit.broadcastMessage(mutechat ? chatMuted : chatUnmuted);
        } else {
            sender.sendMessage(ChatColor.translateAlternateColorCodes('&', plugin.noPerm));
        }
        return true;
    }

    @EventHandler
    public void onChat(AsyncPlayerChatEvent e) {
        Bukkit.broadcastMessage(String.valueOf(mutechat));
        Player p = e.getPlayer();
        if(mutechat) {
            e.setCancelled(true);
            plugin.send(p, plugin.getConfig().getString("chatMutedError"));
        }
    }
}```
#

idk just sent the whole class

wet breach
rocky pond
#

it kinda sent it weird in here

wet breach
#

or better yet, why do you need to know what plugin it belongs to?

torn badge
undone axleBOT
wet breach
#

alright, well then the easy way to achieve this is to listen to all stack traces and then filter them for what you are looking for

#
public static void foo(){ 
        Thread.currentThread();
        Map<Thread,StackTraceElement[]> allLiveThreads = Thread.getAllStackTraces(); 
        Set<Entry<Thread,StackTraceElement[]>>  entries = allLiveThreads.entrySet();

        for(Entry<Thread,StackTraceElement[]> entry : entries){

            System.out.print("Thread: '"+ entry.getKey().getName()+"'");

            if(entry.getValue().length>1) {
                String nameofMethod = entry.getValue()[1].getMethodName(); 
                System.out.println(" and method name '"+ nameofMethod+"()'");
            }
            else {
                System.out.println(" with no methods.");
            }
        }
    }
torn badge
#

But I don’t know if that’s too resource intensive

wet breach
#

I just gave you the code above to do just that

torn badge
#

Since it’s called multiple times per tick

wet breach
#

needs some tweaking

#

and not its not resource intensive because stack traces are always being created

#

just the only time its made visible to a user is when there is an error, but they are still created for successful things too 🙂

odd wedge
rocky pond
torn badge
#

But iterating over the entire stacktrace multiple times per tick?

wet breach
#

stack traces are created regardless if you fetch them or not

torn badge
#

Can’t stack traces get really big?

#

That’s my concern

wet breach
#

you would need a FIFO que so you are not storing all of it, and you can do all this from another thread as well

odd wedge
torn badge
#

Okay so you mean fetching the stack trace, processing it on another thread and then going back to the main thread?

torn badge
#

Why not?

hasty prawn
#

wot

upper vale
#

wtf

#

what

torn badge
#

That’s DI

rocky pond
#

thats kind of what i saw on youtube a lot lol

upper vale
#

who taught you that

#

lmfao

wet breach
#

this is how DI works btw

hasty prawn
#

You're doing it right fireroz dw

wet breach
#

?di

undone axleBOT
upper vale
#

OOP-speaking DI is probably more correct than singletons

wet breach
#

singletons should not be used unless you really need it

odd wedge
#

Someone never learnt Java

wet breach
#

purpose of a singleton is when you need to ensure the best you can that there is only ever a single instance of something

#

most objects don't need this requirement

ivory sleet
#

Loggers are a good example of when singletons are more justifiable

#

Well Ig libs like slf4j technically provides a multiton

torn badge
torn badge
#

@wet breach And how would I know which player issued the command?

#

Also doing it on another thread won’t work I think because I need to return the result

quaint mantle
#

Whats the best way of doing prison enchants

#

Looping blocks on a different thread?

echo basalt
#

depends on the size

#

for breaking blocks in a big area, I make 1 snapshot per chunk, and have 1 thread per snapshot for processing it all to a concurrent queue

#

So all the processing is done async

#

Then I have a queue that sets the processed blocks

wet breach
torn badge
#

But what’s the point in moving it to another thread if the main thread needs to wait for the result?

torn badge
#

How would I know when that particular command execution is done?

wet breach
#

well you didn't specify all these extra requirements

#

so because of that, you might need to instead go with a ASM

#

and look at bytecode of plugins to see if your method sig is in there

#

and then record the commands it is associated with

torn badge
#

damn its getting too complex

quaint mantle
#

can someone help me with: 0x803f8001

eternal night
wet breach
eternal night
#

that is some microsoft shit ye ?

#

google says that is a microsoft store error code

wet breach
#

specifically of not being signed in

eternal night
#

I love people providing 0 context

wet breach
#

either they are not signed in, or the family member that bought it is not signed in

#

but of all places though, they chose to come to a minecraft discord for windows issues

#

windows store issues

eternal night
#

maybe they were trying to launch bedrock 🤔

wet breach
#

that still doesn't fit for here either way XD

eternal night
#

obviously they are also using gyser

wet breach
#

but fortunately for them, there is someone here who knows windows 😛

kindred valley
#

Go buy new one 😡😡

wet breach
wet breach
#

the error code provided specifically relates to not being signed into microsoft account on the windows store

kindred valley
#

What the wuck is windows store😡😡 who uses it

wet breach
#

for windows apps

#

not sure what do you mean who uses it. Lots of people do for windows store apps

kindred valley
#

I thought it was pure java version

river oracle
#

lord I stay out of the windows store I only ever have issues with it

#

its laggy as all fuck and minecraft always has stupid issues

frail gale
#

why the Anvil Container still requires XP when I have set their Level Cost to 0?

weak adder
wet breach
#

it is correct in the sense it does indeed execute

#

you are just doing it the incorrect way to use a ?

#

so what is happening is that the query being executed is looking up a user of ? which returns no results, thus your while loop doesn't execute and thus no errors

#

because it all executed fine

weak adder
#

Oh I got it. Thanks

wet breach
#

PreparedStatement stm = connection.prepareStatement("SELECT * FROM chat_logs WHERE username=?";);
stm.setString(1, "the name");
#

this would be what you want

weak adder
#

Yep

wet breach
#

create code to parse it and input it into a DB

#

you can use anything of your choosing for this and doesn't need to be in a plugin

#

you can even do it from bash

#

while true, there is a lot more tools out there to conver sqlite to mysql then there is from yaml to anything else

undone axleBOT
haughty idol
#

how would i make a player completely invisible

#

including their armor

#

i tried p.hidePlayer(plugin, p);

#

but it didn't work

#

ah

wet breach
#

sql files are essentially just a bunch of sql queries to build a DB or table. So those programs that convert to an sql file actually convert into a fancy sql backup text file that you can use to then import. Mysql has a command for importing sql files and so does sqlite I believe.

torn shuttle
#

does player.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue() get the current max health?

wet breach
#

sure

#

wouldn't be efficient but yes you could do that

#

no making a script or program to pull all of the data and have it organized the way you want then batch insert/update

#

there are many ways to do this, just go with the route you know how to do, because I doubt you will need to do this constantly 😛

sage dragon
#

Is it possible to make player be able to draw a bow without arrows?

I don't want to use tricks like adding an arrow temporarily.

I'm afraid to delete player's stuff

#

Might be possible - If drawing a bow is completely clientside.

Will test it, thanks!

torn shuttle
#

it's weird become I managed to get an error of setting a value that is too high by a few decimal points using getValue

iron glade
#

Any ideas why I'm getting a java.lang.NoSuchMethodError: on location.getNearbyEntities(radius, radius, radius) ?

#

which?

eternal night
#

that is paper-api

iron glade
#

spigot docs have this method tho

eternal night
#

you obviously cannot run paper-api only methods on spigot

#

it does not on a location

#

paper re-exposes this method on the location type

eternal night
#

that is an entity ?

#

not a location

iron glade
#

shit

#

it's too late here uff

#

what's my best bet to get nearby players in a radius on spigot?

#
  • of a location
eternal night
#

I mean

#

world has the method

#

so just

#

location.getWorld().getNearbyEntities(location, double, double, double)

iron glade
#

I might've solved it by just passing a player

#

Well, @eternal night was able to without code xd