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

@ -22,7 +22,7 @@ import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
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.world.biome.EndBiome;
@ -73,7 +73,7 @@ public class BackgroundRendererMixin {
Biome biome = entity.world.getBiome(entity.getBlockPos());
FluidState fluidState = camera.getSubmergedFluidState();
if (biome.getCategory() == Category.THEEND && fluidState.isEmpty()) {
EndBiome endBiome = BiomeRegistry.getRenderBiome(biome);
EndBiome endBiome = EndBiomes.getRenderBiome(biome);
if (fogDensity == 0) {
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.Direction;
import net.minecraft.world.World;
import ru.betterend.registry.BlockRegistry;
import ru.betterend.registry.BlockTagRegistry;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndTags;
import ru.betterend.util.BlocksHelper;
@Mixin(BoneMealItem.class)
@ -31,7 +31,7 @@ public class BoneMealItemMixin {
World world = context.getWorld();
BlockPos blockPos = context.getBlockPos();
if (!world.isClient) {
if (world.getBlockState(blockPos).isIn(BlockTagRegistry.END_GROUND)) {
if (world.getBlockState(blockPos).isIn(EndTags.END_GROUND)) {
boolean consume = false;
if (world.getBlockState(blockPos).getBlock() == Blocks.END_STONE) {
BlockState nylium = beGetNylium(world, blockPos);
@ -82,14 +82,14 @@ public class BoneMealItemMixin {
private BlockState beGetGrassState(World world, BlockPos pos) {
BlockState state = world.getBlockState(pos);
Block block = state.getBlock();
if (block == BlockRegistry.END_MOSS || block == BlockRegistry.END_MYCELIUM) {
return world.random.nextBoolean() ? BlockRegistry.CREEPING_MOSS.getDefaultState() : BlockRegistry.UMBRELLA_MOSS.getDefaultState();
if (block == EndBlocks.END_MOSS || block == EndBlocks.END_MYCELIUM) {
return world.random.nextBoolean() ? EndBlocks.CREEPING_MOSS.getDefaultState() : EndBlocks.UMBRELLA_MOSS.getDefaultState();
}
else if (block == BlockRegistry.CAVE_MOSS) {
return BlockRegistry.CAVE_GRASS.getDefaultState();
else if (block == EndBlocks.CAVE_MOSS) {
return EndBlocks.CAVE_GRASS.getDefaultState();
}
else if (block == BlockRegistry.CHORUS_NYLIUM) {
return BlockRegistry.CHORUS_GRASS.getDefaultState();
else if (block == EndBlocks.CHORUS_NYLIUM) {
return EndBlocks.CHORUS_GRASS.getDefaultState();
}
return null;
}

View file

@ -25,8 +25,8 @@ import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraft.world.WorldAccess;
import net.minecraft.world.WorldView;
import ru.betterend.registry.BlockRegistry;
import ru.betterend.registry.BlockTagRegistry;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndTags;
import ru.betterend.util.BlocksHelper;
@Mixin(value = ChorusFlowerBlock.class, priority = 100)
@ -44,7 +44,7 @@ public abstract class ChorusFlowerBlockMixin extends Block {
@Inject(method = "canPlaceAt", at = @At("HEAD"), cancellable = true)
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.cancel();
}
@ -52,7 +52,7 @@ public abstract class ChorusFlowerBlockMixin extends Block {
@Inject(method = "randomTick", at = @At("HEAD"), cancellable = true)
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();
if (world.isAir(up) && up.getY() < 256) {
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.WorldAccess;
import net.minecraft.world.WorldView;
import ru.betterend.registry.BlockRegistry;
import ru.betterend.registry.BlockTagRegistry;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndTags;
import ru.betterend.util.BlocksHelper;
@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) {
BlockState plant = info.getReturnValue();
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.cancel();
}
@ -58,7 +58,7 @@ public abstract class ChorusPlantBlockMixin extends Block {
@Inject(method = "canPlaceAt", at = @At("HEAD"), cancellable = true)
private void beCanPlace(BlockState state, WorldView world, BlockPos pos, CallbackInfoReturnable<Boolean> info) {
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.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) {
BlockState plant = info.getReturnValue();
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);
info.cancel();
}
@ -86,7 +86,7 @@ public abstract class ChorusPlantBlockMixin extends Block {
BlockPos pos = ctx.getBlockPos();
World world = ctx.getWorld();
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.cancel();
}

View file

@ -16,7 +16,7 @@ import net.minecraft.world.StructureWorldAccess;
import net.minecraft.world.gen.chunk.ChunkGenerator;
import net.minecraft.world.gen.feature.ChorusPlantFeature;
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.MHelper;
@ -24,7 +24,7 @@ import ru.betterend.util.MHelper;
public class ChorusPlantFeatureMixin {
@Inject(method = "generate", at = @At("HEAD"), cancellable = true)
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));
BlockState bottom = structureWorldAccess.getBlockState(blockPos);
if (bottom.isOf(Blocks.CHORUS_PLANT)) {