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

@ -28,7 +28,7 @@ import ru.betterend.world.biome.EndBiome;
import ru.betterend.world.generator.BiomePicker;
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 HashMap<Identifier, EndBiome> ID_MAP = 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 mutateRegistry(Registry<Biome> biomeRegistry) {
BiomeRegistry.biomeRegistry = biomeRegistry;
EndBiomes.biomeRegistry = biomeRegistry;
BiomeRegistry.MUTABLE.clear();
EndBiomes.MUTABLE.clear();
LAND_BIOMES.clearMutables();
for (EndBiome biome : BiomeRegistry.LAND_BIOMES.getBiomes())
BiomeRegistry.MUTABLE.put(biomeRegistry.getOrThrow(BiomeRegistry.getBiomeKey(biome)), biome);
for (EndBiome biome : BiomeRegistry.VOID_BIOMES.getBiomes())
BiomeRegistry.MUTABLE.put(biomeRegistry.getOrThrow(BiomeRegistry.getBiomeKey(biome)), biome);
for (EndBiome biome : EndBiomes.LAND_BIOMES.getBiomes())
EndBiomes.MUTABLE.put(biomeRegistry.getOrThrow(EndBiomes.getBiomeKey(biome)), biome);
for (EndBiome biome : EndBiomes.VOID_BIOMES.getBiomes())
EndBiomes.MUTABLE.put(biomeRegistry.getOrThrow(EndBiomes.getBiomeKey(biome)), biome);
biomeRegistry.forEach((biome) -> {
if (biome.getCategory() == Category.THEEND) {
@ -166,8 +166,8 @@ public class BiomeRegistry {
public static List<EndBiome> getModBiomes() {
List<EndBiome> result = Lists.newArrayList();
result.addAll(BiomeRegistry.LAND_BIOMES.getBiomes());
result.addAll(BiomeRegistry.VOID_BIOMES.getBiomes());
result.addAll(EndBiomes.LAND_BIOMES.getBiomes());
result.addAll(EndBiomes.VOID_BIOMES.getBiomes());
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.EndStoneSmelterBlockEntity;
public class BlockEntityRegistry {
public class EndBlockEntities {
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",
BlockEntityType.Builder.create(EChestBlockEntity::new, getChests()));
public static final BlockEntityType<EBarrelBlockEntity> BARREL = registerBlockEntity("barrel",
@ -37,7 +37,7 @@ public class BlockEntityRegistry {
static Block[] getChests() {
List<Block> result = Lists.newArrayList();
ItemRegistry.getModBlocks().forEach((item) -> {
EndItems.getModBlocks().forEach((item) -> {
if (item instanceof BlockItem) {
Block block = ((BlockItem) item).getBlock();
if (block instanceof BlockChest) {
@ -50,7 +50,7 @@ public class BlockEntityRegistry {
static Block[] getBarrels() {
List<Block> result = Lists.newArrayList();
ItemRegistry.getModBlocks().forEach((item) -> {
EndItems.getModBlocks().forEach((item) -> {
if (item instanceof BlockItem) {
Block block = ((BlockItem) item).getBlock();
if (block instanceof BlockBarrel) {
@ -63,7 +63,7 @@ public class BlockEntityRegistry {
static Block[] getSigns() {
List<Block> result = Lists.newArrayList();
ItemRegistry.getModBlocks().forEach((item) -> {
EndItems.getModBlocks().forEach((item) -> {
if (item instanceof BlockItem) {
Block block = ((BlockItem) item).getBlock();
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.ESignBlockEntityRenderer;
public class BlockEntityRenderRegistry {
public class EndBlockEntityRenders {
@Environment(EnvType.CLIENT)
public static void register() {
BlockEntityRendererRegistry.INSTANCE.register(BlockEntityRegistry.CHEST, EChestBlockEntityRenderer::new);
BlockEntityRendererRegistry.INSTANCE.register(BlockEntityRegistry.SIGN, ESignBlockEntityRenderer::new);
BlockEntityRendererRegistry.INSTANCE.register(EndBlockEntities.CHEST, EChestBlockEntityRenderer::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.tab.CreativeTab;
public class BlockRegistry {
public class EndBlocks {
// Terrain //
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));
@ -108,7 +108,7 @@ public class BlockRegistry {
public static final Block DENSE_VINE = registerBlock("dense_vine", new BlockVine(15, true));
// 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 //
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) {
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;
}

View file

@ -17,7 +17,7 @@ import ru.betterend.entity.EntityEndSlime;
import ru.betterend.util.MHelper;
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<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));
@ -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) {
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);
ItemRegistry.registerEgg("spawn_egg_" + name, type, eggColor, dotsColor);
EndItems.registerEgg("spawn_egg_" + name, type, eggColor, dotsColor);
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.RendererEntityEndSlime;
public class EntityRenderRegistry {
public class EndEntitiesRenders {
public static void register() {
register(EntityRegistry.DRAGONFLY, RendererEntityDragonfly.class);
register(EntityRegistry.END_SLIME, RendererEntityEndSlime.class);
register(EntityRegistry.END_FISH, RendererEntityEndFish.class);
register(EndEntities.DRAGONFLY, RendererEntityDragonfly.class);
register(EndEntities.END_SLIME, RendererEntityEndSlime.class);
register(EndEntities.END_FISH, RendererEntityEndFish.class);
}
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.VineFeature;
public class FeatureRegistry {
public class EndFeatures {
// Trees //
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);
@ -37,17 +37,17 @@ public class FeatureRegistry {
public static final EndFeature PYTHADENDRON_BUSH = new EndFeature("pythadendron_bush", new PythadendronBushFeature(), 4);
// 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 CREEPING_MOSS = new EndFeature("creeping_moss", new SinglePlantFeature(BlockRegistry.CREEPING_MOSS, 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(EndBlocks.CREEPING_MOSS, 5), 5);
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 CAVE_GRASS = new EndFeature("cave_grass", new CavePlantFeature(BlockRegistry.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 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(EndBlocks.CAVE_GRASS, 7), 7);
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_RARE = new EndFeature("bubble_coral_rare", new UnderwaterPlantFeature(BlockRegistry.BUBBLE_CORAL, 3), 2);
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(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_RARE = new EndFeature("end_lily_rare", new EndLilyFeature(3), 1);
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);
// Ores //
public static final EndFeature ENDER_ORE = EndFeature.makeOreFeature("ender_ore", BlockRegistry.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 FLAVOLITE_LAYER = EndFeature.makeLayerFeature("flavolite_layer", BlockRegistry.FLAVOLITE, 12, 4, 96, 6);
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", EndBlocks.VIOLECITE, 15, 4, 96, 8);
public static final EndFeature FLAVOLITE_LAYER = EndFeature.makeLayerFeature("flavolite_layer", EndBlocks.FLAVOLITE, 12, 4, 96, 6);
// Other //
public static final EndPortalFeature END_PORTAL = new EndPortalFeature(new DefaultEndPortalFeature(), (RunedFlavolite) BlockRegistry.FLAVOLITE_RUNED);
public static final EndPortalFeature END_PORTAL_ETERNAL = new EndPortalFeature(new DefaultEndPortalFeature(), (RunedFlavolite) BlockRegistry.FLAVOLITE_RUNED_ETERNAL);
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) EndBlocks.FLAVOLITE_RUNED_ETERNAL);
public static void registerBiomeFeatures(Identifier id, Biome biome, List<List<Supplier<ConfiguredFeature<?, ?>>>> features) {
if (id.getNamespace().equals("minecraft")) {

View file

@ -36,7 +36,7 @@ import ru.betterend.item.EternalCrystal;
import ru.betterend.tab.CreativeTab;
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_ITEMS = Lists.newArrayList();
@ -105,7 +105,7 @@ public class ItemRegistry {
} else if (item instanceof EndHoe) {
TagHelper.addTag((Tag.Identified<Item>) FabricToolTags.HOES, item);
} else if (item instanceof EndHammer) {
TagHelper.addTag((Tag.Identified<Item>) ItemTagRegistry.HAMMERS, item);
TagHelper.addTag((Tag.Identified<Item>) EndTags.HAMMERS, item);
}
return item;

View file

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

View file

@ -1,11 +1,11 @@
package ru.betterend.registry;
import net.fabricmc.fabric.api.client.screenhandler.v1.ScreenRegistry;
import ru.betterend.client.gui.EndStoneSmelterScreen;
import ru.betterend.client.gui.EndStoneSmelterScreenHandler;
public class ScreensRegistry {
public static void register() {
ScreenRegistry.register(EndStoneSmelterScreenHandler.HANDLER_TYPE, EndStoneSmelterScreen::new);
}
}
package ru.betterend.registry;
import net.fabricmc.fabric.api.client.screenhandler.v1.ScreenRegistry;
import ru.betterend.client.gui.EndStoneSmelterScreen;
import ru.betterend.client.gui.EndStoneSmelterScreenHandler;
public class EndScreens {
public static void register() {
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 ru.betterend.BetterEnd;
public class SoundRegistry {
public class EndSounds {
// Music
public static final SoundEvent MUSIC_FOGGY_MUSHROOMLAND = register("music", "foggy_mushroomland");
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_CHORUS_FOREST = register("ambient", "chorus_forest");
public static final SoundEvent AMBIENT_MEGALAKE = register("ambient", "megalake");
public static final SoundEvent AMBIENT_DUST_WASTELANDS = register("ambient", "dust_wastelands");
// Entity
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.VoxelPiece;
public class StructureRegistry {
public class EndStructures {
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 CAVE_PIECE = register("cave_piece", CavePiece::new);

View file

@ -1,12 +1,18 @@
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.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.tag.BlockTags;
import net.minecraft.tag.Tag;
import net.minecraft.tag.Tag.Identified;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.Biome.Category;
@ -15,18 +21,22 @@ import ru.betterend.BetterEnd;
import ru.betterend.blocks.BlockTerrain;
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> GEN_TERRAIN = makeTag("gen_terrain");
// Item Tags
public final static Tag<Item> HAMMERS = registerFabricItemTag("hammers");
private static Tag.Identified<Block> makeTag(String name) {
return (Identified<Block>) TagRegistry.block(BetterEnd.makeID(name));
}
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();
if (block instanceof BlockTerrain) {
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) {
@ -54,4 +75,12 @@ public class BlockTagRegistry {
public static boolean validGenBlock(BlockState block) {
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
)
));
}
}