#help-development

1 messages ยท Page 365 of 1

dry yacht
#

Well, I'd be happy to do that, xD

smoky oak
#

id do it if i knew how

eternal oxide
#

I forget where it is

#

stash is where the source is, I forget where the tickets are

dry yacht
#

Yeah, those dot's were just wrong, xD. They just completely forgot about 1.8.8, :(

dry yacht
eternal oxide
#

I'd open a ticket for it, then its upto md5 if he wasnts to fix it or not. It's not a hard fix, just one file.

#

?contributing else this

dry yacht
#

Yep. At least we got it figured out now. Applying the diff and building manually is not that bad, but BuildTools is all about automated builds. Cannot be that big of a deal for them to change one file to fix their awkwardly malformed doc-strings.

eternal oxide
#

?contribute

eternal oxide
#

I'll make a ticket. It is unlikely to be fixed but it's worth doing as it would be nice to be able to build any version

eternal oxide
#

I'd be ok with them deleting all 1.8 code. But if it's up there it shoudl build properly.

opal juniper
#

i can't compile it cause of a different issue

#
Exception in thread "main" java.io.IOException: Server returned HTTP response code: 403 for URL: https://s3.amazonaws.com/Minecraft.Download/versions/1.8.8/minecraft_server.1.8.8.jar
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1900)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)
    at java.net.URL.openStream(URL.java:1092)
    at com.google.common.io.Resources$UrlByteSource.openStream(Resources.java:72)
    at com.google.common.io.ByteSource.read(ByteSource.java:296)
    at com.google.common.io.Resources.toByteArray(Resources.java:98)
    at org.spigotmc.builder.Builder.download(Builder.java:1083)
    at org.spigotmc.builder.Builder.main(Builder.java:416)
    at org.spigotmc.builder.Bootstrap.main(Bootstrap.java:27)
lost matrix
#

Uh oh. Looks like someone is distributing a mojang jar... (Which is not allowed)

opal juniper
#

buildtools gets them from this s3 service all the time

#

I looked thru the src before

cold field
#

Is it possible to view the size that an object takes while debugging?

hybrid spoke
#

with an profiler yes

lost matrix
hybrid spoke
cold field
#

A profiler would be good. What do you recommend (Free would be better)?

lost matrix
#

YourKit is still my favourite but its costly. The only usable free one is VisualVM in my opition.

wet breach
#

I agree

lost matrix
#

Oh and IntelliJ Profiler. Havent used it a lot but it looks ok

dry yacht
lost matrix
#

Main benefit there is that you can actually directly navigate to code fragments from your timings

cold field
#

I think that is an Ultimate only feature

lost matrix
#

Are you a student?

#

If still school or already in uni doesnt matter

tardy delta
#

instrument package ๐Ÿ‘€

eternal night
#

you gotta download the jar yourself and smack it into the appropriate folder build tools expects the jar to be at

opal juniper
#

i dont actually care enough to do that OMEGALUL

#

I was just testing their issue

#

weird that they just up-and-moved it though

eternal night
#

I mean, they moved to piston meta

opal juniper
#

ye i saw

#

fair enough

#

suprised md5 hasn't fixed BT though

#

supporting legacy and all

eternal night
#

just get your builds from get bukkit kappa

opal juniper
#

tbf if their 1.8.8 builds were out of date i would be seriously concerned

#

im right in saying the spigot api is just in the bundled jar now right?

eternal night
#

yes

opal juniper
#

its just someone is saying you cannot depend on it without maven

#

but you could just yoink it out of there ๐Ÿ˜„

eternal night
#

Or just download it from the maven repo 5Head

opal juniper
#

true dat

#

maven web viewers have nothing but the best UI's

wet breach
#

you still can, but its up to you to do it yourself

remote swallow
dry yacht
quaint mantle
#

hello, is anyone in this server discord server an expert with databases?

#

i have a few questions.

opal juniper
#

i know a bit

lost matrix
#

?ask

undone axleBOT
#

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

quaint mantle
#

i was reading up the mysql manual just now, regarding indexes, and according to the manual, if i create some sort of composite index, for example, i create an index on a hypothetical (colA, colB, colC), it states that it should have optimized queries on colA, (colA, colB), (colA, colB, colC). Does it not optimize queries for the just colB?

#

or (colB, colC)?

lost matrix
#

No

#

You need to also index each property individually

quaint mantle
#

i see.

lost matrix
#

At least in mysql. Other databases might handle this differently.

quaint mantle
#

alright, appreciate the clarification!

cobalt thorn
#

Hi, how can i check if someone is clicking into an item with another item like for upgrades?

echo basalt
#

InventoryView#getCursor

#

is being clicked on InventoryClickEvent#getCurrentItem

lost matrix
#

Also check out InventoryClickEvent#getCurrentItem. Probably easier instead of getting the itemOnCursor from the player.

cobalt thorn
fervent gale
#

I'm wanting to see what plugins on my server have a specific Dependent whats the best way to get all the plugins and make a list of the plugins by name who have a specific dependent

lost matrix
fervent gale
#

well this will be a command but ye

shadow night
#

how do I make a item have the enchanted glint

lost matrix
shadow night
lost matrix
#

Did you apply the ItemMeta on the ItemStack after modifying it?

shadow night
#

yes

#

bucket.setItemMeta(meta);

lost matrix
#

You did override the enchantments with adding the ItemMeta on the ItemStack

shadow night
#

oooh

lost matrix
#

So either get the ItemMeta after calling bucket.addUnsafeEnchantment
Or add the enchantments to the ItemMeta (which i would suggest)

shadow night
#

hmm

#

okay, thanks

#

it works now

cold field
#

Does anyone happen to know if there is a library to randomly access chunks of an unloaded world?

storm scaffold
#

How do I add paper to use this?

#

I'm using gradle

#

I tried this in the build.gradle but it doesnt work

eternal night
#

?whereami

cobalt thorn
lost matrix
cobalt thorn
quasi flint
lost matrix
cobalt thorn
lost matrix
quasi flint
#

ah shi

#

now how would one do that

#

without the use of nms?

#

or packet events api

lost matrix
# cobalt thorn whats called the clicked item?
  private static final Set<Material> ARMOR = Set.of(
          Material.LEATHER_HELMET,
          Material.LEATHER_CHESTPLATE,
          Material.LEATHER_LEGGINGS,
          Material.LEATHER_BOOTS,
          Material.IRON_HELMET
          //        ... and so on ...
  );
  
  public static boolean isArmor(Material material) {
    return ARMOR.contains(material);
  }
lost matrix
quasi flint
#

spawning npc

cobalt thorn
lost matrix
tardy delta
#

EnumSet ๐Ÿฅบ

lost matrix
tardy delta
#

i know what consequence it has, wondering when they're finally gonna change Material to be a class

lost matrix
#

okthen soon

lost matrix
cobalt thorn
#

InventoryClickEvent#getCurrentItem()?

eternal night
#

so ๐Ÿ™‚

#

cope copium

lost matrix
pine forge
#

How do i spawn a tipped arrow with the World#spawnArrow method?

#

It takes a Arrow class as the parameter

lost matrix
#

SpectralArrow iirc

#

Hm there must be a TippedArrow as well

pine forge
#

its deprecated

#

and an interface

#

I cant really do new Arrow()

lost matrix
#

You cant do that with any spigot classes

pine forge
#

Thats what i mean

#

how do i get a tippedarrow class

pine forge
lost matrix
#

The deprecation looks like a warning. Similar to getPlayer(String)
It has no alternative approach in the deprecation which means you should just use it for now.

pine forge
#

But how do I get a TippedArrow class?

#

Like we said already, we cannot construct spigot interfaces

lost matrix
#

TippedArrow.class

pine forge
#

that doesnt let me choose the effect

lost matrix
#

Huh?

pine forge
#

I want it to spawn a harming 1 arrow

lost matrix
#
  public void spawnTippedArrow(Location location, Vector direction, float speed, float spread) {
    World world = location.getWorld();
    TippedArrow arrow = world.spawnArrow(location, direction, speed, spread, TippedArrow.class);
    arrow.addCustomEffect(...);
  }
pine forge
#

ah thanks, ill try that

lost matrix
#

If you want just vanilla tipped arrows then you should just set the potion data of an Arrow

pine forge
#

What are custom effects?

eternal oxide
#

if you set teh potion type to instant it shoudl become an Arrow of Harming

lost matrix
#

Something you cant obtain ingame

pine forge
#
TippedArrow arrow = player.getWorld().spawnArrow(..., TippedArrow.class);
arrow.setBasePotionData(new PotionData(PotionType.INSTANT_DAMAGE));
#

This is what i have so far

#

ill try it

lost matrix
pine forge
#

Luck arrow?

lost matrix
#
    Arrow arrow = world.spawnArrow(location, direction, speed, spread);
    arrow.setBasePotionData(new PotionData(PotionType.INSTANT_DAMAGE));
pine forge
#

Yup, that worked, the arrow shows the red effect particles now

#

Thanks :D

tardy delta
#

\๐Ÿ‘€

pine forge
eternal oxide
#

Player#launchProjectile

quiet ice
#

Not surprising at all

remote swallow
#

elgarls name is steve?!

quiet ice
#

but how did that pass unnoticed

eternal oxide
#

No clue. it's not in 1.8 nor 1.8.3. Only 1.8.8 suffers

mortal hare
#

ahh

eternal oxide
#

just have to never build javadocs for 1.8.8

mortal hare
#

good

#

i made gigantic code

#

and it seems to work

#

but it looks so sus

#

parses Turing's machine data into classes

#

essentially deserializes data from file

pseudo hazel
#

yeah I mean if you want you can def put that for loop structure in a function

mortal hare
#

i hate those guard statements

mortal hare
pseudo hazel
#

o wait this is c++

#

well too bad

mortal hare
#

i need to treat data differently

#

yea

pseudo hazel
#

xD

mortal hare
#

its already in while loop btw ๐Ÿ˜„

#

its just i hate those guards

#

its repetetive

pine forge
pseudo hazel
#

well you could probably still condense it using templates, bt idk if that would help readablility

mortal hare
#

and that's not even the main problem

#

now i need to cleanup heap

#

memory

#

with destructor method

pseudo hazel
#

sexy

#

just use smart pointers

wet breach
#

not all that hard to do, and just build the javadocs lol

eternal oxide
#

yes you coudl do that yoruself, but BT pulls from Git for every build so local changes are lost

tardy delta
wet breach
#

so its a non-issue

eternal oxide
#

It was mainly just for simplicity so everyone BT would work without error

#

rather than just one version failing

tardy delta
hazy parrot
neon badge
#

Anyone know why .orbs is red?

pseudo hazel
#

because its not found or inaccessible

#

hover over it

neon badge
#

but look

pseudo hazel
#

why do you have eco.eco

neon badge
#

its my economy

pseudo hazel
#

well its not public

neon badge
#

yea

#

thats what i tought lol

#

Do i just make it public instead of static?

#

Would that work?

zealous osprey
#

both

neon badge
#

Aight

tender shard
#

also it's static, you should access it through the class, not an instance reference

zealous osprey
#

well normally you should use a getter

pseudo hazel
#

well normally we would first need to know the purpose of this hashmap

neon badge
#

uh

#

so

#

orbs is a custom economy i made

#

and eco.eco is the economy so .orbs will add to the economy

pseudo hazel
#

is there only ever one map of orbs?

neon badge
#

What i think i have to do is to tell the other class to use the .orbs because i dont think it can find the .orbs

tender shard
#

if eco.eco is the class that implements Economy, then what's eco lol

pseudo hazel
#

another class cannot find a variable thats private so yeah

neon badge
#

eco is my eco and the other eco is the economy im using

tender shard
#

whut

neon badge
#

its hard to explain

pseudo hazel
#

well then its also hard to code

eternal oxide
neon badge
#

I already coded it i just need to access the orbs in my new class

neon badge
remote swallow
#

remove the private prefix?

neon badge
#

public static?

#

oh

remote swallow
#

and replace it with public ofc

tender shard
neon badge
#

wait whatcu mean with private prefix?

tender shard
#

?learnjava

undone axleBOT
remote swallow
#
private static String string;

public static String string;
#

private and public would be the prefix

twin venture
#

hello , am i doing anything wrong?

it keep spamming this :
java.lang.IllegalStateException: Not scheduled yet
at org.bukkit.scheduler.BukkitRunnable.getTaskId(BukkitRunnable.java:134) ~[server2.jar:1.8.8-R0.1-SNAPSHOT]
at dev.muntder.addon.skypvpaddon.sumo.core.arena.ArenaCountdownRunnable.run(ArenaCountdownRunnable.java:34)

spice shoal
#

guys how i can create a button to use like a command?

neon badge
#

I made it public but same error

remote swallow
#

eco is the wrong class then

chrome beacon
chrome beacon
#

That would be why no not runTimer I'm talking about the run method

tender shard
neon badge
tender shard
#

please just look at some basic java tutorial

neon badge
#

I already watched alot

tender shard
#

show the declaration of "orbs"

neon badge
#

decloration?

chrome beacon
#

Where the orbs variable is created/defined

neon badge
#

oh

tender shard
#

which class is that?

#

like, what's the name of that class

neon badge
#

The class is named "economies"

tender shard
#

that's a weird class name. it should be Uppercase. Anyway, you can access the orbs field using "economies.orbs"

chrome beacon
#

?conventions

neon badge
#

ohhhhh aight

#

MA BOI

#

uuuuuhm

remote swallow
#

might need some code

neon badge
#

It works fine just these numbers thats a bit yeah

#

Is this a code error or do i have to add a code to fix this?

remote swallow
#

we are gonna need some code to tell you the error

tender shard
#

wdym?

#

do you mean that it shows a UUID?

chrome beacon
#

Did you to string the entire map

remote swallow
#

its showwing the uuid and its value

neon badge
#

yea

#

hm

remote swallow
neon badge
#

Ah aight

tender shard
#

so what do you expect it to show instead? just the number?

remote swallow
#

map.get(uuid.tostring())

#

that will do what you want

tender shard
#

uuid

chrome beacon
#

skip to string

remote swallow
#

just format it correctly

tender shard
#

not uuid.toString()

neon badge
#

Oh thanks yall lemme try

remote swallow
#

Call orbs.get(uuid)

neon badge
#

Aight

#

Like that?

chrome beacon
#

You need to give it a UUID

#

like the players uuid for example

tardy delta
# neon badge

use getOrDefault cuz ((Double) null).doubleValue() will throw

neon badge
#

Ohh aight

neon badge
#

getOrDefault()

tardy delta
#

you have to understand what happens

mortal hare
#

even though it works

#

memory management would kill me

tardy delta
#

you have a map<uuid -> Double>, if you're calling get() on that map and there isnt an entry bound to that uuid, it will return null

neon badge
tardy delta
#

but because you compare the result with some double, it will call Double::doubleValue() on the result to go from a Double -> double primitive

neon badge
#

ooo yea

tardy delta
#

if its null it will throw a nullpointer ex

rough drift
undone axleBOT
tardy delta
#

so you could use map.getOrDefault(someUUid, 0) >= whatever

neon badge
#

Wait so i replace the orbs with that?

remote swallow
#

map is a placeholder

neon badge
#

oh aight

#

when i do orbs.map the "map" gives me an error

remote swallow
#

you get rid of the map

#

?learnjava!

undone axleBOT
tardy delta
#

you should probably learn some java about methods

#

and for later: dont abuse the static keyword

#

exposing collections to other classes in this case

rough drift
tardy delta
#

ill abuse you

tender shard
undone axleBOT
tardy delta
tender shard
#

you don't know the difference between classes and instances and also nothing about visibility, you should just read one of these java tutorials

#

or even better, a proper book about java

tardy delta
#

kinda fun how the learnjava command has been used three times now

remote swallow
#

4

tardy delta
#

people blind

#

hmm im wondering, internally int.class is just a Class<Integer> right?

#

or (some method that returns int).getReturnType()

rough drift
#

yes

#

wait no

#

or yes

#

i forgor lmao

tardy delta
#

probably returns Integer.TYPE

#

but Integer.TYPE is a Class<Integer>???

#

whats int.class for then if Class<int> cannot exist

pseudo hazel
#

for nothing

tardy delta
#

so ig i can remove int.class in my map

tender shard
#
int.class: int
Integer.class: class java.lang.Integer
Integer.TYPE: int
tardy delta
#

but the question is what must i keep in my map so looking up a value based on the return type of a method works (whether thats a method that returns an int or Integer shouldnt matter)

#

i have no clue what Method#getReturnType returns when its an int or Integer return type

neon badge
lost matrix
rough drift
tender shard
neon badge
#

I might of missunderstood because i tought he told me to use .map

tardy delta
#

im trying to avoid inserting both Integer.class and int.class

tender shard
#

and you thought that you will magically have a reference called "map" that comes out of nowhere?

#

why don't you just learn basic java now pls

tardy delta
#

feels like my classmates in college

neon badge
tardy delta
#

that was an example

#

replace map with the name of your map

neon badge
#

Oh okay

neon badge
tardy delta
#

take a guess

neon badge
#

well not HashMap

#

so idk

tardy delta
#

take another guess

remote swallow
neon badge
#

uhm

#

orbs?

remote swallow
#

yeah

#

theres your name

tardy delta
#

ok its dumb and wants me to say it doesnt work

hushed spindle
#

bruh

neon badge
#

oh shi im stupid

neon badge
remote swallow
#

once again another placeholder

#

you give the uuid

neon badge
#

hm alr

hushed spindle
#

well what are you wanting to store in the map

neon badge
#

So just UUID should work?

neon badge
#

i think

hushed spindle
#

who is their

neon badge
#

players

hushed spindle
#

ok

#

then do player.getUniqueId(), yes?

remote swallow
#

player.getUniqueId()

tardy delta
#

ok stupid

neon badge
#

ty ty

tardy delta
#

never int.class cuz it doesnt exist

hushed spindle
#

is it feasible to use NMS to programmatically overlay textures onto a player's skin? i know getting a player's skin returns in hash format, could you simply add or overwrite parts of this hash to make the player's skin appear as if they were wearing, like, jewellery?

neon badge
hushed spindle
#

๐Ÿ—ฟ

#

learn java my brother

#

learn how variables and method parameters work

neon badge
#

This aint basic java tho

#

That might be why im asking

remote swallow
#

it is, it really is

tall dragon
hushed spindle
#

spigot isnt a language lol

#

its just an api

#

its just java

neon badge
#

HashMaps isnt basic

remote swallow
#

it is

tardy delta
#

ok int.class is just syntaxical sugar for Integer.TYPE

hushed spindle
#

hashmaps are SUPER basic

tall dragon
#

what ur asking is not api related tho

remote swallow
#

anyone here got that you've been told to learn java thread

hushed spindle
#

hashmaps are one of the first things you learn about when learning about collections and dictionaries

neon badge
hushed spindle
#

you're not gonna learn forcing yourself to make a spigot plugin if you dont know the basics of java yet

#

its just suffering

remote swallow
#

Map.put(player.getUniqueId(), value)
Map.get(player.getUniqueId())

tardy delta
#

half of the people learnt the spigot api whilst learning java

#

so did i

hushed spindle
#

you do java first and then spigot

#

not the other way around

hazy parrot
#

Well, I learnt java trough spigot lol

hushed spindle
#

you can do that but you probably at least knew some basic java first

#

im talking the very start

tall dragon
#

yea a lot of people here have.

tender shard
#

I bet that you guys at least knew that if you do Map<String,String> myMap = new HashMap<>();, that "myMap" is the variable name, before you made a spigot plugin, right?

hushed spindle
#

as in you've never touched java in your life before

tender shard
#

because this dude doesn't and refuses to learn

remote swallow
#

and what a private/public prefix is

tardy delta
#

i didnt know what a hashmap was

tall dragon
#

i just watched a few videos and knew the basics from there

hushed spindle
#

yeah but thats fine, you learn what objects do by looking them up

tender shard
hushed spindle
#

this guy didnt know what a variable name was

tall dragon
#

then i just started making shit

neon badge
tardy delta
remote swallow
#

you should be able to decipher what he means if you are making a plugin

tardy delta
#

ig this is a map in js

#

or its an object, idk

#

ah new Map() ๐Ÿ’€

hushed spindle
tardy delta
#

why is js impl defined in a ts file lol

remote swallow
neon badge
#

Anyone know if its possible to change the 1.0 to 1?

tall dragon
neon badge
#

Round would be great

tall dragon
#

Math.round(input) should do it

hushed spindle
neon badge
#

thanks

remote swallow
hushed spindle
#

๐Ÿ’€

tardy delta
remote swallow
#

you just have to fake the armor being there to the server

tender shard
tardy delta
#

i had issues with String.format displaying weird characters in game

hushed spindle
#

yeah but wouldnt the resource pack need all those models?

tardy delta
#

that [?] character or smth

hazy parrot
remote swallow
#

double

#

not float

tender shard
hushed spindle
hazy parrot
#

It's same lol

#

Double = long float

remote swallow
#

and its data ofc

neon badge
tardy delta
#

๐Ÿ’€

hazy parrot
#

Omg

eternal oxide
#

lol

remote swallow
#

collective?

hushed spindle
#

good CHRIST

remote swallow
#

3

#

2

#

1

tardy delta
#

me 2 years ago

remote swallow
#

?learnjava

tall dragon
undone axleBOT
hushed spindle
#

mf stop being stubborn

tardy delta
#

you need a DecimalFormat object

desert loom
#

you can also just cast it to an int, depends on what you want.

tardy delta
#

google it

remote swallow
#

read this

#

might help

neon badge
#

So yall should i use DecimalFormat or String.format?

hazy parrot
hushed spindle
#

PLEASE

#

either works

remote swallow
#

i remember when @young knoll said that he told someone to learn java then 6 months later they came back to say thankyou

#

why cant everyone be like that

hushed spindle
#

but for all that is holy learn at least the basics

tardy delta
#

i wanted to say thank you to that guy that got banned

neon badge
hushed spindle
#

you cant just slap together classes and hope it works

#

imo, String.format, but thats only because i use that more

hazy parrot
#

I like how he is literally ignoring everyone

hushed spindle
#

but neither are difficult

#

they're both stupid easy

tall dragon
hushed spindle
#

unless you havent got a clue what you're doing

hazy parrot
#

Just watch him yeet entire string inside of format

remote swallow
#

waiting for the "how do i remove t he "this is a very cool number""

tall dragon
#

we shall see

hushed spindle
#

i have a question for you man

#

what are you making a plugin for right now

#

are you planning to make something for serious usage?

neon badge
#

but yall im getting an error

hushed spindle
#

THERE IT IS

pseudo hazel
#

what does . even mean

#

what is .orbs

tall dragon
#

remove the dot then

neon badge
#

the map

remote swallow
hushed spindle
#

why the dot

neon badge
#

so yall i got another error

hushed spindle
#

you are not even TRYING to understand what you're doing

#

brother in christ

hazy parrot
#

xD

neon badge
#

I AM

tall dragon
#

okay so ur Map is not in the same class i guess?

tardy delta
#

well that not the syntax of the format method

hushed spindle
#

you fuckin aint

#

dont lie to yourself

pseudo hazel
#

well

tall dragon
neon badge
pseudo hazel
#

in any case I dont think shouting at each other will help

hushed spindle
#

you've been ignoring all the advice you've been given to learn java because you only want to be spoonfed what to do

remote swallow
#

you remove pretty much all of what help you got gave

hushed spindle
#

you are not learning that way

warm mica
remote swallow
#

?spoon

undone axleBOT
#

Spoonfeed a newbie for a day and they'll come back with more questions. Teach them to find their own answers and you'll both be better off: you won't get stuck answering the easy questions and they'll be much more productive than before.

neon badge
#

so yall im using the orbs to show their orbs currency

quaint mantle
#

hello

warm mica
hazy parrot
quaint mantle
#

i have been reading up on databases a lot lately, and there is a lot to it, it seems.

hushed spindle
#

oh man just wait til you find out you actually have to persist that data or its all gonna go away when you shut the server down

tardy delta
#

hmm would it make sense to use System.err here or is that only for errors?

quaint mantle
#

System.err is for the error STD stream of your process.

neon badge
tardy delta
#

dunno how that helps me

pseudo hazel
#

then what is

remote swallow
#

we are telling you to learn java

quaint mantle
#

use this,getLogger.warn(); in your plugin.

remote swallow
#

it will solve like 90% of ur issues

tardy delta
#

its a standalone lib without logger lol

hushed spindle
pseudo hazel
#

the issue is that we are not syntax parsers, all these things you have stumbled upon are just java syntax issues, which you can only solve by learning the language

quaint mantle
#

use this.getLogger.warn(); in your plugin.

#

for STD error stream.

neon badge
hazy parrot
pseudo hazel
#

well its not basic enough if you stumble over it like you do now

hushed spindle
#

if we help you figure out this one plugin you will not have learned anything and you will continue to ask questions

remote swallow
hushed spindle
#

you're wanting to do a small currency plugin i take it right?

#

thats the most basic of basic plugins

neon badge
#

So its "basic" to solve this?

hushed spindle
#

yes

#

very

quaint mantle
hushed spindle
#

of course it depends im exaggerating slightly

#

but for purely having currency thats basic as hell

neon badge
quaint mantle
#

not really.

hushed spindle
#

why isnt it? its just storing a number with a player value and persisting that data

#

thats what i mean with basic currency

quaint mantle
#

it is not as simple as you imagine it, though.

hushed spindle
#

if you wanna be able to do anything with that currency you're laying features on top of that

quaint mantle
#

oh yeah, i forgot about spigot persistence api.

neon badge
#

Bro i already made the freaking currency and value and all that im just tryna get this value into the scoreboard

quaint mantle
#

then yeah, it is pretty simple.

neon badge
#

THATS VERY "basic"

hushed spindle
#

it is lol

quaint mantle
#

i was thinking of a database just now.

quaint mantle
#

i have been thinking about databases quite a bit lately.

hushed spindle
#

you're literally just misusing the format method

remote swallow
hushed spindle
#

and the map call thats failing for one reason or another

tardy delta
neon badge
hushed spindle
#

why the map call is failing i cant tell without seeing the rest of the code

remote swallow
#

if you want to call a map in another class you need an instance of that class or the map to have a static getter if it is static

quaint mantle
sacred prairie
#

Hi, im trying to get a file from my plugin in the resource folder, but when i use my method i get this error: java.lang.IllegalArgumentException: URI is not hierarchical this is my method to get the file: java public File getFileFromResource(String fileName){ ClassLoader classLoader = me.CarsCupcake.SkyblockRemake.Main.class.getClassLoader(); URL resource = classLoader.getResource(fileName); if (resource == null) return null; else { try{ return new File(resource.toURI()); }catch(Exception e){ e.printStackTrace(); } } return null; }
And this is my argument for fileName: "schematics/test.schem"

tardy delta
remote swallow
#

you want to call a map in another class

sacred prairie
remote swallow
#

orbs is in another class

hushed spindle
#

did you make your method static by any chance

sacred prairie
#

it returns URL

remote swallow
#

you get an instance of that class

#

and call the method

tardy delta
#

you dont

neon badge
#

oh wait my bad its this one

remote swallow
#

yeah

neon badge
#

But this is already in another class

sterile axle
sacred prairie
#

file not found

remote swallow
sterile axle
#

oh wait

remote swallow
#

if you say idk you already know the response

sacred prairie
hushed spindle
#

its public static so he should be able to do <class>.orbs

#

its an ugly method but it works

sterile axle
#

you're trying to load it from the class loader, that means you're trying to get it from /inside/ the jar

#

is that right?

sacred prairie
#

yes

sterile axle
#

ok

quaint mantle
sterile axle
#

just making sure

quaint mantle
#

or templates.

hushed spindle
#

the generics dont need to be specified in the new HashMap<>() part

sterile axle
#

try just / in front, not ./

neon badge
#

yea right

sacred prairie
#

its in here

sterile axle
#

do /schematics/test.schem

remote swallow
sacred prairie
hushed spindle
#

9xx2 you are so dense it's unreal

sterile axle
#

with no dot in front

remote swallow
#

you got given an example, you removed that example

hushed spindle
#

you're misusing the method and complaining it's not working right away

#

there's several steps of what you did wrong

remote swallow
#

String.format("This is a very cool number: %.0f", input); this is what you got given

#

you removed the entire string in it

quaint mantle
remote swallow
#

the string is what determins the format

remote swallow
quaint mantle
#

ok.

remote swallow
#

we have all said to learn java atleast twice each

sterile axle
#

why are you guys trying to help somebody who very clearly has no idea how to write Java

#

just stop

sacred prairie
quaint mantle
#

first letter of a class name in java is upper case, by naming convention, probably.

hushed spindle
#

in your case you probably want to use String.format("orbs: %.1f", economies.orbs.get(uuid))

quaint mantle
#

so just make em uppercase.

remote swallow
hushed spindle
#

thats the most ill spoonfeed you

quaint mantle
#

oh.

#

ok.

tardy delta
hazy parrot
sterile axle
sacred prairie
#

in here is a file that i want to load

remote swallow
sterile axle
#

they're using ClassLoader#getResource

remote swallow
#

ahhh\

sterile axle
#

which returns URI

tardy delta
#

cant you just do File f = new File(plugin.getDataFolder(), "schematics/somefile")?

sterile axle
#

it's in the jar

tardy delta
#

wait

sacred prairie
#

data folder is not the jar

tardy delta
#

mess with JavaPlugin#getResource

sterile axle
#

you need to get it as an inputstream, copy it, then get the file

remote swallow
#

JavaPlugin.getResource("schematics/somefile") would also work

tender shard
hushed spindle
#

idk im enjoying calling him stupid

tardy delta
#
InputStream inputStream = Files.newFileInputStream(plugin.getResource("schematics/x.y"));
Path filePath = Paths.get("output.txt");
File file = Files.copy(inputStream, filePath, StandardCopyOption.REPLACE_EXISTING).toFile();``` or smth
neon badge
hushed spindle
#

bruh

#

good christ

#

go away

neon badge
#

brotha

hushed spindle
#

dont brotha me

remote swallow
#

learn java

#

then come back

hushed spindle
#

mf doesnt know what a string is

#

piss off

neon badge
#

Dude i know??

hushed spindle
#

"its for messages" ๐Ÿ—ฟ

remote swallow
#

๐Ÿ—ฟ

neon badge
#

dude

#

like

hushed spindle
#

no

neon badge
#

its for if you wanna send something

hushed spindle
#

๐Ÿ—ฟ ๐Ÿ—ฟ ๐Ÿ—ฟ ๐Ÿ—ฟ ๐Ÿ—ฟ

tender shard
#

go troll somewhere else

quaint mantle
#

i am just quietly lurking and spectating.

remote swallow
#

none of us are going to spoonfeed you all the code you want

tender shard
#

is there still no option to completely hide messages from blocked people?

remote swallow
#

with bd yes

hushed spindle
#

ive literally already spoonfed it and he still dont know

tender shard
#

I still always see this annoying "2 blocked messages" shit

hushed spindle
#

go away

#

play with tutorial websites

remote swallow
neon badge
#

holy moly smokes getting help in ohio fr

sterile axle
#

you've been helped

#

you just won't listen

hushed spindle
#

you'd probably be the one crashing the dangerous chemical train bro

remote swallow
#

?learnjava!

undone axleBOT
remote swallow
neon badge
#

I didnt bro they told me to add a string and i did it

hazy parrot
#

tbh if alex blocks you, you really fucked up smth hard

tardy delta
#

bruh

sterile axle
#

String.format("your string here", your, replacements, here);

is how that method works

hushed spindle
#

sometimes finding a person this dense is very entertaining

neon badge
#

Thannks ma boi

sterile axle
#

you were told that, but you refused to do taht

remote swallow
#

waiting for the "whats X mean"

neon badge
hushed spindle
#

that should be telling

#

that you are in fact super duper dense

#

you should try opening up to other ideas sometime

#

it's very freeing

hushed spindle
#

oh my lord

remote swallow
#

I FUCKING KNEW IT

neon badge
#

?

sterile axle
#

I am too busy to help in DMs right now, I believe you have the brainpower to solve this yourself

#

Believe in yourself

tender shard
neon badge
#

hell naw bruh

hushed spindle
#

honestly thats a bargain

tardy delta
#

alex expensive asf

quaint mantle
#

hire me and i will basically code this plugin up for you, 2000 dollars.

hushed spindle
#

get out your moms credit card

quaint mantle
#

trust me, it will be one of the most optimised plugins lol.

tardy delta
#

i want to see first

quaint mantle
#

i wonder how long this will continue lmao.

hushed spindle
#

i wanna see what he dmd simple now

tender shard
#

he's already annoying everyone for 1.5 hours now

hushed spindle
#

got a pretty clear idea of what

#

but just gotta be sure

#

honestly its funny as fuck

#

asking him to check dms got me giggling

sacred prairie
tardy delta
#

dont you have the Files class?

#

outdated java version then

sacred prairie
#

no

#

i use 17

quaint mantle
#

you guys really put up with some messed up stuff, for the amount of expertise i sometimes see some of the members have.

tardy delta
#

heh

neon badge
sacred prairie
#

and files class existing

remote swallow
#

its predictable what he was gonna say

#

it was so easy

sacred prairie
#

but not the method

sage patio
#

just ignore

sacred prairie
# tardy delta heh

i mean the method is not existing and in my project i dont have a files class

hushed spindle
neon badge
sacred prairie
hushed spindle
#

everyone loves attention

sterile axle
#

yall get way too pressed over this stuff

neon badge
#

fr

hushed spindle
remote swallow
hazy parrot
hushed spindle
#

it not ? bru

tardy delta
#

isnt

sacred prairie
quaint mantle
#

nvm.

tardy delta
#

nio

sacred prairie
#

ye i use the one from nio

tardy delta
#

kinda surprised cuz i have it on 1.17

hazy parrot
#

i think files were already introduced in java 8

quaint mantle
#

so, i have been reading up and watching tutorials on the mysql database over the last few hours, and there seems to be a lot to learn here.

sacred prairie
quaint mantle
#

its not just a new language.

#

its different for every database.

#

not syntax wise, but like how it works.

#

and optimisations.

hazy parrot
#

wdym ?

sacred prairie
quaint mantle
#

each database uses its own kind of indexing and data structures probably.

hazy parrot
sacred prairie
#

as i told you

#

that was just proof

quaint mantle
#

anyway, i have been using sqlite in my main project and, would the sql syntax i write for sqlite run the same as it would in mysql?

hazy parrot
quaint mantle
#

hm

#

i might have to read up another documentation as well probably.

hazy parrot
#

can't really tell you what on top of my head

wet breach
#

most of the stuff is interoperable between both

#

but as Goksi said there is certain minor stuff

#

that is different

#

like BLOB's for example I think

quaint mantle
#

the most important for me is the optimisations and indexes.

#

i am super sensitive about the runtime complexity and performance of my code.

wet breach
#

not sure if sqlite has indexes ๐Ÿค”

quaint mantle
#

it does.

hazy parrot
#

wdym by indexes ?

#

autoincremented key ?

quaint mantle
#

they make queries faster.

#

is probably what they are used for nearly all cases.

hazy parrot
#

TIL about indexes lmao

wet breach
quaint mantle
#

if you dont write good indexes, you probably should use a plain text file, probably. Won't make much difference, performance wise, i assume.

#

is what it appears to be.

hazy parrot
#

noone even mentioned it in my school lmao

#

good to know

wet breach
#

lmao

quaint mantle
#

its not really taught in school is what i have noticed as well.

#

or even in universities perhaps.

wet breach
#

there is many DB related things not taught

hazy parrot
quaint mantle
#

probably because it is so different for each database.

tardy delta
wet breach
#

like, creating functions on MySQL ๐Ÿ˜›

hazy parrot
tardy delta
#

just look at the inputstream methods

wet breach
#

oh that is very good you learned that then

hazy parrot
#

but i really don't like its syntax

sacred prairie
hazy parrot
#

create function x
begin
end

wet breach
#

there is two ways to create functions for mysql

#

you can create a function via a query

#

or you can create a static function from the backend side

quaint mantle
#

in the program code?

wet breach
#

doesn't need to be code specifically

hushed spindle
#

i just get the sha1 with mc-packs.net, though im sure theres also a direct sha1 converter without having to upload a pack to some service

quaint mantle
#

functions are not really nice to use though in mysql, they might prevent the indexes from being used and make the queries perform slower.

hazy parrot
#

there is also view thingy, i never understood what that is used for

tardy delta
hazy parrot
#

create view x

wet breach
sacred prairie
hushed spindle
hazy parrot
wet breach
#

think of it like inventory views

#

you can have multiple views on the same data

sacred prairie
hazy parrot
wet breach
#

you could consider it one yes

hazy parrot
#

you literally explained better in 2 sentences then my professor lmao

tardy delta
hushed spindle
#

actually you can also use sha1-online.com to convert your link to sha1, with mc-packs.net you'd need to use the mcpacks link for server.properties

sacred prairie
tardy delta
sterile token
wet breach
#

a view is obtained from a resultset and is a virtual table

#

the fields in a virtual table can be fields from one or more real tables in a database

#

But yeah as I said, it is just a way to look at the same data but in different ways

hazy parrot
#

Thanks ๐Ÿ‘

quaint mantle
#

seems kind of inefficient, write something in the program to do that kind of thing?

hushed spindle
#

what for

wet breach
hushed spindle
#

why

quaint mantle
#

check the format

#

if its 8 bit string or not?

lost matrix
#

You dont need the hash of the link, you need the hash of the resourcepack

sterile token
#

What the best option for displaying timestamps into seconds, hours, etc without messing a lot ?

quaint mantle
#

you need to specify the charset or whatever.

quiet ice
#

doesn't that hash the link?

lost matrix
quiet ice
#

Use a command such as sha -1 * to compute sha-1 checksums (provided you are on a system that supports sha, but that should be the case under linux)

sterile token
lost matrix
#

Using guavas hashing utility:

File resourcePack = ...;
String hash = Files.hash(resourcePack, Hashing.sha1()).toString();
sterile token
eternal night
#

that is a lot of lines tho kekw

sterile token
eternal night
#

you and the message digest

sterile token
#

oh right

#

its better to reply haha

#

Yeah i just said an alternative

eternal night
#

Welp minecraft expects an sha1 hash tho

sterile token
#

Any reason why java didnt already implement a good time parser, so then you can parse time better. Instead of harcoding for parsing time formats like: 1h, 20w, 50s, etc

#

What are you expecting to do?

#

oh right

#

Now everything makes sense for me

lost matrix
#

Then call .asBytes() instead of .toString()

#

Minecraft already has this feature built in

sterile token
#

That can be modified by spigot files ๐Ÿคฆโ€โ™‚๏ธ

grand flint
#

How can I stop only INVISIBLE item frames from being destroyed if they are not attached to a block?

sterile token
#

oh wait i remember it used to be atleast on 1.8, maybe was pruned on nwer versions

tardy delta
#

probably want to make my errors a lil better

sick ermine
#

I want to install adventure api but I am facing such an error,

quiet ice
#

did you add adventure's repo

sick ermine
#

yes

quiet ice
#

nah, should be on maven central

sick ermine
quiet ice
#

Uhm, then invalidate caches, restart your IDE and if that doesn't work install eclipse

quiet ice
quiet ice
#

Did you reload the maven project?

sick ermine
quiet ice
#

That is for snapshot builds

#

You want regular builds though

grand flint
#

How can I stop only INVISIBLE item frames from being destroyed if they are not attached to a block or if they are in another block?

quiet ice
#

Ah that is another story...

#

Disable offline mode

#

or use a proper build environment

twin venture
#

once the countdown hit 0 , it spam the error

sick ermine
#

how do i disable offline mode

quiet ice
#

I don't know - you should know how to use your IDE

sterile token
#

Suggestions are open, i want to get recommendations if possible

sterile token
sterile token
# neon badge This?

I wont recommend coding anything without first learning the lang where you are cooding, you will have lot of issues if not what i tell u is from bad personal experiences i used to have

remote swallow
sterile token
remote swallow
#

maven offline mode

#

read the photo

sterile token
regal scaffold
#

He never looks at context

sterile token
#

Yesterday i was asking about a time issue because it was getting negative the time value, and they where saying me to use a HashMap when i was using Redis as Cache ๐Ÿ’€

chrome beacon
sterile token
#

?paste

undone axleBOT
sterile token
#

Please send full stack trace there - thanks

twin venture
#

oky

chrome beacon
sterile token
#

Olivo, i need your suggestion?

gleaming grove
#

I'm not getting this, I always thought that returned value of server.dispatchCommand(this, command)
represents whether result of onCommand for certain CommandListener successful or not.
However it seems that Spigot do nothing with result of execute so my question is why
public abstract boolean execute(@NotNull CommandSender var1, @NotNull String var2, @NotNull String[] var3); returns bool?

quiet ice
chrome beacon
#

but yeah looks fine

quiet ice
#

and that, yeah

sterile token
#

I ask because i want to know if its good to be used or can a be a better way for displaying cooldown/times

twin venture
#

i added the code too

sterile token
#

perfect

chrome beacon
twin venture
#

new BukkitRunnable?

chrome beacon
#

Your class extends BukkitRunnable

#

so you can call the run methods on it directly

twin venture
#

ok

regal scaffold
#

See it's not exactly the same as running correctly or not. Doesn't check that just checks for the target

twin venture
#

so like this?

gleaming grove
#

ye but still why does CommandExecutor.onCommand returns bool? how this bool is interpreted by spigot?

chrome beacon
regal scaffold
#

Is that the answer you were looking for?

eternal oxide
#

if you return false Spigot will show an error message for that command

sterile token
regal scaffold
#

The error isn't with the execution of the command itself it just checks if it's a valid command so if it was registered before

eternal oxide
sterile token
terse ore
sterile token
eternal oxide
wet breach
#

it is dependent on how you coded the return for your command

gleaming grove
#

so how can I trigger command with code and obtain onCommand(CommandSender sender, Command command, String label, String[] args) result? As we discuss before server.DispatchCommand() returns only information if command was found or not

chrome beacon
wet breach
#

if you code your command to always return true

#

then the bool returned isn't always helpful you know ๐Ÿ˜›

sterile token
#

yeah i prefer better using voids throwing custom command exception! ๐Ÿ‘

#

And then on my command parser cacthing them

bold vessel
#

?pdc

sterile token
#

?? ๐Ÿค”

#

Im not using pdc...

bold vessel
#

its for me

sterile token
#

ohh lmao

grand flint
#

How can I stop only INVISIBLE item frames from being destroyed if they are not attached to a block or if they are in another block?

dry zinc
#

Is there a way to gift other users on spigot plugins?

#

Like buy it for someone else?