This repository has been archived on 2023-11-26. You can view files and clone it, but cannot push or open issues or pull requests.
EnergonRelics/src/main/java/com/thebrokenrail/energonrelics/structure/researchcomplex/BaseResearchComplexPart.java

28 lines
1.1 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.Blocks.ENERGON_LIGHT) {
BlockEntity entity = world.getBlockEntity(pos);
if (entity instanceof EnergonLightBlockEntity) {
((EnergonLightBlockEntity) entity).toggle(getState().getMainNetwork());
}
}
}
}