Skip to content

Commit 6587aea

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents a0aa0a2 + 74f517d commit 6587aea

2 files changed

Lines changed: 9 additions & 12 deletions

File tree

  • stickynote-bukkit/stickynote-bukkit-nms/src/main/kotlin/org/sayandev/stickynote/bukkit/nms

stickynote-bukkit/stickynote-bukkit-nms/src/main/kotlin/org/sayandev/stickynote/bukkit/nms/NMSUtils.kt

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ object NMSUtils {
201201
}
202202

203203
fun setPlayerCamera(player: Player, nmsEntity: Any) {
204-
ServerPlayerAccessor.METHOD_SET_CAMERA!!.invoke(getServerPlayer(player!!), nmsEntity)
204+
ServerPlayerAccessor.METHOD_SET_CAMERA!!.invoke(getServerPlayer(player), nmsEntity)
205205
}
206206

207207
fun getPlayerUseItem(player: Player): ItemStack? {
@@ -274,7 +274,7 @@ object NMSUtils {
274274
}
275275

276276
fun getEntityDataAccessorId(entityDataAccessor: Any): Int {
277-
if (entityDataAccessor.javaClass != EntityDataAccessorAccessor.TYPE!!) return -1
277+
if (entityDataAccessor.javaClass != EntityDataAccessorAccessor.TYPE) return -1
278278
return EntityDataAccessorAccessor.METHOD_GET_ID!!.invoke(entityDataAccessor) as Int
279279
}
280280

@@ -285,7 +285,7 @@ object NMSUtils {
285285
val nmsSign: Any = getNmsSign(sign)
286286

287287
if (ServerVersion.supports(20)) {
288-
val result = SignBlockEntityAccessor.METHOD_UPDATE_TEXT!!.invoke(
288+
SignBlockEntityAccessor.METHOD_UPDATE_TEXT!!.invoke(
289289
nmsSign,
290290
UnaryOperator { signText: Any ->
291291
val updatedText = SignTextAccessor.METHOD_SET_MESSAGE!!.invoke(
@@ -295,7 +295,7 @@ object NMSUtils {
295295
.serialize(component)
296296
)
297297
updatedText
298-
} as UnaryOperator<Any>,
298+
},
299299
isFront
300300
)
301301
} else if (ServerVersion.supports(13)) {
@@ -430,7 +430,7 @@ object NMSUtils {
430430
}
431431

432432
fun playSound(player: Player, soundEvent: Any, volume: Float, pitch: Float) {
433-
require(soundEvent.javaClass == SoundEventAccessor.TYPE!!) { "Sound must be a SoundEvent object" }
433+
require(soundEvent.javaClass == SoundEventAccessor.TYPE) { "Sound must be a SoundEvent object" }
434434
PlayerAccessor.METHOD_PLAY_SOUND!!.invoke(getServerPlayer(player), soundEvent, volume, pitch)
435435
}
436436

@@ -481,9 +481,6 @@ object NMSUtils {
481481
return CRAFT_BLOCK_STATE_GET_HANDLE_METHOD.getOrThrow().invoke(null, blockState)
482482
}
483483

484-
/**
485-
* @apiNote >= 1.9, For 1.8 use [me.mohamad82.ruom.utils.SoundGroupUtils.getBlockSound]
486-
*/
487484
/*TODO SoundGroupUtils
488485
fun getSoundGroup(material: Material?): SoundGroup? {
489486
try {
@@ -558,8 +555,8 @@ object NMSUtils {
558555
"Boolean" -> EntityDataSerializersAccessor.FIELD_BOOLEAN!!
559556
else -> {
560557
when (any.javaClass) {
561-
ComponentAccessor.TYPE!! -> EntityDataSerializersAccessor.FIELD_COMPONENT!!
562-
PoseAccessor.TYPE!! -> EntityDataSerializersAccessor.FIELD_POSE!!
558+
ComponentAccessor.TYPE -> EntityDataSerializersAccessor.FIELD_COMPONENT!!
559+
PoseAccessor.TYPE -> EntityDataSerializersAccessor.FIELD_POSE!!
563560
else -> throw IllegalArgumentException("Unknown data type: ${any.javaClass.simpleName}")
564561
}
565562
}

stickynote-bukkit/stickynote-bukkit-nms/src/main/kotlin/org/sayandev/stickynote/bukkit/nms/hologram/Hologram.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import org.bukkit.Location
66
import org.bukkit.entity.Player
77
import org.sayandev.stickynote.bukkit.extension.toVector3
88
import org.sayandev.stickynote.bukkit.nms.Viewable
9-
import org.sayandev.stickynote.bukkit.warn
109
import org.sayandev.stickynote.core.math.Vector3
1110
import java.util.UUID
1211

1312
class Hologram(
14-
val lines: MutableList<HoloLine>,
13+
lines: List<HoloLine>,
1514
private var location: Location
1615
): Viewable() {
1716

17+
private val lines = lines.toMutableList()
1818
private val lineLocations: MutableMap<UUID, Location> = mutableMapOf()
1919

2020
init {

0 commit comments

Comments
 (0)