#help-development

1 messages · Page 1771 of 1

digital rain
#

makes sense

lavish hemlock
#

I will disable your explicit GC.

#

Don't make me do it.

torn shuttle
#

don't get swayed by maow, he's a part of the system, rise up and store the unstorable

lavish hemlock
#

:|

old cloud
#

lma

torn shuttle
#

I'm not a part of your system, I made my entire plugin serializable and I store a snapshot of the state on a 1 minute timer "just in case"

lavish hemlock
#

ok but legit someone should do that that's fucking hilarious

torn shuttle
#

I don't store player instances, I store the entire server list alongside the reference to which element in the array the player I want is at

golden turret
#

i store players in paper

#

i write their name, uuid, location and etc

torn shuttle
#

I don't use for loops, I use while (true) and breaks everywhere because I am a wildcard which can not be contained nor quantified by for loops

lavish hemlock
#

I use Java's highly advanced printer API to automate the process of writing the players.

#

javax.print ftw

torn shuttle
#

every time a server checks in to see if they are running the latest version of my plugin they actually upload their own version to my spigot profile and then run a checksum between the file they just uploaded and the file that preceded it because I give power to the people

#

anyway buy my book on java programming, it's lit

lavish hemlock
#

will do

#

send me the link

#

I want more of these epic based programming conventions

torn shuttle
#

damn you previewer

pastel carbon
#

Does spigot or bukkit have an easy way of deleting a chunk? So its completely removed from the disk and would regenerate

cursive glen
#

can spiders wear player heads?

torn oyster
#

what would be the best way to make licenses

#

for your plugin

quaint mantle
quaint mantle
torn oyster
quaint mantle
#

no way really

#

sure you can obfuscate your plugin but that wouldnt help against experinced people

torn shuttle
#

man I didn't even know EnumMaps were a thing

old cloud
#

lol, you have a unnecessary import if you declare it as List and initialize as ArrayList and since the classes don't differ very much, it basically doesnt even matter

quaint mantle
#

your say has no difference and no impact

torn shuttle
quaint mantle
#

what if you need a list on a method?

#

as a paremter

#

you cant just require the arraylist implementation

#

you make no sense, why are you even pinging me

old cloud
#

If you have a List as parameter, you can easily pass an ArrayList as argument because ArrayList implements List

quaint mantle
#

thats not what i said

old cloud
#

imagine being a toxic discord helper

quaint mantle
#

????/

#

@lavish hemlock

torn shuttle
#

I guess never mind what I said before, maybe you won't come to realize jack shit

old cloud
torn shuttle
#

mhm

old cloud
#

Nobody needs your dumb comments

lavish hemlock
#

"unnecessary imports" actually don't matter @old cloud

#

Imports are compile-time only and serve as shorthands for fully-qualified names.

old cloud
#

It adds a line to your .java file

lavish hemlock
#

So?

quaint mantle
#

Oh no! A line!

torn shuttle
#

yikes

#

a whole line

old cloud
#

means bigger file

lavish hemlock
#

The .class file is the only one that actually matters size-wise.

quaint mantle
#

you've gotta be trolling

torn shuttle
#

🤡

old cloud
#

You guys dont get it. I just said that it basically doesnt matter and wanted to end this discussion but you are acting like kids

quaint mantle
#

we're acting like kids?

quaint mantle
#

you ping me about something i said an hour ago

old cloud
quaint mantle
#

which is right, and any project will show you that

old cloud
#

it isnt right if it doesnt matter

lavish hemlock
#

Listen if a single additional line in your file actually makes a difference to your hard drive's remaining space, then you should get a bigger hard drive.

quaint mantle
#

🤦🏿‍♂️

#

it matters. You are requiring an exact implementation even if its absolutely unecessary. Soo, the class becomes less re-usable

old cloud
#

Ah now I get what youve meant with parameter

quaint mantle
#

yeah

twilit wharf
#

is there any way through ChatColor that I can make chat message bold and a color? Hypixel somehow does it

lavish hemlock
#

you should probably use translateAlternateColorCodes

twilit wharf
#

alright, so then instead of ChatColor use color codes, thanks

lavish hemlock
#

no you still have to use ChatColor

quaint mantle
#

What

#

use components smh

lavish hemlock
#

^

#

if you're on a version that supports it

stoic osprey
#

How can I copy and paste a chest and keep the contents inside it?

lavish hemlock
#

or using Adventure

#

(you could also use Bungee's text API but idk what kinda support that has)

old cloud
#

Can someone help me with this?

twilit wharf
lavish hemlock
#

well yes but to use color codes you should use ChatColor

torn shuttle
# old cloud Can someone help me with this?

interesting move, calling people here children for giving you actual advice, not saying sorry when you realize they had a point all along and then asking for support 🤡

lavish hemlock
#

unless your keyboard has a section sign key :p

last kayak
#

Does anyone have an API for the heads of active players on the server (HTML)?

stoic osprey
#

How can I to copy contents of one chest to another chest?

old cloud
#

Or are you perfect?

torn shuttle
#

I'm perfect enough to not be an asshole to people in a support room moments before asking for support

old cloud
#

And I called you children because you acted like children

torn shuttle
#

unless it's choco, choco is fair game

torn shuttle
#

thanks!

old cloud
#

No, you acted like an asshole

torn shuttle
#

did I?

old cloud
#

at least imo

torn shuttle
#

yeah alluding that your very strong stance on something that you don't know much about might be misguided is a classic 🥒 move

lavish hemlock
torn shuttle
stoic osprey
#

is anyone able to help me?

#

I need to know how to copy contents of a chest/sign over to another one

old cloud
quaint mantle
#

maybe not wrong, but absolutely pointless

old cloud
#

Not in the context I was thinking

torn shuttle
stoic osprey
#

I have this code which copies an area but it doesn't seem to copy chest data:

World world = Bukkit.getWorld("mcc");
                Location loc = new Location(world, 0, 0, 0);

                for (int x = -339; x <= -96; x++) {
                    for (int z = -49; z <= 193; z++) {
                        for (int y = 0; y <= 77; y++) {
                            loc.setX(x);
                            loc.setY(y);
                            loc.setZ(z);
                            Block block = loc.getBlock();

                            BlockData data = block.getBlockData();

                            loc.setZ(z + 252);
                            loc.getBlock().setType(block.getType());
                            loc.getBlock().setBlockData(data);

                        }
                    }
                }
                System.out.println("COMPLETED");

does anyone know why?

old cloud
torn shuttle
old cloud
stoic osprey
old cloud
#

I don't know, all I know is that BlockData does only contain basic information about the block

last kayak
quaint mantle
#

get the block state, clone it and set on New block?

old cloud
#

I'm pretty sure they want to serialize it

quaint mantle
#
        Block block = event.getBlock();
        if (block instanceof Material.SAND) {

        }```
#

so this doesnt seem to work on blocks

#

but it works on entities

#

what would the block equivalent be

#

to check if a block is sand, that is

quaint mantle
#

Ahh

#

Thank you spinanddrain

last kayak
torn shuttle
#

especially as they provide you with said support

ivory sleet
#

Let’s chill guys

old cloud
#

Only to you because you were a dick to me out of nothing. So I'm sorry for my part.
the end

#

thanks

torn shuttle
#

I'd respond but I've been told if I actually stop when conclure tells me to stop on the 100th time I do so I get conclure's gamer bathwater and I'm not missing out on that

old cloud
#

lol

rough jay
#

with VehicleCreateEvent is there any way I can know how the vehicle was created?

#

because I'm looking to prevent non-op people to place minecarts, boats and others in a certain situation

stoic osprey
#

is there some sort of player event you could use to detect them making a vehicle

opal juniper
#

making a vehicle?

graceful scaffold
#

why isn't there an event that works when you equip a armor

#

i am suffering lol

torn shuttle
#

I hate the way durability loss is handled by the spigot api so I am making a utility class to bypass it, I think I'll call the class Durability and I'll call the method oof

empty gyro
#

how do i actually find the spigot file i need to import into my java package?

torn shuttle
#

the API will tell you but realistically you should be using an IDE that will automatically suggest an import as you type a class

patent horizon
#

whats the method for grabbing a material version of an item from it's string name

empty gyro
#

i am watching a tutorial because am noob and he just told me to go to jenkins and get buildtools but idk if i have to run buildtools to get the API jar or if im missing something

torn shuttle
#

and stop watching yt videos, yt videos suck when it comes to guiding people through code

#

use written documentation and code snippets

patent horizon
#
public class Items {
    public static final Item a;
    public static final Item b;
    public static final Item c;
// and so on``` also would anyone know where the documentation is to decipher this
opal juniper
#

what do you mean

torn shuttle
#

what did you decompile

opal juniper
#

what the hell is an Item

torn shuttle
#

well obviously it's a public static final field in an Items object @opal juniper

#

hope that helped

patent horizon
#

its the nms file

#

for item types

#

so you can do like Item.ab whatever

torn shuttle
#

that doesn't sound right to me but whatever I never bothered with nms code, which is documented here https://wiki.vg/Protocol

#

I'm surprised no one commented about the absolutely insane yt video I posted

empty gyro
#

3hrs of bullshit o-o

patent horizon
#

i doubt anyone here has status

#

social status

empty gyro
#

i mean codelyon's djs tutorials are good

#

but

#

eh

patent horizon
#

people pop in an out of here just for others to answer their questions

torn shuttle
#

what?

#

oh my god this dude is still posting guides, daily

#

I am shocked, he has made nearly 300 identical videos, all entirely nonsensical scams

empty gyro
torn shuttle
proud basin
#

How does one read bytecode?

young knoll
#

Learn what the instructions mean

#

And then just like

#

Read it 5head

proud basin
#

I'm 6head

#

wait what instructions are you talking about

young knoll
#

Bytecode instructions

quaint mantle
#

got a bit to go I see

tranquil viper
#

how do I check if an entity is damageable in the EntityDamageByEntityEvent

#

I know I could just cast it to Damageable but I want to make sure it's actually damageable prior to casting

young knoll
#

instanceof Damageable

tranquil viper
#

I just tried that and it didn't work

#

thats what i originally thought of doing

ancient plank
#

are you sure about that

young knoll
#

Did you import the right damagable

tranquil viper
#

I did not

#

thank you

young knoll
#

Because spigot has two, thanks Obama

tranquil viper
#

lol

round finch
#

Imagine Memorizing the whole Spigot API

young knoll
#

You haven't

#

Peasant

round finch
#

@young knoll you dam right i havn't

#

yesterday i said EntityMoveEvent

#

smh

runic mesa
#

How do i make an enchantment book, and would my idea be useable? My idea is making an enchanted book i can use in a crafting table with a custom recipe to make a completely new item?

#

with the enchantment book

young knoll
#

EnchantmentStorageMeta

#

And yes, use RecipeChoice.ExactChoice

proud basin
#

Does jline compile for you guys?

tranquil viper
#

Which economy plugins are popular that have apis? I want to incorporate some into my project but am not sure which ones to support

visual tide
#

just use vault rsps

runic mesa
#

Any way to use recipe choice with shapeless crafting recipes?

crude charm
#
RecipeChoice item = new RecipeChoice.ExactChoice(itemstackOfItem);

recipe.addIngredient(item);
runic mesa
golden turret
#

hello. i need help to create a level system

#

it will be configurable

#

example: yaml levels: 1-10: 1000 #from levels 1 to 10, each level up will increase the next required xp to 1000 11-20: 2000 #from the levels between 11 and 20 each level up will increase the next required xp to 2000

zenith crescent
#

How can i clone a chunk from one world to another, ping me if you can help 🙂

twilit wharf
#

does anyone know how much of a delay there is between sending a receiving messages between bungee and spigot?

crude charm
#

it depends on alot of factors

patent horizon
#
    @EventHandler
    public void bowShoot(EntityShootBowEvent event) {
        if (event.getEntity().getType() == EntityType.PLAYER) {
            DropItem dropItem = new DropItem();

            Bukkit.getScheduler().scheduleSyncRepeatingTask(Main.get(), () -> {
                if (!event.getProjectile().isOnGround()) {
                    
                } else // Cancel here
            }, 0L, 2L);

        }
    }``` how can i cancel a repeated task?
twilit wharf
crude charm
#

^

patent horizon
#

where do i put the task variable

crude charm
jade perch
#

It's returned from calling the scheduler

patent horizon
#
    @EventHandler
    public void bowShoot(EntityShootBowEvent event) {
        if (event.getEntity().getType() == EntityType.PLAYER) {
            DropItem dropItem = new DropItem();

            BukkitTask task = Bukkit.getScheduler().scheduleSyncRepeatingTask(Main.get(), () -> {
                if (!event.getProjectile().isOnGround()) {
                    
                } else Bukkit.getScheduler.cancelTask(task);
            }, 0L, 2L);

        }
    }```
#

this doesnt work

jade perch
#

You can just use task.cancel I believe

twilit wharf
# crude charm there is no set delay

I am having some issues with sending messages between bungee and spigot, it says that it sends, and says that it receives it, along with the data it receives, just when I try and use it it fails

patent horizon
twilit wharf
patent horizon
#

same thing

#

Variable 'task' initializer 'Bukkit.getScheduler().scheduleSyncRepeatingTask(Main.get(), () -> { if (!event.getPr...' is redundant

jade perch
#

Should give you a recommended change

#

Use this t

#

That

patent horizon
#

lmfao

#

it just deleted all my code

jade perch
#

Savage

#

Idk just ignore it then it's being weird

patent horizon
#

it wont let me build my project if theres errors

#

"int cannot be dereferenced"

jade perch
#

Wtf are you doing

patent horizon
#

projectile particles

jade perch
#

I mean code wise

patent horizon
#
    @EventHandler
    public void bowShoot(EntityShootBowEvent event) {
        if (event.getEntity().getType() == EntityType.PLAYER) {
            DropItem dropItem = new DropItem();

            int task = Bukkit.getScheduler().scheduleSyncRepeatingTask(Main.get(), () -> {
                if (!event.getProjectile().isOnGround()) {
                    dropItem.item(event.getProjectile().getLocation(), new ItemStack(Material.RED_WOOL, 1));
                } else task.cancel();
            }, 0L, 2L);

        }
    }```
jade perch
#

Why are you calling the task an int

#

That's not what it is

patent horizon
#

....

patent horizon
jade perch
#

That's not what he meant

twilit wharf
#

and it works find

jade perch
#

If you're going to do it that way you ant call task.cancel

twilit wharf
#
        int taskone = 0;
        int finalTaskone = taskone;
        taskone = Bukkit.getScheduler().scheduleSyncRepeatingTask(ParkourSystem.getInstance(), () -> {
            if (sw.elapsed(TimeUnit.SECONDS) < 5) {
                p.sendTitle(ChatColor.LIGHT_PURPLE + "NEW HIGHSCORE", "");
            }
            else {
                Bukkit.getScheduler().cancelTask(finalTaskone);
            }
        },0, 45);```
jade perch
#

Do the other way he said

#

Ye that

twilit wharf
runic mesa
#

How would i make my weapon show only one enchant but have a lot

#

like i want it to show a custom enchant

#

and also have it have a lot of other enchants

paper viper
#

AttributeModifier i think?

#

i forgot what its called

#

but one of them is called HIDE_ENCHANTS, but it hides all the normal enchants

drowsy helm
#

Probably an item flag

#

You cant really chose what ones to hide though. Just use lore to replicate it

jade perch
#

Yeah just use the hide enchants then add your own lore or whatever since you want it to be a custom enchant anyway

valid sorrel
#

why is spigot ignoring player.teleport(location)

#

it's not teleporting the player at all

#

oh wait

#

was it thread safe

drowsy helm
#

You shouldnt be teleporting async

valid sorrel
#

aaaahhh

#

ok

#

that's why

drowsy helm
#

It should be giving you an error

valid sorrel
#

no errors tho

#

yup works

digital plume
#

hey everyone- let's imagine I want to create a new fake player

#

specifically an entity that behaves just like a player, an NPC of sorts

#

where would I start in that respect?

young knoll
#

I would use the citizens API

weak mauve
#

use NMS EntityPlayer

#

with nms player u can do many more things

digital plume
#

can anyone list out why I should use any of these?

sullen marlin
#

I would use Citizens too

#

better to use a standard abstraction than make things yourself

weak mauve
#

citizens register entity server side so if you want to make like monster out of it, not suggest

digital plume
#

I see - what does it do?

#

I don't, I just want player-like models

weak mauve
#

so use citizens api

digital plume
#

yep

weak mauve
#

it better than messing with NMS

#

since my player model is a mob so citizens make everything broken apart

digital plume
#

okay

weak mauve
sullen marlin
#

probably? I don't give legal advice here

merry pulsar
#

Hi, I have a simple problem that I can't fix, I'm trying to setup a scoreboard for a player when he joins the server but it's not working.
Code:

    @EventHandler
    public void onJoin(PlayerJoinEvent event) {
        Player player = (Player) event.getPlayer();
        new BukkitRunnable(){


            @Override
            public void run() {
                scoreboardhub(player);
            }
        }.runTaskLater(plugin, 2);
}```
#

Plz i need help

sullen marlin
#

whats the code of scoreboardhub

#

lol

merry pulsar
#

its a normal scoreboard

sullen marlin
#

cant help you with out the code...

weak mauve
#

like an actual function of it

merry pulsar
#
        ScoreboardManager manager = Bukkit.getScoreboardManager();
        Scoreboard board = manager.getNewScoreboard();
        Objective o = board.registerNewObjective("hubsc", "scoreboard");

        Team rank = board.registerNewTeam("rank");
        rank.addEntry(ChatColor.RED + "" + ChatColor.RED);
        rank.setPrefix(ChatColor.translateAlternateColorCodes('&', prefix));

        o.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&bClouds&3MC"));
        o.setDisplaySlot(DisplaySlot.SIDEBAR);
        o.getScore("").setScore(8);
        o.getScore(ChatColor.translateAlternateColorCodes('&', "&7• &bName")).setScore(7);
        o.getScore(ChatColor.translateAlternateColorCodes('&', "&7» &3" + player.getName())).setScore(6);
        o.getScore(" ").setScore(5);
        o.getScore(ChatColor.translateAlternateColorCodes('&', "&7• &bRank")).setScore(3);
        o.getScore(ChatColor.RED + "" + ChatColor.RED).setScore(2);
        o.getScore("   ").setScore(1);
        o.getScore(ChatColor.translateAlternateColorCodes('&', "&bTEST.mysrv.us")).setScore(0);
        player.setScoreboard(board);
    }```
sullen marlin
#

seems ok to me

#

are there any errors?

merry pulsar
#

i don't think so, 1 sec

weak mauve
#

this is the most common situation

merry pulsar
#

yes i did

merry pulsar
# sullen marlin are there any errors?
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_275]
[04:41:18 WARN]: [Lobby] Task #19 for Lobby v1.0.0 generated an exception
java.lang.NullPointerException
        at org.bukkit.ChatColor.translateAlternateColorCodes(ChatColor.java:324) ~[server.jar:git-Spigot-db6de12-18fbb24]
        at me.LBP.Lobby$1.run(Lobby.java:51) ~[?:?]
        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71) ~[server.jar:git-Spigot-db6de12-18fbb24]
        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:350) [server.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.MinecraftServer.B(MinecraftServer.java:723) [server.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.DedicatedServer.B(DedicatedServer.java:374) [server.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.MinecraftServer.A(MinecraftServer.java:654) [server.jar:git-Spigot-db6de12-18fbb24]
        at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:557) [server.jar:git-Spigot-db6de12-18fbb24]```
sullen marlin
#

Imma guess 'prefix' is null

merry pulsar
#

no no 1 sec

sullen marlin
#

well what is line 51?

merry pulsar
#
        LuckPerms API = LuckPermsProvider.get();



        User user = API.getPlayerAdapter(Player.class).getUser(player);


        String prefix = user.getCachedData().getMetaData().getPrefix();```
weak mauve
merry pulsar
#
o.getScore(ChatColor.translateAlternateColorCodes('&', "&7» &3" + player.getNam``` l-51
merry pulsar
sullen marlin
#

Id be surprised if that is line 51

merry pulsar
#

i get owner prefix

weak mauve
#

hmm

merry pulsar
#

or join listener?

sullen marlin
#

no, Lobby

merry pulsar
#
                    p.getScoreboard().getTeam("rank").setPrefix(ChatColor.translateAlternateColorCodes('&', prefix));```
weak mauve
#

the lobby.java line 51

merry pulsar
#
            @Override
            public void run() {
                for (Player p : Bukkit.getServer().getWorld("hub").getPlayers()) {
                    User user = API.getPlayerAdapter(Player.class).getUser(p);
                    String prefix = user.getCachedData().getMetaData().getPrefix();
                    p.getScoreboard().getTeam("rank").setPrefix(ChatColor.translateAlternateColorCodes('&', prefix));
                }
            } //
        }.runTaskTimer(this, 0, 100);
    }```
sullen marlin
#

yes told you that was line 51

#

String prefix; is null

merry pulsar
#

i thought join.class

weak mauve
#

check if the team "team" already exist or not

merry pulsar
#

its "rank"..

merry pulsar
weak mauve
merry pulsar
#

btw

#

it highlights "prefix" string

#

soo how can i fix this? ; v ;

weak mauve
#

where did you declare your "String prefix"

sullen marlin
#

String prefix = user.getCachedData().getMetaData().getPrefix();

#

getPrefix is returning null

weak mauve
#

ye

merry pulsar
sullen marlin
#

idk how to use luckperms API, so its either an issue with that or you didnt define a prefix in your luckperms config

merry pulsar
#

oh 1 sec

#

Do you guys think its because I have a rank with prefix "null"?

sullen marlin
#

yes

weak mauve
#

ye

merry pulsar
#

o-oh...

#

1 sec

sullen marlin
#

add a null check or define a prefix

merry pulsar
#

Ah, it works, it was bc i didn't have a prefix

merry pulsar
#

@sullen marlin @weak mauve tsymm ❤️

weak mauve
#

np

fickle helm
#

hello, I'm making custom spawn eggs and when the user places the egg I want to pass some data to it.
Is there way to associate the spawn egg to the mob spawned from CreatureSpawnEvent ?

summer scroll
vague swallow
#

Can someone explain me how I can charge a CrossbowMeta to an ItemStack?

quaint mantle
#

addChargedProjectile

long elm
#

Hello i want to work with a api to handle data have everyone makes experience with apis in a plug-in ?

ivory sleet
#

Uh like creating an api for other plugins?

plain helm
#

I think the 50% of the people in this server has done an api

#

This percentage does not include me though

long elm
#

Ok here a example :
i Type /Info into the chat
And my plug-in want to get data form my api
So I make a fetch requests in Java on my api and that returns me hello world
So can my plug-in return this data into the chat or whatever

I want to know is this method good to use

ivory sleet
ivory sleet
long elm
#

Yes my own api at the web

ivory sleet
#

Might wanna take a look at HttpUrlConnection if that fits you

long elm
#

so than I wanna know how can I allow a player permissions
i want to know this for my own group system

#

Or a link to the documentation record for permissions

ivory sleet
#

You could use something like Vault API assuming you wanna support generic permission plugins.

#

Or if you create your own permission system, just search "permission" in the javadocs

#

?jd

ivory sleet
#

(First one)

vague swallow
summer scroll
#

I already make sure that we both using the same jar.

chrome beacon
#

1.7 isn't supported

chrome beacon
summer scroll
#

I mean I don't think the version caused it.

quaint mantle
#

Check out polymorphism

sullen marlin
summer scroll
#

craftbukkit

#

eh

#

wtf

#

getbukit is a no no word here?

chrome beacon
#

Yes

summer scroll
#

well i got it from there on the spigot section

chrome beacon
#

And did your client

summer scroll
#

on maven, do i need to specify the scope if i shaded the libs in?

chrome beacon
#

No

summer scroll
#

im just confused on why it throws CNFE but the class is exist when i tried to decompile it with jd-gui

chrome beacon
#

Remapper

#

It's doing something

drowsy helm
#

idk why i read that as "cenfee"

summer scroll
#

and the remapper is from the spigot software?

quaint mantle
#

do you relocate your depenencies

summer scroll
sullen marlin
#

Spigot never had a remapper

#

That's how I know whatever jar you're running is not spigot

summer scroll
#

that's not from my log, i don't have that errors while testing on my localhost

#

might need to ask the tester first

sweet helm
#

i have returned, if anyone recalls, and if you don't recall, ive got a silly project running where i make a computer in minecraft using a plugin to interpret bits placed in the world. every block is a bit. wool is a 1, glass is a 0, the machine operates in 32 bit, the CPU currently works fine, 1 line is 1 game tick, so im editing 32 blocks per tick
,now,
i'm making a GPU, why? because i want to make a computer that resembles a real computer, im looking to find a balance between art and function, if i throw art out the window, i'd obviously not do this, there's plenty of optimizations i could do, but for art it would be cool for the GPU to have all its bits visualized as the cpu ram, anyhow, the GPU is going to draw 128x128 blocks, with 4 bits of color depth.
The GPU is per frame (worst case) changing 128x128x4 blocks to represent every pixel. This absolutely lags out the server and client.
I could reduce it to 128x128 blocks and say "every block represents 4 bits" but i feel like this is a bit of a cheat.
Im looking for a way to reduce the lag, as much as possible, without comprimising the number of blocks used by the GPU.
If i can't find anything, i'll give into reducing, as i want a playable game while this runs... but i wont back down easily 😉
all suggestions are super welcome! My goal is 30+ fps screen realtime computer

sullen marlin
#

1281284*30=2 million

drowsy helm
#

thats alotta blocks

sweet helm
#

almost forgot, a GPU has a front and back buffer + a few registers for pointers.. so i actually need 128x128x4 x2

sullen marlin
#

You want to update 2 million blocks a second

#

Ain't happening

drowsy helm
#

and correct me if im wrong but you can't update blocks more than 20 times a second

sweet helm
#

65.536

#

not 2mil

#

but yes, a ton of blocks

sullen marlin
#

30 fps

#

= 65k * 30

#

= 2 million

sweet helm
#

and yes 20times/sec if you use the standard TPS, but packets can be sent whenever

#

ah i see, then yes

sullen marlin
#

Consider using a map instead

drowsy helm
#

seems a bnit excessive

sullen marlin
#

You can maybe get close to 30fps on that

sweet helm
#

i thought about maps, but i don't think i can update those 30/sec ?

sullen marlin
#

There is 0 chance of you getting more than like 1 fps with blocks

#

You can update them a hell of a lot faster than blocks

summer scroll
#

is this the sync thing

#

sync all of movements, blocks on multiple servers

sweet helm
#

how do you see the map working? custom maps for the screen? what about the ram bits? maps too?

drowsy helm
#

yes just a renderer for the maps

#

didn't you say bits are physical blocks?

#

just the display can be a map

sullen marlin
#

You can do your program in blocks

sweet helm
#

and then the ram in maps on the ground?

sullen marlin
#

That just requires reading once into memory

#

Either way you're writing a plugin so everything is actually going to be in java memory

#

You'll just be reading or writing it to the world every now and again

sweet helm
#

my goal was for every bit of information to be in the world

#

thats the entire "so many blocks" thing

drowsy helm
#

well you could still have a display like that buy 128x128x4 is far too much

sweet helm
#

i can agree its a ton lol

sullen marlin
#

You simply can't update the world fast enough

#

Look at sethblings Atari emulator, it's like one frame every 4 hours

#

And you want 30fps

sweet helm
#

ive seen it, i never said id reach it

drowsy helm
#

even 1fps is too taxing

#

with that many blocks

sweet helm
#

what about hex?

sullen marlin
#

Be realistic

#

I realise he used command blocks, but your goal is still half a million times faster than his was

drowsy helm
#

there are a few methods where you can place a few million blocks fast but not <1s fast

sweet helm
#

if i just make my goal 1 frame per minute thats nothing to say woaw to (even though it is) it doesn't speak to people tho

drowsy helm
#

not to mention client rendering

sweet helm
#

im thinking maps right now... maps need data to render the.. well.. map

drowsy helm
#

i think a map would do far more justice than a laggy block screen

sweet helm
#

nono im thinking, maps need data to display their pixels right?

#

the pixels can be 1's and 0's

#

then, the itemframe rendering the map can just be updated

#

maps are 128x128 pixels

drowsy helm
#

you can use a MapRenderer

#

you don't need a physical llocation if thats what you mean

sweet helm
#

yes, keep the bits internal in java, but display them in the world

#

id love for them to be "read" from the world tho, as in, find the itemframe, read the map... so it still touches the world, and doesn't just display to the world

#

still feel like the map thing is a bit of a cheat... but you're right the blocks are too much...

drowsy helm
#

its your best compromise

sweet helm
#

how many blocks could be set <=3ms

#

just... wondering here

sullen marlin
#

Hundreds at best

drowsy helm
#

not sure honestly, i've seen methods which allow 15m in a second or so

#

not sub millis time however

sweet helm
#

15m/sec is 15k per ms.. right?

#

or i just brainfarted

sullen marlin
#

No way those methods can update client side in that time

drowsy helm
#

Sorry- claim to allow

#

I havent verified myself

sweet helm
#

alr

drowsy helm
#

But yeah theres also client side rendering

sweet helm
#

16 variants of wool....

#

thats 4 bits... thats ... still too much

#

128x128 still..

sullen marlin
#

What is the point of 30fps anyway

#

If your point is a physical demonstration, why go so fast you can't see

sweet helm
#

oh we haven't gotten to the point of 30fps yet yes

drowsy helm
#

Yeah what minecraft demo would benefit with 30fps

sullen marlin
#

Yes but why even have that as a goal

drowsy helm
#

I think even 5 is good enough

sullen marlin
#

The point of doing it in the world is so that people can see what's happening, right?

drowsy helm
#

Assuming it’s just a generic graphics processor

sweet helm
#

the point isn't showing the 1 bit change, the point is seeing all the bits change while running some program on that pc at 30fps

sullen marlin
#

So go at a speed where they can actually see what's happening

#

But all the bits changing at that speed is just a mess

#

It's like looking at an oscilloscope with the divisions wrong and just seeing static

sweet helm
#

the idea is to find structure in chaos by doing this.. thats the artistic part

#

the entire reason why im doing it is to find structure in chaos, some bits wont change, some will constantly

#

what user input does what, what changes when i hit this button, what when i hit this one instead?

#

regardless, the 30fps dream is eventually to port something over to the pc and run it live

drowsy helm
#

don't forget reading from the world can become taxing

#

so you need to do that efficiently

#

or pre bake it or something

sweet helm
#

compiling it in some way would be more efficient yes..

drowsy helm
#

will the player be able to see memory changes in real time?

sweet helm
#

that was the idea yes

#

the idea was to have your screen in front, and if you look below you see the memory bits twitching and flickering away as you play your emulated game

drowsy helm
#

right

sweet helm
#

thats the eventual goal

drowsy helm
#

memory will be in hex i assume?

sweet helm
#

right now its binary

#

but considering its 128x128x4x2 for jsut back and front buffer

#

ill have to move to hex

#

to cut out the x4

#

still leaving a huge number...

#

so im even considering going over hex to just ram in more bits into 1 block

drowsy helm
#

well yeah naturally hex would be more compact

sweet helm
#

the map idea sounds good, im just not too big of a fan as it takes away the read/write from the world... while my entire goal was to feel "inside" the computer, and see it all happen

drowsy helm
#

i mean everything can be in the world except the screen

#

its not like they are gonna be interacting with the screen aside from looking

sweet helm
#

im willing to sacrifice the screen into a map

#

... i think

#

maybe a few maps

drowsy helm
#

yeah like 4x4 or something should suffice

#

maps are already pretty dense

sweet helm
#

(keyboard is gnn be in the world so seeing your screen and going for that Z button will be hard lol)

drowsy helm
#

yeah thus why i think 30fps wont matter too much

#

input will be slow anyway

sweet helm
#

effect speed maybe (dont know yet, play with friends? lol?)

#

im trying to find some blocks that can bump up 1 location to 8 bit

#

so a byte per block

drowsy helm
#

gotta make an OS, transport protocol etc

sweet helm
#

256 bits into 1 block... any idea how?

drowsy helm
#

well 1 hex digit = 8bits

sweet helm
drowsy helm
#

ah right

sweet helm
#

im looking for 1 byte per block now

#

since blocks/tick is the limiting factor

#

i have to downscale

drowsy helm
#

256 bits in 1 block would be like base 20 or some shit

#

a lot of blocks to memorise

sweet helm
#

the programming could be done in binary/hex

drowsy helm
#

wait no far more than 20

#

idk its a lot

sweet helm
#

the ram needs to condense

#

we wont be "reading" the ram as humans

#

its just visuals

#

the program will tho..

drowsy helm
#

yeah

#

idk you can make your program auto assign blocks

#

do the players need to know which block attributes to which of the 256 bits

sweet helm
#

the 'get block by id' is deprecated tho (fuck)

#

in the ram? no.

#

purely visual.

#

the flickering will be the visual queue of "you changed this"

#

not the "how much is this"

drowsy helm
#

yeah

sweet helm
#

it would be nice to have 256 block colorpallet that just rainbows or something

drowsy helm
#

theres a formula that gives you the amount of bits for each base number system

#

i forget what it is

sweet helm
#

so you have an idea how high or low the value is

drowsy helm
#

but that'll give you your answer

sweet helm
#

idm what base it is, im looking for 256 blocks rn ^^'

#

the base bit is just some math i can do in the plugin (not afraid of that stuff)

#

its the interaction minecraft/plugin that scares me, idk what functions are taxing etc

#

thats mostly my questions here 🙂

drowsy helm
#

yeah

#

yeah but i think making one block = 256 bits would limit the reads to the world and thus speed it up dramatically

sweet helm
#

yes

drowsy helm
#

not sure what your cpu's clockrate would be aswell

#

would dramatically effect your performance

sweet helm
#

currently im doing 1 line of code per tick, wich is on avg 2 reads 1 write per line

#

ex: ADD X Y would do read X read Y write result into X

drowsy helm
#

gonna need far more than that

sweet helm
#

oh yes, but thats no issue, ive ran the CPU at 1000 lines/tick, worked fine except the world lagging a bit behind with block updates

#

internally the blocks were set, and executed correctly (so >1 change of block state per tick is fine)

#

the world lagged slightly, wich is due to the 32x3x1000 blocks updated in 1 tick

#

96K

#

but no errors...

#

thing is that it all calculates fine, its just the world updates, so its gnn be a hunt for 256 blocks

#

256 blocks that gradient from one color to the next...

sweet helm
#

how bad is the lighting updates in 1.17.1?

chrome beacon
#

Wdym bad?

#

Performance?

sweet helm
#

yes

chrome beacon
#

If you use Paper with the Starlight engine it's quite fast

sweet helm
#

changing a block only updates the lighting if it goes transparent to solid or back?

#

or on every block change?

chrome beacon
#

🤷‍♂️

sweet helm
#

alright, thanks for the input tho, starlight is a mod, so ill consider it (trying to keep clients vanilla)

chrome beacon
#

Starlight is a mod and a part of Paper

#

(Clients don't need it)

sweet helm
#

thanks! ill check it out : )

quaint mantle
ivory sleet
quaint mantle
#

xD

proud basin
#

the top of the L and bottom of N is cut off for me

quaint mantle
#

Anyway how can I properly use something along the lines of java Class b = ItemSword.class; ItemStack test= new ItemStack(Material.IRON_SWORD); if(test instanceof b){ System.out.println("test is in fact an ItemSword"); }

#

Ofcouse I can't do it like that since you can't compare 2 objects like that

ivory sleet
#

Class::isInstance exists

#

which is basically instanceof

#

however

#

since test is of the type ItemStack, ItemSword.class.isInstance(test) would always be false since test instanceof ItemSword is always false

quaint mantle
#

Yeah that's what I was going to ask

#

Basically I have these classes that implement a Kit class, I want a way to check if the main weapon of a kit is for example a sword, axe, bow etc

ivory sleet
#

ah

quaint mantle
#

Ofcourse those weapons are variable like Iron swords, diamond ones etc, so simply comparing the itemstack itself isn't a great option either

ivory sleet
#

Maybe have an nbt tag where its value would be the name of the kit (on the itemstack)

#

then just get and compare

quaint mantle
#

The itemstacks itself are fetched from the kit's config files respectively though, though I could just apply the meta once fetched.

#

I'll try that

ivory sleet
#

yuh

quaint mantle
#

Isn't checking the meta like that very resourceheavy though

#

This'll be checked every interaction

ivory sleet
#

depends, sort of

#

no

#

well

#

It scales decently

quaint mantle
#

Then again I'd still run into the problem lol

ivory sleet
#

assuming its not for a single backend server with like 500 concurrent players

quaint mantle
#

Because what if for example my knight kit has a bow aswell, i'd still have to somehow find the main weapon

ivory sleet
#

yuh

#

anyways, if you run into optimization problems, then try resorting to nms

#

though I'd advice trying out just the api unless you encounter problems

quaint mantle
#

Might just create an enum for each kit saying it's a SwordKit or something of the sort, might be more efficient that way.

#

yeah i'll do that

#
    public Knight(Player player) {
        this.player = player;
        initialize(this.getClass().getName().toLowerCase()); // loadout from file
        setKitType(KitType.SWORD);
    }``` something like that
quaint mantle
ivory sleet
#

👍

gusty bough
#

Do someone know how to get a Player from a IUser (from EssentialsX) in a non deprecated way?
IUser#getBase() is deprecated

quaint mantle
#

Wait what how do I even compare an itemstack against an ItemSword

ivory sleet
#

you need to determine yourself what you want to compare

#

but ideally

#

interface ItemType
compare(o);
class ItemSword implements ItemType

ItemStack -> get some "key to value" id -> the value becomes an id to determine what type of ItemType should be used for comparison, with for instance a Map<Id,ItemType>

#

or smtng

mortal hare
#

is there any way to obtain entity tracking distance cleanly? I mean i could get spigot.yml yamlConfiguration and get the key through there, but that's messy a bit, what im asking if API has some kind of method to obtain it in one liner

ivory sleet
#

afaik nope

ivory sleet
mortal hare
gusty bough
#

there is not :x

#

But thanks

quaint mantle
#

How can i sell premium plugin on SpigotMC?

chrome beacon
oblique pike
#

Is there a way to get default item attack damage value?

oblique pike
stone sinew
#

getAtributeModifiers().get(Attribute.GENERIC_ATTACK_DAMAGE) I think.

oblique pike
#

Its modifier

#

Not the base value

#

Item has no modifiers by default

stone sinew
#

May need to look into NMS then

oblique pike
#

Nah, very little project to use nms in it lmao

fiery harbor
#

If I am not wrong, you can cast the ItemMeta to an org.bukkit.attribute.Attributable and work with this. Or you can simply pack these values into an enum as they are always the same for each weapon

stone sinew
#

Yall all threads so far about it either say what I posted above or work with nms

quasi flint
#

nms cool

oblique pike
fiery harbor
oblique pike
#

Just was wondering maybe there is some not stupid way of doing that

quasi flint
fiery harbor
oblique pike
quasi flint
fiery harbor
fiery harbor
#

hmm ok

oblique pike
#

Welp, I guess then the only way for me will be doing that fucking map of materials and damage

#

Gigasad

fiery harbor
#

Have fun

vague swallow
young knoll
#

You only need to set one

#

Since the crossbow meta is also ItemMeta

chrome beacon
vague swallow
#

But I can't do things like .setDisplayName() with a CrossbowMeta

#

@chrome beacon

quasi flint
#

sure thing u can

chrome beacon
#

^

acoustic widget
#

Hello i'm looking for communicate externaly with my plugin. I have a website and need to send json data to my minecraft server, and the server must send back json response. What should be the best to do ?
I think rest api should be good, need your help for where i need to look

ivory sleet
#

To build the rest api or just what to use to talk with the rest api?

acoustic widget
#

i dont know if building a rest api is good for my needs or if i should use something else

#

i know how to comunicate with

ivory sleet
#

I mean, you’re bound to use a web api if it’s communication between the website and your plugin I guess

acoustic widget
#

yes right

ivory sleet
#

Though have you looked at graphql?

acoustic widget
#

no i'll take a look. ty

mortal hare
#

@kind patrol

#
    public PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.a reason, float value) {
        this.r = reason;
        this.s = value;
    }
#

use these constructor arguments

#

to construct one

#

modern minecraft server versions include a way to contruct packets without reflections

#

try this:

PacketPlayOutGameStateChange packet = new PacketPlayOutGameStateChange(PacketPlayOutGameStateChange.e, 1.0F);
#

then send it by getting NMS player's connection object

#
PlayerConnection connection = ((CraftPlayer) player).getHandle().b;
connection.sendPacket(packet);
#

(this is 1.17.1 obfuscation)

quaint mantle
#

(use specialsource)

tardy delta
#

@sullen marlin here is your uwu emoji UwU

#

ah i'm not in general

crisp arch
#

im confused about plugin.yml and Bukkit.getPluginManager()

#

do you only have to register stuff in one of them?

#

or both?

#

or plugin.yml only?

#

if i'm doing Bukkit.getPluginManager().setExecutor, do I need to also add the command in plugin.yml?

#

if i'm registering a permission in Bukkit.getPluginManager().addPermission, do I also need to add the permission in plugin.yml?

obsidian bison
#

For permissions, they can be absent from plugin.yml if you check permissions in the command executor.
For commands, if you don't register the command in plugin.yml then Plugin#getCommand(String name) will return null.

crisp arch
#

ok, that clears it up a lot

#

so permissions dont have to be registered? just check it during CommandExecutor right?

obsidian bison
#

Yeah if you use Player.hasPermission() it will check if the player has the permission node, they don't have to be registered in plugin.yml.
They just need to be assigned to players using the Permissions plugin

crisp arch
#

ok

#

sounds good

eternal oxide
#

If a plugin adds permissions they shoudl be registered in your plugin.yml

#

if they are not a perm plugin will not know about them unless you specifically add them

tranquil viper
#

is it bad to have most of my variables inside my main class

#

with getter and setter methods

ivory sleet
#

Probably yeah

tranquil viper
#

I need them to be global tho so I can use them in different classes and when I put them in different classes I have a bunch of issues

ivory sleet
#

A class should only change for one major reason - single responsibility principle. Whether that concerns you or not is up you to decide.

maiden mountain
#

Organizing your code files is one of the important things

ivory sleet
#

No no no global will make your code fragile

#

You’ll get in a state where you change one feature, another irrelevant feature breaks.

tranquil viper
#

it’s so hard to explain but it doesn’t work when I put them in different classes and then try and access them

ivory sleet
#

Also your main class is considered your highest ordered class, and has the purpose of setting up all the other classes up with their intended dependencies. Making it a data/context object (like storing a lot of state in it) may violate your class hierarchy, as you will have to make a lot of other classes depend on your main class.

ivory sleet
tranquil viper
#

Ok here goes my best example:

Main class:
boolean isRunning = false

Command Class to start running:
plugin.setIsRunning(true)
plugin being an instance of my main class

Completely different class

//random event
if(plugin.isRunning()) {
//do something
}
#

sorry for the bad format i’m on my phone lol

#

anyways that’s the main idea of it, if I put the “isRunning” boolean in the command class then if I try and get it from the event class, it is always false even if I set it to true

#

Maybe I’m doing some basic java thing completely wrong

hasty prawn
#

You definitely have some misunderstanding if you think you're setting it to true and it returns false

tranquil viper
#

That code above would work

#

but if I set it to true in the Command class then my events class always returns false

maiden thicket
#

🤨

tranquil viper
#

I must be messing up some basic java concept right?

maiden thicket
#

where do u set it to true

#

show

tranquil viper
#

if I were to have the isRunning boolean in the command class and set it to true in the command class then it would always be false in the event class

#

it makes no sense to me

maiden thicket
#

show the code where u set it to true

#

and show your setter method

tranquil viper
#

I’m not on my pc rn so I can’t but the setter would be public void setIsRunning(boolean isRunning) { this.isRunning = isRunning; }

maiden thicket
#

show code where it is set to true when ur at ur pc

tranquil viper
hasty prawn
#

In your event were you creating a new instance of the Command?

#

Because that would be why it was returning false.

misty current
#

can I somehow change an annotation by overriding? I have these 2 interfaces

public interface DefenseEnchant extends Enchantment {

    void onDamage(@Nullable LivingEntity attacker, @NotNull LivingEntity defender, int level, double damage);

}

public interface DefenseFromEntityEnchant extends DefenseEnchant {

    @Override
    void onDamage(@NotNull LivingEntity attacker, @NotNull LivingEntity victim, int level, double damage);

}

and i want the overriding method to have a @NotNull annotation since in DefenseFromEntityEnchant, the attacker can't be null

tranquil viper
quaint mantle
#

no not really

quaint mantle
misty current
#

what should I do then?

#

make them not inherit from eachother?

quaint mantle
misty current
#

ah

#

that works

#

thanks

quaint mantle
#

lol

#

No

misty current
#

ima just slap an assertion

#

ez

quaint mantle
#

reqnonnull

tardy delta
lavish hemlock
#

there are different implementations of nullability across the JVM

twilit wharf
#

I am sending a message to my bungeecord plugin on the proxy, and it only responds the second time the message is sent

chrome beacon
#

Show code

twilit wharf
#

that is not all, just the main bits

mellow flower
#

Guys How can I run a scheduler only 1 time I mean the scheduler will run if there isnt another one

#
new BukkitRunnable() {
                    
                    @Override
                    public void run() {
                    board.clear();
                        board.setAll(ChatColor.DARK_AQUA + "" + ChatColor.BOLD + "     Remiel", "    ",
                                ChatColor.GOLD + "Akçe ⛁" + ChatColor.WHITE + money_formatted, "", ChatColor.GRAY + player.getName(),
                                ChatColor.DARK_GRAY + formatter.format(date), ChatColor.AQUA + "mc.moonnw.xyz"

                        );
                    }
                }.runTaskLater(f, 80L);```
#

I want to check if runnable is running and if is not I will create a new runnable

#

how can I do that?

echo basalt
#

Why can't you just create a new instance at the start?

wide creek
#

I have to load a lot of chunks, how can I spread the work over few ticks?

        Logger logger = PerPlayerBorder.plugin.getLogger();
        World world = Bukkit.getWorlds().get(0);
        int x = 0;
        int z = 0;
        while (true) {
            x = x + 16;
            if (z > 5000) {
                break;
            }
            if (x >= 5000) {
                x = 0;
                z = z + 16;
                continue;
            }
            Chunk c = world.getChunkAt(x, z);
            Block block = c.getBlock(0, 1, 0);
            if (block.getBiome() == Biome.FOREST) {
                 //saves the coordinates in a file
                }
            }
    }
hazy vale
#

I have this problem with "BlockFertilizeEvent" event. As you can see normal spruce tree's are not growing over the border but the azalea trees are still growing over the border.

What event do I need for the azalea trees growing?

manic furnace
#

How can i make a subcommand like gamemode and than you can select an other command. And i do not want to make this with args

hasty prawn
#

Args are your sub commands

#

You don't have a choice

echo basalt
manic furnace
echo basalt
#

tab completion

hasty prawn
#

^

manic furnace
#

Thats with args

hasty prawn
#

Yeah...?

echo basalt
#

what do you want us to do?

#

Forward you to a command framework?

#

That's literally how it's done

manic furnace
#

I mean its blue when you enter args. Not like the sub command creative from the gamemode commnd.

echo basalt
#

That's because you didn't handle it correctly

#

Just google it, you're being quite vague

manic furnace
#

How should i handle it than?

echo basalt
#

¯_(ツ)_/¯

hasty prawn
#

Are you just trying to make your sub commands blue instead of red?

manic furnace
#

I tryed a bunch of tutorials and always got the same result

echo basalt
#

returning null makes it red

#

returning an empty list, or a list containing what the player typed makes it blue

wide creek
echo basalt
#

Kinda what you're doing

manic furnace
echo basalt
#

🤦

#

Let me grab my crystal ball brb

hasty prawn
#

It should return a list with all your valid sub commands

manic furnace
#

But when i hit tab its blue instead of gray

twilit wharf
hasty prawn
echo basalt
#

Did you register your channel on the messenger?

twilit wharf
echo basalt
#

It works on a weird way where you can't call the code directly, and must implement messaging to yourself

manic furnace
echo basalt
#

Bungee messages aren't received if there's no players online

hasty prawn
echo basalt
#

This is why I usually don't like this hassle and decide to just redis

manic furnace
#

1.17

twilit wharf
hasty prawn
#

Send ss

twilit wharf
feral yoke
echo basalt
#

java -jar BuildTools.jar --rev 1.17.1

hasty prawn
#

And add mavenLocal() to your repositories

manic furnace
manic furnace
echo basalt
#

you can clearly see it on the right

feral yoke
#
dependencies {
    implementation 'org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT'
}```
twilit wharf
#

not implementation

feral yoke
#

I have already reload gradle

echo basalt
#

both work

#

Send your full build.gradle

feral yoke
twilit wharf
#

also make sure you have this repo: maven { name = 'spigotmc-repo' url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/' }

feral yoke
#
plugins {
    id 'java-library'
}

group 'Agent'
version '1.0-SNAPSHOT'

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

dependencies {
    implementation 'org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT'
}

processResources {
    def props = [version: version]
    inputs.properties props
    filteringCharset 'UTF-8'
    filesMatching('plugin.yml') {
        expand props
    }
}
hasty prawn
#

Yeah, run BuildTools and add mavenLocal

echo basalt
#

thing is

#

the first maven repo has what he's looking for

lone remnant
#

I am trying to code a lifesteal plugin. principle is to add one heart to a players max health if he kills someone and to remove one heart of a player that gets killed. my code is on github ||https://github.com/HealingArcYT/Lifesteal|| and it does only work kinda

feral yoke
echo basalt
hasty prawn
#

I never bother to use the public repos

feral yoke
#

yes

#

is good

twilit wharf
hasty prawn
# echo basalt

Also wouldn't that require he use those random numbers at the end

feral yoke
#

MavenlOCAL

#

thank 😉

echo basalt
hasty prawn
#

🤷‍♂️

echo basalt
twilit wharf
lone remnant
echo basalt
#

Makes the code 20x cleaner

lone remnant
#

yea, but doesnt make it work though

echo basalt
#

Makes it easier to see what's going on

#

You're listening to PlayerDeathEvent instead of EntityDamageByEntityEvent

lone remnant
#

ok, would that make it easier then?

wide creek
# echo basalt You can't really do this async, generally I loop on the main and add chunk snaps...

Something like this can work? I never worked with threads before

        loadChunk t1 = new loadChunk();
        t1.start();
        Logger logger = PerPlayerBorder.plugin.getLogger();
        World world = Bukkit.getWorlds().get(0);
        int x = 0;
        int z = 0;
        while (true) {
            x = x + 16;
            if (z > 5000) {
                break;
            }
            if (x >= 5000) {
                x = 0;
                z = z + 16;
                continue;
            }
            ChunkSnapshot chunkSnapshot = t1.get(x, z, world);
            if (chunkSnapshot.getBiome(x, 30, z) == Biome.FOREST) {
                //save
            }
        }
    }
}
class loadChunk extends Thread {
    public ChunkSnapshot get(int x, int z, World world) {
        return world.getEmptyChunkSnapshot(x, z, true, false);

    }
}
echo basalt
#

no

wide creek
#

good to know

#

what i have to fix?

lone remnant
echo basalt
#

See if you can figure what it does

wide creek
#

is it normal that is tagged as C++?

echo basalt
#

btw ChunkPosition is a custom class I made

wide creek
#

what the script supposed to do ?

echo basalt
#

I use bitshifts because I'm stupid and can't bother making code readable

#

¯_(ツ)_/¯

#

4 means /16

#

<< 4 means *16

#

| is like an add

#

& is like a %

#

See if you can guess

lone remnant
echo basalt
wide creek
echo basalt
#

Not quite but close

#

There a BLOCK_RANGE double

#

It gets every block in that radius, starting on an origin

wide creek
#

it gets all block in a range?

echo basalt
#

yeah

#

Async, does some material checks and adds the block location to a list

#

Each chunk on its own thread

lone remnant
# echo basalt instead

but doesnt that act like health boost where you cant regen the extra hearts once lost or doesnt it even not allow anything higher than the max or doesnt it even also set the current health to that? bc it should remain the health, but the max health should change

echo basalt
#

you now have 10 hearts

#

let's say you have 10 hearts and you call player.setHealth(22) (11 hearts)

#

you now have an exception and 10 hearts

lone remnant
#

yea, thats NOT what should happen

echo basalt
#

set the GENERIC_MAX_HEALTH attribute to whtever then

lone remnant
#

when you have max health of 20 (10 hearts) you get max health of 22 (11 hearts) once you killed someone

lone remnant
echo basalt
#

on top of setHealth

lone remnant
#

and there should not be a healing once you kill someone

#

so max health 20, health 4 before, after kill max health 22 current health 4, for example

wide creek
echo basalt
#

A vector is basically a location without the world factor

#

a 3D point

proud basin
#

is bytecode the only way to read through a jar file

quaint mantle
quaint mantle
proud basin
#

That defeats the purpose on what im doing

quaint mantle
#

What are you doing

echo basalt
#

We can assume a line that starts in 0,0,0 and ends at your position, that's a line segment with direction

gray crypt
#

Is this triggered by END_GATEWAYs?
I can't quite tell

#

Not sure if it's just nether portals or something else.

echo basalt
#

should be

quaint mantle
echo basalt
#

Yes

#

But if you read the code / internals, it's just 3 doubles (x, y, z)

#

In that case, you can also say a location is a segmented line with direction

quaint mantle
#

Thats different concepts, and if they look similar that doesnt means they are same

echo basalt
#

A vector pretty much has 2 definitions

#

They both compliment each other

quaint mantle
#

Can you google a second definition of vector for me

proud basin
quaint mantle
#

Well, yes, bytecode is the way to go

proud basin
#

nvm

sullen marlin
#

well what are you trying to do exactly

sullen marlin
#

what things

proud basin
#

argument prints

sullen marlin
#

wdym print?

proud basin
#

System.out.println

sullen marlin
#

just search the class file for 'println'

#

itll be good enough

proud basin
#

Don't I still need to use bytecode?

waxen plinth
#
String str = "println";```
waxen plinth
sullen marlin
#

not if thats all youre doing

echo basalt
#

isn't System.out a public output stream?

waxen plinth
#

Though why are you trying to do that

#

You can do System.setOut to intercept calls to println

proud basin
#

Assignment and I have to use bytecode

ivory sleet
#

pog

steady rapids
#

what is the best way to check if event.getClickedBlock() is a sign?

#

the only ugly way I found is this:

String blockName = event.getClickedBlock().getType() + "".toLowerCase();
   if (blockName.endsWith("sign")) {
}
paper viper
#

Please DO NOT do that

#

lmfao

steady rapids
#

i know haha

paper viper
#

just get the material of the clicked block

#

and check if it equal to sign material

young knoll
#

There are a lot

#

Use an enumset and contains

stone light
#

for coding a 1.16 plugin should I do it in jre 15 or jre 8

young knoll
#

Is it public or private

stone light
#

currently it will be just for one server but I might make it public in the future

young knoll
#

Probably 8 then

stone light
#

okay thanks

runic mesa
#

Whats an event i can use like EntityDamagebyEntityEvent for death?

young knoll
#

I mean, you can use that event

#

Or you can use the EntityDeathEvent and event.getEntity().getLastDamageCause()

runic mesa
#

ty theres .getKiller too!

young knoll
#

Only if the killer is a player, yes

patent horizon
#

how can i grab a random wool color

young knoll
#

Version?

young knoll
patent horizon
#

cuz now its just independent material ids

young knoll
#

Yeah it used to be metadata

olive valve
#

i am having problems with reloading my config.yml, it wont reload with reloadConfig() can someone help?

tranquil viper
#

If it's not reloading then you probably did something wrong

young knoll
#

Gonna need more information than that

#

Or some code

olive valve
#

ok my Command Class: ```private Plugin plugin = CombatLoggZ.getPlugin(CombatLoggZ.class);

String noPerms = ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("NoPermissionsMessage"));
String reloadMessage = ChatColor.translateAlternateColorCodes('&', plugin.getConfig().getString("ReloadMessage"));
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

    Player p = (Player) sender;
    if(p.hasPermission("combatloggz.reload")){
        p.sendMessage(reloadMessage);
        plugin.reloadConfig();
    }else {
        p.sendMessage(noPerms);
    }

    return true;
}```