#help-development

1 messages · Page 99 of 1

smoky oak
#

and

#

whats the height in pixels or distance units the three water levels are?

young knoll
#

Iirc cast the BlockData to Levelled

smoky oak
#

d'oh

#

so APPARANTLY a cauldron is NOT a filled cauldron

#

wth

#

why isnt that part of blockdata

#

WATER_CAULDRON

#

srsly

#

isnt sh a power shell only thingy

undone axleBOT
#

The PlayerInteractEvent may be called once per hand. If you only want code to be executed once, you can check the result of https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/player/PlayerInteractEvent.html#getHand(), then decide functionality.

For example, only executing code if the main hand was used:

@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
    if (event.getHand() != EquipmentSlot.HAND) { // * if the hand used is NOT the main hand:
        return; // do not progress past this point  |
    }
    // provide functionality
}
amber bronze
#

should i import minecraft_server.1.12.2.jar or mapped.cf6b1333.jar

smoky oak
#

uh are you on maven

amber bronze
#

yes

smoky oak
#

1sec

#

?paste

undone axleBOT
smoky oak
#

take note that this is for 1.19.2

amber bronze
smoky oak
#

no not exactly

amber bronze
#

-revision=1.12.2

#

i did that

smoky oak
#

ah i meant the pom

#

it references the version

amber bronze
#

but shoudld i use minecraft_server.1.12.2 or mapped.cf6b1333.jar

smoky oak
#

you need to change the 1.19 in my pom to 1.12 in yours

amber bronze
#

i have

smoky oak
#

it gets automatically imported

#

or should

amber bronze
#

im asking which jar should i use

smoky oak
#

ah

#

the minecraft_server

#

i thought you meant which api

amber bronze
smoky oak
#

?

#

paste ur pom.xml

#

?paste

undone axleBOT
drowsy helm
#

Is there even a remapped 1.12

smoky oak
#

there should be

amber bronze
smoky oak
#

oh ffs

#

I TOLD YOU

#

you need to change your frigging pom xml so that it includes the 1.12 version of what i posted

#

ofc you cant use remapped if you dont import it

#

im so done

amber bronze
#

what i need to change

smoky oak
#

copy paste the dependency you have

#

then remove the -api from one of the dependencies

scarlet creek
#

How do I disable item movement using the number keys?

smoky oak
amber bronze
smoky oak
#

yea now reload your config

amber bronze
#

reloaded

#

already

#

Cannot resolve org.spigotmc:spigot:1.12.2-R0.1-SNAPSHOT

scarlet creek
# smoky oak cancel appropriate inventory event

Sorry, I meant I am trying to disable the movement of an item in a specific slot to another slot, however it isn't working and I'm not sure what to do,
Code:

    public void onRemoveElytra(InventoryClickEvent event){
        if (event.getWhoClicked() instanceof Player){
            if (event.getSlot() == 0){
                System.out.println("clicked");
                event.setCancelled(true);
            }
        }
    }```
iron glade
#

InventoryDragEvent or smth like that iirc

scarlet creek
#

Ah

drowsy helm
#

getWhoClicked will always be a player

smoky oak
drowsy helm
#

No need to check

amber bronze
#

im using intellij

#

and i import it like this

smoky oak
#

well yea but did you click this

amber bronze
smoky oak
amber bronze
smoky oak
#

its possible that your import is messing with the auto import

amber bronze
#

nah

smoky oak
#

hm. did you add both dependencies

amber bronze
#

mapped one?

#

no

drowsy helm
#

Looks like tou havent run buildtools correctly

amber bronze
#

importing mapping did this

#

so i have this

#

but still not what i need

#

and someone said about powershell

bold solstice
#

Hello, I need help with adding another line of text above the player's name it would be really helpful if u helped me. I've researched for a few days to try and find a solution, one of the more popular methods I came across is having a mob riding on you with a custom name tho it hides the main name, another popular method I came across and I tried to do this one aswell is to have an armorstand with the custom text teleported to that exact position I want it every tick but if I F5 I can see it lagging behind me tho for other players it looks just fine. please help

drowsy helm
bold solstice
drowsy helm
#

The regular usename tag isnt

#

Unless you’re using a riding mob, you cant stop that lag

#

Minecraft movement is predictive

bold solstice
#

is there any other way of getting it done

drowsy helm
#

Either use a riding mob or just make it invisble to the player who owns the tag

bold solstice
#

I see

#

thank you for ur help

sacred mountain
#
        try {
            gson.toJson(registeredPlayersManager, new FileWriter(data));
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }```
drowsy helm
#

You’re trying to turn a filewriter into json?

#

Thats the issue

smoky oak
#

whys the spigot doc website so laggy now

sacred mountain
drowsy helm
tardy delta
#

it doesnt know how to serialize a file? idk what that java.lang.String is doing there

#

if you dont want fields to be serialized, declare them as transient

drowsy helm
#

It’s trying to serialize the FileWriter class itself

tardy delta
#

it shouldnt

drowsy helm
#

I think they’re trying to serialize the data then write to file

tardy delta
#

it only provides a way to let gson write to a file?

drowsy helm
#

Ah didnt realise you could pass filewriter

#

Means the data object is whack

tardy delta
#

had so many related issues with gson

sacred mountain
#

custom player object

#

HashMap<UUID, Player> registeredPlayers = new HashMap<>();

#

i wanna be able to save it to json and then retrieve it from the json file

smoky oak
#

?????????

#

cant u just save the list of uuids

#

a uuid always identifies a player

crimson terrace
#

you can always retrieve the Player connected to a UUID, if they are online.

sacred mountain
smoky oak
#

. . .

sacred mountain
#

my naming skills aren't up to scratch

tardy delta
#

is that a custom player class?

sacred mountain
#

nothing to really to with the player

smoky oak
#

ill not write a serializer for u

sacred mountain
#

its more of a bind

tardy delta
#

rename that class pls

sacred mountain
tardy delta
#

doesnt the default serialisation work?

crimson terrace
#

Im pretty sure for that you could just serialize each entry

#

Entry as in Key-value pair

tardy delta
#

^^

#

is that error thrown when you try to serialize your map?

sacred mountain
#

yea

tardy delta
#

do you have a file object in your player class?

sacred mountain
#

whats the best way to do this btw

#

im currently doing it with gson

sacred mountain
tardy delta
#

best way would be writing a proper db impl

echo basalt
tardy delta
#

can you paste that player class

echo basalt
#

for other players you can mess around with packets instead of events so both packets are sent at the same time

tardy delta
#

?paste

undone axleBOT
crimson terrace
#

not sure if Im reading it correctly, but are you trying to access private fields via reflection?

sacred mountain
#

so u mean the class with the hashmap

crimson terrace
#

Gson might be doing that

tardy delta
#

gson is reflection bases ye

sacred mountain
tardy delta
#

and it doesnt know how to access smth in this case

crimson terrace
#

solution would be to try setting the field not private, but maybe protected?

sacred mountain
#

thats iterally it

crimson terrace
#

or non-final, never had that error

sacred mountain
#

idk wy i have a class for it, there used to be a lot more method

#

s

tardy delta
#

gson might now know how to serialize it

tardy delta
sacred mountain
crimson terrace
tardy delta
#

now sent PlayerQuest lmao

crimson terrace
#

shouldnt tho

sacred mountain
#

the playerquest object is also just more of that, theres a few nested objects

tardy delta
#

worked fine for me

sacred mountain
tardy delta
#

and please declare every field that shouldnt be serialized as transient

#

and uh you could optimize this by just calling 'return map.get' in first method and 'map.putIfAbsent' in second

sacred mountain
drowsy helm
tardy delta
#

i guess it doesnt know how to serialize component

#

:/

sacred mountain
#

o

tardy delta
#

not sure, if you would leave that field away and try again you'd be sure its that

#

or the Quest class

sacred mountain
#

it's serialized component before tho

#

i've seen it work, but something happened and idfk

tardy delta
#

dont you just have a github repo lol

#

kinda sucks pasting those classes

sacred mountain
#

yeah erm

#

ill make one rq

#

its a mess atm

#

was trying to make it quickly

#

just adding some comments and cleanup

#

gimme like 3 mins

drowsy helm
#

You can add a codec for it anyway right

tardy delta
#

whats a codec

drowsy helm
#

If the data cant be serialized natively. Just lets you use your own serialization

#

Not sure is gson even had that though

tardy delta
#

just add typeadapters/ serializers/ deserializers

drowsy helm
#

Component can be turned into json anyway right

tardy delta
#

probs

boreal seal
#

wondering hashmap <location,int>

#

or

#

<string,int>

#

i store an location to execute an event at the location

#

i use the int as timer

#

so mainly what would be better

fluid finch
#
world.spawnParticle(Particle.SPELL, new Location(world, loc.getX()+x, loc.getY(), loc.getZ()+z), 10, new DustOptions(Color.fromRGB(50, 205, 50), 1.0F));

Doesn't work: java.lang.IllegalArgumentException: data should be class java.lang.Void got class org.bukkit.Particle$DustOptions
In another class:

Bukkit.getWorld("TowerDefense").spawnParticle(Particle.REDSTONE,((Location)towers.get(towerID).get(4)).clone().add(new Vector(0.5,1,0.5)), 10, new DustOptions(Color.fromRGB(0, 255, 0), 1.0F));

Works perfectly fine

fluid finch
#

In the class that fails

#

in main

boreal seal
#

what api do u use?

#

ver

fluid finch
#

1.13

boreal seal
#

😢

fluid finch
#

I mean that's what I wrote in the plugin.yml

sacred mountain
#

i have another problem, whenever i save/retrieve data from my json file it creates a duplicate key in the file and doubles the file size

fluid finch
#

don't ask me how I made that conclusion I'm a total noob in development

reef lagoon
#

"Yes, I use eclipse and code 1.8 plugins"

fluid finch
#

the linked jar is 1.17.1

boreal seal
tardy delta
#

or just paste the two json files

sacred mountain
#

the 2 methods

fluid finch
#

How does it work in one class and not the other then tho

tardy delta
#

add a typetoken

sacred mountain
#

what's a typetoken

#

and how do i add

tardy delta
sacred mountain
#

thx

fluid finch
sacred mountain
#

no clue what to do lmfao

boreal seal
#

Emeraldtip

fluid finch
#

I gott aget the new focken api

#

pretty retraded of me

boreal seal
#

stick to the API of 1.19 then its an issue coding on 1.13

#

and running on 1.19

#

some methods cloud be changed and etc

#

its the same from 1.9-1.19

#

no really alot of diffrences

tardy delta
#

instead of

Map<UUID, Player> playerHashMap = gson.fromJson(reader, HashMap.class);```
do
```java
Map<UUID, Player> playerHashMap = gson.fromJson(reader, new TypeToken<Map<UUID, Player>>() {}.getType());```
boreal seal
#

and i tell u as a person who uses 1.2.5-1.8

#

which 1.7-1.8 are simillar but below tottaly different

boreal seal
hasty prawn
#

1.2.5

#

what

tropic hollow
#

Can someone help me setup a domain

sacred mountain
sacred mountain
hasty prawn
tropic hollow
sacred mountain
#

java.lang.RuntimeException: Unable to invoke no-args constructor for class net.vlands.survival.quests.internal.Quest. Registering an InstanceCreator with Gson for this type may fix this problem.

#

pain

#

oh its bc its an abstract class

#

Abstract class can't be instantiated! Class name: net.vlands.survival.quests.internal.Quest

fluid finch
#

sorry that my questions are just extremely stupid but is there a way I can just download a jar for 1.19, add that to build path and just be on my way?

sacred mountain
#

buildtools

#

generate it for u

hasty prawn
#

?bt

undone axleBOT
fluid finch
#

aight another 30 min trip here we go

sacred mountain
#

@tardy delta java.lang.RuntimeException: Unable to invoke no-args constructor for class org.bukkit.potion.PotionEffectType. Registering an InstanceCreator with Gson for this type may fix this problem.

#

full error

smoky oak
#

ur trying to do something ur not allowed to

#

im guessing youre trying to make a copy of potioneffecttype

ivory sleet
#

I mean gson ships a generic enum type adapter

#

I think?

echo basalt
#

gson sees it as an abstract class?

sacred mountain
#

might rewrite the reward class, i think its something to do with this:

#

i'll just create my own potioneffect reward class and make it serializable

#

because currently i think its gonna do the whole of the potioneffect stuff

echo basalt
#

maybe serialize the ordinal instead?

ivory sleet
#

Which would address abstract class hierarchies

tardy delta
#

PotionEffectType a class now?

#

yep

#

i guess register a deserializer which calls PotionEffectType.getByName

#

i cant type smh

ivory sleet
#

OptionEffectType kekw

#

Might help you

sacred mountain
#

ooh ok having a look

ivory sleet
#

Look at their first example <:

sacred mountain
#

mkay

tardy delta
#

thats now the reason i stopped using gson

#

too much shit to achieve something

ivory sleet
#

What do you use instead?

#

jackson? Moshi?

tardy delta
#

sqlite kekw

ivory sleet
sacred mountain
#

i feel like this is cleaner than having one reward class that has a bunch of null variables

tardy delta
#

uhh anyways does anyone know how i can see my newly created branch on gh

#

did git checkout -b experimental

ivory sleet
#

Did you create a branch downstream?

tardy delta
#

created it locally

#

if thats what you mean

ivory sleet
#

Mye more or less

tardy delta
#

ill probably have to do a commit first

ivory sleet
#

Yeah probably

#

But else

#

You just push the branch iirc

#

And it should appear at origin

tardy delta
#

ah yep there was an option

ivory sleet
#

Ya might have to check it out first tho unsure

tardy delta
#

oh im used to fucking things up with git

ivory sleet
#

Same lol

sleek badge
#

How do I check wether an argument of my command is a String

tardy delta
#

uhh i mean the arguments is a string array so ofc they're all strings 🤔

sleek badge
#

oh yeah i forgot

#

dont bully :( im new to java

crisp forum
#

In older versions of spigot I was able to use

p.spigot().sendMessage(TextComponent)

how can I send a text component to the player in Spigot 1.16

ivory sleet
#

same

#

Player.Spigot::sendMessage takes a BaseComponent iirc (and an array one)

crisp forum
tardy delta
#

BaseComponent... iirc

ivory sleet
#

oh yeah might be a vararg

tardy delta
#

or normal array whatever

ivory sleet
#

Metu what dependency are ya using

tardy delta
crisp forum
ivory sleet
#

uh well thats odd

boreal seal
#

si bump to my question

#

<string,int> , <location,int>

#

what would be better

#

an object or an string of location?

crisp forum
#

I'm importing

org.bukkit.entity.Player btw

ivory sleet
river oracle
ivory sleet
#

tho depends on what you're doing evan

river oracle
#

That co tains x y x and yaw if needed

tardy delta
#

and make it immutable 🤤

ivory sleet
river oracle
#

Parsing a string for location on every call sould just be annoying

#

I've never had to invalidate caches on vsc so clearly vsc on top

tardy delta
#

vsc doesnt even have that

ivory sleet
#

except having to download like 20 extensions kek

crisp forum
ivory sleet
#

ye

crisp forum
#

how can I do this? I've restarted intellij

river oracle
tardy delta
#

File > invalidate caches

crisp forum
#

like does it store caches in a folder?

ivory sleet
#

idk if u can see but there

tardy delta
#

flipping screen dang

ivory sleet
#

hehe

river oracle
#

Tf your second screen is long

ivory sleet
#

vertical

#

metu sort of

#

it indexes a lot of shit which gets cached

#

sometimes intellij is drunk

boreal seal
#

and integar to represent timer

tardy delta
#

first screen is big too

boreal seal
#

pretty simple

#

so what would be best way to store an block

#

so far hashmap is great for those kind of things in general

#

i would either make a different type of storage but i dont see a reason why not use an hashmap

ivory sleet
#

Map<Location,Integer> is extremely dangerous

#

and can if used wrongly result in memory leaks (due to Location being mutable)

#

Which is why you probably want to write an immutable version of Location for yourself

#

and then use that

river oracle
#

Immutable as well 🔥

#

Why tf is location mutable

tardy delta
#

record 🤤

ivory sleet
#

yeah lmao

#

it is

#

cuz bukkit kinda old ig

crisp forum
ivory sleet
#

uh

tardy delta
#

why does bukkit still has the Consumer class

ivory sleet
#

probably in case someone uses it

tardy delta
#

dunno if its still in the latest versions

river oracle
#

spigot should use 1.20 as the fuck it up and add all the breaking changes to the code lol

ivory sleet
#

does it become red?

#

the assignment expression

twilit roost
#

how can I make progress bar?
Coloring |||||||||||||| and resulting it in progress bar?

crisp forum
ivory sleet
#

thats weird

glossy venture
tardy delta
boreal seal
#

i got 256 gb ram in my dedicated server

glossy venture
#

easy as numberOfBars * progress (where progress is a float between 0.0 and 1.0)

boreal seal
#

but optimization is always required

#

😄

river oracle
twilit roost
ivory sleet
#

myes, but memory leaks will in long term eat up your ram

river oracle
#

also don't run a spigot server on that much you'll lag your server

tardy delta
#

saw it before

ivory sleet
#

they're usually quite subtle at first

boreal seal
#

every 4 hours

tardy delta
boreal seal
#

i abuse cache anyway loading ton of data into it

river oracle
#

don't use your server specs to produce sh it code lmao

boreal seal
#

ik ik

#

ill might store it differently

ivory sleet
#

I mean if you want a malfunctioning design + memory leaks Ig go ahead and use Map<Location,V>

boreal seal
#

nah nah ty

ivory sleet
#

nothing's technically stopping you

boreal seal
#

ill do a custom class

#

learning is always better

ivory sleet
#

alr sounds good

boreal seal
#

not sure what he meant by custom class

#

all i have in my head is storing those not in hashmaps

#

but in files

ivory sleet
#

a class that redefines all of the properties from location

#

x,y,z yaw and pitch

boreal seal
#

X,Y,Z are the only requriments

ivory sleet
#

but is does not allow reassignment once created of said properties

boreal seal
#

i cloud make X,Y,Z into a string and then read the string

#

like ; ; ;

ivory sleet
#

oh then you can in theory create an immutable vector

boreal seal
#

123;100;100

tardy delta
#

record Position(double x, double y, double z) {}

boreal seal
#

but hashmap will still be needed indeed no

ivory sleet
#

record Vec3d(int x, int y, int z){}

boreal seal
#

i use hashmaps as timers oftenly

ivory sleet
#

yeah

boreal seal
#

for different shit

ivory sleet
#

probably is

#

same

boreal seal
#

so whats the point of making custom class?

#

if i will either clean the map

#

since it will be -1 for all the containing

#

if it achives 0

#

it will be removed

ivory sleet
#

I mean to avoid the error proneness of Location as K type for your Map?

#

But I mean there are other benefits also design wise

boreal seal
#

k brb i got to make quick shower i had no toilet paper

#

so my ass is dirty

#

;c

ivory sleet
#

ok lol

boreal seal
#

i just came back to get some underwear

ivory sleet
#

gl

ivory sleet
crisp forum
#

my imports:

glossy venture
crisp forum
#

I have to send a TextComponent

glossy venture
#

though there should be a Player.Spigot too

glossy venture
#

thats in commandsender spigot

ivory sleet
#

Player.Spigot derives it

glossy venture
#

yeah

eternal oxide
eternal oxide
#

you can player.spigot() fine, but Player.Spigot ?

crisp forum
#

I can't use player.spigot() finely

ivory sleet
#

yes just creating a nullary variable to see if the ide recognizes the type at all

eternal oxide
#

ah

#

Player.Spigot spigot = null; works fine

fluid finch
#

Well I just discoeverd that wasn't the issue

#

apparently redstone particles are the only ones that support custom colors

fluid finch
#

now my question is:
Is there a way to spawn potion particles on the ground (like the lingering potion effects)

#

that have different colors based on the potion

eternal oxide
crisp forum
#

intellij

glossy venture
# crisp forum

maybe delete maven or gradle cache for the spigot api and invalidate caches in ide too

waxen plinth
eternal oxide
#

type p. and screen shot the options

waxen plinth
fluid finch
#

oh cool

#

thx

waxen plinth
#

Oh wait it's deprecated

#

lol

fluid finch
fluid finch
#

well deprectaed works for me

waxen plinth
#

Wrong entity

#

This is the right one

fluid finch
#

aight tysm

glossy venture
#

maybe try like mvn command --update

#

mvn clean install -U

#

this

crisp forum
#

I dont have mvn installed

eternal oxide
glossy venture
#

can you show your dependencies

crisp forum
#

where should I paste my pom?

glossy venture
#

?paste

undone axleBOT
eternal oxide
#

?paste

undone axleBOT
crisp forum
glossy venture
#

might need to install mvn or use something in intellij to update maven cache

gray merlin
#

Is NMS not available on 1.17.1 spigot api?

glossy venture
#

pretty sure nms isnt available with the api anywhere

ivory sleet
#

^

glossy venture
#

you need to use BuildTools and install to local repo

#

or include the jar file

gray merlin
#

Isn't buildtools just for the servers though?

crisp forum
#

I believe they can use paper nms thing

ivory sleet
#

yes but nms is shipped with the server jar

gray merlin
ivory sleet
#

and buildtools when ran installs a server jar dependency for u to depend on

glossy venture
#

if you use gradle you can use paper userdev

#

to get remapped

upper vale
gray merlin
#

I'm porting my plugin from 1.7.10 all the way up to 1.19, and i'm now on the 1.17.1 version. Suddenly, the entire NMS reflection broke. Did NMS change here? Is it not stored on net.minecraft.server.* anymore?

chrome beacon
#

Yeah

gray merlin
#

"Yeah"?

chrome beacon
#

Classes aren't relocated and methods are unmapped

#

Unsure about that first part was going to check

eternal oxide
crisp forum
#

I don't I believe

#

I'm not importing anything about CraftBukkit

eternal oxide
#

You have a player object, just not a Spigot one. You have something providing it and its not the Spigot API

crisp forum
#

I'm not importing it. How is it possible?

crisp forum
eternal oxide
#

Yes, those are class imports. I'm talkign about dependencies in IJ

crisp forum
eternal oxide
#

yes

analog vapor
#

so for developing spigot plugins, java is the base?

dusk flicker
#

yes

crisp forum
eternal oxide
#

Its possible that is Spigot 1.8. That has an awardAchievement method

analog vapor
#

So I need to learn it, currently I am learning it with Code academy, so when do I know I am ready for spigot

dusk flicker
#

Finish the courses, do other ones

eternal oxide
dusk flicker
#

When you can write decent programs in normal Java move into Spigot

eternal oxide
#

looks like

analog vapor
#

how much time will it take if I invest 2 hours a day, approximate figures are totally alright

dusk flicker
#

Java is a massive language

crisp forum
#

I just saw this

analog vapor
#

so more than years?

dusk flicker
#

I'd spend a few weeks if not a month just going into Java prior to Spigot

gray merlin
#

Learning isn't a mathematical constant. It varies for everyone.

dusk flicker
#

^

eternal oxide
analog vapor
#

there must be an average right

dusk flicker
#

Everyone's different

analog vapor
#

like how massive etc, I know the caliber differs

dusk flicker
#

That's why I'm trying to stay away from exact numbers when telling you time, cause really we don't know exactly

analog vapor
#

hmm so I will have to figure that out by actually doing it

gray merlin
# analog vapor there must be an average right

It's not like anyone went around and asked people "how long did it take you to learn java and feel comfortable to program in Spigot" to calculate the average, but there must be one uncalculated one, yes.

analog vapor
crisp forum
dusk flicker
#

I'd bet a good percent of us started with spigot but that makes it a lot harder lol

analog vapor
#

move to the paid ones afterwards if needed

#

even tho I am sure I will need them haha

gray merlin
#

Yes, and when you feel comfortable enough, move to spigot. That'll depend on you, really. Learn OOP and java basics/intermediates.

gray merlin
analog vapor
#

OOP?

sharp gate
#

Question: my goal is to automatically make a player ride a boat when they place it. Is there a good way to get the player who placed the boat? In my use case, multiple players will likely be nearby to the boat when the boat is placed, but because I only want the "creator" of the boat to automatically hop in it, I don't think that getting the nearest player is the best approach. Any suggestions?

crisp forum
gray merlin
#

Object Oriented Programming, essentially what 90% of java programs are built upon

#

Because for some reason there's functional programming in java now

eternal oxide
#

you are using somethign out of date

analog vapor
gray merlin
#

It's a programming style, if you learn java, you'll learn it xD

crisp forum
#

This is not my project :/ the owner of the project no longer develops it and shared plugin's source.

analog vapor
#

Ooh so like a format humans can understand?

gray merlin
#

Java is built to be programmed in OOP

gray merlin
analog vapor
#

ah so kind of like a platform or universal format?

gray merlin
#

You can write in OOP across most languages, if they allow you to do so

#

Think of it like...

analog vapor
#

is it necessary for mc plugins

#

I am not sure what that exactly is since I started coding recently haha

eternal oxide
#

Actually fix ALL yoru imports that use local jars

gray merlin
#

Imagine the language being a "house" and the style being the "model", there's the modern models, the 16th century ones, gothic ones, etc. You can build a house with any of those models

crisp forum
gray merlin
#

Java really wants you to write your programs in OOP, so when you learn java, you'll learn that forcibly.

analog vapor
#

I just got it lol, so basically a type of representation or code being written right?

eternal oxide
#

UltraMinions.jar, MMOLib-1.7.4.jar, MythicMobs.jar, MMOItems-6.3.1-Cracked.jar

gray merlin
#

kinda yeah

eternal oxide
gray merlin
#

also here are some resources if you want

#

?learnjava

undone axleBOT
eternal oxide
#

I linked you the project, it tells you on that page what to use in your pom

analog vapor
boreal seal
#

hmm not sure what he meant a custom class

analog vapor
#

It seems quite nice ngl

boreal seal
#

of location

#

like a method that returns the object?

#

a object

boreal seal
gray merlin
#

When I started programming a few years back, I think I used Udemy to learn programming theory

boreal seal
#

and do some homework as well those are bad tutorials

gray merlin
#

But i've also checked out codecademy

analog vapor
gray merlin
#

it's p neat

boreal seal
analog vapor
gray merlin
#

Hmm not really

analog vapor
gray merlin
#

I mean

boreal seal
#

its would be way better

#

then writing down notes

analog vapor
#

The important ones

boreal seal
#

or re read till u got into memory..

gray merlin
#

There are people that understand it better by taking notes and learn that way

boreal seal
#

re-read what you forget

analog vapor
boreal seal
#

it will be the same writing down notes is not really a soluation

gray merlin
#

But I personally just try to understand the concepts and why they work, and why they work like that, so if I ever forget something I can remember it easily

crisp forum
boreal seal
#

i later used to learn what are things after having alot of practice

gray merlin
#

Programming's very much about problem solving and logic, so knowing the exact things isn't much of an issue, you can always look them up

eternal oxide
#

Do that for all the dependencies I listed

gray merlin
#

Your ability to solve problems is more what's needed

boreal seal
#

spigot API is dog shit what you talk about

analog vapor
eternal oxide
#

UltraMinions.jar, MMOLib-1.7.4.jar, MythicMobs.jar, MMOItems-6.3.1-Cracked.jar

gray merlin
boreal seal
#

not always

#

its like math

gray merlin
#

Logic is a subject of math

analog vapor
#

It needs logic too

boreal seal
#

the logic sometimes doesnt make any sense

#

when u stick to spigot api

#

anyway yeah logic exists there

analog vapor
#

Yes doesn't have to everytime, there are a lot of possible cases

boreal seal
#

nah there ton of unnessacry shit in spigot api

#

and things that atleast my logic tells me should not work like they do..

gray merlin
#

That doesn't mean that logic is to be taken out of the equation. Programming's all about logic, problem solving, and maths pretty much.

quiet ice
gray merlin
#

That would just mean spigot has faults

boreal seal
quiet ice
boreal seal
#

from some reason we still use NBT

#

and packets

#

really often

#

from a good reason

#

shit API

quiet ice
#

NBT very rarely

boreal seal
#

i used it very often

quiet ice
#

Like EXTREMELY rarely

boreal seal
#

efficency..

quiet ice
#

Unless you are talking about outdated versions of spigot api

boreal seal
#

i use 1.8

young knoll
#

I have not used NBT in a very long time

boreal seal
#

not 1.19.2

young knoll
#

lol

boreal seal
#

dont do how old is 1.8

#

its 7-8

young knoll
#

Of course you are missing a ton of features, 1.8 is like 7 years old

gray merlin
#

Talking about NBT.:
Did NMS in 1.17.1 change? I've been porting my stuff with reflection across versions, and i've reached 1.17.1, and it doesn't seem like any NMS classes exist.

young knoll
#

1.17 removed all the spigot mappings

chrome beacon
quiet ice
# boreal seal i use 1.8

So you are complaining about inefficenies when USING OUTDATED AND UNSUPPORTED VERSIONS OF AN API and then you have the AUDACITY to complain about the API not having some features THAT WERE IMPLEMENTED LATER. That is it, someone ban this guy

quiet ice
#

YES

young knoll
#

yes

boreal seal
#

bukkit was unsupported since 2k14

#

which was the best thing out there

young knoll
#

This isn't bukkit

gray merlin
#

That really sucks though. How should I do this then?

quiet ice
#

SPIGOT 1.8 IS ALSO FUCKING UNSUPPORTED

boreal seal
#

spigot is fork of bukkit 🤣

#

please.

river oracle
#

bukkit is maintained by spigot

#

lol

boreal seal
#

now

#

but lets go backwards to history

river oracle
#

we aren't backwards in history we are in the now lol

boreal seal
#

you guys just cant admit that newer versions are like a shitty modpack

quiet ice
#

The last update to spigot 1.8 happened months ago, and before that update the last update was years ago

boreal seal
#

yeah i agree new versions have cool features like multi texturing

#

and many other options

#

that i dont have

sacred mountain
#

Caused by: java.lang.UnsupportedOperationException: Interface can't be instantiated! Interface name: net.kyori.adventure.text.Component

#

cry

boreal seal
#

but think about how great things were done in the past as well

#

im not really fan fan of 1.8

chrome beacon
boreal seal
#

i just want to support multi verisions

#

versions

sacred mountain
boreal seal
#

and starting of 1.8 is the right way.

sacred mountain
#

gson serializer

quiet ice
young knoll
#

I don't understand the whole "omg modern minecraft is like a shitty modpack thing"

chrome beacon
young knoll
#

Please just say that any time Mojang adds literally anything new

chrome beacon
#

Add a custom adapter or whatever it's called

boreal seal
sacred mountain
quiet ice
young knoll
#

pfft

quiet ice
young knoll
#

The real Minecraft is 1.0

chrome beacon
boreal seal
young knoll
#

Oh no

boreal seal
#

common man if you already added polar bear and panda where is my animal pack

young knoll
#

Not a turtle

boreal seal
#

not sure already what is begin added

#

lasted updated they added a wierd boss

chrome beacon
#

It's not really a boss

river oracle
#

lol you have to be fake

quiet ice
#

Hey, at least I have my path block. The best addition that happened in the last 10 years

sacred mountain
young knoll
#

Yeah good thing they've never added a weird boss before

boreal seal
#

not sure what thing is even

#

from the pictures it looks like Odin son

young knoll
#

Like a giant dragon in another dimension

quiet ice
boreal seal
#

hm forgten wither

#

it was added in the past

#

not really was best update

#

concept was cool

charred blaze
#

how do i change player's glowing color?

young knoll
#

TL;DR It's new, I don't like it and change is scary

boreal seal
#

anyone of u watched spongebob?

river oracle
boreal seal
#

or simpsons?

chrome beacon
analog vapor
#

Ok so I wil get the lessons completed, thanks for the help everyone, never thought I would recieve such help, thanks again, have a fun time and take care ❤️

boreal seal
#

now compare old and new seasons and realize the difference between 1.8 and 1.19.2

sacred mountain
#

damn, anyone know about paper type adapters for the textcomponents

boreal seal
#

the new seasons are for 2 digit IQ homur

#

same as new versions are shit honestly

#

and no i dont blame combat update was good actually

#

the rest is shit and make game just way heavier.

river oracle
#

if you don't even like the new villagers you just got brain damage not sure what to say

boreal seal
#

new villagers are fine

young knoll
#

It's clearly trolling at this point

boreal seal
#

nah not really

young knoll
#

People said the exact same things when 1.8 came out

#

With its "Weird fish boss"

river oracle
#

1.6 is my favorite version before the dumb 1.7 and 1.8 updates

boreal seal
#

u see anyone stays in 1.7.10

#

for so long?

#

oh

#

forgot about his existance

#

yeah it was dogshit update as well tbh

river oracle
#

anything after MC 1.0 is just fake tbh

charred blaze
# chrome beacon team colors

i also noticed that glowing color is depending on displayname's color. can i change it without changing displayname's color?

river oracle
#

I only play real versions

boreal seal
#

Miles

#

remember you told me to make a custom location class

river oracle
#

tbh actually everything pre-hunger bar is just objectively better

boreal seal
#

it work like util?

chrome beacon
# gray merlin How would I do it then?

You'll need to reflect using the new package and class names. As for the method name you can hardcode it. I don't see nbt classes changing anytime soon

boreal seal
#

not sure what you meant by it

#

never made such a thing before

gray merlin
gray merlin
river oracle
sturdy frigate
#

Is there a quick and easy way to build complex armor stand models?

boreal seal
#

a object right?

#

to store it later in an hashmap?

river oracle
#

yea a data class

crisp forum
eternal oxide
#

looks better

#

can you now do Player.Spigot ?

boreal seal
crisp forum
#

looks like p.spigt() is working tx

boreal seal
#
public class MilesIdea{

 

  private int x;

  private int y;

  private int z;

  private String world;

  public MilesIdea(int x, int y, int z, String world) {
    this.x = x;
    this.y = y;
    this.z = z;
    this.world = world;
  }

 
  //methods to get vaules later.
  public int getx() {
    return x;
  }
  public int gety() {
    return y;
  }
  public int getz() {
    return z;
  }
  public String getworld() {
    return world;
  }
}
#

@river oracle its what you meant + -?

river oracle
twilit roost
#

Spigot NMS Remapped 1.19
How to name entity?
I can't find TextComponent in nms

river oracle
#

isn't it just called Component?

twilit roost
#

ye but can't get that to work as well

boreal seal
river oracle
#

wdym

#

Location is bulky as fuck compared to that class plus it stores the world which can cause memory leaks

#

and it has vector information

#

it also stores the block at the location etc etc

tall dragon
#

better store world uuid

river oracle
#

and its mutable which is cringe

tall dragon
#

not name

river oracle
tall dragon
#

unless ur talking about 1.8

young knoll
#

Location does not store the block

#

lul

boreal seal
#

what you mean by the world?

river oracle
#

The world object

tall dragon
#

if you keep an instance of World. that world cannot be unloaded even though no players would be in it

young knoll
#

WeakReference it

boreal seal
#

and i load the whole map on start

tall dragon
boreal seal
#

anyway ill create an class to store exactly what i need

fiery prairie
#

e

young knoll
#

The funny thing is storing the world by name probably makes that object bigger than a normal Location object

quiet ice
#

Do note that a Location object stores a hard-ref to the World

boreal seal
#

so what do you want me to store worlds by ints?

#

or into binary?

young knoll
quiet ice
#

Yes, but they using 1.8

boreal seal
#

im wondering i will anyway have to use block.get x,block.get y,block.get z

#

in it right?

#

they

quiet ice
#

If you are storing entire chunks, you are better off getting rid of x, y and z and instead make a linear array storing 256 * 16 * 16 objects

young knoll
#

A java reference is 4 bytes

#

A string with 4 characters is already at least 4 bytes

fiery prairie
#

How can I check if the player has a cracked minecraft account in PlayerJoinEvent

young knoll
#

Are you using offline mode

boreal seal
#

nah storing a single block...

fiery prairie
fiery prairie
boreal seal
#

time to trial and error

sacred mountain
#

hey what would be the best way to make a superclass called reward, and have children classes with different types of reward (e.g. expreward, itemreward)

I want it to serialize to json something like this:

"rewards": [
  {
    "rewardType": "EXP",
    {
      "type": "LEVEL",
      "amount": 1
    }
  }
]```
#

probably dumb but i cant think right now

quiet ice
young knoll
#

You can query Mojang's servers for a uuid

#

iirc

boreal seal
fiery prairie
boreal seal
#

diff proxies tho

quiet ice
#

Cracked players login through one proxy, premium players through the true proxy

boreal seal
#

trough the other

#

its pretty much the concept outthere from what i saw

fiery prairie
#

So how would I check through which proxy someone goes through?

quiet ice
#

The proxy could send the information alongside the player connection via the plugin messaging channel

boreal seal
#

learn about how bungee works

#

proxy is just sort of tunnel

quiet ice
#

It's more of an relay than a tunnel

boreal seal
#

that connects the player to different IPs

boreal seal
quiet ice
fiery prairie
#

Yea ik that, but then how do I use it to check if a player has a cracked account?

quiet ice
boreal seal
#

in general ill explain how they did it

quiet ice
boreal seal
#

if account exists in mojang

#

it says its premium account else it allows to register

fiery prairie
boreal seal
#

just make it offline mode shitty feature

boreal seal
#

ur mind doesnt work properly

#

im brain dead not sure what are you

#

anyway proxy is nessacry or make custom alternative to login plugin

#

if u want premium to go to different hub

#

where there no register

young knoll
#

Will a cracked account still return a uuid from Mojang?

quiet ice
# fiery prairie Yea ik that, but then how do I use it to check if a player has a cracked account...

Assume following precedence:

  • Proxy A runs in online mode
  • Proxy B runs in offline mode
  • No other proxies exists and direct connections are forbidden
  • Both proxies will send metadata when a player connects sucessfully through them

If Proxy A says that player X connected through it, player X is not using a cracked account. If Proxy B says that player X connected through it, player X might be using a cracked account

boreal seal
#

false

#

if it doesnt exist

#

like the username

hazy parrot
quiet ice
#

Exactly

#

Spoofing exists

fiery prairie
#

Alright. thanks

boreal seal
hazy parrot
quiet ice
hazy parrot
#

there will be premium and cracked proxy

#

and 1 server

boreal seal
#

it cloud work no?

#

then proxy isnt nessacry

quiet ice
#

Which is probably not what you want

boreal seal
quiet ice
#

Even then I am not sure how the proxy would work given that offline mode protocol is antagonistic to online mode protocol

quiet ice
sacred mountain
#

can i create a superclass without a constructor just to keep some of my classes extending it?

kind hatch
boreal seal
#

here

#

this guy did exactly

#

what you look for

boreal seal
#

go do homework

quiet ice
tall dragon
#

why ru being so mean man

#

jesus

boreal seal
#

thug life

fiery prairie
#

alright i think i get it thanks guys

boreal seal
#

🤣

quiet ice
#

Does anyone know how to declare dependencies in maven in a way that
a) it happens through a Mojo
b) it can be picked up be IDEs
c) the mojo can update dependency whenever it wants (in this specific instance when an access widener file is changed)

My current knowledge would say that I would have to declare the dependency manually in the pom.xml and when the mojo is executed it puts it in a specific directory defined by the system scope. However that would still mean that refreshing/reloading the maven project/pom in the IDE would not pick it up and the IDE wouldn't pick up the dependency either if it has not yet been built yet.

#

If the answer is "use gradle lol", then my second question would be whether anyone knows how to publish artifacts to maven repository in a way that:
a) Includes javadoc
b) Checksums are computed
c) Knows how to deal with snapshot repositories
d) Works through FTP (not SFTP, FTP)
e) Includes source
f) Has the ability to overwrite existing artifacts
g) Requires no manual user intervention (no manual copying)
h) Does not (indirectly) use the CLI or other godforsaken tools (has to work across systems)

hazy parrot
# boreal seal https://github.com/games647/FastLogin
GitHub

Checks if a minecraft player has a valid paid account. If so, they can skip offline authentication automatically. (premium auto login) - FastLogin/ForceLoginTask.java at 812cf21ad0ac565c3211fa63e2a...

reef lagoon
#

how do I get the PAST location in an on move evnet or do i have to use pdc or smth

sacred mountain
#

are there any instanceof switch modules

switchinstance (object) {
case String.class: //blah
}
i dont literally mean this syntax but is there a quick way to do this other than multiple if statements

quiet ice
hazy parrot
# quiet ice that is whether the player is online, not whether the player in in online mode
GitHub

Checks if a minecraft player has a valid paid account. If so, they can skip offline authentication automatically. (premium auto login) - FastLogin/ForceLoginTask.java at 812cf21ad0ac565c3211fa63e2a...

reef lagoon
#

ty!

quiet ice
#

That will not work

#

If the player is connecting through an offline mode connection the UUID of the player will be random for our means

young knoll
#

I thought it was based on name

quiet ice
#

It is predicable yes

#

But random for our intents and purposes

#

Again, if the player is connecting through an offline mode connection (which they will if you are running an offline mode server), they will always have an offline mode UUID that is "randomly" chosen based on their name

young knoll
#

In theory this would work unless the cracked account is using the username of a premium account

quiet ice
#

That too lol, spoofing is not a thing

#

if you do this across servers then you already know that those being on online mode servers are on premium accounts and those being on offline mode server are possibly (but not definitely) on cracked accounts

#

basically you use a proxy that is running in offline mode and a proxy running in online mode

young knoll
#

This is why we don't make cracked servers

quiet ice
#

And yes that, cracked servers are kinda difficult to manage

#

You know the player name and that is it

#

If ip-forwarding is disabled you will also know with which proxy the player is connected to

hazy parrot
#

they will join trough online proxy every time

#

yap that might be problem

#

yeah, but large number of household internets are not static ips

vocal cloud
#

VPNs

quiet ice
#

UUID passthrough

vocal cloud
#

KEKLEO or worse their IP gets changed

quiet ice
#

Paper for sure has this, I believe spigot has it too

hazy parrot
#

I still don't understaind how this works

#

i mean i know there are alot of those kinds

#

of plugins

#

but i just cant think of any way ¯_(ツ)_/¯

young knoll
#

It just checks if the player is already on the server

quiet ice
#

Exactly

hazy parrot
#

what does

#

this mean

#

then

quiet ice
#

Are you blind?

#

isOnlineMode != isOnline

hazy parrot
#

I am

young knoll
#

isOnlineMode is at the bottom

hazy parrot
#

yeye

#

i saw now

#

its not about server but player

#

but im just blind

#

didnt differate two methods

quiet ice
#

not server - connection

#

Otherwise it wouldn't make sense

hazy parrot
#

its in fact meant to work just in offline servers

quiet ice
#

it would

#

It makes use of proxies for that part

#

it is basically just a ternary

#

var var10001 = this.isOnlineMode() ? PREMIUM : CRACKED;

hazy parrot
#

it is

quiet ice
#

Yes, I was just underlying that the order didn't matter

young knoll
#

It's basically a one line if else

#

if (condition) then A else B

#

No

#

true ? "A" : "B" will result in A

young knoll
#

correct

sacred mountain
#

Is creating my own tuple class a good option if i need somewhere on a grid

#

coordinates

#

java doesnt seem to have one or i havent found it yet

tall dragon
#

u can also nest those 😄

#

but that gets hard to read fast

quiet ice
sacred mountain
#

i was just wondering if java has any stuff for that

#

without me creating my own

#

its like a line but yeah

quiet ice
#

There is Map.Entry<K, V>

#

HOWEVER I strongly prefer using long if the two parameters are ints

tall dragon
#

depends on their design. they could be using Deque

quiet ice
#

Creating objects is costly, but converting between primitives and objects is extra costly

#

hashmaps do not keep order unless you use linked hashmaps

#

If you just want to have something like Map<MiniGameType, Deque<QueuedPlayer>>, then go for it

tall dragon
#

if ur looking for a queue the simplest is using a Deque

quiet ice
#

Just remove five players that are at the tail of the queue

#

And insert any incoming players in the head of the queue

tall dragon
#

you could

quiet ice
#

But it is kinda difficult to do that with spigot API

tall dragon
quiet ice
#

You probably can make zombies and other melee mobs attack a bat or something at a certain place, but otherwise it gets complicated

civic apex
#

how can I tell when its safe to unload/load a world

tall dragon
#

pretty sure you can tell by checking if there are no players in that world

civic apex
#

what I mean is

#

for locks to disappear

#

or sth

#

when I try to unload/load a world twice my server crashes

#

i don't know which one(s)

ornate mantle
#

what's the most efficient way to change a mob's target distance?

civic apex
#

session.lock?

#

when I unload?

#

manually?

#

i dont know

#

java.nio.channels.OverlappingFileLockException: null i got this exception

#

so delete after unload?

#

then load again?

#

this is not a permanent thing

#

its for a plugin, without server restarts

#

the world isnt perma locked or anything

#

i can unload the world