#help-development

1 messages · Page 880 of 1

hybrid turret
#

i thought you meant this message. that was my bad, yes.

#

And yes, I apologize, if I - apparently - hurt ur feelings by saying that u were rude. But calling me names, even after me saying that it was a misunderstanding and assuming shit without actually thinking, was not necessary.

torn shuttle
#

what a great apology, thanks. I am also sorry that you identify with the names I called you

hybrid turret
#

And yes, I'm serious sincere about the apology.

torn shuttle
#

oh then I'm sorry you lack the self-awareness to be able to do that instead

hybrid turret
#

Okay no but seriously now, sorry for calling you out like that. It's 10:40 in the morning for me and I already had a stressful day.

spare hazel
#

how can i shoot a fireball in front of the player?

clever lantern
#

when i set fly speed (Player#setFlySpeed) it doesnt work with creative speed but works with Player.setAllowFlight, can i fix it somehow?

valid root
#

I think for it to work player needs to be floating

#

At the time when the speed is changed

torn shuttle
#

I wish I could use chatgpt as a spam filter for my mail

molten hearth
#

I proposed that idea in my university discord lmao

#

We get so much "official" shitposting we need smart filtering at this point

valid basin
#

How do I register custom enchantments?
This is my current code:


    public TeleportationMasterEnchantment() {
        super("teleportation_master");
    }

    @Override
    public @NotNull EnchantmentTarget getItemTarget() {
        return EnchantmentTarget.ARMOR;
    }

    @Override
    public boolean canEnchantItem(@NotNull ItemStack item) {
        return true;
    }

    @EventHandler
    public void onEntityDamage(EntityDamageByEntityEvent event) {
        if (event.getEntity() instanceof Player) {
            Player player = (Player) event.getEntity();
            if (player.getInventory().getArmorContents() != null
                    && hasEnchantment(player.getInventory().getArmorContents(), this)) {
                Random rand = new Random();
                if (rand.nextDouble() < 0.2) {
                    player.teleport(player.getLocation().add(rand.nextInt(10) - 5, 0, rand.nextInt(10) - 5));
                }
            }
        }
    }

    private boolean hasEnchantment(ItemStack[] items, Enchantment enchantment) {
        for (ItemStack item : items) {
            if (item != null && item.containsEnchantment(enchantment)) {
                return true;
            }
        }
        return false;
    }
}```
#

Is this correct?

#

I've just recently moved to 1.20 development

#

before I've used in lore

tender shard
#

you should use a custom PDC tag to identify your enchantments, instead of extending any bukkit classes

valid basin
proper cosmos
#

Does this Player#getStatistic(Statistic.PLAY_ONE_MINUTE) return all playtime, or current server start?

tender shard
smoky anchor
proper cosmos
tender shard
smoky anchor
proper cosmos
tender shard
proper cosmos
proper cosmos
#

I think that would be best way

tender shard
#

for example, yeah

slender elbow
#

huh

#

love bukkit

tender shard
#

hm looks like it only "records" 1/4th second if one plays for 1 second with 5 tps

#

"hey lil' bobby, stop playing minecraft, you've been playing for 6 hours today already"
"no big mamma, I only played 1.5 hours because my laptop can only do 5 tps, see?"

#

life hack

proper cosmos
lost matrix
#

Stopping the tick loop = infinite play time

quaint mantle
#

while (true) {} infinte cpu glitch

lost matrix
#

Heating your room in the winter

pliant topaz
#

actually did that lmao, was cheaper then oil

hybrid spoke
lost matrix
hybrid spoke
#

what happens if i do

lost matrix
#

You get older 🙂

hybrid spoke
#

as usual or faster?

lost matrix
#

As usual i suppose

#

Cant confirm, havent tried

late sonnet
lost matrix
#

Noice

late sonnet
#

i hope dont get now the feedback i request less 1 year ago xd

river oracle
hybrid turret
#

are ppl using prettier with prettier-java-plugin here with IJ Idea?

late sonnet
hybrid turret
#

bc i feel like my formatting is not properly applied upon formatting with prettier

hybrid spoke
#

whats prettier

hybrid turret
#

me, duh

late sonnet
#

i only use that un TypeScript and only because the previous dev keep that xd

hybrid turret
#

damn i thought prettier was much more common

hybrid spoke
#

only used eclipse code formatter and google style so far

hybrid turret
#

okay ic

tender shard
#

I got a storage thingy that supports mysql, json files and sqlite, now I want to make the prefix for tables configurable - now I wonder, should that prefix only apply to mysql, or also when using sqlite? I mean people will never think of using one sqlite db for different things, do they?

lost matrix
hybrid turret
#

yeah, but prettier needs a plugin if you want it to work with java iirc

lost matrix
#

I dont see the appeal of it honestly. Just configuring your code style is all you need 🙂

proper cosmos
#

btw why there is still bunch of people using Eclipse? Is there anything that it can do but intelij can't do?

lost matrix
#

Its lighter and simpler. Also: Multiple projects in the side tab.

hybrid turret
#

tbh idk how eclipse is today, but it was trash back when i used it and i've heard quite often that it sucks

#

it's probably ppl that got used to it at some point and don't bother to switch

hybrid turret
glad prawn
#

Is there a way for me to allow players to sprint, even if they are below 6 levels (3 food)?.

hybrid spoke
#

at least not if youre not making a mod

hybrid turret
#

if i just read up on that correctly, that flag is set client side?

#

for sprinting in relation to hunger

hybrid spoke
#

yeah, thats all clientside

#

so you would have to go the hacky way

#

velocities, pinning the hunger at 3.5, whatever

hybrid turret
#

hacky way? 😨

#

pinning hunger woul've been my first idea there but that's kinda stupid

hybrid spoke
#

just pin the hunger and simulate the rest with packets

hybrid turret
#

oh god

proper cosmos
#

It does not reload classes

hybrid turret
#

you want to hot-reload classes when using the debugger?

river oracle
#

good ol kangarko xD

slender elbow
#

i don't see why it would use wall time when the whole game revolves around ticks

hybrid turret
#

i thought i updated the entries in my package.json... and reinstalled then... but apparently my brain shut off for a sec and it wasn't even a newer version

#

Are plugin Commands able to be used by /execute?

rotund ravine
#

Did u try?

hybrid turret
#

i-

tender shard
hybrid turret
#

good point, fine. i'll try at home lmao

tender shard
hybrid turret
#

i gotta stop asking shit just bc it's convenient to know them rn

hybrid turret
tender shard
#

oh wait

#

I think it works unless you do in world or sth like that

rotund ravine
tender shard
#

idk I only remember I once tried to do /execute as ... in ... ` and that didnt work for plugin commands

hybrid turret
#

huh, okay then i'll try it today or sum

#

thanks anyway :))

slender elbow
#

yeah i don't think that'll work unless you register your commands as a brigadier command in the vanilla command dispatcher (separate from the plugin commands one, taken from the commandmap)

#

✨ internals ✨

hybrid turret
#

that's good actually tbh

#

bc otherwise i feel like that could be a security risk

#

given that admins shouldnt allow random players to use execute anyway lmao

#

so whatever

young knoll
#

execute as @e run /nuke

quaint mantle
#

Can yall recommend me any good sites to learn spigot from?

quasi bear
young knoll
#

Do you already know java?

quaint mantle
#

I was thinking some like udemy?

young knoll
quaint mantle
#

I sadly do not, but they do offer teaching you

#

35h of course

chrome beacon
#

?learnjava

undone axleBOT
quaint mantle
#

OH CMON

#

why is that the first thing

quasi bear
#

because you need to learn the language (at least a bit) to know how to code in it

hybrid spoke
young knoll
#

Don’t try running before you know how to walk

hybrid spoke
#

you want to learn java and how to use the spigot-api WITH it

quaint mantle
#

I mean they do offer to teach you java

worthy yarrow
#

I learned self taught over 4 years (I’m def not the best or even close) but I used Stephan’s udemy course as a basic crash course for spigot api, otherwise since you don’t know java, make sure to check out codecademy’s free intro to java course

hasty obsidian
#

hi guys

quaint mantle
#

hi

hybrid spoke
#

the best java course imo are the books

hasty obsidian
#

i got ddossed

worthy yarrow
hybrid spoke
#

nice

quasi bear
worthy yarrow
#

When you can read books, suddenly learning information becomes so much easier

hasty obsidian
#

and i saw that many popular servers uses neoprotect or tcpshield, i tried them too they are so easy to setup, but i have bedrock support and im stuck

quasi bear
#

ohhh

hasty obsidian
hasty obsidian
hybrid spoke
quasi bear
worthy yarrow
quaint mantle
#

ovh comes with one

#

alr ill take ur word for it

hybrid spoke
quaint mantle
#

books and crash course it is

hybrid spoke
#

books are just great

#

clean code and design patterns as well

chrome beacon
worthy yarrow
quaint mantle
#

would it take a month?

hybrid spoke
#

more than that

quaint mantle
#

oh lord

worthy yarrow
#

It’s a pretty fast course, you could finish codecademy in easily a week

quaint mantle
#

we have a guy saying a week

hybrid spoke
#

learning programming is a never ending process

quaint mantle
#

and another guy saying more

chrome beacon
#

yeah completing one course probably won't be enough

worthy yarrow
#

Super starter concepts are learnable in a week ie: crash course such as codecademy’s intro to java

chrome beacon
#

You might do it in a week, but you'll struggle after that

quasi bear
#

listen, if you are dedicated you can learn how to do a basic plugin in a day

quaint mantle
#

worth a shot

hybrid spoke
quaint mantle
#

thanks guys

hybrid spoke
#

you will have the fundamentals, the basics. if even

worthy yarrow
#

Yeah trust all of us, you just need to learn to walk first

quaint mantle
#

suprisingly, I do know the basics

worthy yarrow
#

With all the courses we mentioned, take about 3-4 months with all of them and I’m sure you’ll be making some decently structured projects at least within that time frame

worthy yarrow
# hybrid spoke and yet you wont get far with it

Yeah that’s true, but like I said walk before you run, also I really like codecademy because of it’s simplicity, shows how anyone (if you take the time) can learn this kind of logic development in a pretty good amount of time

#

Not only that but it’s a pretty simple course, I don’t know about many other ones except for Stephan’s crash course into spigot so I’m sure there are better ones as well

hybrid spoke
#

in germany we had "BiVieh" who made pretty good tutorials

worthy yarrow
#

To be fair germans are pretty good coders haha

hybrid spoke
#

debatable

fluid river
#

i thank you so much guys for explaining me the java plugin loader

worthy yarrow
#

For the one's who have made their way, it seems like they are pretty advanced

young knoll
#

I thought the Germans were more known for manufacturing

worthy yarrow
#

Among other things

hybrid spoke
worthy yarrow
#

Coding probably isn't the first thing you think of when germany is brought up however, the first thing that pops up in my mind is how one time I called someone a girl in german over a video game

#

"Du bist ein madchen!" haha

worthy yarrow
#

Could be more common in germans, though usually if its not american, its less lazy so

hybrid spoke
#

i was one of them 10 years ago

#

not even knowing what a for loop was yet called myself a decent dev

worthy yarrow
#

Haha

chrome beacon
#

tbh having Java dev in the discord description is a common trend that I see

#

While failing at super basic stuff

fluid river
worthy yarrow
#

Yeah there's a lot I don't understand but I like to call myself a decent dev just since I have the ability to make most of my peojects work lol

chrome beacon
#

So I now take that as a red flag

hybrid spoke
chrome beacon
fluid river
hybrid spoke
#

id say you performed pretty good when you dont have to introduce yourself anymore

fluid river
#

for c# i need a .dll and it's path

worthy yarrow
# chrome beacon So I now take that as a red flag

Yeah actually funny story about that, I provided this guy with some simple java resources such as a udemy course and like the codecademy java course..... a week later that guy has "full time minecraft / java dev" in his discord description lol

fluid river
#

so i can use Reflection

#

Assembly.Load("path to dll") -> Type myScript = Assembly.getType("Name of the c# class")

worthy yarrow
#

eek reflection

#

Hate using that concept tbf

fluid river
#

and then for unity you can do gameObject.addComponent(myScript);

fluid river
#

so you have no choice

worthy yarrow
fluid river
#

also only way for java

#

since it's ClassLoader is full of native shit

#

and Reflection shit

worthy yarrow
#

Ah yeah

#

ok that makes sense now

fluid river
#

getDeclaredConstructor() and stuff

#

You ever thought about how spigot server loads your plugins?

worthy yarrow
#

Yeah I never like reflection... perhaps why I didn't know that. Certainly only used it like once or twice maybe

fluid river
#

and why main class always has to extend the JavaPlugin

worthy yarrow
fluid river
#

wdym

#

the loading Exception?

worthy yarrow
#

Like I said I'm self taught over the past 4 years with no other experience in programming so my experience is really only with spigot development... I'd say I'd only have a solid years experience though since it was pretty on and off

hybrid spoke
#

you should avoid reflections where you can anyways

worthy yarrow
# fluid river wdym

Just in the sense that I messed up a dependency or perhaps just forgot to remove args from the main constructer, so unless it didn't load up, I never thought about it

hybrid spoke
#

when you dont do weird crazy stuff or a framework or shit you should keep your hands away from it

fluid river
#

also there is a giant crutch called plugin.yml 🙂

#

it literally has the string which specifies the path to the main class in a .jar like in a folder

worthy yarrow
fluid river
#

still do that tho

worthy yarrow
#

eek awful

fluid river
#

also copy-pasting maven spigot repo everytime

worthy yarrow
#

I let intellij fill the main information, obviously if I have to add more I will, but I just meant in order to get your plugin to load up, you'd have to manually fill out plugin.yml in eclipse

#

Never had fun with that since my formatting was already bad lol

young knoll
#

Gradle plugin.yml pog

worthy yarrow
#

ew gradle

#

Only used maven building as well haha

chrome beacon
#

Gradle is pain

young knoll
#

Nou

fluid river
ivory sleet
#

gradle is pain, but better offers more than maven, right????

fluid river
#

no?

ivory sleet
#

yes

chrome beacon
#

Gradle can do more things

ivory sleet
#

^

#

Objectively

fluid river
#

alr but it's pain

#

at least i haven't experienced anything like that

worthy yarrow
#

I mean if it aint broke dont fix it

fluid river
#

since it's not like i'm using maven or gradle much

#

i just need them to compile my shit

#

like Pen-is bans

ivory sleet
hybrid spoke
#

gradle is cooler, but maven is better

worthy yarrow
#

I just don't like to mess with gradle

#

Plus I don't even do enough to complain about it so

fluid river
#

this guy ignored my freejavalessons tho

ivory sleet
#

but yea

fluid river
#

i'm crying

hybrid spoke
#

free means bad

fluid river
#

noooooooo

hybrid spoke
#

the more expensive it is, the better will it be

worthy yarrow
# ivory sleet No one does

Well like I said, I don't even do enough to complain... I'm at best a very mediocre minecraft dev haha

chrome beacon
fluid river
#

eh not always fr

hybrid spoke
#

thumbrule

#

but selfmade is the best

fluid river
#

my free java lessons are actually self-made and they are PRICELESS

worthy yarrow
#

That's like saying I'd be a better dev if I spent more than 10$ on the stephan udemy course.... though I only put 10 hours total into his course

fluid river
#

))

#

bought 1 year of gym

hybrid spoke
#

my anticheat is better then the free ones which fixed every possible exploit because i paid for it

fluid river
#

visited 10 times

hybrid spoke
#

my custom essentials is better than essentials because its not downloaded

#

pov you are a serverowner

young knoll
#

My anti cheat is best because it just stops all joins to server

fluid river
#

my custom essentials is the best since it's on russian and has memes in description

worthy yarrow
#

even though mine is missing 60% of regular essential functions....

hybrid spoke
#

100% success rate on preventing cheats

worthy yarrow
worthy yarrow
fluid river
#

my anti cheat is the best because it has virus which kills every pc which connects to the server

worthy yarrow
#

that one is literally missing 90% lol

fluid river
#

100% cheater stop rate

#

if they don't have a working pc, they don't cheat

worthy yarrow
hybrid spoke
worthy yarrow
#

Forcing .exe files to peoples pcs in order to join your server D:

slender elbow
worthy yarrow
slender elbow
#

the Netty discord does have rules against that however lmao

worthy yarrow
#

Tinder for mc devs should be a thing imo

#

"Hey wanna come over and completely rewrite vault later :P?"

fluid river
#

my pen-is banner is 20 blocks high

#

Steve (400 m. away) wants to have wild role-play with you.

worthy yarrow
#

Oh dear god

worthy yarrow
# fluid river Steve (400 m. away) wants to have wild role-play with you.

See funny story about that, I was requested to make a marriage plugin that would allow players the ability to cheat on their spouse and if within a certain amount of blocks of their spouse, if "cheating" it will notify their spouse and shit among other sort of mechanics following that sort of style haha

#

Kinda funny plugin idea imo

#

But I said no cuz who even wants to do that

#

Hey has anyone here ever messed with breeding related functions? I was wanting to make a cool interactive breeding plugin that's handled mainly with gui interaction... any suggestions relating to this?

fluid river
#

my suggestion is to stop, you criminal scum

hybrid spoke
worthy yarrow
ornate heart
worthy yarrow
#

my player bounties plugin allows that

hybrid spoke
#

you just cant call it tinder

ornate heart
#

true

worthy yarrow
worthy yarrow
# hybrid spoke rather a plugin where you can swipe player heads

/notTinder -> opens the notTinder app on minecraft, displays right swipe button / left swipe button + player skull in-between, when click left -1 score to owner of player head / when right click +1 score to owner of player head. Extra functionality /notTinderTop -> displays top 10 users with the highest scores

hybrid spoke
#

rather make a website where you can swipe actual player profiles and display it in minecraft

worthy yarrow
#

How dare you move out of my skill range

hybrid spoke
#

imagne all the descriptions

#

"looking for a man with lots of diamonds and a huge base"

worthy yarrow
#

That would be pretty nuts plugin tho

hybrid spoke
#

"risky"

worthy yarrow
hybrid spoke
#

you'd have to deal with so many shit

#

fake profiles, bots, sexual content, mad owners

worthy yarrow
#

ok but thats the server's problem eh?

hybrid spoke
#

yes and no

#

if it takes overhand servers will remove the plugin again

worthy yarrow
#

yeah true

hybrid spoke
#

so you have to prevent that

#

but you cant

#

what i also thought about was a serverwide plugin with one central database

worthy yarrow
#

Still, NotTinder plugin would be lit

hybrid spoke
#

imagine 50 servers having the tinder plugin installed and they all see the profiles from other servers

worthy yarrow
#

I'd say implement messaging through this interactive "app" but it'd get really fcked up really fast lol

worthy yarrow
#

Configurable option that shows other players from other servers too

#

for the /notTinderTop

#

Who's got the highest score of all servers with the tinder plugin???

young knoll
#

What did I just come in to

worthy yarrow
#

Might as well leave if you're not a hardcore tinderer

hybrid spoke
#

NotTinder is a bad name

#

what about mineship

worthy yarrow
#

I like mineship but it comes off being for a younger audience imo

#

Could be a concern considering this a "tinder" like plugin lmao

hybrid spoke
#

biggest problem will be to keep this minecraft related

#

people will upload pictures of themselfs

worthy yarrow
#

lmao true point

hybrid spoke
#

at this point you could just integrate tinder into minecraft with a plugin lol

worthy yarrow
#

More or less yeah

#

So instead you have to keep the uploads minecraft based

hybrid spoke
#

or you create templates which represent the minecraft skin, but everyone would have the same image

#

no place for creativity

worthy yarrow
#

Such as getting an f5 view of your player model to post

hybrid spoke
#

or you can only use pictures made on the server

#

like a command /takepicture

worthy yarrow
#

Yeah

#

That would be really cool to be fair

hybrid spoke
#

i think there even was a plugin which did this

#

snapchat for minecraft

worthy yarrow
#

Minecraft tinder might become a thing....

hybrid spoke
#

nah lol

#

youd actually have to make an entire swiping simulator

#

aka a whole ass dating app

#

doubt anyone will do it

worthy yarrow
#

Like I said already, its out of my skill range so I won't be the one haha

tribal valve
#

how to initialize luck perms

hybrid spoke
#

?learnjava

undone axleBOT
tribal valve
hybrid spoke
#

sorry i meant

worthy yarrow
hybrid spoke
#

?learnjava!

undone axleBOT
tribal valve
worthy yarrow
#

Won't lie i forgot how I do it lol

tribal valve
hybrid spoke
#
worthy yarrow
#

^ that might tell you the correct way to do it

hybrid spoke
#

you have to get the instance over the provider service of bukkit

#

as the docs said

worthy yarrow
#

I never used luckperms either to be fair

hybrid spoke
#

i would call it common sense to look at the docs of the api you're using

worthy yarrow
#

@hybrid spoke would you like to have a look at my bounty plugin?

tribal valve
#

ok ill check if it worked

tribal valve
worthy yarrow
hybrid spoke
hybrid spoke
tribal valve
lost matrix
#

Language pls

worthy yarrow
tribal valve
proper cosmos
tribal valve
worthy yarrow
kind hatch
umbral ridge
hybrid spoke
worthy yarrow
#

I just put it on git

hybrid spoke
#

just drop it here

proper cosmos
# kind hatch sadge

idk, I don't really feel to change to other OS, I'm using windows since I first started using PC so I think that in near future i won't switch OSs

worthy yarrow
worthy yarrow
tribal valve
hybrid spoke
tender shard
#

you have to turn your component into a legacy string

worthy yarrow
lost matrix
# tribal valve bruh

This happens if you call toString() on a component message.
You need to either parse it or use a method which makes use of components.

worthy yarrow
hybrid spoke
#

or cool bounties

#

functional bounties idk

#

or turn it into a revenge plugin

worthy yarrow
#

Yeah like I want to do more with the heads you get from bounties tbf

hybrid spoke
#

so you have to take revenge on the player that killed you in order to get your head back

#

something this game played in school

#

"zombie ball"

#

where if someone throw you out you can only get back in if someone else throws them out

#

and you get more valuable the more you killed and collected

#

other than that idk. let npc slaves spawn out of the heads or whatever

worthy yarrow
#

Oh that sounds cool

timid hedge
lost matrix
lost matrix
timid hedge
#

Sure? im watching a toturial on how to make a discord bot to the things i want it to, and in the video "main" is being used

So you mean that i should just take everything from "main" and move it inside "onEnable" and delete "main"?

lost matrix
#

The main method will never be called

desert loom
timid hedge
clever lantern
#

can i make an entity (armor stand) visible only to some players?

young knoll
#

Sure

#

Use Player#hide/show entity

hybrid spoke
#

you can spawn it for them via packets or hide it for specific players

young knoll
#

There's also setVisibleByDefault

hybrid spoke
#

^

clever lantern
#

thanks

timid hedge
#

Does anyone know why the message isnt being send?
https://pastebin.com/QPrKwmzv
I dont really have that much experience in jda but i cant see whats wrong

hybrid spoke
#

isnt jda with .query

timid hedge
# hybrid spoke isnt jda with .query

Oh yeah i forgot, but even with .queue it still isnt working, the plugin is being enabled and the bot is online, but the message isnt being send

                TextChannel textChannel = shardManager.getTextChannelById(DiscordBot.config.getString("channelId"));

                            textChannel.sendMessage("Vagten " + vagtPlaer + " døde til fange " + fangePlayer).queue();
grim hound
#

Does anyone know how I can distinguish my own packets in ChannelDuplexHandler? I send them using Channel#writeAndFlush, so how can I make sure that the packet in ChannelDuplexHandler#write is my own packet and not block it?

clever lantern
#

can i hide a player and make them still visible in table when pressing tab?

hybrid spoke
#

nvm on that

#

can it find the channel?

remote swallow
timid hedge
timid hedge
remote swallow
#

the JDA class with JDABuilder

#

example:

timid hedge
hybrid spoke
remote swallow
#

get the channel from guild instance, then send message

wintry lynx
#
                //Bukkit.broadcastMessage("In Structure");
                CraftWorld cWorld = (CraftWorld) w;
                Level world =  cWorld.getHandle();

                Location structLoc = cWorld.locateNearestStructure(loc, Registry.STRUCTURE.get(NamespacedKey.fromString("revamp:desert_pyramid")), 200, false).getLocation();

                CraftChunk chunk = (CraftChunk) w.getChunkAt(structLoc);
                Map<Structure,StructureStart> structs = chunk.getHandle(ChunkStatus.STRUCTURE_REFERENCES).getAllStarts();
                for (Map.Entry<Structure,StructureStart> entry : structs.entrySet()) {
                    Structure structure = entry.getKey();
                    StructureStart start = entry.getValue();

                    int structBaseY = start.getPieces().get(0).getLocatorPosition().getY() - 4;

                    if (structBaseY >= loc.getY()) {
                        p.addPotionEffect(PotionEffectType.SLOW_DIGGING.createEffect(PotionEffect.INFINITE_DURATION, 1));
                        //Bukkit.broadcastMessage("Inside Crypts");
                    }else {
                        p.removePotionEffect(PotionEffectType.SLOW_DIGGING);
                    }
                }
            }else{
                p.removePotionEffect(PotionEffectType.SLOW_DIGGING);
            }```

This is how I went about checking if a user is in a structure, there is more than likely a better way to do this but I couldnt for the life of me figure out how to use a TagType or Registry.
tender shard
#

e.g. instead of sending XYZPacket, just create a class MyXYZPacket that extends XYZPacket

grim hound
#

and I'm not a big fan of making 20 modules for each version

#

also can't use bytebuddy cuz it weighs 3 MB

young knoll
warm mica
#

Isn't it possible to accomplish that using the api

young knoll
#

Not spigots

#

Not until my PR is merged

warm mica
#

Oh

worthy yarrow
#

Would anyone with some towny api experience mind taking a look at a project for me?

young knoll
# young knoll Not until my PR is merged

In which case you could just do

Structure structure = Registry.STRUCTURE.get(NamespacedKey.fromString("revamp:desert_pyramid"))
List<GeneratedStructure> structures = new ArrayList<>(chunk.getStructures(structure));

if (structures.isEmpty()) {
  // Maybe in structure
  GeneratedStructure currentStructure = structures.get(0); // Check with currentStructure.getBoundingBox()
} else {
   // not in structure
}
worthy yarrow
chrome beacon
#

Then you really should just ask how to fix it

#

while describing the issue

worthy yarrow
#

Ok then hold on haha

timid hedge
wintry lynx
worthy yarrow
#

https://github.com/NukeCaps/EpirateTownyAddon/tree/master

Alright so the issue is that the events are either not correct or something else in my code is just bugging. The intended functionality of this project is to add a cooldown to the player when they join / leave a town in order to prevent quick town hopping of sorts... In addition to this, it should also prevent anyone from inviting a player who is on cooldown as well as informing the inviter that the invited player is on cooldown... however even after adding in some debug prints, I've still had no progress with finding the issues... I was using different events before but the intended functions were still not working... if anyone has some towny api experience perhaps they could point me in the correct direction

GitHub

Contribute to NukeCaps/EpirateTownyAddon development by creating an account on GitHub.

chrome beacon
#

So what happens

worthy yarrow
#

Literally nothing haha

chrome beacon
#

Do the events not fire?

worthy yarrow
#

The point is that a cooldown is added to a player after joining / leaving a town if they do not already have one, if they are on cooldown, the event gets cancelled and they arent allowed to join / leave a town

worthy yarrow
#

Because none of my code seems to be getting ran when a player joins / leaves a town

chrome beacon
#

Put a print and see if it gets run

eternal oxide
#

are you registering yoru listeners?

chrome beacon
#

Also depend on Towny

worthy yarrow
worthy yarrow
worthy yarrow
#

Perhaps I'm using the wrong towny dependency?

        
        <repository>
            <id>jitpack.io</id>
            <url>https://jitpack.io</url>
        </repository>


          <dependency>
            <groupId>com.github.TownyAdvanced</groupId>
            <artifactId>Towny</artifactId>
            <version>0.99.5.0</version>
        </dependency>      ```
#

I know 0.100.1.0 is the most recent, but this project is being written for a server using 0.99.5.0

eternal oxide
#

events have not changed since then

chrome beacon
worthy yarrow
eternal oxide
#

Do as olivio said, then show us a server statrup log

worthy yarrow
chrome beacon
#

yeah

worthy yarrow
timid hedge
eternal oxide
#

All starts up so now add some debugs at the beginning of each listener., before ANY logic

eternal oxide
#

I guess because it happens to a Block.

#

It only fires for a Player, but I guess in thoery it could fire for others, in the future

worthy yarrow
#

We're just trying to see if the event fires correct?

#

Hi marco

tender shard
remote swallow
#

buildtools

#

if git isnt set it sets the user and that to bt

kind hatch
#

That was fixed in #171 btw

young knoll
#

We fixed that :p

#

Well

shadow night
young knoll
#

shadow did

kind hatch
#

It was a long standing bug that annoyed me.

shadow night
#

Why is my git name sometimes set to BuildTools

kind hatch
#

Because BuildTools would set the name and email globally if they were not already present so it could compile correctly.

shadow night
#

bruh

kind hatch
#

You'll have to go in and change your git settings, but BuildTools will no longer do that.

slender elbow
#

--local lol

shadow night
#

🍺

kind hatch
#

There were issues with other approaches to fix it before, but now it just sets local env vars.

worthy yarrow
#

Idk how to fix that lol, this is literally the first time I’ve ever used GitHub other than to look at others source / api documentation

fervent robin
#

What's the best way to store a list of itemstacks, strings, and 2 ints in an SQL table?

#

I was thinking serialization but wanted to hear other opinions

tender shard
# worthy yarrow It is?

it's shown above the method name

git config --global user.name "Your Name"
git config --global user.email "your@email.com"
worthy yarrow
slender elbow
#

i mean, serialisation just means "transform this live object into some transportable data representation"

#

it is not a technique

proud badge
#

What would be the equivelent of compileOnly files("libs\HeeseUtils-1.0-all.jar") in maven?

worthy yarrow
#

But perhaps just making a table for each datatype would be better?

fervent robin
#

that seems unefficient

kind hatch
#

It also depends on what you are trying to store and why.

fervent robin
worthy yarrow
#

I'm probably not the best person to be speaking on that topic to be fair, I have very little experience with sql

shadow night
worthy yarrow
kind hatch
#

Those are terminal commands, you just run them with the proper info.

worthy yarrow
#

Ah gotcha lol

worthy yarrow
kind hatch
#

You may need to restart IJ for it to refresh.

worthy yarrow
#

I did that as well, still displayed buildtools

kind hatch
#

I wonder if that works off of commit name then. 🤔

slender elbow
#

if those are already committed files, you'd have to change them

#

you are basically seeing "someone else's" changes

worthy yarrow
#

Ohhhh that's probably the issue then

#

Since I did those terminal commands however, now when posting new projects to git, it should display what I put in correct?

tender shard
#

go into your repo and enter git config user.name

#

does it show the correct name now?

worthy yarrow
lean pumice
#

Who among you could come to me to fix something that I can't?

tender shard
worthy yarrow
worthy yarrow
tender shard
#

uuhm what is a final var in kotlin

slender elbow
#

the property

tender shard
#

ah ok that makes sense, thx

worthy yarrow
tender shard
#

I know, but it's a var, and it's final

#

not val

#

it kinda seems weird because it sounds like "final not-final"

worthy yarrow
#

So then just apply final to val and there you go right?

icy beacon
worthy yarrow
#

That's why I don't use kotlin cuz its goofy

slender elbow
#

final in kotlin doesn't have to do with immutability/readonlyness

icy beacon
slender elbow
#

it's about inheritance

worthy yarrow
icy beacon
#

Welp

worthy yarrow
#

Also recovering from a head trauma so.... I'm slow I know

icy beacon
#

I've read the code review thread yes

worthy yarrow
#

So then don't be so mean! D:

icy beacon
#

None of my messages have been mean

#

Straightforward maybe

worthy yarrow
#

Look man I'm self taught over 4 years that has been on and off obviously I'm not going to be the best dev, but I am certainly trying! I just want to help where I can as well and thank you for pointing out the response I gave alex had absolutely nothing to do with what they were asking, but I swear my intention was to help only... I don't know everything i can admit that but we all have to start somewhere right? I'm just doing the best I can man

pliant topaz
#

I've got a PlayerBlockPlaceEvent which gets cancelled and after that another block is placed at the exact same location, but the block doesn't get placed, instead it seems that the cancel of the event is too slow and the block gets placed too fast. Is there anyway around this? And, would a scheduler (for a few ticks delay) work?

worthy yarrow
#

Perhaps 3 seconds is too long however, you can always adjust it to your needs, but it seemed to fix the issue I was having exactly how I wanted it to

pliant topaz
#

Okay, yea, 3 seconds are a bit long, so I'll prob use 5 ticks delay at max (or the minimum I can do for it to work), thx

tender shard
worthy yarrow
#

good thing alex is here, they seem to know everything about spigot api haha

tender shard
#

It kinda works like this, don'T ask me why lol

if(player has placed a block)
  call blockPlaceEvent
  if(blockPlaceEvent is cancelled)
    set block back to original
worthy yarrow
#

eek thats goofy

#

spigot is awesome sometimes huh

slender elbow
#

the fact that some cancelable events fire post mutation is goofy

#

but not all do so it isn't really consistent lol

worthy yarrow
#

is it really just a concern when it comes to functions that require that sort of instant cancellation?

tender shard
#

I think it's because a ton of different things that could happen when right-clicking with a block in hand and doing it that way, spigot doesn't has to handle all those different situations or sth

sullen marlin
pliant topaz
sullen marlin
#

So like it does place, but then it's reverted before the event

worthy yarrow
#

What in the hell

worthy yarrow
sullen marlin
#

It's not a case of just placed block = block version of item in hand

tender shard
#

to me it looks like it first calls placeBlock, and then later the event. and if the event is cancelled, it just calls update(...) on the original blockstate

sullen marlin
#

So the server has to run all the place code then figure it out

worthy yarrow
tender shard
#

what the heck is a SolidBucketItem

sullen marlin
worthy yarrow
#

Ah ok

#

yeah

#

I forgot minecraft does that haha

#

But even then, would it not just be better to handle the cases of those specific blocks instead the entire event?

sullen marlin
#

Definitely easier to use the existing code than rewrite it all

tender shard
worthy yarrow
tender shard
#

how to notice that a project is going into the wrong direction:

worthy yarrow
#

What are you up to alex?

tender shard
worthy yarrow
#

Oh sounds fun

#

and by fun I mean agonizing \

#

also why in kotlin? D:

tender shard
#

why not

#

it saves so much time

worthy yarrow
#

Maybe... I've never used it so I am biased 100%

tender shard
#

it looks weird at first but it's really great

worthy yarrow
#

Sigh this towny addon is giving me such a headache

#

The events just arent firing and I have no clue which ones to use because I swear I have tried them all

worthy yarrow
#

Idk I feel like this whole project is just written incorrectly and I'm just too slow currently to fix it lol

mellow edge
#

player.setPlayerListName to just change their name in tablist, but how would I reconstruct the hole tablist for each player differently? any in-game API?

fervent robin
rare idol
#

hey I can't figure out why neither the fuse nor the velocity is being set with this code


    @EventHandler
    public void onSneak(PlayerToggleSneakEvent e) {
        boolean sneaking = e.isSneaking();
        if(sneaking) {
            PluginLogger.getLogger("DTNTPlugin").info("Player is sneaking");

            Player player = e.getPlayer();

            TNTPrimed tnt = (TNTPrimed) player.getWorld().spawnEntity(player.getLocation(), EntityType.PRIMED_TNT);
            tnt.setFuseTicks(0);
            tnt.setVelocity(new Vector(0, 0, 0));
        }
    }
}```
Its supposed to spawn in tnt at players feet when they shift
tender shard
#

and what does actually happen?

rare idol
#

the tnt just has the default fuse (120 or 160?) and the usual random velocity when spawned in

#

its working except for the fuse and velocity portion

tender shard
#

try to set the ticks and velocity in the consumer https://blog.jeff-media.com/use-consumers-when-spawning-custom-entities/

When you want to spawn a custom entity, e.g. with a custom name or certain items equipped, you must use the method World#spawn(Location, Class, Consumer) unless you give a shit about compatibility with other plugins. I’ll explain why. The shitty way Usually, you can easily spawn entities like this: That is fine, as...

rare idol
#

oh that looks a lot cleaner, okay trying that

#

thanks

tender shard
#
player.getWorld().spawn(location, TNTPrimed.class, tnt -> {
  tnt.setFuseTicks(0);
}
worthy yarrow
#

https://github.com/NukeCaps/EpirateTownyAddon/tree/master

Made some reformations to the code, was trying to implement some of the suggestions I got before about readability and strict single purpose / functions methods, also fixed an issue with me (stupidly) shading towny into the plugin, last thing I tried to do was reduce the strenuous error handling into a simpler system. Please let me know what you think and if I could make any more improvements!

GitHub

Contribute to NukeCaps/EpirateTownyAddon development by creating an account on GitHub.

fallow gyro
#

Is there a way to attach meta data to an inventory? Say, for example, store a string within an inventory without using any items? Thanks

manic dawn
tender shard
#

also why is that repo using a maven layout if theres no pom.xml?

tender shard
fallow gyro
tender shard
#

yeah whats the issue with that?

#

just check if yourMap.containsKey(event.getClickedInventory())

worthy yarrow
#

Hey alex you should look at my revissions and let me know what you think... I worked kinda hard on the formatting and trying to make it a lot easier to read

fallow gyro
#

Ah, so literally storing the inventory object inside a hashmap? Currently I'm storing classes which contain an inventory object in my hashmaps.

worthy yarrow
#

I love honest feedback, and you give good notes as well

river oracle
fallow gyro
manic dawn
tender shard
undone axleBOT
tender shard
fallow gyro
tender shard
#

np

manic dawn
tender shard
#

no, you shall paste your server log

manic dawn
#

now i found the error

wintry lynx
#

Anyone know a good way to make mining fatigue not mine slower? Im replacing it with a custom effect

young knoll
#

Uhh

#

Don’t let the player get it?

#

Or rewrite the block breaking system to be server side

#

Kek

wintry lynx
young knoll
#

Ahh

#

Well yeah you’d have to rewrite the break system

#

Why replace it thought, just make a custom effect system

wintry lynx
#

Itll be used in ocean monuments but it more completely disables block interaction apart from a select few.

young knoll
#

Why not just go off the base mining fatigue then

#

Since it seems you want it to be a more powerful version

wintry lynx
#
java.lang.NoSuchMethodError: 'net.minecraft.core.IRegistryCustom net.minecraft.world.level.World.I_()'```
Also this is the error I get
#

with the code from earlier

young knoll
#

Did you remap for the right version

wintry lynx
#

I used paperweight

young knoll
#

Hmm perhaps World#registryAccess is paper only

wintry lynx
young knoll
#

Try MinecraftServer.getServer.registryAccess

#

Oh, then it shouldn’t be a problem

wintry lynx
young knoll
#

Yes but I mean at runtime

wintry lynx
#

Yea I use paper

young knoll
#

¯_(ツ)_/¯

#

If your server is also on 1.20.2 then idk

wintry lynx
#

Im testing it rn

#

Yea I got no clue

#

Same error

wintry lynx
young knoll
#

Doubt it?

#

Double check your server version

fervent robin
#

Is there a way to loop through all advancement names?

#

I have tried using Bukkit.advancementIterator() but have tried a couple different ways but can't find a way to get the name of it

young knoll
#

Advancement#getDisplay#getTitle?

fervent robin
#

thanks

young knoll
#

Just null check it?

#

No need for try catch

fervent robin
#

holy shit my brain is not functioning to 100%

#

idk why i didnt default to that

young knoll
#

Anyway the hidden advancements probably have null names

#

Or maybe all the recipe ones

topaz cape
#

does Player#closeInventory trigger InventoryCloseEvent

young knoll
#

Probably

#

After all it closes the inventory

topaz cape
#

well, it does xd, i was just wondering about the event

wintry lynx
river oracle
#

if you want to not trigger the event you're probably doing something wrong. If you want it to trigger the event you are probably doing something right

silent tendon
#

Question by what was getServer().getCommandMap().register("", new Settings()); replaced in 1.20? So that I can simply use command instead of CommandExecuter

young knoll
#

Wut

silent tendon
#

So I want to use extends Command in the Command, but I don't know how I can register it in the Main
For CommandExecuter, for example, it is getCommand("setwarp").setExecutor(new SetWarp(mySQL));

young knoll
#

You can only register commands that are listed in your plugin.yml

#

With the api anyway

silent tendon
#

Yes, with CommandExecuter I have to enter it in the Plugin.yml, with extends Command you didn't have to do this in 1.19 and you could register it like this getServer().getCommandMap().register("", new Settings());

river oracle
#

?jd-s

undone axleBOT
slender elbow
#

getCommandMap :weewoo:

river oracle
#

is that a paper addition

slender elbow
#

perchance

silent tendon
#

I have no idea, I'm always changing programming and that's why I still have it in my head

wise mesa
#

if I'm trying to update a structure, do I need to unregister it before I register it

young knoll
#

From the registry?

wise mesa
#

yes

young knoll
#

Probably

#

Or you can hack apart the existing entry and essentially replace it

wise mesa
#

eh

#

just a small personal project I'm not too concerned

#

I'll take the path of least resistance

worthy yarrow
vocal cloud
#

Well for starters your package setup isn't convention.

#

Some of the comments are redunant. Comments should only really be used when clarification is required

worthy yarrow
#

there was an extra for the cooldown util class, but that was removed since I updated the cooldown system to just use towny, that just left the main in an odd spot with the events hanging in that other package

vocal cloud
#

For example, if you think this requires a comment it would be because the name isn't clear.

worthy yarrow
vocal cloud
#

If your code isn't mostly self-documenting you've got another problem. Here, if you're okay with it I'll refactor a class as an example.

worthy yarrow
#

And it was also something I might like to keep for a portfolio of sorts... so any and all notes are appreciated

worthy yarrow
#

I thought my naming was pretty alright for the methods and what not? Do you think they could be better to describe the function?

vocal cloud
#

When you write that many comments you seem insecure others can read your code. Don't assume the person reading is an idiot. Just assume they're going off variable names and function names. Comments are for clarification so you don't need a method called getAllXfromYthenParseXandY etc etc

river oracle
worthy yarrow
#

Right right... also to be fair, this is probably the first time I've ever actually commented code (I was showing my father haha), in addition to that like I said I was proposing it to the head dev of towny so perhaps the comments would be nice just to give a quick scan of the code perhaps.

wise mesa
#

is there any preference between the runTask and scheduleTask variants

vocal cloud
#

Also, you need to remember that errors are for users
Bukkit.getLogger().log(Level.FINE, "TownPreInviteEvent Failed: either ln 32 / ln 53"); This is terrible for the end user to read. Not to mention it's the wrong log level. You really want to explain that something terrible went wrong. It's not a "weird error" you're logging it's something potentially gamebreaking and the user should be made directly aware via an error message that states exactly what's gone wrong.

river oracle
young knoll
#

Fine level never gets logged anyway

vocal cloud
#

I'm going to take this to the thread as there is a lot more to unpack

worthy yarrow
#

I only have one mc account so I can't test the functions

young knoll
#

Offline mode

river oracle
#

^ Use Offline mode

worthy yarrow
#

I can connect to localhost that way?

plain plaza
#

What event is triggered when giving an allay an item? PlayerInteractEntityEvent or PlayerInteractAtEntityEvent doesn’t seem to work.

river oracle
worthy yarrow
#

Oh cool thank you

worthy yarrow
vocal cloud
#

This code here doesn't need to be try catched as the method inside doesn't throw an error.

worthy yarrow
#

But you are correct I think I used the wrong levels on some prints haha

worthy yarrow
vocal cloud
#

Putting a guard case for the inviter or invitee for example will delete most of your nested if eyesore

#

The warnings Intellij is highlighting are essentially "you don't need this anymore because it'll always be true"

worthy yarrow
#

Gotcha alright

worthy yarrow
vocal cloud
#

Here is the final result. Cut 50% of the code and nothing of importance was lost.

worthy yarrow
#

    private final EpirateTownyAddon epirateTownyAddon;

    public TownPreInviteEvent(EpirateTownyAddon epirateTownyAddon) {
        this.epirateTownyAddon = epirateTownyAddon;
    }

    // Event Handler method to handle invites to players on cooldowns.
    @EventHandler
    public void onInviteSent(TownPreInvitePlayerEvent event) {

        Player invitedPlayer = event.getInvitedResident().getPlayer();
        Player inviter = (Player) event.getInvite().getDirectSender();

        if (invitedPlayer == null || inviter == null) {
            Bukkit.getLogger().log(Level.WARNING, "Could not process invite as either inviter / invited player is null!");
            return;
        }

        if (CooldownTimerTask.hasCooldown(invitedPlayer.getName(), "TownHop Cooldown")) {
            // Get the appropriate message(s) related to this function.
            long remainingCooldownHours = epirateTownyAddon.getRemainingCooldownHours(invitedPlayer);
            String inviteMessage = ChatColor.translateAlternateColorCodes('&', epirateTownyAddon.inviteCooldownMessage
                    .replace("%player%", invitedPlayer.getName())
                    .replace("%hours%", String.valueOf(remainingCooldownHours)));
            
                event.setCancelled(true);
                event.setCancelMessage(ChatColor.translateAlternateColorCodes('&', inviteMessage));
                
        }
    }
}``` 

This look better? @vocal cloud
vocal cloud
#

Comments are still unnecessary imo. Only need them when it's a function you've made that needs clarification on either the input or the output that an annotation cannot provide

quick wing
#

could someone possibly help me, im trying to make a little mod that presses or simulates a keypress a key whenever theirs a certain message displayed in chat ex: "blah blah blah" then i would press 0 on my keyboard
not a player typed message but a system typed message

worthy yarrow
river oracle
#

what you want isn't possible

quick wing
river oracle
#

if you're talking about forge/fabic

#

its certainly possible but this isn't the place to be asking those questions

quick wing
#

could you send me those discords per chance

river oracle
worthy yarrow
#

@vocal cloud

...
// this is an event class btw
}

*
*
*

public boolean isCooldownExpired(Player player) {
        return !CooldownTimerTask.hasCooldown(player.getName(), "TownHop Cooldown");
    }
// method in the main class

Should I instead of using CooldownTimerTask to check if the player has a cooldown active, should I just reference my helper method for checking if the cooldown is expired?

#

It achieves the same outcome either way correct? I just wasn't sure if it would be better to use the resources I made haha

quick wing
#

thanks tho numb nuts

vocal cloud
worthy yarrow
#

Well I suppose it just comes down what the outcomes are when I test it

vocal cloud
#

The nice thing about the way I did it was you can easily add temporary logs to before/after the if assuming that's where trouble arises

worthy yarrow
worthy yarrow
vocal cloud
#

Practice makes perfect

worthy yarrow
#

Yeah I notice that for my 4 years on and off of self taught spigot development, my logic is pretty decent, I just have poor writing techniques and formatting

#

At least I think my logic is pretty decent haha

vocal cloud
#

Well your over care with try catch is something you need to watch out for

young knoll
#

Try catch the entire plugin

vocal cloud
#

I'll check the code later

worthy yarrow
wise mesa
#

or like a preferred default

vocal cloud
#

log to debug never try catch to debug

worthy yarrow
#

Gotcha no worries

river oracle
# wise mesa is there any reason to use one over the other

Is this in the BukkitScheduler? I mean a lot of those methods are deprecated for one reason or another. I'd stay away from the schedule methods looks like they're all deprecated. For a naming reason but still depreciation even in bukkit means it's possible they could eventually be removed. Especially with Commodore now it's very possible If you use them it's possible they could dissappear and only ABI is retained

#

?jd-s

undone axleBOT
worthy yarrow
#

https://gyazo.com/572806861ddc263f901210c60b0ba6b1
https://gyazo.com/1b4b1b3af94e2e97e6daaff1a500ed74
https://gyazo.com/f4d19b63a63ac897b7bb5eb19d6b75a2
https://github.com/NukeCaps/EpirateTownyAddon

Finally got this thing working haha. I'm now going to add an ingame gui where you can mess with the config for the cooldown timer and message customization. Let me know what you guys think! @vocal cloud (sorry for the ping but you're still online and I'd love to hear your feedback!)

Also yes the default messages are ugly but they are configurable and support & color codes haha

GitHub

Contribute to NukeCaps/EpirateTownyAddon development by creating an account on GitHub.

wise mesa
#

So that’s why I was asking

wraith dagger
#

?mapping

#

mappings?

#

?mappings

#

?map

#

?help

undone axleBOT
#
CafeBabe Help Menu
*Red V3*
__**Admin:**__

selfrole Add or remove a selfrole from yourself.

__**Cleanup:**__

cleanup Base command for deleting messages.

__**Core:**__

embedset Commands for toggling embeds on or off.
info Shows info about CafeBabe.
licenseinfo Get info about Red's licenses.
mydata Commands which interact with the data CafeBabe has about...
set Commands for changing CafeBabe's settings.
uptime Shows CafeBabe's uptime.

__**Downloader:**__

findcog Find which cog a command comes from.

__**Mod:**__

names Show previous usernames, global display names, and server...
userinfo Show information about a member.

__**ModLog:**__

listcases List cases for the specified member.
reason Specify a reason for a modlog case.

__**Permissions:**__

permissions Command permission management tools.

wraith dagger
#

mappings

#

?mappings

undone axleBOT
slender elbow
#

#bot-commands lol

quaint mantle
#

Hey got a gradle error when trying to get authlib to work.

Runescape:main: Could not resolve com.mojang:authlib:5.0.51.
Required by:
project :

https://paste.md-5.net/wufegifebo.cs
My entire build.gradle

I just built this project and its for the latest version but i created this project the same way I do for any other project so I don't understand what is wrong this time. Anyways I need the authlib to work for the latest version, because I am going to be running the latest version

quaint mantle
#

@Helper I think the website is down and thats why im not able to download Mojang Authlib

slender elbow
#

works fine for me

quaint mantle
# slender elbow works fine for me

I dont know why it is still giving me this error when building my gradle file.

Runescape:main: Could not resolve com.mojang:authlib:5.0.47.
Required by:
project : > org.spigotmcspigot1.20.2-R0.1-SNAPSHOT:20230922.144705-1

#

In my dependencies im using 1.20.2 now instead of 1.20.4 but i still get the same error

shadow night
quaint mantle
shadow night
#

Then you don't need the spigot-api dependency

quaint mantle
#

'NMS' i guess

wet breach
#

The api is in the server jar

quaint mantle
wet breach
#

Also in regards to depending on the server jar this should help

#

?bootstrap

undone axleBOT
#

Bootstrap Jar
The main spigot-1.18.jar is now a bootstrap jar which contains all libraries. You cannot directly depend on this jar. You should depend on Spigot/Spigot-API/target/spigot-api-1.18-R0.1-SNAPSHOT-shaded.jar, or the entire contents of the bundler directory from your server, or use a dependency manager such as Maven or Gradle to handle this automatically.

Please read the release notes for further information: https://www.spigotmc.org/threads/9-years-of-spigotmc-spigot-bungeecord-1-18-1-18-1-release.534760/#post-4305163

quaint mantle
#

How would that make sense

wet breach
#

Because it applies from that version and onwards

wet breach
#

I imagine you dont change your build setup besides dependencies every version of your plugin.

quaint mantle
#

Okay lets stay on topic though, I am just trying to get access to NMS to work.

worthy yarrow
#

Hey there frostalf, how are you doing?

wet breach
#

It is on topic and what the bot sent should help you

quaint mantle
#

Imported this: compileOnly 'org.spigotmc:spigot-api:1.18-R0.1-SNAPSHOT'

Builds successfully, but of course no access to Mojang Authlib

wet breach
#

You dont need the api if you are going to depend on the server jar

worthy yarrow
wet breach
#

Was waiting to see if that person was going to say anything else lol

#

Howdy

worthy yarrow
#

Haha no worries

#

Just made my first functional git repo!

wet breach
#

Nice, but technically all git repos are functional even if nothing in them

worthy yarrow
#

I meant functional more so when it comes to the plugin haha

#

It's a small niche towny addon that implements a configurable coodlown that prevents townhopping

quaint mantle
wet breach
#

I dont understand that the server jar has the api?

#

You are the one that wants to use nms which is fine. you need the server jar for that

worthy yarrow
wet breach
#

Ok did you follow in the steps in the 2 posts?

quaint mantle
#

That link is my build.gradle file so tell me why my NMS is not working?

hybrid turret
#

since google kinda left me hanging again, i have a not that relevant question about general java (and idk where else to ask tbh):
is it better practice to use:

public static final String A_STRING_CONSTANT = "Some String here";

or

private static final String aStringConstant = "Some String here";

public statif String getAStringConstant() {
  return aStringConstant;
}

?
Or is this just preference?

wet breach
#

Well i only sent a link to 1 post but there is two posts. If you read through the first one it will lead to the second post. And there is more info. I dont know how to set up gradle the proper way or what it should look like. I only know maven however you know gradle so i gave you the link to the necessary info if you are going to depend on the server jar

wet breach
quaint mantle
#

Bro im going to be completely honest i read all that please dont take me for a lazy person, i tried all that you offered me i just dont understand how this can help me get the use of NMS in my project.

And I am shading not depending their is a difference bro

wet breach
#

You are shading the server jar?

#

O.o

#

Well regardless will have to wait till i get home as i am about to drive. Just got off work

quaint mantle
hybrid turret
worthy yarrow
#

I just had lots of problems trying to shade towny as a dependency haha tbf it was also maven so not sure if that's a different process

wet breach
#

Plugins typically dont work if they are shaded

#

Well shaded into another plugin that is

worthy yarrow
#

ah gotcha, yeah it was causing me issued for like 5 commits

#

Btw frost do you wanna review the project I've been talking about?

agile anvil
#

Any ideas on how I can get the height / width of a display entity? Display#getDisplayHeight and Display#getDisplayWidth exist but return 0 🙂

tender shard
undone axleBOT
agile anvil
#

thx

wet breach
tribal valve
#

if id want to set villagers recipes how would i set the trades, like ive seen the docs but it looked like i could only set the item you need to pay with and not the item you get after you pay

sullen marlin
#

Where do you get that idea?

#

"result"

tribal valve
#

it only gets one item stack

#

as argument

hybrid turret
#

Can I re-register a tab-completer on the fly?

cobalt thorn
#

Hey, im coming back inside the community after some time and i lost track of the new adds like block display and i saw people like making ropes etcs.. with physics does the block have it already by default or something is adopted to make it work?

hybrid turret
tender shard
hybrid turret
#

okay perfect, thanks

sullen marlin
tribal valve
tender shard
#

addIngredient

#

the constructor is obviously only for the result item

tribal valve
#

damn i cant do it in one line?

tender shard
#
NerchantRecipe recipe = new MerchantRecipe(result, 1); recipe.addIngredient(myItem);

:p

#
val recipe = MerchantRecipe(result, 1).apply { addIngredient(myItem) }
tribal valve
#

also whould -1 work as infinite uses?

#

technically yea but wouldnt look good

#

your ceo of hell

tender shard
#

couldnt he just Ctrl+Alt+L

tender shard
#

oh yeah but visual studio also suckz

tribal valve
#

but also i think there was like a code prettier online or sum

young knoll
#

VS has a format all

tribal valve
young knoll
#

It’s like CTRL + K + D or something

tender shard
#

"i use a special operating system that uses \u+151 as line separator"

tribal valve
#

you couldve also change like function names to "uu6YS7" or sum and variables to "00nau7HS"

#

you could write another program to do it for you

hybrid turret
cobalt thorn
#

its possible to make blocks you can throw or placing them not in the normal way like stacking them in the border etcs? and if you have a guide or some kind of plugin could be useful

flint coyote
#

Yes and no. You can have falling blocks, those don't have to align to the block grid. However having tons of them will lag out your server since they are entities, not blocks

cobalt thorn
tender shard
#

is it possible to show a task in two categories in gradle?

wet breach
#

it does have auto formatting however

flint coyote
#

wdym by places you can't reach normally?

tender shard
cobalt thorn
wet breach
#

also it depends which visual studio you are referring to

#

visual studio code doesn't work exactly the same as Visual Studio Pro

flint coyote
flint coyote
#

There is a comment that explains exactly how it works

icy beacon
#

No blaming anything on anyone

wet breach
#

that is what happened to me XD

#

The window learned its lesson though and didn't try fighting me again

#

but to be fair I didn't try fighting it again either

icy beacon
#

What a peaceful resolution

ivory sleet
#

Not sure if it can show up in both tho

#

Maybe just have two tasks to cover both groups

wet breach
#

also, it is a myth when they say cars can't fly

#

as well as it is a myth that you must use an axe to split a tree

#

a car is just as effective as long as its going fast enough

ivory sleet
#

I mean doesn’t it depend on the definition of flying?

wet breach
#

I suppose that is true, because even though I did go quite the distance, it didn't like stay in the air for a long duration

ivory sleet
#

Yea lol

wet breach
#

but I could blame the tree for being in my way though

#

but, it did get split in half so there is that

distant wave
#

should i use hibernate with spigot/plugin dev?

tender shard
#

I don't think I can add the same task name twice, otherwise how would it know which one to run when using it from CLI?

#

but sure let me try quickly

ivory sleet
#

probs not

#

Why do you want it to show up in both?

tender shard
tender shard
ivory sleet
#

Ah I see

#

Well

#

There might be a way to attach the task to both groups on the intellij sidebar with some hacketry, tho doubt its worth the effort

#

Also alex can I dm you about something

tender shard
#

sure

tender shard
#

I figure even changing it in IJ will not really be possible, IJ seems to just get the output of gradle tasks

#

I think I'll just move the copyAll to basics, and then basics-test is to test specific modules

#

alsop what the hell is this

#

why does shadow include that lmao