#help-development

1 messages · Page 1089 of 1

earnest girder
#

I do have a isProcessing variable for each player

eternal oxide
#

?nocode

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.

royal heath
#

He did put his code above, but yeah some more could help idk how you have this implemented entirely

earnest girder
#
        for(int i = 1; i <= amount; i++) {
            Bukkit.getScheduler().runTaskLater(Main.getInstance(), () -> {
                if(!player.isOnline()) {
                    break;
                }

                if(player.getLocation().distance(LabManager.getLabLocation()) > 6) {
                    player.sendMessage("You moved too far away");
                    break;
                }

                ItemStack ingredient = findIngredient(player, Material.KELP);

                if(ingredient == null) {
                    break;
                }

                ingredient.setAmount(ingredient.getAmount() - 1);
                addItemAndDropExcess(player, ItemManager.getKelpProduct());

                player.sendMessage("Processed 1 Kelp (" + i + "/" + amount + ")");
            }, 200L * i);
        }

        player.sendMessage("Done Processing");
        m.setIsProcessing(false);
eternal oxide
#

ok thats bad

wraith dagger
#

hi guys

earnest girder
#

the problem is that those breaks dont work

wraith dagger
#

how to use entityCreature in nms 1_12_R2?

eternal oxide
#

break will not stop a task

earnest girder
#

I know

wraith dagger
#

in nms 1_16_R3 we can change the entitytype by super(EntityTypes.<VANILATYPE>, world)

earnest girder
#

I just put my old code in the task so thats what I have now, dont know what to change it to

wraith dagger
#

but nms 1_12_R2 i can't use EntityTypes here

#

so can someone help pls

eternal oxide
#

this.cancel()

earnest girder
#

ah

eternal oxide
#

and return

earnest girder
#

awesome thanks

#

but I need it to cancel the other ones spawned by the loop too

eternal oxide
#

also multiple tasks fired inside a for loop is very bad for performance

earnest girder
#

okay

eternal oxide
#

do one task to handle them all

earnest girder
#

but I would need to use sleep

eternal oxide
#

no

earnest girder
#

because the player is processing a stack of items and each item takes 10 seconds

#

and they are processed one at a time

eternal oxide
#

you run a repeating task with a 10 second delay

earnest girder
#

oh

#

with an iterator like with my for loop?

eternal oxide
#

each pass you process one item

#

just a variable outside the run() method to keep track of how many passes

royal heath
#

You could do the recursion method like I said, then you can break it within the runTaskLater

earnest girder
#

ok

earnest girder
royal heath
#

so keep that runTaskLater in it's own method, then you would do something along the lines of

processMethod(amountLeft) {
  runTaskLater() {
    if(!isProcessing || amountLeft == 0) {
      return;
    } 
  
    ///...process stuff
    processMethod(amountLeft-1);
  }
}```
earnest girder
#

okay sweet that makes sense

royal heath
#

Something along the lines of that, you'll likely need to tweak it for your use case but it's roughly what I was getting at

earnest girder
#

yeah

#

thanks I think this will work well

royal heath
#

You're welcome!

halcyon hemlock
#

o/ everyone

umbral ridge
#

O

peak depot
#

hey quick question whats the best way to have a plugin that creates a "world" custom for each player is it just to create a new one each time or maby create a insland every 100k blocks?

umbral ridge
#

Spot the zeroOOOOOOOOO0OOOOO0OO0OOOOO

umbral ridge
#

XD

hidden spade
#

For a plugin im working on I need to give players the sight of the mobs but the only way I know how to do it is by first creating the entity, sending the camera packet and respawning the player. I wanted to know if there was any way to do this without respawning the player as it creates a deathmessage and a noticable effect where the players inventory is cleared and repopulated.

if (!playerModel.isTrippingOnStarbrew()) {
    LivingEntity scope = (LivingEntity) player.getWorld().spawnEntity(player.getLocation(), this.plugin.getPlayerManager().getRandomEntity());
    scope.setAI(false);
    scope.setInvisible(true);

    PacketContainer setCamera = new PacketContainer(PacketType.Play.Server.CAMERA);
    setCamera.getIntegers().write(0, scope.getEntityId());
    try {
        this.plugin.getProtocolManager().sendServerPacket(player, setCamera);
    } catch (Exception e) {
        e.printStackTrace();
    }

    Location loc = player.getLocation().clone();
    player.setHealth(0.0);
    scope.remove();
    player.spigot().respawn();
    player.teleport(loc);
}

Is there a way to do it without respawning the player or similar?

lost matrix
dapper ocean
#

Hey guys!

I need a little help. I'm new to the custom events and everybody is telling me it's really easy. And still... I'm struggling a lot...

So, first let me explain my use case. I want to create a plugin which listens to all bukkit events like block break, block place, ... and call more specific events. For example when you break coal ore you should trigger a custom event called CoalBreakEvent. On top of that logic I will add serveral extra checks like for example: "is the block placed by a player?". I want to use those events across 4 different plugins of mine. Right now they all have the same logic copy pasted, and when I find a bug I have to change it in 4 places. that's the main reason why I want to move it to a seperate plugin. On top of that I assume it will be better performance wise to only listen once to each general event and do my calculations one time.

Now... I started a proof of concept where I created 2 new plugins. One plugin (let's call it ProviderPlugin) contains a custom event which is triggered when I break an iron ore:

public class BlockBreakEventListener implements Listener {
    @EventHandler
    public void onBlockBreak(BlockBreakEvent e) {
        System.out.println("Block break event triggered");
        if (e.getBlock().getType() == Material.IRON_ORE) {
            System.out.println("Iron ore broken");
            Bukkit.getPluginManager().callEvent(new IronOreMinedEvent(e.getPlayer(), e.getBlock()));
        }
    }
}

When I uploaded this to my server it prints out both messages.

Then I created a second plugin (let's call it ConsumerPlugin). This plugin imports the jar of the ProviderPlugin so I can use the custom event. I created a listener for that event like this:

public class IronOreMinedEventListener implements Listener {
    @EventHandler
    public void onEvent(IronOreMinedEvent e) {
        System.out.println("event received!");
    }
}

But this event is not triggered when I mine an iron ore. (FYI: the listener is registered in my main class)

I already checked the loading order and can confirm the ProviderPlugin is loaded before the ConsumerPlugin (since ProviderPlugin is a softdepend of the ConsumerPlugin).

I managed to make it work by also registering the BlockBreakEventListener of the ProviderPlugin inside the ConsumerPlugin. But this is not actually what I would like since then I still have to call the general listener multiple times (and therefore run the logic multiple times) which wouldn't improve my performance at all. Not improving performance sounds like a bummer to me.

Anyone who sees my error? Or is what I want to achieve not possible at all?

Thanks in advance!

chrome beacon
#

Show your event class

#

?paste

undone axleBOT
dapper ocean
chrome beacon
#

Did you forget to register the IronOreMinedEventListener

dapper ocean
chrome beacon
#

Any errors? Also how are you depending on the base plugin

dapper ocean
#

I'm using Intellij, I added a new folder at the same level as my /src called /libs. Inside there I added the jar of my BasePlugin. By right clicking on that folder I added it as a library via "Add as library"

chrome beacon
#

So you're not using a build tool like maven or gradle

#

and you said it works if you register the listener in base plugin from test plugin?

#

If so make sure you're not running an old jar of base plugin and ensure that it's actually registering

dapper ocean
dapper ocean
chrome beacon
#

I don't really see anything wrong with what you've provided 🤷‍♂️

paper falcon
#

@blazing ocean
thx dude!

#

works now finally

brittle geyser
dapper ocean
onyx fjord
#

What r some good command libraries (using annotations)

#

Command API is too huge (almost 1 meg shaded)

#

And I don't like acf

chrome beacon
#

Then Cloud is probably the last remaining option

halcyon hemlock
#

sup everyone

#

bye everyone

halcyon hemlock
#

it's pretty easy

onyx fjord
#

no time

halcyon hemlock
#

and you can customize to your likings

onyx fjord
#

i already started working on one but yh lack of time

halcyon hemlock
#

If you want inspiration, I also made for myself, a while back

chrome beacon
#

ah it depends on NBT API

#

but that can be provided as a dependency plugin instead of shaded

onyx fjord
#

i use provided nbt api so i could probably exclude it

#

btw cloud is even bigger

chrome beacon
dapper ocean
echo basalt
#

🙄 just decompile your own code smh

dapper ocean
echo basalt
#

you can still import raw files with maven / gradle

#

Sometimes one needs a little compileOnly(fileTree(dir: 'libs', includes: ["*.jar"])) or whatever

lost matrix
#

Most proper libraries are accessible via some repo.

dapper ocean
#

Yeah for sure, I'm just trying to reproduce my problem in the most minimal scenario so I strip out all other possible errors.

#

It's nothing permanent 🙂 Just wanting to make it work so I know it's possible

dapper ocean
#

Well actually I know it's possible since I use apis with custom events. I just cannot recreate it 😦

blazing ocean
#

that's not how named params work

echo basalt
blazing ocean
#

what a fucking nerd

peak depot
#

can I just set a block in a world even when the chunk is not loaded?

eternal oxide
#

yes, load it first

peak depot
#

how can I even get the chunk from x,z cords

eternal oxide
#

divide by 16

peak depot
#

wouldnt that work

eternal oxide
#

only if x and z are chunk coords

peak depot
#

ok

peak depot
# eternal oxide only if x and z are chunk coords
    public static void createNewIsland(Player player) {
        World world = Bukkit.getWorld(Objects.requireNonNull(instance.getConfig().getString("worldName")));
        if(world == null) {
            player.sendMessage(instance.getPrefix() + "§cEs gab einen Fehler bitte melde das an das Team.");
            instance.getLogger().log(Level.SEVERE, "OneBlock Welt nicht gefunden!");
            return;
        }
        Block block = world.getBlockAt(instance.nextX, 100, instance.getNextZ());
        block.setType(Material.COBBLESTONE, true);
        world.getChunkAt(instance.getNextX() / 16, instance.getNextZ() / 16).load();
        Island island = new Island(player.getUniqueId(), block.getLocation().add(0, 2, 0));
        instance.playerIslands.put(player, island);
    }
``` so like that?
eternal oxide
#

no, you need to load it before you get any block

peak depot
#

so just put it above the getBlock

#

?

eternal oxide
#

yes. Check if its loaded before you load, just in case

#

no point in loading if it is already loaded

grim ice
worthy yarrow
#

You could probably add pdc to the sign then check for some sort of manipulation event, if it’s your sign, cancel the event

grim ice
#

wdym?

#

it's not an actual sign

#

it's just some packet stuff

worthy yarrow
#

Is it your api?

chrome beacon
#

if so no I don't think so

dapper ocean
# dapper ocean Hey guys! I need a little help. I'm new to the custom events and everybody is t...

I added those projects to a github repo (https://github.com/m4ndsr/POC-CustomEvents) and added a maven dependency. Is there anyone who can guide me on how I will be able to listen to the IronOreBrokenEvent from the ProviderPlugin inside my ConsumerPlugin?

Right now the output is the following:

[17:52:42 INFO]: [ProviderPlugin] [STDOUT] Block break event triggered
[17:52:42 INFO]: [ProviderPlugin] [STDOUT] Iron ore broken
[17:52:42 INFO]: [ConsumerPlugin] [STDOUT] listener is registered

-> So the event should be called and the listener is registered for sure.

chrome beacon
#

otherwise it will be shaded and cause issues

chrome beacon
#

also I just tested your plugin

#

it works fine

sterile breach
#

I am making a replay system. I made an architectruy:

/record player
first we should get the envrionnement (all blocks in a 25 bloc radius) and all entities. Then we wait our player packets and load it as a list and all packets which concerns what surrounds the player. to replay it we just reproducte "inverted" packets.my system is good?

dapper ocean
#

Oh my bad, didn't change the output directory when I added that scope 🤦

#

Thanks a lot!

safe furnace
#

I downloaded supervote plugin and superbvote, when i start the server it says org.bukkit.plugin.UnknownDependencyException: Votifier, i downloaded 3 notifier plugins but still dont work. solution?

chrome beacon
#

Install Votifier or NuVotifier

safe furnace
rough hinge
#

If I kill a player with the in ventory open, is inventorycloseevent called after playerdeathevent and before playerrespawnevent? even in playerdeathevent having spigot.respawn?

worthy yarrow
#

I feel like they’d be called at the same time

#

Could be wrong

lost matrix
#

Same time cant happen. Everying in minecraft is called sequentially. I would assume the InventoryCloseEvent is called before the PlayerDeathEvent.

worthy yarrow
#

Ah

worthy yarrow
#

#

I literally said “could be wrong” right after

rough hinge
lost matrix
rough hinge
worthy yarrow
#

So you send a clown emoji?

#

Fuck you too

rough hinge
rough hinge
rough hinge
#

because the close is called to save the items in the backpack and after the playerdeathevent occurs I will clean the backpack, understand

blazing ocean
worthy yarrow
#

Remind me of context

blazing ocean
#

That 1.8 pandaspigot kid

worthy yarrow
#

Oh yeah kek

blazing ocean
#

That's him

worthy yarrow
#

It’s all coming together

peak depot
#

how can I use block pdc to store a searilized string

compact haven
#

block pdc?

peak depot
#

?blockpdc

undone axleBOT
peak depot
#

but Im to stupid to understand the text ngl

compact haven
#

ah alex's tool

#

well you use it just like any other PDC to store a string lmao

worthy yarrow
#

^

#

PersistentDataType.STRING

grim ice
foggy cave
#

How would I go about adding a second line on a nametag, do I just have to use an invisible entity with a name?

compact haven
#

@peak depot

private final JavaPlugin plugin;
private final NamespacedKey key = new NamespacedKey(plugin, "some_key");

@EventHandler
public void onPlace(BlockPlaceEvent event) {
  Block block = event.getBlock();
  String serializedString = "...";

  PersistentDataContainer data = new CustomBlockData(block, plugin);
  data.set(key, PersistentDataType.STRING, serializedString);
}
young knoll
#

Or use a text display which can have multiple lines

foggy cave
#

Is there an api to do it easily, also can you elaborate on text display, never heard of that before

blazing ocean
#
Minecraft Wiki

Display entities are entities useful for map or data pack creators to display various things. There are Block Displays, Item Displays and Text Displays, which are used to display blocks, items and texts respectively. They can be created only with the /summon or /execute summon command.

worthy yarrow
foggy cave
#

oh wow since when was this a thing

blazing ocean
#

1.19.4

worthy yarrow
#

1.19?

#

rad

blazing ocean
#

hehe

worthy yarrow
#

go back to shitty internet

blazing ocean
#

whaaaa

worthy yarrow
#

kek

blazing ocean
#

not fair

worthy yarrow
#

too fast man

#

God I feel like a fucking slug today

blazing ocean
#

:(

quaint mantle
#

Hello everyone,

I’m looking for a Minecraft plugin that would allow me to do the following: I’d like to be able to add a texture to the plugin's (or server’s) files, then select a glass pane or a fence, and apply that texture with a command like /settextureglasspane {filename}.

I’m open to using a resource pack as long as the process isn’t too complicated, considering that I also use ItemAdder. If anyone knows of a plugin that can do this or could help me create one, I would be very grateful!

Thanks in advance for your help!

blazing ocean
#

not rly possible

brittle geyser
#

maybe you can update resource pack on runtime and send packet to update the resourcepack

quaint mantle
brittle geyser
#

why not

blazing ocean
#

takes ages

brittle geyser
#

What

blazing ocean
#

Loading the pack takse ~5s

#

On average

#

You'd need to hardcode the models

#

Bad player experience

mystic bear
# blazing ocean not rly possible

It’s possible if we tell you, that’s crazy!
I've already seen this on other servers so don't talk if you don't know, thank you very much

quaint mantle
#

:))

blazing ocean
blazing ocean
#

Just tryna help you buddy

worthy yarrow
#

Rad getting trashed on

blazing ocean
#

But you can't do that at runtime

#

*without pack reloads

#

which is terrible to do

worthy yarrow
#

They know you're a stinky kotlin dev rad :p

blazing ocean
worthy yarrow
#

smh

blazing ocean
blazing ocean
worthy yarrow
#

lmao

mystic bear
blazing ocean
#

It kinda is tho

brittle geyser
worthy yarrow
#

You make me laugh rad

blazing ocean
#

Terrible experience for users

mystic bear
quaint mantle
blazing ocean
#

Just make custom models

blazing ocean
mystic bear
blazing ocean
#

No need to be rude as fuck

worthy yarrow
#

I'm gonna have a stroke

blazing ocean
#

real

worthy yarrow
#

and I'm bringing you with me rad

blazing ocean
#

please do

#

🙏

quaint mantle
#

let's go everyone to macdo 🤓

mystic bear
mystic bear
blazing ocean
#

It creates custom models in the resource pack

#

Clearly a skill issue

mystic bear
blazing ocean
#

Well it doesn't do that for you kek

mystic bear
#

Kiss my ass <33

sleek island
blazing ocean
mystic bear
quaint mantle
blazing ocean
#

@young knoll hey dude do you fw this guy

quaint mantle
#

no soz it was a prank

#

joke

sleek island
quaint mantle
#

i love you rad

mystic bear
blazing ocean
#

nty

#

I have better stuff to do than to give some random guy a plugin

worthy yarrow
#

I have a letterkenny sticker just for this case hold on

blazing ocean
#

true

quaint mantle
#

so who can help me and my bff 🥰

#

🤓

mystic bear
#

Shut up 🤓

blazing ocean
quaint mantle
#

bro it was a joke i love you

#

i love everything you do

hidden spade
#

For a plugin im working on I need to give players the sight of the mobs but the only way I know how to do it is by first creating the entity, sending the camera packet and respawning the player. I wanted to know if there was any way to do this without respawning the player as it creates a deathmessage and a noticable effect where the players inventory is cleared and repopulated.

if (!playerModel.isTrippingOnStarbrew()) {
    LivingEntity scope = (LivingEntity) player.getWorld().spawnEntity(player.getLocation(), this.plugin.getPlayerManager().getRandomEntity());
    scope.setAI(false);
    scope.setInvisible(true);

    PacketContainer setCamera = new PacketContainer(PacketType.Play.Server.CAMERA);
    setCamera.getIntegers().write(0, scope.getEntityId());
    try {
        this.plugin.getProtocolManager().sendServerPacket(player, setCamera);
    } catch (Exception e) {
        e.printStackTrace();
    }

    Location loc = player.getLocation().clone();
    player.setHealth(0.0);
    scope.remove();
    player.spigot().respawn();
    player.teleport(loc);
}

Is there a way to do it without respawning the player or similar?

quaint mantle
#

i love

#

i just love

blazing ocean
#

mhm mhm

worthy yarrow
#

@blazing ocean do you like?

quaint mantle
#

BROO

blazing ocean
#

What the fuck

mystic bear
#

@blazing ocean I LOVE YOU BRO I LOVE YOU HARD FUCK ME

blazing ocean
#

right what the fuck

mystic bear
#

Its multiverse

worthy yarrow
blazing ocean
#

hey @austere cove buddy

#

could you deal with these kiddos ty

quaint mantle
#

BRO

#

JUST PLEASE HELP ME

worthy yarrow
#

I thought he already did

sleek island
#

can someone help me dawg

worthy yarrow
#

I'm laughing out loud

blazing ocean
#

kat vc?

worthy yarrow
#

I guess but just for a bit

quaint mantle
#

rad can u please help our ?

#

im so sorry

#

really

#

we know u are better than our

foggy cave
pseudo hazel
#

they need to be passengers of the player

#

then they move with the player

foggy cave
#

very good, thank you sir

pseudo hazel
#

but I dont think it matters in the case you are describing

sleek island
pseudo hazel
#

if the player is lagging their position wont be up to date so the old position is still used

#

resulting in like the same thing

#

but its just more efficient to use the passenger system

keen charm
#

Hey

#

Is it ok to use runTaskLater per player to make delays?

ivory sleet
#

its fine

sleek island
peak depot
#
    public void saveIslands() {
        for (Island island : islands) {
            UpdateValue values = new UpdateValue("UUID", island.getOwner().toString());
            values.add("location", Serializer.locationToString(island.getSpawn()));
            values.add("oneblock", Serializer.locationToString(island.getOneblock()));
            instance.mySQL.rowUpdate("oneblocks", values, "UUID = '" + island.getOwner() + "'");
            getLogger().log(Level.INFO, "Saved " + islands.size() + " Islands");
        }
        getConfig().set("nextX", nextX);
        getConfig().set("nextZ", nextZ);
        getConfig().set("worldName", worldName);
        saveDefaultConfig();
    }
``` why isnt the saveDefaultConfig saving the values for nextX, nextZ and worldName
chrome beacon
#

because it's saving the default config from the jar

peak depot
#

ah

#

ok

#

makes sense

chrome beacon
#

?configs

undone axleBOT
ivory sleet
#

there's a saveConfig() method iirc

chrome beacon
#

^^

ivory sleet
#

prob the one u wna use

#

:D

sleek island
#

this.getConfig.saveConfig();

peak depot
#

yeah thanks

sleek island
#

the clientboundmoveentitypacket does it have a range where it will not move the body?

#

@ivory sleet do u have any idea?

ivory sleet
#

yea I mean there is certain logic for when we expect to send a rot packet, pos packet or rot+pos one

#

idr exactly tho

foggy cave
#

Anyone know how to parse the <bounty> placeholder using minimessage, my code:
ColorManager.mm(plugin.config.getString("bounty-name-tag") ?: "<gold><bold><bounty>g Bounty")

ColorManager.mm:

 @JvmStatic
        fun mm(string: String): Component {
            val component: Component = miniMessage.deserialize(string)
            return component
        }
ivory sleet
#

iirc yea

#

Placeholder.component("bounty",blah)

#

u pass that to the deserialize() method

#

there's also some other static factory methods on Placeholder which may suit ur needs even more

foggy cave
#

textDisplay.text(ColorManager.mm(plugin.config.getString("bounty-name-tag") ?: "<gold><bold><bounty>g Bounty"), Placeholder.parsed("bounty", player.name))

#

Surely this should work then

#

But I get this error

#
None of the following functions can be called with the arguments supplied.
text() defined in org.bukkit.entity.TextDisplay
text(Component?) defined in org.bukkit.entity.TextDisplay
ivory sleet
#

ehm well

#

i think u pay wna add paper api on ur classpath as thats what it looks like u wna use

foggy cave
#

yeah i am using paper api

ivory sleet
#

also ye

#

u should pass the placeholder thingy to the deserialize() method, not the text() one

foggy cave
#

oh right

summer scroll
ivory sleet
#

i think the range is like 7.6

#

its a weird one

halcyon hemlock
#

Ok

foggy cave
#

Ok wait im seriously confused

#

TextDisplay has this @NotNull Component text();

worthy yarrow
#

What are you confused about?

ivory sleet
#

probably returns the empty component as default

#

or something

foggy cave
#

does minimessage.deserialize not return a component

ivory sleet
#

it does

worthy yarrow
#

^

ivory sleet
#

i think?

foggy cave
#

sorry i meant this

#

void text(@Nullable Component var1);

worthy yarrow
#

I thought it did too

foggy cave
#

thats what TExtDisplay has

#

yet this wont work

#

textDisplay.text(ColorManager.mm().deserialize(plugin.config.getString("bounty-nametag") ?: "<gold><bold><bounty>g Bounty"), Placeholder.parsed("bounty", bounty.toString()))

ivory sleet
#

should work fine

worthy yarrow
#
public class ColorUtil {

    private static final LegacyComponentSerializer LEGACY_SERIALIZER = LegacyComponentSerializer
            .builder()
            .character('§')
            .hexCharacter('#')
            .hexColors()
            .useUnusualXRepeatedCharacterHexFormat()
            .build();
    private static final MiniMessage MINI_MESSAGE = MiniMessage.miniMessage();


    public static String convertLegacyColorCodes(String text) {
        return ChatColor.translateAlternateColorCodes('&', LEGACY_SERIALIZER.serialize(MINI_MESSAGE.deserialize(text)));
    }
}

...


public void displayTitle(Player player, Title title) {
        World world = player.getWorld();
        Location location = player.getEyeLocation();
        String titleContents = ColorUtil.convertLegacyColorCodes(title.getTagContents());

        TextDisplay textDisplay = world.spawn(location.clone(), TextDisplay.class);

        Vector3f offset = new Vector3f(0, 0.15f, 0);
        AxisAngle4f rotation = new AxisAngle4f();
        Vector3f scale = new Vector3f(0.75f, 0.75f, 0.75f);
        Transformation transformation = new Transformation(offset, rotation, scale, rotation);

        textDisplay.setText(titleContents);
        textDisplay.setBillboard(Display.Billboard.CENTER);
        textDisplay.setBackgroundColor(Color.fromARGB(0x80333333));
        textDisplay.setCustomNameVisible(false);
        textDisplay.setPersistent(false);
        textDisplay.setSeeThrough(false);
        textDisplay.setShadowed(false);
        textDisplay.setInvulnerable(true);

        textDisplay.setTransformation(transformation);

        this.activeTextDisplays.put(player.getUniqueId(), textDisplay);
        player.sendMessage(ChatColor.GREEN + "You have just equipped the " + ColorUtil.convertLegacyColorCodes(title.getDisplayName()) + ChatColor.GREEN + " title!");
        player.addPassenger(textDisplay);
    }```

This is what I do and it works fine
ivory sleet
#

assuming u're not like... relocating and shading adventure

foggy cave
#

oh i think i know the problem

#

the thing i passed into deserialize can be null i guess

#

so it says text(Component?) isnt found

ivory sleet
#

myea

foggy cave
#

but i thought adding this ?: "<gold><bold><bounty>g Bounty" would make it not nullable

ivory sleet
#

I mean not sure how @Nullable is tolerated

#

but u can always just make it non nullable

#

then it should def work, right?

worthy yarrow
#

Or at least return you a (somewhat) descriptive error kek

foggy cave
#

void
text(@Nullable Component text)
Sets the displayed text.

#

javadoc says its nullable

#

im so confused

ivory sleet
#

ye idk

#

@blazing ocean

blazing ocean
#

yes hello

#

@Nullable Component = Component?

ivory sleet
#

I mean yea then it should work, secured

foggy cave
#

why does it say this then

None of the following functions can be called with the arguments supplied.
text() defined in org.bukkit.entity.TextDisplay
text(Component?) defined in org.bukkit.entity.TextDisplay
blazing ocean
#

Because Spigot doesn't support them natively

foggy cave
#

im using paper

blazing ocean
#

You need to use either NMS or Paper

#

what type is the component

foggy cave
#

whatever mm.deserialize returns

blazing ocean
#

That's supposed to return Component

foggy cave
#

yeah

blazing ocean
#

so I don't get your issue here

#

Show your code

foggy cave
#
val textDisplay: TextDisplay = player.world.spawnEntity(location, EntityType.TEXT_DISPLAY) as TextDisplay
        textDisplay.text(ColorManager.mm().deserialize(plugin.config.getString("bounty-nametag") ?: "<gold><bold><bounty>g Bounty"), Placeholder.parsed("bounty", bounty.toString()))
blazing ocean
#

Oh god I need to reformat that for myself to be able to read it

worthy yarrow
#

Why not just

#

TextDisplay.setText()?

foggy cave
#

Why whats wrong with it

foggy cave
ivory sleet
#

^

#

paper deprecated most string methods in favor of adventure

worthy yarrow
#

ah

blazing ocean
#

Paper uses text() and text(Component) like taht shit

#

No idea how you call it

ivory sleet
#

fluent accessors and mutators

blazing ocean
foggy cave
#

nah surely the IDE is being dumb right

worthy yarrow
#

Possibility sure

blazing ocean
#

Wait no

#

You missed a closing parenthesis

#

unclosed

ivory sleet
#

:,)

worthy yarrow
#

oops kek

blazing ocean
#

This is why you format shit properly

foggy cave
#

uh i dont think i did

ivory sleet
worthy yarrow
ivory sleet
#

but yea nice its solved now :P

foggy cave
#

after invalidating caches and restarting

#

wait no its not nvm just took a while to load

chrome beacon
blazing ocean
#

No, that's for deserialize

#

I messed up my formatting but still same issue

foggy cave
#

im still confused do i just add another )

#

cuz that doesnt work

#

maybe minimessage isnt support on kotlin or smth

#

idfk

blazing ocean
#

No wait

#

This parenthesis is misplaced

#

You're just passing in the component and placeholder to text()

foggy cave
#

totally right

#

thanks man

#
textDisplay.text(ColorManager.mm().deserialize(
  plugin.config.getString("bounty-nametag") ?: "<gold><bold><bounty>g Bounty",
  Placeholder.parsed("bounty", bounty.toString()))
)
#

fixed it appreciate it rad

#

thought i was going insane

ivory sleet
#

w rad

foggy cave
#

fax w rad

worthy yarrow
#

Rad with the eagle eyes man

foggy cave
#

that error should have definetly been more descriptive

worthy yarrow
#

Well that's why we implement our own errors eh?

foggy cave
#

see thats the thing..

#

lol

worthy yarrow
#

well yeah you actually gotta do it kek

foggy cave
#

maybe one day

ivory sleet
#

I mean I thought itd say sth like there's no such method signature text(Component?, Placeholder)

foggy cave
#

exactly, wouldve fixed the problem instantly then

#

very strange

ivory sleet
#

truly

#

or should we just complain about the java interoperability maybe

blazing ocean
#

Real

ivory sleet
#

cuz IJ normally makes the sun shineeee :)

blazing ocean
#

We should all embrace the kotlin

ivory sleet
#

lmao

worthy yarrow
#

Why not just complain about everything there is to complain about?

ivory sleet
#

alright enough self promotion now

worthy yarrow
#

Surly this is helpful

blazing ocean
foggy cave
#

data classes are my favourite part so far

ivory sleet
worthy yarrow
#

ew rad has a new lover

blazing ocean
#

:D

worthy yarrow
#

large red text just appears above someone's head when they don't understand a concept

ivory sleet
#

lol

quaint mantle
#

Hello everyone,

I’m looking for a Minecraft plugin that would allow me to do the following: I’d like to be able to add a texture to the plugin's (or server’s) files, then select a glass pane or a fence, and apply that texture with a command like /settextureglasspane {filename}.

I’m open to using a resource pack as long as the process isn’t too complicated, considering that I also use ItemAdder. If anyone knows of a plugin that can do this or could help me create one, I would be very grateful!

Thanks in advance for your help!

blazing ocean
#

Brother you've been told that it's not possible without a resourcepack reload several times now

quaint mantle
blazing ocean
#

I did not

#

lol

quaint mantle
#

yo ?

#

so how can i do it

wise mesa
#

i was trying to build craftbukkit, and i got an error because I didn't have bukkit installed (it couldn't find it on the remote)

#

so I built and installed bukkit to my repo

#

I see it's in there

blazing ocean
wise mesa
#

but maven is still saying it can't find it in my craftbukkit project

blazing ocean
#

Learn to read lol

quaint mantle
blazing ocean
#

Brother 💀

quaint mantle
#

im not english my broder

#

im french

worthy yarrow
#

reposting over and over and over and over doesnt help

quaint mantle
#

BRO

worthy yarrow
#

@ivory sleet

echo basalt
#

can you please shut the fuck up

wise mesa
#

holy shit bro

#

chill out

#

banned?

echo basalt
#

mr lube my savior

ivory sleet
#

what a desperate lad

blazing ocean
#

Bro NEEDED that help

echo basalt
#

hey there I'd like to make a plugin that when you run /setglasspane <texture> it grabs a texture from

wise mesa
#

lmao

echo basalt
#

hey guys id like a plugin for texture

#

guys pls

#

texture man

blazing ocean
#

not the textures!

worthy yarrow
#

How's this

#

Made it myself, didn't just look up "glass pane model minecraft"

torn badge
young knoll
#

A block state of what

blazing ocean
#

They want to dynamically set it to a specific texture specified

torn badge
#

Yeah, just set the block when that command is run

young knoll
#

Set it to what

torn badge
#

Basically anything you want, could be a plain block, could be a noteblock state

blazing ocean
#

Like that texture isn't in the pack yet

#

How tf does that work

torn badge
#

Of course you'll need to add it to the pack and have a configuration for it

young knoll
#

Noteblocks aren’t transparent

blazing ocean
torn badge
#

He said he was already using ItemsAdder?

blazing ocean
#

Well yea

#

But the point was to do it dynamically at runtime

#

Which would require a pack reload

torn badge
#

No idea why you would need to do that, at least that‘s not what I‘m reading from his messages, maybe there was some other stuff before that idk

worthy yarrow
#

There was just brainrot

#

you didn't miss much

foggy cave
#

hey guys I have a custom event which i call using this
Bukkit.getServer().pluginManager.callEvent(BountyChangeEvent(player, oldBounty, newBounty))
but my Listener never picks up the call

#

is this not the way to call events?

#

yea

#

sorry its in kotlin

#

forgot to mention

#

well im just wondering PluginManager#callEvent is correct because it doesnt seem to work

ivory sleet
#

did u define the handlerlist and everything?

foggy cave
#

idk really

#
class BountyChangeEvent(
    val player: Player,
    val oldBounty: Int,
    val newBounty: Int
) : Event() {

    private val handlers: HandlerList = HandlerList()

    override fun getHandlers(): HandlerList {
        return handlers
    }

    companion object {
        @JvmStatic
        fun getHandlerList(): HandlerList {
            return HandlerList()
        }
    }
}
#

this is the class

ivory sleet
#

handlers need to be singletoned

#

so make it a field in ur companion object

#

w @JvmStatic as well

foggy cave
#

okay ill do that and test

ivory sleet
#

its very useful

foggy cave
#

yeah the event works now thx

blazing ocean
#

nitro go brrrr

#

ty conc again

ivory sleet
#

:P

quaint mantle
#

How would I create private/"user specific" variables? I'm trying to do a toggle private messages command but I still haven't figured out how to create a "private" variable so could anyone help me with that?

ivory sleet
#

usually u define some class that holds the variables, and then u create an object per player of that class

quaint mantle
#

or if there's a readable guide somewhere or something a link to that would be appreciated

foggy cave
#

why doesnt my textdisplay turn around to where the player is looking, do i need to use a billboard, if so which one?

worthy yarrow
#

center

ivory sleet
quaint mantle
#

alright thanks appreciate it

foggy cave
#

thx

#

whats that for

worthy yarrow
#

Reference, if needed

#

I use billboard.center

#

works fine

foggy cave
#

oke thanks

foggy cave
#

whys that

worthy yarrow
#

uh

#

Custom name

#

Set that to false

foggy cave
#

oh ok

worthy yarrow
#

textDisplay.setCustomNameVisible(false);
this line to be specific

foggy cave
#

yea thx

grim ice
grave lion
#

singleton or static which to choose hmm

worthy yarrow
#

?di

undone axleBOT
ivory sleet
#

i mean usually singleton implies static as well

#

at least the canonical singleton pattern

grim ice
worthy yarrow
#

I mean

grim ice
#

singletons utilize the static keyword

worthy yarrow
#

di is easy and usually better than a singleton in most cases

grim ice
#

if you mean whether to static abuse or to use a singleton

worthy yarrow
#

Depends on the use case I suppose

grim ice
#

then use a singleton, or dependency inject

ivory sleet
#

singletons can be abused as well but mye

grim ice
ivory sleet
#

unless u're heavily deviating the singleton pattern, u prob wna ensure the global access through static

foggy cave
grim ice
#

conclube can you give an example of singleton abuse?

ivory sleet
# grim ice wdym?

well I mean, u can abuse singletons as much as u can abuse static itself

blazing ocean
remote swallow
grim ice
#

how do I know if I'm doing it?

worthy yarrow
remote swallow
blazing ocean
#

factual

worthy yarrow
#

Make a translation that puts it just below or above the name tag

foggy cave
ivory sleet
worthy yarrow
#

Oh that's normal

grim ice
#

I don't unit test in the first place 🤷🏻

#

never needed to

blazing ocean
#

real

foggy cave
grave lion
#

wouldnt using singletons make it messy to unit test in the first place?

worthy yarrow
ivory sleet
#

usually u have to allow a setter

#

or use powermocks

#

or some other hack

foggy cave
#

this is the vanilla client looking at the lunar client one

#

nametags are just fully hidden on the vanilla one

ivory sleet
worthy yarrow
#

I'm pretty sure vanilla, you cannot see your own nametag

blazing ocean
#

^

ivory sleet
#

arguably abusing the pattern, I mean sneaky throwing is as simple as a static method

blazing ocean
worthy yarrow
foggy cave
ivory sleet
blazing ocean
#

Yeah ig

worthy yarrow
blazing ocean
#

Just do a translation

foggy cave
#

oh is it overlapping ?

blazing ocean
#

Lemme check mine rq

ivory sleet
#

i mean u can also write terrible singletons in kotlin

blazing ocean
ivory sleet
#

not like the language matters much

worthy yarrow
foggy cave
worthy yarrow
blazing ocean
blazing ocean
foggy cave
#

yeah prob

worthy yarrow
#

Nah it just removes the nametag completely

#

This is the same for vanilla

foggy cave
# blazing ocean

where do i spawn the nametag btw, i just do it 2 blocks higher than the players feet

blazing ocean
#

Spawn it on the player location and do a translation

#

Like I did

ivory sleet
worthy yarrow
#

If you follow my example, that puts the display just below the players name tag and does not cause those overlapping things

foggy cave
#

ok thanks im not gonna test tday its getting late but ive noted it down for tmr

#

appreciate it

worthy yarrow
#

Sure!

grave lion
ivory sleet
#

I'd say yes

worthy yarrow
ivory sleet
#

but up to u

grave lion
#

i will search out my errors and become better thank you

ivory sleet
#

lol okay good luck

worthy yarrow
#

Chad behavior right there kek

blazing ocean
ivory sleet
#

we can discuss whether usage of singletons to that extent is abusing :>

dapper flower
worthy yarrow
#

True util is only static

ivory sleet
#

utility methods are perfect for being static

#

serves no point having them non static

dapper flower
#

Exactly

ivory sleet
#

at that point ur code probably contains a lot of throw away objects, which is just useless

blazing ocean
#

idec about static abuse when writing kotlin, ngl

#

I use objects SO fucking much

#

But I just cannot care

grave lion
#

tbh following the pattern set by those before us is the only way to do it

dapper flower
#

You should treat your plugin as a singleton also

#

If needed that is

grave lion
#

junk in the ecosystem is bad right

ivory sleet
dapper flower
#

You can do it with object?

blazing ocean
#

Yea with paper

#

You need a plugin bootstrapper

worthy yarrow
#

It's def not lol

ivory sleet
#

i mean it may not be false, but neither is it true

grim ice
#

why is there no actual good sign gui api

#

it's just a common idea

worthy yarrow
#

How do we figure if something is better? We try new things and sometimes those new things suck sure, but there are the cases when you figure something out and it's actually just better

dapper flower
blazing ocean
#

😄

ivory sleet
dapper flower
#

A single file manager class can save you a lot of time, same as sql class

blazing ocean
#

I have so many top-level functions too

ivory sleet
blazing ocean
#

Not sure how the compiler handles those

dapper flower
worthy yarrow
blazing ocean
dapper flower
#

Is launch for couroutine the same as run async?

worthy yarrow
dapper flower
#

Forgot coroutines a bit

blazing ocean
#

I really don't know a shit ton about coroutines but there's also GlobalScope.async

#

No idea what's the diff ngl

ivory sleet
worthy yarrow
#

Yeah for sure

dapper flower
#

I wanted to dev all stuff with kotlin at the start as it was easier, but some plugins dependencies straight up break when i load kotlin up

blazing ocean
#

🤨

#

Relocate the stdlib

dapper flower
blazing ocean
#

It's probably a stdlib issue

#

You should be relocating it

dapper flower
#

It breaks only some

#

Not

#

All

worthy yarrow
blazing ocean
#

🤷 Without a stacktrace it's hard to tell ya

dapper flower
#

Well when it happens will give a log pastebin or smth

blazing ocean
#

Never had any issues at all

#

It's just that shading the stdlib is 2mb 😄

hidden spade
#

For a plugin im working on I need to give players the sight of the mobs but the only way I know how to do it is by first creating the entity, sending the camera packet and respawning the player. I wanted to know if there was any way to do this without respawning the player as it creates a deathmessage and a noticable effect where the players inventory is cleared and repopulated.

if (!playerModel.isTrippingOnStarbrew()) {
    LivingEntity scope = (LivingEntity) player.getWorld().spawnEntity(player.getLocation(), this.plugin.getPlayerManager().getRandomEntity());
    scope.setAI(false);
    scope.setInvisible(true);

    PacketContainer setCamera = new PacketContainer(PacketType.Play.Server.CAMERA);
    setCamera.getIntegers().write(0, scope.getEntityId());
    try {
        this.plugin.getProtocolManager().sendServerPacket(player, setCamera);
    } catch (Exception e) {
        e.printStackTrace();
    }

    Location loc = player.getLocation().clone();
    player.setHealth(0.0);
    scope.remove();
    player.spigot().respawn();
    player.teleport(loc);
}

Is there a way to do it without respawning the player or similar?

ivory sleet
# worthy yarrow I certainly still have trouble with SRP kek

yea, like all these paradigms, theories, principles, rules, conventions, its all abstract. And when someone tries to make it absolute, it ends up sucking ass. Just look at clean code "a function must only do a single thing", like noway I'd be making every function 4 lines.

dapper flower
#

One thing i love about kotlin is guards for null checks, literslly just
variable ?: return

blazing ocean
#

yes

worthy yarrow
ivory sleet
#

lol

dapper flower
#

Not reading it like that lmfao

blazing ocean
#

I've just been cluttering the brawls API with this shit

grave lion
#

take

hidden spade
worthy yarrow
ivory sleet
hidden spade
#

If your on discord mobile it doesn't support syntax highlights for whatever reason

dapper flower
#

Maybe phone

grave lion
blazing ocean
ivory sleet
grave lion
#

or the computer is apart of you.

ivory sleet
#

would be quite the blessing

blazing ocean
grave lion
#

you dream of code

dapper flower
quaint mantle
#

Is List<String> togglePM = new ArrayList<String>(); considered as a hashmap?

worthy yarrow
hidden spade
#

instead of yapping about how discord mobile is shit can u help me 🙏🏻

blazing ocean
ivory sleet
worthy yarrow
worthy yarrow
ivory sleet
#

HashMap is considered a hash map

blazing ocean
dapper flower
#

HashMap<T, K> map = new HashMap<>()

grave lion
#

cache everything

#

hash map it

ivory sleet
#

yup

blazing ocean
quaint mantle
#

my bad chat

worthy yarrow
#

no no no

quaint mantle
#

thanks

ivory sleet
#

all good

dapper flower
#

V, K is for poor people

ivory sleet
#

V,K 💀

worthy yarrow
#

I just heard the kid yell "WHAT THE SIGMA"

blazing ocean
dapper flower
#

Wasnt default generics called V K

blazing ocean
#

K, V

ivory sleet
#

K,V

hidden spade
dapper flower
#

Same fucking thing 😭

cedar saffron
blazing ocean
#

NO 😭

cedar saffron
#

i have learned to move past that

blazing ocean
dapper flower
#

Well Key Value makes sense

worthy yarrow
cedar saffron
blazing ocean
#

your grandma hasn't tho

cedar saffron
#

men should wear thongs, it changes you

dapper flower
cedar saffron
#

this guy gets it

dapper flower
#

I am using a 5-6 years old phone sometimes it lags so much but i keep writing and the whole sentence appears in the textbox lmfao

blazing ocean
#

Use aliucord

cedar saffron
#

same 😂 specifically when i play gta and i check on discord tho

dapper flower
#

Like "yeah u can freeze i am going to keep doing my own thing"

blazing ocean
dapper flower
blazing ocean
#

🤷

#

Fuck the new mobile app

ivory sleet
#

i was abit confused how u explain it

worthy yarrow
#

Mobile applications mostly suck when it was originally written for the computers

ivory sleet
worthy yarrow
#

Idk I don't really use mobile apps that much anyway

hidden spade
# ivory sleet i was abit confused how u explain it

So when your in spectator and you view a creeper/spider/endermen you get a special shader effect. I want to apply such effect for survival players but the code provided is the only way I can think of doing it yet you have to respawn the player for it to take effect so I was asking if you knew a way to do it without having to respawn the player

dapper flower
hidden spade
# dapper flower Packets maybe?

If you look at the code sample I do use the camera set packet but for it to take effect as far as I know you have to respawn the player

blazing ocean
#

Pretty sure that's entirely client sided

hidden spade
#

If there's a different way you can do it please lmk

hidden spade
blazing ocean
#

Since the server can't tell the client to use a shader

hidden spade
#

It can kinda

#

With the setcamera packet on a creeper you can force the player to apply the creeper shader

blazing ocean
#

Well yea but you need a creeper for that

blazing ocean
hidden spade
#

That keeps the shader applied

#

Until you send another camera set packet to remove it

#

But to apply the shader properly to my knowledge you have to respawn the player

#

And that causes a visual issue on the inventory where it removes all your items and gives them back

slender elbow
#

yeah I mean there is no supported mechanism to do that, that's why you have to hack around it and kinda just deal with whatever side effects it produces

hidden spade
#

that's why I was asking to see if there was another way of doing it I wasn't aware of

quaint mantle
blazing ocean
#

I'm using decayce my beloved

worthy yarrow
#

imagine default dark theme background smh

blazing ocean
#

That is vim sir

worthy yarrow
#

And they don't let you change the background?

blazing ocean
worthy yarrow
#

And?

blazing ocean
#

I'm using st so I would have to write some C code that does that shit

worthy yarrow
#

Cosmetics are everything!

blazing ocean
#

I could just do opacity tho

#

That's ez asf

#

My st build has that anyway

#

Or just picom

worthy yarrow
#

I used wallpaper engine to find myself a background for intelliJ

blazing ocean
#

wallpaper engine 💀

worthy yarrow
#

kek

#

It's cool!

#

Animated backgrounds + audio / music

blazing ocean
#

I can make my wallpaper a gif or mp4 and it has the same effect

rough ibex
#

+30% CPU usage

#

I want to turn my desktop into a music video

worthy yarrow
#

Aw forgot poor people exist

#

Can't afford a better cpu

rough ibex
#

No, I do better work that requires all of my CPU

#

multi-core drifting

worthy yarrow
#

cool

young knoll
#

Is that like multi track drifting

worthy yarrow
#

Beautiful I must say

wraith delta
worthy yarrow
#

That doesn't mean wallpaper engine will startup, and it doesn't I actually forgot I even had it to be fair

young knoll
#

Does it not have a drm free version

#

Sadge

worthy yarrow
quaint mantle
lost matrix
#

I cant even decipher if this is a minecraft related question...

quaint mantle
#

would if (!tpm.containsKey(p.getPlayer()) == true) be a valid way to check if it's true

lost matrix
#
if(!tpm.getOrDefault(p.getPlayer(), false)) {

} else {

}
#

But there are surely more elegant ways

#

Nope, sry, i have literally no idea what you said there.

worthy yarrow
#

?img

undone axleBOT
#

Can't send images? That's because you're not verified! Use !verify to complete verification.
Alternatively, you can upload screenshots to any image hosting site and share the link.

Here's some screenshot utilities that you can use to upload images.
Lightshot: https://prnt.sc
Imgur: https://imgur.com/upload
Flameshot: https://flameshot.org

lost matrix
#

You are adding a metric ton of cursors to your map for no reason. Dont do that.

#

And you are also tampering with the renderers in the render method. Thats absolutely horrible.

quaint mantle
#

thanks

#

also while making a reply command (replying to a player who has sent you a message via /msg), should I store the last messaged player in a hashmap aswell

worthy yarrow
#

probably

grave lion
#

with config.save(), empty values do not persist?

eternal oxide
#

empty?

hybrid turret
#

i'm trying out some async shenanigans. a thread automatically closes when the function is finished right? I just have to create the object and start it? (1.19.4)

wraith dagger
#

guys can someone help please, in mc 1.16.5 i can create customentity by using entitycreature by using EntityTypes.<>their type but when i back in 1.12.2 i can't use EntityTypes to display them is there anyway to do it?

hybrid turret
#

So, I'm implementing proper data handling since I'm using an SQL database and want to minimize file accesses.
I had the idea to synchronously write to my ServerData singleton and async write to the DB so the main thread doesn't have to do the file access.

#

?paste

undone axleBOT
hybrid turret
hybrid turret
#

This is my approach, is there a more optimal way? (this is simple access, there are more complicated ones too)

hybrid turret
# wraith dagger hi?

relax, someone's gonna help eventually. come back in like 30 minutes or something. spamming won't help.

#

and i can't help with this problem, sorry.

hybrid turret
torn badge
#

Thread Pools are your best friend

echo basalt
#

There are different types of thread pools BTW

#

And thread pool exhaustion can be a real issue

#

Which I've seen happen in large scale networks

#

Especially with things like CompletableFutures with no executor set

#

One of the thread pools that avoids this issue is called a "Cached thread pool", which has a bunch of threads and creates a new one if the pool is exhausted

void sigil
#

Anyone know where I can find a good guide to NMS? Multi version support for a plugin?

echo basalt
#

Downside being that if you have a spike you end up with a huge pool that might never get up to capacity

echo basalt
void sigil
#

Yeah

echo basalt
#

I wrote an NMS guide but it's fairly meh because it's a huge topic that can't really be abstracted into simple terms

eternal oxide
#

?nms, look for the multi-module post

echo basalt
#

?nms

eternal oxide
#

?nms

void sigil
#

Aight ty

echo basalt
#

Hi there! Today I’m going to explain how to setup a multi-module project using maven to support different NMS versions. Important notes about this tutorial: Every step will have detailled screenshots using IntelliJ. I explicitly chose not to include everything as copy/pastable source code, but normal screenshots (you can click on them to show th...

#

I wouldn't use reflections to init it nowadays because paper stopped relocating CraftBukkit

#

(what I usually do instead is have a minecraft version range for each module instead)

eternal oxide
#

spigot still does

echo basalt
eternal oxide
#

Its a Spigot plugin 😉

echo basalt
eternal oxide
#

Forks fault if it breaks compat

echo basalt
#

big problem if everyone uses the fork

eternal oxide
#

Good job not everyone does

echo basalt
#

Sometimes because you need things that don't exist in regular spigot

#

Like if you're running swm

eternal oxide
#

Then its not a Spigot plugin anymore

#

However nms is not API so not supported by Spigot anyway.

wraith dagger
#

guy how to add model for entitycreature to 1.12.2?

torn badge
eternal oxide
#

Mine does 🙂

torn badge
#

Then you're just missing out on performance for no reason

eternal oxide
#

I don't need this "improved performance". I prefer stability.

#

I like things to behave how I expect on my server, not things like TNT duping through portals.

torn badge
#

You know those are vanilla dupes, which can easily be disabled by a config option on Paper?

eternal oxide
#

They don't exist in Spigot

#

With Spigot I don;t have to change any settings. It works how I expect.

torn badge
#

Because they have been patched, but some people want to play the game as it is, including dupes

eternal oxide
#

I'd argue Spigot is closer to vanilla than paper

torn badge
#

You've just proven the opposite

eternal oxide
#

I'd have to take your statement that TNT duping is vanilla for that to be correct

torn badge
#

TNT, carpet, those are vanilla dupes and used in many farms

eternal oxide
#

I've never seen a TNT portal dupe in vanilla

torn badge
#

Because the easiest way doesn't require a portal

eternal oxide
#

I didn;t say easiest. I said TNT portal duping

#

Although after a little searching you may be correct. the portal dupe does seems to exist in vanilla

#

I'll still prefer Spigot over Paper 😉

pliant topaz
#

It's all just a thing of preferance

eternal oxide
#

There are performance benefits (in some areas) using Paper, btu there are also downsides.

pliant topaz
#

what downsides?

eternal oxide
#

different behavior

pliant topaz
#

well thats to be expected and is configurable

eternal oxide
#

Expected is a term I'd not use

#

they are choices made in the fork.

#

When Paper hard forks I'd have to reconsider which to use.

#

While its a fork I'll not pick a fork which changes behavior

wraith dagger
eternal oxide
#

I've no interest in Adventure

blazing ocean
#

eh, I really need my fonts

pliant topaz
#

its a nice have

eternal oxide
#

md5 components is all I need

blazing ocean
#

lmk when everything supports it

eternal oxide
#

everything?

blazing ocean
#

Text displays, names, item names, messages, just everything that uses components in mc

eternal oxide
#

ah

#

I've had no need for components in displays

#

the only one place wher component support would be handy would be in titles

blazing ocean
#

me when fonts

eternal oxide
#

fonts would be nice, but not essential

blazing ocean
#

I'm literally using custom fonts like everywhere

hybrid turret
#

how different is paper from spigot development?

blazing ocean
#

Paper deprecated everything related to legacy chat and replaced it with adventure, and they have some other useful APIs and events

#

They have their own brigadier API which is pretty cool

hybrid turret
#

brigadier?

#

command api?

eternal oxide
#

Brigadier is the system used by Minecraft

smoky anchor
karmic falcon
#
public static World loadWorld(String worldName) 
    {
        File pluginFolder = Main.main.getDataFolder();
        File worldFolder = new File(pluginFolder, "EFTM_Worlds/" + worldName);
        
        if (worldFolder.exists() && worldFolder.isDirectory()) 
        {
            WorldCreator worldCreator = new WorldCreator(worldFolder.getAbsolutePath());
            worldCreator.createWorld();
            World world = Bukkit.getWorld(worldName);
            if (world == null) 
            {
                Main.main.getLogger().severe("Failed to load world: " + worldName);
            }
            return world;
        } 
        else 
        {
            Main.main.getLogger().severe("World folder not found: " + worldFolder.getAbsolutePath());
        }
    
        return null;
    }

hi, im using this method to load worls by thier name inside plugins/MyPlugin/MyPlugin_Worlds/name_of_world , anywys this is for a minigame, how would i make a virtual copy of the world to be loaded so changes dont actually get saved for the next game.

void sigil
lost matrix
karmic falcon
valid basin
#

Does someone know in what version are EntityEffect and player#attack methods added to spigot api?

lost matrix
karmic falcon
lost matrix
karmic falcon
#

thnx

#

i saw on a forum tho a method .copy

#

inside the world creator

#

but the link mentioned was a page not found

blazing ocean
#

What issues does it cause

#

Currently just saving my worlds to the OS temp dir 🙃

eternal oxide
#

while that works, eww

blazing ocean
#

Yea exactly

#

And you can't directly override the save methods in your ServerLevel

#

Because that's how the fabric people do it

eternal oxide
#

it would be nice to be able to do a no save world

blazing ocean
#

Yea and I'm making a public lib so can't just modify the server

scarlet gate
#

I'm having some struggles running build tools, not sure quite what I've done wrong - I am using the new exe with the gui, build 1.21 works fine but older versions all fail
https://pastebin.com/7p2Cy1ZP

upper hazel
#

I have a question out of place, but I'll ask those who know. Is it possible to write a JAVA program to switch java version?

ivory sleet
#

Hmm dont think

#

I know there are some programs that are double programmed

#

Basically a launcher + actual program

upper hazel
#

bc process not can be stoped?

#

or smth else

ivory sleet
#

I mean its hard to just switch version

#

esp in the jvm

#

Like the current version has a certain garbage collector and supports certain things and presumably contains certain bugs yk

#

Its not like u can just jump up or down version like that

upper hazel
#

if it's written in 8 java?

ivory sleet
#

doesnt matter

upper hazel
#

new version should support old version

eternal oxide
#

this is def an x/y thing

ivory sleet
#

support does not mean changing version midst runtime in the jvm lol