#help-development

1 messages · Page 482 of 1

dark arrow
#

does using old installer gives older version?

remote swallow
#

you can do it without

#

settings/appearance/system updates/updates

quaint mantle
#

can anyone help me?

tender shard
#

no, you didnt ask any question

quaint mantle
remote swallow
#

yeah

#

dont ask to ask

tender shard
#

?ask

undone axleBOT
#

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

dark arrow
remote swallow
tender shard
#

just use jetbrains toolbox

dark arrow
#

oo found it , my bad

heavy mural
tender shard
#

have you tried to set a background color with .fromARGB(0,0,0,0)?

heavy mural
#

Good one, I will give that a try instead 🫡

#

It has done the job

#

Tysm :D

cobalt thorn
#

Hi, im using the click event for a map, but when i left click is not detected but the right is correct

tender shard
#

?paste your code

undone axleBOT
tender shard
#

probably there just is no left-click event for the right hand

#

iirc you can only use the offhand item by right-clicking, not by left clicking

cobalt thorn
#

so what action i can use as a substitute shifting?

livid dove
#

What I tried to suggest is divide it by 45, then round up or down to the closest 45 degrees. 🤷‍♂️

E.g 120 degrees

Int startingAngle= Math.ceil(angleFacing/45)*45.

#

Now I just realised round is better lol

#

So.it will snap to the closest 45 degrees

#

With the power of math I just bonked a switch case into one line 😎

young knoll
#

Dear god I can picture it

#

int value = flag ? 1 : flag2 ? 5 : flag3 ? 7 : 0

dark arrow
#

oh no , i forgot what was gradle and marven

quaint mantle
#

dm me if anyone can help me

remote swallow
#

?ask

undone axleBOT
#

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

remote swallow
#

personal preference

young knoll
#

Marven is the best build tool

tender shard
#

My neighbor is called Marvin

#

He builds walls instead of java projects though

livid dove
young knoll
#

Most users are brick walls

tender shard
livid dove
#

The help-development try not to be a brick wall when given an answer to your question challenge

livid dove
livid dove
young knoll
#

Okay but why it no load

livid dove
#

"That isn't a code steve you literally wrote a wish list of features in a word doc and threw it into intellij"

tender shard
livid dove
young knoll
#

I want a man named Marvin to do all my compiling for me

livid dove
#

I'll legally change my name if u pay me.

tender shard
#

I‘d pay 7€ for this

livid dove
#

But fr one of yall better make a maven qol plugin for intellij and call it Marvin right now!

tender shard
#

9€ if you do it today

quiet ice
tender shard
livid dove
tender shard
#

marvin doesnt know what maven is

#

nor IJ

#

fuck marvin

livid dove
#

Also u never commented on my 45 degree fix.

WITNESS ME! 😭

tender shard
#

well it wasn't me who needed it lol

livid dove
#

Don't make that poor man do a giant ass switch case kmao

remote swallow
#

this is a fine ternary operator

#

this is not

livid dove
#

Guh ?

remote swallow
livid dove
#

The bit he was struggling with was getting his snapped 45 degrees

#

Not the left or right b

#

Bit

dark arrow
#

hey , i test my plugin on a online server so is there any way to automatically upload the plugin instead of dragging it on the website after building?

terse ore
#

I used gradle tasks and a python script

tender shard
#

I'd just sshfs the server, then use the maven-jar-plugin to change the output dir

edgy crystal
#

Hey, i am using version 1.16.5.
I have an error in this code:
PersistentDataContainer test = block.getState().getPersistentDataContainer(); ("Cannot resolve method 'getPersistentDataContainer' in 'BlockState'")

but if i use instead this:
PersistentDataContainer test = block.getState().getChunk().getPersistentDataContainer();

it works. but i dont want to save the whole chunk, only the block.
Any ideas?

rotund ravine
#

You gotta make sure le block

#

is a TileState

#

TileEntity

#

etc.

#

If not, it does not have a PDC

orchid gazelle
edgy crystal
rotund ravine
#

The chunks PDC is fine

#

Just make sure to mark the relative location somehow.

orchid gazelle
#

Chunks can have PDC?

rotund ravine
#

ye, world too.

orchid gazelle
#

lol

#

Can areas of blocks have too?

rotund ravine
#

If it's within a chunk

remote swallow
#

?blockpdc

undone axleBOT
orchid gazelle
#

Bigger

remote swallow
#

that for specific blocks that dont have a container

livid dove
#

If ur at 50, ud get 45

edgy crystal
earnest wasp
#

Hey, What is spigot API 1.19 for actionbar please

livid dove
orchid gazelle
livid dove
orchid gazelle
#

Then get for int(angle)

#

Yeah that works too

#

How do I now find out the vectors, find out by doing?

#

trying out lol

livid dove
#

How do you mean what are u trying to do again and what data do you already have?

orchid gazelle
#

I just have the player and wanna know what Vector I need to apply to a location to move it left/right relative to the player's direction

livid dove
#

And do you already have a method for what direction they are pointing?

#

Ngl this sounds like a , just to be utterly sure it is what we think it is, a drawing a diagram situation

grizzled oasis
#

why decompiled class can be found $ number
Like a class named Test and another in the same directory called Test$1 but totaly different

remote swallow
orchid gazelle
grizzled oasis
orchid gazelle
#

So for example 3rd instance of Object TestObject created

#

But its different for decompiling, its some completely different mechanism

grizzled oasis
orchid gazelle
#

I sadly don't know much about how that works /:

reef forge
#

is their a way to store a uuid inside an arraylist permanently

#

bc after reloading/restarting it just removes it from the arraylist

kind hatch
#

Well, yea. That's how they work.
You need to write the data to disk and load it back into memory if you want to use it after a restart.

cobalt thorn
kind hatch
#

^

reef forge
#

hmm

kind hatch
#

You can use the default config if you want.

reef forge
#

gotta try it

idle iron
#

When I broadcast playerPlacedBlocks in the onBlockPlace function it sends the right list but if I broadcast it on the Mapclear function it sends an empty list. I think it is a problem with the scoop I will really appreciate any help.


    private List<Location> playerPlacedBlocks = new ArrayList<>();

    public MapClearTiming(Plugin PluginMain) {
        plugin = PluginMain;
    }

    public void onEnable_MapClear() {
        playerPlacedBlocks.add(new Location((Bukkit.getWorld("KeepInvt")), 69, 69, 69));
        new BukkitRunnable() {
            @Override
            public void run() {
                new BukkitRunnable() {
                    @Override
                    public void run() {
                        mapClear();
                    }
                }.runTaskLater(plugin, 30 * 20L); // 30 seconds = 30 * 20 ticks
            }
        }.runTaskTimer(plugin, 8 * 60 * 60 * 20L, 8 * 60 * 60 * 20L); // every 8 hours = 8 * 60 * 60 * 20 ticks
    }


    public void onDisable_MapClear() {
        playerPlacedBlocks.clear();
    }


    @EventHandler
    public void onBlockPlace(BlockPlaceEvent event) {
        Player player = event.getPlayer();
        if (player.getGameMode().name().equalsIgnoreCase("SURVIVAL")) {
            playerPlacedBlocks.add(event.getBlock().getLocation());
            Bukkit.broadcastMessage("Place block "+ playerPlacedBlocks);
        }
    }

    public void mapClear() {
        Bukkit.broadcastMessage("mapClear "+ playerPlacedBlocks);
        for (Location loc : playerPlacedBlocks) {
            if (loc.getBlock().getType() != Material.AIR) {
                loc.getBlock().setType(Material.AIR);
            }
        }
        playerPlacedBlocks.clear();
    }
}```
kind hatch
#

?paste exists for a reason.

undone axleBOT
kind hatch
idle iron
kind hatch
idle iron
#

I know that was my intention I am saying it clears itself before the loop

#

Bukkit.broadcastMessage("mapClear "+ playerPlacedBlocks); it broadcast empty list

kind hatch
#

Hmm

cobalt thorn
#

?paste

undone axleBOT
idle iron
#

Sure


import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;

public class MapClearCmd implements CommandExecutor {

    private Plugin plugin = null;

    MapClearTiming mapClearTiming;


    public MapClearCmd(Plugin PluginMain) {
        plugin = PluginMain;
        mapClearTiming = new MapClearTiming(plugin);
    }



    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
        if (cmd.getName().equalsIgnoreCase("mapclear")) {
            if (!(sender instanceof Player) || sender.hasPermission("server.mapclear")) {
                Bukkit.broadcastMessage("called mapClear");
                mapClearTiming.mapClear();
                Bukkit.broadcastMessage("§3Map clear!");
                Bukkit.getOnlinePlayers().forEach(player -> {
                    player.sendTitle(ChatColor.BLUE + "MapClear!!!", "Go to spawn", 5, 40, 5);
                });
                return true;
            } else {
                sender.sendMessage("§cYou don't have permission to use this command.");
                return true;
            }
        }
        return false;
    }
}```
#

I am using different class for the command

kind hatch
#

Shouldn't the #onCommand() method be annotated with @Override?

rotund ravine
idle iron
kind hatch
#

Well, if the map is empty when it shouldn't be, that generally means that something else has removed elements from it or called #clear() from somewhere else.

cobalt thorn
#

is the class with implements Events?

kind hatch
#

What other classes utilize MapClearTiming?

idle iron
kind hatch
#

?paste it.

undone axleBOT
idle iron
quaint mantle
#

ay

#

is there a event that gets called

#

like when the player is joining the game

#

like before the player is even loaded in

#

can i stop the player from being loaded and do stuff

remote swallow
#

AsyncPreJoiNEvent

quaint mantle
remote swallow
quaint mantle
#

wait yes

#

javadocs

remote swallow
#

you can disallow

quaint mantle
#

ty

#

disallow and then reallow?

remote swallow
#

iirc disallow just stops it there

quaint mantle
#

kay

#

ykw fekk is ill just use playerjoin

orchid trout
#

bruh how do i insert or ignore in sqlite

#

i even tried insert or replace

orchid trout
remote swallow
orchid trout
#

INSERT OR REPLACE INTO users (uuid,kills,deaths,gems) VALUES (?,?,?,?);

remote swallow
#

that should work

fluid river
#

help

#

which folders exist when you create a gradle project

#

i only know the maven stuff

#

all 4 basically

orchid trout
fluid river
#

anybody

#

i need it rn

remote swallow
#

try INSERT OR UPDATE

orchid trout
#

i did

#

the same thing

remote swallow
terse ore
#

Better way to do
SELECT * FROM foo WHERE faa = x OR faa = y OR faa = z?

fluid river
#

anybody with gradle*

#

helb

remote swallow
#

i use gradle, but im an mc dev user so

#

just create a normal gradle project

fluid river
#

which folders would exist if you do that

#

src/main/java and

remote swallow
#

i can test it rq

fluid river
#

thankz

remote swallow
fluid river
#

so no test folder

#

and no resources

#

i have this in eclipse

#

test java

#

and main java

#

can you open the project in explorer like me

#

and look it up

#

plss

#

@remote swallow

quaint mantle
fluid river
#

sure?

quaint mantle
#

every time I make a new project those folders are there

#

so yes

fluid river
#

same for maven

remote swallow
#

no clue

remote swallow
quaint mantle
#

not 100% sure about that though

quaint mantle
fluid river
#

src main and src test subfolders

quaint mantle
#

oh ok

worldly ingot
worldly ingot
#

o/

ocean hollow
#

why it returns null?

remote swallow
#

it will return null if the key doesnt exist

ocean hollow
remote swallow
#

intellij doesnt know that

#

you can safely ignore the warnings

ocean hollow
#

i have no problems with ij

#

this is my problem

remote swallow
#

the entity doesnt exist then

worldly ingot
#

It's not the config option that's null

#

You would have gotten an IllegalArgumentException from UUID#fromString() if it were

#

The entity you're trying to get is likely in an unloaded chunk

ocean hollow
worldly ingot
#

EntitiesLoadEvent iirc

#

It's called for each chunk that has its entities loaded

ocean hollow
#

But how can I apply it in my case?

#

I need to find the entity from the start, not after the player has loaded it.

ocean hollow
tender shard
#

what is a negative potion effect?

#

a "bad" one?

#

because which one is good and which is bad also depends on the entity. poison is bad for players but good for "undead" entities (or if it not poison, then it's insta damage or sth like that)

orchid trout
#

read what he said

zealous scroll
#

Is there a reason why if I cancel PlayerItemDropEvent, and the player is not looking at a block, it triggers PlayerInteractEvent?

tender shard
#

well just create a list of it?

    private static final List<PotionEffectType> POTION_EFFECT_TYPES = Arrays.asList(
            PotionEffectType.ABSORPTION,
            PotionEffectType.BLINDNESS,
            PotionEffectType.CONFUSION);
worldly ingot
tawny remnant
worldly ingot
#

Should be as simple as finding and replacing 1.19.3 with 1.19.4, danko

tawny remnant
#

oh yeah?

worldly ingot
#

Yep

#

Just be sure you've run BuildTools for that version is all

tender shard
#

with the --remapped flag

tawny remnant
#

what is wrong?

remote swallow
#

why are you running buildtools in sys32

#

and delete the previous contents

tawny remnant
#

where do i run it

chrome beacon
#

Anywhere that's not a protected folder or onedrive

tender shard
#

are you running it

#

in C:\Windows\System32

tawny remnant
#

didnt bro already say that

tender shard
#

also stop running stuff like this as admin

tawny remnant
#

i aint

#

it does it by it self

remote swallow
#

you have to open cmd as admin to get it in sys 32

young knoll
#

The system folder is the best place for a server

#

Idk what the problem is

tender shard
#

no, when you open cmd it opens it in your home folder

#

it does not "do this by itself"

#

you opened it as admin on purpose

quiet ice
#

I am pretty sure you can't create a subdir in sys32 if you are not admin

tender shard
#

ofc not

#

they just ran everything as admin and then installed buildtools to C:\Windows\System32 o0

quiet ice
#

So yeah, you defo have admin perms there

slow arrow
#

How do i get the title of an Inventory?

tender shard
#

InventoryView#getTitle()

tawny remnant
#

if I ran BuildTools what now? do i just put 1.19.4 everywhere and reload maven?

tender shard
#

yes

#

and then you check if you get any compile errors

tawny remnant
quaint mantle
remote swallow
#

did you run 1.19.4 --remapped

tawny remnant
#

ywa

#

yes

zealous scroll
remote swallow
quaint mantle
tender shard
#

at least not successfully

slow arrow
#

I'm making a function to clone inventories

quaint mantle
#

does anyone know how bat behaviour works in minecraft

#

can they go to sleep if you are near them?

#

yes

slow arrow
#

when they hang upside down in a cave or smth

slow arrow
#

Cuz they wake up when you walk near them so it wouldn't make sense for them to fall asleep near you

quaint mantle
#

yeah would it be changeable with nms

slow arrow
#

you can try enclosing one in a 3x3x3 space, stand still inside and see if it ever chills out

slow arrow
tender shard
quaint mantle
#

h ccool

tender shard
#

but why use NMS for that

quaint mantle
#

is it in spigot

tender shard
#

yes

quaint mantle
#

oh

#

nice

tender shard
#

in fact, setAwake and isAwake is the only thing that exists for bats lol

quaint mantle
#

setAwake(false) would make them sleep

#

right?

slow arrow
#

yup

quaint mantle
#

wouldnt they just wake up again

#

does it need to be threaded or something

tender shard
tender shard
quaint mantle
#

yeah wonder if it will look buggy tho

#

like if you had high ping

#

then it might look weird

tender shard
#

or setAI to false

quaint mantle
#

thats a inheriting method or what

tender shard
#

although then it also won't have gravity anymore. although idk if bats have gravity in the first place

tender shard
quaint mantle
#

ok let me tr ysomething

#

what version was it implemented in

#

does Ambient extend LivingEntity

tender shard
orchid trout
#

how do i insert or ignore in sqlite

slow arrow
quaint mantle
#

alright

terse ore
tender shard
terse ore
#

ty lol

mortal hare
#

lifehack

#

thanks

slow arrow
tender shard
#

then it's probably ultimate version only

slow arrow
#

oh yeah probs lol

mortal hare
#

works for me

slow arrow
#

*poor moment*

mortal hare
#

yea

#

i got ultimate version from my uni

#

you can enter any education email

tender shard
#

check if you can find this plugin in the community edition

mortal hare
#

to get jetbrain products for free

quaint mantle
mortal hare
#

my uni doesnt have any contract regarding the supplying the jetbrain products

#

yet i still have access to them

#

because I count as a student

tender shard
#

same, I have unlimited university email addresses

tender shard
#

I didnt even study computer stuff but law

tender shard
# slow arrow nope

F. but there's a ton of other plugins out there, just enter "uml" into the marketplace

quaint mantle
#

damn my college doesnt work

#

F

wise mesa
#

@tender shard how do I use your armor equip event

#

like how do i set it up

tender shard
#

just add it as maven dependency

wise mesa
#

yea that's working fine

#

but it's never getting called and im confused how to register it

abstract sorrel
#

sorry to bother you guys but how would i send an actionbar using nms in 1.19.4

quaint mantle
#

anyone know any spigot/paper forks that have PotionEffectEvents and EquipmentSetEvent support

tender shard
wise mesa
#

so when I do that, where is the event getting called

remote swallow
#

Player#spigot().sendMessage()

abstract sorrel
wise mesa
#

is it just called in any of the plugin's listeners?

worldly ingot
#

Deprecated in Paper probably

tender shard
remote swallow
abstract sorrel
#

oh ok i'll use that then

#

thanks

quaint mantle
wise mesa
tender shard
remote swallow
wise mesa
#

do I call the register function before or after i register the listener with spigot

tender shard
#

doesn't matter

wise mesa
#

oh

#

okay the event's just not getting called

quaint mantle
#

anyone know any spigot/paper forks that have PotionEffectEvents and EquipmentSetEvent support

wise mesa
#

ill look into it i might be doing something wrong here

tender shard
undone axleBOT
wise mesa
#

ill get back to you if its still not working

wise mesa
#

i think it might be something with my shading

quaint mantle
#

setting equipment

remote swallow
#

where

quaint mantle
#

like armor

#

on the player

remote swallow
#

alex's armor equip event lib

#

frick

quaint mantle
#

oh alright what about potion effects

remote swallow
tender shard
#
    public void onEnable() {
        ArmorEquipEvent.registerListener(this);
        getServer().getPluginManager().registerEvents(this, this);
    }
    
    @EventHandler
    public void onChangeArmor(ArmorEquipEvent event) {
        Bukkit.broadcastMessage(event.getPlayer().getName() + " changed their armor.");
    }

this should work just fine

remote swallow
tender shard
quaint mantle
#

they must exist

#

idk

echo basalt
#

meanwhile jitpack is the biggest annoyiance

#

there's always that issue or two with it

remote swallow
#

real

#

fuck jitpack

tender shard
#

everyone hates shitpack

echo basalt
#

I tried for like an hour

tender shard
#

whenever I see some plugin telling me to use jitpack, I rather compile it from source and install it to my password-protected repo

full saddle
#

For some reason there is more items in the destination inventory that items in source inventory, it doesn't scale linearly from what I saw, rangeing from 27 when I input 4 items(2-3 items gives the same amount of items on output and 1 doesn't transfer for some reason) to about 1.5 stacks when I input 1 stack, the amount seems to be consistent, I don't know what could be the issue here, there are no extra plugins and this is only listenner in the plugin, does anybody knows the issue?
Code:
https://paste.md-5.net/mebukadoci.cs (it was too big to post in this message, so here is the link)

cinder abyss
#

Hello, how can I create structures with a structure block and saving it in my plugin to generate it in the world ?

wise mesa
#

plugin just wasn't compiling

#

and it was using an old version

tender shard
#

Oh lol ok

wise mesa
#

other dev forgot a semicolon

tender shard
#

How did you not see that :p

wise mesa
#

wasn't looking at ci

orchid trout
#

whagt it jitpack

remote swallow
#

the shittest thing on earth

tender shard
#

That tries to compile stuff on the fly from github

#

The idea is nice

#

But it only works like 30% of the time, at best

#

It usually fails when people use gradle‘s shadowJar without changing the classifier

orchid trout
#

😬

tender shard
#

Yeah its weird, idk

#

Did anyone ever want to depend on the no non-shaded version? Lol

remote swallow
#

ig

#

its probably what if you shade and relocate all of adventure

#

cough papi cough

wise mesa
#

[pluggyTesty] Failed to register events for class co.tantleffbeef.pluggytesty.ArmorEquipListener because org/bukkit/inventory/meta/trim/TrimPattern does not exist.

#

is this because I'm using paper

orchid trout
#

DJ woman

wise mesa
#

it's because I'm using paper isn't it

#

let me go build spigot rq

remote swallow
#

that shouldnt happen

#

update to latest paper

tender shard
#

Never saw that message

remote swallow
#

its created from registry

#

@worldly ingot can prob bring more insight

tender shard
wise mesa
#

there's no stacktrace

#

just that error

tender shard
#

Show your whole pom pls

wise mesa
#

?paste

undone axleBOT
wise mesa
quaint mantle
remote swallow
#

yeah

wise mesa
#

yes

remote swallow
#

its in experimental

wise mesa
#

using experimental datapack on 1.19.4

quaint mantle
#

oh

tender shard
#

Oh then thats maybe the issue

remote swallow
#

the class should still exist wether its on registry or not iirc

wise mesa
#

right

#

that's why im confused

remote swallow
#

choco you gone borked something

tender shard
#

Are you on latest paper?

wise mesa
#

yes

#

wait

#

maybe not

#

i thought i just updated but it may have redownloaded the exact same version

#

one sec

#

yea that's what it is

abstract sorrel
#

sorry to bother you again but i got this error: Cannot resolve method 'sendMessage(ChatMessageType, String)'

orchid trout
#

should i just get player's stats in 1 preparedstatement and if they are null make another preparedstatement to insert the player

tender shard
orchid trout
#

so 2 preparedstatement

#

ok

#

im not 3rd gradedr thanks

abstract sorrel
#

the full line is

player.sendMessage(ChatMessageType.ACTION_BAR, calculateActionBarMessage(customPlayer));
#

it says it requires a "BaseComponent"

#

can you just cast a string into a BaseComponent?

orchid trout
#

can i do select uuid from users where uuid = ?

abstract sorrel
#

so how do i make this work then? the calculateActionBarMessage method returns a string btw

tender shard
#
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("My name is jeff");
#

sth like that

abstract sorrel
#

ok

#

thank you

tender shard
#

np

unique sable
eternal oxide
#

?npe

undone axleBOT
#

The NullPointerException, (commonly referred to as NPE), is thrown in the following cases, but not sealed to: 1. null is passed into a method or constructor which does not allow it; 2. When trying to access a field on an object pointing to null; 3. Casting null to a primitive. See https://stackoverflow.com/a/3988794/17047120 for information on how to debug NPEs.

eternal oxide
#

look for the Caused by: line

tender shard
#

what's line 51 of HeartIncrementHandler?

#

If you paste the whole file, do NOT remove the imports

unique sable
rotund ravine
#

Looks all wrong

tender shard
#

Thats not valid java

#

Unless pluginlistener is a method

remote swallow
#

it looks like it

eternal oxide
#

you are trying to cteate a new instance of itself using a plugin field you have not set

tender shard
#

Wtf

remote swallow
#

thergonna be an npe ig you ever use plugin, idfk where the hearts or lifes maps are coming from

unique sable
#

well what i can use instead of that

eternal oxide
#

after this line Bukkit.getPluginManager().registerEvents(this,p); add java this.plugin = p;

tender shard
#

You tried to use dependency injection but you used a cursed method name instead of the constructor

remote swallow
#
public HeartIncrementHandler(MythoniaHearts plugin) {
    this.plugin = plugin;
    Bukkit.getPluginManager().registerEvents(this, plugin);
}
eternal oxide
#

then in line 51 you can simply use plugin instead of pluginlistener(plugin)

quaint mantle
#

can i ask non spigot relatet questions here?

remote swallow
#

yeah

quaint mantle
#

im really confused rn my gf needed to make a calc in java for class and while i was trying to debug her code, i added a system.out.print msg. Now heres the weird part. When ever i leave it in the code works perfectly fine. But when i remove it it doesnt work at all

remote swallow
#

the sout is delaying something enough for it to work im guessing

eternal oxide
#

not working isn't very descriptive

tender shard
#

or call a method?

#

show the code

quaint mantle
#

well you wont understand anything

#

she needed to use some dumb libary from our school

abstract sorrel
#

is the onEnable method not triggered on reload because when i reload i get an error that a value is null, which is set in the onEnable method?

eternal oxide
#

you'd be suprised

quaint mantle
#

the libary is german.

#

but here you go ig

#

i need link

rotund ravine
#

Ich spreche deutch

quaint mantle
#

forgor command

remote swallow
#

thats what alex is here for

rotund ravine
#

or smth

remote swallow
#

?paste

undone axleBOT
quaint mantle
#

im making a command /clan kick <playername>

factionManager.removePlayer(args[1], player); this is the method called when the command is ran

args[1] is a String, how do i make it a player

tender shard
abstract sorrel
#

/reload

tender shard
#

then onEnable gets called

quaint mantle
tender shard
#

but reload is unsupported and it's known to cause issues

abstract sorrel
#

ok i'll check to see if i missed something

remote swallow
quaint mantle
#

dont critic the code btw she started java yesterday..

#

i thought Bukkit#getOfflinePlayer

#

but doesnt that need uuid

tender shard
kind hatch
tender shard
#

so yeah epic was right, it's probably the delay caused by sout

quaint mantle
remote swallow
#

good thing alex is here, i haven no idea what this code does

quaint mantle
#

what confuses me even more is that the codes works perfectly fine without the print on her computer

tender shard
#

try to synchronize those methods, or better, use SwingUtilities.invokeLater(...) to open the whole GUI

hazy parrot
tender shard
#
   public static void main(String[] args) {
      SwingUtilities.invokeLater(new Runnable() {
         public void run() {
            createAndShowGui();
         }
      });
   }

this is the proper way to open your GUI

quaint mantle
hazy parrot
#

oh i trough its some kind of uni, as you said school

young knoll
#

That’s a lot of public variables

quaint mantle
sterile token
#

Right i have been many hours of morning studying about internally Redis working, and i want to learn even more about it. So far i learnt that when you do some I/O operations like making use of the cache system or pub/sub the connection to redis server is blocked, until the response is done.

Why didnt they already implement a queue system based on some sort of socket or work distribuitor, so the connection get blocked?

unique sable
quaint mantle
#

like i care less about the issue then the fact that she can use it and i cant

#

i just dont get it

sterile token
#

maybe versioning issues? or OS?

quaint mantle
#

we both use the same shity stuff provided by the school for this

sterile token
#

right

quaint mantle
#

same "bluej"(really trash) same jdk and same libary

sterile token
#

ok

quaint mantle
#

and both windows 10

sterile token
#

Maybe something stupid, but have you try restarting pc and running it again

young knoll
#

Tf is bluej

quaint mantle
kind hatch
#

Probably a code name

sterile token
tender shard
quaint mantle
#

this is bluej

remote swallow
#

my eyes

quaint mantle
#

for some reason its half german and half english too and i cant even change it

sterile token
#

Please the picture is burning our dev eyes

young knoll
#

Is that

sterile token
#

Remember we dont see sun light often

quaint mantle
#

i got it

young knoll
#

Is that like one of those gui based editors

sterile token
young knoll
#

Or is that a fancy UML tool

tender shard
sterile token
quaint mantle
#

i asked my teacher so many times if we can switch to intj or eclipse and he keeps saying yes but never installs it on our school pcs

sterile token
#

💀

quaint mantle
sterile token
#

GPT being broken hahah

#

Must be broken GPT because that doesnt seen related to your issue

quaint mantle
#

yh not really

sterile token
#

Wait i will ask to it in a different way

quaint mantle
#

ive never heard or seen it related to bluethooth at all

young knoll
#

Can you install it yourself

#

That’s what I did in class

sterile token
quaint mantle
#

everythings blocked. cmd etc man even task manager

kind hatch
#

Damn, a school that has a competent IT department.

eternal oxide
#

consuming all processing power

quaint mantle
#

i crashed bluej ones and i had to restart the whole pc because my teacher didnt understand how to let me acsess task manager

compact haven
#

Java API for Bluetooth wireless technology lmfao

quaint mantle
sterile token
#

What could be blocking a redis connection while doing pub/sub and cache updating at "the same", if so far i read redis shouldnt block the connection ¿?

compact haven
#

but anyways, the reason it doesnt understand is because it's literally called "BlueJ" not "jBlue"

quaint mantle
#

let me search the doc of this libary i think somewhere therese a pause thingy

#

so i can slow it down

quaint mantle
#

btw i had my exam with that teacher yesterday and we had to code, ON PAPER

sterile token
#

Okay definitly Jedis implementation totally sucks

orchid trout
quaint mantle
#

like a 150 line code on paper

sterile token
#

💀

quaint mantle
#

damn x)

#

well was it your final exam lmao

sterile token
#

Yeah C++ bruh most shity lang for me in terms of syntax

young knoll
#

Clearly you haven’t seen like

#

A lot of other langs

sterile token
#

pangs, is that something eateable?

quaint mantle
#

yes

#

its sometihng about pregnancy lao

sterile token
#

Yes haha appeared the same to me

#

That why i asked

orchid trout
#

balls on plate

sterile token
#

LMAO

#

Just realize that haha

quaint mantle
#

admins should make that a sticker imo

#

its very java related

sterile token
#

Lmao shity redis java implementations

#

I cant realize there is not shity decent library 😡

quaint mantle
sterile token
#

I tryed Jedis but is so beatiful that when you tell to do 2 different I/O operations get blocked the connection, and doesnt process any of them 💀

echo basalt
#

jedis pool ???

orchid trout
#

?english

sterile token
orchid trout
#

?learnenglish

quaint mantle
#

found it

echo basalt
#

are you properly multithreading em

sterile token
#

Shity library that why it get blocked

#

I didnt realize its not multi threaded, or atleast able to process many responses from redis server "at the same time"

quaint mantle
#

okay so it works now

#

for the future i learned

#

bad pcs are better at java then good pcs

ivory sleet
sterile token
#

Well some things are better optimized for different OS

#

That why many developers prefers Unix based OS for programming

quaint mantle
#

its the same os x)

wise mesa
#

how do i suppress warnings for experimental

quaint mantle
#

my hypothesis is that there was so much lag it worked somehow

#

thats sounds stupid

#

well thw hole problem is anways

sterile token
wise mesa
#

how does async world edit place blocks asynchronously

eternal oxide
wise mesa
#

ah

#

how do I place a lot of blocks rather quickly

kind hatch
#

?workdistro

eternal oxide
#

it has a queue Async and places x blocks per tick sync

wise mesa
#

nvm

sterile token
#

You cant place async blocks, because the server is not (designed) multi threaded

tender shard
wise mesa
#

unrelated

#

is there an api for structure blocks

eternal oxide
#

yes

wise mesa
#

appreciate it

sterile token
wise mesa
#

?

#

i meant in spigot yes

#

not a seperate one

#

i was just too lazy to google

sterile token
#

If im not wrong you cant place blocks async on minecraft

eternal oxide
#

a Structure Block is just a type of Block, Structure is the template

wise mesa
#

that's what it sounds like

wise mesa
eternal oxide
#

use Bukkit.getStructureManager()

wise mesa
#

appreciate it

#

found it

#

ill just place 1 structure per tick or so

eternal oxide
#

go slower

wise mesa
#

alright

eternal oxide
#

a structure is multiple blocks

wise mesa
#

players won't be looking at it

kind hatch
tender shard
zealous scroll
#

Upgrading from 1.19.3 to 1.19.4 spigot, entity.playEffect(EntityEffect.HURT); no longer works on mobsd and sometimes doesn't work on players. Could there be a reason why?

wise mesa
#

randomly generating a dungeon

ivory sleet
#

but like not with spigot api in principle

wise mesa
#

and teleporting the player to it once its built

sterile token
young knoll
#

Sadly the structure API does not provide a way to place the structure over time

wise mesa
#

i really don't need to though

eternal oxide
#

you could do it manually yourself using the pallete

young knoll
#

Ha

wise mesa
#

no one's going to have it loaded

young knoll
#

You wish it was that easy

quaint mantle
wise mesa
#

im really more worried about client lag than server lag

#

but ill just delay it by more if its a problem

young knoll
#

The main shortcoming is that the pallete is made up of virtual block states

wise mesa
#

play a little animation for the player while it builds

young knoll
#

Spigot does not have any support for virtual block states

eternal oxide
#

a BlockState you can retrieve teh BlockData

full saddle
#

I see that my question will probably not be answered so here's a diffrent one that may give me an alternative approach at this:
Why neither Inventory.setItem() nor Inventory.removeItem() affect the source inventory from InventoryMoveItemEvent?

young knoll
#

Yes that handles the block data

#

But not the tile entity data

eternal oxide
#

um true

wise mesa
#

and stuff

young knoll
#

There is a WIP PR for being able to clone block states

wise mesa
#

or do you think it probably won't happen

#

ah

#

interesting

kind hatch
full saddle
young knoll
#

Virtual entities in structures also suck to work with

#

For the states you can get them into the world but not change their position
For entities you can change their position but not get them into the world
🙃

kind hatch
tender shard
full saddle
#

but at least it removes items from source inventory and doesn't give more items than were inputed

onyx fjord
#

can pdc store a list of stuff?

tender shard
#

yes

#

?morepdc

undone axleBOT
onyx fjord
#

how would i implement that myself tho

tender shard
#

check the source code, it's on github

onyx fjord
#

real

tender shard
#

that's for all kinds of collections

onyx fjord
#

how big is it shaded tho

tender shard
#

lets check

#

40kb if you shade everything

tribal quarry
tender shard
#

last pfp?

tribal quarry
#

Yea

tender shard
#

which one do you mean

tribal quarry
#

That pink hair guy

tender shard
#

i went back to this because someone on my server demanded to get rid of the rainbow flag in the server's pfp

#

so I am using a rainbow flag here too again

tribal quarry
#

It's not something to show to anybody in my opinion, like I'm gay too but i don't want to promote it too much

#

nvm, anyway

tender shard
#

I don't care what others think though

wise mesa
#

what's the best way to load schematics?

kind hatch
wise mesa
#

fawe api?

tender shard
#

I'll just photoshop a rainbow flag into this pic

#

tomorrow

tribal quarry
tender shard
#

yeah but Ill add a rainbow flag

#

tomorrow

tribal quarry
#

Okey uwu

sterile token
#

I need some suggestion for implementing async into a library. Its mainly need async because will work sending/receiving remote server data

tribal quarry
sterile token
#

For example in the case of Netty it makes usage of a custom class called Future if im not wrongly

#

Im planning to make some sort of it, the problem is that im not so sure if it will 100 necessary

tribal quarry
#

Netty is very handy-written

#

Like they literally implemented Linux epoll natively

sterile token
#

Right well can i get some recommendations based on what specific i will create, i will just describe it detailed

#

So you i can get a better help

tribal quarry
#

I don't think so, it's straightforward

#

Nope

somber night
#

how can i make a custom item unusable on vanilla recipes?

rose trail
eternal oxide
#

add a PDC tag

tribal quarry
tender shard
#

progress flag

sterile token
#

right, well im mainly doing a Redis api over a redis client. So i wondering if it will necessary or not to implement an async way. Because so far the library has problems related to I/O operations. So if you try using the cache and pub/sub at "the same time". The redis client internally get blocked and doesnt process any of the responses

somber night
tribal quarry
tender shard
#

currently it's green

#

it used to be red/pink when the pfp was made

tribal quarry
#

Well I tried half 9.3 blonde, it's not bad I like it

tender shard
#

half 9.3?

#

no clue what that means tbh

sterile token
tribal quarry
#

9.3 blonde

tender shard
#

is that some kind of dye color or sth?

sterile token
#

yes

tender shard
#

I have no clue about it, I just let my best friend do it, she's dying her hair for 20 years now

#

and mine for 2 years or sth, idk

#

every once in a while she comes home with a new color and throws it into my hair and I'm usually like "ok, nice"

young knoll
#

You are the test subject

tender shard
#

naah she always uses the same color for herself

young knoll
#

Before or after she uses it for you?

brave sparrow
#

Not sure if that makes it better or worse

tender shard
#

I'm fabulous in every color

young knoll
#

My hair is too dark to just dye

#

And bleach is scary

misty ingot
#
    public static void playerPetDoge(LivingEntity doge, Player player) {
        Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {
            Particle smoke = Particle.CLOUD;
            Sound howl = Sound.ENTITY_WOLF_HOWL;
            Sound poof = Sound.ENTITY_WITHER_SHOOT;

            // push doge up slowly and make its exit
            for (int i = 0; i < 7; i++) {
                doge.setVelocity(doge.getLocation().getDirection().multiply(0).setY(1));
                doge.getWorld().spawnParticle(smoke, doge.getLocation(), 10, 0.5, 0.5, 0.5, 0.1);
                doge.getWorld().playSound(doge.getLocation(), poof, 0.75F, 1);
                if (i == 6) {
                    doge.getWorld().playSound(doge.getLocation(), howl, 0.6F, 0.8F);
                    Bukkit.getScheduler().runTask(plugin, () -> {
                        doge.remove();
                        dogeRewardPlayer(player, doge);
                    });
                }
                try {
                    Thread.sleep(100);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        });
    }

dogeRewardPlayer is somehow running twice (playerPetDoge is not being run twice)

tender shard
#

mine too, we bleached it 3 times before dying it

tender shard
brave sparrow
misty ingot
#

thread.sleep

#

dont wanna stop main thread

young knoll
#

I mean most of that should be safe async

#

Except maybe the entity removal

kind hatch
#

#playSound and #spawnParticle are fine to be ran async

eternal oxide
#

I don;t see hwo it could run twice as it only runs if (i == 6) {

#

If it runs twice you are running the outer task twice

#

is playerPetDoge called in the interct event?

misty ingot
#

the outer task is NOT being run twice (im pretty sure)

eternal oxide
#

?interactevent

undone axleBOT
#

The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.

For example, only executing code if the main hand was used:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
misty ingot
#

ok ima do dat

tender shard
#

The bot should just listen to the word „twice“ and then spam ?interactevent (… twice)

young knoll
misty ingot
#

also is there a way for the player's "next death" to have a custom death message

kind hatch
#

Just mark the player with some custom data and use that during your death check.

young knoll
#

And remove it the next time they take damage

#

Or make it only valid for 1 tick

misty ingot
#

or just remove it on said death

young knoll
#

What if they do not die

somber night
#

i have a few questions

  1. is there any way i can sort this into different files?
  2. i cant manage to fix bugs such a:s custom items getting consumed in bulks of 5 instead of one, the items being usable on vanilla recipes, "meth" item not usable
    https://paste.md-5.net/axahoxaran.cs
    if you can help i'd gladly appreciate it
bold vessel
tender shard
somber night
#

wdym...?

kind hatch
young knoll
#

?

echo basalt
kind hatch
bold vessel
kind hatch
young knoll
#

I am almost certain that just clones the item meta again and then sets it there

#

So... yeah

bold vessel
misty ingot
bold vessel
#

this

misty ingot
#

edit attribute then ig

somber night
# misty ingot "methsmp" 💀

ik, its an smp with friends and they decided that would be the name, so i just went with it and made custom items (but since im new to all this its very glitchy)

bold vessel
kind hatch
bold vessel
#

Im talking about this

#

Its not working

kind hatch
#

Oh, well you never apply it to anything. You just created the variable and left it sitting.

bold vessel
#

How i apply it ?

#

With the meta ?

young knoll
#

yes

kind hatch
#

ItemMeta#setAttributeModifiers()

young knoll
#

ItemMeta#addAttributeModifier

bold vessel
#

ok thanks

onyx fjord
#

hey guys could someone explain wtf is this happening?

i have this method here:

    @Nullable
    public Player getOwner() {
        String uuid = pdc.get(ClaimKeys.claimOwner, PersistentDataType.STRING);
        if (uuid == null) return null;
        return Bukkit.getPlayer(uuid);
    }

so this method:

    public boolean isClaimed() {
        return getOwner() != null;
    }

should return true if getOwner doesnt return null right?
However no matter if owner is null or not it returns false 😐

bold vessel
#

Like this ?

onyx fjord
bold vessel
kind hatch
#

#addAttributeModifer takes two parameters.

young knoll
#

The first one is just Attribute.WHATEVER

bold vessel
#

so

#

item, modifier

#

?

onyx fjord
#

yes but you are using the wrong method

#

remove the s

bold vessel
eternal oxide
#

Material?

misty ingot
#

even with the #isDead(), if the hit killed the entity, it still goes ahead with the code

onyx fjord
#

check if health = 0 maybe?

eternal oxide
#

get players health - event.getFinalDamage()

bold vessel
#

Material = diamond helmet by example

eternal oxide
#

that method has nothgin to do with Materials

misty ingot
#

the entity s not a player, its a wolf

kind hatch
misty ingot
#

it doesnt have #getHealth()

young knoll
#

The javadocs tell you exactly what to use

young knoll
#

Or just LivingEntity

bold vessel
#

meta.addAttributeModifier(modifier, "generic.armor");
?

young knoll
#

?jd-s

undone axleBOT
young knoll
#

Read

bold vessel
#

alr

kind hatch
#

I already posted the method from the javadocs. I highly encourage to look at that one first.

remote swallow
#

anyway to add a component to lore, for a keybind

onyx fjord
#

Attribute.GENERIC_ATTACK_DAMAGE, someModifier

#

example

misty ingot
#

any way to stop this console spam?

kind hatch
#

Is that not an sout?

regal scaffold
#

What's a more efficient way to set a custom block texture using ItemAdder

#

Than creating a new block and using .place

#

And no, asking in itemadder discord is not a alternative...

I just want to update the texture

#

Is replacing the block the only way to update the texture live?

onyx fjord
young knoll
#

Iirc there is a setting for that in one of the configs

#

"There is a log-named-deaths option in the very latest version"

#

its spigot.yml

remote swallow
#

how can i get the keybind of a player as a string that could be used anywere, to stringing a base component doesnt work

eternal oxide
#

The server has no access to client key bindings

river oracle
#

Keyboard? AFAIK you have no rights to get player keybindings

young knoll
#

You can use the Keybind components

remote swallow
#

i have one but cant add it to item lore

young knoll
#

Correct, you need NMS

#

You should know this

remote swallow
#

frick

young knoll
#

Go bug choco about his PR :p

remote swallow
#

i need it 1.18

river oracle
#

Wtf Is keybind component

young knoll
#

It translates to whatever key the user has bound to that option

remote swallow
#

does something exist that does the nms or shows me the nms

young knoll
#

For example key.jump will be Space most of the time

bold vessel
#

Like this

#

?

#

Im going to try

quaint mantle
#

anyone got modding tutorials that arent from the 18th century

quaint mantle
#

no you

#

dor

#

k

bold vessel
#

??

#

and its working

young knoll
#

Is it meant to not work?

bold vessel
misty ingot
#

croc and balls moment

bold vessel
#

Can we add durability to item ?

young knoll
#

mhm

#

Cast the meta to Damageable

eternal oxide
#

add GENERIC_ARMOR_TOUGHNESS

#

one of us correct, depending on what you want 🙂

bold vessel
#

I want to made, by example, 1000 durability chestplate

#

Is this possible ?

eternal oxide
#

add the attribute

#

modifier

bold vessel
young knoll
#

There is no attribute for durability

bold vessel
young knoll
#

You would need to make a custom durability system using the Item damage and item mend events

eternal oxide
#

GENERIC_ARMOR_TOUGHNESS Armor durability bonus of an Entity.

regal scaffold
#

?paste

undone axleBOT
regal scaffold
young knoll
#

That does not effect how much durability the armor has

bold vessel
#

Armor toughness reduce damage of "big" attack if i remember good

regal scaffold
bold vessel
eternal oxide
#

um I guess not. it's only the entity durability

young knoll
#

"Armor can further protect the player through a second attribute, generic.armor_toughness. Normally, armor nullifies a lesser portion of damage from attacks that deal greater damage.[1] Armor toughness resists this effect, mitigating the power of strong attacks."

eternal oxide
#

so which are you after? Durability of the entity or the armor piece to take more damage?

edgy crystal
#

whats up,

minecart.getPersistentDataContainer().set(key_id, PersistentDataType.STRING, playerVehicleData.getUuid());

System.out.println(minecart.getPersistentDataContainer().get(key_uuid, PersistentDataType.STRING));```

thats my code. but the sout prints null
young knoll
#

you are setting key_id and getting key_uuid

#

Are they the same?

edgy crystal
#

wow

#

hahahahaha

#

i think thats the problem

#

the code is to long, so i havent seen it

regal scaffold
#
SynchedEntityData dataWatcher = new SynchedEntityData(null);
#

Does reloading possibly mess with this?

kind hatch
#

If it's NMS, probably.

regal scaffold
#

Restarting to test

#

I'm using nms in 100s of other things, it's weird that it happens so randomly

tawny remnant
sterile token
#

BottomInventory returns the player inventory, while having opened a chest or ender_chest
TopInventory returns the chest or ender_chest

#

That in case of talking about custom inventory working

#

So what its exactly your expectation to do? Would you work with player inventory click or custom inventory click?

regal scaffold
#

@remote swallow

#

I'm using minimessages/adventure api for holograms, same thing applies

remote swallow
#

im at all costs trying to avoid nms

river oracle
#

as you shud

remote swallow
#

if i have to use nms im just gonna add it to my lib

regal scaffold
#

Well

#

What you want to do

#

Is not possible without nms

remote swallow
regal scaffold
#

Because spigot will never support components

river oracle
#

not true components are in the work actually

remote swallow
#

i could even use bungee components

river oracle
#

choco is just taking a while

regal scaffold
#

They have been

#

Choco said

#

He stopped working on it

#

lol

#

It's not happening, so I just implemented it myself into my lib

#

I actually implemented adventure into 1.19.4 holograms too

#

So now using minimessages/components in holograms is super simple

river oracle
#

I'd be more apt to use adventure if it wasn't so massive