#help-development

1 messages · Page 245 of 1

river oracle
#

my language server uses 2 gigs normally only uses 1

#

than the electron app itself uses 1

remote swallow
#

I wonder if its not my ram causing issues but my hdd

river oracle
#

could be your hdd

#

hard drives are slow

#

thats honestly probably it

#

Intellij and pycharm were slow when I had a hard drive

wet breach
#

Depends which version. Studio pro does

river oracle
#

I have VSCode

#

not VisualStudio

wet breach
#

Visual studio takes like 100gb if you install everything.

river oracle
#

I don't think I'll ever use Visual Studio

#

that shit seems like bloat

remote swallow
#

Looks like im buying a ssd

chilly crystal
#

there is this youtube series camp minecraft season 4 and they have some stuff in their server i believe are plugins

#

I am trying to find them

#

do you guys know any era mods like a villager where u do quests to upgrade the age

#

wood age stone age etc etc

earnest forum
chilly crystal
#

oh ty

#

my apologies wrong channel ill msg it in the other

wary topaz
#

hey so uh

@EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        try {
            wait(2000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        load();
        event.getPlayer().sendMessage("debug");
        if (motdConfig.getBoolean("JoinGame-MOTD.Enabled")) {

            int size = motdConfig.getStringList("JoinGame-MOTD.Messages").size();
            int get = 0;
            while (size > 0) {
                event.getPlayer().sendMessage((motdConfig.getStringList("JoinGame-MOTD.Messages").get(get).replace('&', '§')));
                get++;
                size--;
            }
        }

It's not even sending the debug message and I can't figure out what's wrong.

#

Also before you ask it didnt work when I removed the "wait"

remote swallow
#

Delay the debug a tick and you will get it

river oracle
#

what the actual fuck

wary topaz
#

???

river oracle
#

why in gods name are you using wait

wary topaz
#

I did delay it though..

#

its a motd thing

remote swallow
#

Wait is not the way to go

#

?scheduling

undone axleBOT
river oracle
#

bro's pausing the main thread for 2 seconds casually

#

I could crash your server easily with a clean sweep bot attack with a plugin like that in

wary topaz
#

oh your right

#

ill try scehduling though

remote swallow
#

Use runTaskLater

wary topaz
#

@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) throws InterruptedException {
Thread.sleep(1_000L);

#

..

river oracle
#

you have to be a trol

#

there is no way you are really serious

wary topaz
#

bro im not a troller

#

since when has anybody trolled 😕

#

BukkitScheduler scheduler = Bukkit.getScheduler();
scheduler.runTaskLater(plugin, () -> {
Bukkit.broadcastMessage("Mooooo!");
}, 20L * 30L /*<-- the delay */);
thanks

undone axleBOT
wary topaz
#

dont "?learnjava me

remote swallow
#

He didnt technically

wary topaz
#
@EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        BukkitScheduler scheduler = Bukkit.getScheduler();
        scheduler.runTaskLater(plugin, ( ) -> {

            load();
            event.getPlayer().sendMessage("debug");
            if (motdConfig.getBoolean("JoinGame-MOTD.Enabled")) {

                int size = motdConfig.getStringList("JoinGame-MOTD.Messages").size();
                int get = 0;
                while (size > 0) {
                    event.getPlayer().sendMessage((motdConfig.getStringList("JoinGame-MOTD.Messages").get(get).replace('&', '§')));
                    get++;
                    size--;
                }
            }
        }, 20L * 30L /*<-- the delay */);
#

}

#

is that 1 tick?

remote swallow
#

The delay is in ticks

#

20 ticks is a second

#

1l for 1 tick delay

wary topaz
#

how many ticks should I wait

#

cause yk

remote swallow
#

1 should be fine

wary topaz
#

why is there a *?

#

is that just multiplication?

remote swallow
#

yeah

#

20l = 1 second
times that by 30, 30 second delay

wary topaz
#

didnt work when I did 1L

remote swallow
#

what did the full line look like

wary topaz
#

wait I think I have an idea.

harsh totem
#

How do I make this stop after a given amount of time?

            finalPlayer.sendMessage(GetRandomText());}, 20, 20);```
wary topaz
#

this doesnt make sense

#

intellij wdym no usages

remote swallow
wary topaz
river oracle
wary topaz
#

ignore the last 2 lines

harsh totem
remote swallow
#

if you only need it to run once, and once only runTaskLater

harsh totem
wary topaz
#

BukkitScheduler scheduler = Bukkit.getScheduler();
scheduler.runTaskLater(plugin, ( ) -> {
}, 1L <- Amount of tickets);
?scheduler

#

?scheduler

remote swallow
#

you removed the comment

#

?scheduling

undone axleBOT
remote swallow
#

when my pc decides to load ill check the code

harsh totem
#

ok

remote swallow
#

i dont see anything wrong with that code

wary topaz
#

me neither

#

but its just not sending me the message

remote swallow
#

any errors in console

wary topaz
#

nope

#

should I wait a couple more ticks?

remote swallow
#

try 5

#

maybe 10

wet breach
wary topaz
#

Command cooldowns:P

#

its not gonna affect anything really

wet breach
#

Not sure how that is relevant to making main thread sleep

wary topaz
#

omg it still doesnt work at 10 tics

#

ticks

wet breach
#

If you want a cool down you don't need to make main thread sleep

#

Nor is it accurate time wise

river oracle
#

you sure frostalf when I make cooldowns everyone on the server has to stop what they are doing to wait. Its only logical

wet breach
#

Lol

river oracle
#

your trying to tell me that I shouldn't pause the entire server

wary topaz
wet breach
#

You could but server isn't going to be happy

remote swallow
#

send size to console and see what happens

wary topaz
#

is this the problom?

remote swallow
#

shouldnt be

wary topaz
#

public void load( ) {
^
Is it this?

remote swallow
#

cant lie the method does seem a little weird, one sec

wary topaz
#

or maybe its the playerjoinevent?

#

theres too versions, playerloginevent and payerjoinevent

#

whats the login one

remote swallow
#

replace java File motdConfigFile = new File(plugin.getDataFolder(), "motd.yml"); try { motdConfig.save(motdConfigFile); } catch (IOException e) { Bukkit.getConsoleSender().sendMessage("§4§lCould not save the file, is it being used by something?"); } try { motdConfig.load(motdConfigFile); } catch (IOException | InvalidConfigurationException e) { Bukkit.getConsoleSender().sendMessage("§4§lAn error occurred while reading your motd.yml file, if you need help just join our discord with /betterserver help!"); } with ```java
File motdConfigFile = new File(plugin.getDataFolder(), "motd.yml");
if (!motdConfigFile.exists()) {
motdConfigFile.getParentFile().mkdirs();
plugin.saveResource("motd.yml", false);
Bukkit.getConsoleSender().sendMessage("§4§lCould not save the file, is it being used by something?");
}
try {
motdConfig.load(motdConfigFile);
} catch (IOException | InvalidConfigurationException e) {
e.printStackTrace();
Bukkit.getConsoleSender().sendMessage("§4§lAn error occurred while reading your motd.yml file, if you need help just join our discord with /betterserver help!");
}

wary topaz
#

alr

#

done ill load the server

#

didnt work :C

#

omg

#

bro im so fucking stupid

#

i didnt register the fucking events

remote swallow
wary topaz
#

sorry man ;c ill check if it works now

#

it works 😛

#

thank you so much for helping me

#

next time ill pay m ore attention to my code

fading spindle
#

anyone have an idea why this wont work? I'm trying to add functionality to an item but when i rightclick nothing happens ``` public void onbellUse(PlayerInteractEvent pie){

if(pie.getAction() == Action.RIGHT_CLICK_AIR){

if(pie.getItem() != null){

    if(pie.getItem().getItemMeta().equals(ItemManager.gong_of_weakening)){
        Player player = pie.getPlayer();

Player nearplayer = (Player) player.getNearbyEntities(6,6,6);
nearplayer.addPotionEffect((new PotionEffect(PotionEffectType.SLOW, 800, 2)));
nearplayer.addPotionEffect((new PotionEffect(PotionEffectType.WEAKNESS, 800, 2)));
nearplayer.addPotionEffect((new PotionEffect(PotionEffectType.LEVITATION, 20, 30)));
nearplayer.addPotionEffect((new PotionEffect(PotionEffectType.GLOWING, 800, 1)));
nearplayer.addPotionEffect((new PotionEffect(PotionEffectType.DARKNESS, 800, 1)));
nearplayer.addPotionEffect((new PotionEffect(PotionEffectType.HUNGER, 800, 1)));
player.addPotionEffect((new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 100 , 2)));
}
}
}

}```
remote swallow
#

are you running paper

fading spindle
#

spigot

wary topaz
#

ItemManager?

fading spindle
#

yes thats a clas

#

ckass

remote swallow
#

add debug statements

fading spindle
#

ok

#

ill see whats wrong

wary topaz
#

the effects you give have some nulls

fading spindle
wary topaz
#

levitation is named different

fading spindle
#

oh

#

but the thing is

wary topaz
#

I think

fading spindle
#

no effects at all

#

get executed

wary topaz
#

error?

fading spindle
#

none

wary topaz
#

we need to see that other class

fading spindle
#

ok

wet breach
#

Should probably debug the item meta to see it is being set or what it is being set to.

fading spindle
#

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.entity.Item;
import org.bukkit.inventory.ItemFlag;
import java.util.ArrayList;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.ShapedRecipe;
import org.bukkit.inventory.meta.ItemMeta;

import java.util.List;

public class ItemManager {

public  static ItemStack gong_of_weakening;


public static void init(){


    creategongofWeakening();



}

private static void creategongofWeakening() {


    ItemStack gong = new ItemStack(Material.CYAN_DYE, 1);

    ItemMeta gongmeta = gong.getItemMeta();
    gongmeta.setDisplayName(ChatColor.AQUA + "The Bell Of Weakening");
    List<String> gongmetalore = new ArrayList<>();
    gongmetalore.add(ChatColor.GRAY + "This item is a powerful");
    gongmetalore.add(ChatColor.GRAY + "relic of what was left");
    gongmetalore.add(ChatColor.GRAY + "of the Ancient Builders...");
    gongmeta.setLore(gongmetalore);
    gongmeta.addEnchant(Enchantment.LUCK, 1, false);
    gongmeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
    gong.setItemMeta(gongmeta);
    gong_of_weakening = gong;
}
















}
#

i might be static abusing though im not sure

wet breach
#

Indeed you are and that is the problem in fact

wary topaz
#

wtf is all the new lines for lol

fading spindle
fading spindle
wary topaz
#

oh alr

wet breach
#

You are obtaining an item stack via static but it's most likely not initialized therefore null

wet breach
#

You never assigned it a value at the top in item manager. Unless you have a method that auto initializes when you access class statically it will always be null when accessed via static like that

wet breach
#

Either fix it appropriately for static access or use di

#

?di

undone axleBOT
fading spindle
#

oh ok thanks so much for the help

wary topaz
#

player.getWorld().getTime()

Is there a thing where it returns "Sunny" or "Rainy" or do I have to manually make that.

kind hatch
#

There is a World#isThundering() method.

#

There is also World#hasStorm().

wary topaz
#

alr one more question and ima go to bed, how can I set the server motd?

remote swallow
#

probably nms i would guess

#

actually

#

listen to ServerListPingEvent

wary topaz
#

nvm i figured it out

remote swallow
#

it has a #setMotd method

wary topaz
#

import org.bukkit.event.server.ServerListPingEvent;

remote swallow
#

yeah

wary topaz
#

Hey uh...

File motdConfigImage = new File(plugin.getDataFolder(), "server-icon.png");
            if (! motdConfigImage.exists()) {
                motdConfigImage.getParentFile().mkdirs();
                plugin.saveResource("server-icon.png", false);
            }
            event.setServerIcon(motdConfigImage);

How would I convert the file to a image?

kind hatch
wary topaz
#

I did try that.

#

Didn't work

#

'setServerIcon(org.bukkit.util.CachedServerIcon)' in 'org.bukkit.event.server.ServerListPingEvent' cannot be applied to '(java.io.File)'

earnest forum
#

?jd-s

undone axleBOT
earnest forum
#

this returns a CachedServerIcon

kind hatch
wary topaz
#

ohh

#

thanks

remote swallow
kind hatch
#

I was making an example.

#

Didn't really care about the exception

primal goblet
#
#!/bin/bash
while true;
do
        screen -dmS "bungee" java -Xms3G -Xmx3G -jar FlameCord.jar
        for x in 3 2 1
        do
                echo "Restarting.. $x"
                sleep 1
        done
        echo "Starting up.."
done

i have this code i want if the server down for any reason restart again but when i start the file
it make a while loop every 3 seconds and start a new screen instance how can i make it correct?

kind hatch
primal goblet
#

i made one before, but i forget how..

#

so if i use the command: /stop or /end (bungee) the server will count to 3 and relaunch

harsh totem
#

In your 3rd if statement

harsh totem
wet breach
onyx fjord
#

Send error

dark harness
#

Can someone tell me wich event is called when this message comes up in bungeecord?
Could not connect to a default or fallback server. Incorrectly configured address/port/firewall?

onyx fjord
#

Mb

gray merlin
#

Hey there, my buildtools are failing due to some sort of security issue...

Exception in thread "main" javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
#

What can I do?

#

Nevermind that, it was an issue with my school's WIFI security measures. I've switched to mobile data and it's working again

civic zenith
#

can someone help me devlop my lifrsteal minecraft server please join genral 1
I can take him as a devloper

#

how to add a hub in another world

#

help me please

#

@dense heron

#

@quaint mantle

#

@gray merlin

gray merlin
#

Don't do that please :/

civic zenith
#

please help me sir

#

I have a hub of .zip file

#

I have added multiverse plugin also

#

but the .zip file is not being created in a world

gray merlin
#

You could quite easily google that up

civic zenith
#

please help

civic zenith
#

can u help me please

gray merlin
hazy parrot
onyx fjord
civic zenith
#

@onyx fjord

onyx fjord
#

Per hour?

civic zenith
onyx fjord
#

5$ for two hours?

civic zenith
#

yes

onyx fjord
#

I can do 8

civic zenith
#

?

onyx fjord
#

8$/2

civic zenith
onyx fjord
#

Upfront tho

#

(DM)

civic zenith
#

come vc

onyx fjord
#

I'm at work rn

civic zenith
#

bruhh

onyx fjord
#

Hop in dm

civic zenith
#

i cant text so much

onyx fjord
#

I'll be home in like hour chill

wary harness
#

would it be possible to change player game mode with packets to client side
to get working middle click in gui menues?

kind hatch
#

You're aware that you can just set the cursor to the item they middle clicked using the InventoryClickEvent right?

wary harness
#

it work only in creative

kind hatch
wary harness
#

if server crash

#

and they where for example in gui

kind hatch
#

In theory, you could send a PacketPlayOutGameStateChange with the proper gamemode, but I'm not too experienced with that specific packet.

#

Also, I believe that is the old class name. I have no clue what it would be with the remappings.

civic zenith
#

Need a mc devloper I pay him 5 dollar / hour

#

Need a mc devloper I pay him 5 dollar / hour

#

join genral 1

tardy delta
#

?services

undone axleBOT
kind hatch
#

Actually, the packet you want for 1.19+ is ClientboundGameEventPacket

civic zenith
#

i am uploading spawn for a lifesteal server but it is not getting converted into world help please

humble tulip
#

Use multiverse and import the world

kind hatch
#

Probably due to the use of static.

civic zenith
#

i am useing multiverse

humble tulip
#

And?

civic zenith
#

still the world is not getting converted it is still in .rar

humble tulip
#

You need to unrar it

civic zenith
#

how

humble tulip
#

Worlds are a folder

civic zenith
#

i have a zip also

#

but still it is

humble tulip
#

Use winzip or win rar and unzip it

#

Worlds are folders not files

civic zenith
#

spawn

humble tulip
civic zenith
humble tulip
#

Well take it out the zip

#

And import it

civic zenith
#

join vc

humble tulip
#

I cant

#

Takena screenshot of the spawn file/folder in the server folder and send it

kind hatch
#

@wary harness Yea, something like this should work.

ClientboundGameEventPacket packet = new ClientboundGameEventPacket(new Type(3), 1F);

The problem is that I don't know what the second parameter should be. Maybe the protocol lib wiki could help with that, but the Type(3) is the value tied to the CHANGE_GAME_MODE field.

kind hatch
#

Oh wait

#

lmao

#

The second parameter should be the value

#

I'm dumb

#

The value in this case representing the gamemode you want to change to.

wary harness
kind hatch
#

And looking at the wiki, it looks like I accidentally got the second value right

wary harness
#

I think that will be it

#

I will see

#

now test time xd

kind hatch
#

You should also do some checks to see if it's a client side packet change or if the server recognizes it as a legitimate gamemode change.

wary harness
#

yeah I will see

fluid river
#

cuz your code is kinda cringe

#

and you need to rewrite it without statics

#

also with more OOP

#

FREE JAVA LESSONS(call me)

#

(checkmybio)

hybrid spoke
#

false positiving is not a good advertising for your free java lessons

#

the code is improvable, but a good approach

fluid river
#

yes

#

can you please send stack trace

#

and

#

entire class

dry beacon
#

Hey, is there a way to check if something happened before a given event? I'm trying to find out if a player had flight enabled before switching dimensions and I can't figure out how I should go about this, any help is greatly appreciated 8)

fluid river
#

having static init for your commandexecutor

#

with a link to your compass method

hybrid spoke
#

the cancellable ones f.e.

fluid river
#

also the entity you are targeting can move

#

so you need to update the compass target

#

cuz it points to location, not entity

#

afair

dry beacon
fluid river
#

also why are you both seting lodestone on compass and compasstarget on player

#

compasstarget should be just enough

fluid river
#

also you mentioned error in console, but didn't attach stack trace

fluid river
#

it is understandable

hybrid spoke
#

no errors in console

harsh totem
#

How do I make it in the plugin.yml file so that a command has 2 permissions that either of them allow the usage of the command?

fluid river
#

oh shit

#

my bad

harsh totem
#

how

fluid river
#

isn't permission mapped as string

harsh totem
#

it is

fluid river
#

you can try checking for permission in your onCommand() method

#

if (player.hasPerm(perm1) || player.hasPerm(perm2))

harsh totem
#

yeah that's what I thought but it would take me some time because I have many commands in the plugin

hybrid spoke
fluid river
#

lemme google rq

fluid river
#

nah i don't think so

harsh totem
#

don't say things if they are not true

fluid river
#

you can only check manually

harsh totem
#

I think using children in the yml file should do it

#

but idk how to use it

fluid river
#

this might help

#

i guess

harsh totem
fluid river
#

yeah and

#

@quaint mantle is your problem fixed

hazy parrot
# harsh totem I think using children in the yml file should do it

you think something like this ?

permissions:
  restful.*:
    children:
      - "restful.admin"
      - "restful.default"
      - "restful.base"
      - "restful.delete"
      - "restful.count.99"
      - "restful.list.*"
  restful.list.*:
    children:
      - "restful.list.self"
      - "restful.list.other"
  restful.base:
    description: "Allows the user to use base RestfulSpigot commands"
    default: true
  restful.default:
    description: "Allows the user to create default API key"
    default: true
fluid river
#

he needs two permissions for command

hazy parrot
#

assuming plugin.* and plugin.command ?

fluid river
#
commands:
  hi:
    permission1: foo.bar
    premission2: bar.foo```
kind hatch
#

Do people even use the permissions section in the plugin.yml? I thought you'd just need to check permissions with Player#hasPermission()

fluid river
#

and if player has at least one of these, command would be processed

fluid river
#

why can't you just ask for some help

#

i once made a plugin

#

which allowed you to chase entities

eternal oxide
#

Please DO use the permission section in plugin.yml. If you do not your permission nodes will be invisible to permission plugins.

fluid river
#

with compass

#

also it sent you the distance between you and the target

fluid river
#

i can share it, if you want(and if it's still somewhere on my pc)

hazy parrot
harsh totem
#

I just did this

fluid river
#

i mean, permissions are changing dynamically

hazy parrot
fluid river
#

i don't think permission section would help

#

one sec

harsh totem
fluid river
#

nah i don't have it

#

but i have jar on bukkit

hybrid spoke
fluid river
#

here it is

fluid river
hybrid spoke
fluid river
#

just pointed the basics first

#

that he needs more oop

hybrid spoke
#

stop harassing people unnecessarily

fluid river
#

and then detailed

kind hatch
hybrid spoke
fluid river
harsh totem
harsh totem
fluid river
#

hehe

kind hatch
#

My bad. I lost track of who originally asked.

fluid river
#

happens

harsh totem
#

yeah

fluid river
#

tho, are you actually so lazy to write this oneliner

hybrid spoke
harsh totem
fluid river
#

if (!player.hasPermission("") && !player.hasPermission("")) return false;

#

done

kind hatch
#

Well, as I was saying, I don't think it's possible to assign two permissions to act as an exclusive or. You can make children, but those are really like permission "packs" in a way.

kind hatch
#

So I'd just create the permissions in your plugin.yml like normal, then just check to see if the player has either permission.

fluid river
#

or you mean tab-completion?

kind hatch
#

Probably for tab-completion.

eternal oxide
#

If a permission is directly on a command it will be registered by Bukkit and visible. Any other permission (if not added to the plugin.yml) will not be visible.

fluid river
#

yeah but

#

you can still add it

#

manually

eternal oxide
#

All permissions add in the permissions section are registered and visible

#

Not what I was saying

fluid river
#

what's the point of visibility

eternal oxide
#

eg, you add a permission plugin.*

fluid river
#

except tabcompletion

eternal oxide
#

If you don;t have all your permissions in your yml * as a wildcard will not know what perms to grant

fluid river
#

after pointing to mistakes

hybrid spoke
fluid river
#

maybe i prefer talking this way, and prefer getting comments on my actions, even if they are not nice

#

ya know, might be a cultural difference

fluid river
#

if the guy don't like my manners, he can say it himself

#

and you are like coming out of nowhere trying to defend the guy who is not even insulted

wary harness
#

From some reason my jar file includes spigot jar stuff

#

am I doing some thing wrong

fluid river
#

maven/gradle?

kind hatch
#

Did you set your scope to provided on the spigot dependency?

eternal oxide
#

<scope>provided</scope> on your spigot dependency

wary harness
#

here my pom file

hybrid spoke
kind hatch
fluid river
hybrid spoke
#

but if thats how you treaten your "students", i wouldnt recommend your "java lesson"

kind hatch
fluid river
#

also idk if he is a newbie

wary harness
#

when I remove <classifier>remapped-mojang</classifier> and compile new jar it is not included

hybrid spoke
fluid river
#

i'm not as scared of people as imllusion so i won't block you anyways

#

but still can just ignore

hybrid spoke
#

someone cant handle critism

kind hatch
fluid river
#

i can accept when people criticise my code

hybrid spoke
#

anyways, since you're ignoring me from now on we can move on

fluid river
#

and i don't need defenders

#

who actaully blame guys for talking to me

#

in manner they prefer

#

also well, i accepted your criticism

wary harness
#

I have some modules with nms

#

so it was pulling files from there

#

because they were missing "provided "

#

and middel click is working

kind hatch
wary harness
#

fake

#

so I just need to send packet to set them survival

#

when they close shop

kind hatch
#

Noice

fluid river
#

hax

#

magic

fluid river
#

heh

#

for microsoft

wary harness
#

yeah

#

Probably little Tomy had idea of fixing bugs

#

by removing feature of MIDDLE click

#

🤣

fluid river
#

hey guys

#

can somebody benchmark

#

sqrt(7)

#

sqrt(6)

#

sqrt(2) * sqrt(3)

#

what is faster

#

hi morice

#

??

kind hatch
#

What new font?

fluid river
#

new font?

#

lol

hazy parrot
#

I literally can't notice new font

fluid river
#

betterdiscord?

#

hmm

#

i have old one

kind hatch
#

Time to get it then lmao

fluid river
#

i guss

hybrid spoke
fluid river
#

no

#

😉

kind hatch
fluid river
#

heh

#

i just didn't update it yet i guess

#

or maybe russians are not allowed to get updates 🙂

kind hatch
#

Also, wdym it looks like ass? It hardly looks different from what it was.

fluid river
#

look at the l

#

letter

#

it finally differs from I

hybrid spoke
fluid river
#

alr i lied

hybrid spoke
#

it looks weird

fluid river
#

i'm not promoting new font tho

#

blaming me for no reason now

hybrid spoke
#

CAPS

#

caps looks good

sharp moss
#

how to create a currency

#

gib me documentations real

fluid river
#

build economic system

#

make it independent

hybrid spoke
#

WHAT DOES THAT LOOK LIKE

kind hatch
#

Ez.
Step 1) Make it

fluid river
#

now you can have independet convertable currency

hybrid spoke
#

nah the caps is actually sick

kind hatch
#

Step 2) Print it

tardy delta
kind hatch
#

Step 3) Spread it amongst the pouplace

fluid river
hybrid spoke
#

make an virtual currency

#

bytecoin

kind hatch
#

Step 4) Get in trouble with the existing government for creating a separate currency that isn't recognized by them.

fluid river
sharp moss
#

how to create a currency in minceraft

fluid river
#

use diamonds

#

use vault

#

use mysql money storage

tardy delta
hybrid spoke
fluid river
#

100 ns?

hybrid spoke
#

minecraft the new paypal

tardy delta
#

idk if i can do maths

sharp moss
fluid river
#

yes

tardy delta
#

but i had the same with my parser when running the same expression a few thousand times

fluid river
#

System.nanoTime()

#

i meant

#

run it without loop

#

then run again

#

for like 5 times

#

and get the middle nanoseconds value

#

and then same for 6

#

and sqrt(2) * sqrt(3)

#

is 6 actually faster than 7

#

and well are perfect squares faster than other numbers

#

like 16 faster than 15

tardy delta
#
sqrt(6)
74400ns
188100ns
70400ns
72200ns
68900ns

sqrt(7)
82300ns
59900ns
83100ns
59500ns
55800ns```
fluid river
#

7 is kinda faster then

#

on late runs

tardy delta
#

average of first is 94800ns

fluid river
#

bruuuuh

#

double d = 289358932.0;
double sqrt = Double.longBitsToDouble( ( ( Double.doubleToLongBits( d )-(1l<<52) )>>1 ) + ( 1l<<61 ) );

#

wtf is this sqrt

#

bit shifting

tardy delta
#

2nd average is 68120.0ns

#

Math.sqrt is native if you didnt know

fluid river
#

?

tardy delta
#

native method

fluid river
#

yeah i know

#

i mean what does it change

tardy delta
#

what does what change

fluid river
#

we are not comparing c++ and java

#

just java's sqrt of 7 and sqrt of 6

fluid river
wet breach
sharp moss
#

how to create scoreboard send me docs

fluid river
#

i meant we are not comparing OS or hardware or c++ with java

wet breach
#

native methods in most cases are generally far more optimal then what you could create in software

fluid river
#

we can't go to lower level

wet breach
#

?scoreboard

fluid river
#

c++ i just highest of lower levels

tardy delta
#

just write sqrt in assembly

wet breach
fluid river
#

we are just using java

#

we are not comparing it with c++ or assembly

tardy delta
#

what was even the point of that benchmark

fluid river
#

and just testing on windows

wet breach
fluid river
#

we are not using it

#

just Math.sqrt()

#

i mean the sqrt might use it

#

idk it's code

wet breach
#

in general, most things in the java api makes use of native method calls and the sorts implementation wise

fluid river
#

is sqrt(6) actually faster than sqrt(7)

#

cuz 6 can be represented by 2 * 3

#

so sqrt(6) is sqrt(2 * 3)

#

or sqrt(2) * sqrt(3)

drowsy pawn
#

hello, who change

fluid river
#

exchange

drowsy pawn
#

<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
</dependency>

wet breach
#

?outdated

undone axleBOT
fluid river
#

?1.8

undone axleBOT
fluid river
#

hehe

tardy delta
#

smh

wet breach
#

we did have an outdated command though

#

!outdated

#

guess its gone now

fluid river
#

sad

tardy delta
#

never seen it

drowsy pawn
#

oh

#

<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.19-R0.1-SNAPSHOT</version>
</dependency>

fluid river
#

shouldn't that be spigot-api tho

drowsy pawn
#

but craftplayer

wet breach
#

?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

fluid river
fluid river
icy beacon
fluid river
#

yeah yeah

tardy delta
#

Yesterday was bad

fluid river
#

what's this

tardy delta
#

me trying to fix my solving algorithm

wet breach
#

looks like bit shifting/shuffling

fluid river
#

quality doesn't let me read letters

tardy delta
#

maybe i dont want that

fluid river
#

😭

fluid river
tardy delta
#

removed the old gh repo and created a new one cuz i fucked up so badly

fluid river
#

again

tardy delta
#

yes

#

exposed my 2nd gh account

fluid river
#

do you need any help

#

maybe we can think together

#

i have nothing to do

tardy delta
#

lemme push it and see if you understand anything of it lmao

fluid river
#

hehe

tardy delta
#

removed a bunch of outdated code so should be a lil more readable

fluid river
#

lez dive

tardy delta
#

look in Expression for entry point

fluid river
#

yeah yeah

#

already there

#

i looked at expressionparser first

#

😉

tardy delta
#

TokenList contains old algorithm and TokenChain contains new

fluid river
#

are they for priority here

#

3 2 1

tardy delta
#

yes

fluid river
#

you are not planning sqrt i guess

#

cuz there is no char for it

tardy delta
#

im planning to add predefined and custom functions

wary harness
#

is it possible to add parent module as dependency and automatically all its sub modules
so in my core pom.xml file I currently have all of them added

#

So I was thinking is there a way to add "hooks" only as dependancy

fluid river
#

PARENTHESIS

tardy delta
#

?

fluid river
#

first time i googled it's meaning

tardy delta
#

didnt know the word either

fluid river
#

brace

#

leftbrace

#

rightbrace:)

tardy delta
#

implemented them with only 5 lines

fluid river
#

well

#

is it working now

tardy delta
#

is what working

fluid river
#

for like 3^-1

#

oh shit

#

you can use 3^(1/2) to have a square root

tardy delta
#

that works yes

fluid river
#

or like any root you want

#

is it working too?)

#

idk if math.pow(1/2) is possible

tardy delta
fluid river
#

so square root is already included

tardy delta
#

pow is double, double yes

fluid river
#

kinda weird but

tardy delta
#

ill probably add a predefined function sqrt()

fluid river
#

so i guess everything works now, and you are optimizing

tardy delta
#

this aint working (should be 720)

fluid river
#

alr let's loop through what you have

#

actually

#

2*3*4*5 doesn't work either?

tardy delta
#

its saying 240 instead of 120

fluid river
#

hmm

tardy delta
#

it depends on the amount of operators i believe

#

going to debug and optimize

fluid river
#

im searching

#

with my eyes

#

for possible error

tardy delta
#

gl lmao

tardy delta
#

people wont believe how fast a switch is lol

#

90% faster than a if else if else with an int

hybrid spoke
dark harness
#

Can someone tell me wich event is called when this message comes up in bungeecord?
Could not connect to a default or fallback server. Incorrectly configured address/port/firewall?

hybrid spoke
#

why should that be an event

dark harness
#

I want to check if someone is trying to connect to an server thats offline

hybrid spoke
#

ServerSwitchEvent then maybe?

signal kettle
#

Hello so I wanted to create a new world generator. I found on internet few examples but very old and any of them don't want to work and idk why;/ Can someone help?

Chunk Generator Class:

package me.bially.midgardworldgenerator;

import org.bukkit.Material;
import org.bukkit.World;
import org.bukkit.generator.ChunkGenerator;

import java.util.Random;

public class MidgardChunkGenerator extends ChunkGenerator {

    @Override
    public ChunkData generateChunkData(World world, Random random, int x, int z, BiomeGrid biome) {
        ChunkData chunk = createChunkData(world);

        for (int X = 0; X < 16; X++) {
            for (int Z = 0; Z < 16; Z++) {
                for (int Y = 0; Y <= 5; Y++) {
                    chunk.setBlock(X, Y, Z, Material.BEDROCK);
                }
            }
        }
        return chunk;
    }
}

Main Class:

package me.bially.midgardworldgenerator;

import org.bukkit.generator.ChunkGenerator;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.logging.Logger;

public final class Main extends JavaPlugin {

    Logger logger = Logger.getLogger("Midgard World Generator");

    @Override
    public void onEnable() {
        logger.info("Midgard World Generator has been Enabled");
    }

    @Override
    public ChunkGenerator getDefaultWorldGenerator(String world, String id) {
        return new MidgardChunkGenerator();
    }
}
fluid river
#

my one

#

guys in comments fixed it

dark harness
wet breach
fluid river
#

??

#

somebody uses switch for boolean

#
switch (b) {
   case true -> {}
   default -> {}
}```
wet breach
#

you can if you want to

#

in terms of optimal performance however it would be best not to

#

however most people won't really notice the difference except in benchmarks and edge cases

tardy delta
#

still had to send

#

||gimme stars owo||

tardy delta
#

believe i forgot to put mention off

fluid river
#

...

signal kettle
fluid river
#

my generator is generating void

#

you don't need a custom ChunkGenerator tho

#

you can just use

#

wc.generator(new ChunkGenerator() {});

fluid river
#

plugin will recreate it with no blocks

signal kettle
#

hmm do i need @Overrides ?

fluid river
#

they are not necessary

#

just for demonstration

signal kettle
#

oh okay i learned something new

#
            wc.generator(new MWGGenerator()); // let's create a class for generator of void

This is name of Generator that I need to put in bukkit or im wrong?

worlds:
  
  world:
    
    generator: MWGGenerator
#

because after run up i have still normal world

midnight shore
#

Hi, anyone can help me with this error? I don't know why i get this as the class exists!

fluid river
#

idk if my generator is supposed to work with default bukkit worlds tho

signal kettle
fluid river
#

full stack trace @midnight shore

midnight shore
#

?paste

undone axleBOT
signal kettle
#

thank you very much ❤️

fluid river
#

why are you hiding plugin name

#

nobody gives a fuck

#

if you are too scared send me in dms

midnight shore
#

i'm not scared but i don't want to have some of my friends find what project i'm working on

#

anyway

fluid river
#

dm me

midnight shore
fluid river
#

SmartInvs is?

midnight shore
#

thats a plugin that connects to mine

#

to make inventories

fluid river
#

are they both installed and running

midnight shore
#

yeah

fluid river
#

is that on initialisation

#

or when you test it

midnight shore
#

this error fires whenever i try to access Prompts.enum values

#

kinda like it doesn't exist

#

but the class is there

#

this class is for getting player inputs

fluid river
#

so you access after init

midnight shore
#

yeah

fluid river
#

how do you depend on hidden plugin

#

maven/gradle?

midnight shore
midnight shore
#

yeah maven

fluid river
#

if you want to access class from another plugin

#

you need to depend on it with maven

#

and add a scope

midnight shore
#

what scope do i add?

fluid river
#

<scope>provided<scope>

#

depends

midnight shore
#

still same error

fluid river
#

Could not pass event InventoryClickEvent to SmartInvs v1.2.7

#

SmartInvs is erroring

#

plugin which you depend on

#

not the one you are coding

midnight shore
#

this one says ClassNotFoundException with the Anvil stuff

midnight shore
fluid river
#

then i guess you need to set the scope on anvilgui

midnight shore
#

I did that

#

<dependency>
<groupId>net.wesjd</groupId>
<artifactId>anvilgui</artifactId>
<version>1.6.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

clever dawn
#

Does somebody know how to use PluginManager#registerEvent(Class<? extends Event>, Listener, EventPriority, EventExecutor)? Particularly the event EventExecutor

wet breach
#

scope has nothing to do with that error

tardy delta
#

isnt the EventExecutor a lambda

clever dawn
#

An interface, yes. I'm curious what it does

fluid river
wet breach
#

First off, you obviously missed an exception check that you should have been catching. When you are depending on other plugins you have to ensure they are not null or that classes don't magically disappear especially since versions can vary

tardy delta
#

(listener, event) -> doSomething()

clever dawn
#

That still doesn't tell me what it's purpose it though

wet breach
#

If you are doing your initializing in the onEnable() what is most likely happening is your plugin is enabling before the plugin you depend on

fluid river
#

he said init goes well

#

with no errors

wet breach
#

that isn't relevant

tardy delta
#

isnt it like an observer or smth?

fluid river
#

anyways if you have depend:

midnight shore
#

guys, AnvilGUI isn't a plugin

tardy delta
#

as you have to pass in a listener

fluid river
#

aren't your plugin loading after

fluid river
wet breach
fluid river
#

i guess

wet breach
#

Well depends on the type of library it is

#

some people think library plugins are not plugins when in fact most actually are just don't do anything itself

midnight shore
midnight shore
midnight shore
wet breach
#

Then shade and relocate it

fluid river
midnight shore
tardy delta
#

im fucking up again

fluid river
#

sad ness

tardy delta
#

probably an if at the wrong position

midnight shore
#

does deploy in the <phase> part matter?

fluid river
wet breach
signal kettle
#

One question more Nuker, so your plugin as normal was created to work with WorldCreator plugin yes? and how did you create the custom one?

tardy delta
#

hehehe

signal kettle
fluid river
#

WorldCreator is a Bukkit class

midnight shore
fluid river
#

not a plugin

signal kettle
#

ohh okay

wet breach
#

that project is coded for 1.8 java, and if you have a jar then its 1.8

#

not really going to work

midnight shore
#

wait

wet breach
#

so what you need to do, is clone the repo locally, update the pom or poms and then build it

midnight shore
#

my project is on java 17

wet breach
#

your project is, but libraries don't automatically get compiled with that version just because you are shading

midnight shore
#

yea i know

wet breach
#

ok I am telling you how to fix it, basically you need to compile the project yourself for the java version you are needing

midnight shore
#

but my other project is on 17 as well and it works

wet breach
#

then its just a matter of using your self compiled library as the dependency instead

midnight shore
#

actually i'm thinking of using Chat Input

#

cause this one is making me mad

midnight shore
#

without writing everything

wet breach
#

well you are also not following the suggested solutions either and assuming it should just magically work because you used it elsewhere

wet breach
#

tell maven to compile it

midnight shore
#

how does the git clone part work?

wet breach
#

it downloads the repo?

midnight shore
#

not that way

#

i mean how to do it

wet breach
#

git clone

#

address

#

how to do it from within the IDE there should be some menu option for it

midnight shore
#

so i'll run git clone in the terminal part

wet breach
#

yes with the web address at the end of course, note that wherever the terminal is at directory wise is where it will clone it to

#

unless you further specify a directory

#

other then the one the terminal is displaying

midnight shore
#

so i make a new intellij project and use git clone right?

wet breach
#

if you are not certain you can go read up on git

midnight shore
#

but do i have to make a new project or not?

wet breach
#

you could if you want to, not necessary

#

I am not here to hold your hand every step of the way, if you have no idea what you are doing you probably should step back and maybe do some research into these pieces of software

midnight shore
#

well thank you and goodbye : D

wet breach
#

or maybe actually learn what your IDE is able to do if you are using IntelliJ or Netbeans

tardy delta
#

wondering why my toString is fucked up in the debug thing

#

where do those three numbers come from lol

quiet ice
#

The better question is where is {

tardy delta
#

im probably adding chars and ints

#

mye

quiet ice
#

If left.getValue() is an int, then yeah - that is the cause

wet breach
#

why are you mixing character literals and quotations?

#

just surround the brackets with quotations like you do everything else o.O

tardy delta
#

looks better

quiet ice
#

I personally prefer using char literals when possible

#

Should be a bit faster to run, so doing that doesn't hurt

tardy delta
#

i always try to use '{' and '}'

wet breach
tardy delta
#

;{

wet breach
#

character literals are more appropriate for things like escape sequences

midnight shore
#

Hi, When i try to create a file it actually creates a folder so when i try and read it with Yaml i obviously get an error... I'm currently using File.mkdirs(); and File.createNewFile(); How can i create a file instead?

fluid river
#

show your code

midnight shore
tardy delta
#

check if it exists

midnight shore
tardy delta
#

by code

fluid river
#

i guess

midnight shore
fluid river
#

getDirectory(), getFileName() + ".yml"

tardy delta
#

and use the File constructor that takes two params

#

^^

glossy venture
#

file.getParentFile().mkdirs()

#

this will create the folder it is in

#

otherwise it will create the folder it is in but the file itself will be created as a directory first as well

midnight shore
#

it works! thank you

tardy delta
#

what happens when you call file::createNewFile() on a file object that has a parent that does not exist on disk?

#

will the parent be created?

glossy venture
#

this looks so weird

#

i think its the division tho

#

i hope its correct

#

yeah

tardy delta
#

everything i try gives me 36 lol

glossy venture
#

these errors look pretty clean

tardy delta
#

i wanted to do smth too

glossy venture
#

but bro setting the location for every error is annoying

#

because you got to like set the location for every token

#

and then every node

glossy venture
tardy delta
#

the problems happen when i put an operator with lower priority in front of one with higher

glossy venture
#

lol 50 microseconds vs 17 ms

#

jit warmed up

tardy delta
#

i just came to the conclusion my way can never work

glossy venture
#

yeah u need AST
also the new font 7 and K look so goofy

tardy delta
#

idk if im even calculating it correctly

#

first calculation was 17ns

#

or im just bad at math

glossy venture
#

you mean the time

tardy delta
#

ye

glossy venture
#

yeah thats correct

#

ns / 1000 = us

tardy delta
#

thought you were talking about that yours was slower

glossy venture
#

nah

#

havent timed it

#

old parser

#

JIT is insane

tardy delta
#

hmm looks that i was wrong and i better keep a list of calculations which couldnt been executed yet and execute them whenever i come accross one with a lower or the same priority

#

is that microseconds?

glossy venture
#

nah nanoseconds

tardy delta
#

first one is nearly a mc tick then

glossy venture
#

bruh i fucked up my old parser

#

its crashed

zealous osprey
#

oof

glossy venture
#

infinite loop or smth

tardy delta
#

me a week ago

glossy venture
#

also function calls were slow as fuck

tardy delta
#

it kept looping but it didnt throw

glossy venture
#

so im rewriting it

zealous osprey
#

why everyone writing math parsers suddenly?

glossy venture
#

for fun also i want it to be like a script language

#

less only math expressions

#

simple scripts

tardy delta
#

i mean using a switch instead of an if else if else reduced execution time with 200 microseconds

#

had 250 before, now around 50

glossy venture
#

damn

tardy delta
#

fuck operator priority is a bitch

#

and i dont want to loop multiple times

glossy venture
#

use tree

#

aka ast

tardy delta
#

christmas tree

trim creek
#
@EventHandler
    public void onKill(EntityDeathEvent e) {
        Player victim = (Player) e.getEntity();
        Player attacker = (Player) victim.getKiller();
        if (victim instanceof Player) {
            if (attacker == null) {
                Bukkit.getServer().getConsoleSender().sendMessage("§cA támadó null");
            }
            if (attacker instanceof Player) {

why is killer null?

eternal oxide
#

read the javadoc

trim creek
#

bruh

onyx fjord
#

i shall use static when i will only have one instance of that object right?

eternal oxide
#

depends

onyx fjord
#

for example my messaging utils

eternal oxide
#

not always required

#

yes, if it's a actual stateless utils class static is good

onyx fjord
#

stateless so one in which i dont take any input in?

eternal oxide
#

stateless is when there is nothing stored in the class which can change, ie fields

golden turret
#

how can I check if I can place the snow layer in a block?

#

something like Material.SNOW.canPlace(otherMaterial)

signal kettle
#

Do somebody know maybe how to add something to spawn via plugin? e.g let me say i want to spawn diamond blocks like coal ores.

golden turret
#

yea

#

just found it

#

thanks

tardy delta
#

why is it possible to give yourself a star 💀

trim creek
#

Thanks

#

but seriously

#

-.-

#

Even PlayerDeathEvent does not works lol

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.

eternal oxide
#
getKiller
@Nullable
Player getKiller()
Gets the player identified as the killer of the living entity.

May be null.

Returns:
    killer player, or null if none found

#

Looks fairly clear to me

trim creek
#

how is player not found if I kill the player...?

#

AS A PLAYE

eternal oxide
#

did you shoot it with a bow?

trim creek
#

Nah

#

Used axe

#

or bow is required?

eternal oxide
#

no, it will be null if you kill it with a bow

trim creek
#

thats... weird...

eternal oxide
#

if you physically kill them Entity you will be listed as the killer

trim creek
#

for some reason it broadcasts that I killed X - while killed it with a bow -

solemn meteor
#

What do i do to stop nether portal being lit up? one of my attempts:

    public void netherPortalLighting(BlockIgniteEvent event){
        if (event.getBlock().getType().equals(Material.OBSIDIAN)){
            event.setCancelled(true);
        }
    }
eternal oxide
#

if it dies to a projectile or any other means of death it will be null

trim creek
#

but the other event cannot work?

eternal oxide
#

they may have fixed projectile kills then

trim creek
#

1.18.2 so idk

remote swallow
trim creek
#

Even using a TNT will kill the player and broadcast it that I killed them - only if I damaged them at least once -.

fading spindle
kind coral
#

hello guys im trying to make a project with intellij (gradle) with more than one module, how could i achieve that?

i am trying to make 3 modules
common, spigot and bungee

when compiling either the spigot or the bungee i want their result to include the common module. (modificato)
[18:55]
like a local dependency

Invia un messaggio in #paper-dev