#help-archived
1 messages · Page 21 of 1
You'll find yourself mostly using Arrays, ArrayLists and sometimes HashMaps for stroing your data
Yeah I got a guy
Derek Banas is the god send for learning anything programming
at least for me
thats where i watched the videos about patterns
RumDum learn about encapsulation, abstraction, dependency injection, inheritance & polymorphism.
^
im guessing abstraction is the hardest part ?
Not at all
yikes
Using abstraction well is the hardest part
and im also guessing its gonna take a lot of practicing to master it
Well RumDum I'd say make something easy first and be sure that once you've done with it you should've understood literally everything you did.
When someone spoonfeeds you code. Ask what the hell that code will do don't juse copy paste lol
^
when should you rather use a set to a list
when you don't want duplicates
Set is a list of keys
linkedlist
my sun is gone
can also do no dups right?
no you could want a linked hash set iirc
Understanding how Set works vs List is really important
It's the set function to not have duplicates of elements
Lists have a .get function
sets dont gave a method to get an index
Sets must be iterated over
So for instance having an array of players then set would be prefered over a list.
u are making it harder for urself
blocks perhaps ?
sets tend to have much quicker lookup
It's entirely situational, Retrooper
for non dups
^
@subtle blade CHANGE MY NAME
oof
OMG THis spigotmc system ass
Yes change my name as well please
fixed
xD
ffs
Give me my spigot name :/
OMG
LOL
😛
sets tend to have much quicker lookup
And the answer to that is the key to understand the difference between Set and List
choco
Am I allowed to be called Laeven or is that a nogo?
retrooper user doesnt exidt
exist
idiotic spigotmc system
lmao
who is retrooper
check spigotmc
And the answer to that is the key to understand the difference between Set and List
It's not really a key but rather understand the different concepts.
I don't know whether or not changing the name will screw with the bot
Well ig you missed my pun then
If we leave and rejoin would we be able to change it then Choco?
I was thinking the same. It may refresh if you leave and rejoin
I tried to leave
Just that I boost :[
RetrooperToday at 10:26 AM
nice I quoted the wrong thing
even if you change your name and tag id
I don't know whether or not changing the name will screw with the bot
Please add some sort of update username command :p
is it easy to make a plugin for nether water ?
yes
Shouldn't be too hard
dunno
set the above block you're looking at to water
I mean static instance of main seems to be good
and replace water bucket with water
i was told that i shouldnt abuse static
How do I ban a player from the console in java?
But people avoid too much
ban <player>
lol
no /
the unban command in spigot is weird
./pardon
or in the vanilla jar
xD
oh yeah
no
it is weird
eclipse bro
oh ban a player in code
i was told that i shouldnt abuse static
For instance looping through a static list and adding like 10000 elements to it wouldn't certainly be a good idea.
But I mean statics doesn't go into the garbage collector
That's not the reason we advise against static. In fact, we don't tell people not to use static. We encourage its use so long as it's appropriate to do so
Yaaa
The abuse comes in when people use it as a means to access it from another class
ive read so much about it
A quick fix
but i still dont understand what it does
Indeed
lol
It assigns a member to the class rather than an instance
It's used mostly for constants to be shared between all instances of a class
does it affect memory ?
depends
How do I ban a player, for example, at a PlayerKick event?
ofc it stores something in memory 🤔
It can if used badly
Use the BanList API, Bukkit#getBanList()
Also, TIL
Bans by name are no longer supported and this method will return null when trying to request them. The replacement is bans by UUID
Had no idea it returned null when fetched by name
ofc it stores something in memory 🤔
Well sometimes it better to store a static field that is going to be reused instead of spamming new instances everytime we want to use the field.
Not that you should be banning by name anyways but yea
I ban by their geological position
ban *
band
i'd make a file and store stuff there
and on join check if they are inside the file or something
if you create a new instance everytime to run just a method then you're doing something bad imo
Yeah that's when statics like constants comes handy
Then you get to the "utility class" territory which is always fun
finalize the class, privatize the constructor, static methods
I remember when I used final static on methods ;u
why cant we upload screenshots ?
Verification
mhm
there
I recommend using event.getMaterial() instead
but dont i need the check for the hand ?
(1) It's null safe and (2) just shorter ¯_(ツ)_/¯
Okay Choco can you like atleast make my name capital in the first letter
PIE is fired for each hand
this is on 1.8.8 xD
people dont tend to play factions in 1.15 :/
Either way, event.getMaterial() is preferred for the sake of nullability
Yea. Throw ALL the exceptions!

what does the material method do ?
Gets material
in the hand right ?
do i just cancel the event and place water with code ?
if so, do i need to check what direction a player is facing ?
What is it you're trying to do anyways? Maybe I missed this conversation
nether water
Can't compare Strings with ==. This is something you have to use .equals() for
if (!e.hasBlock()) { //Retun false if true and return true if false
return; //Code stops
}
//Continue code
yeah i forgot to mention im new to programming
== compares two objects' references in memory (i.e. they're the exact same instance) which a literal and returned value will never be ==
yup equals is for same object check while equals is for their insides
.equals() can be overridden by classes (including String)
CHoco
hold up let me screenshot this
I'm going to leave it alone because I'm not obligated to change it?
u added dum nickname there we no problem
mine changed 🤔
Also rumdum check for hasBlock and hasItem before trying to get the item and compare it
well i had the name changed on spigot but it updated here too
bs
afaik it updates weekly
Discrimination
do i just place water ?
ikr
Block isn't placed so that event isn't called afaik
@EventHandler public void onSomeEvent(final LmaoEvent e) {
if (!(e.hasBlock() || e.hasItem())) {
return;
}
final Material material = e.getMaterial();
final Action action = e.getAction()
if (material != Material.DIAMOND && action != Action.LEFT_CLICK_BLOCK) {
return;
}
//do stuff
}
Isn’t there a bucket use event
There may be but I'm not sure its called either
I remember seeing something about one when I was poking around nms
PlayerBucketEmptyEvent is what you're thinking of
why do we not use PluginEnableEvent
or so
Yep that’s it
do i use that instead ?
Yes
I don't think it's called
which
Why would you need a plugin enable event?
Lots of things exist but you don't need to use them
why is it therr
That doesn’t answer the question
It gets called but water removes instantly?
Why would you need it
So other plugins can listen for enabling and disabling of plugins?
If you need it, use it. If you don't, don't
is it good if you read other people's code ?
to learn yes
If you understand it yes
Then soft depend if you need it???
Does it get called, troxx? I don't know. I've never placed water in the nether and listened for events before lol
I just assumed it wouldn't because the water isn't placed
a guy who made the exact same thing used PIE
I'm unsure as well. But the bucket still gets empty.
I would also use PIE
Kind of overloading you with information. You can compare the world against its environment as well to make it a bit more general instead of just specific to one world. World has a #getEnvironment() method
rumdum I think the BucketEvent works good
(this including World.Environment.NETHER)
Is it possible to rotate a player, which is laying on the bed? (or just has EntityPose.SLEEPING)
I can't figure out a way to do so.
Why would you rotate sleeping player?
I have a feeling that may be determined by the bed they're sleeping in, SoSeDiK
I'm able to force player into sleeping.
But I can't rotate him.
Constants can be compared using ==. Enums are constants
but since you use implicit else, you may use != (NOT equal to)
and return; will obviously stop the code
So no further code that lays under the if statement would be executed if the if statement is true
can you call an event from a different event ?
Yes
Bukkit.getPluginManager().callEvent(new EventClassName(/* params */));
It won't do anything else than other listeners might answer to that.
and you shouldn't be calling any Bukkit-provided events. Only ones you've made
I've seen people do it :o
Hello, I'm adding that it shows health below the name but it keeps showing up as 0 then when you hit the player it shows 18 any help thanks ```java
@EventHandler
public void onJoin(PlayerJoinEvent event)
{
for(Player player : Bukkit.getOnlinePlayers())
{
ScoreboardManager sm = Bukkit.getScoreboardManager();
Scoreboard s = sm.getNewScoreboard();
Objective health = s.registerNewObjective("showhealth", Criterias.HEALTH);
health.setDisplaySlot(DisplaySlot.BELOW_NAME);
health.setDisplayName(ChatColor.DARK_RED + "❤");
Score score = health.getScore("" + ChatColor.RED + ChatColor.BOLD + "❤" + ChatColor.WHITE + player.getHealth());
score.setScore(20);
player.setScoreboard(s);
}
}```
I've fixed it it's because I didn't put the scoreboard on the outside of the loop and forgot to update players health lol
No place there for lambdas
Sure you could forEach() but really, it's not necessary. Just use a for loop
Yeah I like forEach more though. I guess it's preferences.
Can I set the player's pitch and yaw without teleporting? 🤔
Objective health = Optional.of(Bukkit.getScoreboardManager()).map(ScoreboardManager::getNewScoreboard).map(s -> s.registerNewObjective("showhealth", Criteras.HEALTH).map(health -> {health.setDisplaySlot(DisplaySlot.BELOW_NAME); return this; }).map(health -> {health.setDisplayName(ChatColor.DARK_RED + "❤"); return this}).orElseThrow(RuntimeException::new);
here are your lambdas
...
you're welcome choco
I just... I hate that you spent the time to write that
there's a bracket missing don't @ me
Oh there is too. Bastard
Should I put the scoreboard in PlayerJoin for health or a different event?
What is the player disconnect event?
Depends when you want to enable the scoreboard for the players
PlayerQuitEvent or PlayerKickEvent
iirc
the heath
Join prolly
Okay
ScoreboardManager manager = Bukkit.getScoreboardManager();
Scoreboard board = manager.getNewScoreboard();
Objective objective = board.registerNewObjective("showhealth", "health");
objective.setDisplaySlot(DisplaySlot.BELOW_NAME);
objective.setDisplayName(ChatColor.DARK_RED + "❤");
Score score = objective.getScore(ChatColor.DARK_RED + "❤");
for(Player online : Bukkit.getOnlinePlayers()){
score.setScore(1);
online.setScoreboard(board);
online.setHealth(online.getHealth()); //Update their health
}``` What am I doing wrong?
What’s wrong ?
the name is setting to zero untill I hit the player
Yeah I told you it doesn’t initialize real health until that
You would have to make a custom objective for it
Okay, that's pretty stupid lol
Yeah thanks
Yeah I'm new to scoreboards lol
Really quick small question, does Player#setDisplayName have a max character length?
Doesn't seem like it
@silver pewter try this: ```java
public static void createScoreboard(Player p) {
Scoreboard board = Bukkit.getScoreboardManager().getNewScoreboard();
Objective healthOb = board.registerNewObjective("PlayerHealth", "health");
healthOb.setDisplaySlot(DisplaySlot.BELOW_NAME);
healthOb.setDisplayName("§c❤ ");
@Override
public void setDisplayName(final String name) {
getHandle().displayName = name == null ? getName() : name;
}```
Minecraft may stop rendering it if it's too long, though as far as character length, looks infinite to me
for versions > 1.13/4 that is iirc
Where do you find the source for objects like Player
Since it's an interface (or abstract class, I forget), where is it actually implemented
Is that the same for the majority of things? Like World is CraftWorld
Any suggestions for something to use to better and faster visualize what you're doing when playing with ChunkGenerators, PerlinOctaveGenerator, SimplexOctaveGenerator...
Most all interfaces in the Bukkit API are implemented by that same class prefixed with Craft in CraftBukkit source. There are minor exceptions (obviously with Bukkit classes that are not interfaces - i.e. CraftItemStack exists but so does org.bukkit.inventory.ItemStack). Though more often than not, you'll find a Craft prefixed implementation
All can be found either in the BuildTools directory you used to build the server, or on the stash
?stash
Is there a way of running something once an event is completed? Specifically I want to run a piece of code on a player's inventory only after the CraftItemEvent has finished adding the items to an inventory so I can actually see said items
Run it a tick later
^
A villager never despawns right?
it has no reason to
I take that as a yes.
take it as a logic statement based on the idea that they should be in villages
OPa
Villagers are persistent
And I believe there is a way to set mobs persistent via api if they aren’t otherwise
Does Anyone knew an good tutorial how to setup SpiGet update check for a Plugin?
Is there any faster way of testing plugins rather than having to export it, put it into the plugins folder, and restart the server? (IntelliJ)
Write code correctly the first time so you don't have to re-export 
No, but really. I think IJ might have a hotswap feature? I don't IJ so you'd have to ask someone who does, but aside from that, I don't think there's a quicker way
idk about intelliJ but in eclipse i created a batch script that does it all for me when i run it
Haha, That's unfortunate
i think maven has a test feature?
yeah I use maven
Wow, it's still blowing my mind that the mechanism for the vanilla /give command is to make the player drop an item they don't have 😐
Well where else would they put it?
if you can execute batch script in IJ then i think that would be the easiest solution (if you are not on windows use shell script)
i guess you could use the maven jar plugin and set the output directory to your plugins folder
how do you get the enchantment display name?
i can't tell what method tells the entity to change direction when it colides with a block, i must be blind, anyone knows?
I'm getting this error message in my plugin.yml file
Multiple markers at this line
- Content is not allowed in
prolog.
- 7 changed lines
Whenever I execute my /feed command, it does what it's supposed to, but in chat it shows what I typed, (/feed)
How can this be fixed?
return true in the command executor
returning false will show that message as though it was unsuccessful
Thank you
np
If im using a spigiot server and i want my friends to join but i dont want to give them my ip what do i do
is there a way to get like (Servername.net)
thats sad about port forwardin
thats a domain
you must purchase those
they cost money
What website do i get them off of tho
k thx
@low sonnet You don't want to give them your IP address, but you are fine giving them a domain name that still points to your IP address?
I'll never understand that
Keep in mind that people can still "find" your IP address when you give them a domain name
It's not like your IP address is a big secret. That's your gateway to the internet.
well
I know have the IP from everybody who clicked 😄
who's simple
authority
thelounge doesnt log, dw
but they're still here
it was just an example
On an alt lol
dramatic
The @frigid ember account was banned 
you shouldnt worry about ip if you have the proper steps to combat that bad things that can happen to it lol
and if its for private use
theres virtually no worry at all
Now he's here as a way to increase our server member count 
the only port i have open is 25565 on my router
hang on
if i just run like nginx as an image host
that has access.log
which logs all ips
B A N N E D
I am getting this error in a .yml file.. not sure why it is giving me an error, any fix?
https://paste.helpch.at/aqigehuwor.cs
someone gave konsolas ideas
whats the error?
it's yaml use a syntax checker online
end of the stream or a document separator is expected at line 22, column 2: - 'LAVA_BUCKET : 1' ^
your indenting is off
oh look
How am I supposed to fix the indent?
quickly
remove space
just one space?
Is it possible to nerf the experience given from a ore mined with silk touch? if so, how? :p
recommend using np++ to verify yml
It was like that when I got the config when I downloaded the plugin.
experience doesnt come out of ores with silk touch
Experience is not given for silk touched ores
do you mean fortune?
Sniped :((
LOL
lmao
I mean, the experiece given by ores mined with silk touch and then placed again, not natural ores.
Oh yea that too
YAML doesn't like tabs lol
Tabs bad
they're ALL TABS
how many spaces do I need then?
space > tabs!
Some say 4, others say 2
Well
4 is always right
okay. So I just replace the spaces before the dashes with 4 spaces?
never 2
A full tab is 4
category:
2 spaces for subcategory
But yaml also uses 2
No no, anywhere you have a tab character ( ), you should use a space
list:
from 0
Literally Ctrl + F for the tab character, replace with spaces
Okay.
or use a proper text editor like visual studio code line sane ppl
btw anyone have ideas on how to add persistentdatacontainers to Chunk?
Making a PR?
that's what i'm doing choco
chunks have no nbt
they are stored as nbt
and there's a class that loads and saves them as NBT
I mean, the experiece given by ores mined with silk touch and then placed again, not natural ores. (So i can nerf exp from ores mined with silk touch and then placed without affectiong the experience from natural ores)
^ sorry about my english dx
i thought region files were their own thing
i was literally working on this, hang on
Is it possible to build spigot for 1.16? If I try --rev latest, I get 15.2.
1.15.2
just hook into chunk region loader then
got it. tyvm.
@hoary parcel problem is propagating it all the way up to Chunk
it doesn't have generic NBT
just lists and maps of NBT for entities and tile entities
lemme see
and there's PlayerChunkMap, ProtoChunk, and all of minecraft's chunk loading logic in the way
PlayerChunkMap has saveChunk
Sorry if this is a really dumb question...
So how is a quick way to replace the tabs with spaces
choco said use Ctrl + F, but how would I actually replace it?
ChunkRegionLoader has all the nbt stuff
ctrl r
@gray plume depends on your editor
sus
I told you! Discord replaces tabs with spaces!
lmaooo
Wasn't kidding :((
im actually laughing idk why i find that so funny
just define a new method on IChunkAccess to consume the PDA nbt?
How would I replace it in notepad++?
oh yeah ichunkaccess is both chunk and protochunk
I'm so confused
so what if i add a getter for persistentdatacontainer in ichunkaccess and fields in chunk and protochunk
@gray plume it's probably Ctrl+R but i'm sure you know how to use google even if it isn't
Yes, i have the mental capacity to use google, was using this as my first resource.
thank goodness
yes that should work
Mini, can you help my with my question?
I dont know shit about vanilla mechanics
fak
oh no i'll have to add a new patch file to spigot
disaster
oh no i'll have to add two new patch files to spigot
i am doing it in cb
there aren't patches for either of ichunkaccess and protochunk
and there actually might be more things that implement ichunkaccess
oh cool
and theres proto chunk extension which extends proto chunk
lemme get the mojang names, proto chunk extension is horrible
oh that extends ProtoChunk so should be fine
it's an imposter
i lost hope when there were three fields in EntityLiving named xxx, yxx and zxx
oh god
ok but mojangs name makes sense
cause its a Chunk
that pretends to be a ProtoChunk
The XP, XN, YP, YN, ZP and ZN constants in Vector make me a bit sad though, ngl
how is it in spigot?
you mean xxa,yya,zza konsola 😄
Don't think they're named on Spigot's end because we don't use them
how you register a fallback prefix for a command? im using
ProxyServer.getInstance().getPluginManager()
.registerCommand(plugin,
new Command("test") {...etc...});
Doing /test works but i need /myplugin:test too
flawless logic if you ask me
well those make sense tho
do you using the api?
yeah
XN is better as xNegative if you use it in constants 🤷
never saw that in bungee
generally bungee is a bare bones api, you dont really want to do much stuff on bungee level but rather on the actual server
never put too much logic into a proxy, this true for MC too
yeah well this project works on both proxies and backend servers
i need it to work on both
so any ideas?
and i think i'm also patching ChunkRegionLoader
yes, thats where you want to read and write the nbt
cant you just add aliases alex?
you mean just put the whole thing with : as another alias?
ye
hacky af but ok
hang on
does chunkregionloader event load chunks
I only see a method that returns ProtoChunk
well I started writing plugins on sponge, where everything makes sense and is organized. Then i came over to spigot/bungee
dont you see the method that returns InProgressChunkHolder?
no?
maybe even generated chunks are loaded as ProtoChunks?
also there are two decompile errors -.-
nonono
thats where our imposter chunk akak proto chunk extensions comes in
see line 179
how are there decompiler errors if spigot already touches that class?
oh spigot
I actually have the spigot class open now
craftbukkit doesn't i guess
oh right
this'll be fun for everyone involved downstream
does spigot have a patch for the decompile error i can use
I dont see why you would have decomp errors, there is nothing in spigot that attempts to patch them
I only see two commits
the mc-dev imports and the timings one
so clearly there is a patch somewhere
no clue how spigot does this
because a decompiler isn't outputting that
it would need to be in the mc-dev impoprts patch
else intellij would show the patch
how much of it is commented out for you?
interesting, its a surprise that spigot has the mc-dev imporets patch like this at all
that's why it was commented
since this is distributing mojang code
paper does generate the mc-dev commit automatically
what is it?
"Imported files which are only modified by Spigot, not upstream. Files here should be completely unmodified aside from trivial changes such as adding throws statements to ensure proper compilation. You may need to add unrelated files in order to ensure a compilable result in the face of synthetic methods."
interesting
what is what?
mc-dev
mc-dev imports are bringing in the nms files so that they can get patched by spigot/paper
ok so inlining has actually made things worse
it's doubled the error
and also why is there just a registryblocks.getClass() with an ignored return value
object1 = TickListChunk.a(nbttaglist1, IRegistry.BLOCK::getKey, IRegistry.BLOCK::get);
object2 = TickListChunk.a(nbttaglist1, IRegistry.FLUID::getKey, IRegistry.FLUID::get);
maybe its to force class init
maybe its a decomp thing
who knows
its nested
0 is parent, 1 is level
2 is one of the sections
3 is a TE
4 is an entity
this is the saving patch
now i need to figure out which imposter protochunk whatever actually makes it into the chunk object that's loaded
imposter is a wrapper for chunk
what's the point of all this tho
why does a chunk need to be wrapped in an imposter proto chunk
chunk loading works with proto chunks 🤷
i'm going to write it to the object on line 83
yes, that object is either a chunk or a proto chunk, and if needed it will be wrapped on line 179
so your patch should go to like 140 I guess
or before the if at 179
there's also a chunk constructor that accepts a ProtoChunk
might need to copy the persistentdatacontainer in that case
I think protochunks turn into chunks at some point
so the imposter protochunk that wraps a chunk will one day turn into the chunk it wraps
added this anyway
it's real
mojang calls that method protoChunkToFullChunk 😄
even tho it takes a player chunk
whatever the fuck that is
win key + shift + s then you can ctrl v in discord
oh, nms calls it ChunkHolder
so you don't have to imgur anymore
sharex > snipping tool
maybe 🤔
😠
okay
I was really hopping that was a middle finger lol
umm
turns out i moved files from the decompile folder to craftbukkit
running buildtools again is so fun
sounds like a fantastic experience
At least you guys benefit from them

must be nice benefiting from PRs not directed at the project
oh buildtools didn't generate the file anyway
😂
choco, 90% of the patches are MIT, its not like we try to keep them secret
does that mean spigot is technically allowed to upstream all of them
sure, just need to add the license somewhere
and keep the authors of the patches
but thats something git would handle
its not like paper wants to maintain ~500 server patches
I think aikar would be pissed if timingsv2 would be added to spigot (without using his website, like md did with v1)
what happened with v1?
it was hosted on aikars website (like v2 is now), but md decided it host his own instance and patched the original url out of spigot
😮
because it's third party
that was no the reason
It's better hosted on the platforms servers
oh no i missed a craftbukkit comment
that calls for editing patch files manually!
crisis averted
is there an updated resource for setting pathfinder goals?
minidigger's paper pr
Hello, im trying to make a minigame plugin. I copy this code and I put it on my server. And it doesnt work. It should damage to players but it doesn't. It should take half a heart.I would really appreciate if someone can help me 🙂
that's not how you damage
looks decompiled
looks like ide help
is it safe to make minecraft the client use 500M of ram instead of the standard 1gb
Did you register the listener
Nah. If it were decompiled, the if statement would have used braces
or have been formatted the way it was
Alrighty, I've got an issue with refering to entities within a world.
LivingEntity ent = (LivingEntity) Bukkit.getEntity(plugin.entities.get(i)); ent.setHealth(0D);
ent.setHealth(0D); is throwing a NullPointerException when executed, (as well as any other attempts to reference ent. This tells me that the server isn't finding the entity.
The entity in question is almost always going to be in an unloaded chunk, will this be causing the issue? If so how can I get around it? Thanks!
and yes, that should work fine assuming it was registered, but you're also going to be doing a LOT more than just half a heart of damage. You'll be doing 50 hearts lol
To my knowledge, if unloaded, Bukkit#getEntity() will return null
Yeah I suspected that, is there a way to get an entity from an unloaded chunk?
Or do I need to store the chunk information, and load it when required?
Not really because there's no entity to interact with. You'd have to load the chunk
what are you trying to do?
I'm spawning a set of Villagers and saving their UUIDs in a List<UUID>, I'm trying to kill them all in this case.
In other cases I'm trying to locate them, change other stats, etc.
Morbid
is PlayerChatEvent still usable? im just trying to use it for debug
You bet 😉
Is there a Chunk variable type I can store in a HashMap alongside a UUID?
And load said chunk before doing any interactions?
theres a way to keep chunks loaded in vanilla minecraft
Or do I need to store each x,z
Alright. Thanks
perhaps you could interact with them lazily
I don't want to load all the chunks at the same time because there will likely be at least 50 villagers spawned.
i.e. store a list of things to do, and only modify the villagers when the chunk gets loaded by someone
1.13+ servers will thank you for not making them load chunks
^^
that is very smart idea
Definitely second this approach
I didnt refister my listener up i fix it, thanks to everyone who replayed
turns out it is ok to run minecraft with 500m ram
Of course. Vanilla isn't super RAM heavy. It gets bad the more and more blocks added to the game though because all those states are stored in memory
(that's why Forge can take as much as it does when you add hundreds of mods)
i only have 8gb and running a server, intellij, chrome, and two instances of minecraft is a bit much 😅
I tried 500mb and that’s fricking not good just saying
spigot-1.8.8.jar.jar
Windows likes to hide file extensions
Rename your file to just spigot-1.8.8 and you should be good to go
(though you'd be much better to go if you were on the latest, supported version of the server)
The console is the window from which you ran the command
If you're using a start batch file (like it seems your doing), it will be in that window. That is your console
I feel like this is a stupid question, but what's the IP? If I remember correctly, it's my personal IP, but I put that in and it didn't work.
127.0.0.1 will be your local host and is accessible from there
Hey, I’m tryna get a bunch of opinions on this: For those of you that use IntelliJ, do you use the Minecraft Development extension?
Though if you want players to join from an external IP address, you have to give them your public IP address (you can search on Google, "what's my IP", it will tell you)
And you have to port forward your router to allow access to your server's port
?pf
The home of Spigot a high performance, no lag customized CraftBukkit Minecraft server API, and BungeeCord, the cloud server proxy.
@young dawn there is a way to get windows to display file extensions
@rapid yacht I know a large majority of IJ users that do use that plugin and swear by it lol
a quick google will tell you how
Anything that makes plugin development a bit easier can't hurt
ive never herad of it :s
True
I just need it to test plugins for a larger server, I don't need to port forward or anything.
@wanton delta u use IJ,
i think i used it in the past but not anymore
?
Plugin made by a community member for IJ, Martoph
It makes things much quicker when making plugins
seems interesting
Supports Forge as well iirc. Saw some developers over in the Forge server using it which was pretty dope
It is 100% worth a look
The thing is, it takes a bit of extra prep if your making a plugin under the version 1.12
It really isn’t a big deal though
goo die
no one likes 1.8
1.15.2 or bust
anything under 1.13 isnt supported
hell, anything under 1.15 isnt supported
isnt**
Oooo Minecraft Development plug-in?
Makes small testing plugins for things super easy
I love it
It's in a package here
like this?
it needs to be in the root of the jar
Bukkit.getWorld("world").isChunkLoaded(chunk) is returning null although I'm providing a chunk in the parameter
yes (i think)
A boolean method can’t return null
17.04 00:30:26 [Server] INFO Caused by: java.lang.NullPointerException 17.04 00:30:26 [Server] INFO at org.bukkit.craftbukkit.v1_15_R1.CraftWorld.isChunkLoaded(CraftWorld.java:478) ~[server1152.jar:git-Spigot-ae72bf4-183139d] 17.04 00:30:26 [Server] INFO at com.starfluxgames.quests.commands.cmd_listquests.onCommand(cmd_listquests.java:38) ~[?:?]
yes (i think)
@wraith dew still giving me errors
put it outside the src folder
put it in the root of your project
then i think it should work
also @fleet crane I have a question
relating to a bug but im unsure if its to do with spigot or minecraft
I'm fairly new to coding. Is this the root of my project?
yep
yes that should work
A boolean method can’t return null
Boolean
i think in eclispse its outside
basically there are 2 moving compass targets
and the compass only works when the player is unrendered
do you know if thats a minecraft bug?
yes that should work
@wraith dew :/
no idea, you can easily check yourself if its a minecraft bug
because it makes absolutely no sense for a compass to work until the target (a player) is rendered
Not sure it will matter given the changes to compasses in 1.16
Even if it is a vanilla bug, it likely will have been unintentionally fixed
compass rendering is client side anyway
@young dawn your main path is wrong
but does it cause problems if there are 2 targets?
it must be "me.hoggythewizard.nofail4.tutorial"
In the yaml (config.yml of my plugin), I tried this:
wbcworldregistery: - world: enabled: true
Got this when I printed the list:
[00 11 WARN]: This is what the list contained: [{world=null, enabled=true}]
The intention is to store several worlds in that wbcworldregistery, and each world is to
have a boolean associated with it.
Code I used to print that warning:
@Nullable List<?> wbcworldregistry = mainclass.getConfig().getList("wbcworldregistery"); mainclass.getServer().getLogger().log(Level.WARNING, "This is what the list contained: " + wbcworldregistry.toString() + "");
different compasses point to different targets
@warm carbon no the main path is right
you probably want to indent enabled and remove the -
are you sure?
no worries mate
@fleet crane Seems to have corrected the tree order as eclipse displays the yaml. So that was one part fixed. Thanks. :)
Now I just need to figure out why I get a nullpointer. I bet it's because I am trying to print the list directly.
Nope. Was not it.
did you solve it?
yo choco
remember how u said I gotta have return true;?
in order for my commands to not repeat themselves in chat?
it's giving an error
return true in onCommand not onEnable
o lmao thanks
Also, how do you send a message in the chat?
ik System.out.println(); is console
but what about the chat?
Thank you
np
yes
I want the message to be sent to only the command executer
event.getPlayer().sendMessage()
sender.sendMessage("")
i meant that
thats for events like block break
I'm not sure on the context so @wraith dew is also correct
its says command executor
Can you paste your code?
Wait nevermind, xD
ok
I thought @wraith dew was you haha
lmao
?
This solved it in the end:
Set<String> lol = mainclass.getConfig().getConfigurationSection("wbcworldregistery").getKeys(true); mainclass.getServer().getLogger().log(Level.WARNING, "boolean: " + lol.toString() + "");
Gave me:
[01:06:42 WARN]: boolean: [world, world.enabled, world2, world2.enabled]
Alright this chunk problem is doing my head in.... Don't question the mess that it is. I'm pretty new to coding.
Can someone please have a look? https://github.com/pilchard2002/SFNQuests
In Main.java I'm running summonQuest(String, Location, Boolean), and I'm summoning an entity with the provided location argument.. I'm adding the chunk that it's spawned in paired with it's UUID in entityChunks.
Later when I'm in cmd_listquests.java or killallquests.java I'm trying to load the chunk that is stored by the UUID.
if (!Bukkit.getWorld("world").isChunkLoaded(plugin.entityChunks.get(plugin.entities.get(i)))) Bukkit.getWorld("world").loadChunk(plugin.entityChunks.get(plugin.entities.get(i)));
This is returning a NullPointerException
Could anyone please explain this as I've been trying to fix it for a few days!
??
nvm
The first time I run /listquests there is no problem.
after I run /killallquests it breaks
@gloomy shuttle same sadly
does killallquests set anything to null?
plugin.entityChunks.remove(ent.getUniqueId()); ent.setHealth(0D); plugin.entities.remove(ent);
plugin.entities i think is null
it removed the chunks and entities from the List<> and HashMap<>
Although if I spawn another quest is adds it back into entities so it shouldn't be null
how to stop a command in minecraft before it is executed
note i can not code so i need to use a plugin
line:225 in Main.java summonQuest()
What's the event that allows players to break blocks?
BlockBreakEvent
nvm
Doesnt show up though :/
.
