Fixed Drawer drops and added some missing data
This commit is contained in:
parent
302842c798
commit
c77dae2467
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"type": "minecraft:block"
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"type": "minecraft:block"
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"type": "minecraft:block"
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"type": "forge:conditional",
|
||||
"recipes": [
|
||||
{
|
||||
"conditions": [
|
||||
{
|
||||
"values": [
|
||||
{
|
||||
"item": "functionalstorage:framed_1",
|
||||
"type": "forge:item_exists"
|
||||
}
|
||||
],
|
||||
"type": "forge:and"
|
||||
}
|
||||
],
|
||||
"recipe": {
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"PPP",
|
||||
"PCP",
|
||||
"PPP"
|
||||
],
|
||||
"key": {
|
||||
"P": {
|
||||
"item": "minecraft:iron_nugget"
|
||||
},
|
||||
"C": {
|
||||
"tag": "forge:chests/wooden"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "functionalstorage:framed_1"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"type": "forge:conditional",
|
||||
"recipes": [
|
||||
{
|
||||
"conditions": [
|
||||
{
|
||||
"values": [
|
||||
{
|
||||
"item": "functionalstorage:framed_2",
|
||||
"type": "forge:item_exists"
|
||||
}
|
||||
],
|
||||
"type": "forge:and"
|
||||
}
|
||||
],
|
||||
"recipe": {
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"PCP",
|
||||
"PPP",
|
||||
"PCP"
|
||||
],
|
||||
"key": {
|
||||
"P": {
|
||||
"item": "minecraft:iron_nugget"
|
||||
},
|
||||
"C": {
|
||||
"tag": "forge:chests/wooden"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "functionalstorage:framed_2",
|
||||
"count": 2
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"type": "forge:conditional",
|
||||
"recipes": [
|
||||
{
|
||||
"conditions": [
|
||||
{
|
||||
"values": [
|
||||
{
|
||||
"item": "functionalstorage:framed_4",
|
||||
"type": "forge:item_exists"
|
||||
}
|
||||
],
|
||||
"type": "forge:and"
|
||||
}
|
||||
],
|
||||
"recipe": {
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
"CPC",
|
||||
"PPP",
|
||||
"CPC"
|
||||
],
|
||||
"key": {
|
||||
"P": {
|
||||
"item": "minecraft:iron_nugget"
|
||||
},
|
||||
"C": {
|
||||
"tag": "forge:chests/wooden"
|
||||
}
|
||||
},
|
||||
"result": {
|
||||
"item": "functionalstorage:framed_4",
|
||||
"count": 4
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,14 +1,15 @@
|
|||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"functionalstorage:oak_1",
|
||||
"functionalstorage:spruce_1",
|
||||
"functionalstorage:birch_1",
|
||||
"functionalstorage:jungle_1",
|
||||
"functionalstorage:acacia_1",
|
||||
"functionalstorage:dark_oak_1",
|
||||
"functionalstorage:crimson_1",
|
||||
"functionalstorage:warped_1",
|
||||
"functionalstorage:oak_2",
|
||||
"functionalstorage:spruce_2",
|
||||
"functionalstorage:birch_2",
|
||||
"functionalstorage:jungle_2",
|
||||
"functionalstorage:acacia_2",
|
||||
"functionalstorage:dark_oak_2",
|
||||
"functionalstorage:crimson_2",
|
||||
"functionalstorage:warped_2",
|
||||
"functionalstorage:framed_2",
|
||||
"functionalstorage:oak_4",
|
||||
"functionalstorage:spruce_4",
|
||||
"functionalstorage:birch_4",
|
||||
|
@ -17,13 +18,15 @@
|
|||
"functionalstorage:dark_oak_4",
|
||||
"functionalstorage:crimson_4",
|
||||
"functionalstorage:warped_4",
|
||||
"functionalstorage:oak_2",
|
||||
"functionalstorage:spruce_2",
|
||||
"functionalstorage:birch_2",
|
||||
"functionalstorage:jungle_2",
|
||||
"functionalstorage:acacia_2",
|
||||
"functionalstorage:dark_oak_2",
|
||||
"functionalstorage:crimson_2",
|
||||
"functionalstorage:warped_2"
|
||||
"functionalstorage:framed_4",
|
||||
"functionalstorage:oak_1",
|
||||
"functionalstorage:spruce_1",
|
||||
"functionalstorage:birch_1",
|
||||
"functionalstorage:jungle_1",
|
||||
"functionalstorage:acacia_1",
|
||||
"functionalstorage:dark_oak_1",
|
||||
"functionalstorage:crimson_1",
|
||||
"functionalstorage:warped_1",
|
||||
"functionalstorage:framed_1"
|
||||
]
|
||||
}
|
|
@ -12,19 +12,25 @@ import com.hrznstudio.titanium.recipe.generator.TitaniumShapedRecipeBuilder;
|
|||
import com.hrznstudio.titanium.util.ItemHandlerUtil;
|
||||
import com.hrznstudio.titanium.util.TileUtil;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.NonNullList;
|
||||
import net.minecraft.data.recipes.FinishedRecipe;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.inventory.tooltip.TooltipComponent;
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||
import net.minecraft.world.level.block.entity.BlockEntityType;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.storage.loot.LootContext;
|
||||
import net.minecraft.world.level.storage.loot.parameters.LootContextParams;
|
||||
import net.minecraft.world.phys.HitResult;
|
||||
import net.minecraftforge.common.Tags;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
|
@ -33,6 +39,7 @@ import org.apache.commons.lang3.tuple.Pair;
|
|||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
|
@ -77,6 +84,32 @@ public class FramedDrawerBlock extends DrawerBlock{
|
|||
return drawer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(BlockState p_60537_, LootContext.Builder builder) {
|
||||
NonNullList<ItemStack> stacks = NonNullList.create();
|
||||
ItemStack stack = new ItemStack(this);
|
||||
BlockEntity drawerTile = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY);
|
||||
if (drawerTile instanceof FramedDrawerTile) {
|
||||
if (!((FramedDrawerTile) drawerTile).isEverythingEmpty()) {
|
||||
stack.getOrCreateTag().put("Tile", drawerTile.saveWithoutMetadata());
|
||||
}
|
||||
stack.getOrCreateTag().put("Style", ((FramedDrawerTile) drawerTile).getFramedDrawerModelData().serializeNBT());
|
||||
}
|
||||
stacks.add(stack);
|
||||
return stacks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCloneItemStack(BlockState state, HitResult target, BlockGetter level, BlockPos pos, Player player) {
|
||||
BlockEntity entity = level.getBlockEntity(pos);
|
||||
if (entity instanceof FramedDrawerTile framedDrawerTile){
|
||||
ItemStack stack = new ItemStack(this);
|
||||
stack.getOrCreateTag().put("Style", framedDrawerTile.getFramedDrawerModelData().serializeNBT());
|
||||
return stack;
|
||||
}
|
||||
return super.getCloneItemStack(state, target, level, pos, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerRecipe(Consumer<FinishedRecipe> consumer) {
|
||||
if (this.getType() == FunctionalStorage.DrawerType.X_1) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user