Reformatted Code

This commit is contained in:
Frank 2023-12-19 21:02:54 +01:00
parent 2b21b0472f
commit b95e3ccdef
10 changed files with 21 additions and 16 deletions

View file

@ -1,6 +1,5 @@
package org.betterx.betterend.client; package org.betterx.betterend.client;
import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.client.render.BetterEndSkyRenderer; import org.betterx.betterend.client.render.BetterEndSkyRenderer;
import org.betterx.betterend.events.ItemTooltipCallback; import org.betterx.betterend.events.ItemTooltipCallback;
import org.betterx.betterend.interfaces.MultiModelItem; import org.betterx.betterend.interfaces.MultiModelItem;

View file

@ -1,6 +1,5 @@
package org.betterx.betterend.entity.model; package org.betterx.betterend.entity.model;
import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.entity.SilkMothEntity; import org.betterx.betterend.entity.SilkMothEntity;
import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.blaze3d.vertex.PoseStack;

View file

@ -10,13 +10,13 @@ import org.betterx.worlds.together.tag.v3.CommonBlockTags;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.BlockPos.MutableBlockPos; import net.minecraft.core.BlockPos.MutableBlockPos;
import net.minecraft.core.Direction;
import net.minecraft.util.RandomSource; import net.minecraft.util.RandomSource;
import net.minecraft.world.level.WorldGenLevel; import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.BlockStateProperties; import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.core.Direction;
import net.minecraft.world.level.material.Fluids; import net.minecraft.world.level.material.Fluids;
public class SmaragdantCrystalFeature extends DefaultFeature { public class SmaragdantCrystalFeature extends DefaultFeature {
@ -56,10 +56,17 @@ public class SmaragdantCrystalFeature extends DefaultFeature {
BlockState sideState = world.getBlockState(sidePos); BlockState sideState = world.getBlockState(sidePos);
if (BuddingSmaragdantCrystalBlock.canShardGrowAtState(sideState)) { if (BuddingSmaragdantCrystalBlock.canShardGrowAtState(sideState)) {
if (random.nextBoolean()) { if (random.nextBoolean()) {
BlockState attachedShard = EndBlocks.SMARAGDANT_CRYSTAL_SHARD.defaultBlockState() BlockState attachedShard = EndBlocks.SMARAGDANT_CRYSTAL_SHARD
.setValue(SmaragdantCrystalShardBlock.WATERLOGGED, .defaultBlockState()
sideState.getFluidState().getType() == Fluids.WATER) .setValue(
.setValue(SmaragdantCrystalShardBlock.FACING, k); SmaragdantCrystalShardBlock.WATERLOGGED,
sideState.getFluidState()
.getType() == Fluids.WATER
)
.setValue(
SmaragdantCrystalShardBlock.FACING,
k
);
BlocksHelper.setWithoutUpdate(world, sidePos, attachedShard); BlocksHelper.setWithoutUpdate(world, sidePos, attachedShard);
} }
} }

View file

@ -38,7 +38,7 @@ public class StalactiteFeature extends Feature<StalactiteFeatureConfig> {
for (int i = 1; i <= height; i++) { for (int i = 1; i <= height; i++) {
mut.setY(pos.getY() + i * dir); mut.setY(pos.getY() + i * dir);
BlockState state = world.getBlockState(mut); BlockState state = world.getBlockState(mut);
if (!state.canBeReplaced()){ if (!state.canBeReplaced()) {
stalagnate = state.is(CommonBlockTags.GEN_END_STONES); stalagnate = state.is(CommonBlockTags.GEN_END_STONES);
height = i; height = i;
break; break;

View file

@ -63,7 +63,7 @@ public class SulphurHillFeature extends DefaultFeature {
int d = x2 + z2; int d = x2 + z2;
mut.setY(pos.getY()); mut.setY(pos.getY());
BlockState state = world.getBlockState(mut); BlockState state = world.getBlockState(mut);
if (state.canBeReplaced() || state.is(EndBlocks.HYDROTHERMAL_VENT)){ if (state.canBeReplaced() || state.is(EndBlocks.HYDROTHERMAL_VENT)) {
if (d < r2 * r2) { if (d < r2 * r2) {
BlocksHelper.setWithoutUpdate(world, mut, Blocks.WATER); BlocksHelper.setWithoutUpdate(world, mut, Blocks.WATER);
mut.move(Direction.DOWN); mut.move(Direction.DOWN);
@ -76,7 +76,7 @@ public class SulphurHillFeature extends DefaultFeature {
state = world.getBlockState(mut); state = world.getBlockState(mut);
int maxIt = MHelper.floor(10 - Math.sqrt(d)) + random.nextInt(1); int maxIt = MHelper.floor(10 - Math.sqrt(d)) + random.nextInt(1);
for (int i = 0; i < maxIt && state.canBeReplaced(); for (int i = 0; i < maxIt && state.canBeReplaced();
i++){ i++) {
BlocksHelper.setWithoutUpdate(world, mut, rock); BlocksHelper.setWithoutUpdate(world, mut, rock);
mut.move(Direction.DOWN); mut.move(Direction.DOWN);
} }
@ -86,7 +86,7 @@ public class SulphurHillFeature extends DefaultFeature {
state = world.getBlockState(mut); state = world.getBlockState(mut);
int maxIt = MHelper.floor(10 - Math.sqrt(d)) + random.nextInt(1); int maxIt = MHelper.floor(10 - Math.sqrt(d)) + random.nextInt(1);
for (int i = 0; i < maxIt && state.canBeReplaced(); for (int i = 0; i < maxIt && state.canBeReplaced();
i++){ i++) {
BlocksHelper.setWithoutUpdate(world, mut, rock); BlocksHelper.setWithoutUpdate(world, mut, rock);
mut.move(Direction.DOWN); mut.move(Direction.DOWN);
} }

View file

@ -80,7 +80,7 @@ public class CavePiece extends BasePiece {
BlocksHelper.setWithoutUpdate(world, pos, CAVE_AIR); BlocksHelper.setWithoutUpdate(world, pos, CAVE_AIR);
} }
} else if (dist < r * r) { } else if (dist < r * r) {
if (world.getBlockState(pos).canBeReplaced()){ if (world.getBlockState(pos).canBeReplaced()) {
BlocksHelper.setWithoutUpdate(world, pos, Blocks.END_STONE); BlocksHelper.setWithoutUpdate(world, pos, Blocks.END_STONE);
} }
} }