#help-development

1 messages · Page 535 of 1

eternal oxide
#

night

slim wigeon
#

I hope you programmed this

slim wigeon
#

How do I get values from a list using YamlConfiguration?

echo basalt
#

my favorite part is the memory leaks

lucid gazelle
#

How would i go about creating the particles in the video? like making them go up and down and up again?

public static List<Location> getHollowCube(final Location corner1, final Location corner2) {
        final List<Location> result = new ArrayList<Location>();
        final World world = corner1.getWorld();
        final double minX = Math.min(corner1.getX(), corner2.getX());
        final double minY = Math.min(corner1.getY(), corner2.getY());
        final double minZ = Math.min(corner1.getZ(), corner2.getZ());
        final double maxX = Math.max(corner1.getX(), corner2.getX());
        final double maxZ = Math.max(corner1.getZ(), corner2.getZ());
        for (double x = minX; x <= maxX; x += 0.1) {
            result.add(new Location(world, x, minY, minZ));
            result.add(new Location(world, x, minY, maxZ));
        }
        for (double z = minZ; z <= maxZ; z += 0.1) {
            result.add(new Location(world, minX, minY, z));
            result.add(new Location(world, maxX, minY, z));
        }
        return result;
    }```

```java
for (final Location location : GenUtils.getHollowCube(genBlock.getLocation().clone().add(-0.1, 0, -0.1), genBlock.getLocation().clone().add(1.1, 1.1, 1.1))) {
                genBlock.getWorld().spawnParticle(Particle.REDSTONE, location, 2, (Object) new Particle.DustOptions(Color.PURPLE, 1.0f));
            }
            for (final Location location : GenUtils.getHollowCube(genBlock.getLocation().clone().add(-0.1, 1, -0.1), genBlock.getLocation().clone().add(1.1, 1.1 + 1, 1.1))) {
                genBlock.getWorld().spawnParticle(Particle.REDSTONE, location, 2, (Object) new Particle.DustOptions(Color.PURPLE, 1.0f));
            }```

https://media.discordapp.net/attachments/1103643978194231326/1103777982423781567/gen_upgrgadgess_4.mp4
echo basalt
#

that just seems like uhh

#

Here let's start with the basics

slim wigeon
# chrome beacon getList?

I tried this, filter GUI blank for(String material : this.data.getStringList(section+".Filters.WhiteList")) { hopper.getWhiteList().add(Material.getMaterial(material)); } for(String material : this.data.getStringList(section+".Filters.BlackList")) { hopper.getBlackList().add(Material.getMaterial(material)); } for(String material : this.data.getStringList(section+".Filters.VoidList")) { hopper.getVoidList().add(Material.getMaterial(material)); }

echo basalt
sour folio
#
    public void gui(InventoryClickEvent e, InventoryView r) {
        if(r.getItem(0).getItemMeta().getDisplayName().equalsIgnoreCase("test")) {
            e.setCancelled(true);
        }

    }``` How would I get this code to work?
echo basalt
#

Over the frames, the animation just seems to play with the Y levels a bit so we can do some funky stuff

#

Let's say the animation is 50 ticks long and consists of going down and back up

#

That's 25 ticks going down, 25 ticks going up

chrome beacon
echo basalt
#

Those 25 ticks travel 0.5 blocks down so you can calculate the increment per tick

#

Something like

chrome beacon
echo basalt
#

Just looking at the video

lucid gazelle
#

cuz rn the particles just rise up

sour folio
echo basalt
#

basically you want to run a scheduler to display your animation

#

Let me recreate it here real quick

sour folio
#

ty

chrome beacon
sour folio
chrome beacon
#

Yeah

sour folio
#

how would i get it to work

#

would it be multiple classes?

#

anyone?

chrome beacon
#

Get what you need from the event

#

Have to go now

sour folio
# chrome beacon Get what you need from the event

would this work? ```public class listnerGetGui implements Listener {
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
InventoryView inventoryView = event.getView();
if (inventoryView.getTitle().equalsIgnoreCase("test")) {
event.setCancelled(true);
}
}

}

#

It does!

slim wigeon
#

Wait, you still there @chrome beacon ?

small holly
#

I feel really stupid asking this but is there a simple way to load all files from a folder inside my plugins resource folder?

echo basalt
lucid gazelle
echo basalt
#

I know

lucid gazelle
#

one for the top, one for the bottom

echo basalt
#

but I've done something quick and dirty here and it's too spaced out

#

and my inputs seem fine

lucid gazelle
#

oh, so you're basically manually decreasing and increasing the y pos

#

over 50 ticks

echo basalt
#

yeah p much

lucid gazelle
echo basalt
#

the effect class is useless

tough magnet
#

I lost the link to the spigot api documentation for 1.8.8

sour folio
#

why does this this not open the gui ItemStack close = new ItemStack(Material.BARRIER); ItemMeta closemeta = close.getItemMeta(); closemeta.setDisplayName(ChatColor.RED + ("CLOSE")); List<String> closelore = closemeta.getLore(); closelore.add("Close the gui"); closemeta.setLore(closelore); close.setItemMeta(closemeta); but when i do this it does load the gui ItemStack close = new ItemStack(Material.BARRIER); ItemMeta closemeta = close.getItemMeta(); closemeta.setDisplayName(ChatColor.RED + ("CLOSE")); close.setItemMeta(closemeta);

small holly
echo basalt
lucid gazelle
echo basalt
#

?paste

undone axleBOT
echo basalt
#

yeah it seems to work

#

lemme make the particles bigger

#

for some reason adding souts fixed it

#

maybe my particle size is too low

#

now we just need to reverse the animation

#

or what we could do to sound fancy

#

is just make the descent 1 and play a reversed version at the same time

lucid gazelle
echo basalt
#

so yeah just set the descent to 1

#

and play 2 copies of the same animation but one's reversed

#

and they like

#

compliment each other

lucid gazelle
#

yeah got it

chrome beacon
echo basalt
#

utils

chrome beacon
echo basalt
#

this should help you do arcs

#

just pass in a few points and it does magic

lucid gazelle
#

thanks

echo basalt
#

took me a few hours and a lot of pain with chatgpt

slim wigeon
echo basalt
#

Thanks for keeping my mind sharp with these particle effects

#

That's definitely one side I need to expand on

sour folio
#

like a secret code

#

Also how do i get any mob head with a plugin?

echo basalt
#

uh

#

Material.SKELETON_HEAD

#

maybe

sour folio
#

some arnt

lucid gazelle
sour folio
#

like pig_head

chrome beacon
#

Pig head is a player head with a skin

sour folio
#

ok

chrome beacon
echo basalt
#

just do your thing

chrome beacon
# echo basalt That's definitely one side I need to expand on

why are splines? well my god I have good news for you, here's why splines!

if you like my work, please consider supporting me 💖
https://www.patreon.com/acegikmo

This project grew much larger in scope than I had originally intended, and burnout made it impossible for me to do more with it. It was already getting incredibly unwieldy, so I apolog...

▶ Play video
#

You only need to watch first half or so

echo basalt
fierce whale
#

Is there a way to mounting entity follow the direction of mounted entity?

echo basalt
#

3d stuff

chrome beacon
#

Watch that video it starts out basic

#

Then gets real hard

chrome beacon
fierce whale
chrome beacon
#

It's the easiest way

fierce whale
#

For better optimization, is there any better stuff?

chrome beacon
#

If they're both AI controlled you can override the AI behavior to change both directions

fierce whale
lucid gazelle
echo basalt
#

it just returns like

lucid gazelle
#

ah wait that's your own method

echo basalt
#

nope

#

part of the Location class

lucid gazelle
#

wait what API version are u using?

echo basalt
#

1.19.2

chrome beacon
lucid gazelle
#

i'm on 1.19 too

#

1.19.4

chrome beacon
#

🤔

chrome beacon
echo basalt
#

wut

lucid gazelle
#

yea i just saw

echo basalt
#

it's literally surrounded by // paper end // paper start

#

figured it'd be a bukkit thing

lucid gazelle
#

lmao weird

lucid gazelle
echo basalt
lucid gazelle
echo basalt
#

nah

#

just my own thing

lucid gazelle
#

ah

lucid gazelle
echo basalt
#

useless as previously stated

#

just a List<Frame> wrapper

lucid gazelle
#

ah

echo basalt
#

this isn't really worth copying honestly

#

has no workload distribution builtin or anything

lucid gazelle
#

what does the getFrames() return?

echo basalt
#

the list..

#

I am telling you it's literally a list wrapper

lucid gazelle
#

ohhh

echo basalt
#

and a render method that's useless because you're overriding it anyways

lucid gazelle
#

yeah i got that

#

ty

terse pumice
#

Is it possible to use hex colours in the action bar?

chrome beacon
#

Yes

tardy delta
#

yes

echo basalt
#

How performant is it?

#

And how easy would it be to impl more functions

tardy delta
#

looking into units of tens of microseconds

#

and adding more functions is fairly easy, just look at the readme

echo basalt
#

What happens if you input invalid data

fading kite
#

Hello! In the plugin called oraxen, even if I change the size of my rank "cards", nothing changes on the server, it stays the same. Anyone have any ideas/advice?

tardy delta
chrome beacon
echo basalt
#

Input

tardy delta
#

well what kind of input? functions?

echo basalt
#

Uhm

fading kite
echo basalt
#

Just anything weird honestly

tardy delta
#

smth like round(12.345, -2) would throw

#

its the responsibility of the end user to wrap the exception

chrome beacon
echo basalt
#

Perfect

tardy delta
echo basalt
#

I have my own lil scripting parser thing so

#

I wanted to add math to if checks, conditions etc

tardy delta
#

feel free to inform me about the progress

echo basalt
#

It should be rather quick

tardy delta
#

i should be using jitpack or smth lol

#

lemme fix that rq

echo basalt
#

90% chance we'll just fork and shade

#

One weird thing idk how I'd do would be converting ints and all

#

Like

tardy delta
#

you can specify you want an int in a function declaration

opal juniper
#

@echo basalt use crunch?

echo basalt
#

if randint(0, 1)=1-1

tardy delta
#

hmm?

echo basalt
#

isn't that redempt's thing

tardy delta
#

ye

echo basalt
#

ye nah I have beef with him

opal juniper
#

yep it’s very fast

#

ugh petty

echo basalt
#

also last time I followed one of your suggestions I ended up wasting 6 hours on pathethic

echo basalt
#

had to rewrite the nms to work on 1.18.2 and instead of trying to pathfind towards a location the npc would just fly there lmao

opal juniper
#

i never reccomended it lol

#

you asked

#

also, 1.18.2, ew

rough drift
#

should I consider redstone ore interactable or not?

chrome beacon
#

For what use case?

rough drift
#

Checking if a block is interactable lmao?

chrome beacon
#

then yes it is interactible

rough drift
#

It returns true for piston heads as well for example, so you know just wanted an opinion if I should consider redstone interactable @eternal oxide

eternal oxide
#

yes

rough drift
#

Because some blocks just don't do anything on interaction though they are still interactable

eternal oxide
#

follow teh API and you won;t go wrong

orchid gazelle
#

Omg Icant those people in the queue-line in front of me

lucid gazelle
eternal oxide
#

Because you don't see something happen doesn't mean it can't

lucid gazelle
#

only the top half works

orchid gazelle
#

They legit now already took 10 minutes to buy a fucking ticket???

rough drift
eternal oxide
#

yep

rough drift
#

I just need to then check if the block is waterloggable and the player is holding a bucket (empty bucket, waterlogged; full bucket, not waterlogged) and consider that as well?

eternal oxide
#

becomes WATER_CAULRON when correctly interacted with

rough drift
#

Yeah, I don't know how to check if a block is waterloggable

#

oh

#

figured it

echo basalt
lucid gazelle
# echo basalt show code
new FramedEffect(plugin, frames, 20).render(location.getWorld());
new FramedEffect(plugin, reverseFrames, 20).render(location.getWorld());```
#

its the same as u gave

eternal oxide
#

if instanceof it can be waterlogged

lucid gazelle
#

wait i think for the reverse frames, the y pos should be -1 right?

echo basalt
#

no it's just the same for both

lucid gazelle
#

since it starts from the bottom of the block

echo basalt
#

the reversing already does all the funky math for you as it just plays backwards

lucid gazelle
#

but the original frames only render on the top half right?

#

so the reverse frames should render on the bottom half no?

echo basalt
#

ugh let's break this down

#

The full animation consists of a single wave going top -> bottom

#

Without changing the math, and just reversing all the frames, it become bottom -> top

#

Now, play both at the same time

#

and you have the desired effect

lucid gazelle
#

oh

lucid gazelle
#

did u change the getHollowCube method in your example?

echo basalt
#

uhh no

#

math should be the same

echo basalt
lucid gazelle
#

ah i see

#

yeah mb

tardy delta
#

@echo basalt added a jitpack repo if you need it

native ruin
#

i am having trouble having the effect packet work on other players
the packet works fine if i am the target of the effect and the packet
but if the target of the effect is another player but the packet target is still me
i am not able to see the affect (ive been using glowing and invisibility effect so it would be visable for the packet target)
I am using my normal account and an offline account to test this on my localhost server
could the offline account be the problem or could it be something else?

echo basalt
#

Glowing and invisibility are easier to handle in a different, easier way

#

and usually handled that way regardless

#

Glowing is part of entity metadata

#

And invisibility, well

#

You can just send a packet to remove the target entity

native ruin
#

invisibility and glowing is just so i can see it happen on the account that got sent the packet so this could be any effect

echo basalt
#

Yeah true but

#

Invisibility and glowing are the 2 weird cases that actually affect how the player's rendered

#

the effect packet just dictates what potion effects an entity has

native ruin
#

it doesn't actually apply the effect?

#

just the timer thingy

echo basalt
#

Never played with it enough but I'd assume not

#

It just does the timer thing, yes

native ruin
#

oh ok that is fine then

#

thanks for the help

sour folio
#

import org.bukkit.Material;
import org.bukkit.block.CreatureSpawner;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockPlaceEvent;

public class SpawnerPlace implements Listener {
    @EventHandler
    public void onplace(BlockPlaceEvent e) {
        if(e.getBlock().getType().equals(Material.SPAWNER)) {
            Player p = e.getPlayer();
            CreatureSpawner spawner = (CreatureSpawner) e.getBlock().getState();
            if (spawner.getSpawnedType() == EntityType.COW) {
                // here

            }
        }
    }
}
``` how would i make it so where it says '//here' it saves the coordinates of the spawner to a file called cows.yml that is inside of a folder in the main plugin folder where the config.yml is?
echo basalt
#

Well I'm not going to teach you the basics

native ruin
#

get the config and then use set()

echo basalt
#

buut

#

a little googling goes a long way

shell robin
#
    @EventHandler
    public void onPlayerChat(AsyncPlayerChatEvent event) {
        String message = event.getMessage().toLowerCase();

        for (String sozcuk : bannedWords) {
            if (message.contains(sozcuk.toLowerCase())) {
                event.setCancelled(true);
                event.getPlayer().sendMessage("You can't use this word");
                break;
            }
        }
    }```
yml file says asd but when I type asd in chat the message is not blocked
hazy parrot
#

we don't know what korumaSozcukleri is

#

i highly suggest to use english words for variables

shell robin
#

oh sorry

#

i will translate

echo basalt
#

just write code in english

#

it's like

#

20x easier

drowsy helm
shell robin
shell robin
drowsy helm
#

yeah im saying print out whats in bannedWords

#

make sure its loading correctly

echo basalt
#

hm I just thought about a really nice concept

#

that will take some annoying math and redesigning to do

shell robin
echo basalt
#

well

#

math

#

more like

#

2tb of ram

#

I wonder how smooth this'll be

shell robin
echo basalt
#

So your list is empty

shell robin
#

but yml is not empty

drowsy helm
#

so you're not loading it correctly

shell robin
#

1 min i will check it

echo basalt
#

man sometimes I wish I wasn't a developer and could just pay someone for my crazy thoughts

#

because this is an annoying math issue

flint coyote
#

developers can also pay developers

echo basalt
#

true but this is rather advanced

drowsy helm
#

no ones stopping you lol

flint coyote
#

there are advanced developers

#

they are pricey though

echo basalt
#

yeah I'm one of them

#

but this is a proof of concept that's like

#

100 ish bucks to code

#

and I don't have that kind of money

drowsy helm
#

$100?

flint coyote
#

100 doesn't sound like alot

drowsy helm
#

cant be that complex

#

100 is like 2-3 hrs of work lol

flint coyote
#

I'd work 3 hours max for that price

#

4 if I like the idea lol

echo basalt
#

yeah

#

it's a proof of concept that takes like 3 hours to make

#

that's annoying

#

I'm too depressed to be working 3 hours

flint coyote
#

3 hours is nothing lol. I'm working on an engine since at least 100 hours and I'm far from done

shell robin
# drowsy helm so you're not loading it correctly
    public static List<String> bannedWords;
    @Override
    public void onEnable(){
      createConfig();
      loadConfig();
    }
    private void createConfig() {
        if (!getDataFolder().exists()) {
            getDataFolder().mkdirs();
        }
        File configFile = new File(getDataFolder(), "chatkoruma.yml");
        if (!configFile.exists()) {
            saveResource("chatkoruma.yml", false);
        }
    }

    private void loadConfig() {
        FileConfiguration config = getConfig();
        getConfig().getStringList("bannedWords");
        korumaSozcukleri = config.getStringList("bannedWords");
    }
    private void printKorumaSozcukleri() {
        for (String word : bannedWords) {
            System.out.println(word);
        }
    }

    private String getConfigValue(String path) {
        FileConfiguration config = getConfig();
        return config.getString(path);
    }```
flint coyote
#

I mean it does work but I'm not happy with it yet

shell robin
#

my brain is on fire

drowsy helm
#

can i see the config itself

echo basalt
#

Currently working on 2-3 projects

#

biggest one's around 40k lines

#

Smallest one's around 5k lines

flint coyote
#

well mine is mostly reflection and parsing - take time to make everything consistent. dunno about the lines. It's about 190kb without any libs

echo basalt
#

yeah mine's around 1mb without any libs

shell robin
drowsy helm
#

programming dick measuring competition going on

drowsy helm
#

maybe we're both missing something

shell robin
#

i don't realize anything i'm doing right now

#

my brain on fire

flint coyote
#

I'm never flexing with anything programming related

#

I'm proud of my work. Sometimes more sometimes less. Flexing is too much though

drowsy helm
#

whats this korumaSozcukleri = config.getStringList("bannedWords")

#

why are you not doing

bannedWords =  config.getStringList("bannedWords");
#

or is that the translation

shell robin
#

yeah thats a translation

#

bannedWords or korumaSozcukleri

#

the same thing

flint coyote
#

I agree with the others. Please code in english

tardy delta
#

had to look at turkish code yesterday

shell robin
drowsy helm
#

yeah im not sure tbh

#

maybe the list is being changed somewhere else?

shell robin
drowsy helm
#

print it's contents immediately after you load it

#

see if its empty

#
    private void loadConfig() {
        FileConfiguration config = getConfig();
        getConfig().getStringList("bannedWords");
        korumaSozcukleri = config.getStringList("bannedWords");
        printKorumaSozcukleri();
    }

like that

echo basalt
#

ok I used my brain

#

this might be nice

#

this'll either be really choppy or really smooth

shell robin
#

but how

drowsy helm
#

can you send me the untranslated version

wide cipher
#

im trying to make it so when I right click with a specific item, it deletes 1 of those items, but when i do it it deletes all of them in my inventory. Can someone help? This is the code: @EventHandler
public void onRightClick(PlayerInteractEvent event){
Player player = event.getPlayer();
if (event.getAction().equals(Action.RIGHT_CLICK_AIR)){
ItemStack item = player.getItemInHand();
String name = item.getItemMeta().getDisplayName();
if (name.equalsIgnoreCase(ItemManager.overlordrankvoucher.getItemMeta().getDisplayName())){

            String PlayerName = player.getName();
            Inventory inv = player.getInventory();
            inv.removeItem(item);
            server.dispatchCommand(server.getConsoleSender(), "lp user " + PlayerName + " parent add overlord");
        }
    }
}
shell robin
# drowsy helm can you send me the untranslated version
    public static List<String> korumaSozcukleri;

    @Override
    public void onEnable() {
        createConfig();
        loadConfig();

        printKorumaSozcukleri();
    }
    private void createConfig() {
        if (!getDataFolder().exists()) {
            getDataFolder().mkdirs();
        }
        File configFile = new File(getDataFolder(), "chatkoruma.yml");
        if (!configFile.exists()) {
            saveResource("chatkoruma.yml", false);
        }
    }

    private void loadConfig() {
        FileConfiguration config = getConfig();
        getConfig().getStringList("korumaSozcukleri");
        korumaSozcukleri = config.getStringList("korumaSozcukleri");
        printKorumaSozcukleri();
    }
    private void printKorumaSozcukleri() {
        for (String sozcuk : korumaSozcukleri) {
            System.out.println(sozcuk);
        }
    }

    private String getConfigValue(String path) {
        FileConfiguration config = getConfig();
        return config.getString(path);
    }```
flint coyote
wide cipher
flint coyote
#

Yes

wide cipher
#

how? 😦

flint coyote
#

stack.setAmount(stack.getAmount() -1);

wide cipher
#

oh

#

ok ill try that

remote swallow
drowsy helm
#

ooh you're right

shell robin
#

I am very confused with config.yml codes and chatkoruma.yml codes in the same class

wide cipher
flint coyote
#

yw

shell robin
#

can you tell me what i should do

drowsy helm
#

check out the bottom of that

#

Using Custom Configurations

shell robin
#

oh

#

okay

#

thanks

#

If I add the korumaSozcukleri directly to the config, will it work?

drowsy helm
#

to config.yml?

#

yes

wide coyote
#

I am also Turkish but I code in English to make the code future proof, it helps other developers to help and actually understand the code

#

I recommend doing the same

eternal oxide
#

ignore me, I was scrolled up 🙂

flint coyote
split gull
#

im trying to hide command log messages from console for commands that start like that but this doesn't do anythingvb Bukkit.getLogger().setFilter(message -> message.getMessage().startsWith("/component-click-"));

hollow grotto
eternal oxide
#

are you messing with NPC's?

tardy delta
#

are we talking about void smth(Enum<?>... e)?

#

enum constants you mean, work with the ordinal

#

myMethod(INFO.ordinal() | PREDICATE.ordinal())

#

wdym

#

no implicit conversions from enum to int in java ;(

hollow grotto
tardy delta
#

wdym with native

eternal oxide
hollow grotto
tardy delta
#

i thought we were talking about java 💀

eternal oxide
hollow grotto
tardy delta
#

how would you do it in c++ 👀 just interested

#

thats what i was thinking of, but you needed enums 🤔

split gull
eternal oxide
#

sysout the message so you can see what it contains

eternal oxide
#

you are changing an item to null during the event

#

causing the assertion error

dense geyser
#

im trying to put a textcomponent in a book so it can detect click events but its just appearing as json text lol, I can't find any methods other than this one to add the text, anyone have any ideas?

BaseComponent[] comp = TextComponent.fromLegacyText(ChatColor.RED + "HI!");
for (BaseComponent bc : comp) {
    bc.setClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/yes"));
}
meta.addPage(ComponentSerializer.toString(comp));
#

for clarity, this is 1.8

#

yeah I thought the componentserializer might've been an ezpz nms workthrough, can't find anything different lol, not sure why it would be showing as json text though unless I'm being stupid

#

WAIT

#

I think I might just be being stupid

blazing ocean
#

hello, i can't quite figure out how to fill blocks between coordinates, other than using the fill command, i can't use that because the player doesn't have permissions to do that. i don't quite understand how to loop the blocks in the area

dense geyser
#

maybe not, actually, thought i'd missed the ichatbasecomponent

blazing ocean
dense geyser
#

nevermind, I am stupid, idk why posting it helps me think, basically, in 1.8 you can only add strings to books through the spigot API which is why my json wasn't working, so I just used reflection to expose the actual pages arraylist in nms, added the base component to that (because all spigot does is turns the string in the api to a base component) and it worked

#

but grazie

orchid gazelle
#

ITALIAN?

dense geyser
#

also idk if they changed it, in 1.8, TextComponent#fromLegacyText returns a BaseComponent[] array, so I can't ;-;

#

rip

#

what ya tryna do lol

chrome beacon
orchid gazelle
#

Just use Strings KEKW

chrome beacon
#

Can't do fancy things with strings

dense geyser
#

I agree

#

paper tried to do it didn't they and nobody could be assed so they just kept using spigotapi for everything

orchid gazelle
#

I kind of wanna make a text input field with books

#

And disable darkening, make book smaller and customize look

#

But idk if its possible

dense geyser
#

yeah the paper API removed ALL strings and replaced them with the component API (not the text component API, their own stupid difficult thing for new people to use)

orchid gazelle
#

With resourcepacks ofc

chrome beacon
dense geyser
#

texture packs :donger:

orchid gazelle
#

Would need core shaders huh?

dense geyser
#

to newer people it tends to be a thing they need to get their head round if they've used usual strings for ages

chrome beacon
#

paper should come with MiniMessage now

dense geyser
#

personally ive never used it cause im a lazy ass

orchid gazelle
#

I'd never use paper api

#

Its even more anti-legacy than spigot api

eternal night
#

anti-legacy clowning

orchid gazelle
#

^ and that

dense geyser
eternal night
orchid gazelle
#

Imagine accidently clicking on "confirm transaction"

#

And then subbing for a year of nitro and 1000 boosts

dense geyser
#

I've got it on my main, I think there's a £2 version of it

young knoll
#

Spigot also has components smh

dense geyser
#

its basically buying to use emotes in other servers

#

yes we know

young knoll
#

Why not

orchid gazelle
#

Whats the performance and stability diff of paper vs spigot?

#

Who cares about load time bro

#

Servers boot in 2 seconds anyways

young knoll
#

Spigot should be more stable

orchid gazelle
#

We aint in forge lmao

young knoll
#

Since we don’t make nearly as many invasive changes to the server

dense geyser
#

the forge discord would ban you, dox you, put a bounty on your head and bomb your house for mentioning you code on any version below the current latest

young knoll
#

Source?

twilit roost
#

how do I decompile Bukkit to get the default ChunkGenerator code?
I just want to slightly modify it

young knoll
#

Well, not quite but they won’t help you

twilit roost
eternal night
#

paperclip is how paper is distributed

#

yes

young knoll
#

It’s just a fancy way to run buildtools at runtime essentially

#

There was a spigotclip before

eternal night
#

I mean, it is pretty far off buildtools

quiet ice
#

Yeah paperclip just applies a binary patch on the notchian server impl

young knoll
#

Well

#

Close enough to buildtools

#

Shh

eternal night
quiet ice
#

Yeah

eternal night
#

wasn't it like

#

compiled and hosted on a random github

quiet ice
opal juniper
#

yes

#

it sucks

split gull
#

(I have no idea who you are but it seems we speak the same language)

#

btw i've managed to do the console command message thing

opal juniper
#

its almost as if its original name sounds better than a hacky mashup

quiet ice
#

I think it does sound good

twilit roost
#

does one have a good guide on ChunkGeneration?
Im trying to make mainly ocean and sometimes some cool looking islands
yet I can't seem to get it working.

quiet ice
#

I'd honestly wait until 1.20 and the material rewrite v2.0 which also affects many other enums such as the biome enum before starting on chunk gen

twilit roost
#

well it makes sense, but I don't think it will take me just a few hours to setup after the update, so I want to get the hand of it sooner

also did someone crack those riddles and knows release dates?

opal juniper
#

June 7th?

twilit roost
#

oh
i have mistakend those riddles with their other game :D

quiet ice
#

It's always a Wednesday. So either May 31st or June 7th

#

You mean the package-info.java class?

#

AI moment

twilit roost
#

change display mode
or smthing

quiet ice
#

Ah that is an user issue then

#

Learn to use your IDE lol

twilit roost
#

untick this

quiet ice
#

At least Eclipse hides empty packages, I assume that is what you are seeing

#

Yep. that is what you are seeing

eternal oxide
#

I'm guessing you had your economy package selected when you told it to create orbs

quiet ice
#

You need to manually insert the full path then

#

Shouldn't be too hard really

tardy delta
#

skill issue

#

jetbrains products have been fucking up the latest time

worldly ingot
#

I'm still happy with my Eclipse EmbarrasedAsk

worldly ingot
#

I just wish they'd add more features in their releases. They've slowed down on that front for the last couple releases and it's annoying

#

There's only ever like one or two things to look forward to and they're so minor

eternal night
worldly ingot
#

Like this is the only thing I'm excited for in the next release!

#

A CONTEXT MENU ITEM

tardy delta
#

ugh white mode

worldly ingot
#

I just hate having to press Alt + Shift + H sometimes

tardy delta
#

is the "quick actions" thing still like, "cant find method String#whatever, lets cast that string to a Player"

#

atleast that was how good it was when i used it 💀

worldly ingot
#

Yeah because it's a valid solution sometimes. Other suggestions include changing the method signature or the variable type. What more do you expect from quick fixes?

tardy delta
#

that it stays quiet instead 💀

worldly ingot
#

If it's part of the hierarchy it will suggest a cast

tardy delta
#

dang it improved

#

light mode, really...

worldly ingot
#

Yeah. Eclipse's dark mode is kind of awkward

#

It's the only app I still use in light mode

#

Tried. Hate them all and the preferences don't always save

tardy delta
#

ew

quiet ice
#

Eclipse's dark mode is a hit-or-miss

#

JDT is okay, CDT not at all

tardy delta
#

themes uwu

worldly ingot
#

At the end of the day, I still write good code 🙂

tardy delta
#

thats the spirit

worldly ingot
#

Well, I hope so

tardy delta
#

my man thought it was a good idea to let every getConfig call (which gets smth from a json file) parse the whole json file, measured it 💀

twilit roost
#

how do I make ArmorStand head bigger? as big as normal block

kindred valley
#

Tp

#

Dont use statics

chrome beacon
twilit roost
#

how are they called in API? :D

kindred valley
#

static abuser

tardy delta
kindred valley
#

no need to be angry man i just I suggested

smoky anchor
kindred valley
#

This guy is too angry

twilit roost
#

tysm

quaint mantle
#

Does anyone know how can I make a timer in the scoreboard from Tab List plugin

kindred valley
quaint mantle
#

im here

#

ok

quaint mantle
kindred valley
#

nope

#

Guy is aggresive

twilit roost
chrome beacon
#

You can create hitboxes

#

Not sure if you can walk on them though

warm mica
#

You could use invisible shulker boxes and wrap the display entity around it

worldly ingot
#

Praying for a CollisionEnabled NBT tag on hitbox entities in 1.21

shadow night
#

what event is triggered when the player picks up an arrow?

worldly ingot
#

PlayerPickupArrowEvent ;p

shadow night
worldly ingot
#

What version?

shadow night
#

1.8

worldly ingot
#

I added it in 1.9 I believe

#

If I'm not mistaken, pickup item is called but there's no distinction between arrow items and arrow entities

shadow night
#

1.8 is so awful, I had to do so much already just because half the stuff does not exist and I can't even switch to 1.9

worldly ingot
#

Yeah, I mean that event was literally added 7 years ago

#

It was actually my first ever contribution to Bukkit Steve_Dab

shadow night
#

I'm gonna die in this awful 1.8

twilit roost
#

how do I get BlockData of unlit campfire?

shadow night
worldly ingot
#

I'll let you guess which specific type of BlockData it returns 😛

ancient plank
#

THE block data

twilit roost
#

okay but how do I make unlit campfire? I tried getting its BlockData and setting lit to false, but there isn't any lit or smthing

kindred valley
#

Its okay mate. I dont judge you

worldly ingot
#

Block#setBlockData()

twilit roost
#

the problem's that there's no lit variable to be set

worldly ingot
#

Sure there is. Campfire#setLit(false)

kindred valley
#

You do

twilit roost
#

or even when I cast it to Campfire

worldly ingot
#

You're importing the wrong Campfire

#

org.bukkit.block.Campfire vs org.bukkit.block.data.type.Campfire

kindred valley
#

🤠

twilit roost
#

oh my
i was importing the shorter path :D
tysm

blazing ocean
#

sorry if this might be considered spoonfeeding but i would have the command /fill 41 55 -11 62 58 -11 with corner 1 being 41 55 -11 and corner 2 being 62 58 -11, how would i make a loop out of that?

worldly ingot
#

Think about it this way. You want to go from x -> maxX, y -> maxY, and z -> maxZ

#

How would you go from one value to another using a for loop?

blazing ocean
#

you would have i = x; i + 1; if i = maxX; return, something like that (just some pseudocode) and then the whole thing with the other coords

#

would you just do that or is it more complicated

orchid gazelle
#

i++ better

worldly ingot
#

for (int i = 0; i <= 10; i++), so there's i from 0 to 10

#

Now if you wanted to go from, say, 50 to 100, your loop would look like for (int i = 50; i <= 100; i++)

blazing ocean
#

yes, that's what i meant, is it just that?

#

because i thought it was more complicated

worldly ingot
#

Pretty much. Only instead of one loop, you have 3 numbers you want to loop over, right?

orchid gazelle
#

Notice that the 50 and the 0 will get called to

#

So its 11 iterates

#

Or would it?

worldly ingot
#

Yeah. For a fill you'll want that

worldly ingot
#

And if you want a volumetric loop, you'll just have to nest those loops

#
for (x) {
    for (y) {
        for (z) {
            Block block = world.getBlockAt(x, y, z);
        }
    }
}```
#

I'm sure you can fill out those for loops knowing what you know now 😄

blazing ocean
#

okay, thank you very much!

split gull
#

is there a way to get which page of a book a player is currently viewing (not from a lectern)?

split gull
#

i said not froma lectern

vast ledge
#

#getPage()

split gull
#

kk

#

it's not a thing

#

there's only getPage(int page)

vast ledge
#

rip

#

i think you can only get it from a lectern

#

but imma keep lookin

split gull
#

its probably clientside

#

i've also looked at packets

#

nothing there afaik

vast ledge
#

Yea, the book is client side

#

Like in this thread

rotund pond
#

Hello everyone
I have a little question

I'm looking for something to get all files in resources 😅
Do you think it's possible with spigot ? I've found Plugin#getRessource but it's made to get one file with a specific name :/

vital sandal
#

are there any other way to track if player teleported to other world rather than PlayerTeleportEvent and PlayerChangeWorldEvent?

#

as if player is teleported by Multiverse non of 2 events are called

#

and It seem there is no event api in multiverse either

ember estuary
#

In Java, can i somehow run code after the child constructor, without explicitly calling it in the child constructor?

rotund ravine
#

Not in the way you wish.

ember estuary
#

I know i could just not use constructors and put it into functions, but thats kinda shit

rotund ravine
#

There is an init block, but that runs before.

ember estuary
#

yea, chatGPT suggested that too, but if it runs before its of no use

rotund ravine
#

No?

ember estuary
#

its nonstatic stuff tho

rotund ravine
#

Just call it from the constructor

ember estuary
#

and it should be called after every child constructor call

ember estuary
#

but that sucks, if i have to do that for every child :/

vital sandal
#

:l? why

blazing ocean
#

hello, how do you show hud titles (like those on top of the hotbar)? and if so, i would need to update it every 5-10 milliseconds (because i'm making a stopwatch). is that possible?

vital sandal
#

so do abstract class

ember estuary
#

it is

#

the parent class is

vital sandal
#

yeh so what the problem with it?

ember estuary
#

well, how does that solve the problem?

vital sandal
#

you don't need to repeat it?

ember estuary
#

whaat, how

hazy parrot
#

?xy ig

undone axleBOT
ember estuary
#

how am i asking about my solution

#

i dont have a solution

vital sandal
#

so code pls?

#

just an example one

hazy parrot
#

You haven't explained actual problem

ember estuary
#

Parent:

    public MapMenu(Player player, ItemStack map) {
        canvas = new Canvas(mapView);
        window = new Window(canvas);

        this.onLoad(); <--- Should always be called, and always after child constructor, because it needs the stuff which is created in the child constuctor
    }

    protected abstract void onLoad();

Child:

    public ChallengeMapMenu(Player player, ItemStack map) {
        super(player, map);

        defaultButton = ImageIO.read(Objects.requireNonNull(this.getClass().getResourceAsStream("/images/DefaultButton.png")));
    }

    @Override
    protected void onLoad() {
       // 100 lines of code that create a new map which i do not want to put in the constructor because I don't like having hugeee constructors and i want this to be able to be called manually later
    }

That's the code.
I don't wanna have to call this.onLoad() at the end of every child constructor. I would like to have that call at one place, no duplicate code.
And I don't wanna put the onLoad stuff in the child's constructor, for the reasons mentioned.

#

So yeah, I hope my code made my question more clear? Basically i automatically wanna call onLoad of the child class after the child constructor is finished.

rotund ravine
#

super()

vast ledge
#

?

ember estuary
vast ledge
#

super(player, map)

#

in the Child

ember estuary
#

what about it?

vast ledge
#

idk

rotund pond
vast ledge
#

he just said super)=

hazy parrot
#

Nah you can't do that in java, you have to split methods

#

Parent constructor always must be called first

ember estuary
#

oof, hmm :/

hazy parrot
#

I actually don't know language where that isn't the case

#

super() isn't useful as it must be first method in child constructor, you can't postpone it

vast ledge
#

Is there a way i can optimize this?

desert loom
# ember estuary Parent: ```java public MapMenu(Player player, ItemStack map) { canva...

I don't think what you want is possible. There is also a problem with calling overridable methods in the constructor.

Consider the following:

public abstract class SuperClass {

    public SuperClass() {
        onLoad();
    }

    public abstract void onLoad();
}


public class ChildClass extends SuperClass {

    private final Object myObject;

    public ChildClass(Object myObject) {
        this.myObject = Objects.requireNonNull(myObject);
    }

    @Override
    public void onLoad() {
        System.out.println(myObject); // prints null even though this shouldn't be possible
    }
}
vital sandal
night verge
#

I'm making a smithing recipe and I've noticed I cannot use a custom item as the RecipeChoice base, but it's fine to use a custom item as the RecipeChoice addition.
Is it a bug or there are some reasons for not being able to do that?

ember estuary
#

Parent:

    public MapMenu(Player player, ItemStack map) {
        canvas = new Canvas(mapView);
        window = new Window(canvas);

        this.init();
        this.onLoad();
    }

    protected abstract void init();
    protected abstract void onLoad();

Child:

    public ChallengeMapMenu(Player player, ItemStack map) {
        super(player, map);
    }

    @Override
    protected void init() {
      defaultButton = ImageIO.read(Objects.requireNonNull(this.getClass().getResourceAsStream("/images/DefaultButton.png")));
    }

    @Override
    protected void onLoad() {
       // 100 lines of code that create a new map which i do not want to put in the constructor because I don't like having hugeee constructors and i want this to be able to be called manually later
    }

So the only way is doing it like this, i guess?

hazy parrot
vast ledge
#

This is my full class, i can make my Connect function return an instance with all the functions so its no longer static abusing

ember estuary
#

duplicate code

tardy delta
#

too much work to zoom in

vital sandal
#

and you will have grand child class uwu

hazy parrot
desert loom
#

also look at the problem I posted above

vital sandal
vital sandal
ember estuary
vital sandal
#

having supper() or not doesn't change the fact that constructor always called first

desert loom
#

the super() is implicit

#

since the super consturctor is called first, the state in ChildClass is not initialized by the time onLoad() is called

#

leading to myObject being null when it shouldn't

opal juniper
ember estuary
#

but yea, thats exactly the problem i had

desert loom
#

I think your best bet is probably going for a private init method if you really don't want a big constructor

vast ledge
#

I have revised my static abuse,

Class "MongoUtility.java"

#

Class MongoConnector.java

quiet ice
#

Out of Context?

vast ledge
quiet ice
#

You'll realize it

vast ledge
#

oh

#

ooc = out of context

quiet ice
#

Ah meanwhile I thought there was some new design philosophy I would disagree wholeheartedly with

onyx fjord
#

how do i get the server default "no perm" message?

rotund pond
tardy delta
#

MongoUtility sounds so insulting in my language lol

vast ledge
#

is there a way i can pre create "Async Tasks" would i go about it like this:

    public Profile t(UUID uuid){
        Bukkit.getScheduler().runTaskAsynchronously(OcsolirCore.getInstance(), new Runnable() {
            @Override
            public void run() {
                retrieveProfile(uuid);
            }
        });
    }
#

Or would i create a bukkit runnable

#

then execute it as an async

hushed spindle
#

yeah you can create a bukkitrunnable without immediately running it if thats what you mean

vast ledge
#

Would it be better to do that

hushed spindle
#

i dunno why do you need it

vast ledge
#

or to create a method like i showed?

tardy delta
#

it just creates an object, nothing more

hushed spindle
#

whats the goal here

tardy delta
#

BukkitScheduler.runTaskAsync creates a BukkitTask internally

vast ledge
#

To optimize the getting/setting of ranks in a mongo database

hushed spindle
#

if its a single task you're running async then no you dont need to worry about performance much

#

i'd just fetch data when player joins, persist when player leaves

#

and also recommend saving data periodically to account for crashes

onyx fjord
#

?

#

wut

vast ledge
#

Ye thats what im doing, im trying to get it down to the tiniest spec that it doesnt yeet server performace if a lot of people joined suddenly

hushed spindle
#

if you worry more about that you might want to consider just loading in most profiles on server startup, but thats obviously big on memory

hushed spindle
#

if you're doing that you'll also want to purge profiles that made little to no progress

#

wdym you just do what you do with one person with everyone in the database

quaint mantle
#

can i remove a players permission as they leave? I have a permission i want to give to players that are in the que and if they disconect i want to remove them from the que

hushed spindle
#

sure

quaint mantle
#

okay

night verge
#

Hello, I am wondering why is the first code works perfectly, while the second doesn't?

Bukkit.addRecipe(recipe1);

SmithingRecipe recipe2 = new SmithingRecipe(new NamespacedKey(plugin, "recipe2"), customitem2, new RecipeChoice.ExactChoice(customitem), new RecipeChoice.ExactChoice(new ItemStack(Material.IRON_INGOT)));
Bukkit.addRecipe(recipe2);```
tardy delta
#

why not working with pdc flags?

hushed spindle
#

playerquitevents happen before the player has actually left so you can access the player object just fine

quaint mantle
quaint mantle
zinc lintel
#

does anyone know how i can make a block spreading plugin with the WorldEdit api?

vast ledge
#

That

#

help

#

Oh

#

yea

#

ok

#

no

#

idk why

#

cant explain

#

doesnt make sense

#

I save the player data in a local hashmap with there UUID, so i can serach them up when i need them

hushed spindle
#

i also have a bit of question, is it possible to detect item lore changes with nms? i want to make a lore api to allow for dynamic item lore changes, without interfering with other plugins possible changing lore

#

like if another plugin wants to add lore it will still be able to but otherwise my plugin would handle the lore format on the item

vast ledge
#

I jsut dont want the server to have to call out for data

hushed spindle
#

thats not the issue, sending fake lore packets is fine

#

but i want to detect when the lore of an item is being changed

vast ledge
#

That probably be inefficeitn

hushed spindle
#

i dont care about the packets being sent to the player, i need to compare the before & after of an item's lore when its changed. essentially, i want to detect when setItemMeta() is being used

#

from any plugin

vast ledge
#

nutty 😆

hushed spindle
#

mmmmm

#

and another kinda not really related question, is it possible to space bits of text equally among several lines

#

basically making a table

#

maybe using negative space characers with a resource pack

#

all solutions ive found online involve things like guessing character widths and figure out how many spaces need to be between words to kinda get the spacing correct

#

yeah

#

but obviously such a character width guessing method would break if a player uses any font changing resource pack

#

pretty much yeah

#

but you can force item boxes to be a certain minimum size to make it fit so thats less of an issue

sour folio
#
  467_72_-59:
    world: world
    amount: 1
    percentage: 0.0
  462_73_-63:
    world: world
    amount: 1
    percentage: 0.0
  462_73_-62:
    world: world
    amount: 1
    percentage: 0.0``` How would i make it so that every 5 seconds the percentage on each one of these would go up by 0.1
#

the location is Espawners/spawners/pigs.yml

onyx fjord
#

can i bypass ItemStack size limit somehow?

remote swallow
#

iirc you have to change it in nms

onyx fjord
#

hell no

sour folio
eternal oxide
#

Its not going to read that file as live data

#

look to see if the plugin has an API

sour folio
eternal oxide
#

Then you should not be treating that data as live

sour folio
#

how should i

eternal oxide
#

you cache it in memory

#

then you periodically save it as needed

#

files are used to store data to be reused in the next session

#

Things you want to remember between server starts

blazing ocean
#

hello! i'm currently trying to display an actionbar using nms and an interval, because the string that gets shown constantly has to update (im working on a timer), but the server just stops responding after like 10 seconds and eventually crashes. is there a way of showing it and updating it every like 100ms? i've tried intervals ranging from 50ms to 500ms

this is my code right now: java while(Main.isRunning) { player.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent(Main.formatTime(Main.getTime()))); TimeUnit.MILLISECONDS.sleep(500); }

eternal oxide
#

run async, you can not sleep the main thread

quaint mantle
#

how can i make this spawncount int go up for every player so every player gets a unique spawn

blazing ocean
eternal oxide
#

?scheduling

undone axleBOT
glossy venture
#

and check if its enabled in the task

#

if so do the logic

#

alternatively cancel the task when you disable your plugin

blazing ocean
#

so i would have to turn my method into a bukkitrunnable?

glossy venture
#

just put the code inside the while loop, excluding the sleep, inside a lambda

#

then put 10 ticks for the period (10t*50ms/t = 500 ms)

blazing ocean
#

so essentially like this from the wiki?

BukkitScheduler scheduler = Bukkit.getScheduler();
scheduler.runTaskTimer(plugin, () -> {
  Bukkit.broadcastMessage("Mooooo!");
}, 20L * 10L /*<-- the initial delay */, 20L * 5L /*<-- the interval */);```
glossy venture
#

yeah

#

and replacr the values

blazing ocean
#

okay, thanks

#

so 20L is just 20 ticks?

remote swallow
#

yeah

blazing ocean
#

okay

#

thanks

glossy venture
#

yeah

blazing ocean
glossy venture
#

you cant instantiate your plugin class

#

?di to get the instance

undone axleBOT
glossy venture
#

or just do a static getter

raw prairie
#

Kotlin > Java in terms of syntax 🤥💯

glossy venture
#

really dont see issue with that

raw prairie
#

Pin this or gay

ivory sleet
#

will not get pinned

#

that much rest assured

blazing ocean
#

non-static variable this cannot be referenced from a static context

raw prairie
glossy venture
#

yeah use a static field

#

set it in onLoad

#

?learnjava

undone axleBOT
twilit roost
#

can I create ItemStack that looks like the black and purple cube?

raw prairie
#

Error

twilit roost
#

ikr
i want to use the texture as a signal for me when I f something up in code

raw prairie
#

Idk

ivory sleet
quaint mantle
#

Anyone got a yt video that can explain me how to do working and bugless matchmaking

ember estuary
#
public class A extends B {
    private final byte BLACK = MapPalette.matchColor(0,0,0);

    public A(Player player) {
        super(player);
    }

    @Override
    protected void init() {
        System.out.println("Black: " + BLACK + " | " + MapPalette.matchColor(0,0,0));
    }
}


public abstract class B {
    public B(Player player) {
        this.init();
    }
   
    protected abstract void init();
}

Why does this print "Black: 0 | -49" instead of "Black: -49 | -49" ?

#

Shouldnt the BLACK = MapPalette.matchColor(0,0,0); be executed before the init method?

#

If I do

 public A(Player player) {
        super(player);
        System.out.println("Black: " + BLACK + " | " + MapPalette.matchColor(0,0,0));
 }

 @Override
 protected void init() {
   System.out.println("Black: " + BLACK + " | " + MapPalette.matchColor(0,0,0));
 }

it prints
"Black: 0 | -49"
"Black: -49 | -49"

#

does the BLACK = MapPalette.matchColor(0,0,0); only get called after the super constructor is finished? I don't get it...

sour folio
ivory sleet
#

can u be a bit more specific?

#

r u using some type of match making rank to match players up against each other?

quaint mantle
#

nope just basic machmaking

#

if theres 8-10 players in que i want a game session to be initialised

#

i have code that should work but only for 1 sessrion at a time

#

which sucks

vital sandal
#

any better way to store config values :l?

ivory sleet
#

yep

#

make it object oriented

quaint mantle
ivory sleet
#

:)

vital sandal
ivory sleet
#

no1 said u have to have 80 getters

vital sandal
#

so how could that be improve :l

ivory sleet
eternal oxide
#

improve by using naming conventions

ivory sleet
eternal oxide
#

I guess. I thought those were constants

ivory sleet
#

yea

vital sandal
ivory sleet
celest sonnet
#

💀

ivory sleet
#

then u have two ways of dealing with the consumption and population of the queue drvoss

celest sonnet
#

There is actually no way

ivory sleet
#

either eagerly check the size of the queue when ever u push things to it

#

or u go async (id do this)

quaint mantle
quaint mantle
#

bro not even my dad ghosted me that hard

vital sandal
#

:l I meant to load it into ram

celest sonnet
#

Doesn’t that go against like the whole point

vital sandal
#

my bad

quaint mantle
vital sandal
#

not a great idea :l

quaint mantle
#

well it depends on how often that value is needed

#

if its something that you need on every move event i agree with you

#

but

#

if its something being triggert every once in a while why waste ram on it

vital sandal
#

I mean :l that couldn't even more than 1mb I believe

celest sonnet
#

do you believe

quaint mantle
#

if its jusr booleans yh

vital sandal
#

it does has lots of text but still not that big

quaint mantle
#

but if theres strings etc then

#

could become a lot

#

i mean a letter is like

vital sandal
quaint mantle
#

oh yh well then its fine ig

vital sandal
#

and there are lots of string eventually

fresh timber
#

So, I've been trying to make a custom health system on my plugin. I am trying to get the number out of the first lore on the head item and I'm getting an error. I've showed the helmet, error, and code. Can anyone tell me how I can fix this to get the health in the first lore and add it to the variable setMaxHealth in the code?

fresh timber
#

is there a way to make attributes completely do nothing for armor or swords but still... be there

#

actually nvm ill just use pdc

quaint mantle
fresh timber
#

yea

#

I always seem to forget pdc exists

#

so useful

zenith gate
#

Is there a way to use a runnable to check if 50 minecraft days have past? I want all spiders to attack every player every 50 minecraft days.

delicate lynx
#

you can calculate a day count

quaint mantle
#

hi, so I'm new making APIs with Spigot and I'm having this error:

[ERROR] Error occurred while enabling MiniGamesFun v1.0-SNAPSHOT (Is it up to date?)

java.lang.IllegalArgumentException: Plugin already initialized!
at com.donbaguette.arenaapi.ArenaAPI.<init>(ArenaAPI.java:10) ~[?:?]
at com.donbaguette.minigamesfun.MiniGamesFun.onEnable(MiniGamesFun.java:11) ~[?:?]
Caused by: java.lang.IllegalStateException: Initial initialization

(I only kept the useful lines)

My API main code:

public ArenaManager arenaManager;
    public Arena arena;
    public ConfigManager configManager;
    @Override
    public void onEnable() {
        // Plugin startup logic
        arena = new Arena();
        configManager = new ConfigManager(this);
        arenaManager = new ArenaManager(this, configManager);
    }

My plugin main code:

public void onEnable() {
        // Plugin startup logic
        ArenaAPI arenaAPI = new ArenaAPI();
        arenaAPI.configManager.createConfig();
        this.getCommand("mgf").setExecutor(new Commands());
    }

The line where I get the error (11):
ArenaAPI arenaAPI = new ArenaAPI();

Of course I already red the error and know that is caused because I initialized my API main class, but what I don't know is WHY I get that error.

eternal oxide
zenith gate
quaint mantle
#

I mean, I initialized the main class of my API into the main class of my main plugin

pseudo hazel
quaint mantle
#

uh

zenith gate
quaint mantle
#

should I make my API static then?

#

what do you mean?

#

since other dude left just like my dad for the milk anyone else wanna carry the burden of explaining GOOD matchmaking to me?

zenith gate
#

I dont understand by what you mean of timestamps.

pseudo hazel
quaint mantle
#

the last code is from the main class of the main plugin

pseudo hazel
#

i see

ember estuary
#

Whats the easiest way to see which packets my server sends to my client?

pseudo hazel
#

well you cant really have 2 plugin classes in 1 plugin can you?

#

i mean thats what I assume

subtle folio
#

why can’t doubles just be normal 😭

#

how2fix ?

ember estuary
#

round them

pseudo hazel
quaint mantle
#

well, as I said I'm new at creating APIs, so I just followed a basic tutorial and tried to apply that to my logic, but didn't worked lmao

vital sandal
subtle folio
#

just for int i loop with 0.1 and += 0.1

ember estuary
#

Math.round(x * 10)/10

subtle folio
#

ig for double loop

#

ty

quaint mantle
#

so the issue should be fixed from the API or from the main plugin?

#

just asking so I can try to fix it

zenith gate
pseudo hazel
#

usually apis that I use dont have a plugin class

quaint mantle
#

im struggling with having multible run AT THE SAME TIME

quaint mantle
#

running*

pseudo hazel
#

your api can still have a main class or smth, then just pass your plugin into the constructor or whatever

zenith gate
pseudo hazel
#

so you could do something like api = new MyAPI(this) if that makes sense

#

where MyAPI is not a plugin

quaint mantle
pseudo hazel
#

but has a reference to your plugin

quaint mantle
#

its some kind of battle royal you could say

#

8-10 players in each session

#

last one standing wins

zenith gate
#

okay so what's the current problem? you want a matchmaking, how do you have this planned rn?

hasty heron
quaint mantle
quaint mantle
pseudo hazel
#

yes or just convert your main api class to not extend javaplugin

zenith gate
#

Okay, are you isolating the sessions? how are you creating the game or session.

quaint mantle
quaint mantle
#

let me test that

#

bc i cant for the love of god figure out how to do it propperly without it being all sketchi and overcomplicated

zenith gate
# quaint mantle not yet bc i dont know how i dont have any sessions

So you want to host multiple sessions. lets say 4 games at once. when the games start where would they go? just in a place around the world? i dont understand what the issue could be. you can hold most information in a HashMap, teleport the players to their own world, start the game, once they die or the game finishes, they get teleported back to the main location.

quaint mantle
#

just a little issue @pseudo hazel, I need an instance of my main plugin, but idk what type should I add, I mean that all my classes that nead a plugin instance I do it like MyPlugin myPlugin and then use for example myPlugin.getDataFolder()

zenith gate
pseudo hazel
#

cant you just use JavaPlugin?

quaint mantle
zenith gate
quaint mantle
remote swallow
#

yeah

quaint mantle
#

ohh wait my bad

#

I'm just dumb

pseudo hazel
#

yes in your API class for sure

quaint mantle
remote swallow
#

int or uuid

zenith gate
#

you can ID pretty much everything

quaint mantle
#

okay lets say i have a player death event bc a player got killed i just run through all the ids and see if they match?

remote swallow
#

u could prob use pdc or something to tag what game their in or loop

quaint mantle
#

so basically just loop through ALL players every time something happens?

zenith gate
#

you can loop through that current session.

quaint mantle
#

to test if theres only one player left for example

zenith gate
#

those 10 players or whatever would be in their own session their own world

#

when they die, you alter that session.

remote swallow
#

you tag them with a key with the session id, then you can use that to do whatever

zenith gate
#

you would tag them of what session they are in

quaint mantle
#

okay let me try that thank you

zenith gate
quaint mantle
#

okay @pseudo hazel I think almost everything works, I just have a little and last issue. I've made a ConfigManager but can't make it work with resource files that are in my main plugin (the ConfigManager is in my API)

quaint mantle