#help-development

1 messages · Page 1078 of 1

slender elbow
#

I'm pretty confident that is not the kind of question they were asking lol

mortal hare
#

its such implicit language tbh with all that syntax sugar

brittle geyser
#

Its not works

slender elbow
#

not matching
plugin.yml

#

you are excluding the plugin.yml from having it's variables expanded

#

just do filesMatching("plugin.yml") {
blah blah
}

shadow night
#

why do you have to define the variables two times

mortal hare
#

and that's what i need since i want to register entries to registry at some point

#

in my case its perfect

#

but i fear that when i add something later

#

it would still become a class

#

lol 😄

tardy delta
#

kotlin is your savior

mortal hare
#

its still a class

#

but hidden Record class

tardy delta
#

just admit it

brittle geyser
slender elbow
brittle geyser
#

it is correct?

slender elbow
mortal hare
#

bad name i guess

#

i should probably just call it Enchantments

#

or something else

slender elbow
#

I wouldn't use duplicatesStrategy tho

mortal hare
#

and there's no reason to wrap it currently

slender elbow
#

or expose a register method and keep the registry internal

slender elbow
mortal hare
#

maybe, but then i need to put the calculate method somewhere

brittle geyser
#

And here is plugin.yml

mortal hare
#

and it doesnt fit anywhere else

brittle geyser
#

But nothing changed

slender elbow
#

gradle won't change your source plugin.yml, it will change it when jaring your classes and resources

brittle geyser
#

i know

#

it not works

mortal hare
slender elbow
#

that shouldn't be the issue but you can give that a go

mortal hare
#

i can access root level objects without that just fine

#

at least on fabric mods

slender elbow
#

maybe perform a clean build, perhaps you're looking at an old cached version (although it also shouldn't be the case)
is this on github or something to maybe take a better look?

brittle geyser
#

i can import plugin to github, wait a minute

slender elbow
#

lemme see

#

right

#

you are doing that in the root project's build.gradle.kts, you'd need to do that in the submodule (bukkit) build.gradle.kts, or move it inside the allprojects call

mint cairn
#

Why do I have a different result?

chrome beacon
#

Do you have any plugins installed?

slender elbow
chrome beacon
#

probably

tawdry shoal
#

hi, I have a certain stand with a diamond helmet on its head, using a texture pack I replace the helmet with a model of a prone player, but the problem is that I want to do a click test on this model, but the size of the helmet is much smaller than this body of a prone player player. How can I make the entire player body model clickable?

eternal oxide
#

add an InteractEntity as a passenger

mortal hare
#

Do you guys use Optional<>?

#

or prefer @Nullable instead

ivory sleet
#

nullable

#

Optional isnt worth it imo, that is cons vs pros

remote swallow
#

you made me remember about that

ivory sleet
#

naaa noway

remote swallow
#

do you think oliver forgot about it

#

holy shit smiles here

lost matrix
# mortal hare Do you guys use Optional<>?

I've tried it. Its ok. You would have to use it everywhere tho.
For a reactive backend its nice, but for a performance critical infrastructure such as games its meh.
Newer jvms optimize it a lot, so the performance difference might even be negligible by now.

umbral ridge
#

Hi conclube

lost matrix
#

There is really a small group thats always here ^^

umbral ridge
#

I am online like once per every 2 weeks

#

XD

echo basalt
#

Optionals are aite but I feel like they're an afterthought

#

Having been introduced in java 8 they get as much usage as streams. Old timers don't like them and new guys don't see the pros using them as much

#

They're okay for return values but this would've been better solved using a different nullable approach, like Kotlin does

#

Where instead of making a class that wraps the concept of nullability, you revamp it entirely at a language level

alpine urchin
#

i wonder how it's like in kotlin

echo basalt
#

You have the concept of "nullable" and "non-nullable" variables

#

And the "?" operator which lets you run certain actions if the value is nullable

#

While the "!!" operator converts a nullable to non-nullable, throwing an error if it's null

#

It works a little like this

alpine urchin
#

ah okay

echo basalt
#
fun getMyValue(player: Player): MyValue? = player.whatever

fun test(player: Player): String {
  return getMyValue(player)?.name ?: player.name
}
alpine urchin
#

interesting

echo basalt
#

The "elvis operator" ( ?: ) runs an action if the value is null

#

And you can use it for input validation

#
fun provider = providers[key] ?: error("Invalid key: $key")
provider.doSomething() // This is never null 
lethal python
#

i can't find an event for a minecart becoming activated by an activator rail or something similar, i want to make my own minecart type which can be activated

tawdry shoal
eternal oxide
mortal hare
#

what are your guys opinions about this

#

lets say i have a factory that returns implementation object of the interface to not break binary compatibility

slender elbow
#

sure

mortal hare
#

and there's no name currently i cant think of that implementation

#

what would you guys do

onyx fjord
#

C# bros must be angry now

mortal hare
#

question from me is not whether the interface prefix is bad, i agree with that statement

#

but whether what to do when you cant think of name for the implementation

slender elbow
#

needless prefixes and suffixes are needless

#

name things for what they are

onyx fjord
#

What's the name of your implementation

mortal hare
#

if i have one implementation of an interface currently

mortal hare
#

in implementation sense its a primitive wrapper around nms enchantments

slender elbow
#

for example

interface UserStorage {
  User loadUser(Identifier id) throws IOException;
  void saveUser(User user) throws IOException;
  interface Factory {
    UserStorage createStorage(...);
  }
}

class SqlStorage implements UserStorage {
  // ...

  class Factory implements UserStorage.Factory {
     public UserStorage createStorage(...) { return new SqlStorage(...); }
  }
}

class FileBasedStorage implements UserStorage {
  // ...

  class Factory implements UserStorage.Factory {
     public UserStorage createStorage(...) { return new FileBasedStorage(...); }
  }
}
mortal hare
slender elbow
#

good names for what

onyx fjord
slender elbow
#

it entirely depends on what your types do, you can't just come up with an interface name and slap it wherever lmao

mortal hare
#

how would you name an implementation of interface which is primarily purpose is to hide away the implementation details from the user (factory construction)

slender elbow
#

that isn't really the way i use interfaces

#

i use interfaces for abstraction, not encapsulation

mortal hare
#

CraftBukkit for example prefixes the implementation classes of Bukkit API with Craft prefix usually

onyx fjord
#

I use abstract classes more than interfaces

slender elbow
#

yeah?

#

i don't like that strategy

mortal hare
slender elbow
#

sure

mortal hare
#

leaving other parts which use the interface intact

slender elbow
#

i don't really understand the point you are making

mortal hare
#

How to name such classes

#

if there's no good name

slender elbow
#

again, that entirely depends on what the classes and interfaces do

mortal hare
#

Impl suffix?

slender elbow
#

there is no such thing as "how do i name a class"

#

like bro what

mortal hare
onyx fjord
#

Are you making an interface for something with 1 implementation?

mortal hare
#

ik there's no 1:1 solution for this

mortal hare
#

that way i can create agnostic implementations of interfaces from outside the implementation

slender elbow
#

then the "prefix" or "suffix" of the class should derive from what the implementation does specifically within the bounds of the interface contract

umbral ridge
#

Hi emily

#

XD

slender elbow
#

there is a user storage interface, it can load and save users, then you have specific implementations, one that is backed by SQL data store, one that is backed by a file data store (think json or yaml), another that is backed by some http backend through a rest api (RemoteRestUserStorage or something)

slender elbow
young knoll
#

C# will hurt you if you don’t prefix interfaces with I

terse raven
#

hiii, is there a way to open a sign gui for a player that just asks them for input (like on hypixel !!) with just the spigot api? I would like to avoid using nms / protocollib :)
(i tried putting the sign really far away, but i got the error, that the player is trying to edit an uneditable sign :/)

mortal hare
#

microsoft always loved hungarian notation

onyx fjord
#

It's an apple reference

slender elbow
#

there is no "interface vs class" prefix/suffix that you should use, it depends on what the itfc and the impl do

#

and, like i said, i use interfaces for abstraction, not encapsulation; even if i was using classes instead of interfaces i can still change the way it operates and works without users/callers having to recompile their code, so you can have encapsulation in a regular class just fine

thorny willow
#

Hey, I wanted to make BlackJack in Minecraft and don't know how to make a break between dealing the cards (1 sec).
I already tried it with BukkitRunnable runTaskLater and with Thread.sleep(1000) but it won't work.

public void start() {
        this.setGameState(GameState.PLAYING);
        deck = Card.createDeck();
        playerList.forEach(player -> {
            player.sendMessage(BlackJackManager.prefix + "§7Das Spiel beginnt!");
            List<Card> deckP = new ArrayList<>();
            this.playerDecks.put(player, deckP);
        });
        for (int i = 0; i < 2; i++) {
            for (Player player : playerList) {
                drawCard(player);
            }
            drawCardDealer();
        }
    }

    public void drawCard(Player player) {
        playerDecks.get(player).add(deck.peek());
        Bukkit.dispatchCommand(Bukkit.getServer().getConsoleSender(), "give " + player.getName() + " minecraft:paper{display:{Name:'{\"text\":\"" + deck.peek().getCardName() + "\"}'}}");
        deck.pop();
    }

    public void drawCardDealer() {
        dealersDeck.add(deck.peek());
        deck.pop();
    }
#

Nothing to do with the rest sry :')

echo basalt
#

Hm

#

First thing I'd do is make the game state thing an abstract class

#

PLAYING is alright for an internal state enum when it comes to things like matchmaking

#

Anyways your solution is to use the bukkit scheduler

#

I'd probably have some sort of CardQueue class which is a wrapper or a Queue<PlayerCard> and a task that polls and gives that player a card

#

PlayerCard would be a data class of (Player, Card)

runic pine
#

my server crashed. how do i see what caused the thread to stop?

eternal oxide
#

read the logs

runic pine
#

a

eternal oxide
#

the logs, not just a choice bit you wanted to post

young knoll
#

1.8 server running on java 22

#

Smells like a fork

#

Oh wait it straight up says PandaSpigot

runic pine
#

so the crash started after installing the nameless plugin

#

probably this plugin

eternal oxide
#

I want an actual LOG. Not part. The lead up to this thread dump is important

eternal oxide
#

ok I'm off to bed

floral drum
#

wtf is a pandaspigot

young knoll
#

“Updated” 1.8 fork

floral drum
#

bruhhh

tender shard
floral drum
#

honestly I would just throw an exception if the class or whatever is null

#

imo

remote swallow
#

prob 1

tender shard
#

then I could just use Any.toPrettyString() instead of Any?.toPrettyString()

floral drum
#

but I would probs agree just #1

tender shard
remote swallow
#

1

floral drum
#

3 is just too much overhead

#

just overcomplicated

tender shard
floral drum
#

lmao ok

#

yeah that

remote swallow
floral drum
#

perfect

remote swallow
#

how did i send that

#

wtf

floral drum
remote swallow
#

i typed yeah and pressed enter

#

idk how i send that thing

floral drum
#

yeah

#

weird

deep hornet
young knoll
deep hornet
#

anybody knows how i can display a strenght potion?

#

at the display material

#

and at the material

#

looks like this in game

tender shard
#

can't you simply set the appropriate PotionMeta stuff?

deep hornet
#

i want the potion to be at sell

#

to be on the shop

#

and i am on 1.8

tender shard
#

no clue about 1.8

young knoll
#

It think it was just a damage value back then

#

POTION:#####

#

No idea what the number was, check the creative inventory

deep hornet
#

like that?

young knoll
#

Yeah

deep hornet
#

like

young knoll
#

See if the plugin accepts POTION:8201 or something

deep hornet
#

POTION:#0373/8201

#

a

#

still like this

tender shard
#

373 already is potion

#

try just POTION:8201
or
373:8201

wet breach
#

8265

deep hornet
#

i tried POTION:8201

#

and didn't worked

deep hornet
deep hornet
wet breach
#

what mc version?

deep hornet
#

1.8

#

the plugin is redstonepvpcore

wet breach
#

names are not used. its item id's

#

8265 is the longer time variant of strength potion

deep hornet
#

for armor i did with names

#

gui:
title: '&e&lGOLD SHOP'
size: 54
items:
Helmet:
display-material: DIAMOND_HELMET
material: DIAMOND_HELMET
display-amount: 1
amount: 1
data: 0
display-name: '&eHelmet'
name: '&eHelmet'
display-lore:
- ''
- '&fPrice: &e16 Gold'
lore: []
display-enchantments:
- Protection 4
- Unbreaking 3
enchantments:
- Protection 4
- Unbreaking 3
slot: 10
permission: shop.helmet
cost-material: GOLD_INGOT
cost: 16

#

discord fonts..

wet breach
#

material names are not the same as item id's

deep hornet
deep hornet
#

?

wet breach
#

are you making a plugin or configuring one?

deep hornet
#

configuring

wet breach
#

then you are at the mercy of however that plugin was made

#

you are also in the development channel

deep hornet
deep hornet
wet breach
#

again, its however that plugin was made

#

if you were making a plugin it would be different

deep hornet
#

yea

echo basalt
#

ah throwback to when I was a kid and didn't know how to spell "strength"

wet breach
#

lol

deep hornet
#

maybe you will have an idea

echo basalt
#

decompile it, figure it out

#

nothing crazy

brisk estuary
round elbow
#

im attempting to create a spigot 1.12.2 plugin and this appeared, not sure what's wrong

BukkitDiscordHook:main: Could not find org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT.
Searched in the following locations:
  - https://repo.maven.apache.org/maven2/org/spigotmc/spigot-api/1.12.2-R0.1-SNAPSHOT/maven-metadata.xml
  - https://repo.maven.apache.org/maven2/org/spigotmc/spigot-api/1.12.2-R0.1-SNAPSHOT/spigot-api-1.12.2-R0.1-SNAPSHOT.pom
  - https://jitpack.io/org/spigotmc/spigot-api/1.12.2-R0.1-SNAPSHOT/maven-metadata.xml
  - https://jitpack.io/org/spigotmc/spigot-api/1.12.2-R0.1-SNAPSHOT/spigot-api-1.12.2-R0.1-SNAPSHOT.pom
#
plugins {
    id("java")
}

group = "io.github.rephrasing.discordhook"
version = "1.0-SNAPSHOT"

repositories {
    mavenCentral()
    maven {
        url = uri("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
        url = uri("https://oss.sonatype.org/content/repositories/snapshots/")

    }
}

dependencies {
    compileOnly("org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT")
}
#

this is my build script

floral drum
#

that is not how repositories work

#

you're defining the same variable twice, which is url

#

basically overwriting your original spigotmc one with sonatype

#

just remove the sonatype url and it will work

round elbow
#

ah i see

#

i kinda forgot how that worked lmao its been a while since i worked on plugins

pale siren
#

Hi, I have a problem, I have a voucher plugin and I want to make that when I right click on a voucher I send a message, the method I am using is:

public Voucher findVoucherByDisplayName(String displayName) {
        for (Voucher voucher : vouchers.values()) {
            if (voucher.getDisplayName() != null && voucher.getDisplayName().equals(displayName)) {
                return voucher;
            }
        }
        return null;
    }

but when I use it, it doesn't return the voucher, this is the listener code:

Voucher voucher = plugin.getInstance().getVoucherManager().findVoucherByDisplayName(itemDisplayName);
        System.out.println(voucher.getName());

right on print, I get nullpointerexception returned
can anyone help me please?

echo basalt
#

debug your vouchers map

pale siren
# echo basalt debug your vouchers map

the vouchers themselves work, I use a method to search for them by their name to check if they already exist or not, what I don't know is why it returns null if I try to search for them by their displayname

brisk estuary
#

debug your vouchers, print all current vouchers and itemDisplayName, then check if it exists and what is inside the vouchers list

drowsy helm
#

So I want to keep track of all player stats in db, so it has to be extremely granular and will end up looking like

int coalMined
int ironMined

blah blah blah for like 100s of different stats,
would you guys split that up into different data classes/different tables on a db. I'm thinking having to load all that data all at once would be a bit excessive, what do you guys thing

#

As in have table for blockBreakStats, then one for enemiesKilledStats etc

wet breach
worldly ingot
#

I mean you can absolutely select and insert specific columns to avoid the mass data problem

#

If I'm being honest though, I think SQL is a poor choice for statistics. Something like Mongo sort of excels here imo. If you're dead-set on SQL however, then yeah, maybe breaking your stats into multiple tables would be a good idea, but still grouping related stats together in columns

#

Or depending on what you plan on doing with the data, a single table with a JSON blob of stats might work fine. You obviously can't lookup specific stats and you either get all or nothing, but again, depends on your needs.

tulip abyss
#

I'm looking for a developer who can make an advanced Minecraft client

torn shuttle
#

thanks I hate it

#

oooh

#

I just had a clever idea I think

#

ok it's like

#

a 7/10 on the clever scale

rough ibex
#

clever as in good idea or clever as in stupidly contrived

torn shuttle
#
    @Override
    public void execute(CommandData commandData) {
        ArenaCommands.openArenaMenu(commandData.getPlayerSender(), commandData.getStringArgument("arenaID"));
    }

ok so it's not bad

#

it's not good either

#

but it's not bad

#

I think that's about as easy as I can come up with right now

#

the thing I added is the command data class that just gives an easy interface with the underlying advanced command class to get arguments and a shortcut to getting the sender as a player type

#
public class ArenaCommand extends AdvancedCommand {
    public ArenaCommand() {
        super(List.of("arena"));
        addArgument("arenaID", new ArrayList<>());
        setUsage("/em arena <arenaID>");
        setPermission("elitemobs.event.start");
        setDescription("Open the Arena menu.");
        setSenderType(SenderType.PLAYER);
    }

    @Override
    public void execute(CommandData commandData) {
        ArenaCommands.openArenaMenu(commandData.getPlayerSender(), commandData.getStringArgument("arenaID"));
    }
}

basically this is how a command gets registered and how the execution works out (and if you think it's unsafe, yeah kinda in many ways right now)

echo basalt
#

static method o_o

alpine narwhal
echo basalt
#

yeah here's how I do mine

torn shuttle
#

yeah it got recommended but I guess I also want to do some funky stuff with it

alpine narwhal
#

Its 100% worth it

torn shuttle
#

I got in this mess in the first place because I was too lazy to write my own command system in 2017

#

at least if I write it I know it will behave the way I want it to

alpine narwhal
#

I use mine specifically for easier tab complete suggestions and to set arguments like /gamemode mode:creative target:player

torn shuttle
#

yeah my code also does that

#

I still have to figure out a way to do command hints if it's even possible

#

also have a special value to list online players, just basic QOL stuff

blazing robin
#

hey guys im creating a bgm plugin and playSound is very work as well, but the problem the minecraft music is playing at the same time how can I disabled minecraft default music?

eternal oxide
#

Pretty sure default music is client side

blazing robin
#

hmm I think it's possible with the resourcepack

proud badge
blazing robin
proud badge
#

yes

blazing robin
#

actually Im using the Itemsadder is it possible too?

proud badge
#

idk

#

you'd have to make a resourcepack

blazing robin
#

hmm

proud badge
#

and add it to your server

blazing robin
#

got it thank you 🙂

mortal hare
#

do you guys nest interfaces

#

or you do you prefer flat interfaces separated in separate interface java files

inner mulch
mortal hare
#

but in that case namespace gets polluted when you have data classes that are only used within the root data class, lets say i have Block and BlockData. If it's only used to define Block's data why not nest them within the Block interface and have Block.Data syntax instead

shadow night
#

The only acceptable case for making an inner interface are functional interfaces

#

Oh, should add this: imo

mortal hare
#

but having separate files are easier to maintain

#

so i cant f*cking decide lol

#

you can have hybrid approach, define nested interface:

interface Foo {
  interface Data {
    ...
  }
}

and implement those interfaces like this:

public class SimpleFoo implements Foo {} 
public class SimpleFooData implements Foo.Data {}
#

that way when you return Foo interface you can still access Data implementation object via Foo.Data, but for implementation details you use flat structure for easy maintainability

shadow night
#

Looks fine

#

I'd even say it looks pretty good

mortal hare
#

who tf in jetbrains decided that this should be a good hotkey

runic pine
#

https://imgur.com/a/JW2TAyT if i want to move the entity (in runnable), do i have to get the entity instance by uuid or can i use armorstand variable?

eternal oxide
#

no

mellow edge
runic pine
#

i have get entity instance by uuid on runnable right'

#

to avoid problems (chunk unload etc)

mellow edge
#

well depends, if the armor stand may be gone while performing the runnable then yes, but otherwise I don't see any problems just using the same instance

#

in your case you may try to get it by uuid and then check if it's null (that means it was destroyed or no longer loaded)

runic pine
mellow edge
#

yes isValid is what you want

#

but I still think it's best if you get it by uuid and check if it's null

#

really depends on your impl. tho

runic pine
mellow edge
#

and isValid won't check for chunk unloads

runic pine
#

and if I get the instance by uuid I am guaranteed that this is the instance the player is seeing

mellow edge
#

well yes

#

you get the instance by uuid, if the uuid doesn't exist, then the chunk is either not loaded or the entity was removed from the world

#

or it never existed

runic pine
#

ok thx

wise mulch
#

What does a worldgenerator have to do to make structures actually generate? I have shouldGenerateStructures() overridden to true but locating and TPing to any structure reveals nothing ever generates, however the bounding box is there as evidenced by advancements being granted. I have ruled out any code I have written as a cause for the issue, as even a simple blank generator like so is enough to reproduce the issue:

public class TestGenerator extends ChunkGenerator {

    public boolean shouldGenerateStructures() {
        return true;
    }

    private static final List<BlockPopulator> populators = Lists.newArrayList(new SkyGridPopulator());
}
wooden rune
#

Hey Guys !

To make it short, I'm making a plugin that converts a .txt file into a written_book in minecraft.

I have a problem with Encoder because I red on the internet that this big boi doesn't like some characters. But actually, I made logs of my program and no wrong character was found...

Please, Can I have your help ?

Here is the logs that I talked about:

blazing ocean
#

?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.

eternal oxide
#

so what are you actually asking?

#

stop spamming

#

?paste for large text

undone axleBOT
mellow edge
#

is he maybe not reading UTF-8?

eternal oxide
#

We still need an actual question to answer

wooden rune
eternal oxide
#

Now ask a question

wise mulch
#

My guess is that the implementation that actually applies the book's text to the written book's nbt/components is incorrect, since it's reading it just fine

wooden rune
#

What is the problem ?

mellow edge
eternal oxide
#

I can already see what his issue is, but I'd like him to actually ask

river oracle
#

It's a self host of hastebin

mellow edge
#

yeah it was familiar

#

it was probably made for people not to send random pastebin websites

wooden rune
wise mulch
#

That's not what I was saying at all

runic pine
#

playerinteract is called when i place a block?

wise mulch
#

But if someone else evidently found the issue then I'm wrong anyways

river oracle
eternal oxide
#

he didn;t setAuthor

mellow edge
river oracle
#

It's called before you place the block

wooden rune
#

Oh

river oracle
#

While you're interacting with the block

#

BlockPlaceEvent is called as you place the block

#

And the block place immediately proceeds the event

wooden rune
#

Oh my ..

wooden rune
wise mulch
eternal oxide
wise mulch
#

Of course. I wouldn't be able to generate a blank world using that code if it didn't

#

But you are correct in that it was an important clarification to make.

eternal oxide
#

certain structures require Stone gen to be able to place

wise mulch
#

Strongholds do not; they can appear floating.

#

But if a structure failed to generate, then its bounding box would not generate either.

eternal oxide
#

true

wise mulch
#

Yet we have a situation where only the bounding box generates

#

/locate a fortress using a generator like this. You'll get the Eye Spy advancement when you stand on a block at the stronghold

runic pine
wise mulch
#

This is because the bounding box did actually appear; so we know there should be a structure there, but for one reason or another there simply isn't

runic pine
#

for some reason the playerinteract event is being canceled if I interact with the air but if I click on a block, that is (blockplace) it is no longer canceled and I only have 1 plugin and this plugin I saw the whole code and it does not cancel the event wtf

analog matrix
#

Hey guys I have a problem. I want to create a precreated file.
This is my code:

private static final File RECIPEFILE = new File(BetterOres.getPlugin().getDataFolder(), "recipe.yml");
    private static final FileConfiguration RECIPEONFIG = YamlConfiguration.loadConfiguration(RECIPEFILE);

    public void saveRecipeFile() {
        if(RECIPEFILE.exists()) return;
        RECIPEFILE.getParentFile().mkdirs();

        BetterOres.getPlugin().saveResource("recipe.yml", false);
        YamlConfiguration.loadConfiguration(RECIPEFILE);
    }

In older plugins is use this code too and it created everything

river oracle
river oracle
#

You need to ask better questions. You usually have vague questions don't explain your problem and provide 0 relevant code

runic pine
#

I only cancel the playerinteract in some cases but none of the cases are with redstone_block but ok. I have to use blockplaceevent too so it doesn't matter for now

#

this method not get the higher block?

river oracle
#

Please use paste

#

?paste

undone axleBOT
runic pine
river oracle
#

Revolutionary

#

I think you're right

runic pine
#

yea that was it

harsh ruin
#

Does anyone know how to resolve the problems with multiverse core and datapacks? I have a datapack which plays an animation with display_blocks using a function but this datapack only works on the main world and not the worlds created with multiverse core

runic pine
analog matrix
runic pine
#

i use configuration = new Configuration("barrel", "lang.yml", plugin); and configuration.savedefaultcnofig();

drowsy helm
#

Ask the creator

harsh ruin
#

I create the datapack 😅

#

On bdengine

analog matrix
# runic pine no but configuration.java works

nope

public class Configuration {

    private File file;
    private String name;
    private JavaPlugin javaPlugin;

    private FileConfiguration configuration;

    public Configuration(String name, JavaPlugin javaPlugin) {
        this.name = name;
        this.javaPlugin = javaPlugin;
    }

    public void saveFile() {
        javaPlugin.saveResource(name, false);
        file = new File(this.javaPlugin.getDataFolder() + File.separator + name);
        configuration = YamlConfiguration.loadConfiguration(file);
    }
}
private static BetterOres plugin;
    private Configuration configuration = new Configuration("recipe.yml", this);

    @Override
    public void onEnable() {
        plugin = this;
        saveDefaultConfig();
        configuration.saveFile();
    }

Its the same error
https://paste.md-5.net/cuxuyiwebo.bash

analog matrix
undone axleBOT
ocean hollow
wooden zodiac
#

anyone use intelIJ idea here? i need help

harsh ruin
#

me but i'm lmao

wooden zodiac
#

whenever i compile my plugin it compiles with plugin name and version but i dont want it to compile with version in compiled plugin.jar

#

like this its HiderPlus-1.3/1.7 i dont want version in it

shadow night
#

just rename it?

wooden zodiac
shadow night
#

Then leave it with the version

wooden zodiac
blazing ocean
#

just make a copy task that copies it to HiderPlus.jar

shadow night
#

I don't see how the version in the plugins name is an issue lol

umbral ridge
#

Yes

shadow night
#

oh lol just as I said

blazing ocean
wooden zodiac
shadow night
#

But with gradle you can just set the archivesName to whatever you want

umbral ridge
#

I use a custom made compiler

blazing ocean
#

based

shadow night
umbral ridge
#

No maven or gradle

blazing ocean
#

i just run kotlinc

wooden zodiac
#

does it make any difference?

blazing ocean
#

not much

umbral ridge
shadow night
#

it's all java and all spigot

blazing ocean
#

java you say? 😏

shadow night
blazing ocean
#

proof?

spice burrow
#

her back pain should be enough proof

runic pine
#

Is playerjoinevent on the main thread?

drowsy helm
#

All async events are labeled async in the name

slender elbow
#

except for the times where the async events are fired on the main thread

eternal oxide
wise mulch
#

I'm going to look at other worldgen plugins for 1.20.6 to see if the same issue occurs. Is this a Spigot bug?

#

I thought I may have been missing a step in my worldgen

eternal oxide
#

I don't believe so as this has bene talked about for years

#

at least mentioned since 2017

#

I can locate structures and teleport to them, but no blocks

#

?stash

undone axleBOT
ocean hollow
#

how can i fix the numbers? that's probably the problem

cobalt thorn
#

its possible to move shulker and still have the hitbox out of the grid?

ocean hollow
#

numbers are not pretty

dawn flower
#

use decimal format

hazy parrot
#

Do you want to round it or just cut decimals

ocean hollow
#

round it to normal values

#

like 3.8, 3.35

dawn flower
#
public static void displayImage(Location location, String[] data, int width, int height) {
        try {
            float scalingFactor = 0.4f;
            double imageCenterX = (width * scalingFactor) / 2.0;
            double imageCenterY = (height * scalingFactor) / 2.0;
            for (String str : data) {
                if (str == null)
                    continue;
                String[] split = str.split(",");

                int px = Integer.parseInt(split[0]);
                int py = Integer.parseInt(split[1]);
                int red = Integer.parseInt(split[2]);
                int green = Integer.parseInt(split[3]);
                int blue = Integer.parseInt(split[4]);

                double mx = px - imageCenterX;
                double my = py - imageCenterY;
                Location particleLoc = location.clone().add(mx, 0, my);
                Color color = Color.fromRGB(red, green, blue);
                Particle.DustOptions options = new Particle.DustOptions(color, 1f);
                location.getWorld().spawnParticle(
                        Particle.REDSTONE,
                        particleLoc,
                        1,
                        0, 0, 0,
                        1,
                        options
                );
            }
        } catch (Exception ex) {
            throw new RuntimeException(ex);
        }
    }```
this is getting the particleLoc really wrong
#

it literally draws the image hundreds of blocks away

#

and it's drawing it as a line in the x coordinate

blazing ocean
#

question

#

why is the data a string array

dawn flower
#

to store it

#

as an csv

#

i don't want to be loading the image every tick when doing an animation

runic pine
#

entity.getnearbyentities include the entity instance?

dawn flower
#

no

runic pine
#

for (Entity entity : location.getWorld().getNearbyEntities(location, 30, 30, 30)) {

                        if (entity instanceof Player player) {
                            player.playSound(player.getLocation(), "note.supply", convertForSound((float) player.getLocation().distance(location)), 1);
                        }

                    }
#

and this include the entity on location instance?

eternal oxide
wise mulch
#

Is that what Spigot uses internally for providing its worldgen tools?

#

But even FLAT worlds can have strongholds when structures are turned on. Nowhere in vanilla Minecraft does a structure fail to generate in a way where only the bb is present

eternal oxide
#

yeah its odd

wise mulch
#

Even Mineshafts that generate exposed to light won't, there's actually a select few blocks that generate regardless of light level.

#

Either the whole structure including the bb fails to place, or you'll see at least some trace of the structure there.

runic pine
#

why not update? hologram.getStands().get(1).setCustomName("§7Vanishes in: §f" + TimeUtil.formatTime(120000 - (counter / 4 * 1000L)));

#

public List<ArmorStand> getStands() {
return stands;
}

chrome beacon
#

Storing a reference to an entity that way isn't recommended

#

It will lead to memory leaks unless you're very careful

#

Keep track of the entity uuids instead

runic pine
chrome beacon
#

and how do you know it isn't

#

If you're looking for help don't ignore the advice given to you

runic pine
#

but i ll test

#

so it doesn't make sense that a new armorstand instance was created along the way

#

yep

#

no updating yet

chrome beacon
#

then we don't have enough information to help you

#

When is that code running

#

is it running

#

what happens

runic pine
#

im debugging too

#

call or call1 is not appearing so it is some logic problem

runic pine
#

maybe armorstand1.remove is the cause of the probelm

wise mulch
#

MiniHUD can show them, I think you need to give it the server seed though.

eternal oxide
#

I actually can;t get any structures to spawn in a custom worldgen

#

they exist through /locate

wise mulch
#

I can just tell they are there because /locate would stop showing it once you load the chunk and it realizes there's no structure there. Even if it thinks there would be one there.

#

So that's how we know the bounding boxes there. Another reason is, of course, advancements being granted.

#

You could also tell the bounding box is there if you allowed certain structures specific mobs to spawn.

eternal oxide
#

yep I tp to teh locations shown by /locate, and do /locate again, it says 0 blocks away

#

but nothign is spawned

#

I even get an achievement for first entering a stronghold

eternal oxide
#

thats usign both FLAT and NORMAL worldgen

#

I'm beginning to agree this may be a bug. No clue if its vanilla or Spigot though

wise mulch
#

If the boolean was all I am supposed to need then this is probably a Spigot bug

eternal oxide
#

I've overridden both and no structures spawn in a custom worldgen

wise mulch
#

I'm lazy in bed right now. I'll open an issue on their tracker later.

eternal oxide
#

k

wise mulch
#

If you'd like to help me, you can also provide a compilation of information about what you've tried so I can add that to the issue as well.

#

I appreciate your tests

eternal oxide
#

the only thing I did different in Spigot over vanilla is I used a FLAT single biome ChunkGenerator

#

in vanilla I used FLAT but random biomes

wise mulch
#

For me, I'm just applying it over normal world generators. So I have vanilla biome spread and everything. That works, but I don't get my structure still.

eternal oxide
#

I'll strip my biome gen and test apples to apples

dawn flower
mortal hare
#

why didnt i knew about service loader before

#

such a great way to separate your implementation from api, without involving having to create static factory methods inside interfaces

#

whoever told me about this class couple days ago, thank you ❤️

slender elbow
#

more abstraction 😄

mortal hare
#

so it really helps me

eternal oxide
#

?paste

undone axleBOT
wise mulch
#

What's special about this?

#

Does this work?

eternal oxide
#

no

#

nothign works

#

No structures at all

tame wolf
#

Yello

#

What's the best way to stop hostile mobs from spawning in a certain radius?

#

I thought about despawning them immediately after they spawn or cancelling the spawn event, but I've found those two to be very laggy on the server

wintry iron
#

yoyo guys

#

im looking if someone knows about this thing

#

idk im not allowed to send a picture

eternal oxide
#

?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

wintry iron
#

ahh thanks

#

alright

#

so basically i was wondering if anyone of you knows how to replicate this floating text when a player gets killed:

eternal oxide
#

TextDisplay

wintry iron
#

it starts from the bottom and then goes up like 2 blocks high and disappears

wintry iron
#

I see, is there any plugin for this or I'd have to engage with a dev?

#

I'm using 1.8.9

eternal oxide
#

they don;t exist in 1.8

#

you have to use ArmorStands

wintry iron
#

oh lol

#

damn

eternal oxide
#

theres probably some plugin to do it but no clue on 1.8

inner mulch
#

armorstands for 1.8

wintry iron
#

shit im cooked

inner mulch
#

why

wintry iron
#

nah its fine

#

ill just wont put it in my server

#

its just for aesthetics but that'd take more than what im capable of

pearl junco
#

Lookin for someone who can translate plugin files to other languages on a easy way.

hybrid spoke
wintry iron
wintry iron
#

I will use that next time 🙂 thank you

halcyon hemlock
#

is this good guys??

#

im making a custom minecraft server framework implementation

rough drift
#

6.2ms per chunk

halcyon hemlock
#

are you american

rough drift
harsh ruin
#

hello, I really need help, I've been stuck on this for 4 days, I would like in my plugin, each player will have to spawn on their own map and have their own progress/progress. Can anyone help me please?
If you need more information/context like screens, video, no problem
https://paste.md-5.net/oduqeyojuw.java

undone axleBOT
rough drift
#

it's a code viewer

hybrid spoke
#

ahh

#

now it makes more sense

halcyon hemlock
# rough drift what?

there are 322 chunks, if it took 51 ms in total, it would be 0.15 ms per chunk 🤔

harsh ruin
rough drift
#

anyways yeah you're right

#

that's fine

halcyon hemlock
#

bro what dark magic does rust do

#

on debug profile its 600ms, on release profile its 60ms

rough drift
#

debug profiles in EVERY language are slow

#

they add a ton of extra things on top which are very slow

#

but provide you useful info

halcyon hemlock
#

yeah debug symbols

rough drift
#

yeah

#

it's standard procedure

harsh ruin
cosmic ibex
#

Where should I learn to make simple minecraft plugins 1.21? I have python, javascript, skript experience

Is there guide here or website?

undone axleBOT
#

For Beginners:

Codecademy - Learn Java: Interactive Java programming course from basics to more advanced concepts. Perfect for absolute beginners.
https://www.codecademy.com/learn/learn-java
JetBrains Academy - Java Developer Track: Learn by doing with projects and challenges. It covers Java fundamentals to advanced topics.
https://www.jetbrains.com/academy/
Udemy - Java Programming Masterclass for Software Developers: Updated courses that cover Java 8 to Java 17 features. Suitable for those who prefer structured learning.
https://www.udemy.com/course/java-the-complete-java-developer-course/

For Intermediate to Advanced Learners:

Oracle Java Tutorials: The official guides by Oracle for Java programming—great for understanding the depth of Java.
https://docs.oracle.com/javase/tutorial/
Baeldung - Learn Java and Spring: Focus on Spring Framework and modern Java technologies. Best for intermediate learners aiming to expand their knowledge.
https://www.baeldung.com/

Practice and Hands-on Learning:

Exercism - Java Track: Solve exercises and get feedback from mentors. Great for practicing coding skills.
https://exercism.io/tracks/java
LeetCode: Practice your coding skills and prepare for technical interviews with Java.
https://leetcode.com/

Free Resources and Documentation:

Java Programming and Documentation: A comprehensive collection of Java programming guides, tutorials, and API documentation.
https://docs.oracle.com/en/java/

Community and Support:

Stack Overflow: A vast community of developers. Great for getting help with specific problems or understanding concepts.
https://stackoverflow.com/questions/tagged/java
r/learnjava on Reddit: Join the community of Java learners and get advice, share resources, and discuss projects.
https://www.reddit.com/r/learnjava/

Remember: Learning to program takes practice and patience. Don't hesitate to experiment with code and participate in community discussions. Happy coding! 🎉

rough drift
#

you need to learn java

#

plugins are written in Java, so you know, you gotta learn it

#

secondly

#

?jd-s

undone axleBOT
rough drift
#

that has every single class, method, description, etc

#

of all the spigot API

#

third off, you probably want to use the wiki

#

@cosmic ibex

cosmic ibex
rough drift
#

np

halcyon hemlock
#

no programming experience

rough drift
#

I did the nolife run

#

started at 8

eternal oxide
#

we remember 😛

rough drift
#

began programming at 11-12

#

no wait I'm high

#

I started programming at 8

#

and did plugins at 11-12

#

"_comment"

river oracle
#

It really should support json5

#

Alas

tender shard
#

jason

rough drift
#

Jackson

#

negative strictness launches a LLM to make it figure out what you're saying

sand spire
#

Is it possible to know if an PlayerInteractEvent was called because of dropping an item from your inventory while holding an item in your mainhand?

The information I receive is identical to punching the air and when I tried checking if the player's inventory is open I found out it's always open. And InventoryClickEvent is called after PlayerInteractEvent.

ivory sleet
#

on skibidi

ivory sleet
#

😔

rough ibex
#

anything you say can and will be used against you in a court of law

peak bobcat
#

Could someone give me a quick rundown on how to make a specific item stack to a number greater than 64?

slender elbow
#

setMaxStackSize or something in the ItemMeta

#

?jd-s

undone axleBOT
eternal oxide
#

yes

small current
#

im using fastboard's api
if i join using lower versions, the scoreboard shows only half the text, its not wide enough

#

i've seen this before with scoreboard plugins

#

how to fix it

chrome beacon
#

You cannot

#

There is a fixed length of scoreboards in older versions

#

well I mean there is ofc a limit in newer version too but it's much higher

#

Make your scoreboard text shorter

#

That includes color codes

small current
# chrome beacon Make your scoreboard text shorter
    - "&7- &bName: &a{name}"
    - "&7- &bKills: &a{kills}"
    - "&7- &bDeaths: &a{deaths}"
    - "&7- &bKillStreak: &a{killstreak}"
    - "&7- &bBestKillStreak: &a{best_killstreak}"
    - "&7- &bCoins: &a{balance}"
    - "&7- &bK/D: &a{kd}"
    - "&7- &bELO: &a{elo}"
    - "&7- &bCountdown: &a{cooldown}"
#

this is the default config, i know it looks bad

#

but

#

this doesn't look too long

#

i can see wider scoreboards in the same version

chrome beacon
#

That does look a bit short

small current
#

yes

#

it does

chrome beacon
#

So I counted the letters

#

and that is indeed the 16 character limit of old versions

jolly solstice
chrome beacon
#

yes

jolly solstice
chrome beacon
#

They're wasting 8 characters on colors and that initial -

#

So you just have 8 letters remaining for the key and value

blazing ocean
#

pretty sure you can just remove the colour codes by using components no?

jolly solstice
#

I'ts probably (for the sake of limitation) a good idea if you remove the &7- at the starts (4 characters) and limit color coding to either only coloring the text or the value (saves another 2 characters)

#

For old versions that is

chrome beacon
#

where that's not an option

blazing ocean
#

1.8 💀

#

components have been a thing since 2013 i think

chrome beacon
#

yeah but it's taken a while for them to be implemented everywhere

jolly solstice
# blazing ocean 1.8 💀

Hey, I'm playing my current FTB modpack on 1.7.10 - if you want to run a server on that version, you gotta make some plugins for that too eventually 😛
(even though you could make a mod instead)

worthy yarrow
#

Rad doesn't do that

chrome beacon
#

hybrid 💀

worthy yarrow
#

He's a chad

jolly solstice
# blazing ocean 1.8 💀

I just wonder if people still argue that the old combat system is the reason for not going beyond 1.8 or if those servers have created a biotop around itself, that really doesn't support any upgrades

blazing ocean
worthy yarrow
#

Every single one of them too I swear

jolly solstice
blazing ocean
worthy yarrow
#

literally

blazing ocean
#

"there are several advantages" no there aren't

jolly solstice
#

Just cancel the damage event and reimplement the old damage style. Boom.

worthy yarrow
#

Nah bro nah

#

1.8 is just better

#

"Ok how?"

#

"It just is bro"

blazing ocean
#

the one exception to that is hypixel

#

but anybody ever trying to compare ANYTHING to hypixel is stupid

worthy yarrow
#

Yeah but hypixel is hypixel

#

There was a guy the other day asking about 1.7 plugins

blazing ocean
#

💀

worthy yarrow
#

I kinda just laughed in his face

blazing ocean
#

kat wanna join vc?

worthy yarrow
#

Not particularly

#

I gotta finish this damn project

blazing ocean
#

damn

eternal oxide
#

rejected

jolly solstice
slender elbow
#

i am expecting 100k players

worthy yarrow
#

I've been waiting since I got banned from hypixel actually

#

I think I might be the only person to have a genuine false ban off hypixel

torn shuttle
blazing ocean
#

i'll get 20m AT LEAST

torn shuttle
#

I'm building my mc server to be able to hold the entire human race, concurrently, on a single instance, twice over

#

people will be having kids just to have more people to play with in the server

blazing ocean
#

works on spigot 1.8 bro

#

trust me bro

worthy yarrow
#

doesnt work in 1.8

jolly solstice
#

"It's not the old version bro, I just need better hardware"

worthy yarrow
#

"More ram bro"

jolly solstice
#

"More LEDs bro"

#

xD

worthy yarrow
#

"More shitty free gpt dev plugins bro"

#

I remember some guy saying he only uses gpt to write his code lmao

torn shuttle
#

I don't know if I want to hit the gym in an hour and go there with a bad diet prep or hit the gym in 13.5 hours and go there tired

jolly solstice
#

It's very funny to me, that I very quickly understood how GPT is a good tool for certain things, like cleaning up some messy code (not change any logic) or to just quickly give me the infos I need to write what needs to be written ... meanwhile the newer generations literally immediately went to:
"YOOOO, I can just use it to replace myself, so I don't need to do any work anymore!! YOOOOOOOOOOOOOOOOOOOO"
a minute of silence for the new generations

worthy yarrow
#

I like to use it for math since 4.0, it's gotten way better at least in that aspect

jolly solstice
#

True

#

There was a good short video about it from PirateSoftware

worthy yarrow
#

I love his shorts

#

He's the reason I have a bag of 30 rubber ducks

jolly solstice
#

Good topic, good explanation - as always

eternal oxide
#

NEWGuy: GPT please order enough apples for one a day for a week.
GPT: Ordering seven apples...
NEWGuy: no I want one per day for a week.

#

We are heading there

peak bobcat
torn shuttle
#

loser behavior

#

my weeks objectively do not have 7 days

eternal oxide
#

who needs to count past one

torn shuttle
#

I'm not even joking

worthy yarrow
#

I started following magma's day cycle logic kek

#

One day is the amount of the time you grind + the amount of time you sleep

torn shuttle
#

my weeks have almost exactly 6 days

#

I work on a 28 hour cycle on average

jolly solstice
#

My weeks have 7 "normal" days during day time and 7 "actual days" where I'm productive during the night time 🙃

torn shuttle
#

at 28 hours there's 168 hours in a week, divided by 28 that's 6 days

jolly solstice
#

There is literally a cut to where I go onto my PC, with nothing else planned and can just focus on my stuff - and then go to bed, and I would count this as a completely seperate part of my time, so like its own day lol

torn shuttle
#

so my weeks have 6 days

worthy yarrow
#

I like to read before I go to bed

jolly solstice
#

Otherwise my brain will keep me awake with shit like "Oh, did you try this for Problem X yet?"

worthy yarrow
#

I do that too

dawn flower
#

https://paste.md-5.net/idupatunam.cs
this is getting the particleLoc really wrong
it literally draws the image hundreds of blocks away
and it's drawing it as a line in the x coordinate

jolly solstice
dawn flower
#

it's just a line, wdym screenshot

#

it makes a line of particles

jolly solstice
#

Screenshot of how it looks in game

dawn flower
#

straight line

#

it's really long

jolly solstice
#

Ah okay

dawn flower
#

but sure

#

the input location is just my location

eternal oxide
#

your string data is wrong then

dawn flower
#
    public static ImageData readImage(BufferedImage image) {
        int width = image.getWidth();
        int height = image.getHeight();
        ImageData.Pixel[] pixels = new ImageData.Pixel[width * height];

        int i = 0;
        for (int x = 0; x < width; x++) {
            for (int y = 0; y < height; y++) {
                Color color = new Color(image.getRGB(x, y), true);

                int alpha = color.getAlpha();
                int red = color.getRed();
                int green = color.getGreen();
                int blue = color.getBlue();

                pixels[i] = new ImageData.Pixel(x, y, red, green, blue, alpha);
            }
            i++;
        }

        return new ImageData(pixels, width, height);
    }```
#

this is how i read the image

#

Pixel is just a record

jolly solstice
eternal oxide
#

you are spawning particles on the x and z axis

dawn flower
#

i know that

eternal oxide
#

so it shoudl be a flat plane, IF you account for new lines

dawn flower
#

so like

#

it should be similar to pixelart

#

idk if it's called that

#

where it's drawn on the ground

slender elbow
dawn flower
#

where?

slender elbow
#

pixels[i] = new ImageData.Pixel(x, y, red, green, blue, alpha);
}
i++;

jolly solstice
eternal oxide
#

you only increase pixels at teh end of a line

dawn flower
#

am i not uspposed to do that?

eternal oxide
#

so the inner loop is replacing the same pixel

dawn flower
# jolly solstice Where do you convert the ImageData into a String array?
    public String[] convertToCSV() {
        return Arrays.stream(pixels)
                .filter(pixel -> pixel != null && pixel.alpha() == 255)
                .map(pixel -> String.join(",",
                        Integer.toString(pixel.x()),
                        Integer.toString(pixel.y()),
                        Integer.toString(pixel.red()),
                        Integer.toString(pixel.green()),
                        Integer.toString(pixel.blue())))
                .toArray(String[]::new);
    }```
slender elbow
#

for all of the y pixels on the same x, you are putting them in the same i

dawn flower
#

oh

slender elbow
#

since you only increment i after the row

dawn flower
#

so i fucked up?

eternal oxide
#

yes

dawn flower
#

wait so it should be incrementing i in the y loop

eternal oxide
#

you shoudl be increasing I inside the inner loop

dawn flower
#

i'm so smart

#

500 iq

jolly solstice
dawn flower
#

it was intentional so i'm dumb

#

anyways testing time

jolly solstice
#

I mean, you probably didn't know better

#

No need to beat yourself down

dawn flower
#

true

#

no flippin way it works

slender elbow
#

let's go

dawn flower
#

but uh

#

it's black and white

#

my code is on 40 years latency

#

i think i should divide by 255 since minecraft's /particle rgb is 0 - 1 not 0 - 255

#

not sure if it's the same for spigot

slender elbow
#

BufferedImage.getRGB returns ARGB
Color constructor takes RGBA

dawn flower
#

why does that make a difference 😭

#

what should i do

slender elbow
#

Integer.rotateLeft by 8 bits

chrome beacon
chrome beacon
#

because the limit is 16 characters

small current
dawn flower
#

Integer.rotateLeft(image.getRGB(x, y), 8);?

chrome beacon
dawn flower
chrome beacon
#

and that's on a 1.12.2 client?

small current
slender elbow
chrome beacon
# small current

So I looked it up and it looks like you can abuse prefixes and suffixes of players to get longer lines

small current
#

something that fastboard clearly doesn't do

chrome beacon
#

yes

small current
#

ok thanks

prime tartan
#

why is gamemode deprecated

#
if (player.getGameMode() == GameMode.CREATIVE) {
            return;
        }```
#

or wait its non existent

chrome beacon
#

Update Intellij

prime tartan
#

how do i do that

small current
#

wha

chrome beacon
#

yeah I was about to say it does have the code for it

chrome beacon
prime tartan
worthy yarrow
prime tartan
#

i'm trying to make a double jump function haha

small current
#

@chrome beacon it has adventure support, if i use it, will it work?

chrome beacon
#

not on 1.12.2

small current
#

the server runs on 1.19.4

chrome beacon
#

so wait how are you testing with a 1.12.2 client

#

if you're using viabackwards you really should test on 1.12.2 without it

small current
#

so older versions can join too

chrome beacon
#

._.

dawn flower
#

your server runs on 1.19.4 and you're allowing 1.12.2

#

why

slender vortex
#

help

#

Starting org.bukkit.craftbukkit.Main
Exception in thread "ServerMain" java.lang.UnsupportedClassVersionError: org/bukkit/craftbukkit/Main has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:524)
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:427)
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:421)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:420)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:467)
at io.papermc.paperclip.Paperclip.lambda$main$0(Paperclip.java:38)
at java.base/java.lang.Thread.run(Thread.java:833)

worthy yarrow
#

You're not using the correct java version

slender vortex
#

but i updated java

#

@worthy yarrow

kind hatch
#

Doesn't mean your IDE automatically switched versions.

worthy yarrow
#

run java -version in cmd prompt or wtv and see if you're using j21

#

iirc 65 is j21 right?

kind hatch
#

Ye

slender vortex
#

this shows up

worthy yarrow
#

Yeah you gotta change your java version to 21

slender vortex
#

how?

worthy yarrow
#

I'm trying to remember how to get there lol

torn shuttle
worthy yarrow
# slender vortex how?

System settings -> advanced sys settings -> Environment variables -> find 'JAVA_HOME' and change the path to the new version of java

kind hatch
worthy yarrow
#

Quite a backup drive

slender vortex
#

oh nvm found it

worthy yarrow
#

I think I forgot a step

#

iirc you have to edit the 'Path' variable as well, use the bin file of the java installation

#

After you do this, apply changes obv and run java -version again

#

to verify

dawn flower
#
    public static ImageData readImage(BufferedImage image) {
        int width = image.getWidth();
        int height = image.getHeight();
        ImageData.Pixel[] pixels = new ImageData.Pixel[width * height];

        int i = 0;
        for (int x = 0; x < width; x++) {
            for (int y = 0; y < height; y++) {
                int rgb = Integer.rotateLeft(image.getRGB(x, y), 8);
                Color color = new Color(rgb, true);

                int alpha = color.getAlpha();
                int red = color.getRed();
                int green = color.getGreen();
                int blue = color.getBlue();

                pixels[i] = new ImageData.Pixel(x, y, red, green, blue, alpha);
                i++;
            }
        }

        return new ImageData(pixels, width, height);
    }```
for some reason orange becomes purple, black doesn't pass in ``.filter(pixel -> pixel != null && pixel.alpha() == 255)``, white is graish
eternal oxide
#

you are converting 255 to 1? or 0.9?

dawn flower
#

no

floral drum
#

what are you trying to do here exactly?

eternal oxide
#

isn't your original RGB?

dawn flower
#

wait

#

the max of it is 255

#

not 1

eternal oxide
#

does spigot accept 255? or 1?

dawn flower
#

idk

floral drum
#

?isspigotdown

undone axleBOT
dawn flower
#

i found this old code in an old thread

Particle.DustOptions dust = new Particle.DustOptions(
                        Color.fromRGB((int) r * 255, (int) g * 255, (int) b * 255), 1);```
so i'm guessing it's 255
eternal oxide
#

looks like its 0-FF so 255

dawn flower
#

hm

eternal oxide
#

There is a fromARGB

dawn flower
#

how did u even

eternal oxide
#

Spigot is fine here in the UK

dawn flower
#

how can it just work in some countries only

#

internet these days

nova notch
#

Works for me

dawn flower
#

anyways

#

prob a skill issue from my browser

eternal oxide
#

cloud hosting

chrome beacon
#

works for me uwu

eternal oxide
#

a route may be bad for some

dawn flower
#

anyways time to test code

#

it works

#

it's displaying my boo'iful orange

#

and it displays black

#

but it's just making a black circle and puts orange at the end

#

nvm it's just massive

eternal oxide
#

I was going to say, shrink the scale of the particles

dawn flower
#

no, you don't understand

#

it's MASSIVE

#

holy moly

#

what in the world

eternal oxide
#

yes, pixels to particles is going to be BIG

dawn flower
#

nono

#

like

eternal oxide
#

scale by 0.1

dawn flower
#

i travelled

#

across

#

my whole map

#

and it's still going

#

(at scale 0.01)

eternal oxide
#

scale more 🙂

dawn flower
#

0.00000001

#

ok it crashed

eternal oxide
#

until there are no spaces between the particles

dawn flower
#

you mean less?

eternal oxide
#

I don;t know your code. So whichever moves teh particles closer together

jolly solstice
dawn flower
#

i think i'm doing something wrong

chrome beacon
eternal oxide
#

ah you are not scaling the spacing

#

mx,my

dawn flower
#

oh shit

#

i removed that for testing

#
double mx = (px * scalingFactor) - imageCenterX;
double my = (py * scalingFactor) - imageCenterY;```?
#

hhelp

#

my pc

#

is

#

aa

jolly solstice
dawn flower
#

also my pc didnt like 0.00000001 scalingFactor with proper scaling

jolly solstice
# dawn flower my pc

Remember, if you are drawing a 512x512 pixel image, that you are creating 262.144 objects with draw calls at the same time

dawn flower
#

well

jolly solstice
#

The problem is more the rendering here, rather than the amount of objects

#

Which is why your computer freezes on lower scale, as it needs to draw over 250k particles at the same time

dawn flower
#

i mean you could've just told me "you're drawing too much particles"

jolly solstice
#

In one tick (as far as your code goes)

dawn flower
#

yeah it didn't like that

jolly solstice
#

Either re-scale your image or skip every X amount of pixels (hard limiting the resolution)

brazen badge
#

Hello!
I am trying, for the first time, to create a cross-server plugin (my own project), and I am trying to do shared inventory between servers. But now I have a problem with serialising the inventory to save it inside the database.
But now I have a problem with serialising the inventory to save it inside the db.

So I created these methods:

public static String toBase64(Inventory inventory) throws IOException {
        try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
             BukkitObjectOutputStream dataOutput = new BukkitObjectOutputStream(outputStream)) {
          
       dataOutput.writeInt(inventory.getSize());

       for (int i = 0; i < inventory.getSize(); i++) {
       dataOutput.writeObject(inventory.getItem(i));
      }

      return Base64.getEncoder().encodeToString(outputStream.toByteArray());
   }
}
public static Inventory fromBase64(String data) throws IOException {
 try (ByteArrayInputStream inputStream = new ByteArrayInputStream(Base64.getDecoder().decode(data));
             BukkitObjectInputStream dataInput = new BukkitObjectInputStream(inputStream)) {
            /
            int size = dataInput.readInt();

            if (size % 9 != 0) {
                size = ((size / 9) + 1) * 9;
            }

            if (size < 9) {
                size = 9;
            } else if (size > 54) {
                size = 54;
            }

            Inventory inventory = Bukkit.createInventory(null, size);

            for (int i = 0; i < size; i++) {
                inventory.setItem(i, (ItemStack) dataInput.readObject());
            }

            return inventory;
        } catch (ClassNotFoundException e) {
            throw new IOException("Unable to decode class type.", e);
        }
    }

But im getting this error https://paste.md-5.net/ijuheraqes.md
can anyone help?

dawn flower
#

also why does my client not render particle that are far

jolly solstice
dawn flower
nova notch
dawn flower
#

oh yeah

#

force

brazen badge
dawn flower
#

by saving it as an itemstack array

#

you dont need to save the extra fancy stuff like holder

brazen badge
dawn flower
#

ah

#

i remember that gist

#

if you look in the comments, people are complaining about that error

#

(there are fixes in the comments)

#

and if you're using paper there's a safer way

#

to avoid data loss