#help-development

1 messages Β· Page 1018 of 1

echo basalt
#

The thread.sleep is for debugging purposes

#

I tested real-world performance and was doing about 1M blocks per second with 4 threads

eternal oxide
#

uh your hash returns an int?

echo basalt
#

Testing purposes

#

I'll make it a long later

#

could it be overflow issues πŸ€”

eternal oxide
#

possibly

echo basalt
#

I was having some crazy results

#

changed it to a long and it made this

#

tf

young knoll
#

Bedrock spotted

echo basalt
#

test server's running geyser

young knoll
#

😩

echo basalt
#

with some heavy internals

fierce salmon
eternal oxide
#

currentItem has no entry for that UUID

fierce salmon
#

ok ty

echo basalt
#

how the fuck

#

I swear it's some concurrency bs problem

fierce salmon
# eternal oxide currentItem has no entry for that UUID

Nothing seems to happen when I click an item in the inventory. It's supposed to cancel the click when you click a gray stained glass pane but doesn't and doesn't add the player to the hashmap when they click the coal block

eternal oxide
#

This line if (event.getView().getTitle().equals(ChatColor.GREEN+"Personal Compactor")){ will never pass

#

color codes will already be translated when in teh view

echo basalt
#

Alright this pretty much works now, cool

fierce salmon
#

what do you mean?

echo basalt
#

maps everything except the initial location, hm

fierce salmon
#

ohhh

#

so i dont have to check for the color code ok

eternal oxide
#

it will contain a translated color code not CHatColor.GREEN

fierce salmon
#

i get it tysm

#

I removed ChatColor.GREEN and nothing changed

#

do i need to add the color code or smth?

echo basalt
#

wasn't there a memo about not using title checks

fierce salmon
#

i dont pay attention to memos

#

most of them are trying to screw me up

#

praying on my downfall and such

#

@echo basalt im just joking what do I do instead of a title check?

echo basalt
#

when the gui is open you toss the view on a Map<InventoryView, MyCustomGuiData>

#

When the gui closes, you yeet it from the map

#

and to check if it's your custom map, get the data and do stuff

fierce salmon
#

sounds complicated

echo basalt
#

uh

#

?moderngui

#

rip idk the command

#

?guio

#

?gui

echo basalt
#

yeaa

upper hazel
zealous osprey
#

Non working octree ig?

tardy delta
#

quadtree

swift dew
#

can i call loc.getWorld() or other bukkit read methods inside a compltetablefuture?

sterile axle
#

hard maybe depending on surrounding code. make sure nothing is going to change the variable during the time that the future is running, then it's probably ok

#

but you're playing with fire

swift dew
#

is there any other way to access loc.getWorld() inisde a completablefuture

sterile axle
#

get the world outside of the future and pass it into the threaded computation

#

but even then, the world could unload while you're working on it

#

so you're still playing with fire

#

it depends what you want to do off the main thread

#

what are you doing

swift dew
#

loop through blocks

#

and check their materials

#

idk if i can even do that on another thread

hazy parrot
#

Isn't there a chunk snapshot or smth

sterile axle
#

yes, that would be good to use

#

loc.getWorld().getChunk(x,z).getChunkSnapshot()

#

the ChunkSnapshot object is thread safe and you can do whatever you want to it inside of a completable future

#

when your future returns, figure out if what you wanted to do is still valid (world is still loaded? chunk is still loaded? player is still there? whatever); if so, continue on the main thread

sterile axle
#

i have no idea about its implementation

echo basalt
#

It copies a bunch of arrays

shadow night
#

Is that expensive

sterile axle
#

yeah, probably

#

but depending on what you're doing in a separate thread, it's a tradeoff

#

if what you're doing off the main thread is even more expensive it may be worth it

echo basalt
#

Creates snapshots on the main thread and flood-fills given a filter

#

Made it for scanning valid mob spawning locations in an island type deal

echo basalt
#

things within the world are not

swift dew
#

i think theres a diff problem

#

i asked this because my completablefuture was not returning stuff properly

#

it either returned null or crashed

echo basalt
#

.exceptionally and print it out

dim frost
#

Lets say I have two models
One is a triangle the other is a square
I have to put one side of each shape on top of each other but for that I need to rotate the triangle in "quaternion" or "axisangle"
how do I calculate the values I need to set?

shadow night
#

Usually by using maths

dim frost
#

bro? why do you think im asking then

#

Im asking exactly for how to do that math

pseudo hazel
#

thats gonna depend

ivory sleet
#

Is this just in a 2d plane?

pseudo hazel
#

if you have a triangle with a flat base then you just move one point of that base line towards the squares line

dim frost
pseudo hazel
#

then how do you have triangles

dim frost
#

but ive found sort of a solution by converting euler angles into quaternions

dim frost
pseudo hazel
#

just use axis angle

#

thats euler angles

dim frost
#

No isnt

pseudo hazel
#

then what is that

dim frost
#

its as messy as quaternions

#

u can read this document to understand axis angles

ivory sleet
#

Well thats in a 3d vector space

pseudo hazel
#

it literally says in the document that euler angles are axis angles

ivory sleet
#

u were talking about 2d shapes

pseudo hazel
#

a rotation around an axis

dim frost
#

what?

#

where

dim frost
#

Consider it being a cone and a cube then

pseudo hazel
#

"Axis-Angle Representation of 3D Rotations
According to Euler's rotation theorem, any 3D rotation (or sequence of rotations) can be specified using two parameters: a unit vector that defines an axis of rotation; and an angle ΞΈ describing the magnitude of the rotation about that axis."

dim frost
#

that doesnt say euler angles are axis angles?

#

that just means that axis angle is rotation along a vector taken as an axis

#

whereas Euler angles are angles around 3 fixed axis

pseudo hazel
#

where did you read that

#

anyways what did you wanna know again xD

dim frost
#

I wanted to know how I can visualize quaternions and move them around like im 3d modelling

#

which I simplified in saying by giving an example, which I gave in 2d, my mistake, think of it as a cone and cube instead

pseudo hazel
#

ah, well them im not the right person xD

dim frost
#

lol iz alright

#

ill wait on someone or figure it out myself after some gruesome hours of mathematic videos

hollow vessel
#

Hi!, I have problem with checking if player has item in inventory, this is my code:

if (!targetPlayer.getInventory().containsAtLeast(gpsItem, 1)) {
    this.notificationAnnouncer.sendMessage(player, this.messageConfiguration.medic.playerHasNotGpsItem, formatter);
    return;
}

this is check is always false. I'm convinced that player has this item because when Player join I'm putting this item to his inventory, like this:

 ItemStack gps = this.pluginConfiguration.gpsItem.asGuiItem().getItemStack();
 player.getInventory().addItem(gps);
tardy delta
#

What does that asGuiItem().getItemStack() do

hollow vessel
#

?paste

undone axleBOT
hollow vessel
#

this is my item builder from triumph gui, it is creating triump gui inventory item and then I'm getting itemstack of it

tardy delta
#

Uhhhhh

hollow vessel
#

what's wrong?

slender elbow
#

I'm like 99% sure asGuiItem adds a random UUID to the item meta for the purposes of it being a trackable GUI item, so the contains will return false because the pdc doesn't match

hollow vessel
#

I have idea, to loop player inventory contents and check if some item has specific nbt data, is it good idea?

slender elbow
#

uh, why not just use build() instead of asGuiItem()? that will give you the "raw" ItemStack without the GuiItem ID

hollow vessel
#

didn't think about it, I will test it - thanks!

#

now it is working, thanks

brittle geyser
#

How to do this thing?

#

Is it bStats?

chrome beacon
#

yes

brittle geyser
brittle geyser
spiral escarp
spiral escarp
spiral escarp
# brittle geyser

[IMG]https://bstats.org/signatures/bukkit/<your-plugin-name>.svg[/IMG]

spiral escarp
#

No problem!

short drift
#

Looking at the documentation it's not obvious to me whether spawnParticle can be shown only to specific players like the vanilla command can.

#

I'm thinking maybe it's hidden in extra or data.

short drift
#

Or it's not supported.

shadow night
#

Isn't there a spawn particle method in the player class

blazing ocean
#

or just Player#spawnPsrticle

short drift
#

Oh?

#

Oh .. so it is already specific to player.

#

Nice.

#

Thank you.

#

Now that you say it it seems obvious.

green prism
#

?paste

#

?paste

undone axleBOT
green prism
#

How is it possible that an item retrieved from the cache isn't considered similar (by ItemStack#isSimilar) until it has been displayed in a GUI?

drowsy helm
#

That doesnt sound right

#

Can you show your code

green prism
# drowsy helm Can you show your code

My bad, I noticed the error while sending the code...
I was modifying the display name of the cached items directly and never got the correct banknote.
It was only considered similar after modifying it through the GUI loading 🀣 πŸ˜…

#

Thank you!

umbral ridge
#

🍽️😿schnitzel spigot santa_5 khajiit

upper hazel
#

will inheriting an abstract class with public methods be bad if the inheritor does not use ALL the common methods of its parent?

#

general methods in protected

tardy delta
#

does not use or does not override?

eternal oxide
#

Extending an abstract class will force you to implement any unimplemented methods

#

you can choose what others to override

tardy delta
#

just make the subclass has consistent behaviour with the parent and dont care about unused methods

eternal oxide
#

the actual @override annotation is just a compiler thing. it will tell you if your method signature is correct in the IDE. It has no implementation at runtime

pseudo hazel
#

yeah though its very advisable to make override mandatory (in your head I guess) for every method you override, just so you know whats going on

#

also because the ide will let you know if you override a method incorrectly

upper hazel
pseudo hazel
#

and not using override it will just shadow the method instead of overriding

upper hazel
#

is protected

pseudo hazel
#

well you have to implement every abstract method, but whatever else you do depends on what you want

upper hazel
pseudo hazel
#

code will not compile if you do not implement an abstract /interface method when using the class

upper hazel
pseudo hazel
#

if you actually call the method is up to you

eternal oxide
#

you don;t have to use a method just becuase its there

upper hazel
pseudo hazel
#

usually the reason I make a class abstract is that there are some functions I want to be variable depending on something else and then I call the abstract function inside the abstract class, and let the inheritors decide what to actually do in the method

eternal oxide
#

if your abstract class has protected methods, only the class that extends/implements it will be able to access those protected methods

upper hazel
eternal oxide
#

descendants? is not a Java term

upper hazel
#

heirs*

eternal oxide
#

children

upper hazel
#

yes

pseudo hazel
#

just inheritors or child classes

#

but yes thats fine

upper hazel
#

i bad speak engl this all translate google

pseudo hazel
#

it all depends on what you wanna do with each class

eternal oxide
upper hazel
eternal oxide
#

not bad

upper hazel
#

does this apply to default methods of the interface or not( probably because of the public type)?

#

but there's nothing wrong with using it as a utility inside an implementing class I think

#

like abstact class

#

haha

eternal oxide
#

No nothing wrong with that. Generally default will just allow you to ignore it unless you want to use it

astral pilot
#

how do I make ConfigurationSection#getBoolean(String) return null if it doesn't exist

eternal oxide
#

it will return false, unless the section doesn;t exist, then you get an NPE

#

oh sorry, it will return null

astral pilot
#

i mean

#

how do i make it return null sorry i made typo

#

cuz rn it will return false if it doesn't exist

eternal oxide
#

no it returns null if it doesn;t exist

chrome beacon
#

can't return null

chrome beacon
#

boolean is a primitive

eternal oxide
carmine mica
#

ConfigurationSection#getBoolean(String)

eternal oxide
#

oh sorry I'm looking at getString

chrome beacon
#

You can use isSet

#

to check if the value has been set or not

#

contains is also an option

astral pilot
#

i see

#

@chrome beacon how do i make it so that the value is actually boolean

#

and not some random stuff

chrome beacon
#

isBoolean

eternal oxide
#

return section.isBoolean(path) ? section.getBoolean(path) : null;

#

that will return a boolean or null

#

so you'd have to use Boolean

astral pilot
#

oh wait so ig isBoolean() simplifies everything

#

ok i see thanks

eternal oxide
#

kinda overkill to wrap

#

why do you want null if its not there?

#

surely false would suffice.

fierce salmon
#

if (clickedItem.getItemMeta().getDisplayName().equalsIgnoreCase("Gray Stained Glass Pane")) {

#

Is this valid to check to see if an item clicked in an inventory is a Gray Stained Glass Pane?

chrome beacon
#

Don't detect items by their name

eternal oxide
#

don;t match names

chrome beacon
#

^^ give it a read

eternal oxide
astral pilot
fierce salmon
#

Is matching by ItemStack okay?

lean arrow
#

😭 why does code have to code

import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket
...
private fun hidePlayer(bukkitPlayer: Player) {
            val profile = (bukkitPlayer as CraftPlayer).profile
            val entry = ClientboundPlayerInfoUpdatePacket.Entry(
                bukkitPlayer.uniqueId, profile, false, -1, GameType.DEFAULT_MODE, null, null
            )

            val packet = ClientboundPlayerInfoUpdatePacket(
                EnumSet.of(ClientboundPlayerInfoUpdatePacket.Action.UPDATE_LISTED),
                Collections.singletonList(bukkitPlayer.handle)
            )
            val field = packet.javaClass.getDeclaredField("c")
            field.isAccessible = true
            field.set(packet, listOf(entry))

            Bukkit.getOnlinePlayers().forEach { (it as CraftPlayer).handle.connection.send(packet) }
}
eternal oxide
#

thats not remapped

#

well it IS remapped, which is the issue

lean arrow
#

it is in my pom.xml

chrome beacon
#

and did you build with maven

lean arrow
#

yup about 17 times because i cannot figure out why its doing this

chrome beacon
#

send your pom

#

?paste

undone axleBOT
lean arrow
eternal oxide
#

no special-source plugin

chrome beacon
#

?nms

chrome beacon
#

^^

#

also update your maven plugins

acoustic pendant
#

Hey, i'm trying to create a npc but when I create it, it doesn't appear

#

I don't recieve any error

#

version 1.20.6

lean arrow
#

this exact same code was working in a diff plugin so its a config error i just dum

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.

acoustic pendant
#
    public ServerPlayer createNPC(Player player, String name) {
        MinecraftServer minecraftServer = ((CraftServer) Bukkit.getServer()).getServer();
        ServerLevel serverLevel = ((CraftWorld) player.getLocation().getWorld()).getHandle();

        String translatedName = hexTranslator(name);

        GameProfile gameProfile = new GameProfile(UUID.randomUUID(), translatedName);

        ServerPlayer npc = new ServerPlayer(minecraftServer, serverLevel, gameProfile, ClientInformation.createDefault());

        npc.setPos(player.getLocation().getX(), player.getLocation().getY(), player.getLocation().getY());

        SynchedEntityData synchedEntityData = npc.getEntityData();
        synchedEntityData.set(new EntityDataAccessor<>(17, EntityDataSerializers.BYTE), (byte) 127);

        setValue(npc, "c", ((CraftPlayer) player).getHandle().connection);

        showAll(npc, synchedEntityData);

        return npc;
    }


    public void showAll(ServerPlayer npc, SynchedEntityData synchedEntityData) {

        for (Player player : Bukkit.getOnlinePlayers()) {
            sendPacket(new ClientboundPlayerInfoUpdatePacket(ClientboundPlayerInfoUpdatePacket.Action.ADD_PLAYER, npc), player);
            sendPacket(new ClientboundAddEntityPacket(npc), player);
            sendPacket(new ClientboundSetEntityDataPacket(npc.getId(), synchedEntityData.getNonDefaultValues()), player);
            Bukkit.getScheduler().runTaskLaterAsynchronously(NPCore.getInstance(), new Runnable() {
                @Override
                public void run() {
                    sendPacket(new ClientboundPlayerInfoRemovePacket(Collections.singletonList(npc.getUUID())), player);
                }
            }, 40);
        }
    }
#

there's the code

undone axleBOT
acoustic pendant
lean arrow
chrome beacon
#

?nms

chrome beacon
#

^ read this one instead

lean arrow
#

i was already using mojang mappings?

chrome beacon
#

no

#

not correctly

#

which is why you're having problems

#

you're using remapped spigot, but not unmapping after compiling

lean arrow
#

is it the stuff in <executions> in the pom

eternal oxide
#

you are missing the special-source plugin

slender elbow
#

me when class Foo extends @NotNull Bar is valid

acoustic pendant
eternal oxide
acoustic pendant
#

oh

lean arrow
#

@chrome beacon @eternal oxide ty both i am a bit dumb when it comes to compilation stuff :greg:

shadow night
blazing ocean
shadow night
#

damn bro, I'm going crazy

#

I swear I just saw that eye move

blazing ocean
#

he's losing it

#

although when has he ever been sane after that yt session

shadow night
#

Bro I was writing a program to add spigot mappings into others until I understood tiny needs a field descriptor, which csrg doesn't have and now I am depressed

slender elbow
#

tiny πŸ™

shadow night
#

I could either not give up and make it take a server jar to find the descriptors itself or I can just say "ah, fuck it" and go relax
I chose the latter

junior geyser
#

Tring to build complie spigot from my IDE, but I keep running into this. Any ideas?

#

I have the bukkit and craftbukkit repos installed already

#

The applyPatches script started a rebase, and I connot abort it

carmine mica
#

I think you have to use buildtools jank to create/setup the source. then you can compile normally via maven

chrome beacon
#

?contribute

junior geyser
#

There is no explination I can find as to how to compile spigot

#

From the idea at least with my changes to Bukkit and Craftbukkit

chrome beacon
junior geyser
#

I have

slender elbow
#

if you are patching bukkit/craftbukkit and spigot fails to patch on top of that, you need to resolve the merge conflicts and then rebuild spigot patches to save that state

junior geyser
#

I just want to get a spigot built to complie from the repos I cloned

#

I can get CraftBukkit easy. But Spigot on the other hand...

#

The scripts just are not working

junior geyser
slender elbow
#

well what's the conflict?

junior geyser
slender elbow
#

the patch failed to apply in Spigot-Server

#

cd there and check

junior geyser
#

My ide thinks there is a rebace in progress, but when I use git commands it apreas as if nothing is currently happing

slender elbow
#

a rebase is in progress in Spigot-Server

junior geyser
#

ah

#

Ok now I got something

#

All of the patches are failing to apply. I wonder if I need to rebuild them

#

Get all this when rebuilding patches

grep: warning: stray \ before -
grep: warning: stray \ before -
grep: warning: stray \ before -
grep: warning: stray \ before -
  Patches saved for Bukkit to Bukkit-Patches/
fatal: ambiguous argument 'origin/patched': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
grep: grep: warning: stray \ before -warning: stray \ before -

worldly ingot
#

If it's any consideration, whatever it is you're wanting to contribute, unless it specifically needs to be in Spigot (e.g. a performance change or adjustment to existing Spigot-exclusive API), you only really need to make your change in and compile Bukkit and CraftBukkit

#

You can test on those server implementations. That's all we ever do

#

Spigot's patch system is a bit convoluted and difficult to follow. I've been contributing for like 8 years and I'm only just now sort of getting familiar with Spigot patches. And I'm still shit at it

remote swallow
#

proof?

worldly ingot
#

The component API that originally targeted Spigot :p

#

Working with the patch system for that was a bitch

remote swallow
#

how do we know you wrote that

worldly ingot
#

My commits are signed

remote swallow
#

what if ur pc got hacked

junior geyser
worldly ingot
#

I mean yeah I just let my Spigot-dependent plugins fail on my test server lol

#

Usually I only ever boot up CB to test the new feature I added which I write a test plugin for

remote swallow
#

ill let you fail all over my test server

worldly ingot
#

Sometimes it's a good idea to not send messages

remote swallow
#

its funny though

junior geyser
#

I think I need to use build tools to setup some sort of workspace to do it properly

#

But I think I will just go your route and just... Not

#

And just make a new plugin that is not spigot reliant to test

#

this is a pain in the ass to setup lol

worldly ingot
#

In fairness, I use the BuildTools directory as a workspace root as well, pretty much. But yeah, all you really need is to depend on the Bukkit artifact instead. It's installed locally when you build Bukkit (assuming you're using mvn install)

worldly ingot
#

Then yep, just depending on that artifact and version should have your changes after you've made them and installed

junior geyser
#

Okay! Thank you

#

Ill give it one last go

worldly ingot
#

My project pom literally just looks like this lol

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>wtf.choco</groupId>
  <artifactId>TestPlugin</artifactId>
  <version>1.0.0</version>

  <properties>
    <maven.compiler.source>17</maven.compiler.source>
    <maven.compiler.target>17</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.bukkit</groupId>
      <artifactId>bukkit</artifactId>
      <!--
      <groupId>org.spigotmc</groupId>
      <artifactId>spigot-api</artifactId>
      -->
      <version>1.20.6-R0.1-SNAPSHOT</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
</project>
#

That source should really be 21 now though

junior geyser
#

wtf.choco

#

nice

worldly ingot
#

I'm proud of that domain lol

tidal kettle
#

I know how to create a customConfig.yml but can i create it inside my plugin and get it in my plugin folder?

worldly ingot
#

Yes. That's what getResource() and saveResource() are for

tidal kettle
#

please

#

πŸ˜…

worldly ingot
#
public final class MyPlugin extends JavaPlugin {

    @Override
    public void onEnable() {
        this.saveResource("customConfig.yml", false /* don't replace the file on disk if it exists */);
    }

}```
remote swallow
worldly ingot
#

Then you can load it with this:

YamlConfiguration customConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "customConfig.yml"));
worldly ingot
remote swallow
#

add it to the verbose flag

#

only send if enabled

worldly ingot
#

Maybe I'll throw a comment on Coll's PR

tidal kettle
#

fr thx you

remote swallow
#

i dont think colls pr covers it

worldly ingot
#

It doesn't, so I'll ask him to cover it :p

remote swallow
#

new pr time

worldly ingot
#

Well, no, because we could just use the --verbose flag that he introduced

#

PR hasn't been merged yet

remote swallow
#

i thought he didnt add --verbose

#

i thought that already existed

worldly ingot
#

Nope

astral pilot
#

is there an event where it fires when a player sends a command?

quiet ice
tidal kettle
#

there will be no bug if i uograde to 1.20.4 to 1.20.6?

worldly ingot
quiet ice
astral pilot
tidal kettle
quiet ice
#

But in general they are safe to ignore

astral pilot
worldly ingot
#

Yes

#

What do you think a command is? :p

quiet ice
#

Just remember that the bukkit API (and thus the documentation) was designed decades ago

astral pilot
worldly ingot
astral pilot
#

even if the message is not yet entered its still triggered?

#

as long as it has slash? or wat

worldly ingot
#

The enter key was pressed

quiet ice
#

Yeah, but in today's language it is a bit odd

astral pilot
worldly ingot
#

Bro what kinda crack is this channel on today? lmao

#

That's valid English

quiet ice
#

Anyways - quick question, does anyone happen to know the command for updating the gradle wrapper

shadow night
worldly ingot
#

./gradlew wrapper --gradle-version=8.x iirc

eternal night
#

might have to run this twice ^

quiet ice
#

Ah, forgot the gradle- part; darn it

remote swallow
#

i manually update mine kek

worldly ingot
#

could also use latest instead of a specific version but I digress

quiet ice
worldly ingot
#

What else would it be prefixed by? :p

#

It's good to be specific

quiet ice
#

sometimes being too specific can cause confusion

worldly ingot
#

I'm confused

quiet ice
#

Well I was like "huh? Aren't commands handled by brig these days?"

dry arch
# worldly ingot That's valid English

the "(by placing a slash at the start of their message)" implies that a command is run just by typing a single '/', and not even pressing enter
but thats not how that works it just reads slightly weird

quiet ice
#

idk - I always took for granted that commands are commands so when someone tries to explain me what commands are I might be a lil confused

#

But it's correct, yes.

worldly ingot
#

idk man. This isn't a hard thing to grasp

dry arch
#

yeah ik

dawn flower
#

i'm gonna try my best to explain this, so basically i have a cannon and i want to make it so the player can rotate it (WITHOUT MOVING IT), it's made out of block displays and the player doesn't ride it, so the position of it and the cannon isn't sync. I've tried changing to yaw and pitch of all the cannon parts based on the player's yaw and pitch and it worked but the position wasn't sync, and the player was basically floating

this is an image to what i want to do, the cannon shouldn't leave the blue circle and the black point is where the player stands

eternal oxide
#

each part has to be relative to the origin you want to rotate around

dawn flower
#

what about the player position

#

it gets mest up

remote swallow
#

where the player is is the origin

dawn flower
#

ic

junior geyser
#

I have added a new method in Bukkit, and implented it in CraftBukkit, but how can I update my local maven repo with the chnges I made in Bukkit, so I can see them in my local CraftBukkit repo?

tardy delta
#

mvn install or smth?

river oracle
#

Just use mvn install

#

And refresh

junior geyser
#

I get this faliue when I do that

#

With or without my changes

#

Oh wait maybe not

#

Ah forgot to add an annotaion

worldly ingot
#

Yeah the tests should tell you exactly why they failed

dawn flower
#

how do i get the location 2 blocks infront of the player depending on the yaw not the pitch

eternal oxide
#

getDirection().multiply(2)

dawn flower
#

that would get 2 blocks below if you look down

#

i dont want it to get below or above

eternal oxide
#

you did say in front

dawn flower
#

and i did say depending on the yaw

eternal oxide
#

if you want flat plane getDirection.setY(0) then .normalize().multiply(2)

dawn flower
#

ok

eternal oxide
#

that was yaw, pitch would be looking up/down

wispy laurel
#

yo guys i have a pvp zone for my server where u can place blocks and stuff, is there a plugin i can use which clears stuff the players place every 30 minutes or so

junior geyser
#

I mean the Bukkit and CraftBukkit prs

eternal oxide
#

Thats likely never getting merged

#

teh int id only use is for packets/nms

#

which is not API

junior geyser
#

Yeah, I realize that. I do use it with NMS. Would be nice to have it as api for what I use it for, but I understand if this does not get merged. More interested to know if the prs are done properly. Cause the guidlines say I need to link them, and I am not sure if the way I did it is correct

eternal oxide
#

I only see teh CB commit

junior geyser
#

So they are not linked correctly hmm

tender shard
#

simply add the craftbukkit PR link to the bukkit PR, and vice versa

junior geyser
#

Okay I can do that

worldly ingot
#

You can also do bukkit#<id> and craftbukkit#<id>

#

But yes, a link to the related PR would suffice

wispy laurel
#

yo guys i have a pvp zone for my server where u can place blocks and stuff, is there a plugin i can use which clears stuff the players place every 30 minutes or so

trim quest
#

can anyone help ? : (spigot 1.16.5)

Enchantment enchantment = Enchantment.getByKey(NamespacedKey.minecraft("mending");

Caused by: java.lang.IllegalArgumentException: Invalid key. Must be [a-z0-9/._-]: mend?ng
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:191) ~[spigot-1.16.5.jar:3096a-Spigot-9fb885e-af1a232]
at org.bukkit.NamespacedKey.<init>(NamespacedKey.java:50) ~[spigot-1.16.5.jar:3096a-Spigot-9fb885e-af1a232]
at org.bukkit.NamespacedKey.minecraft(NamespacedKey.java:141) ~[spigot-1.16.5.jar:3096a-Spigot-9fb885e-af1a232]
at me.erano.com.kit.KitService.parseItemsFromRequestedKit(KitService.java:72) ~[?:?]
at me.erano.com.kit.KitService.getKitListFromConfig(KitService.java:45) ~[?:?]
at me.erano.com.menu.kit.CustomerKitMenu.displayTo(CustomerKitMenu.java:31) ~[?:?]
at me.erano.com.menu.Menu.onOpen(Menu.java:65) ~[?:?]
at me.erano.com.menu.MenuService.handleOpen(MenuService.java:40) ~[?:?]
at me.erano.com.menu.MenuListener.onOpen(MenuListener.java:23) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_202]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_202]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_202]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_202]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.16.5.jar:3096a-Spigot-9fb885e-af1a232]
... 29 more

slender elbow
#

mend?ng
something is wrong with the i you have in your source

eternal oxide
#

it doesn't look like that code caused the error

#

KitService.java:72

#

ah odd i

slender elbow
#

i mean, that's what it's p0inting at

#

i'm gonna guess the infamous turkish i :^)

shadow night
#

Why do letters from other alphabets always get their own char, even when they're identical to the latin letter

eternal oxide
#

because its not about appearance

shadow night
#

What is it

#

Tell me

eternal oxide
#

its about teh alphabet

shadow night
#

and that means

eternal oxide
#

using a specific codepage would be pointless if you had to keep jumping to a different one for certain characters

shadow night
#

ah

trim quest
# slender elbow > `mend?ng` something is wrong with the `i` you have in your source

yeah i guess:

kits:
   dirtman:
      display-name: "wqeqwewq"
      menu-lore: 
         - "asdasdasd"
         - "asdasdasd"
      price: 10
      item-list:
         WOOD_SWORD:
            count: 1
            enchs:
               KNOCKBACK:
                  ench-level: 1
               MENDING:
                  ench-level: 1
      armor-list:
         LEATHER_HELMET:
            count: 1
            enchs:
               MENDING:
                  ench-level: 1
      permission-string: "MileniumCraft.Dirt"
      icons:
         DIRT:
            custom-ench: true
         COARSE_DIRT:
            custom-ench: false
slender elbow
#

use toLowerCase(Locale.ROOT)

#

instead

chrome beacon
#

^^

trim quest
eternal oxide
#

Dead channel. I guess devs are taking friday off

tardy delta
#

enjoying some minecraft

young knoll
#

Does it have mods or plugins at least

blazing ocean
young knoll
#

Real

#

Spigot smp

shadow night
short drift
#

I'm having a lot of trouble adding more textures to the Minecraft clock item than the default 64.

#

I added 144 textures, thinking that it would be a nice number divisible by 12.

#

But now the time is all out of whack. When the MC time is midnight the clock shows 6.

#

12 is at correct position.

blazing ocean
short drift
#

By default there are 64.

blazing ocean
#

then you can't add more?

short drift
#

And why is that?

blazing ocean
#

mojank i'm guessing

short drift
#

I mean there's support for the "time" predicate.

#

It ranges from 0 to 1.

#

However any small adjustments to the values simply won't do anything because it's so much out of sync.

#

All the textures are, eventually, shown correctly on the clock.

#

But it's just not in sync with the actual time of the day.

#

I wonder what would happen if I shortened the values so it ranged from 0 to 0.5 πŸ€”

native nexus
short drift
native nexus
#

You most likely will need todo some kind of conversion or your current conversion is incorrect. I am also assuming you are updating textures via code? I am not home but I will give you an algorithm possible later that will make it in sync

young knoll
#

Nah clocks update automatically

short drift
#

No, I'm not updating them via code.

native nexus
#

Ah ok nvm

short drift
#

It's the vanilla Minecraft clock.

native nexus
#

You probably haven’t offset it correctly :/

short drift
#

With the time predicates ?

young knoll
#

I just realized

native nexus
#

Yeah correct

young knoll
#

Boo fandom wiki

native nexus
#

Ik lol

short drift
#

Well, the formula is supposed to be 2xn-1 / 2xphases.

#

I wrote a program for outputing the values:

using System;
                    
public class Program {
    public static void Main() {
 string timePredicates = "";

  for (int i = 0; i < 145; i++) {
    decimal increment = (decimal)(2 * i - 1) / 288m;
    string theString = $"{{ \"predicate\": {{ \"time\": {increment:F7} }}, \"model\": \"item/clock_{i}\" }},\n";
    timePredicates += theString;
  }

  Console.WriteLine(timePredicates);        
    }
}
#

But it doesn't really matter what the values contain it's so much out of whack.

native nexus
#

Do you feel like the time is offset or are the values and textures showing are all over the place?

short drift
#

Noon is shown correctly. But midnight is shown as 6 pm on the clock.

native nexus
#

Hmm could it possible be that it also goes negative for the time?

#

Like you have to account for -1 to 1

short drift
#

Err. I don't think so ..

#

It's supposed to range from 0 to 1.

native nexus
#

I am not sure like haven’t done time predicates before. Just giving external suggestions from things you could miss 😐

young knoll
#

Make sure you have them in order from lowest to highest

short drift
#

Yes. From 0 to 1.

#

Not sure if adjusting the textures themselves to a different midpoint would help or not.

young knoll
#

Maybe

#

Check the vanilla textures for refrence

short drift
#

That's the first thing I did. clock_00 is showing noon. 32 is is midnight.
And 63 is noon again.

#

Oh...

#

Yeah, so my textures have noon at 00. Noon again at 144.
But at the mid point, sure enough, it has 6 pm.

#

Well that's interesting.

#

I mean, I just started from noon and progressed forward from there until all of the textures were done.

wet breach
#

however I guess it would seem appropriate if midnight and towards noone from there is all even's and then noon to midgnight is all odds

#

if that is the case, makes it easy to know which side of the clock you are on

short drift
#

I'm still trying to wrap my head around what exactly went wrong and why.

#

Maybe I've been going in the wrong direction.

young knoll
#

Now someone make a full analog clock accurate to the minute

#

That’s only 1440 textures

short drift
#

Well, this is accurate to 5 minutes. Anything more than that and you'd have to raise the resolution.

wet breach
young knoll
#

lol

#

How about a digital one

wet breach
#

would still need textures for a digital one no?

young knoll
#

Well yeah but numbers are easy

wet breach
#

now with digital how many variations would there need to be πŸ€”

young knoll
#

1440

#

60 per hour x 24 hours

wet breach
#

well, its half if we use 12 hour clock

short drift
#

Did I just do it wrong and I should have made 288 textures instead of 144 ... ?

#

Is that why it failed?

#

Oh snap.

#

Because even though the clock face only displays 12 hours there's still 24 hours in a day. So with half of them missing that would land me at 6 pm at midnight.

wet breach
#

seems you managed to find your problem

short drift
#

Yes, I think so. Well, it's easy enough to fix.

#

I just copy the existing textures one more time.

#

Thank you for your help.

#

Although that's kind of silly .. maybe I can just define them to reuse the existing textures in clock.json.

wet breach
#

don't see why not

young knoll
#

You can

wet breach
#

hence I said I would only need half the amount of textures for a 12 hour clock lol

#

makes no sense to make 1440 textures if half of them are the exact same XD

young knoll
#

Well yeah but you still need to show am and pm on a digital clock

wet breach
#

1440 is if we had 24 hour clock which is what your math shows

#

hmmm

#

I wonder if two textures can be used

#

I really don't want to make 1440 textures

echo basalt
#

what if you make a script to do it

#

at the end of the day it's just a base image + some image/line distorted / rotated in a way, for each hand

young knoll
#

For a digital one it would be easy

#

For an analog one a bit more effort but probably still easy

echo basalt
#

If you want to make hands by hand you can just make a quarter / eighth and mirror and flip

young knoll
#

You can also just make the 12 hour hand ones and the 12 minute hand ones

#

Then mix them together

#

Not 12, 60

soft hound
#

What is reflections used for in java exactly?

ivory sleet
#

During runtime, scan variables, methods and generic types of classes and do stuff with them

#

Like check if they’re annotated

#

Or maybe invoke them

soft hound
#

Okay so what I need to do if I want to make a custom Subcommand loader is use reflections.

#
public abstract class Subcommand extends WarpConfigHandler {

    public String name;
    public String permission;
    public String noPermissionMessage;

    public Subcommand(String name, String permission, String noPermissionMessage) {
        this.name = name;
        this.permission = permission;
        this.noPermissionMessage = noPermissionMessage;
    }

    public abstract boolean execute(CommandExecutor sender, String[] args);
}```

This is the format I'm going with, what i want to do is loop through a package and have it load all the subcommands with name/perm/nopermmessage
#

So with that being said, reflections would be the right way to do it, right ?

ivory sleet
#

Thats goofy

#

yes well I suppose

#

reflections in that case

#

And not reflection

soft hound
#

sorry, reflections πŸ˜‚

soft hound
ivory sleet
#

because its generally considered a pretty useless automation

soft hound
#

I meaaaaan..

#

I guess you're right, but at the same time I wanna learn how it works and implement it on a custom command handler later down the line

ivory sleet
#

i mean when u learn

#

sometimes doing the wrong thing teaches you the right thing

#

:D

trim quest
#

I cannot get remapped spigot with BuildTools anyone can help ?:

Patching net\minecraft\world\level\WorldAccess.java
Rebuilding Forked projects....
Resetting Spigot-API to Bukkit...
HEAD is now at 7e29f765 SPIGOT-6502: Loading a class from a library of another plugin resulted in a ClassCastException.
Applying patches to Spigot-API...
error: unsupported value for gpg.format: ssh
fatal: bad config variable 'gpg.format' in file 'C:/Users/Erano/.gitconfig' at line 5
Something did not apply cleanly to Spigot-API.
Please review above details and finish the apply then
save the changes with rebuildPatches.sh
Error compiling Spigot. Please check the wiki for FAQs.
If this does not resolve your issue then please pastebin the entire BuildTools.log.txt file when seeking support.
java.lang.RuntimeException: Error running command, return status !=0: [C:\Windows\system32\cmd.exe, /D, /C, sh, applyPatches.sh]
at org.spigotmc.builder.Builder.runProcess0(Builder.java:1042)
at org.spigotmc.builder.Builder.runProcess(Builder.java:967)
at org.spigotmc.builder.Builder.startBuilder(Builder.java:679)
at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:60)

trim bough
#
    public void register(final AbstractCommand command) {
        System.out.println(command.getAliases());
        cmdMap.register(Papyrus.inst.getName(), command);
    }```

I have this right here and command.getAliases() is empty (prints out `[]`) but for some reason now the command `/papyrus:` without anything exists as an alias to the command even though it should be empty
umbral ridge
#

is it ok to use Executors.newSingleThreadScheduledExecutor() for scheduler that checks if config has been modified

ivory sleet
#

why

umbral ridge
#

because its single threaded

#

and is sequentially executed

ivory sleet
#

why do you even need that tho

trim quest
#

it was all about git configuration

#

new error : [WARNING] The requested profile "remapped" could not be activated because it does not exist.

#

Maybe I'm wrong, but have Mojang mappings been released for 1.17 or later?

sullen marlin
trim quest
plucky rock
#

any1 know a good way to take a number and convert it to a number between -1 and 1 (im trying to make a custom speed stat)

sullen marlin
#

1.16.5 is not 1.17

trim quest
sullen marlin
#

I mean probably

eternal oxide
#

1.17.1 yes

sullen marlin
#

But not with spigot

soft hound
sullen marlin
plucky rock
eternal oxide
#

Math.min(Math.max(value, min), max)

umbral ridge
sullen marlin
#

You need to think what your input range is

plucky rock
#

several hundreds

sullen marlin
#

Then you can map it to your output range

#

You need to pick a maximum

umbral ridge
#

my input range is my cat

sullen marlin
#

Then just divide by the maximum

plucky rock
#

ah I see

soft hound
#

Issue with reflections

sullen marlin
#

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

ivory sleet
soft hound
#

reflection

ivory sleet
#

idk I think they have a documentation

#

maybe a good start? :>

soft hound
#

The problem is, that it scans but for some reason, reads nothing.

#
Reflections reflections = new Reflections("com.ancho.commands");

        Set<Class<?>> classes = reflections.get(SubTypes.of(Main.class).asClass());

        for (Class<?> clazz : classes) {
            System.out.println(clazz.getName());
        }```

`2024-06-01 02:29:04 INFO  Reflections:219 - Reflections took 47 ms to scan 1 urls, producing 0 keys and 0 values`
analog mantle
#

what is a HangingEntity

tranquil glen
#

Hey guys, could someone tell me a simple way to add an enchantment effect to an itemstack?
I don't want it to show the enchantment when you hover over it, but I want it to glow

wraith delta
tranquil glen
#

I tried that but it didn't end up adding the effect

wraith delta
tranquil glen
#

cool 1 sec

wraith delta
#

remove the add item flag part, does it add the enchant?

tranquil glen
#

oh yea maybe it wont do that

#

gimme 1 sec lemme see

carmine mica
#

I think you’re overriding the enchantment you are adding with the setItemMeta call

#

Don’t add the enchant to the ItemStack directly

wraith delta
#

instead of is. use im.

carmine mica
#

Or do it before the getItemMeta call

tranquil glen
#

ItemMeta doesn't have an unsafe enchantment method

#

just normal enchantment

wraith delta
#

whats wrong with normal enchant LURE?

slender elbow
tranquil glen
#

so does true mean safe or unsafe?

wraith delta
#

im.addEnchant(Enchantment.LURE, 1, false); prob something like this

tranquil glen
#

okay cool i got the enchant to get on it

wraith delta
#

just try it

tranquil glen
#

lemme see if the hide flag works

wraith delta
#

you might need HIDE_POTION_EFFECTS in addition

tranquil glen
#

okay ill give it a shot

#

nicceeee

#

it works

#

thanks guys

restive mango
#

anyone know if there is a guide out there for custom enchantment tooltip creation? specifically, i want a generalizable way to appropriately add the text for a custom enchantment to an item's description

#

rn i find it just creates blank space

#

like dat

sullen marlin
#

I don't understand

trim bough
#
    public String translateColorCodes(final String string) {
        return string.replace('&', 'Β§');
    }

    public Component colorText(final String string) {
        return Component.text(translateColorCodes(string));
    }```
I have something like this but it gets a warning in console. I want to do this instead of like Component.text().red() or whatever because im making a language like Skript where i can just do "&c[Something] &7Something" instead of the weird component builder syntax
sullen marlin
#

?whereami

trim bough
wise mesa
#

nope

trim bough
#

my bad

wise mesa
#

there are adventure bindings for spigot

#

but its built in to paper

#

which is likely what you're using

trim bough
#

ye i am

#

i didnt know that my bbadd

wise mesa
#

no worries

spare tangle
#

?whereami

spare tangle
#

Can someone help me, I want to change the default essentials text like when u do /warp something it says teleporting

#

I wanna change that

lost matrix
spare tangle
#

Okay

spare tangle
#

like I want vip to have 3 homes

#

but member to have 2

upper hazel
#

There are ideas on how to make the blocks move smoothly and so that they are solid. 1.16.5 (not display entities)

chrome beacon
#

Falling block + Shulker

short drift
chrome beacon
#

They don't move

short drift
#

So, next I set it to 288 iterations.
But the clock does not show the correct time.
It's off from 5 minutes up to almost 1 hour.

chrome beacon
#

?paste

undone axleBOT
upper hazel
#

And solid?

chrome beacon
#

There is nothing better

#

Shulker is solid

upper hazel
#

Hmm I guess this true

#

He is mob

short drift
chrome beacon
#

No

short drift
#

No?

#

Really?

chrome beacon
#

You need the mob

short drift
#

I don't understand πŸ€”

chrome beacon
#

Box is a block and can't move

short drift
#

I've never had any problems with falling block entities, though.

chrome beacon
#

?

#

They aren't solid

#

You can walk right through them

short drift
#

They can still damage players .. oh, like as building blocks?

#

Right.

upper hazel
short drift
#

It's showing the wrong time 😒

#

Even though I'm using the same algorithm as Mojang.

upper hazel
#

Wait entity can have animation in frame?

#

Or

short drift
#

It's a minecraft:clock.

upper hazel
#

Real? In Minecraft?

#

What the version

short drift
#

It's been in Minecraft forever.

#

It's this item.

upper hazel
#

No lol

#

Not forever

#

I not see it in 1.16

short drift
#

It was added in 1.2.0.

#

In Minecraft alpha.

upper hazel
#

Oh

#

What better use for block move? Shullker mob or armorstand for not solid block

#

in terms of resource consumption

remote swallow
short drift
#

I've been trying to get this working for several days.

#

I'm not sure why the time is off.

#

It produces correct time predicates for 64 clock models, so I don't see why it would fail when changing the iterations to 288.

charred blaze
#

can i set display entity as a passanger?

pseudo hazel
#

yes

mellow snow
#

Hello, I'm making a taser plugin. It all works but It doesn't play the custom sound. I have no error in the console and with the command /playsound the sound work.

Here's my code: https://paste.md-5.net/wuzugogoku.java

buoyant viper
#

does the player have the resource pack installed?

mellow snow
#

wait me or the target?

#

cause my test target it's actually an npc

blazing ocean
#

are you playing the sound to the npc

#

then you're not gonna hear jt

mellow snow
#

not only to the npc

#

the sound have to play in a five block range

blazing ocean
mellow snow
#

how can I play it in a 5 block range?

blazing ocean
#

use World#playSound

mellow snow
#

an example?

pseudo hazel
#

entity.getWorld().playsound

blazing ocean
#

just change it to entity.location.world.playSound

mellow snow
#

ok thanks I'll try

blazing ocean
mellow snow
#

ok it works, thanks

pseudo hazel
#

also work on reducing that hadouken

swift sable
#

anyone know why glass is showing through text displays?

#

o it wont let me add a photo

pseudo hazel
#

?verify

#

nvm thats not the command

#

anyways to post images you need to verify

swift sable
#

like this ^^ it shows through all, even when transparent or with a background colour

#

makes text very hard to read

sullen marlin
#

I don't understand

eternal oxide
#

shader issues

swift sable
#

this is default minecraft tho, no mods; is this just how glass interacts with text displays in default?

eternal oxide
#

a better picture might help

#

are you finding the glass rendering in front of transparent Displays?

upper hazel
#

if class create classes in constructor and has only getting methods this manager class or factory class

pseudo hazel
#

what are you saying

eternal oxide
#

sounds like factory

#

it its not tracking them

pseudo hazel
#

or a builder

upper hazel
pseudo hazel
#

right, but a factory doesnt need to only create objects in its constructor

#

it also just have a create method that does everything

eternal oxide
#

however, you shoudl not really be creating objects in your constructor

upper hazel
#

why

eternal oxide
#

a construtor has the responsibility of creating the class instance, not the objects it can give out

#

in your getThsiItem() you would `if (this.item == null) {build and set item instance, then return}

#

else just return this.item

upper hazel
#

where then are objects created that need to be obtained in getting?

ivory sleet
#

The way I see it is
factory - isolates the creation of an object from its instantiation
builder - mainly just helps with long arg constructors

eternal oxide
#

yeps

eternal oxide
upper hazel
pseudo hazel
#

if you have a method like createThing(), then inside of that method ideally you create a new Thing and return it

eternal oxide
#

if you have a class which returns the same item over and over you can simply create it once, then return clones

#

if you want seperate instances

upper hazel
#

like Singleton ?

#

with null check

#

hm

#

it's cool to check for null but I'll ignore it in bukkit ahahaa

pseudo hazel
#

wdym

#

a singleton is different

#

elgarl is talking more about a template kind of thing

#

also its pretty impressive if you can avoid null checks for your entire plugin

upper hazel
#

it's probably best to describe my class as a "Singleton" factory

#

I don’t know what to replace so that it would be easy to transfer objects as parameters

ivory sleet
#

singleton factory doesnt make a lot of sense

hollow vessel
#

hi! Why when player is in spectator mode, the action in PlayerActionEvent is only left click air and right click block why there is not right click air and left click block?

ivory sleet
#

but elgar is maybe talking about the prototype pattern?

young knoll
#

I’m surprised left click air even fires

#

Spector mode players can’t really left click

hollow vessel
#

ohh, so there is no possibility to check that?

young knoll
#

Right click air requires an item in hand, and players in spectator mode aren’t holding items

#

You can raytrace to see if they are looking at a block or not

upper hazel
hollow vessel
#

is it possible?

young knoll
#

Well right click air isn’t going to happen

#

Unless you can somehow get them to hold an item

hollow vessel
#

okay thanks

ivory sleet
ivory sleet
#

That doesnt need to be a singleton

upper hazel
#

at the moment there are no problems, I don’t know what will happen in the future

ivory sleet
#

its also somewhat of an antipattern to pass ur Plugin instance everywhere

pseudo hazel
#

do you change anything about these configs? else its just a container for a bunch of configs

pseudo hazel
#

right

#

its not really a factory then

#

you arent really creating anything that this class doesnt need I guess

ivory sleet
#

Its not a factory, nor a singleton

upper hazel
#

I originally created wrappers to pass them as a parameter to other manager classes.

#

bc there are a lot of them

upper hazel
pseudo hazel
#

since its supposed to be managing these configs

upper hazel
pseudo hazel
#

or does it just holds them as like a wrapper

upper hazel
#

yes

timber hazel
#

sorry if im disturbing the on going conversation, but does someone have a clue why i cant import the spigot / bukkit api
This is my pom

<repositories>
    <repository>
        <id>spigotmc-repo</id>
        <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
    </repository>
    <repository>
        <id>codemc-releases</id>
        <url>https://repo.codemc.io/repository/maven-releases/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>org.spigotmc</groupId>
        <artifactId>spigot-api</artifactId>
        <version>1.20.6-R0.1-SNAPSHOT</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.github.retrooper.packetevents</groupId>
        <artifactId>spigot</artifactId>
        <version>2.3.0</version>
        <scope>provided</scope>
    </dependency>
</dependencies>

but i get this error

Dependency "org.spigot....snapshotstuff" not found 

this error is in the version line of the spigot dependency

#

its from the spigot api maven wiki

#

so the shapshot should work

#

this is where i got the dependency

eternal night
#

Make sure you are defining and using java 21

timber hazel
#

is it enough to replace that with 21

eternal night
#

Hopefully

timber hazel
#

aye thanks mate

#

how long is a maven build for a small project supposed to take?

pseudo hazel
#

5 seconds on my pc xD

timber hazel
#

shit

pseudo hazel
#

well if you mean just building the plugin

timber hazel
#

1:40 mins rn

pseudo hazel
#

like the package lifecycle action

#

I mean it depends on how many changes I have made in between building it

#

but usually no longer than 20 -30 seconds

quiet ice
#

what on earth is your definition of "small"?

timber hazel
#

hmm any idea why its taking more than 2 mins rn? btw last time it wasnt even successful aka i stopped after 20 mins

quiet ice
#

I suppose you are using some random maven plugin

timber hazel
#

nah i aint

quiet ice
#

What is it stuck at?

timber hazel
#

i mean when i started building, it said that it has no output location, then when i click on where it pointed, im just seeing how long it has been taking to build but idk where to define the output path

quiet ice
#

Could you just paste the logs then?

timber hazel
#

sure, can you tell me how to get those?

quiet ice
#

Uh idk, your IDE?

timber hazel
#

im on intelJ

quiet ice
#

Or just run it in the command line - in which case it should be trivial

timber hazel
#

do i just need to run mvn clean install?

quiet ice
#

well you rarely can go wrong iwth doing that

#

Though you need to have maven installed previously

#

Not too difficult to install on linux systems since it's usually in your package manager of choice; on windows you'd probably be best off getting it from apache directly and adding it to your PATH

timber hazel
#

hmm so i just chose maven instead of gradle in the options of the build stuff, i have the pom.xml and i can reload using maven, but if i even type "mvn" in the terminal it doesnt find anything

#

is there a way to check if i have it running correctly?

eternal oxide
#

what terminal?

timber hazel
#

in my project the local one

#

i get this error in german

mvn : Die Benennung "mvn" wurde nicht als Name eines Cmdlet, einer Funktion, einer Skriptdatei oder eines ausführbaren Programms erkannt. Überprüfen Sie die Schreibweise des Namens, oder ob der Pfad korrekt ist (sofern 
enthalten), und wiederholen Sie den Vorgang. 

which means

mvn : The naming "mvn" was not recognized as the name of a cmdlet, function, script file, or executable program. Check the spelling of the name or whether the path is correct (if 
included) and repeat the process.
#

btw i cant send pictures

civic sluice
#

Sounds like maven isn't installed.

timber hazel
#

tho if i right click on the pom i have the option to reload using maven

quiet ice
#

yeah that error means you don't have maven installed

timber hazel
#

hmm weird

quiet ice
#

That being you should still be able to make use of maven through your IDE

civic sluice
tidal kettle
#

can i reload a YamlConfiguration like the config.yml with reloadconfig()?

eternal oxide
#

Maven window top right of yoru IDE

timber hazel
civic sluice
eternal oxide
#

I don't use IJ but there is a button there to open a terminal window

#

mvn clean package

timber hazel
#

running it rn

#

any tip on where the .jar is now?

eternal oxide
#

target folder

#

or jars. depends on yoru build

#

no target, its maven

#

folder called target

timber hazel
eternal oxide
#

package, unless you are building to use as a dependency

timber hazel
#

nah

#

imma run package rq

quiet ice
#

in the end both are usually identical as install also runs package

eternal oxide
#

package and install do very similar things. just install adds the built jars to yoru local maven repo.

#

so unless you need it as a dependency you use package to save cluttering your .m2 with junk

timber hazel
#

in the target folder of my plugin now is a .pom but nothing more

#

no jar

eternal oxide
#

there will not be a pom in yoru target folder

timber hazel
#
[INFO] --------------------< Recoil:packetevents-example >---------------------
[INFO] Building Recoil 1.0-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- clean:3.2.0:clean (default-clean) @ packetevents-example ---
[INFO] Deleting C:\Users\carlo\IdeaProjects\Recoil\target
[INFO] 
[INFO] --- shade:3.2.4:shade (default) @ packetevents-example ---
[INFO] Replacing original artifact with shaded artifact.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.807 s
[INFO] Finished at: 2024-06-01T14:44:03+02:00
[INFO] ------------------------------------------------------------------------
#

btw my plugin is called recoil

#

this is after i ran mvn clean package

eternal oxide
#

go look in C:\Users\carlo\IdeaProjects\Recoil\target

quiet ice
#

why does it not execute the compiler and jar MOJOs?

timber hazel
#

theres only a pom called "packetevents-example-1.0-SNAPSHOT-shaded.pom"

eternal oxide
#

you did not build the project yoru thought you were

#

yeah it never ran compile

#

?paste your project pom

undone axleBOT
timber hazel
quiet ice
#

Your packaging is the issue

eternal oxide
#

you don;t have a compile pluign

#

oh you do, I missed it

quiet ice
#

You want to remove the <packaging>pom</packaging> part or use <packaging>jar</packaging>

eternal oxide
#

yeah, line 10

timber hazel
#

now we talking

#

yep it compiled something in the terminal

quiet ice
#

Also, that is not how you define a proper group and artifactid, but alas - I digress

timber hazel
#

aye .jar

#

is there a reason i have the .jar and also another one with the same name but with original- before the name

#

brb

eternal oxide
#

because you shade

quiet ice
#

the original jar can usually be ignored

eternal oxide
#
<groupId>me.carlo</groupId>
<artifactId>recoil</artifactId>
<name>packetevents-example</name>```
quiet ice
#

although, in your case you don't shade anything into the jar so I'd just get rid of the maven-shade-plugin

timber hazel
eternal oxide
#

thats an example of a correct setup

timber hazel
#

alr

#

thank yall for the help, appreciate it

#

do libraries require a depend in the plugin.yml?

depend:
  - packetevents

cus i cant load the plugin because it tells me to download the packetevents plugin, tho the packetevents is a library not a plugin

#

brb

eternal oxide
#

then don't depend, shade it

#

you add it as a depedency in your pom

timber hazel
#

now it has a problem with the main declared in the plugin.yml, it generated net.recoil.recoil.Recoil which obviously sounds wrong, do i just input the C:/Carlo thingy or src/main

#
name: Recoil
version: 1.0
main: net.recoil.recoil.Recoil
api-version: '1.19'

current status

eternal oxide
#

that does not match your pom

timber hazel
#

where in the pom should it match the main

eternal oxide
#

in my pom example yoru main would be me.carlo.recoil.Recoil

timber hazel
#

which is the group id of the pom?

eternal oxide
#

your package is your groupId + artifactId + whatever path to your source

#

so if that is the path to your Recoil main in your jar your GroupId would be net.recoil Your ArtifactId would be recoil

timber hazel
#

im not sure what to do rn, ill provide more info

server error

[15:25:37 ERROR] Could not load plugin 'recoil-1.0-SNAPSHOT.jar' in folder 'plugins'

[15:25:37 ERROR] org.bukkit.plugin.InvalidPluginException: Cannot find main class `me.carlo.recoil.Recoil'

pom before <properties>

  <groupId>me.carlo</groupId>
  <artifactId>recoil</artifactId>
  <version>1.0-SNAPSHOT</version>
  <packaging>jar</packaging>
  <name>Recoil</name>

file structure for the starting stuff

src/main/java.net.frontlinemc.common      #in there are all the packages

besides that the resource is in the same place like this

src/main/resources
eternal oxide
#

fix teh package in your source

#

very top of your Recoil.java class

#

what teh hell is frontlinemc?

timber hazel
#

its a server a friend made, im trying to integrate his recoil stuff into a single plugin

eternal oxide
#

it doesn;t seem like you have anything correct

timber hazel
eternal oxide
#

your package, main: GroupId and ArtifactId are ALL incorrect

timber hazel
#

is the group id of the main declared in the pom groupId at the top where its currently me.carlo?

eternal oxide
#

GroupId and ArtifactId are sections of yoru codes package definition

timber hazel
#

so <groupid> in pom means where to start?

#

im confused rn

#

i hate spoonfeeding but could you tell me what to change to what, im confused rn

eternal oxide
#

It seems like you need to change everything. Nothign matches

timber hazel
#

i dont understand what should match

eternal oxide
#

first thing to do, look at teh top of your Recoil.class

#

where it defines teh package

#

what does it say

timber hazel
#

at the Recoil.java it says this
package main.java.net.frontlinemc.common.item.weapon.ranged;

eternal oxide
#

ok thats terrible to start with

timber hazel
#

shit

#

i mean this is only a quick project, wont be continuing stuff in it afterwards

#

it can be shitty but that its working is the big thing

eternal oxide
#

so long as nothing else is ever going to see or use this you can do it

#

in your plugin.yml use main: main.java.net.frontlinemc.common.item.weapon.ranged.Recoil