No pushing

- Fixed Schematicannon asking for "Air" items
- Made several blocks immovable by piston
This commit is contained in:
simibubi 2019-11-07 12:00:27 +01:00
parent 44dc7e054b
commit 7f0ba8211d
9 changed files with 51 additions and 23 deletions

View file

@ -13,7 +13,7 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
version = 'mc1.14.4_v0.1.1a'
version = 'mc1.14.4_v0.1.1b'
group = 'com.simibubi.create'
archivesBaseName = 'create'

View file

@ -28,7 +28,7 @@ public class Create {
public static final String ID = "create";
public static final String NAME = "Create";
public static final String VERSION = "0.1.1a";
public static final String VERSION = "0.1.1b";
public static Logger logger = LogManager.getLogger();
public static ItemGroup creativeTab = new CreateItemGroup();

View file

@ -17,6 +17,7 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.HorizontalBlock;
import net.minecraft.block.material.PushReaction;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.ItemEntity;
import net.minecraft.item.BlockItemUseContext;
@ -149,4 +150,9 @@ public class BeltFunnelBlock extends HorizontalBlock implements IBeltAttachment,
return true;
}
@Override
public PushReaction getPushReaction(BlockState state) {
return PushReaction.BLOCK;
}
}

View file

@ -9,6 +9,7 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.HorizontalBlock;
import net.minecraft.block.material.PushReaction;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.state.BooleanProperty;
@ -176,4 +177,9 @@ public class ExtractorBlock extends HorizontalBlock implements IBlockWithFilter
return state.get(HORIZONTAL_FACING).getOpposite();
}
@Override
public PushReaction getPushReaction(BlockState state) {
return PushReaction.BLOCK;
}
}

View file

@ -35,6 +35,8 @@ public interface IInventoryManipulator {
if (!invState.hasTileEntity())
return false;
TileEntity invTE = world.getTileEntity(invPos);
if (invTE == null)
return false;
LazyOptional<IItemHandler> inventory = invTE.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY);
setInventory(inventory);

View file

@ -11,6 +11,7 @@ import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.material.PushReaction;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.state.BooleanProperty;
@ -238,4 +239,9 @@ public class RedstoneBridgeBlock extends ProperDirectionalBlock implements IBloc
return state.get(FACING);
}
@Override
public PushReaction getPushReaction(BlockState state) {
return PushReaction.BLOCK;
}
}

View file

@ -6,6 +6,7 @@ import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.HorizontalBlock;
import net.minecraft.block.material.PushReaction;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.state.IntegerProperty;
@ -137,4 +138,9 @@ public class StockswitchBlock extends HorizontalBlock {
return new StockswitchTileEntity();
}
@Override
public PushReaction getPushReaction(BlockState state) {
return PushReaction.BLOCK;
}
}

View file

@ -23,6 +23,7 @@ import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.Container;
import net.minecraft.inventory.container.INamedContainerProvider;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.nbt.CompoundNBT;
@ -454,15 +455,15 @@ public class SchematicannonTileEntity extends SyncedTileEntity implements ITicka
}
BlockState blockState = blockReader.getBlockState(target);
if (!shouldPlace(target, blockState)) {
ItemStack requiredItem = getItemForBlock(blockState);
if (!shouldPlace(target, blockState) || requiredItem.isEmpty()) {
statusMsg = "searching";
blockSkipped = true;
return;
}
// Find Item
ItemStack requiredItem = getItemForBlock(blockState);
// Find item
if (blockState.has(BlockStateProperties.SLAB_TYPE)
&& blockState.get(BlockStateProperties.SLAB_TYPE) == SlabType.DOUBLE)
requiredItem.setCount(2);
@ -547,7 +548,8 @@ public class SchematicannonTileEntity extends SyncedTileEntity implements ITicka
}
protected ItemStack getItemForBlock(BlockState blockState) {
return new ItemStack(BlockItem.BLOCK_TO_ITEM.getOrDefault(blockState.getBlock(), Items.AIR));
Item item = BlockItem.BLOCK_TO_ITEM.getOrDefault(blockState.getBlock(), Items.AIR);
return item == Items.AIR ? ItemStack.EMPTY : new ItemStack(item);
}
protected boolean findItemInAttachedInventories(ItemStack requiredItem) {

View file

@ -4,7 +4,7 @@ loaderVersion="[28,)"
[[mods]]
modId="create"
version="0.1.1a"
version="0.1.1b"
displayName="Create"
#updateJSONURL=""
authors="simibubi"