#help-development

1 messages · Page 2294 of 1

tranquil flicker
#
    <repositories>
        <repository>
            <id>dmulloy2-repo</id>
            <url>https://repo.dmulloy2.net/repository/public/</url>
        </repository>
        <repository>
            <id>spigotmc-repo</id>
            <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
        </repository>
        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository>
    </repositories>

    <dependencies>
        <dependency>
            <groupId>com.comphenix.protocol</groupId>
            <artifactId>ProtocolLib</artifactId>
            <version>4.8.0</version>
        </dependency>
        <dependency>
            <groupId>org.spigotmc</groupId>
            <artifactId>spigot-api</artifactId>
            <version>1.19-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
  </project>
#

There.

tranquil flicker
quartz gull
#

mk

#

hm

tender shard
#

i love gh copilot

eternal oxide
#

fiver will do the same thing

supple elk
#

I'm trying to store a location in a config file, have I done this correctly?

eternal oxide
#

no need to serialize teh vector just put "vector", vector

#

it will be serialized when its put in teh config

supple elk
#

oki

#

so how would I now store a list of these in a config file?

granite burrow
#

Is there a way to add a tab complete option to an already existing command on the server?

eternal oxide
#

config.set("positions", List<Positions>)

supple elk
#

and accessing like that?

eternal oxide
#

yes, but pass something other than an empty List

supple elk
#

yeah

#

otherwise I won't be storing anything

#

I've got a list of Locations

#

so now I need to turn all of them into positions

eternal oxide
#

just add a constructor to your Position which takes a Location

supple elk
#

I made a static method

eternal oxide
#

that works too

supple elk
#

cause it's a record, trying to make constructors was weird

#

saying they weren't canonical and must reference canonical constructors

#

but then it was saying the reference to this() must be the first statement

#

however that means I can't do anything else

#

is the use of static here ok?

eternal oxide
#

yes

supple elk
#

👍

bold solstice
#

im not sure, if I do structuremanager.Loadstructure("minecraft:structurethingy"); will it load it?

eternal oxide
#

if that is a valid structure, it will load it and return a Structure

#

Just using the NamespacedKey it mush have been previously registered

#

If it has not been loaded/registered you would use java structuremanager.Loadstructure(getStructureFile(newNamespacedKey("minecraft:structurethingy")));

shadow zinc
#

Why doesn't the event get called?

#

so im halting the server, saving the event and then calling it later

#

but it doesnt actually work

eternal oxide
#

Firing an event yourself will do nothing other than notify plugins that an event just happened which didn;t

shadow zinc
#

Well I tried recreating it myself and it didn't work

#

tried it async and nothing

eternal oxide
#

save the old and new current, then set those values on that specific block to trigger a new redstone event

shadow zinc
#

I did

#

little success

eternal oxide
#

no you raised an event

shadow zinc
#

this is my 10th attempt at this

eternal oxide
#

raising an event does nothing

shadow zinc
#

I've tried many other things before raising events

eternal oxide
#

getBlock

shadow zinc
#

okay, let me restore my code real quick and show you what I was doing

eternal oxide
#

getLocation and getOldCurrent, getNewCurrent.

supple elk
#

anyway I can check this cast? Or do I even need to

eternal oxide
#

store those

#

when you want to trigger it,

#

get teh block at that location, set old current, then a tick or two later, set new current

shadow zinc
#

?paste

undone axleBOT
supple elk
eternal oxide
#

to both

supple elk
#

ok

shadow zinc
supple elk
#

I will supress it then

eternal oxide
shadow zinc
#

k

#

as in never or never?

eternal oxide
#

This line blockState.getBlock().getState().update(true, false); wipes out any change you just made

sweet pike
#

why does player.openEnchanting(null, true); not do anything? i've been struggling on how to get a command-based enchanting GUI, much like if you did /workbench and you could open a crafting table

shadow zinc
#

k, well remember I tried 100 things before this, so thats why I started doing wacky stuff

eternal oxide
#

each BlockState is a snapshot of that Blocks data. Work on One snapshot and then push it back with .update

shadow zinc
#

so do use update?

eternal oxide
#

yes, but on the same BlockState you made changes to

#

Do not get a new BlockState

#
BlockState state = block.getState();
state.setBlockData(data);
state.update();```
shadow zinc
#
            for (BlockState blockState : cachedData.cachedRedstoneActivity.keySet()) {
                try {
                    org.bukkit.block.data.BlockData data = blockState.getBlockData();
                    if (data instanceof org.bukkit.block.data.Powerable) {
                        blockState.getBlock().setBlockData(data);
                        blockState.update(true);
                    } else if (data instanceof org.bukkit.block.data.AnaloguePowerable powerable) {
                        powerable.setPower(cachedData.cachedRedstoneActivity.get(blockState));
                        blockState.setBlockData(powerable);
                    }```
#

like that

#

top if

#

does jack

#

am I missing something?

eternal oxide
#

at the end of making changes you call update

shadow zinc
#

which is what am I doing?

eternal oxide
#

only in one part of your if statement

shadow zinc
#

oh wait

#

stop

#

errors

#

lots of errors

#

cant async apparently

#

k

#

let me not async

eternal oxide
#

nope, no async world changes

shadow zinc
#

someone told me to

#

so

#

technically its not my fault

#

omg it worked so well...

#

it was one pulse

eternal oxide
shadow zinc
# eternal oxide I saw a report a few days ago that force opening enchanting tables may be broken...

why isn't this doing the right thing? java for (BlockState blockState : cachedData.cachedRedstoneActivity.keySet()) { try { org.bukkit.block.data.BlockData data = blockState.getBlockData(); if (data instanceof org.bukkit.block.data.Powerable) { ((Powerable) data).setPowered(cachedData.cachedRedstoneActivity.get(blockState)>0); blockState.getBlock().setBlockData(data); } else if (data instanceof org.bukkit.block.data.AnaloguePowerable powerable) { powerable.setPower(cachedData.cachedRedstoneActivity.get(blockState)); blockState.setBlockData(powerable); } blockState.update(true); } catch (NoClassDefFoundError e) { Logger.outdated(); } catch (Exception e) { throw new RuntimeException(e); } }

eternal oxide
#

You need an actual table at the location for it to correctly operate

#

Else teh logic is disconnected

shadow zinc
eternal oxide
shadow zinc
#

not actual tables

#

yeah whenever I use that language it never works

#

My current code is f*cked

eternal oxide
#

One sec let me open my IDE and check enchanting

shadow zinc
eternal oxide
#

um, What exactly are you trying to do?

shadow zinc
#

Halt, stop all redstone activity

#

cease

#

then

#

any attempted redstone activity during that halting period is restored

bold solstice
#

I need help with loading a structure

shadow zinc
#

after the halt

#

the restoring part is the part that isn't working

#

my original code worked, but it messed up the timings

#

so i started experimenting with other methods, but that didnt work either

eternal oxide
#

to restore it should just be a case of making a single pule.

shadow zinc
#

for any case?

#

is that one solution fits all?

#

and one pulse would be done using a runnable?

#

set powered

#

then off

#

after a tick?

#

surely that would mess up other contraptions that don't fit what I am doing?

eternal oxide
#

You are going to have a nightmare accounting for every type of contraption

shadow zinc
#

yeah well everyone using my plugin is pissed

#

and its bloody optional feature

#

now im behind on my normal release schedule

eternal oxide
#

Shitty Microsft. Can;t login to minecraft

shadow zinc
#

god don't get me started on that

#

my entire school switched from google suite to microsoft

#

now instead of gdrive we got onedrive

#

outlook

#

its absurd

earnest forum
#

the share button on the word app doesnt even work

#

it just loads constantly

shadow zinc
#

I don't even use the app, I use the online version

#

running at 5 fps

eternal oxide
#

Oh no something went wrong. Play Demo!

#

Eff you MS I own multiple copies of MC

shadow zinc
#

boots up a cracked version

#

@eternal oxide Your one tick method works kinda

#

something it doubles the pulse

#

How can I avoid that?

eternal oxide
#

Yeah I can;t test shit, auth servers are effed

shadow zinc
#

Here is a straightforward question you might be able to help me with, how can I get the block that powered the block I am looking at and powering?

eternal oxide
#

that is not easy

shadow zinc
#

come on, should I just discontinue with feature?

eternal oxide
#

tree search of the area is the only way I know of

shadow zinc
#

thats not very efficient

eternal oxide
#

yes

earnest forum
#

is there a difference between BlockPlaceEvent#getBlock() and #getBlockPlaced()?

eternal oxide
#

Nothing by the looks

lost matrix
shadow zinc
#

How do I update a redstone block that is stuck?

#

like if a repeater is powered but not moving, I break the repeater after it and it works

eternal oxide
#

reduce or increase its charge

shadow zinc
#

how can I recreate that in code?

shadow zinc
eternal oxide
#

I've not tried

#

is the repeater actually locked?

shadow zinc
#

No

#

its just broken because I stopped it

#

I need to get it going again

eternal oxide
#

does that method return false though?

#

you can lock a repeater by applying a charge to its side

#

if its behaving as locked you can setLocked(false) to unlock it

#

else you have to change teh charge level

fiery prairie
#

yo, i have updated my config.yml in intellij, however when i build it and remove any files of my plugin on my server, it still generates the old config, help?

eternal oxide
#

refresh (F5) the project in IJ

fiery prairie
#

alright, thanks ill try it

fiery prairie
eternal oxide
#

open teh jar with a compression util (7zip)

#

see what config.yml is in there

fiery prairie
#

its working

#

but on the server it isnt

eternal oxide
#

then your code is breaking it. probably setting somethign null and saving

fiery prairie
#

orr maybe visual studio doesnt seem to be able to update my config (cause thats what im using to view the config) ill try using a notepad

#

to open the config

#

nope still noithing

eternal oxide
#

if the config is correct in the jar but not on the server, its your code breaking it

fiery prairie
#

should i send the code?

eternal oxide
#

the only thing you should be doing with your config at startup is saveDefaultConfig();

fiery prairie
#

yea ik

#

the only other thing that manages the config is my custom reload command

eternal oxide
#

custom?

#

Plugin#reloadConfig()

fiery prairie
#
    public void reload(){
        reloadConfig();
        badwords = getConfig().getStringList("badwords");
    }```
```java
        } else if (command.getName().equalsIgnoreCase("cplus")) {
            Player p = (Player) sender;
            if (p.hasPermission("cplus.reload")) {

                reload();

                p.sendMessage(ChatColor.GREEN + "Reloaded the messages of ChatterPlus");
            }```
#

in the reload method i used that badwords thing to refresh a list too

noble lantern
#

deadass was about to post some long ass complicated function asking "Why is distance between always 0" facepalm

opal juniper
#

why all the atomic references

noble lantern
#

async pathfinder stuff IDE kept bitching at me and i was lazy

#

cause variables changed inside lambdas need to be atomic/final

subtle folio
#

atomic bomb

noble lantern
#

good idea

#

the npc will build a bomb underneath the players bed location

#

and on right click the NPC till run to the tnt and light it

bold solstice
#

I need help with loading a structure in a location can anyone please help me

eternal oxide
#

ask a specific question

drowsy helm
#

very broad question

bold solstice
#

I just couldn't understand how it works

#

do I need to approach the StructureBlock class, structuremanager?, Structure

#

its so confusing

eternal oxide
#

StructureManager holds all loaded Strructures

#

You either use a loaded one, or you load one, OR you create one

#

Its probably easier if you tell us what you are trying to do

reef lagoon
#

b r u h

eternal oxide
#

requireNonNull does not stop things being null

drowsy helm
#

just use an if statement lol

#

requireNotNull is lazy

reef lagoon
#

k lol

eternal oxide
#

Pointless unless its in a unit test, just makes your code blow up earlier java public static <T> T requireNonNull(T obj) { if (obj == null) throw new NullPointerException(); return obj; }

bold solstice
#

sry for ping

reef lagoon
#

gonna do try & catch

eternal oxide
#

did you save teh arena?

bold solstice
#

yes I saved all the arenas I want

#

I just want to load them via code

eternal oxide
#

as Structures?

bold solstice
#

yes

drowsy helm
#

just use schematics

eternal oxide
#

then they correctly exist in your world folder?

#

Structures are a part of Spigot now

#

no need for schematics

bold solstice
eternal oxide
#

so what issue are you having?

#

You get the Structure from the StructureManager and Structure#place

bold solstice
#

so does structuremanager#loadStructure is correct?

eternal oxide
#

You did just say you can load them

#

Yes you use load to load it/fetch it if already loaded

opal wedge
#

Hey, I want to prevent ladders from falling off the wall when the attached block breaks.

For this I tried the following code. The sout is also output to the console, but the blocks break despite the event.setCancelled(true);.

    @EventHandler
    public void onPhysic(BlockPhysicsEvent event) {
        if (event.getBlock().getType() == Material.LADDER) {
            event.setCancelled(true);
            System.out.println(event.getBlock());
        }
    }

Would anyone have an idea where the error could be?

eternal oxide
#

physics is not a break

bold solstice
eternal oxide
#

Oh you mean the ladder breaks

opal wedge
eternal oxide
#

I've not attempted to cancel a physic event to stop a break.

#

generally you fake the supported block breaking

bold solstice
#

is that correct?
manager.loadStructure(new File("world/generated/minecraft/structures/structure.nbt"))

eternal oxide
#

if that is your structure

#

and your world is called world

bold solstice
#

alright tysm

#

u helped me a ton

pulsar path
#

how to set the speed of a minecart?
not max speed, the speed its actually moved

eternal oxide
#

you could easier do java StructureManager#loadStructure(new NamespacedKey("minecraft", "structure"));

#

so long as you saved it with the name structure

tender shard
river oracle
#

It's so satisfying

tender shard
#

yeah I wish every application would have this D:

eternal oxide
#

ALT+SHIFT+A in eclipse

pliant plover
#

How can I summon an Iron Ingot? I#m trying to make a Dropper for a Bedwars game

waxen plinth
#

World#dropItem

pliant plover
#

It gives this Error: The method dropItem(Location, ItemStack) in the type World is not applicable for the arguments (Location, Material)

#

I typed: w.dropItem(Grau, Material.IRON_INGOT);

#

w is: World w = p.getWorld();

eternal oxide
#

Look at the error and what do you think it means?

pliant plover
#

but, how can I make it different?

eternal oxide
#

It tellsl you what its expecting and what you provided

pliant plover
#

I tried creating an Itemstack and it didn't work

eternal oxide
#

it wants an ItemStack and you gave it a Material

pliant plover
#

yeah, but how do I create an Itemstack, which isn't a Material?

pliant plover
#

Or better said, how even do I create a ItemStack how I need it

eternal oxide
#

new ItemStack...

noble lantern
#

new ItemStack(Material, Int)

#

or just material if you only want 1

river oracle
pliant plover
noble lantern
#

either i forgot how bukkit works or your depending on a non spigot jar

river oracle
#

Problems

  1. You have no idea what your doing
  2. You likely imported the api incorrectly
#

1 Is the biggest issue imo

#

?learnjava

undone axleBOT
pliant plover
#

I imported: import net.minecraft.server.v1_8_R1.ItemStack;

river oracle
#

xD lmfao

noble lantern
#

yeah thats NMS

river oracle
#

This means he added the jar to his project instead if maven or gradlew

noble lantern
#

?1.8

undone axleBOT
noble lantern
#

server jar is not rly something you use

#

even for nms, we have remapped now

pliant plover
#

I thought because it said Inventory, its just for giving Players the Items...

noble lantern
#

I mean

#

you can

#

but its gonna be like

#

50 lines of code to do

#

vs 2 lines with bukkit api

pliant plover
#

oh

river oracle
#

Have fun Burchard

#

Bye

pliant plover
#

anyways, thank you both!

noble lantern
# pliant plover anyways, thank you both!

if you want an easy setup and use IntelliJ, lookup the minecraft development plugin for intellij

Then, new project -> minecraft tab

Will auto generate a blank template project for you

opal wedge
# opal wedge Hey, I want to prevent ladders from falling off the wall when the attached block...

I have now worked out the following method to solve the above problem. However, the server hangs as a result.

    @EventHandler
    public void onPhysic(BlockPhysicsEvent event) {
        if (event.getBlock().getType() == Material.LADDER) {
            BlockFace facing = ((CraftLadder) event.getBlock().getBlockData()).getFacing();

            Bukkit.getScheduler().runTaskLater(Main.getMain(), () -> {
                event.getBlock().setType(Material.LADDER);
                CraftLadder blockData = (CraftLadder) event.getBlock().getBlockData();
                blockData.setFacing(facing);
                event.getBlock().setBlockData(blockData);
            }, 1);
        }
    }

https://paste.md-5.net/aluhogixoy.md

eternal oxide
#

you are generating a second physics event

#

recursion

opal wedge
#

hmm, can I avoid this somehow?

eternal oxide
#

event.getBlock().setType(Material.LADDER, false)

opal wedge
#

also for event.getBlock().setBlockData(blockData, false); ?

eternal oxide
#

yes

opal wedge
#

It worked, thank you

pliant plover
#

List loclist = pl.getConfig().getList("llist"); is this how I use something from another class?

noble lantern
#

No thats getting data from a ConfigFile

pliant plover
#

oh

noble lantern
#

Passing variables from class to class you want to use dependency injection

#

?di

undone axleBOT
eternal oxide
#

If pl is a reference to your plugin class

noble lantern
#

^ Yeah you are referancing the getConfig() method of your main class doing that, forgot

pliant plover
#

so its Correct then?

#

private Main pl; this is pl

#

and this is the import of Main: import de.bedwars.main.Main;

#

But list gets this error: List is a raw type. References to generic type List<E> should be parameterized

bold solstice
#

Elgarl I still need help with the structure thing

structure.place(new Location(world, -18, -12, 40), false, StructureRotation.NONE, Mirror.NONE, 0, 0, new Random());

for some reason it does not load the structure

vague swallow
#

How can I get the first line of the item lore?

noble lantern
#

iirc ItemMeta#hasLore is a method

vague swallow
#

alright then I did right, thanks

eternal oxide
bold solstice
#

well

#

the structure spawns on a build

#

maybe thats the problem?

#

like

#

one structure is the arena but with barriers

#

and one is without

#

so I want to swich the one with the barriers by the one without

#

nvm

#

it worked

#

lol

quaint mantle
#

yo anyone can help me add multiple version support?

severe marsh
#

How can I load a world for uhc?

hybrid spoke
quaint mantle
#

how do I do dat?

fiery prairie
#

Hey, any idea why my config.yml is cut in half after putting the plugin on my server? (If i open the jar file using zip, the config.yml inside it is correct)

fiery prairie
eternal oxide
#

?paste your config.yml

undone axleBOT
quaint mantle
#

AHHH

fiery prairie
#

but like it has a part of code that doesn't work on 1.8.8?

#

cause in simple plugins setting 1.8.8 will make the plugin work from 1.8.8 to 1.19.1

quaint mantle
#

ya

#

I need 1.16

fiery prairie
#

that's how it works

quaint mantle
#

I mean

fiery prairie
#

unless you have a part of code that was invented in future versions of Minecraft

quaint mantle
#

how do I do that?

#

ye

fiery prairie
#

wait

quaint mantle
#

I do

fiery prairie
#

pom.xml
scroll down
add the repository below the spigotmc-repo

        <repository>
            <id>sonatype</id>
            <url>https://oss.sonatype.org/content/groups/public/</url>
        </repository> ```
#

and also wait

#

then go to dependencies at the bottom of pom.xml

#

and replace 1.16.5 with 1.8.8

#

and then if you use IntelliJ IDEA then right click the pom.xml file -> maven -> reload project

vague swallow
#

hey for some reason this is not working: p.getItemInHand().getItemMeta().getLore().set(0, "test"); does anyone have an idea why?

fiery prairie
quaint mantle
#

the plugin

#

needs

#

to be 1.16!!

eternal oxide
#

If it NEEDS to be 1.16 you can;t support 1.8

quaint mantle
#

NOOOOOOOOOOOOOOOOO

buoyant viper
quaint mantle
#

oh well

#

I tried

tender shard
#

I'm already disgusted by myself for still supporting 1.14.1+ in some plugins

buoyant viper
#

like

var itemMeta = item.getItemMeta();
/** does stuff */
item.setItemMeta(itemMeta);```
fiery prairie
# quaint mantle to be 1.16!!

it only needs to if it throws errors after setting an old version, but if you set an old version and it doesn't throw any errors IT WILL WORK FOR BOTH 1.8 AND 1.16

old version in this message means 1.8

so does it throw an error after you set the dependency to 1.8?

tender shard
#

then you cannot use ANY features that are 1.9 or newer

#

you couldnt check for offhand

#

cant use the PDC

#

can't use BlockDropItemEvent

vague swallow
fiery prairie
buoyant viper
#

not sure if u need to call like getLore/setLore also to change it but that might also be a requirement

fiery prairie
#

its long so it has to be a file since no more nitro no more character limit bypass

#

it only saves the messages after loading the plugin

eternal oxide
#

?paste thats what this is for <-

undone axleBOT
fiery prairie
eternal oxide
#

now show me the broken config

fiery prairie
eternal oxide
#

have you tried it without the double line break?

fiery prairie
#

yea

eternal oxide
#

we'll need to see some code then, as just those files theres no reason for it to be cut off

#

its multiple entries

fiery prairie
#

alright be warned though, i keep everything in my main class xD

#

idk why

eternal oxide
#

god classes. I remember everyone used to write them

fiery prairie
#

oh its not paste.md-5 anymore

#

magic

eternal oxide
#

line 165, is not a good idea, you are accessing the config at instantiation before teh plugin is loaded

#

set it null there

#

and set it from teh config after you saveDefaultConfg() in onEnable

fiery prairie
#

thx ill try that

#

but there is also a chance that i magically did something or it is just a visual bug rn because the config appears full, im currently launching the server

#

wtf is wrong with this shit, i tried relaunching the server for the 18th time and now it magically generated the right config, one thing is wrong though

#

basically on the bottom of my code there is the playerchatasync event

#

its supposed to change the format of the message

#

it doesnt

#

nvm i forgot to do an if placeholderapi is null

fleet comet
#

imagine using multible classes-

eternal oxide
#

well probably because you have FIVE events

fiery prairie
fiery prairie
#

i mean its a chat managing plugin

fleet comet
eternal oxide
#

one event is all you shoudl use here

fiery prairie
eternal oxide
#

Or at different priorities

fleet comet
#

Yet i still rename apis to StuffManager instead of StuffAPI

fiery prairie
eternal oxide
#

set teh format early, then do chat later

fiery prairie
#

so i should set the priority higher?

eternal oxide
#

set format at Highest

fiery prairie
#

thank you!

eternal oxide
#

or High

#

Highest is mostly for permission plugins

fleet comet
#

is there anywhere on the server that i can ask people to help me make plugin cause solo dev is overrated

fiery prairie
#

general?

#

idk

fleet comet
#

oh yeah duh

#

or i can friend you cause your making a chat formatting plugin-

#

that was a question

fiery prairie
#

im not just making a chat formatting plugin, mostly a whole chat managing plugin

fleet comet
#

well i could use chat skills cause im horrible with that

#

just friend me cause i cant friend you

fiery prairie
#

any idea why?

hybrid spoke
#

and it have to be a cool project

fleet comet
#

dont know where to share it though

fiery prairie
#

or is that not what you mean xD

hybrid spoke
fleet comet
#

i mean here

#

its on github

hybrid spoke
#

general, verified, here

fleet comet
#

oh

#

epic

#

i needa fix bstats lol

fiery prairie
#

i mean why would anyone need a second essentials though
or is it supposed to be a better version of it?

eternal oxide
#

"better"

fiery prairie
#

that's why I said "supposed to be"

hybrid spoke
#

how is it better

fleet comet
#

Not currently no

#

Tp is filly functional and it's better

#

Fully

eternal oxide
#

"better"

fiery prairie
#

btw isnt uploading things to github making it easier for people to copy your project?

eternal oxide
#

Your project has to be worth copying

fleet comet
#

Yep

fiery prairie
#

oh yeah makes sense

fleet comet
#

Mine isn't

#

Only thing that's better is tp

fiery prairie
#

i mean you still can copy anything by opening .jar as .zip

vocal cloud
#

Wait so everytime a player gets attacked it spawns a new scheduled executor?

hybrid spoke
#

clearly

vocal cloud
#

Why not just have one main scheduled thread and store the combat time end in the hashmap

fiery prairie
#

why not use maven

vocal cloud
#

gradle > maven

fiery prairie
#

idk i rather use maven

fleet comet
#

Haven't tested it for multiple players

#

And The request method check doesn't work

tender shard
#

gradle is maven on drugs. It's faster at compiling, but at what price?

fiery prairie
#

btw you know making better essentials is probably gonna take you or anyone a lifetime which equals death?

vocal cloud
#

It spawns a thread whenever someone attacks

#

That's pretty bad

#

Also the taskid gets overwritten so it won't even work properly

#

OOP was a mistake kekw

fleet comet
quiet ice
#

Or just do the same as the madlad yesterday and use ANT

fiery prairie
hybrid spoke
vocal cloud
#

^

fiery prairie
#

yea

vocal cloud
#

If you want people to contribute to a All Rights Reserved plugin you're going to need to do a bit more work

hybrid spoke
#

and to do better

fiery prairie
#

and not just say better

hybrid spoke
#

nobody wants to clean up your shit

#

all this static abuse

#

namings

fleet comet
#

Ima clean up my abuse firat

vocal cloud
#

No, first add a license

#

That's easy and you can do it in 5m

fleet comet
#

Wait. How

hybrid spoke
#

within github

vocal cloud
#

Want me to PR a license lmfao

fleet comet
#

Ohh

#

Mk

tender shard
#

just made a very useful PR

undone axleBOT
#

"Does not working" is a useless statement. Please describe what exactly is not working, what you expect it to do, and what actually happens. If you get any console errors, also ?paste the entire stacktrace.

fiery prairie
#

basically it gets back to vanilla chat formatting

vocal cloud
fiery prairie
drowsy harness
#

Best way to avoid a entity from going into a certain area?

vocal cloud
#

Depends on the entity but you could probably reset where it's going

#

?jd-s

undone axleBOT
vocal cloud
#

Might need NMS for that not sure

quaint mantle
vocal cloud
#

Have you tried logging and seeing what's printing?

quaint mantle
#

yea and so far so good but ill add some more sout's hold on

desert loom
#

this line might be the issue

boolean isSplash = config.isBoolean(dataPath + ".splash");

isBoolean checks if the path is a boolean and in your case it always is

echo basalt
quaint mantle
upbeat pagoda
#

Anyone know a good way to edit the crafting recipe for an item?
E.g replace the iron ingots in an iron pickaxe recipe to like maybe another item

#

I'm currently getting the recipe with this List<Recipe> recipe = getServer().getRecipesFor(new ItemStack(Material.IRON_PICKAXE)); but I don't know how to read the recipe

drowsy harness
echo basalt
#

you can just modify the navigation

#

I did it in 1.18.1 to make sure zombies don't go through client-sided blocks

#

they can still get pushed through but not pathfind through

drowsy harness
#

Sure, but you can just disable pushing. I'm writing this plugin for 1.17. If you don't mind, I'm on a bit of a time limit, could you send the code that you made? If you don't want to, I'll figure something out.

echo basalt
#

knockback is also a thing

drowsy harness
#

I already have a solution for that, bit of a ugly one, but it just teleports the entity to the nearest "allowed" place.

echo basalt
#

I'm thinking of overriding the move method

#

Also my solution uses mojmappings

#

I have a version without (before I turned to mojmappings) that you could use

#

But it's for 1.18.1

#

¯_(ツ)_/¯

drowsy harness
#

Shouldn't be that hard to translate to 1.17, if you could sent it as well, it would be greatly appreciated!

echo basalt
#

here's how you inject it

#

Here's the obfuscated version

#

It's quite simple honestly

#

Just look at PathfinderNormal

#

copy everything

#

and modify that 1 static method with the 200 if(...) return PathType...

tardy delta
ancient plank
tardy delta
#

comments are a great thing too

river oracle
river oracle
tardy delta
#

dunno how that works

worldly ingot
#

Basically key, key, value

#

Column, row, value

#

I mean, it's a table ;p

fiery prairie
#

https://pastebin.com/rp3S3ywb
https://pastebin.com/nB09xDfj

If i change something in the chat format in config.yml, and use /cplus to reload the file, the chat format gets taken back to the vanilla one (before changing it it worked), but if i change anything else and i dont change the chat format everything works fine, any help?

#

and i have a HUGE mess in my main class

#

cause i really dont care about the looks i just care if it works xD

tardy delta
#

i see lmao wtf

fiery prairie
#

ye ill probably spend some time making something for the looks

tardy delta
#

😵‍💫

fiery prairie
#

?

eternal oxide
#

change it to List<String> badwords = null;Then in your onEnable, after saveDefaultConfig() add reload();

quartz basalt
#

am i dumb or smthn my ide is saying ``` if (Material.valueOf(args[0].toUpperCase()) != null) {

                }``` will always be true im trying to check if a materival exists
fiery prairie
tall dragon
quartz basalt
eternal oxide
#

You never know. you accessing a config which doesn;t yet exist can do all sorts of crap to your plugin

fiery prairie
#

but that thing isnt gonna break anythingright?

eternal oxide
#

Yes it might

fiery prairie
#

noice

eternal oxide
#

You are forcing Bukkit to deal with yoru config before its supposedx to. Before you've even asked for it to be saved

fiery prairie
#

but im asking if what you told me with that code earlier is gonna break anything?

#

cause like if its null then the antibadword system might not work

eternal oxide
#

no, my code will not break anything

fiery prairie
#

alright thx

eternal oxide
#

by calling reload() in your onEnable you set your badwords field

frozen cedar
#

how to make a mob look at the player?

fiery prairie
#

i have papi installed of course xD

#

and also formatting doesnt work too

eternal oxide
#

It says line 241

fiery prairie
#

e.setFormat

#

nvm

#

in intellij it doesnt exist

#

bruh

#

okay i refreshed intellij now it works

#

so yeah it is the e.setFormat

fleet comet
#

intelliji is wierd

eternal oxide
#

Your error is p.getDisplayName()).replace("%message%", msg)

#

nope, ignore me

#

I read wrong bracket

fiery prairie
fleet comet
#

ofc

eternal oxide
#

Ok I'm in the mniddle of cooking dinner, but your mistake is you are replacing the whole format, as if you are creating the output string.

#

You need to modify the format not replace it. there are elements you have to preserve in the original string

rough drift
#

If I have an item with an NBT can I make a recipe use the whole item rather than only the material?

#

So like if I have stone with a PDC key of "eee" can I make a recipe use only stone with the PDC key of "eee" rather than just plain stone

fiery prairie
dusty herald
#

show me code

#

too lazy to scroll

fiery prairie
#

it throws errors when using placeholders in chat format in config.yml

zenith gate
#

I thought namespacedkeys auto lowercased everything?

frozen cedar
ivory sleet
#

When you have a NamespacedKey you can rest assured the content encapsulated follows a pattern

zenith gate
#

mhm, I have caps in some of my namespaced keys, but this one just gave me an error I was just confused.

ivory sleet
frozen cedar
fiery prairie
#

doesnt it look at the player when it attacks him?

sterile token
#

I have question for registering a custom command class with a custom annotation processor do i need to initialize the class?

#

Its a question which ill be used on my command framework

lost matrix
sterile token
#

Oh ok

lost matrix
#

But you will obviously have to instantiate it nonetheless.

sterile token
#

That was what i mean

#

If when using reflections for registering them i need to initialize

#

Then i have a big issue because i need to care about the constructors from the command classes

#

🤔

ocean lion
#

Anybody know a good player point based api

sterile token
#

Maybe i can do a custom for you (free or as you want)

#

👍

zenith gate
#

on a EntityDamageEvent is event.getEntity() the one who was damaged or the one doing the damage?

eternal oxide
#

do not insert the message into the string. modify it and use setMessage

#

then at the end of the format string add %s or perhaps it %2s I forget

fiery prairie
#

setMessage wouldn't change the format of the nickname surroundings, or am i not understanding correctly?

eternal oxide
#

no, but you are modifying the message to remove links etc?

fiery prairie
#

yea

eternal oxide
#

then modify the getMessage and put it back with setMessage

#

I believe its %2$s

fiery prairie
#

ohh I understand, thank you!

patent horizon
#
            task = Bukkit.getScheduler().scheduleSyncRepeatingTask(PlexPvP.get(), () -> {
                if (event.getProjectile().isOnGround() || event.getProjectile().isDead()) Bukkit.getScheduler().cancelTask(finaltask);
                player.sendMessage("flying");
            }, 0L, 1L );``` would anyone know why the task still gets repeated after the arrow hit the ground?
eternal oxide
#

because the event is stale once you enter your runnable. itsd not dynamically updated

#

You can get teh shooter in that event

ocean lion
#

Anyone know a good player point (coins) based api?

quartz gull
eternal oxide
#

Or don't use a runnable at all as you don't need it

patent horizon
#
    @EventHandler
    private void onProjectile(EntityShootBowEvent event) {

        if (event.getEntity() instanceof Player player) {

            var data = PlexPvP.getPlayerController().get(player);
            var selectedCosmetic = data.getSelectedCosmetic().get(CosmeticType.PROJECTILE);

            if (selectedCosmetic == null) return;

            var task = 0;
            var finaltask = task;
            task = Bukkit.getScheduler().scheduleSyncRepeatingTask(PlexPvP.get(), () -> {
                if (projectile.contains(event.getProjectile())) {
                    Bukkit.getScheduler().cancelTask(finaltask);
                    projectile.remove(event.getProjectile());
                }
                player.sendMessage("flying");
                if (!activeProjectiles.contains(player)) {

                    player.sendMessage("avail");
                    switch (selectedCosmetic) {
                        case RAINBOW -> Rainbow.play(event.getProjectile(), player, activeProjectiles);
                    }
                    activeProjectiles.add(player);

                }
            }, 0L, 1L );

        }

    }

    @EventHandler
    private void onProjectileHit(ProjectileHitEvent event) {

        if (event.getEntity() instanceof Player player) {

            var data = PlexPvP.getPlayerController().get(player);
            var selectedCosmetic = data.getSelectedCosmetic().get(CosmeticType.PROJECTILE);

            if (selectedCosmetic == null) return;

            projectile.add(event.getEntity());

        }


    }```
#

this doesnt seem to work

eternal oxide
#

you are trying to add a rainbow effect to an arrow?

eternal oxide
#

it will never be instanceof Player

#

event.getEntity().getShooter()

patent horizon
#

can play one of many kinds of effects

cunning canopy
#

Do my bungee cord server need to be a game server?

#

Or could I just use a xeon

lost matrix
cunning canopy
#

So it only job is to redirect right? Like no traffic is actually running through it other then the players connecting?

tardy delta
#

Im Running my test server on a pi smh

#

Poor brush

lost matrix
#

Same goes for spigot. Everything that runs java can run bungeecord and spigot.
So all pcs, servers, pis and even your smartphone.

lost matrix
#

Thats what a proxy is for...

cunning canopy
#

So it will bottleneck if my proxy ain't as good as my game servers?

lost matrix
#

No. It will bottleneck when it can not handle the traffic. Either through bandwidth or cpu limitations.

harsh totem
#

is there a way to make sure this error doesn't happen?

#

Error: SQLITE_BUSY: database is locked

lost matrix
harsh totem
quartz gull
#

lmao

#

grammar 100

harsh totem
#

you said it before i sent it

lost matrix
# harsh totem what?

Use a connection pool like HikariCP. You are probably polluting your connections.

lost matrix
harsh totem
lost matrix
#

Usually all of this is done by a connection pool.

#

Like HikariCP

harsh totem
#

ok

ocean lion
#

Is there any good ScoreboardAPI out there. cant seem to find

eternal oxide
#

The Spigot Scoreboard API is quite good. I'd use that

ocean lion
#

-.-

eternal oxide
#

🙂

fringe hemlock
#

Agreed

cunning canopy
lost matrix
ornate patio
#

is there some sort of entity collision event

eternal oxide
#

no

lost matrix
cunning canopy
#

But it's not responsible for the minecraft traffic

ornate patio
#

damn

#

i need to make a certain mob not collide with any entities in the world

#

i'll just use teams then

lost matrix
# cunning canopy But it's not responsible for the minecraft traffic

Yes its responsible for the whole traffic. If a player moves a bit then he sends a packet to the proxy and the proxy sends it to the server.
If a block changes on the server then the server sends a packet to the proxy and the proxy sends it to the player.
And for every player the proxy will have to route thousands upon thousands of packets every single second.

eternal oxide
#

Mob is a LivingEntity which has a setCollidable

zenith gate
#

I keep getting a null exception error for my ARMOR hashmap not having anything in it, but when the plugin starts I have a loop for when online players first join everything gets set, Max Mana 100, Mana regen 0.5, setting Mana to 0.0, that all works but when i set Armor to 0.0 im still getting null exception.

java.lang.NullPointerException: Cannot invoke "java.lang.Double.doubleValue()" because "original" is null
// where the error is happening
    public static void addArmor(Player player, Double amount){
        Double original = ARMOR.get(player);
        Double now = original + amount;
        ARMOR.put(player, now);
        }
// Puttnig the player in the hashmap
for(Player player : Bukkit.getServer().getOnlinePlayers()){
            Mana.ARCANE_POWER.put(player, Mana.MAX_ArcanePower.get(player));
            player.setHealth(40);
            player.setSaturation(20);
            player.setFoodLevel(20);
            Mana.MANA_PER_SECOND.put(player, 0.5);
            Mana.MAX_ArcanePower.put(player, 100.0);
            Armor.ARMOR.put(player, 0.0);
        }

I don't know what to fix..

lost matrix
zenith gate
#

yes but im setting the armor

#
Armor.ARMOR.put(player, 0.0);

when the player joins

#

it shouldn't be null

eternal oxide
#

The Player object does not get reused if a player relogs

lost matrix
pliant plover
#

all.addPotionEffect((new PotionEffect(PotionEffectType.WEAKNESS, 255000000, 10, true))); Is the true for removing particles?

cunning canopy
hot wolf
#

Short question. Is there a way to get any player? I just need it to initialize something when starting my plugin, but I'm not sure what player to use, especially because names change

lost matrix
# cunning canopy So does the proxy have to be beefy?

Really depends on your traffic. But if you get a decent root server for 20 bucks (i7 4770 or something) then you can run
8 minecraft server + your proxy on it without any problems.
<20 players it does really not matter.

cunning canopy
ornate patio
lost matrix
lost matrix
ornate patio
#

yeah

lost matrix
#

AsyncPlayerChatEvent is not assured to run async. This can be a huge lag machine.

ornate patio
#

damn

lost matrix
#

?data

cunning canopy
ornate patio
#

well I'll just cache everything in ram then

lost matrix
#

?workingwithdata

#

?dataworking

#

What was it...

ornate patio
lost matrix
ornate patio
#

oh wait

lost matrix
#

"IllegalStateException: Asynchronous getNearbyEntities!"

ornate patio
#

can I not use getNearbyEntities on an async thread

#

is there some sort of workaround

lost matrix
#

ofc not. You can not use any spigot api from another thread. Nothing.

fringe hemlock
#

?datamanagement

undone axleBOT
lost matrix
lost matrix
fringe hemlock
#

Yw:)

ornate patio
lost matrix
ornate patio
#

does Bukkit.getScheduler().runTask work

lost matrix
crisp coral
#

Does anybody know how to change block strength without NMS, i just discovered this server and after 2 weeks i am pretty sure its impossible but if it is, can any of you help

fringe hemlock
# lost matrix Just do it on the main thread?

Is it efficient to load player data to memory on asyncplayerpreloginevent, and then edit the data in memory then save back to database on quit or server close async, but always keep a copy in memory so if they relog it’s already there

lost matrix
crisp coral
#

I dont know nms though, Whenever i try to use it, it always errors. I dont know how to import it cause im using InteliJ and I have been struggling for 2 weeks with this.

lost matrix
crisp coral
#

Allot of the time I get CraftMagicNumbers but not even that works.

fringe hemlock
#

Alright thank you, I kept it in memory just so I didn’t have to read it back from the database if they relogged

lost matrix
ornate patio
#

i was honestly planning to load data from the database every time a player takes damage 💀

fringe hemlock
#

Dam bro

lost matrix
ornate patio
#

im too lazy to set up this data thing

#

but I guess i probably will

fringe hemlock
#

SQL or MariaDB which is better

ornate patio
#

I'll have a class to automatically manage all the data in the background

lost matrix
#

No need to set up anything. Just understand the "states of data" and the "scopes of data"

ornate patio
#

alright

patent horizon
#

is it possible to get the head location of an entity?

lost matrix
patent horizon
#

if not, does anyone know how high the middle of a player's head is in relation to the bottom of their feet

#

ah ok ty

ornate patio
#

I have to store a bunch of Families that contain a bunch of players

#

in my SQL database I have a separate table for players and families

lost matrix
ornate patio
#

So i'll have make sure the player references the family and the family references the player?

lost matrix
ornate patio
#

well I am going to be accessing members of a family and the family of a player quite often

ocean lion
#

Anyone who has or knows about an easy to use ScoreboardAPI

noble lantern
naive bolt
#

is listening to an event from a different plugin the same as a bukkit event?

young knoll
#

Yes

manic furnace
#

I've got a SchedualedExecutorService, which schedules 3 runnables at fixed rate:

Main.getScheduledPool().scheduleAtFixedRate(new ServerConnectionWorker(),0,100,TimeUnit.MILLISECONDS);
Main.getScheduledPool().scheduleAtFixedRate(new DataUpdateWorker(),0,500, TimeUnit.MILLISECONDS);
Main.getScheduledPool().scheduleAtFixedRate(new HeartbeatWorker(),0,2000, TimeUnit.MILLISECONDS);

But for some reason I don't understand, the second task (DataUpdateWorker) only executes one time.

ivory sleet
#

how does the class look like

gleaming grove
#

It would be possible to build .jar file with icon?

manic furnace
# ivory sleet how does the class look like
public class DataUpdateWorker implements Runnable {
    @Override
    public void run() {
        System.out.println("TEST " + Main.getServerManagerConnection().isConnectionConfirmed());
        try {
            if (Main.getServerManagerConnection().isConnectionConfirmed()){
                MCServer mcServer = new MCServer(Main.getServerManagerConnection().getUuid(), (BufferedImage) Bukkit.getServerIcon());
                Main.getServerManagerConnection().getMCManagerConnection().write(Requests.Common.updateData(mcServer));
                System.out.println("SENT " + Main.getServerManagerConnection().isConnectionConfirmed());
            }
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}```
ivory sleet
#

btw

#

whats the configuration for ur SES

manic furnace
#

What do you mean?

ivory sleet
#

how do u instantiate it

glass mauve
#

Executors.BLAH_BLah

ivory sleet
#

cause assume you use a single threaded one

#

^

glass mauve
#

which one do you use

ivory sleet
#

then u should delegate

#

to a pool with multiple threads

#

(which is usually what we do)

manic furnace
#

private static final ScheduledExecutorService scheduledPool = Executors.newScheduledThreadPool(3);

noble lantern
#

work stealing sunglas

ivory sleet
#

yeah

#

that or cached

noble lantern
#

ngl cached prolly better for mc maybe

#

just a few threads open, doubt theyre gonna be constantly used to where they all get taken up

ivory sleet
#

I mean

#

when we get virtual threads

rough drift
#

#ProjectLOOM

noble lantern
#

its too far away

manic furnace
#

So what can be my problem?

noble lantern
noble lantern
manic furnace
#

To what?

ivory sleet
#

I could imagine one of ur tasks comprises to a dead lock

rough drift
#

to java

ivory sleet
#

which means scheduling gets blocked entirely

#

hence why we usually wanna execute logic in another pool

rough drift
#

I also like project panama

ivory sleet
#

jep 428 and jep 425

#

❤️

rough drift
noble lantern
#

Executers has a few different methods

You can used a fixed sized cached pool

Or work stealing to a fixed size

The method names are quite literally named those

Typically you size them to System.getRuntime().theCoreCountMethodHere() (Someone know the name)

Or just let them size themself with the default () args

#

oops

#

meant to reply

rough drift
noble lantern
#

in a sense

ivory sleet
#

@manic furnace

noble lantern
#

OH CONCLURE

ivory sleet
#

you could try to obtain the thread

noble lantern
#

HAVE YOU MET LEEROY

ivory sleet
#

and interrupt it

#

leeroy?

noble lantern
#

MOTHAFUCKING LEEROY

ivory sleet
#

Wyf lol

noble lantern
ivory sleet
#

Its a feature 🙂

noble lantern
#

loom is a feature?

ivory sleet
#

its a project

#

which contains a set of jeps (java enhancement proposals)

noble lantern
ivory sleet
#

there is a method

#

but no clue which one

noble lantern
#

yeah theres like

#

20,000

ivory sleet
#

lol

noble lantern
#

and then objects with objects, that also have another object

#

with another 40 methods

rough drift
#

jeps are amazing

#

read the hottest ones

noble lantern
#

can hear my computer scream rendering the tab completions for ServerPlayer

rough drift
#

they'll make you wish for them instantly

steel swan
#

anyone has an idea of how to create a line of particules (x blocks long) and detect if it touches a player, and then get that player?

ivory sleet
# manic furnace To what?
var scheduler = Executors.newSingleScheduledExecutor();
var tempExecutor = Executor.newCachedThreadPool(runnable -> {
  var thread = new Thread(runnable);
  thread.setDaemon(true);
  thread.start();
});
Executor executor = runnable -> {
  try {
    tempExecutor.submit(runnable);
  } catch (Exception e) {
    //HANDLE
  }
};

Consumer<Runnable> = runnable -> scheduler.scheduleAtFixedRate(() -> executor.submit(runnable),delay,timeUnit);
#

you probably wanna have something like this

#

or well

noble lantern
#

oh wtf

ivory sleet
#

wait let me think

noble lantern
#

nms has easy methods for packets

#

since when

noble lantern
#

nmsPlayer.connection.send(Packet, () -> { // listener}) 😐

chrome beacon
noble lantern
#

never seen em before

quaint mantle
quartz gull
last swift
#

I'm working with NBT API and am re-developing a plugin one of my friends made, but #getPersistentDataContainer() doesn't work with 1.8 (the version I'm developing in). What is the alternative to the method? How does getPersistentDataContainer() work?

public static int getMaxHealth(Entity e){
  NBTCompound target = (new NBTEntity(e)).getPersistentDataContainer();
  return target.getInteger("maxHealth");
}
public static int getHealth(Entity e){
  NBTCompound target = (new NBTEntity(e)).getPersistentDataContainer();
  return target.getInteger("cHealth");
}
...
worldly ingot
#

It was added in 1.14

quartz gull
quartz gull
worldly ingot
#

and is a Bukkit method, so I'm not entirely certain why you're retuning an NBTCompound, which is NMS

#

Not to mention... the methods you linked literally have Bukkit alternatives of LivingEntity#getHealth() and #getMaxHealth()

last swift
#

Thanks.

quartz gull
last swift
#

Okay. Thanks for the help

noble lantern
#

chooocoooo

ocean lion
#

dependency is just red all over

last swift
# quartz gull here is a api https://www.spigotmc.org/resources/nbt-api.7939/ for 1.8.8. Next t...

I'm using that API actually, but this error is still thrown when hitting other entities since the method isn't available for 1.8.8 (which is why I asked the question about alternative options).

Caused by: de.tr7zw.nbtapi.NbtApiException: [Selfchecked]The Method 'getPersistentDataContainer' is only avaliable for the Versions MC1_14_R1+, but still got called!

I'll figure out an alternative though.

ocean lion
#

dependency problem.

last swift
#

Yeah

noble lantern
#

it has a built in class called MinecraftVersion

#

there is a version getter

last swift
#

Yeah so I could add a check if the version is 1.14 or less

noble lantern
#

and you can

MinecraftVersion.getCurrentVersion() >= 1_14_0

river oracle
noble lantern
#

forget its exact name

#

but yeah

last swift
#

I'll probably do that. Thanks 👍 This seems to work so I could prob change the code based on the version

public static int getMaxHealth(Entity e){
  int target = (new NBTEntity(e)).getInteger("maxHealth");
  return target;
}
river oracle
noble lantern
noble lantern
#

indeed it even exists in that repo

#

odd

#

well, for now you can install it to your local maven repo if you have the jar

ocean lion
#

no jar :<

noble lantern
#

ooof

#

big sad

#

here lemme try to import it

ocean lion
#

do you have a scoreboard api?

quartz gull
ocean lion
#

omg

noble lantern
#

haha

quartz gull
#

dang I got banned from csgo

quaint mantle
#

Dum

quartz gull
#

I did it on purpose I didn't really care anymore

ocean lion
noble lantern
#

yep

#

well wait

#

indexing

#

all seems good to me

ocean lion
#

weird, how?

noble lantern
#

try invalidating caches for intellij

ocean lion
#

it just say dependency ... not found

quartz gull
#

oh I had The same thing happen when I tried importing craftbukkit into my maven

quartz gull
ocean lion
#

lowering the version?

#

of the plugin, of the api

noble lantern
#

lowering the version is a horrible way to do it

He likely has something wrong with his maven cache, thats not allowing it to import correct

#

Yanesa are you 100% sure you refreshed maven

#

When you import a new lib a button shows up here in the top right

ocean lion
#

HAHA

#

....

#

itworked

#

thank you

noble lantern
#

ofc ofc

last swift
#

I'm trying to create a timer that counts down from 15 minutes, but timeLeft always counts down in increments of 2 and starts at 14:99 which doesn't make sense.

BigDecimal timeLeft = new BigDecimal((double)timer / 60).setScale(2, RoundingMode.HALF_UP);
String line0 = "§bTime Left: §7" + (timeLeft.toString().replace(".", ":"));
team1.setBoard("Title or whatever", line0);
team2.setBoard("Title or whatever", line0);
sterile token
#

?jds 1.19

sterile token
noble lantern
#

^

Also Instant provides a bunch of timing methods for you

#

99% sure it handles epoch milli to formatting like you do

sterile token
#
public class Cooldown {

    private long end;

    public Cooldown(Long time) {
        this.end = System.currentTimeMillis() + time;
    }

    public void stop() { this.end = 0; }

    public boolean hasExpired() { return (System.currentTimeMillis() - this.end >= 1L); }

    public long getRemaining() { return this.end - System.currentTimeMillis(); }
}```
noble lantern
#

but

#

Instant.from(anotherInstant);

z_aCRYYY

noble lantern
#

oh

#

true

sterile token
#

hahhaa

noble lantern
#

damn 1.8 users

sterile token
noble lantern
#

fuuuuck no

sterile token
#

I will defend 1.8 users with all my energy

noble lantern
#

1.19 supremacy

sterile token
#

?jds-s 1.19

#

?status

noble lantern
#

i think you meant

#

?1.8

undone axleBOT
sterile token
#

?1.17

undone axleBOT
noble lantern
#

WAIT

noble lantern
#

1.8 almost 7 years old

sterile token
#

Sorry if sound rude

#

But i will always defend 1.8 servers

#

🤙

sterile token
ocean lion
sterile token
#

I told you to use assemble

noble lantern
#

he got it imported

#

but no i havent

sterile token
#

Why cobol exists, if there is python, rust, etc

#

😂

noble lantern
#

thats a programming language

#

not a game tho

#

cobol can actuall have very valid use cases irl

#

java is shit, 25?

#

but that doesnt mean people use java 3 still

#

same with cobol, when people use it im sure they use the latest developed version vs the older one with bugs, security flaws, developmental mountains for code style, etc

sterile token
#

Hmn i dont know dont worry

#

If i do a command annot proccessor do i need to care about class constructor when doing initialization?

noble lantern
#

uhm

#

so what i do, is provide dependency injection for my command class annotations

#

or, if its empty/no constructor just pass an empty when calling the new instance reflection method

#

doesnt rly matter for constructor

#

java provides one by default if none exist and you try to initialize it

sterile token
#

Wait

#

My command handler class looks for classes annotated with @Command, and then saved each name and data

#

But what about if the class have a constructor, there i cannot initialize...?

noble lantern
#

as long as its public you can use reflection to initialize it (I assume your using reflection to register these annotation classes)

sterile token
#

Yeah

noble lantern
#

i can show you the code i use sec

sterile token
#

But i wont know the constructors param so then i cannot initialize