package com.thebrokenrail.energonrelics.structure.researchcomplex; import com.thebrokenrail.energonrelics.EnergonRelics; import com.thebrokenrail.energonrelics.block.entity.EnergonLightBlockEntity; import com.thebrokenrail.energonrelics.structure.StructurePart; import net.minecraft.block.BlockState; import net.minecraft.block.entity.BlockEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import java.util.List; public abstract class BaseResearchComplexPart extends StructurePart { public BaseResearchComplexPart(ResearchComplexState state, List list) { super(state, list); } @Override protected void handleBlockPlace(World world, BlockPos pos, BlockState state) { if (state.getBlock() == EnergonRelics.Blocks.ENERGON_LIGHT) { BlockEntity entity = world.getBlockEntity(pos); if (entity instanceof EnergonLightBlockEntity) { ((EnergonLightBlockEntity) entity).toggle(getState().getMainNetwork()); } } } }