#help-archived

1 messages · Page 18 of 1

wanton delta
#

@frigid ember you are going to want to use Player#addPotionEffect

jovial trout
#

would anybody know why Entity::setVelocity only works on flying or swimming entities?

frigid ember
#

does it happen what you press tab

#

in chat

#

like when you're tab completing

jovial trout
#

phantoms, fish, bees, etc work but not for cows, skeletons, etc

tender mango
#

@keen compass but when i try it in game it says i dont have access to that command

frigid ember
#

does it happen what you press tab

#

discord is great software

#

it doesn't resend your message 100 times

jovial trout
#

lol

wanton delta
#

I'm having an issue with the -Djansi.passthrough=true tag not working on craftbukkit... would anyone know why that is?

#

it works on a test jansi application ive made

#

but not on spigot

keen compass
#

@tender mango you never specified a command you were trying to do. You want the default group to have access to a particular command or you want yourself to have access to it?

buoyant lodge
keen compass
#

are you doing that test using windows @wanton delta

wanton delta
#

yes

#

actually

#

hold on a minute

keen compass
#

if I recall Jansi gets disabled on spigot if ran through windows command line

wanton delta
#

inserting this

#

works

#

So the way it works

jovial trout
#

okay further testing, it looks like Entity::setVelocity only applies if the entity is not on the ground. i hit a mob on the fence and it went flying, but the same mob on the ground does nothing

wanton delta
#

is if ansi is disabled on your machine (its not on mine, ive tested it) spigot will skip applying jansi

#

but the intellij debug console acts differently than cmd in windows

#

so the error 2020-04-14 21:51:32,141 main WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream persists

#

and im assuming that means spigot will not use ansi

tender mango
#

@keen compass i want default group to have access to the commands that i put in the permissions

keen compass
#

what permission plugin are you using?

#

yes, that means spigot will not attempt to create a console on windows @wanton delta

chrome lark
#

that's jansi tryna enable it's natives and getting upset for some reason, windows is a /really/ odd environment for printing ansi out afaik

frigid ember
#

What causes this error?

        net.minecraft.server.v1_15_R1.ItemStack nmsApple = CraftItemStack.asNMSCopy(newItem);
        NBTTagCompound applecompound = (nmsApple.hasTag()) ? nmsApple.getTag() : new NBTTagCompound();
        applecompound.set("seller", NBTTagString.a(p.getUniqueId().toString()));
        nmsApple.setTag(applecompound);

        msg(p, p.getUniqueId().toString());
        ItemStack soldItem = CraftItemStack.asBukkitCopy(nmsApple);
        
        items.add(soldItem);
    net.minecraft.server.v1_15_R1.ItemStack nmsApple = CraftItemStack.asNMSCopy(i);
    NBTTagCompound applecompound = (nmsApple.hasTag()) ? nmsApple.getTag() : new NBTTagCompound();
    String string = applecompound.getString("seller");

    msg(p, string);
    
    if (string == null) {
        error(p, "No seller found for this item");
        return;
    }

    UUID uuid = UUID.fromString(string);

I get sent my UUID

wanton delta
#

its odd to me because the normal JANSI program i have runs fine with color

#

but theres something with spigot that just disabled it

subtle blade
#

Phaze, ItemMeta extends PersistentDataHolder. No reason to be using NMS for this

#

Though I don't understand. You are the seller, why would it not return your UUID? This looks like it's functional to me

frigid ember
#

I'm getting this error in the console

#

Oh wait, I think I imported the wrong UUID

subtle blade
#

java.util.UUID. That's the right one

frigid ember
#

Ok, I thought there was a bukkit one for a second

smoky tundra
#

@wanton delta seems like it breaks only when using the debugger in intellij, works completely fine when using the actual terminal from within intellij

wanton delta
#

my test jansi project works with debugger

frigid ember
jovial trout
#

real quick does anybody know why setVelocity only actually works on mobs that arent standing on the ground?

fleet crane
#

is no colours in your debug terminal really a problem lol

wanton delta
#

bro dont judge me

golden vault
#

broman i tried it and can get it to work with other mobs on the ground

keen compass
#

it would probably help to see how you have coded it @jovial trout

golden vault
#

^

#

this works for me on sheep and zombies and such standing on grass

#

launches them straight up lol

jovial trout
#

do i need to cancel the evnet?

#

event

keen compass
#

which event?

golden vault
#

idk i just did out of habit

keen compass
#

sometimes it is necessary to cancel the event so that you can apply your physics but it depends which event you are acting upon

jovial trout
#

EntityDamageByEntityEvent

#

im tldring my code rn

wanton delta
#

hahaha i hate that event these two would know from last night hahahaha

jovial trout
#

tldr ```scala
event.getDamager match {
case p: Player =>
event.getEntity match {
case l: LivingEntity =>
l.setVelocity(l.getVelocity.add(new Vector(0,5,0))

#

this but java

wanton delta
#

he might be running into the problem i had yesterday?

#

do physics reset if you cancel entitydamagebyentity?

#

might make sense

keen compass
#

the physics get canceled when you cancel the event

hot fable
#

Hii, how can I know the distance x, y, z between a block and a player?

jovial trout
#

im not cancelling the event in my code

hot fable
#

I have tried in many ways but I cannot

wanton delta
#

or use the distance equation for 3d spaces

hot fable
#

I want to use the 3d positions

keen compass
#

its possible that the physics they are trying to apply are getting overridden by the event, so cancelling the event could fix it, but it could also be their code block not being ran as well depending on how it is done.

wanton delta
hot fable
#

lol

jovial trout
#

@keen compass the code block is ran, i added the setVelocity method to another part of my code i know to be run

wanton delta
#

wow this is so reminiscent of what i experienced yesterady

keen compass
#

@wanton delta thats a complicated way of doing it

#

just use vector math

jovial trout
wanton delta
#

broman are you cancelling damagebyentity event

jovial trout
#

L16 is thge offending line

#

no

#

check my hastebin

golden vault
#

the code in my paste works, it does not work if i comment out the setcancelled method

jovial trout
#

odd

#

oh you know why probably?

#

the weapon calls setVelocity and ignores the current velocity

hot fable
#

just this year I started to make Pythagoras haha

jovial trout
#

i would wager

golden vault
#

what frostalf said

its possible that the physics they are trying to apply are getting overridden by the event, so cancelling the event could fix it, but it could also be their code block not being ran as well depending on how it is done.
@keen compass

wanton delta
#

@keen compass i have no clue what that means but that is the standard equation for distance lol

jovial trout
#

lemme repackage and let you know how it goes

hot fable
#

okay haha

jovial trout
#

that works

#

odd

#

but by setting the damage event to cancelled you wont see the entity go red

#

i can lower its health but it wont go red like youre actually swinging

#

or no

#

Entity::damage exists

hot fable
#

Isn't there an easier way to know the distance x, y, z between 2 locations?

keen compass
#

you can cancel the event and then run the event again after you applied your physics @jovial trout

jovial trout
#

Location::distance(Location other)

wanton delta
#

@hot fable

jovial trout
#

@keen compass wont my listener get called again

hot fable
#

?

wanton delta
#

@jovial trout set the damage cause to CUSTOM

#

that way you will know if it was caused by you

jovial trout
#

mm

keen compass
#

yep what @wanton delta said

wanton delta
#

@hot fable im giving you a link

#

read this

#

that is how you get distance of two locations

hot fable
#

I don't see any that are useful to me

wanton delta
#

Location#distance

#

double distance = location1.distance(location2);

#

dont make us spoonfeed

hot fable
#

Okay ok, I think I know how it was then

#

So I have to do 3 "for" if I want to get the blocks around

golden vault
#

launching sheep is hilarious, my wife is unsure

keen compass
#

the reason for cancelling the event works to be technical is because all of the processing of what is to happen is done before the event fires. So if you change anything in the event, the server doesn't care because no processing is done after the event.

jovial trout
#

plugin would be your main class right?

#

of course

golden vault
#

ya

subtle blade
#

:(( Those poor sheep

jovial trout
#

can i just runTaskLater(Plugin, 0)?

subtle blade
#

(a scheduler would be more condensed in this case)

golden vault
#

there is wool eeeeevvvverywhere

subtle blade
#

Bukkit.getScheduler().runTaskLater(() -> event.getEntity().setVelocity(new Vector(0, 10, 0)), plugin, 1L);

golden vault
#

you and your fancy lambdas

subtle blade
#

Would also make that vector constant and values above 4.0 are sketchy for velocities

prisma nacelle
#

@any devs:
having an issue building a plugin that one of my developers wrote and he's offline. it can't resolve a dependency (spark) but spark builds with gradle and I don't know how to install a non-maven-generated jar. https://paste.ubuntu.com/p/H4mvzsx4GS/

subtle blade
#

In fact, some forks cap that to 4.0

jovial trout
#

Bukkit.getScheduler.runTaskLater {_ => event.getEntity.setVelocity(Vector(0,10,0), plugin,1)} would be the scalafied version

#

looks fancier

#

uwu

subtle blade
#

Yea, only it's Scala and literally nothing else looks fancy

#

So there's that

jovial trout
#

scala > java

#

on the gang

#

on god

#

on jesus

#

on my mom

#

and then kotlin trash ofc

subtle blade
#

Likes scala but hates kotlin. I'm so conflicted

#

On one hand, you hate Kotlin. But on the other, Sc- Scala... PES_CryHands

jovial trout
#

because scala is just better :3

#

overload an operator and then get back to me

subtle blade
#

:(( Don't bring that up

#

That's a cheap shot

keen compass
#

operator overloading isn't really necessary

subtle blade
#

YES IT IS :((

#

I want ChatColor constants to override + so I can ChatColor.BOLD + ChatColor.RED

keen compass
#

it makes it easier reading code in java sometimes instead of having lines of magical code happening because it isn't obvious lol

wanton delta
#

i figured out how to apply jansi.passthrough to craftbukkit

#

it was not worth my time but

#

whatever

keen compass
#

and what was the problem?

hot fable
#
        Location loc1 = Bukkit.getPlayer("player1").getLocation();
        Location loc2 = Bukkit.getPlayer("plsyer2").getLocation();

        for (Double x = loc1.getX(); x <= loc2.getX(); x++) {
            for (Double y = loc1.getY(); y <= loc2.getY(); y++) {
                for (Double z = loc1.getZ(); z <= loc2.getZ(); z++) {
                        
                }
            }
        }

This should work, but it does nothing to me

wanton delta
#

you cant just show us code

#

and say "this doesnt work"

#

what are you trying to accomplish

keen compass
#

for some reason they need to iterate over the coords between the locations

wanton delta
#
  1. you dont know what coordinates are bigger.
#

to achieve this

subtle blade
#

(1) use primitives (double > Double)
(2) Why do you not have player objects?
(3) min/max your coordinates

wanton delta
#

example

#

double maxX = Math.max(loc1.getX(), loc2.getX());

upper hearth
#

The amount of terminology (that I should know, i'm just an idiot) I learn from Choco is amazing

keen compass
#

lol

hot fable
#

hastebin link?

subtle blade
#

Been doing this for half a decade, man. lol

#

Same questions, same answers

wanton delta
#

@keen compass the problem i was running into is that intellij's terminal is not recognized as "jansi compatible" (but it kinda is)

upper hearth
#

Keep just looking up what in the world you're saying and going "ooooohhhhh"

wanton delta
#

so i was trying to enable coloring in the intellij terminal to better read what i needed

keen compass
#

so you had to trick it into thinking it is completely compatible?

storm vessel
#

I am currently running my server on windows. Would it be better to run it on a CentOS VM on my Windows machine?

wanton delta
subtle blade
wanton delta
#

i just added that check to the ColouredConsoleSender

keen compass
#

you might get a slight performance boost in doing so @storm vessel

storm vessel
#

Ok

hot fable
#
  1. you dont know what coordinates are bigger.
    @wanton delta That's true, it kept adding
subtle blade
#

So again, you would have to

(3) min/max your coordinates

wanton delta
#

idek if its worth a PR, tbh. it was just me being silly

subtle blade
#

Martoph sent an example for one of the 6 coordinates. You should max 3 and min 3

wanton delta
#

(even though it should 100% respect the jansi passthrough variable!)

hot fable
#

What if I create a variable and take the small one for example?

#

if(x < x1){
x = small;
x1 = bigger;
}

wanton delta
#

i provided an example

subtle blade
#

That's exactly what min/max will do for you in a single line

wanton delta
#

you should use that

subtle blade
#

Math#min() will grab the least of two values, Math#max() will grab the greatest of two values

hot fable
#

I don't know how that is used

subtle blade
#

I just told you how it's used ;P

wanton delta
#

double maxX = Math.max(loc1.getX(), loc2.getX());
@wanton delta

hot fable
#

a okay

wanton delta
#

if you dont know how to use something

subtle blade
#
minX = min(loc1.x, loc2.x)
minY = min(loc1.y, loc2.y)
minZ = min(loc1.z, loc2.z)```
wanton delta
#

its better to google it

subtle blade
#

Same for the max

keen compass
#
double minX = Math.min(loc1.getX(), loc2.getX());
double maxY = Math.max(loc1.getY(), loc2.getY());
double minY = Math.min(loc1.getY(), loc2.getY());
double maxZ = Math.max(loc1.getZ(), loc2.getZ());
double minZ = Math.min(loc1.getZ(), loc2.getZ());
Location newLocation = new Location(((maxX-minX)), ((maxY-minY)), ((maxZ-minY));```
subtle blade
#

Or just be Frostalf :((

wanton delta
#

what is newLocation supposed to be

subtle blade
#

The fuck are you doing with the ^ operator though, lol?

#

That isn't "squared"

keen compass
#

yeah I realized that after I sent it

#

all well they can fix it

wanton delta
#

is that supposed to be the midpoint

#

i dont understand lol

upper hearth
#

I don't really understand why they're doing what they're doing anyways

#

iterating over the difference?

keen compass
#

if I remember, they wanted the distance between two points

wanton delta
#

distance between points can be called with location#distance which we already provided

upper hearth
#

but Location#distanceSquared() is a thing

keen compass
#

yes I know

#

but I assume they insist doing it themselves lol

subtle blade
#

Why don't we ask. What's your goal, iTz?

buoyant lodge
#

does anyone know how to fix hopper lags?

upper hearth
#

Have less hoppers

wanton delta
#

@buoyant lodge composters on hoppers is proved to be the best way

subtle blade
#

Wow that name is horrible

buoyant lodge
#

cuz players in my server are using afk fish

finite stag
#

Not related to the Spigot API itself, but is it a bad practice to develop a resource that has some similar features to an already pre-existing paid resource?

wanton delta
#

i say go for it

keen compass
#

no

subtle blade
#

All yours for the taking, friend

keen compass
#

as long as you are not directly stealing their code and you do it yourself, by all means go for it

wanton delta
#

if said resource hasnt been updated in a while i would encourage it lol

keen compass
#

I encourage it regardless

#

competition is healthy

wanton delta
#

tru

finite stag
#

Ok just checking.

#

Thanks ❤️

wanton delta
#

would it be silly to create PR for adding a jansi.passthrough check

upper hearth
#

Choco's commas are scary.

"All yours for the taking, f̋̕͡r̉̉̽ỉ̚͘ẽ̋̕ń͂͞d̛͝͡"

keen compass
#

Depends on what that purpose is for @wanton delta I mean, currently it works fine with the exception of the debugging problem you had

buoyant lodge
#

@wanton delta how do you use composter on hopper?

wanton delta
#

well if you have a terminal deemed "unsupported" according to jansi

#

but can support it

#

you wont be able to get colors in your console... which is really my main point

keen compass
#

but how would you determine it can support it?

wanton delta
#

bukkit already does so

#

im detecting for the flag -Djansi.passthrough (which jansi uses as well)

#

which forces support

hot fable
#
        Location loc1 = Bukkit.getPlayer(player1).getLocation();
        Location loc2 = Bukkit.getPlayer(player2).getLocation();
        
        double maxX = Math.max(loc1.getX(), loc2.getX());
        double minX = Math.min(loc1.getX(), loc2.getX());
        double maxY = Math.max(loc1.getY(), loc2.getY());
        double minY = Math.min(loc1.getY(), loc2.getY());
        double maxZ = Math.max(loc1.getZ(), loc2.getZ());
        double minZ = Math.min(loc1.getZ(), loc2.getZ());

        for(double x= minX; x >= maxX; x++) {
            for(double y= minY; y >= maxY; y++) {
                for(double z= minZ; z >= maxZ; z++) {
                    Bukkit.broadcastMessage(x+" " + y+ " " + z);
                }
            }
        }
keen compass
#

oh ok, I guess you could add it, but I see it being abused by those that are trying to use command prompt with that flag though

#

and then wondering why its not working XD

wanton delta
#

well i mean

subtle blade
#

x >= maxX

#

<

#

Not >=

wanton delta
#

you can add flags all the time and them not working

hot fable
#

fuck

wanton delta
#

idk if theyre designed to garuntee work

upper hearth
#

iTz what are you trying to do

subtle blade
#

(this applies to all of them)

#

but yes, what are you trying to do lol

wanton delta
#

it looks like get all coordinates in a cuboid region of two locations

keen compass
#

why are you trying to loop through the min and max values?

#

o.O

wanton delta
#

aka worldedit

keen compass
#

oh, cuboid

#

there is already a method in the API for getting that

#

its called axisAlignedBB();

subtle blade
#

BoundingBox, actually

#

But yes, you're right

wanton delta
#

AxisAlignedBB is the nms right

subtle blade
#

Correct

keen compass
#

right that is NMS

#

XD

hot fable
#

I want to save the blocks from point A to B and then get the distance x, y, z of all the blocks @upper hearth

keen compass
#

Choco is correct on the API name

wanton delta
#

get the distance of them? huh?

upper hearth
#

Get the distance of the blocks from what

hot fable
#

from player

#

similar to a schematic

wanton delta
#

and what do you plan to use all this information for

keen compass
#

the code for schematics loops through the way it does because of how the information is stored about the blocks in NBT format

hot fable
#

But I'm not interested in doing that

upper hearth
#

What's the goal then

#

Are you just pasting blocks?

hot fable
#

I want to save the blocks from point A to B and save them in a list, later for example a player puts //paste returns to put the blocks from another location

keen compass
#

ok, but why would you need the distance?

#

what you are wanting to does not require knowing the distance of the blocks from the player at all.

upper hearth
#

Pasting relative I guess?

wanton delta
#

if you were to paste relative using distance that seems like a bad idea

keen compass
#

you could, but essentially all you do just mark a coordinate as 0,0 and you start from there.

#

well 0,0,0. The block right in front the player when pasting would be considered 0,0,0 as well.

hot fable
#
      for(double x= minX; x <= maxX; x++) {
            for(double y= minY; y <= maxY; y++) {
                for(double z= minZ; z <= maxZ; z++) {
                    Location l = new Location(Bukkit.getPlayer(player1).getWorld(), x, y, z);
                    Block block = l.getBlock().getState().getBlock();
                    Bukkit.broadcastMessage(block.getType()+":"+block.getData());
                }
            }
        }

And with this I already get all the id of the blocks

#

Thank you very much for your help

wanton delta
#

when running applyPatches, should i add the src/main/java/net/minecraft/server/ directory to .gitignore? how does stash handle this?

chrome lark
#

no, the scripts handle that using the decompiled sources folder and patch

wanton delta
#

so i should commit as-is, correct?

keen compass
#

after you run the applyPatches yes, you should commit the changes.

wanton delta
#

great

fossil jetty
#

@wanton delta

#

yoo

#

anyone?

keen compass
#

o.O

fossil jetty
#

anyone have experience with multi verse?

keen compass
#

I am sure plenty are

#

probably should just ask your question

sullen flare
#

is there any 1.8 combat fix for 1.15

buoyant lodge
#

is changing server type from spigot to paper isn't correct?

#

im trying to change spigot to paper, but the result make my server wont be turn on

#

15.04 05:57:33 [Server] ERROR Could not load paper.yml, please correct your syntax errors

#

ERROR Unable to load server configuration

#

WARN Advanced terminal features are not available in this environment

crimson raft
#

@buoyant lodge read the error. It says paper.yml cant be read. Is it there? Is it maybe corrupt?

buoyant lodge
#

it's in my server folder

#

what should i do?

sweet hemlock
#

If you didn't edit paper.yml, back it up or delete it and try again

buoyant lodge
#

before i edit paper.yml server can run well, but after i edit paper.yml, bukkit.yml, spigot.yml and server properties then i restart the server, it made the server crash

sweet hemlock
#

You may have removed spaces in the configs

#

.yaml files depend heavily on spaces as indents

buoyant lodge
#

i did the server on after deleting paper.yml and paper jar

#

is it possible to be crash again after i edit paper.yml?

sweet hemlock
#

if you misformat it, then the server will not start

buoyant lodge
#

oh, okay thanks for that 😀

sweet hemlock
#

npnp

#

^^

fossil jetty
#

is there any way i can get my friend to join my server rn?

#

since he not on localhost

orchid garden
#

@fossil jetty you need to portforward the port 25565 then give him your public IP

#

there is no other way, other than purchasing from a host

buoyant lodge
#

15.04 06:30:20 [Server] INFO 2020-04-15 06:30:20,702 main WARN Advanced terminal features are not available in this environment

#

after i setting paper.yml

#

server crashed again

#

something wrong with this settings

sweet hemlock
fossil jetty
#

thx

buoyant lodge
#

i pasted the log

leaden heath
#

line 144 of the yml

#

114*

fossil jetty
#

if anyone is willing to help me setup a fully customized server that is really easy to do a matter of fact with the knowledge they know and set everything up for me and teach me id be more than happy to pay them please dm me if you are interested

mossy zenith
sweet hemlock
#
Caused by: org.yaml.snakeyaml.scanner.ScannerException: mapping values are not allowed here
 in 'string', line 114, column 11:
          hard: 96
              ^

The logs are telling you what's wrong

#

maybe do something about that :v

buoyant lodge
#

ohhhh

#

i will try to get back to default

frigid ember
#

@fossil jetty you could use ngrok, then you don't need to port forward

buoyant lodge
#

yeah that "hard" thingy made my server crash, thank you so much guys 😉

#

now i can turn on my server😋

fossil jetty
#

if anyone is willing to help me setup a fully customized server that is really easy to do a matter of fact with the knowledge they know and set everything up for me and teach me id be more than happy to pay them please dm me if you are interested

frigid ember
#

you need to use a host

#

Just use a host @fossil jetty

#

if you can pay already

#

people will just be taking your money

fossil jetty
#

@frigid ember its not just about that

sullen flare
#

h

haughty stag
#

@fossil jetty You want a fully customized server then don't buy from those Minecraft Server Resllers. Those are scams. Go with a company that has decent virtual machines. 1 I can recommend is Digital Ocean. I think for $20/m you can get a 4 GB, 80 GB SSD, and 4 TB transfer.

From there you setup the FTP/SSH from their control panel, download something like Putty so you can run the server from your computer. You can download/buy one of those minecraft control panels that will in the long run make it so you don't have to run it through putty.

In the end what you are left with is a server you can customize to your liking whenever/however you want. The transfer rate of 4 tb is not bad at all, and that is only for inbound, outbound is free. The numbers have run that Minecraft is typically an average of 0.1Gb/hr/user can probably handle 56 concurrent users for a whole month. If your getting 56 concurrent users for a whole month you can dish out some more money to upgrade the server.

cobalt thistle
#

Hello, i want to create a minecraft server with some plugins on Athernos (Athernos is the host) but, i'm new and i don't know how to do ? someone can help me ? Thank you.

leaden heath
#

aternos only allows plugins that are pre approved, so that makes it easier to set up if they're already on there. The have a lot of tutorials on their website. You can also join their discord and ask in the Aternos help section, i'm over there.

haughty stag
#

^^^ @fossil jetty example #1 why you shouldn't go for a Minecraft Server Reseller lol.

leaden heath
#

aternos has free server and takes no payments

#

so it's a really good option for people who aren't very tech savvy

fossil jetty
#

@haughty stag cuz i want to be apart of making it 🤷‍♂️

#

and process

frigid ember
#

I mean you really don’t have to be tech savvy to install a Minecraft plugin

leaden heath
#

you'd think so, but some people have no idea what they are doing

#

the aternos help channel is a mess sometimes

fossil jetty
#

@haughty stag thanks for the info man ❤️

haughty stag
#

Didn't know it was free. I guess you get what you paid for.

leaden heath
#

it's able to handle vanilla fairly well for being a free server host, but once you start adding mods and stuff it really goes downhill. A few plugins is safe though

sour perch
#

it's meant to play with some friends, mostly vanilla

finite pine
#

Can someone help me?

fleet crane
#

?ask

worldly heathBOT
#

If you have a question, please just ask it. Don't look for staff or topic experts. Don't ask to ask or ask if people are awake or available. Just ask the question to the channel straight out, and wait patiently for a reply.

finite pine
#

oh

#

how would i check if a player has more than 1 item in their inventory?

fleet crane
#

in skript? no idea personally

finite pine
#

no java

#

skript is just my disc tag

solemn grove
#

no java

#

python..?

fleet crane
#

no, java

solemn grove
#

oo

#

Player#getInventory ?

finite pine
#

yh i got that

#
        PlayerInventory inv = p.getInventory();
        ItemStack[] pop = inv.getContents();
        for(ItemStack item : pop){
            if(AEAPI.isASoulGem(item)){
                if(pop.length > 1){
#

basically it's a gem, you have more than 1 in your inv it's disables

fleet crane
#

you dont want pop.length

#

you want item.getAmount

#

note that applies to any single stack, not two stacks of 1

finite pine
#

yh i'm looking if their is 2 stacks of 1

haughty stag
#

One of the reasons why you should name your variables right, so you don't run into issues like calling pop instead of item.

#

pop.length is always going to give you the size of the inventory

fleet crane
#

Arrays.stream( player.getInventory().getContents() ).filter( AEAPI::isASoulGem ).mapToInt( ItemStack::getAmount ).anyMatch( (amount) -> amount > 1 );

#

something like that would work using streams

#

or rather

#

Arrays.stream( player.getInventory().getContents() ).filter( AEAPI::isASoulGem ).mapToInt(ItemStack::getAmount ).sum() > 1

#

oh wait

#

theres a method for that

#

player.getInventory().containsAtLeast( soulgemItem, 2)

#

that also works

finite pine
#

Oh

fleet crane
#

@iron ravine my bad, fixing

#

unsurprisingly 9/10 donations are $10

#

no

#

getting specific medals is not the aim of the system

#

so it can be very hard to do so

#

they work like currency so 225 is I think the lowst amount that could get nether star

#

and 375 after that

#

basically everything has a value and your badges+medals add up to the total using the fewest number possible

finite pine
#

So basically it sort of works but when i put in an inventory slot anywhere other than my hotbar both gems will go to slot 0 & 1 and start consuming souls

narrow basin
#

i have a problem

#

i just started to create my first plugin but i cant

proud sleet
#

Well, what's not working?

narrow basin
#

new Command(this);

#

this

#

idk why

#

i am trash

#

so expect me to ask you stupid questions

proud sleet
#

Why are you trying to directly initialize a new Command instance?

#

Commands should generally be made in their own class using extends CommandExecutor

narrow basin
#

ik

#

BUT

#

i wanted to create it in a new class

#

and i created it

tiny dagger
#

there may be reasons to use command instead

#

like registering it dynamically

proud sleet
#

Can't see a reason why you'd ever want to register commands dynamically?

narrow basin
#

well

#

i will move it in the Main class

proud sleet
#

Unless, say, reflection-based command registration for kit commands or something

#

But that's done through command registry

leaden heath
#

how about we solve the problem instead of making it more complicated

#

@narrow basin did you make a new classs for the command

tiny dagger
#

thre are plenty of reasons why you would want to do it dinamically

narrow basin
#

@leaden heath ya i did

leaden heath
#

did you override the onCommand() method?

#

with the correct arguments?

narrow basin
#

i think yes

#

i am trash

velvet halo
leaden heath
#

onCommand​(CommandSender sender, Command command, String label, String[] args)

narrow basin
#

ok i did it

leaden heath
#

Ok, so what else is next. Did you register the command

narrow basin
#

yay

#

i am trash

#

and i dont understand anything

leaden heath
#

Does your main class have an onEnable() method

narrow basin
#

uhhh no

proud sleet
#

well, that's the first step hahaha

narrow basin
#

ik

#

i accidently removed it

#

now back from the start

leaden heath
#

Okay, so do you have your command class with the onCommand method, and the class implements CommandExecutor?

narrow basin
#

well now i broke everything

bronze marten
#

Lmao

narrow basin
#

omg

#

oh

#

why Command cannot resolved to a type

#

?

tiny dagger
#

it means you're trying to use a paramter that's not of the same type

#

or something like that

narrow basin
#

i fixed it

#

but now i have a bigger problem

#

omg why is so hard

#

The type Command must implement the inherited abstract method CommandExecutor.onCommand(CommandSender, Command, String, String[])

#

why

#

what private Main plugin; does?

bronze marten
#

Initializes a variable

tiny dagger
#

thats your main plugin instance

coarse shoal
#

Does Spigot sending emails usually take longer than ~10 minutes? 🤨

narrow basin
#

what is the problem with this?

#

new Command();

tiny dagger
#

ugh

sour perch
#

Command is an abstract class

tiny dagger
#

it seems like he is adding whatever the compiler is telling him to do to remove compiling errors

narrow basin
#

lol

coarse shoal
#

I feel many more people would use Discord > IRC

coarse shoal
#

@atomic rapids are forum mods able to mark accounts as verified?

atomic rapids
#

Please use the bot when possible.

coarse shoal
#

Sorry?

#

Use the bot how?

atomic rapids
#

Nevermind - what exactly are you referring to

coarse shoal
#

I had to change my email, and I've been waiting ~25 minutes for the confirmation email to be sent.

atomic rapids
#

That is out of my hands - sorry

coarse shoal
#

Riighto

fleet burrow
#

Why are there some classes missing in the source file outputs of buildtools?

zealous yoke
#

which classes?

fleet burrow
#

"ContainerRecipeBook"

#

AutoRecipeOutput

#

RecipeCrafting, MinecraftKey

fleet burrow
#

They exist in the jar ofc but not in the source files given

chrome lark
#

classes which aren't modified are not in the source tree, otherwise you'd need to fix every decompiled class with issues which gets a bit of a PITA

fleet burrow
#

Is there any way I could get all usages of a class or something then?

chrome lark
#

We have some tricks elsewhere, basically the idea would be that you'd get a folder with every class not in the server jar, IDEA lets you add that as a source path, so you can use standard IDE features properly

frigid ember
#

aye

#

i love this web its helping me alot of making my dream

#

i already made the hub

#

got the skywars map but for some thing its making the /sw setspawn Map and /sw setmainlobby

fleet burrow
#

How can I open a ContainerWorkbench?
I tried doing this but e.getPlayer().openInventory(workbench.getBukkitView()); throws an EventException

    @EventHandler
    public void onInventoryOpen(InventoryOpenEvent e) {
        if (!(e.getInventory() instanceof CraftingInventory)) return;
        ContainerWorkbench workbench = new ContainerWorkbench(1, ((CraftInventoryPlayer) e.getPlayer().getInventory()).getInventory(), ContainerAccess.a);
        e.setCancelled(true);
        workbench.setTitle(new ChatComponentText("Crafting"));
        e.getPlayer().openInventory(workbench.getBukkitView());
    }```
frigid ember
#

i have no idea i just joined yesterday

fleet burrow
#

I can confirm that workbench.getBukkitView() is not null

sly jasper
#

Use Bukkit.createInventory() and InventoryType.WORKBENCH

fleet burrow
#

Can't

#

I need to use ContainerWorkbench

#

For what I am doing

sly jasper
#

Okay

frigid ember
#

jay

#

can u help me in something?

sly jasper
#

Sure

frigid ember
#

i dont know what file to do /sw setmainlobby or /sw setspawn Map

sly jasper
#

You could use the getConfig() That's the easiest way to write to a file in spigot

dusky herald
#

Uh

#

That's not a very complete way to describe doing that.

#

Make a new file, next to your plugin.yml

#

called config.yml

#

and you can define it however you please

#

then use saveDefaultConfig(), etc

sly jasper
#

There are plenty of documentations out there that explain that . Because of that I thought that it'd be enough sry. First day writing here for me

frigid ember
#

me to jay

dusky herald
#

Yeah, there are plenty of docs, it just helps to describe a little better. getConfig() is how you would use it, but it doesn't help when they dont know how to use it possibly, lol.

frigid ember
#

and thanks @dusky herald

sly jasper
#

But I'm a dev for 6 years. You sounded like you started programming recently

#

Sorry if my assumption is wrong

frigid ember
#

me?

sly jasper
#

Yeah 😅

frigid ember
#

yeah i just started yesterday and i already made my hub 🙂

sly jasper
#

Nice. My progress wasn't that fast in my early days 😂

frigid ember
#

can i join ur server pls

#

can i have the ip address?

dusky herald
#

Eh, it's all relative. Usually when you start you go back and change everything because you know better later, lmao.

sly jasper
#

can i join ur server pls
@frigid ember don't have one atm sry

frigid ember
#

ok

dusky herald
#

I definitely have not been doing it for 6 years.

sly jasper
#

Eh, it's all relative. Usually when you start you go back and change everything because you know better later, lmao.
@dusky herald that's always amazing

dusky herald
#

I only started back up a few days ago.

#

pretty much was like I forgot everything anyways

dark shuttle
#

So i've tried this

for (RegisteredListener li : PlayerJoinEvent.getHandlerList().getRegisteredListeners()) {
    Listener listen = li.getListener();
    if (listen instanceof EssentialsPlayerListener) {
        PlayerJoinEvent.getHandlerList().unregister(listen);
        break; 
    }
}

But it seems doesnt work, i tried to unregister Essentials PlayerJoinEvent listener

old barn
#

Why can't I use the event
AreaEffectCloudApplyEvent ?

silk bane
#

you can, you're probably just doing it wrong

velvet halo
#

HandlerList.unregisterAll(listener);

#

EventObject.getHandlerList().unregisterAll(Listener)

dark shuttle
#

The thing that i dont have the listener instance

old barn
#

I can't import AreaEffectCloudApplyEvent, why?

dark shuttle
#

And i need the listener instance from that method, like get all listeners, and if its instance of a class, i will store it to a field and then unregister the listener

restive pivot
#

can i load a 1.15.2 world in a 1.14.4 server and just have it delete the 1.15.2 stuff?

frigid ember
#

who has experience with tcp serversin java

#

with layer 4 servers

finite belfry
#

i have some questions

frigid ember
#

np son

#

same

#

¯_(ツ)_/¯

finite belfry
#

how can i disable compass teleport

#

and is there any working compass navigator plugin in spigot for 1.15,2?

frigid ember
#

its in worldedit

#

you can't just disable it

#

its part of worldedit

finite belfry
#

ok

frigid ember
#

remove worldedit

#

if you don't want the tp

#

ok so i have been working on a tcp / ip java server

#

and i asked my friends to try attack it and absolutely fuck it up

dusky herald
#

They're all TCP though?

frigid ember
#

i need to protect this bad boy

dusky herald
#

Lol

frigid ember
#

they managed to slow down my whole pc*where i hosted it from)

#

to 2fps

#

i had 2fps

#

with mc open

sour perch
#

you can disable it, that's what permissions are for

frigid ember
#

they really did fuc it up

#

@dusky herald is there a way i can protect

dusky herald
#

You have to be able to understand how they slowed it down

pale plaza
#

Who Can DM Me A Good Faction Plugin 1.8

dusky herald
#

I couldn't give you an answer, you have to know how they're doing it.

#

Factions?

#

lol

frigid ember
#

thx guys now i have sky wars 🙂

#

is a basic tcp server safe

#

is it good if i say i made a game

#

like if Minecraft sent packets using tcp

dusky herald
#

uh

#

they all use TCP

frigid ember
#

alright

dusky herald
#

use them both

#

use TCP and UDP

finite belfry
#

i made a server for minigames

#

we have skywars bedwars kitpvp buildbattle parkour skyblock survival and skyblock

#

all of that made by 3 people

dusky herald
#

lol

jaunty wraith
#

Hi can someone help me with logblock;(

frigid ember
#

@vernal lance dm?

kindred vector
#

Can phone verification be added to spigot 2fa?

velvet halo
#

You can access the email via phone 🙃

crimson sandal
finite belfry
#

hi is there any compass navigator plugin for 1.15?

muted spindle
#

That or you could code one. It takes 5 minutes

finite belfry
#

thx

dusky herald
#

Google?

#

Never heard of it

pale plaza
#

Who Can Send Me A Shop Link Like Any Sign Show What Ever 1.8

zenith siren
#

Is there any way to get spigot permissions from a bungee plugin?

kindred vector
#

Skrump you could use luckperms, install luckperms bungee and luckperms spigot on your servers. connect them with a db and you should be good to go

#

Used it for a while now seems decent

frigid ember
#

hii.. im just made a gui... but im dont know how to put commands when he clicked on skull/withersukull, helpme thankyou 😄

#

player.chat(“/command”);

#

okay thankyou

tiny dagger
#

i think it was without / but i might be wrong

pale plaza
#

@kindred vector I Need 1.8 Thats 1,15

#

1/5

#

JEEZ

#

1.15

subtle blade
#

Don't use chat() to send a command, please. Use chat to chat

coarse shoal
#
disconnected with: DecoderException : java.lang.IndexOutOfBoundsException: readerIndex(0) + length(1) exceeds writerIndex(0): UnpooledSlicedByteBuf(ridx: 0, widx: 0, cap: 0/0, unwrapped: PooledUnsafeDirectByteBuf(ridx: 2, widx: 2, cap: 4096)) @ io.netty.handler.codec.MessageToMessageDecoder:98
#

What does this mean? Error I was getting with WorldEdit/Guard commands on BungeeCord (1487). Moved to Waterfall and the issue isn't present anymore?

pale plaza
#

@subtle blade Was U Talking To Me ????

bronze marten
#

why don't use chat btw

#

in the docs it says or runs a command

pale plaza
#

@kindred vector Whats The Commands

subtle blade
#

Because we have a dedicated method to perform commands. Chat forces the player to send a message

#

performCommand does not

bronze marten
#

so you prevent the player from sending messages when using performCommand with an invalid command

subtle blade
#

Or you use the boolean result from performCommand()

bronze marten
#

but the logical difference is the same other than that?

kindred vector
#

theres the older version

#

Commands are on the page

bronze marten
#

because sometimes Ive seen plugins using ChatEvent for some command listeners, those won't be called with performCommand, right?

subtle blade
#

You shouldn't ever be using the chat event to listen for commands. Ever. Period.

bronze marten
#

lmao

#

I can't speak for everyone

subtle blade
#

The PlayerCommandPreprocessEvent should be called and listened to in order to prevent unwanted commands (and it too shouldn't be used to execute command logic)

velvet halo
#

^

subtle blade
#

Basically, use performCommand() for commands, use chat() for chat messages

#

lol

pale plaza
#

And Can I Stop Cus I Dont Want To Have To Pay For My faction Server

#

Bascily When I Test /f claim square It Says Dont Have Enough Money ???

velvet halo
#

You should contact the author themselves if you have any issues.

subtle blade
#

Also, please write proper sentences. You don't have to capitalize every word ;P Just the start of a sentence and proper names

velvet halo
#

If you don't get support then don't use the plugin.

pale plaza
#

Ol

#

i need a faction plugin plz

sullen plank
#

🤦

kindred vector
#

Lewis you really need to learn to be patient

velvet halo
kindred vector
#

and u know have manners

dusky herald
#

Factions should have a wiki that shows you how to set it up.

#

If you need support when you have configuration information on the internet, freely available at any time then you should reconsider running your own server.

pale plaza
#

@velvet halo HA

dusky herald
velvet halo
#

@pale plaza Are you done?

pale plaza
#

No XD

dusky herald
#

"econCostCreate": 100.0,

pale plaza
#

@dusky herald I Cant Find That

velvet halo
#

Search harder

#

easy peasy

dusky herald
#

Did you even bother reading the guides?

pale plaza
#

YEs

dusky herald
#

"econEnabled": true,

#

set it to false

pale plaza
#

Ok

#

If I Find The Plugin XD

sullen plank
#

wdym? Just open the config 🤔

dusky herald
#

wym find the plugin

bronze marten
#

ctrl + f

muted spindle
#

alt + f4

sullen plank
#

^^

dusky herald
#

press the power button on your pc and hold it down

muted spindle
#

Dig up the side walk and unplug the power cable

bronze marten
#

just pull the plug

muted spindle
#

Nuke the local power station

dusky herald
#

go to your ISP and ask them how to setup minecraft plugins

#

they run the internets they should know

pale plaza
#

@sullen plank In The Plugins Folder

muted spindle
#

Ask trump

#

He knows things

#

right?

frigid ember
#

ask trump’s wife

muted spindle
#

ask his 17th brain cell

pale plaza
#

@velvet halo i got the one u said

velvet halo
#

wdym?

#

many confusion

dusky herald
muted spindle
#

confused unga bunga

dusky herald
#

Go to C:\Windows and delete that

#

problem solved

frigid ember
#

best solution

subtle blade
#

(don't joke about that, he might actually do it)

muted spindle
#

Windows by default doesn't allow you to delete that folder nowadays

#

the OS protects it

bronze marten
#

sudo the crap out of it

muted spindle
#

You'll have to go above and beyond with CMD to get rid of it

velvet halo
#

I am gonna neck myself if he actually does it

dusky herald
#

¯_(ツ)_/¯

#

Still better than starting your laptop one day and getting:

#

"WINDOWS FAILED TO BOOT"

#

wtf

#

bot is being a hoe

thorny kelp
#

How to detect a minecart chest

#

block.getType() == Material.CHEST_MINECART

#

Doesn't seem to do the trick on a PlayerInteractEvent

bronze marten
#

its an entity right

#

PlayerInteractAtEntityEvent?

thorny kelp
#

I'll give that a try

tranquil yoke
#

Hello i need to find plugin like that. Śmierci-deaths Gracze-players can some body tell me when i can find plugin like that please

pale plaza
#

@dusky herald BlackveiledToday at 15:34
"econEnabled": true, I Cant it I Is jar file

dusky herald
#

No?

#

/mstore/factions_mconf/instance.json

#

Read the configuration guide.

pale plaza
#

Ok Send Me Link

dusky herald
pale plaza
#

@dusky herald Could I Screen Share U Dont Need To Talk ????

naive goblet
#

@tranquil yoke It's most likely to be a custom coded plugin.

pale plaza
#

@dusky herald How Would I Oppen While ITs On Me Desctop

dusky herald
#

I really dont wanna be a dick but, how could you run a server if you cant figure out how to configure it lol

#

I dont have time to walk you through these things

pale plaza
#

Its Just This One Plugin I Cant Find The EconEnabled

#

@dusky herald What if I Sent U The jar UDownload Edit It Then Send Me Back

runic turret
#

What is better to save player first join date at mongodb: java date object formatted or System.currentTimeMillis ?

dusky herald
#

You dont have to send me the jar

#

It's not in the JAR

#

It's in the configuration files for the plugin.

pale plaza
#

I Cant Find Legit

dusky herald
#

@runic turret Either way, it's going to be a current time. Date object is merely just a wrapper if anything for current time.

#

But, the Date Object could store the data

upper hearth
#

@pale plaza, are you looking in the /mstore directory?

dusky herald
#

in the format you prefer

pale plaza
#

@dusky herald Lookm At D,s

#

Dms

#

@upper hearth Whats That

runic turret
#

ah ok thank you

dusky herald
#

That's the folder, that I told you about 45 minutes ago to look at

upper hearth
#

It's where the factions config is.

pale plaza
#

There Is None

dusky herald
#

/mstore/factions_mconf/instance.json

#

Did you start your server?

#

It should create itself when you start it

upper hearth
#

I don't remember if /mstore generates in the plugins folder or the main server directory, but you need to check there

dusky herald
#

Yeah I've told him multiple times what to do

#

I'm not trying to baby sit how to navigate through folders

pale plaza
#

Im in game and i did /f config But Still Cant See it

upper hearth
#

Don't blame you

#

Not in game

#

In your server files.

pale plaza
#

Well My Server Support Told me ingame cus they cant see the config

dusky herald
#

type /plugins

#

ingame

pale plaza
#

Im in the config in game rn

dusky herald
#

is Factions on the plugins list?

pale plaza
#

Yes But No Config

upper hearth
#

If it's there your server support doesn't know what they're doing either. (Most likely, anyways).

pale plaza
#

Could u join im in game Plz It qwont work

upper hearth
#

You don't change the factions config in-game.

#

How did you put the Factions plugin in the server?

pale plaza
#

I Went To server file then secect it then upload

upper hearth
#

Right, you went to the plugins folder, yes?

#

Then uploaded?

pale plaza
#

I Fix XD

upper hearth
#

👌

narrow basin
#

i have a question

frigid ember
#

ugh i dont know how i could sync mysql data

#

so i dont have updates everytime someone breaks block.

#

if anyone has idea let me know

upper hearth
#

Why would you update your db for every block

frigid ember
#

well i mean crops

#

i have custom crops

#

and i need to save data to db

#

but if someone breaks it i need to remove it from db

boreal tiger
#

you dont need to save immediately

#

you can keep it in the memory

frigid ember
#

true

boreal tiger
#

and save afterwards

frigid ember
#

i do that

boreal tiger
#

ah right 😛

frigid ember
#

but how could i know which ones are in db and which ones arent

#

i do indeed setup custom UUID for each crop

keen compass
#

if you are using mysql you can use the update query. If it exists it will update it, if it doesn't exist it will create it.

frigid ember
#

i use sql and mysql

#

then i have sync function

#

but it doesnt work properly

keen compass
#

but all you have to do really is just have a queue in the background on a separate thread that just updates your DB.

frigid ember
#

hmm

boreal tiger
#

why do you need a uuid? wouldnt coordinates be enough to identify it?

frigid ember
#

well

#

its easier for mež

#

to handle it

hollow drift
#

Does anyone know if it's possible to make a one-off Spigot build but skip the remapping/versioning of NMS/CB packages? I'd really like to be able to set breakpoints in internal code when hunting for bugs.

boreal tiger
#

adding a uuid only adds unecessary complexity @frigid ember

frigid ember
#

well

#

thats true

#

well then i'll remove them

#

and rework it again

fossil jetty
#

can someone pls help me

#

im using ngrok

frigid ember
#

so just 1 question how would i know which ones i need to remove from db if i cache them into hashmap?

fossil jetty
#

to port forward

#

and idk what to do

#

it says active and shit

narrow basin
#

hey i am new here. so in eclipse you can add the spigot file from build path. how can i do this in intellij?

fossil jetty
#

pls someone

upper hearth
#

@frigid ember Only add them to the HashMap if you know they need to be removed.

#

Then remove all of them and clear the HashMap

#

If you do it that way

boreal tiger
#

you dont need it to be removed

frigid ember
#

i cache crops into hashmap couse i dont want to search sql everytime someone breaks crop on world.

boreal tiger
#

you just add them to the hashmap and have something save stuff every few minutes or seconds

pale plaza
#

Who Can Tell me good Item Edit Plugins For 1.8 So i Can Get Like Unbreakin 5

keen compass
#

use an array @frigid ember or setup a queue. Toss whatever into that array or queue that requires updating. Once processed remove it from the array or queue

frigid ember
#

but i want to remove ones that are broken in world.

upper hearth
#

So add them into the list when they break

frigid ember
#

but what if someone like places/breaks/places/breaks in same spot?

keen compass
#

add it back to the list again

#

if its not there

pale plaza
#

Who Can Tell me good Item Edit Plugins For 1.8 So i Can Get Like Unbreakin 5

upper hearth
#

If they place it remove it from the list, if they break it, add it to the list

boreal tiger
#

@pale plaza stop spamming

#

please wait

fossil jetty
#

use enchantplus @pale plaza

pale plaza
keen compass
#

the only other thing I would probably recommend you adding, is a thread that checks your DB for inconsistencies.

#

a utility that runs not so often, but essentially just checks your DB to ensure the coords you are tracking are still ones you want to track as well as checking to make sure none of your rows have invalid data, which can happen if you are updating a row and your server crashes for instance.

frigid ember
#

so sql UPDATE statement inserts if it doesnt find something to edit?

fossil jetty
#

@pale plaza yea

keen compass
#

yes

frigid ember
#

if i knew that before....

silk bane
#

storing locations of crops that are frequently broken/placed might not be a good use case for sql

frigid ember
#

what should i use then?

pale plaza
#

@fossil jetty Ok Thanks

hollow drift
#

so sql UPDATE statement inserts if it doesnt find something to edit?
@frigid ember That is not the case unless using something like "on duplicate key update"

fossil jetty
#

@pale plaza np

frigid ember
#

i could use this right:

update test set name='john' where id=3012
IF @@ROWCOUNT=0
   insert into test(name) values('john');
keen compass
#

sorry it wasn't update, it was the replace command that updates the row if it exists otherwise it inserts a new row

frigid ember
#

would json be better?

swift barn
#

what ip of the server

frigid ember
swift barn
#

with hashtag

frigid ember
#

no go there to check for ipš

swift barn
#

oke

silk bane
#

@frigid ember how do you need to be able to access your data?

frigid ember
#

all the time

#

fast

silk bane
#

as in

#

would you need to get all crops that a given player has

frigid ember
#

no

silk bane
#

or do you just need to look up by block position

frigid ember
#

i need to get if specific block player broken is crop

silk bane
#

just if it is a crop?

frigid ember
#

well mostly yes

silk bane
#

or more information

swift barn
#

whats ip of serverfrf

#

??

frigid ember
#

well i need its id and if its crop

swift barn
#

Bro

silk bane
#

its id?

frigid ember
#

well from id then i get drops from different file

swift barn
#

Ip whats the ip broo

frigid ember
#

alcyy STOP

swift barn
#

why

#

can u just tell me whats the minecraft io server

#

ip server?

silk bane
#

@frigid ember do you need access to crop information on other servers or something like that?

frigid ember
#

nop just 1 server

silk bane
#

so how about:

  • instead of a database, just use a HashMap<Location, CropId>
  • load on enable, save on disable
frigid ember
#

where should i save it?

keen compass
#

need the data base to save

frigid ember
#

i do that

silk bane
#

no you don't

frigid ember
#

but tehere is 1 problem

#

what if server crashes

silk bane
#

you can save it periodically if you want

frigid ember
#

well but i would need to clear database right? and then save new data?

silk bane
#

i'm suggesting that you don't need the database

#

just a file

frigid ember
#

what type of file?

#

yml

keen compass
#

wait, all you are doing is checking if the block broken is a crop?

#

nothing else?

silk bane
#

yeah

keen compass
#

you are not storing custom data of the crop?

silk bane
#

Location is configurationserializable

#

you can just dump it in your config file

#

or any yml file

frigid ember
#

i just store who placed it and its id and location

keen compass
#

don't need the id

frigid ember
#

i do

keen compass
#

just player and location

frigid ember
#

i do need it...

keen compass
#

for what?

silk bane
#

i think their id actually means crop type

frigid ember
#

i cant get custom drops if i dont know crops id..

silk bane
#

^

frigid ember
#

crop id is its name in config for drops

silk bane
#

i think the best solution here would be if Chunk supported persistent data containers

keen compass
#

well, you are better off then saving your data as binary and making use of NIO and using memory mapped file

silk bane
#

but they don't and i cba to write a PR at the moment

frigid ember
#

i have no idea how to use chunk stuff

#

im not that advanced.

silk bane
#

dw the spigot api doesn't support it yet anyway

keen compass
#

if you need to have an idea of how fast memory mapped files can be, if you do it right you can load 10million blocks of information in 3-6 seconds and save it in 3 seconds.

frigid ember
#

well it doesnt help me if i dont know how to use it :3

keen compass
#

the nice advantage of memory mapped files is that they will gracefully save if the server crashes

frigid ember
#

i dont know how to use them

keen compass
#

learn to use them

#

your plugin is one that should make every use of NIO

silk bane
#

it's fine, i doubt you need them

#

just serialise to yml periodically

keen compass
#

I wouldn't recommend that. YML isn't meant to be used for large storage

frigid ember
#

yml can be slow if you have 100000 seeds

#

tried it.

silk bane
#

use java serialisation

keen compass
#

serializing isn't going to improve it that much

frigid ember
#

base64

keen compass
#

but then we are back to just saving it as binary like I suggested

frigid ember
#

i'll look into NIO

keen compass
#

there is a lot in the Java NIO package

#

so there isn't just memory mapped files there, there is other packages in there that your plugin could make use of

frigid ember
#

ye but i dont know them.

keen compass
#

Well, looks like its a good time to broaden your Java knowledge then 😉

#

and you have a perfect use case in learning it as well

#

so it should make it easier in applying some concepts lol

frigid ember
#

ah for now i'll stick to hashmap and sql, im not into learning so much. i still have plenty of time.

boreal tiger
#

how do I get the nbt for a block?

bronze marten
#

Ah yes hashmap storage is the best

naive goblet
#

Depends

bronze marten
#

Everything depends in cs lmao

#

Easy out of jail card for tests

ashen stirrup
#

Can you internally delete a plugin?
e.g /plugin delete Vault
And then it deletes the Vault.jar

naive goblet
#

Lmao no

keen compass
#

yes

bronze marten
#

Yeah possible

naive goblet
#

There is no really command for it as far as I know.

keen compass
#

system commands can be called in java

bronze marten
#

Just get plugins datafolder, then move one directory up, get Vault.jar and delete it

naive goblet
#

system commands can be called in java
@keen compass That's true

keen compass
#

however, this is what permissions are for. If you want to prevent such things you would set the perms to be able read but not modify the jars

#

on windows however sometimes you can't delete the jar other times you can. Just depends how windows feels lol as well as permissions are done differently

naive goblet
#

lol so tru

keen compass
#

in linux though, the server has the same permissions as the user that launched it. So that means if you launched the server as root, then that means the plugin can do everything that the root user can do. Hence why you shouldn't run it as root or any privileged user 😉

#

just a note as to another reason to not use root

naive goblet
#

Root is best :/

frigid ember
#

^^^^

#

imagine having iptables and running root mauahahha

#

which event gets triggered when dispenser uses inside of it?

fossil jetty
naive goblet
#

I mean I'd probably hash iptables

fossil jetty
#

join up

#

who tryna help me make a sevrer

#

server*

#

cannon server

boreal tiger
#

Is it possible to get a tile entity without reflection?

naive goblet
#

Hmm there exist methods like getTileEntities in spigot when I searched in the docs but they seem to be missleading. I am not sure.

bronze marten
#

Thats inside the Chunk class, gets all tiles of a chunk

silk bane
#

spigot gives you TileState extends BlockState

#

with which you can do what the API deems you worthy of

boreal tiger
#

mhm Ill take a look at the docs thanks

pale plaza
#

Who know Any Infinate Cobble Stone Wall Genarators

scarlet wigeon
#

Not really what this channel is for Lewis

naive goblet
#

Lewis I think you can google that by yourself.

hot fable
#

How can I put a block with its data in a location?

keen compass
#

o.O

#

you want to set a block to something at a certain location?

hot fable
#

Yes

#

I have this:

l.getWorld().getBlockAt(l).setData((byte)data);
l.getWorld().getBlockAt(l).setType(material);
#

but not found

frigid ember
#

ah time to make flat square util for custom 3x3 and so on hoes

subtle blade
#

Also, please only get it once

#

Don't fetch the block twice, there's no reason to

frigid ember
#

?

subtle blade
#

(and for the love of God, update to post-1.13. if you have already, don't use setData())

#

RE: iTz

modern sequoia
#

it actually does not make a difference to get the object once

#

its only a reference

#

oh wait it is not

subtle blade
#

Oh boy I hate when people say that lol

modern sequoia
#

you don't have to if it did not had the parameter

subtle blade
#
    @Override
    public Block getBlockAt(int x, int y, int z) {
        return CraftBlock.at(world, new BlockPosition(x, y, z));
    }```
#

Cache it

#

Don't fetch it twice

frigid ember
#

sıkıntıma bakacak varmı