#help-archived
1 messages ยท Page 19 of 1
Not to mention you really have no reason to be calling the same method chain more than once anyways
am i doing this wrong:
yes, you need to min and max your coords
?
Has no coordinates, just a start point, Frostalf
yeah, didn't have a lot of time to look at it was in a game lol
That looks like it would work to me. What's not working?
maybe its my other part of my code
let me check
takes forever to load server up my great pc..
nvm it does work
my other code is broken
;P
idk why it would be..
wat i get air...
my great air, clicked in the middle of crop field and i got air:
probably need to go 1 block down
anybody know of any plugins allowing you to make false walls (walls you can walk through?) Would be nice if you could config it so that only certain perms could walk through, but unneccesary.
Can anybody recommend me a good and small JDBC wrapper or should I rather handle all that stuff myself?
Can anybody recommend me a good and small JDBC wrapper or should I rather handle all that stuff myself?
@tepid burrow Have you tried HikariCP? ๐
That stuff is about 180KB
And I do not want to nuke my final jar size
But I'll probably go with that if I can't find something suitable
it handles connection pooling for you. and 180kb is nothing, not entirely sure why you are even worried about the size either. But if you want a wrapper mysql provides one and is shaded into spigot for you.
In my BungeeCord config I have set tab_list: GLOBAL_PING but when 2 people are on different servers they don't both show on the tab list
Wait, does a tablist plugin on a connected spigot server influence it?
it could yes
Do you know, what is cause of BungeeCord server having high CPU kernel usage? Is it because of network handling or is it sign of something bad happening there?
I mean cpu time spent in kernel.
if your nic can't handle something it will get processed by the kernel. Generally a sign of outdated drivers or outdated server.
If you're talking about the proxy server gobbling up CPU utilisation then who knows, ask md_5
Ok, and do you have any experience or knowledge, what is typical cpu usage of bungeecord with 100 users online?
I'd imagine the proxy server shouldn't be using much CPU at all. Its only purpose is to act as a bouncer pretty much
maybe check your plugins?
^
there isn't really a typical because it varies between hardware
Proxy plugin might be at fault
however, there will be some cpu usage by the proxy because it has to process incoming packets and determine which server to send it to.
Well, that is something I expect as well, but while profiling it, it takes really huge amount of CPU.
But most of the time spent in Netty IO threads
Does bungee on its own run fine?
Process of elimination to find the culprit
that will tell you something immediately
pretty normal for it to spend most of its time in netty IO threads since it mainly deals with connections more then anything
^
I can't test it without plugins, otherwise there won't be that high players count.
Every plugin is custom, except RedisBungee
another culprit could be bad clients sending too many packets too btw
would recommend other then a profiler a network sniffer
You mean, that the CPU usage could be connected also with final servers?
If the proxy server is spending a lot more time than usual in netty IO it suggests you have a plugin which does a lot of plugin messaging or something in that regard which is amplified by the number of players on the server. Possibly due to some joining event
I'm betting my money your problem is a plugin problem
and not bungee itself
Even if its not shown in CPU profiler?
A plugin might be making bungee calls
or methods in bungee
It's very likely you just have a proxy plugin that was never coded for the use case of a lot of players
You can start a process of elimination by removing and adding plugins to see which ones cause the cpu to spike
The isn't any CPU spike, it's more of continuous usage.
Well, If bungeecord should be mainly proxy, then the CPU usage is much higher than expected I would say.
Having 4 vCPUs just to handle 100 players seems a little bit too much.
I recommend using a network sniffer to determine what is going on network wise. So you can see if its too many packets incoming or too many packets being generated by the proxy to the servers.
you can also increase the netty threads too, could have too few of threads to handle all of that traffic
and you said vCPU's? you are using a VPS?
I think he means virtual cores
Where can I set netty threads? Is it configurable? In the CPU profiler I see 4
Bungee should not use a lot of CPU since it only needs to talk to a player when they join the server
it doesn't need to keep track of the player
or send anything to it
unless a plugin tells it to
no, but it still has to process the packets to know which server to send them too
also using a VM can interfere with natives
possibly yes
Native transport?
if bungee can't make use of native code then everything gets processed by the CPU
native code allows the nic to do the majority of the processing
basically if its not native, cpu has to do more work to make it compatible
if it's native bungee can just use of native code
When using the ChatEvent in a BungeeCord plugin I can do event.getSender() but that doesn't return a ProxiedPlayer, it returns a Connection. Why is that, what else can chat that isn't a player?
On my servers (spigot) the option "use-native-transport" is disabled. Is it connected?
one of the things you would want to check is if your VPS uses virtio driver
in your config or you see that in the log @uncut zealot ?
if you see that in the config, enable it
if you see that in the console and its enabled in the config, then it means bungee isn't able to use native code for some reason.
this "use-native-transport" is spigot option, not bungeecord
enable it for the servers
one of the things you would want to check is if your VPS uses virtio driver
@keen compass What do you mean by virtio driver?
virtio driver is a driver that allows the VPS to better make use of its virtualized nic instead of using a generic driver that emulates a network card.
in bungee log it shows:
Using mbed TLS based native cipher.
Using zlib based native compressor.
Not on Windows, attempting to use enhanced EpollEventLoop
Epoll is working, utilising it!
virtio driver is a driver that allows the VPS to better make use of its virtualized nic instead of using a generic driver that emulates a network card.
@keen compass Not sure, it is debian virtual installed on vmware without extra tooling
can use that script to see if you have the virtio driver
but even if you do everything and still can't find the problem, it could be an issue between the VM and the real box though
which you won't be able to determine the issue there if that is the case, you would need your hosting provider to do it.
I am the hosting provider, so I can basically everything.
then why are you running bungee in a VM o.O
There isn't anything called virtio driver. There is just vmxnet3 from vmware.
then why are you running bungee in a VM o.O
@keen compass In order to have better acces to the server and also, to not only host bungeecord there, but also other things.
I recommend installing Virtio drivers
vmxnet3 is emulated virtio isn't
which means even though bungee is using native code, the network card is being emulated which means its not making use of the real hardware that is on the box. In other words the CPU has to handle it which is probably why you are seeing the large cpu usage.
Is it possible in vmware virtual machine?
yes
not sure I see how
Is it possible to get the person using a command in commands.yml?
Trying to make an alias in commands.yml to spread the player around the map:
wild:
- spreadplayers 3000 3000 500 false $1```
Sorry to re-ask, I'll only do this one more time then maybe I'll try spigot forums ...
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.
versioning of NMS is done during compile time remapping is done during the decompile process
that is also done during the decompile process
The code in the "working" dir has the real package names so I think it's the compile-time step I want to skip
Hm, is it?
what do you mean real package names?
net.minecraft.server
org.bukkit.craftbukkit
no 1_15 suffix or whatever
basically I just want the code I have to match what ends up in the jar so I can set breakpoints and debug
well the versioning is in the jar
Yes but it is not in the source
I may be X-Y'ing this question
I should really just ask- how can I run a Spigot build and set breakpoints in my debugger?
What's the difference between player.sendMessage( component ); and player.spigot().sendMessage( component ); in a Bungee plugin?
I am currently trying to figure out why the DropItem event gets triggered when I use the vanilla /give command
but it's very hard to track anything down when the debugger can't align source to the classes in the jar
probably because it is easier to give items that way and not have to check where in the inventory to place it
I feel like this is new behavior as it causes some weird side-effects in my plugin but I'm really not sure
This has motivated me to figure out how to debug Spigot since I've never been able to do that.
I was reading through the code and it looks like drop() should only be called if the player's inventory is full
but mine was not- so here I am trying to figure it out, which would be 100% easier if I could step through the internal code.
๐
its not new behavior, the other reason for triggering that event is if you give an item and there is no inventory space then what is left over will get dropped.
yah that's what the code looked like, but as I said my inventory was not full when I was testing
so I am confused about what's happening
How do I teleport a player to exact coords?
did you search to see what uses that method?
that method can be called from elsewhere too
@zenith siren nothing. One is for BungeeCord, the other is for Spigot
Well I had a stack trace that was basically GiveCommand->...->drop()...->DropItemEvent kind of thing
Functionally they perform the same task
How do I teleport a player to exact coords?
@old barn what do you mean? I think teleport() just.. like works that way
Like just call Entity.teleport
World w = p.getWorld();
Location loc = Location(w, 5000, 90, 5000, 0.51, 0.51);
p.teleport(loc)
It's possible?
yeah Hard that's basically it, did you try it?
I find it hard to believe that nobody who works on Spigot code uses a debugger ๐ฆ
Gotta be some way to make that work, right?
i have a problem
HOW can i make a plugin for spigot 1.8 if the oldest version of spigot plugin in intellij is 1.12
smh people still coding for 1.8
change the pom.xml
from spigot 1.12 to 1.8
@hollow drift shytup and help him
we are not here to judge
@keen compass What do you think about bungee compression threshold setting it from 256 -> 512 ?
ยฏ_(ใ)_/ยฏ
is there any plugin to pick up spawners
purplex, your spammy self should probably not be telling anyone to shut up. That said, I didn't know build tools supported 1.8 or that any of the API for 1.8 was available, so there you have it.
I'm sorry, would it work better for you in meme format?
It's down to 1.8, yea. Bukkit was DMCA'd in 1.7.10 and its build process isn't useable
donโt disrespect now
Roger, thought 1.9 was the farthest back we could go without using a secret stash of builds ๐คทโโ๏ธ
Telling someone to shut up is disrespectful
I wish it were back to 1.9 
ok
Being surprised that people still code for 10-year-old server versions is not really, it's just my truthful opinion. Sorry to have offended anyone.
5 years for 1.8.8 but you're right. As far as Spigot is concerned, 1.15.2 or you're out
Interestingly enough, CraftBukkit is also technically not supported by Spigot
i use spigot
It's not even built by BuildTools anymore
craftbukkit is ass
Yet it's the foundation of Bukkit and our work is based entirely on its platform. The majority of PRs go to Bukkit and CraftBukkit rather than Spigot
man whats up with yall spigot team, yall ttrippin
No, we're thinking about the longevity of the project because you will never get anywhere if you're still running software made 5 years ago
You're intentionally neglecting the bug fixes made in any subsequent version
It would be the equivalent of me still writing my plugins in Eclipse Mars, released in June of 2015
ok, but every sentence you promote the never version
i can alsos au move onto ij
its newer
stop usi ny 5 year old software
bla bla
cmon g
ingot the point you like 1.15
atleast respect some like lower
thats all
That's fine, just don't expect support here ๐
..
You're on your own
thats kind of rude but ok
https://hastebin.com/feralimoso.cs
I can't get Location 1 and 2
Welcome to the real world!
yall trippin for sure
How are you trying to get them, iTz?
@uncut zealot the compression threshold should be fine, but you can test it to see if it improves anything by increasing it
canadian
just don't go below 64 or greater then 1500 @uncut zealot
(this also seems like a good opportunity to make use of WorldEdit and its API rather than re-inventing the wheel)
In commandExecutor class:
Wand wand = new Wand(plugin);
Location loc1 = wand.getLoc1();
return null
Right, so you're creating a new instance every time. For every instance you create, those fields are going to be unique to that instance
They're members
When creating and registering your listener, you should save that instance in a field in your main class. Have a getter to fetch it
choco whats your youtube channel
Linked to my Discord
i just want to unsubscribe
That's fine
And how should I do that?
The thing is that you think I care. I will always get hate. Letting it bother you is the mistake
In Hashmap?
Jeebus I thought you were leaving
OMG IT WAS a joke
didnu know
i was joking the whole time
haha
funny bro
nice tag btw
public class MyPlugin extends JavaPlugin {
private Wand wandListener;
@Override
public void onEnable() {
Bukkit.getPluginManager().registerListeners(wandListener = new Wand(this));
}
public Wand getWandListener() {
return wandListener;
}
}```
When you want to get your wand listener (to get the values of l1 or l2), you should fetch it from your main class
pluginInstance.getWandListener().getL1(); will be your first location, and the same applies to your second
Yes I know, but note the difference I made in my snippet ๐
Or if you want the un-short-handed version of this,
public class MyPlugin extends JavaPlugin {
private Wand wandListener;
@Override
public void onEnable() {
this.wandListener = new Wand(this);
Bukkit.getPluginManager().registerListeners(wandListener);
}
public Wand getWandListener() {
return wandListener;
}
}```
Maybe obvious, but keep in mind the locations will still be null until someone clicks
Correct
I still advise trying to work with WorldEdit though. It's familiar to players and might also help you learn integration with other plugins
I will try it, thank you very much
o/
Whenever I see someone coding a "wand" I get magically excited, but then 90% of the time I realize they're just doing region selection and not casting spells ๐
You've been treated so nicely working with Magic lol
^ yup nathan
I got some haters, lol
You'll have to get in line
My first hater probably came around when you were in diapers XD
probably even earlier then that @hollow drift
shut down your computer
An oldddddd-ass dude that's who lol
๐
Really people shouldn't take offense at being called young
I mean I'm just assuming here of course
but I prolly got one foot in the grave compared to you
when someone says im young
live your best life my man
i say theyre old
theyll be a granny when im their age
you will feed your family off of thid blockgame
gay asf
u got 3 kids
your wife left you
well at least you still have the other foot @hollow drift
i find it funny when my younger cousin says ill dir first
lol
lol
if you want to live long just be a grumpy person
grumpy people tend to live the longest XD
^ they don't let the BS get them down is why
already grumpy, can't make me grumpier
well I wouldn't bet on that, never know till something comes around and makes it happen
yeah ngl global pandemic and quarantine did kinda get me down.
pandemic is a bit of a killer, but the quarantine I can handle
I don't like people anyways XD
can someone explain something to me
I built a house on a spigot server but dirt is growing back through the ceiling im very confused
When i do /wild it say not in this world what do i change in this
if i want to compile craftbukkit from my own source, how would i go about turning into spigot... if that makes sense
could i just drag and drop the contents of craftbukkit into the spigot jar
lol
wati
i think im misunderstanding something
What I normally do is run buildtools
then copy my changes over to its working folders
then manually run maven package in there
When i do /wild it say not in this world what do i change in this
but honestly I do not know if that's the "correct" way ๐
yea lol i know what you mean
Do I Put The World Name HEre randomWorlds:
world: 1337
world_nether: 42
@hollow drift where do you run maven package? in the spigot folder?
oh well I just realized the give command will call drop() no matter what.. so now I'm really confused :|
if (flag && itemstack.isEmpty()) {
itemstack.setCount(1);
entityitem = entityplayer.drop(itemstack, false);
if (entityitem != null) {
entityitem.s();
}
entityplayer.world.playSound((EntityHuman) null, entityplayer.locX(), entityplayer.locY(), entityplayer.locZ(), SoundEffects.ENTITY_ITEM_PICKUP, SoundCategory.PLAYERS, 0.2F, ((entityplayer.getRandom().nextFloat() - entityplayer.getRandom().nextFloat()) * 0.7F + 1.0F) * 2.0F);
entityplayer.defaultContainer.c();
} else {
entityitem = entityplayer.drop(itemstack, false);
if (entityitem != null) {
entityitem.n();
entityitem.setOwner(entityplayer.getUniqueID());
}
}
you could try to override it maybe
yeah @wanton delta in Build/Spigot I think?
why not just modify your changes in the spigot source @wanton delta ?
I'm not sure that's gonna work, @fleet burrow but I could be wrong. What are you trying to customize about the workbench inventory?
I made something to register custom recipes with an amount, beforehand it ignored amount with ExactChoice
So now my problem is that it shows the result when X of and item is placed
But when I take the result
It only takes 1
And I believe I can change that there
So for real the vanilla /give command drops an item on top of a player instead of putting it in their inventory? That seems so wasteful (temporary entity) and weird ... I've got to be missing something, right?
@keen compass spigot source only has the patches tho?
@fleet burrow I wouldn't think the inventory/container would handle that but I honestly don't know, sorry. I'm not going to be much help there.
Gotta say, my plugin is not expecting a player to drop an item they didn't actually have in their inventory ๐ฆ
I created an arraylist in one class, I wanted to use that arraylist in another class, how can I do it?
your options are
- make it static (not recommended)
- pass the instance of that class to the target class and use it there
what class is the arraylist currently in?
if you ran buildtools those patches are applied @wanton delta
public Arraylist myArrayList
public void myMethod() {
giveArraylistToSecondClass(this);
}
}
public class SecondClass{
public void giveArraylistToSecondClass(ScreenShare instance) {
ArrayList list = instance.myArrayList;
}
}```
@keen compass i dont need to add any parameters? just run buildtools as is and itll apply the changes ive made?
I need some help
I am running this:
try {
query = connection.prepareStatement("SELECT balance FROM tokens WHERE uuid = '" + id + "';");
Bukkit.broadcastMessage("SELECT balance FROM tokens WHERE uuid = '" + id + "';");
ResultSet results = query.executeQuery();
if (results.first()) {
amount = results.getInt("balance");
}
} catch (SQLException e) {
e.printStackTrace();
return amount;
}
but the ResultSet comes out as empty but when I do the same command on the panel it gives a non-empty resultset
did you strip the uuid
no
ok
https://gyazo.com/7f69ca8f67864ca62c806d38cbce49be thats the table
public void setTokens(UUID uuid, int tokens) {
Bukkit.getScheduler().runTaskAsynchronously(Tokens.get(), () -> {
Connection connection = Tokens.get().getDB().getConnection();
try {
PreparedStatement set = connection.prepareStatement("REPLACE INTO " +
"tokens(uuid, balance, prestige) VALUES (?, ?, ?)");
set.setString(1, "'" + uuid.toString() + "'");
set.setInt(2, tokens);
set.setInt(3, 0);
set.executeUpdate();
set.close();
} catch (SQLException e) {
e.printStackTrace();
}
});
}
``` thats the code I use to insert a players data in, default value is 0
the setTokens works fine but getTokens does not
Any Good Wild Plugins Plz
Fbasics?
@keen compass do i need to run buildtools in my working directory? not sure if i understand that bit
Hey so when it comes to essentials warp signs, I want my players to only access warps through signs, and not commands, is this possible?
After how long can I bump a post on the forums
is there a plugin / way to prevent mass player join?
like lets say "You have to wait 5s to join the server"
@viscid creek look up for queue plugins
@frigid ember i mean like non bungee only for 1 server
who know any Wild Plugins
How do we get 255 reverse (cannon) stackers to work? Or do we need a fork off spigot?, cos atm the tnt isnt firing up past the trapdoors and reversing.
Hello the item won't add any help thanks ```java
if(event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK)
{
if(player.getInventory().getItemInHand().getType().equals(item.getType()))
{
if(player.getInventory().getItemInHand().getItemMeta().getDisplayName().contains(Utils.colorize(plugin.getSettings().getConfig().getString("Item.display-name"))))
{
SelectorGUI selectorGUI = new SelectorGUI(plugin, player);
if(Utils.getCheckItems().contains(item.getType()))
{
event.setCancelled(true);
player.openInventory(selectorGUI.getGui());
player.getInventory().setItem(plugin.getSettings().getConfig().getInt("Item.slot"), Utils.getSelector(plugin, item));
} else {
player.openInventory(selectorGUI.getGui());
}
}
}
}``` It only adds inside a for loop but it crashes lol
Who Can Set My World Spawn Up Cus It Wotn Work For Me PLZ
@wanton delta ok when you run build tools, it pulls in the source code of craftbukkit and bukkit api. It applies patches to craftbukkit and once that is done, it clones those directories into the spigot directory, renames them to spigot-api and spigot. Then more patches get applied to the api and craftbukkit. then all the changes get commited and then it builds.
so, if you copy the spigot directory into a working directory, you have the full source with most recent patches applied
now, if you are making a PR, you need to do this, but what you do is you create a patch of your changes which then you can put into the patches directory of spigot-server which is called NMS patches.
so if i put the spigot directory into my working craftbukkit directory.... what would i do?
what do you mean working craftbukkit directory?
just open the spigot source as a maven project from in the spigot directory, I recommend copying that directory though and opening where ever you copy it to so that you don't mess with buildtools directory since buildtools has the tendency to overwrite.
once you are done making your changes commit them, then run rebuildpatches.sh
it will make the patch for you
someone with FAWE experience?
I can't get region protection to work, I'm trying to edit a large area but only modify the blocks that are not clamed by some faction
support on FAWE discord is bad
and sorry for my english
Isnโt that wg?
I think you don't understand what I'm trying to achieve
I want to modify a large area, within this area there are chunks claimed by factions, I want to modify that large area (precisely do a // restore), and that it only affects the blocks that are not claimed
Tbh idk if fawe supports any faction plugin
fawe has a region-restriction feature
I donโt think thatโs for factions
I mean if it works for factions?
i only wanna regenerate the chunks that are not claimed by a faction
but regenerate from a backup world, it's a premade world
I don't want it to regenerate by a random new chunk
that's why I wanted to use the world edit snapshot function
but world edit modifies everything, and I don't want to touch the chunks or regions claimed by players
and I saw that fawe had this option, that in theory was going to allow me to do what I want
you are most likely going to need to create a custom plugin. I assume the factions plugin you are using uses worldguard for the region protection, therefore just need to use worldguard api to get the claimed areas, then just restore the areas you are wanting without touching those regions.
That message was deleted I wanted to read it ๐ก๐ก๐ก
o.O
It was probably not something interesting anyways
Hey guys, I'm making a queue plugin, would using mysql be faster and reduce lag as compared to storing the players uuid in a list? This is what someone else told me but I would imagine the performance impact would be negligible if any
why are you storing anything?
no need to store?
Just use some kind of Map, there would be consequence of a restart and a loss of queue order
he can just save data into a file
for saving using sql is good practice
I mean I'm not saving anything after restart or anything, but the players are in a list for order which they can join after joining queue. I figured it would take more time of storing and removing them from MySQL database than just a list
private ArrayList<Queue> playerList;
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 when using an argument after something like //set x) on BungeeCord (1487). Moved to Waterfall and the issue isn't present anymore?
don't use MySQL for that, if anything if you want to use something that will give you some speed use redis @frigid ember
but, storing in memory as a list is generally easy and sufficient
and faster then MySQL
i think you can keep million of entries for a few mb
depending on what you store ofc
yes, but iterating over it takes time
maps are constant
depends what you're doing
factions ?
could you possibly help me out on picking a dedicated ?
uh not that great with all that stuff
same ;/
just start small and upgrade as you need it
thats a good piece of advice i guess ๐ฎ
no point in buy a $100/m server if you only got 3 players
@red bolt doubt
?
whats your budget like?
ehh i already got art and server is ready
i got about $700 left
mostly for ads and ftop
lombok
is that even useful ?
i think so
what was your initial budget?
$1400
damn
is it better to use ddr4 ?
decent prices for some dedicated servers to start with. If you get one of the servers with 64GB of ram, you would be good for about 2-3 servers maybe 4 depending what you have running on them
well with ddr3 you'll be limited to old CPUs
yee i was gonna say that
nothing wrong with DDR3 or some of the old CPU's
just because its old doesn't mean it doesn't perform
would a xeon even do the job ?
yes
factions servers kinda hungry
I have an Xeon quad core server 3.7 Ghz
@red bolt latest xeons have some of the best single thread performance
and its not even latest
i did a mistake and bought a spigot from mcmarket
you're not expecting a crazy amount of players
idk if its gonna do anything
woo you bought snake oil
$300 ๐ฆ
even if you do get a decent amount any Xeon processor from the last 2-3 years will still perform decently
the only time you should even be worrying about latest hardware is if you are super large network with income coming in that you can just afford to get such things
why spend $300 on something you don't know you need
XD
I would have made you a custom plugin for about $200 depending on what it was you needed ๐
or maybe cheaper if it was more simple
they're generally snake oil but if later down the line you face exact issues that this jar claims to solve
then maybe
only then
only then
i can make plugins but im far from reading spigot source code and optimizing it
would you consider buying it
if you can afford to buy plugins off a website, then I highly recommend that instead you just hire a dev to make you plugin
you're only expecting 60 players, you don't need crazy optimisations
stock spigot will probably be fine
not even paper
what are you trying to do @wraith dew
?jd
ive never needed to create an InventoryView
basically create a chest view but only the hotbar is displayed in the bottom inventory
client won't let you do that
really?
nop
inventory views are tied to an inventory
so just create a new inventory if you want a new view
thats what im doing
he wants to hide the players inventory @keen compass
i create a new bottom inventory and copy the hotbar items
but
have the hotbar visible
unless you just blank out the main inventory (as in have no items)
its not possible to hide the player inventory
you could instead not display what is in the players inventory and it be some other inventory on the bottom
you could prevent players from selecting items from a players regular inventory
but honestly idk why you would want to
or just temporarily remove them
or just set the bottom inventory as a different inventory
ok, so what is the issue?
i get a null pointer
show code and line where it occurs
alright, should have started with that first
ive noticed that is a common theme
e.getPlayer().openInventory(inventoryView);
we can help with that ๐
no, please show your code in how you are doing it
not the api method you are using
one line isnt gonna cut it :p
your inventoryView is null then
its not because i instantiate it on the line above
how are we suppose to know that
we need some code to look at to the better determine the problem
InventoryView enchanterView = new InventoryView() {
@Override
public InventoryType getType() {
return InventoryType.CHEST;
}
@Override
public Inventory getTopInventory() {
Inventory inventory = Bukkit.createInventory(e.getPlayer(), 54, "[insert funny phrase here]");
updateInventory(inventory, (Player) e.getPlayer());
return inventory;
}
@Override
public String getTitle() {
return "[insert funny phrase here]";
}
@Override
public HumanEntity getPlayer() {
return e.getPlayer();
}
@Override
public Inventory getBottomInventory() {
Inventory temp = Bukkit.createInventory(e.getPlayer(), 9, "Hotbar");
for(int i = 0; i < 9; i++)
temp.setItem(i, e.getPlayer().getInventory().getItem(i));
return null;
}
};
//Inventory inventory = Bukkit.createInventory(e.getPlayer(), 54, "[insert funny phrase here]");
//updateInventory(inventory, (Player) e.getPlayer());
e.getPlayer().openInventory(enchanterView);
views.put(e.getPlayer(), enchanterView);
?paste
no it fits in i checked
updateinventory is a method that adds all the itemstacks
If I remember correctly, isnt there an inventory ID and a ContainerAccess method that should be used?
public Inventory getBottomInventory() {
Inventory temp = Bukkit.createInventory(e.getPlayer(), 9, "Hotbar");
for(int i = 0; i < 9; i++)
temp.setItem(i, e.getPlayer().getInventory().getItem(i));
return null;
}``` this returns null
idk this is the first time ive used inventoryview
inventories have titles, which is generally used when you have custom inventories so you know which is yours since there may be other plugins that create inventories
when null is returned by getItem, does setItem throw a null pointer?
yes
oh i thought it accepts null
Validate.nonNull(Inventory#getItem)
yes
ok ill try and validate
dont use my validate thing i think i am using it improperly
im just doint if(getItem != null) add it
sure
no it still throws a null pointer
why are you returning null at getBottomInventory
that is what i was pointing to
show the stack trace and use ```
Alrighty I've got an entity issue.
I'm spawning an entity and putting it in a variable.
When a player interacts with the entity I'm checking if it's in the variable to make sure it's the correct entity.
Once the chunk which the entity is in (In this case a villager) the entity gets removed from the variable therefore my interaction event isn't working correctly.
Is there any way to keep the chunk loaded until the entity is removed, or keep it in the variable?
I'm storing it in a List<Entity> as I have more than 1 of them
first, entities have UUID's and they are all unique
should use that since the API supports getting entities by UUID
second, listen for the chunkUnloadEvent and cancel it if your entity is in said chunk
good that is progress
@south cedar you can use World#getChunkAt to temporarily load a chunk
which is the original one i got before i gave up the night before
its a classcastexception
you are casting to something you shouldn't be
@keen compass
Will an entitie's UUID change if a chunk unloads and reloads?
``` your code here ```
no
Univerial Unique Id or something like that i forget
point is
its constant
@south cedar no it won't
Lovely! Thank you so much @keen compass and @wanton delta
the only time an entities UUID changes is because it died
which means the server removes it
and then when a new entity of same type spawns
it will have a new UUID
i forget if uuids are recycled or have a chance of being used again
or may use the old one by chance since its not used anymore lol
probably super low chance
its a low chance
wait why did i get a message from clyde?
idk
can you see the code?
can you see the code i posted?
it says i dont share a server with the recipient
you were trying to DM someone
no i was sending it to this channel
yes
no it would be a different error
@Override
public void run() {
InventoryView enchanterView = new InventoryView() {
@Override
public InventoryType getType() {
return InventoryType.CHEST;
}
@Override
public Inventory getTopInventory() {
Inventory inventory = Bukkit.createInventory(e.getPlayer(), 54, "[example]");
updateInventory(inventory, (Player) e.getPlayer());
return inventory;
}
@Override
public String getTitle() {
return "[example]";
}
@Override
public HumanEntity getPlayer() {
return e.getPlayer();
}
@Override
public Inventory getBottomInventory() {
Inventory temp = Bukkit.createInventory(e.getPlayer(), 9, "Hotbar");
for(int i = 0; i < 9; i++)
if(e.getPlayer().getInventory().getItem(i) != null)
temp.setItem(i, e.getPlayer().getInventory().getItem(i));
return temp;
}
};
//Inventory inventory = Bukkit.createInventory(e.getPlayer(), 54, "[insert funny phrase here]");
//updateInventory(inventory, (Player) e.getPlayer());
e.getPlayer().openInventory(enchanterView);
views.put(e.getPlayer(), enchanterView);
//views.put(e.getPlayer(), e.getPlayer().openInventory(inventory));
}
});```
ah finally
for stacktraces
I would prefer paste site used for code too, so I can see it without having to scroll XD
true this is mainly meant for small bits
so do you understand what it is saying
you cant cast MinecraftInventory to PlayerInventory
i see that but i have no clue on how to fix it
how do you specify an inventory datatype
I believe the order of casting is MinecraftInventory -> CraftInventory -> Inventory -> PlayerInventory
can't skip due to how its coded
what line is the issue
ill try creating minecraftInventory instead of inventory variables
e.getPlayer().openInventory(enchanterView); ?
that throws the error
im not entirely sure how to convert an InventoryView to Inventory
ill try casting to craftingInventory
also @keen compass are you sure inventory extends craftinginventory?
is it not the other way round?
well the sets are in two different areas
so two of them are on the implementation side
and the other two are on the API side
which package is craftInventoryCustom in?
but, I just recommend creating custom inventory instead of custom view
thatll probably be easier
tbh i dont think anyone has explicitly instantiated a new InventoryView
i tried searching it up and found nothing
oh well
but arent the server packages in spigot.jar?
yes, but when you are compiling against the spigot-api jar, you don't get all the code that is in the server
ClassCastException: org.bukkit.craftbukkit.v1_15_R1.inventory.CraftInventoryCustom$MinecraftInventory
oh ye
i thought i was using the spigot server
jar
ill try importing the spigot server jar rather than dev kit
and see what happens
Is there a way to get entity by uuid?
other than running through all entities and checking
I think your problem is that you are creating the inventory from the inventory view, when it should be the other way around
should already have the inventory before you create a view
in getTopInventory and getBottomInventory ive created 2 new inventory objects
inside the InventoryView object
you don't, what I am saying is you need an inventory Object that exists outside of the inventoryview object
should it matter?
the way you have it done, those methods would interact on a different inventory object every single time
because the inventory gets destroyed once the inventoryView object goes away
but inventoryview should only be instantiated once
so those inventories only instantiate once
right?
yes, but not in the way you think though
they only exist inside the method you created it in
but those methods should only run once (when the player opens the view)
right?
i want it to create a new inventory each time
because its player specific
thats alright, still need to create the inventory object outside of the inventoryview object, because the inventory view object needs an inventory to reference, can't be created inside the object on the fly
you also need to set some things with your inventories to keep them unique like setting the title, otherwise you have no way of checking if the inventory you are interacting with is indeed the correct one
the whole method is in an event handler anyway so it creates new Inventories on the fly
i use the object hashcodes
they are always unique to java
Ok, InventoryView and Inventory are two separate objects. Can't create an inventory inside the inventoryview object, as that is out of the order of things. You create the InventoryObject first, and then you pass it into the InventoryView object.
InventoryView is a view of an Inventory, can't create the view first if you haven't created the inventory
its an anonymous inner class. The Inventories are instantiated and stored in the view
right?
What are you trying to make ?
i thought it creates those objects on instantiation
a view where only the hotbar is displayed in the bottom inventory and a chest in the top
Custom menu?
can you give me an code example?
Hm yes
you can do custom menu without messing with inventory view
does spigot take advantage of multiple threads ?
can i run whatever i want async ?
yes but be careful
of what
most of the API is not thread safe
^
its useful for things like SQL interfacing
so, you are going to have to do your own custom code to make API calls thread safe
But if events is in same class
so your server doesnt freeze every 2 secs
or you could create temporary threads using Thread t = new Thread(new Runnable(){/code to run/}).start();
they instantly die after the code is run
ah rip
Hello, I'm trying to work with the commands.yml, I have DeluxeMenus and it lets me make my own commands to open the gui, but it comes up red, so is it posable to add the command in commands.yml? Please @ me if you have the answer. BTW Yes I have read the wiki on the .yml
however most of the api doesnt need to be run async anyway
so its not really a concern
@long crane the open commands of dm isnโt real commands
eventually you will learn how objects work in the JVM
If you were to make a custom commands for it you would have a command that would dispatch another command
Can they become real commands?
Nope
and how they can and cannot be accessed and how much they are exposed when you create them in different ways
not without altering the commandmap
Itโs just listening a chat event I think
Oh ok, Thanks
Donโt access the commandmap use premade PluginCommand and the plugin.yml for commands unless you want to make some advanced sub commands with abstraction and so on
commands.yml is for aliasing commands
handy if you have two commands that have the same name but do different things
it does work like that
you can have multiple commands from different plugins with the same name
Thatโs false
that isn't false
There will only exist one /command
/plugin1:command
But it can be maybe /someplugin:command /otherplugin:command
just because it doesn't get listed doesn't mean its not there
and /plugin2:command
Itโs not the same thing though
what I am talking about is, 2 plugins with the same name for a command
A HashMap canโt have 2 of the same keys
not 1 plugin with 2 commands with the same name
Well only command by itโs name. But it can be more with a given fallbackprefix.
so plugin1:give and plugin2:give both commands are the same name
The command name is still not the same
so what commands.yml resolves if you want access to both without using both at the same time
What are you on about?
what does implementing inventoryHolder do?
Oh youโre talking about that? Well itโs not wel integrated with the API anyways
Donโt use it
is there another commands.yml that is being referred to? o.O
Well there ir something called making a plugin for it
@wraith dew well an InventoryHolder is the holder of an inventory. In most cases when we create guis going to be the double chest iirc
Read about it in docs
Itโs way better than comparing titles though
i just used hashcodes
And trying to access version dependent stuff
also, when creating the inventory if you want everyone to have access to it, set the owner as null otherwise set the owner as the player if you want only the player to have access to it etc.
does implementing inventoryHolder make it so the normal vanilla inventory does not appear?
From what I know Player#openInventory overrides whether the holder is a the player or not
What
โNormal vanilla inventoryโ
yes
Yes
wow thats a great pic im gonna dl
does it remove 27 to 62?
oh
Read docs
according to @subtle blade its soon to be depricated
What is?
InventoryHolder
No. It wonโt. Itโs still useable API, it should just not be implemented
Nor should most of the Bukkit API
No, you should not. Thatโs unintended functionality and against Bukkitโs scope
ok
See the package description for org.bukkit on the Javadocs
You can try and centre it for one client but resource packs make that impossible
Font size varies and is not sent to the server
ill do it for the vanilla pack then
Additionally, client-sided chat width settings
do i just add lots of spaces ?
not only font size varies so does the characters depending on language
and if I remember right, minecraft uses its own fonts for the characters
well assuming a resource pack doesn't change it I guess lol
only text that can be centered reliably is the text you send, really
and you see a lot of servers do stuff like <-------text here------>
to give the illusion its centered
can the client change the width of the chat (i.e. the number of characters per row)?
where does the no come in?
no
does anyone know the spefic method that is called to make a player appear as a sillouette
so I used a classloader to load classes from an external jar from my plugin, however, its not playing well with gson
I keep getting a stackoverflow when I try to gson.toJson() the classloaded instance.
is this external jar running at the same time as the plugin?
if not, i recommend just compiling the jar with the plugin
Itโs not @wanton delta
stack overflow wouldn't occur just because it's being dynamically loaded
Itโs like a plugin for my plugin
Yeah see I tried removing all properties from the class and it wouldโve given me a {} and it still overflows
are you really sure it's not some kind of linkage error
Well I want to be able to edit the jar standalone
what if you run the code in your actual plugin
I did and it seems to work as I call the same method to serialize other stuff
I do have to pass down my data folder instance and logger instance
are you sure you're not doing any kind of infinite recursion
Iโm gonna try it again in my plugin
stack overflow wouldn't occur because of how it's being loaded
Yes Iโm pretty sure Iโm not doing any infinite recursion since it used to be a plugin
And then Iโm trying to covert this code to an addon
The rest works
I guess Iโll try once more
@wanton delta it runs just fine in my main plugin ๐ค
Stackoverflow usually occurs in a recursive method that never terminates. Do you know what that method is?
it was gson
it didnt like different classloaders
it works when I initialized it in the main
and then got that gson instance and then did it
Kotlin
I'm trying to summon no AI mobs using commands generated from a website. In the most simple form, the commands look something like this-
/summon pig ~0 ~1 ~0 {NoAI:1}
However everything I try returns the error "Unable to summon entity". Does anyone know why?
#help-archived Hello ๐ I am new to the minehut server and i can't figure out how to get the plugins to work, i installed them by clicking the button and restarted the server but nothing is happening
I've tried "pig" and "minecraft:pig"
/summon minecraft:pig 0 0 0 {NoAI:1b}
That worked. So no relative coords?
for some reason discord doesn't like the tilde character
I assumed using 0's you would know you could use relative
you were also missing the b at the end of the 1 too
Ah, I see
have fun ๐
Thanks again
@golden vault what's the ETA for resources emails?
I am not exactly sure what you are referring to. But I would assume you would get it when you are gotten to?
I mean the reports sent to resources@spigotmc.org
Not sure if you remember me, but I'm still waiting for a reply from that day you told me I can send an email. Which means 3 days, and I'm starting to think you guys didn't even receive the email.
Oh that idk I don't have access to it.
Aren't you a resource staff lol? Then who's responsible forums staff?
admin
and possibly mods idk resource staff handles reports and approvals if the approval is appealed it needs to be escalated otherwise the resource staff could just reject it as well
Well, I'll wait another day if nothing happens I'll just contact md_5. Thanks
mhm
Hey guys, i'm playing minecraft with my own server. last night we were playing minecraft together smoothly, suddenly i and 2 of my friend got lag together (high ping). we got the same internet provider, but my other friend that using diffrent provider can play minecraft in my server smoothly without lag (low ping). Can anyone help me how to fix this, please?
cuz we are getting lags in the server until now
Thatโs obviously an issue with your service provider. If one friend doesnโt lag and all of the other friends who use the same service that is different then the no lag friends service provider, itโs obviously your service provider.
Guys is there any way I can get a new spigot account?
I want to delete my old one and create a new one
You can't delete your old account but nothing is stopping you from creating a new one?
There is
I saw a spigot post about how u cant have more than 1 spigot account
really stupid but yeah :/
actually can someone confirm that that's true?
Correct, you're only suppose to have one account unless you get permission from staff iirc
