removed diamond, infested stone and portal room finders

This commit is contained in:
Unknown
2020-02-05 16:46:21 -05:00
parent 4c7e8034d0
commit d8c4a4f13b
6 changed files with 0 additions and 229 deletions
@@ -3,11 +3,8 @@ package kaptainwutax.seedcracker.finder;
public class DefaultFinderConfig extends FinderConfig {
public DefaultFinderConfig() {
this.typeStates.put(Type.DIAMOND_ORE, false);
this.typeStates.put(Type.INFESTED_STONE_ORE, false);
this.typeStates.put(Type.IGLOO, false);
this.typeStates.put(Type.MANSION, false);
this.typeStates.put(Type.PORTAL_ROOM, false);
}
}
@@ -4,9 +4,7 @@ import kaptainwutax.seedcracker.finder.population.DesertWellFinder;
import kaptainwutax.seedcracker.finder.population.DungeonFinder;
import kaptainwutax.seedcracker.finder.population.EndGatewayFinder;
import kaptainwutax.seedcracker.finder.population.EndPillarsFinder;
import kaptainwutax.seedcracker.finder.population.ore.DiamondOreFinder;
import kaptainwutax.seedcracker.finder.population.ore.EmeraldOreFinder;
import kaptainwutax.seedcracker.finder.population.ore.InfestedStoneOreFinder;
import kaptainwutax.seedcracker.finder.structure.*;
import kaptainwutax.seedcracker.util.FinderBuilder;
@@ -81,12 +79,8 @@ public class FinderConfig {
END_PILLARS(EndPillarsFinder::create, Category.OTHERS),
END_GATEWAY(EndGatewayFinder::create, Category.OTHERS),
DUNGEON(DungeonFinder::create, Category.OTHERS),
DIAMOND_ORE(DiamondOreFinder::create, Category.ORES),
INFESTED_STONE_ORE(InfestedStoneOreFinder::create, Category.ORES),
EMERALD_ORE(EmeraldOreFinder::create, Category.ORES),
DESERT_WELL(DesertWellFinder::create, Category.OTHERS),
PORTAL_ROOM(PortalRoomFinder::create, Category.OTHERS),
BIOME(BiomeFinder::create, Category.BIOMES);
public final FinderBuilder finderBuilder;
@@ -1,42 +0,0 @@
package kaptainwutax.seedcracker.finder.population.ore;
import kaptainwutax.seedcracker.finder.Finder;
import net.minecraft.block.Blocks;
import net.minecraft.client.util.math.Vector4f;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.OreFeatureConfig;
import java.util.ArrayList;
import java.util.List;
public class DiamondOreFinder extends SimpleOreFinder {
public static OreFeatureConfig CONFIG = new OreFeatureConfig(OreFeatureConfig.Target.NATURAL_STONE, Blocks.DIAMOND_ORE.getDefaultState(), 8);
protected static List<BlockPos> SEARCH_POSITIONS = buildSearchPositions(CHUNK_POSITIONS, pos -> {
if(pos.getY() > 16 + 4)return true;
return false;
});
public DiamondOreFinder(World world, ChunkPos chunkPos) {
super(world, chunkPos, CONFIG);
this.searchPositions = SEARCH_POSITIONS;
}
@Override
public Vector4f getRenderColor() {
return new Vector4f(0.0f, 1.0f, 1.0f, 1.0f);
}
public static List<Finder> create(World world, ChunkPos chunkPos) {
List<Finder> finders = new ArrayList<>();
finders.add(new DiamondOreFinder(world, chunkPos));
finders.add(new DiamondOreFinder(world, new ChunkPos(chunkPos.x + 1, chunkPos.z)));
finders.add(new DiamondOreFinder(world, new ChunkPos(chunkPos.x, chunkPos.z + 1)));
finders.add(new DiamondOreFinder(world, new ChunkPos(chunkPos.x + 1, chunkPos.z + 1)));
return finders;
}
}
@@ -1,42 +0,0 @@
package kaptainwutax.seedcracker.finder.population.ore;
import kaptainwutax.seedcracker.finder.Finder;
import net.minecraft.block.Blocks;
import net.minecraft.client.util.math.Vector4f;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.OreFeatureConfig;
import java.util.ArrayList;
import java.util.List;
public class InfestedStoneOreFinder extends SimpleOreFinder {
public static OreFeatureConfig CONFIG = new OreFeatureConfig(OreFeatureConfig.Target.NATURAL_STONE, Blocks.INFESTED_STONE.getDefaultState(), 9);
protected static List<BlockPos> SEARCH_POSITIONS = Finder.buildSearchPositions(Finder.CHUNK_POSITIONS, pos -> {
if(pos.getY() > 64 + 4)return true;
return false;
});
public InfestedStoneOreFinder(World world, ChunkPos chunkPos) {
super(world, chunkPos, CONFIG);
this.searchPositions = SEARCH_POSITIONS;
}
@Override
public Vector4f getRenderColor() {
return new Vector4f(0.5f, 0.5f, 0.5f, 1.0f);
}
public static List<Finder> create(World world, ChunkPos chunkPos) {
List<Finder> finders = new ArrayList<>();
finders.add(new InfestedStoneOreFinder(world, chunkPos));
finders.add(new InfestedStoneOreFinder(world, new ChunkPos(chunkPos.x + 1, chunkPos.z)));
finders.add(new InfestedStoneOreFinder(world, new ChunkPos(chunkPos.x, chunkPos.z + 1)));
finders.add(new InfestedStoneOreFinder(world, new ChunkPos(chunkPos.x + 1, chunkPos.z + 1)));
return finders;
}
}
@@ -1,50 +0,0 @@
package kaptainwutax.seedcracker.finder.population.ore;
import kaptainwutax.seedcracker.finder.population.OreFinder;
import kaptainwutax.seedcracker.render.Cuboid;
import net.minecraft.client.util.math.Vector4f;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.OreFeatureConfig;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
public abstract class SimpleOreFinder extends OreFinder {
public SimpleOreFinder(World world, ChunkPos chunkPos, OreFeatureConfig oreFeatureConfig) {
super(world, chunkPos, oreFeatureConfig);
}
@Override
public void findOreVeins(List<Set<BlockPos>> veins) {
List<BlockPos> starts = new ArrayList<>();
for(Set<BlockPos> vein: veins) {
//This is a semi-accurate estimate.
BlockPos oreStart = new BlockPos(
this.findX(vein, OreFinder.HIGHEST),
this.findY(vein, OreFinder.LOWEST) + 2,
this.findZ(vein, OreFinder.HIGHEST)
);
starts.add(oreStart);
}
//If the start overlaps with another chunk, get rid of it.
starts.removeIf(start -> {
if((start.getX() & 15) == 0 || (start.getX() & 15) == 15)return true;
if((start.getZ() & 15) == 0 || (start.getZ() & 15) == 15)return true;
return false;
});
starts.forEach(start -> {
this.renderers.add(new Cuboid(start.add(-1, -1, -1), start.add(1, 0, 1), this.getRenderColor()));
});
}
public abstract Vector4f getRenderColor();
}
@@ -1,86 +0,0 @@
package kaptainwutax.seedcracker.finder.structure;
import kaptainwutax.seedcracker.finder.Finder;
import kaptainwutax.seedcracker.render.Cuboid;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.EndPortalFrameBlock;
import net.minecraft.client.util.math.Vector4f;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Vec3i;
import net.minecraft.world.World;
import net.minecraft.world.dimension.DimensionType;
import java.util.ArrayList;
import java.util.List;
public class PortalRoomFinder extends PieceFinder {
protected static List<BlockPos> SEARCH_POSITIONS = buildSearchPositions(CHUNK_POSITIONS, pos -> {
if(pos.getY() > 63)return true;
return false;
});
protected static Vec3i SIZE = new Vec3i(5, 1, 5);
public PortalRoomFinder(World world, ChunkPos chunkPos) {
super(world, chunkPos, Direction.NORTH, SIZE);
this.searchPositions = SEARCH_POSITIONS;
this.buildStructure();
}
@Override
public List<BlockPos> findInChunk() {
List<BlockPos> result = super.findInChunk();
result.forEach(pos -> {
this.renderers.add(new Cuboid(pos, SIZE, new Vector4f(0.1f, 0.4f, 0.0f, 1.0f)));
});
return result;
}
private void buildStructure() {
BlockState northFrame = Blocks.END_PORTAL_FRAME.getDefaultState().with(EndPortalFrameBlock.FACING, Direction.NORTH);
BlockState southFrame = Blocks.END_PORTAL_FRAME.getDefaultState().with(EndPortalFrameBlock.FACING, Direction.SOUTH);
BlockState eastFrame = Blocks.END_PORTAL_FRAME.getDefaultState().with(EndPortalFrameBlock.FACING, Direction.EAST);
BlockState westFrame = Blocks.END_PORTAL_FRAME.getDefaultState().with(EndPortalFrameBlock.FACING, Direction.WEST);
this.addBlock(northFrame, 1, 0, 0);
this.addBlock(northFrame, 2, 0, 0);
this.addBlock(northFrame, 3, 0, 0);
this.addBlock(southFrame, 1, 0, 4);
this.addBlock(southFrame, 2, 0, 4);
this.addBlock(southFrame, 3, 0, 4);
this.addBlock(eastFrame, 0, 0, 1);
this.addBlock(eastFrame, 0, 0, 2);
this.addBlock(eastFrame, 0, 0, 3);
this.addBlock(westFrame, 4, 0, 1);
this.addBlock(westFrame, 4, 0, 2);
this.addBlock(westFrame, 4, 0, 3);
}
@Override
public boolean isValidDimension(DimensionType dimension) {
return dimension == DimensionType.OVERWORLD;
}
public static List<Finder> create(World world, ChunkPos chunkPos) {
List<Finder> finders = new ArrayList<>();
finders.add(new PortalRoomFinder(world, chunkPos));
finders.add(new PortalRoomFinder(world, new ChunkPos(chunkPos.x - 1, chunkPos.z)));
finders.add(new PortalRoomFinder(world, new ChunkPos(chunkPos.x, chunkPos.z - 1)));
finders.add(new PortalRoomFinder(world, new ChunkPos(chunkPos.x - 1, chunkPos.z - 1)));
finders.add(new PortalRoomFinder(world, new ChunkPos(chunkPos.x + 1, chunkPos.z)));
finders.add(new PortalRoomFinder(world, new ChunkPos(chunkPos.x, chunkPos.z + 1)));
finders.add(new PortalRoomFinder(world, new ChunkPos(chunkPos.x + 1, chunkPos.z + 1)));
finders.add(new PortalRoomFinder(world, new ChunkPos(chunkPos.x - 1, chunkPos.z - 1)));
finders.add(new PortalRoomFinder(world, new ChunkPos(chunkPos.x - 1, chunkPos.z + 1)));
return finders;
}
}