#help-development

1 messages · Page 2131 of 1

quaint mantle
#

what u tryna do

#

just make a cooldown system?

civic dagger
#

yea

quaint mantle
#

i had a class for this but it went somewhere

civic dagger
#

i tried runnable.runTaskLater

quaint mantle
#

dont

civic dagger
#

i tried System.currentTimeMillis()

#

none worked

earnest forum
#

@civic dagger try right clicking the item and then waiting the cooldown

#

wait

#

1 sec

civic dagger
#

thats exactly what im doing bro

earnest forum
#

so when you right click

#

it doesn't stop u?

civic dagger
#

no

quaint mantle
#
public class CooldownManager {
    private final Map<UUID, Long> cooldowns = new HashMap<>();

    public void add(UUID uuid) {
        cooldowns.put(uuid, System.currentTimeMillis());
    }

    public long getCooldown(UUID uuid) {
        return cooldowns.getOrDefault(uuid, 0L);
    }

    /**
     * Call on JavaPlugin#onDisable
    */
    public void clear() {
        cooldowns.clear();
    }
}
#

all you need really

civic dagger
#

well no

#

see this

#
if(System.currentTimeMillis() - coolDownsMap.getOrDefault(event.getPlayer().getUniqueId(), 0L) < 1000) {
                        event.getPlayer().sendMessage("cooldowncheck");
                        return;
                    }
                    coolDownsMap.put(event.getPlayer().getUniqueId(), System.currentTimeMillis());
#

smaller

#

also ignore the indent

quaint mantle
#

?

#
private final CooldownManager cooldowns = new CooldownManager();

// somewhere
Player player = event.getPlayer();
UUID uuid = player.getUniqueId();

long cooldown = this.cooldowns.getCooldown(uuid);

if (cooldown > 0) {
    player.sendMessage("cooldownmessage");
    return;
}
// do code
this.cooldowns.add(uuid);
civic dagger
#

what i did is just same as this

quaint mantle
#

ik

civic dagger
#

they use same mechanic and method

quaint mantle
#

ik

civic dagger
#

so you know it dosent matter if i use your method or no because nothing changes right?

quaint mantle
#

ik

#

its just better to turn this into an object so you can use it in other classes

#

yours is a code smell

#

one directive programmign

#

i forgot the name

civic dagger
#

yes BUT IF IT WORKS IN THE FIRST PLACE

quaint mantle
#

no

#

it working doesnt mean it works good

#

anyways whats ur issue

#

:P

civic dagger
#

lmao

#

you dont even know my issue

earnest forum
#

try send the player coolDownsMap.getOrDefault(event.getPlayer().getUniqueId(), 0L)

quaint mantle
#

be grateful i fixed a code smell for you

civic dagger
#

ik how to use objects bro im programming in different langs for 3 years

#

the problem is

quaint mantle
civic dagger
#

the check just dont give the fuck

#

about cooldown

quaint mantle
#

its being modified somewhere earlier in your code

earnest forum
#

calm down bro

#

no reason to get aggressive

civic dagger
#

um wait

#

lemme check some time

#

5:17

#

now 7

#

2 hours almost

quaint mantle
#

lmao ik whats about to happen

civic dagger
#

trying to fix something that nothing is wrong with it

quaint mantle
#

this is funny

earnest forum
#

there obviously is something wrong with it

quaint mantle
#

^

earnest forum
#

just do what i asked you to do

civic dagger
#

ok wait

earnest forum
#

and tell us what it says

quaint mantle
#

something miniscule that you looked over for 2 hours apparently

#

dude

earnest forum
#

not that code

quaint mantle
#

wheres his code at

#

like his full class

earnest forum
#

.

quaint mantle
#

your code bad

#

?pdc

earnest forum
#

lets just fix this issue

#

and then optimize

quaint mantle
#

im pretty sure its supposed to be >

#

not <

#

lol

earnest forum
#

no

civic dagger
#

no?

#

lets take current time is 20

#

time value is added is 10

#

20-10

earnest forum
#

if the difference between the current time and the cooldown time is less than 500 (meaning the 500 hasnt passed) then its still in cooldown

quaint mantle
civic dagger
#

wait

#

lemme see again

quaint mantle
#

dude

#

💀

#

i know im right

civic dagger
#

ok then ill change it and see

quaint mantle
#

10 - 5 = 5, and 5 >= 5

#

10 - 5 < 5

earnest forum
#

he is right i think lmao

civic dagger
#

yeah lmao

quaint mantle
#

im always right

#

thats a joke ^

earnest forum
#

is it?

civic dagger
#

thanks to deotime for this awesome code xD

#

yea he is

earnest forum
#

gg

quaint mantle
#

so i was right

#

lol

civic dagger
#

because time dosent go backwards

quaint mantle
#

i told you it would be something miniscule you'd look over for hours

#

happens to the best of us

#

your welcoem

civic dagger
#

yeah

#

but you know whats the fun part

quaint mantle
civic dagger
#

is im stuck at this for like 15 min

#

that 2 hours was stuck at a runnable

#

that runs itself

quaint mantle
#

use my cooldown manager

civic dagger
#

for no reason

quaint mantle
#

and use

#

?pdc

earnest forum
#

give the item like a keyword in the pdc

#

"FREEZE_WAND" or something

civic dagger
#

uh ill use that link later when my vpn get fixed

#

cuz i cant open it rn

#

it literally timeouts

#

@quaint mantle anyways thanks i would have never found that except if rewrited that code which was what i was thinking about

#

saved me hours lmao

quaint mantle
#

i've probably made that error before so i knew what to look for

civic dagger
#

@quaint mantle

#

i just found a fact

#

a very good fact

#

you were both wrong and not at the same time

#

see this

#

time passed > 1000 -> false, your idea
timepassed < 1000 -> true, my idea, if time passed in ms is smaller than 1k then return

#

wow

#

lmao

quaint mantle
#

?

civic dagger
#

your idea is if its false then dont do anything

#

mine is if its true then return

#

its same

quaint mantle
#

oops

#

lol

civic dagger
#

yea lol

quaint mantle
#

well just inverse the return

civic dagger
#

so

#

now

#

my problem isnt solved

#

because everything is same again

#

lmao running in a circle

quaint mantle
civic dagger
#

wdym? bad english so example please?

crisp steeple
#

inversează valoarea returnată

civic dagger
#

wow helped so much thanks bro!

quaint mantle
#
if (timeElapsed < COOLDOWN_TIME) {
    return;
}

// set cooldown
civic dagger
#

its literally what im doing

#

lol

#
 if(System.currentTimeMillis() - coolDownsMap.getOrDefault(event.getPlayer().getUniqueId(), 0L) < 1000) {
                        event.getPlayer().sendMessage("cooldowncheck");
                        return;
                    }
#

but it dosent stop it

#

which leads to my 1 hour ago idea

#

ik deo

#

its false

#

no need to type

crisp steeple
#

we’ve really spent 2+ hours here making a cooldown

civic dagger
#

and its not working

#

lol

#

alright idc anymore at this point let that mf player make tps 2

quaint mantle
#

?

vestal dome
#

wdymmmm

#

make it 2?

civic dagger
#

i gave up that means

vestal dome
#

2 is bad.

#

20 good

#

2 = very bad

civic dagger
#

oh really thanks for your information

#

i really needed that

vestal dome
#

why are you rude?

#

was I rude to you?

civic dagger
#

because you didnt even read what i said

vestal dome
#

I reed your last line, I get kinda questionable.

low temple
#

Is there anyways to modify the vanilla loottables? like if i wanted to add a custom item to the loottables of abandon mineshaft chests?

quaint mantle
#

wanna see something funi

#

now on how to actually do this loottable stuff, you're basically on your own

civic dagger
#

not completely i guess there is some threads for it out there

quaint mantle
low temple
#

Yeah ive seen all of that, on the LootGenerateEvent it gives me those datatypes but I can never get the loot table type

low temple
#

like the enum is never passed into the event

vestal dome
#

you gotta be able to set the LootTable somehow..

civic dagger
quaint mantle
low temple
quaint mantle
#

its not an enum..?

vestal dome
#

some type of LootTableInventory or smth?

vestal dome
quaint mantle
#

there is no loot table neum

vestal dome
#

which is the "LootTables" enum.

vestal dome
#

bruh

#

bruh moment

quaint mantle
#

Dude

low temple
#

It literally is an enum

quaint mantle
#

you said LootTable

#

and i looked for loottable

#

and you give me loottables

#

we're programming yk gotta be specific

low temple
#

oh yeah my bad i forgot to add the S

#

didnt realize the words LootTable and LootTables look completely different

quaint mantle
#

well when you say the LootTable enum im gonna look for a LootTable enum

low temple
#

Yeah sorry i should have been more specific, those two class names look completely different my b

quaint mantle
#

i hope you try and sign up for a website and it doesnt give you a username because someone else has one that ends in 807 instead of 808 but its close enough yk

low temple
#

Yeah unlike you I can make inferences based on the context of conversations

quaint mantle
#

yes because i can know you want to get the LootTables enum variant from this question

low temple
#

oh shit its almost like I even spelled it correctly in my first question

#

craaaaazy

vestal dome
low temple
quaint mantle
#

or a switch statement

vestal dome
#

wdym a map?

#

like..

quaint mantle
#

a map contains key : value entries

low temple
#

and that would do what exactly

vestal dome
#

how would you get the keys do?

#

well

#

if you know the loot tables (like the instance of them)

quaint mantle
vestal dome
#

that's what he is saying

#

you can know what is the type currently being generated, but even that is not accessible.

quaint mantle
#

ok can we all just agree that these two classes should be accessible from within eachother

#

this is just bad api

dusk flicker
#

fix it then

quaint mantle
#

no

#

fuck jira

dusk flicker
#

mr. discord helper

low temple
#

Yeah its not made in an intuitive way

crisp steeple
#

spigot python edition

vestal dome
#

mapping NMS is an adventure sometimes..

low temple
vestal dome
#

I found it

#

I found a way.

quaint mantle
dusk flicker
#

nms through spigot is an adventure, dealing with nms without any mappings is the real adventure

quaint mantle
#

inventoryholder, instanceof Chest

vestal dome
#

LootTable extends Key

#

which means you can check the key

#

and know what is the loot table

quaint mantle
#

Keyed

vestal dome
#

big brain

quaint mantle
#

or you could be ballsy and use LootTables.valueOf

low temple
quaint mantle
#

Im looking for variants of chest loot tables

vestal dome
#

why would you make a switch statement tho? wouldn't you just, check if the key == "chest/abandonned_mineshaft" (this is absolutely wrong in terms of language, I understand it, it's just for demonstration purposes)

low temple
knotty gale
#

can anyone help me make a scoreboard that I can make a score change INSIDE the scoreboard? so like not the actual score but like the text of the scoreboard goes from "team 1: 0" to "team 1: 1"

vestal dome
#

then why make switch statemet?

quaint mantle
#

oh i forgot because we were scrambling on about LootTable was similar to the name LootTables

low temple
#

Oh then there we go

knotty gale
knotty gale
#

the text of the board would change

vestal dome
#

well hm

low temple
# knotty gale can anyone help me make a scoreboard that I can make a score change INSIDE the s...

https://www.youtube.com/watch?v=7QXokn_GEGg slightly outdated but explains it well

Keeping score??? Learn how to create scoreboards in 1.15 Spigot! Great for minigames and hub plugins :D

Patreon:
https://www.patreon.com/codedred

Donate to me :)
https://www.paypal.me/CGMax

Join my discord:
https://discord.gg/zMzXSgk

Follow the Twitch Streams:
https://www.twitch.tv/coded_red

------ Links ------

Download Eclipse: https://w...

▶ Play video
knotty gale
#

Ik how to do the scoreboard

#

lemme getthe SS

vestal dome
#

huh okey

#

while you do that

#

I do nothing

#

I was gonna ask for help in a thing, but might as well not, gonna make chat confusion

knotty gale
#

so like that would change to "Team 1: 1"

#

when I do a command

vestal dome
#

build a new scoreboard?

low temple
#

"Wanna hear something?" "Oh nevermind"

vestal dome
#

I don't want to confuse chat..

#

I really don't

knotty gale
#

this is what the entire scoreboard looks like if it makes it less confusing

low temple
#

Then dont edge people with ur "I have a question but i dont wanna ask"

crisp steeple
#

ironic how not asking the question caused more chat confusion

dusk flicker
#

fun fact a scoreboard issue is like the least confusing thing lmao

#

we deal with a lot worse stuff

knotty gale
#

ik...

#

the problem know though, is simple!

crisp steeple
knotty gale
#

a command

crisp steeple
#

probably would just reuse that but with a different number

#

oh

#

what

#

are you using another plugin or something

civic dagger
#

wait you cant edit a scoreboard? you have to rebuild it?

earnest forum
knotty gale
#

I am using another plugin butI can manipulate that code if it

low temple
earnest forum
#

im pretty sure coded red doesnt do that

dusk flicker
#

fun fact: youtubers arent always right

#

most of those spigot tutorials are pretty shitty

earnest forum
#

coded red has bad api use

#

yea

#

its good for basics

low temple
earnest forum
#

yea

knotty gale
#

im just gonna ffucking pay someone to do it idek why I try

earnest forum
#

i learnt off him

#

use the website i sent

#

datshrek

#

its great

dusk flicker
#

tbh I catch exception when theres like 3+ of em lol

knotty gale
#

I do

knotty gale
#

just dont have the stamina rn

earnest forum
#

the webpage

low temple
sweet pike
#

any suggestions on how to 'cancel' certain blocks from slowing down players (soul sand, cobwebs, honey)

knotty gale
#

the thing I did that I was most proud of myself for doing was making a command that tells you when someone shot or got shot by a bow lmfao

earnest forum
#

so an event

#

lol

knotty gale
#

yes

#

a listener

crisp steeple
earnest forum
#

set the player walk speed

#

to counteract the slow

crisp steeple
#

does that effect cobwebs

earnest forum
#

it doesnt look like speed effect

#

it probably doesnt

#

tbf

vestal dome
#

it doesn't, it doesn't change fov or anything, doesn't even appear in the UI

earnest forum
#

yea

#

its great

crisp steeple
#

yea

knotty gale
#

What is the listener for a arrow touching a block?

crisp steeple
#

only problem is theres a limit

dusk flicker
#

yeah but its high af lol

knotty gale
#

ty very much 🙂

vestal dome
#

yeah so basically, I have this current setup.

#

basically I want to make it so I can know if a hopper is pointed towards a machine block

#

any ideas?

#

without making the server go brr mode.

#

(dropping tps crazy)

crisp steeple
#

armor stands probably best idea yeah

vestal dome
#

yeah but when do I check it?

crisp steeple
#

whenever you need to?

#

about the cobwebs yes

civic dagger
#

did you even open the link?

vestal dome
#

and can transfer items every tick

dusk flicker
#

what?

crisp steeple
#

what

vestal dome
#

okey so I'll reform that

dusk flicker
#

you are asking something outside the scope of your original question

#

you asked originally how to get what direction a hopper is facing, which I answered above

earnest forum
#

you can pick how frequently you check that

dusk flicker
#

doubt doing as check like that wont be that bad either

earnest forum
#

or you could just set it to a variable and then reference that every time you want the hopper to function

vestal dome
#

really honest here, I really don't think I have any choice, but I don't want to check if the machine has a hopper around it..

#

idk, It just doesn't feel right..

knotty gale
#

what does the green underline in eclipse mean?

earnest forum
#

hover over it

knotty gale
#
if(event.getHitBlock().equals(Material.BARRIER)) {
``` dis shit wrong?
crisp steeple
#

eclipse 🤢

earnest forum
#

that will never be true

knotty gale
earnest forum
#

you need to do .getType()

#

on the block

knotty gale
#

... ok

vestal dome
#

enums are compared with ==

earnest forum
#

comparing a block to a material

#

is a no no

vestal dome
#

not with equals

earnest forum
#

that too ^

knotty gale
#

how do I compare then?

vestal dome
#

just

knotty gale
#

cause Material. is the only thing that I can think of

low temple
#
LootTables.valueOf(event.getLootTable().getKey().getKey().split("/")[event.getLootTable().getKey().getKey().split("/").length-1].toUpperCase())

This gets the loot table enum when u open a chest that hasnt been looted yet

vestal dome
#

Block.getType() == Material.BARRIER

#

for example.

knotty gale
#

just now

crisp steeple
#

nope

#

you checked Block == Material.BARRIER

knotty gale
#

damnit

vestal dome
knotty gale
#
if(event.getHitBlock().getType() == Material.BARRIER) {
crisp steeple
#

yeah that is correct

knotty gale
#

lfg

#

ima test it

#

you gotta be fucking with me

#

the guy who owns the server I test with shut it down

vestal dome
#

well

#

unlucky!

#

get him next time.

knotty gale
#

I am...

knotty gale
#

.equals is for like strings right?

vestal dome
#

and objects*

low temple
vestal dome
#

== is for enums.

knotty gale
#

Ik == was like roblox coding too and shit

low temple
#

== is used for primitives and enums

vestal dome
#

or to test if "hi" == "hi"

#

ok terrible joke

knotty gale
#

my 3 year old spigot server I havent loaded up and is still running 1.8

earnest forum
#

.equals() checks the information of the objects

#

== checks if the objects are the same

earnest forum
#

if they are the EXACT same object

low temple
#

(new String("hi") == new String("hi")) returns false

earnest forum
#

like same point in memory

knotty gale
#

ah ok

civic dagger
#

== checks if they have the same pointer

vestal dome
#

Java's String pool.

#

As I call it..

knotty gale
#

yall i get it they are different

eternal oxide
knotty gale
#

now can we talk about the econimical and political state of the world rn?

earnest forum
#

fr

vestal dome
low temple
eternal oxide
#

yes, but if a string of the same contents exists in teh cachee it's instance will be used

low temple
#

not if the new keyword is used

eternal oxide
#

I'd have to check that

knotty gale
#

lets go it works!

earnest forum
#

amongus

vestal dome
#

I will check it rn

eternal oxide
#

k

knotty gale
#

real talk. Dasani or Fiji

earnest forum
#

deez nuts

vestal dome
#

well yes.

low temple
knotty gale
#

"yeah I format my code correctly and dont call every class I have main" - 🤓

eternal oxide
low temple
#

basically, dont use == if youre not comparing enums or primitives

vestal dome
#

well you could use == if the object is a singleton 😂

knotty gale
#

whats a singleton

earnest forum
#

whats the point then

#

lmao

vestal dome
#

Dunno 😂

vestal dome
low temple
#

it is actually sometimes better to use == over .equals for enums. Like if you hook into the PlayerInteractEvent and want to check if a block is gravel, using .equals will give u Null exception if the player interacts the air. if you use == it will not generate an exception

vestal dome
#

good point.

knotty gale
low temple
#

so you dont need to do the block==null check

compact haven
#

actually it is better

earnest forum
#

ur main class

compact haven
#

enums are constants, always use == for constants if that's what you're checking

knotty gale
earnest forum
#

nice

quaint mantle
#

nice

compact haven
#

nice

knotty gale
#

I am yet to make any plugin using more than 1 class

quaint mantle
#

jesus

knotty gale
#

that isnt a tutorial;

low temple
compact haven
#

my god (not to u)

low temple
compact haven
#

(u)

knotty gale
#

lmfao

low temple
#

lmao

vestal dome
#

what are we doing ..

quaint mantle
#

lol

vestal dome
#

confusion spikes

quaint mantle
earnest forum
#

just made bank on elite dangerous

#

feeling good

vestal dome
quaint mantle
#

1v1 me kid

vestal dome
#

lmfao

quaint mantle
#

my vulture will shit on your little cobra

earnest forum
quaint mantle
#

oh ok

earnest forum
#

and i played 9 hours

#

on that day

#

i think im gonna get the best ship in 2 weeks

low temple
knotty gale
#

"1v1 me in spigot development" - :sigma:

quaint mantle
vestal dome
#

if apis are allowed, I win

earnest forum
#

clash of clans

#

hehehehehe

vestal dome
#

😂

quaint mantle
#

i know apache commons better than you

compact haven
#

lmfao

vestal dome
#

wtf

#

oh no!

compact haven
#

just use TNAHRSC

earnest forum
#

just get an api that literally builds u an entire plugin with 1 method

quaint mantle
#

cmon

#

join you smellies

knotty gale
crisp steeple
#

so silly

quaint mantle
earnest forum
#

so goofy ahh]

knotty gale
earnest forum
compact haven
#

SpigotPluginAPI.make("MyPlugin").load(this.getClassLoader()).module(WeirdCommands.class)

low temple
quaint mantle
compact haven
#

sorry mate my api already did what u can do in 2 days

civic dagger
#

can i spectate? lmao

quaint mantle
knotty gale
#

pls

low temple
earnest forum
#

like whats the problem with me preferring static singleton over dependency injection

compact haven
#

what is this bullshit

#

reverse mode??

low temple
#

put static before ur datatype declaration or before final

compact haven
#

im not a fucking inverter

crisp steeple
#

its not working guys

compact haven
#

oh nevermind this is ez

earnest forum
#

we have to remember that we are quite literally coding a rock that we shaped and put lightning into

crisp steeple
#

i am totally going to win the clash of code

earnest forum
#

there is no right way to do things

civic dagger
#

cmon someone stream that clash of code for me xD

knotty gale
low temple
low temple
knotty gale
earnest forum
#

basically

knotty gale
low temple
#

?learnjava

undone axleBOT
earnest forum
#

static makes it belong to the class name instead of instance

knotty gale
low temple
# knotty gale *asks a question*

Youre asking questions that are basic to java as a language, youll learn more from learning java than asking people to teach you java

knotty gale
#

I have went to all of those sites and found nothing that I didnt already know

vestal dome
knotty gale
#

so i must be either super smart or super stupid

quaint mantle
#

@compact haven bad

#
s = input()
v = []

skip = False
for c in s[::-1]:
    if skip:
        skip = False
    else:
        v.append(c)
        skip = True

print(''.join(v))
earnest forum
#

ew python

compact haven
#

ur bad

quaint mantle
knotty gale
compact haven
#

I'VE FORGOTTEN HOW TO FOR IN KOTLIN

#

IM STUPID

quaint mantle
#

public static final synchronized arbitary void

#

idk

knotty gale
#

PHOTOSHOP

low temple
earnest forum
#

public override event static final synchronized void

#

combined a couple languages there

knotty gale
crisp steeple
earnest forum
#

hot

civic dagger
#

bruh wtf is synchronized and arbitary they didnt teach me these stuff :(

crisp steeple
vestal dome
#

why is the S capitalized?

#

garbage

knotty gale
#

bro I asked someone to make a plugin for me and I was gonna pay them and it was so easy they did it for free 💀

vestal dome
#

variable conventions

low temple
# crisp steeple

protected private final async boolean Object<Class<T extends Object> extends Object> int { }

compact haven
#

im so confused

#

why is it not accepting

compact haven
#

am I not meant to print it out

knotty gale
#

my pc running mc spigot and ecclipse

low temple
#

@knotty gale https://www.youtube.com/watch?v=xk4_1vDrzzo&t=0s Pretty good video for people learning java. Good explanations of stuff. Timestamps for concepts

Java tutorial for beginners full course
#Java #tutorial #beginners
⭐️Time Stamps⭐️
#1 (00:00:00) Java tutorial for beginners ☕
#2 (00:20:26) variables ❌
#3 (00:32:58) swap two variables 💱
#4 (00:36:42) user input ⌨️
#5 (00:44:40) expressions 🧮
#6 (00:49:13) GUI intro 🚩
#7 (00:55:01) Math class 📐
#8 (01:01:08) ra...

▶ Play video
crisp steeple
low temple
compact haven
#

wtf is this bs

#

i understand what it wants

#

but i cant write it in kotlin

civic dagger
#

who wants a python 1v1? i can just ask a question that you cant even find in stack overflow xd

knotty gale
#

looks at vid "Oh cool!" 12:00:00 "..."

civic dagger
#

almost 5h of that you dont have to watch

#

because its GUI

low temple
crisp steeple
#

codingwithmosh >>>

knotty gale
compact haven
#

ok i figured it out

civic dagger
#

it is
bro code just mixed them inside a single video

low temple
compact haven
#

@quaint mantle ur just sad that i beat u so quickly

quaint mantle
#

huh

compact haven
#

lets be honest that 7 mins was like too long for u to take

earnest forum
#

protected static async final void Object<T<Object extends BukkitObjectOutputStream> extends Object<Object extends Object<Object extends Object>> getYourMum() {}

low temple
#

@quaint mantle Idk if u saw but I found out how to get the loot table enum from the LootGenerateEvent, I can send u the code if ur interested

earnest forum
#

extends object

quaint mantle
#

idc

low temple
#

ok

compact haven
#

im fucking with you

earnest forum
#

extends object

crisp steeple
#

i have forgotten every piece of python i have ever known

knotty gale
#

ima be real with yall

#

I only really need listeners for the rest of what I am doing

#

like it is just hitlogs arrow logs and shot logs

compact haven
#

why does this not work

knotty gale
quaint mantle
#

Can a dropped item be cast to living entity? I’m guessing probs but

crisp steeple
#

its not a livingentity

#

so no

compact haven
#

this is rigged

quaint mantle
#

How can I affect a dropped item with a potion effect then?

crisp steeple
#

i dont think you can?

#

what would be the purpose of that anyways

quaint mantle
#

You can in vanilla?

#

Giving a dropped item glowing effect

crisp steeple
#

i think thats a different method

#

yeah entity alone has that

compact haven
#

did it

#

in a short 10 minutes

eternal oxide
#

You can add glow effects using Teams

crisp steeple
compact haven
#

we should go again kekw

quaint mantle
crisp steeple
#

should be the same

quaint mantle
#

Mk I’ll try

compact haven
#

wait whyd everyone choose python

#

was that battle 😶

golden kelp
#

How to make an entity glow with certain colours (rainbow)

dark arrow
#

How can i make bukkit runnable inside a function?

golden kelp
#

Just use the Bukkit class

dark arrow
#

?

crisp steeple
#

new BukkitRunnable

vocal cloud
#

Or you can use an anonymous class

crisp steeple
#

but why

dark arrow
# crisp steeple new BukkitRunnable
else{
                        player.sendMessage(ChatColor.LIGHT_PURPLE+"You frozed: "+target.getDisplayName());
                        target.sendMessage(ChatColor.RED+ "You got frozen by: "+player.getDisplayName());
                        Utils.createCircle(player,player.getEyeLocation(),1.5f,Particle.REDSTONE,Color.fromRGB(6,210,6),Sound.ENTITY_ILLUSIONER_CAST_SPELL,-2,1.25f);
                        frozenPlayers.add(target);
                        new BukkitRunnable(){
                            @Override
                            public void run() {
                                frozenPlayers.remove(target);
                            }
                        }.runTaskLater(this.plugin,20*10);
                    }```It throws error
crisp steeple
#

the error being?

dark arrow
#

you have to implement methods

crisp steeple
#

but you already did

#

try clicking the context action and see what it does

dark arrow
#

it creates a new run function at the end

crisp steeple
#

huh

#

that is odd

dark arrow
crisp steeple
#

idk why it would be saying that

#

looks like you implemented the methods properly

dark arrow
#

is it because i have to do somethiung ion main class also?

kindred valley
#

i cant build my project

compact haven
#

well of course you cant

#

your project's groupID and artifactID are the same as net.tnemc.TNE

#

that's meant to be the identifier for your project, not the dependency

compact haven
#

Do you currently own a domain?

kindred valley
compact haven
#

do you plan on owning a domain

kindred valley
#

no

compact haven
#

okay then I guess just use like me.limpeex for the group ID and rpplugin for the artifact ID

#

then move all of your packages in the source to me.limpeex.rpplugin

#

remove your Main class from the Main package, rename all packages to lowercase

earnest forum
#

yeah

compact haven
#

delete the Main package, name the Main class RPPlugin

earnest forum
#

have you used eclipse

#

or even just intellij

compact haven
#

he's in intellij

earnest forum
#

its like folders

kindred valley
compact haven
#

very aware

#

your maven pom.xml needs to have your own groupID and artifactID

#

not just the dependencies

earnest forum
compact haven
#

as for every other change I've suggested, it's to make your project follow conventions

earnest forum
#

org.bukkit.player

#

or whatever

#

their groupid would be org.bukkit

#

and then artifact would be Bukkit

compact haven
#

artifact ID meant to be lowercase, and it wouldnt be that

faint harbor
compact haven
#

in any case, your code is meant to all be under a package <reverse domain>.<project name>, then the group id is your reverse domain and the artifact id is the project name

#

LuckPerms for example (and about every other Java project) uses this convention, me.lucko (Luck owns lucko.me) and (luckperms), hence the group ID me.lucko and the artifact ID luckperms

#

along with all the source code being under me/lucko/luckperms or, in Java, me.lucko.luckperms

#

if you only care about fixing the one dependency problem, and not the other ones present in your code, just change the group id and artifact id to what I said previously

#

then you'll be able to build a problematic plugin

torn shuttle
#

bro don't listen to these loser haters, put your main class in main.main.main.Main so people know you're the real MVP

golden kelp
#

this is a joke btw^^

torn shuttle
#

then also name every other class Main1, Main2, Main2... and name every method main1, main2, main3

#

every field should be called main, every interface should be called main, every config file should be called main

#

I recommend hacking spigot so you can even generate a main.yml file instead of a plugin.yml file

river oracle
#

is the dependency already installe in your m2

#

or is it using something like jitpack

#

if your using a dependency like this too make sure you shade it if it won't be in the plugins folder

#

you can use maven-shade plugin for this

kindred valley
river oracle
#

maven dependencys are located in your .m2 file

#

on linux it'd be /home/usr/.m2

#

if you didn't properly install your dependency look it up

#

maven provides tools to do this

#

again if your using something like jitpack or repsy follow their doccumentation as its pretty well descriptive of what you need to do to depend off your custom dependency

river oracle
#

Also in your future dependencies make sure you use lowercase artifact ids per mavens conventions

kindred valley
#

i dont even know what the heck is that 🙃

river oracle
#

I reccomend doing self-research its a good trait to learn and get used to

#

maven is pretty well doccumented and explained on apache given your needs

#

use google correctly by being descriptive yet general simultaniously

#

descriptive of your issue more general in terminology

vestal dome
#

how to get blocks around block

river oracle
#

block faces is probably the best way

#

Block#getBlockFace(BlockFace face)#getBlock

compact haven
#

@kindred valley you've changed the wrong thing

#

the thing you changed is the ID of the dependency itself, not your own project's ID

#

the error is that the ID is the same, which it shouldnt be

#

the project isn't TNE, the project depends on TNE

vestal dome
kindred valley
earnest forum
#

you need to actually put the TNE repo in

#

repository

#

because it doesn't know where to get the dependency from

#

the TNE website should give you the repository

river oracle
#

its in there somwhere

compact haven
#

are you meant to be depending on such an old version

river oracle
#

blockface something

vestal dome
#

well

#

there's no "getBlockFace" method.

compact haven
river oracle
#

getFace probably then

#

idk ASakashrug

#

i don't have the docs memorized

compact haven
#

quite the difference from a development version that you're trying to use

kindred valley
river oracle
#

be easier if you looked at em yourself ASRemWink

earnest forum
kindred valley
compact haven
#

I don't really know where the fuck it is lmfao

earnest forum
#

does TNE not have a guide for this?

compact haven
#

it's in Sonatype's OSS repo

vestal dome
#

not a block face.

river oracle
#

oops my bad

#

its getRelative

kindred valley
#

sorry

earnest forum
#

i dont know if you can use github repos for that

compact haven
#

thats not what that section is for

#

that's specifically for compiling the TNE project itself

#

not for dependening on it

#

what version of TNE are you using

kindred valley
earnest forum
#

their entire website is just error 404

compact haven
#

ugh this is so confusing

earnest forum
#

you can always just import the jar as a file

#

instead of repo

#

i dont think they actually have a public maven repo

kindred valley
#

wait

compact haven
#

they use github packages

#

had to go through an old Issue to figure that out

#

why is that so difficult for them to put in the README

earnest forum
#

looks like theyve stopped supporting it

compact haven
#

change the dependency section to that info

earnest forum
#
<dependency>
  <groupId>net.tnemc.TNE</groupId>
  <artifactId>tne</artifactId>
  <version>1.1.9.2</version>
</dependency>
compact haven
#

thats from the end of 2019 💀

earnest forum
compact haven
#

this is stupid

earnest forum
#

click on any of the buttons

#

on this website

#

the big ones

compact haven
#

yeah it would seem they just don't publish artifacts anymore

#

but try the one above

#

I can't really tell what versioning scheme they are using, but it might work unless they've made breaking changes

kindred valley
#

I actually dm the creater

#

I want to use the vault but vault does not have much functionalities

compact haven
#

just try the one I posted above, see if it works

#

if not then yeah wait for his response

kindred valley
#

its not working yes

dark arrow
#

how can i manupilate the block position

eternal oxide
#

Block positions are fixed

dark arrow
#

but i have seen many plugins changing it using items when clicked

earnest forum
#

u wanna move a block?

dark arrow
#

yah

eternal oxide
#

each location contains a block type. You can set those types per location. If you want to animate moving a Block you use Entities

earnest forum
#

you gotta set the type of the block you click to air

#

and then get the location of the new block

#

and set the type to the first block's type

dark arrow
#

ooo

earnest forum
#

yeah because you can't set a block's position

#

as elgar said its fixed

#

theres a set block for every position in the world

dark arrow
#

thanks for the idea 🙂

earnest forum
#

no problem

earnest forum
#

yea

#

remove their gravity

dark arrow
#

ok

#

how can i get a block using it location?

earnest forum
#

Location#getBlock()

dark arrow
#

ok

dark arrow
earnest forum
#

there isn't a Location#getBlock()??

dark arrow
#

oh my bad

#

i found it

earnest forum
dark arrow
#

yah

#
    Player player = event.getPlayer();
        if(player.getInventory().getItemInMainHand().getType()==Material.GOLD_INGOT){
            Block block = player.getTargetBlock(null,4);
            double BlockX = block.getX();
            double BlockY = block.getY();
            double BlockZ = block.getX();
            player.sendMessage(ChatColor.RED+"X:"+BlockX+",Y:"+BlockY+",Z:"+BlockZ);
            BlockData blockData = block.getBlockData();
            block.setType(Material.AIR);
            Location BlockX1 = new Location(player.getWorld(),BlockX+1,BlockY,BlockZ);
            Block block1 = BlockX1.getBlock();
            block1.setType(Material.OBSIDIAN);
            player.sendMessage("Done");
```Sorry to disturb again but the blocks diappears and the new block does not spawns
manic furnace
#

What is the best way to save a list in a mysql-table?

fleet pier
#

How are there systems that auto login premium user?

#

like i thought they cant communicate with mojang server cuz of onlinemode off

west orbit
#

is there any way to make an arrow not hurt entities but just fly through them?

midnight shore
kindred valley
#

my plugin does not creating data folder why can it be

eternal oxide
#

you haven't called `saveDefaultConfig()

kindred valley
eternal oxide
#

then you don't have a config.yml in your jar

kindred valley
#

?paste

undone axleBOT
kindred valley
eternal oxide
#

one fo the two is fact

mellow edge
#

can I convert spigot's Color class to ChatColor

golden kelp
harsh totem
#

I have this event that doesn't work. am I supposed to compare the things that I put in the if statements differently?

#
    public void OnClick(InventoryClickEvent event){
        Wands inv = new Wands();
        if (event.getClickedInventory() == null || event.getCurrentItem() == null) { return; }
        else  if (inv.compare(event.getClickedInventory())){
            Player player = (Player) event.getWhoClicked();
            if (event.getCurrentItem().getItemMeta() == ItemManager.fireWand.getItemMeta()){
                player.getInventory().addItem(ItemManager.fireWand);
                player.sendMessage(ChatColor.GOLD + "You now posses the power of fire!");
                player.closeInventory();
            } else if (event.getCurrentItem().getItemMeta() == ItemManager.dragonWand.getItemMeta()){
                player.getInventory().addItem(ItemManager.dragonWand);
                player.sendMessage(ChatColor.LIGHT_PURPLE + "You now posses the power of the dragon!");
                player.closeInventory();
            } else if (event.getCurrentItem().getItemMeta() == ItemManager.lightningWand.getItemMeta()){
                player.getInventory().addItem(ItemManager.lightningWand);
                player.sendMessage(ChatColor.YELLOW + "You now posses the power of lightning!");
                player.closeInventory();
            }
            event.setCancelled(true);
        }
        }```
#

inv.compare is a function in the class

#

like can I not compare item meta like this? item.getMeta() == item2.getMeta()

urban kernel
#

how can i call plugin.getConfig() outside of the main class

harsh totem
#

now its like this if (event.getCurrentItem().getItemMeta().toString().equals(ItemManager.lightningWand.getItemMeta().toString()))

#

and it still doesnt work

golden kelp
urban kernel
#

?

golden kelp
#
public static Main instance;

public void onEnable() {
    instance = this;
}
Main.instance.getConfig()
#

U should learn Java tbh

harsh totem
golden kelp
#

Why are you converting them to strinf

golden kelp
#

please learn java

#

?learnjava

undone axleBOT
golden kelp
#

^^

harsh totem
golden kelp
#

Wdym doesn't work

#

What r u trying to achieve

harsh totem
#

im trying to check if an item in equal to another item

golden kelp
golden kelp
harsh totem
#

it is an instance

#
    public void OnClick(InventoryClickEvent event){
        Wands inv = new Wands();
        if (event.getClickedInventory() == null || event.getCurrentItem() == null) { return; }
        else  if (inv.compare(event.getClickedInventory())){
            Player player = (Player) event.getWhoClicked();
            if (event.getCurrentItem().getItemMeta().toString().equals(ItemManager.fireWand.getItemMeta().toString())){
                player.getInventory().addItem(ItemManager.fireWand);
                player.sendMessage(ChatColor.GOLD + "You now posses the power of fire!");
                player.closeInventory();
            } else if (event.getCurrentItem().getItemMeta().toString().equals(ItemManager.dragonWand.getItemMeta().toString())){
                player.getInventory().addItem(ItemManager.dragonWand);
                player.sendMessage(ChatColor.LIGHT_PURPLE + "You now posses the power of the dragon!");
                player.closeInventory();
            } else if (event.getCurrentItem().getItemMeta().toString().equals(ItemManager.lightningWand.getItemMeta().toString())){
                player.getInventory().addItem(ItemManager.lightningWand);
                player.sendMessage(ChatColor.YELLOW + "You now posses the power of lightning!");
                player.closeInventory();
            }
            event.setCancelled(true);
        }
        }```
vocal cloud
#

jesus

golden kelp
#

what is this code

harsh totem
#

im comparin the instance of Wands to an ItemStack

golden kelp
#

Make variables please

harsh totem
golden kelp
#

i m saying its very bad

harsh totem
#

y

golden kelp
#

Use variables whenn u call thiings multiple times

harsh totem
#
    public void OnClick(InventoryClickEvent event){
        Wands inv = new Wands();
        Inventory clicked = event.getClickedInventory();
        ItemStack current = event.getCurrentItem();
        
        if (clicked == null || current == null) { return; }
        else  if (inv.compare(clicked)){
            Player player = (Player) event.getWhoClicked();
            if (current.getItemMeta().toString().equals(ItemManager.fireWand.getItemMeta().toString())){
                player.getInventory().addItem(ItemManager.fireWand);
                player.sendMessage(ChatColor.GOLD + "You now posses the power of fire!");
                player.closeInventory();
            } else if (current.getItemMeta().toString().equals(ItemManager.dragonWand.getItemMeta().toString())){
                player.getInventory().addItem(ItemManager.dragonWand);
                player.sendMessage(ChatColor.LIGHT_PURPLE + "You now posses the power of the dragon!");
                player.closeInventory();
            } else if (current.getItemMeta().toString().equals(ItemManager.lightningWand.getItemMeta().toString())){
                player.getInventory().addItem(ItemManager.lightningWand);
                player.sendMessage(ChatColor.YELLOW + "You now posses the power of lightning!");
                player.closeInventory();
            }
            event.setCancelled(true);
        }
        }```
#

here

golden kelp
#

Still

#
  • DONT DO TOSTING PLEASE
harsh totem
supple elk
#

Hey guys :>

#

I am this class here

dark arrow
#

I have a direction in vector variable , how can i use it to tell if the player is looking at (x or z)

supple elk
#

which takes a generic which extends GameMap

golden kelp
supple elk
golden kelp
supple elk
# supple elk

In the gameMap class I'd like to be able to call the addMap() function

harsh totem
#

how do i compare itemStacks?

golden kelp
#

instanceof

#

🤦‍♂️ i really suggest you to learn java

supple elk
#

now I can only do this if the GameMap constructor instead takes a GameType which starts with itself

harsh totem
#

like if (item instanceof item2)?

dark arrow
supple elk
#

like GameType<this, ?>

#

bit obviously that's incorrect syntax

#

is it even possible to do?

golden kelp
west orbit
earnest forum
earnest forum
#

you use this for direction vectors

golden kelp
#

they want to compare items right

earnest forum
#

yes

#

use .equals()

golden kelp
#

to check if item is some item

earnest forum
#

instanceof is classes

golden kelp
#

mb

earnest forum
#

if (item instanceof ItemStack)

west orbit
earnest forum
#

not if (item instanceof item2)

dark arrow
harsh totem
#

so how do i compare 2 itemStacks?

earnest forum
harsh totem
#

cause it is not instanceof

harsh totem
golden kelp
earnest forum
#

yes and...?

supple elk
earnest forum
#

and thats your block in front

harsh totem
#

I changed it to item.equals(item2) like you said and nothing happens

earnest forum
#

what are you trying to compare about the items

#

just if they are the same type

#

or do you want meta as well

#

enchantments, etc

harsh totem
#

wait can I compare inventories like this?

        for (int i = 0; i < this.getInventory().getContents().length; i++){
            if (this.getInventory().getItem(i) != inv.getItem(i)){
                return false;
            }
        }
        return true;
    }```
earnest forum
#

dont use ==

#

for itemstacks

harsh totem
#

so compare meta?

earnest forum
#

.equals should be working

harsh totem
earnest forum
#

ItemStack#isSimilar()

#

looks like that doesn't compare amounts tho

#
public boolean isSimilar(ItemStack first,ItemStack second){

        boolean similar = false;

        if(first == null || second == null){
            return similar;
        }

        boolean sameTypeId = (first.getTypeId() == second.getTypeId());
        boolean sameDurability = (first.getDurability() == second.getDurability());
        boolean sameAmount = (first.getAmount() == second.getAmount());
        boolean sameHasItemMeta = (first.hasItemMeta() == second.hasItemMeta());
        boolean sameEnchantments = (first.getEnchantments().equals(second.getEnchantments()));
        boolean sameItemMeta = true;

        if(sameHasItemMeta) {
            sameItemMeta = Bukkit.getItemFactory().equals(first.getItemMeta(), second.getItemMeta());
        }

        if(sameTypeId && sameDurability && sameAmount && sameHasItemMeta && sameEnchantments && sameItemMeta){
            similar = true;
        }

        return similar;

    }

found this modified version of the original method you can use if you want

harsh totem
#

like a stick

#

or a slime ball

earnest forum
#

all items have durability im pretty sure

#

just try it out

harsh totem
#

ok

dark arrow
earnest forum
#

normalized sets it to 1

#

try see if theres a setMagnitude or setDistance method on it

#

i dont use vectors often

harsh totem
dark arrow
#

ok

earnest forum
#

change it

harsh totem
#

k

earnest forum
#

to that

earnest forum
#

1 sec

#

yeah idk sorry

#

ask the other guy

trail oriole
#

how do I add dependencies into my plugin.yml ?

earnest forum
trail oriole
#

yeah but is the line where i'm putting it mattering ?

earnest forum
#

not really

#

just put it after the main 3

#

main author and version

trail oriole
#

okay

harsh totem
#
    public void OnClick(InventoryClickEvent event){
        Wands inv = new Wands();
        Inventory clicked = event.getClickedInventory();
        ItemStack current = event.getCurrentItem();

        if (clicked == null || current == null) { return; }
          if (inv.compare(clicked)){
            Player player = (Player) event.getWhoClicked();
            if (inv.isSimilar(current, ItemManager.fireWand)){
                player.getInventory().addItem(ItemManager.fireWand);
                player.sendMessage(ChatColor.GOLD + "You now posses the power of fire!");
                player.closeInventory();
            } else if (inv.isSimilar(current, ItemManager.dragonWand)){
                player.getInventory().addItem(ItemManager.dragonWand);
                player.sendMessage(ChatColor.LIGHT_PURPLE + "You now posses the power of the dragon!");
                player.closeInventory();
            } else if (inv.isSimilar(current, ItemManager.lightningWand)){
                player.getInventory().addItem(ItemManager.lightningWand);
                player.sendMessage(ChatColor.YELLOW + "You now posses the power of lightning!");
                player.closeInventory();
            }
            event.setCancelled(true);
        }
        }``` @earnest forum still nothing happens which means that none of these if stetements are true
earnest forum
#

thats weird

#

try print the bools inside of the isSimilar method

#

only for one of them so just comment out the rest of the ifs so you dont get spammed

harsh totem
#

k

supple elk
#

anyway I can do something like this?

#

Alternative is this which is unsafe

brittle lily
#

How Can I Fill My GUI with black glass

earnest forum
#

loop through all of the slots and set them to glass

brittle lily
#

thanks

fleet pier
#

How are there systems that auto login premium user?
like i thought they cant communicate with mojang server cuz of onlinemode off

dark arrow
#

how to increase magnitude of vector?

dark arrow
earnest forum
#

nice

#

try like 0.5

dark arrow
#

sorry length is use to get the lengh not to change it we need to use multiply or divide

#

multiple works 🙂

dark arrow
earnest forum
#

np

mighty pier
#

my yamlconfiguration used to be like kitname: items: ...
and i looped all of the kits like this for (String kit : KitData.get().getKeys(false)) {
but not i changed the configuration like this Kits: kitname: items: ...
how do i loop all kitnames in this configuration?

#

i tried that

dark arrow
#

how to customize a entity that i want to spawn

mighty pier
#

i did exactly that but when it returned null and sent an error i thought it didnt work

#

also

#

yes i added that

#

when i restart server configuration doesnt save

#

i have kitdata and playerdata