#help-development

1 messages · Page 2051 of 1

sacred mountain
#

i quit too

grim ice
#

give it to me :D

#

Lol

sacred mountain
grim ice
#

nO PLEASE DONT

sterile token
grim ice
#

i beg you

sacred mountain
#

how about like

tranquil viper
#

ugh I am trying to optimize a plugin and it doesn't store the Inventory anywhere

grim ice
#

NO PLEASE

#

STOP

#

DONT

#

DO THAT

tranquil viper
#

it only stores the names

lavish hemlock
#

Could y'all move to #general?

sacred mountain
#

ill mlg it

grim ice
tardy delta
#

and what does that mean?

sacred mountain
#

and if i dont fail then ill hyper max a set of leaf armor

lavish hemlock
# tardy delta and what does that mean?

Well first you'd have to find the immutable implementation, probably something like java.util.Collections$ImmutableList, which you would access via Class.forName, then reflectively access the field via getDeclaredField, and acquire its value via the immutable instance.

lavish hemlock
#

Comparing by name isn't wise since inventories have default names based on their type, e.g. InventoryType.CHEST = "Chest"

tardy delta
#

on a not cheaty way

lavish hemlock
#

Yeah that's the point

#

You shouldn't be able to mutate an immutable collection

#

Makes sense that you'd have to do it reflectively

tardy delta
#

whats then the difference between those two?

#

i still dont get it

lavish hemlock
#

Between Guava and Java's?

tardy delta
#

ye

lavish hemlock
#

Guava's ImmutableList is not a view

#

It stores values itself instead of delegating calls to an underlying collection

tardy delta
#

but whats a view i dont understand that

lavish hemlock
#

We just explained it :p

tardy delta
#

so a view is a delegation which blocks modification?

lavish hemlock
#

Not necessarily

#

That would just be an immutable view

low temple
#

Don’t InventoryViews store an inventory and a list of players accessing the inventory?

lavish hemlock
#

They store the top and bottom inventories

#

The top inventory being the one a player is accessing, and the bottom inventory the inventory of the player

low temple
#

Do personal inventories have views?

#

Like if a player opens their own inventory

lavish hemlock
#

No

low temple
#

Makes sense

lavish hemlock
#

There's an interesting implementation detail

#

In CraftBukkit, the "active container" and player container are separate fields

#

The active container is the inventory the player is viewing

#

While the player container is their inventory

#

So, the player opening their own inventory does not create an InventoryView

#

Because it's not handled the same as something like a chest GUI

tardy delta
#

Unlike Collections.unmodifiableList(java.util.List), which is a view of a separate collection that can still change, an instance of ImmutableList contains its own private data and will never change. ImmutableList is convenient for public static final lists ("constant lists") and also lets you easily make a "defensive copy" of a list provided to your class by a caller.

#

ahe when changing that java.util.List, the actual collection you want to protect isnt altered?

lavish hemlock
#

With unmodifiableList, get and forEach and such will return values from the underlying list, but methods like add, remove, and set will throw an UnsupportedOperationException

#

Guava does the same, just without an underlying list

#

I haven't looked at Guava's immutable implementation but I'll check it out eventually, probs

lethal coral
#

I would like to know why so that I obtain a greater understanding

tardy delta
#

ah the unmodifiableList changes when changing the undlerlying list

#

im starting to understand

vast sapphire
#
                            short durability = p.getInventory().getItemInHand().getType().getMaxDurability();
                            if (!(p.getInventory().getItemInHand().getDurability() == -durability)) {
                                p.getInventory().getItemInHand().setDurability((short) -(durability));
                                Zenon.getInstance().getConnection().createStatement().executeUpdate("UPDATE ZenonPVP SET points=points-"+price+" WHERE uuid=\"" + p.getUniqueId() + "\" ");
                                p.sendMessage(format("&e-"+price+" points"));
                            } else {
                                p.sendMessage(format("&3You are already at max durability"));
                            }``` The statement still gets executed even though the durability does not equal max durability?
sacred mountain
#

whats better using string format or .replace()

tardy delta
#

it looks horrifying

dire salmon
#

is there a way to remove Symbol from banner patern lore?

#

should look like this but without "Símbolo"

bold solstice
#

I know its probably a very stupid question for most of you but
how do I call a function that is on another class
like I have a Gui Function that returns a gui and I want
to access it from a different class and using the information that is already there

dire salmon
#

Class.function()?

tardy delta
#

static abuse

#

get the object from somewhere

bold solstice
#

Races is the class so I try to do
private static Races races;
and then call races like this
p.openInventory(races.GuiCreator(p));
(p is player)

dire salmon
#

||wheres the code block : (||

bold solstice
tardy delta
#

thats looks like static abuse

#

wait what is Races?

#

your main class?

bold solstice
#

yes

tardy delta
#

?di

undone axleBOT
tardy delta
#

use this

#

much cleaner

bold solstice
#

so I do private Races races;?

tardy delta
#

yes

grim ice
#

?naming should be add

#

Standard Java Naming Conventions:
Packages: Names should be in lowercase. ...
Classes: Names should be in Pascal Case. ...
Interfaces: Names should be in Pascal Case. ...
Methods: Names should be in camelCase. ...
Variables: Names should be in camelCase. ...
Constants: Names should be in uppercase.

dire salmon
#

yes

tardy delta
#
public class MyPlugin extends JavaPlugin {
  @Override
  public void onEnable() {
    Manager manager = new Manager(this);
  }
}

public class Manager {
  private final MyPlugin plugin;
  public Manager(MyPlugin plugin) { this.plugin = plugin; }
}```
#

thats the best thing

#

instead of a static getter

tardy delta
#

there might be situations where you need one but try to avoid it

grim ice
#

it doesnt matter

#

in most cases

tardy delta
#

to not use a static method?

#

yes it does, its cleaner

grim ice
#

not really imo

bold solstice
grim ice
#

then learn java

sharp bough
#

is it possible to extract chunk X and Y from ChunkData?

ivory sleet
sterile token
#

Radius = 10
And i didnt move from the location (Im inside the radius)

#

So im definitly giving up

slim locust
#

i have a troll command with 3 cases and i want that you can choose the case with tab how can i do it

tardy delta
#

let your command class extends TabCompleter

#

then override the abstract method

#

check for the args length and the content

grim ice
vocal cloud
sterile token
#

They dont load on my google

vocal cloud
lusty vault
#

I was going to say

grim ice
#

2 letter variables

sterile token
# vocal cloud

And how check if player location, is inside the 2 locations?

grim ice
#

bruhh

#

cant u see

#

the second method

sterile token
#

Forget

#

I have eaten a clown today

#

🤔

tardy delta
#

wha-

vocal cloud
sterile token
#

Wouldnt that math lag the sever when having lot of claims with large radius?

lusty vault
#

No it won't lag

sterile token
#

And call it on MoveEvent?

vocal cloud
#

No? This is the most efficient method

grim ice
#

fast to a degree you will never imagine

sterile token
vocal cloud
sterile token
#

HMn

vocal cloud
#

Well if you want a circle that's different

grim ice
tardy delta
#

circles in mc

vocal cloud
#

But you can inflate a 1x1

sterile token
#

I need the to calculate 2 corners from 1 location and 1 radius

#

That what i need, ge tthe red points based on a radius

grim ice
#

btw @sterile token

sterile token
#

Idk why its so diffcult

grim ice
#

whats ur pc cpu ghz

sterile token
#

Its not for my pc

grim ice
#

just tell me

sterile token
#

Its public plugin

grim ice
#

Yes just tell me

sterile token
#

My pc has ryzen 5 3600, 32gb of ram

grim ice
#

i asked for the ghz of your cpu

#

not the gpu and ram

tardy delta
#

damn 32 gigs ram

vocal cloud
#

But you know all the points

grim ice
#

eitherwya

tardy delta
#

i wish i could afford that

vocal cloud
#

I don't understand

sterile token
#

I want you to define how many block will protect around the protection block

grim ice
#

gaming computers usually have 4 ghz

lusty vault
#

the distance between min points and max points / 2

grim ice
#

which means

#

4000000000 cycles per second

vocal cloud
#

That's easy divide the distance between x1 and x2 by 2

grim ice
#

an ADD task takes 1 to 2 cycles

#

from 4000000000 cycles

sterile token
#

Mike i dont understand sorry

grim ice
#

(those cycles are per second btw)

sterile token
#

IM too confused

woeful crescent
#

can i clear potion effects with getActivePotionEffects.clear()?

grim ice
#

computers are way too fast

sterile token
#

Idk why i cannot do that

#

Such a simplier thing and im so dumb

vocal cloud
#

You can inflate from a point. You can do other math to find the center

sterile token
#

Does it support from 1.8x to lastest sipgot version?

grim ice
#

the world's fastest cpu can perform around 6 billion add operations in 1 second

#

a fact i think

sterile token
#

Wouldnt apply using world edit cuboid?

#

My big problem is that i dont know how to calculate the 2 corners knowing a center location and a radius

#

Your code didnt work

#

I test and still aying false

tardy delta
sterile token
#

When i was inside the location

#

zacken how much do you ask for coding yourself that thing?

#

Because im stressed

#

To test everything and nothing works

lusty vault
#

No unless you use the wrong one by accident

tall dragon
#

is it still bad if its in a different module?

sterile token
#

I will start from 0 again using this base that you told me it was correct

public class RadiusCuboid implements Cuboid<Vector> {

    private final Vector first;
    private final Vector second;

    public RadiusCuboid(Vector location, Integer radius) {
        this.first = new Vector(location.getX() - radius, location.getY() + radius, location.getZ() + radius);
        this.second = new Vector(location.getX() + radius, location.getY() - radius, location.getZ() - radius);
    }

    public boolean contains(Vector location) {
        return null;
    }

    @Override
    public Vector getFirstPoint() { return this.first; }

    @Override
    public Vector getSecondPoint() { return this.second;}
}```
#

The operators or what?

vocal cloud
#

I don't get why you don't just use a simpler implementation

lusty vault
#

Nevermind

sterile token
#

I dont understand when you said negative values

#

So my whole class its wrong?

#

I ill start from there

#

on contains method?

#

Or the constructor?

#

You never told me that before

#

Or i never seen that

#

So i have to cahnge operators or what?

#

but i dont understand

#

I ill post my question on stackoverflow

#

Maybe they can help me

#

In which vector? first or second?

#

why you have 2 values?

#

Im probably confuse because never worked with 3d models

smoky vapor
#

Why is Gradle failing to load changes now? It didn't have problems before:

plugins {
    id 'java'
}

group 'com.macintoshfan'
version '2.0.1'

repositories {
    mavenCentral()
    maven { url 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }
}

dependencies {
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
    compileOnly 'org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT'
    implementation 'org.jetbrains:annotations:23.0.0'
}

test {
    useJUnitPlatform()
}
#

Has the link changed for 1.18.2?

chrome beacon
smoky vapor
#

It did work before, but does not now.

sterile token
#

Allright, i will watch a video to understand how works 3d graphs using x, y, z

#

I rember on high-school just orking with x and y*

torn shuttle
#

it feels sort of weird how invariably the largest classes I have exist because they just have hundreds of lines of strings

#

like over 500 lines of strings of me just defining what is in the default arena

smoky vapor
quaint mantle
#

how do I add worldedit 7.2.10 to dependencies?

#

pom.xml

#

How to use it?

#
<repository>
            <id>sk89q-snapshots</id>
            <url>http://maven.sk89q.com/artifactory/repo</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
#
<dependency>
            <groupId>com.sk89q.worldedit</groupId>
            <artifactId>worldedit-bukkit</artifactId>
            <version>7.2.10-SNAPSHOT</version>
        </dependency>
#

not worked

chrome beacon
#

?notwork

#

Hm was a command for this..

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.

chrome beacon
#

Ah ty :)

tall dragon
#

600 ticks

#

by default

#

when it has existed for 600 ticks

#

so yes, spawn

undone axleBOT
tall dragon
#

say it drops for 30 seconds straight it will destroy itself and drop its item

#

if you wanted to make it exist longer, u can just keep setting the time it existed to 0.

quaint mantle
#

Cannot resolve org.hamcrest:hamcrest-core:1.1

Clean up the broken artifacts data and reload the project.

tall dragon
#

im pretty sure setPersistent will not help you. and it will still destroy the block

#

dont u have Entity#setTicksLived?

#

u could try setting that to 0 every X amount of time

#

im not aware of one. and already heard lots of people complaining about this

#

there should indeed be a better way. but i think there is not.

sterile token
#

Something like this you where saying?

public List<Block> getBlocks(Location pos1, Location pos2) {
  World world = pos1.getWorld();
  List<Block> blocks = new ArrayList<>();
  int x1 = pos1.getBlockX(), y1 = pos1.getBlockY(), z1 = pos1.getBlockZ();
  int x2 = pos2.getBlockX(), y2 = pos2.getBlockY(), z2 = pos2.getBlockZ();
  int lowestX = Math.min(x1, x2);
  int lowestY = Math.min(y1, y2);
  int lowestZ = Math.min(z1, z2);
  int highestX = lowestX == x1 ? x2 : x1;
  int highestY = lowestX == y1 ? y2 : y1;
  int highestZ = lowestX == z1 ? z2 : z1;
  for(int x = lowestX; x <= highestX; x++)
    for(int y = lowestY; x <= highestY; y++)
      for(int z = lowestZ; x <= highestZ; z++)
        blocks.add(world.getBlockAt(x, y, z));
  return blocks;
}```
#

And sorry for being so asshole and annoying

#

Its taken from spigotmc thread, just to ask you if its similar

#

I know that i dont have to loop

tall dragon
#

u could use an armorstand

sterile token
#

So what i can do? I just wanna finish this, and stop fucking on the discord

tall dragon
#

maybe i can help

sterile token
#

Oh allright really thanks

#

Let me do a diagram

#

On block place, i keep the block location (x, y, z) into a list.
I having problems to calculate the Pos1 and Pos2 knowing 1 location and radius.

Let say the blue part its the protection block, based on that cordinates and a radius i want to calculate the 2 corners

#

My goal, to people be able to change how much blocks around (a radius literally) will be protected by the protection block

quaint mantle
#

add radius to the x and z?

tall dragon
#

so that includes Y axis?

sterile token
#

I think yes, because the protection will be 3D, top, botton, right and left

#

So let say, you put the protection block on coords: x=0, y=0 and z=0 and radius 5, the x, y, z should protect 5 blocks around

spring minnow
#

is there a way to get every Attribute avaible for an entity?

#

without actually having an entity

tall dragon
sterile token
#

Oh really thanks

spring minnow
#

yeah

quaint mantle
#

👍

#

always check javadocs

spring minnow
#

i would like to have a way to store in something like a list, all the attributes avaible for an entity, without having the entities

spring minnow
quaint mantle
#

hmm

#

Oh you want to pull a list from the api

spring minnow
#

Attribute class doesn't have a .isAvaibleFor(EntityType type)

quaint mantle
#

hmm

spring minnow
#

yeah

#

without manually add the attributes that i know are avaible for that type of entity

vocal cloud
quaint mantle
spring minnow
spring minnow
#

thanks anyway :=)

sterile token
quaint mantle
#

its a saying

#

like, thats all you need to do

sterile token
#

Kero so i just need to inflate it by x amount?

#

That what he means?

vocal cloud
#

My code I wrote has an inflate. You just need to set the initial to 1x1 block aka the center then you can inflate it by x y z and you've got a x by y by z square with an origin of your original position

grim ice
sterile token
#

I have done of the positon +5 and the other -5

quaint mantle
sterile token
quaint mantle
#

Use the code he provided. Its your best bet.

sterile token
quaint mantle
#

Create the bounding box with both points of your block

#

then inflate it by the radius

#

then ur good

sterile token
#

`Mike this would be like this (https://paste.md-5.net/zoxelecoqi.java):

Location loc = player.getLocation();
int raidus = 10;

CustomBoundingBox cuboid = new CustomBoundingBox(loc.getX() + radius, loc.getY() + radius, loc.getZ() + radius, loc.getX() - radius, loc.getY() - radius, loc.getZ() - radius);

cuboid.inflate(radius, radius, radius);`

#

LIke that so?

tall dragon
#

no

sterile token
#

So?

vocal cloud
sterile token
#

Im confused

quaint mantle
#

No dont use the + radius

tall dragon
#

ur already adding the radius

quaint mantle
#

Just put the initial coords of it

sterile token
#

Oh allright

#

Location loc = player.getLocation();
int raidus = 10;

CustomBoundingBox cuboid = new CustomBoundingBox(loc.getX(), loc.getY(), loc.getZ(), loc.getX(), loc.getY(), loc.getZ());

cuboid.inflate(radius, radius, radius); 
#

My issue is that i dont know the 2 corners

tall dragon
#

you dont need them

sterile token
#

I jsut kno the center coord

quaint mantle
#

do you specifically need the two corners?

last citrus
#

How do I use p.setStatistic();

quaint mantle
#

once you inflate it just call the isInside method

tall dragon
sterile token
quaint mantle
#

Yea you dont need it specifically

#

The isInside will return true if they try to break inside of the box

#

so u just cancel the break then

tall dragon
sterile token
#

Allright and the constructor will be liek the one i send?

quaint mantle
#

Yep, and also what @tall dragon said

#

wait

#

its not player.getLocation

sterile token
tall dragon
#

yes

quaint mantle
#

it would be the location of the center block

tall dragon
#

yea you also need to pass in the location of your center block indeed

#

not the player

quaint mantle
#

Location loc = (your center block).getLocation();

sterile token
#

So will be:


Location loc = block.getLocation();
int raidus = 10;

CustomBoundingBox cuboid = new CustomBoundingBox(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());

cuboid.inflate(radius, radius, radius); 
tall dragon
#

but, block.getLocation. will be the block the player has broken no?

quaint mantle
#

uhhhh

tall dragon
#

not the center block perce

vocal cloud
#

Well you can make a constructor that assigns x1 and x2 to the center block

sterile token
#

Wait because i have to use for 2 things

quaint mantle
#

ok so initially to create the box you need the center block. When you check if its inside you want to use the block that the player is trying to break

sterile token
#

1- Create the cuboid when player place the protection
2- Check the cuboid when player break, move, etc

#

So im confuse again

#

I was unconfused but i get again

quaint mantle
#

Do you not want them to walk inside of it either?

#

Or just not break

tall dragon
#

yea nvm haha

sterile token
#

I want the next:

  1. On block place, if it his claim allow him to place blocks, if not doesnt allow him
  2. On block place, if claim doesnt exists create the cuboid
  3. On block break, if claim exists doesnt allow him
#

But im confused again

tall dragon
#

whats there to be confused about xd

quaint mantle
#

if ur not gonna help then stop commenting zack, he obviously doesnt understand

sterile token
#

So for creating the claim just do:

CustomBoundingBox cuboid = new CustomBoundingBox(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());

#

So?

quaint mantle
#

and you telling him you already told him isnt doing anything

sterile token
#

I know you explain but im so dumb that i cannot do it

sharp bough
grim ice
#

@sterile token can u draw over this

#

select a block

grim ice
#

and give an example input

#

(radius)

sterile token
grim ice
#

and tell us how it would look like

quaint mantle
#

uhhhh I don't think he needs to do that

#

we already know what he wants to do

grim ice
#

oh ok

quaint mantle
#

Theres just too many people talking i think and its confusing him

sterile token
#

Black = protection block (1 location)
Blue = the amount of blocks

So if in this case the radius will be 3, protecting 3 blocks around the black one

#

Do i have explained? That what i mean with radius Hex, Kero

quaint mantle
#
// In the listener for block break/place

Block b = ??? //The block breaked or placed
Location loc = b.getLocation();

if (cuboid.isInside(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())
{
  // Also check if they own it, however you want to do that
  // If the block is inside the cuboid and they dont own the cuboid cancel the event
  event.setCancelled(true);
}
sterile token
#

Yeah i know

quaint mantle
#

thats it then 🤔

sterile token
quaint mantle
sterile token
#

Oh yeah its better

sturdy heron
#

I was trying to put some snippet into my project for resetting pitch, but when I put it in the "PacketPlayOutPosition" was red, and I'm not sure if I'm supposed to import some library or what

private void resetPitch(Player player) {
  PacketPlayOutPosition posPacket = new PacketPlayOutPosition(0,0,0,0,45, Set.of(PacketPlayOutPosition.EnumPlayerTeleportFlags.a, PacketPlayOutPosition.EnumPlayerTeleportFlags.b, PacketPlayOutPosition.EnumPlayerTeleportFlags.c, PacketPlayOutPosition.EnumPlayerTeleportFlags.d), 1, true);
  ((CraftPlayer) player).getHandle().b.sendPacket(posPacket);
}```
tender hemlock
#

does anyone know a minecraft bedrock api, to fetch player info such as skins? something like crafatar.com but for bedrock

quaint mantle
tall dragon
#

?paste

undone axleBOT
tall dragon
sterile token
#

Oh allright really thanks

#

Really thanks to everybody, Epic, Kero, 2hex, zacken and mike for being helpful

quaint mantle
#

ah yes that does seem better for him. now he has to figure out how to use that one now tho :huh:

#

omg my emoji didnt work

#

are external emojis blocked lol

tall dragon
#

yea

quaint mantle
#

darn

tall dragon
#

unless you are a booster :D

quaint mantle
#

oh

#

say less

sturdy heron
quaint mantle
sturdy heron
#

1.18.1-R0.1-SNAPSHOT

quaint mantle
#

Ok

#

as of 1.17 NMS is different

#

read this post for info (the second message)

hybrid spoke
#

but design a revolver pls

#

oh

#

sad

quaint mantle
#

lmao idk why i thought of that too

#

didnt think about the casino game

grim ice
#

isnt rr a win win

#

if ure gonna do it u prob need money

#

if u win u get money

#

if u lose ur suffering ends

hybrid spoke
#

but you should always use your own revolver

#

otherwise you will lose for sure

quaint mantle
#

arent gambling plugins not allowed on spigot anyways

#

pretty sure i read that somewhere

#

i could be mistaken tho

tall dragon
quaint mantle
#

oh okay gotcha

grim ice
#

should i make a russian roulette plugin

tall dragon
#

premium gambling plugins that existed before that rule however are allowed to stay

hybrid spoke
#

lets all make it together

grim ice
#

and the revolver has a custom design

#

itll be so neat

hybrid spoke
#

and with a custom animation

#

in third person with armorstands

grim ice
#

YEAH

#

and an npc in the back of the room

hybrid spoke
#

and let us make the death visualized as realistic as possible

#

and a lose ends with a 1/2h ban

grim ice
#

ru gonna do that actually

#

i might

#

but i dont know a designer so

hybrid spoke
#

that would be sick but lotta work

grim ice
#

eh its profitable tho

#

u can sell it to some yt

#

itll gain heck a lot of views

hybrid spoke
#

im not into selling things

grim ice
#

but not sure what type of youtuber would do that on their channel

hybrid spoke
#

either public or nothing

grim ice
#

lol

grim ice
#

and make custom messages

#

ur character talks without you talking

#

e.g

hybrid spoke
#

"Dear god, be with me..." click

grim ice
#

Player 1: Uhh.. Can I go back home.. I don't wanna continue..

#

Player 3: I'm definitely dying this one..

#

Player 2: If I win this, I'll pay off every debt on me.

hybrid spoke
#

hm, nah. would be funnier if it comes from the players itself

grim ice
#

Player 5: I will leave this alive, hopefully

hybrid spoke
#

nothing forced

grim ice
#

stuff like this

#

would be more dramatic if its forced

#

if its from the players it would be prob

hybrid spoke
#

or like messages which spoil the outcome

grim ice
#

LMAOOOO

#

LOL U GON DIE LOL

hybrid spoke
grim ice
#

and like

#

the revolver

#

a huge one

#

is held by a npc wearing a costume

#

handing it to the next person

hybrid spoke
#

oh and premium features like a rocket launcher

grim ice
#

it would be so cool istg

#

but it needs some bit of work

grim ice
#

the personalities should

#

each personality has its own messages

#

so it wont be like this:
Player 1: I will win this and get this money, I will pay off my debts!
Player 1: Oh god I'm sorry please let me out, I have children I beg you

sterile token
#

2Hex

sleek pond
#

Yes

hybrid spoke
#

Yes

glossy venture
#

how do i get the shaded reobfuscated jar with paperweight userdev
its giving me a classnotfound with the dev-all version, i assume the dev versions are not reobfuscated?

dire marsh
#

make your build dependon reobfjar and then it's just your normal output jar

glossy venture
#

ight ill try

#

still getting

java.lang.NoClassDefFoundError: net/minecraft/server/level/ServerPlayer
#

but i need to shade another module with it

dire marsh
#

what jar are you trying

glossy venture
#

building with paperweight (build task) generates

*.jar // no shading
*-dev.jar // idfk
*-dev-all.jar // shading
#

i need shading

dire marsh
#

what?

#

.jar is the shaded one

glossy venture
#

but theres no *-all.jar

glossy venture
dire marsh
#

show your build.gradle

glossy venture
#

oh yeah it is

#

tf

dire marsh
#

it's not dev-all

glossy venture
#

nvm

#

thanks

#

last time it wasnt im confused

lethal coral
mortal hare
#

Man i wish i knew x86 assembly like a god

#

there aren't many tutorials or sources referencing assembly

lavish hemlock
#

I like varints.

lethal coral
lavish hemlock
mortal hare
#

varints are different from ints

#

but the practicality is the same

lavish hemlock
#

I mean, byte-wise they're pretty different, but if you're using ProtocolLib then you'll likely just write/read ints.

mortal hare
#

they're more efficient in packing data

#

thus saves bandwidth

lavish hemlock
lethal coral
#

so if I'm trying to get the EntityId of a packet that I'm listening to (the field is VarInt), what would I do?

outer pond
#

Read a var int? :D

lavish hemlock
#

There are some situations where varints actually waste an extra byte, but that's negligible for how much they save.

lethal coral
#

this is the packet

lavish hemlock
#

Just read an int.

#

ProtocolLib handles the variable-length primitives itself.

mortal hare
#

magnificent

lavish hemlock
#

What in the name of god is this

mortal hare
#

assembly

lavish hemlock
#

I know it's x86 but

mortal hare
#

for loop

lavish hemlock
#

What does it do

#

Ohh

#

Yeah I saw the inc

lethal coral
lavish hemlock
#

getIntegers(), probably

mortal hare
#

well i think its for loop

#

im not sure really

#

im tinkering with memory hacking

lavish hemlock
#

Also

mortal hare
#

for fun

#

just to tinker with C lang

lavish hemlock
#

One important thing about ProtocolLib!

outer pond
#

Assembly, the most human readable language ever made

lavish hemlock
#

The index of the values in a packet is relative to the fields of the NMS packet.

lethal coral
lavish hemlock
#

Because I think ProtocolLib uses reflection to instantiate a packet

#

That way avoiding issues with versioning

vale cradle
outer pond
#

Wiki.vg documents the protocol, the actual implementation by Minecraft might be different

lavish hemlock
#

So, each packet is represented by it's own class in NMS.

#

You basically need to check the fields

#

for example

vale cradle
lavish hemlock
#
int i0;
int i1;
IBaseComponent c0; // or whatever the class is

would be

getIntegers()
    .write(0, /* int here */)
    .write(1, /* int here */);
getChatComponents()
    .write(0, /* component here */);
#

Also yes those indices are correct

outer pond
lavish hemlock
#

Also don't use PacketWrapper it's out-of-date.

outer pond
vale cradle
lethal coral
lavish hemlock
#

You don't wanna use getField

lethal coral
#

😐

lavish hemlock
#

You wanna use read

lethal coral
#

I see

lavish hemlock
#

That returns the actual value

#

getField returns the instance of java.lang.reflect.Field that represents that value

lethal coral
#

I saw

#

it appears I didn't read enough

mortal hare
#

can someone of you remind me does low endian mean that its starts from the right or the left (binary value)

lavish hemlock
#

Little-Endian

#

Endian is literally "end"

mortal hare
#

little endian whatever

lavish hemlock
#

Little-Endian means the smaller value's on the end

#

Big-Endian means the bigger value's on the end

mortal hare
#

so which is normal to human writing

lavish hemlock
#

So:
LE = Starts from right left
BE = Starts from left right

#

or wait

mortal hare
#

little endian is the most common

#

then?

lavish hemlock
#

did I get that backwards

mortal hare
#

yea

lavish hemlock
#

Yeah

mortal hare
#

that's what im talking about

#

i always forget that

lavish hemlock
#

Like uhh

#

I think networking?

outer pond
#

Java is big endian

lavish hemlock
#

Yeah okay so a lot of networking stuff is Big-Endian

#

But Little-Endian is more common for architectures

mortal hare
#

DH and DL are the High and Low halves of the DX register. or EDX or in 32 bit registers, does this mean if i acess DL 8 bit register i get the least significant byte out of the EDX register

#

suppose its little endian

lethal coral
# lavish hemlock Yeah okay so a lot of networking stuff is Big-Endian
    private void registerEntitySpawnPacket(){
        Games.getInstance().getProtocolManager().addPacketListener(
                new PacketAdapter(Games.getInstance(), ListenerPriority.NORMAL,
                        PacketType.Play.Server.NAMED_ENTITY_SPAWN) {
                    @Override
                    public void onPacketSending(PacketEvent event) {
                        // Item packets (id: 0x29)
                        Player player = event.getPlayer();
                        if(!isDisguised(player)) return;
                        if(getDisguise(player) == null) return;
                        System.out.println("pass1");
                        if (event.getPacketType() ==
                                PacketType.Play.Server.NAMED_ENTITY_SPAWN &&
                                (getDisguise(player).getDisguiseEntity().getEntityId() == event.getPacket().getIntegers().read(0))) {
                            System.out.println("pass2");
                            event.setCancelled(true);
                        }
                    }
                });
    }

Am I doing the wrong packet here?

lavish hemlock
#

I'm

#

not sure?

lethal coral
#

🤦‍♂️

outer pond
#

Named Entity Spawn is the spawn packet for players, depends on your use case if that's the right packet

lethal coral
#

yeah no I was doing the wrong one

lavish hemlock
#

I don't know enough 'bout packets lol

#

Just know how to use ProtocolLib

lethal coral
lavish hemlock
#

Sure

#

Thank you for like, asking before doing that

lethal coral
#

👍

lavish hemlock
#

People tend to just message me out of the blue with questions bc... idk, I guess I seem smart :p

outer pond
#

Stop tooting your own horn kekw

lavish hemlock
#

I said "seem smart"

#

Not "am smart"

lethal coral
lavish hemlock
#

I can answer questions about much more than ProtocolLib lol

#

I just delve into the depths of unsafe and internal shit

vale cradle
#

Seeming friendly seems like the most likely reason why people usually approaches to ask :p

lethal coral
#

Well yeah but usually learning protocollib is towards the end of the bucket

lavish hemlock
lethal coral
lavish hemlock
#

Fair 'nough

#

I just personally hate when people do that

vale cradle
lavish hemlock
#

Sometimes I'm like that

#

Well

#

Not the latter half

#

But more so the "Do you even know Java?"

#

Usually when someone is so bad that they honestly need a ?learnjava

outer pond
lavish hemlock
#

I mean what

lethal coral
#

Making disguises for your plugin is so time consuming 😩 💀

vale cradle
lavish hemlock
#

Fair enough

vocal cloud
#

A vast majority of questions can be answered with either learn java or read the docs

lethal coral
#

that doesn't help people who have actually tried doing both of those and just need some minor assistance in the right direction

vale cradle
#

I guess every people's different

vocal cloud
sturdy heron
#

Hey, could someone help me with setting up these flags for a relative teleport using PacketWrapper?

WrapperPlayServerPosition relativeTeleport = new WrapperPlayServerPosition();
relativeTeleport.setX(0);
relativeTeleport.setY(0);
relativeTeleport.setZ(0);
relativeTeleport.setPitch(10);
relativeTeleport.setYaw(0);

Set<WrapperPlayServerPosition.PlayerTeleportFlag> set = new HashSet<WrapperPlayServerPosition.PlayerTeleportFlag>();
set.add(WrapperPlayServerPosition.PlayerTeleportFlag.X);
set.add(WrapperPlayServerPosition.PlayerTeleportFlag.Y);
set.add(WrapperPlayServerPosition.PlayerTeleportFlag.Z);
set.add(WrapperPlayServerPosition.PlayerTeleportFlag.X_ROT);
set.add(WrapperPlayServerPosition.PlayerTeleportFlag.Y_ROT);

relativeTeleport.setFlags(set);

relativeTeleport.sendPacket(player);``` this code is probably really stupid looking but I honestly have no clue how I'm supposed to format it
lavish hemlock
#

Don't use PacketWrapper

#

It's outdated.

#

At least, I believe so, since some packet wrappers don't seem to make sense.

sturdy heron
#

Well I don't know of any other simple methods so I'm just going with this

magic gazelle
vocal cloud
sturdy heron
#

The API doesn't support relative teleportation + API is not thread safe

vocal cloud
#

Relative as in between dimensions?

sturdy heron
#

relative as in the minecraft cmd "/teleport Player ~ ~1 ~"

tall dragon
#

pretty sure u can just calculate a relative location

vocal cloud
#

You can make it relative with just a little work?

sturdy heron
#

It's not the same, relative keeps the player's velocity and only adds to their current location

outer pond
#

Sending a teleport packet wont change the players position on the server though

tall dragon
#

im not sure how the sever would respond to that actually

#

maybe by just placing you back

vocal cloud
#

Then just add to their location?

outer pond
tall dragon
#

yea, thats what i thought

magic gazelle
#

yeah.. packets are not the way to go here

sturdy heron
#

Well the thing is I want the server to update the client's pitch and yaw by a certain amount and it needs to be smooth

vocal cloud
#

You understand that entity teleport does the same stuff

hybrid spoke
#

it lags you back

vocal cloud
#

Sending a packet instead of using the API isn't some magic bullet

sturdy heron
#

It works with minecraft cmds, so I thought there would be some way to do it in the code

magic gazelle
magic gazelle
#

which is like

#

the same thing

#

uh

#

have the vanish plugin unregister them from the tab completion list?

#

because it's either that or you manually recreate /ping and /msg

#

lol

quaint mantle
#

well is it for those commands or every command?

#

uh

quaint mantle
#

I mean that doesnt prevent you from typing their names in

#

just tab completing them

magic gazelle
#

filter for first arg?

quaint mantle
#

you wouldnt need packets at all

#

theres an event for intercepting commands

tall dragon
#

yea PlayerCommandPreProccess or somethn

quaint mantle
#

yep

tall dragon
#

but i think the best way is to have your own commands

#

with support built in

quaint mantle
#

Well he wants it for every command haha

outer pond
quaint mantle
#

hes not talking about tab requests at all

outer pond
#

Huh, I misunderstood this then

quaint mantle
#

What do you hope to accomplish by doing this anyways?

#

why is it so bad if they type their names in

magic gazelle
quaint mantle
#

so what 🤔

#

You could do something like giving admins the ability to block all incoming dm's or teleport requests or something specific like that. To be honest I dont think youre going to find what youre looking for

#

You can really hide them from every command

#

I think what you're trying to do is unrealistic

tall dragon
#

i guess you would need to make the player appear offline to the server

#

im pretty sure SuperVanish does this

#

and supervanish is open source

#

could look into that

sturdy heron
# magic gazelle there is... you can't just type +1 in the code but you can do (PSEUDOCODE BTW) P...

Even when checking the player's velocity and setting it back after the teleport it's not a seamless transition. Like you can tell you've been teleported. I've been trying to change the pitch of the player for a recoil system, which means that I can't take the pitch and yaw of the player and then teleport them up a bit since that'll create a yucky lagback feeling that doesn't happen when you use relative.

quaint mantle
#

hmm good point

#

Ive never uses supervanish before

tall dragon
#

quote from supervanish Hides invisible players in the list of logged in players in the serverlist (configurable)

outer pond
#

If your plugin controls the command you could simply check if the player in the arguments is vanished, but if you don't control them youre kinda screwed

tall dragon
#

i think u want that.

quaint mantle
#

Yea it doesnt do anything else other than that basically

tall dragon
#

no u did this

#

Hides invisible players in the playerlist [Tab]

quaint mantle
#

just like silent chest and other syuff

tall dragon
#

its somethn dif

#

aw wait nvm

#

yea

quaint mantle
#

Hold on so let me get this straight

tall dragon
#

hmmm sounds like a difficult problem

quaint mantle
#

you want to make it so they cant type in any commands at all with a vanished player as a target?

#

Wouldnt that just let the user know that theyre online and vanished

#

"oh i cant use this command on this player... they must be vanished"

tall dragon
#

he wants it to fail like the player is not online

#

yea

outer pond
#

"This player is offline"

quaint mantle
#

ohhh ok

#

Yea idk then haha

#

sounds very annoying

magic gazelle
#

you'd just have to redo every command manually

#

or do packet magic to just drop the command if it contains those names

outer pond
#
  1. Listen to the preprocess event and write a handler for every possible command (rip)
  2. Make the commands yourself and check if the player is vanished
    Dont see any other possibilities
quaint mantle
#

I say do option 1 just for fun

#

:)

lethal coral
#

I have run into a problem

quaint mantle
#

Zak sounds like you should make your own vanish plugin

#

and integrate it with your custom commands

lethal coral
#

so I'm listening to the packet for spawning entities, but in that listener I'm checking if the entity id of the packet spawn is equal to the entity id of the player's disguise which isn't spawned yet according to that packet

quaint mantle
#

Do you have a standard command class that you inherit for your custom commands?

#

if not youre gonna have to edit them all manually

tall dragon
#

yea @quaint mantle i think the only way is to make the commands yourself and support it.

magic gazelle
#

or use packet magic

quaint mantle
#

thats lame tho

magic gazelle
#

or just preprocess EVERY command

#

3 options

#

all are tedious

outer pond
#

Some command libs like Aikars check for vanished players automatically which is pretty nice

quaint mantle
#

He means filter out the commands that include the players names that are vanished

#

Which basically you can just use the command pre process event for

#

Yea

magic gazelle
#

okay but there's this thing called .split(" ")

quaint mantle
#

It wouldn’t work universally for every command

#

All commands are different

magic gazelle
#

so just make a bunch of cases

quaint mantle
#

No

magic gazelle
#

you're not getting an easy fix

quaint mantle
#

That’s so fucking stupid

magic gazelle
#

stop being an ass if you don't have any better solutions

quaint mantle
#

How do you make a bunch of cases for an infinite amount of commands

#

I already gave a solution

tall dragon
#

Inject code into every plugin changing their commands 😂

magic gazelle
#

😘

quaint mantle
#

It’s actually way better buddy

#

He can rework his network of custom commands

#

To integrate with his custom vanish plugin

outer pond
quaint mantle
#

That’s a win win in my book

magic gazelle
#

which one

magic gazelle
quaint mantle
#

In the long run doing what I suggested is the cleanest way to implement it

#

No need for packets

magic gazelle
#

W H I C H one

quaint mantle
#

At all

magic gazelle
#

wow no packets so cool

quaint mantle
#

My guy do you know how to read 😂

magic gazelle
#

I count 2

#

there is definitely not

magic gazelle
tall dragon
#

thats indeed the cleanest way.

quaint mantle
#

You don’t know how to read

outer pond
#

This is chaos

quaint mantle
#

Yes because one person gets butthurt and can’t read English

magic gazelle
#

I'm not the one who started insulting other people for perfectly valid solutions

#

but okay bud

quaint mantle
#

Anyways, good luck on your issue. However you decide to fix it @quaint mantle

outer pond
#

You're not making it better :D

#

Just chill, no need to get upset at each other

magic gazelle
#

indeed though, good luck Zak

quaint mantle
#

I’m far from upset but thanks

magic gazelle
#

it sucks that there aren't any easy solves but that's just part of coding :P

outer pond
#

If you say so ^^

quaint mantle
#

I did say so

hybrid spoke
tall dragon
lethal coral
tall dragon
#

does this disguise plugin disguise you as any entity or somethn?

lethal coral
#

yes

tall dragon
#

so why are you trying to cancel an entity spawn packet. i dont rlly understand.

lethal coral
#

so that the entity doesn't get in the way of the player and they don't see it or aren't able to interact with it at all

hybrid spoke
#

so just spawn it for everyone else

lethal coral
#

I was previously just sending the entity destroy packet upon creation, but changing worlds & things of that nature resulted in it not being a viable option

#

So how am I supposed to compare entity ids if the entity isn't created yet, disallowing me to even compare it anywhere else

quaint mantle
#

What if you add a delay to the id check?

#

might not be the most reliable solution tho, idk

lethal coral
#

that would be the equivalent to waiting 1 tick then cancelling the event

#

wouldn't work

quaint mantle
#

That's true

lethal coral
#
    private void registerEntitySpawnPacket(){
        Games.getInstance().getProtocolManager().addPacketListener(
                new PacketAdapter(Games.getInstance(), ListenerPriority.NORMAL,
                        PacketType.Play.Server.SPAWN_ENTITY_LIVING) {
                    @Override
                    public void onPacketSending(PacketEvent event) {
                        Player player = event.getPlayer();
                        if(!isDisguised(player)) return;
                        if(getDisguise(player) == null) return;
                        System.out.println("pass1");
                        if (event.getPacketType() ==
                                PacketType.Play.Server.SPAWN_ENTITY_LIVING &&
                                (getDisguise(player).getDisguiseEntity().getEntityId() == event.getPacket().getIntegers().read(0))) {
                            System.out.println("pass2");
                            event.setCancelled(true);
                        }
                    }
                });
    }

Here's the current code

#

it passes the 1st one and throws errors beyond that for reasons that I described

quaint mantle
#

isnt there a way to spawn it for everybody except the player who is disguised?

#

I havent messed with entities for a while i forget

#

wait yea cant you just send the spawn packet to everyone but the player 🤔 or am i missing something

desert musk
#

watching a tutorial that uses TasksBukkit as a type but when i write it in nothing is found. has it been deprecated? i'm confused.

quaint mantle
#

BukkitTask

#

ive never heard of TasksBukkit lol

desert musk
#

ok i was going to use that but in the tutorial the guy uses bukkittasks too so i got more confused

quaint mantle
#

can u link the tut

#

i wanna see

desert musk
#

ok

#

ignore timestamp

#

youtube is weird

#

3:10

quaint mantle
#

oh he made the class himself

#

and just named it that

desert musk
#

oh did he rip

#

missed that tragically

#

ok lol

#

I see it too

#

🤦‍♂️

#

ty

quaint mantle
#

👍

torn shuttle
#

anyone got any ideas why skeletons won't aggro during daytime?

#

or even night time I am extending their follow distance but they're just sort of chilling

quaint mantle
#

got any code to show?

torn shuttle
#

this is out of the box mc ai as far as I can tell

desert musk
#
            public void run() {
        if (Bukkit.getWorld("world").getGameTime() >= 14000
                && Bukkit.getWorld("world").getGameTime() < 24000) {
           Bukkit.dispatchCommand(Bukkit.getConsoleSender(),"title @a actionbar It turns night.");
            System.out.println("Alerted players of nighttime");
        }
        if (Bukkit.getWorld("world").getGameTime() < 14000
                && Bukkit.getWorld("world").getGameTime() >= 0) {
            Bukkit.dispatchCommand(Bukkit.getConsoleSender(),"title @a actionbar It turns day.");
            System.out.println("Alerted players of daytime");
        }
        System.out.println("checked time");
    }
quaint mantle
#

hmm

desert musk
#

this no workie

#

it seems to not get the game time

#

because

quaint mantle
desert musk
#

if anyone knows how i'm misusing the getGameTime or getWorld let me know

quaint mantle
#

game time isnt what you think it is

torn shuttle
quaint mantle
#

game time is the time since world generation i believe

torn shuttle
#

also when you hit them they also aggro

quaint mantle
#

or mayeb im mistaken

lethal coral
desert musk
#

you're probably right

#

hence why it's MUCH bigger than either of those two conditions i have in the if statements

#

ok

#

documentation doesn't say that 😭

#

how should i go about getting the actual game time

#

cuz this is confusing me

#

trying getTime()

quaint mantle
#

sounds right

vocal cloud
#

Well the docs says getTime is relative so I assume that's correct

desert musk
#

ty taco man

#

ok perfect

#

it works

#

thanks

#

just um, the title command doesn't work

#

i still dk how to properly send minecraft commands apparently

#

Oh

#

because i didn't add quotes maybe?

quaint mantle
#

just use the spigot api for titles

#

no need for commands

desert musk
#

o

#

sendTitle()?

#

sweet

#

ok yeah i find time and time again that i don't need to use minecraft commands

#

gotta break habits ig

desert musk
quaint mantle
lethal coral
#

Issues arose when a player changed worlds

#

since I can't exactly predict when they're completely loaded in the world

#

Unless I'm missing something 😏

quaint mantle
#

can you elaborate specifically

lethal coral
#
  1. spawn mob and send destroy packet for player
  2. Everything works
  3. Player is teleported to another world
  4. mob shows up again as it's spawning in the world
quaint mantle
#

ohhh okay i get it now

#

hmmm

#

cant you destroy it every time it spawns tho or?

#

you have to wait for the player to load in tho...

lethal coral
quaint mantle
#

yea

lethal coral
quaint mantle
#

seems like quite the pickle

#

Does it have to be a real entity for a specific reason?

lethal coral
quaint mantle
#

hmm i see

#

just tryna think of every possible thing haha. im not extremely familiar with disguise stuff hopefully somebody else has some pointers

lethal coral
#

you're fine it's better than nothing

desert musk
#

I'm trying to make a custom entity much like a traditional custom item. basically i want a unique mob (that can really just be any mob) but has special properties (like max health) and can be identified as the new custom entity. How do i make this kind of entity in spigot?

#

ok nvm found a good resource

#

all i really wanted was just a datatype for entity that was comparable to itemstack

sharp bough
#

this doesnt create a new instance everytime the event is fired right?

#
public class BeltManager {

    JsonObject belts = new JsonObject();

would belts reset?

quaint mantle
#

no?

#

its created whenever BeltManager is initialized

#

and it belongs to that instance

sharp bough
#

i think i understand now thanks

manic furnace
#

When i want to set the packet meta in protocollib, do I have to sat arrays as json-strings?

solid forge
tender shard
#

I have a custom event that extends InventoryClickEvent. Now I want to listen to an InventoryClickEvent and call my custom event in some cases. Is it better to use the same HandlerList as the event I'm extending, or a custom one?

If I use a custom one, I explicitly have to listen to ChangedItemMoveEvent. Listening to InventoryClickEvent is not sufficient (that's bad)
If I use the original event's one, I have to check if the event is instanceof my custom event in my own listener, and then return (not bad but also ugly)

My event: https://paste.jeff-media.com/?0e14f17435854f1e#GphoEqUvkpcebPivHc5MNF4BbWPMetMeD2A9ezcwd4a8

hybrid spoke
hybrid spoke
tender shard
tender shard
dreamy chasm
#

does Bukkit.getScheduler().cancelTask() apply to tasks that are scheduled to be run in x seconds? or only ones that are actively running right then?

tender shard
#

actually its even the opposite

#

if your task is currently running, it still finishes to execute

#

it will simply stop future tasks from getting started

dreamy chasm
#

ah I see, I think my issues is that I was checking currentlyRunning instead of isQueued

#

so if it was queued but not running yet it wasn't being cancelled

modern vigil
#

What does the name prop om the Attribute class mean?

#

And where is it being used

sacred mountain
#

hew how do i create a potion itemstack? new Potion is deprecated

#

i mean idk whats wrong with deprecated stuff because its worked before

hybrid spoke
tender shard
tender shard
#

lol well, according to the docs it means "the name of this modifier."

echo basalt
#

Yeah it's just an identifier

modern vigil
#

So passing in the stringified attribute type is enough?

#

E
G

#

AttributeModifier(Attribute.GENERIC_ARMOR.toString(), 69.0, AttributeModifier.Operation.ADD_NUMBER)

safe edge
#

How can I use different java in git bash ?

ivory sleet
#

I mean more like a name that describes the attribute modifier

halcyon mica
#

How do I convert a bungie component to a vanilla chat component?

tender shard
#

toLegacyText()

tender shard
#

I think it's supposed to be used like this:
if you want to create an armor that makes you walk twice as fast, and the armor is called "Fast Shoes" I'd call the modifier "fastshoes" or sth

crude loom
#

Is it ok to use the config as a database or should I implement some sort of database?

modern vigil
fallow merlin
#

Is there a debug info send event? (eg. whenever a mob sents a pathfinding data with DebugPackets#sendPathFindingPacket)

tender shard
tall dragon
tender shard
#

what amount of data do you store?

#

for small things I'd use json or sqlite, otherwise a proper db like postgres, mysql, etc

#

you could even use YAML if you want it to be easily editable and don't have megabytes of data

tall dragon
#

or save in bytes :D

#

its the fastest. but also uneditable for someone without knowledge

crude loom
#

Is my api-version the version I put in my plugin.yml or is it the version of the spigot library on the pom.xml file?

tall dragon
#

um they should be the same i think

#

you need to set your api-version to the version ur compiling against

crude loom
#

Are you sure?

dreamy chasm
crude loom
#

It sounds like it would slower, yeah

halcyon mica
modern vigil
#

Can I ask questions about JSON parsing here?

#

related to a plugin ofc

tall dragon
glossy venture
#

lets gooo

fallow merlin
#

Hey why does this take 3 doubles instead of a Bounding Box

glossy venture
#

its a radius

glossy venture
modern vigil
#

having some trouble parsing and serializing json to an actual object, lemme send the json and dataclass

tall dragon
#

did you design the gun!

#

i wish you would tho

#

that be so neat

#

me neither

#

xD

#

bad deal

#

i cant model either

modern vigil
#
{
    "id": "SUSSY_SHANK",
    "name": "&c&lSussy Stabber",
    "material": "DIAMOND_HORSE_ARMOR",
    "enchants": [
        {
            "id": "KNOCKBACK",
            "level": 6500
        }
    ],
    "lore": [
        "&c sus amogus"
    ],
    "unbreakable": true
}```I am able to parse this, but the code isn't that great. How would I go on about making a custom Serializer with kotlinx's json plugin?
#

dont mind the name

tall dragon
#

are u using Gson?

modern vigil
#

no

#

kotlinx's serialization package

#

kotlinx.serialization.json.Json

tall dragon
#

eh, im not sure alot of people here have experienc with that.

#

i don't at least.

halcyon mica
#

Question, why does this: new ComponentBuilder("■■■■■■■■").color(ChatColor.of("#f800f8")).append(new ComponentBuilder("■■■■■■■■").color(ChatColor.of("#000000")).create()[0]).create()[0]
result in this:

#

It should be a more or less solid line in two colours

#

And is this instead

chrome beacon
#

Make sure your plugin is compiled with UFT-8

halcyon mica
#

It is

tardy delta
#

the minecraft font doesnt include the ■ char

#

dunno what that â- is

halcyon mica
#

It very clearly does

tardy delta
#

wha

#

i got that NPSP sign thing when i used String.format on text

halcyon mica
#

But invalid characters aside, why is the colour formatting wrong?

#

One half should be pink, the other black

tardy delta
#

i have this to cololize hex strings

#

idk if thats just translates the hex things or also the text

fervent gate
#
for (Player player : Bukkit.getOnlinePlayers()) {
                player.doSomeThing();
}
for (OfflinePlayer player : Bukkit.getOfflinePlayers()) {
                Player p = player.getPlayer();
                p.doTheSameThing();
}

Is this the right way to do something for all online and offline players?

#

or should I work with a db?

chrome beacon
#

Second one won't work very well

#

You can't get the player object of an offline player

fervent gate
chrome beacon
#

It will throw an error

fervent gate
#

Is there a way to do that with OfflinePlayer?

#

or is Bukkit.getPlayer(uuid) the way?

chrome beacon
#

You cannot get a player object of an offline player

#

The player needs to be online

crude loom
#

I want to delete a resource I uploaded to the spigot website, is the only way to do it is reporting myself?

glossy venture
#

yes

fervent gate
#

How do I get the player object to work with PDC if they are offline?

chrome beacon
#

You don't

#

You need to store data somewhere else

young knoll
#

You restore a backup?

modern vigil
#

Is there a way I could improve this code? It basically takes a file path arg and reads it and passes it to parseItemData which returns an ItemStack

sonic cosmos
chrome beacon
undone axleBOT
glossy venture
#

what is the metrics site for plugins called again

chrome beacon
#

bstats

noble lantern
#

Here is my issue, I'm looking to get the value of BlockBreakEvent#isDropItems() that is set by another plugin that has the event priority of HIGH

Here is the specific line of code of the said plugin, setting the value to false: https://github.com/MrButtersDEV/AutoPickup/blob/06f4fdeb3e5088104b8583d10903314d9ce378e3/src/main/java/us/thezircon/play/autopickup/listeners/BlockBreakEventListener.java#L165 (I'm certainly confident this plugin is calling this method)

We have our own BlockBreakEvent, with an EventPriority of HIGHEST. Also tried this with MONITOR and no matter what the return value of BlockBreakEvent#isDropItems() will always return true would anyone happen to have any theories as to why this could be happening? I havent seen this happen before with any plugins ive worked on

glossy venture
chrome beacon
glossy venture
#

yo im trying to add a plugin to bstats, but it says that the plugin was already added. when i go to "My Page" and look at the plugin list though, its not there

noble lantern
young knoll
#

Maybe another plugin has that name

#

Use BlockDropItemsEvent for auto pickup