1
0
mirror of https://github.com/chylex/Hardcore-Ender-Expansion-2.git synced 2025-04-11 03:15:44 +02:00

Use Map.getValue instead of [key]!!

This commit is contained in:
chylex 2019-06-01 03:04:27 +02:00
parent 86aabd10bb
commit 3a7964a20a
2 changed files with 4 additions and 4 deletions
src/main/java/chylex/hee/game

View File

@ -94,7 +94,7 @@ class BlockGloomtorch(builder: BlockSimple.Builder) : BlockSimple(builder){
// Shape and rendering
override fun getBoundingBox(state: IBlockState, source: IBlockAccess, pos: BlockPos): AxisAlignedBB{
return BOUNDING_BOX[state[FACING]] ?: BOUNDING_BOX[UP]!!
return BOUNDING_BOX[state[FACING]] ?: BOUNDING_BOX.getValue(UP)
}
override fun getBlockFaceShape(world: IBlockAccess, state: IBlockState, pos: BlockPos, face: EnumFacing) = UNDEFINED

View File

@ -29,7 +29,7 @@ class TerritoryGlobalStorage(name: String) : WorldSavedData(name){
return 0
}
val list = territoryData[territory]!!
val list = territoryData.getValue(territory)
val newIndex = list.size
list.add(makeEntry(territory, newIndex))
@ -44,7 +44,7 @@ class TerritoryGlobalStorage(name: String) : WorldSavedData(name){
return if (territory.isSpawn)
spawnEntry
else
territoryData[territory]!!.getOrNull(index)
territoryData.getValue(territory).getOrNull(index)
}
// Serialization
@ -62,7 +62,7 @@ class TerritoryGlobalStorage(name: String) : WorldSavedData(name){
for(key in keySet){
val territory = TerritoryType.fromTitle(key) ?: continue
val list = territoryData[territory]!!
val list = territoryData.getValue(territory)
list.clear()
list.addAll(getListOfCompounds(key).mapIndexed { index, nbt -> makeEntry(territory, index).also { it.deserializeNBT(nbt) } })