mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-27 23:47:38 +01:00
Change item requirements for block zapper and schematicannon
grass path -> grass block farmland -> dirt block
This commit is contained in:
parent
d73ebd0253
commit
1f06acb497
2 changed files with 11 additions and 10 deletions
|
@ -4,22 +4,14 @@ import java.util.ArrayList;
|
|||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.SeaPickleBlock;
|
||||
import net.minecraft.block.SnowBlock;
|
||||
import net.minecraft.block.TurtleEggBlock;
|
||||
import net.minecraft.block.*;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.item.ArmorStandEntity;
|
||||
import net.minecraft.entity.item.BoatEntity;
|
||||
import net.minecraft.entity.item.ItemFrameEntity;
|
||||
import net.minecraft.entity.item.minecart.AbstractMinecartEntity;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.item.*;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.state.properties.SlabType;
|
||||
|
||||
|
@ -65,6 +57,10 @@ public class ItemRequirement {
|
|||
return new ItemRequirement(ItemUseType.CONSUME, Arrays.asList(new ItemStack(item, state.get(SeaPickleBlock.PICKLES).intValue())));
|
||||
if (block instanceof SnowBlock)
|
||||
return new ItemRequirement(ItemUseType.CONSUME, Arrays.asList(new ItemStack(item, state.get(SnowBlock.LAYERS).intValue())));
|
||||
if (block instanceof GrassPathBlock)
|
||||
return new ItemRequirement(ItemUseType.CONSUME, Arrays.asList(new ItemStack(Items.GRASS_BLOCK)));
|
||||
if (block instanceof FarmlandBlock)
|
||||
return new ItemRequirement(ItemUseType.CONSUME, Arrays.asList(new ItemStack(Items.DIRT)));
|
||||
|
||||
return item == Items.AIR ? INVALID : new ItemRequirement(ItemUseType.CONSUME, item);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.simibubi.create.foundation.utility;
|
|||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import net.minecraft.item.Items;
|
||||
import org.apache.commons.lang3.mutable.MutableInt;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -115,6 +116,10 @@ public class BlockHelper {
|
|||
|
||||
public static ItemStack getRequiredItem(BlockState state) {
|
||||
ItemStack itemStack = new ItemStack(state.getBlock());
|
||||
if (itemStack.getItem() == Items.FARMLAND)
|
||||
itemStack = new ItemStack(Items.DIRT);
|
||||
else if (itemStack.getItem() == Items.GRASS_PATH)
|
||||
itemStack = new ItemStack(Items.GRASS_BLOCK);
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue