mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-24 05:54:49 +00:00
Fix spreaders and force relay being spawnable
This commit is contained in:
1 parent
7acdb06518
commit
a683d2442a
2 files changed
+15
No files matched your search
@@ -17,6 +17,7 @@ import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.MovingPistonBlock;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.material.PushReaction;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -30,6 +31,7 @@ import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.GlobalPos;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
@@ -70,6 +72,11 @@ public class BlockPistonRelay extends BlockMod implements IWandable {
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canEntitySpawn(BlockState state, @Nonnull IBlockReader world, @Nonnull BlockPos pos, EntityType<?> type) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReplaced(@Nonnull BlockState state, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull BlockState newState, boolean isMoving) {
|
||||
if(!world.isRemote)
|
||||
|
||||
@@ -15,6 +15,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockRenderType;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -25,6 +26,7 @@ import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.shapes.ISelectionContext;
|
||||
import net.minecraft.util.math.shapes.VoxelShape;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
import net.minecraft.world.World;
|
||||
@@ -42,6 +44,7 @@ import vazkii.botania.common.core.helper.InventoryHelper;
|
||||
import vazkii.botania.common.item.ModItems;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockSpreader extends BlockMod implements IWandable, IWandHUD, IWireframeAABBProvider {
|
||||
@@ -65,6 +68,11 @@ public class BlockSpreader extends BlockMod implements IWandable, IWandHUD, IWir
|
||||
return RENDER_SHAPE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canEntitySpawn(BlockState state, @Nonnull IBlockReader world, @Nonnull BlockPos pos, EntityType<?> type) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack) {
|
||||
Direction orientation = Direction.getFacingDirections(placer)[0].getOpposite();
|
||||
|
||||
Reference in new issue
Block a user