#help-development

1 messages · Page 1472 of 1

eternal oxide
#

You can probably get around it by not trying to get teh block from teh world

#

get it from the provided Chunk

opal juniper
#

ill try it

visual tide
#

bruh what does discord do to my indentation

opal juniper
#

hmm

#

i think that i could probs have some sort of garbage collector that goes behind a bit and instead of clearing them immediately just send an unload packet to the clients

eternal oxide
#

what exactly are you trying to clear? The whole chunk?

opal juniper
#

2d map ><

#

yeah

#

but i screwed up the logic

#

so it is 3 wide

young knoll
#

You probably want a custom chunk generator ideally

#

But that is more complicated

opal juniper
#

yes, and impossible on spigot

young knoll
#

No it isn't

opal juniper
#

How can you generate the chunk data for that specific chunk only?

opal juniper
#

yeyeye, but that would require a custom chunk data algorithm

eternal oxide
#

Have you tried running your code on the ChunkPopulateEvent instead of the chunk load?

opal juniper
#

paper has a method:
Bukkit.createVanillaChunkData()

opal juniper
#

i will try again

#

yeah it does the same thing

oak mica
#

Hi

opal juniper
#

hello

oak mica
#

How can i set an items meta specific to a certain player

#

so like have say a players kills on their sword

#

but only their sword

#

and for other people it is different

opal juniper
#

Ummm, i mean you can give a player an itemStack with a specific meta.

#

Do you want to pick up some1 elses sword and see ur stats?

oak mica
#

yes

young knoll
#

Hmm

opal juniper
#

ok

oak mica
#

i want to use the same itemstack

opal juniper
#

so you would have to listen to them getting the sword and then change the meta

young knoll
#

Store the data tied to the player and then set it to all items in that players inventory

eternal oxide
#

you'd have to modify the lore when you pick it up

young knoll
#

You could modify it in the outgoing packet technically

opal juniper
oak mica
opal juniper
#

What?

oak mica
#

basically

young knoll
oak mica
#

like say skyblock

#

hypixel

young knoll
#

When the player picks up an item

oak mica
#

everyones stats show up

#

on their sword

oak mica
young knoll
#

Clear the custom data from it, and then set it again with the new owner

opal juniper
oak mica
opal juniper
#

Why would it do that?

oak mica
#

like this sword

young knoll
#

No, only the item you pick up

oak mica
#

say i had this

#

and when a player got this sword

#

they have a custom meta specific to them

opal juniper
#

static?

oak mica
#

idk why

#

but yeah

#

i want to have this one itemstack

#

main

opal juniper
#

Thats not how it works

oak mica
#

so each items itemstack is different?

young knoll
#

mhm

opal juniper
#

as soon as you give it to a player it is a different itemstack afaik

oak mica
#

oh that makes it much more simple

#

thanks

#

so i can jsut access it and change it

#

sorry for taking tiem cos im dumb

opal juniper
#

np

visual tide
#

is there a better way to do this

List<String> allBlockStrings = new ArrayList<>();
                        for (Material block : allBlocks) {
                            allBlockStrings.add(block.toString());
                        }
opal juniper
#

I mean, what are you trying to do

visual tide
#

can i do that with streams or something?

opal juniper
#

im not sure

ivory sleet
#

yeah lvj

#

you could Idk if the allBlocks iterable is big

#

then a parallell stream might suit you

#

allBlocks.stream().parallel().map(String::valueOf).collect(Collectors.toList())

visual tide
#

thanks!

#

it works

left swift
#

hello, why armor stand isn't small? i tried spawn EntityArmorStand via packets

        WorldServer s = ((CraftWorld)owner.getLocation().getWorld()).getHandle();
        EntityArmorStand armorStand = new EntityArmorStand(EntityTypes.ARMOR_STAND, s);

        armorStand.setLocation(owner.getLocation().getX(), owner.getLocation().getY(), owner.getLocation().getZ(), 0, 0);
        armorStand.setSmall(true);

        PacketPlayOutSpawnEntity packet = new PacketPlayOutSpawnEntity(armorStand);
        ((CraftPlayer) owner).getHandle().playerConnection.sendPacket(packet);```is this good method?
ivory sleet
#

I mean

#

API is a thing

storm monolith
#

Heyo, I made a custom entity with NMS (custom silverfish), at the moment it walks on the ground, can I specify another Y?

final imp
#

Hi, someone can give me a plugin for add things to vip, change de name, etc

sharp bough
#

hows the thing that runs whenever a player clicks something in chat?

#

like "next page" in chat

#

and it does something or whatever

#

wait nvm

young knoll
#

Clickable Components that run commands

cobalt blaze
ivory sleet
#

that handles permissions

young knoll
#

Essentials has /nick

#

Among other things

final imp
young knoll
#

Use Luckperms

sage swift
#

more like SUCK perms

wraith ingot
#

is it possible to create an anvil inventory?

#

like without an anvil?

#

i'm trying to do something like this

Inventory ai = Bukkit.createInventory(null, InventoryType.ANVIL, "Map Name");
ai.setItem(0, new ItemStack(Material.MAP));
((Player) sender).openInventory(ai);
#

but I want ai to be of type AnvilInventory

cobalt blaze
#

cast it?

wet breach
#

you should be able to create an anvil inventory

#

there is only 3 inventories that method can't be used to create

cobalt blaze
sage swift
#

AnvilInventory ai = (AnvilInventory) Bukkit.etc

#

...

cobalt blaze
#

Read above gecko

sharp bough
#

lol

fierce salmon
#

what is the name of the event for when you place a block

left swift
#

How can i set EntityArmorStand as player's passanger? I tried with player.setPassenger() but this method requires Entity (not EntityArmorStand) and i tried with armorstnad.startRiding() but it requires Entity too (not Player), sow how can i make it?

eternal oxide
#

they both extend Entity

wraith rapids
#

you're still working on that

#

impressive

#

points for persistence I suppose

left swift
left swift
cobalt blaze
wraith rapids
#

for EntityArmorStand you need to use the bukkit wrapper if you're using the bukkit method on the bukkit player

#

CraftArmorStand is what it's called probably

#

which implements bukkit's ArmorStand

#

and wraps over nms' EntityArmorStand

fierce salmon
#

I am trying to add a delay to my code. I would like it to wait 2 seconds and set the event to be cancelled. How would i do this?

eternal oxide
#

you can;t

#

you cancel the event or you don;t, you can;t delay it

fierce salmon
#

then can i delay it to set the block to air or null?

eternal oxide
#

delay what?

fierce salmon
#

i want to delay placing water

#

lemme rephrase

eternal oxide
#

so bucket use?

fierce salmon
#

yes

#

so when you place water i want to wait 2 seconds then set the block to air

final imp
#

Hi, someone have a antiXray?

fierce salmon
#

orebfuscator

#

100%

eternal oxide
#

you could cancel the event, then start a runnable with a 40 tick delay to spawn teh water block and replace teh players bucket with an empty one

fierce salmon
#

hmm

#

how do i do a delay btw?

#

with bukkit

eternal oxide
#

you don;t delay you use teh Scheduler to run a task later

fierce salmon
#

oh

eternal oxide
#

oh you want to replace teh water that was placed.

#

thats easier, you don;t cancel the event, you just start a runnable

fierce salmon
#

whats a runnable?

#

and how do i use it?

eternal oxide
#
        new BukkitRunnable() {
            
            @Override
            public void run() {
                
                // code
            }
        }.runTaskLater(plugin, delay);```
#

all you have to do is a final Location where teh water was placed in your event

#

and in your runnable loc.getBlock().setType(Material.AIR)

#

probably be safer to check the block is water before you set to AIR

fierce salmon
#

did that

#

also for the plugin do i put this?

eternal oxide
#

If this is your main class, yes

fierce salmon
#

oh no

cobalt blaze
#

Bukkit.getPlugin(YourMainClass.class)

eternal oxide
#

or use Dependency Injection and pass the instance

fierce salmon
#

Do i just put the name of my class?

#

bc it errors when i do that

eternal oxide
#
    private JavaPlugin plugin;

    public YourListenerClass(JavaPlugin plugin) {

        this.plugin = plugin;
    }```
fierce salmon
#

im a bit confused lol

#

@eternal oxide So i just need to put the name of my main class?

eternal oxide
#

no

fierce salmon
#

bc my main class is MultiPractice and it errors when i put that

eternal oxide
#

Learn dependency injection. I gave you all the code you need

ivory sleet
cobalt blaze
#

Might as well inject DataManager as well

velvet fog
#

hi, if i buy 1 premium plugin ... can i download it as many times as i want? or is it only 1 time? What happens if the plugin is updated? Can I download it again?

#

help me pls?

ivory sleet
cobalt blaze
#

Absolutely yes?

#

You are still depending on plugin when you only use the manager

ivory sleet
#

The entrypoint is usually responsive for bootstrapping the plugin thus making it the context provider of all loaded resources isnt a bad idea. If we want to extend (not extend as inheritance) the event listener at a later point then it will become easier to just pass our context object rather than individual dependencies at a later point of time. Of course we can talk about modularity and component embracing but scalability and extendability is important needless to say.

#

But yes if I would use a DI framework like Guice then I would probably do that instead.

cobalt blaze
#

So the entire point of Dependency Injection is that you let the upper level control what is given, or Inverse of Control. If you still go through the Main class to get dependencies, you force your main class to contain a certain shape, the getDataManager(). That kills the entire point of the modularity provided by a DI design. There's no difference in Bukkit.getPlugin(YourPlugin.class) and your public MyListener(YourPlugin plugin). The client (your listener class) isn't supposed to know where DataManager comes from, it just cares that it gets provided.

ivory sleet
#

Indeed a very good point. However let's say that this is the case. Such that MyListener only depends on DataManager. Then just passing the DataManager instance through constructor might be sufficient enough. But now lets say you also need to depend on a StorageProvider, a Configuration and a TranslationManager. One way we could handle this is to of course pass all of the four dependencies through MyListener's constructor like MyListener(DataManager, StorageProvider, Configuration, TranslationManager) and that take some time to rewrite from just MyListener(DataManager). Instead what we could do is to use our PluginMainClass as a context object and then pass that single instance instead MyListener(PluginMainClass). Then expose our dependencies through accessible methods in PluginMainClass like PluginMainClass#storageProvider(), PluginMainClass#dataManager() etc. By doing this we can easily add new dependencies without having to reshape our constructor of MyListener class. Of course we would still let upper level control whats given as we could pass a different instance of PluginMainClass which might provide a different implementation of DataManager and what not. Bukkit.getPlugin(YourPlugin.class) is not a thing, did you mean JavaPlugin.getPlugin(YourPlugin.class)? But yeah arguably it may be beneficial to just pass DataManager in the first place if we can ensure that it is going to be the only dependency.

cobalt blaze
#

Yes even if you need 10 dependencies you just need to put them in the constructor

#

Because the design is to not force the provider to require a certain shape

ivory sleet
#

That's not a great idea.

#

Then you should at least use a builder for it.

cobalt blaze
#

Why should we use a builder

ivory sleet
#

It is hard to maintain constructors which have many arguments.

#

Can even be recognized as a code smell iirc.

cobalt blaze
#

It can be a sign of bad design, but if you really need the dependencies and there is nothing to be improved then that's it

#

We just have a 10 argument constructor

#

From experience you don't really use that many though

ivory sleet
#

First and foremost long constructors are hard to maintain. Then Idk what you mean with require a certain shape.

#

Of course its tightly coupled to what PluginMainClass#dataManager would provide

cobalt blaze
#

The certain shape is that you force your provider to have functions like getDataManager()

ivory sleet
#

Tightly coupling isn't good always but making your application cohesive in terms of coupling it with certain shapes isn't bad needless to say. Let's say you have multiple components all depending on DataManager through constructor. It can be very tedious to swap implementation. But if we would use PluginMainClass as a context provider then we would just have to swap the implementation of #dataManager(). Which might be beneficial if you need cohesion.

cobalt blaze
#

That's where the provider comes in

#

It's also why Java gets memed on a lot because you just build layers upon layers with these designs

ivory sleet
#

¯_(ツ)_/¯

#

Seen more memes about Java's verbosity.

cobalt blaze
#

Also one thing you forget if you need to swap is to work with interfaces

ivory sleet
#

?

cobalt blaze
#

If you only use the interface you don't need to mess inside the classes

#

You only need to do stuff at the toplayer

ivory sleet
#

What are you on about now moving from DI to abstraction?

#

I mean sure interfaces a good to create high level abstractions or what's your point?

cobalt blaze
#

So if you design it like this

public interface DataManager {
    boolean save(Player player, Data data);
}```

```java
public class SimpleDataManager implements DataManager {
    public boolean save(Player player, Data data) {
        //the stuff here
    }
}

And then in your listeners it would be like

public class MyListener implements Listener {
    private DataManager dataManager;
    public MyListener(DataManager dataManager) {
        this.dataManager = dataManager;
    }

    //The rest here
}

So if you are swapping your DataManager with another DataManager, you only need to do stuff in the upper level

public class MyPlugin extends JavaPlugin {
    private DataManager dataManager;

    public void onEnable() {
        //Just change this line.
        this.dataManager = new SimpleDataManager();
        this.dataManager = new NoSQLDataManager():
        
        //So you don't have to change these
        getServer().getPluginManager().registerEvents(new MyListener(dataManager), this);
    }
}
#

Because you are using abstraction

ivory sleet
#

Yes but we are not always using abstraction, you should only create powerful abstraction which uses the power of polymorphism. Else you would use a normal class.

cobalt blaze
#

Then we can also just alter DataManager class right

#

There would be no need to change all these lines

eternal night
#

I mean, pushing most functionality behind an abstraction is probably a clever idea if you are planning on serious production code

ivory sleet
#

Yeah indeed

#

I just mean, dont create interfaces for the sake of creating interfaces

cobalt blaze
#

They got a very powerful usage though

eternal night
#

Ehhh, idk about that xD Like, an interface just for the sake of interfacing might still be useless for unit tests

cobalt blaze
#

Especially for testing as you can easily mock services

eternal night
#

🙂

eternal night
#

yes

#

sssshh it is 1am

#

my brain is fried

ivory sleet
#

lol yeah fine, but I would still argue for that it should be used when you can take full advantage of polymorphism (can never spell that). A con I experienced when using many interfaces is that it got quite hard to navigate through my application.

ivory sleet
#

Im gonna go sleep now gn 🙂

cobalt blaze
#

This is basically only useful if you work with a group or on enterprise level

#

otherwise its a huge overkill

sage swift
#

if another person asks about getting the title of a custom inventory, im gonna punch my monitor

wraith rapids
#

what are we arguing about

sage swift
#

people getting their custom inventories via inventory view name

#

no argument

#

just right vs wrong

wraith rapids
#

i'm seeing several walls of text regarding abstracting and polymorphism

sage swift
#

i dont care about them

#

im a strong independent woman

cobalt blaze
wraith rapids
#

injecting shit is for junkies

candid galleon
#

:squint:

#

test

floral flare
#

How can I get the time for a specific country?

Date date = new Date();```
ivory sleet
#

LocalTime iirc

paper viper
#

Is there any difference between !Files.exists(f) and Files.notExists(f)

lofty mulch
#

nope

#

but I will choose Files.notExists(f)

ivory sleet
#

Yes

#

@paper viper

paper viper
#

Apparantly the state of a file can be "unknown"

ivory sleet
#

From javadoc Note that this method is not the complement of the exists method. Where it is not possible to determine if a file exists or not then both methods return false. As with the exists method, the result of this method is immediately outdated. If this method indicates the file does exist then there is no guarantee that a subsequence attempt to create the file will succeed. Care should be taken when using this method in security sensitive applications.

paper viper
#

ic

terse pumice
#

I am spawning an armour stand with the below code:

armorStand = owner.getLocation().getWorld().spawn(owner.getLocation().add(-1.5, 0, 1.5), ArmorStand.class);
armorStand.setBasePlate(false);
armorStand.setArms(true);
armorStand.setInvulnerable(true);
armorStand.setCanPickupItems(false);
armorStand.setSmall(true);
armorStand.setCustomName(followerUser.getDisplayName());
armorStand.setCustomNameVisible(followerUser.isDisplayNameEnabled());```

For some people it displays correctly however for others it appears as a default armorstand with the armor on.

I have tried using a bukkit runnable to rerun the attribute settings 5 ticks later to try see if that fixes but it doesn't seem to.

If the player unrenders the entity and then renders it again it fixes. Is there a way in which I can force this reload for the particular entity for players to fix this? OR is there an alternative fix that any of you know of?
drowsy helm
#

have you tried isolating the plugin

#

sounds like something is interfering with packets

terse pumice
#

Yeah I have it did the same without any other plugins

#

All clients are 1.16 and so is the server. I can somewhat understand with the version difference why there might be errors haha. I'm wondering if there is a way in which i can almost force rerender the armour stand for players

#

Yeah I knew there would be a way with packets but unsure what that way is

#

Very good question, that's 2am code for you

#

I wrote the majority of this a while ago but have only recently been bothered to investigate further into this bug

#

That doesn't sound particularly fun haha

#

Wondering if there is a way I could teleport the armour stand away and then back

#

Or something like that?

#

Would be an iffy method but could work

warm vapor
#

is there a way I can store simple data (a string) in an entity? my entities do not have their own classes and I need a way of differentiating them

terse pumice
#

Persistent Data Containers

#

There are some good Spigot threads on them if you give it a Google

warm vapor
#

alright
another problem I am having is understanding the distinction between some classes
for entities it seems like there are separate inheritance chains and I don't know why this is or how to work between them

terse pumice
#

Sorry I don't quite understand what you mean

warm vapor
#

as an example I sometimes have to convert between worlds and craftworlds and there are two different ItemStack classes that I can convert between

terse pumice
#

Ohh I've not gone deep enough into entities to know I'm afraid sorry

#

Hopefully someone else will know

sage swift
#

CraftEntities extend their Entity counterparts

#

so all the different versions of them do so

sage swift
#

🅱️lackspigot

#

@granite stirrup

granite stirrup
#

who loves 🅱️lackspigot :)

pearl hollow
#

how do I get the row and column from a slot in a chest inventory?

granite stirrup
quartz anchor
#

row = slot / 9 and col = slot % 9, all parameters must in integer

granite stirrup
#

just use the slot number???

quartz anchor
#

also row and col starts from 0

granite stirrup
#

lol

vagrant stratus
#

That's what google is for m8

quartz anchor
#

it takes the reminder of division operation

#

so a % b is like a - ((a / b) * b)

pearl hollow
quartz anchor
#

but it's faster

pearl hollow
#

But is there a better way

granite stirrup
#

use another api

#

that uses slots

#

?

viscid venture
#

hey so i'm using mohist as the base .jar file for my minecraft server so i can run mods and plugins so i can set up a shopmenu system but i can't get the coding for bossshoppro to work can someone help me get the codings to work for that plugin? or at most set up the coding for my servers shops i already have the codes basicly made but i need help getting them to work properly and yes the plugin works like this i know of another server then mine that is doing it but they aren't willing to help me much so if someone could point me in the correct direction i'd appreciate it

vagrant stratus
#

You'll have to ask in mohist's discord/forum whatever, this isn't really the best place to ask that sorta thing

viscid venture
#

i'm asking for help on coding the plugin Bossshoppro i already have everything else situated

vagrant stratus
#

mohist's code is most likely different than spigot's hence my message

viscid venture
#

ok

twilit rivet
#

how does one convert a string to get the uuid of a player, for example, arg[0] could be a string, but I want to get the UUID if the name is a player

vagrant stratus
#

UUID#fromString

twilit rivet
#

that doesn't do string > uuid though does it i.e. Sam > 24352345-8cf0-11sd...

vagrant stratus
#

If you wanna go name -> UUID, you'll have to get the player then get the player's UUID

twilit rivet
#

@vagrant stratus am I doing it a terrible way or?

vagrant stratus
#

you can do Bukkit#getPlayer, it'll return null if the player doesn't exist though

#

so do a null check

twilit rivet
#

is there a getOfflinePlayer(String) that's not deprecated

granite stirrup
#

normally deprecated isnt things that u cant use its just that deprecated things are normally old or just not recommended

#

doesnt mean u cant use it tho

#

but u dont have to use it

twilit rivet
#

@vagrant stratus better?

vagrant stratus
#

Should be fine now 👍

dusty herald
#

why are you prepare statements and not preparing shit? 👀

#

shame

twilit rivet
#

thus, still playing about

quaint mantle
dusty herald
#

what nitro

#

I never had nitro

quaint mantle
#

I swear to god I saw your name pink last week

#

Unless I’m tripping balls rn

dusty herald
#

you are

granite stirrup
#

lol

#

discord doesnt tell people if they have nitro classic or nitro it just says they purchased some nitro

twilit rivet
#

is there a way to get all users that have played the server

#

so that I don't get only online players

tawdry plume
#

hey guys, I'm trying to make a plugin to detect how many zombies were killed by the player before spawning a creeper (as a "boss"). What's the best way to keep track of zombies killed within a game instance?

granite stirrup
tawdry plume
#

just need it for that specific instance. it can be stored in memory

granite stirrup
#

just use a variable?

tawdry plume
#

lol I understand, but I'm new to spigot/bukkit api. Not sure what to store in that variable

granite stirrup
#

u would store the count of zombies killed

#

in a int

granite stirrup
tawdry plume
#

ok

#

how can i keep track of the zombies killed?

granite stirrup
#

u should really learn java

granite stirrup
#

theres a ondeath event which i think works with zombies but u gotta check if its a zombie

tawdry plume
#

That's what I was looking for. Thank you

#

I'll search up the on death event

granite stirrup
#

actually i think its thisjava @EventHandler public void onKill(EntityDeathEvent event) { Player killer = event.getEntity().getKiller(); if (event.getEntity().getType() == EntityType.ZOMBIE) { // code here } }

#

u also gotta register the event tho

#

and also u gotta implement listener

tawdry plume
#

@granite stirrup that was actually very helpful. Got it working thanks!

granite stirrup
#

np 👍

tacit drift
covert bluff
#

i want to drop all of a player's inventory's content onto the ground, is my method fine, or is there something wrong with it

if (deathDrops) {
                                    PlayerInventory playerInventory = plr.getInventory();

                                    for (int j = 0; j <= 36; j++) {
                                        plr.getWorld().dropItemNaturally(plr.getLocation(),playerInventory.getItem(j));
                                    }
                                }
#

(also i have no idea why its spaced out that much)

granite stirrup
#

when u paste it

#

then it should be fixed

covert bluff
#
if (deathDrops) {
   PlayerInventory playerInventory = plr.getInventory();

   for (int j = 0; j <= 36; j++) {
       plr.getWorld().dropItemNaturally(plr.getLocation(), Objects.requireNonNull(playerInventory.getItem(j)));
             }
    }
granite stirrup
#

but also depends on how much that loop is runned it might make the main thread kill itself

covert bluff
#

what should i do then

granite stirrup
#

i think BukkitScheduler

#

idk

#

how u use it tho

dire marsh
#

can't you just loop thru inventory contents

granite stirrup
#

i think so

dire marsh
#

inventory getcontents something blah blah

#

also be aware that an inventory slot can be null or air

granite stirrup
#

like that

#

its either null or air

dire marsh
#

and the javadocs are wrong a lot of the time

granite stirrup
#

to be specific either null or Material.AIR i think

covert bluff
dire marsh
#

e.g getEquipment methods say not null when it can in fact return null...

granite stirrup
#

XD

dire marsh
#

then i get warnings for checking nullability

#

pain

granite stirrup
#

u could just try catch it

dire marsh
#

that's bad

granite stirrup
#

why?

#

try catch isnt that bad

dire marsh
#

not good design for that

granite stirrup
#

and i mean its kinda a overcomplicated if stament

#

XD

#

someone used it as a if stament

#

ngl

#

i saw it

#

on a Video

#

cuz they were using java without if staments

#

and other stuff

#

like for loops and while loops

dire marsh
#

oh no

granite stirrup
#

try catch isnt bad lmao

#

i mean u dont need to use it much

#

but sometimes its helpful

#

when something throws something its so fucking gay to add the throws exception to where ever method im using it in

twilit rivet
#

I mean sometimes you have to use it, for stuff like PreparedStatement

sage swift
granite stirrup
#

i just dont like adding the one line throws exception cuz then u gotta do it everywhere it uses it

#

imagine calling a method from something that uses a throws exception in the method and theres like 50 methods behind that before it gets called including the main one its gonna be a pain

#

so i like using try catch instead

dire marsh
#

i once saw a plugin that would throw a UserIsRetardedException if you tried to double click the jar file

granite stirrup
#

wtf

#

XD

twilit rivet
#
    private void playerInfoMethod(Player player, String arg1) {

        Player playerName = plugin.getServer().getPlayer(arg1);


        if (!(playerName == null)) {
            UUID playerID = playerName.getUniqueId();
            String queryName = playerID.toString();

            ...
        } else {
            player.sendMessage("Invalid user!")
        }
```Is there a way to get all users that have been on the server? As currently it only grabs those who are online
dire marsh
#

Bukkit.getOfflinePlayers

sage swift
granite stirrup
#
public void isGay(Player player) {
  throws PlayerIsGayException(player);
}```
sage swift
#

i dont think thats how exceptions work

vagrant stratus
sage swift
#

its the main class

dire marsh
#

oh no

sage swift
#

if you use the plugin as intended, no problem

dire marsh
#

optic is resource staff

#

how are we gonna hide our malware now

vagrant stratus
#

Still in the jar code 🤷‍♂️

sage swift
#

have it download a "library" then

#

:)

vagrant stratus
#

Would still get deleted

dire marsh
#

notatrojan.exe

sage swift
#

not if they dont find out

vagrant stratus
#

If it does anything malicious, it's gonna get deleted and the author banned 🙂

granite stirrup
#

imagine someone posted something named Virus and it wasnt a virus

dire marsh
#

run your mc server with full admin privileges 🧠

vagrant stratus
granite stirrup
sage swift
#

dont tell me what to do

#

youre not my dad

vagrant stratus
sage swift
#

yes we get it you're responsible

vagrant stratus
#

proof?
Reviews?
There's no reports

dire marsh
#

wasn't EWG basically ransomware if it thought you were using a leaked jar?

granite stirrup
#

thats what i heard from somewhere

covert bluff
#

how to i throw errors

granite stirrup
vagrant stratus
#

That's not any real proof, leaked versions are modifed

granite stirrup
#

nah on the b l a ck spigot page for savagegenbuckets it says NOTE : USE AT YOUR OWN RISK : The plugin contains a backdoor DIRECTLY from the spigot version, and it may not be safe to use on your server. We are leaking it here because he is literally charging money for a backdoor on spigot lmao

dire marsh
#

hey optic, when will open source plugins be mandatory

vagrant stratus
dire marsh
#

md

granite stirrup
#

XD

dire marsh
#

hi

#

no, optic is our new Spigot owner

#

:)

granite stirrup
#

the only bad thing about b lackSPIGOT

#

is that

#

u have to sign in

#

to download stuff

dire marsh
#

and why is that bad

granite stirrup
#

and theres like 100000 ads

#

XD

dire marsh
#

adblocker?

vagrant stratus
granite stirrup
vagrant stratus
#

as for the supposed backdoor, not finding anything yet

dire marsh
#

it's probably something that gives the owner all of the plugin permissions

#

a lot of plugins seem to do that

granite stirrup
#

lmao

#

i just want to make sure that its not a backdoor XD even tho im not gonna use it since it costs money

#

and i cant afford a cent

dire marsh
#

and it's not open source 😕

granite stirrup
#

lol

dire marsh
#

nope

granite stirrup
#

u cant sell something for money and also make it open source

dire marsh
#

u pay for the support

granite stirrup
#

bruh why

#

people can just compile the source code

#

get it for free

#

;-;

dire marsh
#

and those are the people that wouldnt buy it anyway

granite stirrup
#

i mean citizens cost money and u can get it for free from them

dire marsh
#

and would use a leak site

dire marsh
vagrant stratus
#

Base code has nothing malicious 🤷‍♂️

dire marsh
#

yup

#

mcmmo 👀

granite stirrup
dire marsh
#

always

granite stirrup
#

im bored

dire marsh
#

go fix mc performance

granite stirrup
#

mc servers run on basically one thread tho XD

dire marsh
#

not so much anymore

granite stirrup
#

well yeah but it used to be

dire marsh
#

and with things like paper chunk loading is async 😄

granite stirrup
#

yeah but the normal mc server i think is still one thread

dire marsh
#

hmm probably

#

i really think spigot should remove its compatibility layer

granite stirrup
dire marsh
#

you can get 300 players on a single 1.16 server

#

if you try hard enough

granite stirrup
#

yeah i just wish mc servers was like use 4-8 threads

#

or 2

#

instead of 1

dire marsh
#

depends on your server type tbh, survival has all those machines

granite stirrup
#

i think they should have like 2 threads for like half the players each

#

or something

#

1 thread for chunk loading and then the main thread for everything else

#

so 4 threads

#

might be able to get u more players

vagrant stratus
#

technically allowed, has a default value though which i assume is theirs

dire marsh
#

nice

tacit drift
#

after 100 it's 📉

#

i think the developer for mrbeast's events even said that

dire marsh
#

not if you can modify the server itself

granite stirrup
tacit drift
#

yeah, but if you want a good playable experience i think it would be max 100

granite stirrup
#

if ur on 1.12.2 tho u could easily run 200

dire marsh
#

100 is easily achievable for our server type

sage swift
#

"gens"

#

"minehut"

dire marsh
#

like, we can ignore most of the vanilla bs of hoppers etc

tacit drift
#

you can get 500 easily on a 1.8 server

#

😳

granite stirrup
#

well ik

dire marsh
#

1.8 is bad

granite stirrup
#

but i like 1.12.2 also 1.8 is old

tacit drift
#

look at big hcf servers

granite stirrup
#

1.8 u dont get support

#

and most plugins dont supPort it

#

anymore

dire marsh
#

we modified server code to readd old knockback and stuff instead

granite stirrup
#

1.13 tho is probs the version u shouldnt go below

#

but 1.12 is nice

#

normally people run 1.16.5 servers

dire marsh
#

1.16 is more stable than 1.13 imo

granite stirrup
#

but 1.12 is before they moved to string ids

#

so i like that version

#

1.13+ is just bad

#

and performance is shit

dire marsh
#

id's are still used internally in some places

#

spigot compatibility layer is gross.

granite stirrup
#

k gtg

#

bye

ivory sleet
#

The performance in 1.13+ isn’t bad at all

torn shuttle
#

I enjoy how there's endless conversations every day about which server version is the most efficient and then you see timings from actual users where one heads database plugin or one random russian shop plugin is using 1000% of the tick for whatever reason

ivory sleet
#

^

torn shuttle
#

weird question but what is the fastest fading white particle in the game?

#

I'm trying to come up with a fairly specific effect but am having a hard time

ivory sleet
#

Just test every particle (;

torn oyster
#

how do i lower regeneration rate

#

i want to keep it peaceful difficulty

#

but regen is ridiculously fast

sullen marlin
#

Cancel 50% of regens or something

cobalt blaze
#

Mess around with EntityRegainHealthEvent

torn shuttle
#

damage the player on a delay

near crypt
#

why does Thread.sleep() not work in a command?

chrome beacon
#

It does

#

And it will kill your server

near crypt
#

uhm... okay i dont want this xD

#

but how can i wait in my code?

sullen marlin
#

Use the scheduler to schedule a delayed task

near crypt
#

okay

#

how can i execute a delayed task?

torn shuttle
#

read up on BukkitRunnable

#

there's a #runTaskLater

#

why do I always mess up rotation math

near crypt
#

how can i get the Plugin?

crude charm
torn shuttle
#

you might want to take a step back and go read the guides that cover the basics

near crypt
#

no Main.getPlugin() ik but what do i have to write in the ()?

near crypt
#

bro shut up...

crude charm
#

Why are you so mad?

#

What did I do

#

learn basic java

#

The most basic of java ever

near crypt
#

you write something that is not helpful, and does not bring me a step foreward so shut up

crude charm
#

Because you shouldn't be going a step forward

near crypt
#

just this or what

crude charm
#

without learning java

torn shuttle
#

go learn java is not only useful but also the only thing you can do right now

crude charm
#

^

near crypt
#

the plugin is this

torn shuttle
#

I completely forgot that a rotation in radian isn't 2 but 2pi

#

god I hate radian

sullen marlin
#

Use gradians obviously

#

Best unit

torn shuttle
#

good lord

#

well rotation matrices tend to use radian anyhow, as do the ones in the API

#

I am tempted to just covert degrees though

ivory sleet
near crypt
#

ohhhh okay iam dump

ivory sleet
#

No worries

torn shuttle
#

why is my water bottle packaged like an apple product

#

man they must be spending half of the cost of the bottle just in packaging lol

#

's a good bottle, feels good man

ivory sleet
#

🥲

torn shuttle
#

mine has been a life of suffering and of really bad water bottles

#

I'm happy to get a good one

hybrid spoke
#

and your water bottle now thinks "why do i always get the baaaaaaad guys"

near crypt
#

how can i cancel the InventoryCloseEvent

eternal oxide
#

you can't, you can only reopen it

crude charm
near crypt
#

@eternal oxide okay i meant that

#

😉

eternal oxide
#

The best you can achieve is to get the Top inventory on close, then in a delayed runnable force the player to open it.

crude charm
#

HA good luck figuring that out without basic java knowledge 😉

torn shuttle
#

hm I just pulled a calculator out to figure out 24*2

#

this is going to be a long day

crude charm
#

48

eternal oxide
#

lol, very long

#

are you sure?

crude charm
#

yes

torn shuttle
#

cutting back on caffeine sucks

near crypt
crude charm
#

OMG FOR REAL

torn shuttle
#

yes, thank you skull, I am aware

crude charm
#

I NEVER KNEW THAT

#

OMG

near crypt
#

yooo shut up

#

sorry that iam talking to you

#

😭

crude charm
#

You'll be the one crying when you figure out not learning java yet trying to learn spigot wont get you anywhere

torn shuttle
#

I'll be crying when I see the performance impact of running these many rotation vectors per tick

#

don't look forward to having to cache them

crude charm
#

Then why do it?

torn shuttle
#

because I need stuff to rotate?

crude charm
#

The server will run 1tps

#

if you rotate a big object every tick

torn shuttle
#

what

#

the fuck are you talking about

crude charm
#

idk

#

idk what ur talking about

torn shuttle
#

rotating entities

crude charm
#

oh

near crypt
#

is getViewers a new getTitle?

crude charm
#

oops

#

I thought you meant like worldedit HAHAHAHA

crude charm
near crypt
#

?

crude charm
#

Viewers has nothing to do with title

torn shuttle
#

ah this water bottle is great

#

I'm glad I spent 6 hours browsing for one

near crypt
#

okay but how can i get the title than?

#

@crude charm

crude charm
#

getTitle

near crypt
#

no there is no getTitle

#

haha

crude charm
#

you are so so dumb

#

im loosing brain cells

torn shuttle
#

clearly, that's not how you spell losing

hybrid spoke
#

learning java by doing spigot is totally fine

#

maybe not the best way but totally fine and always possible

crude charm
#

refusing the learn java and just doing spigot is not

#

and thats what he is doing

hybrid spoke
#

he cant just do spigot lmao

crude charm
#

ik

near crypt
#

true

hybrid spoke
#

there is "always" java

crude charm
#

thats what hes trying to do

#

do no java

#

and just spigot

hybrid spoke
#

or you are using some third party things like visual bukkit or stuff

near crypt
#

yes

crude charm
#

I have stuff to do

#

brb

hybrid spoke
#

👋

near crypt
#

and iam very happy with what iam doing and you can not say anything else

crude charm
#

send the code

near crypt
#

?

#

hahahaha

coral sparrow
near crypt
#

please read the definition of dump

coral sparrow
near crypt
#

not you at all

coral sparrow
#

lol

hybrid spoke
#

how did you got to dump

near crypt
#

he said to me iam dump

hybrid spoke
#

he said you r dumb

ivory sleet
#

Dumpling

torn shuttle
#

this whole discussion is giving me flashbacks of arguments I've had with angry russians

near crypt
#

yes

hybrid spoke
#

concluuuuuuuuuuuuure

lavish lion
#

Shrimp dumplings?

ivory sleet
#

Shrimp shredded dumplings

coral sparrow
#

.

lavish lion
#

Ya'll making me hungry

ivory sleet
#

Lol

#

Why learn Java when you can drink it omegalul

torn shuttle
#

why learn java when you can hop on a chatroom and get it to make a plugin for you line by line?

hybrid spoke
#

okay conclure.. its early morning.. we are not alcoholics

coral sparrow
hybrid spoke
#

$1 per line

#

$0.5 per tip

torn shuttle
#

let's hope that's not retroactively true because then I'll be owing quite a bit of cash lol

lavish lion
#

Even better deal $0.50 per line and ill call you degrading names for free

torn shuttle
#

oh my lord there is nothing more annoying than testing something really random

near crypt
#

okay guys

torn shuttle
#

do the god damned power, dragon

hybrid spoke
#

$1 skull

torn shuttle
#

fuck me it's doing the wrong one again

#

fuck me

#

how large is a dragon hitbox

near crypt
#

idk min jung

torn shuttle
#

well I have a japanese class now, peace

hybrid spoke
#

just press f3 and b and use a ruler

#

easy

rigid otter
#

Hello! How to set player current openned inventory title?

eternal oxide
#

You can only change the name of a currently opened inventory with packets

rigid otter
#

Can you show me or let me go where to get example of it?

coral sparrow
#

Just copy the inv and make a new one xD

rigid otter
#

I don't know how to do it

coral sparrow
#

with diff title

rigid otter
#

Nah

#

It's another discussion

coral sparrow
#

why not

#

oh

rigid otter
#

But here I want to change living inventory title

#

There are no usable code and article for it now

rigid otter
#
public static void updateTitle(Player p, String title) {
        EntityPlayer ep = ((CraftPlayer) p).getHandle();
        PacketPlayOutOpenWindow packet = new PacketPlayOutOpenWindow(ep.activeContainer.windowId, "minecraft:chest", new ChatMessage(title), p.getOpenInventory().getTopInventory().getSize());
        ep.playerConnection.sendPacket(packet);
        ep.updateInventory(ep.activeContainer);
    }

This code error parameters of new PocketPlayOutOpenWindow()

#

I got this from your link

#

Actually I already search it, but I still can't get it. Can you give me an example of code?

eternal oxide
#

Yes, you can't just copy/paste as that code is for 1.8

#

you have to update it for 1.16

#

it is also using CraftBukkit so its version dependant and you have to use Spigot not Spigot-api

hybrid spoke
#

why don't you just reopen the inventory with your wish-title?

rigid otter
#

Wow, ready! Finally I can do it! Thank you ElgarL

rigid otter
burnt current
#

Hey I have a question:
How can I create a book in Spigot where something has already been written (e.g. hello) and which only opens the first time you join?

burnt current
#

is there such a thing like firstplayerjoinevent?

#

and how can i create the book?

sullen marlin
#

Player.hasPlayedBefore or something

#

and book = ItemStack + getItemMeta + BookMeta

burnt current
#

ok and how can i write something in the book?

eternal night
#

the BookMeta interface has the respective methods needed to fill the book

burnt current
#

ok thank you very much

coral sparrow
burnt current
#

ok i try thank you

terse pumice
eternal night
#

try to use the consumer based spawning (which should set these values before the entity is even rendered/sent to clients)

near crypt
#

how can i check for ever if a player is over an specific hight?

burnt current
#

can you also open a book page without adding a book to your inventory?

eternal night
#

I don't think that is possible in newer versions of the game

#

tho there is a helper method for the player

#

I think Player#openBook

burnt current
#

i use 1.16.5

eternal night
#

Yeah try Player#openBook

terse pumice
burnt current
eternal night
#

check the BookMeta documentation for it

burnt current
#

ok

#

and how can I correctly create the book's variable?

dusty herald
#

You need to create a new book, set the metadata (pages) n shit

coral sparrow
#

^^

dusty herald
#

it has to be a written book too

tired spoke
#

Someone know how can i add 1.8 support to a 1.12.2 plugin?

coral sparrow
#

Material.WRITTEN_BOOK

tired spoke
#

Or link me something

dusty herald
#

what're you trying to do?

#

if you're trying to port a 1.12.2 plugin => 1.8 good luck lol

tired spoke
#

I use intellij and paper 1.12.2

coral sparrow
#

use 1.8 if you are running a 1.8 server

#

lmao

dusty herald
eternal night
#

or want to support 1.8 :>

storm monolith
#

Heyo, I made a custom entity with NMS (custom silverfish), at the moment it walks on the ground, can I specify another Y?

dusty herald
#

don't use the 1.8 API??

#

you can use the latest API just fine 😉

coral sparrow
dusty herald
#

🔫

coral sparrow
#

I like the combat mode of 1.8 than 1.16 so my servers run on them.. So I use 1.8 api

#

lmao

burnt current
dusty herald
#

i

eternal night
#

there

#

google

coral sparrow
#

yea

#

Nobody likes spoon feeding code

tribal holly
#

player can be in two different scoreboard ?
i wanna let all player see team color above their head and a unique score board on the screen per team

eternal night
#

pretty sure that is a no

tribal holly
#

so how can i do this ?

#

like sending a fake visual scorebaord ?

eternal night
#

but you can simply create the teams on all the individual scoreboards

eternal night
#

I mean, you create a new scoreboard for each player/team to setup the individual sidebar display

tribal holly
#

i'm actually doing this right

eternal night
#

just apply the teams with their respective colour to all of those scoreboards

tribal holly
#

but players need to be inside the same scoreboard to see other team color

eternal night
#

what ?

#

lets say you have the "red" team

#

and scoreboards for team red, blue and green

#

now all of those scoreboards have individual sidbars yes ?

burnt current
eternal night
#

and removed instantly

#

straus

burnt current
#

ok

eternal night
#

don't add it to the inv

#

like they do

#

just use Player#openBook

#

so zelytra, you now have three scoreboards

#

and on all of those

#

you register the teams red, green and blue

burnt current
#

as the first page then opens directly

eternal night
#

on all of them you add all the players to their respective team

#

and then add the red players to the red teams scoreboard

tribal holly
#

haaaaaa i see this is "fake team" inside each scoreboard to only show color isn't it ?

eternal night
#

yes, what else are you gonna use teams for xD

#

besides showing colour

tribal holly
#

okay ^^ i see thx

burnt current
eternal night
#

yes ?

burnt current
#

The book page opens directly. You don't have to click on the item beforehand or something?

eternal night
#

yes

burnt current
#

ok thank you xd

summer scroll
#

Anyone know why this is happening? I set the 4th argument suggestion to <amount> but it showing up this instead. (The suggestion before argument 4 is shown exactly like what is on the code)

storm monolith
#

Heyo, I made a custom entity with NMS (custom silverfish), at the moment it walks on the ground, can I specify another Y?

tired spoke
#

I want support to 1.11 1.10 1.9 and 1.8

cobalt blaze
#

Develop from 1.8

#

And then there shouldn't be any issues unless you use NMS

eternal night
#

^^

coral sparrow
#

I do it like that

#

nvm

#

What?

#

You mean libraries?

#

Uh, What is the problem

#

You mean imports?? Just delete the line lmao

#

Oh like that

#

I think you search the file name

late dove
#

How can you store item enchantments in a text file? Then load these enchantments.

eternal night
late dove
ivory sleet
#

I mean can you be more specific, like what do you actually want? When are you going to read/write to the file?

rigid otter
#

Why is InventoryView::getCursor() return ItemStack instead of int of slot? And InventoryView::setCursor(ItemStack itemStack), why not to put slot in parameter? If so, then how to set player cursor in a specific location in GUI?

eternal night
#

you don't

#

the cursor is pretty much client side

#

the cursor item returnd is the item the player is currently holding "out of the inventory"

#

as if you picked it up but didn't put it in your inventory yet

summer scroll
late dove
#

And I write to the file.

eternal night
#

to a txt/csv file ??

#

like, what is that format o.O

ivory sleet
#

lol

tired spoke
#

I use nms, there are a lot of plugins that starts from 1.13/1.12 and have 1.8 support

ivory sleet
#

Your point?

eternal night
#

just means you will need a lot more work

#

to make it compatible

coral sparrow
#

xd

eternal night
#

basic idea is that you hide all your NMS implementation logic behind interface abstractions

#

and then dynamically select the correct implementation for those interfaces based on the server version that is running

late dove
ivory sleet
eternal night
#

but even that doesn't work

#

just because it is reflection doesn't mean variable names don't change

#

one returns you the key of an enchantment and the other allows you to map the key to the enchantment

ivory sleet
#

Thing is you can entirely skip interface abstractions if you really want to and just use some nasty switch thing with nms

eternal night
#

If you prefer switch statements over each version to an interface abstraction you should not be using an object oriented programming language

tired spoke
ivory sleet
#

That is true however it’s for some reason very common in these nms compatible plugins I recognized

eternal night
#

mostly because a lot of plugins are pretty meh xD

ivory sleet
#

Yeah

#

Hmm have you tried Guice or Daggar? If you tried both which one is best in your opinion?

eternal night
#

I am not the biggest fan of DI Frameworks but dagger 2 specifically is the one I use if I have to

ivory sleet
#

Hmm okay then I will try that one this time

eternal night
#

make sure to grab the intellij plugin for it xD

ivory sleet
#

Oh nice didn’t know that existed

eternal night
oak mica
ivory sleet
#

🥲

oak mica
#

why does this cause

young knoll
#

Air has no meta

eternal night
#

I mean intellij already tells you

#

lol

oak mica
#

what

eternal night
#

the yellow background

#

it is already telling you (if you hover over it)

#

that this might cause a nullpointer exception

oak mica
#

so will this owrk?

eternal night
#

don't use asserts

#

and no

#

the item isn't the issue

#

the item meta is

summer scroll
#

use ItemStack#isSimiliar instead

oak mica
ivory sleet
#

you probably wanna null check and return or something like:
ItemStack item = event.getItem();
if (item == null) {
return;
}

oak mica
#

now

ivory sleet
#

Yeah

young knoll
#

Don’t forget item.getType.isAir

quaint mantle
#

why

young knoll
#

Because air has no meta

oak mica
summer scroll
#

oh god, don't do that on the if statements please

quaint mantle
#

yeah but then item would already be null

oak mica
#

why?

summer scroll
#

that's too long, make your code less readable

oak mica
young knoll
quaint mantle
#

I don't have that air check in any of my code

#

and i'm not getting fucked by NPE's

oak mica
#

anyone know a free hosting site which allows me to add custom plugins?

quaint mantle
#

localhost

oak mica
#

apart from that

#

it causes to much lag for me

quaint mantle
#

127.0.0.1

oak mica
#

its what i do now

oak mica
torn shuttle
#

jebaited

oak mica
#

i mean i didnt open it

quaint mantle
#

or you can always try 192.168.1.1

oak mica
#

huh

quaint mantle
#

I don't know if there's any good free hosts.

oak mica
quaint mantle
#

Free == shit specs == shit server == shit experience

young knoll
#

Spigot is inconsistent with air and null

#

I believe the interact event will return air

quaint mantle
#

Weird

#

I've never had this problem

torn shuttle
#

coll is speaking the truth though

#

i usually check both

quaint mantle
#

I don't doubt that

#

TBH I only check items that I want to check, I don't check for items I don't want to check

torn shuttle
#

anyone have an idea of what's the fastest fading white particl

#

I can't get this effect down

brittle igloo
#

Is there a way for one command (/fly) for example to trigger essentials and my own plugin?

#

Or are they always unique

quaint mantle
#

you can listen to the command event itself

#

I think if you register it yourself it'll either overwrite essential's or the other way around

#

why not write your own fly command

brittle igloo
#

Yeah it does I'm looking to make something like socialspy so an listener would be the way to go i think

split panther
#

you meant command?

#

you can intercept it on PlayerCommandPreprocessEvent

#

or, unregister previously existing command, but that would need some reflection

brittle igloo
#

Yeah, I was stupid i made An CommandExecutor but that only overrides it ofc..

quaint mantle
brittle igloo
quaint mantle
#

*Some examples of valid uses for this event are:

Logging executed commands to a separate file*
Well there you go

brittle igloo
#

That sounds exactly what i need haha

oak mica
quaint mantle
#

check if it's air you psychopath

oak mica
#

the thing is

torn shuttle
#

oh shit I just found a really cool and innovative way of giving players seizures

quaint mantle
#

What is it magmaguy

torn shuttle
#

hundreds of FLASH particles moving around

oak mica
quaint mantle
#

you getting an error or smth @oak mica

quaint mantle
#

;-; wut is problem den

oak mica
#

wait i do

oak mica
quaint mantle
#

is there any errors in console

oak mica
oak mica
quaint mantle
#

what's at line 49

oak mica
#

if(e.getAction().equals(Action.RIGHT_CLICK_AIR) || e.getAction().equals(Action.RIGHT_CLICK_BLOCK)){

eternal oxide
#

thats not 49

oak mica
#

look

#

at

#

line

#

number

quaint mantle
#

Cannot invoke "org.bukkit.inventory.ItemStack.getItemMeta()" because "item" is null

eternal oxide
#

look

#

at

#

stacktrace

quaint mantle
#

yeahhh

oak mica
#

ok

#

so

quaint mantle
#

I expected better from you Amoghus Coding

torn shuttle
#

sus

quaint mantle
torn shuttle
#

well I've seen them and I still don't really know what they're used for

young knoll
#

I could probably tell you if I knew what they looked like

quaint mantle