#help-development

1 messages ยท Page 1747 of 1

golden turret
#

i have a list of itemstacks

crimson terrace
#

event.setCancelled(true)

golden turret
#

and convert them to 1 item

#

example:

rancid pine
golden turret
#

stone, stone, dirt, stone, grass -> stone, stone, stone -> 1 stone with 3 as amount

crimson terrace
#

just iterate over all the slots and count how many you have. (not sure if theres a stack() method you could use)

#

Do you know your way around Java?

#

then Id get started with that

quaint mantle
#

lol

undone axleBOT
crimson terrace
#

?learnjava

#

np

twilit wharf
#

Hi, I am trying to send a open sign editor packet, but on the wiki, it says it needs a position/location information, but I cant find a method for that on the PacketContainer class. (here is what I am looking at: https://wiki.vg/Protocol#Open_Sign_Editor)

eternal night
#

no

#

I can't think of a single often used packet that would realistically be worth caching its instance

plucky crow
#

How do I enchant items?
item.addEnchantment(Enchantment.DURABILITY, 2);
not working.

ornate spire
#

you need to add the enchantment to the meta

#

not the item

plucky crow
#

The method addEnchantment(Enchantment, int) is undefined for the type ItemMeta

plucky crow
#

can u give me sample code?

quaint mantle
#

no

#

you can read the javadoc

#

its fucking simple

#

i literally pointed you to the method you need to use

quaint mantle
twilit wharf
#

ye

quaint mantle
#

well there ya go

twilit wharf
#

I tried that

quaint mantle
#

and?

twilit wharf
#

It doesnt work on 1.17

quaint mantle
#

hmm, i see comments saying it does. maybe some changes need to be made im not sure i havent tried it yet

lost matrix
#

Not sure if something like this is actually implemented right now. Its kind of a trade off between memory and cpu time because those packets arent exactly small.

eternal night
#

Eh, I guess tracking that might work ? However the amount of work you'd have to put into invalidating those caches seems like a pretty big rip

#

neither invalidate on change nor invalidate every send (calc some hash ? dunno) works out well

#

e.g. even tile entities ticking might just break your caching if they update their nbt

#

just a lot of crap sadly sent in a single huge packet that might explode any other second

nova sparrow
#

How do you check if a block has been broken with spigot?

eternal night
#

broken ? e.g. listen to a block breaking ?

nova sparrow
#

What methods would that require

eternal night
#

idk if that is what you are asking tho

nova sparrow
#

I know about BlockBreakEvent

#

What would I do with BlockBreakEvent to tell if a specific block is being broken

quaint mantle
#

Use .getBlock() on the event object

#

That returns a Block

nova sparrow
#

ok thanks

quaint mantle
#

Make a variable for each

#

Loop trough the List

ornate spire
golden turret
#

no

noble spire
#

Is there a better way of getting a player from a command other than?

Bukkit.getPlayer(sender.getName());
golden turret
#

no

noble spire
#

thought so

golden turret
#

actually yes

noble spire
#

hmm?

ancient plank
#

instanceof Player

#

Then cast

quaint mantle
#

Increment the corresponding variable if it is the specific item

#

Cast the sender to Player if it is an instance of Player

noble spire
#

I didn't know that

ancient plank
#
if(!(sender instanceof Player)) {
  // code if sender isn't player
}
Player player = (Player) sender;
noble spire
#

yeahh thanks

ancient plank
#

tho

quaint mantle
#

You can simplify it

ancient plank
#

in more recent versions of java you can do
if (sender instanceof Player player)

quaint mantle
#

Yeah

opal juniper
#

or

if (sender instanceof Player player) {
   player.sendMessage("Hello")
}
noble spire
#

I know java - thanks

opal juniper
#

yeah

noble spire
vestal moat
#

The error is while loading this line is never reached

#

Uhh huh

quaint mantle
#

@vestal moat please use a traditional paste bin

#

lucy's is fine, but dont have it run through a custom link

vestal moat
#

Huh

quaint mantle
#

?paste

undone axleBOT
vestal moat
#

Its lucy's but i improved

lost matrix
# golden turret stone, stone, dirt, stone, grass -> stone, stone, stone -> 1 stone with 3 as amo...

Algorithm wise this is not great. It also may contain bugs. But you get the general idea:

  public void rePack(final List<ItemStack> itemStackList) {
    final List<ItemStack> items = new ArrayList<>(itemStackList);
    itemStackList.clear();
    outer:
    for (final ItemStack next : items) {
      for (final ItemStack current : itemStackList) {
        if (current.isSimilar(next)) {
          final int currentAmount = current.getAmount();
          final int nextAmount = next.getAmount();
          final int combined = currentAmount + nextAmount;
          if (combined < current.getMaxStackSize()) {
            current.setAmount(combined);
            continue outer;
          } else {
            current.setAmount(current.getMaxStackSize());
            next.setAmount(combined - current.getMaxStackSize());
          }
        }
      }
      itemStackList.add(next);
    }
  }
golden turret
#

yes

#

i did it

vestal moat
#

Also i don't have the error now im not on oc anymore wtf

golden turret
#
   private static List<ItemStack> sumEquals(Collection<ItemStack> items) {
        List<ItemStack> result = new ArrayList<>(items.size());

        for (ItemStack item : items) {
            if (item == null)
                continue;
            boolean has = false;
            for (ItemStack stack : result) {
                if (stack.isSimilar(item)) {
                    stack.setAmount(stack.getAmount() + item.getAmount());
                    has = true;
                }
            }
            if (!has)
                result.add(item);
        }

        return result;
    }```
#

but thanks anyway

vestal moat
vestal moat
#

Ye now i wanna fix it

#

Dude hastebin so bad

#

Anyways i didn't import it

#

So how

#

Like logic

quaint mantle
#

its from discordsrv

golden turret
vestal moat
quaint mantle
#

do you have litebans installed

vestal moat
#

No

#

I removed it bc i dont own it

quaint mantle
#

do it

vestal moat
#

Had it for test purpose

quaint mantle
#

oh this is your plugin

vestal moat
#

Yes...

quaint mantle
#

is it still in your pom?

vestal moat
#

Litebans?

quaint mantle
#

yeah

vestal moat
#

I use gradle

quaint mantle
#

is it in your gradle?

vestal moat
#

Yes

quaint mantle
#

then remove it..

vestal moat
#

But its a feature...

#

It should not error if litebans not installed

quaint mantle
#

you're instantiating a class that imports it

vestal moat
#

Never called it

lost matrix
vestal moat
#

Never made new instance of it

#

See its on load

quaint mantle
#
java.lang.Class.forName(Class.java:398) ~[?:?]
#

are you doing forName somewhere?

golden turret
lost matrix
# golden turret that is not a problem in my case
    final List<ItemStack> items = new ArrayList<>();
    for (int i = 0; i < 200; i++) {
      items.add(new ItemStack(Material.STONE));
    }
    final List<ItemStack> post = sumEquals(items);
    System.out.println(Arrays.toString(post.toArray()));

Produces:

[22:38:51 INFO]: [SpigotSandbox] [STDOUT] [ItemStack{STONE x 200}]
vestal moat
#

Never called that for litebans

lost matrix
golden turret
#

because i need to show how many items he will need to craft something

quaint mantle
#

would be nice if java actually showed where the exception generated

vestal moat
#

(not on master)

#

import tk.bluetree242.discordsrvutils.listeners.punishments.litebans.LitebansPunishmentListener;

#

wait is this why?

#

interesting

#

nope still erroring

golden turret
#

what is the problem

vestal moat
golden turret
#

what you want to do

vestal moat
#

fix the error?

quaint mantle
#

๐Ÿคฆ๐Ÿฟโ€โ™‚๏ธ

golden turret
#

and why there is an error?

vestal moat
#

bruh look at it

quaint mantle
#

anyways @vestal moat i think because its being imported through the listener

lost matrix
quaint mantle
#

im not familiar with this, but try and use Class.forName

vestal moat
#

no i didn't

#

its compileOnly

lost matrix
#

Also this path looks incomplete litebans.api.Events$Listener

golden turret
#

or

#

you are calling a class that does not exists

quaint mantle
vestal moat
#

but people requested it so i do it for them

lost matrix
#

lul... Then make sure the version you are developing against is exactly the version you use on the server.

golden turret
#

i would use java try { //call listener here } catch (NoClassDefFoundError e) { System.out.println("litebans not found :D"); }

vestal moat
#

the error is while loading so there is no way i called it atm

vestal moat
golden turret
#

you referenced your listener somewhere

vestal moat
#

this is not reached

quaint mantle
#
Events.Listener litebanListener = (Events.Listener) Class.forName("tk.bluetree242.discordsrvutils.listeners.punishments.litebans.LitebansPunishmentListener").newInstance();
// ...
vestal moat
#

can this be causing the problem?

#

since it extends a class that doesn't exist

quaint mantle
golden turret
vestal moat
#

but i imported advancedban on the advancedban listener and no errors

golden turret
#

maybe because you have advancedban?

lost matrix
#

make sure the version you are developing against is exactly the version you use on the server.

vestal moat
#

i dont have any bans plugin atm

lost matrix
#

Look inside the litebans jar to see if there is even a package named litebans.api

vestal moat
#

bro i don't get errors if litebans is installed

#

but if its missing i get erorr

lost matrix
#

omg

lost matrix
#

Then dont load classes with imports that are not reachable at runtime.

vestal moat
#

litebans not installed, package correct or wrong does not matter

lost matrix
#

Just prevent initialization of the class that uses the litebans imports

golden turret
#

try catch

quaint mantle
golden turret
#

i use that in wlib

#

i do a lot of try catch

ancient plank
#

isn't litebans the one that has their api being "just execute the commands" or w/e?

quaint mantle
#

but people wont move on

ancient plank
#

lol

vestal moat
#

U need to use db by urself

#

Wtf

#

Maybe i shouldn't extend classes that doesn't exist?

golden turret
#

my dear

#

use

#

try

#

catch

quaint mantle
#

we gave you the fix

ancient plank
#

pls no spam.......

#

o ye I was making an implementation for that plugin, an admin wanted to check ban/warn history through a discord command and I just got tired becausew their api is non-existent

golden turret
#

o

#

k

quaint mantle
#

libertybans โค๏ธ

golden turret
#

bukkit /ban ๐Ÿ˜Ž

#

minecraft, actually

vestal moat
#

Free plugin better than paid plugin which is a rare case

quaint mantle
#

there's a lot of bad paid plugins though

golden turret
#

everything is good, we just dont know how to use them properly

vestal moat
vestal moat
golden turret
vestal moat
#

99.9% not going to work

quaint mantle
golden turret
#

THANKS

vestal moat
#

Bc i don't even interact with that class until litebans confirmed installed which is happen after discordsrv bot is online

#

This error occurs while loading

lost matrix
#

Then you are initializing the class somehow. Either by calling a static method in it or by constructing an instance.

vestal moat
#

Ok ig ill look for the last time

#

litebans/api/Events$Listener its bc of the extend, confirmed

#

finally got rid of the *** errors

dry forum
#

what would be the easiest approach to making something that can detect a button press on a HTML website? for example, i have a button on a html website (which i have hosted) then detect when its pressed then restart the server, i understand

ServerSocket socket = new ServerSocket(port);```
just dont know where to go from there
quaint mantle
#

read from the socket

#

if the bytes are equal to the password, restart

ivory sleet
lost matrix
#

For the website: Use JavaScript.
The mc server needs an open ServerSocket, the website needs a client socket (javascript impl)
Then the js simply sends some bytes to the open server socket

#

Depends. Do you write the ItemStack in your config with code or do you just define the Material?

#

You can convert a String to a Material using the static method Material.matchMaterial(String)

lost matrix
#

Get the lines as a List<String>, translate every line and set this translated list as the lore of the items ItemMeta.
Just dont forget to set the ItemMeta back on the ItemStack

quaint mantle
#

Hey, I made a minecraft spigot 1.16.5 server on my pi and don't know how to add plugins, can anyone help?

carmine nacelle
#

like...raspberry pi???!

proud basin
quaint mantle
proud basin
#

If you're planning to release this server to the public I really don't recommend using a raspi and switching to something else.

quaint mantle
#

It's already released and I have people playing on it currently

#

They want keep inventory enabled but I can't because it won't let me use commands and I don't know how

#

so I was just going to use a plugin for that

golden turret
#

how do you connected previously to the raspi?

quaint mantle
#

I don't understand

golden turret
#

how you added a server to the raspi previously

quaint mantle
proud basin
quaint mantle
#

Do I need that on my computer or on my pi?

proud basin
#

computer

quaint mantle
#

hmm

golden turret
#

basically the best to do is

#

use ssh of ftp to connect to your raspi

proud basin
#

root

quaint mantle
#

wdym root?

#

and what does filezilla do? like once i download it what can i do with it ?

proud basin
#

Filezilla allows you to connect through ftp and ftps

#

fill out the credentials it asks for

quaint mantle
#

oooh well i'm an idiot

#

all i had to do was not add a / in the console and all of the commands would work

#

thank you guys for the help though <3

last citrus
#

Does anyone know how to decrypt a texture pack?

#

I think the texture pack is for a server called PandaCraft. I dont remember

noble lantern
#

Sadly dont think anyone here would download that file and check it out for you

#

Not to mention decrypting something most means you need the encryption key(s)

quaint mantle
#

its loaded by minecraft so not like its actually encrypted

last citrus
#

Yeah

#

It wont let me open it though even when I set it to a zip

quaint mantle
#

They prob just break some byte that any proper zip reader needs

lean gull
#

config file manager

last citrus
#

ok

#

I tried built in windows zip, 7Zip, and Winrar

last citrus
#

How did you do it?

young knoll
#

You can extract them with Javaโ€™s zip methods

#

Same way minecraft does it

last citrus
#

Ok

#

Do you know what software?

young knoll
#

Write a java program

last citrus
#

Ok

glossy scroll
#

Thought of a system to allow commands to change fields in certain classes

#

i thought it would be cool to use annotations

#

would generally declutter things

#

but i ran into trouble when trying to define illegal values for the field

#

e.i. field is an integer but cannot be less than 0 or

#

field is of type X and X.Y cannot equal 4

#

so i thought using a predicate in my annotation class would be a smart idea

#

but i realized that predicates are not allowed in those

#

anyone have a suggestion for this kind of system?

#

(tl;dr want to allow commands to change fields in the plugin and define illegal values)

#

i thought of another way to do it without annotations but i dont like it as much..

unreal quartz
#

hot

quaint mantle
#

interact event?

drowsy helm
#

repeating task check if they are in distance

#

you have an npe can we see code

quasi stratus
#

This is a bit of an odd question and I am a bit new to plugins, so forgive me if I need to explain a bit more (just let me know and I can ๐Ÿ˜ )

   @EventHandler
   public void onQuit(PlayerQuitEvent event) {

       FirmamentPlugin.worldBorder.refresh(false, false, event);

   }```
I have the  event above listening for players leaving, and then refreshing a list of online players. However, it appears as if the event occurs before the player is actually considered offline, so the player is still added to the list.
#
        Collection<? extends Player> playerList = Bukkit.getServer().getOnlinePlayers();
        int total = 0;
        for (Player currPlayer : playerList) {
            // If the player is online, alive, and valid, add their levels to the total
            if (currPlayer.isOnline() && !currPlayer.isDead() && currPlayer.isValid()) {
                total += currPlayer.getLevel();
            }
        }
quaint mantle
#

Event's do not complete until all of their listeners have finished being processed

#

so do whatever you need to do one tick later

#

using the bukkit scheduler

quasi stratus
#

Ah, alright

#

then, I may have a related issue.

#
java.lang.IllegalStateException: WorldBorderBoundsChangeEvent may only be triggered synchronously.
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:616) ~[patched_1.17.1.jar:git-Purpur-1419]
        at org.bukkit.event.Event.callEvent(Event.java:45) ~[patched_1.17.1.jar:git-Purpur-1419]
        at net.minecraft.world.level.border.WorldBorder.lerpSizeBetween(WorldBorder.java:169) ~[patched_1.17.1.jar:git-Purpur-1419]
        at org.bukkit.craftbukkit.v1_17_R1.CraftWorldBorder.setSize(CraftWorldBorder.java:46) ~[patched_1.17.1.jar:git-Purpur-1419]
        at me.coopersully.Firmament.Firmament.setSize(Firmament.java:92) ~[Boxed-in-1.0-SNAPSHOT.jar:?]
        at me.coopersully.Firmament.Firmament.refresh(Firmament.java:122) ~[Boxed-in-1.0-SNAPSHOT.jar:?]
        at me.coopersully.Firmament.events.FQuitEvent$1.run(FQuitEvent.java:18) ~[Boxed-in-1.0-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[patched_1.17.1.jar:git-Purpur-1419]
        at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[patched_1.17.1.jar:git-Purpur-1419]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[patched_1.17.1.jar:git-Purpur-1419]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) ~[?:?]
        at java.lang.Thread.run(Thread.java:831) ~[?:?]```
#

This is what happens when I attempt to run it 1 second later

drowsy helm
#

you are using an async task to interact with the world it looks like

quaint mantle
#

You are running it async

quasi stratus
#

i'm not sure i understand

quaint mantle
#

use Bukkit.getScheduler().runTaskLater

#

Show your code running it 1 tick later

#

what u have so far

quasi stratus
#

ah alright

#
            @Override
            public void run() {
                Bukkit.broadcastMessage("A player left the game; executing correlating events");
                FirmamentPlugin.worldBorder.refresh(false, false, event);
            }
        }, 1);```
drowsy helm
#

1 thread, yes

quaint mantle
#

ok your issue

quasi stratus
#

I should change Async to Sync?

quaint mantle
#

"Async"

#

yes

quasi stratus
#

gotcha- sorry im a bit slow

quaint mantle
#

it ok

drowsy helm
#

never

#

and threads

#

cores and threads are different things

noble lantern
#

That would require an entire rewrite of the server end

drowsy helm
#

they are lazy and it will cost them a lot to basicalyl rewrite the notchian server

#

and they will make nothing out of rewriting it

native nexus
#

You can pay them if you want

noble lantern
#

I mean notch never thought MC would be as big as it got

drowsy helm
#

well they do not benefit financially at all if they do it

noble lantern
#

that too ^

quasi stratus
#

i will personally do it

#

starting a gofund me brb

drowsy helm
#

gonna cost you a good million

noble lantern
#

Im suprised no one used MC protocol to make a jar from scratch that incorporates multi core support

quasi stratus
#

i think that every time notch tweets something offensive he should rewrite a little bit of the mc servers

#

we'd have it done in a week

noble lantern
#

I made a MC server with NodeJS using the MC protocol but its a total bitch to use, i only got the MOTD and server list returning working it wasnt even joinable

noble lantern
#

Not really

#

If anything it would mean you need to add more codebase to the official jar

drowsy helm
#

i dont think anyone would benefit enough to rewrite the entire notchian server

noble lantern
#

Then patch your own jar like others have done that is specifically designed for the game mode your making

#

EG, faction jars

#

Hyperion is a decent example of an optimized spigot fork, its mainly so TNT is more optimized

#

But hyperion is kinda expensive asf when i last checked a few years ago

#

how?

#

Never heard of it, but because a different spigot patch is better than another doesnt make one jar "bad"

#

When i did work on Mozektot they used Hyperion jar

#

have fun

vagrant stratus
#

What's the point of that exactly?

#

I mean, isn't that basically the move event ๐Ÿ˜

#

Meh

#

no one cares tbh

#

Why would we?

#

by doing what exactly?

#

๐Ÿคทโ€โ™‚๏ธ

#

I don't have my own server, can't say

#

I personally don't even care about 1.8.8

noble lantern
#

thats just a interface

vagrant stratus
#

and one yoinked from someone else's project as well

noble lantern
#

^

#

I could of made an interface just like that in 20 seconds, thats really nothing special it probably uses 10 other classes to actually use but

#

Why would you even leak a authors source code unless its open sourced, thats just scummy

vagrant stratus
#

.

#

Yea, but isn't that "Implement everything yourself" iirc?

#
The main difference compared to it is that our implementation of the Minecraft server does not contain any features by default! However, we have a complete API which allows you to make anything possible with extensions, similar to plugins and mods.
fallow merlin
#

.o.

vagrant stratus
#

Yea.....and just to get everything a normal jar has it would end up looking like node

#

and you'd have to hope the libraries you have aren't shit

#

and if you're depending on one, you'd have to hope it isn't depending on a different variant of the same type of library you already have (e.g. loot tables)

#

imo, it's just a mess

#

I mean, if forks actually worked properly I could probably hardfork and do a decent-ish improved server

#

I mean, I'll have to do it anyways for a different project, so we'll see ๐Ÿคทโ€โ™‚๏ธ

rancid pine
#

is there some type of event for when tnt explodes

#

i want to change how big the explosion is

fallow merlin
#

bc primed tnt is an entity

last ledge
#
                player.sendMessage(msg);```
#

what do i do

#

it says Cannot resolve method 'sendMessage(java.util.List<java.lang.String>)'

rancid pine
kind hatch
last ledge
vagrant stratus
#

?learnjava

undone axleBOT
vagrant stratus
#

o

last ledge
#

ok

kind hatch
#

So, I'm trying to create a tpall command that takes the maxEntityCramming gamerule into account. I've already figured out how to split the players evenly based on that number, but I am having significant trouble figuring out how to implement location checks.

In the image provided, I've marked locations where players should be teleported to.

  • Gold = The origin point. (Not included in teleportation)
  • Green = Locations to check.
  • Blue = Further rings if needed.

Obviously, if any of these locations are invalid (lava, can suffocate the player, etc) I don't want players teleported there.

Here's my problems/questions:

  • How should I go about finding these locations?
    -- Should I just create a map of locations with a boolean indicating that the location is safe?
    -- Can I make these checks mathematical? Ideally, I would like to just calculate locations up to the number of players split, but for a rough prototype, checking every location in green should work.

  • How do I check for topology. (I.E different Y levels)
    -- Because not every player is going to be on a perfectly flat area.

vagrant stratus
#
- How do I check for topology. (I.E different Y levels)
-- Because not every player is going to be on a perfectly flat area.

You'd just use getHighestBlock or something along those lines i believe

kind hatch
#

Will that work if the player is in a cave?

#

Or underground base?

vagrant stratus
#

Read the documentation

waxen plinth
#

Getting the highest block gets the highest block

#

It won't take caves or anything into account

#

But it's fast

#

It uses the heightmap so it's much faster than just iterating down to find the highest block

kind hatch
#

Obviously, getHighestBlock would work if the player executing the command is on the surface. However, I'm trying to account for underground areas as well. 1.18 caves are huge and have plenty of room for players to be teleported there. I could do a Y check on the player to use getHighestBlock if they are above Y64, but I'm not a fan of that approach as some caves can literally generate from the surface all the way down to the bottom of the world.

fallow merlin
#

I feel like a getClosestEmptyBlock should exist

#

(if it doesn't)

kind hatch
#

What if a cave is exposed right under a mountain? If the player is in that cave but above Y64, players will be teleported to the top of the mountain if I were to use getHighestBlock

carmine nacelle
#

Can't resolve symbol ServerLevel

#

any ideas..?

chrome beacon
#

Is NMS imported to the project

#

Actually class names still use Spigot Mappings iirc

#

Might be wrong though

summer scroll
#

How can you prevent player from spawning entity using spawn egg?

#

I've tried to cancel PlayerInteractEvent but it doesn't work If the player right clicking it on the entity, it will spawn a baby instead.

young knoll
#

CreatureSpawnEvent

#

But that doesnโ€™t have a player context

#

Alternatively you can also cancel PlayerInteractEntity

summer scroll
#

I've tried that also.

drowsy helm
#

createspawnevent has spawnreason

summer scroll
#

Oh wait a second, I put the wrong event.

summer scroll
drowsy helm
#

not that im aware of

carmine nacelle
#

Well im trying to use remapped but getting "cannot resolve" when I add ```xml
<classifier>remapped-mojang</classifier> <!-- Comment this out for regular Spigot mappings -->

summer scroll
#

Oh yeah, the PlayerInteractEntity do the thing, thanks.

carmine nacelle
#

Cannot resolve org.spigotmc:spigot:1.17.1-R0.1-SNAPSHOT when trying to use the remapped

drowsy helm
#

have you ran build tools

eternal night
#

Did you install the remapped version

carmine nacelle
#

What is the BuildTools command to download the remapped jars?

carmine nacelle
eternal night
#

You'll need the --remapped parameter

carmine nacelle
#

holy shit i love u

#

what even is the remapped?

#

i just know i need it to follow this tutorial

eternal night
#

Well, it installs the remapped version of the server jar into your local maven repo

#

Two technically

carmine nacelle
#

yeah but likeee

#

what even does remapped mean

eternal night
#

When Mojang publishes their server, all of the methods and classes are obfuscated (e.g. single nonsense letters). Spigot source code is build against a mapping of those methods called spigot mappings, that define spigot-decided names for methods needed

#

Mojang also ships their own mappings, giving names to these obfuscated methods

young knoll
#

Spigot doesnโ€™t even map anything anymore

eternal night
#

While the server is running however, it is "obfuscated"

quaint mantle
#

In some spigot pages I get "error, you do not have permission to access this site" and I am already registered on the page.

eternal night
#

E.g. neither spigot nor Mojang mappings

carmine nacelle
#

why do they do that tho

#

why hide them?

eternal night
#

Legal reasons I assume

carmine nacelle
#

hmmmm..

#

org.spigotmc:minecraft-server:txt:maps-mojang:1.17-R0.1-SNAPSHOT was not found in https://hub.spigotmc.org/nexus/content/repositories/snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of spigotmc-repo has elapsed or updates are forced

eternal night
#

Ooof, yea that is about the limit of my knowledge of what spigot does with mappings

carmine nacelle
#

oof

#

its letting me use the methods now though

#

which makes it really confusing..

eternal night
#

Well the missing mappings are only needed when reobfuscating your plugin

quaint mantle
carmine nacelle
# eternal night Well the missing mappings are only needed when reobfuscating your plugin

In this episode of the Spigot MC Plugin series, I show you how to create an NPC with NMS and Packets. First, we make a fake player with a skin. Then, we give that NPC some items and a helmet. Finally, we make it look at you when you move around it. #Spigot #SpigotTutorial #MinecraftNMS

Brain.fm 20% off: https://brain.fm/kodysimpson
My code: htt...

โ–ถ Play video
eternal night
#

Has the official examples

#

Scroll down for a bit until you find NMA

#

NMS

carmine nacelle
#

yeah im following that

eternal night
#

๐Ÿ˜ช sadly that's about as far as I know spigots Mojang mappings tooling

compact cape
#

It's not related to java or spigot at all, But I need it for my plugin...

I need to create a 3D database to store data:

D-1: Special Blocks (Consider sth like Slimefun blocks)
D-2: Have Access Or Not
D-3: Players

I was using Json, But it is getting out of hands (More than 10K Blocks and 1K Players) so I decided to use SQL, But how should I implement them in a table?

crimson terrace
#

Just getting started on databases but you should probably use the UUID of a player for the primary key

#

Depending on what else youre planning on doing

ivory sleet
compact cape
#

I'm just confused what the table should be... Players as Columns and Blocks as Rows ? Then I have to add a new column for each new player... Reverse of that, I should do it per block...

compact cape
crimson terrace
#

If youre really enthusiastic you could have foreign keys with another table which just has the UUID of the player and the blocks attached to each Uuid

compact cape
#

Hmm ๐Ÿค” Maybe that works... But isn't there a simpler way for some who never used SQL before ๐Ÿ˜‚

eternal night
#

Just use a document based dB

crimson terrace
#

Im also just getting started on it. Thats as far as I go on this XD

eternal night
#

Then you don't have to learn SQL ๐Ÿคฏ

compact cape
eternal night
#

Huh ? You are using mongodb or the likes ?

compact cape
eternal night
#

Yea, that isn't really a database

#

Mongodb could allow you to do the same but properly

#

Or well, some other documented based dB like couchdb

compact cape
#

The real issue is the performance Every time the server checks for the permission We get a lag spike (Really short maybe 2 or 3 ticks)

#

But still annoying

crimson terrace
#

You have multiple servers running?

eternal night
#

Not like a database will be magically instant. You have to move IO (such as database lookups) off the main server thread

compact cape
#

And even the 12GB is dying with the amount of blocks now

#

That's why I want to use SQL

crimson terrace
#

Damn ok. Otherwise you could have had each server have a seperate file

compact cape
#

As the SQL is on another server

#

At least not on the 12GB Ram of this server ๐Ÿ˜‚

crimson terrace
#

I could give you a start on how to create the table for the data

compact cape
#

I now the basics, I'm just stuck at the design of table

compact cape
#

Maybe this one works:

Block   | UUID   | Permission
1/21/-5 | 123... | Yes
1/21/-5 | 123... | Yes
10/2/-9 | 123... | No
crimson terrace
#

Just not sure on how to get the blockarray working

compact cape
#

I don't need unique keys ๐Ÿค”

crimson terrace
#

Could it be faster to make the block the primary key and then have a list of uuids?

compact cape
#

And I always have to check A UUID with A Block

crimson terrace
#

Aka even for the yaml file you could have the blocks and then a list of uuids

compact cape
compact cape
crimson terrace
#

The other way around is slower?

compact cape
#

I guess so...

crimson terrace
#

Could be worth a try to invert

compact cape
#

But as far as I don't get the spike lag and I get to clean the 2GB of hard data I'm ok with it

crimson terrace
#

I dont think it would solve the memory issue but having a Uuid contain a list of allowed blocks could be a good way

#

Mostly since you have less UUIDs than blocks

compact cape
crimson terrace
#

Save a hashmap for each UUID containing the block and then a boolean?

compact cape
#

The No means they can not even notice it is a special block.. but Missing means they can notice what block it is

compact cape
#

But per block ๐Ÿ˜‚

crimson terrace
#

Im not sure if runtime on hashmaps is linear or otherwise. If its linear it would definitely save you time to save the UUIDs instead of the blocks

#

Since you said you have 10k blocks and 1k players

compact cape
#

I'll try that, But I think I might just go for SQL

ivory sleet
#

Yeah it has in best case an O(1) lookup time, removal time and add time complexity

glossy venture
#
    public boolean runSafe(Runnable runnable, Consumer<Exception> errorHandler) {
        try {
            runnable.run();
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            if (errorHandler != null)
                errorHandler.accept(e);
            return false;
        }
    }

    public boolean runSafe(Runnable runnable) {
        return runSafe(runnable, null);
    }
``` heres something completely unrelated
#

just a utility

crimson terrace
ivory sleet
#

Yeah

compact cape
#

I have one my self in the core plugin ๐Ÿ˜‚

crimson terrace
#

Damn ok so the amount of blocks you have shouldnt have an impact

ivory sleet
#

Its lookup time may be the same regardless of size, with that being said it isnโ€™t always the case

compact cape
crimson terrace
#

And the encoded data isnt serializable?

compact cape
#

Yaml ๐Ÿคท

ivory sleet
#

Well ideally youโ€™d have a concurrent hash map in which you read the data asynchronous which should be fast enough assuming youโ€™re not performing some sort of bulk update

compact cape
#

The statistics of my plugins says it is loading about 10 blocks per second average...

#

The issue is that the amount of files causing issue, As each block is in a separate file

ivory sleet
#

Idk how you implement stuff so that feels like a pretty vague argument, anyways if itโ€™s startup/bootstrap loading loads of data is okay even if itโ€™s synchronous.

#

ยฏ_(ใƒ„)_/ยฏ

#

Might have to start implementing an expiring cache

compact cape
#

I agree with that ๐Ÿ˜‚

compact cape
crimson terrace
#

Also not sure on why each block is a separate file

ivory sleet
#

Probably to isolate and modelize the data

compact cape
#

At first it looked ok... I never imagined players start using the blocks this much

#

And also to keep it easy to manually edit the data

ivory sleet
#

Shreb assume you just want to load player file x, then having it in a separate file could be of help, for instance you donโ€™t have to read all players which would be the case if youโ€™d have all player data in a single file

crimson terrace
#

Fair enough. Thanks for the explanation

compact cape
#

What if I want to remove a block permissions completely ๐Ÿคท

#

Then I have to check 1K files

crimson terrace
#

The only thing I can think of is to make the processing of a blocks data take less resources

compact cape
#

I usually need to do that manually ๐Ÿ˜‚

#

I think the SQL fix the issue... No More Huge Folder to look into

crimson terrace
#

I cant really help you there without knowing exactly what youre trying to put into the database

last ledge
#

I want to make Custom Trading Gui, where i can trade with my Custom Made ItemStack items, how do i make it, how do i start

crimson terrace
#

Are you trying to open the GUI using a command or a playerinteractevent?

last ledge
#

command

crimson terrace
#

Then you should start by making a trade inventory

last ledge
#

no, i want to open villager trading inventory

#

with 2 slots

#

and 1 result

crimson terrace
#

Not sure how to do that since Im on my phone and cant experiment

last ledge
#

ah k

last ledge
acoustic widget
#

Hello i'm trying to shade lucko.helper in maven but doesn't work

                                <createDependencyReducedPom>false</createDependencyReducedPom>
                                <relocation>
                                    <pattern>me.lucko.helper</pattern>
                                    <shadedPattern>com.example.testmaven.me.lucko.helper</shadedPattern>
                                </relocation>
                            </relocations>```
Error shown 
> Cannot find default setter in class org.apache.maven.plugins.shade.mojo.PackageRelocation

How can i shade this dependencies ??
undone pebble
#

That thing you sent is for relocating the dependency which in your case, you're struggling with

acoustic widget
#

I'm just trying to include my.lucko.helper dependencies in my final jar.
I don't want to add lucko plugin in the folder but include in my jar.
Can you tell me how to do that correctly ? (im new at java dev)

undone pebble
#

You shouldn't shade the whole jar into your plugin

acoustic widget
#

Why ?

undone pebble
#

Although here, they show you how to shade their API:
https://luckperms.net/wiki/Developer-API

acoustic widget
undone pebble
undone pebble
acoustic widget
#

' do however recommend just installing the standalone plugins. These can be obtained from Jenkins.'

#

yeah i read that but i would like to try to shade for my own experience ^^

undone pebble
#

Change "provided" to "compile"

#

That'll do it

acoustic widget
#

ok i see thank you

#

shading is different things ?

undone pebble
#

Huh?

acoustic widget
#

I was talking about shading, but finnaly i just need to change provided to compile. I just want to know what is shading exactly ? I read many things about "shading" but I don't know if it's only to compile dependencies in main jar

undone pebble
#

It basically includes the dependency to your jar

acoustic widget
#

So it's what i did when I set to compile ?

#

It's calling "shading" so ?

undone pebble
#

ยฏ\_(ใƒ„)_/ยฏ

noble lantern
last ledge
#
           ItemStack roteSp = new ItemStack(Material.NETHER_WART);
           ItemMeta roteSpMeta = roteSp.getItemMeta();
           roteSpMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&cRotter &6Splitter"));
           roteSp.setItemMeta(roteSpMeta);
           MerchantRecipe recipe1 = new MerchantRecipe(new ItemStack(Material.FIRE_CORAL_FAN), 1);//result
           recipe1.addIngredient(roteSp, 2));```
ah i am trying to add my itemstack material to the recipe1 ingridient but it throws this error:  ```addIngredient(org.bukkit.inventory.@org.jetbrains.annotations.NotNull ItemStack)' in 'org.bukkit.inventory.MerchantRecipe' cannot be applied to '(org.bukkit.inventory.ItemStack, int)'```
noble lantern
#

And in your plugin.yml

#

It needs to depend or soft-depend on that plugin

#

That way your plugin loads after x plugin so your plugin gets "provided" the API by the x plugin

#

Shading a plugin into your own plugin is just kinda pointles

last ledge
#

excuse me can you help me above in my code ? ๐Ÿ™‚

quaint mantle
chrome beacon
chrome beacon
quaint mantle
chrome beacon
#

I assumed the player was an example

#

Oh well

quaint mantle
#

and my server is offline mode

acoustic widget
noble lantern
acoustic widget
chrome beacon
acoustic widget
#

this "plugin" is just a library for dev

noble lantern
#

I thought you were using an aspect inside of LuckPerms

#

Then yes, just shade the jar into your plugin then

acoustic widget
#

Ok, thanks for your help guys. I'm learning java and you helped me a lot

quaint mantle
#

hello uh
i made npcs with spigot api & nms and packets

#

how to listen for interact

onyx shale
#

connect to player channelpipe and intercept it there

#

you save the entity id from the npc you created

#

and check on the interact packet if its yours

#

(btw injecting is done on join then disconnect the pipeline on quit)

#
private void removePlayer(Player player) {
        Channel channel = ((CraftPlayer)player).getHandle().playerConnection.networkManager.channel;
        channel.eventLoop().submit(()->{
        channel.pipeline().remove(player.getName());
        return null;
        });
    }
undone axleBOT
tardy delta
#

is this the way to make a self-cancelling task?

onyx shale
#

this.cancel will also return and everything past it

#

gets stopped

#

and yeah it can be done through a trigger

#

you can also store it in a bukkittask and cancel it from somewhere else directly

#

also put delay 0

#

unless you want it running a tick later after its called

tardy delta
#

does this.cancel() makes sure everything after, in my case the traders.forEach doest get executed anymore?

onyx shale
#

yes

tardy delta
#

or do i really need the return?

onyx shale
#

it kills it instantly at that line

tardy delta
#

aha ok

onyx shale
#

if you are really worried about it you can also just do a check for cancelled

#

before executing your traders loop

tardy delta
#

nah its just a stupid trade command

worldly ingot
#

You still need the return though

#

this.cancel() will continue the remainder of the task otherwise

tawny talon
#

Hello, I'm trying to register a command but i get the following error

#

[12:30:17 ERROR]: Error occurred while enabling Languages v1.0-SNAPSHOT (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.command.PluginCommand.setExecutor(org.bukkit.command.CommandExecutor)" because the return value of "me.davide.languages.Languages.getCommand(String)" is null

worldly ingot
#

Register the command in the plugin.yml

onyx shale
tawny talon
worldly ingot
#

Yeah, assuming the command you're setting is lang

tawny talon
worldly ingot
#

Show us your onEnable() ;p

#

Or wherever that error originates

tawny talon
#

@Override
public void onEnable() {

    registerCommands();
    instance = this;

}

and I made a private void registerCommands();

#

where i made private void registerCommands() {
getCommand("lang").setExecutor(new LangCommand());
}

worldly ingot
#

Only reason that error would be thrown is if the command wasn't in the plugin.yml, so just be sure to save, re-export, and double check there aren't two instances of your plugin in the plugins directory

#

For good measure as well, commands in the plugin.yml generally include some additional information

commands:
  lang:
    description: This is a description
#

At the very least, a description

tawny talon
#

Also I understood why, I've made this plugin through the mcdev intellij plugin and it uses maven, it register the plugin.yml that is on the pom.xml

quaint mantle
#

been experimenting with complicated command handlers to optimize performance, but this caught me:
what's the best way to handle commands cleanly?

tardy delta
worldly ingot
#

I, personally, just use Bukkit's framework for commands. Nothing extra on top. There's nothing wrong with it

#

Others prefer annotations, others prefer abstraction, etc.

quaint mantle
#

Who can convert this code to NMS for me?

        CraftPlayer craftPlayer = (CraftPlayer) player;

        craftPlayer.getHandle().listName = name.equals(player.getName()) ? null : CraftChatMessage.fromString(name)[0];

        for (Player player1 : players) {
            EntityPlayer entity = ((CraftPlayer) player1).getHandle();

            if (entity.getBukkitEntity().canSee(player)) {
                entity.playerConnection.sendPacket(new PacketPlayOutPlayerInfo(
                        PacketPlayOutPlayerInfo.EnumPlayerInfoAction.UPDATE_DISPLAY_NAME, craftPlayer.getHandle()));
            }
        }
worldly ingot
#

PES_Think That is using NMS

#

Though there is a player.setDisplayName() method that does exactly that in the API

plucky crow
#
        if (!this.playing) {
            return;
        }

        final int time = NumberUtils.randomNumber(2, 5);
        this.getArena().broadcastTitle("games.first.green-light.title", "games.first.green-light.subtitle");
        this.getArena().broadcastSound(
                this.getArena().getMainConfig().getSound("game-settings.sounds.green-light", "GHAST_MOAN"));
        this.canWalk = true;

        Bukkit.getScheduler().runTaskLater(SquidGame.getInstance(), () -> {
            this.getArena().broadcastTitle("games.first.red-light.title", "games.first.red-light.subtitle");
            this.getArena().broadcastSound(
                    this.getArena().getMainConfig().getSound("game-settings.sounds.red-light", "BLAZE_HIT"));
            Bukkit.getScheduler().runTaskLater(SquidGame.getInstance(), () -> {
                this.canWalk = false;
                final int waitTime = NumberUtils.randomNumber(2, 5);
                Bukkit.getScheduler().runTaskLater(SquidGame.getInstance(), () -> {
                    singDoll();
                }, waitTime * 20);
            }, 20);
        }, time * 20);
    }

How can I separate 2-3-4 and 5? For example, if 2 comes up, give 1 diamond, if 3 comes up, 2 diamonds, if 4 comes up, 5 diamonds, if 5 comes up, 6 diamonds.

quaint mantle
worldly ingot
#

Sorry, it's Player#setPlayerListName()

#

There's API for exactly that

#

So,

player.setPlayerListName(ChatColor.translateAlternateColorCodes('&', name));
#

Literally your whole method can be reduced to just that lol

#
    @Override
    public void setPlayerListName(String name) {
        if (name == null) {
            name = getName();
        }
        getHandle().listName = name.equals(getName()) ? null : CraftChatMessage.fromStringOrNull(name);
        for (EntityPlayer player : (List<EntityPlayer>) server.getHandle().players) {
            if (player.getBukkitEntity().canSee(this)) {
                player.connection.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo.EnumPlayerInfoAction.UPDATE_DISPLAY_NAME, getHandle()));
            }
        }
    }```
That's how CB implements it
quaint mantle
#

ok

#

thank you very much

vivid cave
#

how to hide default tablist and make my own custom one?

#

without plugins

onyx shale
#

if its not plugin related i dont think asking here

#

will get you anything done

vivid cave
#

whaat

#

its a spigot/bukkit question

worn tundra
#

It's not a spigot plugin development question

vivid cave
#

yes it is

onyx shale
#

where is the plugin part?

worn tundra
#

You literally said without plugins

#

Lmao

vivid cave
#

I mean

#

without other plugins besides spigot

#

i don't wanna use someone else's code

worn tundra
#

Spigot isn't a plugin

#

But sure

vivid cave
#

Yeah exactly

#

that's why i said "without plugins"

worn tundra
#

Why use spigot then?

onyx shale
#

unless you will work with command blocks(likely not even then) you cant

vivid cave
#

So i can't customize the tablist with spigot?

#

Weird.

worn tundra
#

It's not weird lol

onyx shale
#

spigot is merely a framework so others can use it to modify

worldly ingot
#

No you need a plugin to customize anything

#

That's what plugins are for

quaint mantle
#

been experimenting with complicated command handlers to optimize performance, but this caught me:
what's the best way to handle commands cleanly?
also how would i cancel events when a bukkitrunnable is cancelled?

vivid cave
#

but how are those plugins made then?

worn tundra
#

magic

vivid cave
#

Like how are the plugins to "change the tablist" made

onyx shale
quaint mantle
onyx shale
#

it stops the events

quaint mantle
#

it doesnt get unregistered

onyx shale
#

simple

quaint mantle
#

no

#

it doesnt

worn tundra
worldly ingot
#

what's the best way to handle commands cleanly?
Answered this like 10 minutes ago:
Performance isn't really a factor when it comes to command frameworks. It's preference
I, personally, just use Bukkit's framework for commands. Nothing extra on top. There's nothing wrong with it
Others prefer annotations, others prefer abstraction, etc.

onyx shale
#

i assume you are storing that said listener in a field and use it to register/unregister not creating a new one for unregistering right?

worldly ingot
#

Yes lol

quaint mantle
#

my bad

vivid cave
#

Anyway do you guys know a place where I could get help with bungeecord? All i try to do is a tablist which is the same for every people accross all servers of the bungeecord proxy

#

I feel using additional plugins for tablist is just a waste

onyx shale
#

well thats gonna be rough

quaint mantle
# worn tundra > what's the best way to handle commands cleanly? Best advice here is to check o...

also how would i cancel events when a bukkitrunnable is cancelled?
basically i have a Countdown class

public abstract class Countdown {

    private int time;

    protected BukkitTask task;
    protected final Plugin plugin;


    public Countdown(int time, Plugin plugin) {
        this.time = time;
        this.plugin = plugin;
    }
    @EventHandler
     public void onEntityDeath(onEntityDeath event) {

     }

    public abstract void count(int current);
    public final void start() {
        task = new BukkitRunnable() {

            @Override
            public void run() {
                count(time);
                if (time-- <= 0) cancel();
            }

        }.runTaskTimer(plugin, 0L, 20L);
    }

}

this is the code structure, now im trying to cancel the event on event cancel [it gets registered in start()]

onyx shale
#

a tablist its not exactly meant to go cross servers

onyx shale
#

i dont see it registering

subtle kite
#

you mean like the players also , just the text people put around the tab list

quaint mantle
vivid cave
#

nothing is impossible nor difficult Stellrow, I think you have a pretty restricted vision of what's possible

worldly ingot
vivid cave
#

it's just a question of good practise and courage

worldly ingot
#

Though we also don't use BungeeCord and we have a very, very hacky system for it lol. All custom

onyx shale
#

so i guess querying bungee to get all online players than later creating fake ones on a tablist is a good way?

#

idk bout that one

worn tundra
#

you can't otherwise

#

The event instance if passed once per listener (pre eventhandler method), so that's the only way you'll be able to cancel that exact instance

quaint mantle
#

what about unregisterAll?

worldly ingot
worn tundra
worldly ingot
#

Then yeah, fake players w/ custom names

worn tundra
#

Just pass an event object into your count function

quaint mantle
worn tundra
#

It will not add any extra load

onyx shale
#
private Listener gameMechanics;

@Override
    public void registerMechanics() {
        pl.getServer().getPluginManager().registerEvents(gameMechanics,pl);
    }

    @Override
    public void unregisterMechanics() {
        HandlerList.unregisterAll(gameMechanics);
    }
quaint mantle
onyx shale
#

instance based listener

vivid cave
#

how about "scoreboards which have an objective of displayslot=sidebar", then we createTeam() and .addPlayer(), ain't that supposed to replicate a tablist?

worn tundra
onyx shale
#

if hes registering it on start

worn tundra
#

Why would he register it every time

onyx shale
#

always pass a new instance of the listener your working with

#

to achieve instanced events

#

wich is what he wants

worn tundra
#

That's weird

#

AquaDef stop

#

;D

quaint mantle
#

what

#

:(

onyx shale
#

i use this for my minigame engine

ashen agate
#

Does anyone know how to update the xrot (head going up and down) of an entity properly? I'm trying for an iron golem to look from 0 to 45 in 20 ticks, but it just looks at 0 the whole time and doesn't update, even though the value does change...
I tried doing just #setXRot(...) too, but same effect.

onyx shale
#

each game instance has its own listener

quaint mantle
#

yes exactly

#

its a minigame

#

i know my code sucks and i wanna rewrite it but im lazy

worn tundra
#

Oh there we go, more context

#

Which was important

#

Because at first it looked like a global event that runs each time someone kills an entity

quaint mantle
#

basically, its a 5 minute game that keeps resetting if no one loses

worn tundra
#

And what is the Countdown class doing

#

what's it supposed to do in the end

quaint mantle
#

it is actually the game

onyx shale
#

why not store it as a bukkittask?

quaint mantle
#

man i made this at 1 am

worn tundra
#

;D

quaint mantle
#

brain isnt the same

#

brain was ded

onyx shale
#

welp time to rewrite it in that case..

quaint mantle
#

im fully open to better approaches

quaint mantle
#

okay so

#

whats a better approach

worn tundra
#

Depends on the minigame

onyx shale
#

for start... make a game engine

quaint mantle
#

All players are given a random way to die, and they must try and die that way before 5 minutes is up. The first player unable to complete their death task within 5 minutes loses. This game is designed for 2 players. Credit for this idea goes entirely to Dream on YouTube. Leave a review if you enjoy the plugin!

#

lol

onyx shale
#

oh another one of those..

worn tundra
#

for start... make a game engine

Not necessarily

quaint mantle
#

no

worn tundra
#

Lmaoo

quaint mantle
#

basically

#

bro

#

i made a working one

#

but i wanna update it

onyx shale
#

let me guess

quaint mantle
#

i need more wealth

onyx shale
#

making it instance based is difficult?

quaint mantle
#

no but code sucks

#

and i wanna rewrite

worn tundra
#

Why need instances though? This sounds like it can be done in one class

#

No need to over-engineer it for no reason

onyx shale
#

if you dont it to be server instanced yeah

quaint mantle
#

i just want it to work lol

onyx shale
#

if you want nice arenas and multiple games at once per server

#

yes it needs to be instanced

worn tundra
#

How do you want it to work Aqua

#

Is it a small little thing you use with friends?

quaint mantle
#

no

worn tundra
#

Or do you need multiple of these running on the same server on separate worlds?

quaint mantle
#

its an actual plugin published on spigotmc that i wanna update

worn tundra
#

Oh, care to link it?

quaint mantle
quaint mantle
#

i dont want to link it

#

:(

worn tundra
#

You shouldn't be

quaint mantle
#

its poop

onyx shale
#

its doesnt really matter you know

#

your name is linked to spigot anyway..

worn tundra
#

Yeah lmao

quaint mantle
#

UHHH

worn tundra
#

Deathshuffle

quaint mantle
#

1 sec

onyx shale
#

is it instance based?

#

or are you trying to implement this

#

rn

quaint mantle
#

so it wont work on multiple worlds at once

#

or a bungee network

onyx shale
#

thats the opossite..

#

instance based = multiple people doing theyr own separate game

quaint mantle
#

yeah

#

but u said

#

oh

#

nvm

onyx shale
#

basically there can be a infinite amount of games

#

thats instance based

quaint mantle
#

yeah i know

#

but

#

i misread

#

for some reason

worn tundra
#

It... will... just require more advanced knowledge

#

Since each instance will have it's own world, win conditions, stats etc.

quaint mantle
#

dont worry ive been coding for 5 years in fact

#

im just new to spigot

onyx shale
#

best way is to start working on a gameengine

#

then you can create more minigames easly

worn tundra
#

Depends on how complicated you wanna make it. BUT I assume a random peep off the internet who wants to download a plugin like this will just want a quick plugin for one group that just works fine with one instance. Doubt any server owner wants anything like this multi-instanced.

quaint mantle
#

yeah

#

but i want to learn

onyx shale
#

cool ideea but true

quaint mantle
#

im just bored of creating complex neural networks and wanna code something fun

worn tundra
onyx shale
#

cause theyr usefull

#

made one and now i can create a fully working minigame in 20-25mins

quaint mantle
#

how complicated of a game engine

#

i will just yoink urs

worn tundra
#

lmao

#

valid

quaint mantle
#

stop creating a utils plugin

onyx shale
#

enough to handle the game state,the countdown,max/min players,overridable methods for start/stop its own mechanics,interfaced arena to always have a lobby...

worn tundra
#

Thousand libraries to do the smallest things

quaint mantle
#

wait wait

#

actually

#

i just realized

onyx shale
#

also checkers for canjoin,what happens when a player joins,what happens when a player leaves

#

things you need in every minigame

quaint mantle
#

my plugin works on multiple worlds

#

:D

worn tundra
#

Yeah

#

On any world in fact

quaint mantle
#

no like

#

at the same time

worn tundra
#

That's what happens when you don't define a limit?

quaint mantle
#

no thats a good thing

#

its instance based

#

it creates an instance of Countdown for each game

worn tundra
#

So four players can start two separate games?

quaint mantle
#

yes

worn tundra
#

But they'll be in the same world

quaint mantle
#

no need

worn tundra
#

Because I assume you're not generating new worlds for each game, are you?

quaint mantle
#

im not

#

you know what maybe i should just leave this plugin be

worn tundra
#

;D

quaint mantle
#

i need help with something more important

#

if u dont mind

worn tundra
#

Yeah, if you need inspiration for something else fun

#

You can explore the spigot resources "fun" category

quaint mantle
#

thank

#

okay so um

worn tundra
#

Ye

onyx shale
worn tundra
#

lol no

#

look at the dates

quaint mantle
#

this is the idea:
For every player there is a pit, every player has a pit that they should drop mobs into, each NEW mob is 5 point, otherwise 1 point.
Game ends in 60 minutes, player with most points wins.

worn tundra
#

Dream game again

onyx shale
quaint mantle
#

its free clout

worn tundra
#

lol wha

quaint mantle
#

the deathshuffle plugin got 93 downloads

#

and its my first plugin ever

onyx shale
#

yeah idk tf is happening in there but i guess

#

aw nvm

quaint mantle
#

it even got attention on reddit

winged hinge
#

Hello, why do i not receive the "Permissions: " send in the chat when the method called, but receive the send "list all permissions of user..." which is after running the method?

private void printPermissionList(ArrayList<String> permissions, CommandSender sender) {
    sender.sendMessage("Permissions: \n");
    for (String perm : permissions) {
       sender.sendMessage("    - " + perm);
   }
}
onyx shale
#

its date created with last replied

worn tundra
#

Oh you don't receive the "Permissions:" either?

winged hinge
#

but the send which is before output of the list outputs only "Permission"

quaint mantle
worn tundra
winged hinge
worn tundra
onyx shale
#

however thats a long ass minigame round

worn tundra
quaint mantle
#

its fine dream stans will do it anyways

worn tundra
#

Bro

quaint mantle
worn tundra
#

By using spigot

onyx shale
#

dream stans have brain size of a peanut they wont figure out getting a server running @quaint mantle

worn tundra
#

^

winged hinge
onyx shale
#

so idk why you expect clout off clones

#

we have so many

quaint mantle
#

literally got 93 downloads

#

ez clout

worn tundra
onyx shale
#

i also saw like 10-15 clones of yours

quaint mantle
#

wait really

worn tundra
#

They're all clones of one

#

You thought you're the first one?

onyx shale
#

look

#

821 downloads

#

amazing

worn tundra
#

Peanut brained dream stans have done it thousands of times

quaint mantle
#

bruh

#

what is this

#

HE UPLOADED IT AFTER 3 DAYS

winged hinge
worn tundra
winged hinge
#

okey

onyx shale
#

as they just use the current world for it no instances,nothing

quaint mantle
#

okay so

#

how would i create the pit?

winged hinge
quaint mantle
#

i wish minecraft was python based

#

python luv

onyx shale
#

python will struggle with such complex logic..

quaint mantle
#

:(

#

python wins

onyx shale
#

also theres a reason python is pretty much a baby language beside the rest

quaint mantle
#

no its not

worn tundra
#

it is

quaint mantle
#

no

worn tundra
#

yes

quaint mantle
#

no

winged hinge
#

and C# is better

#

xD

quaint mantle
#

๐ŸŒถ๏ธ

#

๐Ÿซ‘

#

๐Ÿชถ

worn tundra
#

Any language closer to the bytecode is faster

quaint mantle
#

true

#

but man

#

python is just cleaner

worn tundra
#

Python handles machine learning and ai well

quaint mantle
#

than any programming language

winged hinge
#

can we please stop

#

i will fix my code ๐Ÿ˜„

quaint mantle
quaint mantle
worn tundra
quaint mantle
worn tundra
#

Is it registered?

winged hinge
#

yeeessss

#

i run it

worn tundra
#

Show screenshot

winged hinge
quaint mantle
#

make sure you have a break; in every case

onyx shale
worn tundra
#

If he was it would still show the "Permissions:"

winged hinge
#

if the list is empty, the send have also to be in the chat

quaint mantle
#

what about sender

#

try making a broadcast

#

in the printPermissionList

winged hinge
#

okey

quaint mantle
#

perhaps its the sender

#

wait a second

#

WAIT A SECOND

winged hinge
#

no

worn tundra
#

How can it be sender if the other thing is being sent to the sender fine

quaint mantle
#

thats not even what you wanna do

winged hinge
#

the message before the method called also works with sender

quaint mantle
#

you want to getplayerinexact by the name of args[2]

#

or offline player

#

and get permissions of that guy

quaint mantle
winged hinge
#

broadcast also dont work

quaint mantle
#

so it doesnt even go in the printPermissionList

winged hinge
#

but how?

winged hinge
#

i dont understand

quaint mantle
#

this is kinda odd

winged hinge
#

i receive the "list all permissions of user" but the method before was not run wtf?

quaint mantle
#

ye

winged hinge
#

yes!

quaint mantle
#

so now we're sure it doesn't run

#

because broadcast didnt work

winged hinge
#

jup

quaint mantle
#

whats left

winged hinge
#

i really dont know ๐Ÿ˜„ nothing

quaint mantle
#

can i see the full switch