#help-development

1 messages · Page 825 of 1

echo basalt
#

Player is a bukkit class

#

we can't make the API any easier

eternal night
#

kotlin moment

lost matrix
#

Kotlin

#

Ah sniped

echo basalt
#

Welp I'm about to walk out the door

#

lynx wanna join me

proud badge
#

oh wait I think my IDE assumed im using UUID from java.util

eternal night
#

walk with you out the door 🥰 ?

echo basalt
#

Sure

lost matrix
eternal night
#

wtf does assume you are using java.util

echo basalt
#

I always invite ppl who talk about kotlin to walk out the door

eternal night
echo basalt
#

ngl that was the face I made when I nearly ran over a homeless lady during today's driving lesson

orchid gazelle
#

LMAO

shadow night
#

Man tf

echo basalt
#

was the first one pls chill

#

lady at the end asked me to drive back to the school and I was like "wtf I'm not baby driver" and did it anyways

orchid gazelle
#

I love receiving some alcohol after school and in school noon break

#

Mulled wine is great

echo basalt
#

So is staying sober

shadow night
#

Interesting topic for this channel lol

orchid gazelle
#

Yeah guys, don't drink

#

OH I THOUGHT I WAS IN GENERAL LMAO

shadow night
#

Knew it

#

Lmao

orchid gazelle
#

I thought because @echo basalt said that he just drove over a woman, almost

proud badge
#

wait I just realised

shadow night
#

About alcohol, an ukrainian friend of mine told me that some ukrainians, 12-13 years of age, could buy alcohol by showing some poorly photoshopped ukrainian document lol

proud badge
#

Or does it

echo basalt
#

Fuck I need a red bull and the corner store is closed

eternal night
#

because why would it

proud badge
#

bru

eternal night
#

java.util.UUID is perfectly fine

proud badge
#

this explains a lot

shadow night
orchid gazelle
#

I am 16 and I can just buy drinks with some type of liquor lol

shadow night
orchid gazelle
#

It just depends on how it is made, if it is mixed and so on

#

For example, wine is fine even when it has like 16%

#

I can also buy aperol mixed which has liquor in it

#

Or some types of mulled wine with liquor in it

ivory sleet
#

:D

rare rover
orchid gazelle
#

All my homies hate kotlin

#

It literally has the word "shit" in German in it

ivory sleet
#

fes_ban DaFeist

rare rover
#

Lol

lost matrix
orchid gazelle
#

Hmmm

shadow night
#

I don't buy alcohol because I'm pretty fucked even without it

orchid gazelle
#

And somehow they are fine with stuff like aperol

#

And often they do not even care if you buy harder stuff

lost matrix
shadow night
#

Germany with its Bundesländer is kinda like a little USA lol

lost matrix
# proud badge this explains a lot

UUID is just short for "universally unique identifier"
Its nothing more than a 128bit number and is used in a ton of applications outside of minecraft or gaming.

shadow night
#

Always a power of two

shadow night
lost matrix
#

Yeah, no

eternal night
#

I mean, that is not spigot 😅

eternal oxide
#

?fork

undone axleBOT
#

SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.

molten hearth
#

are hashmaps values automatically gcd or should I manually do that? eg if a player disconnects in a <Player, blabla> hashmap will the value eventually get removed from the hashmap or do i need to handle it myself

eternal oxide
#

you have to remove

molten hearth
#

sick

shadow night
#

Don't weakrefs do that are something? Or what were weakrefs even for

lost matrix
#

Yeah you could use a WeakHashMap for that

molten hearth
#

epic thanks

#

better than centralising my 5 billion hashmaps

echo basalt
echo basalt
#

fuck I lost 33 cents on the stock market

lost matrix
echo basalt
#

p sure IdentityHashMap works with player keys

molten hearth
#

the point of IdentityHashMap doesnt really seem to be garbage collection removal

echo basalt
#

I remember that being an option

lost matrix
molten hearth
#

also do WeakHashMap-s require a WeakReference to function correctly or do they make a WeakReference themselves

chrome beacon
#

Guava has weak identity map

lost matrix
echo basalt
#

o might be a misunderstanding then

#

yeah IdentityHashMap is faster if you're manually removing refs

molten hearth
#

yeah id rather not do that but thanks

hazy parrot
#

Isn't IdentityHashMap just HashMap with == instead of .equals

lost matrix
#

The main diff is how the hash code is calculated

slate tinsel
chrome beacon
#

Yeah

molten hearth
#

hmm would a Heap Summary be what i need to find thats referencing the weakhashmap value 😭

lost matrix
molten hearth
#

cause if so I dont see references to player here but the value is still in the weakhashmap

molten hearth
chrome beacon
#

Well did the GC run yet?

molten hearth
#

i mean, I did a System.gc() upon disconnect but im not sure

dry hazel
#

get a full heap dump and run it via eclipse mat/visualvm to see where it's referenced

lost matrix
#

You should never have any references to Players in the first place to be honest...

molten hearth
#

I must for the greater good

#

(I am not bothering editing 50 hashmaps to handle disconnecting)

lost matrix
#

There is no greater good. Only drawbacks.

molten hearth
#

the greater good is not having my time wasted 😭

dry hazel
#

you're wasting it right now

molten hearth
#

i mean once i figure whats referencing player its going to be easier than editing all of my hashmaps to make them accessible

dry hazel
#

should have done it right from the start

lost matrix
molten hearth
#

too late lul

dry hazel
#

weakrefs are almost always not the way to do things

slate tinsel
#

Hello! Did some quick experimenting with NMS trying to get findSafeDismountLocation to work for a player managed to get Player as entityType and blockPos but it requires "net.minecraft.world.level.CollisionGetter" how do I get it?

chrome beacon
#

That would probably be the world

slate tinsel
#

CraftWorld?

chrome beacon
#

(Server)Level

quaint mantle
#

im looking a plugin like
when my SQL queries in my code are incorrect, a warning will be thrown or the error message above will be given.

#

someoneknow ?

chrome beacon
#

That should happen by default

#

incorrect queries will throw errors

slate tinsel
chrome beacon
#

No

quaint mantle
#

When I run the program it says I'm looking for a plugin that checks before running.

slate tinsel
#

Or how do you mean

chrome beacon
#

You're working with nms

#

So you need nms level

#

Not CraftBukkit World

chrome beacon
slate tinsel
chrome beacon
slate tinsel
chrome beacon
#

?tas

undone axleBOT
slate tinsel
#

Okey!

slate tinsel
# chrome beacon You're working with nms

But how do you change a player from org.bukkit.entity.player to NMS player ie ServerPlayer?
Tried with this but didn't get it to work:
ServerPlayer entityPlayer = ((CraftPlayer) player).getHandle();

#

Or do you need to retrieve the player's profile etc. to convert a player to NMS player?

chrome beacon
#

?notworking

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

slate tinsel
#

?paste

undone axleBOT
chrome beacon
#

Looks like you might have forgotten to remap

slate tinsel
chrome beacon
#

How did you build your plugin

slate tinsel
#

Do you want to se my pom.xml or what do you mean?

chrome beacon
#

That too

#

How did you make your jar

slate tinsel
slate tinsel
chrome beacon
#

For a 1.20 server

slate tinsel
#

ok, how do you do it if you want to make it work for several versions?

#

reflection?

chrome beacon
#

That or multiple maven modules

slate tinsel
#

Is it like when you have a single part of the plugin called like "Spigot_1_16_R3" and so for each version

molten hearth
#

damn i was not expecting createBlockData to be this expensive

#

here i was calling it like 30 times per tick per player

torn badge
molten hearth
# torn badge Why so often?

i was checking if the block below the player was a wooden sound type, and if it was i created block data of another material to use it

valid burrow
#

what kind of info could i give to arrow that would then be transfered even when shot and turned into an entity

#

so i can identify it on impact

umbral ridge
#

whats the proper way to check if server has an internet connection

#

onEnable

valid burrow
#

just try to reach a random ip ig

young knoll
#

pdc

#

You will have to transfer it manually tho

lost matrix
# valid burrow .

You can add PDC values and then use the ProjectileLaunchEvent to get the ItemStack and transfer it manually

young knoll
#

Wait is that pr merged yet

#

Ye it is

#

PDC.copyTo

lost matrix
#

Ah nice. I was eyeing that one.

icy beacon
devout kite
#

Hey i wanna run a task allways at 12pm how to do that?

chrome beacon
#

You can use the ScheduledExecutorService

smoky oak
#

So um... issue
I'm putting the <T extends Event> in the method signature so that the class can handle more than one Event consumer at once
But for completeness I'm keeping a list of Event.class -> Consumer, which has to be <? extends Event>
(There's only ever one consumer per event, I believe that constraint is reasonable)
a method arg Consumer<T> passes fine into that, but i cannot pass the values of that back to a T without casting is. My question therefore is: Is the following code fine?

@SuppressWarnings("unchecked")
public <T extends Event> void registerConsumers(){
  for(Map.Entry<Class<? extends Event>, Consumer<? extends Event>> e : consumerList.entrySet())
    handler.registerListener((Class<T>) e.getKey(), (Consumer<T>) e.getValue());
}```
#

side question: would this cast it to Class<Event> or to Class<actual class extending Event>

pseudo hazel
#

i may be stupid and intermediary java experience, but why not just use Event instead of something that extends it

inner mulch
#

Which event is called when the player is in the process of breaking a block?

smoky oak
#

because it needs to register with the actual event class or it wont get called correctly

pseudo hazel
#

oh so you didnt make this Event class?

smoky oak
#

thats the bukkit event

pseudo hazel
#

okay

#

java kinda dumb I guess

#

but anyways idk the answer

smoky oak
#

bleh

#

and of course the two guys who know what im doing are offline lol

smoky oak
#

break is called when it actually breaks tho, not when you start breaking it

inner mulch
#

I found one its called blockdamageevent

#

There is one

smoky oak
ivory sleet
#

Consumer<? extends> doesnt make sense

smoky oak
#

i mean

smoky oak
lost matrix
smoky oak
#
public <T extends Event> void cacheConsumer(Class<T> clazz, Consumer<T> consumer){
        consumerList.put(clazz, consumer);
    }

    @SuppressWarnings("unchecked")
    public <T extends Event> void registerConsumers(){
        for(Map.Entry<Class<? extends Event>, Consumer<? extends Event>> e : consumerList.entrySet())
            handler.registerListener((Class<T>) e.getKey(), (Consumer<T>) e.getValue());
    }

public <T extends Event> void registerListener(final Class<T> eventClass, final Consumer<T> listener) {
        Class<?> clazz = eventClass;
        do{
            consumerMap.computeIfAbsent(eventClass, k -> new ArrayList<>()).add(listener);
            clazz = clazz.getSuperclass();
        } while(!Modifier.isAbstract(clazz.getModifiers()));
    }
#

problem being i cant put T in the map

lost matrix
#

Ugh... pls show your "consumerList" and "consumerMap" and then explain the purpose of them

smoky oak
#

ah well this is spread over two classes

#

the map is what u gave me originally
Map<Class<? extends Event>, List<Consumer<? extends Event>>> consumerMap = new HashMap<>();
the list is the list of consumers cached in the Effect class to be able to remove them again
Map<Class<? extends Event>, Consumer<? extends Event>> consumerList;

lost matrix
#

One moment

ivory sleet
smoky oak
#

shrug
havent gotten a better idea yet

steel swan
#

hello ! little question, how do i get my plugin from an other class than main class? like i want to get my plugin here

rotund ravine
#

?di

undone axleBOT
lost matrix
#

?paste

undone axleBOT
smoky oak
steel swan
lost matrix
smoky oak
#

thats a fair point

#

follow up question

#

tried to figure out the reverse to the inject method u did but couldnt

#

how do i remove an effect from this then a la computeIfPresent/Absent ?

lost matrix
#

Kind of depends on what you are trying to do. If you go with the EffectManager then you can just

  private final Map<Class<? extends Event>, List<Effect>> eventMap;

  public EffectManager() {
    eventMap = new HashMap<>();
  }

  public void addEffect(Effect effect) {
    for (Class<? extends Event> eventClass : effect.getEventClasses()) {
      eventMap.computeIfAbsent(eventClass, k -> new ArrayList<>()).add(effect);
    }
  }

  public void removeEffect(Effect effect) {
    for (Class<? extends Event> eventClass : effect.getEventClasses()) {
      List<Effect> effects = eventMap.get(eventClass);
      if (effects != null) {
        effects.remove(effect);
      }
    }
  }
shadow night
#

Is it possible to make random ticks tick in certain chunks? Would I need NMS?

smoky oak
#

oh right its pass by reference

#

i certainly did too much haskell lately

lost matrix
young knoll
#

I assume they want to force more random ticks to happen

echo basalt
#

oh god you're one of those init-hashmap-in-constructor

shadow night
#

Well, I have heard somewhere that force loading chunks doesn't do random ticks preventing crops from growing. Idk how right that is

young knoll
#

Which no, there is no api for that

river oracle
#

You can probably get away with manually calling a chunks tick method though use nms

smoky oak
#

you can just call block.tick

river oracle
shadow night
smoky oak
#

pretty sure i saw it done somewhere once

river oracle
#

Yeah so blocks don't tick in nms either AFAIK

young knoll
#

Chunks do afaik

river oracle
#

Yeah chunks do

#

So do TileEntities

#

But not blocks

young knoll
#

Game picks (random tick speed) blocks per tick in a chunk and sends a random tick to them

river oracle
#

Alr final time

#

Byebye hopefully I don't fail

shadow night
young knoll
#

Probably can do it via nms

#

If you can find the method

shadow night
#

Well

lost matrix
#

Expose Chunk#tick() method when?

young knoll
#

Maybe™️

shadow night
quiet ice
#

it is hidden in nms

young knoll
#

I like to run it in a while true loop

shadow night
#

Hmmmm

quiet ice
young knoll
#

of course

quaint mantle
#

I like to run it in a async bukkit task

shadow night
#

I still dk what it is lmao

lost matrix
#

Uh... chunks are getting ticked in an ugly way.

young knoll
#

Don't question Mojang code

#

You'll live longer that way

shadow night
#

why does mc code have 2 width tabs

#

When mcp'ing it fucks with my IJ

quiet ice
#

that is just the decompiler setting that was choosen

#

Though better than FF's default indent of 3

shadow night
#

Fuck decompilers then

lost matrix
#

Ah i kinda understand what they are doing. They have a backlog of ticks for chunks so that they can catch up with missed chunk ticks
when the server get busy...

shadow night
#

So, how tf do I make a chunk loader that can random tick

lost matrix
#

You could use nms 🤷

shadow night
#

Hmmm

lost matrix
#

Or simply select N random blocks based on the gameRule and tick them

shadow night
#

Hmm

#

Well, I'll have to see

zealous osprey
#

Heya, I got a Git issue and hope someone could help:
In the image, there is one blue repo. From all that I could gather, it's a "sub-module". However, that is causing quite some issues. For some reason I cannot commit to it or rather, my changes aren't considered.
So, either, how do I remove its sub-module status or how do I turn all of them into sub-modules, but with the ability to commit to them?

chrome beacon
#

That's why you can't commit to it

zealous osprey
#

Even if that repo is mine?

shadow night
#

You'd need to commit to it seperately, probably

zealous osprey
#

In any case, would it be possible to retain both repos; But have it not be a sub-module. Or should I just always commit that code to the other repo.

chrome beacon
zealous osprey
#

ok, thanks

valid burrow
devout kite
#

what is the event when a player pickup a item in 1.19.4?

chrome beacon
#

PlayerPickupItemEvent

#

would be my guess

devout kite
#

Deprecated

#

i found EntityPickupItemEvent but it does not fire. ```
@EventHandler
public void pickUpMoney(EntityPickupItemEvent event) throws SQLException {
System.out.println(event.getEntity());
}

tribal rivet
#

Hello why is my event red?

#

what do i need to import?

#

thanks guys 💕

devout kite
chrome beacon
chrome beacon
devout kite
tribal rivet
#

oh... okay thank you wait im trying to find how to do the ''' thing correctly

#

if you understand

#

lol im dumb wait

#

gonna take me a min then i can show

tribal rivet
#

i forgot 💀

inner mulch
#

I dotn know the exqct name

chrome beacon
slate crown
#

The essence of the problem:

I have an island system. When a player logs in, we check his UUID by yml - if there is no UUID, then we create an island for the player. At the same time, the player can be in the list of members of a certain owner. In this case, the player is teleported to the owner's island.

/member <player> - add a player to the island.

Problem:

The player enters and is teleported to the owner's island. But the problem is that the players do not see each other (although they are in the same map). And yet they don't have gamemode 3 or invisible, etc.```

spigot 1.12.2
#

help pls

inner mulch
#

Are you canceling paxkets?

slate crown
#

packets?

inner mulch
#

yes

slate crown
#

No. I just add information to yml and the system determines what to do based on it...

#

Sec, I will send code

#
ConfigurationSection playerSection = islandSystem.getPlayerConfig().getConfigurationSection(player.getUniqueId().toString());
        List<String> membersList = playerSection.getStringList("members");
        List<String> membersUUIDList = playerSection.getStringList("membersUUID");

        membersList.add(targetPlayerName);
        membersUUIDList.add(targetPlayerUUID.toString());

        playerSection.set("members", membersList);
        playerSection.set("membersUUID", membersUUIDList);

        try {
            islandSystem.getPlayerConfig().save(islandSystem.getPlayerIslandFile());
            player.sendMessage(ChatColor.GREEN + "Player " + targetPlayerName + " has been added to your island.");
        } catch (IOException e) {
            e.printStackTrace();
            player.sendMessage(ChatColor.RED + "An error occurred while saving the configuration.");
        }
#

here is add player to yml (members)

#
  public void teleportPlayer(Player player, String copiedWorldName) {
        UUID playerUUID = player.getUniqueId();
        ConfigurationSection playerSection = getPlayerConfig().getConfigurationSection(playerUUID.toString());

        if (playerSection == null) {
            for (String key : playerConfig.getKeys(false)) {
                ConfigurationSection subSection = playerConfig.getConfigurationSection(key);
                List<String> membersUUIDList = subSection.getStringList("membersUUID");

                if (membersUUIDList != null && membersUUIDList.contains(playerUUID.toString())) {
                    playerSection = subSection;
                    break;
                }
            }
        }

        if (playerSection != null) {
            ConfigurationSection locationSection = playerSection.getConfigurationSection("location");
                World copiedWorld = Bukkit.getWorld(copiedWorldName);
                if (copiedWorld != null) {
                    Location defaultLocation = new Location(copiedWorld, 7, 100, 7);
                    player.teleport(defaultLocation);
                }
            }
        }
    }
#

and here is teleportation

inner mulch
#

Are you maybe creating a replica of the owners map that the player is being teleported to?

#

That way it seems the aame but you xant See each other bexause of different maps

slate crown
#

No, no, no. They are on the same map, for example, one of them breaks blocks - and the other sees it... I've already tried all the methods... I don't understand what the mistake is..

inner mulch
#

If the players dont see each other and everything else works you probably cancel the ADD_PLAYER packet or the entitytrackentityevent?

slate crown
tribal rivet
#
import org.bukkit.Material;
import org.bukkit.block.Sign;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEntityEvent;;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.Event.*;

public class EventClass implements Listener {
    @EventHandler
    public void onPlayerClickSign(PlayerInteractEntityEvent e) {
        Player player = e.getPlayer();
        if(event.getClickedBlock().getType() == Material.OAK_SIGN ||event.getClickedBlock().getType() == Material.OAK_HANGING_SIGN ||event.getClickedBlock().getType() == Material.OAK_WALL_SIGN){
            if(event.getAction() == Action.RIGHT_CLICK_BLOCK) {
                player.sendMessage(ChatColor.LIGHT_PURPLE + "[PVPMANAGER] " + ChatColor.GREEN)``` this is my code why is my event red? Do i need to import something? What is the issue?
chrome beacon
#

that's no variable called event

quaint mantle
#

It's called e

chrome beacon
#

Try not to copy paste code without knowing what it does

quaint mantle
#

lol

chrome beacon
#

?learnjava

undone axleBOT
tribal rivet
slate crown
#

where is a problem

lost matrix
devout kite
#

how to despawn a item?

lost matrix
devout kite
#

oh i need Item not Item Stack for that

slate crown
lost matrix
slate crown
#

When a player logs in, the system checks him to see if the player is somewhere. If so, we will teleport the owner to the island. The problem is that it all works, but the players do not see each other, although they are on the same island

slate crown
lost matrix
clear elm
#

Why in tutorial first import is orange but if I copy code it’s gray

clear elm
slate crown
#

no hide, no packets

clear elm
lost matrix
river oracle
clear elm
#

idk at his code its orange and in mine not

#

what do you need that you can say why its so

slate crown
lost matrix
clear elm
#

okay

river oracle
clear elm
#

but isnt it if import is orange that is used in code

river oracle
#

color is irrelevant

clear elm
#

okay

slate crown
lost matrix
eternal oxide
#

are you using any disguise/skin plugin?

smoky oak
#

anyone here good with non euclidean geometry, namely path equivalence?

#

please dont ask why

lost matrix
smoky oak
#

was looking at different approaches tbh

#

could you describe a grid of squares as discrete?

#

like, what i want is a function, or an approach for writing one, which takes two paths from a start point to spit out if they end up in the same location, if the step size stays constant

#

a la forward, 90° left & right, back (that one only as first step i guess)

#

and a given vertex count (is that the word? number of square tiles around a corner point)

#

i know i could just map it to poincare coordinates but that is something that's likely to break given numbers for computers arent infinitely precise

eternal oxide
#

you want to A* on a surface of vertices?

smoky oak
#

well no

#

i want 'do those two paths lead to the same tile'

#

because in non euclidean geometry, depending on the path you take, rotation becomes an issue

eternal oxide
#

fixed path or search?

smoky oak
#

u cant just add up everything

#

two fixed paths

#

finding a path there would be helpful but i fail to understand how to check path equivalence

eternal oxide
#

it sounds like you are confusing things with model space and world space.

#

if you work in worldspace you will always be using ecludian math

#

there was a thread about pathing in this channel, not sure if it's still there

smoky oak
#

well, i guess describing why I'm concerned about this might help

#

side note this is something thats been at the back of my mind for a while, im curious about it, but its not something important

#

so the thing i was thinking was that non-euclidean geometry has this thing where surface area increases exponentionell if you increase the radius, which meant if i was generating paths i could only know by either generating everything up until the furthest distance from 'zero' and just checking if the paths end up on the same tile, which is NOT feasible for longer paths, or some way to check if two paths are equivalent

#

I've read on and off some articles about coordinates but they tend to confuse me, and the thing i take away from it is that it is math that tends to have rounding errors so i cant do an equality check

eternal oxide
#

I guess it depends on the application

#

if we are talking Minecraft here then rounding errors will not be significant enough to worry about

smoky oak
#

well i thought about doing it in minecraft but that opens a whole other can of worms and nms nonsense

clear elm
#

What’s wrong here

eternal oxide
#

but if we are talking MC here, you are over thinking the complexity

eternal oxide
# clear elm

nothing, it's a yellow underline so it's a warning

smoky oak
#

the problem is if i want to do anything in minecraft thats remotely hyperbolic i need some coordinate system for a square-tesselated hyperbolic space

eternal oxide
#

hover over it and it will tell you

clear elm
smoky oak
clear elm
#

okay

smoky oak
#

like he said, hover over it

#

its probs the warning about 'on ground is client side'

dry hazel
#

== || is not valid java

eternal oxide
#

A Warning is not serious enough to be an error but it's something to take note of

clear elm
#

okay ty

eternal oxide
#

This one is telling you of a deprecation

clear elm
#

hope my double joum work

#

what does green underline mean?

smoky oak
eternal oxide
#

I don;t think I've seen a green underline

clear elm
eternal oxide
#

hover your mouse over and see what it tells you

smoky oak
dry hazel
#

it's probably the spellchecker

#

Gamemode vs GameMode

smoky oak
clear elm
#

How can I register it

clever lantern
#

pls just take a screen

#

XD

#

or copy code

clear elm
#

Bro in yt tuto sais I have to register in 2nd smth

#

Can you see this time on picture ?

smoky oak
#

Bukkit.getEventHandler().registerEvent(new Listener(), this); or smth

clear elm
#

What means or smth

smoky oak
#

like im not 100% sure

clear elm
#

Okay

smoky oak
#

thats what i can remember

eternal oxide
#

you already have registered it

#

in your onEnable

clear elm
#

It don’t work

eternal oxide
#

then you have other issues

smoky oak
#

did you build, copy the plugin, and restart your server?

clear elm
#

There isn’t an double jump

clear elm
#

this is full code :

#

package com.tomlegendxd.untitled.listeners;

import org.bukkit.GameMode;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerGameModeChangeEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerToggleFlightEvent;

import java.util.HashMap;

public class DoubleJumpListerners implements Listener {
private HashMap<Player, Boolean> cooldown = new HashMap<>();

@EventHandler
public void onJoin(PlayerJoinEvent event) {
    event.getPlayer().setAllowFlight(true);
    cooldown.put(event.getPlayer(), false);
}

@EventHandler
public void onFly(PlayerToggleFlightEvent event) {
    if (event.getPlayer().getGameMode() == GameMode.SURVIVAL || event.getPlayer().getGameMode() == GameMode.ADVENTURE) {
        event.setCancelled(true);
        if (cooldown.get(event.getPlayer())) return;
        event.getPlayer().setVelocity(event.getPlayer().getLocation().getDirection().setY(1));
        cooldown.put(event.getPlayer() , true);
    }
}

@EventHandler
public void onMove(PlayerMoveEvent event){
    if (event.getPlayer().isOnGround()){
        cooldown.put(event.getPlayer() , false);
    }

}

@EventHandler
public void onGamemodeChange(PlayerGameModeChangeEvent event){
    if (event.getNewGameMode() == GameMode.SURVIVAL || event.getNewGameMode() == GameMode.ADVENTURE){
        event.getPlayer().setAllowFlight(true);

    }
}

}

#

package com.tomlegendxd.untitled.listeners;

import com.tomlegendxd.untitled.listeners.DoubleJumpListerners;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public final class DoubleJump extends JavaPlugin {

@Override
public void onEnable() {
    Bukkit.getPluginManager().registerEvents(new DoubleJumpListerners(), this);
}

}

clever lantern
#

its plugin.getServer().getPluginManager().registerEvents(Listener, Plugin))

clear elm
#

what

#

is this worng ? Bukkit.getPluginManager().registerEvents(new DoubleJumpListerners(), this);

smoky oak
#

no, both work

#

the pluginManager is the same for them

valid burrow
#

what was the character one can use to make progress bars in nametags

smoky oak
#

|

valid burrow
#

oh

clear elm
#

hmm but the import is not used

valid burrow
#

arl

#

thx

smoky oak
#

also known as 'pipe symbol'

clear elm
#

its gray

valid burrow
#

yh i know its the same char used to make or statements

clear elm
#

and if its gray its not used

valid burrow
#

just thought there was another

smoky oak
#

well

#

theres some

#

i believe theres a char that doesnt have any space before or after

#

to make a continuous bar

#

dunno the name tho

valid burrow
#

its arl ill just use this one

clever lantern
#

someone knows why when i spawn some particles with offset they are being shoot like 20 block aways and some are spawning correcly

smoky oak
weak meteor
#

how can i kill a player without appearing the Respawn screen (1.8.8)?

smoky oak
clear elm
#

import org.bukkit.GameMode;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerGameModeChangeEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerToggleFlightEvent;

import java.util.HashMap;

public class DoubleJumpListerners implements Listener {
    private HashMap<Player, Boolean> cooldown = new HashMap<>();

    @EventHandler
    public void onJoin(PlayerJoinEvent event) {
        event.getPlayer().setAllowFlight(true);
        cooldown.put(event.getPlayer(), false);
    }

    @EventHandler
    public void onFly(PlayerToggleFlightEvent event) {
        if (event.getPlayer().getGameMode() == GameMode.SURVIVAL || event.getPlayer().getGameMode() == GameMode.ADVENTURE) {
            event.setCancelled(true);
            if (cooldown.get(event.getPlayer())) return;
            event.getPlayer().setVelocity(event.getPlayer().getLocation().getDirection().setY(1));
            cooldown.put(event.getPlayer() , true);
        }
    }

    @EventHandler
    public void onMove(PlayerMoveEvent event){
        if (event.getPlayer().isOnGround()){
            cooldown.put(event.getPlayer() , false);
        }

    }

    @EventHandler
    public void onGamemodeChange(PlayerGameModeChangeEvent event){
        if (event.getNewGameMode() == GameMode.SURVIVAL || event.getNewGameMode() == GameMode.ADVENTURE){
            event.getPlayer().setAllowFlight(true);

        }
    }

}```
#

so ?

#

import com.tomlegendxd.untitled.listeners.DoubleJumpListerners;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

public final class DoubleJump extends JavaPlugin {

    @Override
    public void onEnable() {
        Bukkit.getPluginManager().registerEvents(new DoubleJumpListerners(), this);
    }


}```
chrome beacon
#

?paste

undone axleBOT
lost matrix
clear elm
#

an now anyone can help why first import in 2nd code is not used

#

im very new with java

chrome beacon
#

Yeah you should look at some Java tutorials and guides

#

before making your plugin

smoky oak
clever lantern
#

so idk

clear elm
smoky oak
#

its considered in the same package, its already visible to each other

clear elm
#

but why jump dont wotk than :((

weak meteor
smoky oak
#

a OR b

#

like, set the gamerule, kill the player, set the gamerule back
OR
simulate their death manually

weak meteor
smoky oak
#

that were the two ideas i had

weak meteor
#

Thanks thanks

lost matrix
#

Havent used WorldGuard in a while. Any better way of getting all Players inside a ProtectedRegion, other than a full iteration?

  public boolean hasParticipants() {
    ProtectedRegion region = this.getRegion();
    
    if(region == null) {
      return false;
    }
    
    return Bukkit.getOnlinePlayers().stream()
        .map(Player::getLocation)
        .map(BukkitAdapter::asBlockVector)
        .anyMatch(region::contains);
  }
clear elm
#

ah nvm i skip the double jump i dont need this just wanna leran java

ivory sleet
#

with getMembers or sth

slender elbow
#

membership is something else

ivory sleet
#

oh nvm then

slender elbow
#

I don't think WG keeps track of that itself, but that's one approach, the other approach would be to use a session handler and keep constant track of the regions players enter/exit, in the same fashion as the enter/exit message flags for example

lost matrix
#

I thought about converting it to a BoundingBox but then realized that WG regions might not have an AABB shape.

#

I guess there is no other way. But should be fine, right?

slender elbow
#

I mean unless you have like millions of players online, iteration will be fine lol

lost matrix
#

Its for ~20 ppl online and checked once every few seconds. I shouldnt worry about it 🙂

#

Im just marked from the time where WG scaled horribly and i wrote my own region system.
But they did a similar optimization a few months afterwards.

ivory sleet
lost matrix
#

Creating a bunch of regions and checking with a profiler how well it scaled with a runnable checking a location every tick 🙂
I was a semi-noob when it comes to benchmarking. But it was apparent as it scaled linearly with the amount of regions until
they started mapping them to chunk coordinates.

ivory sleet
#

fair enough

slender elbow
#

I don't think they map to chunk coords?

#

they just use an r-tree

#

kinda, with priorities

#

an r-tree still

lost matrix
#

I just remember it being way better. r-tree would mean O(log(n)) still. Better than O(n) but worse than
what you would have with chunk mapping (Which is O(1) if there is only one region in a chunk)

smoky oak
#

pretty sure tree search isnt linear

#

ye that

smoky oak
ivory sleet
#

the event bus thingy?

smoky oak
#

event bus???

#

no im talking about geometry rn

ivory sleet
#

or are you working on something else now? :,)

smoky oak
#

was honestly confused for a sec

#

thought I'd ask coz it seemed empty ish in here

lost matrix
#

He's babbling about non-euclidian geom

ivory sleet
#

well, ur consumers and maps etc

smoky oak
#

oy its not easy to understand

ivory sleet
#

what is the tldr moterius?

smoky oak
#

for the non euclidean thing you mean?

ivory sleet
#

yea

smoky oak
#

im trying to figure out how to check equivalence for paths in {4,n} (n > 4) tesselations

#

like in the example, the paths do not have the same number of moves but still end up in the same tile

ivory sleet
#

well, i have scarcely touched tesselations, but did you have a current approach as of right now?

smoky oak
#

well a really bad one yes

#

generate map out to max radius, see if they end up at the same tile

#

which considering how fast hyperbolic space grows is... not ideal

clear elm
#

how can i learn java making plugins without paying money?

dry hazel
#

?learnjava

undone axleBOT
quaint mantle
#

you need to pay to learn java? xd

clear elm
#

nah idk there some tutos for money

ivory sleet
clear elm
#

is minecrat plugins making and java different things?

smoky oak
#

ye thats the worry i have

ivory sleet
smoky oak
clear elm
#

but what i have to learn if i wanna make plugins

clever lantern
#

java basics

smoky oak
#

uh, basic java syntax, basic spigot api

ivory sleet
#

or maybe if you can limit urself to the space Z^3 rather than R^3

clear elm
ivory sleet
#

altho it comes with heavy compromises

clever lantern
clear elm
#

wtf is this

smoky oak
#

i doubt Z^3 works in non-flat space

ivory sleet
#

the grammar rules of java

clear elm
#

if i watch tutos how to make a plugin will it help?

ivory sleet
#

from what I know

#

most people learn it by doing it themselves

clever lantern
#

first go watch some java tutorial

ivory sleet
#

like actual practice

clear elm
inner mulch
#

Im getting a ClassCastException, why do i need to cast it to a runnable in the first place and why does it throw an exception, what did i do wrong?

clever lantern
#

java not plugin tutorial

#

do you understand?

clear elm
#

like gamemode switch warps

clear elm
ivory sleet
clear elm
#

can you recommend me an good youtuber?

ivory sleet
#

tho it can become mem intensive

clear elm
#

who makes good tutorials

clever lantern
undone axleBOT
inner mulch
smoky oak
#

there ought to be a better way for tesselations
i dont doubt I'd need bigDecimal for continuous space but tesselated should have some better options

clear elm
#

what i need to know before making plugins?

ivory sleet
minor junco
smoky oak
clear elm
#

how long can this take to learn?

#

and what is the paper api

smoky oak
#

?whereami

smoky oak
#

thats paper

quiet ice
# clear elm what are java basiscs xD?

Very basic OOP (classes have methods, classes can inherit classes or interfaces, interfaces define methods that can be called, constructors initiate classes, etc.) as well as very basic syntax (Instructions are seperated by semicolons, static method calls are Class.method(), non-static ones are instance.method(), method parameters are put in the brackets (e.g. System.out.println(arg)), Strings (basically any text) are defined by "<content>", chars (single character/unicode codepoint [with limitations]) by '<char>', constructors are called via new Class([...]), Classes are defined by class Name { [...] }, methods by public <returnType> Name(args) { [...] } etc.)

smoky oak
# smoky oak thats paper

paper is an 'optimized' fork that isnt 100% compatible with spigot, so people here will tell you to go to the paper discord

clear elm
#

hmm ty guys i prob start learn java instat of tutos how to create dumb plugins xD

minor junco
#

it's probably the better idea

clear elm
#

yea

quiet ice
#

I personally recommend making small CLI applications first

minor junco
#

I too started programming because of minecraft primarily 10 years ago (which aint that an eternity), so you can too

clear elm
#

okay ty guys i going to scool and i have only 1-2 hours per day to learn java hope it its enogh 😉

quiet ice
#

Like very simple text-based games. Note, if I talk about making very simple games, I mean very simple. Don't try to make anything like DF or even any sort of rougelike for the first few weeks to months (depending on how good you are at learning it)

#

Pft, for as long as you go to school your free time is basically unlimited

hazy parrot
clear elm
quiet ice
#

That isn't text based.

clear elm
#

what is text based

clever lantern
#

cli is in terminal

#

you described gui

eternal oxide
#

command line interface

quiet ice
#

I'm talking about something like if you enter "click" in the terminal it would increase your score by one. That sort of thing

clear elm
#

okay i try ty i gotta go now i have school tmrw bye

young knoll
#

You enter click in the terminal and it deletes system32

quiet ice
#

And I'm not talking about making games that look like this (even though that is sorta possible in a terminal, depending on your terminal)

young knoll
#

Is that terraria 2

ivory sleet
#

lol

#

what an upgrade

quiet ice
#

Nah, that is the steam release of dwarf fortress. Not a CLI game though, just CLI-inspired

smoky oak
#

isnt dwarf fortress on steam GUI?

quiet ice
#

Yes, but there is an ASCII graphics mode

clever lantern
#

player.getWorld().spawnParticle(particle, player.getLocation(), 1);
i do this and by spawning (i think its like that because its directional?) for example "soul fire flame", it gets shoot like 20 blocks away, obsidian tear particle works normal tho

smoky oak
#

try setting that to 0

young knoll
#

Take a shot for ever spawnParticle overload

clever lantern
quaint mantle
#

Is it good or bad practice to wrap a Player? Not like an actual Player object but in a sense like GamemodePlayer that is stored in some cache

minor junco
#

good practice

#

but you may consider storing the player as a weak reference

quaint mantle
#

cant I just remove on player leave

minor junco
#

you can, yes

#

but I'd recommend using a UUID anyways so you can access the player even if they're offline (or if on pre-connect)

#

but that depends on your use-case

young knoll
clever lantern
#

any way to spawn particle behind where the player is looking?

young knoll
#

Vectors

#

You can get the look vector, normalize it, and then multiply it by -1

weak meteor
#

how can i add permissions to LuckPerms web editor by the API?

young knoll
#

They should just appear if they are in your plugin.yml

weak meteor
#

so i got a problem

#

is not a command

#

and i need a permission per every material on the api

#

sooo

young knoll
#

Hmm

weak meteor
#

how can i do that without hard writing it

young knoll
#

I assume they have an api for it

weak meteor
#

they dont

eternal oxide
#

why do you need a permission for every material?

weak meteor
eternal oxide
#

find out why as it may be pointless

weak meteor
#

idk, he just wants it on the web editor

#

i dont judge why

eternal oxide
#

it may be better to default allow all and then use permissions to blacklist materials

weak meteor
#

i told him that

#

but he still wants the permission per block

slender elbow
#

i mean you can register a permission in the pluginmanager, that'll have the same effect, but like, eh

slender elbow
#

get the plugin manager
register a permission

weak meteor
#

yeha

#

just found the method

#

thanks thanks thanks

slender elbow
# weak meteor

fwiw, it isn't specific to the web editor, there's getKnownPermissions or something somewhere, but I don't think the collection it returns is mutable

#

probably an unmodifiable view

young knoll
#

Ah right you can register perms via the api

#

Just not commands

#

Sadge

valid burrow
#

why cant i get atributes from an entity

#

not even if i cast it to animals

tough fiber
#

For plugin devs and others, what are normally things that you struggle with during minecraft plugin development? I'm working on an api rn and am trying to include some things people normally struggle with to ease mc plugin developing

young knoll
undone axleBOT
#

It’s hard to answer a programming question without code
Oh no! You ran into a problem. But no worries, people are willing to help, but first they need to see your code. This is because otherwise, they would be providing help based on guesses instead of concrete knowledge. Whether it be a compile error, runtime error, or an unexpected output, I'm sure that if you were to provide code, you'd receive a quick solution.

valid burrow
# young knoll ?nocode

Theres no code needed for this question. I just asked why isnt there no getAtributes in the entity class

eternal oxide
#

LivingEntity

valid burrow
#

ah thxy

worthy scroll
#

I'm trying to call setCancelDrop() on a FallingBlock, but it doesn't seem to think the method exists despite it being in the documentation
any ideas?

young knoll
#

Are you on the right api version

eternal oxide
#

it takes a boolean

worthy scroll
quaint mantle
#

is getting a player's armor and pdc like a bunch of times a tick going to hurt my server's performance

hazy parrot
#

how are you achiving getting pdc multiple times per tick

quaint mantle
#

lol

#

custom items

#

i just dont know how to aproach this

hazy parrot
#

not really answer to my question

#

you most likely don't need to constantly check for pdc

quaint mantle
#

im making a plugin with a bunch of custom items

#

and so

#

each one can have a custom ability in like a damage event or something

#

and I thought about another ability, having the ability to interfere with other abilities

hazy parrot
#

so check for it in entitydamagebyentity event, not constantly

quaint mantle
#

and now idek how to start

eternal oxide
#

yes it can be costly as getting the PDC of an item requires fetching the Meta, which is cloned every time

quaint mantle
#

how do i even approach this lol

eternal oxide
#

don;t check multiple times a tick

#

check an item once per tick

quaint mantle
#

if multiple items have different on damage events

#

my current system is custom events, so like

#

CustomItemEntityDamageEvent

#

and then I send it to all those custom item ability handlers

#

which caches some info

#

maybe I should just cache the pdc

#

is it costly the get a tag off a pdc?

hazy parrot
#

why not store type of custom item inside of event ?

#

that way, you dont need to check pdc again

quaint mantle
#

but lets say

#

an item can interfere with another item's ability

#

then in each impl of each ability, i need to add this new item

eternal oxide
#

Too generalized to comment on. It all depends on your implementation

quaint mantle
#

is it costly the get a tag off a pdc?

#

like .getString etc

eternal oxide
#

but remember fetching the PDC is a costly action if done repeatedly

hazy parrot
eternal oxide
#

fetching a tag itself, no

quaint mantle
#

so if I do it like

#

100 times

eternal oxide
#

depends

hazy parrot
#

if you do it 100 times per tick, i would say something is wrong with your impl

eternal oxide
#

100 times per item? 1 times each item for 100 players?

quaint mantle
#

it's per player

#

like

#

per item per player

eternal oxide
#

so 1 time per player

quaint mantle
#

so like

#

lets say

#

i have a custom event (CachedEntityDamageEvent) that stores the entities armor as a pdc, so helmet, boots, chestplate, all as a pdc

#

now I have each armor item, with their abilities that is subscribed to the custom event

#

calling pdc#something

valid burrow
#

how do i change the damage in a projectile hit event

young knoll
#

You can’t

#

Gotta use a damage event

valid burrow
#

yh i realized

#

already did it

molten hearth
#

would the best way to implement custom durability be just using PlayerItemDamageEvent with pdc

young knoll
#

Yes

#

And the mending event

molten hearth
#

thankz™️

young knoll
#

Oh and the anvil event

#

😩

waxen plinth
#

sometimes I wish the event bus would let you attach a listener to specific values and receive and get the chance to cancel an event anytime it changes

#

one or two events always seem to slip through the cracks

valid burrow
#

wtf is a "Suspicious call to 'HashMap.getOrDefault()' "

young knoll
#

It means you being sus

#

Or more likely you are calling it with something that doesn’t match the key type

valid burrow
#

ah oikay

waxen plinth
#

the value type might just be Object

#

no the key is Object

#

I have no clue why

#

but it means you can pass anything as the key and only your ide will pick up on the fact that it's probably not what you meant

inner mulch
hazy parrot
#

that is probably how would i do it idk

inner mulch
#

okay, thank you :)

waxen plinth
#

you've got helper methods right

inner mulch
#

what ?

inner mulch
waxen plinth
#

let's see your event handler code that checks the uuid

inner mulch
#

what could be wrong with it ?

#

maybe i can fix it myself and learn

waxen plinth
#

well I'm just asking if you abstracted out the logic for checking the UUID

#

I'm confused why you're asking for advice on your code but won't show the code

inner mulch
#

i think it's fine, i was only scared about the pdc is perfomance heavy part

#

except this im pretty confident it's effiecient

echo basalt
#

he bacc

inner mulch
#

what ?

#

bacc ?

molten hearth
#

im having weird beheavior with ItemStack#setDurability

echo basalt
#

this is cursed

inner mulch
molten hearth
#

1 sec lol

#

if I do java event.getItem().setDurability((short) 1560); on a Diamond Axe (they have a max durability of 1561) the durability drops to 1

#

💀

inner mulch
#

yeah you need to set to 0

inner mulch
#

that happened to me too the first time i used it

river oracle
#

please use the Damageable Interface

molten hearth
#

oh okay

river oracle
#

its less confusing because damageable implies its inverted

#

where durrability does not

#

?jd-s

undone axleBOT
river oracle
#

its so wack that its inverted but 🤷‍♂️

quaint mantle
#

does anyone know how a server like hypixel manages all the custom enchants in a gamemode like hypixel pit

valid burrow
#

what is the default walk speed for a player

inner mulch
#

0.2 i think

valid burrow
#

arl thx

river oracle
# quaint mantle does anyone know how a server like hypixel manages all the custom enchants in a ...

they likely use NBT since they're on some old highly modified fork of spigot. As of for todays standard you really should be using PDC. You can also go about it in another way though. However, you have to be ready for breakages with this method. First you have to unfreeze the NMS Enchantment registry and create a new NMS Enchantment. Then you can use the API to operate MOST of your enchantment logic. I say most because you also have to think about the actual function. Its also important to note that even with this method there is no proper implementation in the EnchantmentTable and Anvil. If you do go the NMS route pay mind you'll be pretty much on your own

valid burrow
#

what is it called when cats "lay in bed"

#

thought it would just be cat.setSleeping

#

like with fox

#

but it isnt

molten hearth
#

uhh so am i supposed to do somethin along the lines of java Damageable damageable = (Damageable) event.getItem().getItemMeta(); damageable.setDamage(1560);

valid burrow
#

oh god

molten hearth
#

cause i aint gonna lie that didnt do shit

valid burrow
#

damageables gave me trauma

inner mulch
molten hearth
#

my bad forgot autosave wasnt on

inner mulch
#

np

molten hearth
#

ladies and gentlemen

#

nothing happened

#

oh wait

molten hearth
#

ladies and gentlemen i commented my setDamage

#

lol

river oracle
#

it is a copy

inner mulch
#

this is my code

#

it repairs item

#

fully

molten hearth
#

interesting system

river oracle
#

you need to do
Damageable damagelabe = event.getItem().getMeta();
damageable.set(5);
event.getItem().setItemMeta(damageable)

molten hearth
#

yeah i got it thanks

#

was it too next gen thinking to simply have setDurability

#

sigh

river oracle
quaint mantle
#

how do you think the ndb is structured

river oracle
#

don't worry about NBT if your >1.14

#

the NBT is probably pretty simple hell they probably just have their own enchantment logic embedded into the server

#

its probably just a single entry

quaint mantle
#

idk im asking because they have enchants

#

which can effect other enchants

#

vice versa

#

and I wonder how they implemented that optimally

river oracle
#

that's likely all in the event logic

quaint mantle
#

i can understand it to a certain extent

#

but they added an enchant that disables others

river oracle
#

same logic

timid berry
#

i decompiled a spigot fork and removed a certian line that was causing me trouble, how can i recompile these files into a server.jar ?

river oracle
#

ask those who maintain the fork

#

they may have different tooling

quaint mantle
river oracle
#

that's how you get better

quaint mantle
#

ok well im guessing they hardcoded it

river oracle
#

Is their any way to define a specific line to hard wrap comments at in Intellij. Right now by code wraps at 120 lines, but I want my javadocs to wrap at 80. However, autoformat always reformats my docs to wrap at 120. I couldn't find anything in the settings regarding this either

timid berry
#

i think its using mvn to build it

river oracle
#

then you gotta figure it out yourself

timid berry
#

but theres no pom.xml

#

so i dont know what to do

river oracle
#

if you decompiled it you'll have all kinds of fun

#

good luck 👍

timid berry
#

okay

#

does anyone know how i can compile it

green plaza
#

how to send itemstack using netty

molten hearth
#

is there an alternative to GENERIC_ATTACK_DAMAGE that scales with enchantments?

#

bc i currently have java itemMeta.addAttributeModifier(Attribute.GENERIC_ATTACK_DAMAGE, new AttributeModifier(UUID.randomUUID(), "generic.attackDamage", 10, AttributeModifier.Operation.ADD_NUMBER, EquipmentSlot.HAND)); and when enchanting the item with sharpness its unaffected

young knoll
#

Did you check the actual damage or just the tooltip

molten hearth
#

just the tooltip

#

i mean idk if the actual damage is correct or not but the broken tooltip is the issue lol

young knoll
#

It’s not broken

#

That’s just how attributes work

molten hearth
#

epic

#

so what da hell should i do instead 😭

#

display the lore manually?

young knoll
#

If you want it to show the full damage, yeah

molten hearth
#

oh wait

#

this probably means i should also re-calculate the damage?

molten hearth
#

but the actual item's damage + 10

#

unless im trippin

weak meteor
#

this is what copilot came with

#

but idk, i dont trust copilot so much

#

so someone can give me a code check?

young knoll
#

The games base damage is 1

molten hearth
#

thanks

timid berry
#

theres no pom.xml

junior geyser
#

Is there a way to spawn a dragon, then make it constantly target a player?

weak meteor
#

javac

weak meteor
green plaza
#

How to send banners using netty?

weak meteor
#

like the ones that appear in the middle of the screen?

green plaza
weak meteor
#

oh

molten hearth
#

lmao I saw minecraft internally had BASE_ATTACK_DAMAGE_UUID = UUID.fromString("CB3F55D3-645C-4F38-A497-9C13A33DB5CF"); and got excited and thought i could just use that UUID

weak meteor
#

k, yea idk

ivory sleet
grand flint
#

jk bc beenest and beehive have the same tag

carmine mica
#

...

grand flint
#

why does it bother u so specifically

carmine mica
#

well that's not it

grand flint
#

thast crazy

carmine mica
#

there are a zillion blocks which have the same block entities

grand flint
#

then go check them all :D

carmine mica
#

I'm curious why those 2 are called out specifically there, and what the reason only those 2 are

carmine mica
#

?

river oracle
#

They are a troll just ignore them

#

They haven't a clue wtf is going on

#

Also tbh I'd just ping md5 and ask I'm sure he'd probably respond when he wakes up or is avaliable

grand flint
ivory sleet
#

?kick @grand flint trolling

undone axleBOT
#

Done. That felt good.

torn oyster
#

how would i generate vanilla world that is only plains

torn oyster
#

if i create a biome provider that is only one biome

#

it still generates everrything normally just with it displaying as that biome in f3

#

oceans are my main concern

warm drift
#

@dusty herald

#

(in other channels too)

undone axleBOT
#

Done. That felt good.

dusty herald
#

ty

grim hound
torn oyster
grim hound
#

Hmm they probably also have an outdated API usage

#

You could ask the gpt mfo

#

Altough he'll most likely be useless

shadow night
grim hound
#

Yeah, his info about the world is really inconsistent

shadow night
#

Yes

grim hound
#

Anyway, when are maps (the item) rendered?

#

After like, at least one chunk has been sent?

maiden geode
#

Hello,
I have a small issue with BuildTools -
I've installed BuildTools for version 1.20.1 in my IdeaProjects > tools folder and tried to use the dependency for this version in my build.gradle (without -api) but it doesn't work at all, I can't build the project nor I can access NMS code. I've tried to restart the IDE but it didn't fix the problem. Any ideas? Maybe someone else had had this problem

remote swallow
#

did you run buildtools and have it complete

maiden geode
#

It said the build was successful

remote swallow
#

do you have mavenLocal() in the depdencies block of your build.gradle

maiden geode
#

Thank you

smoky oak
#

two questions:

  1. is it fine to put initialization for attributes into the {} thing that's called before the constructor? I want to avoid having to call super in extending classes
  2. does this check guarantee the cast works?
Class<? extends Event> currentClazz = clazz;
//loop
if (!superClazz.isAssignableFrom(Event.class)) break;
currentClazz = (Class<? extends Event>) superClazz;
hazy parrot
#

It is called before constructor, but you can't avoid super()

#

Compiler will add it

smoky oak
hazy parrot
#

If there is no primary constructor you have to add it anyway

smoky oak
#

ah tru

#

tbh was more looking for an answer to the 2nd question lol

hushed spindle
#

do certain server softwares have somekind of yml correction system in place because sometimes it's doing this even though that's not present in the default config at all

#

this being the default

#

its also replacing those double quotes with single quotes for some reason

eternal oxide
#

yaml is formated when it's saved.

#

the {} is removed as it does nothing. it's completely empty

#

it shoudl not be there in the first place

quiet ice
#

It really depends on what you use it for

smoky oak
quiet ice
#

But I think you have the isAssignableFrom switched up

dry hazel
#

yeah he does

smoky oak
#
do {
  //add / remove from list

  Class<?> superClazz = currentClazz.getSuperclass();
  if (!Event.class.isAssignableFrom(superClazz)) break;
  currentClazz = (Class<? extends Event>) superClazz;
} while (!Modifier.isAbstract(currentClazz.getModifiers()));

I'm iterating through the classes upwards, and was worried about the 'unchecked cast' thing

#

side note wouldnt this break if there's a key -> null in the map? It's not supposed to happen, but im curious what would if it were

HashMap<Class, List<Event>> eventMap;
...
eventMap.computeIfAbsent(currentClazz, k -> new ArrayList<>()).add(effect);
hushed spindle
#

its not there in the default config

#

but because its added it throws errors on the servers where this happens

#

the bottom pic is the default config i got in my project and the top pic is what some servers get after the plugin is loaded, and its causing errors because obviously {} is gonna break that config section

eternal oxide
#

{}is not valid as teh next key is indented as a subsection

hushed spindle
#

YEAH

#

but i didnt add that

#

and neither did the plugin user

eternal oxide
#

be sure teh original yaml is saved as UTF8 when it's in teh jar

hushed spindle
#

it is

#

its not consistent at all, not all servers have this issue

#

its only some

eternal oxide
#

then I can't see how it is being changed as that is not valid yaml, unless they have something else editing it

hushed spindle
#

some servers just try to correct it or whatever even though there's nothing to correct

#

so its attempt breaks the file

eternal oxide
#

I guess they are running some buggy web console

hushed spindle
#

these files were also completely unedited so this happens when the plugin is first being started

eternal oxide
#

If they can have them exclude it from their web console configs

#

Spigot will not save like that, so it's nothing to do with Spigot

hushed spindle
#

they do be using purpur and i know purpur does a bunch of wacky shit sometimes

eternal oxide
#

unlikely

hushed spindle
#

does purpur have somekind of plugin caching system that anyone is aware of because sometimes uploading a new plugin jar doesnt even update the plugin

eternal oxide
#

My guess would be a hosts web console messing with it

remote swallow
#

ah cool

#

a troll

hushed spindle
#

oh you're one of those LOL

eternal oxide
#

me smart, fix servers good

smoky oak
#

so first of all

remote swallow
#

@ancient plank porn + troll

smoky oak
hushed spindle
#

yeah but doing it in an annoying child way

#

the gates of heaven will be welded shut for you

eternal oxide
#

?fork

undone axleBOT
#

SpigotMC maintains the Spigot server. If you are using a fork of Spigot (such as Paper, Airplane, Purpur, or other derivative works), you should seek support in the appropriate Discord servers.

smoky oak
#

is folia a spigot fork?

remote swallow
#

technically

smoky oak
#

so plugins might work

hushed spindle
#

folia is a fork off of paper which is a fork off of spigot i think

#

they sometimes work, as far as i know they have a different scheduler system

#

so any plugin that schedules tasks need to be reworked to suit folia, probably among other changes

smoky oak
#

hm

#

u recon theres a list of changes

hushed spindle
#

folia is still in development so maybe there's no guide to plugin compatibility yet

vagrant stratus
#

How about we don't ping staff for this kinda thing

#

k thx

remote swallow
#

optic

#

look in the other channels

remote swallow
smoky oak
#

wouldnt it be visible in server logs?

smoky oak
#

uh why are my annotations collapsing like this?

forest elm
#

yo is there a way to save the slots of individual items when serializing and encoding to base64?

im trying to save an inventory but whenever it's decoded, all the items end up in a stack at the top of the inventory rather than individual items in their respective slots

smoky oak
#

lemme dig up something

#

huh im not doing it b64

#
            ByteArrayOutputStream bos = new ByteArrayOutputStream();
            BukkitObjectOutputStream oos = new BukkitObjectOutputStream(bos);

            oos.writeInt(stack.length);

            for (ItemStack itemStack : stack) {oos.writeObject(itemStack);}

            oos.close();
            return bos.toByteArray();

might break between versions then

smoky oak
#

like

#

what you want is a placeholder, i believe

#

you should be able to b64 encode an array

#

there might be the issue with the way you're inserting the items in the inventory