#help-development

1 messages ยท Page 2112 of 1

zenith saddle
#

I have to unlock, BUT HOW

#

anyone have a server that is off and can send me their file?

waxen plinth
#

the session.lock file is the lock

#

you can just delete that file and it will start as normal

#

conveniently it also tells you the exact path of the file: /Users/ianerbacher/Desktop/Server 1.17/./world/session.lock

#

note that there may also be locks on the nether and end worlds

zenith saddle
#

ok

#

dat worked

#

I thought the little charachter inside did sothin

#

this little guy โ˜ƒ

#

wait...

#

its a snowman?

waxen plinth
zenith saddle
#

wot

dusk flicker
#

unicodesnowmanforyou.com

ivory sleet
#

lol

dusk flicker
#

โ˜ƒ

tender shard
jade perch
#

If you're tryna do it with a plugin it's not gonna be easy at all

echo basalt
#

debug

#

just send the X and Z values to the player's actionbar or something

zenith saddle
#

How do you create a plugin data folder

echo basalt
#

getDataFolder()

#

you can then mkdir it

zenith saddle
#

ya but create it

waxen plinth
#

I'm guessing that it gets replaced with a simple string search + replace over the jar itself but I could be wrong

#

because strings have to be embedded in their literal forms anyways

#

though I guess they can be compressed so you'd have to decompress them first

#

still though

tender shard
#

basically just a tool to replace placeholders in string constants like fields, local vars, etc

jade perch
tender shard
#

yeah I also found byte buddy but haven't found a way easily replace something in a .jar and then save the file again :<

jade perch
#

Been a bit since I've worked with it, might be a different lib that's better suited for it. Anything ASM based is going to be the right direction though.

tender shard
#

RIP this going to be more complicated than I thought

#

I thought there must be an existing tool for this

#

after all, all those illegal leaking websites replace those placeholders automatically

tender shard
#

I also have to replace that stuff in already compiled libraries

ivory sleet
#

oh

tender shard
#

I need to replace strings within string constants in .class files

ivory sleet
#

nvm then

tender shard
#

:<

zenith saddle
#

file = new File(Bukkit.getServer().getPluginManager().getPlugin("DisappearingBlocks").getDataFolder(), "blocksConfig.yml");

#

Is there a better way to get the plugin object

tender shard
#

the plugin name?

zenith saddle
#

in the on enable method I can use this.getDataFolder()

tender shard
#

just pass an instance of your main class to the other class' instance

#

e.g. ```java
MyOtherClass myOtherThing = new MyOtherClass(this);

#
class MyOtherClass {
  private final MyMainClass plugin;
  public MyOtherClass(MyMainClass plugin) {
    this.plugin = plugin;
    plugin.getDataFolder()....;
  }
}
zenith saddle
#

wot

#

I am confused

#

Plugin plugin = new CustomItems(this);
file = new File(plugin.getDataFolder(), "blocksConfig.yml");

#

does that work @tender shard

quaint mantle
#

no

zenith saddle
#

why not

quaint mantle
#

you're initiating your main class

#

and that will error

#

and disable the plugin

#

?di

undone axleBOT
zenith saddle
#

so what do I do

delicate lynx
#

initialize your 2nd class and pass your plugin into its constructor

zenith saddle
#

else if (!(args[0] instanceof Player)) { gives error

tall dragon
zenith saddle
#

how to convert string to player

tall dragon
#

by using Bukkit#getPlayer(String name)
then performing a null check to see if this player is actually online.

zenith saddle
#

nope

tall dragon
#

uhmm

#

yep

zenith saddle
#

yes I did not have null statement correct

#

tx

tall dragon
#

๐Ÿ‘

worldly ingot
#

Two options

  1. Depend on Spigot API (or whatever) before Vault. Dependencies will prioritize based on when they're defined
  2. Exclude Bukkit from the Vault dependency
#

I advise doing the first. It's way easier. Just move your Vault dependency below Spigot

ivory sleet
crisp steeple
#

java is a great language

worldly ingot
#

Seek Jesus

digital socket
#

hello

#

I really need a little help

ivory sleet
#

ask away

digital socket
#

I was doing the DiscordSRV setup

#

And where do I put the channel ID so the bot would show the messages from the in game server?

noble lantern
quaint mantle
#

Hey I've got a question, how do you get the data of a seed when a player breaks it ?
The level that the seed has grown.

noble lantern
#

Check if its state is instance of Ageable

#

and cast to Ageable

quaint mantle
#

How would you do it ?

noble lantern
#

Block#getState

#

and do a instanceof check for Ageable

#

then just cast (Ageable) theBlock.getState()

quaint mantle
#

Ohhh.

noble lantern
#

just in case you run into any errors ^

#

make sure you import

#

org.bukkit.block.data.Ageable because theres a Entity one as well iirc

quaint mantle
#
@EventHandler
    void onBreak(BlockBreakEvent e){
        if(e.getBlock() instanceof Ageable){
            
            Block block = e.getBlock();
            Ageable age = (Ageable) block.getState();
            
            age.getAge();
            
        }
    }```
#

This'd work, right ?

noble lantern
quaint mantle
#

well it won't do anything with the age but i'd work.

#

Ohh okay.

#

And one more thing, is there a way to make it so the crops don't need water to grow ?

noble lantern
#

you can get the soil block underneath it and set it to a waterlogged state (i think) and prevent state changes on it

quaint mantle
#

Oh okay,.

#

I just gotta figure out how to stop the state changes.

noble lantern
#

Already got it

#

sec

quaint mantle
#

Ohh okay, thank you!

noble lantern
#

https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/block/data/type/Farmland.html

So you use Block#getBlockData and cast it to this class and set its moisture level to 7 IIRC, and add this Block to a List of Blocks so you can keep track of it, preferable do this when you right-click a block with a hoe to make it farmland (PlayerInteractEvent)

From there use this event: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/block/MoistureChangeEvent.html and set the event to canceled if the Block effected here is in your List of blocks mentioned previously

OR:

If you wanna prevent all state changes of soil blocks, forget the List of Block's entirely, and just check if the BlockData from this state is farmland, and cancel the event there

#

do note

#

if you do the List of blocks route youll likely need to store them in a file/database so they can be loaded when the server starts up

digital socket
#

What is this bruh, is this just the Discord Authenticator of myself like Google Authenticator?

quaint mantle
#

So I guess it'd be the best to use the MoistureChangeEvent

tall dragon
noble lantern
noble lantern
quaint mantle
#

So moisture event it is, thanks alot man!

noble lantern
#

IIRC you can check when a player colides with a block

tall dragon
#

its a door for only 1 "team"

#

yea but how do i figure out where to teleport to

noble lantern
tall dragon
#

if i take the player direction it could pose issues as he could be looking the other way

noble lantern
tall dragon
#

yea it does the same but to the other side

digital socket
noble lantern
#

you could get the BlockFaces of those glass panes, and check if the blocks facing north east south and wast are air set the location to that

digital socket
#

This is what it says

tall dragon
#

yea i guess il try that

noble lantern
# digital socket

not sure tbh, just looks like you dont have 2fa setup but if its asking for the code you do have it enabled

#

maybe ask discord support or check its reddit page

#

in fact

#

it was the first google search i found

#

whoever developed that bot, needs to do that ^

spiral hinge
#

Is there a way I can get the max food level a player has for a variable?

spiral hinge
#

Max

noble lantern
#

if your changing it, that would be up to you to hold the max food level of the player and enforce it

#

i dont think theres a well written api for adding hunger bars like there is with health

#

theres only getFoodLevel and setFoodLevel

tall dragon
#

@noble lantern do you think it would also be possible to just detect block collision and then teleport the player to the other side of the block using a vector maybe?. i dont know much about vector math but i should be able to get a vector in the direction of the collided block and have that vector be 1 block long.

noble lantern
tall dragon
#

aw unlucky haha

noble lantern
#

you could maybe try

#

raycasting through it?

#

sec

tall dragon
#

cause it would be amazing if i could do it in a way like this. so it will really work from any direction

tall dragon
#

yes uhm.

#

unfortunately my customer is on 1.8

#

๐Ÿ˜„

noble lantern
tall dragon
#

yes...

#

indeed

#

it should still be possible with vectors though

noble lantern
#

Indeed it should

#

just that methods a lot simpler ๐Ÿ˜›

tall dragon
#

just need to wait for my very smart friend to wake up xD

#

so he can teach me how vector work

quaint mantle
#

@noble lantern

#
@EventHandler
    void moistureChange(MoistureChangeEvent e){
        Ageable age = (Ageable) e.getBlock().getState();
        if(age.getAge() == 7){
            e.setCancelled(true);
        }
        else{
            age.setAge(7); 
        }
    }```
#

Would this work ?

noble lantern
#

no need to check its age or stuff

#

just instanceof Farmland then cancel event

quaint mantle
#

Okay then what if it's not watered ?
How do I set it to lvl 7?

#

Nvm found it, casted it to a farmland.

noble lantern
#

you make sure its watered when you till the farmland

#

ie

quaint mantle
#
@EventHandler
    void moistureChange(MoistureChangeEvent e){
        if(e.getBlock() instanceof Farmland){
            Farmland land = (Farmland) e.getBlock();
            if(land.getMoisture() != 7){
                land.setMoisture(7);
            } else {
                e.setCancelled(true);
            }
        }
    }```
#

Wouldn't this work as well ?

noble lantern
#

player interact event -> check right-click block -> if player is holding a Material which its name ends with HOE -> check if block right-clicked is a typeof DIRT/GRASS_BLOCK/etc -> run one tick later to change its Farmland moisture to 7

noble lantern
#

it would still work

#

prolly a lot simpler tbh

quaint mantle
#

And for the crop's age use Ageable, understood.

noble lantern
#

yep!

#

oh wait

#

wait

#

wait

noble lantern
#

not Block#getState or Block#getBlockData

#

and then your chillin

quaint mantle
#

Yeah I know.

#

First I check if it's an instance.

noble lantern
#

yes but a Block will never be Farmland because Block doesnt directly inherit it

#

Farmland implements BlockData, not Block

quaint mantle
#

Ohh that makes sense.

lavish robin
#

any idea why this would make a null pointer exeption?
static Scoreboard scoreboard = Bukkit.getScoreboardManager().getMainScoreboard(); Cannot invoke "org.bukkit.scoreboard.ScoreboardManager.getMainScoreboard()" because the return value of "org.bukkit.Bukkit.getScoreboardManager()" is null

quaint mantle
lavish robin
#

ah that makes sence. would worlds be loaded when on enabled is called?

lavish robin
#

ok thanks for the help

crisp steeple
#

wondering, why does blockbreakevent trigger when you left click a block in creative with a sword?

#

sort of seems like a bug

scarlet sun
#

hello, how can i disallow people to drag items in to a GUI. I have made so people can't steal items from gui, but people still can drag their own items, so it works like a trash can :D

waxen plinth
#

InventoryDragEvent

crude loom
#

Is there a way to check for if a key has a deeper structure to it in a configuartion file? for example:

hello:
  world : hi

getConfig().something("hello")
this will return true

hello :world

getConfig().something("hello")
this will return false

crisp steeple
#

#getConfigurationSection(path)

waxen plinth
#

You can pass a boolean for whether to get deeper keys or only the first layer

crude loom
#

Oh right, and then I can check for the size of the set, thanks!

surreal prawn
#

whenever im using the SignChangeEvent event, the server is printing the first line on the sign when i dont have that programmed in

#

how do i remove it?

chrome beacon
#

Recompile and use that jar

surreal prawn
#

sorry, i had 2 different jar files

#

figured it out lol

chrome beacon
#

Yeah it happens

restive tangle
#

https://paste.md-5.net/nolifuzoja.xml My dependencies are not being shaded, this used to work a while ago. It's probably due to Lombok, that thing is being more of a hassle than it's worth. How do I configure it properly?

chrome beacon
restive tangle
#
 <dependencies>
        <dependency>
            <groupId>com.destroystokyo.paper</groupId>
            <artifactId>paper-api</artifactId>
            <version>1.16.5-R0.1-SNAPSHOT</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.24</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
restive tangle
restive tangle
#

My bad lmao, Lombok works fine. Just a little null pointer

chrome beacon
native hamlet
chrome beacon
#

The client requires a location of the anvil. I have no idea how that handles it

native hamlet
#

I'm talking specifically about Grindstone

chrome beacon
#

ah

#

That bug report is for an anvil though

native hamlet
#

marked as duplicate

chrome beacon
#

ah I see

#

You might have to use NMS then to fix that

native hamlet
#

Alright then

#

I'm just confused that this bug is still here for 3 years xD

chrome beacon
#

You're free to fix it yourself and add a PR

sullen dome
#

i'm completely confused.. why tf does this always return false? doesnt look wrong to me

    public static boolean doesDBEntryExist(Player p) {
        try {
            PreparedStatement ps = Main.getPlugin().getSQLManager().getConnection().prepareStatement("SELECT * FROM " + Constants.TABLE_NAME + " WHERE UUID=?");
            ps.setString(1, p.getUniqueId().toString());
            ResultSet result = ps.executeQuery();
            if (result.next())
                return true;
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return false;
    }```
#

and yes, the database exists, is connected, and works fine. The following one just always puts it into the database, regardless of if it already exists

    public static void createDBEntry(Player p) {
        try {
            if (!doesDBEntryExist(p)) {
                PreparedStatement ps = Main.getPlugin().getSQLManager().getConnection().prepareStatement("INSERT IGNORE INTO " + Constants.TABLE_NAME +" (UUID, RANK) VALUES (?,?)");
                ps.setString(1, p.getUniqueId().toString());
                ps.setString(2, "&7Player");
                ps.executeUpdate();
            }
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }```
tender shard
#

yay I got my "replace strings in compiled .jar file" thing working

tender shard
sullen dome
#

ofc it doesnt

#

the question is why

#

because the entry in the db does in fact exist, it just creates the exact same entry below it

tender shard
#

have you checked the actual db table?

#

oh

sullen dome
#

-_-

tender shard
#

but have you checked it yourself?

sullen dome
#

if with "yourself" you mean checking the table inside heidisql, yes

#

it now has 10 entries with the same uuid and rank

tender shard
#

yes that's what I meant

sullen dome
#

maybe i'm dumb? idk

#

but saving/loading it works, so i have no fucking idea

tender shard
#

oh wait

#

32 is too short

#

doesn't a UUID have 36 chars?

sullen dome
#

tf?

#

oh

tender shard
#

yes

#

it has 36

sullen dome
#

okay, makes sense

tender shard
#

I just checked

sullen dome
#

my bad ahaha

#

thanks

tender shard
#

np ๐Ÿ™‚

#

well

#

alternatively

#

replace the "-" in UUIDs

sullen dome
#

uuids are shit

tender shard
#

then it fits into 32 chars

sullen dome
#

nah doesnt matter

#

i just had the rank at 32

#

so i made uuid at 32 too, not knowing it has 36

#

4 fucking letters

tender shard
#

btw UUIDs do not suck ๐Ÿ˜›

#

they are awesome

sullen dome
#

they do

tender shard
#

why?

sullen dome
#

they crash my server sometimes

tender shard
#

then you're doing sth wrong

sullen dome
#

yea, i wasn't checking if theyre null

tender shard
#

A uuid itself ist just a string represantion of 2 "long"s

sullen dome
#

i didnt knew that uuids of joined players can be null

tender shard
#

hm they can't

sullen dome
#

well they do. when bots with null uuids join

#

which happens quite frequently for some reason

tender shard
#

you mean from Citizens?

sullen dome
#

no

#

like spam accounts

#

from idiots with too much time

#

console literally also says "uuid=null"

tender shard
#

oh that's what you mean, like in AsyncPlayerPreLoginEvent

#

yeah but that's not the fault of java's UUID but rather mojang allowing such weird stuff ๐Ÿ˜„

sullen dome
#

mojang is shit as well

tender shard
#

anyway, changing the varchar length from 32 to 36 should work fine :3

#

that is true

sullen dome
#

imagine getting bought from microsoft

tender shard
#

that's like the best that can happen to you

sullen dome
#

without those microsoft accounts i could without libraries login into my dev environment for my mods

hybrid spoke
sullen dome
#

now, i need libraries because i'm a lazy ass and i dont want to create a new one for this shitty new login system

tender shard
#

anyway, I'll continue improving my custom string encryption, have a nice day everyone :3

sullen dome
#

also javafx doesn't work for whatever reason, so i need to fucking have my login details in a config file

#

which makes me feel bad

#

also

[11:02:38 WARN]: Nag author(s): '[Cxlina]' of 'Survival' about their usage of System.out/err.print. Please use your plugin's logger instead (JavaPlugin#getLogger).```
this is fucking annoying when you just want to debug some shit
tender shard
#

just ignore it if it's only for debugging

#

I always just let allatori remove all sout's from my final .jar

#

or I add a public static debug() method that checks a System.getProperty before using sout

sullen dome
#

i would never use MainClass.getInstance().getLogger().info(some shit); to fucking debug something

#

i just use sout in intellij, and bum

lean gull
#

how do i use custom fonts in bossbars?

tender shard
#

that way people can also enable debug mode themselves and you don't have to worry about forgetting sout's before releasing a jar

blissful gyro
#

Hey guys ! Do you know a plugin that can simulate a player connection, with fake players, to test if my server handles well a large number of players ?

blissful gyro
#

Thanks

sullen dome
#

that intellij has

#

which is fucking nice

lean gull
#

resource pack

#

no it's a custom font

#

why does it have to be so hard, it's so easy in commands ):

#

can i do it with protocollib?

solid jungle
#
package samplepluginspigot.samplepluginspigot;

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;


public final class SamplePluginSpigot extends JavaPlugin {

    @Override
    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        if (sender instanceof Player) {

            Player player = (Player) sender;

            if(command.getName().equalsIgnoreCase("hello")){
                player.sendMessage("Hello There");
            }

        }

        return false;
    }

}

I tried to test my plugin on my server and it enabled but it kept on returning unknown command and didnt work

#
name: SamplePluginSpigot
version: '${project.version}'
main: samplepluginspigot.samplepluginspigot.SamplePluginSpigot
```this is my plugin.yaml
#

Hm?

#

so i should override onEnable instead of onCommand? is there anything else to fix in order to make it work?

hybrid spoke
#

there is

solid jungle
#

Im confused because someone is telling me theres no method and then someone is saying there is

#

Lmao

hybrid spoke
golden kelp
#

Hey does anyone have a link to the picture that shows Inventory indexes, I got a small inventory (1 row 9 columns) and I want to add items into some slots

golden kelp
buoyant viper
#

ezpz map it out urself

hybrid spoke
golden kelp
#

it requires slot?

hybrid spoke
#

3*4 = the 5. slot in the 4. row

#

wait

sullen dome
#

-1

hybrid spoke
#

3*9+4

sullen dome
#

ig

#

true

golden kelp
#

Ohh so the slots are just called like

* * * * * * * * * (9 slots)
0 1 2 3 4 5 6 7 8

This?

tender shard
#

yes

golden kelp
#

i thought it was something real weird cause the inventory one looked like that too, my bad

#

thank you guys

solid jungle
#

Wait What?

tender shard
#
0   1  2  3  4  5  6  7  8
9  10 11 12 13 14 15 16 17
18 19 20 21 22 23 24 25 26
etc
golden kelp
#

Aight, thanks

solid jungle
#

Ah thank you

sullen dome
tender shard
#

no

sullen dome
#

tf

tender shard
#

well it's like text

#

you start in the upper right corner

#

erm

#

upper left corner

#

then it goes to the right

#

until the next line starts

sullen dome
#

uhh

tender shard
#

just imagine a wikipedia article ๐Ÿ˜„

#

left -> right, and then
top -> bottom

sullen dome
#

i always used slot 13-15 for below the crafting field

tender shard
#

well if you're using raw slots, it's a bit different

sullen dome
#

ah nvm it also counts the crafting armor etc slots

#

my bad

tender shard
#

this for example is the "raw slot" of the player inventory view

tender shard
#

this are the "proper" slots for a CraftingInventory

sullen dome
#

what a long link

#

i'm confused

tender shard
#

okay so let me try to explain

#

an InventoryView consists of two inventories

sullen dome
#

yea the top and bottom afaik

tender shard
#

imagine you have a top inventory (double chest)
and a bottom inventory (the player inventory)
a double chest has 54 slots, counting from 0 (upper left) to 53 (lower right)

#

If you refer to the "raw slot", the first slot in the player inventory is now 54

sullen dome
#

i never counted slots from inventoryviews, rather from the inventories directly

#

idk

tender shard
#

in the normal "CRAFTINGInventory" (which basically is the player inv + the armor slots, crafting table, etc), the first slot of the player inv isn't 54 but actually 9 (because the hotbar already goes from 0 to 8)

solid jungle
#
package samplepluginspigot.samplepluginspigot;

import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;


public final class SamplePluginSpigot extends JavaPlugin {

    @Override
    public void onEnable() {

        getCommand("hello").setExecutor(this);

    }

    public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

        if (sender instanceof Player) {

            Player player = (Player) sender;

            if(command.getName().equalsIgnoreCase("hello")){
                player.sendMessage("Hello There");
            }

        }

        return false;
    }

}
```would this be okay now?
tender shard
#

I think this is a good example:

#

slot 3 of the inventoryview is the same as slot 9 of the bottom inv

#

slot 30 of the view is the same as slot 0 of the bottom inv

sullen dome
#

imo counting from the bottom would make more sense
so the "inventory" slots (which are basically always present) are always the same

tender shard
#

it's a bit random, that's true

solid jungle
#

๐Ÿ‘ Thank you for all the help

sullen dome
#

and then if a chest is present as well, just start from the last inventory slot

tender shard
#

imho the "raw slot" thing shouldn't exist at all

#

but well, that's the way it is and it will never change

hybrid spoke
#

the slot thing in general could've been easier

tender shard
#

the InventoryClickEvent in general sucks eggs

#

e.g. if I press Q to drop an item from my hotbar, how is that a CLICK event?

hybrid spoke
#

keypress

#

1-9

sullen dome
#

was it the PlayerDeathEvent which has getEntity instead of getPlayer? this sucks ass

hybrid spoke
sullen dome
#

-_- wow

#

its so annoying to me

#

or the getWhoClicked like WTF

hybrid spoke
#

lol yeah and why is it a HumanEntity

sullen dome
#

EXACTLY

tender shard
#

getWhoClicked is to allow plugins like Citizens to create proper NPCs

#

however Citizens is stupid and extends Player instead

#

"implements" I meant

#

they should implement HumanEntity instead of Player

#

because NPCs are NON-PLAYER characters... yet they implement Player, that's so stupid

sullen dome
#

so it currently dont even has a real reason?

tender shard
#

well it does have

#

Citizens could implement HumanEntity instead of implement Player

#

it's Citizen's fault that they don't do it

sullen dome
#

-_-

#

i hate minecraft as a whole

#

and everything that has something to do with it

hybrid spoke
#

hytale hype

sullen dome
#

i'm literally so un-hyped for the 1.19

#

i literally don't care a single bit

#

that update has no reason for me to update my game/server

golden turret
#

one of the reasons behind why some people stil use 1.8

glossy venture
#

1.19 isnt super exciting but 1.18 damn that was epic

#

also the sculk sensor is a pretty cool mechanic in my opinion

noble lantern
glossy venture
#

just play modded minecraft

golden turret
#

legends say that hytale is releasing since 1500

glossy venture
#

they started like 500 million years ago

golden turret
#

yes

#

some devs says that they remember when the meteor killed the dinosaurs

sullen dome
#

i rant about the 1.19 because it has no feature that i think is useful

#

the warden for example has no reason to go kill it

noble lantern
#

People who use 1.8 just want to purposly make devs jobs harder

sullen dome
#

true

noble lantern
#

thats the only reason they exist

sullen dome
#

imo spigot should completely trash the pre-1.12 builds

#

alltho probably all those kids would completely cancel everyone involved in that step lol

noble lantern
#

"But waaaah my 1.8 pvp"

#

And yeah probably

sullen dome
#

i love when the people dont know you can disable cooldown by commands

#

always funny to see them

noble lantern
#

i just choose not to support anything that cant use jre 16 natively without modifications

noble lantern
#

didnt know that

sullen dome
dire marsh
#

the only thing you can complain about is not having block hitting

#

everything else can be reimplemented

noble lantern
#

block hitting is so stupid

#

only something sweaty 13 year olds use while using auto clickers to click 30 cps

sullen dome
#

/attribute <EntityName> minecraft:generic.attack_speed base set 30.0

#

there you go

#

no cooldown for all your weapons

noble lantern
#

i dont think that command exists in 1.9-1.12, i might be wrong

dire marsh
sullen dome
#

uhh

#

i dont think so

#

i think 4 is actually no cooldown

#

idk

#

nvm

#

24*

#

is the effective value for no cooldown

#

afaik knockback can also be tweaked

#

players apparently dont have that attribute tho? huh

dire marsh
#

I made a server fork to make knockback 1.8 again

sullen dome
#

thats also an option

dire marsh
sullen dome
#

ah

#

so zombies etc?

glossy venture
#

sucks that bukkit doesnt allow for mixins

#

no need to create an entire fork

#

or at least asm

dire marsh
#

it has ravager hoglin and zoglin specified

#

/attribute was 1.16

sullen dome
#

dud

#

why would you play pre-1.16

#

no reason for that

noble lantern
#

chicken

sullen dome
#

wtf

#

ah sql servercrashes
gotta love it

noble lantern
#

and thats why mongodbs better

sullen dome
#

lol

#

nah was just hanging the server for obvious reasons

tall dragon
#

is it possible to detect while a player is breaking a block

#

i want to give a player mining fatigue while he is breaking a specific block

#

but if he stops it should be removed again

sullen dome
#

PlayerInteractEvent maybe?

#

idk

tall dragon
#

pretty thats only fires once when you start breaking the block

sullen dome
#

yea

#

there you give mining fatigue

tall dragon
#

and how do i know if the player stopped

sullen dome
#

which eventually won't even work on instabreak blocks tho

noble lantern
#

youd need packets

sullen dome
#

packets -_-
i gonna hang up

#

byebye

noble lantern
#

its dah only way

tall dragon
#

ughhhhhh

#

i thought blockdamageevent would fire every time the block changes damage state

#

but it doesnt

sullen dome
#

i meaaaaaan

#

oh

#

when does it get called

tall dragon
#

same as interact bassically

#

when you first damage it

sullen dome
#

i see

#

there you go

#

give fatigue on damageevent, and remove it on damageabortevent

#

i guess

tall dragon
#

cries in using 1.8

sullen dome
#

well

#

in that case

noble lantern
sullen dome
#

you won't get support in here anyway

noble lantern
#

to updoot

tall dragon
#

i should

#

xd

sullen dome
#

1.8 is old ass

#

no one will help you in here, except theyre using 1.8 as well

#

and i dont evne know if staff likes that

noble lantern
#

1.8 users when they cant use theyre auto clickers on 1.9

sullen dome
#

ahahaha

#

MY MAN

#

you have no idea how much people hate on me for my 1.8 opinions lol

noble lantern
#

I cant stand anything 1.8-1.13/1.14, i don't get why people don't use update

sullen dome
#

same

golden turret
#

1.8 users when they need to use their brain for pvp

sullen dome
#

i love when people tell me 1.9+ is just shield-spam

#

alltho it literally isn't KEKW

noble lantern
carmine mica
#

Is there like an onCreeperExplode event I can use to modify things that are happening upon creeper explosion?

sullen dome
#

when i tell em you can use axes

sullen dome
#

they are like CoOlDoWn

glossy venture
#

1.9 pvp is epic

sullen dome
#

^

sullen dome
#

alltho i have to say

#

the old totem

#

looks TRASH

glossy venture
#

yeah

sullen dome
#

change my mind

echo saddle
earnest forum
#

Pre 1.13 netherrack was the best texture

sullen dome
#

FALSE

earnest forum
#

True

sullen dome
#

i completely disagree

steel swan
sullen dome
#

with all my power

earnest forum
#

which is none

sullen dome
#

the old textures are ass

golden turret
#

flase

noble lantern
#

FUCK

echo saddle
#

what? granite will and forever be my favorite texture.

sullen dome
#

FUCK

#

YOU WERE FASTER

#

DUCK YOU

noble lantern
#

idk why it failed to embed thats some bs

earnest forum
#

Nah but the old netherrack definitely made the nether feel more netherry to me than the new one

glossy venture
#

lololol

golden turret
#

STOP SENDING GIFS

sullen dome
#

the old nether was ass

glossy venture
#

true

golden turret
#

IT IS WATING MY INTERNET

#

thanks

earnest forum
#

The new texture is better

glossy venture
#

old netherrack is fucking horrible

sullen dome
#

^

noble lantern
#

me wasting your internet like

earnest forum
#

But the coarseness of the old netherrack felt more hellish

steel swan
sullen dome
#

my internet be like gbit -_-

#

me having no idea what people talk about

noble lantern
#

all older textures are doggy but theyre good for memories

earnest forum
#

Yea

#

Except the emerald block

golden turret
#

old netherrack is like a red pixel gradient spam

earnest forum
#

What the fuck is the new emerald block

#

They're trying to hypnotise me

noble lantern
glossy venture
golden turret
#

ccp

glossy venture
#

internal shaders epok

golden turret
#

ััั€

#

ัััั€

steel swan
glossy venture
#

c++ epic

echo saddle
#

C plu plu??

golden turret
#

ัััั€

steel swan
sullen dome
#

i get a headache

#

that looks awful

steel swan
sullen dome
#

didnt even know it looks that bad

echo saddle
#

really, loaded up a client and went to the nether for that screenshot?

sullen dome
#

i have my client open anyway

echo saddle
#

could have at least got a piglin selfie!

sullen dome
#

and my server as well

golden turret
#

piglin chan

noble lantern
#

its simply the truth

sullen dome
#

true

echo saddle
#

what is this world.dat coming to

sullen dome
#

alltho aternos is worse

noble lantern
#

skynode and sparked on top

golden turret
#

content://com.android.chrome.FileProvider/images/screenshot/16511449649303049870528196045836.jpg

#

btuh

sullen dome
#

uff

#

completely wrecked

sullen dome
#

no

#

please no

#

he doesn't even deserve that fail gif

echo saddle
#

wait, i need enderios

tall dragon
#

i did manage to do my problem from yesterday with vectors by the way. @noble lantern it ended up being quite easy actually

sullen dome
#

honestly, i have no idea what discord needs to make smt embed

echo saddle
#

wait, is this not #general

#

oof.

noble lantern
tall dragon
#

ah yea

#

fair

echo saddle
#

ok, nvm, lemme act all professional like

golden turret
tall dragon
#

this is all it took if ur interested.

private Location getDoorEndpoint(Player player, Location door) {
        Vector blockL = door.getBlock().getLocation().add(0.5, 0, 0.5).toVector();
        Vector playerL = player.getLocation().toVector();
        blockL.setY(playerL.getBlockY());

        Vector DV = blockL.subtract(playerL);
        double multiple = 1 + (STEP / DV.length());
        return playerL.add(DV.multiply(multiple)).toLocation(door.getWorld());
    }
echo saddle
#

yas, someone thru up some code.!!!

sullen dome
echo saddle
#

but this is the code channel

sullen dome
#

i hate it

echo saddle
#

we have to talk about code related stuff

noble lantern
#

godsend code

echo saddle
#

stuffs

#

like abstraction.

#

or obfuscation.

sullen dome
golden turret
echo saddle
#

or worse, lets have a nice chat about ecapsulation.

sullen dome
#

alltho i dont think i want that

echo saddle
#

3 words = channel ded.

sullen dome
#

nah

noble lantern
#

this channel never dies

sullen dome
#

more like what i think about specific coding languages

noble lantern
#

unless i leave

#

jk

echo saddle
#

promiscuous pointers?

noble lantern
#

dangling pointers

echo saddle
#

better than dangling pointers?

#

shall we poll?

#

oh and dare I say, shall we talk about tabs vs. spaces??????

noble lantern
#

wait

#

wtf we talking about

echo saddle
#

3 spaces is best.

noble lantern
#

no

#

no

#

no

#

fuck out of here

golden turret
#

_ _

sullen dome
#

what has this server become... ffs

echo saddle
#

yas, this thread will live.

noble lantern
noble lantern
#

welcome back

golden turret
sullen dome
#

true

#

i wonder where my last active time was on here

echo saddle
#

wait, there is something called a em-space.

#

i think it's like a half space

golden turret
#

_ _

noble lantern
golden turret
#

_ _

noble lantern
#

angy

echo saddle
#

could we have half spaces vs tabs?

golden turret
echo saddle
#

because hariy mains are dope.

sullen dome
#

few months ago

#

lol

#

i have too much time

echo saddle
#

well becuase of the main loop

#

it was thought at the time, that there was a main proccessing loop

noble lantern
#

unlimited time

echo saddle
#

and everything else was, well not so main, but secondary

#

wait, y goes to infinity.

#

your chart is incorrect

steel swan
#

hey, so i have this code to create an inventory :

public Inventory coldInv;

    public void createcoldInv() {
        coldInv = Bukkit.createInventory(null, 27, BOLD + "" + RED + "Printer");

        ItemStack item = new ItemStack(BLACK_STAINED_GLASS_PANE);
        ItemMeta meta = item.getItemMeta();
        meta.setDisplayName(" ");

        for (int a = 0; a < 10; a = a + 1) {
            item.setItemMeta(meta);
            coldInv.setItem(a, item);
        }

        for (int a = 18; a < 27; a = a + 1) {
            item.setItemMeta(meta);
            coldInv.setItem(a, item);
        }

        item.setItemMeta(meta);
        coldInv.setItem(9, item);

        item.setItemMeta(meta);
        coldInv.setItem(17, item);

        item.setType(PEONY);
        meta.setDisplayName(GREEN + "Rรฉcupรฉrer");
        item.setItemMeta(meta);
        coldInv.setItem(11, item);

        item.setType(CHAIN);
        meta.setDisplayName(GREEN + "Refroidir");
        item.setItemMeta(meta);
        coldInv.setItem(13, item);

        item.setType(WARPED_SIGN);
        meta.setDisplayName(GREEN + "Argent");
        item.setItemMeta(meta);
        coldInv.setItem(15, item);
    }
```before u guys ask, yes i put createcoldInv ine onenable
and i call it by doing :
```java
 if (command.getName().equalsIgnoreCase("mรฉtier")) {
            String argumentOne = args[0];
            if (args.length > 1) {
                if (StaffList.contains(playerSender.getDisplayName())) {
                    if (Objects.equals(args[1], "test")) {

                        ItemStack item = coldInv.getItem(15).clone();
                        ItemMeta meta = item.getItemMeta();
                        meta.setDisplayName("test");
                        coldInv.setItem(15, item);
                        playerSender.openInventory(coldInv);
                        playerSender.updateInventory();
                    }
//and then some other objects, command and other things
echo saddle
#

please demonstrate y = โˆž in your graph

steel swan
echo saddle
#

too few indents

tall dragon
noble lantern
#

BurchAPI's inventory api is very poggers

tall dragon
#

let me guess

#

its made by a certain you?

golden turret
tall dragon
#

๐Ÿ˜„

noble lantern
#

but its not dogshit

tall dragon
#

show

#

me

golden turret
#

WLib better

noble lantern
#

docs ^

sullen dome
golden turret
#

i dont think so

tall dragon
#

yea looks like a pretty solid inventory api

noble lantern
#

its a inventory

#

you listen for click close and open

echo saddle
#

If anyone can help me for this..

#

Does P = NP?

noble lantern
golden turret
noble lantern
noble lantern
quiet ice
#

Yes

golden turret
tall dragon
quiet ice
#

At least with Bukkit that id

echo saddle
#

can someone help me with a coding problem?

noble lantern
echo saddle
#

it's not working

noble lantern
#

Is it cause i said poggers :((

#

well, the api is fast

#

speedy boi

echo saddle
#

did you know that you can have two inventories linked

tall dragon
#

?paste

undone axleBOT
tall dragon
#

for me?

noble lantern
#

i didnt do that, i just made a functional interfaces for the specified inventory events

tall dragon
#

yes indeed

tall dragon
#

ya got a problem with mah naming!?

noble lantern
#

im gonna add animated frames into my api here soon

echo saddle
#

it's not camelCase

golden turret
#

my inventory

echo saddle
#

bump

tall dragon
#

@noble lantern does yours support title animation tho ๐Ÿ˜„

echo saddle
#

into the binary shredder you go...

#

/dev/null

sullen dome
#

guys
player names can't contain - right?

noble lantern
golden turret
sullen dome
#

aight

noble lantern
sullen dome
#

thats helpful

noble lantern
#

reltively simple tbh

tall dragon
#

well i have never tried actually playing a full on animation. but i can for example show a message to the player

#

then revert back to the old title

noble lantern
#

but your closing and re-opening that inventory i assume

#

to change that name?

tall dragon
#

no

noble lantern
#

oh you just got interfaces for it all huh zack

tall dragon
#

i use packets

noble lantern
#

ahh

#

vanilla * you cant change inventory names it what i meant

tall dragon
#

well depending on the mc version i use packets or nms

noble lantern
#

annotations + functional interfaces for me

#

ie vanilla bukkit/spigot code

hybrid spoke
#

i mean

#

everything you see "was" once a packet

noble lantern
#

indeed it is

hybrid spoke
#

ew

noble lantern
#

i wanted to do that but didnt really see a reason for it

tall dragon
noble lantern
#

epic god pr that inventory name fix

golden turret
#

maybe it is just the window packet

lavish hemlock
#

I've used the open window packet before

tall dragon
#

this is how that looks btw

lavish hemlock
#

It does change the title but there's a bit of a client-side issue where the contents of the window won't be visible/update until the player clicks on a slot :p

golden turret
#

you could used

#

window property i guess

#

something called property

tall dragon
#

@quaint mantle i use PacketPlayOutOpenWindow

lavish hemlock
#

Window property doesn't apply to the title

golden turret
#

i was talking with @quaint mantle

lavish hemlock
#

What I did for an animated title was just reconstruct an inventory with matching contents but a different title, then close the old inventory and open a new one

#

There was no flickering or anything, but I don't know

#

It's slightly hacky

tardy delta
#

maow what happened to your pfp

lavish hemlock
#

Changed it

#

Oh wait

#

Changed

#

Haha funny

golden turret
#

i heard that same inventory holders dont make it flick

lavish hemlock
#

Inventory holders probably have no actual importance

tall dragon
#

@quaint mantle i could even send you my method that does it. but its slightly big and uses a lot of stuff from my library

#

u woulnt be able to use half of it

golden turret
lost matrix
# tall dragon any specific reasons?

Several. One is higher flexibility, another one is that inheritance breaks strong encapsulation.
You can read about it in books like "Design Patterns: Elements of Reusable Object-Oriented Software"

tall dragon
#

๐Ÿ‘

tall dragon
echo saddle
#

events

golden turret
#

for some annotations there, i would use only 1 annotation with more parameters

tall dragon
#

the message one prolly

#

just have a Message Annotation

echo saddle
#

!paste

undone axleBOT
golden turret
#

Command:
permission, defaultPermission, permissionMessage, cooldown

#

something like this

echo saddle
#

?spacex

hybrid spoke
golden turret
#

imagine having to use a lot of annotations

noble lantern
#

imagine not using functional interfaces + annotations

#

smh

#

angry

echo saddle
#

ah, thx, GodCipher

lavish hemlock
#

What are the signatures for those interfaces

echo saddle
#

nice to know it's still there

midnight shore
#

Are there any libs that give plenty of annotations interfaces and enums?

tall dragon
midnight shore
#

Ty!

noble lantern
#

oo the plug

#

i am gonna expand that inventory api some tho i needs more features

tall dragon
#

of course. i gladly plug ur stuff ๐Ÿ˜„

glossy venture
noble lantern
#

code warning go brrrt

golden turret
#

a

noble lantern
#

jesus

#

i couldnt find the kek

glossy venture
#

nah its because i needed to init the engine and intellij is like "engine is null will make npe help me"

#

lmfao

noble lantern
#

why does your code look HD asf

#

4k resolution text font

glossy venture
#

font

tall dragon
#

he zoomed in

#

using intellij

glossy venture
#

fira code 16

glossy venture
#

but its like 17

#

px

noble lantern
#

OHHH

#

intellij zooming

tall dragon
#

for example

glossy venture
#

that was just a screenshot

noble lantern
#

so im just blind with smaller font

glossy venture
#

using windows sketch or whatever

noble lantern
#

yeah but the actual ide looks exactly like i so i was curious

glossy venture
#

your ide bg

tall dragon
#

yea its very popular

glossy venture
#

like hte first google result when you search "wallpaper"

#

yeah

tall dragon
#

i like it, it does not distract

#

its pretty

glossy venture
#

oh ye i quite like it

#

matches up with my theme

tall dragon
#

yh

lavish hemlock
#

I just don't use an IDE wallpaper

#

Maybe I should

glossy venture
#

i did too

lavish hemlock
#

My brain: "Protogen go brr"

glossy venture
#

until i did this

#

i like it

lavish hemlock
#

I have an obsession

#

save me

grand perch
#

whats the pom thing for vault

lavish hemlock
#

Do you mean the artifact?

grand perch
#

yea

lavish hemlock
grand perch
#

is 1.7 for 1.17

lavish hemlock
#

I believe Vault is version-agnostic

grand perch
#

what that mean

lavish hemlock
#

?google

undone axleBOT
grand perch
#

always forgot that existed

lavish hemlock
#

Google the word "agnostic"

#

Oh wait

echo saddle
#

Google the word "satan"

lavish hemlock
#

The definition on Google is shit

#

One sec

hybrid spoke
lavish hemlock
#

version-agnostic means it works across most versions

glossy venture
#

i just uploaded it from my pc

grand perch
#

somehow we have the same wallpaper

lavish hemlock
#

It's probably really common

glossy venture
#

everyone has it

#

lmao

glossy venture
lavish hemlock
#

Here's my desktop

glossy venture
#

at least for intellih

glossy venture
#

sick

#

HD ascii art

lavish hemlock
#

Home screen

#

That screenshot is like, 13 hours old

#

And actually one sec I'll send my laptop's desktop too

lavish hemlock
#

Old screenshot but yeah, 0 customization here.

next fossil
#

I'm having an error with the newest version for my NMS

#

It all broke from 1.18 to 1.18.2

#

I ran buildtools and restarted even

pastel juniper
#

I want to make a plugin that checks for custom items, but not checking for the name or lore. I tried Persistent Data Container but didn't worked....

crimson terrace
#

its important to have the plugin instance which created that NamespacedKey, as it wont be the same otherwise

maiden briar
#
public static String getArenaServer()
    {
        return instance.getConfig().getString("plugin.server");
    }

    public static SimpleLocale getLocale()
    {
        return instance.locale;
    }

    public static Database getMySqlDatabase()
    {
        return instance.database;
    }

    public static ClassManager getClassManager()
    {
        return instance.classManager;
    }

    public static PlayerManager getPlayerManager()
    {
        return instance.playerManager;
    }

    public static TeamManager getTeamManager()
    {
        return instance.teamManager;
    }

Guys, I have various classes extending a custom database class made by me. I don't want to have a getInstance() method in all of these singleton classes (because static). But to get them from the main class.... What do you think is the best way?

echo basalt
#

oh god the static abuse

maiden briar
echo basalt
#

maybe just call getInstance every time you need it?

maiden briar
#

Ok so you are for a getInstance() in every class?

echo basalt
#

no

#

I am for calling your plugin's getInstance method

#

or tbh just avoid it all and stick to dependency injection

maiden briar
echo basalt
#

?di

undone axleBOT
grand perch
#

i cant find a way to do this
i want to make a shop config where you can use this format to set blocks and items

shop:
  Blocks:
    Grass:
      item: Grass_Block
      price:
        buy: 10
        sell: 5
    Dirt:
      item: Dirt_Block
      price:
        buy: 5
        sell: 2

i wanted to get all items in the blocks category and put it in the inventory

echo basalt
#

get the shop section

#

each key on it will be an item or something

#

then that item's section can just be parsed

grand perch
#

i dont understand

echo basalt
#
ConfigurationSection shopSection = config.getConfigurationSection("shop");

for(String category : shopSection.getKeys(false)) {
  ConfigurationSection categorySection = shopSection.getConfigurationSection(category);

  ...
}
grand perch
#

ok

#

what does getkeys does

hybrid spoke
#

get the keys

carmine mica
#

I want the creeper to not destroy blocks when exploding, is there anything else I have to do?

carmine mica
#

i did

grand perch
carmine mica
#

also I know this one

carmine mica
hybrid spoke
#

so obv you have to do something else

carmine mica
#

that's why I'm here

lapis widget
#

!doesnotworking

grand perch
#

what is even a key

hybrid spoke
#

?notworking

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.

hybrid spoke
echo basalt
#

event.blockList().clear

grand perch
#

huh

#

java and javascript are very diffrent thats why i dont understand anything

hybrid spoke
#

like a hashmap

#

the "identifier"

#

just not an identifier

grand perch
#

tf is hasmap ;-;

carmine mica
hybrid spoke
grand perch
echo basalt
grand perch
#

() -> {} <= is lamda
() => {} <= Arrow Function

#

they dont look very diffrent

hybrid spoke
#

a hashmap is the root of performance

grand perch
#

yet they are 2 diffrent things

tender shard
#

despite a syntax error

grand perch
tender shard
#

oh you're talking about js

grand perch
#

yea

#

i got confused for 3 straight hours

#

why () => {} isnt working

lavish hemlock
#

They're basically the same thing :p

grim ice
#

most admins dont know spigot enums

ember estuary
#

I was trying to do a performance test, but I noticed, that this code

    public static void main(String[] args) {
        Random random = new Random();
        int[] data = new int[100_000];
        for(int i = 0; i < 100_000; i++) {
            data[i] = random.nextInt();
        }

        long startTime = System.nanoTime();
        //Measure Time between these two lines of code
        long endTime = System.nanoTime();
        long duration = (endTime - startTime);
        System.out.println("Took " + duration + " ns");
    }

Takes 2000 to 3000 ns
But when i remove the array creation:

    public static void main(String[] args) {
        long startTime = System.nanoTime();
        //Measure Time between these two lines of code
        long endTime = System.nanoTime();
        long duration = (endTime - startTime);
        System.out.println("Took " + duration + " ns");
    }

It only takes 100 to 200 ns

#

Does anyone know why?

grand perch
grim ice
#

nah

#

thats not how to benchmark

grim ice
undone axleBOT
ember estuary
#

then how do i, without setting up some super complicated software

grim ice
#

Use a benchmarking library

ember estuary
#

ugh

#

no way to do it with vanilla java

#

?

grim ice
#

no

ember estuary
#

that sucks