content: package com.github.alexthe666.iceandfire.block;
  
  import com.github.alexthe666.iceandfire.IceAndFire;
  import com.github.alexthe666.iceandfire.entity.tile.TileEntityMyrmexCocoon;
  import net.minecraft.core.BlockPos;
  import net.minecraft.world.*;
  import net.minecraft.world.entity.player.Player;
  import net.minecraft.world.level.Level;
  import net.minecraft.world.level.block.BaseEntityBlock;
  import net.minecraft.world.level.block.RenderShape;
  import net.minecraft.world.level.block.SoundType;
  import net.minecraft.world.level.block.entity.BlockEntity;
  import net.minecraft.world.level.block.state.BlockState;
  import net.minecraft.world.level.material.Material;
  import net.minecraft.world.phys.BlockHitResult;
  import org.jetbrains.annotations.NotNull;
  
  import javax.annotation.Nullable;
  
  public class BlockMyrmexCocoon extends BaseEntityBlock {
  
  
      public BlockMyrmexCocoon() {
          super(
              Properties
                  .of(Material.DIRT)
                  .strength(2.5F)
                  .noOcclusion()
                  .dynamicShape()
                  .sound(SoundType.SLIME_BLOCK)
          );
      }
  
      @Override
      public @NotNull RenderShape getRenderShape(@NotNull BlockState state) {
          return RenderShape.MODEL;
      }
  
      @Override
      public void onRemove(@NotNull BlockState state, Level worldIn, @NotNull BlockPos pos, @NotNull BlockState newState, boolean isMoving) {
          BlockEntity tileentity = worldIn.getBlockEntity(pos);
          if (tileentity instanceof Container) {
              Containers.dropContents(worldIn, pos, (Container) tileentity);
              worldIn.updateNeighbourForOutputSignal(pos, this);
          }
          super.onRemove(state, worldIn, pos, newState, isMoving);
      }
  
      @Override
      public @NotNull InteractionResult use(@NotNull BlockState state, @NotNull Level worldIn, @NotNull BlockPos pos, Player player, @NotNull InteractionHand handIn, @NotNull BlockHitResult hit) {
          if (!player.isShiftKeyDown()) {
              if (worldIn.isClientSide) {
                  IceAndFire.PROXY.setRefrencedTE(worldIn.getBlockEntity(pos));
              } else {
                  MenuProvider inamedcontainerprovider = this.getMenuProvider(state, worldIn, pos);
                  if (inamedcontainerprovider != null) {
                      player.openMenu(inamedcontainerprovider);
                  }
              }
              return InteractionResult.SUCCESS;
          }
          return InteractionResult.FAIL;
      }
  
      @Nullable
      @Override
      public BlockEntity newBlockEntity(@NotNull BlockPos pos, @NotNull BlockState state) {
          return new TileEntityMyrmexCocoon(pos, state);
      }
  }
  