#help-development

1 messages · Page 1385 of 1

ornate heart
#

It may be the end one

near crypt
#

ok but why

ornate heart
#

because the method has e#getFrom so i'd imagine this method is called after they change

near crypt
#

yes could be true

ornate heart
#

I'd just try it out. See what happens. If that doesn't work, then you may need another method

drowsy helm
#

I was thinking of listening to the packet but that is EVERY message, and not just player messages, which isn't what I really want

#

and includes non global messages

ornate heart
#

Or you could use a BukkitRunnable to delay the checking of the world.

exotic oriole
#

i still have this error

deep wave
#

erm

earnest junco
# exotic oriole

It tells you where (Mysql.java line 43) and probably which error too, if you look all the way at the top.

deep wave
#

you're calling getConnection inside of getConnection

deep wave
#

can't be

tribal holly
#

obfuscation code...

cinder thistle
#

have fun

deep wave
#

if that's what line 43 is, that's not the code that is currently running in the JVM, try rebuilding

cinder thistle
#

try dming him first and asking

#

he might let you know

tribal holly
#

yep i'm going to there discord

crude charm
#

how tf is this too many

                    scoreboard.setTitle(Hub.mainColour + Hub.serverName);
                    line1.setMessage(Hub.ambientColour + "--------------------");
                    rank.setMessage(Hub.mainColour + "Rank: " + Hub.secondColour + Hub.rankPlaceholder(player));
                    onlinePlayers.setMessage(Hub.mainColour + "Online Players: " + Hub.secondColour + playerCount(player));
                    line2.setMessage(Hub.ambientColour + "--------------------");
                    scoreboard.finish();
                    scoreboard.display(player);
chrome beacon
#

It's too wide

crude charm
#

how can I make it not

#

too wide

#

the method returns smth short

quiet ice
#

Are you sure that the colors are not accounted for?

crude charm
#

is it the length of the name of the method

#

or the length of what the method returns

quiet ice
#

what?

crude charm
#

if a method is called

#

sdfgiohdguidgidsgh\

#

but returns

#

a

quiet ice
#

The client is only sent the string

crude charm
#

what one will matter

#

for the length

#

what it returns

#

or the name

quiet ice
#

If the client was to know the name of the method it would be a serious security concern

#

So no

crude charm
#

I dont think u understand

#

doesent matter

#

how can I fix this tho

quiet ice
#

Have you strings smaller

crude charm
#

the strings return like nothing

quiet ice
#

You sure "--------------------" is under 16 chars?

crude charm
#

idk

#

didnt count it

quiet ice
#

mind 2 chars might be taken by the color

crude charm
#

oh

#

then its over

#

WTF

#

why is it so little

#

like I cant do anything

#

with this lttle

#

just slashed both the ---------------

#

lines

#

and im still getting it

#

@quiet ice

quiet ice
#

Trying #length() ing all the strings

silent vigil
#

is there any way I could store data after restarts? lets say I want to save a string, how would I do that?

crude charm
#

store it

silent vigil
#

where?

crude charm
#

config

#

json

#

db

#

flatfile

silent vigil
#

which would be best for storing a lot of those strings?

crude charm
#

what exactly are u storing tho?

#

like player data

#

leaderboards

#

ect

#

that is db

silent vigil
#

well ints and strings

crude charm
#

like...

#

what do they refer to

quaint mantle
#

`can someone help me ? this code return player correct name but a totally wrong uuid. is there a better way to get uuid from an offline player (banned player on database) if (cmd.getName().equalsIgnoreCase("gunban") && player.hasPermission("geyseradmintools.gunban")) { String uname = args[0]; UUID target = Bukkit.getOfflinePlayer(uname).getUniqueId(); OfflinePlayer offplayer = Bukkit.getOfflinePlayer(target); System.out.println("this is the username: " + uname);

quiet ice
#

Just make sure you have Java 9+ though, Java 8 is aids for storing data

silent vigil
#

small descriptions of players, their discord and their rating (ex: 1/5, 2/5 and so on)

crude charm
#

db, flatfile or json

#

u choose

#

best is probs db

#

under a player data thing

silent vigil
#

smth like a mysql?

crude charm
#

mysql

#

mongo

#

one of those

silent vigil
#

ok

crude charm
#

probs sql tho

quiet ice
silent vigil
crude charm
#

np

quiet ice
#

DB is really overrated most of the time, I personally store everything to flatfile using bytebuffs and it works just fiine (until now)

silent vigil
#

ok

quaint mantle
#

this is my current code. im not that good with java and msql so its being a pain especially msql. i think is possible to check with query if player name is in db and use that uuid to delete

left swift
#

hello, i have method which place block next to the wall when i clicked on this noteblock wall, but I would like to do that if you click with a box or something like that, it will turn towards the gamer, like normal minecraft offers. My code:

    @EventHandler
    public void onRightClick(PlayerInteractEvent e) {
        if (e.getAction() == Action.RIGHT_CLICK_BLOCK) {
            if (e.getClickedBlock().getType() == Material.NOTE_BLOCK && e.getClickedBlock() != null) {
                e.setCancelled(true);
                Block b = e.getClickedBlock().getRelative(e.getBlockFace());
                if (b == null || b.getType() == Material.AIR) {
                    if (e.getPlayer().getItemInHand().getType().isBlock()) {
                        b.setType(e.getPlayer().getItemInHand().getType());
                    }
                }
            }
        }
    }```
crude charm
#

@quiet ice

quiet ice
#

What are the numbers?

crude charm
#

those

quiet ice
#

I know, but what is the right and left one?

crude charm
#

idk

#

oh

#

this

#
                    rank.setMessage(Hub.mainColour + "Rank: ".length() + Hub.secondColour + Hub.rankPlaceholder(player).length());
                    onlinePlayers.setMessage(Hub.mainColour + "Online Players: ".length() + Hub.secondColour + playerCount(player).length());
                    line2.setMessage(Hub.ambientColour + "-------------".length());
                    scoreboard.finish();
                    scoreboard.display(player);
#

see

#

yellow is first

#

white is second

#

might be easier to see

quiet ice
#

I guess you could make the online players and rank on a second line

#

Something like

key:
<value>

key2:
<value2>

I've seen a couple of servers do that, so unless you have many pairs it should be doable

crude charm
#

ill do that then

lost depot
#

guys, how do you typically name your config.yml keys? Like, is there a naming convention? Talking about "foo-bar: " vs "fooBar: " vs "foo_bar: " etc.

#

i know its not that important, just wondering

lost matrix
#

I either go for java code style so fooBarBaz or if its the first key FooBarBaz

quiet ice
#

all lowercase with dashes is my concention

lost matrix
#

But there is no convention

lost depot
#

hmm

lost matrix
lost depot
#

oh, good one

maiden briar
#

I am trying to get the UUID or name of a player async, but this will get me always null (if I ask the name, name = null, if I ask the UUID, UUID = null)

#

(line 106 / 126)

thorny orchid
#

Hey, I have a litle problem with my code :
I created a method that write some lines into the config file of the plugin.
And when i look at the config file i seed this :

cosmetics-data:
  827f8c48-cdb2-4105-af39-df5a64f93490:
    HATS: &id001 []
    BANDANAS: *id001

And there is my code :

public void addNewPlayer(Player player) {
        List<String> blankCosmeticList = new ArrayList<String>();
        System.out.println(blankCosmeticList);
        for(CosmeticType cosmeticType : CosmeticType.values()) {
            config.set("cosmetics-data." + player.getUniqueId().toString() + "." + cosmeticType, blankCosmeticList);
        }
        main.saveConfig();
        return;
    }
maiden briar
#

You can't set an full class in config, only (lists of) strings, ints and longs

eternal oxide
#

all other classes have to implement ConfigurationSerializable

thorny orchid
#

@maiden briar I dont understand... I am french and i dont understand everything lmao

maiden briar
#

Ask Elgar he is more clear

thorny orchid
#

Ok

#

@eternal oxide Can you explain to me because i don't understand what you mean

thorny orchid
#

Where I need to do that ?

eternal oxide
#

In any class you want to store in your config

thorny orchid
#

Because in my other plugin i made the same thing and it worked as expected

#

and it does not put *id001 in the config file before, and when i replace in my method the list by a classic string like "test" it works perfectly

eternal oxide
#

yes, primitives are serializable. Complex objects are not

#

@thorny orchid You have to implement the ConfigurationSerializable Interface in any complex object you want to store

thorny orchid
#

Ok but why it's working without in my other plugin, as i store list (of string) the same way ?

opal juniper
#

If I have a resource pack link, how do I generate the correct sha1 for it?

thorny orchid
eternal oxide
#

Make sure your serialized Byte[] has contents

thorny orchid
#

@opal juniper i'm not sure, but if you don't have one you are not forced to type the sha1

eternal oxide
#

You tried to implement Javas Serialiable

thorny orchid
eternal oxide
#

there shoudl be an sha1 method shaded in Spigot

sharp bough
#

how is chance called ? i need to have a 50% chance of something happening, if that doesn happen then you have a 30% of one thing and 20% of the other 2, and then a 10% 10% of the last two things happening

eternal oxide
sharp bough
#

yea but how is it called?

#

i can only find random()

sharp bough
#

and use that to get a % chance of something happening

#

like 50 50

maiden briar
#

If I want to get content from the web async, I really can't return any value

eternal oxide
#

you use a Consumer to pass data back

eternal oxide
maiden briar
#

No it is working, I have printed both taskresults, and they al printed the correct uuid value (

@Override
public void done(TaskResult<String> result)
{
  name = result.getValue();
  System.out.println(name);
}
```)
thorny orchid
#

@eternal oxide I implemented ConfigurationSerializable but what should I do now with the serialize method ?

maiden briar
#

The left side is the name in your config, the right side is the value

eternal oxide
thorny orchid
#

ok I think i understand

maiden briar
#

Getting values async is impossible! Who knows the solution?

eternal oxide
maiden briar
#

At the 'getName' or 'getUUID' method

#

So after 'done' I set the field, but constantly get null if I get the field

maiden briar
maiden briar
#

I printed 'uuid' and 'result.getValue()' and noticed that 'uuid' is printed (null) before 'result.getValue()'

#

@eternal oxide ?

eternal oxide
#

no stack trace?

maiden briar
#

Nope, I printed everything out

torn jewel
#

if i am making a plugin with multiple storage methods what are the main ones that people us

maiden briar
eternal oxide
#

But when you debug in your done method the value returned is nuill

maiden briar
#

I will add comments to explain, a moment

floral flare
#

How can i make HashMap work with MySQL?

thorny orchid
#

@eternal oxide I just understand what's ConfigurationSerializable is, but it's not what i want to do with my configuration file.

I want to get all the content of my list<String> and put it into my config.yml

like this :

List<String> blankList = new ArrayList<String>();
blankList.add("foo");
blankList.add("bar");

config.set("something.test", blankList);

And the output :

something:
  test:
    - foo
    - bar
eternal oxide
#

Then your Json Parse is returnign null. Either the content you get from yoru URL is not as you expect or you are parsing it incorrectly

lilac dagger
#

you'll deserilize it

#

you can't just put a hashmap in a mysql

young knoll
floral flare
maiden briar
eternal oxide
#

to get it back you getConfig().getStringList("something.test")

thorny orchid
eternal oxide
#

Show me yoru code again

#

?paste

queen dragonBOT
thorny orchid
#

i see &id001 idk why

eternal oxide
#

thats an object ID, which means its not "just a List<String>"

thorny orchid
maiden briar
#

No, because the for was with Class class : classes (No String)

maiden briar
eternal oxide
#

well

#

it is

thorny orchid
#

yes it is lmao

#

that's why a don't understand

#

it should work

eternal oxide
#

Yes, it looks like it should work

thorny orchid
#

And when i put a string it works perfectly i dont know what goes wrong, obv after i make a litle System.out.println and a see a normal blank list lmao []

maiden briar
#

Why don't you use in your for loop new ArrayList<String>

eternal night
#

Or just toArray the list before saving

eternal oxide
#

If it were me I'd not add the node if the list is empty

thorny orchid
maiden briar
#

Good idea

thorny orchid
#

i'm going to save everytime the loop do a loop also

#

well

#

that's working lmao

#

i don't understand, it's the same fu*** code

#

thanks to everyone lmao

#

btw, do you know how to make the server "believe" that this is the first time you have joined the server? What file should i delete ?

modern fox
#

?paste

queen dragonBOT
modern fox
maiden briar
quaint mantle
#

im still getting null CommandException any reason why target == null aint working ?

modern fox
#

try Bukkit.getPlayerExact(args[0]);

quiet ice
#

target == null is useless

eternal oxide
quaint mantle
#

makes sense sike

quiet ice
#

Also, try using Java 15+, it has better NPE messages

quaint mantle
#

true x)

lunar wigeon
#

fake packets?

eternal oxide
exotic plaza
#

what is the event of on attack and what is the event of on get damage?

worn tundra
#

EntityDamageByEntityEvent

exotic plaza
#

thx

eternal oxide
#

because the UUID objects will be identical but they will not be the same object. == will return false in that instance

proper notch
#

They mean why not UUID#equals

eternal oxide
#

oh you are saying why not use the equals method

#

You could use equals

#

or compareTo, just not ==

rotund ravine
#

I mean compareTo would return an int

#

He might find that weird

eternal oxide
#

True

mortal hare
#

This is resource pack with remodelled totem effect

tribal holly
mortal hare
#

and yeah

#

im gonna make content just like this on my server

#

im really hyped to provide modded vanilla experience for players which they've never seen in my national minecraft server market

bright jasper
#

That is ALL vanilla

#

asked how it works, supposedly its an image generated on the server based on state and updated on click/event, sent back to the user too but its a whole ass gui

eternal oxide
#

so maps

bright jasper
#

Yeah it just looks really cool though, that was the most eye catching thing though

#

He has a whole energy system and stuff too

mortal hare
#

honestly resource packs nowadays are powerful enough to replace most of the medium complexity content mods

eternal oxide
#

yeah you could probably do that using a canvas and swing, or something simpler.

mortal hare
#

there's image API in java

#

you can draw images there too

#

question is how much computer power does it need to handle vast majority of players

#

to render the GUI for them

bright jasper
#

I mean supposedly he does it all async, it has a threadpool and tries to process tasks like that

#

updates and such

eternal oxide
#

probably not much, you are only copying a canvas, relaying clicks and updating changes

bright jasper
#

screen only updates on click or on requested event

#

So I dont think its that heavy

mortal hare
#

probs uses raycast to detect which place of map was clicked

#

heck you could recreate computercraft mod with this

bright jasper
#

Would it be that difficult? afaik CC does this anyway

#

just send the canvas and process events differently

eternal oxide
#

Converting to a map canvas isn;t that easy btu there is probably an api for that

wide galleon
#

this doesnt work for some reason java public void onEnderDragonDeath(EntityDeathEvent event){ if(event.getEntityType().equals(EntityType.ENDER_DRAGON)){ Bukkit.broadcastMessage(" "); Bukkit.broadcastMessage(" "); Bukkit.broadcastMessage("§8» §aThe Challenge has been completed §2§lsuccessfully§a."); Bukkit.broadcastMessage("§8» §7The §2§lEnderdragon §7has died."); Bukkit.broadcastMessage("§8» §e§oReset the World with§r §6/reset §e§o."); Bukkit.broadcastMessage("§8» §6The seed was §e" + Bukkit.getWorlds().get(0).getSeed()); Bukkit.broadcastMessage("§8» §6Time: §e" + Main.shortInteger(timer.getTime())); Bukkit.broadcastMessage(" "); Bukkit.broadcastMessage(" "); } }

mortal hare
#

lost connection: Internal Exception: java.lang.IllegalStateException: PlayerDropItemEvent may only be triggered synchronously. Anyone know how to fix this? Im setting item data through netty channel handler, ik its async, but for some reason while dragging it throws this shit. Even if i discard packet it still does this.

#

maybe because of .equals() ? Enums are singletons so you can do ==

modern fox
mortal hare
#

im not sure actually

rotund ravine
modern fox
#

okay

eternal oxide
mortal hare
#

ik

rotund ravine
#

Async

mortal hare
#

but i can't see why

rotund ravine
#

The packet triggers the event

mortal hare
#

it wouldn't work

eternal oxide
#

Because its not permitted

mortal hare
#

but i discard the packet

wide galleon
mortal hare
#

i discard the packet after it was catched by that handler

rotund ravine
#

Spawn a new sync task to drop stuff

mortal hare
#

via netty

#

im not dropping anything

#

at all

#

that's the thing

rotund ravine
#

🤷🏼‍♂️

#

Show code i suppose

mortal hare
#

im trying to build Packet GUI

#

everything works

#

i synced the inventory with the server

#

but dragging vomits this error

#

i guess i fixed it actually

#

packet's slot got sent with -999 while dragging

#

which cause setting of item method be confused

#

that im dropping it or smth like that

sand frost
#

Small question. What is the "Mot" (Vec3D) of an entity? What does this defines and what is it used for?

eternal night
#

represents the velocity of the entity

#

it holds the same values as spigots Entity#getVelocity

sand frost
#

So its used for moving an entity?

smoky finch
#

Is it possible to disable gravity for plants so they can stay where they were placed even if the block underneath them is missing?

quaint mantle
#

No

#

Not gravity, but block updates

#

If they receive block updates, they will get broken. You will need to make sure they don't receive block updates

smoky finch
sharp bough
#

so

file.addDefault("cooldown", 0);

        file.options().copyDefaults(true);

        saveConfig();

will create a default "cooldown", but if i edit it while the server is running, and reload the server the cooldown will be what i just set it to, but if i stop the server and start it back up, would the cooldown go back to 0 because of the saveConfig() or remain what i set it to?

#

To load the default configuration file to your plugin's folder, the following code must be added to your onEnable():

#

saveDefaultConfig()

quaint mantle
#

make your config, it should already be in your resources folder, then add all the stuff you want inside

#

then call saveDefaultConfig when your plugin enables, and that's it

sharp bough
#

and if i edit it while the server is running, save it and reload the server the new data will be used

#

right?

#

and when i start the server the new data wont be erased

#

or replaced with the old one

quaint mantle
#

yea

charred thorn
#

hey guys

#

I am making gambling crash plugin

#

gambling plugin

#

crash that is seen on roobet and other gambling sites

#

I need help with making algorithm for it

onyx shale
#

I am making crash plugin never have i seen a faster reputation loss in my life

charred thorn
#

bruh

#

it's gambling

onyx shale
#

word it different

charred thorn
#

done

onyx shale
#

its rly sounding like a malicious plugin

charred thorn
#

alr

onyx shale
#

good

charred thorn
#

if you can help me

#

help me

#

If not

#

Go away

onyx shale
#

lmao

charred thorn
#

You are wasting my time @onyx shale

#

hey guys
I am making gambling crash plugin
gambling plugin
crash that is seen on roobet and other gambling sites
I need help with making algorithm for it

onyx shale
#

yet hes still typing deciding to somehow waste his time,wut

cinder thistle
#

@charred thorn why u bein a dick

#

we're not obligated to help you

eternal oxide
#

NO idea what a "crash" is

cinder thistle
#

being a dick makes us just wanna not help u

charred thorn
#

@eternal oxide have you heard for roobet?

eternal oxide
#

no

charred thorn
#

basically it's gambling site

#

and

#

you will enter amount you want to gamble

#

For example $100

#

and there will be multiplier going up every second

#

1.1x

#

1.2x 1.3x 1.4x 1.5x

#

It will go up until it crashes

cinder thistle
#

o

charred thorn
#

when it crashes you lose your money

cinder thistle
#

essentially u pull out before you lose it all

charred thorn
#

yes

#

exactly

eternal oxide
#

Why would everyone not just gameble at 1.1?

#

guaranteed win

charred thorn
#

nah

cinder thistle
#

because ppl are risky

onyx shale
#

i mean isnt that just a simple random chance to crash? like not rly an algorithm needed

cinder thistle
#

^

onyx shale
#

sometimes it may crash instantly sometimes after hours

cinder thistle
#

just center it around a range so it doesn't instantly crash

charred thorn
#

Yep but I aint got any experience with something like this

#

How could I write this?

eternal oxide
#

yeah, just use java random to generate a random int of when its going to crash

cinder thistle
onyx shale
cinder thistle
#

lol

charred thorn
#

I still don't know honestly

cinder thistle
#

then you need to learn java basics

charred thorn
#

Ik java basics

#

dw ab that

onyx shale
#

use the links above but with ur own numbers ex,every 2 minutes check a random chance,if its lower than 5(out of 100) crash

#

from there you can go as complex as you want with minimums and maximums crash chances

#

eq for 1.6x crash chance starts at 20

wide galleon
#

How do I detect if the player got xp?

onyx shale
#

hmm not sure you can go as deep as experience,seems spigot only has a event for levels

cinder thistle
#

my man had that jd ready

onyx shale
#

its on fast history as i used it alot in the past

untold kernel
#

I use paper jd 😂

onyx shale
#

same stuff beside theyr custom things

untold kernel
#

Ya

#

But search works

#

Lol

charred thorn
#

Should this work?

#

if (CrashGambling.getInstance().getConfig().getBoolean("neon") &&
neon) {
int neonmath = (int)(Math.random() * 1.0D + 0.0D);
if (neonmath == 0) {
crash = Math.random() * 90.0D + 10.0D;
crash = Math.round(crash * 100.0D) / 100.0D;
return crash;
}
crash = Math.random() * 4.98D + 3.01D;
crash = Math.round(crash * 100.0D) / 100.0D;
return crash;
}
crash = Math.random() * (top - 1.0D) + 1.0D;
crash = Math.round(crash * 100.0D) / 100.0D;
return crash;
}
}

cinder thistle
#

?paste

queen dragonBOT
cinder thistle
#

also whyare you adding 0 lmao

charred thorn
#

idk lol

#

accidently

#

Does this work

cinder thistle
onyx shale
#

is that a random multiplied by a double then casted to a int wut

#

also you never specify the range of the random

final fog
#
player.getWorld().spawnParticle(Particle.SOUL_FIRE_FLAME, player.getLocation(), 5, 1, 1, 1);``` Is there a way I can decrease the speed of these particles so they aren't super fast, just more slow.
charred thorn
onyx shale
#

ur using the wrong random

#

Random.nextInt(100) will return a random number between 0 and 99,you can offset if you dont want 0 and do +1 after

charred thorn
#

Hmm

onyx shale
#

so... Random random = new Random();

glass sparrow
#

why cant you get a random number and increase the current amount until it hits that number and then crashes?

#

that would be v simple

onyx shale
#

both work

charred thorn
#

So you think like I do Random.nextInt(5.5)

#

and then I make for loop

glass sparrow
#

not an int value

charred thorn
#

and increase it until it hitps that value

#

Ye ye

#

Mb

glass sparrow
#

then yeah you could

main dew
#

How fast place block in version 1.12.2?

glass sparrow
#

dont have much control over it that way

#

but its simple

onyx shale
#

dang now i want to recode a casino plugin

glass sparrow
#

do it make some fun games

onyx shale
#

have 4 kind of games on the last one

charred thorn
#

do yall sell premium resources?

onyx shale
#

a slot machine(inventory based),a roulette,a simple coin flip and a dice

#

not bothering selling any,i alrdy have a full job with uni beside,cant be bothered to offer 24/7 support

charred thorn
#

Oh

#

I thought mostly kids were here

#

lol

onyx shale
#

mostly are retired spigot devs

#

who kinda got a job in coding so they just stick around from time to time

charred thorn
#

what you do irl?

#

developer?

onyx shale
#

~70% are devs full time

#

as everyone else yeah

untold kernel
charred thorn
#

how old r u

untold kernel
#

I would say 50% kids

untold kernel
charred thorn
#

yep

#

im 14

untold kernel
#

Lollll

charred thorn
#

what xd

#

@onyx shale do you have some time to help me more

main dew
young knoll
#

Well those are for 1.14

#

You'll have to convert all the NMS stuff to 1.12 methods and names

main dew
#

hmm

#

I change v1_14_R1 to v1_12_R1

young knoll
#

Not that simple

#

Obfuscation names have likely changed

main dew
#

Obfuscation names?

young knoll
main dew
#

maybe you know how I should change?

young knoll
#

I don't use 1.12

cold field
quiet ice
#
Angle     1     A rotation angle in steps of 1/256 of a full turn     Whether or not this is signed does not matter, since the resulting angles are the same. 

Literally the first mention of "Angle" on the site

cold field
#

Oh i didn't look for it xD

sharp bough
#

what am i missign here? cant find it in the docs

quiet ice
#

Did you try assigning it from your plugin?

#

There are multiple issues here

sharp bough
quiet ice
#
  1. You have a field that should be final
  2. You leave a field undeclared
  3. You shadow a field
  4. You use an undeclared field in the implicit constructor by doing plugin.getConfig()
quiet ice
#

It's not even wrong, it's just not working

quiet ice
#

But I recommend to use Dependency Injection (which you appear to do)

#
protected StarFight(JavaPlugin pluginInstance) {
    plugin = pluginInstance;
}

Add this

#

Then instead of doing new StarFight() you can do new StarFight(this) (provided you do that in your plugin main)

quiet ice
#

that is the constructor

sharp bough
#

no nvm i can google that

dim chasm
quiet ice
#

it's the tradtional method

dim chasm
#

Guice is 3 mb and i'm not sure it's that worth it 🤔

quiet ice
#

Don't do automated DI

wide galleon
#

How can I list everything in my config that has the definition true?

dim chasm
quiet ice
#

Automated dependency injection is only good if you are doing API at a scale of bukkit without having to worry what the Constructor is

dim chasm
dim chasm
quiet ice
#

That's passing the reference through the constructor

#

I call it dependency injection because everyone else calls it like that

quiet ice
#

yeah

wide galleon
dim chasm
dim chasm
quiet ice
#

Well, as far as I know "passing the reference through the constructor" does not have a really proper name, so I just stick with dependency injection until I find a better word for it

proven sierra
#

that is dependency injection

#

not a mistake

quiet ice
#

Issue is that the human factor can lead to people thinking that it is automated with tools such as guice

lost matrix
#

I was also confused by that when i worked with CDI frameworks for the first time. But dependency injection is both a design pattern and a container framework tool. Similar because CDI basically enforces the dependency injection pattern, but not the same.
It all comes down to how the "injection" is done.

#

Btw constructor injection > field/method injection

left swift
#

How can I check if player is facing up or down and have BlockFace returned to me?
I tried this:

BlockFace f = p.getFacing();```But this return anything other than north, east, west, south
novel lodge
#

How can I get the head height of a player

lost matrix
novel lodge
#

ok

#

ty

fallow geode
#

@left swift maybe use pitch?

lost matrix
lost matrix
#

I think 45 is a bit early for calling it up or down. But that arbitrary.

lost matrix
# left swift 50? not 45?
  public BlockFace getExactFacing(final Player player) {
    final float pitch = player.getEyeLocation().getPitch();
    if (pitch > 50F) {
      return BlockFace.DOWN;
    } else if (pitch < -50F) {
      return BlockFace.UP;
    }
    return player.getFacing();
  }
mortal hare
#

how can i check itemstack's equality? equals seems to not work. I want to check if the itemstack would be stackable with item in cursor?

young knoll
#

Use isSimilar

young knoll
#

It ignores stack size

lost matrix
#

-.-

mortal hare
#

why they don't override equals tho?

young knoll
#

They do

#

But it compares stack size

mortal hare
#

oh

hardy lagoon
#

If I took the block underneath the player, how would I loop through all blocks next to it?

lost matrix
hardy lagoon
#

Cheers

novel lodge
#

How can I make custom armor

young knoll
#

Dyed leather usually

lost matrix
young knoll
#

You can't change the armor model without optifine

novel lodge
lost matrix
novel lodge
#

ok

topaz cape
#
    public ItemStack setItem() {
        ItemStack i = new ItemStack(Material.SKULL_ITEM, 1, (byte)3);
        SkullMeta meta = (SkullMeta) i.getItemMeta();
        assert meta != null;
        
        meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&6Golden Head"));
        StringBuilder surl = new StringBuilder();
        surl.append(url);
        GameProfile profile = new GameProfile(UUID.randomUUID(), null);
        byte[] data = Base64.getEncoder().encode(String.format("{textures:SKIN:{url:\"&s\"}}}", surl.toString()).getBytes());
        profile.getProperties().put("textures", new Property("textures", new String(data)));
        try {
            Field f = meta.getClass().getDeclaredField("profile");
            f.setAccessible(true);
            try {
                f.set(meta, profile);
            } catch (IllegalArgumentException e) {
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                e.printStackTrace();
            }
            
        } catch (NoSuchFieldException e) {
            e.printStackTrace();
        } catch (SecurityException e) {
            e.printStackTrace();
        }
        
        i.setItemMeta(meta);
        return i;
    }```
#

this throws null point exception

#

what did i do wrong

young knoll
#

Show the exception

quiet ice
#

Use Java 15+

topaz cape
young knoll
#

What is line 48

quiet ice
#

The JVM will tell you directly what is null

topaz cape
quaint mantle
#

should i save things like sethome locations and balance (economy) in files or in database?

topaz cape
#

to put it in a hashmap

lost matrix
quiet ice
#

<ignore>

drifting halo
quaint mantle
drifting halo
#

then use whatever, db is faster than IO but IO is faster to program

lost matrix
topaz cape
young knoll
#

I don't see setItem in there at all

lost matrix
quiet ice
#

I'd just store it in flatfile that I load into memory at runtime

topaz cape
#

    
    String url = "https://textures.minecraft.net/texture/3bb612eb495ede2c5ca5178d2d1ecf1ca5a255d25dfc3c254bc47f6848791d8";

    private ItemStack goldenHead = setItem();
    
    public ItemStack getItem() {
        return goldenHead;
    }```
quiet ice
#

Yeah, the setItem is really not relevant to your case

lost matrix
drifting halo
#

depends on the medium they're on i suppose

quiet ice
#

Java performs methods eagerly

drifting halo
#

but yeah, if you're expecting lots of reads/writes go with a db, since it does indeed scale better

quiet ice
#

So the setItem() is invoked way before you invoke your getItem call

topaz cape
#

oh i understand

lost matrix
topaz cape
#

i think i can fix it

#

ty ❤️

sand vector
#
            for(int i = 0; i < plugin.getResources().CustomItemDatas().getConfigurationSection("Ranks." + r + ".itemNames").getKeys(false).size(); ++i){ 
        String name = (String) plugin.getResources().CustomItemDatas().get("Ranks." + r + ".itemNames." + i );

            if (CustomItems.spawnCustomItems()[i].getItemMeta().getDisplayName().equals(name)) {

                System.out.print(CustomItems.spawnCustomItems()[i]);
                
                player.getInventory().addItem(CustomItems.spawnCustomItems()[i]);

            }
            
            }
        }

This is how I add an item to the players inventory, CustomItems.spawnCustomItems()[i] Is the array holding all the items, name item wanting to be given to the player. The system print.out gives the itemStack but the item is never added to the inventory. Why is this happening?

drifting halo
#

well if you do flatfile and load it into memory its also cached

lost matrix
#

Caffeine 😄

drifting halo
#

please define variables this is hard to look at

quaint mantle
#

or use pastebin

drifting halo
#

also your method names are a bit weird, why is your method named spawnCustomItems when it doesnt actually spawn them but just gets/creates them and adds them to the inventory

quaint mantle
#

anything above >10 lines of code on here is nasty to look at

drifting halo
#

not really its just that his method chaining is too long so it messes up in discord

lost matrix
drifting halo
#

i dont see why it wouldnt work tho

drifting halo
sand vector
#

CustomItems.spawnCustomItems() returns a ItemStack[]

drifting halo
#

yeah ok but what material type

#

loop over its contents and see whats actually them

#

if they're air ofc its not gonna give anything

sand vector
#

It is giving all custom items that i specified in my yaml

#

ill give the code of CustomItems.spawnCustomItems() as it will be a bit easier maybe.

#

It is basically a system of putting the custom items from my yaml to an array. I tested it and it was working before adding the items like i am doing

#

This is what the ItemStack returns

sand vector
#

Scrap all of that. Didn't refresh the yaml with the new file contents 🤦

main dew
#
public static void setBlockInNativeChunkSection(World world, int x, int y, int z, int blockId, byte data) {
    net.minecraft.server.v1_14_R1.World nmsWorld = ((CraftWorld) world).getHandle();
    net.minecraft.server.v1_14_R1.Chunk nmsChunk = nmsWorld.getChunkAt(x >> 4, z >> 4);
    IBlockData ibd = net.minecraft.server.v1_14_R1.Block.getByCombinedId(blockId + (data << 12));

    ChunkSection cs = nmsChunk.getSections()[y >> 4];
    if (cs == nmsChunk.a()) {
        cs = new ChunkSection(y >> 4 << 4);
        nmsChunk.getSections()[y >> 4] = cs;
    }
    cs.setType(x & 15, y & 15, z & 15, ibd);
}```
How I can translate this to 1.12.2?
deft sedge
#

Kind of a more java related question, but how many or statments can I have?

#

Is there a limit

earnest junco
deft sedge
#

ok

#

Another question, i have made some custom recipes, how do I refer to thim in this code. Where it says != recipe How do i make recipe a custome recipe

lost matrix
deft sedge
#

ok

#

Ill be back, but i have some more questions

deft sedge
lost matrix
deft sedge
#

k thx

deft sedge
# lost matrix Nope. https://www.spigotmc.org/wiki/recipe-example/

I don't think u understand, i already made the recipe using the same method thjat u sent me or maybe i'm missing something. What this code trys to do is make is so that you have to have 2 items in a specific slot for the recipe to work. What I want to know, is if I already had my recipe made, what do i put in the if statement. Where it says event.getRecipe() != recipe I wanna know what to put in the recipe space to target a custom recipe I made

lost matrix
deft sedge
#

ok

lost matrix
#

NamespacedKey.fromString is not a method. Are you on an ancient spigot version?

deft sedge
#

i don't think so

#

how would I do it?

lost matrix
#

What version are you on

deft sedge
#

because i tried a different way and it autocorrected to that

deft sedge
#

I don't know how to check spigot version, I'm using intelij 😳

steep nova
deft sedge
#

Is this right I found this in plugin.yml

#

probably isn't

#

lol

lost matrix
deft sedge
lost matrix
#

No

deft sedge
#

ok....

lost matrix
#

Ill write an example... this is pretty basic java stuff

deft sedge
#

srry i'm being slow

quaint mantle
#

Is the latest version of MangNecraft Server Drive better than the old version?

#

what

deft sedge
lost matrix
# deft sedge srry i'm being slow
public class SpigotCore extends JavaPlugin implements Listener {

  private NamespacedKey recipeKey;

  @Override
  public void onEnable() {
    this.recipeKey = new NamespacedKey(this, "some_recipe");
    this.registerRecipe();
    Bukkit.getPluginManager().registerEvents(this, this);
  }

  private void registerRecipe() {
    final ItemStack result = new ItemStack(Material.IRON_AXE);
    final ShapedRecipe recipe = new ShapedRecipe(this.recipeKey, result);
    recipe.shape("isi", " s ", " s ");
    recipe.setIngredient('i', Material.IRON_INGOT);
    recipe.setIngredient('s', Material.STICK);
    Bukkit.addRecipe(recipe);
  }

  @EventHandler
  public void onCraft(final PrepareItemCraftEvent event) {
    final Recipe recipe = event.getRecipe();
    if (!(recipe instanceof Keyed)) {
      return;
    }

    final NamespacedKey currentlyCraftedKey = ((Keyed) recipe).getKey();
    if (!currentlyCraftedKey.equals(this.recipeKey)) {
      return;
    }

    System.out.println("Your custom recipe was prepared.");
  }
  
}
deft sedge
#

ok thanks

quaint mantle
#

what is the best way to get someones location?

lost matrix
quaint mantle
#

ok thx

main dew
#
public static void setBlockInNativeChunkSection(World world, int x, int y, int z, int blockId, byte data) {
    net.minecraft.server.v1_14_R1.World nmsWorld = ((CraftWorld) world).getHandle();
    net.minecraft.server.v1_14_R1.Chunk nmsChunk = nmsWorld.getChunkAt(x >> 4, z >> 4);
    IBlockData ibd = net.minecraft.server.v1_14_R1.Block.getByCombinedId(blockId + (data << 12));

    ChunkSection cs = nmsChunk.getSections()[y >> 4];
    if (cs == nmsChunk.a()) {
        cs = new ChunkSection(y >> 4 << 4);
        nmsChunk.getSections()[y >> 4] = cs;
    }
    cs.setType(x & 15, y & 15, z & 15, ibd);
}```
I find this code to fast modify chunk (fast setblock) but this on version 1.14 I need this on version 1.12.2 Who can help me?
lost matrix
main dew
#

yea I do this

#

but don't work

#
if (cs == chunk.a()) {
            cs = new ChunkSection(y >> 4 << 4);
            chunk.getSections()[y >> 4] = cs;
        }```
lost matrix
#

Not sure if <1.13 had the chunks separated in sections already

main dew
#

yea XD he has

#

as well as understanding this piece of code, it forces an unloaded chunk to be loaded

lost matrix
#

Just tried building the 1.12 sources but BuildTools requires a java version below 11
So no help from me on this one.

#

god i hate old versions

rotund ravine
#

M8

#

@lost matrix search “iilegale” in the chat

#

And have a look at that repo

lost matrix
#

Jeb gonna visit you for this

rotund ravine
#

It’s not mine

#

I just found it in some weird plugin i was porting once

lost matrix
#

lol

slow badge
drowsy helm
#

Anyone aware of any libs that lets you saves schematics to mongo?

slow badge
#

Thank you 👍

sage swift
#

is it possible to make a dispenser dispense an item (not Dispenser#dispense)? ideally, something like the BlockProjectileSource#launchProjectile but for an item, maybe have it take in an ItemStack?

#

shoot out the item as if the item were inside

wispy monolith
#

@sage swift idk what u mean

#

Can u explain a little bit

sage swift
#

when a dispenser dispenses, the item comes out with a velocity out of a certain location

#

i want to replicate that

wispy monolith
#

To?

sage swift
#

i guess i have getVelocity from BlockDispenseEvent

#

what do you mean "To?"

wispy monolith
#

U want to replace it with what?

#

Or change to what

sage swift
#

replicate...

wispy monolith
#

Oh ok

#

The message wasn't appearing some discord for phone glitch

wispy monolith
sage swift
#

as if the item is being dispensed from the dispenser, but it is not in the dispenser originally

wispy monolith
#

I'm not that good at English but is it just me or isn't this confusing

quaint mantle
#

Why is the ev red?

sage swift
#

well it should tell you

quaint mantle
#

it doesn;t hmm

lost matrix
sage swift
#

item isn't a projectile though

lost matrix
#

Oh you mean a dropper?

sage swift
#

no, it's a dispenser

#

i want to launch an item as if it is coming out of the dispenser

wispy monolith
sage swift
#

but it was never actually in the dispenser

wispy monolith
#

And it must be bcz of the comment in side of a command

sage swift
#

no, that is probably not why

wispy monolith
#

Oh I see he has ev red

sage swift
#

i would assume it's because he doesn't have the dependencies set up correctly

wispy monolith
#

Maybe used this variable before

cinder thistle
#

if you have a code error somewhere the IDE will think there's a whooole bunch of errors elsewhere

sage swift
#

when you hover over, what does it tell you?

#

@quaint mantle

lost matrix
sage swift
#

that's what i'm considering

#

BlockDispenseEvent already has getVelocity so that's nice

deft sedge
#

How do i get the player from this event?

trail oriole
#

How would i loop every block in a certain area ?

sage swift
#

although this kinda sucks

sage swift
lost matrix
deft sedge
#

ok

trail oriole
sage swift
#

yep

lost matrix
trail oriole
#

alr i'll try

#

thanks

deft sedge
sage swift
#

getView

lost matrix
deft sedge
#

ok

sage swift
deft sedge
sage swift
#

no

#

you only register the recipe with Bukkit.addRecipe

lost matrix
deft sedge
#

then waht is this?

sage swift
#

ah, nice

#

thanks

sage swift
# deft sedge then waht is this?

that sets the key to have the namespace of your plugin and the key to some_recipe, then calls the registerRecipe method, then registers event listeners

deft sedge
#

k

#

thx

deft sedge
sage swift
#

dont do that

lost matrix
deft sedge
trail oriole
#

Anyone know how to code in js ?

lost matrix
trail oriole
#

i need help

deft sedge
lost matrix
trail oriole
#

huh ? x)

deft sedge
#

they don't like js

#

idk y

#

actually nvm

#

they think it's slow

trail oriole
#

i don't find js that slow ngl

lost matrix
#

Nobody that is sane likes js. I literally know no one that writes js without the ts layer.

trail oriole
#

i like js

#

i like coding in general

deft sedge
#

the only expeience i have in js is writing a very simple discord bot

trail oriole
#

i'm not that good though

trail oriole
sage swift
#

what the hell is ISourceBlock supposed to be

deft sedge
#

lol

lost matrix
trail oriole
#

anyways

#

i need to set a global variable

#

which is in a function

#

and idk how to

sage swift
#

they don't use the static function xD

lost matrix
#

Anything in js thats not in a method scope is global.
So literally write

var value = 100;

and its global

trail oriole
#

Talking about js

#

that doesn't work

#

i already tried

lost matrix
trail oriole
#
events.on('playerRespawnEvent', event => {
    event.getPlayer().getInventory().clear()
    startShop.give(event.getPlayer())
    let death = 0;
})```
#

i need the death variable to be global

#

which isn't there

lost matrix
#
var death;
events.on('playerRespawnEvent', event => {
    event.getPlayer().getInventory().clear()
    startShop.give(event.getPlayer())
    death = 0;
})
trail oriole
#

wow

#

thanks

final fog
#

How can I set a block to a fully grown wheat plant?

twin cape
#

If you make a new namespaced key 2 times with the same string, is it a new instance or can it still be used to check against a different instance with the same string?

lost matrix
quaint mantle
#

what is the easiest way to make a reload command? like /plguin reload

lost matrix
twin cape
#

ok, thx!

lost matrix
#

I would just properly implement onEnable and onDisable

deft sedge
#

@lost matrix Would this work if my namespacedkey was axe?

lost matrix
deft sedge
#

ok, i just got confused because when i set it up i used quotes

#

so if how i set it up was "axe" then how would I comapre it?

lost matrix
#

You want to compare the NamespacedKey of the recipe that is currently prepared with the NamespacedKey of your recipe. Then check if both those keys are equal.

deft sedge
#

i feel like i'm missing something

lost matrix
#

Thats better

deft sedge
#

so is that right?

lost matrix
#

If your recipe was created using a NamespacedKey that looked like this then yes.

deft sedge
#

ok, thanks for all the help!

final fog
bright jasper
#

So a plugin opens a menu when the key F is pressed

#

How would I do this or map keys to events

lost matrix
lost matrix
bright jasper
#

Somehow when i press the F key something happens in spigot

#

in the game

#

on a non modded client

lost matrix
#

The hands swap

bright jasper
#

ah

#

Oh also so I wanted to start making my own NMS solution for multiline nametags, so basically i create an endermite, remove AI, make it invis, and mount the endermite on the player or vice versa?

#

Where does the armor stand come in this

lost matrix
bright jasper
#

So I shouldnt use NMS here?

#

ProtocolLib?

lost matrix
#

Sure. Just use packets instead of adding the entities to the world. NMS packets are probably simpler in this regard unless you know ProtocolLib quite well.

bright jasper
#

Isnt the issue that it has to send the packets to every player

lost matrix
#

Sure. But spigot does exactly this too

deft sedge
#

How would I cancel this event?

#

event.setCancelled doesn't work

lost matrix
deft sedge
lost matrix
sage swift
#

a better solution would be to remove the recipe

bright jasper
#

or when the nametag changes i loop over everyone and send them a packet for the player?

deft sedge
#

is there an even that triggers when they take something out of a crafting table?

lost matrix
bright jasper
#

I want just for the tag to be different

deft sedge
lost matrix
sage swift
#

there's CraftItemEvent, which is kinda weird

#

you can also use StatisticIncrementEvent for Statistic.CRAFT_ITEM and compare for material

bright jasper
#

yeah

#

Or atleast ONE custom line not limited to 16 chars

lost matrix
bright jasper
#

Is there NMS documentation anywhere on how to use that

lost matrix
#

No. nms is just mojangs source code.

bright jasper
#

right but there is no decipher documentation project for it?

unreal quartz
#

if you ring mojang and ask really nicely then they might just help you

bright jasper
#

Also for some reason I cant add org.bukkit as a dependency

#

it only goes up to 1.15.1

#

cant access NMS rn

deft sedge
#

Does anyone know what the slot numbers for crafting tables are?

crude charm
#

I need to call them

#

I have something to discuss

deft sedge
unreal quartz
#

^

crude charm
#

fr

#

or scam

unreal quartz
#

try it

crude charm
#

no

#

I dont wanna get scammed

deft sedge
#

The last didgets i gave u are literally 69420

crude charm
#

I googled it and it doesent come out with anything

deft sedge
#

OMG

#

lol

unreal quartz
#

it's their hidden number

deft sedge
#

I made that up

unreal quartz
#

nah

#

rang it just now

crude charm
#

it has 69

#

see

deft sedge
#

The last digets are 69420
How did u not know that's a joke

#

Yea but 69420

#

rare

crude charm
#

no

deft sedge
#

@unreal quartz do u know the slot numbers for crafting tables

unreal quartz
#

nope

#

but if i had to guess the top right is 0

#

left*

deft sedge
#

yea

unreal quartz
#

and the result slot is 9

deft sedge
#

yea

unreal quartz
deft sedge
#

k thx

#

How do I get what was clicked on from an inventory click event?

unreal quartz
deft sedge
#

k thx

quaint mantle
#

How do you get the full error message from a spigot server console?

unreal quartz
#

by copying it?

quaint mantle
#

Nvmd

trail oriole
#

how do i check if the player has 3 arrows in his inv ?

#

do i have too loop through all the inv to check if he has 3 arrows ?

summer scroll
lost matrix
trail oriole
#

thanks

#

you guys are amazing

quaint mantle
#

no u

#

💋

hexed hatch
#

Does anyone know a good way to generate a dummy entity with specific metadata without it being spawned in the world?

deft sedge
#

How would I do a delay, like wait 10 seconds or something

hexed hatch
#

Bukkit scheduler

deft sedge
#

ok

#

?js

#

?jd

hexed hatch
deft sedge
#

k thx

#

what would the code look like, to do a simple couple secoinds delay?

earnest junco
hexed hatch
#

Okay so it's stupidly specific

#

I want to make a custom death message for an artificial damage application source

#

and I figured if I could check if the dead player was killed by that entity, it would do the trick

#

I really don't want to make an expiring list or hashmap for this lol

#

I mean I probably should but if I can just instantiate an entity that'd probably work

earnest junco
#

Are you the one that's applying the damage?

hexed hatch
#

With a plugin, yes

earnest junco
#

Then just show the message when that damage is lethal?

deft sedge
#

What would the code look like for a simple couple second delay using bukkit scheduler

hexed hatch
#

Thanks

earnest junco
#

lol np

wanton knot
#

does anyone know how RecipeChoice.MaterialChoice works for planks for setIngredient

#

this is what i got so far

bpR.setIngredient('W', new RecipeChoice.MaterialChoice);
earnest junco
wanton knot
#

yea the problem with that

#

is if i wanna do every plank i gotta spam recipes

quaint mantle
#

?

#

fym

wanton knot
#

tryna set a recipe ingredient to all planks using materialchoice

earnest junco
#

new RecipeChoice.MaterialChoice(Material.OAK_PLANKS, Material.BIRCH_PLANKS, ...);

#

should work?

wanton knot
#

ill try it

#

if it was that easy imma smash my head into a table

deft sedge
#

Is there not a simple way to make the code wait a couple seconds?

earnest junco
deft sedge
#

ok, i have a problem my code runs everytime aplayer takes something out of a crafting table, I am trying to stop the player from being able to take things out of the crafting table if they don't have a specific item. Here are my attempts to stop it, the event i'm listening to is inventory click event, and it checks if they click on the output slot of a crafting table, the problem is that if you shift click you can steal the item faster then my plugin can stop you. any ideas on how to fix?

wanton knot
#
bpR.setIngredient('W', new RecipeChoice.MaterialChoice(Tag.PLANKS));

so like this?

deft sedge
quaint mantle
#

?

wanton knot
#

omg it did work it was me testing materialchoice that broke it

#

lmao

deft sedge
quaint mantle
deft sedge
#

IT just doesn't do it fast enough

#

because if i shift click on the itim

#

it gives it to me before it gets canceled

quaint mantle
#

just

#

use that code

#

try it

deft sedge
#

ok

opal sluice
#

Hi, how could I get the view of the actual player inventory ?

#

(So I can use raw slot to change items)

earnest junco
opal sluice
#

Or, if someone knows how to change the crafting slots of the player inventory

errant cipher
#

how do i compile a jar file from github without any pom.xml?

#

also its from a paid plugin that said to compile the open source code if u cant pay

#

im also assuming this is legal

quaint mantle
#

you set it up yourself I guess

lost matrix
#

In the folder of your pom

errant cipher
#

there isnt any pom though?

#

will it still work?

lost matrix
#

Show the repo pls

errant cipher
opal sluice
lost matrix
#

It literally tells you how to compile it.
Clone the repo, go into the folder of the cloned repo and execute gradlew build there

errant cipher
#

oh my bad

#

thanks for that

deft sedge
drowsy helm
#

anyone wanna spoonfeed me a quick snippet of how to set a skull texture

#

Not skull owner, actual texture

deft sedge
#

texture.skull(yes);

lost matrix
drowsy helm
#

ur a leg

lost matrix
deft sedge
#

ok, i have a problem my code runs everytime aplayer takes something out of a crafting table, I am trying to stop the player from being able to take things out of the crafting table if they don't have a specific item. Here are my attempts to stop it, the event i'm listening to is inventory click event, and it checks if they click on the output slot of a crafting table, the problem is that if you shift click you can steal the item faster then my plugin can stop you. any ideas on how to fix?

drowsy helm
#

tyvm ill check it

lost matrix
# deft sedge

I would just set the result to null in the prepare event if they dont have a specific item to be honest.

deft sedge
lost matrix
deft sedge
#

?paste

queen dragonBOT
lost matrix
#

I dont think so. I just wouldnt tinker with the click event at all

vast dome
#

does anyone have decent knowledge on vectors, im trying to launch an armor stand and based on the pitch/yaw it should move a certain distance

deft sedge
#

and the reaso for that long clicked item statment is becsause it costs a specific number of energy points (EP) to do different things, so that checks for the tools @lost matrix

lost matrix
deft sedge
#

ok

crude charm
#
Fatal error compiling: java.lang.ExceptionInInitializerError: com.sun.tools.javac.code.TypeTags -> [Help 1]

#

?paste

queen dragonBOT
deft sedge
crude charm
lost matrix
# deft sedge <@!220605553368498176> https://paste.md-5.net/vukonopewe.cs Here is code, goal o...
  1. Your very long if statement with all the || should be replaced with something else.
    I would just use this at the start of my class and then call the isValidMaterial method instead of this huge if clause
  private final EnumSet<Material> validMaterials = EnumSet.of(
      Material.STONE_AXE,
      Material.STONE_PICKAXE,
      Material.STONE_SHOVEL,
      Material.STONE_HOE,
      Material.STONE_SWORD,
      Material.WOODEN_SWORD
  );

  private boolean isValidMaterial(Material tMaterial) {
    return this.validMaterials.contains(tMaterial);
  }
deft sedge
crude charm
lost matrix
deft sedge
#

god that's a long error

crude charm
#

-e

deft sedge
#

332 lines of error

crude charm
#

lmfao

#

now the question is, how to fix it

deft sedge
lost matrix
#

obvsly...

lost matrix
lost matrix
crude charm
#

<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<executions>

crude charm