#help-development

1 messages · Page 272 of 1

fluid river
#

cuz there is no stoi(myString) method

tardy delta
#

ahh lol

sterile token
fluid river
#

bruh

tardy delta
#

it says is c++ 11+

echo basalt
#

I forgot I blocked nukerfall

fluid river
echo basalt
#

I was wondering like

fluid river
#

i forgor

#

to include string

echo basalt
#

"did one of these bots get in the server how many blocked messages are they sending2

sage dragon
#

Player#teleport does not work when the player has a passenger, but Enderpearls and the vanilla command still works for teleporting, is this intended? 😅

tardy delta
#

lmao

sterile token
#

i was going to dm you, but i realize you were ausent so i didnt do it

fluid river
river oracle
#

I want to block nukerfall too

subtle folio
fluid river
#

for some reason

#

you can't tp entity with passenger

#

remove the passenger, teleport the entity and add passenger again

fluid river
subtle folio
#

in your pom.xml?

#

oop deleted message nice

sterile token
river oracle
sterile token
#

Thats a conclusion i taken

river oracle
#

I'll figure out a reason

subtle folio
river oracle
#

give me a bit here pal

subtle folio
#

thast stupid hang on

sterile token
#

lmao i will take some time out while you stop discussing

#

And i can paciently ask for help while no one disturbing*

subtle folio
tardy delta
fluid river
#

i'll try to switch from struct to another class

sterile token
fluid river
#

LOL

#

@tardy delta i fixed the error

#

i hate c++

subtle folio
sterile token
#

Because i testing right? And having the permission or the mode active and being member block placing/breaking events

fluid river
#

lol i didn't

subtle folio
#

I think im lost lol

sterile token
#

Let me write a full msg

#

So its better for you

subtle folio
#

yes please lol

west linden
#

when I do Player player = Bukkit.getPlayer(entry.getUuid()); I get null. When I do a System.out.println(entry.getUuid()); I get the uuid of the player. Any ideas?

vivid cave
#

bro i swear, nms isn't abstract enough
I would like it to be as abstract as the Minecraft Protocol

tardy delta
#

this looks hotter too

vivid cave
#

and possibilities to turn Entities into the Metadata format for the minecraft protocol

tardy delta
#

do a null check

subtle folio
#

its also better practice to do getOfflinePlayer() so..

#

#getPlayer assumes the player is online

eternal oxide
sterile token
#

Ntdi:

Im doing a mini game, where you have a mode called build which should allow you to (while having mode active):

(Always being inside the region of course)

  1. Place/breaks blocks
  2. Not interact with anything (which contains storage, neither blocks nor entities)

I success with the interaction block, when i realize that i need to disable off hand all isues came, because i want to disable putting items on it so that started to cause issues with my conditions.

Because as far as placing blocks is know as Equipment.OFF_HAND, then my onInteract listener override the block placing/breaking

west linden
eternal oxide
#

then you will never get a player

#

you need to use UUID.fromString(entry.getUuid()) or something close

tardy delta
#

goddamn java

subtle folio
sterile token
subtle folio
#

Oh, my bad let me rephrase

sterile token
#

But i just want to block putting items in the off hand, which was added in 1.9+ the one used for putting the shield. But ppl use it for what ever

subtle folio
#

Do you want people to be able to use their offhand?

#

for placing blocks

sterile token
subtle folio
#

I see, what's wrong with that?

sterile token
#

Yeah that my point

#

one miniute is raning water is cumming in

subtle folio
#

You don't want players to be able to place blocks with their offhand.

sterile token
#

No i dont want to use that slot

west linden
sterile token
#

This slot let me find apicture

#

The slot 40

subtle folio
#

So why don't you cancel inventory click event for that slot?

sterile token
#

Its better right?

#

In my case i use that one, because ppl suggested me to use the PlayerInteractEvent

subtle folio
#

You can use that and check if they are interacting with OFF_HAND right?

sterile token
#

Do i need to use both of them? InventoryClickEvent and InventoryDragEvent

subtle folio
#

Yes,

sterile token
subtle folio
sterile token
subtle folio
#

That makes no sense 🤣

sterile token
#

Yeah

#

That why im messed up and came to ask it here

#

All problem is that OFF HAND is not just that simple slot

subtle folio
#

Atleast that makes sense

#

wait its not?

sterile token
#

I think that OFF hand you should only be slot hand mean to be used with the shield

#

Because if not its confusing asf

subtle folio
#

yes -;

sterile token
#

That why we are mixed now 💀

subtle folio
#

thats so confusing

sterile token
#

yeah, also thanks for understanding me, no one beside you, Fourten and yk2 understand

subtle folio
#

Yup, come back and ask if you run into more issues

#

ill be here

sterile token
#

yeah know i will have to see how to fix this poroblem 😮‍💨

subtle folio
#

🤣

sterile token
#

yeah its funny until you need to finish fast a comission

subtle folio
#

oh its a comission??

sterile token
#

yeah i just need that to be done and its finished

subtle folio
#

oh man I don't take comissions for projects im not fully capable of understaind yikesanimated

tardy delta
sterile token
subtle folio
sterile token
#

Can i add you, you look like really friendly

subtle folio
#

Yeah for sure

sterile token
#

thanks man

fluid river
#

i fucking made it

tardy delta
#

might inline new FunctionCallSite too lol

calm falcon
#

Is there any way I can include the "*" character in my yml configuration?

#

The same happens if I use apostrophes...

tardy delta
#

why would you anyways

calm falcon
#

I've read that I should use apostrophes instead of quotation marks, but that doesn't help anyway

subtle folio
calm falcon
#

I am trying to make it as user friendly as possible. The back slashes may confuse some people

#

The "*" is important though, because this text is meant to be sent by a Discord bot so it has to support Discord formatting

subtle folio
#

Ah I see now i understand,

remote coral
#

I'm using Waterfall 1.8-1.19(Bungee) and Spigot 1.8(Lobby) using ViaVersion. But the blocks of 1.19 transforming in stone, how fix? Thx

#

I tried change Spigot to 1.19, but plugins no work in the version

#

Only 1.8

tardy delta
#

ok final thing

#

ah sin(1, causing a stackoverflow

sacred mountain
#

more of a general thing but how can i clean this

#

is there a better way to lay it out

#

like what do you guys do

sterile token
#

What the best option, for disable the slot 40 from player inventory using Bukkit?

tardy delta
#

ah yes thats what happens when you add new stuff

sterile token
sacred mountain
#

(i dont know why, but it fixes things for some reason so i dont ask)

tardy delta
#

and sin(rad()) works

sacred mountain
#

yeah u need to convert to rad

tardy delta
#

thats not the issue

sacred mountain
#

o lol

#

whats the issue then

tardy delta
#

stackoverflow

#

classcast

#

etc

#

time to debug

#

looks like multiple parameters seem to break

main dew
#

Hi I thinking how in spigot source I can add method from plugin (if I add method to source spigot and I get error ClassNotFound)

sullen canyon
tardy delta
#

one dark

hazy parrot
#

And if its just used to hold data, make it a record

obtuse dirge
#

how could i copy a text file from the java resources folder to the plugin data folder?

obtuse dirge
#

thanks

twin elbow
#

How to update texture change NMS for the player itself

quaint mantle
torn shuttle
#

I think I want to learn opengl

#

looks like a lot of work

undone axleBOT
quaint mantle
#

What is considered a ConfigurationSection?

remote swallow
#

Mysection:
My option: falsee
My option 2: 05

tardy delta
#
section:
  a: 1
  b: 
    - 1
    - 2```
haughty plover
#

If an armorstand is on a player's head. Is it normal for the EntityDismountEvent to constantly be called even though it's still on the player's head?

quaint mantle
dry forum
#

im trying to make something to set a lot of blocks quickly with no lag i have https://pastebin.com/M5REDzC4 which works kind of, it has a lag spike when starting but after it starts it works with minimal lag, could anyone give some advice on how to make this not lag or another way to set a lot of blocks with no lag & fast

quaint mantle
#

Like if I try to check if a is a configurationsection, will it return true or false?

#

I'm having issues with it and I'm getting confused 🤨

quaint mantle
tardy delta
#

a is a key to an int and b is an int list

quaint mantle
#

So section is a ConfigurationSection but both a and b are not?

river oracle
#

oh my god this is the worst thing I've seen in a while

#

why are you doing it like this

#

AtomicInteger too my lord

#

just use events

#

InventoryClickEvent, EntityPickupItemEvent

rotund ravine
river oracle
quaint mantle
#

don't blame the AI that wrote it

river oracle
#

🤦🏽‍♂️ the AI can't code

#

don't trust it

rotund ravine
quaint mantle
#

ooooo

#

lol

rotund ravine
#

It is not yet at a part where you can simply use it.

quaint mantle
#

ye

river oracle
#

if you don't know hwo to code

#

commision someone

quaint mantle
#

I got to be honest I don't know a lot of coding

#

I would totally pay but I don't have any money

river oracle
#

then oyu better start learning :}

quaint mantle
dry forum
#

spread placing them apart

remote swallow
# quaint mantle Yes

I can probably make the thing you want later, give me about 30 min ish. Ill show the code after

dry forum
#

? because im placing them in waves kind of, 80 blocks per tick instead of 500 blocks in 1 tick

#

i dont understand sorry, i want to place blocks fast with no lag

#

im just trying to find the best way to place thousands of blocks fast with no lag

rotund ravine
#

mcedit

dry forum
#

ive found forms which say to use schedulars to spread the placement apart

dry forum
orchid gazelle
#

Well on the pure theoretical and technical part, would it not be the fastest to only a chunk, modify the data in the file itself and then load it again? lol

dry forum
#

id rather have placing 3000 blocks take 1 second with no lag instead of 1 tick with a lot of lag

raw sky
#

How many spigot plugins are out there rn

#

and if I try and tab complete 100k values or so, how much lag would that cause

atomic swift
#

if i use this and the player isn't online will it return null Bukkit.getEntity(UUID)

eternal night
#

yes

atomic swift
#

so use getOfflinePlayer

remote swallow
gilded knot
#

How would I make a MySQL query that grabs a user's tokens by UUID or PlayerName

orchid gazelle
#

Well you make 2 methods, one for name and one for UUID

gilded knot
#

I have this SELECT tokens FROM tmtokens WHERE uuid = %s
but it returns Unread result found

humble tulip
#

Use?

#

?

#

Not %s

gilded knot
#

Python

humble tulip
#

Ah ok

orchid gazelle
#

Oh

gilded knot
#

Making a discord bot hook into a MySQL db so users can see their stats via command

#

oh wait

#

I need to check if "" are required

humble tulip
#

Why use name then?

gilded knot
#

yep

orchid gazelle
#

UUIDs don't have '

#

And Playernames also cannot have '

humble tulip
#

Can't you always use the user id?

humble tulip
orchid gazelle
#

Oh right

#

Yeah then just first check if it contains it

gilded knot
#

this is painful lol

humble tulip
#

Doesn't python have prepared statements?

gilded knot
#

I saw an image earlier that explains it well

#

sec

#

rip can't find it

#

but there was an image with a grass block

#

showing everything

#

XYZ position etc

#

unsure

#

found the error

#

got it

#

I always hated trigonometry

sterile token
#

You are confuse, what he wants is called work distribution

wet breach
#

sometimes

rare rover
#

is there a way to get the id of modern materials?

#

im using it for this

#

but i cant do #getId()

rotund ravine
rare rover
#

so how would i do this then

rotund ravine
#

They have an id on the global palette, but not tied directly and is not dependent on the item. No clue how to get the palette or what that is all about

rare rover
#

these are the only 3 methods that return IBlockData

#

so how would i use the name?

rotund ravine
#

Can you use the remapped jar? For better function names

remote swallow
#

?nms

rare rover
#

yeah i can

#

ome moment

#

just converting my code rq

#

okay so

#

i got this

#
    public static void setBlock(World world, int x, int y, int z, Block block) {
        ServerLevel nmsWorld = ((CraftWorld) world).getHandle();
        LevelChunk nmsChunk = nmsWorld.getChunkAt(new BlockPos(x, y, z));
        BlockState state = block.defaultBlockState();

        LevelChunkSection cs = nmsChunk.getSection(y >> 4);
        cs.setBlockState(x & 15, y & 15, z & 15, state);
    }```
#

but now how do i convert a material into net.minecraft.world.level.block

sullen marlin
#

why are you using nms to set a block

rare rover
#

faster way of setting them

sullen marlin
#

that's not faster

#

its literally what World#setType does

rare rover
#

💀

#

i was told World#setType is laggy

#

or was

tardy delta
shadow tide
#

I need SerializationUtils from Apache, but even though I'm using maven to get the spigot API it seems like I'm not depending on apache, how do I? (haven't touched spigot, java, or maven in a long time)

river oracle
#

considering, bukkit does similar calls internally I'm assuming

shadow tide
#

its a small difference

#

nms is much faster than spigot from experience though

#

(like c++ vs python, most of spigot is reskinned bukkit, but some is its own thing)

civic apex
#

ive got this error in my plugin and I have no idea how to debug it (no info in either client or server log) and no, this isnt a client settings issue

river oracle
civic apex
#

i think it might be related to EntityDismountEvent, as a post I found also mentioned that and the behaviour started happening after I added it to my code

#

but both should be completely unrelated + the error should be just a clientside thing

civic apex
#

and when player 1 (thats riding player 2) disconnects, player2's "esc" menu pops up and the "Chat disabled in client options" occurs

versed fern
#

How can I change the player's game language item name in a string?

civic apex
#

oh I realised im like completely desynced with the server

#

maybe player2 has like a null passenger

sterile token
#

Why the heck while debugging, the event is giving, is cancelling the event while i have: permission: true, build: false, region user: true

event.setCancelled(!player.hasPermission("region.bypass") || !profile.isBuild() && region.getUsers().contains(player.getUniqueId()));
#

Im feeling really stupid, because i cannot understand what happening

tall dragon
#

of course

rotund ravine
#

Oh

#

This is dev

dry forum
#

im tryting to set a lot of blocks with minimal lag and fast speed, im using https://pastebin.com/4jF8QrQL which is from 7smile's guide and its very laggy, when it starts, my game freezes for like 2 seconds but after that it works fine, anyone know how to fix this?

civic apex
#

its some sort of weird desync with entitydismountevent

#

apparently if a player is riding another player and the event cancels

#

whenever the player thats riding leaves the server

#

it desyncs the other player from the server

#

to a state where the world basically breaks

rotund ravine
tall dragon
civic apex
#

and it kinda makes sense

#

but theres no debug message

dry forum
civic apex
#

nothing

#

neither in client nor server

rotund ravine
#

Well, it’s not an intended use

civic apex
#

i figured

#

but then idk how to do what i want to do

tall dragon
civic apex
#

which is not allow the player to leave the player theyre riding

rotund ravine
#

Can’t u just unride them on PlayerQuitEvent ?

tall dragon
civic apex
dry forum
#

1.19.2

civic apex
#

also

dry forum
#

also is there a guide or smthn on how to load it async

civic apex
#

whenever the player leaves it has to do something to remove itself from entities it used to ride

#

which is what triggers the event, but spigot/bukkit/minecraft cant handle it

tall dragon
#

?scheduling

undone axleBOT
civic apex
#

and it leaves the other player in a weird state

rotund ravine
#

Oh

civic apex
#

maybe with a null passenger

#

or a reference to a player that doesnt exist

#

idk

rotund ravine
#

Why do you cancel it if the player is leaving?

civic apex
#

how do i detect if the player is leaving

#

afaik no values get set when the event fires, no matter the EventPriority

#

(stuff like .isOnline())

versed fern
#

How can I change the translation property in a tellraw message in a string for example; replaceAll (%material%, part to change:",{"translate": "item.minecraft.creeper_spawn_egg"}.)"

rotund ravine
#

@civic apex Can u check which order the EntityDismount and PlayerQuitEvent runs in?

tall dragon
#

@dry forum btw Block#setType is also a really slow method. i could give you a method that runs faster if you like?

civic apex
#

i can change the order with eventpriorities

rotund ravine
#

@civic apex Talking about

#

If PlayerQuitEvent runs before the other or after

civic apex
#

i made it so entitydismount runs first (LOWEST)

tall dragon
rotund ravine
#

That’s not how that works.

civic apex
#

o wait

#

i think i did it the wrong way

#

wait

dry forum
#

id need nms though?

tall dragon
#

yes it is nms based

civic apex
#

nvm

dry forum
#

ahh um

tall dragon
#

and thus version specific

#

but it is considerably faster

dry forum
#

maybe but then id need to do nms for every version

civic apex
#

wait i think i know what you mean

tall dragon
civic apex
#

but again im not doing anything with playerquitevent

#

(nothing related to this)

rotund ravine
#

@civic apex Well it kindof is, but isn’t

civic apex
#

it isnt

rotund ravine
#

If it runs before

civic apex
#

the leave code itself

#

is

tall dragon
civic apex
#

not the code i run from the eventhandler

#

when a player leaves

#

spigot executes code

rotund ravine
#

You can easily set a value, and if it’s set do not cancel the dismount.

dry forum
#

ill probably do nms

civic apex
#

first it calls the event

#

then it does stuff

#

and in that stuff is the "bugged" code that causes the state

#

not in the event call

#

its not my code

rotund ravine
#

Submit a bug report on the jira and wait until someone decides to fix it, or work around the issue.

civic apex
#

but still its not a solution i specifically like

#

idk if this is a bukkit /spigot bug or a minecraft one

rotund ravine
#

Try riding a player in vanilla and canceling the event there

civic apex
#

how do i

#

cancel an event in vanilla

rotund ravine
#

You don't.

civic apex
#

then

#

im talking about the server, bukkit/spigot arent clients

tall dragon
civic apex
#

and yes the bug affects vanilla clients

rotund ravine
#

Work around the issue. Post to Spigot JIRA how to replicate it.

civic apex
#

again idk if its spigot or minecraft

dry forum
#

ty 😄

rotund ravine
#

Again, what are you using to cause the issue?

civic apex
#

spigot

rotund ravine
#

So, what is causing the problem other than your code?

fading spindle
#

So i'm trying to make it that a certain type of palyer(custom player type) can deal more damage with bows but for some reason it doesn't do that ive been trying to fix it and I think i'm not setting the damage output correctly



 @EventHandler
    public void damagee(EntityDamageByEntityEvent event) {
        if (event.getDamager() instanceof Arrow) {
            Arrow arrow = (Arrow) event.getDamager();
            if (arrow.getShooter() instanceof Player) {

                Player player = (Player) arrow.getShooter();

                if (playerclass.containsKey(player.getUniqueId())) {
                    if (((customPlayerAttributes) playerclass.get(player.getUniqueId())).getPlayerclass().equals("ARCHER")) {
                        arrow.setDamage(arrow.getDamage() * 2);

                    }

                }

            }


        }
    }```
civic apex
#

but the code for removing passengers when someone leaves is present in vanilla

#

and that might or might not contain the bug

#

if it did, and spigot reuses the same, well its a minecraft bug

rotund ravine
#

?Stash

#

?stash

undone axleBOT
fading spindle
#

So i m trying to make it that a certain

shadow tide
#

I haven't touched maven in quite some time now, and I'm trying to depend on apache commons, xml <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-configuration2</artifactId> <version>2.8.0</version> </dependency> is saying Dependency 'org.apache.commons:commons-configuration2:2.8.0' not found, am I missing something?

tall dragon
shadow tide
#

correct, thanks, what would the repo be?

rotund ravine
shadow tide
#

?

tall dragon
#

yea just noticed that

shadow tide
#

I wouldn't know

#

if it's in the default repo why can't it find it?

tall dragon
#

can u show ss perhaps

shadow tide
#

In my IDE commons-configuration2 is red

tall dragon
#

did u reload maven

dry forum
# tall dragon its as simple as running your load code in an async task

would i put all of it in the async task? ``` new BukkitRunnable() {
@Override
public void run() {
ConfigurationSection section = configuration.getConfigurationSection(key);
double x = section.getDouble("x") + center.getX();
double y = section.getDouble("y") + center.getY();
double z = section.getDouble("z") + center.getZ();

                        runnable.addWorkLoad(new PlaceableBlock(player.getWorld().getUID(), (int) (x), (int) (y), (int) (z), Material.valueOf(section.getString("material"))));
                    }
                }.runTaskAsynchronously(Mines.getInstance());``` ive never really used async tasks
shadow tide
#

it worked

tall dragon
#

xd

shadow tide
#

sorry I didn't wait long enough lol

tall dragon
#

since ur editing blocks in there that needs to be synced

dry forum
#

if i leave the workload out it makes me convert the doubles to lists

tall dragon
#

uhh idk what u mean

dry forum
#
                    double y = 0.0;
                    double z = 0.0;

                    new BukkitRunnable() {
                        @Override
                        public void run() {
                            ConfigurationSection section = configuration.getConfigurationSection(key);
                            x = section.getDouble("x") + center.getX();
                            y = section.getDouble("y") + center.getY();
                            z = section.getDouble("z") + center.getZ();

                        }
                    }.runTaskAsynchronously(PersonalMines.getInstance());

                    runnable.addWorkLoad(new PlaceableBlock(player.getWorld().getUID(), (int) (x), (int) (y), (int) (z), Material.valueOf(section.getString("material"))));``` says the doubles need to be arrays
tall dragon
#

u can add the workload in the async task i believe

#

but where are u starting "runnable"

dry forum
#
    public void onEnable() {

        Bukkit.getScheduler().runTaskTimer(this, new WorkloadRunnable(), 1, 1);``` on enable
tall dragon
#

ye

#

so thats sync

dry forum
#

ah ok

tall dragon
#

u can add workloads async just fine

#

they will be processed sync

dry forum
#

ok ty

shadow tide
#

it says ObjectInputStream is protected

#

(timestamp on purpose)

valid basin
#

I'm trying to create assists but I'm having major issue where when an existing assister leaves I'm getting weird error. It only happens when an existing assister leaves the game, when every assister is still in the game when a victim dies everything goes normally. Idk how to fix it. I'd appreciate if someone does know. Thx
Here's my current code:

            for(DamageStamp stamp:profile.getDamageLog()){
                if(stamp.getTickStamp()-event.getEntity().getWorld().getFullTime()<100){
                    assisters.merge(stamp.getDamager(), stamp.getAmount(), Double::sum);
                }
            }
            assisters.remove(killerProfile);
            for(Profile assister:assisters.keySet()){
                if(assister!=null&&assisters.get(assister)!=null){
                    double assistPercentage = (assisters.get(assister) / 20);
                    Bukkit.getPlayer(assister.getUuid()).playSound(Bukkit.getPlayer(assister.getUuid()).getLocation(), Sound.NOTE_PLING, 0.5F, 1.5F);

                    assister.incrementCredit((creditsPerAssist*assistPercentage),true,"Assist");
                    assister.upgradeExperience(PlayerGainExpEvent.Type.ASSIST,
                            (int) (WargroundsMain.getInstance().getRankConfig().getInt("PLAYER-EXPERIENCE.DEFAULT.EXPERIENCE-PER-ASSIST") * assistPercentage)
                    );
                }
            }```
shadow tide
#

please highlight your code by putting java after ```,
like this: ```java

remote swallow
#

?codeblock

undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
shadow tide
#

'ObjectInputStream()' has protected access in 'java.io.ObjectInputStream' Am I importing the wrong thing?

tall dragon
#

the empty constructor is protected

#

the other one is not

shadow tide
#

oooh

#

thanks

#

lemme see this

#

what lol

sterile token
rotund ravine
shadow tide
#

nope

#

uhh

rotund ravine
#

not even by pressing some hotkeys?

shadow tide
#

umm

#

I guess it just didn't import inputstream

tall dragon
#

or by creating the class instead of importing :d

shadow tide
#

like, at all

#

but it didn't really show an error for that

#
package com.cjendantix.project.commands;

import org.bukkit.World;
import org.bukkit.entity.Player;

import java.io.Serializable;
import java.util.spi.LocaleNameProvider;

public class LocationInfo implements Serializable {

    private double x;
    private double y;
    private double z;
    private World worldKey;

    public LocationInfo(Player player) {
        this.x = player.getLocation().getX();
        this.y = player.getLocation().getY();
        this.z = player.getLocation().getZ();
        this.worldKey = player.getLocation().getWorld();
    }

    public double getX() {
        return x;
    }

    public void setX(double x) {
        this.x = x;
    }

    public double getY() {
        return y;
    }

    public void setY(double y) {
        this.y = y;
    }

    public double getZ() {
        return z;
    }

    public void setZ(double z) {
        this.z = z;
    }
}
#
package com.cjendantix.project.commands;

import org.apache.commons.lang3.SerializationUtils;
import org.bukkit.persistence.PersistentDataAdapterContext;
import org.bukkit.persistence.PersistentDataType;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.InputStream;

public class LocationDataType implements PersistentDataType<byte[], LocationInfo> {
    @Override
    public Class<byte[]> getPrimitiveType() {
        return byte[].class;
    }

    @Override
    public Class<LocationInfo> getComplexType() {
        return LocationInfo.class;
    }

    @Override
    public byte[] toPrimitive(LocationInfo complex, PersistentDataAdapterContext context) {
        return SerializationUtils.serialize(complex);
    }

    @Override
    public LocationInfo fromPrimitive(byte[] primitive, PersistentDataAdapterContext context) {
        try {
            InputStream is = new ByteArrayInputStream(primitive);
            ObjectInputStream o = new ObjectInputStream(is);
            return (LocationInfo) o.readObject();
        } catch (IOException | ClassNotFoundException e) {
            e.printStackTrace();
        }
        return null;
    }
}
#

How do I make it actually work with storing locations?

#

I got the basics of custom persistant data types, but I need it to actually work

tall dragon
#

what doesnt work

shadow tide
remote swallow
#

isnt that just meant to be LocationDataType.something

#

or just LocationDataType

tall dragon
#

ur tryna add a location

shadow tide
#

yep

tall dragon
#

while ur type is made for LocationInfo

shadow tide
#

?

tall dragon
shadow tide
#

wait I wasn't thinking

#

yes it is made for location info

shadow tide
#

is there something stupid I did

#

again

remote swallow
#

that reminds me i was gonna add custom pdc to my lib

shadow tide
#

o h w a i t

#

dont

remote swallow
#

you missed the world

shadow tide
#

say

#

anything

remote swallow
#

i said

shadow tide
#

😢

tall dragon
remote swallow
tall dragon
#

right, right hahaha

shadow tide
#

yeah I'll just use that, thanks.

#

No point in reinventing the wheel, although it feels wrong accepting defeat

valid basin
#

I'm trying to create assists but I'm having major issue where when an existing assister leaves I'm getting weird error. It only happens when an existing assister leaves the game, when every assister is still in the game when a victim dies everything goes normally. Idk how to fix it. I'd appreciate if someone does know. Thx
Here's my current code:

            for(DamageStamp stamp:profile.getDamageLog()){
                if(stamp.getTickStamp()-event.getEntity().getWorld().getFullTime()<100){
                    assisters.merge(stamp.getDamager(), stamp.getAmount(), Double::sum);
                }
            }
            assisters.remove(killerProfile);
            for(Profile assister:assisters.keySet()){
                if(assister!=null&&assisters.get(assister)!=null){
                    double assistPercentage = (assisters.get(assister) / 20);
                    Bukkit.getPlayer(assister.getUuid()).playSound(Bukkit.getPlayer(assister.getUuid()).getLocation(), Sound.NOTE_PLING, 0.5F, 1.5F);

                    assister.incrementCredit((creditsPerAssist*assistPercentage),true,"Assist");
                    assister.upgradeExperience(PlayerGainExpEvent.Type.ASSIST,
                            (int) (WargroundsMain.getInstance().getRankConfig().getInt("PLAYER-EXPERIENCE.DEFAULT.EXPERIENCE-PER-ASSIST") * assistPercentage)
                    );
                }
            }```
tall dragon
shadow tide
#

how do I use the custom persistant data types, I imported them into maven

tall dragon
shadow tide
#

I don't really understand

remote swallow
#

instead of PersistentData.something use his

#

theres 2 enums for options

tall dragon
#

pdc.set(key, DataType.LOCATION, yourLocation);

#

should work with his lib

valid basin
shadow tide
#

thanks

remote swallow
#

since when did we have bounding boxes

shadow tide
#

Works

tall dragon
remote swallow
#

oh also use DataType_1_18_1.stuff if your above 1.18.1

#

for player profile stuff

valid basin
#
    public void onPlayerQuit(PlayerQuitEvent event) {
        for (Profile assister : assisters.keySet()) {
            if (assister != null && assisters.get(assister) != null) {
                assisters.remove(assister);
            }
        }

    }```
Something like this EpicGodMC?
remote swallow
#

i said that before i fully looked at the file lmao

tall dragon
#

and it wont work like this

#

this will cause an exception

valid basin
#

well I have to null check it and check if the player is in assisters in the first place

tall dragon
#

what is "assisters" ?

shadow tide
#
public class CommandManager implements CommandExecutor {
    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        NamespacedKey key = new NamespacedKey(Project.getPlugin(), "player_location");

        if (!(sender instanceof Player)) { return true; }
        Player player = (Player) sender;

        if (command.getName().equalsIgnoreCase("set")) {
            PersistentDataContainer data = player.getPersistentDataContainer();
            Location playerLocation = player.getLocation();
            data.set(key, DataType.LOCATION, playerLocation);
        }

        if (command.getName().equalsIgnoreCase("go")) {
            PersistentDataContainer data = player.getPersistentDataContainer();
            Location location = data.get(key, DataType.LOCATION);
            player.teleport(location);
        }

        return true;
    }
}
``` trying it now, but theoretically this would work, right
remote swallow
#

yes

shadow tide
valid basin
tall dragon
valid basin
#

yes it's profile, like from plugin's profile manager

tall dragon
#

huh

valid basin
#

HashMap<Profile,Double> assisters = new HashMap<>();

tall dragon
#

but what is ur HashMap Key and value object

#

ah

valid basin
#

u said that won't work?

#

to remove assisters on quit

tall dragon
#

ur current implementation wont work

#

as ur looping though the list ur removing something from

#

that cannot be done

#

personally i would make the hashmap Key a UUID

remote swallow
tall dragon
valid basin
#

yh I've done similar but with profile

#

idk if it will work, I'll test

#
        if (assisters.containsKey(profile)) {
                assisters.remove(profile);
            }
        }```
tall dragon
#

yea that should work as well

#

as long as the profile is present in your profilemanager :d

valid basin
#

I mean the same profile is saved in hashmap

#

so it should work the same like it's uuid

#

right?

tall dragon
#

should work like this yea.

#

but i dont rlly understand why ur having problems anyway

valid basin
#

I appreciate the help, thx

tall dragon
#

when ur processing the assisters u should be able to just check if the player is still online

#

and else skip it

valid basin
#

I've tried but idk it didn't work

#

i've tried that before

tall dragon
#

well just try this i guess

shadow tide
#

Thank y'all so much, I've been trying to learn about pdcs for soooo long

tall dragon
#

its quite simple once you understand them

shadow tide
#

thats what they said 2 years ago

#

gosh I was only 11 😳

terse ocean
#

getServer().getPluginManager().registerEvents(new RightClickEvent(new GUIShop()),this);

i created a constarcot of GUIShop in RightClickEvent
will that work??

#

constractor*

sterile token
#

Please i really need help with the next code, for some stupid reason which i cannot realize, the event is being cancelled, when i tes it like this:

Permission: true, Mode: false, User: true, cancel the event, while it should cancel it only if you dont have the permission

event.setCancelled(player.isOp() || !profile.isBuild() && region.getUsers().contains(player.getUniqueId()));
sterile token
tall dragon
#

wdym, will that work

#

why dont u just try 0,0

sterile token
terse ocean
#

i dont know what to put in there i made a constractor in RightClickEvent

tall dragon
#

@terse ocean

sterile token
remote swallow
#

a plugin instance or a gui shop instance

tall dragon
terse ocean
#

when you create a constractor in an event you need to put something in there when you register it and idk what to put tjere so i am asking for help

remote swallow
#

yes... what do you need in the event

#

why are you making the constructor

sterile token
#

Im really messed up bro

terse ocean
#

cuz i need to acces a getter in the class

sterile token
#

I cannot understand wha thappens tho

remote swallow
tall dragon
#

ur saying "permission: true" but that code checks no permissions

terse ocean
#

the getter is in the GUIShop class and the constractor is in the RightClickEvent class

sterile token
remote swallow
terse ocean
#

no

#

its a class where i creared a gui

remote swallow
#

can you make an instance of it in the event

sterile token
#

But dont care, that is not the point, the point is that is being cancelled, when it shouldnt

tall dragon
#

did you debug

terse ocean
#

nvm

tall dragon
sterile token
tall dragon
#

yea sure

sterile token
#
@EventHandler(priority = EventPriority.HIGHEST)
public void onBlockBreak(BlockBreakEvent event) {
  Region region = this.regions.getRegion(event.getBlock().getLocation());
  if (region == null) return;
  Player player = event.getPlayer();
  Profile profile = this.profiles.getProfile(player.getUniqueId());
  if (profile == null) return;
  player.sendMessage("[Break-1.9+] Perm: " + player.hasPermission("build.region.bypass") + " Build: " + profile.isBuild() + ", Region: " + region.getUsers().contains(player.getUniqueId()));
  event.setCancelled(player.hasPermission("build.region.bypass") || !profile.isBuild() && region.getUsers().contains(player.getUniqueId()));
}      
tall dragon
#

ples fix formatting :<>

sterile token
#

Sorry man

#

Today al is worst man, that code was suppoused to be working and not works, discord too tho

tall dragon
#

okay, send me the exact message

#

with a screenshot

sterile token
#

ok

#

Let me recompile it and restart, maybe i forget to update it on sever

tall dragon
#

ok

sterile token
#

And then i test and send picture

#

Issue here, i should be able to bypass with op

tall dragon
#

and its being cancelled right?

sterile token
tall dragon
#

right now its cancelling when the player has "build.region.bypass"

#

u gotta invert that defo

#

try event.setCancelled((!player.hasPermission("build.region.bypass")) || (!profile.isBuild() && region.getUsers().contains(player.getUniqueId()))); @sterile token

sterile token
#

?paste

undone axleBOT
quaint mantle
#

there

remote swallow
#

do you use gradle or maven?

quaint mantle
#

same msg

sterile token
#

Paste your code there, and send it in channel, please dele it

quaint mantle
sterile token
#

Delete the wrong msg

remote swallow
undone axleBOT
sterile token
#

Because its mix everything

#

thanks man

quaint mantle
tall dragon
#

@quaint mantle did u open ur jar with something like winrar to check if its there in the root.

quaint mantle
remote swallow
#

how you building

quaint mantle
#

and it was in there.

quaint mantle
sterile token
remote swallow
#

are you using the maven panel on the right?

#

or are you not on intellij

tall dragon
quaint mantle
quaint mantle
# sterile token right

So player = has perm = access to build if not then cancel building? is what im understanding you want help with?

tall dragon
# sterile token right
        if (player.hasPermission("build.region.bypass")) return;
        if (!profile.isBuild() && region.getUsers().contains(player.getUniqueId())) event.setCancelled(true);

try this

remote swallow
sterile token
#

I must do: setCancel(false) when the conditions mentioned before are not okay, because they will be another protection plugin which be able to block it

quaint mantle
tall dragon
remote swallow
quaint mantle
#

but sure

tall dragon
#

ye but the green hammer aint what u wanna be using when you use maven

remote swallow
#

that would use intellij build system

tall dragon
#

because that uses Intellij's build system

#

yea ^ :<>

quaint mantle
#

but i always use it? xD

remote swallow
#

then your not using the pom then lol

quaint mantle
#

🤷‍♀️ it's always worked for me including the pom, but ill see what it shows for me now using the green play button

#

well its fixed now

#

so tysm

sterile token
tall dragon
#

did u try it

sterile token
#

Yes, same issue

#

😡

#

Im really weird

tall dragon
#

are u sure its not the "other" plugin messing with it then

sterile token
#

no, atm i dont have it

#

I removed everything for test reasons, was the first thing i did to test

tall dragon
#

sigh. do u have that message again

#

from this try

sterile token
#

Let me send you all the trys and how i do them

wet breach
#

are you trying to work with worldguard?

sterile token
#

No no, its all custom made

wet breach
#

ah ok

#

do you have at least a permission plugin?

sterile token
#

Yes, lp

#
  1. Permission: true, Mode: true, Users. true, result: event cancelled
  2. Permission: false, Mode: true, Users: true, result: event not cancelled
  3. Permission: true, Mode: false, Users: true, event cancelled
wet breach
#

idk what mode is

sterile token
#

mode is a method to know if the player can build or not, its part of minigame events

#

I mean, if they have the permission OR have ability to build AND are members of game, they must be not cancelled, unless the conditions are not true (so they are cancelled)

#

Idk why im being so stupid for not doing that alone, im feeling really ussesless

tall dragon
#

try this

#

event.setCancelled((!player.hasPermission("build.region.bypass")) || !(profile.isBuild() && region.getUsers().contains(player.getUniqueId())));

sterile token
tall dragon
#

cuz thats what u want

sterile token
#

okay

#

I will try

sterile token
#

If i have the permission, still being cancelled

tall dragon
#

what are ur values

#

permission: true

#

and the other ones?

sterile token
#

wait

#

Im debugging

tall dragon
sterile token
#

Permission: true, Mode: true, User: true = okay
Permission: false, Mode: false, User: true = okay
Permission: true: Mode: false, User: true = not okay
Permission: false, Mode: true, User: true = not okay

tall dragon
#

Permission: true: Mode: false, User: true = not okay cancels the event. correct?

sterile token
#

yes

#

The one not okay, cancel the event, when it should be backward

tall dragon
#

ok give me a few minutes to wrap my head arround this

tall dragon
#

like "cancelled", "not cancelled"

sterile token
#

Permission: true, Mode: true, User: true = not cancelled
Permission: false, Mode: false, User: true = cancelled
Permission: true: Mode: false, User: true = cancelled
Permission: false, Mode: true, User: true = cancelled

tall dragon
#

@sterile token i think i got it

quaint mantle
#

?paste

undone axleBOT
clear sluice
#

Is there a way to prioritize onJoin event? I think something overrides my teleport and places it somewhere else. Interestingly only for firstjoin

sterile token
fluid river
#

why is hashmap hash

#

does it allow different values on one key

#

and use hash function for collision treatment

quaint mantle
#

https://paste.md-5.net/daxekedoro.bash for some reason this.jda is null but yet i set it up correctly,

its most like this that is causing it to be null,

getCommand("newticket").setExecutor(new DiscordTickets(jda));
``` *It tells me to put jda in it, so yeah..*
tall dragon
# sterile token ok

try this event.setCancelled(!(profile.isBuild() && region.getUsers().contains(player.getUniqueId()) || player.hasPermission("build.region.bypass")));

remote swallow
remote swallow
#

which

fluid river
#

what's the point of map being HashMap

tall dragon
fluid river
#

i read on the website that hashmap uses chain hash

#

but

#

like

#

for what?

quaint mantle
#

?paste

undone axleBOT
fluid river
#

isn't it a problem for arrays, not maps

fluid river
#

i just made my own hashTable on c++ with chain hashing

#

like how collisions would appear in a hashmap

tall dragon
#

it uses hashing to for example "get" an object

fluid river
tall dragon
#

in a fast way

fluid river
quaint mantle
wet breach
#

if you really wanted to yes

fluid river
#

no need for hashing here rly

tall dragon
#

thats only the case if ur key is an int tho

fluid river
fluid river
#

what's the problem

echo basalt
tall dragon
remote swallow
# quaint mantle https://paste.md-5.net/uyofarujoy.cpp

one moment


public class ClassName {
    private final MainClassName plugin;
    private JDA jda;

    public ClassName(MainClassName plugin) {
      this.plugin = plugin;

    }


and for main class

public class MainClassName extends JavaPlugin {
    private JDA jda;

    @Override
    public void onEnable() {
      this.jda = jda stuff i dont remember;
    }
    
    public JDA getJDA() {
      return this.jda;
    }
}
wet breach
fluid river
#

nothing would change i guess

echo basalt
#
TypedMap<String> map = new TypedMap<>();
map.put("one", 2);
map.put("two", true);

int one = map.getTyped("one");
boolean two = map.getTyped("two");
#

It's lovely

#

autocasting

remote swallow
fluid river
#

we are talking about HashMaps rn and why does Map use hashing

sterile token
wet breach
echo basalt
#

and have the side effect of not allowing duplicates

fluid river
#

you can use hashcode of object

#

not a hashfunction on the map

wet breach
#

of object yes

tall dragon
#

Yeah that why its pretty weird

wet breach
#

but if the key is a string

#

that wouldn't work

fluid river
#

?

#

you mean cuz of string pool?

echo basalt
#

it took me a while to learn that the hashcode of an int... is itself

fluid river
#

but there is literally only one pool in java for strings, no other objects use it

wet breach
#

you are under the impression that Objects are unique when really the value of objects are what are unique and thus you can't always use the hashcode of an object for what you are claiming

quaint mantle
echo basalt
#

equals is not ==

wet breach
#

Anyways, the hashing for map, is faster for detecting duplicates as well as faster for performing a contains check

fluid river
echo basalt
#

hashcode1 == hashcode2 -> 1.equals(2)

wet breach
#

I am not sure what exactly you are trying to arguing here NukerFall

fluid river
#

if two of your objects have the same hashcode, then it's not the problem of the map

#

where is HashList or smth

remote swallow
fluid river
#

HashSet comes to the chat...

wet breach
#

but that is a flawed method that you simply don't understand and thus it isn't used for Maps

fluid river
#

like i literally worked around hashing today

#

whole day

#

used it for storing things like employee numbers

#

to ARRAY

wet breach
#

but here is something you haven't considered where your method would be flawed

#

two different objects can have the same hashcode

#

remember the map doesn't allow duplicates

fluid river
#

if they have just replace

wet breach
#

the map would see that as being a duplicate when they are both different

fluid river
#

old with new

#

problems?

wet breach
#

two different objects

#

can't replace one object that isn't the same as another

#

especially if you want both of them

fluid river
#

hashFunction would not help solving this issue, cuz it's just storing elements own way

#

you will have to go for some better EQUALS check

wet breach
#

Well this is why hashcode of objects are not used for the map

echo basalt
#

the objective of a hash is to literally

#

not allow duplicates

#

but provide O(1) contains

#

That's literally the caveats

#

That's why there's no HashList

wet breach
# echo basalt not allow duplicates

this is the part where using hashcode of an object would fail as I described with the scenario above that two different objects can have the same hashcode

echo basalt
#

exactly

#

the hashcode can be the same across 2 different instances

remote swallow
# quaint mantle Only if u could remember the on enable stuff... :/
public class MainClassName extends JavaPlugin {
    private JDA discordBot;

    @Override
    public void onEnable() {
        try {
            this.discordBot = JDABuilder.createDefault(token).setActivity(Activity.watching("stuff")).build().awaitRead();
        } catch (InterrupedtedException ex) {
            ex.printStackTrace();
        }
        getCommaned("ticket").setExectutor(new CommandClassName(this));
    }
    
    public JDA getJda() { return discordBot; }
}
fluid river
#

My question is how does map check that objects are not similar

#

If they share same hashcode

#

In my test program i had a hashFunction key%100;

quaint mantle
#

i was being stupid and not including the JDA jda = plugin.getJDA(); part in the class file

remote swallow
#

ah

fluid river
#

So for my program NUMBERS 111222 and 345622 were the same

#

And i used chain hashing to store second object in first object's field next_one

#

Which is basically a pointer

#

And for 789622 i made the same thing

#

Saving a pointer to the third object in the second object's field

#

But hash function was used just to decrease amount of array cells

#

From 999999 to 100

wet breach
fluid river
#

And then(same as in java's HashMap) i made a rehashing on .75 coefficient

fluid river
wet breach
#

hashcode isn't used to check if an object is or is not similar

fluid river
#

What IS used?

wet breach
#

when it comes to the map, it only cares that the appropriate type is used for key and values

echo basalt
#

pretty sure the hash is only relevant for the key

fluid river
#

So it's hashing object with own hashing system

wet breach
#

as long as the type is correct, it will accept it, and then it checks if the key being put in is a duplicate

fluid river
#

Not using object's hashCode()

#

?

wet breach
#

as I stated can't use the hasCode for such things

wet breach
#

seems kind of obvious at this point

#

if its not using the hashcode, then it has to be something else lol

fluid river
#

now it's time to figure out what exactly does HashMap use

#

Im like sure that c++ map is not using hashtables

echo basalt
#

hashmap does use Object#hashcode

#

you can just override it

#

at least in java

wet breach
#

as in the internal hashing the map uses to identify the buckets it contains

fluid river
#

I guess i need to write own HashMap on c

#

To figure it out

#

Or try to do it on java itself

#

Im almost god in chain hashing

#

Idk how open hashing works tho

raw sky
#

How should I approach getting a plugins version, description, and authors from the plug-in.yml?

#

And a few others like sha256 dependencies and soft depends

#

Without running the file? I scraped every single plug-in off spigot I could get and some of its data, I just need a efficient way to do this

#

My python script has been running for like 4 hours and it’s almost done, I don’t know python so it’s not very optimized

torn shuttle
#

why do I keep finding myself learning all my complex systems at 4 am

torn shuttle
#

because you could just get the data from the jar file

hexed void
#

How do I set the strength and duration of an ItemStack potion?

remote swallow
#

potion meta

hexed void
#

potion data?

remote swallow
#

meta

hexed void
#

Do I need to set CustomEffect?

remote swallow
#

if you want to add an effect i would guess so

hexed void
#

Thank you :)

round finch
#

It remains me about something..

How do you make potions with custom colors?

hexed void
#

PotionMeta.setColor()

round finch
#

Nice

#

Ty

raw sky
torn shuttle
# raw sky yes

just check the plugin.yml then, it stores all the data you need

raw sky
#

Ok ty

devout tangle
#

how can i use the spigot build tools to send packets

remote swallow
#

build tools doesnt send packets

#

build tools builds spigot

devout tangle
#

ohh ok

clear sluice
#

Would it be very heavy to run code executing each 50 server ticks that would display actionbar message to people on X world

devout tangle
#

how can i send packets

remote swallow
#

which you are required to do use packets, run buildtools and then follow this guide

#

?nms

remote swallow
#

or use protocol lib

devout tangle
remote swallow
#

i would probably recommend protocol lib

devout tangle
#

ok i compiled the build tools but how do i use this in my plugin

raw sky
#

you might have to add someething abt local to the repos

distant plume
#

I want a plugin that allows players to respawn every 2 hours but still works if the player is offline is there anything like that, that already exists

raw sky
#

LearnSpigot provides a free web-based pastebin service for storing and sharing code snippets with anyone. Powered by hastebin.

LearnSpigot provides a free web-based pastebin service for storing and sharing code snippets with anyone. Powered by hastebin.

LearnSpigot provides a free web-based pastebin service for storing and sharing code snippets with anyone. Powered by hastebin.

LearnSpigot provides a free web-based pastebin service for storing and sharing code snippets with anyone. Powered by hastebin.

raw sky
distant plume
#

I have some knowledge of java but haven't made a plugin

raw sky
#

Making a plugin is going to be semi easy if you have some java background, plus its always fun to get into plugin development

devout tangle
raw sky
#

Plugin development for me is really fun, Worked on 1 project for 19 hours in the past 2 days, only downtime was hanging out w friends and sleeping

devout tangle
raw sky
#

all good

remote swallow
#

it cant get the file

#

iirc its new File(JavaPlugin.getDataFolder(), "filename.yml")

raw sky
#

so

#

uhm

#

stupid issue

#

a configuration section cannot end with .:

remote swallow
#

oh

#

i didnt even see that

raw sky
#

Why tf would this cause a huge issue? Dont know

raw sky
#

I sure hope you didnt look through hundreds of different plugin names

remote swallow
#

i didnt, if it was a problem with that i would have just said do the split in half

echo granite
#

Is there an event that runs when a player touches a world border?

raw sky
#

What are the chances of downloading malaware by downloading every single plugin on spigotmc

#

ran a small test and downloaded 127 before my server completely crashed

#

they got some long names too

#

Now that is a quality name 👌

echo granite
raw sky
remote swallow
raw sky
#

only downloaded plugins with iirc 30k+ downloads to prevent downloading tens of thousands of plugins

remote swallow
#

only like 30k left to go

raw sky
#

I could instead check for which plugins are 1.16.4+ and 1.12.2 since those are the most used paper versions by far

remote swallow
#

you should run them through antimalware

raw sky
#

Yea imma just run them through virus total with their api

remote swallow
raw sky
#

Ah ty

remote swallow
#

why use virus total when you can even find stuff just bad for servers in general

raw sky
#

True, could always make my own AI detection too, never used AI in the past though

remote swallow
#

as long as they are all in a plugins folder

#

drop aw in the folder outside

#

and go

#

finds pretty much all malware including mc related

raw sky
#

There we go, ill decompile them tmrw

remote swallow
#

damn

cosmic nebula
#

someone please help me with my authme plugin i want players to spawn in a room before login and spawn at lobby after /login

raw sky
#

If it’s your own plugin then do player.teleport(location)

silk mirage
#

i realaly hate it when my intellij does this to me

vale ember
#

if i want to run some code when plugin is instantiated do i need to override the no-args constructor of JavaPlugin or the protected one?

#

or should i just use an initializer?

eternal oxide
#

Why when instantiated?

vale ember
#

so i can set private final fields

eternal oxide
#

then use a code block {}

vale ember
#

ok

#

btw i would like to ask
if i use runtime reflection to register all listeners in the plugin package, would it be too performance intensive?

#

so that i dont have to register them manually

#

i jsut wanna avoid having to modify main class every time i add a new listener

#

because i constantly forget to do it

#

okay thanks

regal shadow
#

Hi, how can I check if player aiming with bow?

#

Yeah

twin venture
#

Hello , i have a bit of a problem , so when server restart it should remove old entity [armorstand , lootbox]
but it dosen't do that

#

i have 2 types of lootboxes :
1- normal lootbox
2- preview lootbox

#

am i doing anything wrong with nbt-api?

opal juniper
#

what is the point to this

twin venture
twin venture
twin venture
#

and that's the error :

onyx fjord
#

1.8

twin venture
#

ofc

onyx fjord
#

smh

twin venture
#

latest ver 2.11.1

orchid gazelle
#

Why use patchEntity?

#

What is that

twin venture
orchid gazelle
#

Well, when you spawn the stands, add them to a List

#

And then remove all from that list at disable

twin venture
#

iam doing that ..

orchid gazelle
#

Ahh ok

twin venture
#

when i first spawn them :

orchid gazelle
#

Then you may do some debugging when you execute some test command, request if the list does even contain any stands

twin venture
#

Alright i will do that

orchid gazelle
#

I have the feeling that there are none since it returns null at patchentity

#

When you're done, please ping me so I can look further if I have another idea

twin venture
orchid gazelle
#

What does patchEntity do?

#

You can just use the normal Entity Object and kill that

#

(Remove)