Skip to content

Commit 954342b

Browse files
committed
Fixed ghost cast issue
1 parent 861db72 commit 954342b

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/main/kotlin/com/lambda/util/player/SlotUtils.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ import net.minecraft.item.ItemStack
2323
import net.minecraft.screen.slot.SlotActionType
2424

2525
object SlotUtils {
26-
val ClientPlayerEntity.hotbar: List<ItemStack> get() = inventory.mainStacks.slice(0..8)
27-
val ClientPlayerEntity.storage: List<ItemStack> get() = inventory.mainStacks.slice(9..35)
26+
val ClientPlayerEntity.hotbar: List<ItemStack> get() = inventory.main.slice(0..8)
27+
val ClientPlayerEntity.storage: List<ItemStack> get() = inventory.main.slice(9..35)
2828
val ClientPlayerEntity.equipment: List<ItemStack> get() = inventory.equipment.map.map { it.value }
29-
val ClientPlayerEntity.hotbarAndStorage: List<ItemStack> get() = inventory.mainStacks
30-
val ClientPlayerEntity.combined: List<ItemStack> get() = hotbarAndStorage// + equipment
29+
val ClientPlayerEntity.hotbarAndStorage: List<ItemStack> get() = inventory.main
30+
val ClientPlayerEntity.combined: List<ItemStack> get() = hotbarAndStorage + equipment
3131

3232

3333
fun SafeContext.clickSlot(

src/main/resources/lambda.accesswidener

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ accessible field net/minecraft/entity/player/PlayerInventory equipment Lnet/mine
3636
accessible method net/minecraft/client/network/ClientPlayerEntity applyMovementSpeedFactors (Lnet/minecraft/util/math/Vec2f;)Lnet/minecraft/util/math/Vec2f;
3737
accessible field net/minecraft/entity/EntityEquipment map Ljava/util/EnumMap;
3838
accessible method net/minecraft/entity/LivingEntity getHandSwingDuration ()I
39+
accessible field net/minecraft/entity/player/PlayerInventory main Lnet/minecraft/util/collection/DefaultedList;
3940

4041
# Camera
4142
accessible method net/minecraft/client/render/Camera setPos (DDD)V

0 commit comments

Comments
 (0)