New sounds, registry rename

This commit is contained in:
paulevsGitch 2020-10-27 03:16:55 +03:00
parent c609f98ec2
commit 1c03ecb5e3
105 changed files with 1449 additions and 1447 deletions

View file

@ -11,16 +11,15 @@ import ru.betterend.recipe.AlloyingRecipes;
import ru.betterend.recipe.CraftingRecipes; import ru.betterend.recipe.CraftingRecipes;
import ru.betterend.recipe.SmeltigRecipes; import ru.betterend.recipe.SmeltigRecipes;
import ru.betterend.recipe.SmithingRecipes; import ru.betterend.recipe.SmithingRecipes;
import ru.betterend.registry.BiomeRegistry; import ru.betterend.registry.EndBiomes;
import ru.betterend.registry.BlockEntityRegistry; import ru.betterend.registry.EndBlockEntities;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.BlockTagRegistry; import ru.betterend.registry.EndEntities;
import ru.betterend.registry.EntityRegistry; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.FeatureRegistry; import ru.betterend.registry.EndItems;
import ru.betterend.registry.ItemRegistry; import ru.betterend.registry.EndSounds;
import ru.betterend.registry.ItemTagRegistry; import ru.betterend.registry.EndStructures;
import ru.betterend.registry.SoundRegistry; import ru.betterend.registry.EndTags;
import ru.betterend.registry.StructureRegistry;
import ru.betterend.util.Logger; import ru.betterend.util.Logger;
import ru.betterend.util.TranslationHelper; import ru.betterend.util.TranslationHelper;
import ru.betterend.world.generator.BetterEndBiomeSource; import ru.betterend.world.generator.BetterEndBiomeSource;
@ -32,23 +31,22 @@ public class BetterEnd implements ModInitializer {
@Override @Override
public void onInitialize() { public void onInitialize() {
SoundRegistry.register(); EndSounds.register();
ItemRegistry.register(); EndItems.register();
BlockRegistry.register(); EndBlocks.register();
BlockEntityRegistry.register(); EndBlockEntities.register();
FeatureRegistry.register(); EndFeatures.register();
EntityRegistry.register(); EndEntities.register();
BiomeRegistry.register(); EndBiomes.register();
BetterEndBiomeSource.register(); BetterEndBiomeSource.register();
ItemTagRegistry.register(); EndTags.register();
BlockTagRegistry.register();
EndEnchantments.register(); EndEnchantments.register();
EndPotions.register(); EndPotions.register();
CraftingRecipes.register(); CraftingRecipes.register();
SmeltigRecipes.register(); SmeltigRecipes.register();
AlloyingRecipes.register(); AlloyingRecipes.register();
SmithingRecipes.register(); SmithingRecipes.register();
StructureRegistry.register(); EndStructures.register();
FabricLoader.getInstance().getEntrypoints("betterend", BetterEndPlugin.class).forEach(BetterEndPlugin::register); FabricLoader.getInstance().getEntrypoints("betterend", BetterEndPlugin.class).forEach(BetterEndPlugin::register);

View file

@ -22,7 +22,7 @@ import net.minecraft.util.math.Vec3i;
import ru.betterend.client.ERenderLayer; import ru.betterend.client.ERenderLayer;
import ru.betterend.client.IRenderTypeable; import ru.betterend.client.IRenderTypeable;
import ru.betterend.interfaces.IColorProvider; import ru.betterend.interfaces.IColorProvider;
import ru.betterend.registry.ItemRegistry; import ru.betterend.registry.EndItems;
import ru.betterend.util.MHelper; import ru.betterend.util.MHelper;
public class AuroraCrystalBlock extends AbstractGlassBlock implements IRenderTypeable, IColorProvider { public class AuroraCrystalBlock extends AbstractGlassBlock implements IRenderTypeable, IColorProvider {
@ -88,13 +88,13 @@ public class AuroraCrystalBlock extends AbstractGlassBlock implements IRenderTyp
int min = MathHelper.clamp(MIN_DROP + enchant, MIN_DROP, MAX_DROP); int min = MathHelper.clamp(MIN_DROP + enchant, MIN_DROP, MAX_DROP);
int max = MAX_DROP + (enchant / Enchantments.FORTUNE.getMaxLevel()); int max = MAX_DROP + (enchant / Enchantments.FORTUNE.getMaxLevel());
if (min == max) { if (min == max) {
return Lists.newArrayList(new ItemStack(ItemRegistry.CRYSTAL_SHARDS, max)); return Lists.newArrayList(new ItemStack(EndItems.CRYSTAL_SHARDS, max));
} }
count = MHelper.randRange(min, max, MHelper.RANDOM); count = MHelper.randRange(min, max, MHelper.RANDOM);
} else { } else {
count = MHelper.randRange(MIN_DROP, MAX_DROP, MHelper.RANDOM); count = MHelper.randRange(MIN_DROP, MAX_DROP, MHelper.RANDOM);
} }
return Lists.newArrayList(new ItemStack(ItemRegistry.CRYSTAL_SHARDS, count)); return Lists.newArrayList(new ItemStack(EndItems.CRYSTAL_SHARDS, count));
} }
return Lists.newArrayList(); return Lists.newArrayList();
} }

View file

@ -6,7 +6,7 @@ import net.minecraft.state.StateManager;
import net.minecraft.state.property.EnumProperty; import net.minecraft.state.property.EnumProperty;
import ru.betterend.blocks.BlockProperties.TripleShape; import ru.betterend.blocks.BlockProperties.TripleShape;
import ru.betterend.blocks.basis.BlockUpDownPlant; import ru.betterend.blocks.basis.BlockUpDownPlant;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
public class BlockBlueVine extends BlockUpDownPlant { public class BlockBlueVine extends BlockUpDownPlant {
public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE; public static final EnumProperty<TripleShape> SHAPE = BlockProperties.TRIPLE_SHAPE;
@ -18,6 +18,6 @@ public class BlockBlueVine extends BlockUpDownPlant {
@Override @Override
protected boolean isTerrain(BlockState state) { protected boolean isTerrain(BlockState state) {
return state.getBlock() == BlockRegistry.END_MOSS || state.getBlock() == BlockRegistry.END_MYCELIUM; return state.getBlock() == EndBlocks.END_MOSS || state.getBlock() == EndBlocks.END_MYCELIUM;
} }
} }

View file

@ -14,7 +14,7 @@ import net.minecraft.util.math.Direction;
import net.minecraft.world.WorldAccess; import net.minecraft.world.WorldAccess;
import net.minecraft.world.WorldView; import net.minecraft.world.WorldView;
import ru.betterend.blocks.basis.BlockBase; import ru.betterend.blocks.basis.BlockBase;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
public class BlockBlueVineLantern extends BlockBase { public class BlockBlueVineLantern extends BlockBase {
public static final BooleanProperty NATURAL = BooleanProperty.of("natural"); public static final BooleanProperty NATURAL = BooleanProperty.of("natural");
@ -26,7 +26,7 @@ public class BlockBlueVineLantern extends BlockBase {
@Override @Override
public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) { public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) {
return state.get(NATURAL) ? world.getBlockState(pos.down()).getBlock() == BlockRegistry.BLUE_VINE : true; return state.get(NATURAL) ? world.getBlockState(pos.down()).getBlock() == EndBlocks.BLUE_VINE : true;
} }
@Override @Override

View file

@ -9,7 +9,7 @@ import net.minecraft.world.StructureWorldAccess;
import ru.betterend.blocks.BlockProperties.TripleShape; import ru.betterend.blocks.BlockProperties.TripleShape;
import ru.betterend.blocks.basis.BlockGlowingFur; import ru.betterend.blocks.basis.BlockGlowingFur;
import ru.betterend.blocks.basis.BlockPlantWithAge; import ru.betterend.blocks.basis.BlockPlantWithAge;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
import ru.betterend.util.MHelper; import ru.betterend.util.MHelper;
@ -21,29 +21,29 @@ public class BlockBlueVineSeed extends BlockPlantWithAge {
if (h < height + 1) { if (h < height + 1) {
return; return;
} }
BlocksHelper.setWithoutUpdate(world, pos, BlockRegistry.BLUE_VINE.getDefaultState().with(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM)); BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.BLUE_VINE.getDefaultState().with(BlockProperties.TRIPLE_SHAPE, TripleShape.BOTTOM));
for (int i = 1; i < height; i++) { for (int i = 1; i < height; i++) {
BlocksHelper.setWithoutUpdate(world, pos.up(i), BlockRegistry.BLUE_VINE.getDefaultState().with(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE)); BlocksHelper.setWithoutUpdate(world, pos.up(i), EndBlocks.BLUE_VINE.getDefaultState().with(BlockProperties.TRIPLE_SHAPE, TripleShape.MIDDLE));
} }
BlocksHelper.setWithoutUpdate(world, pos.up(height), BlockRegistry.BLUE_VINE.getDefaultState().with(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP)); BlocksHelper.setWithoutUpdate(world, pos.up(height), EndBlocks.BLUE_VINE.getDefaultState().with(BlockProperties.TRIPLE_SHAPE, TripleShape.TOP));
placeLantern(world, pos.up(height + 1)); placeLantern(world, pos.up(height + 1));
} }
private void placeLantern(StructureWorldAccess world, BlockPos pos) { private void placeLantern(StructureWorldAccess world, BlockPos pos) {
BlocksHelper.setWithoutUpdate(world, pos, BlockRegistry.BLUE_VINE_LANTERN.getDefaultState().with(BlockBlueVineLantern.NATURAL, true)); BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.BLUE_VINE_LANTERN.getDefaultState().with(BlockBlueVineLantern.NATURAL, true));
for (Direction dir: BlocksHelper.HORIZONTAL) { for (Direction dir: BlocksHelper.HORIZONTAL) {
BlockPos p = pos.offset(dir); BlockPos p = pos.offset(dir);
if (world.isAir(p)) { if (world.isAir(p)) {
BlocksHelper.setWithoutUpdate(world, p, BlockRegistry.BLUE_VINE_FUR.getDefaultState().with(BlockGlowingFur.FACING, dir)); BlocksHelper.setWithoutUpdate(world, p, EndBlocks.BLUE_VINE_FUR.getDefaultState().with(BlockGlowingFur.FACING, dir));
} }
} }
if (world.isAir(pos.up())) { if (world.isAir(pos.up())) {
BlocksHelper.setWithoutUpdate(world, pos.up(), BlockRegistry.BLUE_VINE_FUR.getDefaultState().with(BlockGlowingFur.FACING, Direction.UP)); BlocksHelper.setWithoutUpdate(world, pos.up(), EndBlocks.BLUE_VINE_FUR.getDefaultState().with(BlockGlowingFur.FACING, Direction.UP));
} }
} }
@Override @Override
protected boolean isTerrain(BlockState state) { protected boolean isTerrain(BlockState state) {
return state.getBlock() == BlockRegistry.END_MOSS || state.getBlock() == BlockRegistry.END_MYCELIUM; return state.getBlock() == EndBlocks.END_MOSS || state.getBlock() == EndBlocks.END_MYCELIUM;
} }
} }

View file

@ -2,7 +2,7 @@ package ru.betterend.blocks;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import ru.betterend.blocks.basis.BlockPlant; import ru.betterend.blocks.basis.BlockPlant;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
public class BlockChorusGrass extends BlockPlant { public class BlockChorusGrass extends BlockPlant {
public BlockChorusGrass() { public BlockChorusGrass() {
@ -11,6 +11,6 @@ public class BlockChorusGrass extends BlockPlant {
@Override @Override
protected boolean isTerrain(BlockState state) { protected boolean isTerrain(BlockState state) {
return state.getBlock() == BlockRegistry.CHORUS_NYLIUM; return state.getBlock() == EndBlocks.CHORUS_NYLIUM;
} }
} }

View file

@ -28,8 +28,8 @@ import net.minecraft.world.WorldAccess;
import net.minecraft.world.WorldView; import net.minecraft.world.WorldView;
import ru.betterend.blocks.BlockProperties.TripleShape; import ru.betterend.blocks.BlockProperties.TripleShape;
import ru.betterend.blocks.basis.BlockUnderwaterPlant; import ru.betterend.blocks.basis.BlockUnderwaterPlant;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.ItemRegistry; import ru.betterend.registry.EndItems;
import ru.betterend.util.MHelper; import ru.betterend.util.MHelper;
public class BlockEndLily extends BlockUnderwaterPlant { public class BlockEndLily extends BlockUnderwaterPlant {
@ -91,7 +91,7 @@ public class BlockEndLily extends BlockUnderwaterPlant {
@Override @Override
public List<ItemStack> getDroppedStacks(BlockState state, LootContext.Builder builder) { public List<ItemStack> getDroppedStacks(BlockState state, LootContext.Builder builder) {
if (state.get(SHAPE) == TripleShape.TOP) { if (state.get(SHAPE) == TripleShape.TOP) {
return Lists.newArrayList(new ItemStack(ItemRegistry.END_LILY_LEAF, MHelper.randRange(1, 2, MHelper.RANDOM)), new ItemStack(BlockRegistry.END_LILY_SEED, MHelper.randRange(1, 2, MHelper.RANDOM))); return Lists.newArrayList(new ItemStack(EndItems.END_LILY_LEAF, MHelper.randRange(1, 2, MHelper.RANDOM)), new ItemStack(EndBlocks.END_LILY_SEED, MHelper.randRange(1, 2, MHelper.RANDOM)));
} }
return Collections.emptyList(); return Collections.emptyList();
} }

View file

@ -7,20 +7,20 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.StructureWorldAccess; import net.minecraft.world.StructureWorldAccess;
import ru.betterend.blocks.BlockProperties.TripleShape; import ru.betterend.blocks.BlockProperties.TripleShape;
import ru.betterend.blocks.basis.BlockUnderwaterPlantWithAge; import ru.betterend.blocks.basis.BlockUnderwaterPlantWithAge;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
public class BlockEndLilySeed extends BlockUnderwaterPlantWithAge { public class BlockEndLilySeed extends BlockUnderwaterPlantWithAge {
@Override @Override
public void grow(StructureWorldAccess world, Random random, BlockPos pos) { public void grow(StructureWorldAccess world, Random random, BlockPos pos) {
if (canGrow(world, pos)) { if (canGrow(world, pos)) {
BlocksHelper.setWithoutUpdate(world, pos, BlockRegistry.END_LILY.getDefaultState().with(BlockEndLily.SHAPE, TripleShape.BOTTOM)); BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.END_LILY.getDefaultState().with(BlockEndLily.SHAPE, TripleShape.BOTTOM));
BlockPos up = pos.up(); BlockPos up = pos.up();
while (world.getFluidState(up).isStill()) { while (world.getFluidState(up).isStill()) {
BlocksHelper.setWithoutUpdate(world, up, BlockRegistry.END_LILY.getDefaultState().with(BlockEndLily.SHAPE, TripleShape.MIDDLE)); BlocksHelper.setWithoutUpdate(world, up, EndBlocks.END_LILY.getDefaultState().with(BlockEndLily.SHAPE, TripleShape.MIDDLE));
up = up.up(); up = up.up();
} }
BlocksHelper.setWithoutUpdate(world, up, BlockRegistry.END_LILY.getDefaultState().with(BlockEndLily.SHAPE, TripleShape.TOP)); BlocksHelper.setWithoutUpdate(world, up, EndBlocks.END_LILY.getDefaultState().with(BlockEndLily.SHAPE, TripleShape.TOP));
} }
} }

View file

@ -16,7 +16,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.shape.VoxelShape; import net.minecraft.util.shape.VoxelShape;
import net.minecraft.world.BlockView; import net.minecraft.world.BlockView;
import ru.betterend.blocks.basis.BlockPlant; import ru.betterend.blocks.basis.BlockPlant;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.util.MHelper; import ru.betterend.util.MHelper;
public class BlockEndLotusFlower extends BlockPlant { public class BlockEndLotusFlower extends BlockPlant {
@ -29,7 +29,7 @@ public class BlockEndLotusFlower extends BlockPlant {
@Override @Override
protected boolean isTerrain(BlockState state) { protected boolean isTerrain(BlockState state) {
return state.isOf(BlockRegistry.END_LOTUS_STEM); return state.isOf(EndBlocks.END_LOTUS_STEM);
} }
@Override @Override
@ -50,6 +50,6 @@ public class BlockEndLotusFlower extends BlockPlant {
@Override @Override
public List<ItemStack> getDroppedStacks(BlockState state, LootContext.Builder builder) { public List<ItemStack> getDroppedStacks(BlockState state, LootContext.Builder builder) {
int count = MHelper.randRange(1, 2, MHelper.RANDOM); int count = MHelper.randRange(1, 2, MHelper.RANDOM);
return Lists.newArrayList(new ItemStack(BlockRegistry.END_LOTUS_SEED, count)); return Lists.newArrayList(new ItemStack(EndBlocks.END_LOTUS_SEED, count));
} }
} }

View file

@ -10,17 +10,17 @@ import net.minecraft.util.math.Direction;
import net.minecraft.world.StructureWorldAccess; import net.minecraft.world.StructureWorldAccess;
import ru.betterend.blocks.BlockProperties.TripleShape; import ru.betterend.blocks.BlockProperties.TripleShape;
import ru.betterend.blocks.basis.BlockUnderwaterPlantWithAge; import ru.betterend.blocks.basis.BlockUnderwaterPlantWithAge;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
public class BlockEndLotusSeed extends BlockUnderwaterPlantWithAge { public class BlockEndLotusSeed extends BlockUnderwaterPlantWithAge {
@Override @Override
public void grow(StructureWorldAccess world, Random random, BlockPos pos) { public void grow(StructureWorldAccess world, Random random, BlockPos pos) {
if (canGrow(world, pos)) { if (canGrow(world, pos)) {
BlockState startLeaf = BlockRegistry.END_LOTUS_STEM.getDefaultState().with(BlockEndLotusStem.LEAF, true); BlockState startLeaf = EndBlocks.END_LOTUS_STEM.getDefaultState().with(BlockEndLotusStem.LEAF, true);
BlockState roots = BlockRegistry.END_LOTUS_STEM.getDefaultState().with(BlockEndLotusStem.SHAPE, TripleShape.BOTTOM).with(BlockEndLotusStem.WATERLOGGED, true); BlockState roots = EndBlocks.END_LOTUS_STEM.getDefaultState().with(BlockEndLotusStem.SHAPE, TripleShape.BOTTOM).with(BlockEndLotusStem.WATERLOGGED, true);
BlockState stem = BlockRegistry.END_LOTUS_STEM.getDefaultState(); BlockState stem = EndBlocks.END_LOTUS_STEM.getDefaultState();
BlockState flower = BlockRegistry.END_LOTUS_FLOWER.getDefaultState(); BlockState flower = EndBlocks.END_LOTUS_FLOWER.getDefaultState();
BlocksHelper.setWithoutUpdate(world, pos, roots); BlocksHelper.setWithoutUpdate(world, pos, roots);
Mutable bpos = new Mutable().set(pos); Mutable bpos = new Mutable().set(pos);
@ -63,14 +63,14 @@ public class BlockEndLotusSeed extends BlockUnderwaterPlantWithAge {
BlocksHelper.setWithoutUpdate(world, bpos, flower); BlocksHelper.setWithoutUpdate(world, bpos, flower);
bpos.setY(bpos.getY() - 1); bpos.setY(bpos.getY() - 1);
stem = world.getBlockState(bpos); stem = world.getBlockState(bpos);
if (!stem.isOf(BlockRegistry.END_LOTUS_STEM)) { if (!stem.isOf(EndBlocks.END_LOTUS_STEM)) {
stem = BlockRegistry.END_LOTUS_STEM.getDefaultState(); stem = EndBlocks.END_LOTUS_STEM.getDefaultState();
if (!world.getBlockState(bpos.north()).getFluidState().isEmpty()) { if (!world.getBlockState(bpos.north()).getFluidState().isEmpty()) {
stem = stem.with(BlockEndLotusStem.WATERLOGGED, true); stem = stem.with(BlockEndLotusStem.WATERLOGGED, true);
} }
} }
if (world.getBlockState(bpos.offset(dir)).isOf(BlockRegistry.END_LOTUS_LEAF)) { if (world.getBlockState(bpos.offset(dir)).isOf(EndBlocks.END_LOTUS_LEAF)) {
stem = stem.with(BlockEndLotusStem.LEAF, true).with(BlockEndLotusStem.FACING, dir); stem = stem.with(BlockEndLotusStem.LEAF, true).with(BlockEndLotusStem.FACING, dir);
} }
@ -89,7 +89,7 @@ public class BlockEndLotusSeed extends BlockUnderwaterPlantWithAge {
private void generateLeaf(StructureWorldAccess world, BlockPos pos) { private void generateLeaf(StructureWorldAccess world, BlockPos pos) {
Mutable p = new Mutable(); Mutable p = new Mutable();
BlockState leaf = BlockRegistry.END_LOTUS_LEAF.getDefaultState(); BlockState leaf = EndBlocks.END_LOTUS_LEAF.getDefaultState();
BlocksHelper.setWithoutUpdate(world, pos, leaf.with(BlockEndLotusLeaf.SHAPE, TripleShape.BOTTOM)); BlocksHelper.setWithoutUpdate(world, pos, leaf.with(BlockEndLotusLeaf.SHAPE, TripleShape.BOTTOM));
for (Direction move: BlocksHelper.HORIZONTAL) { for (Direction move: BlocksHelper.HORIZONTAL) {
BlocksHelper.setWithoutUpdate(world, p.set(pos).move(move), leaf.with(BlockEndLotusLeaf.HORIZONTAL_FACING, move).with(BlockEndLotusLeaf.SHAPE, TripleShape.MIDDLE)); BlocksHelper.setWithoutUpdate(world, p.set(pos).move(move), leaf.with(BlockEndLotusLeaf.HORIZONTAL_FACING, move).with(BlockEndLotusLeaf.SHAPE, TripleShape.MIDDLE));

View file

@ -6,7 +6,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.BlockView; import net.minecraft.world.BlockView;
import ru.betterend.blocks.basis.BlockPlant; import ru.betterend.blocks.basis.BlockPlant;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
public class BlockGlowingMoss extends BlockPlant { public class BlockGlowingMoss extends BlockPlant {
public BlockGlowingMoss(int light) { public BlockGlowingMoss(int light) {
@ -15,7 +15,7 @@ public class BlockGlowingMoss extends BlockPlant {
@Override @Override
protected boolean isTerrain(BlockState state) { protected boolean isTerrain(BlockState state) {
return state.getBlock() == BlockRegistry.END_MOSS || state.getBlock() == BlockRegistry.END_MYCELIUM; return state.getBlock() == EndBlocks.END_MOSS || state.getBlock() == EndBlocks.END_MYCELIUM;
} }
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)

View file

@ -9,7 +9,7 @@ import net.minecraft.item.ItemPlacementContext;
import net.minecraft.sound.BlockSoundGroup; import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.state.StateManager; import net.minecraft.state.StateManager;
import net.minecraft.state.property.BooleanProperty; import net.minecraft.state.property.BooleanProperty;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
public class BlockMossyGlowshroomCap extends Block { public class BlockMossyGlowshroomCap extends Block {
public static final BooleanProperty TRANSITION = BooleanProperty.of("transition"); public static final BooleanProperty TRANSITION = BooleanProperty.of("transition");
@ -20,7 +20,7 @@ public class BlockMossyGlowshroomCap extends Block {
} }
public BlockState getPlacementState(ItemPlacementContext ctx) { public BlockState getPlacementState(ItemPlacementContext ctx) {
return this.getDefaultState().with(TRANSITION, BlockRegistry.MOSSY_GLOWSHROOM.isTreeLog(ctx.getWorld().getBlockState(ctx.getBlockPos().down()))); return this.getDefaultState().with(TRANSITION, EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(ctx.getWorld().getBlockState(ctx.getBlockPos().down())));
} }
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) { protected void appendProperties(StateManager.Builder<Block, BlockState> builder) {

View file

@ -2,7 +2,7 @@ package ru.betterend.blocks;
import net.minecraft.world.gen.feature.Feature; import net.minecraft.world.gen.feature.Feature;
import ru.betterend.blocks.basis.BlockFeatureSapling; import ru.betterend.blocks.basis.BlockFeatureSapling;
import ru.betterend.registry.FeatureRegistry; import ru.betterend.registry.EndFeatures;
public class BlockMossyGlowshroomSapling extends BlockFeatureSapling { public class BlockMossyGlowshroomSapling extends BlockFeatureSapling {
public BlockMossyGlowshroomSapling() { public BlockMossyGlowshroomSapling() {
@ -11,6 +11,6 @@ public class BlockMossyGlowshroomSapling extends BlockFeatureSapling {
@Override @Override
protected Feature<?> getFeature() { protected Feature<?> getFeature() {
return FeatureRegistry.MOSSY_GLOWSHROOM.getFeature(); return EndFeatures.MOSSY_GLOWSHROOM.getFeature();
} }
} }

View file

@ -2,7 +2,7 @@ package ru.betterend.blocks;
import net.minecraft.world.gen.feature.Feature; import net.minecraft.world.gen.feature.Feature;
import ru.betterend.blocks.basis.BlockFeatureSapling; import ru.betterend.blocks.basis.BlockFeatureSapling;
import ru.betterend.registry.FeatureRegistry; import ru.betterend.registry.EndFeatures;
public class BlockMossyPythadendronSapling extends BlockFeatureSapling { public class BlockMossyPythadendronSapling extends BlockFeatureSapling {
public BlockMossyPythadendronSapling() { public BlockMossyPythadendronSapling() {
@ -11,6 +11,6 @@ public class BlockMossyPythadendronSapling extends BlockFeatureSapling {
@Override @Override
protected Feature<?> getFeature() { protected Feature<?> getFeature() {
return FeatureRegistry.PYTHADENDRON_TREE.getFeature(); return EndFeatures.PYTHADENDRON_TREE.getFeature();
} }
} }

View file

@ -11,7 +11,7 @@ import net.minecraft.world.BlockView;
import net.minecraft.world.World; import net.minecraft.world.World;
import ru.betterend.blocks.basis.BlockDoublePlant; import ru.betterend.blocks.basis.BlockDoublePlant;
import ru.betterend.blocks.basis.BlockPlant; import ru.betterend.blocks.basis.BlockPlant;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
public class BlockUmbrellaMoss extends BlockPlant { public class BlockUmbrellaMoss extends BlockPlant {
@ -21,7 +21,7 @@ public class BlockUmbrellaMoss extends BlockPlant {
@Override @Override
protected boolean isTerrain(BlockState state) { protected boolean isTerrain(BlockState state) {
return state.getBlock() == BlockRegistry.END_MOSS || state.getBlock() == BlockRegistry.END_MYCELIUM; return state.getBlock() == EndBlocks.END_MOSS || state.getBlock() == EndBlocks.END_MYCELIUM;
} }
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
@ -42,7 +42,7 @@ public class BlockUmbrellaMoss extends BlockPlant {
@Override @Override
public void grow(ServerWorld world, Random random, BlockPos pos, BlockState state) { public void grow(ServerWorld world, Random random, BlockPos pos, BlockState state) {
int rot = world.random.nextInt(4); int rot = world.random.nextInt(4);
BlockState bs = BlockRegistry.UMBRELLA_MOSS_TALL.getDefaultState().with(BlockDoublePlant.ROTATION, rot); BlockState bs = EndBlocks.UMBRELLA_MOSS_TALL.getDefaultState().with(BlockDoublePlant.ROTATION, rot);
BlocksHelper.setWithoutUpdate(world, pos, bs); BlocksHelper.setWithoutUpdate(world, pos, bs);
BlocksHelper.setWithoutUpdate(world, pos.up(), bs.with(BlockDoublePlant.TOP, true)); BlocksHelper.setWithoutUpdate(world, pos.up(), bs.with(BlockDoublePlant.TOP, true));
} }

View file

@ -8,7 +8,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.server.world.ServerWorld; import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import ru.betterend.blocks.basis.BlockDoublePlant; import ru.betterend.blocks.basis.BlockDoublePlant;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
public class BlockUmbrellaMossTall extends BlockDoublePlant { public class BlockUmbrellaMossTall extends BlockDoublePlant {
public BlockUmbrellaMossTall() { public BlockUmbrellaMossTall() {
@ -17,12 +17,12 @@ public class BlockUmbrellaMossTall extends BlockDoublePlant {
@Override @Override
public void grow(ServerWorld world, Random random, BlockPos pos, BlockState state) { public void grow(ServerWorld world, Random random, BlockPos pos, BlockState state) {
ItemEntity item = new ItemEntity(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, new ItemStack(BlockRegistry.UMBRELLA_MOSS)); ItemEntity item = new ItemEntity(world, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, new ItemStack(EndBlocks.UMBRELLA_MOSS));
world.spawnEntity(item); world.spawnEntity(item);
} }
@Override @Override
protected boolean isTerrain(BlockState state) { protected boolean isTerrain(BlockState state) {
return state.getBlock() == BlockRegistry.END_MOSS || state.getBlock() == BlockRegistry.END_MYCELIUM; return state.getBlock() == EndBlocks.END_MOSS || state.getBlock() == EndBlocks.END_MYCELIUM;
} }
} }

View file

@ -26,8 +26,8 @@ import net.minecraft.world.gen.feature.ConfiguredFeatures;
import ru.betterend.client.ERenderLayer; import ru.betterend.client.ERenderLayer;
import ru.betterend.client.IRenderTypeable; import ru.betterend.client.IRenderTypeable;
import ru.betterend.interfaces.TeleportingEntity; import ru.betterend.interfaces.TeleportingEntity;
import ru.betterend.registry.BlockTagRegistry; import ru.betterend.registry.EndParticles;
import ru.betterend.registry.ParticleRegistry; import ru.betterend.registry.EndTags;
import ru.betterend.util.PortalFrameHelper; import ru.betterend.util.PortalFrameHelper;
public class EndPortalBlock extends NetherPortalBlock implements IRenderTypeable { public class EndPortalBlock extends NetherPortalBlock implements IRenderTypeable {
@ -54,7 +54,7 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTypeable
z = pos.getZ() + 0.5D + 0.25D * k; z = pos.getZ() + 0.5D + 0.25D * k;
} }
world.addParticle(ParticleRegistry.PORTAL_SPHERE, x, y, z, 0, 0, 0); world.addParticle(EndParticles.PORTAL_SPHERE, x, y, z, 0, 0, 0);
} }
@Override @Override
@ -164,7 +164,7 @@ public class EndPortalBlock extends NetherPortalBlock implements IRenderTypeable
BlockState state = world.getBlockState(position); BlockState state = world.getBlockState(position);
if (state.isAir()) airBlocks++; if (state.isAir()) airBlocks++;
if (world.getRegistryKey().equals(World.END)) { if (world.getRegistryKey().equals(World.END)) {
free &= state.isAir() || BlockTagRegistry.validGenBlock(state); free &= state.isAir() || EndTags.validGenBlock(state);
} else { } else {
BlockState surfaceBlock = world.getBiome(pos).getGenerationSettings().getSurfaceConfig().getTopMaterial(); BlockState surfaceBlock = world.getBiome(pos).getGenerationSettings().getSurfaceConfig().getTopMaterial();
free &= this.validBlock(state, surfaceBlock.getBlock()); free &= this.validBlock(state, surfaceBlock.getBlock());

View file

@ -16,14 +16,14 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.BlockView; import net.minecraft.world.BlockView;
import net.minecraft.world.explosion.Explosion; import net.minecraft.world.explosion.Explosion;
import ru.betterend.blocks.basis.BlockSlab; import ru.betterend.blocks.basis.BlockSlab;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
public class EternalPedestal extends BlockSlab { public class EternalPedestal extends BlockSlab {
public static final BooleanProperty ACTIVATED = BooleanProperty.of("active"); public static final BooleanProperty ACTIVATED = BooleanProperty.of("active");
public static final BooleanProperty HAS_ITEM = BooleanProperty.of("has_item"); public static final BooleanProperty HAS_ITEM = BooleanProperty.of("has_item");
public EternalPedestal() { public EternalPedestal() {
super(BlockRegistry.FLAVOLITE_RUNED_ETERNAL); super(EndBlocks.FLAVOLITE_RUNED_ETERNAL);
this.setDefaultState(stateManager.getDefaultState().with(ACTIVATED, false).with(HAS_ITEM, false)); this.setDefaultState(stateManager.getDefaultState().with(ACTIVATED, false).with(HAS_ITEM, false));
} }

View file

@ -10,7 +10,7 @@ import net.minecraft.state.property.BooleanProperty;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import ru.betterend.blocks.basis.BlockBase; import ru.betterend.blocks.basis.BlockBase;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
import ru.betterend.util.PortalFrameHelper; import ru.betterend.util.PortalFrameHelper;
@ -18,7 +18,7 @@ public class RunedFlavolite extends BlockBase {
public static final BooleanProperty ACTIVATED = BooleanProperty.of("active"); public static final BooleanProperty ACTIVATED = BooleanProperty.of("active");
public RunedFlavolite() { public RunedFlavolite() {
super(FabricBlockSettings.copyOf(BlockRegistry.FLAVOLITE.polished).resistance(Blocks.OBSIDIAN.getBlastResistance()).luminance(state -> { super(FabricBlockSettings.copyOf(EndBlocks.FLAVOLITE.polished).resistance(Blocks.OBSIDIAN.getBlastResistance()).luminance(state -> {
return state.get(ACTIVATED) ? 8 : 0; return state.get(ACTIVATED) ? 8 : 0;
})); }));
this.setDefaultState(stateManager.getDefaultState().with(ACTIVATED, false)); this.setDefaultState(stateManager.getDefaultState().with(ACTIVATED, false));
@ -40,7 +40,7 @@ public class RunedFlavolite extends BlockBase {
BlockState posState = world.getBlockState(position); BlockState posState = world.getBlockState(position);
if (posState.getBlock() instanceof RunedFlavolite && posState.get(ACTIVATED)) { if (posState.getBlock() instanceof RunedFlavolite && posState.get(ACTIVATED)) {
BlocksHelper.setWithoutUpdate(world, position, posState.with(ACTIVATED, false)); BlocksHelper.setWithoutUpdate(world, position, posState.with(ACTIVATED, false));
} else if (posState.isOf(BlockRegistry.END_PORTAL_BLOCK)) { } else if (posState.isOf(EndBlocks.END_PORTAL_BLOCK)) {
world.removeBlock(position, false); world.removeBlock(position, false);
} }
} }

View file

@ -27,7 +27,7 @@ import net.minecraft.world.BlockView;
import net.minecraft.world.World; import net.minecraft.world.World;
import ru.betterend.blocks.entities.EBarrelBlockEntity; import ru.betterend.blocks.entities.EBarrelBlockEntity;
import ru.betterend.interfaces.Patterned; import ru.betterend.interfaces.Patterned;
import ru.betterend.registry.BlockEntityRegistry; import ru.betterend.registry.EndBlockEntities;
public class BlockBarrel extends BarrelBlock implements Patterned { public class BlockBarrel extends BarrelBlock implements Patterned {
public BlockBarrel(Block source) { public BlockBarrel(Block source) {
@ -36,7 +36,7 @@ public class BlockBarrel extends BarrelBlock implements Patterned {
@Override @Override
public BlockEntity createBlockEntity(BlockView world) { public BlockEntity createBlockEntity(BlockView world) {
return BlockEntityRegistry.BARREL.instantiate(); return EndBlockEntities.BARREL.instantiate();
} }
@Override @Override

View file

@ -14,7 +14,7 @@ import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
import net.minecraft.world.BlockView; import net.minecraft.world.BlockView;
import ru.betterend.interfaces.Patterned; import ru.betterend.interfaces.Patterned;
import ru.betterend.registry.BlockEntityRegistry; import ru.betterend.registry.EndBlockEntities;
public class BlockChest extends ChestBlock implements Patterned { public class BlockChest extends ChestBlock implements Patterned {
@ -22,7 +22,7 @@ public class BlockChest extends ChestBlock implements Patterned {
public BlockChest(Block source) { public BlockChest(Block source) {
super(FabricBlockSettings.copyOf(source).nonOpaque(), () -> { super(FabricBlockSettings.copyOf(source).nonOpaque(), () -> {
return BlockEntityRegistry.CHEST; return EndBlockEntities.CHEST;
}); });
this.parent = source; this.parent = source;
} }
@ -30,7 +30,7 @@ public class BlockChest extends ChestBlock implements Patterned {
@Override @Override
public BlockEntity createBlockEntity(BlockView world) public BlockEntity createBlockEntity(BlockView world)
{ {
return BlockEntityRegistry.CHEST.instantiate(); return EndBlockEntities.CHEST.instantiate();
} }
@Override @Override

View file

@ -36,7 +36,7 @@ import net.minecraft.world.WorldAccess;
import net.minecraft.world.WorldView; import net.minecraft.world.WorldView;
import ru.betterend.client.ERenderLayer; import ru.betterend.client.ERenderLayer;
import ru.betterend.client.IRenderTypeable; import ru.betterend.client.IRenderTypeable;
import ru.betterend.registry.BlockTagRegistry; import ru.betterend.registry.EndTags;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
public class BlockDoublePlant extends BlockBaseNotFull implements IRenderTypeable, Fertilizable { public class BlockDoublePlant extends BlockBaseNotFull implements IRenderTypeable, Fertilizable {
@ -93,7 +93,7 @@ public class BlockDoublePlant extends BlockBaseNotFull implements IRenderTypeabl
} }
protected boolean isTerrain(BlockState state) { protected boolean isTerrain(BlockState state) {
return state.isIn(BlockTagRegistry.END_GROUND); return state.isIn(EndTags.END_GROUND);
} }
@Override @Override

View file

@ -25,7 +25,7 @@ import net.minecraft.world.gen.feature.Feature;
import ru.betterend.client.ERenderLayer; import ru.betterend.client.ERenderLayer;
import ru.betterend.client.IRenderTypeable; import ru.betterend.client.IRenderTypeable;
import ru.betterend.interfaces.Patterned; import ru.betterend.interfaces.Patterned;
import ru.betterend.registry.BlockTagRegistry; import ru.betterend.registry.EndTags;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
public abstract class BlockFeatureSapling extends BlockBaseNotFull implements Fertilizable, IRenderTypeable { public abstract class BlockFeatureSapling extends BlockBaseNotFull implements Fertilizable, IRenderTypeable {
@ -59,7 +59,7 @@ public abstract class BlockFeatureSapling extends BlockBaseNotFull implements Fe
@Override @Override
public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) { public boolean canPlaceAt(BlockState state, WorldView world, BlockPos pos) {
return world.getBlockState(pos.down()).isIn(BlockTagRegistry.END_GROUND); return world.getBlockState(pos.down()).isIn(EndTags.END_GROUND);
} }
@Override @Override

View file

@ -32,7 +32,7 @@ import net.minecraft.world.WorldAccess;
import net.minecraft.world.WorldView; import net.minecraft.world.WorldView;
import ru.betterend.client.ERenderLayer; import ru.betterend.client.ERenderLayer;
import ru.betterend.client.IRenderTypeable; import ru.betterend.client.IRenderTypeable;
import ru.betterend.registry.BlockTagRegistry; import ru.betterend.registry.EndTags;
public class BlockPlant extends BlockBaseNotFull implements IRenderTypeable, Fertilizable { public class BlockPlant extends BlockBaseNotFull implements IRenderTypeable, Fertilizable {
private static final VoxelShape SHAPE = Block.createCuboidShape(4, 0, 4, 12, 14, 12); private static final VoxelShape SHAPE = Block.createCuboidShape(4, 0, 4, 12, 14, 12);
@ -84,7 +84,7 @@ public class BlockPlant extends BlockBaseNotFull implements IRenderTypeable, Fer
} }
protected boolean isTerrain(BlockState state) { protected boolean isTerrain(BlockState state) {
return state.isIn(BlockTagRegistry.END_GROUND); return state.isIn(EndTags.END_GROUND);
} }
@Override @Override

View file

@ -36,8 +36,8 @@ import net.minecraft.world.WorldAccess;
import net.minecraft.world.WorldView; import net.minecraft.world.WorldView;
import ru.betterend.client.ERenderLayer; import ru.betterend.client.ERenderLayer;
import ru.betterend.client.IRenderTypeable; import ru.betterend.client.IRenderTypeable;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.BlockTagRegistry; import ru.betterend.registry.EndTags;
public class BlockUnderwaterPlant extends BlockBaseNotFull implements IRenderTypeable, Fertilizable, FluidFillable { public class BlockUnderwaterPlant extends BlockBaseNotFull implements IRenderTypeable, Fertilizable, FluidFillable {
private static final VoxelShape SHAPE = Block.createCuboidShape(4, 0, 4, 12, 14, 12); private static final VoxelShape SHAPE = Block.createCuboidShape(4, 0, 4, 12, 14, 12);
@ -82,7 +82,7 @@ public class BlockUnderwaterPlant extends BlockBaseNotFull implements IRenderTyp
} }
protected boolean isTerrain(BlockState state) { protected boolean isTerrain(BlockState state) {
return state.isIn(BlockTagRegistry.END_GROUND) || state.getBlock() == BlockRegistry.ENDSTONE_DUST; return state.isIn(EndTags.END_GROUND) || state.getBlock() == EndBlocks.ENDSTONE_DUST;
} }
@Override @Override

View file

@ -28,7 +28,7 @@ import net.minecraft.world.WorldAccess;
import net.minecraft.world.WorldView; import net.minecraft.world.WorldView;
import ru.betterend.client.ERenderLayer; import ru.betterend.client.ERenderLayer;
import ru.betterend.client.IRenderTypeable; import ru.betterend.client.IRenderTypeable;
import ru.betterend.registry.BlockTagRegistry; import ru.betterend.registry.EndTags;
public class BlockUpDownPlant extends BlockBaseNotFull implements IRenderTypeable { public class BlockUpDownPlant extends BlockBaseNotFull implements IRenderTypeable {
private static final VoxelShape SHAPE = Block.createCuboidShape(4, 0, 4, 12, 16, 12); private static final VoxelShape SHAPE = Block.createCuboidShape(4, 0, 4, 12, 16, 12);
@ -54,7 +54,7 @@ public class BlockUpDownPlant extends BlockBaseNotFull implements IRenderTypeabl
} }
protected boolean isTerrain(BlockState state) { protected boolean isTerrain(BlockState state) {
return state.isIn(BlockTagRegistry.END_GROUND); return state.isIn(EndTags.END_GROUND);
} }
protected boolean isSupport(BlockState state, WorldView world, BlockPos pos) { protected boolean isSupport(BlockState state, WorldView world, BlockPos pos) {

View file

@ -14,7 +14,7 @@ import ru.betterend.blocks.basis.BlockStoneButton;
import ru.betterend.blocks.basis.BlockStonePressurePlate; import ru.betterend.blocks.basis.BlockStonePressurePlate;
import ru.betterend.blocks.basis.BlockWall; import ru.betterend.blocks.basis.BlockWall;
import ru.betterend.recipe.builders.RecipeBuilder; import ru.betterend.recipe.builders.RecipeBuilder;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.util.TagHelper; import ru.betterend.util.TagHelper;
public class StoneMaterial { public class StoneMaterial {
@ -37,20 +37,20 @@ public class StoneMaterial {
public StoneMaterial(String name, MaterialColor color) { public StoneMaterial(String name, MaterialColor color) {
FabricBlockSettings material = FabricBlockSettings.copyOf(Blocks.END_STONE).materialColor(color); FabricBlockSettings material = FabricBlockSettings.copyOf(Blocks.END_STONE).materialColor(color);
stone = BlockRegistry.registerBlock(name, new BlockBase(material)); stone = EndBlocks.registerBlock(name, new BlockBase(material));
polished = BlockRegistry.registerBlock(name + "_polished", new BlockBase(material)); polished = EndBlocks.registerBlock(name + "_polished", new BlockBase(material));
tiles = BlockRegistry.registerBlock(name + "_tiles", new BlockBase(material)); tiles = EndBlocks.registerBlock(name + "_tiles", new BlockBase(material));
pillar = BlockRegistry.registerBlock(name + "_pillar", new BlockPillar(material)); pillar = EndBlocks.registerBlock(name + "_pillar", new BlockPillar(material));
stairs = BlockRegistry.registerBlock(name + "_stairs", new BlockStairs(stone)); stairs = EndBlocks.registerBlock(name + "_stairs", new BlockStairs(stone));
slab = BlockRegistry.registerBlock(name + "_slab", new BlockSlab(stone)); slab = EndBlocks.registerBlock(name + "_slab", new BlockSlab(stone));
wall = BlockRegistry.registerBlock(name + "_wall", new BlockWall(stone)); wall = EndBlocks.registerBlock(name + "_wall", new BlockWall(stone));
button = BlockRegistry.registerBlock(name + "_button", new BlockStoneButton(stone)); button = EndBlocks.registerBlock(name + "_button", new BlockStoneButton(stone));
pressure_plate = BlockRegistry.registerBlock(name + "_plate", new BlockStonePressurePlate(stone)); pressure_plate = EndBlocks.registerBlock(name + "_plate", new BlockStonePressurePlate(stone));
bricks = BlockRegistry.registerBlock(name + "_bricks", new BlockBase(material)); bricks = EndBlocks.registerBlock(name + "_bricks", new BlockBase(material));
brick_stairs = BlockRegistry.registerBlock(name + "_bricks_stairs", new BlockStairs(bricks)); brick_stairs = EndBlocks.registerBlock(name + "_bricks_stairs", new BlockStairs(bricks));
brick_slab = BlockRegistry.registerBlock(name + "_bricks_slab", new BlockSlab(bricks)); brick_slab = EndBlocks.registerBlock(name + "_bricks_slab", new BlockSlab(bricks));
brick_wall = BlockRegistry.registerBlock(name + "_bricks_wall", new BlockWall(bricks)); brick_wall = EndBlocks.registerBlock(name + "_bricks_wall", new BlockWall(bricks));
// Recipes // // Recipes //
RecipeBuilder.make(name + "_bricks", bricks).setOutputCount(4).setShape("##", "##").addMaterial('#', stone).setGroup("end_bricks").build(); RecipeBuilder.make(name + "_bricks", bricks).setOutputCount(4).setShape("##", "##").addMaterial('#', stone).setGroup("end_bricks").build();

View file

@ -27,7 +27,7 @@ import ru.betterend.blocks.basis.BlockStairs;
import ru.betterend.blocks.basis.BlockTrapdoor; import ru.betterend.blocks.basis.BlockTrapdoor;
import ru.betterend.blocks.basis.BlockWoodenButton; import ru.betterend.blocks.basis.BlockWoodenButton;
import ru.betterend.recipe.builders.RecipeBuilder; import ru.betterend.recipe.builders.RecipeBuilder;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.util.TagHelper; import ru.betterend.util.TagHelper;
public class WoodenMaterial { public class WoodenMaterial {
@ -58,28 +58,28 @@ public class WoodenMaterial {
public WoodenMaterial(String name, MaterialColor woodColor, MaterialColor planksColor) { public WoodenMaterial(String name, MaterialColor woodColor, MaterialColor planksColor) {
FabricBlockSettings materialPlanks = FabricBlockSettings.copyOf(Blocks.OAK_PLANKS).materialColor(planksColor); FabricBlockSettings materialPlanks = FabricBlockSettings.copyOf(Blocks.OAK_PLANKS).materialColor(planksColor);
log_stripped = BlockRegistry.registerBlock(name + "_stripped_log", new BlockPillar(materialPlanks)); log_stripped = EndBlocks.registerBlock(name + "_stripped_log", new BlockPillar(materialPlanks));
bark_stripped = BlockRegistry.registerBlock(name + "_stripped_bark", new BlockBark(materialPlanks)); bark_stripped = EndBlocks.registerBlock(name + "_stripped_bark", new BlockBark(materialPlanks));
log = BlockRegistry.registerBlock(name + "_log", new BlockLogStripable(woodColor, log_stripped)); log = EndBlocks.registerBlock(name + "_log", new BlockLogStripable(woodColor, log_stripped));
bark = BlockRegistry.registerBlock(name + "_bark", new BlockBarkStripable(woodColor, bark_stripped)); bark = EndBlocks.registerBlock(name + "_bark", new BlockBarkStripable(woodColor, bark_stripped));
planks = BlockRegistry.registerBlock(name + "_planks", new BlockBase(materialPlanks)); planks = EndBlocks.registerBlock(name + "_planks", new BlockBase(materialPlanks));
stairs = BlockRegistry.registerBlock(name + "_stairs", new BlockStairs(planks)); stairs = EndBlocks.registerBlock(name + "_stairs", new BlockStairs(planks));
slab = BlockRegistry.registerBlock(name + "_slab", new BlockSlab(planks)); slab = EndBlocks.registerBlock(name + "_slab", new BlockSlab(planks));
fence = BlockRegistry.registerBlock(name + "_fence", new BlockFence(planks)); fence = EndBlocks.registerBlock(name + "_fence", new BlockFence(planks));
gate = BlockRegistry.registerBlock(name + "_gate", new BlockGate(planks)); gate = EndBlocks.registerBlock(name + "_gate", new BlockGate(planks));
button = BlockRegistry.registerBlock(name + "_button", new BlockWoodenButton(planks)); button = EndBlocks.registerBlock(name + "_button", new BlockWoodenButton(planks));
pressure_plate = BlockRegistry.registerBlock(name + "_plate", new BlockPressurePlate(planks)); pressure_plate = EndBlocks.registerBlock(name + "_plate", new BlockPressurePlate(planks));
trapdoor = BlockRegistry.registerBlock(name + "_trapdoor", new BlockTrapdoor(planks)); trapdoor = EndBlocks.registerBlock(name + "_trapdoor", new BlockTrapdoor(planks));
door = BlockRegistry.registerBlock(name + "_door", new BlockDoor(planks)); door = EndBlocks.registerBlock(name + "_door", new BlockDoor(planks));
crafting_table = BlockRegistry.registerBlock(name + "_crafting_table", new BlockCraftingTable(planks)); crafting_table = EndBlocks.registerBlock(name + "_crafting_table", new BlockCraftingTable(planks));
ladder = BlockRegistry.registerBlock(name + "_ladder", new BlockLadder(planks)); ladder = EndBlocks.registerBlock(name + "_ladder", new BlockLadder(planks));
sign = BlockRegistry.registerBlock(name + "_sign", new BlockSign(planks)); sign = EndBlocks.registerBlock(name + "_sign", new BlockSign(planks));
chest = BlockRegistry.registerBlock(name + "_chest", new BlockChest(planks)); chest = EndBlocks.registerBlock(name + "_chest", new BlockChest(planks));
barrel = BlockRegistry.registerBlock(name + "_barrel", new BlockBarrel(planks)); barrel = EndBlocks.registerBlock(name + "_barrel", new BlockBarrel(planks));
// Recipes // // Recipes //
RecipeBuilder.make(name + "_planks", planks).setOutputCount(4).setList("#").addMaterial('#', log, bark, log_stripped, bark_stripped).setGroup("end_planks").build(); RecipeBuilder.make(name + "_planks", planks).setOutputCount(4).setList("#").addMaterial('#', log, bark, log_stripped, bark_stripped).setGroup("end_planks").build();

View file

@ -21,7 +21,7 @@ import net.minecraft.util.collection.DefaultedList;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Vec3i; import net.minecraft.util.math.Vec3i;
import ru.betterend.blocks.basis.BlockBarrel; import ru.betterend.blocks.basis.BlockBarrel;
import ru.betterend.registry.BlockEntityRegistry; import ru.betterend.registry.EndBlockEntities;
public class EBarrelBlockEntity extends LootableContainerBlockEntity { public class EBarrelBlockEntity extends LootableContainerBlockEntity {
private DefaultedList<ItemStack> inventory; private DefaultedList<ItemStack> inventory;
@ -33,7 +33,7 @@ public class EBarrelBlockEntity extends LootableContainerBlockEntity {
} }
public EBarrelBlockEntity() { public EBarrelBlockEntity() {
this(BlockEntityRegistry.BARREL); this(EndBlockEntities.BARREL);
} }
public CompoundTag toTag(CompoundTag tag) { public CompoundTag toTag(CompoundTag tag) {

View file

@ -1,10 +1,10 @@
package ru.betterend.blocks.entities; package ru.betterend.blocks.entities;
import net.minecraft.block.entity.ChestBlockEntity; import net.minecraft.block.entity.ChestBlockEntity;
import ru.betterend.registry.BlockEntityRegistry; import ru.betterend.registry.EndBlockEntities;
public class EChestBlockEntity extends ChestBlockEntity { public class EChestBlockEntity extends ChestBlockEntity {
public EChestBlockEntity() { public EChestBlockEntity() {
super(BlockEntityRegistry.CHEST); super(EndBlockEntities.CHEST);
} }
} }

View file

@ -25,7 +25,7 @@ import net.minecraft.text.Texts;
import net.minecraft.util.DyeColor; import net.minecraft.util.DyeColor;
import net.minecraft.util.math.Vec2f; import net.minecraft.util.math.Vec2f;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
import ru.betterend.registry.BlockEntityRegistry; import ru.betterend.registry.EndBlockEntities;
public class ESignBlockEntity extends BlockEntity { public class ESignBlockEntity extends BlockEntity {
private final Text[] text; private final Text[] text;
@ -35,7 +35,7 @@ public class ESignBlockEntity extends BlockEntity {
private DyeColor textColor; private DyeColor textColor;
public ESignBlockEntity() { public ESignBlockEntity() {
super(BlockEntityRegistry.SIGN); super(EndBlockEntities.SIGN);
this.text = new Text[] { LiteralText.EMPTY, LiteralText.EMPTY, LiteralText.EMPTY, LiteralText.EMPTY }; this.text = new Text[] { LiteralText.EMPTY, LiteralText.EMPTY, LiteralText.EMPTY, LiteralText.EMPTY };
this.editable = true; this.editable = true;
this.textBeingEdited = new OrderedText[4]; this.textBeingEdited = new OrderedText[4];

View file

@ -45,7 +45,7 @@ import ru.betterend.BetterEnd;
import ru.betterend.blocks.EndStoneSmelter; import ru.betterend.blocks.EndStoneSmelter;
import ru.betterend.client.gui.EndStoneSmelterScreenHandler; import ru.betterend.client.gui.EndStoneSmelterScreenHandler;
import ru.betterend.recipe.builders.AlloyingRecipe; import ru.betterend.recipe.builders.AlloyingRecipe;
import ru.betterend.registry.BlockEntityRegistry; import ru.betterend.registry.EndBlockEntities;
public class EndStoneSmelterBlockEntity extends LockableContainerBlockEntity implements SidedInventory, RecipeUnlocker, RecipeInputProvider, Tickable { public class EndStoneSmelterBlockEntity extends LockableContainerBlockEntity implements SidedInventory, RecipeUnlocker, RecipeInputProvider, Tickable {
@ -64,7 +64,7 @@ public class EndStoneSmelterBlockEntity extends LockableContainerBlockEntity imp
private int fuelTime; private int fuelTime;
public EndStoneSmelterBlockEntity() { public EndStoneSmelterBlockEntity() {
super(BlockEntityRegistry.END_STONE_SMELTER); super(EndBlockEntities.END_STONE_SMELTER);
this.inventory = DefaultedList.ofSize(4, ItemStack.EMPTY); this.inventory = DefaultedList.ofSize(4, ItemStack.EMPTY);
this.recipesUsed = new Object2IntOpenHashMap<Identifier>(); this.recipesUsed = new Object2IntOpenHashMap<Identifier>();
this.propertyDelegate = new PropertyDelegate() { this.propertyDelegate = new PropertyDelegate() {

View file

@ -33,7 +33,7 @@ import net.minecraft.world.World;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
import ru.betterend.blocks.basis.BlockChest; import ru.betterend.blocks.basis.BlockChest;
import ru.betterend.blocks.entities.EChestBlockEntity; import ru.betterend.blocks.entities.EChestBlockEntity;
import ru.betterend.registry.ItemRegistry; import ru.betterend.registry.EndItems;
public class EChestBlockEntityRenderer extends BlockEntityRenderer<EChestBlockEntity> { public class EChestBlockEntityRenderer extends BlockEntityRenderer<EChestBlockEntity> {
private static final HashMap<Integer, RenderLayer[]> LAYERS = Maps.newHashMap(); private static final HashMap<Integer, RenderLayer[]> LAYERS = Maps.newHashMap();
@ -162,7 +162,7 @@ public class EChestBlockEntityRenderer extends BlockEntityRenderer<EChestBlockEn
RenderLayer.getEntitySolid(new Identifier("textures/entity/chest/normal_right.png")) RenderLayer.getEntitySolid(new Identifier("textures/entity/chest/normal_right.png"))
}; };
ItemRegistry.getModBlocks().forEach((item) -> { EndItems.getModBlocks().forEach((item) -> {
if (item instanceof BlockItem) { if (item instanceof BlockItem) {
Block block = ((BlockItem) item).getBlock(); Block block = ((BlockItem) item).getBlock();
if (block instanceof BlockChest) { if (block instanceof BlockChest) {

View file

@ -30,7 +30,7 @@ import net.minecraft.util.registry.Registry;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
import ru.betterend.blocks.basis.BlockSign; import ru.betterend.blocks.basis.BlockSign;
import ru.betterend.blocks.entities.ESignBlockEntity; import ru.betterend.blocks.entities.ESignBlockEntity;
import ru.betterend.registry.ItemRegistry; import ru.betterend.registry.EndItems;
public class ESignBlockEntityRenderer extends BlockEntityRenderer<ESignBlockEntity> { public class ESignBlockEntityRenderer extends BlockEntityRenderer<ESignBlockEntity> {
private static final HashMap<Integer, RenderLayer> LAYERS = Maps.newHashMap(); private static final HashMap<Integer, RenderLayer> LAYERS = Maps.newHashMap();
@ -106,7 +106,7 @@ public class ESignBlockEntityRenderer extends BlockEntityRenderer<ESignBlockEnti
static { static {
defaultLayer = RenderLayer.getEntitySolid(new Identifier("textures/entity/sign/oak.png")); defaultLayer = RenderLayer.getEntitySolid(new Identifier("textures/entity/sign/oak.png"));
ItemRegistry.getModBlocks().forEach((item) -> { EndItems.getModBlocks().forEach((item) -> {
if (item instanceof BlockItem) { if (item instanceof BlockItem) {
Block block = ((BlockItem) item).getBlock(); Block block = ((BlockItem) item).getBlock();
if (block instanceof BlockSign) { if (block instanceof BlockSign) {

View file

@ -4,19 +4,19 @@ import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap; import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
import net.minecraft.client.render.RenderLayer; import net.minecraft.client.render.RenderLayer;
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
import ru.betterend.registry.BlockEntityRenderRegistry; import ru.betterend.registry.EndBlockEntityRenders;
import ru.betterend.registry.EntityRenderRegistry; import ru.betterend.registry.EndEntitiesRenders;
import ru.betterend.registry.ParticleRegistry; import ru.betterend.registry.EndParticles;
import ru.betterend.registry.ScreensRegistry; import ru.betterend.registry.EndScreens;
public class BetterEndClient implements ClientModInitializer { public class BetterEndClient implements ClientModInitializer {
@Override @Override
public void onInitializeClient() { public void onInitializeClient() {
registerRenderLayers(); registerRenderLayers();
BlockEntityRenderRegistry.register(); EndBlockEntityRenders.register();
ScreensRegistry.register(); EndScreens.register();
ParticleRegistry.register(); EndParticles.register();
EntityRenderRegistry.register(); EndEntitiesRenders.register();
} }
private void registerRenderLayers() { private void registerRenderLayers() {

View file

@ -22,7 +22,7 @@ import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.TranslatableText; import net.minecraft.text.TranslatableText;
import net.minecraft.util.Identifier; import net.minecraft.util.Identifier;
import ru.betterend.recipe.builders.AlloyingRecipe; import ru.betterend.recipe.builders.AlloyingRecipe;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.util.LangUtil; import ru.betterend.util.LangUtil;
public class REIAlloyingCategory implements TransferRecipeCategory<REIAlloyingDisplay> { public class REIAlloyingCategory implements TransferRecipeCategory<REIAlloyingDisplay> {
@ -34,7 +34,7 @@ public class REIAlloyingCategory implements TransferRecipeCategory<REIAlloyingDi
@Override @Override
public @NotNull String getCategoryName() { public @NotNull String getCategoryName() {
return LangUtil.translate(BlockRegistry.END_STONE_SMELTER.getTranslationKey()); return LangUtil.translate(EndBlocks.END_STONE_SMELTER.getTranslationKey());
} }
@Override @Override

View file

@ -11,7 +11,7 @@ import net.minecraft.util.Identifier;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
import ru.betterend.recipe.builders.AlloyingRecipe; import ru.betterend.recipe.builders.AlloyingRecipe;
import ru.betterend.recipe.builders.AnvilSmithingRecipe; import ru.betterend.recipe.builders.AnvilSmithingRecipe;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
public class REIPlugin implements REIPluginV0 { public class REIPlugin implements REIPluginV0 {
@ -20,7 +20,7 @@ public class REIPlugin implements REIPluginV0 {
public final static Identifier ALLOYING = AlloyingRecipe.ID; public final static Identifier ALLOYING = AlloyingRecipe.ID;
public final static Identifier SMITHING = AnvilSmithingRecipe.ID; public final static Identifier SMITHING = AnvilSmithingRecipe.ID;
public final static EntryStack END_STONE_SMELTER = EntryStack.create(BlockRegistry.END_STONE_SMELTER); public final static EntryStack END_STONE_SMELTER = EntryStack.create(EndBlocks.END_STONE_SMELTER);
public final static EntryStack ANVIL = EntryStack.create(Blocks.ANVIL); public final static EntryStack ANVIL = EntryStack.create(Blocks.ANVIL);
@Override @Override

View file

@ -8,7 +8,7 @@ import net.minecraft.potion.Potions;
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
import ru.betterend.mixin.common.BrewingAccessor; import ru.betterend.mixin.common.BrewingAccessor;
import ru.betterend.registry.ItemRegistry; import ru.betterend.registry.EndItems;
public class EndPotions { public class EndPotions {
public final static Potion END_VEIL = registerPotion("end_veil", EndStatusEffects.END_VEIL, 3600); public final static Potion END_VEIL = registerPotion("end_veil", EndStatusEffects.END_VEIL, 3600);
@ -23,7 +23,7 @@ public class EndPotions {
} }
public static void register() { public static void register() {
BrewingAccessor.callRegisterPotionRecipe(Potions.AWKWARD, ItemRegistry.ENDER_DUST, END_VEIL); BrewingAccessor.callRegisterPotionRecipe(Potions.AWKWARD, EndItems.ENDER_DUST, END_VEIL);
BrewingAccessor.callRegisterPotionRecipe(END_VEIL, Items.REDSTONE, LONG_END_VEIL); BrewingAccessor.callRegisterPotionRecipe(END_VEIL, Items.REDSTONE, LONG_END_VEIL);
} }
} }

View file

@ -28,8 +28,8 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.WorldView; import net.minecraft.world.WorldView;
import ru.betterend.registry.EntityRegistry; import ru.betterend.registry.EndEntities;
import ru.betterend.registry.SoundRegistry; import ru.betterend.registry.EndSounds;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
import ru.betterend.util.MHelper; import ru.betterend.util.MHelper;
@ -109,7 +109,7 @@ public class EntityDragonfly extends AnimalEntity implements Flutterer {
@Override @Override
public SoundEvent getAmbientSound() { public SoundEvent getAmbientSound() {
return SoundRegistry.ENTITY_DRAGONFLY; return EndSounds.ENTITY_DRAGONFLY;
} }
@Override @Override
@ -184,6 +184,6 @@ public class EntityDragonfly extends AnimalEntity implements Flutterer {
@Override @Override
public PassiveEntity createChild(ServerWorld world, PassiveEntity entity) { public PassiveEntity createChild(ServerWorld world, PassiveEntity entity) {
return EntityRegistry.DRAGONFLY.create(world); return EndEntities.DRAGONFLY.create(world);
} }
} }

View file

@ -39,7 +39,7 @@ import net.minecraft.world.ServerWorldAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
import ru.betterend.interfaces.ISlime; import ru.betterend.interfaces.ISlime;
import ru.betterend.registry.BiomeRegistry; import ru.betterend.registry.EndBiomes;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
import ru.betterend.util.MHelper; import ru.betterend.util.MHelper;
@ -74,7 +74,7 @@ public class EntityEndSlime extends SlimeEntity {
@Override @Override
public EntityData initialize(ServerWorldAccess world, LocalDifficulty difficulty, SpawnReason spawnReason, EntityData entityData, CompoundTag entityTag) { public EntityData initialize(ServerWorldAccess world, LocalDifficulty difficulty, SpawnReason spawnReason, EntityData entityData, CompoundTag entityTag) {
EntityData data = super.initialize(world, difficulty, spawnReason, entityData, entityTag); EntityData data = super.initialize(world, difficulty, spawnReason, entityData, entityTag);
if (BiomeRegistry.getFromBiome(world.getBiome(getBlockPos())) == BiomeRegistry.FOGGY_MUSHROOMLAND) { if (EndBiomes.getFromBiome(world.getBiome(getBlockPos())) == EndBiomes.FOGGY_MUSHROOMLAND) {
this.setMossy(true); this.setMossy(true);
} }
this.calculateDimensions(); this.calculateDimensions();
@ -154,7 +154,7 @@ public class EntityEndSlime extends SlimeEntity {
private static boolean isPermanentBiome(ServerWorldAccess world, BlockPos pos) { private static boolean isPermanentBiome(ServerWorldAccess world, BlockPos pos) {
Biome biome = world.getBiome(pos); Biome biome = world.getBiome(pos);
return BiomeRegistry.getFromBiome(biome) == BiomeRegistry.CHORUS_FOREST; return EndBiomes.getFromBiome(biome) == EndBiomes.CHORUS_FOREST;
} }
private static boolean notManyEntities(ServerWorldAccess world, BlockPos pos, int radius, int maxCount) { private static boolean notManyEntities(ServerWorldAccess world, BlockPos pos, int radius, int maxCount) {

View file

@ -10,14 +10,14 @@ import net.minecraft.recipe.Ingredient;
import net.minecraft.sound.SoundEvent; import net.minecraft.sound.SoundEvent;
import net.minecraft.sound.SoundEvents; import net.minecraft.sound.SoundEvents;
import net.minecraft.util.Lazy; import net.minecraft.util.Lazy;
import ru.betterend.registry.ItemRegistry; import ru.betterend.registry.EndItems;
public enum EndArmorMaterial implements ArmorMaterial { public enum EndArmorMaterial implements ArmorMaterial {
TERMINITE("terminite", 26, new int[] { 3, 6, 7, 3 }, 14, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 1.0F, 0.05F, () -> { TERMINITE("terminite", 26, new int[] { 3, 6, 7, 3 }, 14, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 1.0F, 0.05F, () -> {
return Ingredient.ofItems(ItemRegistry.TERMINITE_INGOT); return Ingredient.ofItems(EndItems.TERMINITE_INGOT);
}), }),
AETERNIUM("aeternium", 40, new int[] { 4, 7, 9, 4 }, 18, SoundEvents.ITEM_ARMOR_EQUIP_NETHERITE, 3.5F, 0.2F, () -> { AETERNIUM("aeternium", 40, new int[] { 4, 7, 9, 4 }, 18, SoundEvents.ITEM_ARMOR_EQUIP_NETHERITE, 3.5F, 0.2F, () -> {
return Ingredient.ofItems(ItemRegistry.AETERNIUM_INGOT); return Ingredient.ofItems(EndItems.AETERNIUM_INGOT);
}); });
private static final int[] BASE_DURABILITY = new int[] { 13, 15, 16, 11 }; private static final int[] BASE_DURABILITY = new int[] { 13, 15, 16, 11 };

View file

@ -26,7 +26,7 @@ import net.minecraft.tag.Tag;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World; import net.minecraft.world.World;
import ru.betterend.registry.ItemTagRegistry; import ru.betterend.registry.EndTags;
public class EndHammer extends MiningToolItem implements DynamicAttributeTool { public class EndHammer extends MiningToolItem implements DynamicAttributeTool {
@ -93,7 +93,7 @@ public class EndHammer extends MiningToolItem implements DynamicAttributeTool {
@Override @Override
public float getMiningSpeedMultiplier(Tag<Item> tag, BlockState state, ItemStack stack, LivingEntity user) { public float getMiningSpeedMultiplier(Tag<Item> tag, BlockState state, ItemStack stack, LivingEntity user) {
if (tag.equals(ItemTagRegistry.HAMMERS)) { if (tag.equals(EndTags.HAMMERS)) {
return this.getMiningSpeedMultiplier(stack, state); return this.getMiningSpeedMultiplier(stack, state);
} }
return 1.0F; return 1.0F;
@ -101,7 +101,7 @@ public class EndHammer extends MiningToolItem implements DynamicAttributeTool {
@Override @Override
public int getMiningLevel(Tag<Item> tag, BlockState state, ItemStack stack, LivingEntity user) { public int getMiningLevel(Tag<Item> tag, BlockState state, ItemStack stack, LivingEntity user) {
if (tag.equals(ItemTagRegistry.HAMMERS)) { if (tag.equals(EndTags.HAMMERS)) {
return this.getMaterial().getMiningLevel(); return this.getMaterial().getMiningLevel();
} }
return 0; return 0;

View file

@ -5,14 +5,14 @@ import java.util.function.Supplier;
import net.minecraft.item.ToolMaterial; import net.minecraft.item.ToolMaterial;
import net.minecraft.recipe.Ingredient; import net.minecraft.recipe.Ingredient;
import net.minecraft.util.Lazy; import net.minecraft.util.Lazy;
import ru.betterend.registry.ItemRegistry; import ru.betterend.registry.EndItems;
public enum EndToolMaterial implements ToolMaterial { public enum EndToolMaterial implements ToolMaterial {
TERMINITE(3, 1230, 8.5F, 3.0F, 14, () -> { TERMINITE(3, 1230, 8.5F, 3.0F, 14, () -> {
return Ingredient.ofItems(ItemRegistry.TERMINITE_INGOT); return Ingredient.ofItems(EndItems.TERMINITE_INGOT);
}), }),
AETERNIUM(5, 2196, 10.0F, 4.5F, 18, () -> { AETERNIUM(5, 2196, 10.0F, 4.5F, 18, () -> {
return Ingredient.ofItems(ItemRegistry.AETERNIUM_INGOT); return Ingredient.ofItems(EndItems.AETERNIUM_INGOT);
}); });
private final int durability; private final int durability;

View file

@ -10,14 +10,14 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import ru.betterend.blocks.EternalPedestal; import ru.betterend.blocks.EternalPedestal;
import ru.betterend.blocks.RunedFlavolite; import ru.betterend.blocks.RunedFlavolite;
import ru.betterend.registry.ItemRegistry; import ru.betterend.registry.EndItems;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
import ru.betterend.util.PortalFrameHelper; import ru.betterend.util.PortalFrameHelper;
public class EternalCrystal extends Item { public class EternalCrystal extends Item {
public EternalCrystal() { public EternalCrystal() {
super(ItemRegistry.makeSettings()); super(EndItems.makeSettings());
} }
public ActionResult useOnBlock(ItemUsageContext context) { public ActionResult useOnBlock(ItemUsageContext context) {

View file

@ -22,7 +22,7 @@ import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.Biome.Category; import net.minecraft.world.biome.Biome.Category;
import ru.betterend.registry.BiomeRegistry; import ru.betterend.registry.EndBiomes;
import ru.betterend.util.BackgroundInfo; import ru.betterend.util.BackgroundInfo;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
@ -73,7 +73,7 @@ public class BackgroundRendererMixin {
Biome biome = entity.world.getBiome(entity.getBlockPos()); Biome biome = entity.world.getBiome(entity.getBlockPos());
FluidState fluidState = camera.getSubmergedFluidState(); FluidState fluidState = camera.getSubmergedFluidState();
if (biome.getCategory() == Category.THEEND && fluidState.isEmpty()) { if (biome.getCategory() == Category.THEEND && fluidState.isEmpty()) {
EndBiome endBiome = BiomeRegistry.getRenderBiome(biome); EndBiome endBiome = EndBiomes.getRenderBiome(biome);
if (fogDensity == 0) { if (fogDensity == 0) {
fogDensity = endBiome.getFogDensity(); fogDensity = endBiome.getFogDensity();

View file

@ -17,8 +17,8 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockPos.Mutable; import net.minecraft.util.math.BlockPos.Mutable;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.world.World; import net.minecraft.world.World;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.BlockTagRegistry; import ru.betterend.registry.EndTags;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
@Mixin(BoneMealItem.class) @Mixin(BoneMealItem.class)
@ -31,7 +31,7 @@ public class BoneMealItemMixin {
World world = context.getWorld(); World world = context.getWorld();
BlockPos blockPos = context.getBlockPos(); BlockPos blockPos = context.getBlockPos();
if (!world.isClient) { if (!world.isClient) {
if (world.getBlockState(blockPos).isIn(BlockTagRegistry.END_GROUND)) { if (world.getBlockState(blockPos).isIn(EndTags.END_GROUND)) {
boolean consume = false; boolean consume = false;
if (world.getBlockState(blockPos).getBlock() == Blocks.END_STONE) { if (world.getBlockState(blockPos).getBlock() == Blocks.END_STONE) {
BlockState nylium = beGetNylium(world, blockPos); BlockState nylium = beGetNylium(world, blockPos);
@ -82,14 +82,14 @@ public class BoneMealItemMixin {
private BlockState beGetGrassState(World world, BlockPos pos) { private BlockState beGetGrassState(World world, BlockPos pos) {
BlockState state = world.getBlockState(pos); BlockState state = world.getBlockState(pos);
Block block = state.getBlock(); Block block = state.getBlock();
if (block == BlockRegistry.END_MOSS || block == BlockRegistry.END_MYCELIUM) { if (block == EndBlocks.END_MOSS || block == EndBlocks.END_MYCELIUM) {
return world.random.nextBoolean() ? BlockRegistry.CREEPING_MOSS.getDefaultState() : BlockRegistry.UMBRELLA_MOSS.getDefaultState(); return world.random.nextBoolean() ? EndBlocks.CREEPING_MOSS.getDefaultState() : EndBlocks.UMBRELLA_MOSS.getDefaultState();
} }
else if (block == BlockRegistry.CAVE_MOSS) { else if (block == EndBlocks.CAVE_MOSS) {
return BlockRegistry.CAVE_GRASS.getDefaultState(); return EndBlocks.CAVE_GRASS.getDefaultState();
} }
else if (block == BlockRegistry.CHORUS_NYLIUM) { else if (block == EndBlocks.CHORUS_NYLIUM) {
return BlockRegistry.CHORUS_GRASS.getDefaultState(); return EndBlocks.CHORUS_GRASS.getDefaultState();
} }
return null; return null;
} }

View file

@ -25,8 +25,8 @@ import net.minecraft.world.BlockView;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.WorldAccess; import net.minecraft.world.WorldAccess;
import net.minecraft.world.WorldView; import net.minecraft.world.WorldView;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.BlockTagRegistry; import ru.betterend.registry.EndTags;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
@Mixin(value = ChorusFlowerBlock.class, priority = 100) @Mixin(value = ChorusFlowerBlock.class, priority = 100)
@ -44,7 +44,7 @@ public abstract class ChorusFlowerBlockMixin extends Block {
@Inject(method = "canPlaceAt", at = @At("HEAD"), cancellable = true) @Inject(method = "canPlaceAt", at = @At("HEAD"), cancellable = true)
private void beCanPlace(BlockState state, WorldView world, BlockPos pos, CallbackInfoReturnable<Boolean> info) { private void beCanPlace(BlockState state, WorldView world, BlockPos pos, CallbackInfoReturnable<Boolean> info) {
if (world.getBlockState(pos.down()).isOf(BlockRegistry.CHORUS_NYLIUM)) { if (world.getBlockState(pos.down()).isOf(EndBlocks.CHORUS_NYLIUM)) {
info.setReturnValue(true); info.setReturnValue(true);
info.cancel(); info.cancel();
} }
@ -52,7 +52,7 @@ public abstract class ChorusFlowerBlockMixin extends Block {
@Inject(method = "randomTick", at = @At("HEAD"), cancellable = true) @Inject(method = "randomTick", at = @At("HEAD"), cancellable = true)
private void beOnTick(BlockState state, ServerWorld world, BlockPos pos, Random random, CallbackInfo info) { private void beOnTick(BlockState state, ServerWorld world, BlockPos pos, Random random, CallbackInfo info) {
if (world.getBlockState(pos.down()).isIn(BlockTagRegistry.END_GROUND)) { if (world.getBlockState(pos.down()).isIn(EndTags.END_GROUND)) {
BlockPos up = pos.up(); BlockPos up = pos.up();
if (world.isAir(up) && up.getY() < 256) { if (world.isAir(up) && up.getY() < 256) {
int i = state.get(ChorusFlowerBlock.AGE); int i = state.get(ChorusFlowerBlock.AGE);

View file

@ -20,8 +20,8 @@ import net.minecraft.world.BlockView;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraft.world.WorldAccess; import net.minecraft.world.WorldAccess;
import net.minecraft.world.WorldView; import net.minecraft.world.WorldView;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.BlockTagRegistry; import ru.betterend.registry.EndTags;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
@Mixin(value = ChorusPlantBlock.class, priority = 100) @Mixin(value = ChorusPlantBlock.class, priority = 100)
@ -44,7 +44,7 @@ public abstract class ChorusPlantBlockMixin extends Block {
private void beConnectionProperties(BlockView world, BlockPos pos, CallbackInfoReturnable<BlockState> info) { private void beConnectionProperties(BlockView world, BlockPos pos, CallbackInfoReturnable<BlockState> info) {
BlockState plant = info.getReturnValue(); BlockState plant = info.getReturnValue();
if (plant.isOf(Blocks.CHORUS_PLANT)) { if (plant.isOf(Blocks.CHORUS_PLANT)) {
if (world.getBlockState(pos.down()).isIn(BlockTagRegistry.END_GROUND)) { if (world.getBlockState(pos.down()).isIn(EndTags.END_GROUND)) {
info.setReturnValue(plant.with(Properties.DOWN, true).with(BlocksHelper.ROOTS, true)); info.setReturnValue(plant.with(Properties.DOWN, true).with(BlocksHelper.ROOTS, true));
info.cancel(); info.cancel();
} }
@ -58,7 +58,7 @@ public abstract class ChorusPlantBlockMixin extends Block {
@Inject(method = "canPlaceAt", at = @At("HEAD"), cancellable = true) @Inject(method = "canPlaceAt", at = @At("HEAD"), cancellable = true)
private void beCanPlace(BlockState state, WorldView world, BlockPos pos, CallbackInfoReturnable<Boolean> info) { private void beCanPlace(BlockState state, WorldView world, BlockPos pos, CallbackInfoReturnable<Boolean> info) {
BlockState down = world.getBlockState(pos.down()); BlockState down = world.getBlockState(pos.down());
if (down.isOf(BlockRegistry.CHORUS_NYLIUM) || down.isOf(Blocks.END_STONE)) { if (down.isOf(EndBlocks.CHORUS_NYLIUM) || down.isOf(Blocks.END_STONE)) {
info.setReturnValue(true); info.setReturnValue(true);
info.cancel(); info.cancel();
} }
@ -68,7 +68,7 @@ public abstract class ChorusPlantBlockMixin extends Block {
private void beStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom, CallbackInfoReturnable<BlockState> info) { private void beStateForNeighborUpdate(BlockState state, Direction direction, BlockState newState, WorldAccess world, BlockPos pos, BlockPos posFrom, CallbackInfoReturnable<BlockState> info) {
BlockState plant = info.getReturnValue(); BlockState plant = info.getReturnValue();
if (plant.isOf(Blocks.CHORUS_PLANT)) { if (plant.isOf(Blocks.CHORUS_PLANT)) {
if (world.getBlockState(pos.down()).isIn(BlockTagRegistry.END_GROUND)) { if (world.getBlockState(pos.down()).isIn(EndTags.END_GROUND)) {
plant = plant.with(Properties.DOWN, true).with(BlocksHelper.ROOTS, true); plant = plant.with(Properties.DOWN, true).with(BlocksHelper.ROOTS, true);
info.cancel(); info.cancel();
} }
@ -86,7 +86,7 @@ public abstract class ChorusPlantBlockMixin extends Block {
BlockPos pos = ctx.getBlockPos(); BlockPos pos = ctx.getBlockPos();
World world = ctx.getWorld(); World world = ctx.getWorld();
BlockState plant = info.getReturnValue(); BlockState plant = info.getReturnValue();
if (ctx.canPlace() && plant.isOf(Blocks.CHORUS_PLANT) && world.getBlockState(pos.down()).isIn(BlockTagRegistry.END_GROUND)) { if (ctx.canPlace() && plant.isOf(Blocks.CHORUS_PLANT) && world.getBlockState(pos.down()).isIn(EndTags.END_GROUND)) {
info.setReturnValue(plant.with(BlocksHelper.ROOTS, true).with(Properties.DOWN, true)); info.setReturnValue(plant.with(BlocksHelper.ROOTS, true).with(Properties.DOWN, true));
info.cancel(); info.cancel();
} }

View file

@ -16,7 +16,7 @@ import net.minecraft.world.StructureWorldAccess;
import net.minecraft.world.gen.chunk.ChunkGenerator; import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.feature.ChorusPlantFeature; import net.minecraft.world.gen.feature.ChorusPlantFeature;
import net.minecraft.world.gen.feature.DefaultFeatureConfig; import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
import ru.betterend.util.MHelper; import ru.betterend.util.MHelper;
@ -24,7 +24,7 @@ import ru.betterend.util.MHelper;
public class ChorusPlantFeatureMixin { public class ChorusPlantFeatureMixin {
@Inject(method = "generate", at = @At("HEAD"), cancellable = true) @Inject(method = "generate", at = @At("HEAD"), cancellable = true)
private void onGenerate(StructureWorldAccess structureWorldAccess, ChunkGenerator chunkGenerator, Random random, BlockPos blockPos, DefaultFeatureConfig defaultFeatureConfig, CallbackInfoReturnable<Boolean> info) { private void onGenerate(StructureWorldAccess structureWorldAccess, ChunkGenerator chunkGenerator, Random random, BlockPos blockPos, DefaultFeatureConfig defaultFeatureConfig, CallbackInfoReturnable<Boolean> info) {
if (structureWorldAccess.isAir(blockPos) && structureWorldAccess.getBlockState(blockPos.down()).isOf(BlockRegistry.CHORUS_NYLIUM)) { if (structureWorldAccess.isAir(blockPos) && structureWorldAccess.getBlockState(blockPos.down()).isOf(EndBlocks.CHORUS_NYLIUM)) {
ChorusFlowerBlock.generate(structureWorldAccess, blockPos, random, MHelper.randRange(8, 16, random)); ChorusFlowerBlock.generate(structureWorldAccess, blockPos, random, MHelper.randRange(8, 16, random));
BlockState bottom = structureWorldAccess.getBlockState(blockPos); BlockState bottom = structureWorldAccess.getBlockState(blockPos);
if (bottom.isOf(Blocks.CHORUS_PLANT)) { if (bottom.isOf(Blocks.CHORUS_PLANT)) {

View file

@ -6,7 +6,7 @@ import net.minecraft.network.PacketByteBuf;
import net.minecraft.particle.ParticleEffect; import net.minecraft.particle.ParticleEffect;
import net.minecraft.particle.ParticleType; import net.minecraft.particle.ParticleType;
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
import ru.betterend.registry.ParticleRegistry; import ru.betterend.registry.EndParticles;
public class GlowingSphereParticleEffect implements ParticleEffect { public class GlowingSphereParticleEffect implements ParticleEffect {
private final float red; private final float red;
@ -21,7 +21,7 @@ public class GlowingSphereParticleEffect implements ParticleEffect {
@Override @Override
public ParticleType<?> getType() { public ParticleType<?> getType() {
return ParticleRegistry.GLOWING_SPHERE; return EndParticles.GLOWING_SPHERE;
} }
@Override @Override

View file

@ -3,7 +3,7 @@ package ru.betterend.recipe;
import net.minecraft.block.Blocks; import net.minecraft.block.Blocks;
import net.minecraft.item.Items; import net.minecraft.item.Items;
import ru.betterend.recipe.builders.AlloyingRecipe; import ru.betterend.recipe.builders.AlloyingRecipe;
import ru.betterend.registry.ItemRegistry; import ru.betterend.registry.EndItems;
public class AlloyingRecipes { public class AlloyingRecipes {
public static void register() { public static void register() {
@ -24,14 +24,14 @@ public class AlloyingRecipes {
.setSmeltTime(500) .setSmeltTime(500)
.build(); .build();
AlloyingRecipe.Builder.create("terminite_ingot") AlloyingRecipe.Builder.create("terminite_ingot")
.setInput(Items.IRON_INGOT, ItemRegistry.ENDER_DUST) .setInput(Items.IRON_INGOT, EndItems.ENDER_DUST)
.setOutput(ItemRegistry.TERMINITE_INGOT, 1) .setOutput(EndItems.TERMINITE_INGOT, 1)
.setExpiriense(2.5F) .setExpiriense(2.5F)
.setSmeltTime(450) .setSmeltTime(450)
.build(); .build();
AlloyingRecipe.Builder.create("aeternium_ingot") AlloyingRecipe.Builder.create("aeternium_ingot")
.setInput(ItemRegistry.TERMINITE_INGOT, Items.NETHERITE_INGOT) .setInput(EndItems.TERMINITE_INGOT, Items.NETHERITE_INGOT)
.setOutput(ItemRegistry.AETERNIUM_INGOT, 1) .setOutput(EndItems.AETERNIUM_INGOT, 1)
.setExpiriense(4.5F) .setExpiriense(4.5F)
.setSmeltTime(600) .setSmeltTime(600)
.build(); .build();

View file

@ -4,85 +4,85 @@ import net.minecraft.block.Blocks;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.Items; import net.minecraft.item.Items;
import ru.betterend.recipe.builders.RecipeBuilder; import ru.betterend.recipe.builders.RecipeBuilder;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.ItemRegistry; import ru.betterend.registry.EndItems;
public class CraftingRecipes { public class CraftingRecipes {
public static void register() { public static void register() {
RecipeBuilder.make("ender_pearl_to_block", BlockRegistry.ENDER_BLOCK) RecipeBuilder.make("ender_pearl_to_block", EndBlocks.ENDER_BLOCK)
.setShape(new String[] { "OO", "OO" }) .setShape(new String[] { "OO", "OO" })
.addMaterial('O', Items.ENDER_PEARL) .addMaterial('O', Items.ENDER_PEARL)
.build(); .build();
RecipeBuilder.make("ender_block_to_pearl", Items.ENDER_PEARL) RecipeBuilder.make("ender_block_to_pearl", Items.ENDER_PEARL)
.addMaterial('#', BlockRegistry.ENDER_BLOCK) .addMaterial('#', EndBlocks.ENDER_BLOCK)
.setOutputCount(4) .setOutputCount(4)
.setList("#") .setList("#")
.build(); .build();
RecipeBuilder.make("end_stone_smelter", BlockRegistry.END_STONE_SMELTER) RecipeBuilder.make("end_stone_smelter", EndBlocks.END_STONE_SMELTER)
.setShape(new String[] { "###", "V V", "###" }) .setShape(new String[] { "###", "V V", "###" })
.addMaterial('#', Blocks.END_STONE_BRICKS) .addMaterial('#', Blocks.END_STONE_BRICKS)
.addMaterial('V', Items.BUCKET) .addMaterial('V', Items.BUCKET)
.build(); .build();
String material = "terminite"; String material = "terminite";
RecipeBuilder.make(material + "_block", BlockRegistry.TERMINITE_BLOCK) RecipeBuilder.make(material + "_block", EndBlocks.TERMINITE_BLOCK)
.setShape(new String[] { "III", "III", "III" }) .setShape(new String[] { "III", "III", "III" })
.addMaterial('I', ItemRegistry.TERMINITE_INGOT) .addMaterial('I', EndItems.TERMINITE_INGOT)
.build(); .build();
RecipeBuilder.make(material + "_block_to_ingot", ItemRegistry.TERMINITE_INGOT) RecipeBuilder.make(material + "_block_to_ingot", EndItems.TERMINITE_INGOT)
.addMaterial('#', BlockRegistry.TERMINITE_BLOCK) .addMaterial('#', EndBlocks.TERMINITE_BLOCK)
.setOutputCount(9) .setOutputCount(9)
.setList("#") .setList("#")
.build(); .build();
registerHelmet(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_HELMET); registerHelmet(material, EndItems.TERMINITE_INGOT, EndItems.TERMINITE_HELMET);
registerChestplate(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_CHESTPLATE); registerChestplate(material, EndItems.TERMINITE_INGOT, EndItems.TERMINITE_CHESTPLATE);
registerLeggings(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_LEGGINGS); registerLeggings(material, EndItems.TERMINITE_INGOT, EndItems.TERMINITE_LEGGINGS);
registerBoots(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_BOOTS); registerBoots(material, EndItems.TERMINITE_INGOT, EndItems.TERMINITE_BOOTS);
registerShovel(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_SHOVEL); registerShovel(material, EndItems.TERMINITE_INGOT, EndItems.TERMINITE_SHOVEL);
registerSword(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_SWORD); registerSword(material, EndItems.TERMINITE_INGOT, EndItems.TERMINITE_SWORD);
registerPickaxe(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_PICKAXE); registerPickaxe(material, EndItems.TERMINITE_INGOT, EndItems.TERMINITE_PICKAXE);
registerAxe(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_AXE); registerAxe(material, EndItems.TERMINITE_INGOT, EndItems.TERMINITE_AXE);
registerHoe(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_HOE); registerHoe(material, EndItems.TERMINITE_INGOT, EndItems.TERMINITE_HOE);
registerHammer(material, ItemRegistry.TERMINITE_INGOT, ItemRegistry.TERMINITE_HAMMER); registerHammer(material, EndItems.TERMINITE_INGOT, EndItems.TERMINITE_HAMMER);
material = "aeternium"; material = "aeternium";
RecipeBuilder.make(material + "_block", BlockRegistry.AETERNIUM_BLOCK) RecipeBuilder.make(material + "_block", EndBlocks.AETERNIUM_BLOCK)
.setShape(new String[] { "III", "III", "III" }) .setShape(new String[] { "III", "III", "III" })
.addMaterial('I', ItemRegistry.AETERNIUM_INGOT) .addMaterial('I', EndItems.AETERNIUM_INGOT)
.build(); .build();
RecipeBuilder.make(material + "_block_to_ingot", ItemRegistry.AETERNIUM_INGOT) RecipeBuilder.make(material + "_block_to_ingot", EndItems.AETERNIUM_INGOT)
.addMaterial('#', BlockRegistry.AETERNIUM_BLOCK) .addMaterial('#', EndBlocks.AETERNIUM_BLOCK)
.setOutputCount(9) .setOutputCount(9)
.setList("#") .setList("#")
.build(); .build();
registerHelmet(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_HELMET); registerHelmet(material, EndItems.AETERNIUM_INGOT, EndItems.AETERNIUM_HELMET);
registerChestplate(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_CHESTPLATE); registerChestplate(material, EndItems.AETERNIUM_INGOT, EndItems.AETERNIUM_CHESTPLATE);
registerLeggings(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_LEGGINGS); registerLeggings(material, EndItems.AETERNIUM_INGOT, EndItems.AETERNIUM_LEGGINGS);
registerBoots(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_BOOTS); registerBoots(material, EndItems.AETERNIUM_INGOT, EndItems.AETERNIUM_BOOTS);
registerShovel(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_SHOVEL); registerShovel(material, EndItems.AETERNIUM_INGOT, EndItems.AETERNIUM_SHOVEL);
registerSword(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_SWORD); registerSword(material, EndItems.AETERNIUM_INGOT, EndItems.AETERNIUM_SWORD);
registerPickaxe(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_PICKAXE); registerPickaxe(material, EndItems.AETERNIUM_INGOT, EndItems.AETERNIUM_PICKAXE);
registerAxe(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_AXE); registerAxe(material, EndItems.AETERNIUM_INGOT, EndItems.AETERNIUM_AXE);
registerHoe(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_HOE); registerHoe(material, EndItems.AETERNIUM_INGOT, EndItems.AETERNIUM_HOE);
registerHammer(material, ItemRegistry.AETERNIUM_INGOT, ItemRegistry.AETERNIUM_HAMMER); registerHammer(material, EndItems.AETERNIUM_INGOT, EndItems.AETERNIUM_HAMMER);
registerHammer("iron", Items.IRON_INGOT, ItemRegistry.IRON_HAMMER); registerHammer("iron", Items.IRON_INGOT, EndItems.IRON_HAMMER);
registerHammer("golden", Items.GOLD_INGOT, ItemRegistry.GOLDEN_HAMMER); registerHammer("golden", Items.GOLD_INGOT, EndItems.GOLDEN_HAMMER);
registerHammer("diamond", Items.DIAMOND, ItemRegistry.DIAMOND_HAMMER); registerHammer("diamond", Items.DIAMOND, EndItems.DIAMOND_HAMMER);
registerHammer("netherite", Items.NETHERITE_INGOT, ItemRegistry.NETHERITE_HAMMER); registerHammer("netherite", Items.NETHERITE_INGOT, EndItems.NETHERITE_HAMMER);
RecipeBuilder.make("blue_vine_seed_dye", Items.BLUE_DYE).setList("#").addMaterial('#', BlockRegistry.BLUE_VINE_SEED).build(); RecipeBuilder.make("blue_vine_seed_dye", Items.BLUE_DYE).setList("#").addMaterial('#', EndBlocks.BLUE_VINE_SEED).build();
RecipeBuilder.make("creeping_moss_dye", Items.CYAN_DYE).setList("#").addMaterial('#', BlockRegistry.CREEPING_MOSS).build(); RecipeBuilder.make("creeping_moss_dye", Items.CYAN_DYE).setList("#").addMaterial('#', EndBlocks.CREEPING_MOSS).build();
RecipeBuilder.make("umbrella_moss_dye", Items.YELLOW_DYE).setList("#").addMaterial('#', BlockRegistry.UMBRELLA_MOSS).build(); RecipeBuilder.make("umbrella_moss_dye", Items.YELLOW_DYE).setList("#").addMaterial('#', EndBlocks.UMBRELLA_MOSS).build();
RecipeBuilder.make("umbrella_moss_tall_dye", Items.YELLOW_DYE).setList("#").addMaterial('#', BlockRegistry.UMBRELLA_MOSS_TALL).build(); RecipeBuilder.make("umbrella_moss_tall_dye", Items.YELLOW_DYE).setList("#").addMaterial('#', EndBlocks.UMBRELLA_MOSS_TALL).build();
RecipeBuilder.make("paper", Items.PAPER).setShape("###").addMaterial('#', ItemRegistry.END_LILY_LEAF_DRIED).setOutputCount(3).build(); RecipeBuilder.make("paper", Items.PAPER).setShape("###").addMaterial('#', EndItems.END_LILY_LEAF_DRIED).setOutputCount(3).build();
RecipeBuilder.make("aurora_block", BlockRegistry.AURORA_CRYSTAL).setShape("##", "##").addMaterial('#', ItemRegistry.CRYSTAL_SHARDS).build(); RecipeBuilder.make("aurora_block", EndBlocks.AURORA_CRYSTAL).setShape("##", "##").addMaterial('#', EndItems.CRYSTAL_SHARDS).build();
} }
private static void registerHelmet(String name, Item material, Item result) { private static void registerHelmet(String name, Item material, Item result) {

View file

@ -1,10 +1,10 @@
package ru.betterend.recipe; package ru.betterend.recipe;
import ru.betterend.recipe.builders.FurnaceRecipe; import ru.betterend.recipe.builders.FurnaceRecipe;
import ru.betterend.registry.ItemRegistry; import ru.betterend.registry.EndItems;
public class SmeltigRecipes { public class SmeltigRecipes {
public static void register() { public static void register() {
FurnaceRecipe.make("end_lily_leaf_dried", ItemRegistry.END_LILY_LEAF, ItemRegistry.END_LILY_LEAF_DRIED).build(); FurnaceRecipe.make("end_lily_leaf_dried", EndItems.END_LILY_LEAF, EndItems.END_LILY_LEAF_DRIED).build();
} }
} }

View file

@ -2,13 +2,13 @@ package ru.betterend.recipe;
import net.minecraft.item.Items; import net.minecraft.item.Items;
import ru.betterend.recipe.builders.AnvilSmithingRecipe; import ru.betterend.recipe.builders.AnvilSmithingRecipe;
import ru.betterend.registry.ItemRegistry; import ru.betterend.registry.EndItems;
public class SmithingRecipes { public class SmithingRecipes {
public static void register() { public static void register() {
AnvilSmithingRecipe.Builder.create("ender_pearl_to_dust") AnvilSmithingRecipe.Builder.create("ender_pearl_to_dust")
.setInput(Items.ENDER_PEARL) .setInput(Items.ENDER_PEARL)
.setOutput(ItemRegistry.ENDER_DUST, 1) .setOutput(EndItems.ENDER_DUST, 1)
.setLevel(4) .setLevel(4)
.setDamage(5) .setDamage(5)
.build(); .build();

View file

@ -22,7 +22,7 @@ import net.minecraft.util.registry.Registry;
import net.minecraft.world.World; import net.minecraft.world.World;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
import ru.betterend.recipe.EndRecipeManager; import ru.betterend.recipe.EndRecipeManager;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.util.RecipeHelper; import ru.betterend.util.RecipeHelper;
public class AlloyingRecipe implements Recipe<Inventory> { public class AlloyingRecipe implements Recipe<Inventory> {
@ -113,7 +113,7 @@ public class AlloyingRecipe implements Recipe<Inventory> {
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
public ItemStack getRecipeKindIcon() { public ItemStack getRecipeKindIcon() {
return new ItemStack(BlockRegistry.END_STONE_SMELTER); return new ItemStack(EndBlocks.END_STONE_SMELTER);
} }
public static class Builder { public static class Builder {

View file

@ -23,7 +23,7 @@ import net.minecraft.util.registry.Registry;
import net.minecraft.world.World; import net.minecraft.world.World;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
import ru.betterend.recipe.EndRecipeManager; import ru.betterend.recipe.EndRecipeManager;
import ru.betterend.registry.ItemTagRegistry; import ru.betterend.registry.EndTags;
import ru.betterend.util.RecipeHelper; import ru.betterend.util.RecipeHelper;
public class AnvilSmithingRecipe implements Recipe<Inventory> { public class AnvilSmithingRecipe implements Recipe<Inventory> {
@ -81,7 +81,7 @@ public class AnvilSmithingRecipe implements Recipe<Inventory> {
public boolean matches(Inventory craftingInventory) { public boolean matches(Inventory craftingInventory) {
ItemStack hammer = craftingInventory.getStack(0); ItemStack hammer = craftingInventory.getStack(0);
if (hammer.isEmpty() || !ItemTagRegistry.HAMMERS.contains(hammer.getItem())) { if (hammer.isEmpty() || !EndTags.HAMMERS.contains(hammer.getItem())) {
return false; return false;
} }
int level = ((ToolItem) hammer.getItem()).getMaterial().getMiningLevel(); int level = ((ToolItem) hammer.getItem()).getMaterial().getMiningLevel();
@ -95,7 +95,7 @@ public class AnvilSmithingRecipe implements Recipe<Inventory> {
@Override @Override
public DefaultedList<Ingredient> getPreviewInputs() { public DefaultedList<Ingredient> getPreviewInputs() {
DefaultedList<Ingredient> defaultedList = DefaultedList.of(); DefaultedList<Ingredient> defaultedList = DefaultedList.of();
defaultedList.add(Ingredient.ofStacks(ItemTagRegistry.HAMMERS.values().stream().filter(hammer -> { defaultedList.add(Ingredient.ofStacks(EndTags.HAMMERS.values().stream().filter(hammer -> {
return ((ToolItem) hammer).getMaterial().getMiningLevel() >= level; return ((ToolItem) hammer).getMaterial().getMiningLevel() >= level;
}).map(ItemStack::new))); }).map(ItemStack::new)));
defaultedList.add(input); defaultedList.add(input);

View file

@ -28,7 +28,7 @@ import ru.betterend.world.biome.EndBiome;
import ru.betterend.world.generator.BiomePicker; import ru.betterend.world.generator.BiomePicker;
import ru.betterend.world.generator.BiomeType; import ru.betterend.world.generator.BiomeType;
public class BiomeRegistry { public class EndBiomes {
private static final Map<EndBiome, RegistryKey<Biome>> KEYS = Maps.newHashMap(); private static final Map<EndBiome, RegistryKey<Biome>> KEYS = Maps.newHashMap();
private static final HashMap<Identifier, EndBiome> ID_MAP = Maps.newHashMap(); private static final HashMap<Identifier, EndBiome> ID_MAP = Maps.newHashMap();
private static final HashMap<Biome, EndBiome> MUTABLE = Maps.newHashMap(); private static final HashMap<Biome, EndBiome> MUTABLE = Maps.newHashMap();
@ -59,15 +59,15 @@ public class BiomeRegistry {
public static void register() {} public static void register() {}
public static void mutateRegistry(Registry<Biome> biomeRegistry) { public static void mutateRegistry(Registry<Biome> biomeRegistry) {
BiomeRegistry.biomeRegistry = biomeRegistry; EndBiomes.biomeRegistry = biomeRegistry;
BiomeRegistry.MUTABLE.clear(); EndBiomes.MUTABLE.clear();
LAND_BIOMES.clearMutables(); LAND_BIOMES.clearMutables();
for (EndBiome biome : BiomeRegistry.LAND_BIOMES.getBiomes()) for (EndBiome biome : EndBiomes.LAND_BIOMES.getBiomes())
BiomeRegistry.MUTABLE.put(biomeRegistry.getOrThrow(BiomeRegistry.getBiomeKey(biome)), biome); EndBiomes.MUTABLE.put(biomeRegistry.getOrThrow(EndBiomes.getBiomeKey(biome)), biome);
for (EndBiome biome : BiomeRegistry.VOID_BIOMES.getBiomes()) for (EndBiome biome : EndBiomes.VOID_BIOMES.getBiomes())
BiomeRegistry.MUTABLE.put(biomeRegistry.getOrThrow(BiomeRegistry.getBiomeKey(biome)), biome); EndBiomes.MUTABLE.put(biomeRegistry.getOrThrow(EndBiomes.getBiomeKey(biome)), biome);
biomeRegistry.forEach((biome) -> { biomeRegistry.forEach((biome) -> {
if (biome.getCategory() == Category.THEEND) { if (biome.getCategory() == Category.THEEND) {
@ -166,8 +166,8 @@ public class BiomeRegistry {
public static List<EndBiome> getModBiomes() { public static List<EndBiome> getModBiomes() {
List<EndBiome> result = Lists.newArrayList(); List<EndBiome> result = Lists.newArrayList();
result.addAll(BiomeRegistry.LAND_BIOMES.getBiomes()); result.addAll(EndBiomes.LAND_BIOMES.getBiomes());
result.addAll(BiomeRegistry.VOID_BIOMES.getBiomes()); result.addAll(EndBiomes.VOID_BIOMES.getBiomes());
return result; return result;
} }
} }

View file

@ -19,9 +19,9 @@ import ru.betterend.blocks.entities.EChestBlockEntity;
import ru.betterend.blocks.entities.ESignBlockEntity; import ru.betterend.blocks.entities.ESignBlockEntity;
import ru.betterend.blocks.entities.EndStoneSmelterBlockEntity; import ru.betterend.blocks.entities.EndStoneSmelterBlockEntity;
public class BlockEntityRegistry { public class EndBlockEntities {
public final static BlockEntityType<EndStoneSmelterBlockEntity> END_STONE_SMELTER = registerBlockEntity(EndStoneSmelter.ID, public final static BlockEntityType<EndStoneSmelterBlockEntity> END_STONE_SMELTER = registerBlockEntity(EndStoneSmelter.ID,
BlockEntityType.Builder.create(EndStoneSmelterBlockEntity::new, BlockRegistry.END_STONE_SMELTER)); BlockEntityType.Builder.create(EndStoneSmelterBlockEntity::new, EndBlocks.END_STONE_SMELTER));
public static final BlockEntityType<EChestBlockEntity> CHEST = registerBlockEntity("chest", public static final BlockEntityType<EChestBlockEntity> CHEST = registerBlockEntity("chest",
BlockEntityType.Builder.create(EChestBlockEntity::new, getChests())); BlockEntityType.Builder.create(EChestBlockEntity::new, getChests()));
public static final BlockEntityType<EBarrelBlockEntity> BARREL = registerBlockEntity("barrel", public static final BlockEntityType<EBarrelBlockEntity> BARREL = registerBlockEntity("barrel",
@ -37,7 +37,7 @@ public class BlockEntityRegistry {
static Block[] getChests() { static Block[] getChests() {
List<Block> result = Lists.newArrayList(); List<Block> result = Lists.newArrayList();
ItemRegistry.getModBlocks().forEach((item) -> { EndItems.getModBlocks().forEach((item) -> {
if (item instanceof BlockItem) { if (item instanceof BlockItem) {
Block block = ((BlockItem) item).getBlock(); Block block = ((BlockItem) item).getBlock();
if (block instanceof BlockChest) { if (block instanceof BlockChest) {
@ -50,7 +50,7 @@ public class BlockEntityRegistry {
static Block[] getBarrels() { static Block[] getBarrels() {
List<Block> result = Lists.newArrayList(); List<Block> result = Lists.newArrayList();
ItemRegistry.getModBlocks().forEach((item) -> { EndItems.getModBlocks().forEach((item) -> {
if (item instanceof BlockItem) { if (item instanceof BlockItem) {
Block block = ((BlockItem) item).getBlock(); Block block = ((BlockItem) item).getBlock();
if (block instanceof BlockBarrel) { if (block instanceof BlockBarrel) {
@ -63,7 +63,7 @@ public class BlockEntityRegistry {
static Block[] getSigns() { static Block[] getSigns() {
List<Block> result = Lists.newArrayList(); List<Block> result = Lists.newArrayList();
ItemRegistry.getModBlocks().forEach((item) -> { EndItems.getModBlocks().forEach((item) -> {
if (item instanceof BlockItem) { if (item instanceof BlockItem) {
Block block = ((BlockItem) item).getBlock(); Block block = ((BlockItem) item).getBlock();
if (block instanceof BlockSign) { if (block instanceof BlockSign) {

View file

@ -6,10 +6,10 @@ import net.fabricmc.fabric.api.client.rendereregistry.v1.BlockEntityRendererRegi
import ru.betterend.blocks.entities.render.EChestBlockEntityRenderer; import ru.betterend.blocks.entities.render.EChestBlockEntityRenderer;
import ru.betterend.blocks.entities.render.ESignBlockEntityRenderer; import ru.betterend.blocks.entities.render.ESignBlockEntityRenderer;
public class BlockEntityRenderRegistry { public class EndBlockEntityRenders {
@Environment(EnvType.CLIENT) @Environment(EnvType.CLIENT)
public static void register() { public static void register() {
BlockEntityRendererRegistry.INSTANCE.register(BlockEntityRegistry.CHEST, EChestBlockEntityRenderer::new); BlockEntityRendererRegistry.INSTANCE.register(EndBlockEntities.CHEST, EChestBlockEntityRenderer::new);
BlockEntityRendererRegistry.INSTANCE.register(BlockEntityRegistry.SIGN, ESignBlockEntityRenderer::new); BlockEntityRendererRegistry.INSTANCE.register(EndBlockEntities.SIGN, ESignBlockEntityRenderer::new);
} }
} }

View file

@ -46,7 +46,7 @@ import ru.betterend.blocks.complex.StoneMaterial;
import ru.betterend.blocks.complex.WoodenMaterial; import ru.betterend.blocks.complex.WoodenMaterial;
import ru.betterend.tab.CreativeTab; import ru.betterend.tab.CreativeTab;
public class BlockRegistry { public class EndBlocks {
// Terrain // // Terrain //
public static final Block ENDSTONE_DUST = registerBlock("endstone_dust", new BlockEndstoneDust()); public static final Block ENDSTONE_DUST = registerBlock("endstone_dust", new BlockEndstoneDust());
public static final Block END_MYCELIUM = registerBlock("end_mycelium", new BlockTerrain(MaterialColor.LIGHT_BLUE)); public static final Block END_MYCELIUM = registerBlock("end_mycelium", new BlockTerrain(MaterialColor.LIGHT_BLUE));
@ -108,7 +108,7 @@ public class BlockRegistry {
public static final Block DENSE_VINE = registerBlock("dense_vine", new BlockVine(15, true)); public static final Block DENSE_VINE = registerBlock("dense_vine", new BlockVine(15, true));
// Ores // // Ores //
public static final Block ENDER_ORE = registerBlock("ender_ore", new BlockOre(ItemRegistry.ENDER_DUST, 1, 3)); public static final Block ENDER_ORE = registerBlock("ender_ore", new BlockOre(EndItems.ENDER_DUST, 1, 3));
// Materials // // Materials //
public static final Block TERMINITE_BLOCK = registerBlock("terminite_block", new TerminiteBlock()); public static final Block TERMINITE_BLOCK = registerBlock("terminite_block", new TerminiteBlock());
@ -127,7 +127,7 @@ public class BlockRegistry {
public static Block registerBlock(String name, Block block) { public static Block registerBlock(String name, Block block) {
Registry.register(Registry.BLOCK, BetterEnd.makeID(name), block); Registry.register(Registry.BLOCK, BetterEnd.makeID(name), block);
ItemRegistry.registerItem(name, new BlockItem(block, new Item.Settings().group(CreativeTab.END_TAB))); EndItems.registerItem(name, new BlockItem(block, new Item.Settings().group(CreativeTab.END_TAB)));
return block; return block;
} }

View file

@ -17,7 +17,7 @@ import ru.betterend.entity.EntityEndSlime;
import ru.betterend.util.MHelper; import ru.betterend.util.MHelper;
import ru.betterend.util.SpawnHelper; import ru.betterend.util.SpawnHelper;
public class EntityRegistry { public class EndEntities {
public static final EntityType<EntityDragonfly> DRAGONFLY = register("dragonfly", SpawnGroup.AMBIENT, 0.6F, 0.5F, EntityDragonfly::new, EntityDragonfly.createMobAttributes(), true, MHelper.color(32, 42, 176), MHelper.color(115, 225, 249)); public static final EntityType<EntityDragonfly> DRAGONFLY = register("dragonfly", SpawnGroup.AMBIENT, 0.6F, 0.5F, EntityDragonfly::new, EntityDragonfly.createMobAttributes(), true, MHelper.color(32, 42, 176), MHelper.color(115, 225, 249));
public static final EntityType<EntityEndSlime> END_SLIME = register("end_slime", SpawnGroup.MONSTER, 2F, 2F, EntityEndSlime::new, EntityEndSlime.createMobAttributes(), false, MHelper.color(28, 28, 28), MHelper.color(99, 11, 99)); public static final EntityType<EntityEndSlime> END_SLIME = register("end_slime", SpawnGroup.MONSTER, 2F, 2F, EntityEndSlime::new, EntityEndSlime.createMobAttributes(), false, MHelper.color(28, 28, 28), MHelper.color(99, 11, 99));
public static final EntityType<EntityEndFish> END_FISH = register("end_fish", SpawnGroup.WATER_AMBIENT, 0.5F, 0.5F, EntityEndFish::new, EntityEndFish.createMobAttributes(), true, MHelper.color(3, 50, 76), MHelper.color(120, 206, 255)); public static final EntityType<EntityEndFish> END_FISH = register("end_fish", SpawnGroup.WATER_AMBIENT, 0.5F, 0.5F, EntityEndFish::new, EntityEndFish.createMobAttributes(), true, MHelper.color(3, 50, 76), MHelper.color(120, 206, 255));
@ -35,7 +35,7 @@ public class EntityRegistry {
private static <T extends LivingEntity> EntityType<T> register(String name, SpawnGroup group, float width, float height, EntityFactory<T> entity, Builder attributes, boolean fixedSize, int eggColor, int dotsColor) { private static <T extends LivingEntity> EntityType<T> register(String name, SpawnGroup group, float width, float height, EntityFactory<T> entity, Builder attributes, boolean fixedSize, int eggColor, int dotsColor) {
EntityType<T> type = Registry.register(Registry.ENTITY_TYPE, BetterEnd.makeID(name), FabricEntityTypeBuilder.<T>create(group, entity).dimensions(fixedSize ? EntityDimensions.fixed(width, height) : EntityDimensions.changing(width, height)).build()); EntityType<T> type = Registry.register(Registry.ENTITY_TYPE, BetterEnd.makeID(name), FabricEntityTypeBuilder.<T>create(group, entity).dimensions(fixedSize ? EntityDimensions.fixed(width, height) : EntityDimensions.changing(width, height)).build());
FabricDefaultAttributeRegistry.register(type, attributes); FabricDefaultAttributeRegistry.register(type, attributes);
ItemRegistry.registerEgg("spawn_egg_" + name, type, eggColor, dotsColor); EndItems.registerEgg("spawn_egg_" + name, type, eggColor, dotsColor);
return type; return type;
} }
} }

View file

@ -7,12 +7,12 @@ import ru.betterend.entity.render.RendererEntityDragonfly;
import ru.betterend.entity.render.RendererEntityEndFish; import ru.betterend.entity.render.RendererEntityEndFish;
import ru.betterend.entity.render.RendererEntityEndSlime; import ru.betterend.entity.render.RendererEntityEndSlime;
public class EntityRenderRegistry { public class EndEntitiesRenders {
public static void register() { public static void register() {
register(EntityRegistry.DRAGONFLY, RendererEntityDragonfly.class); register(EndEntities.DRAGONFLY, RendererEntityDragonfly.class);
register(EntityRegistry.END_SLIME, RendererEntityEndSlime.class); register(EndEntities.END_SLIME, RendererEntityEndSlime.class);
register(EntityRegistry.END_FISH, RendererEntityEndFish.class); register(EndEntities.END_FISH, RendererEntityEndFish.class);
} }
private static void register(EntityType<?> type, Class<? extends MobEntityRenderer<?, ?>> renderer) { private static void register(EntityType<?> type, Class<? extends MobEntityRenderer<?, ?>> renderer) {

View file

@ -28,7 +28,7 @@ import ru.betterend.world.features.SinglePlantFeature;
import ru.betterend.world.features.UnderwaterPlantFeature; import ru.betterend.world.features.UnderwaterPlantFeature;
import ru.betterend.world.features.VineFeature; import ru.betterend.world.features.VineFeature;
public class FeatureRegistry { public class EndFeatures {
// Trees // // Trees //
public static final EndFeature MOSSY_GLOWSHROOM = new EndFeature("mossy_glowshroom", new MossyGlowshroomFeature(), 3); public static final EndFeature MOSSY_GLOWSHROOM = new EndFeature("mossy_glowshroom", new MossyGlowshroomFeature(), 3);
public static final EndFeature PYTHADENDRON_TREE = new EndFeature("pythadendron_tree", new PythadendronTreeFeature(), 2); public static final EndFeature PYTHADENDRON_TREE = new EndFeature("pythadendron_tree", new PythadendronTreeFeature(), 2);
@ -37,17 +37,17 @@ public class FeatureRegistry {
public static final EndFeature PYTHADENDRON_BUSH = new EndFeature("pythadendron_bush", new PythadendronBushFeature(), 4); public static final EndFeature PYTHADENDRON_BUSH = new EndFeature("pythadendron_bush", new PythadendronBushFeature(), 4);
// Plants // // Plants //
public static final EndFeature UMBRELLA_MOSS = new EndFeature("umbrella_moss", new DoublePlantFeature(BlockRegistry.UMBRELLA_MOSS, BlockRegistry.UMBRELLA_MOSS_TALL, 5), 5); public static final EndFeature UMBRELLA_MOSS = new EndFeature("umbrella_moss", new DoublePlantFeature(EndBlocks.UMBRELLA_MOSS, EndBlocks.UMBRELLA_MOSS_TALL, 5), 5);
public static final EndFeature CREEPING_MOSS = new EndFeature("creeping_moss", new SinglePlantFeature(BlockRegistry.CREEPING_MOSS, 5), 5); public static final EndFeature CREEPING_MOSS = new EndFeature("creeping_moss", new SinglePlantFeature(EndBlocks.CREEPING_MOSS, 5), 5);
public static final EndFeature BLUE_VINE = new EndFeature("blue_vine", new BlueVineFeature(), 1); public static final EndFeature BLUE_VINE = new EndFeature("blue_vine", new BlueVineFeature(), 1);
public static final EndFeature CHORUS_GRASS = new EndFeature("chorus_grass", new SinglePlantFeature(BlockRegistry.CHORUS_GRASS, 4), 5); public static final EndFeature CHORUS_GRASS = new EndFeature("chorus_grass", new SinglePlantFeature(EndBlocks.CHORUS_GRASS, 4), 5);
public static final EndFeature CAVE_GRASS = new EndFeature("cave_grass", new CavePlantFeature(BlockRegistry.CAVE_GRASS, 7), 7); public static final EndFeature CAVE_GRASS = new EndFeature("cave_grass", new CavePlantFeature(EndBlocks.CAVE_GRASS, 7), 7);
public static final EndFeature CRYSTAL_GRASS = new EndFeature("crystal_grass", new SinglePlantFeature(BlockRegistry.CRYSTAL_GRASS, 8, false), 5); public static final EndFeature CRYSTAL_GRASS = new EndFeature("crystal_grass", new SinglePlantFeature(EndBlocks.CRYSTAL_GRASS, 8, false), 5);
public static final EndFeature DENSE_VINE = new EndFeature("dense_vine", new VineFeature(BlockRegistry.DENSE_VINE, 24), 3); public static final EndFeature DENSE_VINE = new EndFeature("dense_vine", new VineFeature(EndBlocks.DENSE_VINE, 24), 3);
public static final EndFeature BUBBLE_CORAL = new EndFeature("bubble_coral", new UnderwaterPlantFeature(BlockRegistry.BUBBLE_CORAL, 10), 10); public static final EndFeature BUBBLE_CORAL = new EndFeature("bubble_coral", new UnderwaterPlantFeature(EndBlocks.BUBBLE_CORAL, 10), 10);
public static final EndFeature BUBBLE_CORAL_RARE = new EndFeature("bubble_coral_rare", new UnderwaterPlantFeature(BlockRegistry.BUBBLE_CORAL, 3), 2); public static final EndFeature BUBBLE_CORAL_RARE = new EndFeature("bubble_coral_rare", new UnderwaterPlantFeature(EndBlocks.BUBBLE_CORAL, 3), 2);
public static final EndFeature END_LILY = new EndFeature("end_lily", new EndLilyFeature(10), 10); public static final EndFeature END_LILY = new EndFeature("end_lily", new EndLilyFeature(10), 10);
public static final EndFeature END_LILY_RARE = new EndFeature("end_lily_rare", new EndLilyFeature(3), 1); public static final EndFeature END_LILY_RARE = new EndFeature("end_lily_rare", new EndLilyFeature(3), 1);
public static final EndFeature END_LOTUS = new EndFeature("end_lotus", new EndLotusFeature(7), 5); public static final EndFeature END_LOTUS = new EndFeature("end_lotus", new EndLotusFeature(7), 5);
@ -60,13 +60,13 @@ public class FeatureRegistry {
public static final EndFeature ROUND_CAVE_RARE = EndFeature.makeRawGenFeature("round_cave_rare", new RoundCaveFeature(), 25); public static final EndFeature ROUND_CAVE_RARE = EndFeature.makeRawGenFeature("round_cave_rare", new RoundCaveFeature(), 25);
// Ores // // Ores //
public static final EndFeature ENDER_ORE = EndFeature.makeOreFeature("ender_ore", BlockRegistry.ENDER_ORE, 6, 3, 0, 4, 96); public static final EndFeature ENDER_ORE = EndFeature.makeOreFeature("ender_ore", EndBlocks.ENDER_ORE, 6, 3, 0, 4, 96);
public static final EndFeature VIOLECITE_LAYER = EndFeature.makeLayerFeature("violecite_layer", BlockRegistry.VIOLECITE, 15, 4, 96, 8); public static final EndFeature VIOLECITE_LAYER = EndFeature.makeLayerFeature("violecite_layer", EndBlocks.VIOLECITE, 15, 4, 96, 8);
public static final EndFeature FLAVOLITE_LAYER = EndFeature.makeLayerFeature("flavolite_layer", BlockRegistry.FLAVOLITE, 12, 4, 96, 6); public static final EndFeature FLAVOLITE_LAYER = EndFeature.makeLayerFeature("flavolite_layer", EndBlocks.FLAVOLITE, 12, 4, 96, 6);
// Other // // Other //
public static final EndPortalFeature END_PORTAL = new EndPortalFeature(new DefaultEndPortalFeature(), (RunedFlavolite) BlockRegistry.FLAVOLITE_RUNED); public static final EndPortalFeature END_PORTAL = new EndPortalFeature(new DefaultEndPortalFeature(), (RunedFlavolite) EndBlocks.FLAVOLITE_RUNED);
public static final EndPortalFeature END_PORTAL_ETERNAL = new EndPortalFeature(new DefaultEndPortalFeature(), (RunedFlavolite) BlockRegistry.FLAVOLITE_RUNED_ETERNAL); public static final EndPortalFeature END_PORTAL_ETERNAL = new EndPortalFeature(new DefaultEndPortalFeature(), (RunedFlavolite) EndBlocks.FLAVOLITE_RUNED_ETERNAL);
public static void registerBiomeFeatures(Identifier id, Biome biome, List<List<Supplier<ConfiguredFeature<?, ?>>>> features) { public static void registerBiomeFeatures(Identifier id, Biome biome, List<List<Supplier<ConfiguredFeature<?, ?>>>> features) {
if (id.getNamespace().equals("minecraft")) { if (id.getNamespace().equals("minecraft")) {

View file

@ -36,7 +36,7 @@ import ru.betterend.item.EternalCrystal;
import ru.betterend.tab.CreativeTab; import ru.betterend.tab.CreativeTab;
import ru.betterend.util.TagHelper; import ru.betterend.util.TagHelper;
public class ItemRegistry { public class EndItems {
private static final List<Item> MOD_BLOCKS = Lists.newArrayList(); private static final List<Item> MOD_BLOCKS = Lists.newArrayList();
private static final List<Item> MOD_ITEMS = Lists.newArrayList(); private static final List<Item> MOD_ITEMS = Lists.newArrayList();
@ -105,7 +105,7 @@ public class ItemRegistry {
} else if (item instanceof EndHoe) { } else if (item instanceof EndHoe) {
TagHelper.addTag((Tag.Identified<Item>) FabricToolTags.HOES, item); TagHelper.addTag((Tag.Identified<Item>) FabricToolTags.HOES, item);
} else if (item instanceof EndHammer) { } else if (item instanceof EndHammer) {
TagHelper.addTag((Tag.Identified<Item>) ItemTagRegistry.HAMMERS, item); TagHelper.addTag((Tag.Identified<Item>) EndTags.HAMMERS, item);
} }
return item; return item;

View file

@ -8,7 +8,7 @@ import ru.betterend.BetterEnd;
import ru.betterend.particle.ParticleGlowingSphere; import ru.betterend.particle.ParticleGlowingSphere;
import ru.betterend.particle.PaticlePortalSphere; import ru.betterend.particle.PaticlePortalSphere;
public class ParticleRegistry { public class EndParticles {
public static final DefaultParticleType GLOWING_SPHERE = register("glowing_sphere"); public static final DefaultParticleType GLOWING_SPHERE = register("glowing_sphere");
public static final DefaultParticleType PORTAL_SPHERE = register("portal_sphere"); public static final DefaultParticleType PORTAL_SPHERE = register("portal_sphere");

View file

@ -4,7 +4,7 @@ import net.fabricmc.fabric.api.client.screenhandler.v1.ScreenRegistry;
import ru.betterend.client.gui.EndStoneSmelterScreen; import ru.betterend.client.gui.EndStoneSmelterScreen;
import ru.betterend.client.gui.EndStoneSmelterScreenHandler; import ru.betterend.client.gui.EndStoneSmelterScreenHandler;
public class ScreensRegistry { public class EndScreens {
public static void register() { public static void register() {
ScreenRegistry.register(EndStoneSmelterScreenHandler.HANDLER_TYPE, EndStoneSmelterScreen::new); ScreenRegistry.register(EndStoneSmelterScreenHandler.HANDLER_TYPE, EndStoneSmelterScreen::new);
} }

View file

@ -4,7 +4,7 @@ import net.minecraft.sound.SoundEvent;
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
public class SoundRegistry { public class EndSounds {
// Music // Music
public static final SoundEvent MUSIC_FOGGY_MUSHROOMLAND = register("music", "foggy_mushroomland"); public static final SoundEvent MUSIC_FOGGY_MUSHROOMLAND = register("music", "foggy_mushroomland");
public static final SoundEvent MUSIC_CHORUS_FOREST = register("music", "chorus_forest"); public static final SoundEvent MUSIC_CHORUS_FOREST = register("music", "chorus_forest");
@ -16,6 +16,7 @@ public class SoundRegistry {
public static final SoundEvent AMBIENT_FOGGY_MUSHROOMLAND = register("ambient", "foggy_mushroomland"); public static final SoundEvent AMBIENT_FOGGY_MUSHROOMLAND = register("ambient", "foggy_mushroomland");
public static final SoundEvent AMBIENT_CHORUS_FOREST = register("ambient", "chorus_forest"); public static final SoundEvent AMBIENT_CHORUS_FOREST = register("ambient", "chorus_forest");
public static final SoundEvent AMBIENT_MEGALAKE = register("ambient", "megalake"); public static final SoundEvent AMBIENT_MEGALAKE = register("ambient", "megalake");
public static final SoundEvent AMBIENT_DUST_WASTELANDS = register("ambient", "dust_wastelands");
// Entity // Entity
public static final SoundEvent ENTITY_DRAGONFLY = register("entity", "dragonfly"); public static final SoundEvent ENTITY_DRAGONFLY = register("entity", "dragonfly");

View file

@ -21,7 +21,7 @@ import ru.betterend.world.structures.piece.MountainPiece;
import ru.betterend.world.structures.piece.PaintedMountainPiece; import ru.betterend.world.structures.piece.PaintedMountainPiece;
import ru.betterend.world.structures.piece.VoxelPiece; import ru.betterend.world.structures.piece.VoxelPiece;
public class StructureRegistry { public class EndStructures {
public static final StructurePieceType VOXEL_PIECE = register("voxel", VoxelPiece::new); public static final StructurePieceType VOXEL_PIECE = register("voxel", VoxelPiece::new);
public static final StructurePieceType MOUNTAIN_PIECE = register("mountain_piece", MountainPiece::new); public static final StructurePieceType MOUNTAIN_PIECE = register("mountain_piece", MountainPiece::new);
public static final StructurePieceType CAVE_PIECE = register("cave_piece", CavePiece::new); public static final StructurePieceType CAVE_PIECE = register("cave_piece", CavePiece::new);

View file

@ -1,12 +1,18 @@
package ru.betterend.registry; package ru.betterend.registry;
import java.util.Arrays;
import net.fabricmc.fabric.api.tag.TagRegistry; import net.fabricmc.fabric.api.tag.TagRegistry;
import net.fabricmc.fabric.impl.tool.attribute.ToolManagerImpl;
import net.fabricmc.fabric.impl.tool.attribute.handlers.ModdedToolsVanillaBlocksToolHandler;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.BlockState; import net.minecraft.block.BlockState;
import net.minecraft.item.BlockItem; import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.tag.BlockTags; import net.minecraft.tag.BlockTags;
import net.minecraft.tag.Tag; import net.minecraft.tag.Tag;
import net.minecraft.tag.Tag.Identified; import net.minecraft.tag.Tag.Identified;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.Registry;
import net.minecraft.world.biome.Biome; import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.Biome.Category; import net.minecraft.world.biome.Biome.Category;
@ -15,18 +21,22 @@ import ru.betterend.BetterEnd;
import ru.betterend.blocks.BlockTerrain; import ru.betterend.blocks.BlockTerrain;
import ru.betterend.util.TagHelper; import ru.betterend.util.TagHelper;
public class BlockTagRegistry { public class EndTags {
// Block Tags
public static final Tag.Identified<Block> END_GROUND = makeTag("end_ground"); public static final Tag.Identified<Block> END_GROUND = makeTag("end_ground");
public static final Tag.Identified<Block> GEN_TERRAIN = makeTag("gen_terrain"); public static final Tag.Identified<Block> GEN_TERRAIN = makeTag("gen_terrain");
// Item Tags
public final static Tag<Item> HAMMERS = registerFabricItemTag("hammers");
private static Tag.Identified<Block> makeTag(String name) { private static Tag.Identified<Block> makeTag(String name) {
return (Identified<Block>) TagRegistry.block(BetterEnd.makeID(name)); return (Identified<Block>) TagRegistry.block(BetterEnd.makeID(name));
} }
public static void register() { public static void register() {
addSurfaceBlock(BlockRegistry.ENDSTONE_DUST); addSurfaceBlock(EndBlocks.ENDSTONE_DUST);
ItemRegistry.getModBlocks().forEach((item) -> { EndItems.getModBlocks().forEach((item) -> {
Block block = ((BlockItem) item).getBlock(); Block block = ((BlockItem) item).getBlock();
if (block instanceof BlockTerrain) { if (block instanceof BlockTerrain) {
addSurfaceBlock(block); addSurfaceBlock(block);
@ -34,7 +44,18 @@ public class BlockTagRegistry {
} }
}); });
TagHelper.addTag(GEN_TERRAIN, BlockRegistry.ENDER_ORE, BlockRegistry.FLAVOLITE.stone, BlockRegistry.VIOLECITE.stone); TagHelper.addTag(GEN_TERRAIN, EndBlocks.ENDER_ORE, EndBlocks.FLAVOLITE.stone, EndBlocks.VIOLECITE.stone);
ToolManagerImpl.tag(HAMMERS).register(new ModdedToolsVanillaBlocksToolHandler(
Arrays.asList(
EndItems.IRON_HAMMER,
EndItems.GOLDEN_HAMMER,
EndItems.DIAMOND_HAMMER,
EndItems.NETHERITE_HAMMER,
EndItems.TERMINITE_HAMMER,
EndItems.AETERNIUM_HAMMER
)
));
} }
public static void addSurfaceBlock(Block block) { public static void addSurfaceBlock(Block block) {
@ -54,4 +75,12 @@ public class BlockTagRegistry {
public static boolean validGenBlock(BlockState block) { public static boolean validGenBlock(BlockState block) {
return block.isIn(END_GROUND) || block.isIn(GEN_TERRAIN); return block.isIn(END_GROUND) || block.isIn(GEN_TERRAIN);
} }
public static Tag<Item> registerItemTag(String name) {
return TagRegistry.item(BetterEnd.makeID(name));
}
public static Tag<Item> registerFabricItemTag(String name) {
return TagRegistry.item(new Identifier("fabric", name));
}
} }

View file

@ -1,36 +0,0 @@
package ru.betterend.registry;
import java.util.Arrays;
import net.fabricmc.fabric.api.tag.TagRegistry;
import net.fabricmc.fabric.impl.tool.attribute.ToolManagerImpl;
import net.fabricmc.fabric.impl.tool.attribute.handlers.ModdedToolsVanillaBlocksToolHandler;
import net.minecraft.item.Item;
import net.minecraft.tag.Tag;
import net.minecraft.util.Identifier;
import ru.betterend.BetterEnd;
public class ItemTagRegistry {
public final static Tag<Item> HAMMERS = registerFabricItemTag("hammers");
public static Tag<Item> registerItemTag(String name) {
return TagRegistry.item(BetterEnd.makeID(name));
}
public static Tag<Item> registerFabricItemTag(String name) {
return TagRegistry.item(new Identifier("fabric", name));
}
public static void register() {
ToolManagerImpl.tag(HAMMERS).register(new ModdedToolsVanillaBlocksToolHandler(
Arrays.asList(
ItemRegistry.IRON_HAMMER,
ItemRegistry.GOLDEN_HAMMER,
ItemRegistry.DIAMOND_HAMMER,
ItemRegistry.NETHERITE_HAMMER,
ItemRegistry.TERMINITE_HAMMER,
ItemRegistry.AETERNIUM_HAMMER
)
));
}
}

View file

@ -5,16 +5,16 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.ItemRegistry; import ru.betterend.registry.EndItems;
public class CreativeTab { public class CreativeTab {
public static final ItemGroup END_TAB = FabricItemGroupBuilder.create(BetterEnd.makeID("items")) public static final ItemGroup END_TAB = FabricItemGroupBuilder.create(BetterEnd.makeID("items"))
.icon(() -> new ItemStack(BlockRegistry.END_MYCELIUM)).appendItems(stacks -> { .icon(() -> new ItemStack(EndBlocks.END_MYCELIUM)).appendItems(stacks -> {
for (Item i : ItemRegistry.getModBlocks()) { for (Item i : EndItems.getModBlocks()) {
stacks.add(new ItemStack(i)); stacks.add(new ItemStack(i));
} }
for (Item i : ItemRegistry.getModItems()) { for (Item i : EndItems.getModItems()) {
stacks.add(new ItemStack(i)); stacks.add(new ItemStack(i));
} }
}).build(); }).build();

View file

@ -24,8 +24,8 @@ import net.minecraft.world.WorldAccess;
import ru.betterend.blocks.BlockBlueVine; import ru.betterend.blocks.BlockBlueVine;
import ru.betterend.blocks.basis.BlockDoublePlant; import ru.betterend.blocks.basis.BlockDoublePlant;
import ru.betterend.blocks.basis.BlockGlowingFur; import ru.betterend.blocks.basis.BlockGlowingFur;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.BlockTagRegistry; import ru.betterend.registry.EndTags;
public class BlocksHelper { public class BlocksHelper {
public static final BooleanProperty ROOTS = BooleanProperty.of("roots"); public static final BooleanProperty ROOTS = BooleanProperty.of("roots");
@ -229,7 +229,7 @@ public class BlocksHelper {
else if (!state.canPlaceAt(world, POS)) { else if (!state.canPlaceAt(world, POS)) {
// Blue Vine // Blue Vine
if (state.getBlock() instanceof BlockBlueVine) { if (state.getBlock() instanceof BlockBlueVine) {
while (state.isOf(BlockRegistry.BLUE_VINE) || state.isOf(BlockRegistry.BLUE_VINE_LANTERN) || state.isOf(BlockRegistry.BLUE_VINE_FUR)) { while (state.isOf(EndBlocks.BLUE_VINE) || state.isOf(EndBlocks.BLUE_VINE_LANTERN) || state.isOf(EndBlocks.BLUE_VINE_FUR)) {
BlocksHelper.setWithoutUpdate(world, POS, AIR); BlocksHelper.setWithoutUpdate(world, POS, AIR);
for (Direction dir : HORIZONTAL) { for (Direction dir : HORIZONTAL) {
BlockPos p = POS.offset(dir); BlockPos p = POS.offset(dir);
@ -266,7 +266,7 @@ public class BlocksHelper {
} }
public static boolean isEndNylium(Block block) { public static boolean isEndNylium(Block block) {
return block.isIn(BlockTags.NYLIUM) && block.isIn(BlockTagRegistry.END_GROUND); return block.isIn(BlockTags.NYLIUM) && block.isIn(EndTags.END_GROUND);
} }
public static boolean isEndNylium(BlockState state) { public static boolean isEndNylium(BlockState state) {

View file

@ -13,8 +13,8 @@ import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.feature.ConfiguredFeature; import net.minecraft.world.gen.feature.ConfiguredFeature;
import net.minecraft.world.gen.feature.ConfiguredStructureFeature; import net.minecraft.world.gen.feature.ConfiguredStructureFeature;
import ru.betterend.mixin.common.GenerationSettingsAccessor; import ru.betterend.mixin.common.GenerationSettingsAccessor;
import ru.betterend.registry.FeatureRegistry; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.StructureRegistry; import ru.betterend.registry.EndStructures;
public class FeaturesHelper { public class FeaturesHelper {
private static final Set<Biome> INJECTED = Sets.newHashSet(); private static final Set<Biome> INJECTED = Sets.newHashSet();
@ -30,8 +30,8 @@ public class FeaturesHelper {
features.add(Lists.newArrayList(list)); features.add(Lists.newArrayList(list));
}); });
FeatureRegistry.registerBiomeFeatures(biomeRegistry.getId(biome), biome, features); EndFeatures.registerBiomeFeatures(biomeRegistry.getId(biome), biome, features);
StructureRegistry.registerBiomeStructures(biomeRegistry.getId(biome), biome, structures); EndStructures.registerBiomeStructures(biomeRegistry.getId(biome), biome, structures);
accessor.setFeatures(features); accessor.setFeatures(features);
accessor.setStructures(structures); accessor.setStructures(structures);

View file

@ -8,8 +8,8 @@ import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction; import net.minecraft.util.math.Direction;
import net.minecraft.world.World; import net.minecraft.world.World;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.FeatureRegistry; import ru.betterend.registry.EndFeatures;
public class PortalFrameHelper { public class PortalFrameHelper {
@ -79,7 +79,7 @@ public class PortalFrameHelper {
if(!checkIsAreaEmpty(world, bottomCorner.add(0, 1, 1), topCorner.add(0, -1, -1))) return false; if(!checkIsAreaEmpty(world, bottomCorner.add(0, 1, 1), topCorner.add(0, -1, -1))) return false;
} }
if (valid) { if (valid) {
if (world.getBlockState(bottomCorner).isOf(BlockRegistry.FLAVOLITE_RUNED)) { if (world.getBlockState(bottomCorner).isOf(EndBlocks.FLAVOLITE_RUNED)) {
generatePortalFrame(world, bottomCorner, axis, width, height, true); generatePortalFrame(world, bottomCorner, axis, width, height, true);
} else { } else {
generateEternalPortalFrame(world, bottomCorner, axis, width, height, true); generateEternalPortalFrame(world, bottomCorner, axis, width, height, true);
@ -164,18 +164,18 @@ public class PortalFrameHelper {
} }
public static void generatePortalFrame(ServerWorld world, BlockPos pos, Direction.Axis axis, int width, int height, boolean active) { public static void generatePortalFrame(ServerWorld world, BlockPos pos, Direction.Axis axis, int width, int height, boolean active) {
FeatureRegistry.END_PORTAL.configure(axis, width, height, active).getFeatureConfigured().generate(world, world.getChunkManager().getChunkGenerator(), new Random(), pos); EndFeatures.END_PORTAL.configure(axis, width, height, active).getFeatureConfigured().generate(world, world.getChunkManager().getChunkGenerator(), new Random(), pos);
} }
public static void generateEternalPortalFrame(ServerWorld world, BlockPos pos, Direction.Axis axis, int width, int height, boolean active) { public static void generateEternalPortalFrame(ServerWorld world, BlockPos pos, Direction.Axis axis, int width, int height, boolean active) {
FeatureRegistry.END_PORTAL_ETERNAL.configure(axis, width, height, active).getFeatureConfigured().generate(world, world.getChunkManager().getChunkGenerator(), new Random(), pos); EndFeatures.END_PORTAL_ETERNAL.configure(axis, width, height, active).getFeatureConfigured().generate(world, world.getChunkManager().getChunkGenerator(), new Random(), pos);
} }
public static void generatePortalFrame(ServerWorld world, BlockPos pos, Direction.Axis axis, boolean active) { public static void generatePortalFrame(ServerWorld world, BlockPos pos, Direction.Axis axis, boolean active) {
FeatureRegistry.END_PORTAL.configure(axis, active).getFeatureConfigured().generate(world, world.getChunkManager().getChunkGenerator(), new Random(), pos); EndFeatures.END_PORTAL.configure(axis, active).getFeatureConfigured().generate(world, world.getChunkManager().getChunkGenerator(), new Random(), pos);
} }
public static void generateEternalPortalFrame(ServerWorld world, BlockPos pos, Direction.Axis axis, boolean active) { public static void generateEternalPortalFrame(ServerWorld world, BlockPos pos, Direction.Axis axis, boolean active) {
FeatureRegistry.END_PORTAL_ETERNAL.configure(axis, active).getFeatureConfigured().generate(world, world.getChunkManager().getChunkGenerator(), new Random(), pos); EndFeatures.END_PORTAL_ETERNAL.configure(axis, active).getFeatureConfigured().generate(world, world.getChunkManager().getChunkGenerator(), new Random(), pos);
} }
} }

View file

@ -10,8 +10,8 @@ import com.google.gson.Gson;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
import ru.betterend.registry.BiomeRegistry; import ru.betterend.registry.EndBiomes;
import ru.betterend.registry.ItemRegistry; import ru.betterend.registry.EndItems;
public class TranslationHelper { public class TranslationHelper {
public static void printMissingNames() { public static void printMissingNames() {
@ -24,7 +24,7 @@ public class TranslationHelper {
JsonObject translationEn = gson.fromJson(new InputStreamReader(streamEn), JsonObject.class); JsonObject translationEn = gson.fromJson(new InputStreamReader(streamEn), JsonObject.class);
JsonObject translationRu = gson.fromJson(new InputStreamReader(streamRu), JsonObject.class); JsonObject translationRu = gson.fromJson(new InputStreamReader(streamRu), JsonObject.class);
ItemRegistry.getModBlocks().forEach((block) -> { EndItems.getModBlocks().forEach((block) -> {
String name = block.getName().getString(); String name = block.getName().getString();
if (!translationEn.has(name)) { if (!translationEn.has(name)) {
missingNamesEn.add(name); missingNamesEn.add(name);
@ -34,7 +34,7 @@ public class TranslationHelper {
} }
}); });
ItemRegistry.getModItems().forEach((item) -> { EndItems.getModItems().forEach((item) -> {
String name = item.getName().getString(); String name = item.getName().getString();
if (!translationEn.has(name)) { if (!translationEn.has(name)) {
missingNamesEn.add(name); missingNamesEn.add(name);
@ -44,7 +44,7 @@ public class TranslationHelper {
} }
}); });
BiomeRegistry.getModBiomes().forEach((endBiome) -> { EndBiomes.getModBiomes().forEach((endBiome) -> {
if (endBiome.getID().getNamespace().equals(BetterEnd.MOD_ID)) { if (endBiome.getID().getNamespace().equals(BetterEnd.MOD_ID)) {
String name = "biome." + BetterEnd.MOD_ID + "." + endBiome.getID().getPath(); String name = "biome." + BetterEnd.MOD_ID + "." + endBiome.getID().getPath();
if (!translationEn.has(name)) { if (!translationEn.has(name)) {

View file

@ -5,10 +5,10 @@ import net.minecraft.particle.ParticleTypes;
import net.minecraft.world.gen.GenerationStep.Feature; import net.minecraft.world.gen.GenerationStep.Feature;
import net.minecraft.world.gen.feature.ConfiguredFeatures; import net.minecraft.world.gen.feature.ConfiguredFeatures;
import net.minecraft.world.gen.feature.ConfiguredStructureFeatures; import net.minecraft.world.gen.feature.ConfiguredStructureFeatures;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EntityRegistry; import ru.betterend.registry.EndEntities;
import ru.betterend.registry.FeatureRegistry; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.SoundRegistry; import ru.betterend.registry.EndSounds;
public class BiomeChorusForest extends EndBiome { public class BiomeChorusForest extends EndBiome {
public BiomeChorusForest() { public BiomeChorusForest() {
@ -16,19 +16,19 @@ public class BiomeChorusForest extends EndBiome {
.setFogColor(87, 26, 87) .setFogColor(87, 26, 87)
.setFogDensity(1.5F) .setFogDensity(1.5F)
.setPlantsColor(122, 45, 122) .setPlantsColor(122, 45, 122)
.setSurface(BlockRegistry.CHORUS_NYLIUM) .setSurface(EndBlocks.CHORUS_NYLIUM)
.setParticles(ParticleTypes.PORTAL, 0.01F) .setParticles(ParticleTypes.PORTAL, 0.01F)
.setLoop(SoundRegistry.AMBIENT_CHORUS_FOREST) .setLoop(EndSounds.AMBIENT_CHORUS_FOREST)
.setMusic(SoundRegistry.MUSIC_CHORUS_FOREST) .setMusic(EndSounds.MUSIC_CHORUS_FOREST)
.addFeature(FeatureRegistry.VIOLECITE_LAYER) .addFeature(EndFeatures.VIOLECITE_LAYER)
.addFeature(FeatureRegistry.END_LAKE_RARE) .addFeature(EndFeatures.END_LAKE_RARE)
.addFeature(FeatureRegistry.PYTHADENDRON_TREE) .addFeature(EndFeatures.PYTHADENDRON_TREE)
.addFeature(FeatureRegistry.PYTHADENDRON_BUSH) .addFeature(EndFeatures.PYTHADENDRON_BUSH)
.addFeature(Feature.VEGETAL_DECORATION, ConfiguredFeatures.CHORUS_PLANT) .addFeature(Feature.VEGETAL_DECORATION, ConfiguredFeatures.CHORUS_PLANT)
.addFeature(Feature.VEGETAL_DECORATION, ConfiguredFeatures.CHORUS_PLANT) .addFeature(Feature.VEGETAL_DECORATION, ConfiguredFeatures.CHORUS_PLANT)
.addFeature(FeatureRegistry.CHORUS_GRASS) .addFeature(EndFeatures.CHORUS_GRASS)
.addStructureFeature(ConfiguredStructureFeatures.END_CITY) .addStructureFeature(ConfiguredStructureFeatures.END_CITY)
.addMobSpawn(EntityRegistry.END_SLIME, 5, 1, 2) .addMobSpawn(EndEntities.END_SLIME, 5, 1, 2)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 4)); .addMobSpawn(EntityType.ENDERMAN, 50, 1, 4));
} }
} }

View file

@ -1,20 +1,20 @@
package ru.betterend.world.biome; package ru.betterend.world.biome;
import net.minecraft.entity.EntityType; import net.minecraft.entity.EntityType;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.FeatureRegistry; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.SoundRegistry; import ru.betterend.registry.EndSounds;
import ru.betterend.registry.StructureRegistry; import ru.betterend.registry.EndStructures;
public class BiomeCrystalMountains extends EndBiome { public class BiomeCrystalMountains extends EndBiome {
public BiomeCrystalMountains() { public BiomeCrystalMountains() {
super(new BiomeDefinition("crystal_mountains") super(new BiomeDefinition("crystal_mountains")
.setPlantsColor(255, 133, 211) .setPlantsColor(255, 133, 211)
.setSurface(BlockRegistry.CRYSTAL_MOSS) .setSurface(EndBlocks.CRYSTAL_MOSS)
.setMusic(SoundRegistry.MUSIC_CRYSTAL_MOUNTAINS) .setMusic(EndSounds.MUSIC_CRYSTAL_MOUNTAINS)
.addStructureFeature(StructureRegistry.MOUNTAIN) .addStructureFeature(EndStructures.MOUNTAIN)
.addFeature(FeatureRegistry.ROUND_CAVE) .addFeature(EndFeatures.ROUND_CAVE)
.addFeature(FeatureRegistry.CRYSTAL_GRASS) .addFeature(EndFeatures.CRYSTAL_GRASS)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); .addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
} }
} }

View file

@ -3,8 +3,8 @@ package ru.betterend.world.biome;
import net.minecraft.entity.EntityType; import net.minecraft.entity.EntityType;
import net.minecraft.particle.ParticleTypes; import net.minecraft.particle.ParticleTypes;
import net.minecraft.world.gen.feature.ConfiguredStructureFeatures; import net.minecraft.world.gen.feature.ConfiguredStructureFeatures;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.SoundRegistry; import ru.betterend.registry.EndSounds;
public class BiomeDustWastelands extends EndBiome { public class BiomeDustWastelands extends EndBiome {
public BiomeDustWastelands() { public BiomeDustWastelands() {
@ -13,10 +13,10 @@ public class BiomeDustWastelands extends EndBiome {
.setFogDensity(2) .setFogDensity(2)
.setWaterColor(192, 180, 131) .setWaterColor(192, 180, 131)
.setWaterFogColor(192, 180, 131) .setWaterFogColor(192, 180, 131)
.setSurface(BlockRegistry.ENDSTONE_DUST) .setSurface(EndBlocks.ENDSTONE_DUST)
.setParticles(ParticleTypes.WHITE_ASH, 0.01F) .setParticles(ParticleTypes.WHITE_ASH, 0.01F)
//.setLoop(SoundRegistry.AMBIENT_FOGGY_MUSHROOMLAND) .setLoop(EndSounds.AMBIENT_DUST_WASTELANDS)
.setMusic(SoundRegistry.DUST_WASTELANDS) .setMusic(EndSounds.DUST_WASTELANDS)
.addStructureFeature(ConfiguredStructureFeatures.END_CITY) .addStructureFeature(ConfiguredStructureFeatures.END_CITY)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); .addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
} }

View file

@ -2,12 +2,12 @@ package ru.betterend.world.biome;
import net.minecraft.entity.EntityType; import net.minecraft.entity.EntityType;
import net.minecraft.world.gen.feature.ConfiguredStructureFeatures; import net.minecraft.world.gen.feature.ConfiguredStructureFeatures;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EntityRegistry; import ru.betterend.registry.EndEntities;
import ru.betterend.registry.FeatureRegistry; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.ParticleRegistry; import ru.betterend.registry.EndParticles;
import ru.betterend.registry.SoundRegistry; import ru.betterend.registry.EndSounds;
import ru.betterend.registry.StructureRegistry; import ru.betterend.registry.EndStructures;
public class BiomeFoggyMushroomland extends EndBiome { public class BiomeFoggyMushroomland extends EndBiome {
public BiomeFoggyMushroomland() { public BiomeFoggyMushroomland() {
@ -17,23 +17,23 @@ public class BiomeFoggyMushroomland extends EndBiome {
.setFogDensity(3) .setFogDensity(3)
.setWaterColor(119, 227, 250) .setWaterColor(119, 227, 250)
.setWaterFogColor(119, 227, 250) .setWaterFogColor(119, 227, 250)
.setSurface(BlockRegistry.END_MOSS, BlockRegistry.END_MYCELIUM) .setSurface(EndBlocks.END_MOSS, EndBlocks.END_MYCELIUM)
.setParticles(ParticleRegistry.GLOWING_SPHERE, 0.001F) .setParticles(EndParticles.GLOWING_SPHERE, 0.001F)
.setLoop(SoundRegistry.AMBIENT_FOGGY_MUSHROOMLAND) .setLoop(EndSounds.AMBIENT_FOGGY_MUSHROOMLAND)
.setMusic(SoundRegistry.MUSIC_FOGGY_MUSHROOMLAND) .setMusic(EndSounds.MUSIC_FOGGY_MUSHROOMLAND)
.addStructureFeature(StructureRegistry.GIANT_MOSSY_GLOWSHROOM) .addStructureFeature(EndStructures.GIANT_MOSSY_GLOWSHROOM)
.addFeature(FeatureRegistry.END_LAKE) .addFeature(EndFeatures.END_LAKE)
.addFeature(FeatureRegistry.MOSSY_GLOWSHROOM) .addFeature(EndFeatures.MOSSY_GLOWSHROOM)
.addFeature(FeatureRegistry.BLUE_VINE) .addFeature(EndFeatures.BLUE_VINE)
.addFeature(FeatureRegistry.UMBRELLA_MOSS) .addFeature(EndFeatures.UMBRELLA_MOSS)
.addFeature(FeatureRegistry.CREEPING_MOSS) .addFeature(EndFeatures.CREEPING_MOSS)
.addFeature(FeatureRegistry.DENSE_VINE) .addFeature(EndFeatures.DENSE_VINE)
.addFeature(FeatureRegistry.END_LILY) .addFeature(EndFeatures.END_LILY)
.addFeature(FeatureRegistry.BUBBLE_CORAL) .addFeature(EndFeatures.BUBBLE_CORAL)
.addStructureFeature(ConfiguredStructureFeatures.END_CITY) .addStructureFeature(ConfiguredStructureFeatures.END_CITY)
.addMobSpawn(EntityRegistry.DRAGONFLY, 80, 2, 5) .addMobSpawn(EndEntities.DRAGONFLY, 80, 2, 5)
.addMobSpawn(EntityRegistry.END_FISH, 20, 2, 5) .addMobSpawn(EndEntities.END_FISH, 20, 2, 5)
.addMobSpawn(EntityRegistry.END_SLIME, 10, 1, 2) .addMobSpawn(EndEntities.END_SLIME, 10, 1, 2)
.addMobSpawn(EntityType.ENDERMAN, 10, 1, 2)); .addMobSpawn(EntityType.ENDERMAN, 10, 1, 2));
} }
} }

View file

@ -2,11 +2,11 @@ package ru.betterend.world.biome;
import net.minecraft.entity.EntityType; import net.minecraft.entity.EntityType;
import net.minecraft.world.gen.feature.ConfiguredStructureFeatures; import net.minecraft.world.gen.feature.ConfiguredStructureFeatures;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EntityRegistry; import ru.betterend.registry.EndEntities;
import ru.betterend.registry.FeatureRegistry; import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.SoundRegistry; import ru.betterend.registry.EndSounds;
import ru.betterend.registry.StructureRegistry; import ru.betterend.registry.EndStructures;
public class BiomeMegalake extends EndBiome { public class BiomeMegalake extends EndBiome {
public BiomeMegalake() { public BiomeMegalake() {
@ -16,19 +16,19 @@ public class BiomeMegalake extends EndBiome {
.setWaterColor(96, 163, 255) .setWaterColor(96, 163, 255)
.setWaterFogColor(96, 163, 255) .setWaterFogColor(96, 163, 255)
.setFogDensity(1.75F) .setFogDensity(1.75F)
.setMusic(SoundRegistry.MUSIC_MEGALAKE) .setMusic(EndSounds.MUSIC_MEGALAKE)
.setLoop(SoundRegistry.AMBIENT_MEGALAKE) .setLoop(EndSounds.AMBIENT_MEGALAKE)
.setSurface(BlockRegistry.ENDSTONE_DUST, BlockRegistry.END_MOSS) .setSurface(EndBlocks.ENDSTONE_DUST, EndBlocks.END_MOSS)
.addStructureFeature(StructureRegistry.MEGALAKE) .addStructureFeature(EndStructures.MEGALAKE)
.addStructureFeature(ConfiguredStructureFeatures.END_CITY) .addStructureFeature(ConfiguredStructureFeatures.END_CITY)
.addFeature(FeatureRegistry.END_LOTUS) .addFeature(EndFeatures.END_LOTUS)
.addFeature(FeatureRegistry.END_LOTUS_LEAF) .addFeature(EndFeatures.END_LOTUS_LEAF)
.addFeature(FeatureRegistry.BUBBLE_CORAL_RARE) .addFeature(EndFeatures.BUBBLE_CORAL_RARE)
.addFeature(FeatureRegistry.END_LILY_RARE) .addFeature(EndFeatures.END_LILY_RARE)
.addFeature(FeatureRegistry.UMBRELLA_MOSS) .addFeature(EndFeatures.UMBRELLA_MOSS)
.addFeature(FeatureRegistry.CREEPING_MOSS) .addFeature(EndFeatures.CREEPING_MOSS)
.addMobSpawn(EntityRegistry.DRAGONFLY, 50, 1, 3) .addMobSpawn(EndEntities.DRAGONFLY, 50, 1, 3)
.addMobSpawn(EntityRegistry.END_FISH, 50, 3, 8) .addMobSpawn(EndEntities.END_FISH, 50, 3, 8)
.addMobSpawn(EntityType.ENDERMAN, 10, 1, 2)); .addMobSpawn(EntityType.ENDERMAN, 10, 1, 2));
} }
} }

View file

@ -2,9 +2,9 @@ package ru.betterend.world.biome;
import net.minecraft.entity.EntityType; import net.minecraft.entity.EntityType;
import net.minecraft.particle.ParticleTypes; import net.minecraft.particle.ParticleTypes;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.SoundRegistry; import ru.betterend.registry.EndSounds;
import ru.betterend.registry.StructureRegistry; import ru.betterend.registry.EndStructures;
public class BiomePaintedMountains extends EndBiome { public class BiomePaintedMountains extends EndBiome {
public BiomePaintedMountains() { public BiomePaintedMountains() {
@ -13,10 +13,11 @@ public class BiomePaintedMountains extends EndBiome {
.setFogDensity(2) .setFogDensity(2)
.setWaterColor(192, 180, 131) .setWaterColor(192, 180, 131)
.setWaterFogColor(192, 180, 131) .setWaterFogColor(192, 180, 131)
.setMusic(SoundRegistry.DUST_WASTELANDS) .setMusic(EndSounds.DUST_WASTELANDS)
.setSurface(BlockRegistry.ENDSTONE_DUST) .setLoop(EndSounds.AMBIENT_DUST_WASTELANDS)
.setSurface(EndBlocks.ENDSTONE_DUST)
.setParticles(ParticleTypes.WHITE_ASH, 0.01F) .setParticles(ParticleTypes.WHITE_ASH, 0.01F)
.addStructureFeature(StructureRegistry.PAINTED_MOUNTAIN) .addStructureFeature(EndStructures.PAINTED_MOUNTAIN)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2)); .addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
} }
} }

View file

@ -5,7 +5,7 @@ import java.util.Random;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.StructureWorldAccess; import net.minecraft.world.StructureWorldAccess;
import ru.betterend.blocks.basis.BlockPlantWithAge; import ru.betterend.blocks.basis.BlockPlantWithAge;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
import ru.betterend.util.MHelper; import ru.betterend.util.MHelper;
@ -20,16 +20,16 @@ public class BlueVineFeature extends ScatterFeature {
public boolean canGenerate(StructureWorldAccess world, Random random, BlockPos center, BlockPos blockPos, float radius) { public boolean canGenerate(StructureWorldAccess world, Random random, BlockPos center, BlockPos blockPos, float radius) {
float d = MHelper.length(center.getX() - blockPos.getX(), center.getZ() - blockPos.getZ()) / radius * 0.6F + random.nextFloat() * 0.4F; float d = MHelper.length(center.getX() - blockPos.getX(), center.getZ() - blockPos.getZ()) / radius * 0.6F + random.nextFloat() * 0.4F;
small = d > 0.5F; small = d > 0.5F;
return BlockRegistry.BLUE_VINE_SEED.canPlaceAt(AIR, world, blockPos); return EndBlocks.BLUE_VINE_SEED.canPlaceAt(AIR, world, blockPos);
} }
@Override @Override
public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) { public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) {
if (small) { if (small) {
BlocksHelper.setWithoutUpdate(world, blockPos, BlockRegistry.BLUE_VINE_SEED.getDefaultState().with(BlockPlantWithAge.AGE, random.nextInt(4))); BlocksHelper.setWithoutUpdate(world, blockPos, EndBlocks.BLUE_VINE_SEED.getDefaultState().with(BlockPlantWithAge.AGE, random.nextInt(4)));
} }
else { else {
BlockPlantWithAge seed = ((BlockPlantWithAge) BlockRegistry.BLUE_VINE_SEED); BlockPlantWithAge seed = ((BlockPlantWithAge) EndBlocks.BLUE_VINE_SEED);
seed.grow(world, random, blockPos); seed.grow(world, random, blockPos);
} }
} }

View file

@ -8,7 +8,7 @@ import net.minecraft.block.Material;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.StructureWorldAccess; import net.minecraft.world.StructureWorldAccess;
import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
import ru.betterend.util.MHelper; import ru.betterend.util.MHelper;
import ru.betterend.util.sdf.SDF; import ru.betterend.util.sdf.SDF;
@ -27,21 +27,21 @@ public class CaveBushFeature extends FullHeightScatterFeature {
@Override @Override
public boolean canGenerate(StructureWorldAccess world, Random random, BlockPos center, BlockPos blockPos, float radius) { public boolean canGenerate(StructureWorldAccess world, Random random, BlockPos center, BlockPos blockPos, float radius) {
return world.getBlockState(blockPos.down()).isOf(BlockRegistry.CAVE_MOSS); return world.getBlockState(blockPos.down()).isOf(EndBlocks.CAVE_MOSS);
} }
@Override @Override
public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) { public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) {
float radius = MHelper.randRange(0.8F, 2.5F, random); float radius = MHelper.randRange(0.8F, 2.5F, random);
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextInt()); OpenSimplexNoise noise = new OpenSimplexNoise(random.nextInt());
SDF sphere = new SDFSphere().setRadius(radius).setBlock(BlockRegistry.CAVE_BUSH); SDF sphere = new SDFSphere().setRadius(radius).setBlock(EndBlocks.CAVE_BUSH);
sphere = new SDFScale3D().setScale(MHelper.randRange(0.8F, 1.2F, random), MHelper.randRange(0.8F, 1.2F, random), MHelper.randRange(0.8F, 1.2F, random)).setSource(sphere); sphere = new SDFScale3D().setScale(MHelper.randRange(0.8F, 1.2F, random), MHelper.randRange(0.8F, 1.2F, random), MHelper.randRange(0.8F, 1.2F, random)).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> { return (float) noise.eval(vec.getX() * 0.2, vec.getY() * 0.2, vec.getZ() * 0.2) * 3; }).setSource(sphere); sphere = new SDFDisplacement().setFunction((vec) -> { return (float) noise.eval(vec.getX() * 0.2, vec.getY() * 0.2, vec.getZ() * 0.2) * 3; }).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> { return random.nextFloat() * 3F - 1.5F; }).setSource(sphere); sphere = new SDFDisplacement().setFunction((vec) -> { return random.nextFloat() * 3F - 1.5F; }).setSource(sphere);
sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere)); sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere));
sphere.setReplaceFunction(REPLACE); sphere.setReplaceFunction(REPLACE);
sphere.fillRecursive(world, blockPos); sphere.fillRecursive(world, blockPos);
BlocksHelper.setWithoutUpdate(world, blockPos, BlockRegistry.CAVE_BUSH); BlocksHelper.setWithoutUpdate(world, blockPos, EndBlocks.CAVE_BUSH);
} }
static { static {

View file

@ -8,8 +8,8 @@ import net.minecraft.block.Material;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.StructureWorldAccess; import net.minecraft.world.StructureWorldAccess;
import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.BlockTagRegistry; import ru.betterend.registry.EndTags;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
import ru.betterend.util.MHelper; import ru.betterend.util.MHelper;
import ru.betterend.util.sdf.SDF; import ru.betterend.util.sdf.SDF;
@ -29,22 +29,22 @@ public class CaveBushFeatureCeil extends InvertedScatterFeature {
@Override @Override
public boolean canGenerate(StructureWorldAccess world, Random random, BlockPos center, BlockPos blockPos, float radius) { public boolean canGenerate(StructureWorldAccess world, Random random, BlockPos center, BlockPos blockPos, float radius) {
return world.isAir(blockPos.down()) return world.isAir(blockPos.down())
&& world.getBlockState(blockPos.up()).isIn(BlockTagRegistry.GEN_TERRAIN) && world.getBlockState(blockPos.up()).isIn(EndTags.GEN_TERRAIN)
&& world.getBlockState(blockPos.down(BlocksHelper.downRay(world, blockPos.down(), 64) + 2)).isIn(BlockTagRegistry.GEN_TERRAIN); && world.getBlockState(blockPos.down(BlocksHelper.downRay(world, blockPos.down(), 64) + 2)).isIn(EndTags.GEN_TERRAIN);
} }
@Override @Override
public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) { public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) {
float radius = MHelper.randRange(1.0F, 3.2F, random); float radius = MHelper.randRange(1.0F, 3.2F, random);
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextInt()); OpenSimplexNoise noise = new OpenSimplexNoise(random.nextInt());
SDF sphere = new SDFSphere().setRadius(radius).setBlock(BlockRegistry.CAVE_BUSH); SDF sphere = new SDFSphere().setRadius(radius).setBlock(EndBlocks.CAVE_BUSH);
sphere = new SDFScale3D().setScale(MHelper.randRange(0.8F, 1.2F, random), MHelper.randRange(0.8F, 1.2F, random), MHelper.randRange(0.8F, 1.2F, random)).setSource(sphere); sphere = new SDFScale3D().setScale(MHelper.randRange(0.8F, 1.2F, random), MHelper.randRange(0.8F, 1.2F, random), MHelper.randRange(0.8F, 1.2F, random)).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> { return (float) noise.eval(vec.getX() * 0.2, vec.getY() * 0.2, vec.getZ() * 0.2) * 3; }).setSource(sphere); sphere = new SDFDisplacement().setFunction((vec) -> { return (float) noise.eval(vec.getX() * 0.2, vec.getY() * 0.2, vec.getZ() * 0.2) * 3; }).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> { return random.nextFloat() * 3F - 1.5F; }).setSource(sphere); sphere = new SDFDisplacement().setFunction((vec) -> { return random.nextFloat() * 3F - 1.5F; }).setSource(sphere);
sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere)); sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere));
sphere.setReplaceFunction(REPLACE); sphere.setReplaceFunction(REPLACE);
sphere.fillRecursive(world, blockPos.down()); sphere.fillRecursive(world, blockPos.down());
BlocksHelper.setWithoutUpdate(world, blockPos.down(), BlockRegistry.CAVE_BUSH); BlocksHelper.setWithoutUpdate(world, blockPos.down(), EndBlocks.CAVE_BUSH);
} }
static { static {

View file

@ -10,7 +10,7 @@ import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.feature.Feature; import net.minecraft.world.gen.feature.Feature;
import ru.betterend.blocks.EndPortalBlock; import ru.betterend.blocks.EndPortalBlock;
import ru.betterend.blocks.RunedFlavolite; import ru.betterend.blocks.RunedFlavolite;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
public class DefaultEndPortalFeature extends Feature<EndPortalFeatureConfig> { public class DefaultEndPortalFeature extends Feature<EndPortalFeatureConfig> {
@ -24,7 +24,7 @@ public class DefaultEndPortalFeature extends Feature<EndPortalFeatureConfig> {
EndPortalFeatureConfig config) { EndPortalFeatureConfig config) {
BlockState portalFrame = config.frameBlock.getDefaultState().with(RunedFlavolite.ACTIVATED, config.activated); BlockState portalFrame = config.frameBlock.getDefaultState().with(RunedFlavolite.ACTIVATED, config.activated);
BlockState portalBlock = BlockRegistry.END_PORTAL_BLOCK.getDefaultState().with(EndPortalBlock.AXIS, config.axis); BlockState portalBlock = EndBlocks.END_PORTAL_BLOCK.getDefaultState().with(EndPortalBlock.AXIS, config.axis);
BlockPos bottomCorner = pos; BlockPos bottomCorner = pos;
BlockPos topCorner; BlockPos topCorner;
int width = config.width - 1; int width = config.width - 1;

View file

@ -12,8 +12,8 @@ import net.minecraft.world.StructureWorldAccess;
import net.minecraft.world.gen.chunk.ChunkGenerator; import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.feature.DefaultFeatureConfig; import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.BlockTagRegistry; import ru.betterend.registry.EndTags;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
import ru.betterend.util.MHelper; import ru.betterend.util.MHelper;
@ -108,18 +108,18 @@ public class EndLakeFeature extends DefaultFeature {
r *= r; r *= r;
if (x2 + z2 <= r) { if (x2 + z2 <= r) {
state = world.getBlockState(POS); state = world.getBlockState(POS);
if (state.isIn(BlockTagRegistry.GEN_TERRAIN)) { if (state.isIn(EndTags.GEN_TERRAIN)) {
BlocksHelper.setWithoutUpdate(world, POS, AIR); BlocksHelper.setWithoutUpdate(world, POS, AIR);
} }
pos = POS.down(); pos = POS.down();
if (world.getBlockState(pos).isIn(BlockTagRegistry.GEN_TERRAIN)) { if (world.getBlockState(pos).isIn(EndTags.GEN_TERRAIN)) {
state = world.getBiome(pos).getGenerationSettings().getSurfaceConfig().getTopMaterial(); state = world.getBiome(pos).getGenerationSettings().getSurfaceConfig().getTopMaterial();
if (y > waterLevel + 1) if (y > waterLevel + 1)
BlocksHelper.setWithoutUpdate(world, pos, state); BlocksHelper.setWithoutUpdate(world, pos, state);
else if (y > waterLevel) else if (y > waterLevel)
BlocksHelper.setWithoutUpdate(world, pos, random.nextBoolean() ? state : BlockRegistry.ENDSTONE_DUST.getDefaultState()); BlocksHelper.setWithoutUpdate(world, pos, random.nextBoolean() ? state : EndBlocks.ENDSTONE_DUST.getDefaultState());
else else
BlocksHelper.setWithoutUpdate(world, pos, BlockRegistry.ENDSTONE_DUST.getDefaultState()); BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.ENDSTONE_DUST.getDefaultState());
} }
} }
} }
@ -163,8 +163,8 @@ public class EndLakeFeature extends DefaultFeature {
}*/ }*/
} }
pos = POS.down(); pos = POS.down();
if (world.getBlockState(pos).getBlock().isIn(BlockTagRegistry.GEN_TERRAIN)) { if (world.getBlockState(pos).getBlock().isIn(EndTags.GEN_TERRAIN)) {
BlocksHelper.setWithoutUpdate(world, POS.down(), BlockRegistry.ENDSTONE_DUST.getDefaultState()); BlocksHelper.setWithoutUpdate(world, POS.down(), EndBlocks.ENDSTONE_DUST.getDefaultState());
} }
pos = POS.up(); pos = POS.up();
while (canReplace(state = world.getBlockState(pos)) && !state.isAir() && state.getFluidState().isEmpty()) { while (canReplace(state = world.getBlockState(pos)) && !state.isAir() && state.getFluidState().isEmpty()) {
@ -180,11 +180,11 @@ public class EndLakeFeature extends DefaultFeature {
//if (world.getBlockState(POS).getMaterial().isReplaceable()) { //if (world.getBlockState(POS).getMaterial().isReplaceable()) {
if (world.isAir(POS.up())) { if (world.isAir(POS.up())) {
state = world.getBiome(POS).getGenerationSettings().getSurfaceConfig().getTopMaterial(); state = world.getBiome(POS).getGenerationSettings().getSurfaceConfig().getTopMaterial();
BlocksHelper.setWithoutUpdate(world, POS, random.nextBoolean() ? state : BlockRegistry.ENDSTONE_DUST.getDefaultState()); BlocksHelper.setWithoutUpdate(world, POS, random.nextBoolean() ? state : EndBlocks.ENDSTONE_DUST.getDefaultState());
BlocksHelper.setWithoutUpdate(world, POS.down(), END_STONE); BlocksHelper.setWithoutUpdate(world, POS.down(), END_STONE);
} }
else { else {
BlocksHelper.setWithoutUpdate(world, POS, BlockRegistry.ENDSTONE_DUST.getDefaultState()); BlocksHelper.setWithoutUpdate(world, POS, EndBlocks.ENDSTONE_DUST.getDefaultState());
BlocksHelper.setWithoutUpdate(world, POS.down(), END_STONE); BlocksHelper.setWithoutUpdate(world, POS.down(), END_STONE);
} }
//} //}
@ -216,8 +216,8 @@ public class EndLakeFeature extends DefaultFeature {
private boolean canReplace(BlockState state) { private boolean canReplace(BlockState state) {
return state.getMaterial().isReplaceable() return state.getMaterial().isReplaceable()
|| state.isIn(BlockTagRegistry.GEN_TERRAIN) || state.isIn(EndTags.GEN_TERRAIN)
|| state.isOf(BlockRegistry.ENDSTONE_DUST) || state.isOf(EndBlocks.ENDSTONE_DUST)
|| state.getMaterial().equals(Material.PLANT) || state.getMaterial().equals(Material.PLANT)
|| state.getMaterial().equals(Material.UNDERWATER_PLANT) || state.getMaterial().equals(Material.UNDERWATER_PLANT)
|| state.getMaterial().equals(Material.UNUSED_PLANT); || state.getMaterial().equals(Material.UNUSED_PLANT);

View file

@ -5,7 +5,7 @@ import java.util.Random;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.StructureWorldAccess; import net.minecraft.world.StructureWorldAccess;
import ru.betterend.blocks.BlockEndLilySeed; import ru.betterend.blocks.BlockEndLilySeed;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
public class EndLilyFeature extends UnderwaterPlantScatter { public class EndLilyFeature extends UnderwaterPlantScatter {
public EndLilyFeature(int radius) { public EndLilyFeature(int radius) {
@ -14,7 +14,7 @@ public class EndLilyFeature extends UnderwaterPlantScatter {
@Override @Override
public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) { public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) {
BlockEndLilySeed seed = (BlockEndLilySeed) BlockRegistry.END_LILY_SEED; BlockEndLilySeed seed = (BlockEndLilySeed) EndBlocks.END_LILY_SEED;
seed.grow(world, random, blockPos); seed.grow(world, random, blockPos);
} }

View file

@ -5,7 +5,7 @@ import java.util.Random;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.StructureWorldAccess; import net.minecraft.world.StructureWorldAccess;
import ru.betterend.blocks.BlockEndLotusSeed; import ru.betterend.blocks.BlockEndLotusSeed;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
public class EndLotusFeature extends UnderwaterPlantScatter { public class EndLotusFeature extends UnderwaterPlantScatter {
public EndLotusFeature(int radius) { public EndLotusFeature(int radius) {
@ -14,7 +14,7 @@ public class EndLotusFeature extends UnderwaterPlantScatter {
@Override @Override
public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) { public void generate(StructureWorldAccess world, Random random, BlockPos blockPos) {
BlockEndLotusSeed seed = (BlockEndLotusSeed) BlockRegistry.END_LOTUS_SEED; BlockEndLotusSeed seed = (BlockEndLotusSeed) EndBlocks.END_LOTUS_SEED;
seed.grow(world, random, blockPos); seed.grow(world, random, blockPos);
} }

View file

@ -10,7 +10,7 @@ import net.minecraft.util.math.Direction;
import net.minecraft.world.StructureWorldAccess; import net.minecraft.world.StructureWorldAccess;
import ru.betterend.blocks.BlockEndLotusLeaf; import ru.betterend.blocks.BlockEndLotusLeaf;
import ru.betterend.blocks.BlockProperties.TripleShape; import ru.betterend.blocks.BlockProperties.TripleShape;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
public class EndLotusLeafFeature extends ScatterFeature { public class EndLotusLeafFeature extends ScatterFeature {
@ -37,7 +37,7 @@ public class EndLotusLeafFeature extends ScatterFeature {
private void generateLeaf(StructureWorldAccess world, BlockPos pos) { private void generateLeaf(StructureWorldAccess world, BlockPos pos) {
Mutable p = new Mutable(); Mutable p = new Mutable();
BlockState leaf = BlockRegistry.END_LOTUS_LEAF.getDefaultState(); BlockState leaf = EndBlocks.END_LOTUS_LEAF.getDefaultState();
BlocksHelper.setWithoutUpdate(world, pos, leaf.with(BlockEndLotusLeaf.SHAPE, TripleShape.BOTTOM)); BlocksHelper.setWithoutUpdate(world, pos, leaf.with(BlockEndLotusLeaf.SHAPE, TripleShape.BOTTOM));
for (Direction move: BlocksHelper.HORIZONTAL) { for (Direction move: BlocksHelper.HORIZONTAL) {
BlocksHelper.setWithoutUpdate(world, p.set(pos).move(move), leaf.with(BlockEndLotusLeaf.HORIZONTAL_FACING, move).with(BlockEndLotusLeaf.SHAPE, TripleShape.MIDDLE)); BlocksHelper.setWithoutUpdate(world, p.set(pos).move(move), leaf.with(BlockEndLotusLeaf.HORIZONTAL_FACING, move).with(BlockEndLotusLeaf.SHAPE, TripleShape.MIDDLE));

View file

@ -17,8 +17,8 @@ import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import ru.betterend.blocks.BlockMossyGlowshroomCap; import ru.betterend.blocks.BlockMossyGlowshroomCap;
import ru.betterend.blocks.basis.BlockGlowingFur; import ru.betterend.blocks.basis.BlockGlowingFur;
import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.BlockTagRegistry; import ru.betterend.registry.EndTags;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
import ru.betterend.util.MHelper; import ru.betterend.util.MHelper;
import ru.betterend.util.SplineHelper; import ru.betterend.util.SplineHelper;
@ -56,21 +56,21 @@ public class MossyGlowshroomFeature extends DefaultFeature {
if (blockPos.getY() < 5) { if (blockPos.getY() < 5) {
return false; return false;
} }
if (!world.getBlockState(blockPos.down()).isIn(BlockTagRegistry.END_GROUND)) { if (!world.getBlockState(blockPos.down()).isIn(EndTags.END_GROUND)) {
return false; return false;
} }
CONE1.setBlock(BlockRegistry.MOSSY_GLOWSHROOM_CAP); CONE1.setBlock(EndBlocks.MOSSY_GLOWSHROOM_CAP);
CONE2.setBlock(BlockRegistry.MOSSY_GLOWSHROOM_CAP); CONE2.setBlock(EndBlocks.MOSSY_GLOWSHROOM_CAP);
CONE_GLOW.setBlock(BlockRegistry.MOSSY_GLOWSHROOM_HYMENOPHORE); CONE_GLOW.setBlock(EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE);
ROOTS.setBlock(BlockRegistry.MOSSY_GLOWSHROOM.bark); ROOTS.setBlock(EndBlocks.MOSSY_GLOWSHROOM.bark);
float height = MHelper.randRange(10F, 25F, random); float height = MHelper.randRange(10F, 25F, random);
int count = MHelper.floor(height / 4); int count = MHelper.floor(height / 4);
List<Vector3f> spline = SplineHelper.makeSpline(0, 0, 0, 0, height, 0, count); List<Vector3f> spline = SplineHelper.makeSpline(0, 0, 0, 0, height, 0, count);
SplineHelper.offsetParts(spline, random, 1F, 0, 1F); SplineHelper.offsetParts(spline, random, 1F, 0, 1F);
SDF sdf = SplineHelper.buildSDF(spline, 2.1F, 1.5F, (pos) -> { SDF sdf = SplineHelper.buildSDF(spline, 2.1F, 1.5F, (pos) -> {
return BlockRegistry.MOSSY_GLOWSHROOM.log.getDefaultState(); return EndBlocks.MOSSY_GLOWSHROOM.log.getDefaultState();
}); });
Vector3f pos = spline.get(spline.size() - 1); Vector3f pos = spline.get(spline.size() - 1);
float scale = MHelper.randRange(0.75F, 1.1F, random); float scale = MHelper.randRange(0.75F, 1.1F, random);
@ -113,34 +113,34 @@ public class MossyGlowshroomFeature extends DefaultFeature {
.setSource(FUNCTION) .setSource(FUNCTION)
.setReplaceFunction(REPLACE) .setReplaceFunction(REPLACE)
.setPostProcess((info) -> { .setPostProcess((info) -> {
if (BlockRegistry.MOSSY_GLOWSHROOM.isTreeLog(info.getState())) { if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getState())) {
if (random.nextBoolean() && info.getStateUp().getBlock() == BlockRegistry.MOSSY_GLOWSHROOM_CAP) { if (random.nextBoolean() && info.getStateUp().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) {
info.setState(BlockRegistry.MOSSY_GLOWSHROOM_CAP.getDefaultState().with(BlockMossyGlowshroomCap.TRANSITION, true)); info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.getDefaultState().with(BlockMossyGlowshroomCap.TRANSITION, true));
return info.getState(); return info.getState();
} }
else if (!BlockRegistry.MOSSY_GLOWSHROOM.isTreeLog(info.getStateUp()) || !BlockRegistry.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown())) { else if (!EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateUp()) || !EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown())) {
info.setState(BlockRegistry.MOSSY_GLOWSHROOM.bark.getDefaultState()); info.setState(EndBlocks.MOSSY_GLOWSHROOM.bark.getDefaultState());
return info.getState(); return info.getState();
} }
} }
else if (info.getState().getBlock() == BlockRegistry.MOSSY_GLOWSHROOM_CAP) { else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) {
if (BlockRegistry.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown().getBlock())) { if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown().getBlock())) {
info.setState(BlockRegistry.MOSSY_GLOWSHROOM_CAP.getDefaultState().with(BlockMossyGlowshroomCap.TRANSITION, true)); info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.getDefaultState().with(BlockMossyGlowshroomCap.TRANSITION, true));
return info.getState(); return info.getState();
} }
info.setState(BlockRegistry.MOSSY_GLOWSHROOM_CAP.getDefaultState()); info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.getDefaultState());
return info.getState(); return info.getState();
} }
else if (info.getState().getBlock() == BlockRegistry.MOSSY_GLOWSHROOM_HYMENOPHORE) { else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) {
for (Direction dir: BlocksHelper.HORIZONTAL) { for (Direction dir: BlocksHelper.HORIZONTAL) {
if (info.getState(dir) == AIR) { if (info.getState(dir) == AIR) {
info.setBlockPos(info.getPos().offset(dir), BlockRegistry.MOSSY_GLOWSHROOM_FUR.getDefaultState().with(BlockGlowingFur.FACING, dir)); info.setBlockPos(info.getPos().offset(dir), EndBlocks.MOSSY_GLOWSHROOM_FUR.getDefaultState().with(BlockGlowingFur.FACING, dir));
} }
} }
if (info.getStateDown().getBlock() != BlockRegistry.MOSSY_GLOWSHROOM_HYMENOPHORE) { if (info.getStateDown().getBlock() != EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) {
info.setBlockPos(info.getPos().down(), BlockRegistry.MOSSY_GLOWSHROOM_FUR.getDefaultState().with(BlockGlowingFur.FACING, Direction.DOWN)); info.setBlockPos(info.getPos().down(), EndBlocks.MOSSY_GLOWSHROOM_FUR.getDefaultState().with(BlockGlowingFur.FACING, Direction.DOWN));
} }
} }
return info.getState(); return info.getState();
@ -190,7 +190,7 @@ public class MossyGlowshroomFeature extends DefaultFeature {
FUNCTION = new SDFSmoothUnion().setRadius(4).setSourceB(new SDFUnion().setSourceA(HEAD_POS).setSourceB(ROOTS_ROT)); FUNCTION = new SDFSmoothUnion().setRadius(4).setSourceB(new SDFUnion().setSourceA(HEAD_POS).setSourceB(ROOTS_ROT));
REPLACE = (state) -> { REPLACE = (state) -> {
if (state.isIn(BlockTagRegistry.END_GROUND)) { if (state.isIn(EndTags.END_GROUND)) {
return true; return true;
} }
if (state.getMaterial().equals(Material.PLANT)) { if (state.getMaterial().equals(Material.PLANT)) {

View file

@ -11,7 +11,7 @@ import net.minecraft.world.StructureWorldAccess;
import net.minecraft.world.gen.chunk.ChunkGenerator; import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.feature.DefaultFeatureConfig; import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
import ru.betterend.util.MHelper; import ru.betterend.util.MHelper;
import ru.betterend.util.sdf.SDF; import ru.betterend.util.sdf.SDF;
@ -26,18 +26,18 @@ public class PythadendronBushFeature extends DefaultFeature {
@Override @Override
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, DefaultFeatureConfig config) { public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, DefaultFeatureConfig config) {
if (world.getBlockState(pos.down()).getBlock() != BlockRegistry.CHORUS_NYLIUM) return false; if (world.getBlockState(pos.down()).getBlock() != EndBlocks.CHORUS_NYLIUM) return false;
float radius = MHelper.randRange(1.8F, 4.5F, random); float radius = MHelper.randRange(1.8F, 4.5F, random);
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextInt()); OpenSimplexNoise noise = new OpenSimplexNoise(random.nextInt());
SDF sphere = new SDFSphere().setRadius(radius).setBlock(BlockRegistry.PYTHADENDRON_LEAVES.getDefaultState().with(LeavesBlock.DISTANCE, 1)); SDF sphere = new SDFSphere().setRadius(radius).setBlock(EndBlocks.PYTHADENDRON_LEAVES.getDefaultState().with(LeavesBlock.DISTANCE, 1));
sphere = new SDFScale3D().setScale(1, 0.5F, 1).setSource(sphere); sphere = new SDFScale3D().setScale(1, 0.5F, 1).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> { return (float) noise.eval(vec.getX() * 0.2, vec.getY() * 0.2, vec.getZ() * 0.2) * 3; }).setSource(sphere); sphere = new SDFDisplacement().setFunction((vec) -> { return (float) noise.eval(vec.getX() * 0.2, vec.getY() * 0.2, vec.getZ() * 0.2) * 3; }).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> { return random.nextFloat() * 3F - 1.5F; }).setSource(sphere); sphere = new SDFDisplacement().setFunction((vec) -> { return random.nextFloat() * 3F - 1.5F; }).setSource(sphere);
sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere)); sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere));
sphere.setReplaceFunction(REPLACE); sphere.setReplaceFunction(REPLACE);
sphere.fillRecursive(world, pos); sphere.fillRecursive(world, pos);
BlocksHelper.setWithoutUpdate(world, pos, BlockRegistry.PYTHADENDRON.bark); BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.PYTHADENDRON.bark);
return true; return true;
} }

View file

@ -13,8 +13,8 @@ import net.minecraft.world.StructureWorldAccess;
import net.minecraft.world.gen.chunk.ChunkGenerator; import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.feature.DefaultFeatureConfig; import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.BlockTagRegistry; import ru.betterend.registry.EndTags;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
import ru.betterend.util.MHelper; import ru.betterend.util.MHelper;
import ru.betterend.util.SplineHelper; import ru.betterend.util.SplineHelper;
@ -30,7 +30,7 @@ public class PythadendronTreeFeature extends DefaultFeature {
@Override @Override
public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, DefaultFeatureConfig config) { public boolean generate(StructureWorldAccess world, ChunkGenerator chunkGenerator, Random random, BlockPos pos, DefaultFeatureConfig config) {
if (world.getBlockState(pos.down()).getBlock() != BlockRegistry.CHORUS_NYLIUM) return false; if (world.getBlockState(pos.down()).getBlock() != EndBlocks.CHORUS_NYLIUM) return false;
float size = MHelper.randRange(10, 20, random); float size = MHelper.randRange(10, 20, random);
List<Vector3f> spline = SplineHelper.makeSpline(0, 0, 0, 0, size, 0, 4); List<Vector3f> spline = SplineHelper.makeSpline(0, 0, 0, 0, size, 0, 4);
@ -42,11 +42,11 @@ public class PythadendronTreeFeature extends DefaultFeature {
branch(last.getX(), last.getY(), last.getZ(), size * bsize, MHelper.randRange(0, MHelper.PI2, random), random, depth, world, pos); branch(last.getX(), last.getY(), last.getZ(), size * bsize, MHelper.randRange(0, MHelper.PI2, random), random, depth, world, pos);
SDF function = SplineHelper.buildSDF(spline, 1.7F, 1.1F, (bpos) -> { SDF function = SplineHelper.buildSDF(spline, 1.7F, 1.1F, (bpos) -> {
return BlockRegistry.PYTHADENDRON.bark.getDefaultState(); return EndBlocks.PYTHADENDRON.bark.getDefaultState();
}); });
function.setPostProcess((info) -> { function.setPostProcess((info) -> {
if (BlockRegistry.PYTHADENDRON.isTreeLog(info.getStateUp()) && BlockRegistry.PYTHADENDRON.isTreeLog(info.getStateDown())) { if (EndBlocks.PYTHADENDRON.isTreeLog(info.getStateUp()) && EndBlocks.PYTHADENDRON.isTreeLog(info.getStateDown())) {
return BlockRegistry.PYTHADENDRON.log.getDefaultState(); return EndBlocks.PYTHADENDRON.log.getDefaultState();
} }
return info.getState(); return info.getState();
}); });
@ -73,14 +73,14 @@ public class PythadendronTreeFeature extends DefaultFeature {
SplineHelper.offsetParts(spline, random, 0.3F, 0, 0.3F); SplineHelper.offsetParts(spline, random, 0.3F, 0, 0.3F);
Vector3f pos1 = spline.get(spline.size() - 1); Vector3f pos1 = spline.get(spline.size() - 1);
boolean s1 = SplineHelper.fillSpline(spline, world, BlockRegistry.PYTHADENDRON.bark.getDefaultState(), pos, REPLACE); boolean s1 = SplineHelper.fillSpline(spline, world, EndBlocks.PYTHADENDRON.bark.getDefaultState(), pos, REPLACE);
spline = SplineHelper.makeSpline(x, y, z, x2, y, z2, 5); spline = SplineHelper.makeSpline(x, y, z, x2, y, z2, 5);
SplineHelper.powerOffset(spline, size * MHelper.randRange(1.0F, 2.0F, random), 4); SplineHelper.powerOffset(spline, size * MHelper.randRange(1.0F, 2.0F, random), 4);
SplineHelper.offsetParts(spline, random, 0.3F, 0, 0.3F); SplineHelper.offsetParts(spline, random, 0.3F, 0, 0.3F);
Vector3f pos2 = spline.get(spline.size() - 1); Vector3f pos2 = spline.get(spline.size() - 1);
boolean s2 = SplineHelper.fillSpline(spline, world, BlockRegistry.PYTHADENDRON.bark.getDefaultState(), pos, REPLACE); boolean s2 = SplineHelper.fillSpline(spline, world, EndBlocks.PYTHADENDRON.bark.getDefaultState(), pos, REPLACE);
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextInt()); OpenSimplexNoise noise = new OpenSimplexNoise(random.nextInt());
if (depth < 3) { if (depth < 3) {
@ -138,7 +138,7 @@ public class PythadendronTreeFeature extends DefaultFeature {
private void leavesBall(StructureWorldAccess world, BlockPos pos, Random random, OpenSimplexNoise noise) { private void leavesBall(StructureWorldAccess world, BlockPos pos, Random random, OpenSimplexNoise noise) {
float radius = MHelper.randRange(4.5F, 6.5F, random); float radius = MHelper.randRange(4.5F, 6.5F, random);
SDF sphere = new SDFSphere().setRadius(radius).setBlock(BlockRegistry.PYTHADENDRON_LEAVES.getDefaultState().with(LeavesBlock.DISTANCE, 1)); SDF sphere = new SDFSphere().setRadius(radius).setBlock(EndBlocks.PYTHADENDRON_LEAVES.getDefaultState().with(LeavesBlock.DISTANCE, 1));
sphere = new SDFScale3D().setScale(1, 0.6F, 1).setSource(sphere); sphere = new SDFScale3D().setScale(1, 0.6F, 1).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> { return (float) noise.eval(vec.getX() * 0.2, vec.getY() * 0.2, vec.getZ() * 0.2) * 3; }).setSource(sphere); sphere = new SDFDisplacement().setFunction((vec) -> { return (float) noise.eval(vec.getX() * 0.2, vec.getY() * 0.2, vec.getZ() * 0.2) * 3; }).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> { return random.nextFloat() * 3F - 1.5F; }).setSource(sphere); sphere = new SDFDisplacement().setFunction((vec) -> { return random.nextFloat() * 3F - 1.5F; }).setSource(sphere);
@ -150,17 +150,17 @@ public class PythadendronTreeFeature extends DefaultFeature {
int count = (int) (radius * 2.5F); int count = (int) (radius * 2.5F);
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
BlockPos p = pos.add(random.nextGaussian() * 1.5, random.nextGaussian() * 1.5, random.nextGaussian() * 1.5); BlockPos p = pos.add(random.nextGaussian() * 1.5, random.nextGaussian() * 1.5, random.nextGaussian() * 1.5);
BlocksHelper.setWithoutUpdate(world, p, BlockRegistry.PYTHADENDRON.bark); BlocksHelper.setWithoutUpdate(world, p, EndBlocks.PYTHADENDRON.bark);
} }
} }
} }
static { static {
REPLACE = (state) -> { REPLACE = (state) -> {
if (state.isIn(BlockTagRegistry.END_GROUND)) { if (state.isIn(EndTags.END_GROUND)) {
return true; return true;
} }
if (state.getBlock() == BlockRegistry.PYTHADENDRON_LEAVES) { if (state.getBlock() == EndBlocks.PYTHADENDRON_LEAVES) {
return true; return true;
} }
if (state.getMaterial().equals(Material.PLANT)) { if (state.getMaterial().equals(Material.PLANT)) {

View file

@ -16,9 +16,9 @@ import net.minecraft.world.StructureWorldAccess;
import net.minecraft.world.gen.chunk.ChunkGenerator; import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.feature.DefaultFeatureConfig; import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.BlockTagRegistry; import ru.betterend.registry.EndStructures;
import ru.betterend.registry.StructureRegistry; import ru.betterend.registry.EndTags;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
import ru.betterend.util.MHelper; import ru.betterend.util.MHelper;
import ru.betterend.util.sdf.SDF; import ru.betterend.util.sdf.SDF;
@ -45,7 +45,7 @@ public class RoundCaveFeature extends DefaultFeature {
bpos.setX(pos.getX()); bpos.setX(pos.getX());
bpos.setZ(pos.getZ()); bpos.setZ(pos.getZ());
bpos.setY(top); bpos.setY(top);
while (top > bottom && !world.getBlockState(bpos).isIn(BlockTagRegistry.GEN_TERRAIN)) { while (top > bottom && !world.getBlockState(bpos).isIn(EndTags.GEN_TERRAIN)) {
bpos.setY(--top); bpos.setY(--top);
} }
top -= radius + 5; top -= radius + 5;
@ -69,7 +69,7 @@ public class RoundCaveFeature extends DefaultFeature {
double nr = radius * 0.25; double nr = radius * 0.25;
Set<BlockPos> bushes = Sets.newHashSet(); Set<BlockPos> bushes = Sets.newHashSet();
BlockState terrain = BlockRegistry.CAVE_MOSS.getDefaultState(); BlockState terrain = EndBlocks.CAVE_MOSS.getDefaultState();
for (int x = x1; x <= x2; x++) { for (int x = x1; x <= x2; x++) {
int xsq = x - pos.getX(); int xsq = x - pos.getX();
xsq *= xsq; xsq *= xsq;
@ -105,7 +105,7 @@ public class RoundCaveFeature extends DefaultFeature {
} }
} }
bpos.setY(y - 1); bpos.setY(y - 1);
if (world.getBlockState(bpos).isIn(BlockTagRegistry.GEN_TERRAIN)) { if (world.getBlockState(bpos).isIn(EndTags.GEN_TERRAIN)) {
BlocksHelper.setWithoutUpdate(world, bpos, terrain); BlocksHelper.setWithoutUpdate(world, bpos, terrain);
} }
} }
@ -114,16 +114,16 @@ public class RoundCaveFeature extends DefaultFeature {
if (!state.getFluidState().isEmpty()) { if (!state.getFluidState().isEmpty()) {
BlocksHelper.setWithoutUpdate(world, bpos, Blocks.END_STONE.getDefaultState()); BlocksHelper.setWithoutUpdate(world, bpos, Blocks.END_STONE.getDefaultState());
} }
else if (world.getBlockState(bpos).isIn(BlockTagRegistry.GEN_TERRAIN)) { else if (world.getBlockState(bpos).isIn(EndTags.GEN_TERRAIN)) {
if (world.isAir(bpos.down())) { if (world.isAir(bpos.down())) {
int h = BlocksHelper.downRay(world, bpos.down(), 64); int h = BlocksHelper.downRay(world, bpos.down(), 64);
if (h > 6 && h < 32 && world.getBlockState(bpos.down(h + 3)).isIn(BlockTagRegistry.GEN_TERRAIN)) { if (h > 6 && h < 32 && world.getBlockState(bpos.down(h + 3)).isIn(EndTags.GEN_TERRAIN)) {
bushes.add(bpos.down()); bushes.add(bpos.down());
} }
} }
else if (world.isAir(bpos.up())) { else if (world.isAir(bpos.up())) {
int h = BlocksHelper.upRay(world, bpos.up(), 64); int h = BlocksHelper.upRay(world, bpos.up(), 64);
if (h > 6 && h < 32 && world.getBlockState(bpos.up(h + 3)).isIn(BlockTagRegistry.GEN_TERRAIN)) { if (h > 6 && h < 32 && world.getBlockState(bpos.up(h + 3)).isIn(EndTags.GEN_TERRAIN)) {
bushes.add(bpos.up()); bushes.add(bpos.up());
} }
} }
@ -138,23 +138,23 @@ public class RoundCaveFeature extends DefaultFeature {
} }
}); });
if (random.nextBoolean() && world.getBiome(pos).getGenerationSettings().hasStructureFeature(StructureRegistry.MOUNTAIN.getStructure())) { if (random.nextBoolean() && world.getBiome(pos).getGenerationSettings().hasStructureFeature(EndStructures.MOUNTAIN.getStructure())) {
pos = pos.add(random.nextGaussian() * 5, random.nextGaussian() * 5, random.nextGaussian() * 5); pos = pos.add(random.nextGaussian() * 5, random.nextGaussian() * 5, random.nextGaussian() * 5);
BlockPos down = pos.down(BlocksHelper.downRay(world, pos, 64) + 2); BlockPos down = pos.down(BlocksHelper.downRay(world, pos, 64) + 2);
if (isReplaceable(world.getBlockState(down))) { if (isReplaceable(world.getBlockState(down))) {
SDF prism = new SDFHexPrism().setHeight(radius * MHelper.randRange(0.6F, 0.75F, random)).setRadius(MHelper.randRange(1.7F, 3F, random)).setBlock(BlockRegistry.AURORA_CRYSTAL); SDF prism = new SDFHexPrism().setHeight(radius * MHelper.randRange(0.6F, 0.75F, random)).setRadius(MHelper.randRange(1.7F, 3F, random)).setBlock(EndBlocks.AURORA_CRYSTAL);
float angleY = MHelper.randRange(0, MHelper.PI2, random); float angleY = MHelper.randRange(0, MHelper.PI2, random);
float vx = (float) Math.sin(angleY); float vx = (float) Math.sin(angleY);
float vz = (float) Math.sin(angleY); float vz = (float) Math.sin(angleY);
prism = new SDFRotation().setRotation(new Vector3f(vx, 0, vz), random.nextFloat()).setSource(prism); prism = new SDFRotation().setRotation(new Vector3f(vx, 0, vz), random.nextFloat()).setSource(prism);
prism.setReplaceFunction((state) -> { prism.setReplaceFunction((state) -> {
return state.getMaterial().isReplaceable() return state.getMaterial().isReplaceable()
|| state.isIn(BlockTagRegistry.GEN_TERRAIN) || state.isIn(EndTags.GEN_TERRAIN)
|| state.getMaterial().equals(Material.PLANT) || state.getMaterial().equals(Material.PLANT)
|| state.getMaterial().equals(Material.LEAVES); || state.getMaterial().equals(Material.LEAVES);
}); });
prism.fillRecursive(world, pos); prism.fillRecursive(world, pos);
BlocksHelper.setWithoutUpdate(world, pos, BlockRegistry.AURORA_CRYSTAL); BlocksHelper.setWithoutUpdate(world, pos, EndBlocks.AURORA_CRYSTAL);
} }
} }
@ -164,7 +164,7 @@ public class RoundCaveFeature extends DefaultFeature {
} }
private boolean isReplaceable(BlockState state) { private boolean isReplaceable(BlockState state) {
return state.isIn(BlockTagRegistry.GEN_TERRAIN) return state.isIn(EndTags.GEN_TERRAIN)
|| state.getMaterial().isReplaceable() || state.getMaterial().isReplaceable()
|| state.getMaterial().equals(Material.PLANT) || state.getMaterial().equals(Material.PLANT)
|| state.getMaterial().equals(Material.LEAVES); || state.getMaterial().equals(Material.LEAVES);
@ -173,12 +173,12 @@ public class RoundCaveFeature extends DefaultFeature {
private void generateBush(StructureWorldAccess world, Random random, BlockPos blockPos) { private void generateBush(StructureWorldAccess world, Random random, BlockPos blockPos) {
float radius = MHelper.randRange(1.0F, 3.2F, random); float radius = MHelper.randRange(1.0F, 3.2F, random);
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextInt()); OpenSimplexNoise noise = new OpenSimplexNoise(random.nextInt());
SDF sphere = new SDFSphere().setRadius(radius).setBlock(BlockRegistry.CAVE_BUSH); SDF sphere = new SDFSphere().setRadius(radius).setBlock(EndBlocks.CAVE_BUSH);
sphere = new SDFScale3D().setScale(MHelper.randRange(0.8F, 1.2F, random), MHelper.randRange(0.8F, 1.2F, random), MHelper.randRange(0.8F, 1.2F, random)).setSource(sphere); sphere = new SDFScale3D().setScale(MHelper.randRange(0.8F, 1.2F, random), MHelper.randRange(0.8F, 1.2F, random), MHelper.randRange(0.8F, 1.2F, random)).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> { return (float) noise.eval(vec.getX() * 0.2, vec.getY() * 0.2, vec.getZ() * 0.2) * 3; }).setSource(sphere); sphere = new SDFDisplacement().setFunction((vec) -> { return (float) noise.eval(vec.getX() * 0.2, vec.getY() * 0.2, vec.getZ() * 0.2) * 3; }).setSource(sphere);
sphere = new SDFDisplacement().setFunction((vec) -> { return random.nextFloat() * 3F - 1.5F; }).setSource(sphere); sphere = new SDFDisplacement().setFunction((vec) -> { return random.nextFloat() * 3F - 1.5F; }).setSource(sphere);
sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere)); sphere = new SDFSubtraction().setSourceA(sphere).setSourceB(new SDFTranslate().setTranslate(0, -radius, 0).setSource(sphere));
sphere.fillRecursive(world, blockPos); sphere.fillRecursive(world, blockPos);
BlocksHelper.setWithoutUpdate(world, blockPos, BlockRegistry.CAVE_BUSH); BlocksHelper.setWithoutUpdate(world, blockPos, EndBlocks.CAVE_BUSH);
} }
} }

View file

@ -7,7 +7,7 @@ import net.minecraft.util.math.BlockPos.Mutable;
import net.minecraft.world.StructureWorldAccess; import net.minecraft.world.StructureWorldAccess;
import net.minecraft.world.gen.chunk.ChunkGenerator; import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.feature.DefaultFeatureConfig; import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import ru.betterend.registry.BlockTagRegistry; import ru.betterend.registry.EndTags;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
import ru.betterend.util.MHelper; import ru.betterend.util.MHelper;
@ -31,7 +31,7 @@ public abstract class ScatterFeature extends DefaultFeature {
if (pos.getY() < 5) { if (pos.getY() < 5) {
return false; return false;
} }
else if (!world.getBlockState(pos.down()).isIn(BlockTagRegistry.END_GROUND)) { else if (!world.getBlockState(pos.down()).isIn(EndTags.END_GROUND)) {
return false; return false;
} }
return true; return true;

View file

@ -17,8 +17,8 @@ import net.minecraft.world.biome.source.TheEndBiomeSource;
import net.minecraft.world.gen.ChunkRandom; import net.minecraft.world.gen.ChunkRandom;
import ru.betterend.BetterEnd; import ru.betterend.BetterEnd;
import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.BiomeRegistry; import ru.betterend.registry.EndBiomes;
import ru.betterend.registry.BlockTagRegistry; import ru.betterend.registry.EndTags;
import ru.betterend.util.FeaturesHelper; import ru.betterend.util.FeaturesHelper;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
@ -42,8 +42,8 @@ public class BetterEndBiomeSource extends BiomeSource {
public BetterEndBiomeSource(Registry<Biome> biomeRegistry, long seed) { public BetterEndBiomeSource(Registry<Biome> biomeRegistry, long seed) {
super(getBiomes(biomeRegistry)); super(getBiomes(biomeRegistry));
this.mapLand = new BiomeMap(seed, 256, BiomeRegistry.LAND_BIOMES); this.mapLand = new BiomeMap(seed, 256, EndBiomes.LAND_BIOMES);
this.mapVoid = new BiomeMap(seed, 256, BiomeRegistry.VOID_BIOMES); this.mapVoid = new BiomeMap(seed, 256, EndBiomes.VOID_BIOMES);
this.centerBiome = biomeRegistry.getOrThrow(BiomeKeys.THE_END); this.centerBiome = biomeRegistry.getOrThrow(BiomeKeys.THE_END);
this.barrens = biomeRegistry.getOrThrow(BiomeKeys.END_BARRENS); this.barrens = biomeRegistry.getOrThrow(BiomeKeys.END_BARRENS);
this.biomeRegistry = biomeRegistry; this.biomeRegistry = biomeRegistry;
@ -53,8 +53,8 @@ public class BetterEndBiomeSource extends BiomeSource {
chunkRandom.consume(17292); chunkRandom.consume(17292);
this.noise = new SimplexNoiseSampler(chunkRandom); this.noise = new SimplexNoiseSampler(chunkRandom);
BiomeRegistry.mutateRegistry(biomeRegistry); EndBiomes.mutateRegistry(biomeRegistry);
BlockTagRegistry.addTerrainTags(biomeRegistry); EndTags.addTerrainTags(biomeRegistry);
FeaturesHelper.addFeatures(biomeRegistry); FeaturesHelper.addFeatures(biomeRegistry);
} }
@ -86,7 +86,7 @@ public class BetterEndBiomeSource extends BiomeSource {
mapVoid.clearCache(); mapVoid.clearCache();
} }
return biomeRegistry.getOrThrow(BiomeRegistry.getBiomeKey(netherBiome)); return biomeRegistry.getOrThrow(EndBiomes.getBiomeKey(netherBiome));
} }
@Override @Override

View file

@ -5,7 +5,7 @@ import java.util.Random;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import ru.betterend.registry.BiomeRegistry; import ru.betterend.registry.EndBiomes;
import ru.betterend.world.biome.EndBiome; import ru.betterend.world.biome.EndBiome;
public class BiomePicker { public class BiomePicker {
@ -37,7 +37,7 @@ public class BiomePicker {
for (EndBiome biome: biomes) for (EndBiome biome: biomes)
if (biome.canGenerate(chance)) if (biome.canGenerate(chance))
return biome; return biome;
return BiomeRegistry.END; return EndBiomes.END;
} }
public List<EndBiome> getBiomes() { public List<EndBiome> getBiomes() {

View file

@ -9,7 +9,7 @@ import net.minecraft.util.math.Direction;
import ru.betterend.blocks.BlockMossyGlowshroomCap; import ru.betterend.blocks.BlockMossyGlowshroomCap;
import ru.betterend.blocks.basis.BlockGlowingFur; import ru.betterend.blocks.basis.BlockGlowingFur;
import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
import ru.betterend.util.MHelper; import ru.betterend.util.MHelper;
import ru.betterend.util.SplineHelper; import ru.betterend.util.SplineHelper;
@ -66,17 +66,17 @@ public class StructureGiantMossyGlowshroom extends SDFStructureFeature {
SDFBinary function = new SDFSmoothUnion().setRadius(4).setSourceB(new SDFUnion().setSourceA(HEAD_POS).setSourceB(rotRoots)); SDFBinary function = new SDFSmoothUnion().setRadius(4).setSourceB(new SDFUnion().setSourceA(HEAD_POS).setSourceB(rotRoots));
cone1.setBlock(BlockRegistry.MOSSY_GLOWSHROOM_CAP); cone1.setBlock(EndBlocks.MOSSY_GLOWSHROOM_CAP);
cone2.setBlock(BlockRegistry.MOSSY_GLOWSHROOM_CAP); cone2.setBlock(EndBlocks.MOSSY_GLOWSHROOM_CAP);
priGlowCone.setBlock(BlockRegistry.MOSSY_GLOWSHROOM_HYMENOPHORE); priGlowCone.setBlock(EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE);
primRoots.setBlock(BlockRegistry.MOSSY_GLOWSHROOM.bark); primRoots.setBlock(EndBlocks.MOSSY_GLOWSHROOM.bark);
float height = MHelper.randRange(10F, 25F, random); float height = MHelper.randRange(10F, 25F, random);
int count = MHelper.floor(height / 4); int count = MHelper.floor(height / 4);
List<Vector3f> spline = SplineHelper.makeSpline(0, 0, 0, 0, height, 0, count); List<Vector3f> spline = SplineHelper.makeSpline(0, 0, 0, 0, height, 0, count);
SplineHelper.offsetParts(spline, random, 1F, 0, 1F); SplineHelper.offsetParts(spline, random, 1F, 0, 1F);
SDF sdf = SplineHelper.buildSDF(spline, 2.1F, 1.5F, (pos) -> { SDF sdf = SplineHelper.buildSDF(spline, 2.1F, 1.5F, (pos) -> {
return BlockRegistry.MOSSY_GLOWSHROOM.log.getDefaultState(); return EndBlocks.MOSSY_GLOWSHROOM.log.getDefaultState();
}); });
Vector3f pos = spline.get(spline.size() - 1); Vector3f pos = spline.get(spline.size() - 1);
float scale = MHelper.randRange(2F, 3.5F, random); float scale = MHelper.randRange(2F, 3.5F, random);
@ -89,34 +89,34 @@ public class StructureGiantMossyGlowshroom extends SDFStructureFeature {
.setScale(scale) .setScale(scale)
.setSource(function)) .setSource(function))
.setPostProcess((info) -> { .setPostProcess((info) -> {
if (BlockRegistry.MOSSY_GLOWSHROOM.isTreeLog(info.getState())) { if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getState())) {
if (random.nextBoolean() && info.getStateUp().getBlock() == BlockRegistry.MOSSY_GLOWSHROOM_CAP) { if (random.nextBoolean() && info.getStateUp().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) {
info.setState(BlockRegistry.MOSSY_GLOWSHROOM_CAP.getDefaultState().with(BlockMossyGlowshroomCap.TRANSITION, true)); info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.getDefaultState().with(BlockMossyGlowshroomCap.TRANSITION, true));
return info.getState(); return info.getState();
} }
else if (!BlockRegistry.MOSSY_GLOWSHROOM.isTreeLog(info.getStateUp()) || !BlockRegistry.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown())) { else if (!EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateUp()) || !EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown())) {
info.setState(BlockRegistry.MOSSY_GLOWSHROOM.bark.getDefaultState()); info.setState(EndBlocks.MOSSY_GLOWSHROOM.bark.getDefaultState());
return info.getState(); return info.getState();
} }
} }
else if (info.getState().getBlock() == BlockRegistry.MOSSY_GLOWSHROOM_CAP) { else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_CAP) {
if (BlockRegistry.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown().getBlock())) { if (EndBlocks.MOSSY_GLOWSHROOM.isTreeLog(info.getStateDown().getBlock())) {
info.setState(BlockRegistry.MOSSY_GLOWSHROOM_CAP.getDefaultState().with(BlockMossyGlowshroomCap.TRANSITION, true)); info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.getDefaultState().with(BlockMossyGlowshroomCap.TRANSITION, true));
return info.getState(); return info.getState();
} }
info.setState(BlockRegistry.MOSSY_GLOWSHROOM_CAP.getDefaultState()); info.setState(EndBlocks.MOSSY_GLOWSHROOM_CAP.getDefaultState());
return info.getState(); return info.getState();
} }
else if (info.getState().getBlock() == BlockRegistry.MOSSY_GLOWSHROOM_HYMENOPHORE) { else if (info.getState().getBlock() == EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) {
for (Direction dir: BlocksHelper.HORIZONTAL) { for (Direction dir: BlocksHelper.HORIZONTAL) {
if (info.getState(dir) == AIR) { if (info.getState(dir) == AIR) {
info.setBlockPos(info.getPos().offset(dir), BlockRegistry.MOSSY_GLOWSHROOM_FUR.getDefaultState().with(BlockGlowingFur.FACING, dir)); info.setBlockPos(info.getPos().offset(dir), EndBlocks.MOSSY_GLOWSHROOM_FUR.getDefaultState().with(BlockGlowingFur.FACING, dir));
} }
} }
if (info.getStateDown().getBlock() != BlockRegistry.MOSSY_GLOWSHROOM_HYMENOPHORE) { if (info.getStateDown().getBlock() != EndBlocks.MOSSY_GLOWSHROOM_HYMENOPHORE) {
info.setBlockPos(info.getPos().down(), BlockRegistry.MOSSY_GLOWSHROOM_FUR.getDefaultState().with(BlockGlowingFur.FACING, Direction.DOWN)); info.setBlockPos(info.getPos().down(), EndBlocks.MOSSY_GLOWSHROOM_FUR.getDefaultState().with(BlockGlowingFur.FACING, Direction.DOWN));
} }
} }
return info.getState(); return info.getState();

View file

@ -12,7 +12,7 @@ import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.chunk.ChunkGenerator; import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.feature.DefaultFeatureConfig; import net.minecraft.world.gen.feature.DefaultFeatureConfig;
import net.minecraft.world.gen.feature.StructureFeature; import net.minecraft.world.gen.feature.StructureFeature;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.util.MHelper; import ru.betterend.util.MHelper;
import ru.betterend.world.structures.piece.PaintedMountainPiece; import ru.betterend.world.structures.piece.PaintedMountainPiece;
@ -51,8 +51,8 @@ public class StructurePaintedMountain extends StructureFeatureBase {
static { static {
VARIANTS = new BlockState[] { VARIANTS = new BlockState[] {
Blocks.END_STONE.getDefaultState(), Blocks.END_STONE.getDefaultState(),
BlockRegistry.FLAVOLITE.stone.getDefaultState(), EndBlocks.FLAVOLITE.stone.getDefaultState(),
BlockRegistry.VIOLECITE.stone.getDefaultState(), EndBlocks.VIOLECITE.stone.getDefaultState(),
}; };
} }
} }

View file

@ -14,8 +14,8 @@ import net.minecraft.world.StructureWorldAccess;
import net.minecraft.world.gen.StructureAccessor; import net.minecraft.world.gen.StructureAccessor;
import net.minecraft.world.gen.chunk.ChunkGenerator; import net.minecraft.world.gen.chunk.ChunkGenerator;
import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.BlockTagRegistry; import ru.betterend.registry.EndStructures;
import ru.betterend.registry.StructureRegistry; import ru.betterend.registry.EndTags;
import ru.betterend.util.BlocksHelper; import ru.betterend.util.BlocksHelper;
import ru.betterend.util.MHelper; import ru.betterend.util.MHelper;
@ -25,7 +25,7 @@ public class CavePiece extends BasePiece {
private float radius; private float radius;
public CavePiece(BlockPos center, float radius, int id) { public CavePiece(BlockPos center, float radius, int id) {
super(StructureRegistry.CAVE_PIECE, id); super(EndStructures.CAVE_PIECE, id);
this.center = center; this.center = center;
this.radius = radius; this.radius = radius;
this.noise = new OpenSimplexNoise(MHelper.getSeed(534, center.getX(), center.getZ())); this.noise = new OpenSimplexNoise(MHelper.getSeed(534, center.getX(), center.getZ()));
@ -33,7 +33,7 @@ public class CavePiece extends BasePiece {
} }
public CavePiece(StructureManager manager, CompoundTag tag) { public CavePiece(StructureManager manager, CompoundTag tag) {
super(StructureRegistry.CAVE_PIECE, tag); super(EndStructures.CAVE_PIECE, tag);
makeBoundingBox(); makeBoundingBox();
} }
@ -66,7 +66,7 @@ public class CavePiece extends BasePiece {
double r2 = r - 4.5; double r2 = r - 4.5;
double dist = xsq + ysq + zsq; double dist = xsq + ysq + zsq;
if (dist < r2 * r2) { if (dist < r2 * r2) {
if (world.getBlockState(pos).isIn(BlockTagRegistry.END_GROUND)) { if (world.getBlockState(pos).isIn(EndTags.END_GROUND)) {
BlocksHelper.setWithoutUpdate(world, pos, AIR); BlocksHelper.setWithoutUpdate(world, pos, AIR);
} }
} }

View file

@ -22,10 +22,10 @@ import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.gen.StructureAccessor; import net.minecraft.world.gen.StructureAccessor;
import net.minecraft.world.gen.chunk.ChunkGenerator; import net.minecraft.world.gen.chunk.ChunkGenerator;
import ru.betterend.noise.OpenSimplexNoise; import ru.betterend.noise.OpenSimplexNoise;
import ru.betterend.registry.BiomeRegistry; import ru.betterend.registry.EndBiomes;
import ru.betterend.registry.BlockRegistry; import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.BlockTagRegistry; import ru.betterend.registry.EndStructures;
import ru.betterend.registry.StructureRegistry; import ru.betterend.registry.EndTags;
import ru.betterend.util.MHelper; import ru.betterend.util.MHelper;
public class LakePiece extends BasePiece { public class LakePiece extends BasePiece {
@ -38,7 +38,7 @@ public class LakePiece extends BasePiece {
private float r2; private float r2;
public LakePiece(BlockPos center, float radius, float depth, int id) { public LakePiece(BlockPos center, float radius, float depth, int id) {
super(StructureRegistry.LAKE_PIECE, id); super(EndStructures.LAKE_PIECE, id);
this.center = center; this.center = center;
this.radius = radius; this.radius = radius;
this.depth = depth; this.depth = depth;
@ -48,7 +48,7 @@ public class LakePiece extends BasePiece {
} }
public LakePiece(StructureManager manager, CompoundTag tag) { public LakePiece(StructureManager manager, CompoundTag tag) {
super(StructureRegistry.LAKE_PIECE, tag); super(EndStructures.LAKE_PIECE, tag);
makeBoundingBox(); makeBoundingBox();
} }
@ -100,13 +100,13 @@ public class LakePiece extends BasePiece {
} }
minY = MathHelper.lerp(lerp, maxY - minY, 56 - minY); minY = MathHelper.lerp(lerp, maxY - minY, 56 - minY);
pos.setY(maxY); pos.setY(maxY);
while (chunk.getBlockState(pos).isIn(BlockTagRegistry.GEN_TERRAIN)) { while (chunk.getBlockState(pos).isIn(EndTags.GEN_TERRAIN)) {
pos.setY(maxY ++); pos.setY(maxY ++);
} }
for (int y = maxY; y >= minY; y--) { for (int y = maxY; y >= minY; y--) {
pos.setY(y - 1); pos.setY(y - 1);
BlockState state = chunk.getBlockState(pos); BlockState state = chunk.getBlockState(pos);
if (state.getMaterial().isReplaceable() || state.isIn(BlockTagRegistry.GEN_TERRAIN)) { if (state.getMaterial().isReplaceable() || state.isIn(EndTags.GEN_TERRAIN)) {
pos.setY(y); pos.setY(y);
chunk.setBlockState(pos, y > 56 ? AIR : WATER, false); chunk.setBlockState(pos, y > 56 ? AIR : WATER, false);
} }
@ -117,15 +117,15 @@ public class LakePiece extends BasePiece {
} }
if (pos.getY() < 57) { if (pos.getY() < 57) {
BlockState state = chunk.getBlockState(pos); BlockState state = chunk.getBlockState(pos);
if (state.getMaterial().isReplaceable() || state.isIn(BlockTagRegistry.GEN_TERRAIN)) { if (state.getMaterial().isReplaceable() || state.isIn(EndTags.GEN_TERRAIN)) {
chunk.setBlockState(pos, BlockRegistry.ENDSTONE_DUST.getDefaultState(), false); chunk.setBlockState(pos, EndBlocks.ENDSTONE_DUST.getDefaultState(), false);
pos.setY(pos.getY() - 1); pos.setY(pos.getY() - 1);
state = chunk.getBlockState(pos); state = chunk.getBlockState(pos);
if (state.getMaterial().isReplaceable() || state.isIn(BlockTagRegistry.GEN_TERRAIN)) { if (state.getMaterial().isReplaceable() || state.isIn(EndTags.GEN_TERRAIN)) {
chunk.setBlockState(pos, BlockRegistry.ENDSTONE_DUST.getDefaultState(), false); chunk.setBlockState(pos, EndBlocks.ENDSTONE_DUST.getDefaultState(), false);
pos.setY(pos.getY() - 1); pos.setY(pos.getY() - 1);
} }
if (!chunk.getBlockState(pos).isIn(BlockTagRegistry.GEN_TERRAIN)) { if (!chunk.getBlockState(pos).isIn(EndTags.GEN_TERRAIN)) {
chunk.setBlockState(pos, Blocks.END_STONE.getDefaultState(), false); chunk.setBlockState(pos, Blocks.END_STONE.getDefaultState(), false);
} }
@ -149,7 +149,7 @@ public class LakePiece extends BasePiece {
return h; return h;
} }
if (BiomeRegistry.getFromBiome(world.getBiome(pos)) != BiomeRegistry.MEGALAKE) { if (EndBiomes.getFromBiome(world.getBiome(pos)) != EndBiomes.MEGALAKE) {
heightmap.put(p, -4); heightmap.put(p, -4);
return -4; return -4;
} }

Some files were not shown because too many files have changed in this diff Show more