#help-development

1 messages · Page 918 of 1

tardy delta
#

i just wanna see what happens cuz i have no clue whats going on there

drowsy helm
#

can you send your pom

harsh rose
drowsy helm
#

no

paper rain
#

yeah. i have it on server, in external libaries too and also in pom

#

everywhere

drowsy helm
#

?paste

paper rain
#

fr

drowsy helm
#

!paste

undone axleBOT
drowsy helm
paper rain
#

okok

worthy yarrow
#

It's something weird with my build probably idek

harsh rose
# drowsy helm !paste

One question before, which spigot dependency to i need to use to get those classes in 1.20.1:

import net.minecraft.server.v1_8_R3.BlockPosition;
import net.minecraft.server.v1_8_R3.EntityPlayer;
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;
import net.minecraft.server.v1_8_R3.DataWatcher;
import net.minecraft.server.v1_8_R3.Entity;
import net.minecraft.server.v1_8_R3.EntityArmorStand;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityDestroy;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityMetadata;
import net.minecraft.server.v1_8_R3.PacketPlayOutSpawnEntityLiving;
import net.minecraft.server.v1_8_R3.WorldServer;
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
import org.bukkit.craftbukkit.v1_8_R3.entity.CraftPlayer;

#

Back in 1.8 i could just import them

tardy delta
harsh rose
#

But in 1.20.1 paper api doesnt find

#

or even normal spigot doesnt find

#

then i tried remapped => same.

worthy yarrow
drowsy helm
#

some of them might be a pain you have to find their 1.20 equivalent if they're deprecated

tardy delta
#

what happens in your ide so you cant call ExpressionParser.parse

#

wait

harsh rose
drowsy helm
#

thats paper

worthy yarrow
#

Which is why I'm so lost... the dependency is fine

harsh rose
#

which do i have to use

drowsy helm
#

spigot

#

the remap plugiun is for spigot

#

spigot plugins can run on paper servers

harsh rose
worthy yarrow
drowsy helm
#

if you want remapped methods (you do) you have to use the remaped-mojang classifier

#

but keep in mind none of these imports will resolve because they're using diff names

#

so you'll have to find the Remapped equivalent

tardy delta
worthy yarrow
harsh rose
tardy delta
#

bruh stupid java, it compiles but it doesnt

drowsy helm
#

A lot of nms has changed, it's not as easy as just updating the version name unfortunately

#

you'll have to rewrite a portion of it if you want to use remap

meager wolf
#

u know how hypixel got those "pets" in the lobbies? (parrot, sloth...)
how can i easily make them? is there a library for that, or should i hard code it

drowsy helm
meager wolf
#

not specifically pets only, but things that are similar

drowsy helm
#

pretty sure @torn shuttle is making one

tardy delta
#

if jitpack refreshed its cache atleast

worthy yarrow
#

Same issue D:

tardy delta
#

get into dm

harsh rose
#

If someone is able update NMS Classes/Methods from 1.8 to 1.20.1, DM me. Im paying up to 100€

rough drift
#

?services

undone axleBOT
rough drift
#

also depending on the size of the plugin it may be more than €100 just saying

inner mulch
#

?paste

undone axleBOT
unique shuttle
#

Am I missing something? When it spawns, it already appears with the translation ignoring the interpolation. Spigot 1.20.4

young knoll
#

You need to wait a tick

#

Because Mojang

worldly ingot
#

Yeah, you're setting the transformation around the same time it's spawned on the client. Give it about a tick or two before actually changing its transformation

unique shuttle
#

It's strange because this doesn't happen to me in another project

#

But with 2 ticks, it worked fine. Thanks :)

quaint mantle
#

is it possible to make a sound follow an entity?

rough ibex
#

No

#

Sounds have a position from which they are played

#

but this position cant be changed

lost matrix
#

You can stream mono sounds directly to the player

quaint mantle
#

im trying to make a sound follow an entitiy

#

so they know where the entity is ayt

restive mango
#

player.performcommand does check if a player has permission to execute that command right

#

like if the server ran randomguy.performcommand("ban Unknown_abs") it wouldn't actually ban them right

#

...im pretty sure it does

topaz cape
#

can gradle change constants in my project , if yes how can i do it?

like for example I want to replace "XContant" in
private static final String CONSTANT = "XContant";
in compile time

slender elbow
remote swallow
mild granite
#

Is there a way to specify the main class of a plugin outside of plugin.yml? I've forked a plugin from github and I can't figure out where it specifies its main class (I know what the main class is)

remote swallow
#

If its gradle it might use minecrells build.gradle config for it

mild granite
# remote swallow If its gradle it might use minecrells build.gradle config for it

Thanks, it was specified in the gradle (not sure if minecrells or not). Since you seem to know some things about gradle: I was trying to add the paper api to build.gradle using the instructions on their website (https://docs.papermc.io/paper/dev/project-setup), but adding the third block gives the error The new Java toolchain feature cannot be used at the project level in combination with source and/or target compatibility I'm confused because I haven't set sourceCompatibility or targetCompatibility anywhere. Is there somewhere other than build.gradle that it could be set?

slender elbow
#

uh maybe you should share your build.gradle

#

?paste

undone axleBOT
slender elbow
#

i got it right omg

topaz cape
#

or smth

mild granite
lusty flax
#

heya, anyone know how to run code every x number of seconds with a bungeecord plugin?

drowsy helm
#

Bungee should have runnables

#

Yeah it has a scheduler

wet breach
quaint mantle
#

how do i get all the players but sorted from the closest from a entity to the furthest from an entity?

dreamy chasm
#

you can use getNearbyEntities() which is part of the World class

quaint mantle
#

thank you

median trench
#

Is there any way I can disable the arm swing when clicking a noteblock?

torn shuttle
#

woah hold up

#

is the velocity of a controllable mountable entity the velocity of the entity mounting it?

inner mulch
#

Are data classes bad design ?

eternal oxide
#

no, but it depends on what you are calling a "data class"

next iron
#

newPosition < 0: (-1 < 0)
im getting this error after typing
chestDisplayTime: 100
in my config.yml

#

does anyone know what it means?

echo basalt
#

probably a formatting issue

echo basalt
next iron
echo basalt
echo basalt
next iron
echo basalt
#

When an exception / throwable is thrown you get a nasty error with a stacktrace (what's printed after the error)

eternal oxide
#

no inage, 404

echo basalt
#

elgar you got this

#

imma get back to reading effective java

eternal oxide
#

?paste your config

undone axleBOT
smoky anchor
next iron
#

^

eternal oxide
eternal oxide
next iron
#

yes

next iron
eternal oxide
#

then it's impossible for that to cause your issue

#

run mvn clean

#

then try building again

inner mulch
eternal oxide
inner mulch
#

But No funcionality

eternal oxide
#

Nothing wrong with that

#

Perfectly valid design and been done that way for decades

echo basalt
#

Yeah that's decent design

#

Ideally it'd be immutable but whatever

next iron
inner mulch
eternal oxide
#

It sounds like you need to re-think what you are doing

#

data is just that, data. Operations on that data are not data

echo basalt
eternal oxide
#

You have a UserData class and a User class. UserData holds all data while User holds all your functionality, if it needs to be per user and not a Holder/Manager across all.

echo basalt
#

ehh

#

that adds complexity

#

In some cases yes, that's good

#

I'd argue that's more in favor of hiding volatile / instance data

inner mulch
eternal oxide
#

It really all depends on wether the User can change its own data.

echo basalt
#

For example on my skyblock core I use that pattern to separate InstancedIsland (world, IslandData) with IslandData (islandId, ownerId, members)

echo basalt
#

You're adding more points of entry which is not great

#

But it's generally acceptable

#

Let's say you have something like uh

#
public final class UserPopularityData {

  private final UUID userId;
  private int likeCount;

  private UserPopularityData(UUID userId, int likeCount) {
    this.userId = userId;
    this.likeCount = likeCount;
  }

  public static UserPopularityData create(UUID userId, int likeCount) {
    return new UserPopularityData(userId, likeCount);
  }

  public static UserPopularityData create(UUID userId) {
    return UserPopularityData.create(userId, 0);
  }

  public void addLike() {
    this.likeCount++;
  }

  public int getLikes() {
    return this.likeCount;
  }
  
}
inner mulch
#

Ok

echo basalt
#

This, by norm, is fine

#

Now, could you go the extra mile and make a package-private setLikes method and having your whole manager class be responsible for modifying? absolutely

inner mulch
#

So god like Manager that do everything from a encapsulated system?

echo basalt
#

Your UserPopularityTracker class would be responsible for implementing the addLike / setLikes / removeLike / clearLikes methods

#

And it'd just call the "hidden" setLikes method

inner mulch
#

Okay

echo basalt
#

It'd also be responsible for creating the data itself

#

But instead of making the setLikes method package-private we can instead extrapolate the UserPopularityData to an interface, provide read-only methods and make the setLikes method not part of the interface, but rather the implementation

#

and now we're starting to over-engineer this

#

😛

inner mulch
#

Okay this is so complex for just having setLikes in a data class?

echo basalt
#

Well, there's simple code and then there's enterprise code

#

I'm going the overengineered enterprise code route

echo basalt
dusk moth
#

Guys I need help, I'm trying to make a plugin where there are schematics of rooms, and I'm trying to get a random schematic, and summon that schematic besides the previous schematic, and it would look like a infinite randomised rooms connected to each with an opening.
My main plan is to set a main room, then following up an infinite amount of rooms, but not really infinite AT definition.
I want it so that after the player has passed 3 rooms, the previous room would degenerate, and it would generate another room in front of the 2 rooms, which are already generated.

agile anvil
#

So where are you stuck as now?

dusk moth
#

Getting the random schematic, and the generation.
As of now I have set the commands up, like setting the main room, setting the schematics.

agile anvil
#

I'm not really familiar with schematics, but as far as I now those are file containing some block placements right?
So depending on how many schematics you have you can wether:

  • load them all in memory (such as a list) and fetch a random one each time you need one
  • or list your schematics directory and load a random file on this directory
    (PS: you might like to avoid generating two similar rooms one after the other, for the player's experience ig)

For generating what do you mean? Actually generating the schematic, or the process on when should you generate a room based on the player's location ?

astral scroll
#

i think

#

would be the obvious

echo basalt
#

hm

astral scroll
#

like depending on how big the schematic is yk

echo basalt
#

I'm concerned about performance though

#

because what if a player walks back

astral scroll
#

sometimes big ass schems could lag the server

echo basalt
#

will it generate a new room?

agile anvil
#

So for pasting the schematics you really have two ways;

  1. the easiest is to use WorldEdit's Schematic API, which contains the methods for loading, pasting (and even saving schematics)
  2. make your own schematic format (including making the saving, parsing, and generating)
echo basalt
#

I feel like we're already beyond this stage

agile anvil
echo basalt
#

Yeah so we're past the point of "how do I paste a schematic" and the true question is how do we track this data

eternal oxide
echo basalt
#

This problem breaks down in a few steps:

  • Picking what room to paste
  • Knowing what room we're in and how it's related to the rooms around it
  • Unloading rooms and sealing off? its neighbours
astral scroll
#

i'd like to say we is the best way to go

echo basalt
#

And I feel like we want a kind of graph structure for this

#
public class RoomInstance {

  private final RoomTemplate template;
  private final Point position;
  private final Collection<RoomInstance> neighbours;

}
agile anvil
echo basalt
#

Yeah

agile anvil
#

So only tracking a direction coordinate seems enough

#

And each time passing the coordinate modulo length of the room, do something

echo basalt
#

We need a constant scale to determine

  • Where to paste
  • Where a room starts and ends
dusk moth
#

Do u guys know the famous horror game on roblox called "Doors"?

echo basalt
#

no

#

I just know I want to look into maze algorithms now

agile anvil
echo basalt
#

¯_(ツ)_/¯

#

I worked on a randomly generated dungeon system before

#

a solid 3 years ago

#

it's a pain in the ass

agile anvil
#

I love those kind of problems

echo basalt
#

@tender forge

#

@vagrant stratus ?

dusk moth
#

Well, it's exactly like it, where instances of rooms have been initialised in the code, and there are doors, as per the game name itself.
And, whenever a player walks through the door, it triggers an event, and the room, which was generated 3 rooms ago, would degenerate, and the door would close in front of it.
I do have a idea tho, could I use the files name to it's advantage, where there will be a list of strings, which are the file names, and choose a random name, and paste that schematic file?

echo basalt
#

Well

echo basalt
#

Now we just need to define

  • The room template class
  • Our room template registry
#

Your room template is basically your schematic

dusk moth
#

Ye

echo basalt
#

It might also have some kind of list of entrance directions

#

Let's just make it an interface for now

#
public interface RoomTemplate {

  String getName();
  void paste(Location location);

}
#

We can add metadata to this later on

agile anvil
#

@dusk moth is it a straight line room generation or might it changes direction for some rooms ?

dusk moth
#

Straight

echo basalt
#

This also allows us to use both worldedit schematics and bukkit (nms) schematics

#

And let's make our little registry class

#
public class RoomTemplateRegistry {

  private final Map<String, RoomTemplate> registeredTemplates = new ConcurrentHashMap<>();

  public RoomTemplate getTemplate(String id) {
    return this.registeredTemplates.get(id);
  }

  public void register(RoomTemplate template) {
    this.registeredTemplates.put(template.getName(), template);
  }

  public RoomTemplate getRandomTemplate() {
    ...
  }
}
#

Something like this

dusk moth
#

Oh and I also wanted to ask, can I store a number of locations instances in a list, and get a random instance of that location, so that a chest could be spawned on the random location from the list?

echo basalt
#

Ideally instead of random templates we'd have a bunch of picking strategies and some kind of context system

echo basalt
#

Let's rework the getRandomTemplate part into a generator class

#
public class RoomGenerator {

  private static final int SCALE = 16;

  public RoomTemplate getIdealTemplate(RoomInstance previousInstance) {
    return ...;
  }

  public RoomInstance createRoom(RoomTemplate template, Location location) {
    Point point = new Point(location.getX() / SCALE, location.getY() / SCALE, location,getZ() / SCALE);
    template.paste(location);
    return new RoomInstance(template, location); // The method calling this is responsible for registering neighbours
  }
}
#

We can expand this class a bit

dusk moth
#

No, like I mean, say for example I have a big maze, and I want many chests with a diamond inside it on random location of the maze.
I make command, where I can set the location of a random spawn, with its own getter name.
I store that location into a list.
And so, before the maze minigame starts, it would generate all the chests before hand, at the random locations.

echo basalt
#

I believe at the time we used signs for that

#

that ran scripts

#

When the room was pasted / when a player got nearby

#

why am I writing this entire system for you

eternal oxide
#

Place the chests in teh schematics, then insert a diamond in random ones as they spawn

dusk moth
#

I'm srry, I'll try to make this conversation short. I just want the base idea of it to be cleared

#

Well, thank you guys, I will try out those options

#

And srry for bothering you all.

agile anvil
#

I liked seeing the system being live coded bellow my eyes ㅠㅠ

echo basalt
dusk moth
#

Can't imagine the muscles aching 🗣️🔥

echo basalt
#

im bored

dusk moth
#

What do u call a mob which makes you angry?

echo basalt
#

boss

dusk moth
#

A pro-evoker!

echo basalt
dusk moth
#

That reaction was way better than my friends.

torn shuttle
sullen marlin
#

I think this .toString has side effects making the code work perfectly in debugging

#

dies

torn shuttle
#

deja vu

#

well I am almost done with this

#

I think the only bug left with my display enities is just the origin compensation system I put in for armorstand, just gotta find a way to decouple it

#

ngl this is kinda nightmarish

ashen quest
#

It's been quite a long time since I've coded a plugin.

#

Is storing Player UUIDs as primary keys in tables good?

kind sundial
#

Hey ! I'm investing plugin development and I have this code :

@EventHandler public static void onBlockBreak(BlockBreakEvent event) {
        Player player = event.getPlayer();
        Block block = event.getBlock();
        Material material = block.getType();
        if (material.equals(Material.DIRT)) {
            player.sendMessage("Tu as cassés un block de terre.");
        }
    }```

It seems to be right but I still have an error :
```java
Required type: Material
Provided: BlockType <capture of ?>
Change variable 'material' type to 'BlockType<?>'
___
org.bukkit
@deprecated
public enum Material
implements org.bukkit.Keyed, org.bukkit.Translatable
___
Deprecated
spigot-api-1.20.4.jar
#

I'm using IntellliJ and trying to dev' this for MC 1.20.4

smoky anchor
#

Where did you get this jar ?
Material is not deprecated on Spigot

echo basalt
#

You're using a weird snapshot build

smoky anchor
#

This seems like the material rewrite

echo basalt
#

Yep

kind sundial
quaint mantle
#

Hi guys, I have an gradle project with submodules and I just made a module depend to other one but I'm getting ClassNotFoundException but at the project the classes works. Any idea? If you need code or something tell me

kind sundial
smoky anchor
kind sundial
#

wdym ?! I gotta develop a whole API ?

#

No

echo basalt
kind sundial
#

I misunderstood

smoky anchor
#

?bt

undone axleBOT
kind sundial
quaint mantle
round finch
#

wtf 1.20.5?

#

is this a joke?

kind sundial
#

Iguess

echo basalt
kind sundial
#

wtf

#

what should I use for the 1.20.4 so ?

smoky anchor
#

BuildTools

round finch
#

you welcome 😉

kind sundial
#

Oka

#

y*

#

Downloading it

echo basalt
#

Or if using maven/gradle (you should), import spigot-api

#

From the spigot maven repo

kind sundial
#

going outside with the doggo, taking a small break then... Get back to work !

#

C ya and thx for the help !

#

wait

#

in the BT

round finch
#

java -Xmx4G -Xms4G -jar BuildTools.jar --rev latest 1.20.4
pause

my buildtool bat

kind sundial
#

"Select Version", I use 1.20.4 ?

smoky anchor
round finch
#

but the new version has gui

round finch
#

😎

storm scaffold
#

Can I somehow make this not appear under specific circumstances, or change what it's wearing, or anything of that sort to make it appear different?

river oracle
#

Fucking autocorrect

storm scaffold
river oracle
#

You can move it around with those

storm scaffold
river oracle
#

Ohhh

#

I don't think you can then unfortunately

#

Even if you could it'd require going from the ground up In NMS which is uhhh not fun

slender elbow
#

nah it's entirely client sided

river oracle
#

Sadge mojank yy :(

inner mulch
echo basalt
#

Their whole point is to store data

inner mulch
#

if a manager only interacts with the data contained in such object cant they just contain the managers methods in the first place

inner mulch
eternal oxide
#

I disagree

inner mulch
#

okay

eternal oxide
#

java literally added record classes for data classes

inner mulch
#

yes but coupling these classes to a manager isnt really needed as the manager also just uses the data thats already there?

agile anvil
kind sundial
#

Okay

#

so

#

I've made the thing for 1.20.4 with the BT

#

And now everything's red

eternal oxide
kind sundial
#

Like red for error lmao

inner mulch
eternal oxide
#

not always

#

if you provide an API

agile anvil
#

That's still a great practice to do so. And when programming in oop you're the client of your own code

kind sundial
#

As said before, it's well builded but don't work in Intellij

echo basalt
#

The point of data classes is to contain data, the manager class is responsible for collecting it

inner mulch
#

okay so static manager?

echo basalt
#

There's no need for it to be static

#

The manager is your point of entry

inner mulch
#

point of entry?

eternal oxide
#

delete their dat file while they are offline

round finch
#

@kind sundial huh what are you talking about here?

kind sundial
#

Like

#

I can't show you because despite I'm verify, I can't paste img.

#

Fun

#

but I used the BT to get the 1.20.4 jar I needed

smoky anchor
#

?img
also, you clearly are not verified

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

kind sundial
#

Literally done it

kind sundial
smoky anchor
#

you did what

kind sundial
#

but it's still not working out, when I do that all of my code become an error

smoky anchor
#

do you not use maven/gradle ?

kind sundial
kind sundial
#

I just followed a tutorial... ;-;

smoky anchor
#

bad tutorial then

kind sundial
#

This one

#

but he hasn't talk about maven or gradle

smoky anchor
#

I do not know how to guide you to the correct resources
Hopefully someone else knows

kind sundial
#

Ah, sad... dw

#

What I don't understand is that it's seems to be something really important but I still can load the plugin and do things

kind sundial
#

Still not working

tall dragon
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

sterile flicker
#
if (event.getMessage().equals("math")) {
            EntityPlayer player = ((CraftPlayer) event.getPlayer()).getHandle();
            BlockPosition bp = new BlockPosition(player);
            PacketPlayOutOpenSignEditor packet = new PacketPlayOutOpenSignEditor(bp);


            Generator generator = new Generator();
            generator.nextFormula(ThreadLocalRandom.current().nextInt(14) + 1, ThreadLocalRandom.current().nextInt(2));
            NBTTagCompound ntc = new NBTTagCompound();
            ntc.setString("id", "sign");
            ntc.setInt("x", bp.getX());
            ntc.setInt("y", bp.getY());
            ntc.setInt("z", bp.getZ());
            ntc.setString("Text1", "{\"text\":\""+ generator.result+"\"}");
            ntc.setString("Text2", "{\"text\":\"Answer:\"}");
            ntc.setString("Text3", "{\"text\":\"\"}");
            PacketPlayOutTileEntityData tile = new PacketPlayOutTileEntityData(bp, 9, ntc);
            player.playerConnection.sendPacket(tile);
            player.playerConnection.sendPacket(packet);
            
        }``` I want a sign to open to the player with the text using packets
#

but why can't I see the text?

shadow night
#

why are you checking if their message equals something

#

have you never heard of commands or something

sterile flicker
#

I'll change it later, what about the problem itself?

sterile flicker
#

yes

lost matrix
#

No idea then

#

Try sending a simpler text

sterile flicker
#

PacketPlayOutOpenSignEditor or PacketPlayOutTileEntityData

tall dragon
#

doesnt the client need to think theres a sign at that blockposition?

#

saw people do it with sendblockchange before

sterile flicker
lost matrix
sterile flicker
#

?

tall dragon
#

the way i did it is create a blockposition at the player under the world. where i would send the block change

#

then sent those 2 packets

#

in the same order as ur doing

lost matrix
#

PS: I also think you might need to send a block change first. Otherwise the entity metadata is sent for an air block
which simply makes the client discard it. Not sure about older versions.
But a simple player.sendBlockChange(location, Material.OAK_SIGN.createBlockData()); should be enough

sterile flicker
lost matrix
#

Just throw a byte in i guess

grave vigil
#

I have a shared inventory between several players that gets updated. I'm storing the players in a hashmap, and iterating through all of them to create a new inventory each time. Issue was that, when the players close the inventory, any action done to update it will reopen the inventory for them. To fix this, I removed them from the hashmap on InventoryCloseEvent.

Since every time the menu updates, it triggers an InventoryCloseEvent, what else can I use to detect if the player has left the inventory?

tall dragon
#

why are you creating a new one for each update?

grave vigil
eager sigil
#

Hey, I am currently doing an internship for a game server hosting company and I am looking into improving the performance of Mc servers. I was wondering if you could help me out with your experience. What are some concepts that could theoretically improve server performance but have failed? I was thinking of solutions like offloading chunk generation to a more performant environment or trying to incorporate multithreading.

tall dragon
#

seems odd to have to create a whole new inventory when the inventory size stays the same

#

seems to me you could pretty easily just update the contents for all viewers

tall dragon
eager sigil
#

Yes I know about it! Folia is great, but multithreading is just one solution. I just wanted to see if there are some solutions I've missed, some can be just conceptual. Proving a resource optimization strategy can't be made is still a relevant research finding for me

tall dragon
#

u could reprogram the server in C 😂

kind sundial
shadow night
tall dragon
eager sigil
tall dragon
tall dragon
#

if your server is really custom you could go for something like minestom as well. which is library to build a mc server on top of. meaning it would have no useless bloat running in the background ur never going to use. bad news is that u would have to program any vanilla mechanics u want urself.

grave vigil
tall dragon
eager sigil
grave vigil
sterile flicker
# lost matrix Just throw a byte in i guess
if (event.getMessage().equals("math")) {
            EntityPlayer player = ((CraftPlayer) event.getPlayer()).getHandle();
            Location playerLocation = player.getBukkitEntity().getLocation();
            BlockPosition signLocation = new BlockPosition(playerLocation.getBlockX(), playerLocation.getBlockY(), playerLocation.getBlockZ());
            TileEntitySign sign = new TileEntitySign();
            sign.setPosition(signLocation);
            player.getBukkitEntity().sendBlockChange(playerLocation, Material.SIGN, (byte) 0);

            Generator generator = new Generator();
            generator.nextFormula(ThreadLocalRandom.current().nextInt(14) + 1, ThreadLocalRandom.current().nextInt(2));
            PacketPlayOutTileEntityData tile = getTileEntityData(signLocation, generator);
            player.playerConnection.sendPacket(tile);
            PacketPlayOutOpenSignEditor packet = new PacketPlayOutOpenSignEditor(signLocation);

            player.playerConnection.sendPacket(packet);
        }
    }

    private static PacketPlayOutTileEntityData getTileEntityData(BlockPosition signLocation, Generator generator) {
        NBTTagCompound ntc = new NBTTagCompound();
        ntc.setString("minecraft:sign", "sign");
        ntc.setInt("x", signLocation.getX());
        ntc.setInt("y", signLocation.getY());
        ntc.setInt("z", signLocation.getZ());
        ntc.setString("Text1", "{\"text\":\""+ generator.result+"\"}");
        ntc.setString("Text2", "{\"text\":\"Answer:\"}");
        ntc.setString("Text3", "{\"text\":\"\"}");
        PacketPlayOutTileEntityData tile = new PacketPlayOutTileEntityData(signLocation, 9, ntc);
        return tile;
    }```I'm sorry to keep you guessing, but I think maybe you can see what's wrong based on your experience
#

it still doesn't work

tall dragon
tall dragon
sterile flicker
#

i can just do

#
EntityPlayer player = ((CraftPlayer) event.getPlayer()).getHandle();
            Location playerLocation = player.getBukkitEntity().getLocation();
            BlockPosition signLocation = new BlockPosition(playerLocation.getBlockX(), playerLocation.getBlockY(), playerLocation.getBlockZ());
            TileEntitySign sign = new TileEntitySign();
            sign.setPosition(signLocation);
            Generator generator = new Generator();
            generator.nextFormula(ThreadLocalRandom.current().nextInt(14) + 1, ThreadLocalRandom.current().nextInt(2));

            sign.lines[0]= new ChatComponentText(String.valueOf(generator.result));
            player.getBukkitEntity().sendBlockChange(playerLocation, Material.SIGN, (byte) 0);

            player.playerConnection.sendPacket(sign.getUpdatePacket());
            PacketPlayOutOpenSignEditor packet = new PacketPlayOutOpenSignEditor(signLocation);
            player.playerConnection.sendPacket(packet);```
kind sundial
#

How do you add something to a creative category ? I'm investigating it but I don't find a lot of ressources abt that...

civic lodge
#

IS there a plugin or way to make all items have a different nametag and subtitles and stuff?

kind sundial
#

Use meta data

#

like meta.SetDisplayName()

lost matrix
kind sundial
#

Like

#

I've created an item

#

how can I made it to be in the TOOLS category ?

#

What line of code I have to use ?

#

I tried "creativeCategory" but nothing

lost matrix
#

Those are client side and for Materials. You cant add ItemStacks to them.

sterile flicker
#
EntityPlayer player = ((CraftPlayer) event.getPlayer()).getHandle();
            Location loc = getDefaultLocation(player.getBukkitEntity());
            BlockPosition signLocation = new BlockPosition(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
            TileEntitySign sign = new TileEntitySign();
            sign.setPosition(signLocation);
            Generator generator = new Generator();
            generator.nextFormula(ThreadLocalRandom.current().nextInt(14) + 1, ThreadLocalRandom.current().nextInt(2));

            sign.lines[0] = new ChatComponentText(String.valueOf(generator.result));
            sign.update();
            player.getBukkitEntity().sendBlockChange(loc, Material.SIGN, (byte) 0);
            player.playerConnection.sendPacket(sign.getUpdatePacket());
            PacketPlayOutOpenSignEditor packet = new PacketPlayOutOpenSignEditor(signLocation);
            player.playerConnection.sendPacket(packet);``` for some reason it still doesn't work
#

sign.update(); I've added this, but nothing has changed.

lost matrix
sterile flicker
lost matrix
sterile flicker
lost matrix
#

Add the sign in front of you, dont open the editor, and try to get the first part working: A sign with text on it

#

And you should keep that approach in mind. If you have a complicated method like this, and it "doesnt work", then you
need to find out where it fails. There is no point tinkering with all possible dials and levers, if you have no understanding about what
is actually going on.

Debug it step by step. If you master this, then you will be able to debug 90% of problems on your own.

sterile flicker
lost matrix
inner mulch
#

Are generic method parameters possible (amount and type). I want an abstract method that must be defined but the parameters can be whatever?

azure vault
#

how can i get the number of scores currently shown by a scoreboard?

chrome beacon
azure vault
#

doesnt work

#

thats just 0

#

for both the ones that are shown and not shown

chrome beacon
#

Show your code

azure vault
#
println("collected length: " + collected.length)
println("our scores: " + collected.indices.map(i => s"${i.toHexString}").map(scoreboard.getScores).flatten.map(score => (score.getEntry, score.getScore)))
println("found: " + scoreboard.getTeams.map(_.getName).filter(_.startsWith("score")).map(scoreboard.getScores).flatten.map(score => (score.getEntry, score.getScore, score.getObjective, score.getPlayer)))
println("found size: " + scoreboard.getTeams.map(_.getName).filter(_.startsWith("score")).map(scoreboard.getScores).flatten.size)
```output:```
[18:10:48] [Server thread/INFO]: collected length: 10
[18:10:48] [Server thread/INFO]: our scores: Vector((0,0), (1,0), (2,0), (3,0), (4,0), (5,0), (6,0), (7,0), (8,0), (9,0))
[18:10:58] [Server thread/INFO]: found: List((score5,0,org.bukkit.craftbukkit.v1_20_R3.scoreboard.CraftObjective@3ef214ce,CraftOfflinePlayer[UUID=229c776f-e945-4c65-b190-c0c337a236d2]), (score6,0,org.bukkit.craftbukkit.v1_20_R3.scoreboard.CraftObjective@3ef214ce,CraftOfflinePlayer[UUID=4d2b6401-845b-3b84-a655-4be5d9aad20b]), (score3,0,org.bukkit.craftbukkit.v1_20_R3.scoreboard.CraftObjective@3ef214ce,CraftOfflinePlayer[UUID=3a6c6b8b-ca87-3778-a52b-e5b9379c2b16]), (score4,0,org.bukkit.craftbukkit.v1_20_R3.scoreboard.CraftObjective@3ef214ce,CraftOfflinePlayer[UUID=ee631dbf-733d-4c49-99c2-91d28fd5af83]), (score0,0,org.bukkit.craftbukkit.v1_20_R3.scoreboard.CraftObjective@3ef214ce,CraftOfflinePlayer[UUID=c0ba1508-4619-43e3-b62d-4f4652f24697]), (score9,0,org.bukkit.craftbukkit.v1_20_R3.scoreboard.CraftObjective@3ef214ce,CraftOfflinePlayer[UUID=c650e842-e5a6-413b-a572-08d1a343d2ad]), (score2,0,org.bukkit.craftbukkit.v1_20_R3.scoreboard.CraftObjective@3ef214ce,CraftOfflinePlayer[UUID=7a0ac395-9d60-4ba1-b63d-3d7ef0e73e15]), (score8,0,org.bukkit.craftbukkit.v1_20_R3.scoreboard.CraftObjective@3ef214ce,CraftOfflinePlayer[UUID=691187f1-4596-39a8-8ddc-fb4e663a7706]), (score1,0,org.bukkit.craftbukkit.v1_20_R3.scoreboard.CraftObjective@3ef214ce,CraftOfflinePlayer[UUID=765c3432-e1f3-36dc-8221-60608a187546]), (score7,0,org.bukkit.craftbukkit.v1_20_R3.scoreboard.CraftObjective@3ef214ce,CraftOfflinePlayer[UUID=14739beb-0c5e-3a74-a2eb-fdbac73f602c]))
[18:10:58] [Server thread/INFO]: found size: 10
#

for whatever reason it makes the server lag for 5 seconds when i call getObject or getPlayer on all of the scores lol

azure vault
#

u can ignore the first two print statements

#
scores.indices.foreach { i =>
    val hex = s"§${i.toHexString}"

    obj.getScore(hex).setScore(i)

    val team = scoreboard.getTeam(s"score$i")

    if (team != null) {
        team.addEntry(hex)
    } else {
        scoreboard.registerNewTeam(s"score$i").addEntry(hex)
    }
}
#

this is how i set the scores

azure vault
#

since the score entry is actually that hex one

#

but the the scores are 0 regardless

#

maybe i need to call getscore on the objective

#

OK I figured it out

vast raven
#

why does the damager is null in blockexplodevent using a respawnanchor?

chrome beacon
#

How are you getting the damager

vast raven
#

getDamager() (?)

tardy delta
#

anyone here that ever used jacoco for code coverage and knows how to upload those reports to codecov.io with github actions?

#

keeps telling me it cannot find those reports, documentation is kinda bad too

chrome beacon
#

at least not in Spigot

#

if you're using something else go ask them

kind sundial
#

How do I get an item display name please ?

#

Like, I have the diamond shovel vanilla item, how to get it ?

river oracle
#

ItemMeta#getDisplayName

kind sundial
#

It doesn't work lol

#

it's returning nothing

river oracle
#

Or
ItemMeta#getLocalizedName

#

If no display name is set

kind sundial
#

I've tried to

#

and not working :/

river oracle
#

What is not working

kind sundial
#

Both

#

when I used them

#

my string stay empty

young knoll
#

I don't know if the server even has any language files

#

So idk if it can get the default name

river oracle
#

I thought

young knoll
#

¯_(ツ)_/¯

river oracle
#

Meh could be wrong ig

young knoll
#

Isn't there also a setLocalizedName

#

(yes)

kind sundial
#

There is

#

but if I want to get the name of the item you have in hand when breaking a name

#

I can't use it

river oracle
#

ItemStack is translatebale you'd have to use components which spigot doesn't yet support

#

Not where you need it atleast

young knoll
#

I mean you need to send it to the client for that to work

#

So if you want it server side you're out of luck

kind sundial
#

Oh

#

So not possible to get name of the item in name when breaking a block ?

#

But-

#

ahhh

dreamy chasm
#

or you could convert the material to the name if you want it in a nicer format

ionic terrace
#

I was wondering if it's possible to open a writable book, I've tried p.openBook() but that requires an ItemStack of written_book?

sullen marlin
#

I guess not then

vast raven
#

Lol

#

it is not even inherited from entitydamage parent class

#

it's part of damagebyblockevent class

molten hearth
#

has anyone had to do any in-depth string cleaning here cus i aint got a clue where to start w/ this

#

is there some simple AI libraries for this or what 😭 🙏

sullen marlin
#

Wdym cleaning

lilac dagger
#

string = "";

#

but it has to be some other type of cleaning, maybe removing certain elements from a string?

wet breach
chrome beacon
umbral ridge
#

is casting a Sign to getState a proper thing to do

eternal night
#

depends on the Sign import

#

but yea

umbral ridge
#

Sign should work for any sign right

#

WallSign

#

etc

eternal night
#

yea

umbral ridge
#

Alright

eternal night
#

you could also just

#

dip that material check and do like if(!(block.getState() instanceof final Sign sign)) return;

#

orrrrr

#

Tag.SIGNS.isTagged()

#

if you need the speed of avoiding state snapshotting

umbral ridge
#

Sure yeah

#

so isTagged takes in the getState() ?

#

and returns true if its a sign?

eternal night
#

no

#

it takes a material

umbral ridge
#

o

eternal night
#

but like, its still faster and nicer than your .endsWith

#

Block#getState just isn't a free operation

slender elbow
#

i don't pay the bills

#

so

#

plenty free

umbral ridge
#

btw how could it throw a null exception here

eternal night
#

the block is nullable?

#

your IDE is not smart enough to know that an event that is CLICK_BLOCK will have a block assigned

umbral ridge
#

yeah lol

eternal night
#

it just sees the nullable annotation and goes

#

yup

slender elbow
#

so what you're saying is

#

get a better ide

eternal night
#

exactly

#

lynxde

#

would catch that

umbral ridge
#

EmilyIDE

slender elbow
#

💀

umbral ridge
#

nice plugin btw

slender elbow
#

oh no

#

please spare me

umbral ridge
#

XD

#

btw Sign#getLines is deprecated ?

eternal night
#

yea

#

signs have sides now

umbral ridge
#

I havent worked with signs for a long ass time

eternal night
#

you can write on both sides

umbral ridge
#

XD

#

So

eternal night
#

read the javadocs ™️

umbral ridge
#

getTargetSide im guessing i have to check

#

why does getSide take in a Side parameter when its returning the same data type

#

XDD

eternal night
#

different side

#

just

#

"naming" kekwhyper

#

well

#

actually it yields SignSide

#

so

umbral ridge
#

Then how am i supposed to check which side the player clicked on

eternal night
#

getTargetSide?

young knoll
#

Ah yeah we should have named it SideOfTheSign

eternal night
#

obv

warped shell
#

player.getWorld().rayTraceEntities why do i need a location and a vector? is the location a starting location and the vector just the direction? the vector im using contains the location, is it so you can use a normalized vector?

eternal night
#

vectors don't contain locations

young knoll
#

Location is the point where it starts

eternal night
#

but yea, your initial guess is correct

#

location is ray origin, vector is ray direction

young knoll
#

Vectors contain an x y z

#

Location also has pitch yaw and world

worldly ingot
#

Or an rgb. Or an abc.

young knoll
#

Well, yeah

#

3 values

worldly ingot
#

Heck it could contain 123 if you want

#

Might as well go full Jackson 5

eternal night
#

or a qtπ

#

if you are really going for it

warped shell
#

i meant block location

young knoll
#

Vector at home is just double[3]

slender elbow
tardy delta
#
warning - 2024-03-05 19:31:45,802 -- Some files being explicitly added are found in the list of excluded files for upload. --- {"files": ["core/target/site/jacoco/index.html"]}
warning - 2024-03-05 19:31:45,803 -- Some files were not found --- {"not_found_files": ["core/target/site/jacoco/index.html"]}```
Ah yes how does that make sense
warped shell
#

location,vector,double

worldly ingot
eternal night
#

the javadocs should host this information for you

#

give them a read

#

?jd

undone axleBOT
warped shell
#

oh they actually do for once lol

#

usually i find little to nothing

#

ty

young knoll
#

Hey MD takes them very seriously

#

At least now

worldly ingot
#

Does he? Kappa

#

I can think of a few

young knoll
#

Uhhh

#

Well he doesn't write Squee'ek uh'k kk'kkkk squeek eee'eek anymore

worldly ingot
#

*glares at PotionEffectType.DOLPHINS_GRACE, HERO_OF_THE_VILLAGE, and Fire BlockData*

young knoll
#

Hey I fixed the potion effects

worldly ingot
#

You mean you RUINED them :((

young knoll
#

The old stuff is still there!

worldly ingot
#

lmao I didn't realize "BAD_OMEN" had oof in it. That's great

young knoll
#

lol I hadn't seen fire until now

worldly ingot
#

Fire is a classic

young knoll
#

When MD gonna drop that mixtape tho

worldly ingot
#

Fire I think was the OG of md's shenanigans in the Javadocs and I'm in full support

spare prism
#
        Arrays.stream(chest.getInventory().getContents()).forEach(item -> {
            if(item != null) plugin.getLogger().info("item: " + item.getType().name());
        });

why does it print this:

[23:30:03 INFO]: [DeluxeMenuFromChest] item: GOLD_CHESTPLATE
[23:30:03 INFO]: [DeluxeMenuFromChest] item: AIR
[23:30:03 INFO]: [DeluxeMenuFromChest] item: AIR
[23:30:03 INFO]: [DeluxeMenuFromChest] item: AIR
[23:30:03 INFO]: [DeluxeMenuFromChest] item: IRON_CHESTPLATE

when I have these contents: https://imgur.com/a/HLgHV00

umbral ridge
#

btw why does playerinteractevent fire twice

spare prism
#

as far as ik

umbral ridge
spare prism
worldly ingot
eternal night
#

api-version: "1.13"*

young knoll
#

Ew

#

Why

eternal night
#

so we don't have to banish floats from a whole yaml file because the community does not care to specify its strings

worldly ingot
young knoll
#

We already did

#

Cope

eternal night
#

common spigot moment

worldly ingot
#

We banished floats because floats weren't used anywhere in the plugin.yml PES_Blush

eternal night
#

yet ™️

young knoll
#

Speaking of banishing

worldly ingot
#

YET

umbral ridge
#

How do you compare which side was clicked?? XD (ignore the naming signTop.. it's just a sign)

#

SignSide isn't an enum

eternal night
#

SIgnSide is the data thing

umbral ridge
#

only Side is

young knoll
#

SignSide is the clicked side

umbral ridge
#

SignSide

#

doesnt have get methods

young knoll
#

But it doesn't have any refrence to if it's the front or back

#

kek

umbral ridge
#

So....

eternal night
#

getLines exists on there

worldly ingot
#

I mean... I guess we could add Side to the SignSide interface :p

eternal night
#

so does gteLine

umbral ridge
eternal night
#

oh

umbral ridge
#

no getSide

#

????

eternal night
#

ohhh

young knoll
#

I mean front and back are kinda arbitrary

#

They look exactly the same

umbral ridge
#

No

worldly ingot
#

They're DIFFERENT >:((

umbral ridge
#

I need to check which side was clicked

eternal night
#

I mean

#

dumbest thing would be signTopSide == sign.getSide(FRONT)

worldly ingot
#

PES_Giggle it would work though

umbral ridge
#

Can I do that?

worldly ingot
#

Yes

young knoll
#

Can't wait until we can put text on the top of signs too

worldly ingot
#

Returns a referentially comparable instance

eternal night
#

but choco

#

is that an API promise

#

HMMM

worldly ingot
#

IT MIGHT NOT BE

#

.equals() if you want to be SAFE

umbral ridge
#

lmao

#

no errors

worldly ingot
#

We should probably add in getSide() to SignSide though. It's stupid easy. Just need to add it to the constructor

young knoll
#

Does it even implement equals

worldly ingot
#

Maybe a getSign() for good measure

eternal night
worldly ingot
#

Yeah but it might in the future

#

👀

eternal night
eternal night
worldly ingot
#

ur heavy

#

im sorry that's mean

#

WeakReference

eternal night
#

virtual entity moment

#

I mean, you ignored my qtπ compliment early so

#

yea

#

fuck you too

worldly ingot
#

Oh I saw it

eternal night
worldly ingot
#

I just hated it

eternal night
#

oh

#

oh okay

worldly ingot
#

because you can't name a variable π, dummy

umbral ridge
#

Also

young knoll
#

You got a problem with virtual entities cat boy?

umbral ridge
#

how do you check which hand was used to interact with the block (LEFT / RIGHT ?)

young knoll
eternal night
#

java too

#

choco is just not smart

umbral ridge
#

but it has only HAND

young knoll
#

OFF_HAND

umbral ridge
#

I know they clicked with their hand

#

oh LO0L

young knoll
#

I can see it peaking at the bottom of your image

#

smh

worldly ingot
#

I was going to say, how CONVENIENT

umbral ridge
#

btw how could you possibly click with your feet

worldly ingot
#

Very, very carefully

young knoll
#

Welllll

eternal night
#

the enum isn'T just used for that event

young knoll
#

There is Action.PHYSICAL

topaz cape
worldly ingot
#

Leaked Mojang update

#

Feet clicking, 1.21

umbral ridge
#

lolll hahahaa

young knoll
#

What does Action.PHYSICAL actually return for getHand

umbral ridge
#

imagine

#

chest clicking

sleek estuary
#

Why is stone spawning instead of gold?

umbral ridge
#

pushups

eternal night
#

yea, I am actually collecting examples for this @worldly ingot I'll need a video of you pushing a button with your naked toes

#

thanks!

worldly ingot
young knoll
#

Sad

young knoll
#

The heck is the integer in that constructor

sleek estuary
young knoll
#

Uhh

umbral ridge
#

So basically...
Action.LEFT_CLICK_BLOCK is the same as EquipmentSlot.HAND

young knoll
#

That's old naming so idk what it was called

worldly ingot
#

"Equivalent" is doing some heavy lifting

young knoll
#

PacketPlayOutEntityMeta maybe

sleek estuary
worldly ingot
#

Left click block will always be a hand slot, yes

umbral ridge
#

yeah...

#

XD

worldly ingot
#

but you can right click with the main hand too

#

So equivalent isn't correct

young knoll
#

You cannot left click with your offhand

#

yet

umbral ridge
#

really?

#

how

worldly ingot
#

By right clicking :p

eternal night
umbral ridge
#

ohhh right yeah

worldly ingot
#

Is it?

young knoll
#

(Ur nullable)

umbral ridge
#

so wait if I go to the client settings and change my main hand to left / right.. is that a client side thing or will it apply ingame

worldly ingot
#

All my homies don't care about nullability of getHand() because we compare with == 😎

umbral ridge
#

and event

eternal night
young knoll
#

It's client side

worldly ingot
#

Server's aware of your main hand, but either way it's not a matter of "left" or "right" handedness

#

It's hand or off hand

umbral ridge
#

alright

worldly ingot
#

Your off hand can be either your left or your right

#

It's whatever hand is used for your offhand slot

young knoll
#

Your offhand can be left or right but it is always off

#

Which means of course your main hand is always on

solar mortar
#

hey question, could I get someone to help me to troubleshoot an install of xenforo? lmao

young knoll
#

Uhh

#

Not sure anyone here can help much with that

solar mortar
#

yeah I know, its mad offtopic, but I figured Id ask, on the offchance

young knoll
#

@worldly ingot did you happen to handle the xenforo install for hypixel

worldly ingot
#

lmao no. That shit would not be running if that were the case

solar mortar
#

xD

topaz cape
young knoll
#

Do they actually use xenforo

#

I was memeing

topaz cape
#

they 99% do

topaz cape
#

just found out

solar mortar
#

yeah its og

worldly ingot
#

tippy tappy

spare prism
#

?paste

undone axleBOT
topaz cape
worldly ingot
#

NO

#

I liked the tippy tappies

topaz cape
umbral ridge
#

Hey if I check the block type at the itemframe location, why does it return AIR, when itemframe is placed there...

#

I guess itemframe isnt a solid block ? but how do you check for it

worldly ingot
topaz cape
umbral ridge
chrome beacon
umbral ridge
#

So.... I doo block instanceof Entity ?

#

XD

chrome beacon
#

no a block isn't an entity

umbral ridge
#

Exactly

#

how do i check for it

#

XD

#

How do I check for an entity that I know will always exist, at a certain block, in this case an item frame

inner mulch
#

maybe listen for the right click (or any event that opens a chest) of a player, cancel it and open a new inventory with the contents of the chest

#

the contents should be in sync if done correctly

#

player.openInventory(chestInv);

umbral ridge
#

no matter how many itemframes i place around the location

eternal night
#

"around the location" kekwhyper

umbral ridge
#

yea

eternal night
#

upon closer inspection

umbral ridge
#

this is why its BoundingBox

chrome beacon
#

does that location happen to be at 5, 5, 5

eternal night
#

you'll notice you are not passing said location to the method

#

the bounding box is absolute

umbral ridge
#

I though BoundingBox was like an area lol

eternal night
#

and also, yea, wrong lol

#

it is

umbral ridge
#

a rectangle

eternal night
#

it is

#

but you are completely missusing it

umbral ridge
#

ohh I see

#

yeah i get it now

sleek estuary
#

animation that i want (gold): https://www.youtube.com/watch?v=PQYT4gG3OCU second 0.22. any suggestion?
code: https://paste.md-5.net/seyilezope.cpp
my animation: https://imgur.com/a/ESXuvGK

AkumaMC Season 6, the summer update will be releasing this Saturday, 17th of June @ 2PM EST // 7PM BST

» Server IP: fun.AkumaMC.net
» Bedrock IP: Bedrock.AkumaMC.net
» Store: https://store.akumamc.net (50% OFF SALE!)
» Discord: https://discord.gg/akumamc
» Forums: https://www.akumamc.net

AkumaMC Is definitely the best OP Prison Server. Minecra...

▶ Play video
umbral ridge
#

Ok so what am I doing wrong now?
I just need to check at the current location if theres a single itemframe, I am basically checking 1x1x1 block because I don't need more

#

its always zero

eternal night
#

again

#

read the javadocs on it

remote swallow
umbral ridge
#

I am doing exactly that

eternal night
#

yea

#

no

umbral ridge
#

Yes

eternal night
#

okay

umbral ridge
#

I am looking at the 1x1x1 block

eternal night
#

how much volume fits into a cuboid

#

with its two corners exactly

#

at the same location

topaz cape
umbral ridge
#

i dont know

eternal night
#

what is the height of your cuboid

umbral ridge
#

1

remote swallow
eternal night
#

no

#

think again

#

the first corner (the low one) has its y at blockY()

umbral ridge
#

Ahh

#

so I need the +1

eternal night
#

the high corner has its y also at blockY()

#

yes

umbral ridge
#

Alright

eternal night
#

or

#

you use one of the helper methods

#

that can do this for you

umbral ridge
#

Sure yeah what are they?

eternal night
#

BoundingBox#of

#

also visible in the javadocs 😉

remote swallow
#

ill make you visable in the javadocs

eternal night
#

say less

grim ice
#

spigotmc's members are so iconic

remote swallow
#

what else would we be

grim ice
#

like at this point, if i saw lynx irl i would instantly recognize him

#

just from how many times ive seen his pfp

remote swallow
#

i fuckin wouldnt

grim ice
#

same for 7smile

remote swallow
#

i can barely see the fact its a person let alone what he looks like

grim ice
#

basically no one changes anything about their profile

grim ice
remote swallow
#

its small

remote swallow
#

THATS A BATHROOM?!?

grim ice
#

yes...

remote swallow
#

I THOUGHT IT WAS A WARDROBE

grim ice
#

when you finally buy glasses:

#

im pretty sure this pic is at least 6 years old

#

or 5

topaz cape
remote swallow
#

bring it back or i start a vote ban

grim ice
#

also i cant believe 2022 is 2 years ago

#

that's crazy

#

and 2018 is 6 years ago..

eternal night
#

also yikes

grim ice
eternal night
#

my pic is so old

#

I shall update it

remote swallow
#

me thinking ur pfp was you stood infront of a wardrobe with a mirror

grim ice
#

dont

#

please

eternal night
#

nope

grim ice
#

NO

#

WHAT HAEV I DONE

eternal night
#

this is years old

#

time to change

#

I forgot about it tbh

#

I have compact mode without pictures

grim ice
#

nah this picture is tradition

eternal night
#

Welp

grim ice
#

cant break it now

eternal night
#

its time to look forward

grim ice
#

rip

remote swallow
#

how do you know who ur talking to with no pfps

grim ice
#

names

eternal night
#

their name?

#

the fuck

#

xD

grim ice
#

lol

remote swallow
#

who has the effort to read that

grim ice
#

fair

remote swallow
#

i made choco think i was simple by setting my pfp to his photo of an oraguntan

grim ice
#

didnt realize

olive lance
#

Clearance is good?

plain plaza
#

Is there a way to accurately detect whether a player hits an entity and misses it by hitting a block or air?

drowsy helm
plain plaza
#

yeah, i tried depending on just the damage event and interact event, but they seem to both fire when hitting an entity

#

i didnt wanna check if an entity is actually in their view

#

guess i might have to do it

young knoll
#

Wait what

drowsy helm
#

you dont have to hit an entity for itneract event to fire

young knoll
#

How do you hit an entity but not hit an entity

#

Are you going for like, accurate hitboxes?

plain plaza
#

im trying to track the accuracy of hits, so i use the damage event for a successful hit, and the interaction for misses

young knoll
#

Ah

plain plaza
#

but at some certain distances, it also fires the interaction event despite hitting the entity

young knoll
#

You’d have to figure out which order they fire in

#

And then check if one is fired right after the other

plain plaza
#

yeah i figured im supposed to do that

#

ty

umbral ridge
#

how do you get the block's PDC again?

worldly ingot
#

Not all blocks have PDC

young knoll
#

Blocks don’t have pdc

worldly ingot
#

Only tile entities because they're the only ones that store NBT data

umbral ridge
#

I need it for a Sign

young knoll
#

Block entities do though

umbral ridge
#

It has it

worldly ingot
#

BlockState#getPersistentDataContainer()

umbral ridge
#

Ahhh block state

young knoll
#

Iirc it has to be a TileState

worldly ingot
#

Yeah, or your Sign object

#

Right, yeah, TileState, but practically all block states (if not all of them) are tile states

young knoll
#

Well no

umbral ridge
#

Awesome

young knoll
#

All blocks have a state, just most are the basic blockstate

worldly ingot
#

ye

#

Your Sign instance will have that method lol

umbral ridge
#

Yea figured it out lol

#

btw so from what I remember you first gotta create a NamespacedKey and then how do you use it?

young knoll
#

?

#

You just pass it as an argument

umbral ridge
#

I mean for checking the PDC

#

not writing it to the block

young knoll
#

PDC#get

#

Or has

umbral ridge
#

Noice

umbral ridge
# young knoll PDC#get

Wait I shouldn't use new NamespacedKey("", "") ? How do I initialize the NamespacedKey class then

young knoll
#

You’re meant to use the one that takes a plugin and a string

umbral ridge
#

ohhhhhhhhhh

rough ibex
#

should never be used by plugins, for internal use only!!

young knoll
#

(I do it anyway)

#

Yeah im a rebel

umbral ridge
#

Alright a complicated question, so how do you place an itemframe and then rotate it based on the player's looking direction? XD

drowsy helm
#

done

umbral ridge
#

What about an itemframe? xDD

#

since it's an entity

#

I cant just setblock right

drowsy helm
#

you have the block face, just apply it accordingly

nocturne knoll
#

what is the process for gaining access to objects through dependent plugins? this is kinda driving me absolutely insane right now...

i've added my dependent plugin through my local maven repository (after trying to add it as a provided dependency in intellij to no avail) with the scope set to provided, registered it using the Bukkit servicesmanager, and i cannot get it back as a registeredserviceprovider using the same class in my other plugin... it's showing up in the plugin that registered it, however.

previous to that, i got the plugin instance from the pluginmanager and attempted to cast it to the type of the dependent plugin, but the cast failed as it's looking as though it's trying to use another classloader between plugins.

i can't find anything on the web for this and i'm about ready to punch GPT in the face

lost matrix
# nocturne knoll what is the process for gaining access to objects through dependent plugins? thi...

The plugin classloaders are parented by the spigot classloader and will end up searching on the same classpath on runtime.
If you have two plugins installed, then you can simply get an instance from other plugins through the static JavaPlugin methods,
or by having a singleton instance of your JavaPlugin implementation with a static getter in your plugin.

Example for the both:
// PluginA

public class PluginA extends JavaPlugin {

  private static PluiginA instance;

  public static PluginA getInstance() {
    return instance;
  }

  @Override
  public void onEnable() {
    instance = this;
  }

}

// PluginB

public class PluginB extends JavaPlugin() {
  @Override
  public void onEnable() {
    PluginA instanceA = PluginA.getInstance();
    PluginA anotherA = JavaPlugin.getPlugin(PluginA.class);
  }
}

Just make sure that the plugin.yml of PluginB contains a yml to signal this dependency:

depend: [PluginA, ...]

or

depend:
  - PluginA
  - ...

This ensures that the onLoad and onEnable methods on all dependencies are
called before yours is.

nocturne knoll
#

that was what i tried first. the dependency has been set in the plugin.yml file and load order has been verified.
the classes are not matching, and using a static reference still gets a null reference in pluginb

ivory sleet
#

A certain fork does expose it as api iirc

umbral ridge
#

How do you get the block that the player is looking at

lost matrix
lost matrix
umbral ridge
#

wasn't there another way to do this