filename:
common/src/main/java/rearth/oritech/block/entity/generators/LavaGeneratorEntity.java
branch:
1.21
back to repo
package rearth.oritech.block.entity.generators;
import net.minecraft.block.BlockState;
import net.minecraft.screen.ScreenHandlerType;
import net.minecraft.util.Pair;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Vec3i;
import net.minecraft.world.World;
import rearth.oritech.Oritech;
import rearth.oritech.block.base.entity.FluidMultiblockGeneratorBlockEntity;
import rearth.oritech.client.init.ModScreens;
import rearth.oritech.init.BlockEntitiesContent;
import rearth.oritech.init.recipes.OritechRecipeType;
import rearth.oritech.init.recipes.RecipeContent;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
public class LavaGeneratorEntity extends FluidMultiblockGeneratorBlockEntity {
public LavaGeneratorEntity(BlockPos pos, BlockState state) {
super(BlockEntitiesContent.LAVA_GENERATOR_ENTITY, pos, state, Oritech.CONFIG.generators.lavaGeneratorData.energyPerTick());
}
@Override
protected Set<Pair<BlockPos, Direction>> getOutputTargets(BlockPos pos, World world) {
var res = new HashSet<Pair<BlockPos, Direction>>();
res.add(new Pair<>(pos.up(2), Direction.DOWN));
res.add(new Pair<>(pos.down(), Direction.DOWN));
res.add(new Pair<>(pos.east(), Direction.WEST));
res.add(new Pair<>(pos.east().up(), Direction.WEST));
res.add(new Pair<>(pos.south(), Direction.NORTH));
res.add(new Pair<>(pos.south().up(), Direction.NORTH));
res.add(new Pair<>(pos.west(), Direction.EAST));
res.add(new Pair<>(pos.west().up(), Direction.EAST));
res.add(new Pair<>(pos.north(), Direction.SOUTH));
res.add(new Pair<>(pos.north().up(), Direction.SOUTH));
return res;
}
@Override
protected OritechRecipeType getOwnRecipeType() {
return RecipeContent.LAVA_GENERATOR;
}
@Override
public ScreenHandlerType<?> getScreenHandlerType() {
return ModScreens.LAVA_GENERATOR_SCREEN;
}
@Override
public long getDefaultExtractionRate() {
return Oritech.CONFIG.generators.lavaGeneratorData.maxEnergyExtraction();
}
@Override
public long getDefaultCapacity() {
return Oritech.CONFIG.generators.lavaGeneratorData.energyCapacity();
}
@Override
public List<Vec3i> getAddonSlots() {
return List.of(
new Vec3i(1, 0, 0),
new Vec3i(1, 1, 0)
);
}
@Override
public List<Vec3i> getCorePositions() {
return List.of(
new Vec3i(0, 1, 0)
);
}
}