Furnace drop fix
This commit is contained in:
parent
2a4b4f9c5a
commit
a3a6b54eba
1 changed files with 19 additions and 0 deletions
|
@ -1,15 +1,21 @@
|
|||
package ru.betterend.blocks.basis;
|
||||
|
||||
import java.io.Reader;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.FurnaceBlock;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.loot.context.LootContext;
|
||||
import net.minecraft.loot.context.LootContextParameters;
|
||||
import net.minecraft.screen.NamedScreenHandlerFactory;
|
||||
import net.minecraft.stat.Stats;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
@ -76,4 +82,17 @@ public class EndFurnaceBlock extends FurnaceBlock implements BlockPatterned, IRe
|
|||
public ERenderLayer getRenderLayer() {
|
||||
return ERenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDroppedStacks(BlockState state, LootContext.Builder builder) {
|
||||
List<ItemStack> drop = Lists.newArrayList(new ItemStack(this));
|
||||
BlockEntity blockEntity = builder.getNullable(LootContextParameters.BLOCK_ENTITY);
|
||||
if (blockEntity instanceof EFurnaceBlockEntity) {
|
||||
EFurnaceBlockEntity entity = (EFurnaceBlockEntity) blockEntity;
|
||||
for (int i = 0; i < entity.size(); i++) {
|
||||
drop.add(entity.getStack(i));
|
||||
}
|
||||
}
|
||||
return drop;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue