#help-development

1 messages · Page 2210 of 1

eternal night
#

the point is, either do what they proposed -> drop any drop if it is a weapon and run drop logic yourself on the drop click from inv

#

or "unlock" dropping for a single drop even if there was the drop click from inv before

vast raven
#

There are ways.

eternal night
#

I think they went with the first

#

but w/e

#

whatever works

eternal oxide
#

Looks like an error when deserializing a kit. looks like yoru code is calling itself

eternal night
#

ItemStackManager#knightKit does something fun

untold jewel
#

How do I send a "code" message in chat

#

on discord

#

``

eternal oxide
#

?paste

undone axleBOT
eternal night
#

three of those

#

but yea, paste is better

untold jewel
#

this is the ItemStack that is apprently calling itself

#

It probably is calling iteself but haha

eternal night
#

it is

#

yes

untold jewel
#

with the return method?

eternal night
#

indeed

untold jewel
#

hm

#

but it says it needs to return something

eternal night
#

it does

eternal oxide
#

return knight; not knightKit();

left swift
#

where can I find server version displayed on debug screen? (own fork)

untold jewel
#

Makes sense, will test out and come back!

eternal night
#

like internally ?

#

or through API

left swift
eternal night
#

MinecraftServer#getServerModName

untold jewel
eternal night
#

CraftServer.serverName

left swift
sand turret
#

can you help me?

#

pls

eternal oxide
#

Give the correct permissions to use the command. But you should be in #help-server

brittle lily
#

hey Guys how Can I set my world to always night?

chrome beacon
#

/time set night
/gamerule doDaylightCycle false

iron glade
#

xd

brittle lily
tardy delta
#

lmao

iron glade
#

there really gotta be some very easy way for devs to add fake players to test stuff

kind hatch
brittle lily
brittle lily
eternal oxide
#

when are you running that code?

brittle lily
#

I have enum. I'm making minigame and I'm setting on if(getGameState().equals(STARTING){
}

brittle lily
#

I'm setting My Game State to STARTING but nothing changes.

eternal oxide
#

You need to set the time properly

sand turret
#

Is there a plugin that shows me the permissions to use to run a command?

eternal oxide
#

no

quartz basalt
#

if i have a number like 20 how can i turn that into .20

eternal oxide
#

Math

brittle lily
kind hatch
eternal oxide
#

Time covers actual in game time. number of days, hours, minutes

kind hatch
#

Specify the type of number it is using the letters. L = Long D = Double

quiet ice
#

No, but they corrected it

#

D stands for double which are double-precision floating point numbers

eternal oxide
#

You need to get the world time, then add to to move it to midday, else you mess with teh number of days

quiet ice
#

Generally the D can be omitted as that is the default type for floating-point numbers but I still do it anyways

fickle crater
#

how do i change the level of a light block

eternal oxide
sacred mountain
#

i forgot what getDisplayName gives and i cba to test one line of code

#

does it give the whole [Rank] name [Suffix] Whatever blahablah

#

or just the name

#

of the player

kind hatch
#

It should give the whole thing. Player#getName() would just return their username.

sacred mountain
#

if a plugin modifies the player name will .getname return their real name or their modified name

#

im debating on whether to test it

kind hatch
#

You can't modify a player's username.

eternal oxide
#

getName() always returns teh players exact name

sacred mountain
#

aquacore seems to be able to

#

getName() completely changes when i disguise/nick using aqua

#

i guess its effective lol

eternal oxide
#

getDisplayName() returns whatever it has been modified to be. That usually does not include prefix/suffix. Those are added by formatting in chat

sacred mountain
#

alr

kind hatch
#

Hmm, well you could theorietically change the player name using NMS packets, but modifying the user packets are not only dangerous, but require knowledge of how the player packets work.

sacred mountain
#

yeah i'm fairly sure he's really good at that stuff

kind hatch
#

Otherwise, #getName() should just return the name of the player.

sacred mountain
#

alright thanks

#

so is there a condition where getDisplayName will return it with the ranks and prefix included?

#

because i want to avoid that

kind hatch
#

Well that's the point of getDisplayName. It lets you customize/format it how you want.

sterile token
sacred mountain
#

on a server

#

with ranks n shi

kind hatch
#

It outputs whatever the displayname was set to. Most of the time, displaynames are set by Vault since everything uses it. It should return nicknames and such, but I'm not sure if it would return rank prefixes. It'll really depend on what plugin modifies the displayname.

If you don't want any of that and just want the player name, use Player#getName()

maiden thicket
#

i think thats what player#getname returns

dapper harness
#

Why is FallingBlock.getMaterial() deprecated ?

tardy delta
#

check the docs

opal juniper
dense falcon
#

What is the enchantment Sharpness in the lib Enchantment from Bukkit???

quiet ice
#

?jd-s

undone axleBOT
dense falcon
#

Oj thanks.

quiet ice
#

(I feel like it is easier to get the enchantments via their registry key heh)

dense falcon
#
package fr.program.pranction.commands;

import fr.program.pranction.Pranction;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Player;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

import java.util.Arrays;

public class SpCMD implements CommandExecutor {
    Pranction plugin;

    public SpCMD(Pranction plugin) {
        this.plugin = plugin;
    }

    private ItemStack createItem(Material material, int quantity, String name) {
        ItemStack item = new ItemStack(material, quantity);
        ItemMeta meta = item.getItemMeta();
        meta.setDisplayName(name);
        item.setItemMeta(meta);
        return item;
    }

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
        if (command.getName().equalsIgnoreCase("sp") || command.getName().equalsIgnoreCase("sanctionplayer")) {
            if (sender instanceof Player) {
                Player plr = (Player) sender;

                Player target = Bukkit.getPlayer(args[0]);

                Inventory GUI_SP = Bukkit.createInventory(null, 54, "SP : " + target.getDisplayName());

                ItemStack head_player = createItem(Material.PLAYER_HEAD, 1, target.getDisplayName());
                ItemMeta head_player_meta = head_player.getItemMeta();
                head_player_meta.setLore(Arrays.asList(
                        ChatColor.GREEN + "Information(s) sur le joueur " + target.getDisplayName(),
                        "Reduit au silence : " + plugin.getConfig().getBoolean("players." + target.getUniqueId() + ".muted")
                ));
                head_player.setItemMeta(head_player_meta);
                GUI_SP.setItem(0, head_player);

                ItemStack triche_sword = createItem(Material.DIAMOND_SWORD, 1, "Triche");
                ItemMeta triche_sword_meta = head_player.getItemMeta();
                triche_sword_meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
                triche_sword_meta.addEnchant(Enchantment.DAMAGE_ALL, 5, false);
                triche_sword.setItemMeta(triche_sword_meta);
                GUI_SP.setItem(1, triche_sword);

                plr.openInventory(GUI_SP);
            }
        }
        return false;
    }
}

#

Btw why the enchantment is not visible?

#

I mean.

#

The "texture".

quiet ice
#

Whoever was behind the names of the fields of this class did a terrible job

#

The enchantment is there but not the glint?

dense falcon
#

@quiet ice

quiet ice
#

Probably because of the HIDE_ENCHANTS flag, but idk

misty current
#

that flag should not remove the glint

quiet ice
#

It should usually still show the glint though, which leads me to believe that the enchantment was not applied

misty current
#

check the nbt to verify the enchant is there

kind hatch
#

Enchantment glint is hardcoded to enchantments. There should be no reason for it to not be there.

misty current
#

also if you have any client side mod to stop/modify the glint

#

like lunar client mods

kind hatch
#

Or VanillaTweaks resource packs.

dense falcon
dense falcon
misty current
#

check if the noglint mod is enabled

quiet ice
#

Well, it is the only reasonable reasoning I have assuming vanilla

misty current
#

or try to launch with a vanilla client

kind hatch
#

Also, enchantments cannot be applied with ItemMeta. They get removed for some weird reason. You have to set your item meta first, then apply the enchantment to the ItemStack afterwards.

quiet ice
#

that is a bit strange

dense falcon
quiet ice
#

I have never seen that happening

tardy delta
#

people still not using a command lib 🤤

kind hatch
#

@me lmao

dense falcon
#

On the wool, it works!!!

quiet ice
#

Why would one use a cmd lib

#

It's just even more shit you cannot control but you still need to debug

tardy delta
#

makes it easier to handle commands without handling all the boilerplate code

dense falcon
#

I found the error about the sword.

quiet ice
#

Handling commands myself works (almost) flawlessly for me

quiet ice
dense falcon
#

Thanks guys.

tardy delta
#

mhm i kinda hate the fact that i would have to do all prechecks before actually handling a command

#

and parsing them manually

quiet ice
#

Ah, it was denvercoder9, but eh, close enough

kind hatch
#

Bro, that's all too real.

tardy delta
#

living in the void

#

🙏

harsh totem
#

🤨

tardy delta
#

me when i just deleted 5 classes and doing everything again

iron glade
#

Is there a way to move an object from one hashmap to another one?

#

without copying it

sterile token
#

JedisDataException: ERR Can't execute 'publish': only (P)SUBSCRIBE / (P)UNSUBSCRIBE / PING / QUIT / RESET are allowed in this context

kind hatch
#

Uhhh, no?

iron glade
#

How am I supposed to delete it then without causing a ConcurrentModificationException

kind hatch
#

Unless you know how to use pointers and can even use pointers in java, then I highly doubt it.

#

Well what's accessing it at the same time?

kind hatch
iron glade
kind hatch
#

What does #stopTroll do? Code for that method?

iron glade
kind hatch
#

I could be wrong here, but I think since you are already iterating over the map via a stream, trying to remove a player from that same map is what's causing the CME

sterile token
tardy delta
tardy delta
dense falcon
#
    public static void init(PlayerInteractEvent event, Pranction plugin) {
        Player plr = event.getPlayer();
        Action action = event.getAction();
        ItemStack item = event.getItem();

       if (item != null && item.getType() == Material.PLAYER_HEAD && item.hasItemMeta() && item.getItemMeta().hasDisplayName()) {
            NamespacedKey key = new NamespacedKey(plugin, "playerhead-key");
            ItemMeta meta = item.getItemMeta();
            PersistentDataContainer data = meta.getPersistentDataContainer();
            if (data.has(key, PersistentDataType.DOUBLE)) {
                event.setCancelled(true);
            }
        } else if (item != null && item.getType() == Material.DIAMOND_SWORD && item.hasItemMeta() && item.getItemMeta().hasDisplayName() && item.getItemMeta().getDisplayName().equalsIgnoreCase("Triche")) {
            NamespacedKey key = new NamespacedKey(plugin, "trichesword-key");
            ItemMeta meta = item.getItemMeta();
            PersistentDataContainer data = meta.getPersistentDataContainer();
            if (data.has(key, PersistentDataType.DOUBLE)) {
                event.setCancelled(true);
            }
        } else if (item != null && item.getType() == Material.PAPER && item.hasItemMeta() && item.getItemMeta().hasDisplayName() && item.getItemMeta().getDisplayName().equalsIgnoreCase("Chat")) {
            NamespacedKey key = new NamespacedKey(plugin, "paperchat-key");
            ItemMeta meta = item.getItemMeta();
            PersistentDataContainer data = meta.getPersistentDataContainer();
            if (data.has(key, PersistentDataType.DOUBLE)) {
                event.setCancelled(true);
            }
        } else if (item != null && item.getType() == Material.WHITE_WOOL && item.hasItemMeta() && item.getItemMeta().hasDisplayName() && item.getItemMeta().getDisplayName().equalsIgnoreCase("Construction")) {
            NamespacedKey key = new NamespacedKey(plugin, "construction-key");
            ItemMeta meta = item.getItemMeta();
            PersistentDataContainer data = meta.getPersistentDataContainer();
            if (data.has(key, PersistentDataType.DOUBLE)) {
                event.setCancelled(true);
            }
        }
    }
``` Why I can move my item from the GUI?
tardy delta
#

wtf

undone axleBOT
tardy delta
#

thats not even a valid listener method

#

?event-api

undone axleBOT
sterile token
#

That not event the api tho

tardy delta
#

and method names should start with a lowercase letter

sterile token
#

I think its ?learn-java momment

dense falcon
#

It does not matter -_-.

tardy delta
#

it does

dense falcon
#

Look:

tardy delta
#

and now its public static void init :/

dense falcon
eternal oxide
#

Case for names matters. When anyone looks at your code and see's a capital letter they expect that to be a Class

iron glade
dense falcon
dense falcon
kind hatch
# iron glade Yeah what?

#remove returns the removed object. So you could take that object and put in another map. Like what he did.

iron glade
#

Wouldn't I have to iterrate over all objects and do remove() on them?

#

and wouldn't that also cause a CME?

sterile token
kind hatch
#

If you wanted more than one yes.

sterile token
#

Because that it is not event spigot-api listener

eternal oxide
dense falcon
sterile token
iron glade
quiet ice
#

Just use ConcurrentHashMap

#

Best lifehack in the world

sterile token
#

Anyone else love jedis "ERR Can't execute 'publish': only (P)SUBSCRIBE / (P)UNSUBSCRIBE / PING / QUIT / RESET are allowed in this context" !!!

quiet ice
#

Concurrency is nice even outside of multi-threaded code

sterile token
eternal oxide
#

at the same time

quiet ice
#

Yeah, multiple operations at the same time

sterile token
tardy delta
#

running stuff at the same time, like multithreaded programs

dense falcon
iron glade
# eternal oxide Using an iterator will not cause a CME

So, like this?

                            LinkedHashMap<UUID, Troll> copy = new LinkedHashMap<>();

                            Iterator<UUID> it = plugin.getTrollManager().getTrolltable().keySet().iterator();
                            while(it.hasNext()) {

                                copy.put(it.next(), plugin.getTrollManager().getTrolltable().remove(it.next()));

                            }```
tardy delta
#

what are you trying to do? copying a map?

eternal oxide
quiet ice
#

ConcurrentHashMap also allows iterating over stuff while you perform removals - to some extent

iron glade
#

I called it copy although I don't want to copy, but move them xD

sterile token
eternal oxide
#

You get around a CME by using an Iterator.

quiet ice
#

No, use it.remove()

#

For the removal that is

iron glade
#

ah true

quiet ice
#

It removes the current element

tardy delta
#

why not just

Map<> newMap = new HashMap<>(oldMap);
oldMap.clear();
iron glade
#

Cause I can't create a new instance

#

I need the object as is

eternal oxide
#

also, only use it.next() once per loop. else you are skipping entries

tardy delta
#

im still wondering what you actually are doing

quiet ice
sterile token
quiet ice
#

It won't throw an exception, but still may yield funny behaviour

tardy delta
#

kotlin is very funny too

#

:)

sterile token
#

Lmao jedis hatting momment

#

It amazing it generate an exception, when it was working before

quiet ice
#

(Such as newly inserted objects not showing up in the map or recently removed objects still being shown through the iterator)

undone axleBOT
dense falcon
eternal oxide
#

do you have an api version in your plugin.yml? as it asks

tardy delta
#

put an api-version: 1.13 in your plugin.yml

dense falcon
#

Ah ok.

dense falcon
dense falcon
quiet ice
#

Blame beta 1.X bukkit for this

tardy delta
#

i guess you should cache that inventory

flint coyote
sterile token
#

My code: https://paste.md-5.net/janokeruzo.java

Exception:

[Redis] Successfully connected to 
Exception in thread "Thread-1" redis.clients.jedis.exceptions.JedisDataException: ERR Can't execute 'publish': only (P)SUBSCRIBE / (P)UNSUBSCRIBE / PING / QUIT / RESET are allowed in this context
    at redis.clients.jedis.Protocol.processError(Protocol.java:96)
    at redis.clients.jedis.Protocol.process(Protocol.java:137)
    at redis.clients.jedis.Protocol.read(Protocol.java:192)
    at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:316)
    at redis.clients.jedis.Connection.getUnflushedObjectMultiBulkReply(Connection.java:282)
    at redis.clients.jedis.JedisPubSub.process(JedisPubSub.java:135)
    at redis.clients.jedis.JedisPubSub.proceed(JedisPubSub.java:125)
    at redis.clients.jedis.Jedis.subscribe(Jedis.java:7891)
    at dev.alex.net.core.redis.Redis.lambda$open$0(Redis.java:27)
    at java.lang.Thread.run(Thread.java:748)
dense falcon
#

Ah it is the wrong event?

#

@flint coyote

#

For GUIs interaction.

flint coyote
#

For every inventory GUI you wanna use inventory click event, yes

tardy delta
#

thats not even an event

sterile token
#

Fabsi, have you seen his code? Is not even from spigot api his code

quiet ice
#

PlayerInteractEvent would be for interacting with blocks

flint coyote
#

I was also major confused but I guess he just tried to build a listener himself "around" the api

dense falcon
#

Event

quiet ice
#

He meant EventHandler

#

Your @EventHandler annot appears to be missing unless I am not fed enough information

dense falcon
tardy delta
#

i mean theres so much wrong about that code

dense falcon
#

There is nothing wrong man :>, there is no way to code a plugin huh you know?

small current
#

does InventoryPickupItemEvent get called when a player picks up an item or an entity does ?

quiet ice
#

Well it is more that you are violating many conventions set up by sun microsystems

small current
#

ok thanks

dense falcon
#

:).

sterile token
sly bay
#

Hey there, i am listening to the BlockGrowEvent and try to get the Age of the seed.
But whenever i cast BlockData to Ageable, i get the error "CraftCrops cannot be cast to class org.bukkit.entity.Ageable"
As you can see, I check what Material the block has before, so it cant be AIR or something else
My code:

    @EventHandler
    public void OnWheatGrowEvent(BlockGrowEvent event) {
        if(event.getBlock().getType().equals(Material.WHEAT)){
            if(isFullyGrown(event.getBlock())){
               ...
            }
        }
    }

    private boolean isFullyGrown(Block block) {
        Ageable ageable = (Ageable) block.getBlockData(); //error here

        return ageable.getAge() == 7;
    }
sterile token
heady pumice
#

Cant you cast it to CraftCrops which also has a getAge method?

sterile token
maiden thicket
#

sorry i mean

#

ur using thr wrong import

sly bay
#

imma look

maiden thicket
#

u need this one instead

#

ur using the wrong import

sly bay
#

how am i using the wrong import

#

ahh i see

#

lol

#

thank you

#

should i use
event.getNewState().getBlockData()
or event.getBlock().getBlockData()?

maiden thicket
#

what are u trying to check

sly bay
#

the age

#

still lol

maiden thicket
#

new state probably

sly bay
#

alright thank you

eternal oxide
#

just ((Ageable) block.getBlockData())

sly bay
sterile token
undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

heady pumice
#

Is there a way to load in-jar yml files without copying them first? 🤔

#

Rn i copy, load and delete them again, but that cant be the only way right

sterile token
sly bay
eternal oxide
#

Plugin#getResource()

heady pumice
#

Is either of that without saving them to disk?

#

I just want the info, for default values. Not indending on copying the file

kind hatch
#

Well #saveResource writes to disk.

eternal oxide
#

getResource() reads it as a stream

heady pumice
#

Ill try that, thanks

harsh totem
#

how do I check if a villager has a bed?

vale ember
#

if i have a class which has static builder() method that returns A, and than i have another class which extends the first and it also has static builder() method which returns B, why would they clash?

ivory sleet
#

does B derive A?

vale ember
#

no

iron glade
vale ember
#

well, i know about method overloading, but why the hell does it apply to static methods?

quiet ice
#

Likely because of how invokestatic works

misty current
#

hey, i'm making player statistics and I wanted to store them in a Map<Statistic, T> where Statistic is an enum constant and T the statistic value, that could be an integer, a string and so on. Is there a way i can do it with generics so I don't have to make the value an Object and cast?

quiet ice
#

If I am right it also searches in subclasses for the static method

vale ember
#

how can i solve the problem then? i really want to have the builder method to be consistent with other builders

harsh totem
ivory sleet
#

Make B derive A perhaps?

iron glade
misty current
ivory sleet
misty current
#

how do gamerules work? I saw something similar to what i need there

quiet ice
#

Yeah, sadly the JEP that allowed for generics in enums failed to go through

#

So this is not possible

ivory sleet
#

Oh they still cast, but their facade abstracts it away

misty current
#

ah i see

ivory sleet
#

They have type aware keys (iirc)

harsh totem
vale ember
misty current
#

well i guess i can blind cast too, not like i'll ever go poke in the database and change the type of stuff

crimson terrace
#

is it possible to listen to custom events from a dependency you set for your plugin?

ivory sleet
#

Myeah, well they just throw some assertive exception if an unexpected type is encountered

crimson terrace
#

good 🙂

misty current
#

yea that works, when i retrieve data i'll just listen for that and do something so the data isn't lost incase it ever happens

#

i can put the class the statistic is supposed to be cast to in the enum constant and make casts with that

#

can you cast if you have a class object?

ivory sleet
#

Uh wym?

misty current
#

let's say i have an Object o and i want to cast it to an Integer and I have Integer.class

ivory sleet
#

Oh yes

misty current
#

oh ye just found it

ivory sleet
#

Class::isInstance and Class::cast

misty current
#

aight thanks

ivory sleet
#

Altho for primitive types, check if the object is an instance of the boxed type and then convert using the specific methods like intValue() etc

misty current
#

so methods like Integer#parseInt() and so on

ivory sleet
#

Oh if you parse from an input sure Ig

#

I was just saying don’t do:

var isPrimeInt = int.class.isInstance(obj)
if(!isPrimeInt)return
var asPrimeInt = int.class.cast(obj)

#

Instead use Integer.class and convert with intValue, Boolean.class and convert with booleanValue etc

misty current
#

aight got it

#

cheers

ivory sleet
sterile token
ivory sleet
#

Yeah

#

Probably due to a bad read

sterile token
#

really

ivory sleet
#

But send the stack trace + code Ig

sterile token
#

Im burning my brains

ivory sleet
#

Lol

#

That’s not good

ivory sleet
#

You use the pool wrongly

crimson terrace
#

are there any problems when mass cancelling spawn events?

ivory sleet
#

Depends on what you define as a problem, but its usually not a great idea

harsh totem
#

Why when I do this when I have bad omen X I don't get the effect that's in the if statement?

        PotionEffect effect = new PotionEffect(PotionEffectType.BAD_OMEN, 120000, 4);
        player.addPotionEffect(effect);
        Bukkit.getScheduler().runTaskLater(plugin, () -> player.removePotionEffect(PotionEffectType.BAD_OMEN), 2L);
        if (potionEffect != null){
            player.addPotionEffect(potionEffect);
        }```
ivory sleet
#

Dont higher amplified effects override lower?

harsh totem
ivory sleet
# crimson terrace are there any problems when mass cancelling spawn events?

Assume you are a tree planter, your job is to plant 50 plants and make sure they grow, that will consume energy. Now let’s say I come here and yeet those plants as soon as you plant them, now you will run around constantly plant new plants while I will be constantly yeeting them. It becomes an unnecessary fight ergo unnecessary energy/resource consumption.

crimson terrace
#

so it will continue to try and reach a certain limit of mob spawns and when I cancel the event it will retry

crimson terrace
#

got it, thanks

ivory sleet
#

It’s a best practice

#

Having utility non static is considered an anti pattern

crimson terrace
#

no, people call what I do static abuse

ivory sleet
#

Nah but people often mistake utility methods for clumsy static methods and helper methods

ivory sleet
sterile token
ivory sleet
#

Use the pool correctly

sterile token
#

Hmn

ivory sleet
#

try-with-resources when using JedisPool::getResource

sterile token
#

How ould be corrected?

sterile token
ivory sleet
#

Wym?

sterile token
#

Ho to fix it

#

I dont understand

#

U didnt explain me

ivory sleet
#

try (Jedis jedis = pool.getResource()){
jedis.blah()
}

misty current
#

for the statistic thing i said above, do I have to create a class that looks something like this

public class PlayerStatistic<T> {

    private final Class<T> clazz;

    public PlayerStatistic(Class<T> clazz) {
        this.clazz = clazz;
    }

    public Class<T> getValueType() {
        return clazz;
    }
}

and then create another class with all the constants? example:

public class PlayerStatistics {

    public static final PlayerStatistic<Integer> XP = new PlayerStatistic<>(Integer.class);
    public static final PlayerStatistic<Integer> LEVEL = new PlayerStatistic<>(Integer.class);
}

or is there an easier way?

sterile token
#

YE

sterile token
ivory sleet
#

Literally does

sterile token
#

Im still getting the ex

misty current
#
    public <T> T getStatistic(PlayerStatistic<T> statistic) {
        return statistic.getValueType().cast(statisticsMap.get(statistic));
    }
``` so i can have a method like this
ivory sleet
#

Of course you have to consume the resources in a correct way

sterile token
#

Look code please

#

I have alredy use try

#

I have added to my code and doesnt ork tho

ivory sleet
sterile token
#

But happen the same exception

#

I also read because im pubkishing and reading the same time

#

Could be that?

ivory sleet
#

Idk might be also

sterile token
#

P

#

Hmn

#

Strange

ivory sleet
#

Anyway when you subscribe on a Jedis instance it’s gonna block

#

So iirc you cant publish

#

Hence why you should be using the pool correctly

sterile token
#

But what means correctly

#

I dont undertand your "correctly" meaning

ivory sleet
#

You use getResource for every new command

#

one for publish, one for subscribe

#

And you enclose it in a try-with-resources to lend the resource back once used

sterile token
#

Mnnn a library on github work perfect with 1 pool

dense falcon
#

How can I get the CPS of a player?

untold jewel
sterile token
ivory sleet
#

It’s the damn resources in the pool

#

Not the pool itself

untold jewel
#

If someone could help me cause I dont know what I did wrong

dense falcon
ivory sleet
#

Altho yes the pool by default is badly configured

sterile token
#

I thought that redis was NIO

ivory sleet
#

If you use the pool lol

#

You just keep one instance around

#

That’s not what using the pool is

#

And no it’s not really nio

sterile token
#

I dont understand the pool meaning so

ivory sleet
#

It’s more able to be used in a multi threaded environment

#

google the pool design pattern then

sterile token
#

Lmao i will endupt doing my own NIO

#

Because redis looks shity

ivory sleet
#

?

sterile token
#

It doesnt work as i expect

ivory sleet
#

No, you don’t know how to use the library

sterile token
#

A good redis would be a NIO allowing to publish and subscribe at the same time

ivory sleet
#

No

#

Redis doesn’t work like that

untold jewel
#

Dont really know what that means.. Could you be more specific?

#

If you wouldnt mind

ivory sleet
#

Once you have a connection registered with a subscriber it can’t do much else iirc

sterile token
ivory sleet
#

So you need another connection if you wanna publish

#

Hence why being able to use the pool correctly is a prerequisite

sterile token
ivory sleet
#

What

sterile token
#

Ho reade works

untold jewel
sterile token
#

A good one, will be able to publish/subscribe using the same connection

ivory sleet
#

Idk

sterile token
ivory sleet
#

Redis didn’t do it that way

#

Yes but you can achieve nio if you use the library correctly

sterile token
#

But how

#

I dont understand you

#

orry if sound im trolling, but really i dont undertand

ivory sleet
#

Literally

#

try (Jedis jedis = pool.getResource()){
jedis.subscribe(blah);
}

try (Jedis jedis = pool.getResource()){
jedis.publish(blah);
}

atomic niche
#

YAML Error.

ivory sleet
#
  1. The design pattern, object pool
  2. It says this in their documentation
ivory sleet
#

If you would have read the documentation you would have found an example of how to use it correctly

sterile token
#

Ohh ok

#

I catch it

#

I need one Jedis jedis for publishing, and another for subscribing?

ivory sleet
#

Myes altho I suggest using the pool rather than caching 2 instances

#

Sure they’re made to be long lived

#

But the pool can achieve some internal optimizations

sterile token
#

what it a pool?

ivory sleet
#

JedisPool

sterile token
#

Maybe i dont understand that so then i dont understand anything

ivory sleet
#

A pool manages several expensive objects, might reuse them if necessary

#

Just google what it is

sterile token
#

Ahh that why i cannot publish and subscribe with same shit

#

I cannot open google

#

Literally doesnt update

ivory sleet
#

Use firefox

#

Or whatever browser you got

atomic niche
#

and/or a different search engine?

sterile token
#

And i dont have another browser

#

If no browser i cannot install another

atomic niche
#

...

#

what os?

sterile token
#

win 10+ linux

misty current
#

edge

manic ice
misty current
#

microsoft edge

sterile token
#

I dont have any else, because it not either windows nor linux

#

It a mix of the two together

manic ice
#

??

atomic niche
#

... what distro?

sterile token
#

I dont know the name, i think its arch

#

Because i can install things as linux and windows

ivory sleet
manic ice
#

I think arch comes with wget bundled

ivory sleet
#

I would have several static factory methods for the primitive types tho

#

Just to make life a bit easier

sterile token
#

Finally google opened

ivory sleet
#

🙌

sterile token
#

Conclure

ivory sleet
#

Yes

misty current
sterile token
#

Also why is blocking the resource, if im subscribing in another thread

ivory sleet
#

Jedis poop design

sterile token
#

Oh that why

ivory sleet
#

Lettuce got it differently

#

One async view and a sync view, so you can choose if it should block or not (current thread)

sterile token
#

I would use Lettuce but the listener oblise me to inherit all methods

#

I dont like that, having innecessary things

ivory sleet
#

That’s a subtle reason to stay with the inferior alternative

sterile token
#

Conclure if using lettuce in async() i cann publish and subscribe at same momment right?

ivory sleet
#

Well, you would have to use 2 connections

#

But afaik yes

sterile token
#

Why 2 connection???

#

I dont like that

#

If connection are bi-directional

ivory sleet
#

Yeah idk why they chose it that way

sterile token
#

So they must be able to send and receive

#

f** libraries design

ivory sleet
#

No it’s redis

sterile token
#

?not-working

ivory sleet
#

It’s not the libraries’ fault

sterile token
#

The redis design?

ivory sleet
#

Yes

sterile token
#

OHH Ok

#

Now i understand

ivory sleet
#

Yeah a bit clumsy perhaps but that’s how they do it, I believe they had a pretty solid reason as to why but I don’t remember it by heart

sterile token
#

Im still trying to jump into spigot netty instance, but the spigot-jar is so amazing that doesnt have a getter for it

ivory sleet
#

Reflection :3

#

(Or method handles)

sterile token
#

Which class?

ivory sleet
#

Uh let me look that up for you once I get home

sterile token
#

I need to jump specially into the Boostrap

#

Because i want to register a cutom channel handler

#

So as far spigot works on their channels, i do my stuff in another channel

#

And sorry for taking your time

ivory sleet
#

No worries I’m not really doing anything rn

atomic niche
#

What's the best way to detecting when/where another plugin deletes a chunk? ChunkPopulateEvent?

tardy delta
#

chunkunload?

#

dunno how you would delete a chunk tho

slim magnet
#

Hey, whats the ebst way to create per player entities like armorstands

sterile token
atomic niche
#

What exactly does worldedit do?
//delchunks is a lot faster than simply deleting all the blocks in the area

#

Actually, probably best just to dig into their repo for that answer

slim magnet
tardy delta
#

isnt it just removing the blocks?

atomic niche
#

I think its doing something else

sterile token
atomic niche
#

possibly targeting a region file or something

tardy delta
#

checks its impl then

slim magnet
sterile token
#

But what you want to do?

#

I dont catch it

#

Sounds like doing custom entity or npc

slim magnet
#

just an armorstand that a specific player can see

sterile token
#

ohh ok

atomic niche
tardy delta
#

i guess just load the old world instead of the new one from time to time

#

so different world files

tardy delta
#

idk how to code it but probably messing around with world creators idk

crimson terrace
#

I am trying to get mobs to stay within a certain bounding box or area
I have tried CraftCreature#getHandle#getNavigation#moveTo whenever they move out of the bounding box and gave it the center of said bounding box. its not giving me any errors and its not making them stay inside tho...

vast raven
#

Is there a way to check if a player has his own inventory opened? I thought that if (!(event.getPlayer().getOpenInventory() instanceof PlayerInventory)) would be good, but as I understood, if you don't have any kinda of inventory opened, the method getOpenInventory() returns the player's inventory anyway.

waxen plinth
#

The client no longer informs the server when opening or closing their own inventory

#

Only for inventories not attached to the player

vast raven
waxen plinth
#

Don't think so

vast raven
#

Well, thanks btw.

eternal oxide
#

you get Click and Drag events but no open

vast raven
eternal oxide
#

Yep, it has no Clue if its just the Player Inventory

#

It doesn't really need to know. It only has to action something if a change is made

#

an additional world to the 3 main ones, or one of the mains?

#

random seed, or reset back to the same world every time?

#

then unload the world, delete its files and createWorld

#

?paste

undone axleBOT
eternal oxide
#

you just have to create the world if its successful

#

file locks

#

it keeps trying for 50 seconds to delete teh world

#

you can reduce that

#

but it's to allow everything to release any locks it has on any files

#

after line 16 you'd create your world again, or call a method in your plugin to do it

#

just be sure to not allow your plugin to attempt any access of the mining world while its being deleted

signal kettle
#

Hello, I wanted to create EventHandler that will make smth like this:
After right click with item in mainhand on the block Sand then change this block on to another one.
The problem is that i want to use oraxen(custom items/blocks plugin) item for this and to create that in code i need to create firstly item stack and how i can check if player have this item in main hand?

#
public class Archaeology implements Listener {

    @EventHandler
    public void SandBrushing1(PlayerInteractEvent event) {
        Player player = event.getPlayer();
        Block block = event.getClickedBlock();
        ItemStack pedzel = OraxenItems.getItemById("pedzel_archeologiczny").build();

        if (event.getAction() != Action.RIGHT_CLICK_BLOCK || block.getType() != Material.SAND) return;
        if (player.getInventory().getItemInMainHand().getType() == Material.SHEARS) {
            BlockMechanicFactory.setBlockModel(block, "blok_srebra");

        }
    }
tardy delta
#

you should do your early returns first

#

Player#getItemInMainHand

eternal oxide
limber owl
#

essentialsx depends in plugin.yml? the name?

tardy delta
#

i thought it was just Essentials

#

or are essentials and essentialsx two different things?

limber owl
#

i didd it with x smh

tardy delta
#

you might just want to look in their plugin.yml in the sourcecode lol

limber owl
tardy delta
rain echo
#

Hi! Can somebody help me with a question?

limber owl
#

thanks

limber owl
eternal oxide
#

?paste your code

undone axleBOT
tardy delta
undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

tender shard
rain echo
tardy delta
#

yes

tender shard
#

you have to wait a bit until the files were saved

eternal oxide
#

yeah, thats not going to work

rain echo
#

everything works fine until somebody opens the menu too

rain echo
#

like... not the same inventory

eternal oxide
#

yes, your code is very different to mine. you are not waiting for the world to unload

tardy delta
#

i forgot but i guess you have to create a new one

rain echo
kind hatch
# rain echo and its not the same

How are you calling ItemsMenu? Because if you make a createInventory call in the constructor, then create a new instance of ItemsMenu, the inventory will be different.

rain echo
tardy delta
#

?scheduling

undone axleBOT
eternal oxide
#

you are just testing the world != null

eternal oxide
#

You are not waiting at all for the world to unload before you try to delete it

rain echo
#

but i dont understand how to create only one inventory

#

without static

tender shard
kind hatch
rain echo
eternal oxide
tender shard
# rain echo public **static** void

I have heard of this keyword before. I wonder why you are trying to avoid if the goal you want to achieve is basically ideal to make the field static

median trench
#

Is EntityDamageEvent called whenever EntityDamageByEntityEvent is called (not programatically)?

tardy delta
#

yes iirc

tender shard
tall dragon
subtle folio
#

makes main method final 🤓

tender shard
rain echo
#

i'm sorry, i was wrong, the thing is even if the inventory is static, this method

    public Inventory getInventory() {
        return itemsMenuGui;
    }

will not be static, i mean i will have to create an instance anyway

#

sorry for my bad english

median trench
tender shard
median trench
#

You could add a public static "Class" getInstance() { return instance; }

#

if that's what you ask

tender shard
#

just make "itemsMenuGui" static and that's it. and create the inventory directly in the field declaration, and get rid of the constructor

rain echo
#

like this?

        return itemsMenuGui;
    }
tender shard
#

no

rain echo
#

im stupid then

#

oh

#

i didnt saw that

tender shard
#
private static final INventory itemsMenuGui = Bukkit.createInventory(...);

@Override
public Inventory getInventory() { return itemsMenuGui; }
lost matrix
#

Uh oh... static is not the cleanest way to solve this. ngl.

quaint mantle
#

well if its only one instance of the gui dont see why not

median trench
#

I really don't understand the point of the question

#

You're going to need the constructor anyways

rain echo
tender shard
tardy delta
#

if two people are opening the same inventory, they can move eachothers stuff or am i wrong?

#

like trading gui

rain echo
#

yep

median trench
#

Oh, so that's why

#

You could however do it without static

rain echo
#

well... do u mind telling me how? 🥺

median trench
#
ItemsMenu menu = new ItemsMenu();

player.whatever(menu.getInventory());
player2.whatever(menu.getInventory());

Am I wrong?

tardy delta
#

from my experience; both players will be able to move stuff

#

if ItemsMenu#getInv is returning the same inv

rain echo
median trench
tender shard
#

instead of recreating it everytime

lost matrix
# quaint mantle well if its only one instance of the gui dont see why not

Because static objects are something thats more procedural then object oriented. Another problem is code Implicity -> You wont know when a static variable is instantiated and whether or not it will be instantiated before another static variable. They are instantiated when the classloader "touches" the class for the first time. And this could happen before bukkit is initialized, leading to a nasty classloader excepion that is really hard to debug.

tender shard
#

but their inventory never accesses anything from outside

lost matrix
#

Bukkit.createInventory(...) might throw an exception if its being called
too early.

#

Imagine if another plugin would do classpath scanning early on for Guice or something similar. Then the class might be initialized before bukkit is done loading properly.

tender shard
humble tulip
#

How woukd your class load before bukkit?

median trench
humble tulip
#

Oh nvm

tardy delta
#

cuz the classloader loads your class earlier?

lost matrix
rain echo
#

but how to do it without static?

tender shard
#

but how? when I start spigot.jar then spigot decides what classes get loaded when. even when setting to load: STARTUP and creating the inventory in the static { } block it works. how would it ever get loaded even earlier?

tender shard
rain echo
#

also i need exactly the same inventory for events

tender shard
#

and then simply use that field instead of recreating your inventoryholder everytime

rain echo
#

ok ok

buoyant viper
#

wondering myself now how a plugin could possibly get loaded before bukkit when its bukkit that loads the plugin

rain echo
#

let me try

median trench
lost matrix
tender shard
lost matrix
#

Then why not use a code style that will always work instead of only sometimes?

tender shard
#

and just because something else might not work doesn't mean I shouldnt do this

median trench
#

But it's a bad practice

tender shard
#

it's bad practice to initialize a static field somewhere?

median trench
#

And it's also resource expensive

tender shard
#

lol

#

alright so why do we have static fields then

lost matrix
#

constants for example. We also have strictfp which is pretty much useless.

tender shard
median trench
#

leading to, in some cases, memory leaks

#

it's also more difficult to debug when using static methods

waxen plinth
#

.-.

tender shard
waxen plinth
#

That is such a weak argument against static

#

What are you using statics for, alex?

tender shard
#

I am not

waxen plinth
#

Well what's the use case in question then

tender shard
#

someone else was doing something with inventories

#

and they needed the exact same inventory all the time

waxen plinth
#

If it is literally always going to be the same

tender shard
#

I told them to store it in a field but I also saw nothing wrong in making it static on their inventoryholder object

dire sand
#

Hello

waxen plinth
#

Having it be static isn't really an issue

dire sand
#

How can I apply vine to a Block?

lost matrix
eternal night
#

question still is when that inventory is initialized

waxen plinth
eternal night
#

with static, that is a little out of your control

#

or well

dire sand
waxen plinth
#

And make it set in the correct direction

eternal night
#

not obviously in your control

dire sand
#

I have the direction

waxen plinth
dire sand
#

Oh darn

median trench
waxen plinth
#

They're not metadata on a block

tender shard
waxen plinth
#

They're another block adjacent to it

dire sand
#

I see

eternal night
#

oh

waxen plinth
#

But if you want to apply vine and you have the block and direction

eternal night
#

that is neat then

waxen plinth
#

It should be something like this

dire sand
#

So I need the blocks to be in front

tender shard
#

scoreboards won't work that early though

dire sand
#

Yeah

#

That'd be great

tender shard
#

anyway some people hate "static" stuff for no reason, all the time. sure it's not always appropriate to use, but saying it's bad per se is stupid. anyway I'll continue my citrus fruit production in anno now

#

to whom?

waxen plinth
#
Block block;
BlockFace face; // Assume these are populated
Block vineBlock = block.getRelative(face);
BlockData vine = Material.VINE.createBlockData();
((Directional) vine).setFacing(face);
vineBlock.setBlockData(vine);```
#

This should work

lost matrix
tender shard
signal kettle
#

Okay anyone will make it for me? I need that block after right click with an oraxen item in hand will change on to another block.
Ofc i'll pay for it, because im too tired today of trying.
If someone is interesting then dm me

tender shard
#

your world is only brewing up to 85%? Yeah I would be upset too. I think you wanna ask in #help-server instead?

undone axleBOT
tender shard
#

so how are you brewing your world?

median trench
# tender shard anyway some people hate "static" stuff for no reason, all the time. sure it's no...

It's not bad to use, it's a bad practice to create a singleton program when you can avoid it. It's a bad practice to use static for everything.
Yes, you can use static to create an inventory that it will be always used, but why using static when you can just use an object
You should know when and why to use static, again, for this inventory problem it's not bad at all, but I've seen horrible codes because of the use of static for everything. Did I explain well?

lost matrix
tender shard
signal kettle
# tender shard ?services

i can't finde any that will be online for now and i can't post on spigot in forum because i'll not post 20 posts

tender shard
#

and that's exactly what it's for

tender shard
signal kettle
#

okay thanks for advice

dire sand
#

rip

#

any adjustments I can make

lost matrix
#

Do you use a custom chunk generator?

dire sand
#

What would be the equivalent of BlockData?

waxen plinth
#

MaterialData

median trench
waxen plinth
#

I mean

#

If the inventory is always the same, it is literally a constant

tender shard
#

yeah my point totally is "lets overuse static" lmao

#

I think you should learn to read a bit better

#

have a nice day 🙂

median trench
#

lol

waxen plinth
#

To be fair you could dependency inject it

dire sand
#

Since MaterialData has no create material data

#

Should I just appl yit?

waxen plinth
#

But unless the project is very large, dependency injecting it wouldn't make a difference

#

Step 1. generate random coordinates

dire sand
#

vineBlock.setType(Material.VINE);

tender shard
# waxen plinth To be fair you could dependency inject it

our last "conversation" topic was that static is for class members and that non-static is for instance members. i don't know how this obviously true statement (because that's how the JLS specifies what "static" is), leads him to the conclusion that I love to overuse this keyword.

waxen plinth
#

Step 2. teleport the player to them

#

World#getHighestBlockYAt(x, z)

median trench
tender shard
#

I don't think I was rude

lost matrix
#

Just a random number for x and z

#

Between -x +x and -z +z

waxen plinth
#

Choose one

dire sand
#
            b.setType(Material.COBBLESTONE);
            Block vineBlock;

            if (facing == BlockFace.NORTH) {
                vineBlock = b.getRelative(BlockFace.SOUTH);
            } else if (facing == BlockFace.SOUTH) {
                vineBlock = b.getRelative(BlockFace.NORTH);
            } else if (facing == BlockFace.EAST) {
                vineBlock = b.getRelative(BlockFace.WEST);
            } else {
                vineBlock = b.getRelative(BlockFace.EAST);
            }

            vineBlock.setType(Material.VINE);
            vines.add(vineBlock);
#

What would be wrong w/ my vine block?

waxen plinth
#

500k? 10k? 30 million? doesn't matter that much

waxen plinth
#

And what is vines

tender shard
dire sand
waxen plinth
#

For real

dusk flicker
#

what version are you running

waxen plinth
#

You do

tender shard
dire sand
#

1.11.2

dusk flicker
#

tf

tender shard
#

then you have it

lost matrix
#

I wouldnt attempt to generate one outside of the ~30 million. Anything below should be fine

waxen plinth
#

Why would you use 1.11

dire sand
#

I just checked

dusk flicker
#

better question, why the fuck are you running 1.11.2

tender shard
#

BlockFace.SOUTH.getOppositeFace

dire sand
#

oh

#

ok

#

i see

waxen plinth
#

And BlockFace#getOppositeFace exists in that version too

dire sand
#

Now that I have the opposite face though

#

How can I get my vine block to appear?

dusk flicker
#

Im still wondering why you are running 1.11.2

tender shard
dusk flicker
#

like I expected 1.8

dire sand
#

we keep it lit

dusk flicker
#

you keep it weird

dire sand
#

lol

dusk flicker
#

whats the actual reason tho

tender shard
#

1.8 is at least understandable because some people get confused by differentiating left and right so they prefer having only one hand

dire sand
#

some old libs

#

i just have been lazy to update

#

i'll proll ydo it tonight

dusk flicker
#

I would expect 1.8.8, 1.12.2, and newer

#

never expected to see 1.11

dire sand
#

what's so nice about 1.12.2 btw?

#

but also any idea baout hte vines too

tender shard
#

I mean some people are even using 1.15.2 or 1.16.3 like wtf

dusk flicker
#

its the step before the new api change, so from what I know people think its the best performing later ver

hybrid spoke
dusk flicker
#

1.11 isnt even on there lol

lost matrix
#

Oh 1.8 stepped down from 7.8% to 7% since the last time i checked. How delightful to see.

dusk flicker
#

who the fuck is running a minecraft server with 96 cores

tender shard
#

shared hosters

dusk flicker
#

probably ltt

dire sand
#

^

tender shard
#

for example shitty hosters running openvz

dusk flicker
#

that makes sense

tender shard
#

I mean many epycs have 48 cores, so with hyperthreading itll be 96

dire sand
#

what method should I use to change the BLock to having a vine on it?

lost matrix
#

I can imagine that the "free" hosts run like 4 docker containers per core on an EPYC. So one CPU and ~400 servers.

dusk flicker
#

i wish we could see a difference from these graphs to like 3-5 years ago

tender shard
tender shard
#

because if you use setType, there should be a vine. unless it immediately drops again because it "can't go there" for some reason

#

e.g. because it's mid air

lost matrix
dusk flicker
#

yeah

#

its nice to see it really declining finally

dire sand
#

ya

#
        for (Block b : blocks) {
            b.setType(Material.COBBLESTONE);
            Block vineBlock = b.getRelative(facing.getOppositeFace());
            vineBlock.setType(Material.VINE);
            vines.add(vineBlock);
        }
dusk flicker
#

why set it to cobble

dire sand
#

So blocks contains the block I want to apply the vine to

dusk flicker
#

oh i see

dire sand
#

i'm building

#

ya

#

lemme print pos of the vineblock

#

ok

#

all the locations check out

#

so ig the vineblock.setype isn't working

lost matrix
#

Show the whole code pls

eternal oxide
#

try setType(type, false)

dire sand
#

that is all code

#

other part before is just doing a loop throuhg

#

and grabbing blocks

#

to apply wall to

lost matrix
#

whats "blocks", "vines", "facing" and how are they used?
Thats far from everything

tender shard
dire sand
#

thank you

dusk flicker
#

drag it up there?

#

oh im thinking of something else

#

not sure\

flint coyote
#

bossbar?

#

oh in intellij xD

lost matrix
#

No. It doesnt matter. But your server will have to handle a lot of chunk generation.
What is your overall goal? Because i might have some suggestions.

tender shard
#

do you actually mean gitHUB

dusk flicker
#

fun fact there is an edit button so you dont need to spam the channel

tender shard
#

or just git

dusk flicker
#

you're running a third party git plugin when the ide comes with one?...

tender shard
#

? why would that have it's own toolbar

flint coyote
dusk flicker
#

no

tender shard
dusk flicker
#

just spamming is annoying

flint coyote
#

I see, true

dusk flicker
#

A few messages I dont care, but when you are getting like 5+ it can be annoying

tender shard
#

As I said, that doesn't have its own tool window. It would be pointless anyway. You just use the normal git tool window

#

View -> Tool Windows -> Git

#

or Alt + 9

lost matrix
#

I would recommend to pregenerate a 10k x 10k world every month or a 3k x 3k every week.
That should be more than enough. Pregenerating prevents constant chunk generating when players scavenge the world.

#

Use a pregen plugin

tender shard
#

let me guess. you haven't even created a .git repo yet

tender shard
lost matrix
#

I would recommend mine but it doesnt have an api and im also too lazy to add one.

tender shard
#

the "github plugin you installed" is the builtin default github integration by jetbrains

dusk flicker
#

no

#

be patient

#

?ask

undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

tender shard
#

send a screenshot of your whole intellij window

dusk flicker
#

iirc its default on the left

tender shard
#

do you have a vcs.xml file in the .idea folder in the project?

#

this file?

dusk flicker
#

can you sometime in the future verify so we dont have to keep clicking these links

tender shard
#

yeah prntsc is the worst screenshot site

dusk flicker
flint coyote
#

just win+shift+s and ctrl+v

tender shard
#

at the bottom, go to Terminal, make sure you're in the root folder of your project, then enter "dir -Force". does it show any .git folder now?

dusk flicker
#

I like ShareX where I can just click print screen lol

tender shard
#

it should look like this:

lost matrix
#

PS: If you use FastChunkPregenerator then you can set the world border and generate a world like this:

  public void fullRender(final World world, final int radius) {
    final FastChunkPregenerator plugin = JavaPlugin.getPlugin(FastChunkPregenerator.class);
    final GeneratorManager manager = plugin.getGeneratorManager();
    final Chunk mid = world.getSpawnLocation().getChunk();
    final int midX = mid.getX();
    final int midZ = mid.getZ();
    world.getWorldBorder().setCenter(world.getSpawnLocation());
    world.getWorldBorder().setSize(radius * 2);
    manager.start(world, midX, midZ, radius);
  }
dusk flicker
#

I didnt know you made that 7smile7

lost matrix
#

Ive made it in two nights. Every semester break i have a motivation boost and write a plugin which i regret later because i feel the pressure of maintaining them 😓

waxen plinth
#

I have a project that I'm just doing a small piece of every day

#

Sometimes it's a class, sometimes just one method, sometimes just a few lines of a method

#

Problem is that it's a massive project

upper tendon
#

If I did new Location(x,y,z).getBlock() and the block at that x, y, and z was air, would it return null? nvm

#

Huge

#

Is there a way to set one's spawnpoint? like just a /spawnpoint command?

upper tendon
#

How?

#

I see a .setBenSpawnLocation, but what if they dont have a bed

#

ah ok

#

thanks

quiet garden
#

So I switched maven shade plugin to 3.3.0-SNAPSHOT and it seems to be causing config errors: Cannot load configuration from stream org.bukkit.configuration.InvalidConfigurationException: unacceptable code point '' (0x0) special characters are not allowed when i switch back to 3.2.4 the error disappears

lost matrix
#

Also: Weird bug

quiet garden
quiet garden
lost matrix
#

Why java 8?

quiet garden
#

for the plugin to support 1.8+

lost matrix
#

Then whats the reson to use 3.3.0-SNAPSHOT in the first place?

quiet garden
dusk flicker
#

why not use PDCs

#

?pdc

quiet garden
#

1.14

dusk flicker
#

they were introduced in 1.13

quiet garden
dusk flicker
#

oh

lost matrix
#

Drop support for ancient versions then.. lol

#

1.8 support was dropped ages ago

quiet garden
lost matrix
#

big oof

#

Whats your native version then?

quiet garden
#

1.18

#

act 1.17

lost matrix
#

Backwards support is horrible. Future support is more reasonable.
So if you want to write 1.8+ plugins then your native version should be 1.8

quiet garden
#

well it supports things such as custom model data/itemsadder

lost matrix
#

That being said: I would drop everything below 1.13
Even below 1.16 for that matter.

#

80% of the playerbase is on 1.16+ anyways

quiet garden
#

i mean 1.8 is still relitivelly high

dusk flicker
#

7%

river oracle
#

dropping everything before 1.17.1 is fine actually

dusk flicker
#

not really

lost matrix
#

1.8 is dying out < 3

buoyant viper
#

muh combat!!!!11

dusk flicker
#

63% is on 1.18 or above

river oracle
#

well your looking for the ease of it on your part 1.8 support is usually a pain in the ass it makes sense to pump out more plugins than spend the time you could make another plugin

buoyant viper
#

rip whatever sad souls are still using 1.7.10

dusk flicker
#

people do use 1.7.10

buoyant viper
eternal night
#

the 1.18.1 kids worry me more

dusk flicker
#

what a random question

river oracle
eternal night
#

Yea idk what exploits they want

#

but just wild

river oracle
#

I like to keep up to date and find new exploits its no fun to use the same old ones

quiet garden
#

well i can support 1.8 but like that wasn't the point of this at all so-