28 lines
1.0 KiB
Java
28 lines
1.0 KiB
Java
|
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<ResearchComplexState> {
|
||
|
public BaseResearchComplexPart(ResearchComplexState state, List<Transformation> list) {
|
||
|
super(state, list);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
protected void handleBlockPlace(World world, BlockPos pos, BlockState state) {
|
||
|
if (state.getBlock() == EnergonRelics.ENERGON_LIGHT_BLOCK) {
|
||
|
BlockEntity entity = world.getBlockEntity(pos);
|
||
|
if (entity instanceof EnergonLightBlockEntity) {
|
||
|
((EnergonLightBlockEntity) entity).toggle(getState().getMainNetwork());
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|