#help-archived
1 messages · Page 218 of 1
when i is greater than or equal to j
Spawnprotection or just normal minecraft behaviour
ah ok
Yes chest are an example
However I never used it. It should be thrown prior BlocPlaceEvent I think
Where can i find GameSpy4 documentation?
cool, doesn't sound very useful but it's there for a reason I guess :p
Im using NoCheatplus in 1.16 but it's blocking crossbows how do I fix it or replace what to replace it with.
Can anyone help me or there is another server to help with this problem.
When using nms how can i make the second layer of the skin appear?
yeh i gotchu
The packet is PacketPlayInSettings and method is e https://i.imgur.com/r3fj9XG.png
Probably have to send a packet for each layer, so 7 packets
im using redprotect but people still do not have permission to use buttons when i have them and redstone edit available
probably just one packet @quick arch
it is an unsigned byte, and the bitmask can be sent as just a single byte containing all the options
🤔
that is the purpose of a bitmask
either it adds up all the bits or they are listed in order one of the two
since it is unsigned it has a range of 0-255
int i;
int sum = 0;
for(1 = 1; i <= 5; sum += i++);
System.out.println("Sum is " + sum);
```Just wondering, why is the sum 15?
Where is the i initialization?
Any good plugin that can prevent hostile mobs from burning on daylight?
Can anyone see this?
Hello Dio
my plugin have these wacky permissions:
permissions:
locationsplugin.setlocation.self:
children:
locationsplugin.setlocation.other:
children:
locationsplugin.setlocation.*:
children:
locationsplugin.*: true
locationsplugin.getlocation.self:
children:
locationsplugin.getlocation.other:
children:
locationsplugin.getlocation.*:
children:
locationsplugin.*: true
locationsplugin.remlocation.self:
children:
locationsplugin.remlocation.other:
children:
locationsplugin.remlocation.*:
children:
locationsplugin.*: true
The Spig0t wiki page for permissions says the following about children permissions:
Each child node must be set to either true or false.
A child node of true inherits the parent permission.
A child node of false inherits the inverse parent permission.
Am I setting this up wrong? Should I actually just specify only one layer of children, and any further layers would require the parent permissions to be redefined at the permissions root?
In other words, this still confuses me even after coding with Bukkit for over a year...
I don't think my permissions need much context here to interpret, but if for some reason it is needed, I will gladly provide more details.
Thanks in advance
One thing that confuses me the most is "inverse parent permission."
I don't understand what that really means
I think it means the opposite of "inherits the parent permission"
so inherits all the child permissions?
but that can't be the case, because if you set the value of that key in the yaml to true rather than specifying a section with keys/values, it cant have children... because children are defined using key/value pairs
It looked like the article was last touched near the end of June
not too long ago
Okay, so I figured out a surefire way to find the truth
yes, that is right
I have a gigantic brain
locationsplugin.*:
children:
locationsplugin.setlocation.*:
children:
locationsplugin.setlocation.others:
children:
locationsplugin.setlocation.self: true
locationsplugin.getlocation.*:
children:
locationsplugin.getlocation.others:
children:
locationsplugin.getlocation.self: true
locationsplugin.remlocation.*:
children:
locationsplugin.remlocation.others:
children:
locationsplugin.remlocation.self: true
I will test it
?ask
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.
Whats the best way to go about taking the integer, subtracting 1 and repeating if still 1 or higher:
public void animatronix(int hmd11) {
if (hmd11 >= 1) {
//run spinners
int hmd11 = hmd11 - 1; //THIS is where im havin issues
new BukkitRunnable() {
@Override
public void run() {
animatronix(hmd11);
}
}.runTaskLater(Main.getInstance(), 4);
}
}```
Do a simple while loop?
Recursive java method oops
r/IncreasinglyVerbose except for programming
plz help
@EventHandler
public void onCommand(PlayerCommandPreprocessEvent e){
if(getConfig().getStringList("disabled-commands").contains(e.getMessage().toLowerCase().substring(1))) {
e.getPlayer().sendMessage(Objects.requireNonNull(getConfig().getString("disabled-message")));
e.setCancelled(true);
}
}
config
disabled-message: "You don't have access to this command"
#Commands to disable
disabled-commands:
- tps
- kill
It does not cancel the commands:/
...I built my own config class...
That verbosity scares me...
so noob question here. been years since ive last ran a server and im helping a friend with his. how do i OP myself and others? i also set up essentialsX and luck perms
not showing anything for it
in the console
hahahahaha
is in on their computer or a hosting place?
thanks
np
How can I get a config value in a command executor?
wow i cant believe i forgot about the console, i even had it open on a different monitor 🤦🏻♂️
i ake mistakes like that all the time lol
im losing my sides right now lmfao. i was supposed to be a jr sys admin a few months ago and im fing up something like this
corona saved that company for sure lmao
Lol
plz help
@EventHandler public void onCommand(PlayerCommandPreprocessEvent e){ if(getConfig().getStringList("disabled-commands").contains(e.getMessage().toLowerCase().substring(1))) { e.getPlayer().sendMessage(Objects.requireNonNull(getConfig().getString("disabled-message"))); e.setCancelled(true); } }config
disabled-message: "You don't have access to this command" #Commands to disable disabled-commands: - tps - killIt does not cancel the commands:/
I think it needs to be getList not getStringList lol
how do i change the perms so all players can use the command i jus made?
hi folks, sorry if my question is stupid easy, but i've been googling for an answer and found nothing.
i'm trying to set up a 1.16.1 spigot server and when i start it up, it gets to the world setup part and freezes at
Tile Max Tick Time: 50ms Entity max Tick Time: 50ms
i've tried increasing the ram flag to -Xmx6G, but no luck
Uuuuh
for reference, i've run servers before on 1.12.2, and i still have all those folders from back then. tried running them, and they function exactly as they used to, no issues
where did you get your spigot jar from
hmm ok i'll try it again and take a look
oh wow yeah CPU goes through the roof. what could be causing that?
When something takes that long to process its usually the process or ram
could be background apps. What cpu you using?
as in the processor?
yeah
Intel Core i7. it's a MacBook Pro
hm that's strange
Which one
this MacBook Pro is from like 2015
It shouldn't be throttling like that
yeah when i started it up, "java" CPU went to like 640% or something, and then disappeared. everything else is fine
ram shouldnt be much of an issue with world gen
i have 16GB of ram but i can try closing all the other stuff
Generating worlds can take up allot of ram
Discord actually seems to take up way more ram than it should, my hunch is that it isn't optimized for mac
Chrome is worse
but i'll just try closing out a bunch of stuff on my computer anyway
i'm using Firefox, switched from chrome for that reason haha
I use fire fox and opera
mk yeah i'll try restarting and get back to ya 🙂
restarted the computer and tried it again, max ram allocated is 6GB, and yep same problem
i've noticed that my laptop seems to run quite high on ram, and the battery needs to be replaced, so i'm wondering if that has to do with the performance. but would a lack of ram make it impossible to run, or just slow?
cause i'm also wondering if it will take a lot of ram to run the server, or only the first time when it's generating the worlds
#general any1?
@EventHandler
public void onCommand(PlayerCommandPreprocessEvent e){
if(Objects.requireNonNull(getConfig().getList("disabled-commands")).contains(e.getMessage().toLowerCase().substring(1))) {
e.getPlayer().sendMessage(Objects.requireNonNull(getConfig().getString("disabled-message")));
e.setCancelled(true);
}
else{
e.getPlayer().sendMessage("not working");
}
}
config
disabled-message: "You don't have access to this command"
#Commands to disable
disabled-commands:
- tps
- kill
It does not do anything at all, no matter what command i run
How do i stop scoreboard flickering
What would be the best way to "intercept" plugin class loading for instrumentation?
As far as I'm aware, spigot will always use PluginClassLoader to load the plugin main
Is there any way to stop the randomness in the Particle.REDSTONE colors?
I've tried an i of both 0 and 1
But there is always noticeable color variation
When I want them to be pure tones
@umbral dirge by using teams instead of scores
thx
I'm implementing something with advancements....how do I get the advancements name from an advancement object in Spigot?
Say I have the advancement
Hanro50 had made the advancement [Getting an Upgrade]
How do I get the "Getting an Upgrade" text in that advancement?
@warped coyote Maybe advancement.getKey().getKey()
Mmm...let me test that
Probably not - I'd guess that's actually handled client side - you'll see a different message depending on the client language
@sage summit
wait no
nvm
i'd say do a for loop
and
if
message equalsignore case "/" + commandname
then do this
Huh...the server prints out the message so I know the server processes it at some stage.
As for the advancement.getkey().getkey() messages... I get story/smelt_iron for Acquiring Hardware....
He'd actually just need to split at the first " " and use the 0th element in the resulting array
Maybe I can check for a story achievement type. And then check the chat log for the achievement text?
Is there any way I could make a queue system to get into my multiverse world
and /queue on in the world to turn on queue
If I send a plugin message to bungeecord every two ticks will the server lag?
Wait Minecraft is a multi language game...so I'd need to access the language files to translate the advancements IDs into readable names.... now to figure out how to do that
crowdin
@warped coyote You can get the advancement name id and to display it send it as a translatable text component and the client will get the correct name for you
But it depends on what you are trying to do, it doesn't work with everything
I'm outputting it to Discord
Do you know a queue system plugin for my multiverse worlds
So... won't work.
@copper star
I think you'd have better luck with doing something like that in bungee rather than using multiword.
Although luckily the Spigot jar contains a copy of the language jars
How do i check if block under player is chest? xd
Get the player's location, get the block the location represents, get the block below (the #getRelative method) check it's type or state (whichever better suits your situation)
hey, anyone know why it sends the command sender /command when someone executes my command in-game?
That's what you've specified in the usage: bit in your plugin.yml and you're returning false in the onCommand method
declaration: package: org.bukkit.command, interface: CommandExecutor
Clearly stated in the javadocs as well
I am getting this error:
Local variable queueposition defined in an enclosing scope must be final or effectively final
You cannot use a non-final local variable in a lambda that gets run at a later time
That's because it would be unclear which instance the variable is supposed to refer to at the time at which the lambda is run
You can simply create a new (final or effectively final) variable referring to the instance you need
@wraith thicket teaching young minds over here
Thank you @wraith thicket
how do I spawn tnt with a coustom fuse length?
Ok I ended up with a solution....so my planned solution is this.
Spigot will take the player UUID and advancement ID and ship them off to Bungee. Bungee has a language file which I can use to convert that ID into readable text.
I can then ship that off to Discord. And considering the Lang files contain item descriptions. It can lead to some fancy embeds along the way
Tbf there is probably a better solution... but I'm more familiar with JDA then Spigot or Bungee.
I... forgot how to use SQL tbh
But I'll look into that
\u78af\u309d\u3b31\ubff3\u972a\ue6fd\uf43b\u0d9a\u2324 . Guys What are they ?
idfk
try decoding it
like is it UTF-8?
it's probably byte data @cerulean musk
İdk what means \u78af....
probably byte data of some non-english charachters
like chinese or korean or something
in utf-8
it should be stored in the format of byte data
idfk
İ have a bedwars plugin and source codes is like this
there should be a decode function in java to decode bit encodings of text
İ have a bedwars plugin and source codes is like this
are you opening a class file? because that's not source. that's compiled bytecode
looks like someone was decompiling classes
İ found them with decomplier
those chars are what java translates them internally
knowing this community its probably just obfuscated
bruh dont try to read a source without knowing what ur doing
why not? it's more than likely an obfuscated string in decompiled source? i just told you exactly what it is...
in what fucking way is that not helpful?
also he didnt rly post anything
whoah may I ask if I'm allowed to swear?
obfuscators translate strings into seemingly random utf characters and pass them to a heavily obfuscated decoder method
with as little information as we were given, that is my best observation. characters with no discernible meaning found in decompiled source generally serve no purpose other than to hide text
you may continue to translate and try to decode them all you want but unless you have that decoding function, it's useless
in what fucking way is that not helpful?
@subtle blade AM I ALLOWED TO SWEAR?
why wouldn't you?
keep it in moderation
far from it. i just don't like being told i'm not being helpful when i've given, so far, the most amount of information while being provided nothing more than "what is this"
i've been in this community for 6 years now. the last thing I need is "you're not helpful"
wow yeah last time instead of helping u said to me was
"you should learn the basics of java before asking for help here"
and wouldn't bother explaining ANYTHING.
I just made a stupid mistake in my code and that's what u said
read javadocs, done
because we're not here to teach you basic Java. If you're failing to understand a basic concept, you should take your time learning it before approaching the Spigot API
That has been the case since day one and that ideology extends far beyond myself
every time u give an answer to an inexperienced person it's usually really offensive.
It’s really offensive when a lot of people ask for basic things that google or something else can search for.
Is launchpad a good NamespacedKey name? Or should I use a name like <my plugin>.customitems.launchpad?
You're fine to use simple key values. Realistically it's up to you because your key is namespaced. Hence the name
All your keys are prefixed with your plugin's name
Thank you, I don't need many of them so I guess I'll just keep it short and simple
You mean new String(byte[])
I'm trying to migrate my server from using a proxy to just using a plain spigot server, but there is an issue with the UUIDs when we are not in online mode, as bungee assigned the players a different UUID to their real one. How do I fix this?
Hey 🙂 I got a weird bug
online mode = uuid are taken from mojang
offline mode = uuid are generated by name
Thanks stellrow, I'm wanting to migrate from offline to online mode, do you have any advice on that?
you cant without breaking everything
I spawning a PrimedTNT, and a Bat, then making the tnt riding the bat. The problem is the position of the bat (so of the tnt), the X and Z axis a good, but the Y is not good, because I can't adjust it properly:
also i hope you know,changing from offline will also block every cracked player,meaning most players without a premium account wont be able to join @edgy ridge
Something is very wrong with my /give command. I have tried multiple current-version item generators, and all of them are giving me what my game is insisting is an invalid item name.
/give @s minecraft:turtle_helmet{Unbreakable:1,display:{Name:"{\"text\":\"Grippli\"}",Lore:["You can't wear helmets, but you can breathe underwater longer!"]},Enchantments:[{id:"minecraft:binding_curse",lvl:1},{id:"minecraft:vanishing_curse",lvl:1},{id:"minecraft:respiration",lvl:1}]} 1
^With this item it fails at "You" because it sees a space. If I put a space in the name it fails there instead.
that's direct from a generator, no modifications. I've tried it with 3 of them 😦
Even commands that people in forums insist work for them have this problem. If there's a space in the name or lore it fails.
@vernal spruce Yes, I am aware, we are moving off using a proxy, as it is too expensive to maintain it, and we would like to make sure cracked players cannot join, and make it so that we can grab skins too
Well no way to change to online without losing every possible data
might as well just wipe and start fresh again
Thanks for the help!
When I change the spawn position of the bat to b.getPosition().add(0.5, 0, 0.5) it's way too high:
And when I set to b.getPosition().add(0.5, -0.1, 0.5) it's too low:
For simplicity's sake, I generated a barebones one:
/give @p turtle_helmet{display:{Name:'[{"text":"Name with a space","italic":false}]'}} 1
returns:
Error: Unknown item name: turtle_helmet{display:{name:'[{"text":"name.
It appears it's not escaping spaces that are within quotes?
Paper 131, 1.16.1
Reproduce on spigot else go to paper issue tracker and report it.
how can i zoom in in Intelliji?
hey guys
is there a way to tag an inventory?
like how you can give an itemstack a namespacedkey?
because essentially I need a way for a listener to detect an inventory
now I could do this by doing a bunch of itterations
however it would be much simpler if I could just tag the inventory
and would imporve the performance of the plugin
because those itterations would run every single click that a player makes in an invent
and that could get quite performance heavy
where can i find a copy of the Spigot file that doesnt say its outdated in the console?
I'm looking for a developer
I think there's a place on the forums
May anybody help me with a question?
for hiring devs
just say your question and dont ask if we can answer it
^^
How to do it, that when a player do for example /skull , but he hasn't the needed perms , he'll get a customizable message?
How to do that?
if (!player.hasPermission("permission")) {
player.sendMessage("message");
return;
}
But I will make it general for all plugins
So that it isn't important which Command you execute the message will appears
use the code above
I don't want to do that for any PERMISSION
oi Michiel
I will do it for all in one code
"How to do it, that when a player do for example /skull , but he hasn't the needed perms , he'll get a customizable message?
How to do that?
"
do u know of a way to uniquely identify an inventory?
You need to be more obvious then
do u know of a way to uniquely identify an inventory?
@formal nimbus Could you give a explenation?
sure
?
so imagine I have a group of inventories
they're all really similar
and I want them to have the exact same functionality
How to do it for all Permission in one code?
except there's one or 2 items different
Not for every single perm
@shell zephyr You can make a list of permissions used in your plugin
I want to check ifthe clicked inventory has a certain tag
then check if the player has one of the stored permissions
@wispy pewter I don't understand. Please explain
that way I know it's an inventory which is meant to have the particular functionality
that way I know it's an inventory which is meant to have the particular functionality
@formal nimbus You mean a table of inventories with keys?
so like _inventories["Inv_1"]
I don't know lol
sure
imagine all the inventories are in a list
but I don't want to have to iterate through the list
I just want to check fi they have a particular field
You mean a key that holds a value inside a table
I'm desperate
I don't know xD
Figure out what you want to do
I know what I want to do ):
I cant really help you with the provided information
I'll show you the nameSpacedKey example
ok
so that for example
So
rather than checkinf if the itemsatck is in a list, I just checked if it has my particualr identifier
therefore i know it's a crate ItemStack
Just use a table i suppose
by table do you mean a list?
No
o?
hashmaps
oh right
When the Player type /skull , but he hasn't the needed perms, he should get a message about the deny. But I don't want to make a plugin for every single deny message, I will resume it. So what to do? How to do it in general for all the deny messages?
do titles accept certain texts
private final Map<SomeType> _inventories = new HashMap<SomeType>();
also where can i get the vannila text thingies(such as the pickaxe)
When the Player type /skull , but he hasn't the needed perms, he should get a message about the deny. But I don't want to make a plugin for every single deny message, I will resume it. So what to do? How to do it in general for all the deny messages?
@shell zephyr So lets your plugin contains 10 commands with permissions. and you dont want to add a perm check for each of those commands?
Nooooo.
That's the question
?????????????/
I don't want to do it
Bro that's literally what you are saying.
yes, but only if you make it clear what you need help with lol
Which code I need to type
what you're saying doesn't exaclty make sense
YES
I recommend making one super permission which controls all the commands
like "MyAwesomePlugin.use"
You are going nuts with your own explanation
Listen. What you want is one super permissions which controls all the commands in your plugin
*picture
how do i add symobls to text
Listen. What you want is one super permissions which controls all the commands in your plugin
@wispy pewter It shouldn't control the commands. It should only send everytime the same message that the player doesn't have the needed perm
Example Permissions:
1. skull.use = if a user has this permission he can execute all commands related to the skull plugin.
2. skull.destroy = Allows a player to destroy a skull
your statement is contradictory
Can you not put a primative tpye inside of a hasmap?
so ur saying I have a hasmap like this one:
I then put every special inventory I want in that map
with the same code
then when I want to test it
I stick in the click inventory
*clicked inventory
Yes and use the integer as unique ID
But then instead of int use UUID
o?
Which is specially designed for creating unique id's i reckon
cool
oh and change inventory to _inventory
so you always know you are working with the field
because variables could also be called inventory
and then it can cause conflicts
#NamingConvention
Always make private fields start with _
does anyone know a placeholder for mob hp or a plugin that gives me that placeholder or something
i want to put the mob hp in the name of the mob
You mean a new field inside the mob class?
oh and change inventory to _inventory
@wispy pewter I haven't been following that naming convention, so I'm not gonna start now lol
I'll implement it in future though
Its good to start with
otherwise you will eventually get lost inside your own code
but that means renaming EVERY VARIABLLLELELLE
I'm on eclipse and it doesn't make it easy ):
I don't think eclipse does?
😂
yeah ik
^
wut doth it do?
its not going to be a pain
ofc not
it is going to be big pain
that's an ide for you
Or your lazy 😉
google type java convention
k
even quicker lol
prob a lot quicker
easy see xD
Im still gonna have to find every object and check it ;-;
so instances and hashmaps begin with an _
Well if you keep coding then it will take longer to change all of them 😉
or I could just not change them :0
Only if they are private lol
wait wat
wait so private things begin with an _
ok I need to find a different link
You know the difference between the public and private access modifier?
yes obviously I do
Alright
it just didn't say on the document to name privaate things with an _
...
wat
lmao
so
private:
private String _name = "big doddo";
public:
public String Name = "Big doddo";
no
yuck
where the fuck did you learn that
that's wrong
cool
probably should only be lowecase in java then
what doesn't work
No under-score
😂
Maybe in java _ isnt in its naming convenation
@wispy pewter what language is it then?
I see
So thats why i thought it was in java to
private fields should start with _
what is this? Python?
The reason why we create private fields _ is to identify the diffrence between variables and private fields
what is this? Python?
@subtle blade C
as far as I know python naming convention is basically save as Java
*same
but I've only done basic stuff in Python
oh yeah python I've done a fair bit of that
so I don't realyl know
yeah, only python's encapsulation is a joke in that in order to privatize something you prefix it with _ or __
The reason why we create private fields _ is to identify the diffrence between variables and private fields
@wispy pewter sure it makes sense
I don't like the way you type in python
then it name mangles it
im not even kidding. look into python encapsulation. its terrible
i find python a bit weird
Because it is 😂
the most half-assed OOP language i've ever seen in my life
ahah
I started off coding in python, when I started Java a couple of months ago I instantly preffered Java
python is just eh
let me created a quick example of what i mean with the _ naming convention in C#, C++
the most half-assed OOP language i've ever seen in my life
@subtle blade that's literally cause it is
it's like, you can do OOP or functional
and it's just odd
probably why many like it
for those who don't understand the glory of OOP D-:<
public class Test
{
private Map<Integer, String> _data = new HashMap<Integer, String>();
public static void main(String[] args) {
var data = _data[1];
}
}
Guys how can i make killer heart? (Esat was slain by Mustafa 8.5HP)
if the field is just called data i cannot create a var called data
The _ allows us to determine whenever we are working with a field or not
for some reason i need to reload my plugin before it works
I'm planning on creating one
cause it seems you mainly code in C?
oh nice
it's remarkable how much help you can give despite the fact you've never made one 😮
@ancient ridge Go learn PHP 😂
Go learn PHP 😂
we don't tolerate threats here
it's remarkable how much help you can give despite the fact you've never made one 😮
@formal nimbus Thanks ahah, I only looked at the docs of spigot yet. But after learning couple languages its easy to understand the next one.
Its just called Experience
thats all
👍
bruhhe fortran oldd
The entire economy of the USA runs on COBOL
Want to know whats even worse?
VISUAL BASIc
I don't know what that is ;-;
Module Module1
Sub Main()
Dim insult = "You suck"
Console.WriteLine(insult)
End Sub
End Module
That
Public Class Person
Public Name As String
Public Gender As String
Public Age As Integer
Public Sub New(name As String, gender As String, age As Integer)
Me.Name = name
Me.Gender = gender
Me.Age = age
End Sub
End Class
What language is that?
Visual Basic
You like it?
Please dont
Lua is my third fav language
XD
function love.load()
math.randomseed(os.time())
width = love.graphics.getWidth()
height = love.graphics.getHeight()
end
function love.draw()
for y = 0, height do
for x = 0, width do
if y <= 15 or y >= height - 15 then
love.graphics.setColor(1,185 / 255,15 / 255)
love.graphics.rectangle("fill", x, y, 1, 1)
else if x <= 15 or x >= width - 15 then
love.graphics.setColor(191 / 255,62 / 255,1)
love.graphics.rectangle("fill", x, y, 1, 1)
else
local color = {
r = x / 255,
g = 0,
b = y/ 255
}
love.graphics.setColor(color.r, color.g, color.b)
love.graphics.rectangle("fill", x, y, 1, 1)
end
end
end
end
end
xD
You like it?
Not really xd
This channel is for help only please take it to general
Messing with pixels
This channel is for help only please take it to general
@balmy sentinel oh oops, ssst
Lua is faster then C#
lol
How can I thunder someone with a script
Dont see a reason to use static
Static should not be used when storing data
Just make it private
thats all
but I don't want multiple maps
You dont need
?
and I only want 1 UUID
yes
it's instantiated lots
should I store the info in a class which is only instantiated once?
if you only want one map than yes.
I thought you were working with Singetons again 😂
mainly because he's saying I don't need to change anything
I thought you where working with Singetons again 😂
@wispy pewter nope
Altough you could create a class called ItemStore
that stores all the data
Which i would recommend
And that DataStorage class is a singleton
awwwwwwwww ):
understand?
You'll save time/effort in the future.
Yep
And now you know that the Items are being stored in the ItemStorage class
This will make your project more readable
for some reason my plugin only works when reloaded
Yes
what if I abreviate it but leave a comment saying wut it is
Its always better to sort your stuff
it’s your plugin name it what you want. Naming conventions are really just for you to understand what it is. However you should pick a name where someone else could read your code and understand what it is and used for.
^
?paste
Seems the jar isnt added
Ooh then i think i know
If your plugin loads before the other does you cannot call it
How can i make https://cdn.discordapp.com/attachments/713154327350607963/714547005375905803/unknown.png like this ? Killer hearts
Player#getAttribute
If your plugin loads before the other does you cannot call it
@wispy pewter what?
@here
wot
any way go to restart my pc bye
If your plugin loads before the other does you cannot call it
@wispy pewter what does that mean
is there a wat I can clone an inventory?
What inventory you want to clone? Why you not listens to inventory events, like InventoryOpenEvent?
i think he ment way
Is a way to remove a resource?
report that resource with "delete" or sgh text
?paste
Where can I create a thred?
on spigot
You just go into the forum section and click Post New Thread.
Make sure you're logged in and if the button isn't there, you can't post there. Some sections have requirements such as 50 posts.
I can't post it
halp
halp?
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_241]
at `java.uti`l.ArrayList.get(Unknown Source) ~[?:1.8.0_241]
at com.javaminecraft.Elytra.<init>(Elytra.java:212) ~[?:?]
com.javaminecraft.Elytra.<init>(Elytra.java:212)
I can't post it
login/register to spigot
I did it
Where are you trying to post specifically?
You need to go into a specific section as I said.
Which?+
What are you going to post?
But remember there are requirements to post there.
You require at least 20 posts and a 1 week old account to post within this section
All threads within this section are moderated until they are found to be in line with the section rules.```
anyone wana help me learn how to program spigot plugins
So you post in other sections about something else.
I can't
whats the best way to store player achievements like how do the big servers do it? I was thinking an achievement database, but I'm not sure if I should make each achievement it's own field and use a tinyint (1 or 0 for achieved and not achieved) or use an array in the database so it'd just store their uuid and and array of achievements. Lmk what you all think is the best way of accomplishing this. I was thinking like 20+ achievements with room to add more. (Still trying to find a way to store progress tho 🤔
Guys who can help me for coding issues? Dm me please
you want errors to code?
?ask
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.
how do I delete my account?
I've been banned on spigotmc.org
what you do before you got banned?
How do i fix Lighting lag (TPS) when i place a block above void in spigot 1.8.8?
how?
you could check if a block is right above 0-1
declaration: package: org.bukkit.event.block, class: BlockPhysicsEvent
declaration: package: org.bukkit.block, interface: Block
Inventory inv = chest.getInventory();
if (!(inv instanceof DoubleChestInventory)) {
event.getDrops().addAll(drops);
return;
}
DoubleChest doubleChest = (DoubleChest) inv.getHolder();
for (ItemStack item : drops) {
doubleChest.getInventory().addItem(item);
}```
Anyone know why this won't work
Doesn't put anything in the chest but Chest chest = (Chest) chestBlock.getState(); for (ItemStack item : drops) { chest.getInventory().addItem(item); } does, however only into one half of the inventory
This is more of a general Java question than a question pertaining to Bukkit, but it is still somewhat related to Bukkit based on the situation.
I have some library jars that I would like to add to the classpath for the JVM, so I will use the -classpath argument to specify the folder\*. The problem I am having has to do with the fact that the Spigot jar has some of these libraries with the exception that they are on a lower version. If I were to specify these dependency jars using -classpath, would the classes loaded from these jars take priority over classes with the same name loaded from the Spigot jar? I assume it wouldn't from a maintenance perspective, because the code in the Spigot jar does not expect any other version than the one packaged with it.
@lone fog also yes it puts only in half
because you can cast a doublechest to only 1 chest
i believe doublechest has methods for both inventorys
or check first if the instance is a doublechest
before using only chest
That is what if (!(inv instanceof DoubleChestInventory)) { is for
not rly sure why are you working with holders
also
how can a chest be instance of doublechest
??
Chest chest = (Chest) chestBlock.getState(); Inventory inv = chest.getInventory(); into inv instanceof DoubleChestInventory
Alright changed it to ```Chest chest = (Chest) chestBlock.getState();
InventoryHolder holder = chest.getInventory().getHolder();
if (holder instanceof DoubleChest) {
DoubleChest doubleChest = (DoubleChest) holder;
for (ItemStack item : drops) {
doubleChest.getInventory().addItem(item);
}
}``` as per <https://www.spigotmc.org/threads/add-item-to-double-chest.431341/>
im sure i already know the answer but test it yourself
Still empty
as expect you cant turn a chest into a doublechest straight like that
let me get the spoon quick
What plugin would u suggest to stop exploiters?
a good staff
exploits can be anywhere,including in other plugins
you cant prevent them
there are some not even the developer is aware of
if(chest.getState() instanceof DoubleChest) {
DoubleChest dchest = (DoubleChest)chest.getState();
HashMap<Integer,ItemStack> left = dchest.getInventory().addItem(item);
if(!left.isEmpty()) {
for(ItemStack items : left.values()) {
addToChest2(chest.getLocation(),items);
}
}
return;
}
if(chest.getState() instanceof Chest) {
Chest cchest = (Chest) chest.getState();
HashMap<Integer,ItemStack> left = cchest.getInventory().addItem(item);
if(!left.isEmpty()) {
for(ItemStack items : left.values()) {
addToChest2(chest.getLocation(),items);
}
}
return;
}
}```
@lone fog
as simple as checking first if its a doublechest
like why go through holders and shit
ignore the hashmap and stuff as thats just a simple go next chest if current one is full
if (chest instanceof DoubleChest) {
Bukkit.broadcastMessage("double");
} else {
Bukkit.broadcastMessage("not double");
return;
}``` chest instanceof DoubleChest doesn't pass
Has anyone know about MySql Placeholder i kinda need help
you know that..
you are trying to check if a chest is a instance of doublechest right?
I know it is a double chest
i told you stop casting it straight to chest in the beggining
Chest chest = (Chest) chestBlock.getState(); this should not exist only before checking if its a doublechest
first
How i fix lighting TPS lag at spigot 1.8.8?
alrdy told you to cancel blockphysics after placing it
this should ignore light update or anything about the block
ok, so this can work?
@EventHandler
public void test(BlockPhysicsEvent p) {
p.setCancelled(true);
}
you check if the block meet your condition
you dont cancel every physic holy shit..
;-;
You do check if the block location is at level 0/1 y
declaration: package: org.bukkit.event.block, class: BlockPhysicsEvent
no need to care about anything way above void
ok
Nope if (chestBlock.getState() instanceof DoubleChest) still fails
Infact, DoubleChest does not even extend BlockState
you check light level
if it has clear sky it will always be 14 if i remember
declaration: package: org.bukkit.block, interface: Block
but if is night the light level go be the same?
yes
Thanks for help bro
Infact, DoubleChest does not even extend BlockState
@lone fog yet ide throws nothing when i do this?
Guess not
if(b.getState() instanceof DoubleChest){
}```
Ah I see
its not gonna magically only work for me..
you know,you can simply copy paste the code i posted
and just change it to fit
so you didnt even look at the fully functional code i posted.. i see
if(b.getState() instanceof DoubleChest){ }```
@vernal spruce DoubleChest does not extend BlockState
I mean if(chest.getState() instanceof DoubleChest) can never be true so...
Don't work Stellrow, the TPS lag its the same
tps or fps
server TPS
when i place a block in a hight place
the lighting loop put the tps down
Well you only checked if you are placing a block right above the void
You do check if the block location is at level 0/1 y
Assuming you did that
i made for check if the block y its above 30
Any1 Hv Good Plugin to Warp Menu = Inventory to select item to teleport?
See the ChatColor class
@ionic hound do sender.sendMessage(ChatColor.<Color>"<Message>")
you can either use the constants or use ChatColor#translateAlternateColorCodes()
?paste
ok
@static echo do i need to import anthying?
Import ChatColor
Can you disable disconnect.spam in the spigot source code or something?
I saw some plugins that tell the owner if there is a new update for the plugin, how do I make that
so @static echo import org.bukkit.ChatColor;
just press CTRL+Shift+o to import everything
@ionic hound Yes, but is more eazy you try press CTRL + Space
how do I post on the forums?
I cant find the place to do so
yes, good gif
hey guys, im trying to set rewards for voting, I currently have the rewards file as the following but nothing is given. Could you let me know what im doing wrong? Thanks
MinecraftServerListings:
Enabled: true
Name: Minecraft Server Listings
ServiceSite: minecraft-server-list.com
VoteURL: https://minecraft-server-list.com/server/465613/vote/
VoteDelay: 24
Item:
Material: TRIPWIRE_HOOK
Amount: 1
Chance: 100
Name: '&aPirates Chance Key'
Enchants:
fortune: 1
Rewards:
Commands:
- /eco give {player} 1000
- /xp give {player} 1l
Messages:
Player: '&aThanks for voting on %ServiceSite%!'
hey im very new to java / plugin making and im having a problem
dead code. you have a return true the line above your error
e.e
you should (1) fix your indentation and (2) use braces where appropriate. Just because you don't have to use them for single-lined statements doesn't mean you should
i dont really understand what ur saying if u dont mind explaining where i should put the return true line
Why are you creating the same variable 2 times
Choco, can anyone learn how to program?
Someone told me to give up because I asked a question about Java.
Anyone can learn
^
I don't want to give up, but someone else told me to.
If you want to figure something out then search that particular feature on google
oh well now im stuck not knowing what to do
Some people can be rude
he told you to give up because he probably doesn't know how to program himself.
If you want to figure something out then search that particular feature on google
unless it's complex stuff i.e. packets, nms, etc then you probably will have to ask
Every beginner will ask questions
That with everything the same
You can't learn to drive a car without getting help
or asking questions
@frigid ember he told you to give up because he probably doesn't know how to program himself.
probably just a wanna be kid who tries to flex with a hello World program
Well I mean he does know how to program, he's in this discord right now, but I don't know if I should say his name.
🤔
Don't give up and keep going :)
Good that hes here
name and shame him
😂
hey so @wispy pewter can u help me with my problem i dont know what do
The return statement cancels the code after it causing dead code
You can put code under a return statement in the same scope
The returns statements prevents the program for executing any further code in its scope
hey ill send the script and can u show me what to do here is the script
package me.valid.event;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
public class Main extends JavaPlugin {
public void onEnable() {}
public void onDisable() {}
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (!label.equalsIgnoreCase("setevent"))
return false;
if (!(sender instanceof Player)) {
sender.sendMessage(ChatColor.DARK_RED + "You do not have Permission to access this command!");
return true;
}
Player player = (Player)sender;
if (!player.hasPermission("event.set"))
return true;
Bukkit.broadcastMessage(ChatColor.translateAlternateColorCodes('&', args[0]));
String message = "";
message = message + args[0] + " ";
return true;
if (!label.equalsIgnoreCase("getevent"))
return false;
if (!(sender instanceof Player)) {
sender.sendMessage(ChatColor.DARK_RED + "You do not have Permission to access this command!");
return true;
}
Player p = (Player) sender;
if (!p.hasPermission("event.get"))
return true;
p.sendMessage(ChatColor.DARK_GREEN + ""+ message );
return true;
}
}
discord indention sucks
?paste
send us the .java file
Paste it there and send the link
^
why do people use label 🤔
?
^ was going to point that out too, should be the opposite
otherwise any other command that is not setevent wont run
turn
if (!label.equalsIgnoreCase("setevent"))
return false;
//code here
into
if (label.equalsIgnoreCase("setevent")) {
//code here
okey
same for getevent
ok so i did that now this happend :-:
ohhh
That return true before the second if is to blame for the ide complaining.
The highlighted code beneath it will essentially never run basically.
not necessarily
in his case he should have it there and end the first if statement
so that setevent is one block, and getevent is one block
If there is a chance for a return not to run the ide won't complain. So if you do
If(x){
Return;
}
//Code here
It won't complain
If you do
If(x){
Return;
//Code here
}
It'll highlight anything after the return block in red that's still within the if block.
.
Sorry, bit slow and messy with my explanation😅
Was that for the thing from earlier?
Wait, I misread.
I'm tired lol.
I'll go mess up hashing on 2FA tokens. Back in a bit. Just realised that's even more of a tired thing to say coz I can't hash em 🤦♂️.
I solved my issue from earlier btw
Thank you Bungeecord devs for including a language file in the server jar...
what?
Send the full config file so we can help you with what's wrong with it
spigot applies certain transformations when loading classes, such as replacing legacy materials if applicable. does anyone know where the code for this is located?
can't find it in PluginClassLoader
Looks like ; to me
yeah
Yeah minor mistakes can and will mess up your config file
hey does anyone know if there is a way to access the global nbt storage that was added in 1.14?
You could force a command to be run and grab the data
you can't grab global nbt with Persistent Data Containers
Don't know of anothe way
Anyway why do you need to use that?
I heard it's faster
because it doesn't deserialize and reserialize everytime
PersistentDataContainer is stored inside PublicBukkitValues https://i.imgur.com/MFfBJpr.png
and can only get/set stuff from there
It's not worth it mess
I know you are able to store with an entity
or itemstack
yeah alright
I couldn't find a way to do it with api, just wanted to confirm that it was the case
spigot applies certain transformations when loading classes, such as replacing legacy materials if applicable. does anyone know where the code for this is located?
@fading frost Commodore
what's that?
ok thank you, that looks promising
are there any further transformations being made?
Or does it all happen in convert
to my knowledge, all is done through Commodore
There's nothing more than the SimplePluginManager, PluginClassLoader and Commodore
At least with regards to managing class instances
Sure
I mean there is no api for custom class loading as far as I'm aware
I'm doing it with a really hacky solution right now
All you need to load a class is a URLClassLoader
well there's a little more to do than that if you want to intercept it
And I'm talking about the plugins themselves, not some plugin system of my own
unless there is a way to change the class loader that's used to load the plugin main.
wait, when does this commodore stuff happen?
it replaces the jar file, is that correct?
In the PluginClassLoader
so before anything is loaded
Reads the class' bytes, processes them through Commodore to convert what needs to be converted using ASM, defines the class
(processClass() is literally nothing more than a call to Commodore#convert() - https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java#304-313)
ok, good
I think I can work with that
You have been of great help so far, thank you
o/
