#help-development

1 messages · Page 1891 of 1

buoyant viper
#

jeez

#

i can excuse nano but notepad is just a sin

lavish hemlock
#

I don't like how bloated Notepad++'s UI is :p

#

And Notepad has actually gotten better in recent years

#

Like it works with Unix newlines now

#

Also for Nano

#

I literally don't know how to use Vim

#

So I prefer Nano since it's easier

buoyant viper
#

oh its actually pretty simple

lavish hemlock
#

People make all these arguments about like

#

"well aliases and shit make my workflow faster"

#

but it takes longer to set all that stuff up than it takes to do stuff manually anyways

#

only time I edit options is when IDEA's defaults are shit or I need to install plugins

#

(also tabbed editors should auto-save by default, d@m)

buoyant viper
#

vim <filename>

press I to enter insert mode (this lets u type normally to add/remove text)

press Esc to exit insert mode and enter visual? mode iirc, at this point ur done doing what u needed to do to the file

and then type either :w to write/save, :wq to write/save & quit, or :q/:q! to quit (q! ignores changes, typing just :q after modifying yells at u)

lavish hemlock
#

okay but

#

why would I bother with this when I can just

#

nano <filename>
type some shit
CTRL + S

buoyant viper
#

i thought its ctrl+x ctrl+o when ur done

lavish hemlock
#

you can CTRL + S

buoyant viper
#

o

lavish hemlock
#

I just close the terminal window after

#

lol

buoyant viper
#

idk i use vim

tender shard
#

vim is awesome

woeful crescent
#

anyone know how i can set up mvn -b for an already existing project with intellij dependencies and stuff

lavish hemlock
#

you know the one good feature of Maven is archetypes

buoyant viper
#

yeah

lavish hemlock
#

I wish Gradle had those

woeful crescent
#

i want to use github actions

#

with nightly.link

lavish hemlock
#

although Maven always uses the shittiest terms like

buoyant viper
#

intellij dependencies, is the project not already a maven one?

woeful crescent
#

i mean yeaaah

lavish hemlock
#

"archetype"? what the fuck is this? a D&D character?!

#

just say "default project"

woeful crescent
#

but it has dependencies in iml

tender shard
buoyant viper
#

then make them maven

tender shard
#

you MUST use maven to handle ALL your dependencies

woeful crescent
#

:(

buoyant viper
lavish hemlock
woeful crescent
#

ok

tender shard
lavish hemlock
tender shard
#

I translated archetype to german and it means something like "origin"

woeful crescent
#

AUGH

#

I just need help guys please

buoyant viper
#

convert ur intellij dependencies to maven ones

#

very simple

tender shard
woeful crescent
#

i cant tho

buoyant viper
#

why not

lavish hemlock
#

and also yeah archetype makes sense but

tender shard
woeful crescent
#

they're not on maven

#

and they're private

lavish hemlock
#

I only know the definition because D&D also uses it for their fucking character classes

tender shard
woeful crescent
#

???????

lavish hemlock
#

Classes have different archetypes

tender shard
#

allows you to use a file path for the dependencies

lavish hemlock
#

Like Rogue has stuff like Thief

woeful crescent
#

Can you like explain it

buoyant viper
#

haha systemPath go brrrrrrrrrr

woeful crescent
#

canonically

#

instead of just giving random snippets of stuff assuming i know the rest?

#

sorry im just a little frustrated

buoyant viper
#

@lavish hemlock yknow whats really shit though

#

VS projects

lavish hemlock
#

yes

tender shard
lavish hemlock
#

but y'know what's worse?

buoyant viper
#

maven projects but fucking worse

woeful crescent
#

;-;

lavish hemlock
#

good question

#

let's move out boiiis

tender shard
#

check my pom for InvUnload - you can just use scope system and then give the file path to your dependency

lavish hemlock
#

#general

tender shard
#

if you tell how your .jars are called that are NOT in any repo, and I'll explain to you how you can use them with maven easily

woeful crescent
#

ok so

#

one sec

tender shard
#

ping me when you reply, otherwise I won't see it

woeful crescent
#

alright

#

waiiiit

#

noooooo

woeful crescent
#

i think

#

idk

tender shard
woeful crescent
#

any way to fix that?

tender shard
#

what dependencies do you use?

#

are those your own libraries?

woeful crescent
#

wait a minute

#

is there any way to juuust

#

like

tender shard
#

if your dependencies are on github, you can use jitpack

woeful crescent
#

upload the local artifact with the commit

#

lemme explain one sec

#

so whenever someone commits or pushes it makes sure an artifact is in a specific folder (person builds it on their own)

#

can i do that

#

and if not the push fails

#

possible or no

#

bc im lazy

quaint bough
#

Is it possible to just cast an itemstack back to your custom item ?

woeful crescent
#

i dont think so

#

i think it might be converted to like an nms item and back or something

#

but ask someone else

vocal cloud
#

Try it and see lol

woeful crescent
#

not unless your custom item extends itemstack, but even then itd be precarious

#

because like

#

how would it even work if you like

#

have an item and then the plugin is removed

#

and then .getClass() is called on the item

quaint bough
woeful crescent
#

itll return a class that isnt there????

quaint bough
#

danke

halcyon mica
#

So this is a interesting conundrum

#

The current build of fawe is supposed to support 1.16.5

#

But also forces Java 17

#

But spigot 1.16.5 does not support java versions above 15

#

Does anyone happen to know what the last properly compatible version of fawe is?

woeful crescent
#

is == possible with itemstacks?

tender shard
tender shard
woeful crescent
#

unreliable?

tender shard
#

well

#

it depends

woeful crescent
#

i mean obv if the server restarts

#

lol

tender shard
#

you should just use equals()

woeful crescent
#

but i was thinkin more for a gui thing

tender shard
#

I will give an example:

woeful crescent
#

it's fine tho

#

like i just use slots rn (for GUIs please dont kill me)

vocal cloud
#

If you only care of the material use material. If it's a custom item use PDC

woeful crescent
#

is it possible to run code on push to github?

#

like

#

when someone pushes it does a maven target on their machine first

tender shard
woeful crescent
#

ahhhh yes

#

so when someone pushes

tender shard
#

we have an ?xy problem here

#

what do you need those actions for anyway?

woeful crescent
#

it will build the artifact

#

?xy

undone axleBOT
tender shard
#

I am sure there is an easier way than gh actions

proud forum
#

hello, i asked for help a couple days ago and was told to read on the java docs for assistance, and i found something. i have two classes, one is the Over powered mobs class, and the other is the command class to toggle it. My main question is, to get two classes to be able to call for each other, would i have to use the implements (classname) in it?

woeful crescent
#

no

tender shard
#

?learnjava

undone axleBOT
woeful crescent
#

oh no

#

i knew it was coming

proud forum
#

LOL back to learning java

woeful crescent
#

i feel like this is how u learn tho mfna

proud forum
#

i am currently reading the docs rn

tender shard
#

yes sure, I'll explain

#

@proud forum

woeful crescent
#

like asking stupid questions is a part of the process

proud forum
#

yes i know

tender shard
#

If you have stuff that you need to access from another class...

#

you need a reference to the instance of that class

#

so, for example

#

imagine you have one listener, and one commandexecutor

woeful crescent
#

first explain it in animals

tender shard
#

you could store the reference to both of that instances in your main class

woeful crescent
tender shard
#

for example, using animals:

#
public class Main extends JavaPlugin {
  private Dog dog;
  private Cat cat;
  private static Main instance;

  {
    instance = this;
  }

  public static Main getInstance() {
    return instance;
  }

  public getDog() {
    return dog;
  }
#

Now, in your Cat class, you can do:

#
Dog dog = Main.getInstance().getDog();
#

the other alternative would be dependency injection

#

dependency injection is actually better in terms of structure, buuuuuuuut

#

it's harder and more annoying to setup and there's no real advantage over the static getInstance() method in your main class unless you actually know why there would be any advantage

#

so just read the blog post, and add a getter method for the object you need in your other class, then you're done

quaint bough
#

If only minecraft used c#

tender shard
woeful crescent
#

except you could only run on windows ¯_(ツ)_/¯

lavish hemlock
#

Minecraft would actually be worse on C# lmao

lavish hemlock
woeful crescent
#

c# is native to windows

tender shard
lavish hemlock
#

around the time Minecraft was released, pretty much only .NET existed for C#

#

and that was .NET Framework

#

not .NET Core

#

.NET Framework only supported Windows

quaint bough
#

Yeah but are they ever gonna get performance up with java?

proud forum
#

here is why i am trying to do this, i am trying to make a command (the one class i talked about before) that enables and disables the spawning of all over powered mobs, and someone said insert a boolean somewhere, and that is why i am reading the java docs, to know when and where to insert true or false statements and you are right, what you just told me solved half my problem!

lavish hemlock
#

Java is not their performance problem

#

It's the fact that Mojang developers don't know how to fix the performance of an old fucking codebase

#

And Notch was not very good at optimizing certain parts of the game

halcyon mica
#

Neither is current mojang

quaint bough
#

Yeah but I thought when they made bedrock they could fix the old shit

#

Instead in turned into a microtransations bs

lavish hemlock
#

Bedrock is also C++ iirc.

halcyon mica
#

Which is shown pretty clearly by java mods making the game run so much better with comperatively little work

lavish hemlock
#

but basically

halcyon mica
#

Only by cleaning up the rendering

lavish hemlock
#

Java is not slow at all

halcyon mica
#

it is a disaster for performance

lavish hemlock
#

It's not as fast as C# or other langs

halcyon mica
#

Ok, first off

lavish hemlock
#

But it is at least manageable

woeful crescent
#

guys please not in here

halcyon mica
#

A language is not fast or slow by default

#

It depends on the usecase

woeful crescent
#

i actually need to get help with smtn lol

lavish hemlock
#

Yes it is

quaint bough
lavish hemlock
#

There's a reason why Python is slower than other languages almost all of the time.

young knoll
#

Interpreted moment

quaint bough
#

But anyway is using nbt tags reliable for custom item checking? (1.12.2)

woeful crescent
#

@tender shard so basically i am trying to set up nightly.link so my server pulls the latest version of all our plugins automatically

lavish hemlock
#

Interpreter vs compiler.
JIT vs AOT.
Bytecode only? (Lua runs pretty well because of bytecode)
How well implemented is the language?

ivory sleet
#

From api pov

lavish hemlock
#

Interpreted is slower than compiled most of the time because of additional performance costs.

quaint bough
woeful crescent
#

GUYS NOT HERE pls im trying to get help

#

#general

ivory sleet
#

Yeah or just create a thread

lavish hemlock
#

Sometimes programs are just more complicated to parse, and compilers clear that up because they turn large trees of statements into sets of instructions.

ivory sleet
lavish hemlock
#

but yeah, #general

woeful crescent
#

conclure how would i set up nightly.link with my project. i will convert all my dependencies to local maven dependencies but the jar still needs to be built on the pusher's machine

ivory sleet
#

Java is mye, not a disaster for performance :3

tender shard
woeful crescent
tender shard
quaint bough
#

Probably his machine place or something

woeful crescent
#

nah

#

but anyways

#

i just need upload-artifact

#

but

#

it needs to be automatic with the build artifact

#

so like

#

depended jars are local, right? so the user needs to build the target artifact to the project on their machine and then push

#

but i want to automate that

#

i use maven

#

any ideas?

#

@tender shard @ivory sleet

proud forum
woeful crescent
#

how to install a local repository in maven

#

like

#

i want to put a jar as a maven repo on my computer

#

how

#

@tender shard you told me to use install:install-file, what do i put as -Dpackaging?

woeful crescent
#

yea thanks

halcyon mica
#

Where does fawe actually anchor a schematic when importing it via the api?

#

The to anchor that is supposed to define where the schematic is pasted into is set to the bottom left corner of the frame, but as you can tell that is not what is happening:

quaint bough
#

How would I set nbt tag like this?

#

you cant do it like that can you

tender shard
#

@tender shard

brave sparrow
#

What is item supposed to be? @quaint bough

brave sparrow
#

They’re setting item = a craft item stack

#

What do they think they’re doing

quaint bough
#

No I'm just wondering how I would set the nbt data to the super class

#

I dont think it's possible

golden turret
#

hello

#

i want to convert the minecraft yaw to angle degrees

#

my goal is to invert the angle

#

making something like

#

in degrees it would be just add 180° and it is done

#

but minecraft yaw is -180 -> 180

worldly ingot
#

Extending ItemStack isn't going to work at all btw. CraftBukkit's implementation will be returning copies and clones of items, but it won't ever be your item

quaint bough
worldly ingot
#

Should really just make a util class or an item builder then

#

Extending most aspects of Bukkit is frowned upon

golden turret
#

event.getClickedInventory?

#

which game then

vocal cloud
#

Forge?

#

Lul

golden turret
#

if you are talking about the javafx

#

you could add an action listener i guess

#

elaborate

golden turret
kind hatch
#

Complex Data Storage Solution

buoyant viper
#

?learnjava

undone axleBOT
buoyant viper
#

humbling myself tonight

quaint mantle
#

ight i have a question that is more just java but ima ask here anyways

so i have this code

coordinates = new double[11 + 20 * 2][];
        int arrayLocation = 0;
        for (double i = 0; i <= Math.PI; i += Math.PI / 20) {
            double radius = Math.sin(i);
            double y = Math.cos(i);
            for (double a = 0; a < Math.PI * 2; a+= Math.PI / 20) {
                double x = Math.cos(a) * radius;
                double z = Math.sin(a) * radius;
                coordinates[arrayLocation++] = new double[] { x, y, z };
            }
        }

but what ever i set new double[x][] to it throws an error
index x out of bounds of length x for the line with coordinates[arraylocation++]

i dont see what the issue is as it looks like it should work and it should add 1 less then the length to coordinates but dunno

worldly quest
#

if i wanted all hostile mobs to spawn with like 3x hp how would i get all the hostile mobs from the creature spawn event

jagged monolith
#

I am currently getting an error for UnknownFormatConversionException when trying to use the setFormat method within the AsyncPlayerChatEvent. I've used a debug logger message and nothing looks out of the ordinary so I am not exactly sure why I would be receiving the error. I know about String.Format being needed, and it's what I have been following, but for some reason it is still not working.

The Error: https://paste.md-5.net/aropimaxoj.bash
The Code: https://paste.md-5.net/icokofivak.js
Debug Message: [14:59:36] [Async Chat Thread - #0/INFO]: [Stylizer] %s >> %s
Chat Format From Config: "%displayname% #14abc9>> #6b6b6b%message%"

I have tried using %1$s and %2$s as well as the generic %s but can't seem to find what is actually using the error. Any help would be appreciated as this error is annoying me

waxen plinth
nova grove
#

I'm making a plugin that tracks how many deaths the player has. Can I reset my deaths so that I can test more easily?

worldly quest
waxen plinth
#

It should

worldly quest
#

ok thanks

waxen plinth
#

I would double check on the gray-area mobs like zombie piglins

worldly quest
#

that sounds like itd be under monster

#

event.getEntity() instanceof Monster <-- that should work right

#

inside of my if statement

bold vessel
#

Hi ! I need the 1.6.4 spigot documentation som1 have a link pls ?

#

ping me if u respond

quaint mantle
#

wtf...

#

1.6.4?

#

md_5 come here and help him

#

you probably still remember that version right

#

you the one who maintained the backward compat, you should remember it lol

bold vessel
#

(sorry ghost ping only want to dm u)

#

(la vérité jesquive le ban)

buoyant viper
#

in applyFormat

jagged monolith
buoyant viper
#

which setFormat is failing btw

#

first or second one

jagged monolith
#

second

#

Well. They both do, same error

buoyant viper
#

which one is at line 105

brave sparrow
bold vessel
# quaint mantle wtf...

basically we make a practice server for the players of a modded server but the founders of the modded server are big sons of bitch who bypass the eula with the 1.6.4 so we are obliged to make with this version to access our server with their launcher

jagged monolith
quaint mantle
buoyant viper
#

oh

#

which ones at 61

jagged monolith
#

The second one

buoyant viper
#

what does defaultChatFormat equal

jagged monolith
buoyant viper
#

hm

#

and ur completely sure making it %%displayname%% and %%message%% didnt fix it?

jagged monolith
#

Correct

buoyant viper
#

wat da fuk

#

does prefix or suffix have a % in it?

#

like its actual value

worldly quest
#

if i wanted to increase the ender dragon health would i do that in the creaturespawn event or does the first ender dragon not count as being spawned

quaint mantle
#
@EventHandler
    public void onInvClick(InventoryCreativeEvent e) {
        ItemStack item = e.getCurrentItem();
        if (item != null && item.getItemMeta() != null && item.getItemMeta().getPersistentDataContainer().has(DistinguishableArmor.KEY, PersistentDataType.STRING)) {
            e.setCancelled(true);
            ((Player) e.getWhoClicked()).updateInventory();

        }
    }

why the item duplicates

lost matrix
quaint mantle
#

its notnull

quaint mantle
#

1.17

worldly quest
#

how would i drop an item when an entity dies

muted sand
#

i am getting yelled at for This plugin is not properly shutting down its async tasks when it is being shut down. This task may throw errors during the final shutdown logs and might not complete before process dies.
do I just add something like

    @Override
    public void onDisable() {
        this.getServer().getScheduler().cancelTasks(this);
    }
```?
#

or is there a better way to cancel my async tasks
(saving my task id, then cancelling that only?)

lost matrix
worldly quest
#

ty

lost matrix
jagged monolith
sacred basin
#

I tried to call event and I find two ways for this.

Bukkit.getPluginManager().callEvent();

Bukkit.getServer().getPluginManager().callEvent();```
 
What's the difference and which is more better(general) way? (because will use in Framework)
lost matrix
buoyant viper
#

paper moment

hardy swan
#

hello world

#

eh im right

#

it is a spigot method

#

not from paper

lost matrix
hardy swan
#

Bukkit.getPluginManager().callEvent(Event)

#

did I just read the messages out of context

lost matrix
#

Misread the question. Thought he meant Event#callEvent()

hardy swan
#

oh lol

thorny python
#

is there any good way to check the inventory in interact event is a custom inventory created by myself?

lost matrix
#

Store your custom inventories in a Set and call contains on it

thorny python
#

currently I do it either check title or keep a Set of inventory

sacred oyster
#

how to craft hearts

#

anyone tell me

lost matrix
sacred oyster
#

how

#

can u send screenshot

lost matrix
sacred oyster
#

aaa

#

how

lost matrix
tardy delta
#

!verify

undone axleBOT
#

Usage: !verify <forums username>

shadow night
#

how do I make commands like pluginname:commandname

lost matrix
buoyant viper
lost matrix
buoyant viper
#

i remember another person had asked a while ago abt detecting weather type for a block and we didnt actually figure out what happened at 0.15 exactly

#

bc the wiki says <0.15 is snow, and >0.15 is rain, but =0.15 was.... undocumented

lost matrix
#

Your code flow is questionable btw...
Also: Dont read from configs on runtime. Read the entire config once when the server starts and call properly named variables.

buoyant viper
#

questionable code flow? thonking

lost matrix
#

And you should probably use the thread bound random for lower contention and less overhead.
ThreadLocalRandom

buoyant viper
#

hm

#

will do

#

still wondering abt the code flow comment tho

lost matrix
lost matrix
# buoyant viper hm

Btw prevent magic numbers:

  private static final int MAX_DIST = 128;
  private static final int MAX_DIST_SQ = MAX_DIST * MAX_DIST;
  ...
  if (this.distanceSqXZ(lightningLoc, playerLoc) > MAX_DIST_SQ) continue; // Player is greater than 128 blocks away

This way you just need to edit MAX_DIST instead of calculating a new sq distance every time.
And if someone reads the code he knows what that number means

buoyant viper
#

i think i yoinked the 128 block think from like a wiki page or something so thats why its that

#

lol

#

it was like effective range of players to send a lightning strike or w/e

#

so improved readability yes but practicality of using the fields not so much

lost matrix
#

Those are not fields

buoyant viper
#

last time i checked a public static final int MAX_DIST is a field

lost matrix
#

Using constants is crucial for readability

#

Arent fields instance variables only?

buoyant viper
#

pretty sure not

lost matrix
#

I think you are right

shadow night
buoyant viper
#

i still understand where ur coming from with the readability concern btw, i just dont see why i should considering this plugin is just for an SMP that i run

#

so im not entirely throwing ur recommendation away

lost matrix
shadow night
buoyant viper
#

but the random in there should also kind of help mitigate that

#

since it (hopefully) wont always be a successful chance every time for the same player

lost matrix
lost matrix
#

yeah that should be enough

lost matrix
buoyant viper
#

writing a config manager as speak

lost matrix
#

I think its a bit cleaner to just add values to a collection instead of having a 10 line boolean statement ^^

buoyant viper
#

oh you shouldve saw my old biome check

lost matrix
#

Oh god...

buoyant viper
#
private boolean isRainPossible(Biome biome) {
        return !(biome == Biome.FROZEN_OCEAN
              || biome == Biome.FROZEN_RIVER
              || biome == Biome.DEEP_FROZEN_OCEAN
              || biome == Biome.ICE_SPIKES
              || biome == Biome.SNOWY_BEACH
              || biome == Biome.SNOWY_MOUNTAINS
              || biome == Biome.SNOWY_TAIGA
              || biome == Biome.SNOWY_TAIGA_HILLS
              || biome == Biome.SNOWY_TAIGA_MOUNTAINS
              || biome == Biome.SNOWY_TUNDRA);
    }``` @lost matrix
buoyant viper
#

xd

#

sry i had to convert decompiled code to my original source so thats why edits

spiral light
#

maven hates me....
how can i use and shade a local lib that i made in a plugin for example

buoyant viper
#

maven shade plugin?

spiral light
#

the problem is that there are errors all the time

lost matrix
buoyant viper
lost matrix
spiral light
buoyant viper
#

.equals on an enum? what do i look like? a hooligan?

trim creek
#

How much is 5 seconds in the code Thread.sleep(int)?

trim creek
#

o.o

spiral light
buoyant viper
#

Thread.sleep uses milliseconds

trim creek
#

And I need to use an "L" on the end of the numbers, right?

#

Like 5000L

spiral light
#

if its long yes

trim creek
#

Okay, thank you! 😄

buoyant viper
#

like i do now

lost matrix
trim creek
#

Wait. Why?

spiral light
#

any other way to add the mainClass to the manifest with maven then "maven-assembly-plugin" (which is also red but somehow still works)

lost matrix
#

Because im suspecting that you plan of freezing the main thread.

trim creek
#

Lol it really crashed XD

#

Wait no

#

It didn't.

lost matrix
buoyant viper
#

still shouldnt use Thread.sleep in server

lost matrix
trim creek
#

Well. That was the first code I saw in the scheduling (or what), so I used that. 🥴

buoyant viper
#

if u need a task to run after X time might i recommend using Bukkit tasks

lost matrix
#

?scheduling

undone axleBOT
spiral light
trim creek
#

Thread.sleep actually works, but the player is actually frozen for like 7 seconds, and the TPS is down asf, so you guys were right. .-.

quaint mantle
#

and minecraft depends entirely on it

#

so you sleep it = you sleep minecraft

#

iirc

trim creek
#

Yeah.

#

Just reading the wiki, and I realised that "boring" texts are always useful.

#

c.c

#

Might be.... This the right code I need...?

BukkitScheduler scheduler = Bukkit.getScheduler();
scheduler.runTaskLater(plugin, () -> {
  Bukkit.broadcastMessage("Mooooo!");
}, 20L * 30L /*<-- the delay */);
lost matrix
trim creek
#

Hm.

#

This is good, but I still have an error. The plugin is unrecognized.

#

...as a variable..?

lost matrix
# trim creek ...as a variable..?

Yes you need to pass an instance of JavaPlugin. Just pass it via the constructor or create a static getter for a singleton instance.

trim creek
#

You mean make the Loader (Main) class static?

#

I don1t think its a good idea

chrome beacon
#

No

lost matrix
undone axleBOT
trim creek
#

Ah ####

quaint mantle
#

Why enchants not working on zombie i spawned?
z.getEquipment().setBoots(dia_boots, true);
z.getEquipment().getBoots().addEnchantment(Enchantment.PROTECTION_ENVIRONMENTAL, 2);

young knoll
#

Add the enchantment before you set the boots

#

getBoots is probably a copy

trim creek
#

'cause breaking the blocks will be disabled in certain server types.

#

Wait...

#

This WIki shows that FancyLogger is a classfile, I may use, for like the join event, or the quit event, right?

analog prairie
#

How to disable anti-cheat in spigot

#

With code

lost matrix
spiral light
#

well spigot has not rly anti-cheat ... just some fixes to make sure the server dont crash while player try to hack

young knoll
#

That’s just vanilla

analog prairie
#

It keeps going back and forth, isn't it because of anti-cheating?

lavish folio
#

hello, i have entity (egg) how get itemstack display name?

young knoll
#

I don’t think that’s stored when the item becomes an entity

trim creek
#

"The server has not responded for 0 seconds" - wtf

lavish folio
#

and I don't know how to save it before throwing?

lost matrix
trim creek
#

And also: why is the anticheat detecting you, if you are the owner...?

lavish folio
young knoll
#

Vanilla has a loved too quickly system

#

I think there is a way to up the threshold in on of the server configs

quaint mantle
#

why does zombie when i give it sword do same damage as without it?
z.getEquipment().setItemInMainHand(dia_sword);

buoyant viper
#

reads config values on server start or manual config reload (via command in core plugin)

lost matrix
#

But why is it public?

buoyant viper
#

is it?

#

oh woops

#

lol

#

just typo

young knoll
#

The real question is

#

Is netherite conductive

buoyant viper
#

its infused with gold

#

so id say yes

lost matrix
#

Wouldnt it make more sense to instantiate the entries in your config manager class?

    private final ConfigurationEntry<Boolean> enableCutlasses;
    private final ConfigurationEntry<Double> cutlassStrikeChance;

    public WorldEventListener(SmpCore plugin) {
        super(plugin);

        this.enableCutlasses = plugin.configurationManager.<Boolean>getOrCreate("world.cutlasses.can-strike");
        this.cutlassStrikeChance = plugin.configurationManager.<Double>getOrCreate("world.cutlasses.strike-chance");
    }
buoyant viper
buoyant viper
#

its 6 am

#

ill rework it later

#

bc i might actually use this approach in other plugins so ill have to work on it anyway

young knoll
#

How about sleeping

buoyant viper
#

in a bit

tardy delta
#

programmers dont sleep

buoyant viper
#

we get ideas and then we need to make them before we forget

tardy delta
#

yesh

buoyant viper
#

so id have to make a method in the listener called like

young knoll
#

Just read from the YamlConfiguration each time

buoyant viper
#

loadConfiguration()

#

and then that sets the values

lost matrix
# buoyant viper loadConfiguration()
public class LightningStrikeConfiguration {

  private final FileConfiguration configuration;
  @Getter
  private boolean lightingStrikingEnabled;
  @Getter
  private int maxDistance;

  public LightningStrikeConfiguration(FileConfiguration configuration) {
    this.configuration = configuration;
    reload();
  }

  public void reload() {
    this.lightingStrikingEnabled = configuration.getBoolean("some.path.to.stuff");
    this.maxDistance = configuration.getInt("some.other.path.stuff");
  }

}
buoyant viper
#

h

#

to each their own

#

i like objects

lost matrix
#

Wait that wouldnt work as you need a new instance of FileConfiguration

buoyant viper
#

@Getter, do i look like a hooligan to u???

#

jk

lost matrix
#
public class LightningStrikeConfiguration {

  private final Supplier<FileConfiguration> configSupplier;
  @Getter
  private boolean lightingStrikingEnabled;
  @Getter
  private int maxDistance;

  public LightningStrikeConfiguration(Supplier<FileConfiguration> configSupplier) {
    this.configSupplier = configSupplier;
    reload();
  }

  public void reload() {
    FileConfiguration configuration = configSupplier.get();
    this.lightingStrikingEnabled = configuration.getBoolean("some.path.to.stuff");
    this.maxDistance = configuration.getInt("some.other.path.stuff");
  }

}
young knoll
#

When the lom is bok

buoyant viper
#

gona slep so im not completely dreading irl job later

#

will work on configurator after work

#

gud nite spigot

tardy delta
buoyant viper
#

@young knoll maybe ill consider the project to maow...

#

piping-configs

buoyant viper
#

eventually

young knoll
#

Sleep is for daytime

tardy delta
#

sleeping is for losers uwu

buoyant viper
#

2-8 today not the worst

young knoll
#

Just uhh

#

Don’t

buoyant viper
#

i wish

simple cloud
#

im trying to write my own code to just move to the next day if 50% of people are sleeping. does this look correct?

public class SleepListener {
    private int sleeping = 0;

    @EventHandler
    public void onSleep(org.bukkit.event.player.PlayerBedEnterEvent event) {
        if (event.getBedEnterResult() == BedEnterResult.OK) {
            sleeping++;
            if (sleeping > event.getPlayer().getServer().getOnlinePlayers().size() / 2.0) {
                event.getPlayer().getWorld().setTime(0);
            }
        }
    }

    @EventHandler
    public void onWake(org.bukkit.event.player.PlayerBedLeaveEvent event) {
        sleeping--;
    }
}
#

I'm not sure if theres some smoother/better way to transition to day, other than just jumping the time to 0

lost matrix
simple cloud
#

wait really???

buoyant viper
#

if ur on 1.17+ use gamerule yeah

simple cloud
#

omg i didnt even know

#

wow so much has changed in 1.17 and 1.18

tardy delta
#

org.bukkit.event.player.PlayerBedEnterEvent nice

lost matrix
#

playersSleepingPercentage

simple cloud
#

i swear i imported it

red sedge
#

is there anyway to register events without duplicating the same stuff]over and over

lost matrix
buoyant viper
#

?jd for self

red sedge
# lost matrix Define "duplicating the same stuff"

getServer().getPluginManager().registerEvents(new listener, this);
getServer().getPluginManager().registerEvents(new listener, this);
getServer().getPluginManager().registerEvents(new listener, this);
getServer().getPluginManager().registerEvents(new listener, this);
getServer().getPluginManager().registerEvents(new listener, this);
getServer().getPluginManager().registerEvents(new listener, this);
getServer().getPluginManager().registerEvents(new listener, this);

buoyant viper
#

u could do a for loop

red sedge
tardy delta
#

like let your listener classes extend a base class and let the base class register them all

buoyant viper
#

i was thinking a literal reregister of the same listener for some reason but yeah what 14 said

tardy delta
#

idk why tho

lost matrix
tardy delta
#

yea..

lost matrix
red sedge
#

i gues

tardy delta
#

i saw people doing new ListenerClass(this) in their onEnable

#

looks weird

red sedge
#

i mean

#

isnt it just registering them just somewhere else

quaint mantle
#

hi, can someone explain to me why when i spawn new zombie with diamond sword it deals same damage as without it
z.getEquipment().setItemInMainHand(dia_sword);

tardy delta
red sedge
tardy delta
#

same for other modules :(

red sedge
#

so there isno way?

tardy delta
buoyant viper
#

smh wheres the DI

tardy delta
#

they were using singleton most of the time

lost matrix
# red sedge new ListenerClass(this)
public abstract class SelfRegisteringListener implements Listener {

  public SomeListener(JavaPlugin plugin) {
    Bukkit.getPluginManager().registerEvents(this, plugin);
  }

}
trim creek
#

🤔

tardy delta
#

thats what im taking abt

lost matrix
#
public class SomeListener extends SelfRegisteringListener {

  public SomeListener(JavaPlugin plugin) {
    super(plugin);
  }

  @EventHandler
  public void doStuff(BlockBreakEvent event) {

  }

}
  @Override
  public void onEnable() {
    new SomeListener(this);
  }
tardy delta
#

i dont see any profit with doing this

lost matrix
tardy delta
#

implements Listener :)

buoyant viper
#

how to spigot:

  1. ???
  2. profit
tardy delta
#

nvm

buoyant viper
#

ok i go bed

tardy delta
#

"hello spigot" 🥺 🥺

lost matrix
# tardy delta kekw

Thats not how you should use constructors. Prone to really nasty ClassLoader exceptions if anything happens in your constructor.

tardy delta
#

dont blame me its not my code

#

it looks weird af

lost matrix
#

Maybe something like:

public interface PluginModule {

  void enable();
  void disable();

}

  private final List<PluginModule> moduleList = new ArrayList<>();

  @Override
  public void onEnable() {
    // Add modules in order here
    enableModules();
  }

  @Override
  public void onDisable() {
    disableModules();
  }

  private void enableModules() {
    moduleList.forEach(PluginModule::enable);
  }

  private void disableModules() {
    Collections.reverse(moduleList);
    moduleList.forEach(PluginModule::disable);
    Collections.reverse(moduleList);
  }
trim creek
#

Oké, so the loader (main) class has the code logger = new LobbyJoinEvent(this); when registering the lobby classes, and it also has the...

    public LobbyJoinEvent getFancyLogger() {
        return logger;
    }
``` ...code too. Now, my problem is that LobbyJoinEvent is actually... not loaded. What could destroy the process of loading the class (there are no errors against LobbyJoinEvent.java)?
tardy delta
#

why reversing uwu

lost matrix
tardy delta
#

for module compatibility?

lost matrix
tardy delta
#

ah i understand

#

im specifying the order manually

trim creek
#

(some parts of the LobbyJoinEvent)

    private final JavaPlugin plugin;

    public LobbyJoinEvent(JavaPlugin plugin) {
        this.plugin = plugin;
    }

(the part that needs the "logger")

    sch.runTaskLater(plugin, () -> {
            if(player.isOp()) {
                player.sendMessage("§4§lFIGYELMEZTETÉS §8| §7Operátor jogosultságokkal rendelkezel!");
                player.sendTitle("§4§lFIGYELMEZTETÉS!", "§7Operátor jogsultságokkal rendelkezel!", 5, 100, 5);
                player.playSound(player.getLocation(), Sound.BLOCK_BELL_USE, 1000, 0);
            }
        }, 200L);
lost matrix
# tardy delta im specifying the order manually

A better way would be to maintain a Map<Class<? extends PluginModule>, PluginModule> with an abstract
interface method List<Class<? extends PluginModule>> getDependencies() and then use some graph algorithm
to find out the perfect load/unload order. Similar to how Spigot does its load order.

#

Or just define them manually ^^

lost matrix
trim creek
trim creek
spiral light
#

plugin cant be a logger ^^

trim creek
#

Da

quaint mantle
#

LOL

#

?learnjava

undone axleBOT
lost matrix
trim creek
#

🤔

#

OK. This article/wiki (https://www.spigotmc.org/wiki/using-dependency-injection/) makes no sense to me. How the #### does this even lets me use the plugin in the code of

sch.runTaskLater(plugin, () -> {
            if(player.isOp()) {
                player.sendMessage("§4§lFIGYELMEZTETÉS §8| §7Operátor jogosultságokkal rendelkezel!");
                player.sendTitle("§4§lFIGYELMEZTETÉS!", "§7Operátor jogsultságokkal rendelkezel!", 5, 100, 5);
                player.playSound(player.getLocation(), Sound.BLOCK_BELL_USE, 1000, 0);
            }
        }, 200L);
``` if it just breaks the whole ###### class?!
buoyant viper
#

yknow what would be pog

#

annotation based configs

lost matrix
lost matrix
buoyant viper
#

hmm

#

ill probably still take a grab at it myself since im stubborn and like to DIY everything

trim creek
lost matrix
# buoyant viper ill probably still take a grab at it myself since im stubborn and like to DIY ev...

Im at the point where i just write a class and let Jackson generate me yml files from it.

@Data
@JsonRootName(value = "Configuration")
public class BaseConfiguration {

  @JsonProperty("MaxMillisecondsPerTick")
  private double maxMillisecondsPerTick = 15.5;
  @JsonProperty("MachineSettings")
  private MachineSettings machineSettings = new MachineSettings();
  @JsonProperty("MessageFormatting")
  private MessageFormatInformation formatInformation = new MessageFormatInformation();
  @JsonProperty("TranslatedEntityNames")
  private TranslatedEntityNames entityNames = new TranslatedEntityNames();
  @JsonProperty("FirePlayerEventsForMachines")
  private boolean fireEventsForMachines = true;

}
public class MachineSettings {

  @JsonMerge
  @JsonProperty("TriggerIntervals")
  private final Map<BaseMachineType, Integer> triggerIntervals = Arrays
      .stream(BaseMachineType.values())
      .collect(Collectors.toMap(Function.identity(), BaseMachineType::getBaseMachineInterval));

  public int getTriggerInterval(final BaseMachineType baseMachineType) {
    return this.triggerIntervals.getOrDefault(baseMachineType, 20);
  }

}
trim creek
#

However, as I was following the wiki someone sent to me, it just made me break the class

#

Everything else works, but not the join events

#

And this all makes no sense, because the IDE shows no absolute errors.

#

And this is what I hate

lost matrix
#

?paste

undone axleBOT
lost matrix
#

Just paste your two classes pls

trim creek
#

You mean the main and the join event?

acoustic pendant
#

Hey! i have been doing some code but i got stuck, how can i do to delete Player player from these methods?

    public static void createNPC(Player player, String name, String skin) {
        MinecraftServer server = ((CraftServer) Bukkit.getServer()).getServer();
        WorldServer world = ((CraftWorld) Bukkit.getWorld(LocationsFile.getConfig().getString(name + ".world"))).getHandle();
        GameProfile gameProfile = new GameProfile(UUID.randomUUID(), ChatColor.translateAlternateColorCodes('&', name));
        EntityPlayer npc = new EntityPlayer(server, world, gameProfile, new PlayerInteractManager(world));
        npc.setLocation(LocationsFile.getConfig().getDouble(name + ".x"), LocationsFile.getConfig().getDouble(name + ".y"),
                LocationsFile.getConfig().getDouble(name + ".z"), LocationsFile.getConfig().getInt(name + ".yaw"),
                LocationsFile.getConfig().getInt(name + ".pitch"));

        String[] name1 = getSkin(player, skin);
        gameProfile.getProperties().put("textures", new Property("textures", name1[0], name1[1]));

        addNPCPacket(npc);
        NPC.add(npc);
    }```
#
    private static String[] getSkin(Player player, String name) {
        try {
            URL url = new URL("https://api.mojang.com/users/profiles/minecraft/" + name);
            InputStreamReader reader = new InputStreamReader(url.openStream());
            String uuid = new JsonParser().parse(reader).getAsJsonObject().get("id").getAsString();

            URL url1 = new URL("https://sessionserver.mojang.com/session/minecraft/profile/" + uuid
            + "?unsigned=false");
            InputStreamReader reader1 = new InputStreamReader(url1.openStream());
            JsonObject property = new JsonParser().parse(reader1).getAsJsonObject().get("properties")
                    .getAsJsonArray().get(0).getAsJsonObject();
            String texture = property.get("value").getAsString();
            String signature = property.get("signature").getAsString();
            return new String[] { texture, signature };
        } catch (Exception e){
            EntityPlayer p = ((CraftPlayer) player).getHandle();
            GameProfile profile = p.getProfile();
            Property property = profile.getProperties().get("textures").iterator().next();
            String texture = property.getValue();
            String signature = property.getSignature();
            return new String[] { texture, signature };
        }
    }```
trim creek
#

'cause main is full of most likely codes you may see weird - which I really do not mind about 😹 -.

acoustic pendant
tardy delta
#

delete player?

lost matrix
tardy delta
#

that looks like codedred's code

acoustic pendant
#

String[] name1 = getSkin(player, skin);

acoustic pendant
lost matrix
#

Ah i see. Then replace with createNPC(String texture, String signature, String name, String skin)

String[] name1 = new String[]{texture, signature};
red sedge
#

should i encrypt player data

tardy delta
#

what player data lol

spiral light
#

GameProfile probably

lost matrix
acoustic pendant
#

yes

#

it does already

#

but i need to delete Player player

quaint mantle
#

hi, can someone explain to me why zombie doesnt give more damage with diamond sword in his main hand?
z.getEquipment().setItemInMainHand(dia_sword);

lost matrix
acoustic pendant
#

the name

tardy delta
#

it does a web request to the profile server or how its called

acoustic pendant
#

yea

spiral light
#

there is a nice website where you can create your own skins and the website gives your value+signature ^^

tardy delta
#

pls do that async

tacit drift
#

will PlayerResourcePackStatusEvent get triggered even if the server sets the resource pack from server.props?

lost matrix
#

Then simply remove the Player from the getSkin() method.
Its only used for exception handling in there.
@acoustic pendant

tacit drift
#

I want a way to detect the resource pack of a player/when the server applies the resourcepack

acoustic pendant
#

hmm

spiral light
#

try and see

trim creek
#

idk why is the main a cs

#

xD

acoustic pendant
#

so i have to return steve texture and signature?

tardy delta
#

uhh what

#

thats default

acoustic pendant
#

yea but i have to return a string

lost matrix
#

you need to return a String[]

acoustic pendant
#

just this?

tardy delta
#

you just check if the player entered a name and then apply a texture, otherwise dont?

#

new String[0]

lost matrix
# acoustic pendant just this?
  private static String[] getSkin(String name) {
    try {
      URL url = new URL("https://api.mojang.com/users/profiles/minecraft/" + name);
      InputStreamReader reader = new InputStreamReader(url.openStream());
      String uuid = new JsonParser().parse(reader).getAsJsonObject().get("id").getAsString();

      URL url1 = new URL("https://sessionserver.mojang.com/session/minecraft/profile/" + uuid
          + "?unsigned=false");
      InputStreamReader reader1 = new InputStreamReader(url1.openStream());
      JsonObject property = new JsonParser().parse(reader1).getAsJsonObject().get("properties")
          .getAsJsonArray().get(0).getAsJsonObject();
      String texture = property.get("value").getAsString();
      String signature = property.get("signature").getAsString();
      return new String[] { texture, signature };
    } catch (Exception e){
      e.printStackTrace();
      return null;
    }
  }
tardy delta
#

is null valid for a String[]?

lost matrix
#

null is valid for everything unless its a primitive

acoustic pendant
#

and if the skin is wrong?

#

will send an error

#

or just steve?

lost matrix
tardy delta
#

oh didnt know it worked on arrays tho

acoustic pendant
#

well

trim creek
young knoll
#

You tell me?

tardy delta
#

its an example smh

trim creek
#

😒

#

Hát, elég szarul sikerült.

tardy delta
#

wha-

#

satan?

trim creek
#

🤣

#

No

tardy delta
#

oh 😳

shell prism
#

yo i need help with opening a book to a player

#
    @EventHandler
    public void onInventoryClick(InventoryClickEvent event) {
        HumanEntity player = event.getWhoClicked();
        if (event.getInventory().getName().equals("Updates")) {
            event.setCancelled(true);
            if (event.getCurrentItem() == null) {
                return;
            }
            if (event.getCurrentItem().getType() == Material.BOOK) {
                return;
            }
            if (event.getCurrentItem().getItemMeta().getDisplayName().equals("§a§lUpdates")) {
                ItemStack book = createBook();
                //open book

            }
        }
    }```
misty current
#

Packets are my best guess, unless spigot has method to do so

analog prairie
#
[20:40:52] [Server thread/WARN]: handleDisconnection() called twice
#

What's wrong?

quiet ice
#

People say that you should store custom enchantments in the PDC, however why is that the case if Bukkit already stores this info if I were to extend the Enchantment class? Is there some catch with just using latter (outside of the enchantment not showing on the user's side)

spiral light
misty current
#

I didn't even know you could do that but i'd rather handle enchantments on my own

spiral light
#

also anvil and stuff like that dont use custom enchantments automatically

quiet ice
#

Within spigot it absolutely refuses to merge items, under paper it is a bit better but there are still a few edge cases. And I know that it is not my code because I already spent dozens of hours of debugging over the span of almost two years only to come to the same conclusion each and every time

misty current
#

I kinda hate anvils

quiet ice
#

I couldn't agree more

spiral light
#

i kinda made it work with anvils and eventtriggering.... but it was pain

quaint mantle
#

Why my plugin doesnt want to load?
heres code:


import me.karlo292.luckyblock.listeners.onBlockBreak;
import me.karlo292.luckyblock.listeners.onCustomMobDeath;
import org.bukkit.plugin.java.JavaPlugin;

public final class LuckyBlock extends JavaPlugin {

    @Override
    public void onEnable() {
        // Plugin startup logic
        System.out.println("STARTING PLUGIN!!!!!!!!!!!!!!!!!!");
        getServer().getPluginManager().registerEvents(new onBlockBreak(), this);
        getServer().getPluginManager().registerEvents(new onCustomMobDeath(), this);
    }

    @Override
    public void onDisable() {
        // Plugin shutdown logic
    }
}
tardy delta
#

// Plugin startup logic heheee

quaint mantle
#

[14:21:22 ERROR]: Ambiguous plugin name `LuckyBlock' for files `plugins\original-LuckyBlock-1.0-SNAPSHOT.jar' and `plugins\LuckyBlock-1.0-SNAPSHOT.jar' in `plugins' [14:21:22 ERROR]: Could not load 'plugins\original-LuckyBlock-1.0-SNAPSHOT.jar' in folder 'plugins' org.bukkit.plugin.InvalidPluginException: java.lang.UnsupportedClassVersionError: me/karlo292/luckyblock/LuckyBlock has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 60.0

spiral light
#

the problem is the java version you use ^^

quiet ice
#

Java 16 > Java 17

quaint mantle
#

ok

quiet ice
#

Actually, Java 16 > any other java version

#

(for compilation that is)

hardy swan
#

idk man the error message seems really self-explanatory

#

safest bet is to use 1.8 compile source

shell prism
#

yo i need help with the inventory on click event
it doesnt trigger

hardy swan
#

here are few things you might have missed:

  • not registering the listener
  • not adding @EventHandler annotation to the method
  • you are listening to the wrong event
quiet ice
#
  • the event you are listening for has no handler
tardy delta
#

what would that even mean?

#

that you cant listen for it?

eternal oxide
#

You can't listen to abstract events

tardy delta
#

ah in that way

quaint mantle
#

has anyone used the MCPLuGINDEBUG plugin for IntelliJ? It says I dont have the latest java while I do

shell prism
#

hey i need help again with opening a book

#
            try {
                player.getClass().getMethod("openBook", ItemStack.class).invoke(player, book);
            } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
                player.getServer().getLogger().info(e.toString());
            }
#

i have tried this and it doesnt work (like everything else)

tardy delta
#

already tried packets?

shell prism
#

no

#

idk how to use it tbh

eternal oxide
#

what error?

tardy delta
shell prism
#

nope

quaint mantle
#

which event is fired when a player right clicks an item frame?

spiral light
#

PlayerInteractAtEntityEvent
maybe ^^

tardy delta
#

PlayerInteractEvent also prob.

#

which is useless ._.

ivory sleet
#

the interact event 🌛

spiral light
#

why useless O.o

ivory sleet
#

prob not useless but it gets fired for a various amount of reasons

spiral light
#

and it wont get change since it will always stick to support ancient versions too

tardy delta
#

are there multiple Player interfaces for versions?

spiral light
#

nope

tardy delta
#

well the 1.15 api has the openBook method for a player

ivory sleet
#

so?

tardy delta
#

and @shell prism cant find that method

ivory sleet
#

I very much believe it still exists as of today

spiral light
#

the interface only adds stuff and never removes stuff

tardy delta
#

the 1.14 one doesnt have the method

ivory sleet
#

well then its clear that in some snapshot version in 1.15 ::openBook was added

#

as freesoccerhdx said, spigot scarcely remove methods

#

but I mean 1.15 sounds quite old

ancient plank
#

3 years old iirc

tardy delta
#

fixed

crimson verge
#

openBook defo still exists lol

#

i used it just recently in a 1.18 plugin

tardy delta
#

in which way is the clicker of an inventory not a player?

crimson verge
#

i think thats Bukkit claiming its a HumanEntity

#

which is annoying

#

i always just cast it 💀

tardy delta
#

and a humanentity isnt always a player?

#

a npc or something?

crimson verge
#

in my experience a humanentity is always a player

spiral light
#

until now its always a player

crimson verge
#

i think its just bukkit being dumb lol

spiral light
#

but maybe someday it will be used somewhere else

crimson verge
#

i have never had an issue just casting the clicker to player lulz

tardy delta
#

then my check is useless

crimson verge
#

well, good practice yadda yadda 🤣

spiral light
#

yeah... because nothing else exist that has HumanEntity ... its just good prepared

#

also plugins could do weird stuff with the HumanEntity class

tardy delta
#

rewriting whole my plugin goes brr

#

i just make a new project smh

spiral light
#

any way to automatically parse an string to the primitive array ?

tardy delta
#

wait 1.18 uses jdk16 right?

#

?java16

undone axleBOT
hybrid spoke
tardy delta
#

17 then

#

?java17

undone axleBOT
tardy delta
#

i never have to mess around with java versions 🙄

gleaming grove
#

@tardy delta you can downland and set JDK in the project structure

tardy delta
#

its for the server jar

#

to run on

gleaming grove
#

oh ok

spiral light
#

just buy a server ^^

tardy delta
#

?

obtuse ferry
#

Is there a list of images somewhere that shows every single particle and its ID

spiral light
#

no i want to have for example '["123","123","123","132"]' (its a string)
to its representative int-array or long-array what ever

hardy swan
#

No

tardy delta
#

wha-

hardy swan
#

Just do manually

spiral light
#

i already have done that ... just tryd to save time

woeful crescent
#

what's the github action for mvn clean package

unreal quartz
#

run: mvn clean package?

woeful crescent
#

confuse

#

whose machine will it run on

unreal quartz
#

github

sinful hedge
#

Do you know plugins for auto-ranking?

woeful crescent
#

like what about my local dependencies

#

will that not work

unreal quartz
#

nope

woeful crescent
#

dammit

#

how would i do that?

unreal quartz
#

unless you can host said local dependencies you won’t be able to use github actions

woeful crescent
#

hmmmm

#

is there any way to make it run on someone's machine before they push?

#

or, when they push it runs mvn clean package

unreal quartz
#

mvn clean package && git push?

#

that will just build it on your machine

woeful crescent
#

im so confused

#

no way to automate it?

unreal quartz
#

what are you even trying to do

woeful crescent
#

alright so we have local dependencies, but i still want to upload the latest artifact

#

using upload-artifact

unreal quartz
#

to what

woeful crescent
#

nightly.link

#

or whatever else can just link a download to an artifact on github

unreal quartz
#

can’t you just use github releases

woeful crescent
#

the repo is private

unreal quartz
#

is that an issue

woeful crescent
#

uh yeah

#

so what we need to do

#

well i actually meant nightly.link because it needs to link the latest commit and i dont wanna have to publish every time

unreal quartz
#

why do you need these jars on github

#

because unless you can host these local dependencies then you’re gonna have to have a ci server of your own

woeful crescent
#

because they juist need to be included with every commit

summer scroll
woeful crescent
#

or yk what

#

i think its better they do it themself

#

bc what if you push something that you dont want to be downloaded immediately

unreal quartz
woeful crescent
#

i dont

#

but i think this is how i learn

tardy delta
#

on the same server

summer scroll
#

I don't know

eternal oxide
#

no

summer scroll
#

So that's why

tardy delta
#

use UUID.randomUUID() then

woeful crescent
#

also is ${user.home} the pom pattern with /Joe/

#

what is it exactly

summer scroll
#

How can I change the skin so it's using the same skin?

tardy delta
#

web request to mojang server to get some properties

summer scroll
#

That's the only way?

#

With web request

tardy delta
#

i heard people talking about another site

summer scroll
#

It's more complicated than I thought xd

tardy delta
#

this kinda explains it

#

codedred is bad but yea

hardy swan
#

you are trying to have github build your maven project and create a release with that on every push?

woeful crescent
#

no im gonna upload the artifact and then link it

hardy swan
#

you don't "upload" an artifact

#

are you creating an API?

woeful crescent
#

actions/upload-artifact?

#

no im not

#

im creating something that needs to be downloaded with a link and no more

summer scroll
hardy swan
#

nvm

summer scroll
#

cracked or whatever

hardy swan
#

maybe just create a separate repo

summer scroll
#

Can I get the GameProfile of the Player and get the skin textures and signatures from there?

tardy delta
#

that you can join with hacked clients?

hardy swan
#

offline mode means you tell mojang to not check on your players on log in

tardy delta
#

ah

hardy swan
#

with cracked* clients

#

hacked clients can go anywhere

tardy delta
#

then it will not find a gameprofile on the mojang server

hardy swan
#

they are hacked

tardy delta
#

but who uses offline mode 🙄

hardy swan
#

a lot of people actually

#

you will be surprised

summer scroll
#

Lots of people xd

tardy delta
#

mwoa

#

i dont think i have it enabled and i could join with a cracked client

summer scroll
#

I think getting the skin from the GameProfile is doable right?

#

Instead using a web request

tardy delta
#

doesnt the player has to be online for that?

summer scroll
#

In my case the player will be online to do this

tardy delta
#

oh

#

idk if the texture is linked to the gameprofile but if it is, it will work

tender shard
#

and textures ALSO need a valid signature

#

there's no way to change a player's texture to a random one without having it signed from mojang servers

sinful hedge
#

Do you know plugins for auto-ranking?

tardy delta
#

so you will need to do a web request to the server?

tender shard
hardy swan
#

i think it is possible to reuse the game profile from the player

summer scroll
#

I'm trying to change the skin of an NPC.

tender shard
#

you CAN change player's textures, but: it requires you to once upload the skin to a real MC account, then you can grab the signature from there

tardy delta
#

wha-

#

sounds complicated

tender shard
#

well basically I could just upload any skin, then log into the game and save my GameProfiles "textures" and "signature" property

#

now you can reuse that as often as you want

summer scroll
#

I'm struggling to get that property.

tender shard
#

oh that's easy

#

one second

#

here's my method to get the texture of a skullmeta, which contains a gameprofile

summer scroll
#

Oh I think I got it.

tender shard
#
    @Nullable
    public static String getBase64Texture(@NotNull final SkullMeta skullMeta) {
        try {
            final Field profileField = skullMeta.getClass().getDeclaredField("profile");
            profileField.setAccessible(true);
            final GameProfile profile = (GameProfile) profileField.get(skullMeta);
            return profile.getProperties().get("textures").stream().findFirst().get().getValue();
        } catch (final Throwable t) {
            return null;
        }
    }
#

of course you can do the same thing to set the value instead of just getting it, and do the same for "signature" instead of "textures"

tardy delta
#

why do you need to upload the skin to a real mc acc?

tender shard
#

to get a valid signature for that skin

tardy delta
#

aaah

tender shard
#

there are APIs that do that for you IIRC

tardy delta
#

so thats why you need a player

tender shard
#

yeah seems like only mojang knows how their "signature" code works

summer scroll
tender shard
#

unless someone cracks it, people will have to upload it

tender shard
#

just try it 🙂

#

mineskin.org automatically gets you a signature for any skins you upload

mint quiver
#

helo
im having some problem in plugin

#

i mean i made a plugin but it works only one time

tardy delta
#

errors?

summer scroll
mint quiver
#

it works when i upload it and when server closes and starts again the plugin jar becomes 1 kb and throws this error

[20:14:16 ERROR]: Could not load 'plugins\icecube.jar' in folder 'plugins'                                              org.bukkit.plugin.InvalidDescriptionException: Invalid plugin.yml                                                               at org.bukkit.plugin.java.JavaPluginLoader.getPluginDescription(JavaPluginLoader.java:178) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]                                                                                                              at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:158) ~[paper-api-1.18.1-R0.1-SNAPSHOT.jar:?]                                                                                                                      at org.bukkit.craftbukkit.v1_18_R1.CraftServer.loadPlugins(CraftServer.java:422) ~[paper-1.18.1.jar:git-Paper-152]                                                                                                                              at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:285) ~[paper-1.18.1.jar:git-Paper-152]                                                                                                                        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1202) ~[paper-1.18.1.jar:git-Paper-152]          at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317) ~[paper-1.18.1.jar:git-Paper-152]                                                                                                                               at java.lang.Thread.run(Thread.java:833) ~[?:?]                                                                 Caused by: java.io.FileNotFoundException: Jar does not contain plugin.yml                                                       ... 7 more  
tardy delta
#

Invalid plugin.yml

#

Jar does not contain plugin.yml

#

it says

mint quiver
#

but it worked first time when i started server

#

without any err

tardy delta
#

idk are you sure its in the resources?

quaint mantle
#

hello how can I set max durability of some tool to 1?

tardy delta
#

and it is valid syntax?

mint quiver
#

plugin.yml is in the src folder
i googled things but nothing worked

#

the jar was of 11kb when i placed it in plugins folder,
after i stopped server it became only 1 kb
and when i kill the server without stop cmd it remains same

tardy delta
#

can you ?paste your plugin.yml

#

?paste

undone axleBOT
mint quiver
#

yes

#

its short

#
main: xyz.squeek.icecubesmp.main
name: icecube
version: 1.0.1
commands:
  suicide:
    description: Suicide
    usage: /suicide
  bedrock:
    description: test one
    usage: /bedrock
  linkdsc:
    description: test two
    usage: /linkdsc
tardy delta
#

its valid yea

#

however dont you need to set an author?

summer scroll
#

It's optional

mint quiver
#

so , maybe its papermc currupting the jar?

tardy delta
#

well its a filenotfound so i assume its not there

summer scroll
#

Maybe wrong path

mint quiver
#

very confusing, it was fine at first start

summer scroll
#

Can you show us the folder structure?

mint quiver
#

yes

#

just a sec

#

im unable to upload image

summer scroll
#

Oh, you need to be verified first to upload an image

mint quiver
#

sed

summer scroll
#

Just use imgur or something

summer scroll
tardy delta
#

i see no resources folder

quaint mantle
#

where can i find the list of items in a specific creative mode tab, i am trying to pick X amount of items from a specific creative mode tab

vestal dome
#

what

quaint mantle
#

Like picking 5 items from the Building Blocks tab

tardy delta
#

there isnt

vestal dome