1
1
package io.github.dockyardmc
2
2
3
- import io.github.dockyardmc.commands.*
3
+ import io.github.dockyardmc.commands.Commands
4
+ import io.github.dockyardmc.commands.PlayerArgument
4
5
import io.github.dockyardmc.datagen.EventsDocumentationGenerator
5
6
import io.github.dockyardmc.datagen.VerifyPacketIds
6
7
import io.github.dockyardmc.events.Events
8
+ import io.github.dockyardmc.events.PlayerDropItemEvent
7
9
import io.github.dockyardmc.events.PlayerJoinEvent
8
10
import io.github.dockyardmc.events.PlayerLeaveEvent
9
11
import io.github.dockyardmc.extentions.broadcastMessage
10
- import io.github.dockyardmc.location.Location
12
+ import io.github.dockyardmc.item.ItemStack
11
13
import io.github.dockyardmc.particles.spawnParticle
12
- import io.github.dockyardmc.player.*
14
+ import io.github.dockyardmc.player.GameMode
15
+ import io.github.dockyardmc.player.Player
16
+ import io.github.dockyardmc.player.add
17
+ import io.github.dockyardmc.player.toPersistent
18
+ import io.github.dockyardmc.protocol.packets.play.clientbound.EntityEquipmentLayer
19
+ import io.github.dockyardmc.protocol.packets.play.serverbound.placementRules
13
20
import io.github.dockyardmc.registry.*
14
21
import io.github.dockyardmc.sounds.playSound
15
22
import io.github.dockyardmc.utils.DebugScoreboard
16
23
import io.github.dockyardmc.utils.MathUtils
17
24
import io.github.dockyardmc.utils.Vector3f
18
- import io.github.dockyardmc.world.World
19
- import io.github.dockyardmc.world.WorldManager
20
25
21
26
// This is just testing/development environment.
22
27
// To properly use dockyard, visit https://dockyardmc.github.io/Wiki/wiki/quick-start.html
@@ -51,22 +56,25 @@ fun main(args: Array<String>) {
51
56
}
52
57
53
58
54
- Commands .add(" /explode " ) {
59
+ Commands .add(" /equipment " ) {
55
60
addArgument(" player" , PlayerArgument ())
56
- withPermission(" player.admin" )
57
- withDescription(" executes stuff" )
58
61
execute {
59
- val executingPlayer = it.getPlayerOrThrow()
60
- val player = getArgument<Player >(" player" )
62
+ val player = it.getPlayerOrThrow()
63
+ val target = getArgument<Player >(" player" )
61
64
62
- player.spawnParticle( player.location, Particles . EXPLOSION_EMITTER , Vector3f ( 1f ), amount = 5 )
63
- player.playSound( " minecraft:entity.generic.explode " , volume = 2f , pitch = MathUtils .randomFloat( 0.6f , 1.3f ))
64
-
65
- player.sendMessage( " <yellow>You got <rainbow><b>totally exploded <yellow>by <red> $executingPlayer " )
66
- executingPlayer.sendMessage( " <yellow>You <rainbow><b>totally exploded <yellow>player <red> $player " )
65
+ target.equipmentLayers[ player.toPersistent()] = EntityEquipmentLayer (
66
+ helmet = ItemStack ( Items . LIME_STAINED_GLASS ),
67
+ offHand = ItemStack ( Items . LEAD ),
68
+ boots = ItemStack ( Items . NETHERITE_BOOTS )
69
+ )
67
70
}
68
71
}
69
72
73
+ Events .on<PlayerDropItemEvent > {
74
+ it.cancelled = true
75
+ }
76
+
77
+
70
78
val server = DockyardServer ()
71
79
server.start()
72
80
}
0 commit comments