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: 'eclipse'
apply plugin: 'maven-publish' apply plugin: 'maven-publish'
version = 'mc1.14.4_v0.1.1a' version = 'mc1.14.4_v0.1.1b'
group = 'com.simibubi.create' group = 'com.simibubi.create'
archivesBaseName = 'create' archivesBaseName = 'create'

View File

@ -28,7 +28,7 @@ public class Create {
public static final String ID = "create"; public static final String ID = "create";
public static final String NAME = "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 Logger logger = LogManager.getLogger();
public static ItemGroup creativeTab = new CreateItemGroup(); 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.BlockState;
import net.minecraft.block.Blocks; import net.minecraft.block.Blocks;
import net.minecraft.block.HorizontalBlock; import net.minecraft.block.HorizontalBlock;
import net.minecraft.block.material.PushReaction;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.item.ItemEntity; import net.minecraft.entity.item.ItemEntity;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
@ -149,4 +150,9 @@ public class BeltFunnelBlock extends HorizontalBlock implements IBeltAttachment,
return true; 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.BlockState;
import net.minecraft.block.Blocks; import net.minecraft.block.Blocks;
import net.minecraft.block.HorizontalBlock; import net.minecraft.block.HorizontalBlock;
import net.minecraft.block.material.PushReaction;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.state.BooleanProperty; import net.minecraft.state.BooleanProperty;
@ -176,4 +177,9 @@ public class ExtractorBlock extends HorizontalBlock implements IBlockWithFilter
return state.get(HORIZONTAL_FACING).getOpposite(); 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()) if (!invState.hasTileEntity())
return false; return false;
TileEntity invTE = world.getTileEntity(invPos); TileEntity invTE = world.getTileEntity(invPos);
if (invTE == null)
return false;
LazyOptional<IItemHandler> inventory = invTE.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY); LazyOptional<IItemHandler> inventory = invTE.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY);
setInventory(inventory); setInventory(inventory);

View File

@ -11,6 +11,7 @@ import com.simibubi.create.foundation.utility.VecHelper;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks; import net.minecraft.block.Blocks;
import net.minecraft.block.material.PushReaction;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.state.BooleanProperty; import net.minecraft.state.BooleanProperty;
@ -238,4 +239,9 @@ public class RedstoneBridgeBlock extends ProperDirectionalBlock implements IBloc
return state.get(FACING); 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.BlockState;
import net.minecraft.block.Blocks; import net.minecraft.block.Blocks;
import net.minecraft.block.HorizontalBlock; import net.minecraft.block.HorizontalBlock;
import net.minecraft.block.material.PushReaction;
import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.BlockItemUseContext; import net.minecraft.item.BlockItemUseContext;
import net.minecraft.state.IntegerProperty; import net.minecraft.state.IntegerProperty;
@ -137,4 +138,9 @@ public class StockswitchBlock extends HorizontalBlock {
return new StockswitchTileEntity(); 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.Container;
import net.minecraft.inventory.container.INamedContainerProvider; import net.minecraft.inventory.container.INamedContainerProvider;
import net.minecraft.item.BlockItem; import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.item.Items; import net.minecraft.item.Items;
import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.CompoundNBT;
@ -454,15 +455,15 @@ public class SchematicannonTileEntity extends SyncedTileEntity implements ITicka
} }
BlockState blockState = blockReader.getBlockState(target); BlockState blockState = blockReader.getBlockState(target);
if (!shouldPlace(target, blockState)) { ItemStack requiredItem = getItemForBlock(blockState);
if (!shouldPlace(target, blockState) || requiredItem.isEmpty()) {
statusMsg = "searching"; statusMsg = "searching";
blockSkipped = true; blockSkipped = true;
return; return;
} }
// Find Item // Find item
ItemStack requiredItem = getItemForBlock(blockState);
if (blockState.has(BlockStateProperties.SLAB_TYPE) if (blockState.has(BlockStateProperties.SLAB_TYPE)
&& blockState.get(BlockStateProperties.SLAB_TYPE) == SlabType.DOUBLE) && blockState.get(BlockStateProperties.SLAB_TYPE) == SlabType.DOUBLE)
requiredItem.setCount(2); requiredItem.setCount(2);
@ -547,7 +548,8 @@ public class SchematicannonTileEntity extends SyncedTileEntity implements ITicka
} }
protected ItemStack getItemForBlock(BlockState blockState) { 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) { protected boolean findItemInAttachedInventories(ItemStack requiredItem) {

View File

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