#help-archived
1 messages · Page 85 of 1
And much quicker
and you can't run it async anyway since getType is unsafe
Yes but it's unnecessary for this
don't take a damn chunk snapshot to check 16 blocks
So again... before you decide to toss a thread into the mix just because "ASYNC = FASTER", think twice
Hey guys, for cursors how do I get the player's direction as a byte
No because on 1.13+ it times out the server..
in the best case you only check 2 blocks
Not because its faster
well you have to optimize it
jfc, if I hear one more time that checking 16 fucking blocks is going to crash the fucking server
1.13 performance isn't shit. Your code's performance is shit
not .1, .2, .3
LOL
correction: 1.13 performance is shit, and your code's performance is also shit
Lol
^^ @silk bane
I run 1.15 pretty decently
I do as well
Where the fuck did I say
I crashed 1.15 with sand blocks only
1.13 is shit
My world on 1.15 loads slow too 😦
1.13 or 1.15, we don't talk about fucking 1.14 kids
Magic values, comparing Material constants' names with Strings, hundreds of location cloning
Only need one location, create constants, compare Material constants, etc.
You're checking block type. Block type will only ever change every 1 coordinate
Iterating every 0.1 and on every axis is so unnecessarily overkill it hurts
Take my points and get to work
🤯
Hey guys, do you know how to get the players direction as a byte?
cursors.addCursor(fX, fZ, (byte) 12, (byte) 4);
Direction the coursers going in?
Yeah
I'm genuinely surprised Bukkit exposes a magic value like that
The facing of the cursor, from 0 to 15.
I assume clockwise
0 = north, 3 = east, 7 = south, 11 = west
I've got the values
0 = South
1 = South-West-South
2 = South-West
3 = South-West-West
4 = West
5 = North-West-West
6 = North-West
7 = North-West-North
8 = North
9 = North-East-North
10 = North-East
11 = North-East-East
12 = East
13 = South-East-East
14 = South-East
15 = South-East-South
But I'm not sure how to change the players direction to them
Right. Minecraft's coordinate system is ass-backwards
Lol
Yep
youd have to do some basic math to figure it out
im tired
if you add 180 you can convert from -180/180 to 0/360
so 0<yaw<45 would be 1 direction
etc.
theres probably a utility/method out there that does this already
Yea, I'd multiply by that byte by 22.5 to get a value from 0 - 360 degrees
Subtract 180? Not sure
alright, I'll look for a util
Still genuinely surprised Bukkit exposes a magic value
i think, when you've written wrappers for hundreds of magic values in minecraft, there's a point where you just go 'fuck it' and leave it in the API
Well here's the thing... we have a Rotation enum
Ah not quite enough constants. I think there is one though
I'm like 90% sure banners use that same type of rotation of 22.5 degrees
why dont you simply call e.getentity.getkiller?
even better why nms
also a check for bow will also be needed
oh yeah just noticed that craftentity cast
Gosh this code
I'm putting bets on custom dragon
i was betting on decompiled
most likely
f
F
you know what i also love
no seriously though why is it nms
how he gets a inventory from a string
I'm putting bets on custom dragon
@solid canopy entity.getKiller
make sure it's an InventoryHolder
cast it
holder.getInventory().addItem
getKiller could be an arrow, or potion as Stellrow said
Don't think it can
also check for possible full inventory to drop the item rather than adding
getKiller() returns a Player
@solid canopy entity.getKiller
make sure it's an InventoryHolder
cast it
holder.getInventory().addItem
@torn robin Do'nt understand how
so its pretty inaccurate then
If you want the arrow that killed it, get its last damage cause and grab it from the event
so it'll be null if they died by a bow
that 1 answer made the impression
How do i reset events of ComponentBuilder? I use this code, but the whole "/help general to see all general commands." has the hover and click event from the "/help part": ``` commandSender.sendMessage( new ComponentBuilder( "Use " )
.append("/help skywars").event( new ClickEvent( ClickEvent.Action.SUGGEST_COMMAND, "/help general" ))
.event( new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ComponentBuilder( "Click this to put it in your text box." ).create()))
.append(" to see all general commands.").create());
It will be the player that shot the arrow
on where the code is from😂
afaik you can .append() another text component? I haven't used the ComponentBuilder in a long time
it shouldn't all be 1 line
@torn robin Its more structured for me. Cant read a long line at once
ok
public ComponentBuilder append(BaseComponent component)
public ComponentBuilder append(BaseComponent component)
@subtle blade Ok i will try this
Alternatively, FormatRetention may have something?
FormatRetention.RESET or something if I recall correctly
Oh, no, FormatRetention.FORMATTING
It will drop event formatting on your next append
FormatRetention.RESET or something if I recall correctly
@subtle bladeIt wont reset it for the the whole builder?
Nope. Just all that is appended
.append("Hello!", FormatRetention.FORMATTING);
Events are dropped, colour and whatnot is kept
.append("Hello!", FormatRetention.FORMATTING);
@subtle blade ok cool will try that
Component API works linearly 🙂
Heya guys, i remember there being an option to enable recipes to check if you have discovered the recipe first before crafting it. What was this option called again?
It's a gamerule iirc
Ah! Thanks!
doLimitedCrafting I think
I just found something so sadening
No i found mine
oh shit waddup
Anyway another saddening fact
I just discovered that banner pattern recipes don't exist
Not yet, no 😦
And with doLimitedCrafting set to true, you can't craft them.
I mean like
Before 1.14 btw
mhmm
yea if you set that to false you should be able to craft things even without discovering them
Think you'll discover it once you do though
Craft the banner pattern?
Well not really, i just made a method that loops through every recipe, and unlocks that recipe if it has "BANNER" contained in its result material
That didn't work, only normal ones showed up

true OGs make banners and fireworks through the crafting table
none of that weak loom stuff
Yeah that's what we are talking about
Only way i see it is i need to go through over all of the docs and add the recipes manually myself
doesnt sound that bad
@worthy lava a real OG knows too that he can use Minecraft tools for crafting banners: https://minecraft.tools/en/banner.php
man its good to see minecraft.tools is still up
Yes but that doesn't solve my problem
Well it might
@frigid ember do you have a page where every pattern is shown in crafting?
Hello how could I fix one chunk that lag when someone enter it? I tried remove all plugins except Multiverse and ipwhitelist, tried to place it on different servers and still there are lag spikes... But on one server it doesn't lag
@worthy lava it depends on what version you are using
The way to craft them changed over time.
1.13.2
old version
Well im sorry mister but i can't update above that version because mojang doesn't really do a good job at optimising newer versions
old version
@vernal spruce Are you waiting for this all day?
Not my fault
nah i actually use that for alot of things
nah i actually use that for alot of things
@vernal spruce k
@worthy lava there are over 809,6 trillion differnt banners. You really wanna do this?
damn
Anyone don't know about chunk fix? 😅
do you want all 809.6 trillion different banners
Well actually i could
@worthy lava I think i cant give you a page with all banners. That would be considered spamming the web. 😂
I mean, all i need to know is what shape
What you shape you create a specific pattern with
Its in the minecraft wiki
its in google images as well!
you dont need spigot help you need mental help!
ive always wondered how that was done
they use viaversion/viabackwards
for protocol hacking..
thats how all of them do,but i strongly believe hypixel has theyr own
and they are hypixel with a big dev team behind..
also,anyone got a spigot resource "template" i could borrow?
BUT ON WATERFALL!
ViaVersion and ViaBackward are not Bungee plugins!
@frigid ember Yes i think its ping passtrough. The server will tell the perople all its comability
In config.yml?
@frigid ember Im not a dev. I cant promise you that it works. Yes its in config.yml
why packet titles?
wait where did you get that from
someone asked me to fix a bug with it
i basically said this is bad code but ill fix it
only the part that wasn't working
not all of the code
i think u are better off telling him to remake it
is it even working in the first place?
barely it looks
@frigid ember I think I killed my proxy. :ded:
@frigid ember What?
I enabled something in the config, to test, "What", and I killed it. pls help :p
@frigid ember Can you give us the config?
@frigid ember logs?
@frigid ember it seems like the server refuses the proxy
Is the port really open?
@frigid ember your Proxy cant get the version of the server, when it is off
Waterfall seems to try to connect to the server, but fails
@frigid ember ahhhhhhhhhhhhh. I thought you wanted to change the displayed version, when you saved the server.
You can do that in the spigot.yml file of your hub server
under messages
thats being a server owner in a nutshell
you eventually solve it
@frigid ember now you see why its handy to have it
i have this problem
btw lilypad or whatever bungee competitor was is still around?
The message comes from the server
messages:
whitelist: You are not whitelisted on this server!
unknown-command: Unknown command. Type "/help" for help.
server-full: The server is full!
outdated-client: Outdated client! Please use {0}
outdated-server: Outdated server! I'm still on {0}
restart: Server is restarting
Thats the part of the spigot.yml file
Hey guys, I need help with my maps again
https://www.youtube.com/watch?v=2e7Kt1a2r1c&feature=youtu.be
When I set the Scale further than Scale.CLOSE , it doesn't render the full map
public void update(MapView map) {
@SuppressWarnings("deprecation")
WorldMap worldMap = (WorldMap) MinecraftServer.getServer().worlds.get(0).worldMaps.get(WorldMap.class,
"map_" + map.getId());
world = ((CraftWorld) map.getWorld()).getHandle();
int size = 128 << worldMap.scale;
for (int x = worldMap.centerX - size / 2; x <= worldMap.centerX + size / 2; x += 32) {
for (int z = worldMap.centerZ - size / 2; z <= worldMap.centerZ + size / 2; z += 32) {
locX = x;
locZ = z;
itemWorldMap.a(world, this, worldMap);
}
}
}
if (map.getWorld().getName().equals(player.getWorld().getName())) {
map.setCenterX(player.getLocation().getBlockX());
map.setCenterZ(player.getLocation().getBlockZ());
mapUpdater.update(map);
}
i cant msg
How do I make Eclipse link to other javadocs when it depends on classes from other javadocs?
but jars are intensive aren't they?
nope they act as dependencies
U think you'd have to make a fork?
does eclipse let me generate docs with maven?
does eclipse let me generate docs with maven?
@tough viper
The IDE is irrelevant. Maven lets you do it. Eclipse just calls the maven command.
why?
people usually avoid whisper helping
@sick citrus how do I do it?
as it tends to get sticky..
Gyrmadro the help is here not anywhere else
as somebody said why they dont do whisper... they dont want to become theyr personal assistant..
as thats where it usually ends..
@frigid ember verify urself
Verify
then you will
@tough viper https://lmgtfy.com/?q=maven+generate+javadoc
If I were you, since you asked that question though, I'd quintuple check that you are indeed using maven...
isnt that just
changing server name in .proprieties
thats how i did it last time,there are even plugins to do it for you
ahh you meant the requires mc message
@vernal spruce @frigid ember not sure there's anything in the API for that.
to change the "requires thing"
you'll need NMS/Protocol I'm pretty sure. I tried to do it too but failed to find anything in-api
@wooden tree
ProtocolChanger then
on a server
Bungee should have that in-api tho
spigot requires protocol.
If it's for bungee, listen to ProxyPingEvent, and call event.getResponse().getVersion().setName("what you want it to say");
can i put the error.txt file in #general ? bc it wont work here
it dont work anywhere
well time for you to verify then
ok
Please how could I fix chunk that lag when someone enters?
the chunk contain almost nothing
and we have good cpu
just one chunk is laggy....
hmm might be a coruppted chunk
and how could I fix it 😄
it was originally built on 1.15.2
so what can be wrong with it
I tried also pasting with schem and still laggy
hmm not sure,there should be however stuff on the internet to fix them
that was boring webpage xD
i think mcedit also provides a "fix" button
i got tired myself of downloading txt files..
hmm java.lang.RuntimeException: org.bukkit.configuration.InvalidConfigurationException: unacceptable code point ' ' (0x0) special characters are not allowed in "'string'", position 0
special charachter?
yeah the name somehow has a special charachter
it points to spigotconfig at org.spigotmc.SpigotConfig.init(SpigotConfig.java:65)
maybe spigot.yml?
yeah i use notepad++ i love the sorting feature
also were on keyboard..
and also when you code alot you learn to type rather fast..
Any of you ever had this issue or seen it before?
[16:38:04 WARN]: Event ConnectionInitEvent(remoteAddress=/[HIDDEN]:20234, isCancelled=false) took 499ms to process!
isnt that a paper error?
Bungee
It's happening only to me when i log-on, i have to wait 2 minutes to be able to do anything.
All my chat logs, commands, register in spigot console but nothing happens in game until it responds or i'm kicked.
it says the server is online
Why would a class not be legal for implementation? I think I need to use it but it's "not legal"
bad practice
@frigid ember what you using it for?
create your own
don't use bukkit's interfaces
same for inventory holders
you know you who you are
I'm trying to transfer a recipe from a preexisting recipe to a new recipe that changes what the result is
it will shuffle all the recipes around randomly
the problem is these RecipeChoice stuff
idk but often encapsulation with references is a better practice than the interfaces of bukkit.
How do you make Eclipse generated javadocs link to other classes from other docs
Like Spigot classes
javadocs
You can link something through
/**
* {@link package.Class}
*/```
idk acc
search up?
but mcedit doesn't work on 1.15.2?
how do I link that org.bukkit.event.Event to bukkit's event class
does {@link} do that?
@gray plume by fixing line 776.
lava and water arent flowing on my server? it flows after restart but stops suddenly after like 20 minutes? Whats going on
plugin stopping lag ?
Idk which one would do it tho
...essentials ?
yeah but i dont see where it would stop the flow
well if you install protocolchanger, obviously you'll have the player amount working
Ultimate way would to code it yourself
if you didn't disable viaversion/whatever you're using that allows other players to come.
https://ci.md-5.net/job/BungeeCord/ws/api/target/apidocs/overview-summary.html
Where's the searchbar? Am I stupid?
well protocolchanger is very basic and you can't really go any more barebones unless you use reflection (to get rid of ProtocolLib).
@timber barn yes
where is the bar then
hidden
hidden
@sick citrus
thanks
you may notice that
top left
It's not you, don't worry.
but do you really need a search bar for a javadoc of a like a dozen class ?
with the time you spent asking about the searchbar, you would have found it in time
It's not. It's just the fact that the javadocs is hosted in the CI, it messes it up somehow
F
Hey guys still waiting for idea to fix broken chunk 😄
Can someone help me on this thread https://www.spigotmc.org/threads/map-update.439293/
how would i go about mob stacking?
Cannot resolve method 'getConfig' in 'ExclusionUtil'```
Main:
package me.faintcamo.exhc;
import me.faintcamo.exhc.commands.HC;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.java.JavaPlugin;
public class ExclusionHC extends JavaPlugin {
public static ExclusionHC plugin;
public static FileConfiguration config;
@Override
public void onEnable() {
getLogger().info("[ExclusionHC] Enabled");
config = getConfig();
getCommand("hc").setExecutor(new HC());
}
@Override
public void onDisable() {
getLogger().info("[ExclusionHC] Disabled");
config = null;
}
}
Utils
package me.faintcamo.exhc;
public class ExclusionUtil {
public static ExclusionHC plugin;
public ExclusionUtil(ExclusionHC plugin) {
this.plugin = plugin;
plugin.getConfig();
String noPlayer = getConfig().getString("noPlayer").replace("&", "§");
}
}
Dm me if you can help me
It means the method isnt found
public class with the method
wdym
Alr
@viral herald unnecessary static
in which
Isn’t good
Which class?
Main
static will always be kept in memory and won’t be gc’d for instance
Work with dependency injection and encapsulation
Instead
alr
So don’t make a FileConfiguration field static or main class. Also you don’t have to redeclare FileConfiguration to be null onDisable
I mean it's not terribly difficult. Iterate along the z axis of your shape, pick certain intervals (say every 10 blocks). Once you've reached that point, go up and to the right by 1 pixel, place a block. Continue until you reach the top axis again
for (int x = 0; x < 128; x++) {
for (int z = 0; z < 128; z++) {
int dX = x;
int dZ = z;
if (x < 64) {
dX = -x;
}
if (z < 64) {
dZ = -z;
}
Location newLoc = data.getStart().clone().add(dX, 0, dZ);
Faction faction = BoardColl.get().getFactionAt(PS.valueOf(newLoc));
if (faction != FactionColl.get().getNone()) {
canvas.setPixel(x, z, MapPalette.RED);
}
}
}
@subtle blade I'm still a bit confused, how would I make it in a criss cross pattern?
bruh those method calls from constructor @viral herald
@brisk mango i fixed it
remove them
which property do i change to make exp orbs stop clumping together into one big orb? its messing with some farms on my sserver
WHY DOES THIS HAPPEN
How do I get the new slimes from SlimeSplitEvent
Hello, i want to create a amorstand with a passenger. I did it and everything fine, but when I am going to clear the entites, the passenger will be removed and I don't want it. I tried so much, but the problem is still there. Can maybe someone help me please?
There's only event.getCount() but I want to get the new slimes
And iterate over them
Is there a way to get the new slime objects from a SlimeSplitEvent, even if it's 1 tick after?
No but it may be able to be passed in and new API could likely be added to that event to include them
Not sure where it's called
Alright
@subtle blade do you know how I can do this? #help-archived message
Is there any documentation on the villagers-work-immunity settings?
You guys got any opinions on good generalized discord bots? My contenders are Dyno, Carl-Bot, YAGPDB.xyz, and MEE6
Does anyone know a good library for inventories?
Deleting that link because it's not something that should be shared
It hosts Mojang's decompiled source
Use BuildTools
Besides - that second integer is the RGB int value
HOw to send item to the killer of the enderdragon someone tried to help me
BUrt i don't understand
How to do it with my code plizz
lastPlayerAttacked is a string not a player instance
.<
If you don't know how to fix that code then you don't know java
NO no i understand that*
BUt,, which function tio get the Player
I know that's its a string bro T_T
I want to get a Player class, to send him a item
But i write it like a pseudo code hahah don't worry
So yo want to get the player who killed the ender dragon?
No stop
Why 😮
You are doing it not in an efficient way
Why i just decompiled thisplugin
If you just want to get who is the killer of the ender dragon you can do it more easily
Doesn't mean it is a good plugin
How can u do it
@EventHandler
public void onDeath(EntityDeathEvent event) {
if(event.getEntity() instanceof EnderDragon) {
if(event.getEntity().getKiller() != null) {
event.getEntity().getKiller().getInventory().addItem(new ItemStack(Material.DIAMOND));
}
}
}
``` Easy peasy
Yes you should update to 1.15.2
what's the best way to make sure my plugins are backwards compatible?
I don't see the point in using NMS if you can just use it with the spigot api..
i mean ones I make
@velvet halo NMS has many things regular spigot doesn't
and it lets you do many of the things spigot's API doesn't let you use
Yes but that doesn't mean it is good for this purpose because you can do it in regular spigot.
Not always
I literally just sent the code
Yeah of course there are reasons why you should use NMS
Not for the function he provided
my bad
no problem
Comparing the type is better than using instanceof @velvet halo
Yeah that is true
hey, i want to create a amorstand with a passenger. I did it and everything fine, but when I am going to clear the entites, the passenger will be removed and I don't want it. I tried so much, but the problem is still there. Can maybe someone help me please?
What is the plugin of [i]
@ebon charm check if the type is equal to armorstand and if yes, dont clear it
What do you mean @chrome heron
[i ] to show the stuff that u are holding on your hand on chatbox
Chat component API
final TextComponent component = new TextComponent("Message");
component.setHoverEvent(new HoverEvent(HoverEvent.ACTION.SHOW_ITEM, item);
not sure about the SHOW_ITEM action
never used it
??
@ebon charm That is my wife
then what is your point if u did it already
I have a ClearLagManager and I did it in it
lmfao
It doesn't work
it doesnt work isnt a question
no
no
@brisk mango ```java
for(ArmorStand stand : world.getEntitiesByClass(ArmorStand.class)) {
if (((ent instanceof TNTPrimed)) || ((ent instanceof ExperienceOrb)) ||
((ent instanceof FallingBlock)) ||
(!(ent instanceof Tameable)) &&
(!(ent instanceof Player)) &&
(!(ent instanceof ArmorStand)) &&
(!(ent instanceof Giant)) &&
(!(ent.getType().equals(stand)))) {
ent.remove();
//Bukkit.broadcastMessage("§7Es wurden §6" + ent + " §7gelöscht.");
}
}```
there is more above, but this is how i made it
you dont need to do this what?
world.getEntities().forEach(entity -> {
if(!entity.getType() == EntityType.ARMOR_STAND) {
entity.remove();
}
});
also compare the enums with ==
remove the passenger?
Did it already
okay.
still removing
because u probs cant code it
properly if its removing
i cant help with that i pointed you in the right direction.
world.getEntitiesByClass(ArmorStand.class).forEach(Entity::remove);
@velvet halo he doesnt want to remove armorstands
and why would you use getEntitiesByClass
To get the armorstand
bruh are you retarded
rude
chill
world.getEntities().forEach(entity -> {
if(!entity.getType() == EntityType.ARMOR_STAND) {
ArmorStand stand = (ArmorStand) entity;
entity.remove();
}
});
there you go
don't ever call someone restarded that is super offensive
yes true, but it still removes the passenger
because he wants to remove other entities but not armorstands
and u send him code that removes the armorstands
because u cant probs read what he even said
So how can I solve it?
What flavour of linux is recommended for Game Servers
How can I add methods to an interface that belongs to another plugin?
world.getEntities().forEach(entity -> {
if(entity.getType() == EntityType.ARMOR_STAND) {
if(entity.getPassengers().size != 0) {
continue;
}
} else {
entity.remove();
}
});
@ebon charm
@velvet halo where do i call you retarded
please man
even then don't use that word please
it is offensive
world.getEntitiesByClass(ArmorStand.class).forEach(armorStand -> {
if(armorStand.getPassengers().size() == 0) armorStand.remove();
});
Why are you using continue?
bruh are you joking right now
And there is no #getPassengers() method
he wants to not remove the passengers and the armor stands
has to be
@velvet halo because thats how continue-break is used in a loop/iteration
temedy if you don't relax a bit you're going to get yourself kicked
Your elitism isn't appreciated
If there's a question, answer it. If someone's wrong, explain why
Tell me, why is there an getPassengers method in the docs then ? @ebon charm
You are removing the armorstand also Temedy you are doing the exact same thing In am doing but in a different way
I don't know, I am just doing what you say
its underlined red
@subtle blade Can you please help me out with this? Fairly sure it's a quick answer but I'm just missing something.
How can I add methods to an interface that belongs to another plugin?
"The method getPassengers() is undefined for the type Entity"
spigot 1.8.8
it returns an List<Entity>
how would i do that?
There is nothing temedy
wdym nothing
Create a class that accepts an instance of said interface through the constructor
Have a getter to get it, write methods as necessary
Alternatively, you can extend the interface with another interface
no #getPassengers()
Idk
Are you importing the right entity?
bruh
ok thanks
arent you doing #getPassengers()
There are some from Java's std lib
with the #
lol
method reference
Much like Foo::bar would be a reference in source
i like method reference
remove the method calls from the constructor
.size()
@subtle blade still
and assign the fields private
also why is an int named like an constant though its not?
It is constant just not defined as one
how is it a constant
just not defined as one
it can only be a constant when its defined as one
Defined to a set value and not modified, just not static nor final
what when it will be modified
Dude, do you have to be right about absolutely everything? lol
whatever im not gonna argue w u about this
You're actually quite annoying
Nah embeds are off
What version of spigot are you using @ebon charm just to make sure?
rip
@ebon charm should be named worlds instead of world, its not an world its an list of worlds
sorry about that
What version of spigot are you using @ebon charm just to make sure?
@velvet halo 1.8.8
temedy its already defined above
Added in January of 2017
what is defined above
update to the latest
@velvet halo But i need for 1.8.8
1.8 has getPassenger() and setPassenger()
There was only every the possibility for one passenger then
hmm
^
The reason the API was expanded was for boats
isEmpty()
did it already
And now it removes nothing
isEmpty() is specifically used to check if an entity has passengers so I recommend do utilize that instead of a null check
Did it
isEmpty() is specifically used to check if an entity has passengers so I recommend do utilize that instead of a null check
@velvet halo
Not sure what purpose that nested if statement serves
👍
But now it removes nothing
if (entity.getType() == EntityType.ARMOR_STAND) {
if (entity.isEmpty()) { // This is all useless
continue;
}
} else {
entity.remove();
}```
What is it you're trying to do again?
I missed the earlier parts of this conversation
how is it useless
because regardless of whether or not it's true, it does nothing
if (entity.getType() != EntityType.ARMOR_STAND) {
entity.remove();
}```
Those are equivalent
i mean
So I wasn't retarded after all...
wont it remove the passenger
okay.
afaik the passenger has to be ejected first
Can't be removed while it's still a passenger
Hey guys, how do I get the color of a block?
NONE(0, 0, 0),
GRASS(127, 178, 56, Material.GRASS, Material.SLIME_BLOCK),
SAND(247, 233, 163, Material.SAND, Material.SIGN, Material.STONE_PLATE, Material.SANDSTONE),
WOOL(199, 199, 199),
FIRE(255, 0, 0)
I've started doing an enum, is there another way?
Bukkit does not expose map colour
Considered making a PR for this some time ago though
PR?
Oh ok
Now I made this: ```java
for(World world : world){
for(Entity ent : world.getEntities()){
for(Item item : world.getEntitiesByClass(Item.class)) {
for(ArmorStand stand : world.getEntitiesByClass(ArmorStand.class)) {
if (((ent instanceof TNTPrimed)) || ((ent instanceof ExperienceOrb)) ||
((ent instanceof FallingBlock)) ||
(!(ent instanceof Tameable)) &&
(!(ent instanceof Player)) &&
(!(ent instanceof ArmorStand)) &&
(!(ent instanceof Giant)) &&
(!(stand.isEmpty()))) {
ent.remove();
//Bukkit.broadcastMessage("§7Es wurden §6" + ent + " §7gelöscht.");
}
}
}
}
}```
huh
wait
👀
bruh
Now it removes the passenger, but not the items on the groundd
why did you make this
because your code is shit
when that code we sent
should do it
Yours doesn't work too
it does
gonna try it out
send me again
its above there.
@EventHandler
public void onSave(WorldSaveEvent event) {
for(Entity entity : event.getWorld().getEntities()) {
if(entity.getType() == EntityType.DROPPED_ITEM) {
entity.remove();
}
}
}
``` Clearing items on a world save could be nice. Correct me if I am wrong.
world.getEntites().forEach(entity -> {
if (entity.getType() != EntityType.ARMOR_STAND) {
entity.remove();
}
});
This code doesn't work
bruh im done with you
It removes me too
Don't be like that
"it removes me"
temedy you need to word yourself differently
okay bruh
sorry for my english, but I need help 🤷♂️
world.getEntites().forEach(entity -> {
if (entity.getType() != EntityType.ARMOR_STAND) {
entity.remove();
}
});
@ebon charm
I will help you VerpeiltYT ill get you through it.
Explain from beginning to the end what you want to happen.
Why not use a for
Why is a .forEach better
nice
yeah, i was just wondering why
yeah np
I mean if you wanna read this then good luck
is aac good or not guys
decent
thanks
I'm needing some help canceling the drag event for slot 40 (offhand slot) but there is not direct method to get the slot that the item is being dragged to, does anyone have a solution to my problem?
I was trying to maybe scan all the items in the inventory and compare but I couldn't really figure it out/get it working
?paste
Hey, quick question about premium resource guidelines. Most/All premium resource developers that I have viewed that have multiple resources have 3 free resources per one paid. Is this a requirement? (Looked thoroughly through guidelines, didn't see this explicitly stated; if you know of a developer who has a lower than 1/3+ premium to free ratio (when >1), please link me)
I have 1 free resource and 1 premium and they stopped my premium from being able to be sold
The requirement states that you need
3 free resources
Doesn't explicitly say 3 free per 1 premium, so I was wondering if it's theoretically possible to have 3 free and 2+ paid.
Check if the slot is equal to 40 and if yes just cancel InventoryClickEvent?
@brisk mango I did that but you can still "drag" over a single slot
40 being the offhand slot and thats a single slot
Guys whats the fastest way to get the color of a block?
Also, how do I get the highest block from a location? I know how to get it from a chunk, but I'm trying to do it from locations
for (int x = 0; x < 128; x++) {
for (int z = 0; z < 128; z++) {
int multiplier = l(map.getScale());
Location loc = start.clone().add(multiplier * x - 64, 0, multiplier * z - 64);
//int xM =
canvas.setPixel(x, z, );
}
}
That won't lag if I do 16384 of those every second?
I'm trying to get the highest block for map colors
wdym
just have the color for a certain location Y between
for example 150-120 is a color
120-100 etc
I'm confused
you are joking arent you?
No?
What?
I mean
Player player = (Player) inventoryClickEvent.getWhoClicked();
ItemStack itemCursor = inventoryClickEvent.getCursor();
Inventory inventory = inventoryClickEvent.getClickedInventory();
if (inventory == null || itemCursor == null) {
return;
}
Why are you getting the inventory
and then checking if its null?
whats the point of that
if you didnt know, ClickedInventory is Nullable
second, the ItemStack in that event before is nullable too
Why not just get the slot of the ClickedInventory instead getting it from the event?
also stop using static unless its an utility class/singleton/constant, and replace that singleton with a dependency injection
I dont understand how people like you can do paid comissions
The rest of the code is probably very shit too
ok
so youre basically calling the methods that are nullable before null checking
what a fucking joke
uhh, so there's an bungee exploit? if my ports aren't being able to be accessed from outside am I fine?
only finding out about this now
@brisk mango
if (inventory == null || itemCursor == null) {
This is ok to do the way he did it, there won't be errors
@EventHandler
public void onClick(InventoryClickEvent e) {
Inventory inventory = e.getClickedInventory();
if (inventory == null) {
e.getWhoClicked().sendMessage("Clicked on a null inventory");
return;
}
e.getWhoClicked().sendMessage(inventory.getName());
}
Alright chill out a little bit on that one Temedy, He is probably not been coding for long. People make mistakes no matter how dumb they are
Null pointer will be thrown
@frigid ember its just pissing me off because people like this do paid plugins
@frigid ember yes there will, because if an event#getClickedInventory will get called before an null check
then it will throw a null pointer
Yes but calling them a fucking joke doesn't really help anybody
No I just showed it
Inventory inventory = e.getClickedInventory();
is nullable
but he doesn't call any methods on it
inventory.getName();
before he checks it to be null
And I'm sure if his code wasn't good enough the resource staff wouldn't have accepted his premium resources
Mk, i thought it throws an null pointer because it gets called every time u click in a inventory
The resource staff necessarily doesn't critique code
no lol, and his code is shit
if they would have seen it for sure it wouldnt have been on spigot
most paid plugins wouldnt
the most they do is a quick glance over and make sure it actually functions properly and he not selling a dud and also malware
Yeah, but he checks if it's null #help-archived message
you just doint get my point @frigid ember
What's your point
maybe if youve been some more experienced you would get the point
what about it
@EventHandler
public void onClick(InventoryClickEvent e) {
Inventory inventory = e.getClickedInventory();
if (inventory == null) {
e.getWhoClicked().sendMessage("Clicked on a null inventory");
return;
}
e.getWhoClicked().sendMessage(inventory.getName());
}
This code will not throw any errors if you click outside the inventory menu (where it would be null)
Inventory inventory = e.getClickedInventory();
can be null, but he checked for that before he called any methods on inventory
Anyone know why Azazel the tablist provider when imported into Intellji it doesnt compile with the plugin?
it doesnt work isnt a question
what im i supposed to do with it though?
Maybe try the API to see if it works for yourself it just doesnt compile with the plugin it works fine in Intellji like i can import anything but now i can do jack shit
Does anyone here know something about json models?
Yeah, heres a video explaining it https://www.youtube.com/watch?v=dQw4w9WgXcQ
Are you serious 🤨?
What kind of json models? Block models?
There are programs that help you model. BlockBench for instance
@frigid ember since no one answered your question. If you are using bungee and your mc servers are on the same system as bungee, you should be setting your mc servers to listen on the loop back address which is 127.0.0.1. However if your mc servers are on separate systems, then you need to ensure direct connections to the mc servers can not happen otherwise bad things can be done. There is guides on the spigot website about how to prevent this from happening.
host is 0.0.0.0.
host is not 0.0.0.0. Using that tells either bungee or mc server to listen on all addresses
you don't want that
it is fine to use in bungee config
but it isn't fine to use that in the mc server config
oh i think server is using a pterodactyl docker ip.
ah, the two things I don't use
well i went ahead and added bungee guard just in case. i’ll look more into this tomorrow. thanks for explaining it to me!
You are welcome
Is there a plugin just for teleporting players to spawn on join/death?
I could code it myself but I feel like one already exists that covers this without other features
@tough viper so basically a plugin that disables bed spawnpoints?
@torn robin yeah
and minecraft's spawnpoint teleports you nearby
i just want to teleport into a single location
actually i'll just use essentials
@tough viper /gamerule spawnRadius 0
how do I stop players from using tab to complete commands?
I used the spigot yml option and set it to -1
But now whenever a player types a command they have permission to it will show up as red
The command works but the red color makes players think it wont
on inv click event how do i get the inv name?
e.getView().getTitle()
1.8
e.getInventory().getName()
any help? ^
Hey guys, how do I get the color pixel on a map?
for (int x = 0; x < 128; x++) {
for (int z = 0; z < 128; z++) {
int multiplier = l(map.getScale());
Location loc = start.clone().add(multiplier * x - 64, 0, multiplier * z - 64);
//int xM =
//canvas.setPixel(x, z, );
}
}
then I have a MapColor class which is pretty much the same from minecraft
I'm gettin' a read-only error Exception for a Packet
17.05 01:25:48 [Server] ERROR [Prison] Unhandled exception occured in onPacketReceiving(PacketEvent) for Prison
17.05 01:25:48 [Server] INFO java.lang.IllegalStateException: The packet event is read-only.
public BlockDigListener() {
this.protocolManager.addPacketListener(new PacketAdapter(this.plugin, ListenerPriority.MONITOR, PacketType.Play.Client.BLOCK_DIG) {
@Override
public void onPacketReceiving(PacketEvent event) {
PacketContainer packet = event.getPacket();
WrapperPlayServerBlockBreakAnimation wrapper = new WrapperPlayServerBlockBreakAnimation();
wrapper.setDestroyStage(0);
event.setPacket(wrapper.getHandle());
event.getPlayer().sendMessage("Wrapper Stage: " + wrapper.getDestroyStage());
}
@Override
public void onPacketSending(PacketEvent event) {
}
});
}
I'm guessing because it's being modified when it's accepted POST-FINAL type changes?
if (Bukkit.getPluginManager().isPluginEnabled("AdvancedBan")) {
banManager = new AdvancedBanManager();
MSG.log("Successfully hooked into AdvancedBans.");
}else if(Bukkit.getPluginManager().isPluginEnabled("MaxBans")) {
banManager = new MaxBansManager();
MSG.log("Successfully hooked into MaxBans.");
}
is there a better way of doing this?
I don't know if I'd do else if
https://gyazo.com/6d59920b63c6a2a80bc50bad8d881d8a the issue im havin problems with.
Okay so I have simple question which might sound dumb, but how do I make it so a player can't lose hunger?
FoodLevelChangeEvent
i was never able to figure it out
i have no idea how the person in the video got it working
Lets tackle it together 😉
you could make a resource pack that disables the block break effect and send that lmffaooo
:kappa:
My guess would be.
I'll get a Packet Analyzer mod 1 second.
If you think about it.
What kind of json models? Block models?
@subtle blade item models I already made the models I don’t know how to show it in the Minecraft
ive seen people running their plugins from inside intellij
how do i do that?
I have a question - To run a minecraft server do I need a static IPv4 or Public IP Adress?
Did you mean something like this @frigid ember https://www.spigotmc.org/wiki/intellij-debug-your-plugin/
yep
Hey guys, how do I change rgb value to byte for map
cast to short ^ idk
or Short.valueOf
@frigid ember it's not working
B1 - 48
b2 - 255
public static void main(String args[]) {
System.out.print("B1" + MapPalette.BLUE);
System.out.print("b2" + (short) Color.BLUE.getRGB());
}
I can't join my server
What are you trying to do again?
im trying to join my server
I'm trying to change the RGB or import java.awt.Color to a MapPalette value
Well post some more details.
Hmm
what details
You can't just you can't join your server lol
i'm trying to connect to my server - it says "can't connect to server"
what's console saying?
nothing
the last thing is "Done (11.147s)! For help, type "help"" XD
i have no idea what i'm doing wrong
anyone help?
1s.
What server are you connecting to?
mine
Anything in console when you failed to connect?
Are you sure it's correct IP?
i've tried like 5 different things so
yeah
If Console says it up, it's up.
ok
but why can't i join
No errors on loadup?
nope
Map<AuctionItem, Double> auctionItemMap = new HashMap<>();
for (AuctionItem auctionItem : subPage.getAuctionItems().values()) {
auctionItemMap.put(auctionItem, auctionItem.getPricePer());
}
LinkedHashMap<AuctionItem, Double> sortedMap = new LinkedHashMap<>();
auctionItemMap.entrySet()
.stream()
.sorted(Map.Entry.comparingByValue(Comparator.naturalOrder()))
.forEachOrdered(x -> sortedMap.put(x.getKey(), x.getValue()));```
Why is this not sorting my list in ascending order?
Anyone here knows how I do to allow 1.7 clients to join my Bungeecord, but not dropping 1.15 support? (and before someone questions me xD yes, I'm planning on having a bungeecord plugin that sends the player to different spigot servers depending on the protocol version)
I saw some plugin for 1.7 support but it was outdated
i think i did the port forwarding wrongly
Hey guys - sorry to bother, I am just looking for an answer to this question regardless if Cloudflare flagged me or not. Basically, how do you mesh player-specific data with team-specific data without rebuilding the board every time and being forced to re-register the teams?
can someone tell me how to port forward
@frigid ember there are a million YouTube videos showing how to do this
@frigid ember and none of them work for me
I've tried like 26 different videos and still nothing
Every port I try is closed and I still have no idea what WAN ports I need to enter and what LAN Port I need to enter
what is wrong here?
Sounds like you’re way off - you just want to connect on an open TCP/UDP port
There are hundreds of open ports for you to choose
None of them are open for me
help?
Have you tried adding the port to the computer's firewall as well?
Windows Firewall
Open Windows defender with advanced security, click Rules for incoming traffic and select New rule
And then port
https://gyazo.com/1eb433f118b2314f9364441398748137
THERE ARE SOOOO MANY TUTORIALS, what router do u have?
uhhh some kind of huawei
Not sure then, have you checked https://www.yougetsignal.com/tools/open-ports/ if it finds your server as online or not?
but it has a custom interface from my internet provider so theres no tutorial for my router
@woeful mural that's the exact one that i'm using
Is the Minecraft server online as well?
Have you bound the Minecraft server to any IP?
to my lan ip yes
Remove the IP from server.properties and try it again
Just leave it blank
server-ip=
And then join the server with [your ip]:25564
the public one?
