mirror of
https://github.com/chylex/Hardcore-Ender-Expansion-2.git
synced 2025-04-14 12:15:44 +02:00
Add option to disable stack splitting in loot tables
This commit is contained in:
parent
05bb8dcb36
commit
a9e46c4f1d
src/main
@ -0,0 +1,11 @@
|
||||
package chylex.hee.game.loot
|
||||
import chylex.hee.init.ModLoot.pools
|
||||
import net.minecraft.item.ItemStack
|
||||
import net.minecraft.world.storage.loot.LootTable
|
||||
import java.util.Random
|
||||
|
||||
class NoStackSplittingLootTable(wrapped: LootTable) : LootTable(wrapped.pools.toTypedArray()){
|
||||
override fun shuffleItems(stacks: MutableList<ItemStack>, emptySlotCount: Int, rand: Random){
|
||||
stacks.shuffle(rand)
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
package chylex.hee.init
|
||||
import chylex.hee.HEE
|
||||
import chylex.hee.game.loot.BlockLootTable
|
||||
import chylex.hee.game.loot.NoStackSplittingLootTable
|
||||
import chylex.hee.game.loot.conditions.ConditionCriticalHit
|
||||
import chylex.hee.game.loot.conditions.ConditionFortune
|
||||
import chylex.hee.game.loot.conditions.ConditionLooting
|
||||
@ -74,6 +75,13 @@ object ModLoot{
|
||||
|
||||
for((key, value) in split){
|
||||
when(key){
|
||||
"stack_splitting" -> {
|
||||
if (value == "off"){
|
||||
table = NoStackSplittingLootTable(table)
|
||||
pools = table.pools
|
||||
}
|
||||
}
|
||||
|
||||
else -> throw UnsupportedOperationException(key)
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,8 @@ public-f net.minecraft.client.renderer.tileentity.TileEntityChestRenderer field_
|
||||
public-f net.minecraft.client.renderer.tileentity.TileEntityChestRenderer field_147505_d # TEXTURE_NORMAL_DOUBLE
|
||||
public net.minecraft.client.renderer.tileentity.TileEntityChestRenderer field_147509_j # isChristmas
|
||||
|
||||
public net.minecraft.world.storage.loot.LootTable func_186463_a(Ljava/util/List;ILjava/util/Random;)V # shuffleItems
|
||||
|
||||
public net.minecraft.world.Explosion field_77287_j # world
|
||||
public net.minecraft.world.Explosion field_77280_f # size
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user