#help-development

1 messages · Page 534 of 1

chrome ferry
remote swallow
#

if you fully know java you can learn it

quaint mantle
#

doesnt work either

vast ledge
#

the slash the otherway

#

\

quaint mantle
#

already did that wrong screenshot

vast ledge
#

put a comma

quaint mantle
#

oh

#

okay

#

btw what is ...strings

#

why isnt it just an array

fresh timber
#

?paste

undone axleBOT
quaint mantle
#

oh okay thx

#

any way i can alter the "done" button

#

sad

remote swallow
#

with a resource pack yeah

quaint mantle
#

a custom resource pack could

#

tho

#

yh

#

okay

#

well technically couldnt i create new buttons and call them myself

#

i know that ive made resource packs before. BUT you can technically add unlimited resources

#

especially with resourcepacks

#

they have little bounderies

#

i bet theres a way

orchid gazelle
raw prairie
fresh timber
#

I am trying to test something and in this code, you can see that I get the head equipment of the player I'm using this on and I get the first line of the lore of it and test if it starts with "§fHealth: ." I literally use a plugin that can add lores but you have to use & in the symbol instead of § but it has to change & to § in the lore anyway so the check of if it starts with "§fHealth: " should work fine. The plugin I use is ItemEdit and the command with this plugin I use to add the lore is "/ie lore set 1 &fHealth: &a+10" Does anyone know why this doesn't work?

https://paste.md-5.net/velosahoko.cs

remote swallow
raw prairie
#

Just Java syntax giving me headaches

#

What, it's pretty easy to learn compared to java

#

Its syntax actually doesn't make the average user want to commit suicide

remote swallow
quaint mantle
#

Java isnt that complicated

#

if you want to fully use c c++ or c-- all of them will most definetly be harder then java

remote swallow
#

c-- KEKW

orchid gazelle
#

c and c++ are way harder than java, but java is still hard compared to a lot of other languages

quaint mantle
#

but

#

i wouldnt even say its in the bottom 50%

orchid gazelle
#

I'd say its in the top 40% of all languages sorted by "hard"

#

The thing is I would probably need to know more languages to really know

quaint mantle
#

i would refeer to this iceberg its not fully my opinion but somewhat how i see it

orchid gazelle
#

I don't know all of those logos

raw prairie
#

I made games with c++ within the first week of learning c++ with windowing system

orchid gazelle
#

Like wtf is row 7

raw prairie
quaint mantle
#

1.top ones scratch isnt really programming
2.java script and python are really simple
3.then sql, ruby, bash etc is a bit complicated but duable
4.Java, C#, GO you probally know them
5.Then stuff like elexir wich is for example used for discord
6.C, C++ and Rust is starting to hurt a lot
7. No clue really either
8. Barely in use anymore cause useless
9. Mostly Meme stuff like Brainfuck, Lolcode etc but also Grape and C-
10. Binary. I love binary

raw prairie
#

Its assembly x86

quaint mantle
#

everything thats really close to hardware is in the last row.

raw prairie
#

Its 01 and those are the 2 only numbers used

quaint mantle
#

I build a computer my self before. With 8 bit only but it was really fun

#

thats why i know all the logic gates stuff etc

subtle folio
#

wrong i’m on x128 and we have 0,1,2

#

get real

raw prairie
#

Lmao

quaint mantle
#

tfs that

#

not againnn

subtle folio
#
  • 2023
quaint mantle
#

how do i do it

orchid gazelle
quaint mantle
#
    1. 2023
subtle folio
#
    1. 2023
subtle folio
#

87!?

raw prairie
#

86x

subtle folio
#

woah

#

future man

raw prairie
#

Lmao

orchid gazelle
subtle folio
#

why is brain fuck on that list

quaint mantle
orchid gazelle
raw prairie
subtle folio
#

and c—

orchid gazelle
#

Who tf uses c-- seriously

quaint mantle
raw prairie
subtle folio
#

no oen it was a joke project

quaint mantle
raw prairie
#

Rust is my bbg

quaint mantle
#

yh fr

#

rust <3

#

but nothing beats lolcode

raw prairie
tardy delta
quaint mantle
raw prairie
#

I just had 2 donuts imma bust

quaint mantle
#

better then this for example xd

orchid gazelle
#

My personal preference tierlist:

  1. Java, SQL
  2. C#, Bash
  3. C++, JavaScript, PHP
    999999999 Kotlin, Lua, Python
tardy delta
#

is the bottom supposed to be low level or what

orchid gazelle
#

Build yours, my guys and tell me

quaint mantle
#

python on 4?

tardy delta
#

why are c++ and css together

orchid gazelle
quaint mantle
tardy delta
#

was the dude who made that drunk

quaint mantle
#

he probally learned html and called himself a hacker

orchid gazelle
tardy delta
#

HOLY C--

quaint mantle
#

python is nice from time to time but sadly way to slow

orchid gazelle
#

I hate python

#

I literally am mad when seing python

#

I saw too many python kiddies in my life, way more than java kiddies

quaint mantle
tardy delta
#

thanks for the secrets

quaint mantle
#

xD

orchid gazelle
#

Which copy-pasted some literal 2+2 python software and then called themself the biggest hackers and shot down any other dev that does not use python

tardy delta
#

can we also get the license key?

quaint mantle
quaint mantle
#

no joke,

orchid gazelle
#

Python devs made me so mad

#

They were literally in the bubble "python is best, everything else is shit, everyone not using it is shit, I am the best hacker coder reverse engineerer ever, python is gonna take over the world, were gonna write python libs for EVERYTHING". That destroyed it for me

#

I saw that too much

quaint mantle
#

yh i agree

orchid gazelle
#

I pressed on instagram once and NO JOKE LITERAL NO CAP NO OVERDRIVE this was at least every 4th post

#

And if something was about Java and how we can use Java in the future and I looked into the comments, I instantly saw "Nah Java shit Python best"

quaint mantle
#

well i gotta admid

#

admit

#

there is no other language that makes it this easy to make actual good looking guis

orchid gazelle
#

Then I went on discord, and some random copy-paste kids insulted me too much because I said that Python is not always the best option as someone asked for help what to use

quaint mantle
#

lets get back to java before admin bans me

orchid gazelle
#

you gotta admit, python kiddies are horrible

#

Its literally a sect

sour folio
#

Im really struggling with gui's, is there any basic ways to make it so players cant move round objects in a gui when the window is open?

orchid gazelle
#

You cannot really block mouse movements

#

Best you can do is spam reopens to reset the mouse position

lucid gazelle
#

How would i go about creating the particles in the video? like making them go up and down and up again?

public static List<Location> getHollowCube(final Location corner1, final Location corner2) {
        final List<Location> result = new ArrayList<Location>();
        final World world = corner1.getWorld();
        final double minX = Math.min(corner1.getX(), corner2.getX());
        final double minY = Math.min(corner1.getY(), corner2.getY());
        final double minZ = Math.min(corner1.getZ(), corner2.getZ());
        final double maxX = Math.max(corner1.getX(), corner2.getX());
        final double maxZ = Math.max(corner1.getZ(), corner2.getZ());
        for (double x = minX; x <= maxX; x += 0.1) {
            result.add(new Location(world, x, minY, minZ));
            result.add(new Location(world, x, minY, maxZ));
        }
        for (double z = minZ; z <= maxZ; z += 0.1) {
            result.add(new Location(world, minX, minY, z));
            result.add(new Location(world, maxX, minY, z));
        }
        return result;
    }```

```java
for (final Location location : GenUtils.getHollowCube(genBlock.getLocation().clone().add(-0.1, 0, -0.1), genBlock.getLocation().clone().add(1.1, 1.1, 1.1))) {
                genBlock.getWorld().spawnParticle(Particle.REDSTONE, location, 2, (Object) new Particle.DustOptions(Color.PURPLE, 1.0f));
            }
            for (final Location location : GenUtils.getHollowCube(genBlock.getLocation().clone().add(-0.1, 1, -0.1), genBlock.getLocation().clone().add(1.1, 1.1 + 1, 1.1))) {
                genBlock.getWorld().spawnParticle(Particle.REDSTONE, location, 2, (Object) new Particle.DustOptions(Color.PURPLE, 1.0f));
            }```

https://media.discordapp.net/attachments/1103643978194231326/1103777982423781567/gen_upgrgadgess_4.mp4
sour folio
#

like in other plugins

orchid gazelle
#

Ohh so you mean when you shift-click on an item in your inventory

#

Do you mean so it actually does not visually move or should it just not move in general

sour folio
remote swallow
orchid gazelle
#

And what you want to know is how to achieve it so that the block can not be taken out?

#

Thats done via events

sour folio
remote swallow
orchid gazelle
#

You listen to the Event, check if the inventory is the right inventory and cancel the event(Event#setCanceled(true)) if it is

#

I think it would be best for you to see an example here

remote swallow
#

extend the custom inventory class for my inv, and make instances of the manager

sour folio
#

ty

orchid gazelle
#

tbh I really should rewrite a lot of API I have written once

#

I actually identify by names lmao

echo basalt
#

mhm a bit too basic

orchid gazelle
#

What a bit too basic?

echo basalt
#

that inv lib

orchid gazelle
#

Ah ok

#

But also, I have a FailSafe-System for custom inventories

#

So if the plugin fails or the server fails in the wrong moment, it rolls back the player's inventory data

sour folio
wraith bane
#

I am uploading a paid resource, and while waiting for it to get approved I modified the plugin a bit (changed the material of one of the items)
Is there a way to edit the jar I uploaded on creation? I clicked on edit resource but it doesn't let me change the jar

echo basalt
#

manually doing pagination

#

my G you need more classes

remote swallow
#

pr it then

worn tundra
#

^ lmao

remote swallow
#

i should actually make that stuff though

orchid gazelle
#

The funny thing is

#

I got a shit-load of API in the one HUGE plugin im writing

#

Which exists only there

#

I may need it in a lot of other places in the future but its really nested

remote swallow
quaint mantle
#

anyone have experience with the world edit api

echo basalt
undone axleBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply. Make sure you use the right channel regarding the topic of your question. Create a thread in case the channel is already in use!

echo basalt
#

Worldedit is big enough that multiple people know how to use it here

quaint mantle
#

hi I have an issue, I'm starting creating APIs for my plugins, but when I try to import a basic API to my original plugin I get this error:
package com.donbaguette.testapi.api does not exist

I suppose this occurs when my API and my original plugin use the same package? Like com.donbaguette.

echo basalt
#

You need to like

#

add the api as as library on your build management system

#

like maven or gradle

quaint mantle
#

hmmm weird

#

I mean, I imported the api in the modules section

#

like: project settings > modules > dependencies

#

am I wrong?

tardy delta
#

are you using maven or gradle?

quaint mantle
#

maven

tardy delta
#

you should work with the pom.xml file instead

quaint mantle
#

some people told to use gradle but I'm more familiar with maven

quaint mantle
#

XD

echo basalt
#

personal preference

#

I prefer gradle myself

orchid gazelle
#

Maven > Gradle :)

quaint mantle
#

I never imported local files in maven

orchid gazelle
#

Its that simple

tardy delta
#

ill start counting the people will gradle problems

quaint mantle
orchid gazelle
#

Also, alex got a good maven-setup blog entry

tardy delta
#

well does that api you depend on have a maven repo?

#

you need a dependency block

quaint mantle
#

nope, I just created the jar file with really basic and testing features

#

or may I upload it in my github, test that and after remove it to do something more profesionnal?

tardy delta
#

jitpack is able to give you a dependency block for code that is on github but i thought there was a maven file scope?

echo basalt
#

scope system

remote swallow
#

system scope for jars

echo basalt
#

filepath

#

whatever

tardy delta
#

ye no clue i never use file scopes

orchid gazelle
#

Yeah see

#

Alex has great blogs for maven

tardy delta
#

oeh system scope :))

#

geol will bonk me

river oracle
#

SYSTEM SCOPE

#

where

#

where is the offense

quaint mantle
remote swallow
#

you dont have to

#

but if you want it accessable to everyone putting it on github so jitpack can access it may help

#

@echo basalt KEKW

quaint mantle
# remote swallow you dont have to

I mean, I was looking at the proper way and as I see by logic I would have to upload it in github? that's what it looks like in the output pom.xml

echo basalt
#

I made that with a whole 10 minutes of coding experience

remote swallow
orchid gazelle
#

And what about making the background normal again? Without darkening

sterile token
echo basalt
#

but since you've been looking too hard and missed the obvious

#

here's an example of a confirmation menu

remote swallow
#

oh cosmos has menus

sterile token
orchid gazelle
sterile token
orchid gazelle
sterile token
orchid gazelle
#

Ohh ok no worries

sterile token
#

Also sorry for always tagging you - haha

orchid gazelle
#

Im fine with that

fresh timber
#

alright

sterile token
#

Personally i wont get custom items checking by the name and/or lore, you should use NBT (in legacy cases) or PDC (on newers)

#

Thats the apropiate way for working with custom items

orchid gazelle
#

^

fresh timber
#

that seems like way too much trouble to do that

#

way easier to do names

sterile token
remote swallow
#

its easier but if you check names the items can be faked

orchid gazelle
#

And riskier

#

Yeah

fresh timber
#

and the appropriate way is just what mos tppl do

sterile token
#

Yeah so then you can duplicate thems

fresh timber
#

most ppl

#

also u cant change names of items as a player on my server

sterile token
echo basalt
#

I did the same with slimefun lmao

remote swallow
#

dont ever say slimefun again

echo basalt
#

?pdc

echo basalt
#

if you're below v1.14

quaint mantle
#

bro idk what I'm doing wrong but I'm still not able to use my local dependency

echo basalt
#

just

#

nbt-api

sterile token
echo basalt
#

just give it some tag

sterile token
#

NBT allow you to give custom tags to am item/block so then you can add a uuid property to it and make it unique the item

#

Thats what i used to do when coding on 1.8, i remebering to create a uuid property for the items (by creating a NBT tag) and save it statically as constant

orchid gazelle
#

(NBT Tags require some nms tho)

river oracle
#

Proof????

sterile token
#

Or atleast in my case i didnt use NMS for working with NBT, just a public api i found on github

orchid gazelle
#

I don't want to depend on apis so yeah

#

Only if really necessary

simple mica
#

i'm getting a no such method error when working with nms 1_19_R3. im not sure whats going on but does it have to do with the fact that my version is remapped?

remote swallow
sterile token
#

In my case github is working correct, i have just logged in and no problem

simple mica
remote swallow
#

in ur pom

orchid gazelle
#

Github is online for me

#

Wait a bit I guess

simple mica
# remote swallow in ur pom

not exactly sure what you mean by that, but here's a snippet of the pom file

    <dependencies>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot</artifactId>
            <version>1.19.4-R0.1-SNAPSHOT</version>
            <classifier>remapped-mojang</classifier>
            <scope>provided</scope>
        </dependency>
    </dependencies>
remote swallow
#

?nms follow this guide but update the verson to 1.19.4-R0.1-SNAPSHOT

simple mica
river oracle
#

are you using the right jar?

sterile token
#

can someone sent me the french thing, used for putting the code formation?

river oracle
#

??? lol

sterile token
remote swallow
sterile token
# river oracle ??? lol

the one used for formatting code, i dont know their correct name but they called "french something"

remote swallow
#

?codeblock

undone axleBOT
#

You can use the discord code block format to display code or just text in a more pleasing way:
```java
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {

}

}```
Becomes:

public class MyPlugin extends JavaPlugin {
    @Override
    public void onEnable() {

    }
}```
sterile token
#

ohh thanks!

remote swallow
#

do you mean backticks

sterile token
#

that yes, i didnt know the name in English

simple mica
#

was it supposed to be autocreated when i ran buildtools?

remote swallow
#

theres ur issue

sterile token
remote swallow
#

in ur pom add ```
<build>
<plugins>
<plugin>
<groupId>net.md-5</groupId>
<artifactId>specialsource-maven-plugin</artifactId>
<version>1.2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-obf</id>
<configuration>
<srgIn>org.spigotmc:minecraft-server:1.19.4-R0.1-SNAPSHOT:txt:maps-mojang</srgIn>
<reverse>true</reverse>
<remappedDependencies>org.spigotmc:spigot:1.19.4-R0.1-SNAPSHOT:jar:remapped-mojang</remappedDependencies>
<remappedArtifactAttached>true</remappedArtifactAttached>
<remappedClassifierName>remapped-obf</remappedClassifierName>
</configuration>
</execution>
<execution>
<phase>package</phase>
<goals>
<goal>remap</goal>
</goals>
<id>remap-spigot</id>
<configuration>
<inputFile>${project.build.directory}/${project.artifactId}-${project.version}-remapped-obf.jar</inputFile>
<srgIn>org.spigotmc:minecraft-server:1.19.4-R0.1-SNAPSHOT:csrg:maps-spigot</srgIn>
<remappedDependencies>org.spigotmc:spigot:1.19.4-R0.1-SNAPSHOT:jar:remapped-obf</remappedDependencies>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

river oracle
#

its on the same tilda key

#

idk wtf its called

remote swallow
#

~ thats a tilda

worldly ingot
#

`

#

that's a backtick

sterile token
#

yeah those, but arent called french quatations too?

worldly ingot
#

Quotations? I don't think so

#

Frech tend to use << >> for quotations

sterile token
#

oh right

echo basalt
#

you mean

#

« »

sterile token
#

I mean google once told me that those backstick are called french quatations marks too

onyx fjord
#

can i bypass async block placing limitation without nms?

echo basalt
#

uhm

#

reflect nms lol

onyx fjord
#

yeah...

worldly ingot
echo basalt
#

it's a key on my keyboard so

#

I also have § on my kboard

remote swallow
#

§

#

i have a keybind

echo basalt
#

since when are ]'s bound to altgr + ´

sterile token
#

One fast question, i read that LinkedList allow to get all the elements as they were put, meaning you can get the next element and the previous one?

quaint mantle
#

this nnot work

sterile token
undone axleBOT
#

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

quaint mantle
worldly ingot
#

Yeah, linked lists are doubly linked

echo basalt
#

A linked list is basically just a

sterile token
#

right perfect, because im planning to use it for paginating and i just realize i can simply use LInkedList instead of over engine it

echo basalt
#
public class Node<T> {

  private Node<T> previous;
  private Node<T> next;

  private T value;
  ...
}
tardy delta
#

implementing a linkedlist hmm

quaint mantle
#

how can i select key from primarykey ? in mysql i didnt find at google

echo basalt
#

Then because it's a deque

sterile token
tardy delta
#

always fun when i have to look at code in turkish, cmon man

sterile token
#

Also woudl be really thankful if you expand what you were meaning

quaint mantle
#

How can i make a circle that replaces every block that isnt air or mossy cobble stone with mossy cobble stone using world edit api

echo basalt
#
public class LinkedList<T> implements Deque<T>, List<T> {

  private Node<T> head;
  private Node<T> tail;
  
  private int size;

  @Override
  public T get(int index) {
     int halfSize = size / 2;

     if(index < halfSize) { // quicker fetch from head
        Node<T> target = head;
        
        for(int iteration = 0; iteration < index; iteration++) {
          target = target.getNext();
        }

        return target.getValue();
    }

    Node<T> target = tail;
    
    for(int iteration = 0; iteration < index; iteration++) {
      target = target.getPrevious();
    }

    return target.getValue();
  }

  @Override
  public void add(T value) {
    Node<T> node = new Node(tail, value, null);
    tail.setNext(node);
    tail = node;
    size++;
  }

  ...
#

That's pretty much how a linkedlist works

remote swallow
#

whats deque

echo basalt
#

it's a doubly linked queue

#

basically a queue that can traverse backwards

remote swallow
#

sus

tardy delta
#

uhh did you spent all that time to write how a linkedlist works?

echo basalt
#

yes

sterile token
#

oh right Imlussion i understand perfectly what you sent, really thanks man. More clarify that our Java teacher

echo basalt
#

It's literally just a chain of nodes where a node knows who's next and who's behind

#

This makes get(index) operations O(N) but add operations O(1)

tardy delta
#

i remember the time i implemented a linkedlist myself

sterile token
sterile token
#

oh right

#

So a node can be linked to many nodes

echo basalt
#

no

#

A node just knows what's next and what's behind

#

the node ahead just knows who's next and who's behind

#

etc

sterile token
#

oh right, so its not exactly what i mean probably

echo basalt
#

it's basically recursion

#

in a weird sense

sterile token
#

So i need linkedlist but connected with another implementation

echo basalt
#

You need a linkedlist of pages

sterile token
#

Because i need to do some sort of graph linking

#

Meaning to get the first, last and current node, but allowing to those node be linked to other nodes

echo basalt
#

wh

#

you mean keeping an index of what's the current node on your list?

#

a linkedlist already knows what's first and last

sterile token
#

no, wait i will translate it

#

So its better for you

tardy delta
#

but more performance based

#

linkedlist of linked lists uwu

sterile token
echo basalt
#

?xy

undone axleBOT
tardy delta
#

just point to the first node of the next set?

sterile token
#

I don't know how to explain it, because I need something like a LinkedList of LinkedList.

echo basalt
#

man wants a tree

tardy delta
#

feels like we are talking about a linkedlist of lists now

#

just make it one big linkedlist then ig

sterile token
#

In this way, doing first() will return the first node or the set of nodes (if any). Is this more clarify?

slim wigeon
echo basalt
#

oh god what the fuck

echo basalt
#

not just that

#

but also the lack of any oop

tardy delta
#

even worse than the turkish code i had to look at 5 mins ago

#

whats wrong with people not coding in english

echo basalt
#

mans just followed 7smile7's tutorial for guis and didn't learn anything from it

tardy delta
#

i already did that stuff

#

ah i thought you were talking about yourself

echo basalt
#

man knows about early return yet still nests

quaint mantle
#
private final MainClass plugin;

public LClass(MainClass plugin) {
  this.plugin = plugin;
}``` why we do this ?
remote swallow
#

so you can access your plugin instance

sterile token
echo basalt
#

Basically avoids static abuse

#

?di

undone axleBOT
echo basalt
#

Read more about it here

tardy delta
#

c# devs will embrace you

quaint mantle
#

thanks u guys

sterile token
echo basalt
#

yes but why

#

this feels like xy problem

fleet imp
#

The block-broken listener will run before a datapack loot table, right?

sterile token
echo basalt
sterile token
# echo basalt yes but why

To track all the menus, has has opened and go the previos menu, of the previos. But im not sure if have to use a LinkedList or that structure i sent

echo basalt
#

🤦

#

you want a linkedlist where you just append to the tail whenever you open a new menu

#

and remove from the tail whenever you close it

sterile token
#

oh right, so mainly the first option i thought haha. I over engine it too much haha

echo basalt
#

instead of a list of lists of lists of lists

echo basalt
slim wigeon
# echo basalt man knows about early return yet still nests

You talking about my code? If you talking about following the exect source code, its going to get on my nerves. I dealt with a poor support service on this website and least I want to do is bang my head. I don't want to unload on this channel but just help me to see why this is not operating as it should be

quaint mantle
echo basalt
#

hey look

quaint mantle
#

ive never ever used world edit api thats why im asking i dont even know what edit session is and where to get it from

echo basalt
#

An edit session is basically just a session of mass block changes

sterile token
echo basalt
#

you create an edit session, apply it and dispose the session

#

When you do //undo, you're undoing the last session

echo basalt
#

but yeah that's the idea

quaint mantle
echo basalt
#

Now, to create an edit session

slim wigeon
#

Also, I found what it was. That event.getCursor() and everything

quaint mantle
sterile token
#

Overall, really thanks i have almost an idea for base on what u have said

echo basalt
# slim wigeon You talking about my code? If you talking about following the exect source code,...

this feels like a poor attempt at a threat --

We're here to help with code. This is the discord server of a minecraft plugin platform and we're all just independent people doing our thing. None of us are paid (including the staff), and none of us are obliged to help anyone.

While we are independent and we all don't really give a fuck, we still have standards. In order to actually understand a problem, we expect the code quality of a project to be relative to the size of it. Extremely inconsistent and overall poor quality code is expected when someone is doing their first plugin and starting off with a command, but overall stepping into inventories and all of that should come with decent-quality code.

Talking about how you've had bad experiences on getting help or how you'd bang your head against the wall will not help you in any way, shape or form. Brain damage will likely only cause your code to get worse

quaint mantle
#

I got the point, but I would appreciate if you could help me understand.
Dependency injection
so this

#

wants to mainclass?

remote swallow
#

no that wants an instance

quaint mantle
#

why ?

remote swallow
#

because your plugin's instance holds all the data relating to ur plugin

quaint mantle
#

alright
if i don't do this injection
what happens?

#

expose my silly questions

echo basalt
#

Well

quaint mantle
#

I don't want to go by heart I want to understand the logic

remote swallow
#

you dont have access to ur main class params or config

echo basalt
#

You will eventually need access to your plugin's instance

#

For things like registering schedulers, getting configs or overall just communicating with other classes

quaint mantle
echo basalt
quaint mantle
#

aight thx

quaint mantle
#

alright

#

thanks guys

#

How would I have learned this without you?

echo basalt
#

Uhm

#

?learnjava

undone axleBOT
echo basalt
#

msot likely

#

or just experience

#

Beginners usually:

  • Lean towards static
  • Figure out that static bad
  • Lean towards singleton
  • Feel bad about using static
  • Learn about DI
  • Use DI
#

That's the process that many (including myself) have followed

quaint mantle
echo basalt
#

But you can skip so much hassle by just learning it right

#

(and just letting your brain develop before your plugins do)

#

which is something that 12 year old me refused to believe

quaint mantle
#

what is DI ?

sterile token
quaint mantle
#

where ?

#

oh

#

depenceny

#

injection

#

oke

echo basalt
#

DI stands for Dependency Injection

#

yeah

sterile token
#

I dont think you learn correctly

#

You must never touch libs, not knowing the basics. And singleton, DI and some other patterns are the most basic ones

quaint mantle
echo basalt
#

I already gave you a basic guide on DI

quaint mantle
#

i know

sterile token
echo basalt
#

p much

quaint mantle
# echo basalt p much

you gave me DI enjection guide from spigot but ur java learning sites have this guides ?

#

or basics ?

#

i even don't know DI is in java basics ?

sterile token
#

I mean you should learn things correctly

#

If you dont know how to cook, you cannot make a good cake. That why first you learn the basic of cooking and then yes, you make the best cake

#

But most people fail here, because most dont really know how to learn. And the correct way of learning - Including me, i have succed when i learnt how to learn

echo basalt
#

I'd just suggest learning the basics first

#

and you'll slowly get to all your answers

sterile token
quaint mantle
#

What is the difference between to learn java and being a professional?

slim wigeon
echo basalt
#

Not interested in following the argument

sterile token
echo basalt
#

You learn something every day

#

You can't expect to be an expert overnight

sterile token
#

I have seens profesional using 1h and 30m of they day, just to learn and learn new things. Thats how you improve, you have to really be focus

echo basalt
#

That's about my average daily coding time

quaint mantle
#

i will check my udemy course
i wonder he uses DI in example projects

#

i will back

simple mica
simple mica
sterile token
# echo basalt That's about my average daily coding time

Yes, I do exactly that. But it's starting to annoy me that people in general, get stuck on something so simple. Like learning the basics before going to the hard stuff. I know it sounds very illogical, but it is the society that has been created. They have no initiative at all, and that's why today there are no heads like Steve Jobs, Bill Gates and many others who have succceded.

echo basalt
#

wdym no steve jobs

#

you ever seen me?

sterile token
echo basalt
#

There are so many people that are skilled and have spent their entire lifes mastering their craft

#

It's just that Bill Gates and Steve Jobs had good timing, a good vision and had a decent execution

sterile token
#

That's my point tho, otherwise they would have learned and not even studied the problems of their society. They wouldnt have had the vision to make their inventions.

simple mica
#

?nms

split gull
#

Is there a way to run code when clicking on a text component?

#

Without the use of commands

young knoll
#

Use the PlayerCommandPreprocessEvent

sterile token
young knoll
#

Technically still a command, but you don't need to register one

split gull
#

mh

#

alr

fluid river
#

guys really need java lessons

#

just read the topic above

split gull
#

is there a way to disable console command output for specific instances (without changing the gamerule)

indigo frost
#

Hi so i am trying to code my own permissions plugin, and I have everything down, although the code I use to give players their permissions work, but only when I use it in a playerJoinEvent method. If I use it in any other way, the permissions do not update unless the player leaves and rejoins the server. How can I fix this?

echo basalt
# split gull Is there a way to run code when clicking on a text component?

ILLUSION SEARCH INDEX - Clickable Text Functions

Here's a short guide on how to assign actions to clickable text.

The problem: The only away to assign a click action to a text component is to use the RUN_COMMAND action, which makes the player run a specified command when clicking on the component.

The solution: Assign a unique parameter indicating an internal ID for an action to execute. We don't even need to use a registered command.

Implementation:
We'll use the Consumer interface. The interface has a single method (void accept(T element);) that is perfect for our use-case scenario.
Here's an example:

public class ClickableTextRegistry implements Listener { // Make sure to register this listener!

  private final Map<String, Consumer<Player>> functions = new HashMap<>();

  public String createCommand(String identifier, Consumer<Player> function) {
    functions.put(identifier, function);
    return "/" + idenfitier;
  }

  public String createCommand(Consumer<Player> function) {
    return createCommand(UUID.randomUUID().toString(), function);
  }

  // Feel free to make methods that accept runnables instead ..

  @EventHandler
  public void onCommand(PlayerCommandPreprocessEvent event) {
    String command = event.getMessage().substring(1); // Remove the first slash
    Player player = event.getPlayer();

    Consumer<Player> function = funcions.get(command); // change get to remove if you don't re-use identifiers, otherwise you end up with a memory leak. Fun!
    
    if(function == null) {
      return;
    }

    function.accept(player);
    event.setCancelled(true);
  }
}

Usage:

String command = createCommand(player -> {
  player.sendMessage("You clicked on the text!");
});

// assign it to whatever component you have..
worldly ingot
#

I.S.I.
I do wonder where you come up with such creative and intuitive names

echo basalt
#

NOO YOUVE RUINED MY IMMACULATEI NDEX

worldly ingot
#

o I fix

echo basalt
split gull
#

gawd damn

#

jeez, that was a long response

echo basalt
#

just replace it with a 0

worldly ingot
#

How's I.S.I?

pseudo hazel
#

ez

echo basalt
split gull
#

is Consumer supposed to be bukkit's or java's?

echo basalt
#

java's

split gull
#

kk

echo basalt
#

I'll pay you 20$ if you add a rule that allows me and only me to say I.S.I

worldly ingot
#

Well, you have both

echo basalt
#

both work but java's a bit more standard

worldly ingot
#

Bukkit has a Consumer type as well. Avoid it if you can though lol

#

It was added pre-Java 8

split gull
#

wait did you type this whole thing on discord???

echo basalt
#

yes

#

Choco

#

What do you think of this

split gull
#

jesus christ

worldly ingot
echo basalt
#

.,

echo basalt
#

I had to type it out twice because discord crashed

#

I made sure to type the second version on notepad++ though

indigo frost
#

Hi so i am trying to code my own permissions plugin, and I have everything down, although the code I use to give players their permissions work, but only when I use it in a playerJoinEvent method. If I use it in any other way, the permissions do not update unless the player leaves and rejoins the server. How can I fix this?

echo basalt
#

Player#recalculatePermissions

worldly ingot
#

Seems fine. A tad wordy and probably too complicated for a beginner (touching on memory is always awkward), but it's fine.

indigo frost
echo basalt
#

try and see

#

I literally just

river oracle
# echo basalt try and see

lol I do the same shit if someone asks questions on here I'll just do the classic

Player pl = null;
pl.permiss

and look lmao

indigo frost
#

let me try this

echo basalt
#

it's a big enough project that I have player instances eveyrwhere

sterile token
echo basalt
#

sometimes it leaves evidence though

remote swallow
#

i have auto optimize on

echo basalt
#

yes I'm aware that lombok is garbage

remote swallow
#

im very lazy

remote swallow
echo basalt
river oracle
remote swallow
#

lomnok is on unacceptable for new people

river oracle
#

even though its a dependency in every project

#

lol

remote swallow
#

if ur new and using lombok just leave, if your skilled and using lombok thats fine

echo basalt
#

fun fact I learned about lombok in a minecademy video

#

and I never used minecademy

remote swallow
#

i used lombok when i started and coll made me remove it

sterile token
#

who is alive?

echo basalt
#

nobody

indigo frost
#

it worked

#

lmao

#

im dying on the inside rn

split gull
#

cuz it tells me to make it static and that doesnt sound wise

#

structures i think

#

idk how to use structures sorry

tender shard
undone axleBOT
split gull
#

kk

#

so it basically stores the instance of that class somewhere else?

#

is that what this is?

#

oh i like this

#

this is very fancy

indigo frost
#

@echo basalt ok so i've run into another issue. When I remove a permissions, which I do by removing all permissions, updating the player's permission list then readding the new permissions, and then I run the method from before, it doesn't update the player's permissions unless they leave. What do you think is the issue?

visual laurel
#

why is this texture not working?

I have all the files for it so it should be,

Resource pack file tree

PluginPack
└───assets
└───minecraft
├───models
│ └───item
│ ├───popped_chorus_fruit.json
│ ├───t1upgrade.json
│ ├───t2upgrade.json
│ └───t3upgrade.json
└───textures
└───item
└───upgrades
├───tier1Upgrade.png
├───tier2Upgrade.png
└───tier3Upgrade.png

Content of popped_chorus_fruit.json:

{
    "parent": "item/generated",
    "textures": {
        "layer0": "item/popped_chorus_fruit"
    },
    "overrides": [
        { "predicate": { "custom_model_data": 1 }, "model": "item/t1upgrade" },
        { "predicate": { "custom_model_data": 2 }, "model": "item/t2upgrade" },
        { "predicate": { "custom_model_data": 3 }, "model": "item/t3upgrade" }
        
    ]
}```
young knoll
#

Check client logs for errors

visual laurel
#

👍

visual laurel
# young knoll Check client logs for errors
[00:44:27] [Worker-Main-11/WARN] [minecraft/ModelBakery]: Unable to load model: 'minecraft:item/t1upgrade' referenced from: minecraft:popped_chorus_fruit#inventory: java.io.FileNotFoundException: minecraft:models/item/t1upgrade.json
[00:44:27] [Worker-Main-11/WARN] [minecraft/ModelBakery]: Unable to load model: 'minecraft:item/t2upgrade' referenced from: minecraft:popped_chorus_fruit#inventory: java.io.FileNotFoundException: minecraft:models/item/t2upgrade.json```

I don't understand why this error is being thrown since that file exists.
covert shoal
#

Hello, is it possible to change the unit in placeholder %statistic_sprint_one_cm% from cm to m (meters)? In vanilla statistics walked distance is shown in meters.

hazy parrot
#

you would have to give more context

#

is it your plugin or what

covert shoal
#

I'm creating TOP STATISTICS in GUI (using DeluxeMenus plugin) and I want to make TOP Walked Distance with placeholder

hazy parrot
#

then just divide it by 100 ?

#

and you will get meters

covert shoal
#

but im not making plugin/script

#

i also use plugin ajLeaderboards to make top list from player-only placeholder like this %statistic_sprint_one_cm%

drowsy helm
covert shoal
#

its from spigotapi

drowsy helm
#

No it's a deluxe chat placeholder

#

spigot doesnt have placeholders

covert shoal
#

i mean statistics from Spigot-API

drowsy helm
#

we cant do anything for you

worldly ingot
#

Placeholders are strings. You can't do any arithmetic on them

drowsy helm
#

unless you make your own plugin to make a placeholder for meters, theres not much to be done

remote swallow
#

you can register ur own placeholders with papi and do the math for them

young knoll
#

I swear there was an addon that can somehow do math

worldly ingot
#

There is, but you can't do math on another placeholder

#

It evaluates expressions

covert shoal
#

Thank you all, sorry for wrong channel

#

have a nice day

young knoll
#

You can infact do math on another placeholder

#

@high fulcrum

#

Shite wrong ping

covert shoal
#

yea i just saw this plugin

drowsy helm
#

where does it say you can do it on other placeholders

remote swallow
drowsy helm
#

oh cool

young knoll
#

It uses EvalEx and not crunch though

#

0/10

visual laurel
#

How can i bypass the enchant limit?
Caused by: java.lang.IllegalArgumentException: Enchantment level is either too low or too high (given 7, bounds are 1 to 5)

compact haven
#

there’s methods for unsafe enchantments

#

either there’s a new method or a boolean, the method would read like addUnsafeEnchant

visual laurel
#

ah, found it thanks

compact haven
#

perfect, np

visual laurel
compact haven
#

why doesn’t it work

#

addUnsafeEnchant should definitely work

visual laurel
#

not sure, it just doesnt add the enchant

#
PickaxeMeta.addEnchant(Enchantment.DIG_SPEED, 7, true);```
this is what you have to do for unsafe enchants
young knoll
#

Ahh upper camel case

#

Also the other method should work fine provided you aren’t currently editing the ItemMeta yourself

#

Otherwise your changes will override it

idle yacht
#

how can I obtain a playerhead using uuid (I'm on 1.8)

#

using the uuid as name and getting the offline player through the uuid doesn't seem to work

young knoll
#

Getting the offline player should work

#

Provided it’s a valid player

idle yacht
#

i tried it but the head won't show

#

it works by command

#

and it works if i use my name for example

young knoll
#

1.8 moment ¯_(ツ)_/¯

idle yacht
#

i don't want to set up nms just for that

sterile token
idle yacht
#

it's a comission

sterile token
#

Well just accept newer versions probably, dont you think it ¿?

idle yacht
#

it's a commission, my client wants it to be on 1.8

sterile token
#

Sorry if sound rude, but 1.8 is too messy to work with. If you can get outside get it. I only accept 1.8 if its good money if not i reject it

#

I accept 1.8 in case of being +100 and up

idle yacht
#

good money and mc plugins don't go together anyway, at least for private customers

sterile token
#

Yeah, i consider if you wanna a legacy plugin you have to put money, if not you will never get it

#

Because most dev dont lost your time for a small piece of shity money

idle yacht
#

doesn't matter, otherwise i loose time doing nothing

sterile token
#

I just remember they were offering a simple Hypixel minigame for about $200/30 usd

#

When it doesnt even cost more than $100, but idk i dont tell anything and just accept if they offer me smth like that

#

😂

#

You have to be a rogue, because they pass you over the top. You have to take advantage of everything, since everyone takes advantage of everything and they do it dog-faced

compact haven
#

how much are you charging if I may ask delta ?

idle yacht
#

if it's an exclusive commission that's nothing, nobody is going to pay you real wage

#

like if i tell them I'll count my time and do a 14$/h rate nobody is going to accept

sterile token
compact haven
#

there’s people here who get like 25-35 eur an hour, which I consider pretty good

#

yeah bro you’re undervaluing yourself or you’re finding the wrong clients

#

I can get 20$ hr easily on commissions

sterile token
#

I mean the problem is that you take costs by hours of working, its not really like that in real market

idle yacht
#

right now I'm at like 6$ an hour or something

compact haven
#

💀

young knoll
#

Doesn’t Jeff charge like $100/h

compact haven
#

that’s the pain of flat rates tho

compact haven
#

Alex goes for like 75 eur an hour but idk how well that works for him

idle yacht
compact haven
#

that’s why you don’t work for casual people

#

you work for people who own a server and make thousands a month

idle yacht
#

I'm looking at mc market requests 😭

#

idk where else to look

compact haven
#

mm

hazy parrot
compact haven
#

his company is Jeff media but his name is Alex

#

idk why we calling him Jeff

#

@tender shard Jeff how are you

sterile token
compact haven
#

To be honest delta, I just get random messages here and there because I’m active in development discords

sterile token
#

I found them on helpch.at and some other discords

young knoll
#

I thought his name was Jeff but his discord was Alex

compact haven
#

put something related to Java development in your bio and speak here and in the BBB discord

young knoll
#

Idfk imma call him Steve

sterile token
#

isnt he caled Jeff ?

idle yacht
#

There's also alot of people expecting free work

sterile token
idle yacht
#

like especially in the german community, 99% is unpayed 💀

compact haven
#

@tender shard is German and he makes decent money on spigot

sterile token
compact haven
#

not to mention, you speak English and you’re doing an online job

#

who the hell cares about the German community pay rate 😭

#

as for where to start

#

make a few public plugins that are good

#

have a public support discord and offer commissions there

idle yacht
compact haven
#

Make it very clear your rate is xyz an hour before making a ticket, or you can do flat 25% above an hourly estimation

sterile token
#

You have to start doing good things free/open source which are cool and they dont exists. So them you can start popularity from there

idle yacht
#

i have one that i started recently

compact haven
#

it doesn’t even need to be open source to get the requests at first, but having a few decently sized projects open source is incredibly important to landing the commission tbh

young knoll
#

The problem with hourly

#

Is that it’s hard to charge half up front

compact haven
#

that’s true

idle yacht
#

i never did that

compact haven
#

bro wtf

#

you’re literally letting yourself get ran over

young knoll
#

You should

compact haven
#

like you’re laying on a train track and paying people to run you over

idle yacht
young knoll
#

That way you don’t get completely fucked if they vanish

sterile token
#

If u really wanna make money get out of Mc, and start learning Spring Boot. So far you must know plain Java and you can get amazing job oportunities as a springboot backend developer

idle yacht
young knoll
#

PayPal moment

idle yacht
#

yeah

young knoll
#

Idk what you do against that, killswitch I guess

static ingot
#

Anybody have a clue why I get this error when instantiating the ACF BukkitCommandManager?

java.lang.IllegalArgumentException: Material cannot be null```
#

Spigot 1.19.4

compact haven
#

it makes no sense that it’s calling that method from a constructor

#

are you sure it’s from that specifically?

static ingot
#

Yeah, it's what the stacktrace says.

#

sec

#

?paste

undone axleBOT
static ingot
#
at xyz.mauwh.dailyrewards.DailyRewards.onEnable(DailyRewards.java:10) ~[?:?]``` this part confirms that it is indeed a result of simply instantiating the command manager
compact haven
#

well shit it is from a constructor

#

that’s so odd

#

what’s in your plug-in config

#

there’s a getConfig in that stack trace

simple mica
#

where can i find the vanilla chunk generation code?

static ingot
split gull
#

when running a non existent command is there a way to not send the unknown command message?

compact haven
#

Can you send the code?

static ingot
#

¯_(ツ)_/¯

sterile token
#

?paste

undone axleBOT
compact haven
#

The relevant init invoke

static ingot
#
public class DailyRewards extends JavaPlugin {

    @Override
    public void onEnable() {
        BukkitCommandManager commandManager = new BukkitCommandManager(this);
        commandManager.registerCommand(new TestCommand());
    }

}```
#

like i said, lol

compact haven
#

that’s actually so scuffed lmao

#

let me check ACF source

#

what version depend

sterile token
static ingot
sterile token
static ingot
#

really?

#

no idea

compact haven
#

Isn’t it? I doubt that the current is major 0

#

I’d upgrade to latest lmfso

#

Nope version latest is 0.5.1

#

I’m yelling at Aikar that’s the dumbest thing I’ve seen

static ingot
#

lol

compact haven
#

A production library at major 0

idle yacht
sterile token
#

Not even talking its annoted too 💀 💀

compact haven
#

registerDependency(FileConfiguration.class, plugin.getConfig());
is the line

#

you are absolutely positive there is no config.yml in resources/ @static ingot ?

#

there has to be

static ingot
#

well. if only fools are positive, call me a genius rn

#

(actually tarded)

compact haven
#

lmao

static ingot
#

sorry to waste your time, lmao

compact haven
#

nope no worries

#

gl aha

static ingot
#

did help me figure it out at least

unique sable
#

How do I prevent a player from editing anything in the inventory?

        Inventory inv = Bukkit.createInventory(null,27, ChatColor.GOLD + "Auction Overview");
        Tools.itemFill(inv, Material.GRAY_STAINED_GLASS_PANE);
        inv.setItem(11,AuctionHouseGUI.mainAuctionHouse());
        inv.setItem(13,AuctionHouseGUI.myAuctions());
        inv.setItem(15,AuctionHouseGUI.createAuction());
        return inv;
    }```

This is the method that I am using to open and create the inventory

```    @EventHandler
    public void onInvClick(InventoryClickEvent event){
        if(event.getView().getTopInventory().equals(AuctionHouseManager.backendAuctionHouseInv())){
            event.setCancelled(true);
        }
    }```
And this is where I am trying to cancel the events, but it doesnt seem to work? Am I doing something wrong?
compact haven
#

because you're comparing their inventory with a new instance of it

#

pretty sure Inventory doesn't have any cool hash code equals, so you're just comparing memory add, which will never work with that code

unique sable
#

what can I use then?

compact haven
#

i don't know the latest method for checking whether the inventory in the event is correct, someone else will need to chime in

small holly
#

Hey so I am having some issues with setting skull owner, I checked the NBT data and all looks fine to me https://sourceb.in/AvFl0O3JC5
Here is the method for setting the head owner (also used for setting a custom texture if needed)

    private ItemStack getHead() {
        ItemStack head = new ItemStack(Material.SKULL_ITEM, this.Amount, (short)3);
        SkullMeta headMeta = (SkullMeta)head.getItemMeta();
        headMeta.setOwner(Skull_Owner == null ? "" : Skull_Owner);
        GameProfile profile = new GameProfile(UUID.fromString(this.Skull_UUID), Skull_Owner == null ? "" : Skull_Owner);
        if (Skull_Texture != null)
            profile.getProperties().put("textures", new Property("textures", this.Skull_Texture));
        try {
            Field profileField = headMeta.getClass().getDeclaredField("profile");
            profileField.setAccessible(true);
            profileField.set(headMeta, profile);
        } catch (IllegalArgumentException|NoSuchFieldException|SecurityException|IllegalAccessException error) {
            error.printStackTrace();
        }
        head.setItemMeta(headMeta);

        return head;
    }
young knoll
#

Compare instance or view

small holly
#

was working a moment ago

#

turns out my edit to that method broke the adding texture too

young knoll
#

What version

small holly
#

1.8 I think I see the issue lemme test

#

well I fixed the texture issue that I just noticed but ye its not setting the owner

#
    private ItemStack getHead() {
        ItemStack head = new ItemStack(Material.SKULL_ITEM, this.Amount, (short)3);
        SkullMeta headMeta = (SkullMeta)head.getItemMeta();
        if (Skull_Owner != null)
            headMeta.setOwner(Skull_Owner);
        GameProfile profile = new GameProfile(UUID.fromString(this.Skull_UUID), Skull_Owner == null ? "" : Skull_Owner);
        if (Skull_Texture != null)
            profile.getProperties().put("textures", new Property("textures", this.Skull_Texture));
        try {
            Field profileField = headMeta.getClass().getDeclaredField("profile");
            profileField.setAccessible(true);
            profileField.set(headMeta, profile);
        } catch (IllegalArgumentException|NoSuchFieldException|SecurityException|IllegalAccessException error) {
            error.printStackTrace();
        }
        head.setItemMeta(headMeta);

        return head;
    }

Updated code

small holly
unique sable
small holly
#

Solved it

#

was because I was setting the texture to ""

faint mantle
#

is there any documentation for bungeecoord's protocol? kinda like what wiki.vg does?

visual laurel
#

Why are these recipes not registering/working when using the items:

        NamespacedKey T1KeyTirFrostd = new NamespacedKey(this, "t0t1tirfrostd");
        NamespacedKey T2KeyTirFrostd = new NamespacedKey(this, "t1t2tirfrostd");
        NamespacedKey T3KeyTirFrostd = new NamespacedKey(this, "t2t3tirfrostd");
        NamespacedKey T1KeyTirFrostn = new NamespacedKey(this, "t0t1tirfrostn");
        NamespacedKey T2KeyTirFrostn = new NamespacedKey(this, "t1t2tirfrostn");
        NamespacedKey T3KeyTirFrostn = new NamespacedKey(this, "t2t3tirfrostn");
        RecipeChoice TirFrost0d = new RecipeChoice.ExactChoice(TirFrostItem(0, 1));
        RecipeChoice TirFrost1d = new RecipeChoice.ExactChoice(TirFrostItem(1, 1));
        RecipeChoice TirFrost2d = new RecipeChoice.ExactChoice(TirFrostItem(2, 1));
        RecipeChoice TirFrost0n = new RecipeChoice.ExactChoice(TirFrostItem(0, 2));
        RecipeChoice TirFrost1n = new RecipeChoice.ExactChoice(TirFrostItem(1, 2));
        RecipeChoice TirFrost2n = new RecipeChoice.ExactChoice(TirFrostItem(2, 2));
        Recipe upgradeT0T1TirFrostd = new SmithingRecipe(T1KeyTirFrostd, new ItemStack(TirFrostItem(1, 1)), TirFrost0d, T1Upgrade);
        Recipe upgradeT1T2TirFrostd = new SmithingRecipe(T2KeyTirFrostd, new ItemStack(TirFrostItem(2, 1)), TirFrost1d, T2Upgrade);
        Recipe upgradeT2T3TirFrostd = new SmithingRecipe(T3KeyTirFrostd, new ItemStack(TirFrostItem(3, 1)), TirFrost2d, T3Upgrade);
        Recipe upgradeT0T1TirFrostn = new SmithingRecipe(T1KeyTirFrostn, new ItemStack(TirFrostItem(1, 2)), TirFrost0n, T1Upgrade);
        Recipe upgradeT1T2TirFrostn = new SmithingRecipe(T2KeyTirFrostn, new ItemStack(TirFrostItem(2, 2)), TirFrost1n, T2Upgrade);
        Recipe upgradeT2T3TirFrostn = new SmithingRecipe(T3KeyTirFrostn, new ItemStack(TirFrostItem(3, 2)), TirFrost2n, T3Upgrade);
        getServer().addRecipe(upgradeT0T1TirFrostd);
        getServer().addRecipe(upgradeT1T2TirFrostd);
        getServer().addRecipe(upgradeT2T3TirFrostd);
        getServer().addRecipe(upgradeT0T1TirFrostn);
        getServer().addRecipe(upgradeT1T2TirFrostn);
        getServer().addRecipe(upgradeT2T3TirFrostn);```
echo basalt
#

ew what the fuck

#

weird naming conventions

faint mantle
#

anyone who uses numbers in variable names immediately looses all of my respect

wary topaz
#

if (label.equals(plugin.getMessageList("commands.gmc.aliases")) || label.equals("gmsp") || label.equals("gma") || label.equals("gms")) {

is thjis possible?

#

this*

#

The plugin.getMessageList gets a stringlist of a yamlconfiguration

echo basalt
#

no

#

there is a way to like

#

circumvent

#

well

#

proper terms are more like

#

getMessageList.contains

wary topaz
#

what im asking is if you can add aliases with yaml files

young knoll
#

Sure

#

If you use lists properly

wary topaz
#

so I can use label.equals(plugin.getMessageList

#

'equals' between objects of inconvertible types 'String' and 'List<String>'

#

List<String> aliases = plugin.getMessageList("commands.gmc.aliases");
boolean match = aliases.contains(label);
if (match) {

} else {

}

i'll tr this

#

if (plugin.getMessageList("commands.gmc.aliases").contains(label)) { works

small holly
#

Hey so I was trying to update an item on InventoryInteractEvent and I came across a dupe that I am not sure how to fix

    @EventHandler
    public void updateHead(InventoryClickEvent event) {

        Inventory inv = event.getClickedInventory();
        if (event.getSlotType() == InventoryType.SlotType.OUTSIDE || event.getCursor() == null || event.getCursor().getType() == Material.AIR)
            return;
        ItemStack item = event.getCursor();
        NBTItem nbtItem = new NBTItem(item);
        if (!nbtItem.getBoolean(NBTConsts.GLITCH_ITEM))
            return;

        if (!nbtItem.getBoolean(Consts.playerHead))
            return;
        
        inv.setItem(event.getSlot(), Heads.updateHeadWorth(item));

    }
echo basalt
#

looks like you'd want to cancel the event and set the cursor to null

#

just from rough experience

small holly
#

but then if I cancel the event they will not be able to move the item

echo basalt
#

you're already setting the item at the slot so

small holly
#

works fine with any other slot just not those ones

echo basalt
#

anything stopping you from just InventoryView#setCursor instead of setItem?

#

you'd need to account for shift clicking, sure

split gull
#

hey, im using this to block commands that start with that string but it's not blocking them:
this.getServer().getLogger().setFilter(record -> !record.getMessage().startsWith("/component-click-"));

#

why is that? am i doing it wrong?

echo basalt
#

change startsWith with a contains

wary topaz
#

uhhh

echo basalt
#

is my uhh

split gull
#

i've already tried that, same thing

#

but i can try again

echo basalt
#

print out the message

wary topaz
#

why not use the command executed event

echo basalt
#

he's trying to get rid of logs

split gull
#

command doesnt actually exist

echo basalt
#

but yeah you should cancel the event ngl

small holly
#

a duped one of the item

split gull
#

like this?

small holly
#

setting to canceled kinda works but I cant put it on the player head (not needed but still)

wary topaz
#

no when command executed event I think

echo basalt
wary topaz
#

@small holly InventoryClickEvent

split gull
#

do i print the filter or

small holly
wary topaz
#

PlayerClickEvent

small holly
#

public void updateHead(InventoryClickEvent event)

wary topaz
#

is there a api or something Im not seeing to Gamemode.getGamemode(String)?

echo basalt
#

valueOf

#

it's called an enum

wary topaz
#

dose it return null?

#

if its not

echo basalt
#

no it throws an exception

wary topaz
#

alr so surround with try

#

ty

split gull
#

did Bukkit.getLogger().info(this.getServer().getLogger().getFilter().toString()); and it didn't print anything

#

did you mean something else?

small holly
#

Sooo I know why now

#

its because armor slots

#
if (event.getSlotType() == InventoryType.SlotType.ARMOR) {
            ((Player) event.getWhoClicked()).getInventory().setHelmet(Heads.updateHeadWorth(item));
            return;
        }
#

was the fix

echo basalt
#

setFilter(message -> {
sout(message)
return whatever
});

#

type deal

split gull
#

ohh kk

#

didn't print anything

#
            Bukkit.getLogger().setFilter(message -> {
                System.out.println((message));
                return message.getMessage().startsWith("/component-click-");
            });```
#

this is very weird

#

when i did it the first time it worked

#

then it just stopped

echo basalt
#

lol recursion

young knoll
#

Check how ConsoleSpamFix implements it

indigo frost
#

Hi so I need help. I am making a permissions plugin and I had the issue where when a permissions was added, the player had to leave and rejoin for the permissions to become effective for them. This was then fixed using the player#recalculatePermissions() method. The issue I'm having now is removing the permissions and making the player unable to use them right away. My thought process was to remove all the player's permissions then readd the new ones but it doesn't seem to work unless the player leaves the game first. Please help me

echo basalt
#

recalculate again

#

@tardy delta you that dude that made the math parser thing, right?

indigo frost
#

didn't do anything

echo basalt
#

wait a tick idk what to tell you

#

permissions is one of those like 3 features that I haven't had to touch during the past 6 years

indigo frost
#

yeah I added the delay and it didn't work

#

im puzzled

fierce whale
#

How can I make armor stand follow player smoothly
I'm trying to make decoration(cosmetic) plugin.

drowsy helm
#

apply a velocity in the player's direction

fierce whale
fierce whale
#

entity.setVelocity(player.getLocation().getDirection());

small holly
#

Hey so this is more of a general question not really spigot related but I am wanting to add Mask effects for a plugin but I dont want the effects to be hard coded, is there some way I can add a folder of like MaskEffects in the plugin home folder and execute them in my plugin? preferably not needing to be compiled so they can be edited on the panel

slim wigeon
small holly
#

sorry if that makes little sense lol

drowsy helm
#

not just the player's direction

fierce whale
drowsy helm
small holly
#

preferably not something that needs compiling

#

but I mean that could be an option

drowsy helm
#

im not gonna spoonfeed you

drowsy helm
small holly
#

any idea how I would go about doing it?

#

just kinda want to be pointed in the right direction not yknow given the answer XD

small holly
drowsy helm
#

then iterate over each and parse

small holly
#

I kinda want it to be some sort of scripting language so the effects can be changed to do anything essentially

slim wigeon
drowsy helm
small holly
#

I mean an option of like expansion Jars would be useful

drowsy helm
#

unless you want to make your own interpreter or use like LUA or something

slim wigeon
small holly
drowsy helm
#

there are many ways we could interpret what you want to be a list

slim wigeon
#
        plugin.data.set(plugin.getSection(block)+".Filters.WhiteList",Arrays.asList(this.getWhiteList()));
        plugin.data.set(plugin.getSection(block)+".Filters.BlackList",Arrays.asList(this.getBlackList()));
        plugin.data.set(plugin.getSection(block)+".Filters.VoidList",Arrays.asList(this.getVoidList()));
        
        for(String key : this.getOptionBooleanKeys()) {
            plugin.data.set(plugin.getSection(block)+".Options."+key, this.getOptionBoolean(key));
        }
    }```
#
    WhiteList:
    - - !!org.bukkit.Material
        data: {}
    BlackList:
    - []
    VoidList:
    - - !!org.bukkit.Material
        data: &id003 {}
      - !!org.bukkit.Material
        data: *id003```
drowsy helm
#

okay i'm still not understanding what this is

#

you want a list of filters?

slim wigeon
#

!!org.bukkit.Material is breaking the whole config file and refuses data to load. It should have been VoidList: [OAK_WOOD, OAK_LOG]

drowsy helm
#

use the enum value of the material then

slim wigeon
#

If I need to convert Material to String, I can make that happen

drowsy helm
#

and the nyou have to manually parse it

slim wigeon
drowsy helm
#

what?

#

Material#matchMaterial

slim wigeon
#

I should be switching to EpicHopper if that is the case

#

Owned by Songoda

drowsy helm
#

'manually parse' doesn't mean you haveto have a switch for each type

#

manually meaning spigot doesn't automatically parse it for you

slim wigeon
#

Ok, so the config list type is for string only?

echo basalt
#

That's a weird way of saying it

#

More like

#

A user inputs a string list and you convert it to whatever internal form you're using

slim wigeon
#

There is no string input, everything is operated by GUIs

echo basalt
#

Stick to the basics first

slim wigeon
#

So this I seeing is what happens with normal Java its self?

echo basalt
#

If you're struggling to understand how an enum works then I suggest you take some time to learn the basics before making a gui-based plugin

#

This is not a problem with the programming language itself

drowsy helm
#

the

    - - !!org.bukkit.Material
        data: &id003 {}```
is how java is serializing the Material enum to a string
echo basalt
#

And enums are a feature in most OOP based languages

slim wigeon
#

I was thinking it was to do with spigot, don't mind me

timid berry
#

how do i compile this?

#

into a jar

#

ive tried ./buildsh

#

but i dont see the jar anywhere

eternal oxide
#

not spigot

timid berry
#

how do i compile it tho

eternal oxide
#

?fork

undone axleBOT
#

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

timid berry
#

ok

#

so no one here knows how to compile it

eternal oxide
#

?fork

undone axleBOT
#

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

slim wigeon
timid berry
small holly
wary topaz
slim wigeon
slim wigeon
wary topaz
#

haha

#

uh oh elgar is about to raost me

slim wigeon
#

Lets say a Game Community does not like me and I was thinking it was that url

eternal oxide
wary topaz
#

lmfao

#

"aliases"

#

ive invested so much time into just the gamemode part

eternal oxide
#

lol

wary topaz
#

cause it sucks

#

which also means I am not even a third of the way there

#

im like a penny

#

me go bed gn

slim wigeon
#

...