Rename and cleanup
This commit is contained in:
parent
37cd89d3f2
commit
581c04c4a2
8 changed files with 15 additions and 26 deletions
|
@ -5,12 +5,10 @@ import java.util.Random;
|
|||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.NetherPortalBlock;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.sound.SoundCategory;
|
||||
|
@ -21,7 +19,6 @@ import net.minecraft.util.registry.Registry;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
|
||||
import ru.betterend.client.render.ERenderLayer;
|
||||
import ru.betterend.interfaces.IRenderTypeable;
|
||||
import ru.betterend.interfaces.TeleportingEntity;
|
||||
|
|
|
@ -23,7 +23,6 @@ import net.minecraft.world.BlockView;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
import net.minecraft.world.explosion.Explosion;
|
||||
|
||||
import ru.betterend.blocks.basis.BlockPedestal;
|
||||
import ru.betterend.blocks.entities.PedestalBlockEntity;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
package ru.betterend.blocks;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.state.StateManager;
|
||||
import net.minecraft.state.property.BooleanProperty;
|
||||
|
||||
import ru.betterend.blocks.basis.BlockBase;
|
||||
import ru.betterend.registry.EndBlocks;
|
||||
|
||||
|
|
|
@ -8,7 +8,6 @@ import java.util.Map;
|
|||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockEntityProvider;
|
||||
import net.minecraft.block.BlockState;
|
||||
|
@ -34,7 +33,6 @@ import net.minecraft.util.shape.VoxelShapes;
|
|||
import net.minecraft.world.BlockView;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldAccess;
|
||||
|
||||
import ru.betterend.blocks.BlockProperties;
|
||||
import ru.betterend.blocks.BlockProperties.PedestalState;
|
||||
import ru.betterend.blocks.entities.PedestalBlockEntity;
|
||||
|
|
|
@ -10,7 +10,6 @@ import net.minecraft.network.packet.s2c.play.BlockEntityUpdateS2CPacket;
|
|||
import net.minecraft.util.Tickable;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import ru.betterend.registry.EndBlockEntities;
|
||||
import ru.betterend.util.EternalRitual;
|
||||
|
||||
|
|
|
@ -9,7 +9,6 @@ import net.minecraft.util.Identifier;
|
|||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.gen.GenerationStep;
|
||||
import net.minecraft.world.gen.feature.ConfiguredFeature;
|
||||
|
||||
import ru.betterend.world.features.BlueVineFeature;
|
||||
import ru.betterend.world.features.CavePlantFeature;
|
||||
import ru.betterend.world.features.DoublePlantFeature;
|
||||
|
|
|
@ -22,7 +22,6 @@ import net.minecraft.world.Heightmap;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraft.world.gen.feature.ConfiguredFeatures;
|
||||
|
||||
import ru.betterend.blocks.BlockProperties;
|
||||
import ru.betterend.blocks.EndPortalBlock;
|
||||
import ru.betterend.blocks.RunedFlavolite;
|
||||
|
@ -31,20 +30,20 @@ import ru.betterend.registry.EndBlocks;
|
|||
import ru.betterend.registry.EndTags;
|
||||
|
||||
public class EternalRitual {
|
||||
private final static Set<Point> structureMap = Sets.newHashSet(
|
||||
private final static Set<Point> STRUCTURE_MAP = Sets.newHashSet(
|
||||
new Point(-4, -5), new Point(-4, 5), new Point(-6, 0),
|
||||
new Point(4, -5), new Point(4, 5), new Point(6, 0));
|
||||
private final static Set<Point> frameMap = Sets.newHashSet(
|
||||
private final static Set<Point> FRAME_MAP = Sets.newHashSet(
|
||||
new Point(0, 0), new Point(0, 6), new Point(1, 0),
|
||||
new Point(1, 6), new Point(2, 1), new Point(2, 5),
|
||||
new Point(3, 2), new Point(3, 3), new Point(3, 4));
|
||||
private final static Set<Point> portalMap = Sets.newHashSet(
|
||||
private final static Set<Point> PORTAL_MAP = Sets.newHashSet(
|
||||
new Point(0, 0), new Point(0, 1), new Point(0, 2),
|
||||
new Point(0, 3), new Point(0, 4), new Point(1, 0),
|
||||
new Point(1, 1), new Point(1, 2), new Point(1, 3),
|
||||
new Point(1, 4), new Point(2, 1), new Point(2, 2),
|
||||
new Point(2, 3));
|
||||
private final static Set<Point> baseMap = Sets.newHashSet(
|
||||
private final static Set<Point> BASE_MAP = Sets.newHashSet(
|
||||
new Point(3, 0), new Point(2, 0), new Point(2, 1), new Point(1, 1),
|
||||
new Point(1, 2), new Point(0, 1), new Point(0, 2));
|
||||
|
||||
|
@ -93,7 +92,7 @@ public class EternalRitual {
|
|||
moveY = Direction.EAST;
|
||||
}
|
||||
boolean valid = this.checkFrame();
|
||||
for (Point pos : structureMap) {
|
||||
for (Point pos : STRUCTURE_MAP) {
|
||||
BlockPos.Mutable checkPos = center.mutableCopy();
|
||||
checkPos.move(moveX, pos.x).move(moveY, pos.y);
|
||||
valid &= this.isActive(checkPos);
|
||||
|
@ -107,7 +106,7 @@ public class EternalRitual {
|
|||
BlockPos framePos = center.down();
|
||||
Direction moveDir = Direction.Axis.X == axis ? Direction.NORTH: Direction.EAST;
|
||||
boolean valid = true;
|
||||
for (Point point : frameMap) {
|
||||
for (Point point : FRAME_MAP) {
|
||||
BlockPos pos = framePos.offset(moveDir, point.x).offset(Direction.UP, point.y);
|
||||
BlockState state = world.getBlockState(pos);
|
||||
valid &= state.getBlock() instanceof RunedFlavolite;
|
||||
|
@ -138,7 +137,7 @@ public class EternalRitual {
|
|||
BlockPos framePos = center.down();
|
||||
Direction moveDir = Direction.Axis.X == axis ? Direction.NORTH: Direction.EAST;
|
||||
BlockState frame = FRAME.getDefaultState().with(ACTIVE, true);
|
||||
frameMap.forEach(point -> {
|
||||
FRAME_MAP.forEach(point -> {
|
||||
BlockPos pos = framePos.offset(moveDir, point.x).offset(Direction.UP, point.y);
|
||||
BlockState state = world.getBlockState(pos);
|
||||
if (state.contains(ACTIVE) && !state.get(ACTIVE)) {
|
||||
|
@ -152,7 +151,7 @@ public class EternalRitual {
|
|||
});
|
||||
Direction.Axis portalAxis = Direction.Axis.X == axis ? Direction.Axis.Z : Direction.Axis.X;
|
||||
BlockState portal = PORTAL.getDefaultState().with(EndPortalBlock.AXIS, portalAxis);
|
||||
portalMap.forEach(point -> {
|
||||
PORTAL_MAP.forEach(point -> {
|
||||
BlockPos pos = center.offset(moveDir, point.x).offset(Direction.UP, point.y);
|
||||
if (!world.getBlockState(pos).isOf(PORTAL)) {
|
||||
world.setBlockState(pos, portal);
|
||||
|
@ -174,7 +173,7 @@ public class EternalRitual {
|
|||
private void removePortal(World world, BlockPos center) {
|
||||
BlockPos framePos = center.down();
|
||||
Direction moveDir = Direction.Axis.X == axis ? Direction.NORTH: Direction.EAST;
|
||||
frameMap.forEach(point -> {
|
||||
FRAME_MAP.forEach(point -> {
|
||||
BlockPos pos = framePos.offset(moveDir, point.x).offset(Direction.UP, point.y);
|
||||
BlockState state = world.getBlockState(pos);
|
||||
if (state.isOf(FRAME) && state.get(ACTIVE)) {
|
||||
|
@ -186,7 +185,7 @@ public class EternalRitual {
|
|||
world.setBlockState(pos, state.with(ACTIVE, false));
|
||||
}
|
||||
});
|
||||
portalMap.forEach(point -> {
|
||||
PORTAL_MAP.forEach(point -> {
|
||||
BlockPos pos = center.offset(moveDir, point.x).offset(Direction.UP, point.y);
|
||||
if (world.getBlockState(pos).isOf(PORTAL)) {
|
||||
world.removeBlock(pos, false);
|
||||
|
@ -292,14 +291,14 @@ public class EternalRitual {
|
|||
BlockPos framePos = center.down();
|
||||
Direction moveDir = Direction.Axis.X == axis ? Direction.EAST: Direction.NORTH;
|
||||
BlockState frame = FRAME.getDefaultState().with(ACTIVE, true);
|
||||
frameMap.forEach(point -> {
|
||||
FRAME_MAP.forEach(point -> {
|
||||
BlockPos pos = framePos.offset(moveDir, point.x).offset(Direction.UP, point.y);
|
||||
world.setBlockState(pos, frame);
|
||||
pos = framePos.offset(moveDir, -point.x).offset(Direction.UP, point.y);
|
||||
world.setBlockState(pos, frame);
|
||||
});
|
||||
BlockState portal = PORTAL.getDefaultState().with(EndPortalBlock.AXIS, axis);
|
||||
portalMap.forEach(point -> {
|
||||
PORTAL_MAP.forEach(point -> {
|
||||
BlockPos pos = center.offset(moveDir, point.x).offset(Direction.UP, point.y);
|
||||
world.setBlockState(pos, portal);
|
||||
pos = center.offset(moveDir, -point.x).offset(Direction.UP, point.y);
|
||||
|
@ -311,7 +310,7 @@ public class EternalRitual {
|
|||
private static void generateBase(World world, BlockPos center, Direction moveX) {
|
||||
BlockState base = BASE.getDefaultState();
|
||||
Direction moveY = moveX.rotateYClockwise();
|
||||
baseMap.forEach(point -> {
|
||||
BASE_MAP.forEach(point -> {
|
||||
BlockPos pos = center.offset(moveX, point.x).offset(moveY, point.y);
|
||||
world.setBlockState(pos, base);
|
||||
pos = center.offset(moveX, -point.x).offset(moveY, point.y);
|
||||
|
@ -327,7 +326,7 @@ public class EternalRitual {
|
|||
Direction moveDir = Direction.Axis.X == axis ? Direction.NORTH: Direction.EAST;
|
||||
for (BlockPos checkPos : BlockPos.iterate(center.offset(moveDir.rotateYClockwise()),
|
||||
center.offset(moveDir.rotateYCounterclockwise()))) {
|
||||
for (Point point : portalMap) {
|
||||
for (Point point : PORTAL_MAP) {
|
||||
BlockPos pos = checkPos.offset(moveDir, point.x).offset(Direction.UP, point.y);
|
||||
if (!world.getBlockState(pos).isAir()) return false;
|
||||
pos = checkPos.offset(moveDir, -point.x).offset(Direction.UP, point.y);
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package ru.betterend.world.processors;
|
||||
|
||||
import net.minecraft.structure.Structure.StructureBlockInfo;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.structure.Structure.StructureBlockInfo;
|
||||
import net.minecraft.structure.StructurePlacementData;
|
||||
import net.minecraft.structure.processor.StructureProcessor;
|
||||
import net.minecraft.structure.processor.StructureProcessorType;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue