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
Raw Normal View History

2020-07-19 19:12:39 +00:00
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) {
2020-08-20 23:03:47 +00:00
if (state.getBlock() == EnergonRelics.Blocks.ENERGON_LIGHT) {
2020-07-19 19:12:39 +00:00
BlockEntity entity = world.getBlockEntity(pos);
if (entity instanceof EnergonLightBlockEntity) {
((EnergonLightBlockEntity) entity).toggle(getState().getMainNetwork());
}
}
}
}