#help-archived
1 messages Β· Page 42 of 1
mhm
well it requires some maths
ikr
I meant 12 sections each are 30 degrees I think
some
I think you can loop all blocks of the circle and then check if they are in a "section"
there was bracket in the wrong place
what was your issue
You really want to animate that? lol
getItem had a red underline
None of which Spigot collects
@subtle blade Replying to the above, so the account is some days old with 0 contributions anywhere. I am a citizen of the EU. So I assume the best solution is to send a support ticket for it to get deleted. Thank you π
Seems like a big waste of power to me, but maybe thats just me.
lmao
but you do you
no
I want people to spin it if they have a ticket and if it lands on a certain section, they win something
seems easy except for the animation
I mean, you could make the wheel and memorize the positions, and create classes in your own plugin to do it
I am a citizen of the EU
Irrelevant. But report your account and state you want it deleted
md will get to it
blackveiled that would take way too long
It doesn't seem like it would be terribly hard to implement. More-so time consuming, and wasteful
I mean, it wouldn't take too long
You have 12 potential categories, and you could rotate them fairly easily
what if you just made it 4 sections?
it would be 90 degrees each
it would be alot easier
it would be alot easier
@vast hinge no
ok
You would have fixed positions for all of them regardless.
You could create a runnable that begins after the player presses a switch
and generate a random integer/double as a "Strength"
and the Strength could determine the duration of the spin
and then you just iterate through a list, and move the "sections" in order
It depends how technical you want to get with it.
There's no reason to slow it down unless you plan to implement more quality in the way the blocks move.
I've already thought of how I would pull it off, but it wouldn't be animating like a wheel, just literally rotating blocks around the axis
@vast hinge just count the number of rotation - the more rotation they are the less a new rotation is probable
^ either that, or just use a strength to determine the duration
Are there any plugins which make blazes drop blaze rods in water? They don't seem to be doing that on my server
It's by no means impossible, but you'd have to put in a lot of extra work to make it look like its fully animated.
You could do the basic work first, get it working, and then improve the "quality" later.
As far as math goes, I dont think you would need to do any math if you used fixed positions.
however I think the block update should be done with packets, so only the player spinning the wheel should see the animation
don't even need to use packets
I think packets would be wasteful if anything.
pretty sure there is a method to make a player see a block
I would rather just have the server update it personally, that way people are aware it's spinning.
wait is it possible to make a player not see a block while another player can see the block?
that was what I was thinking
Whaaaat are you all on about... what's wrong with ray tracing along a rotating vector?
Have it be a set radius, rotate along the z axis
(or x depending on rotation)
Divide it up into set radians
@vast hinge i do not know if there is a method in the api for this, but with packets it's possible
Nothing wrong with it, just trying to simplify it
I didnt bring up packets π
If he's capable of doing it the way you suggested, then that's fine.
as long as he understands the calculations he would have to apply.
I mean, the math behind it is nothing more than sin/cos to rotate along a circle and being able to use > and < lol
Actually, even better. Vector has https://hub.spigotmc.org/javadocs/spigot/org/bukkit/util/Vector.html#rotateAroundAxis-org.bukkit.util.Vector-double-
Don't even need the sin/cos math
packets seems to be nessecary if he want players to be able to spin the wheel in the same time
You'd be surprised how many people dont understand that π
no matter how basic it is
You'd be surprised how many people dont understand that π
+1
If you can't > and <, you should reconsider learning programming π
basic trigonometry isn't sometimes that "basic" for some begginners
how would i get past this in someones else plugin?
@EventHandler (ignoreCancelled = true, priority = EventPriority.HIGHEST)
@subtle blade Lol, I'm not talking about > or <, I'm talking about the mathematical understanding behind it.
I would believe a person who understood how to apply mathematics, would probably not ask how to do it in the first place.
I mean at least those guys aren't using the MONITOR priority
Though HIGH would probably be more appropriate
sadly problem is.. i made a nice plugin that changes a spawner based on X.. but this just listens if its a spawner and completly changes it
Yea. That's a stupid plugin
I would believe a person who understood how to apply mathematics, would probably not ask how to do it in the first place.
@dusky herald well if we have an idea for how to do something, but we are looking for a better way to do it mathematically ?
Plugins released publicly listening on highest priority are stupid unless there's a justifiable reason behind it
highest should be reserved for private plugins looking to modify the outcome of public plugins
@upbeat wyvern If you're looking for a better way to do it mathematically, then you would need to set a radius, and determine your sections (as radians), like Choco said.
and animate those radians by updating the blocks / sending packets / update block for player, etc
Stellrow, what plugin is this?
you would also need to determine an arc length (basically the outline of the circle)
OS, just PR
The thing is I donβt know where to start
to determine how many blocks long the edges of your circle would be
or rather, the radian
I'm not sure of an easy way to explain it, you could just look it up and figure out how to apply it
Blackveiled, what I would do is get the handler list for BlockBreakEvent (I think that's what it is? Whatever the event is)
HandlerList handlers = BlockBreakEvent.getHandlerList()
Donβt you think Iβve been googling
@subtle blade you want to temporarily unregister the event while i do my thing?
No no, but unregister theirs and re-register it with a lower priority
How would I check if a spawned entity is a chicken jockey?
or you know just pull request, since it's a open source plugin
as if the author has anything wrong with it being HIGH rather than HIGHEST
maybe there's a way to inject code to change that ?
yeah i will
I would say bump all of his events down to normal
@subtle blade isn't monitor priority reserved for observing only?
Yes
Say it something? If its finish?
for now i gave it to a friend to test the plugin so i guess i will do a workaround for him as well
As in you should never modify the outcome of the event in the monitor priority
This author doesn't know what they're doing lol
still 53k downloads damn
He just said, fuck everyone else
That SpawnerMineListener makes me hurt
Say it something? If its finish?
@digital sphinx Hello?
I donβt even know where to start with this so if you can help please DM me. (Iβm trying to fix my pc)
Why's that?
this is why he updated
"set event priority to highest to fix cancelled explosions from droppi"
dont think me requesting it lowered will make him do it
π
ohh boy.
Sounds like other plugins doing stupid things
So he was forced to do stupider things
work around it is
the cycle continues
guess ima just skip breaking my spawner forcing it to a admin command..
at least for now
Fork. Speak to them instead
Also, beerspigot.jar:git-TacoSpigot-bf023c7d. lolwut. Which one is it?
Why is a TS jar named BS?
Someone knows why this line isn't changing the block to a glowstone block?
player.sendBlockChange(e.getBlock().getLocation(), Bukkit.createBlockData(Material.GLOWSTONE));
Just do e.getBlock().setType(Material.GLOWSTONE);?
No, I want to send a package, not change the actual block
Wants it done client side I presume
yes
Ah
Is it called? Because there's no reason for it not to work
You could send a debug message
I did
yes
Anything strange about the Location? null world? Invalid block? I honestly don't know what else would be causing that issue
that's probably what it is
Sometimes cancelling the event screws things up.
nah
No, won't matter
it wont make a difference
no, doesn't work
The client has to re-assume that the block wasn't changed so it changes for a split second to whatever it thinks it should change to (air), then calls your change packet, then reverts back to what it should be after it was cancelled
set the values as final then refer to them in the temporary runnable
Your packet is sandwiched in the middle and snuffed out
wut?
Call sendBlockChange() one tick later lol
Sorry, but I did this in the past, without issues
how would I do that?? I mean, a different thread to send the package??
Bukkit.getScheduler().runTaskLater(plugin, () -> player.sendBlockChange(/* whatever you had here */), 1L);
Yeah, but, it used to work without, anyhow, I'll try that
Maybe in another event or if it weren't cancelled
But I'm doubtful it worked if it were a cancelled block break event
(plugin being an instance of your plugin's main class, obviously)
yea
I really don't like that I have to pass an instance of my plugin there .. but okay
Gotta do what you've gotta do
yea
yes
it works
but
as soon as I hit a block, the package that I placed are gone
so they change back
there is some strange stuff going on
Don't the block get updated if you interact with them?
So the server sends new data about it?
your hitting it?
no
Yea that's how it works
okay, everything looks good now
When the client left or right clicks the block, the client is sent a packet from the server with the result of the interaction and the block it clicks is updated
Realizes "oh shit... I didn't click a glowstone block" lol
so catching the packet might fix it?
it works perfectly
k then nvm
kk. I'm yet to find an answer for this, wondering if someone can help. Buckle your seatbelts.
When i started my survival server, I introduced tools that are way too op, and they are affecting the game now, there is no need to grind when you can buy really really op stuff.
I need to remove them, They all have unbreaking 10 etc and have custom names.
My original idea. was to have the items rendered useless, aka, you try and hit with the custom sword 'noobslayer' and it just gives a message, giving the user the ability to sell the sword back for what they paid (fair) by taking it to a refund shop (different plugin)
and with the armour thats op, hopefully have that unequip itself and not allow it to be worn again.
I tried BANITEM plugin, but unfortunatly it only works with specific durability states. so i can block the sword at 0 durability. or 1562 durability. and not anything 'within' that range. and putting the code in 1500+ times for each weapon, isnt feasible at all. 10+ weapons
So does anybody know how i can fairly easily render these items useless? Thanks π
When the client left or right clicks the block, the client is sent a packet from the server with the result of the interaction and the block it clicks is updated
what
the client is sent a packet
I have scoured for plugins :/
What's wrong with that, BitLong?
Most of them dont support custom items, If i add my custom diamond sword to the config to blacklist, it bans all diamond swords.
if the client performs an event it has to communicate that to the server
the server would only handle verification
if necessary
I'm aware. I simplified
ehh
Client -> server -> client
Client requests interaction with block, server validates and sends back a packet saying what block was interacted with
@hidden crest why not make it urself?
It does, otherwise the client wouldn't realized it fucked up lol
they can be fun
ehhh
i mean creating npcs is fun
i would assume it just updates the block for other players in chunk
server validates and sends back a packet saying what block was interacted with
that would be a waste of bandwidth
i could definitely be wrong
@Override
public void a(PacketPlayInUseItem packetplayinuseitem) {
PlayerConnectionUtils.ensureMainThread(packetplayinuseitem, this, this.player.getWorldServer());
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
EnumHand enumhand = packetplayinuseitem.b();
ItemStack itemstack = this.player.b(enumhand);
MovingObjectPositionBlock movingobjectpositionblock = packetplayinuseitem.c();
BlockPosition blockposition = movingobjectpositionblock.getBlockPosition();
EnumDirection enumdirection = movingobjectpositionblock.getDirection();
this.player.resetIdleTimer();
if (blockposition.getY() >= this.minecraftServer.getMaxBuildHeight() - 1 && (enumdirection == EnumDirection.UP || blockposition.getY() >= this.minecraftServer.getMaxBuildHeight())) {
IChatBaseComponent ichatbasecomponent = (new ChatMessage("build.tooHigh", new Object[]{this.minecraftServer.getMaxBuildHeight()})).a(EnumChatFormat.RED);
this.player.playerConnection.sendPacket(new PacketPlayOutChat(ichatbasecomponent, ChatMessageType.GAME_INFO));
} else if (this.teleportPos == null && this.player.g((double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D) < 64.0D && worldserver.a((EntityHuman) this.player, blockposition)) {
EnumInteractionResult enuminteractionresult = this.player.playerInteractManager.a(this.player, worldserver, itemstack, enumhand, movingobjectpositionblock);
if (enuminteractionresult.b()) {
this.player.a(enumhand, true);
}
}
this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(worldserver, blockposition));
this.player.playerConnection.sendPacket(new PacketPlayOutBlockChange(worldserver, blockposition.shift(enumdirection)));
}```
@vernal spruce I'm nowhere near skilled enough
Last two lines
- client to server
- server validates if necessary
- update players in chunk
Always called
Wondering if worldguard blacklist supports custom item names
sec
separate with ,
@hidden crest ask for a plugin in bukkits forum its most likely to be made
don't need to indicate implements twice
JumpBoots implements CommandExecutor, Listener
Seriously advise separating your CommandExecutors and Listeners though
thanks
hmmm
classes should only have a single purpose
nah just slap everything in a god class π
:p
sure
how do you do it?
Hey guys, does anyone know how to trigger the chest open/close animation without using NMS?
.listeners > .events tbh
true
That animation is triggered based on the amount of inventory viewers, james
should the main.java be in just com.mywebsite
oof
@subtle blade why openable doesnt have this? Kappa
Main.java is a poor name but yeah
What is ur your plugin name
most often the plugin name is the main
im confused
That animation is triggered based on the amount of inventory viewers, james
@subtle blade Yeah so is there a way to have like a phantom inventory viewer? I basically open a different inventory when the player opens the chest.
im very new to java
no worries
you could spawn a fake player then open that chest for him
(extends JavaPlugin)
oh is it JavaPlugin or Plugin
not sure if it can do the job though
I dont even recall
yeah ur right its JavaPlugin
is this how the main is ment to look like?
Can you spawn fake players with just the api? I thought that needed NMS?
it does indeed need nms i think
what does it mean?
Yeah ideally I'd like to do this without NMS
basically as choco said you can't do it through the api
just requires the command to not be null
if it is, an exception is thrown
at teh start of runtime
Can probably create API for it tbh
Just trying to figure out where that animation is sent
I remember seeing it when working with Forge. I know it's in the client model
But the server has to tell it how many viewers there are
wait
It doesn't. It's all done through the model
does the windows cmd terminal support 256 colour ansi codes?
where do i specify what class it is in?
damn
Why is it recommended to restart your server once a day, what does it affect?
Yeah it's definitely based on the viewers the chest has and then the client animates based on the viewers the servers provides.
dont think i ever saw the windows cmd have a color @wraith dew
because plugins are shit and hog resources
and probably dont dispose of them
@crimson sandal
ever used bungeecord @vernal spruce
doesnt Help override minecrafts default /help ?
yes
Okay sorry again, but the package thing has one very shitty isssue ... if I break a block right next to the block which I sent a packet for, it also updates
if you specify it in plugin.yml it will override the vanilla one
@peak marten i think it updates in a area
Yep. Updates neighbouring blocks
imagine breaking a redstoneblock next to a lamp
All cardinal directions
it has to update
That is an issue
what does this mean?
It would be nice if Inventory had a method like .setViewers() or something along those lines
@peak marten welcome to working with packets π
the purpose of requireNonNull is to ensure the reference from getCommand("help") is not null
@subtle blade , are there any work arounds for that? :p
but what does it mean by required type: t?
The type you provide is the type you get back
There's really no clean way to add in API to force a chest open animation
look into a topic called Generics
Eh, I can think of a way I guess
where?
oh ok
oracle website
Other then actually updating it?
specifically look into type inferrence
what is the goal ur trying to reach?
I could set all the blocks agian
so I got a collection of locations
and I update the block there
Eh, I can think of a way I guess
@subtle blade How do you think it could be added?
using packets
couldnt you update X block if location is less than 2blocks?
so I can send all packages to solve it
yes
packets yes
if not, whats a package
typo *3? :p
CraftBukkit would have to patch in a boolean to TileEntityChest which could be set by an org.bukkit.block.Chest (the BlockState). It wouldn't be per-player though
It would just be a stated thing
so everybody would see the chest open
hahahaah
:p
Yea, it would be everyone
hes talking about packets didnt even read packages
idk is it worth bothering adding that? @subtle blade
There has to be a packet that clients are sent to inform them of how many inventory viewers there are but we would have to manipulate that packet a bit to give the wrong number of viewers
Probably not, no
Ah yeah, so if true set the inventory of the chest's viewers != 0
If you want, you could try reflectively setting viewingCount in TileEntityChest
I don't know if that would actually do anything but yea
its a shame the interface system isnt more complex
he doesnt want to use nms..
would love to see some custom interfaces
nope,no way to do it rn without nms π
If one was going to take a first look into making plugins for my own server
what ide would one suggest?
eclipse is the easyest i think
i'd suggest taking a full week to learn about 30 minutes a day of java
The actual animation is done by modifying the a field incrementally by 0.1 until it reaches 1.0
IntelliJ is the nicest though π
Funny enough, that's done on the server side to send sounds
also watch the almighty god TheSourceCode https://www.youtube.com/channel/UCNXt2MrZaqfIBknamqwzeXA/playlists
Wait so the server actually controls the animation?
No, the server controls the sounds
Which it should
Though it keeps track of the animation in order to play said sounds at the right time
if (this.viewingCount == 0 && this.a > 0.0F || this.viewingCount > 0 && this.a < 1.0F) {
float f1 = this.a;
if (this.viewingCount > 0) {
this.a += 0.1F;
} else {
this.a -= 0.1F;
}
if (this.a > 1.0F) {
this.a = 1.0F;
}
float f2 = 0.5F;
if (this.a < 0.5F && f1 >= 0.5F) {
this.a(SoundEffects.BLOCK_CHEST_CLOSE);
}
if (this.a < 0.0F) {
this.a = 0.0F;
}
}```
@hidden crest https://www.youtube.com/watch?v=eIrMbAQSU34&t=5s
break this up into 30-45mins/day
Ohhh that makes sense actually
(and this one above for opening)
if (this.viewingCount > 0 && this.a == 0.0F) {
this.a(SoundEffects.BLOCK_CHEST_OPEN);
}```
this.a() just plays it at the correct location once if it's a double chest
hmm so changing it might not be that hard
Well that's in a tick method. It's constantly changed
https://hastebin.com/itezuveyes.cs
Anyone know why this is being caused from Buycraft π
socked closed?
@fading owl i found out what generics are
OkioL232?
but how does that link to it?
class Okio
What even is that? Also, what socket should I open?
But I'd need NMS to reflect the TileEntityChest class anyway wouldn't I?
probably some type of blocking operation
It's BuycraftX, it's a plugin I did't code it.
@frigid ember you would get better help on theyr help
i figured, is it open source?
Let me check
@vernal spruce I'll ask haha, but just wanted to make sure here before I wait 20 days for a response from them
package-ception
Can make as many packages as you'd like
your IDE usually imports it for you
Organize how you'd please
so it doesnt matter how many you make
Just... use common sense and don't go overboard lol
and stay within the conventions
a package inside a package inside a package inside a package inside a package inside a package inside a package inside a package inside a package inside a package inside a package inside a package inside a package inside a package inside a package inside a package inside a package inside a package
a package for each event,ezyπ
Also is the API open source and available to make pull-requests to etc? I know it used to be on GitHub but not much else
i believe u need to do it to bukkit
And CraftBukkit is the implementation of the API right
CraftBukkit is the glue that bridges the API and the vanilla server
BukkitCraft is the bridge that glues vanilla servers and the api
lol
Lul
proud of u
thanks
remove the call to this.
no need
should only use this. for potential self assignment
and a few other use cases
Okay and so is the repo currently working at 1.15 is it? How does it work with updating to 1.16 etc?
Okay and so you just use BuildTools and that downloads the current branch?
listen
dont try and run before you can walk
take some time to go learn some basics
then tackle plugins
ok
Okay nice, and so no work on 1.16 has started yet then and master is the latest codebase at 1.15 correct?
- conventions
- data types
- modifiers
- objects
- interfaces
- abstraction
- polymorhism
- design patterns
take a week to learn all of that
then tackle plugins
otherwise you'll spend a week doing nothing and getting nowhere
the best thing you can do is start learning java, open an IDEA like IntelliJ or Eclipse and play around after each time you learn something.
what is the most used CamelCase or Mixed case?
I suggest the Oracle tutorials to learn Java in conjunction with putting together your own plugin. Think of what you want to make, it's best to start off basic. Search up tutorials on good practices to utilize the Bukkit/Spigot API as well.
@vast hinge follow Java naming conventions
ehhh
i would use oracle tutorials to gather the lsit of topics you need to learn
but i'd research alternative ways to learn those topics
Oracle can be pretty bland.
Yeah I meant more or less just to learn, not literally the entire thing.
Β―\_(γ)_/Β―
Sure
Sometimes bland is better.
Is the iDisguise plugin there for 1.14.4?
A lot of tutorials can be long and drawn out, and provide too much information.
How do I find which plugin is overriding my /shop command? when I edited my commands.yml nothing changed
You can use plugman /plugman lookup shop
is this a class or a function?
function
thanks
(method)
YouTube is often quite good because at first learning to use your IDE is sometimes the most challenging part
I don't really want to install another plugin. is there any other way?
EssentialsSpawn
@wicked sequoia maybe disallow permissions to use the other shop command?
you could use debugging software and listen for events that fire commands and step through them
Just a theory
Are you a developer Fred? If so you can code something to check
But I don't think there is a vanilla way to do it
@crimson sandal that's up to how you learn best. Everyone is different. I personally learn best through experimentation. Watching videos is dull to me.
and check if they have a Shop:
Yeah, but then you have to open every single jar file
As opposed to download one and run a command
I have shopGUI+, bentobox, the EsentialsX suite, Worldedit, and tokenamanger
I want the shopgui+ shop command
@vast hinge could hve aded the command programatically
true
and yeah, some plugins might be using ACF or something
which doesn't need plugin.yml iirc
@dusky herald true, I like a combination of both, sometimes when you can't get something to work watching someone else is the best way
does anyone know if Spigot can be used as a dependency
not the spigot api
spigot itself
i meant publicly
@crimson sandal if you use IntelliJ IDEA though, just an example they do have a good document resource to figure out how to navigate their IDE.
yes
and packaged
<repository>
<id>spigot-repo</id>
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
</repository>
i don't think i am..?
And it's good to know too, because YouTube cant always cover specific problems you may encounter
does anyone know if Spigot can be used as a dependency
not the spigot api
spigot itself
not the spigot api
yes
@dusky herald Oh yeah I know! I just mean when I first started learning 8 years ago I didn't even know what an IDE was or how it worked. But tbf eclipse back then was frustrating to set up
Lol I remember when I tried learning and I tried Eclipse and was like yup, not happening
I hate Eclipse.
Yep IntelliJ is infinitely better π
i dislike it cause its glitchy
to each their own
I use IntelliJ IDEA right now, but I learned on NetBeans, and I found NetBeans to be really easy to learn on
if you mean a literal server jar bitlong, then no
they aren't legally allowed to host that
which is why the whole build tools thing exists
you can use it out of your local repo though?
yeah you can use it out of your local if you have ran buildtools
I have no problem with Netbeans, lol.
fair enough
/plugman lookup shop is returning shopgui+, but when I do /shop I get You can find our webstore at www.example.com/store!
how do I fix this?
mojang should be open sourcing minecraft, permitting plugin development, and taking a % of the pie.
Minecraft is basically open source
they release ob mappings
open source? then they loose money
Didn't they release the mappings to deobfuscate recently?
yea
Make money off plugin dev? Sounds like double dipping, no-go
why dont people just use long instead of int?
They want you to succeed and make money
Does Bukkit make use of those mappings or not? π
No
@vast hinge there are reasons to use either ore
@vast hinge more memory
Because, you dont want to use 64-bit datatypes for everything.
oof
4 bytes vs 8 bytes
I heard they have lots of different names for classes, like TileEntity isn't a thing etc
I'm having an issue dropping naturally.
Location blazeLoc = new Location(blaze.getWorld(), blaze.getLocation().getX(), blaze.getLocation().getY(), blaze.getLocation().getZ());
Bukkit.broadcastMessage("Location");
blaze.getWorld().dropItemNaturally(blazeLoc, new ItemStack(Material.BLAZE_ROD, 1));
Bukkit.broadcastMessage("Drop");
blaze.setHealth(0);
Bukkit.broadcastMessage("Death");
It broadcasts all the debug messages but it doesn't drop
wait a minute
Does it make the blaze look like it drops it or something?
Someones know how to setup votifier on bungeecord,
Pm me if yes, i'm paying.
Or could you just create an item stack at that position instead
why didnt minecraft make weapon enchantments a byte instead of an int?
Why don't you just use blaze.getLocation() instead of making a new location?
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
What I'm trying to do is drop blaze rods when the blaze dies in water. I have all of that setup but it doesn't drop it
How do I find which plugin is overriding ./shop? plugman is showing ShopGUI+ but I know for a fact that thats wrong
blaze.getWorld().dropItemNaturally(blaze.getLocation(), new ItemStack(Material.BLAZE_ROD, 1));
It doesn't seem to do it
commands dont have priority? darn
but if it doesn't come up in plugman, then it is probably being caught in a commandpreprocess
by some random plugin
Β―_(γ)_/Β―
@fading owl I changed commands.yml to forward /shop to /shopguiplus:shop, and it still doesn't work
are you sure you're not looking at the shopguiplus shop
yes
Fred
if you want
Hello, what's the best way to count down in a format of dd:hh:mm using runnables thanks
you're welcome
who me?
I'm making a count down so let's say you set the count to be in 12 days 30 mins and 0 seconds
1.12.2 any recommended way of checking if entity is specific player?
continue;
// skips for loop```
seems to work, but
```if(!Entity.equals(Player))
// carrys on, does not skip for loop```
does not
I think if entity instanceof Player then a comparison of UUID would be best? Any thoughts
ZonedDateTime start;
ZonedDateTIme end;
Duration remaining = Duration.between(start, end);
DurationFormatUtils
for formatting
Okay thanks
np
@frigid ember are u checking if the entity is an instance of player or a specific individual player
specific individual
thank u i can do basic code
okay
so you wreckon that's best way?
Wasn't sure if comparing name or anything would be slightly faster
if you're trying to distinguish between players hten yes
No
UUID implements the uquals/hashcode
its pretty fast
np
its also immutable, universally unique (by definition)
where as name is subject to change
Hello can someone help me or explain some spigot plugins?
@frigid ember check if Entity is instanceof Player first. Then compare UUID that way you dont get a nullpointerexception
I can explain my plugin to you if you want? π
ah, it was a bungeecord plugin that overrid ./shop
@dusky herald That's a good note to make.
if (e.getEntity().getType() == EntityType.BLAZE){
Blaze blaze = (Blaze) e.getEntity();
ItemStack br = new ItemStack(Material.BLAZE_ROD, 1);
if (e.getCause() == EntityDamageEvent.DamageCause.DROWNING){
World world = blaze.getWorld();
if (blaze.getHealth() < 4){
world.dropItemNaturally(blaze.getLocation(), br);
Bukkit.broadcastMessage("Drop");
blaze.setHealth(0);
Bukkit.broadcastMessage("Death");
}
}
}
@frigid ember check if Entity is instanceof Player first. Then compare UUID that way you dont get a nullpointerexception
@dusky herald Course, ty
Can anyone help? It doesn't seem to be dropping naturally
I need help with the plugin because I would like to add gui (mailbox) but I don't know how
I may be used to when Entities didnt have UUIDs then lol
i will flip tables
lol
kinda mad java doesnt support @NotNull inheritly
what purpose would it serve if the comparing UUID is a players uuid
sucks that its an intellij annotation
List<LivingEntity> hit = new ArrayList<>();
for (Entity entity : loc.getChunk().getEntities()) {
if(entity instanceof Player) {
if(entity.getUniqueId().equals(caster.getUniqueId())) {
continue;
}
// do stuff...```
that's all I really need
If he wants to run actions specific to the Player lol
but if the uuids are equal it's guaranteed a player
Entity.equals(Player) didn't work for some reason
lol
tyvm, will compare entity uuid to player uuid
lol
lol
wrecked
That's new info to me anyways good to know for later
there we go β¬ββ¬ γ( γ-γγ)
private List<LivingEntity> affectedEntities(Player caster, Location loc, int max, double radius) {
List<LivingEntity> hit = new ArrayList<>();
for (Entity entity : loc.getChunk().getEntities()) {
if (entity == caster) {
continue;
}
if(entity instanceof Player) {
}
}
}
ngl its a shame we cant do shit like
if entity.getType() == EntityType.PLAYER
or even
entity.getClass() == Player.class
due to wrapping
by CraftBukkit CraftPlayer
not that instanceof is expensive in 2020 but still
lmao
o.O
You... you can do that
wdym by expensive?

you cant
you can
to my knwoeldge
$$$ obv
are you sure?
lol
EntityType you most definitely can
oh
getClass(), you cannot
Yea, absolutely. That's why it exists
@ashen stirrup have you considered using EntityDeathEvent? There is getDrops method
Wait did you just guess getType() and EntityType existed? Or did you know they at least existed? lol
Because that was a spot on guess
That's literally how you would do it
thats amazing
instanceof isn't remotely expensive either
i know
getType returns an EntityType lol
a virtual method call is more expensive than instanceof
yeah i assume getType() would return some EntityType of tpye Enum
@dusty topaz yes
because they're the same reference in memory right
i assume CraftBukkit isnt creating a new reference
Correct
All NMS entities hold a reference to CraftBukkit wrappers and those are used
(this includes Players)
Does anyone know how to reset Advancement progress for player (or at least for everyone) as would /advancement revoke <player> everything command do via the api? I could call the command, I am just wondering if there is cleaner solution...
informative, ty
So referential equality does work as well
i'm shocked that he said that entity.equals(caster) didnt work
because i assume they would have checked for if (obj == this) { return true } in equals impl
It most likely does. Entity#equals() compares UUID equality
.equals doesn't tend to implement ==
It does by default
^ what
overridden
Actually not even. It compares entity ID
Thought it was UUID
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final CraftEntity other = (CraftEntity) obj;
return (this.getEntityId() == other.getEntityId());
}```
oof
Arguably faster
In the end it's reference vs integer. Won't be much different
yeah but kinda breaks the equals contract
@EventHandler (priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onDeath(EntityDeathEvent e){
if (e.getEntity().getType() == EntityType.BLAZE){
Blaze blaze = (Blaze) e.getEntity();
ItemStack br = new ItemStack(Material.BLAZE_ROD, 1);
if(blaze.getLastDamageCause().equals(EntityDamageEvent.DamageCause.DROWNING)){
e.getDrops().add(br);
}
}
}
not necessarily. If an entity's id is ==, its reference must be as well
Otherwise that's broken server logic
@ashen stirrup does it work?
No
ehh its the reflexive aspect of the contract though
priority = EventPriority.HIGHEST Not necessary. Go to normal priority
would it not make more sense to do an == though
since you could reflectively change id
@subtle blade this is not Entity, it is EntityDeathEvent instance
Hello there is a plugin that increases the durability of the armor and also the resistance ?
@subtle blade well E is both for entity and event, so... π
getLastDamageCause() returns an EntityDamageEvent, not a DamageCause
Confusing name, I know
It will never be equal. Surprised your IDE didn't tell you that
EntityDamageEvent lastCause = entity.getLastDamageCause();
if (lastCause != null && lastCause.getCause() == DamageCause.DROWNING) {
// add drops
}```
I'll give it a try
@subtle blade I know why, he used equals... I guess equals accepts Object, so IDE won't warn him...
if he used == it would warn him, imho
Help
If i want to Code FFA with Skript how ?
Im searching from too long
and i cant find ):
give a bunch of people diamond swords in a survival server and turn hardcore on
your welcome
No, your IDE would warn you, Dawon
do you need help or do you need a plugin?
I need help
@subtle blade ah, I see
do you know how to make a plugin
wrong language
no i don't know how to make a plugin
well
Im learning how to code on skript rn
But i need a Good FFA Plugin
or
Code FFA
plugins are alot harder than skript
rlly ?
ye
So how to code ffa ?
you could also just get a free plugin
@subtle blade ha, I underestimated IDEs, I guess you were right π
I need a good ffa plugin
bukkit π
uh oh
what do you mean by good
BukkitDev is fine too though
a plugin thats free or a plugin that costs?
just cause its free dosent mean its bad
you could just pay someone to make you the plugin
Im using uKitPvP rn
it would take less time and may have a better outcome
rip
but costs money
not me though
What's your budget though
im not that good at java
lol
@gloomy dew
What's your budget?
There is someone know how to create a Domain for a server ip ?
ye
Hwooawowoaowwodwoaowaodwa
but
Howowowowowowo
it costs money
lmao
hmmm
im sure you could find a good tutorial on how todo it on google
^^^
are you 7?
im 108 years old
lmao
haha