Reorganized Imports/Packages

This commit is contained in:
Frank 2022-05-18 23:56:18 +02:00
parent a8beba9196
commit 770a5b4046
854 changed files with 42775 additions and 41811 deletions

View file

@ -0,0 +1,26 @@
package org.betterx.betterend.registry;
import net.minecraft.core.Registry;
import net.minecraft.world.entity.ai.attributes.Attribute;
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.item.EndAttribute;
public class EndAttributes {
public final static Attribute BLINDNESS_RESISTANCE = registerAttribute("generic.blindness_resistance", 0.0, true);
public static Attribute registerAttribute(String name, double value, boolean syncable) {
return Registry.register(
Registry.ATTRIBUTE,
BetterEnd.makeID(name),
new EndAttribute("attribute.name." + name, value).setSyncable(syncable)
);
}
public static AttributeSupplier.Builder addLivingEntityAttributes(AttributeSupplier.Builder builder) {
return builder.add(EndAttributes.BLINDNESS_RESISTANCE);
}
}

View file

@ -0,0 +1,160 @@
package org.betterx.betterend.registry;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.level.biome.Biome;
import org.betterx.bclib.api.LifeCycleAPI;
import org.betterx.bclib.api.biomes.BiomeAPI;
import org.betterx.bclib.world.biomes.BCLBiome;
import org.betterx.bclib.world.generator.BiomePicker;
import org.betterx.bclib.world.generator.map.hex.HexBiomeMap;
import org.betterx.betterend.config.Configs;
import org.betterx.betterend.world.biome.EndBiome;
import org.betterx.betterend.world.biome.air.BiomeIceStarfield;
import org.betterx.betterend.world.biome.cave.*;
import org.betterx.betterend.world.biome.land.*;
import org.betterx.betterend.world.generator.BiomeType;
import org.betterx.betterend.world.generator.GeneratorOptions;
public class EndBiomes {
public static final BiomeAPI.Dimension END_CAVE = new BiomeAPI.Dimension(BiomeAPI.Dimension.END);
public static BiomePicker CAVE_BIOMES = null;
private static HexBiomeMap caveBiomeMap;
private static long lastSeed;
// Better End Land
public static final EndBiome FOGGY_MUSHROOMLAND = registerBiome(new FoggyMushroomlandBiome(), BiomeType.LAND);
public static final EndBiome CHORUS_FOREST = registerBiome(new ChorusForestBiome(), BiomeType.LAND);
public static final EndBiome DUST_WASTELANDS = registerBiome(new DustWastelandsBiome(), BiomeType.LAND);
public static final EndBiome MEGALAKE = registerBiome(new MegalakeBiome(), BiomeType.LAND);
public static final EndBiome MEGALAKE_GROVE = registerSubBiome(new MegalakeGroveBiome(), MEGALAKE);
public static final EndBiome CRYSTAL_MOUNTAINS = registerBiome(new CrystalMountainsBiome(), BiomeType.LAND);
public static final EndBiome PAINTED_MOUNTAINS = registerSubBiome(new PaintedMountainsBiome(), DUST_WASTELANDS);
public static final EndBiome SHADOW_FOREST = registerBiome(new ShadowForestBiome(), BiomeType.LAND);
public static final EndBiome AMBER_LAND = registerBiome(new AmberLandBiome(), BiomeType.LAND);
public static final EndBiome BLOSSOMING_SPIRES = registerBiome(new BlossomingSpiresBiome(), BiomeType.LAND);
public static final EndBiome SULPHUR_SPRINGS = registerBiome(new SulphurSpringsBiome(), BiomeType.LAND);
public static final EndBiome UMBRELLA_JUNGLE = registerBiome(new UmbrellaJungleBiome(), BiomeType.LAND);
public static final EndBiome GLOWING_GRASSLANDS = registerBiome(new GlowingGrasslandsBiome(), BiomeType.LAND);
public static final EndBiome DRAGON_GRAVEYARDS = registerBiome(new DragonGraveyardsBiome(), BiomeType.LAND);
public static final EndBiome DRY_SHRUBLAND = registerBiome(new DryShrublandBiome(), BiomeType.LAND);
public static final EndBiome LANTERN_WOODS = registerBiome(new LanternWoodsBiome(), BiomeType.LAND);
public static final EndBiome NEON_OASIS = registerSubBiome(new NeonOasisBiome(), DUST_WASTELANDS);
public static final EndBiome UMBRA_VALLEY = registerBiome(new UmbraValleyBiome(), BiomeType.LAND);
// Better End Void
public static final EndBiome ICE_STARFIELD = registerBiome(new BiomeIceStarfield(), BiomeType.VOID);
// Better End Caves
public static final EndCaveBiome EMPTY_END_CAVE = registerCaveBiome(new EmptyEndCaveBiome());
public static final EndCaveBiome EMPTY_SMARAGDANT_CAVE = registerCaveBiome(new EmptySmaragdantCaveBiome());
public static final EndCaveBiome LUSH_SMARAGDANT_CAVE = registerCaveBiome(new LushSmaragdantCaveBiome());
public static final EndCaveBiome EMPTY_AURORA_CAVE = registerCaveBiome(new EmptyAuroraCaveBiome());
public static final EndCaveBiome LUSH_AURORA_CAVE = registerCaveBiome(new LushAuroraCaveBiome());
public static final EndCaveBiome JADE_CAVE = registerCaveBiome(new JadeCaveBiome());
public static void register() {
LifeCycleAPI.onLevelLoad(EndBiomes::onWorldLoad);
}
private static void onWorldLoad(ServerLevel level, long seed, Registry<Biome> registry) {
if (CAVE_BIOMES == null || CAVE_BIOMES.biomeRegistry != registry) {
CAVE_BIOMES = new BiomePicker(registry);
registry.stream()
.filter(biome -> registry.getResourceKey(biome).isPresent())
.map(biome -> registry.getOrCreateHolder(registry.getResourceKey(biome).get()))
.map(biome -> biome.unwrapKey().orElseThrow().location())
.filter(id -> BiomeAPI.wasRegisteredAs(id, END_CAVE))
.map(id -> BiomeAPI.getBiome(id))
.filter(bcl -> bcl != null)
.forEach(bcl -> CAVE_BIOMES.addBiome(bcl));
CAVE_BIOMES.rebuild();
caveBiomeMap = null;
}
if (caveBiomeMap == null || lastSeed != seed) {
caveBiomeMap = new HexBiomeMap(seed, GeneratorOptions.getBiomeSizeCaves(), CAVE_BIOMES);
lastSeed = seed;
}
}
/**
* Put existing {@link EndBiome} as a sub-biome into selected parent.
*
* @param biomeConfig - {@link EndBiome.Config} instance
* @param parent - {@link EndBiome} to be linked with
* @return registered {@link EndBiome}
*/
public static EndBiome registerSubBiome(EndBiome.Config biomeConfig, EndBiome parent) {
final EndBiome biome = EndBiome.create(biomeConfig);
if (Configs.BIOME_CONFIG.getBoolean(biome.getID(), "enabled", true)) {
BiomeAPI.registerSubBiome(parent, biome);
}
return biome;
}
/**
* Registers {@link EndBiome} and adds it into worldgen.
*
* @param biomeConfig - {@link EndBiome.Config} instance
* @param type - {@link BiomeType}
* @return registered {@link EndBiome}
*/
public static EndBiome registerBiome(EndBiome.Config biomeConfig, BiomeType type) {
final EndBiome biome = EndBiome.create(biomeConfig);
if (Configs.BIOME_CONFIG.getBoolean(biome.getID(), "enabled", true)) {
if (type == BiomeType.LAND) {
BiomeAPI.registerEndLandBiome(biome);
} else {
BiomeAPI.registerEndVoidBiome(biome);
}
}
return biome;
}
/**
* Put integration sub-biome {@link EndBiome} into subbiomes list and registers it.
*
* @param biomeConfig - {@link EndBiome.Config} instance
* @return registered {@link EndBiome}
*/
public static EndBiome registerSubBiomeIntegration(EndBiome.Config biomeConfig) {
EndBiome biome = EndBiome.create(biomeConfig);
if (Configs.BIOME_CONFIG.getBoolean(biome.getID(), "enabled", true)) {
BiomeAPI.registerBiome(biome, BiomeAPI.Dimension.END);
}
return biome;
}
/**
* Link integration sub-biome with parent.
*
* @param biome - {@link EndBiome} instance
* @param parent - {@link ResourceLocation} parent id
*/
public static void addSubBiomeIntegration(EndBiome biome, ResourceLocation parent) {
if (Configs.BIOME_CONFIG.getBoolean(biome.getID(), "enabled", true)) {
BCLBiome parentBiome = BiomeAPI.getBiome(parent);
if (parentBiome != null && !parentBiome.containsSubBiome(biome)) {
parentBiome.addSubBiome(biome);
}
}
}
public static EndCaveBiome registerCaveBiome(EndCaveBiome.Config biomeConfig) {
final EndCaveBiome biome = EndCaveBiome.create(biomeConfig);
if (Configs.BIOME_CONFIG.getBoolean(biome.getID(), "enabled", true)) {
BiomeAPI.registerBiome(biome, END_CAVE);
}
return biome;
}
public static BiomePicker.ActualBiome getCaveBiome(int x, int z) {
return caveBiomeMap.getBiome(x, 5, z);
}
}

View file

@ -0,0 +1,53 @@
package org.betterx.betterend.registry;
import net.minecraft.core.Registry;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder;
import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.blocks.EndStoneSmelter;
import org.betterx.betterend.blocks.basis.PedestalBlock;
import org.betterx.betterend.blocks.entities.*;
public class EndBlockEntities {
public final static BlockEntityType<EndStoneSmelterBlockEntity> END_STONE_SMELTER = registerBlockEntity(
EndStoneSmelter.ID,
FabricBlockEntityTypeBuilder.create(EndStoneSmelterBlockEntity::new, EndBlocks.END_STONE_SMELTER)
);
public final static BlockEntityType<PedestalBlockEntity> PEDESTAL = registerBlockEntity(
"pedestal",
FabricBlockEntityTypeBuilder.create(PedestalBlockEntity::new, getPedestals())
);
public final static BlockEntityType<EternalPedestalEntity> ETERNAL_PEDESTAL = registerBlockEntity(
"eternal_pedestal",
FabricBlockEntityTypeBuilder.create(EternalPedestalEntity::new, EndBlocks.ETERNAL_PEDESTAL)
);
public final static BlockEntityType<InfusionPedestalEntity> INFUSION_PEDESTAL = registerBlockEntity(
"infusion_pedestal",
FabricBlockEntityTypeBuilder.create(InfusionPedestalEntity::new, EndBlocks.INFUSION_PEDESTAL)
);
public final static BlockEntityType<BlockEntityHydrothermalVent> HYDROTHERMAL_VENT = registerBlockEntity(
"hydrother_malvent",
FabricBlockEntityTypeBuilder.create(BlockEntityHydrothermalVent::new, EndBlocks.HYDROTHERMAL_VENT)
);
public static <T extends BlockEntity> BlockEntityType<T> registerBlockEntity(String id,
FabricBlockEntityTypeBuilder<T> builder) {
return Registry.register(Registry.BLOCK_ENTITY_TYPE, BetterEnd.makeID(id), builder.build(null));
//return Registry.register(Registry.BLOCK_ENTITY_TYPE, BetterEnd.makeID(id), builder.build(null));
}
public static void register() {
}
static Block[] getPedestals() {
return EndBlocks.getModBlocks()
.stream()
.filter(block -> block instanceof PedestalBlock && !((PedestalBlock) block).hasUniqueEntity())
.toArray(Block[]::new);
}
}

View file

@ -0,0 +1,16 @@
package org.betterx.betterend.registry;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.rendering.v1.BlockEntityRendererRegistry;
import org.betterx.betterend.client.render.PedestalItemRenderer;
@Environment(EnvType.CLIENT)
public class EndBlockEntityRenders {
public static void register() {
BlockEntityRendererRegistry.register(EndBlockEntities.PEDESTAL, PedestalItemRenderer::new);
BlockEntityRendererRegistry.register(EndBlockEntities.ETERNAL_PEDESTAL, PedestalItemRenderer::new);
BlockEntityRendererRegistry.register(EndBlockEntities.INFUSION_PEDESTAL, PedestalItemRenderer::new);
}
}

View file

@ -0,0 +1,514 @@
package org.betterx.betterend.registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.material.MaterialColor;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import org.betterx.bclib.blocks.*;
import org.betterx.bclib.registry.BlockRegistry;
import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.blocks.*;
import org.betterx.betterend.blocks.basis.*;
import org.betterx.betterend.complexmaterials.*;
import org.betterx.betterend.config.Configs;
import org.betterx.betterend.item.material.EndArmorMaterial;
import org.betterx.betterend.item.material.EndToolMaterial;
import org.betterx.betterend.tab.CreativeTabs;
import java.util.List;
import org.jetbrains.annotations.NotNull;
public class EndBlocks {
private static final BlockRegistry REGISTRY = new BlockRegistry(CreativeTabs.TAB_BLOCKS, Configs.BLOCK_CONFIG);
// Terrain //
public static final Block ENDSTONE_DUST = registerBlock("endstone_dust", new EndstoneDustBlock());
public static final Block END_MYCELIUM = registerBlock("end_mycelium",
new EndTerrainBlock(MaterialColor.COLOR_LIGHT_BLUE));
public static final Block END_MOSS = registerBlock("end_moss", new EndTerrainBlock(MaterialColor.COLOR_CYAN));
public static final Block CHORUS_NYLIUM = registerBlock("chorus_nylium",
new EndTerrainBlock(MaterialColor.COLOR_MAGENTA));
public static final Block CAVE_MOSS = registerBlock("cave_moss", new EndTripleTerrain(MaterialColor.COLOR_PURPLE));
public static final Block CRYSTAL_MOSS = registerBlock("crystal_moss",
new EndTerrainBlock(MaterialColor.COLOR_PINK));
public static final Block SHADOW_GRASS = registerBlock("shadow_grass", new ShadowGrassBlock());
public static final Block PINK_MOSS = registerBlock("pink_moss", new EndTerrainBlock(MaterialColor.COLOR_PINK));
public static final Block AMBER_MOSS = registerBlock("amber_moss", new EndTerrainBlock(MaterialColor.COLOR_ORANGE));
public static final Block JUNGLE_MOSS = registerBlock("jungle_moss",
new EndTerrainBlock(MaterialColor.COLOR_GREEN));
public static final Block SANGNUM = registerBlock("sangnum", new EndTerrainBlock(MaterialColor.COLOR_RED));
public static final Block RUTISCUS = registerBlock("rutiscus", new EndTerrainBlock(MaterialColor.COLOR_ORANGE));
public static final Block PALLIDIUM_FULL = registerBlock("pallidium_full", new PallidiumBlock("full", null));
public static final Block PALLIDIUM_HEAVY = registerBlock("pallidium_heavy",
new PallidiumBlock("heavy", PALLIDIUM_FULL));
public static final Block PALLIDIUM_THIN = registerBlock("pallidium_thin",
new PallidiumBlock("thin", PALLIDIUM_HEAVY));
public static final Block PALLIDIUM_TINY = registerBlock("pallidium_tiny",
new PallidiumBlock("tiny", PALLIDIUM_THIN));
// Roads //
public static final Block END_MYCELIUM_PATH = registerBlock("end_mycelium_path", new BasePathBlock(END_MYCELIUM));
public static final Block END_MOSS_PATH = registerBlock("end_moss_path", new BasePathBlock(END_MOSS));
public static final Block CHORUS_NYLIUM_PATH = registerBlock("chorus_nylium_path",
new BasePathBlock(CHORUS_NYLIUM));
public static final Block CAVE_MOSS_PATH = registerBlock("cave_moss_path", new BasePathBlock(CAVE_MOSS));
public static final Block CRYSTAL_MOSS_PATH = registerBlock("crystal_moss_path", new BasePathBlock(CRYSTAL_MOSS));
public static final Block SHADOW_GRASS_PATH = registerBlock("shadow_grass_path", new BasePathBlock(SHADOW_GRASS));
public static final Block PINK_MOSS_PATH = registerBlock("pink_moss_path", new BasePathBlock(PINK_MOSS));
public static final Block AMBER_MOSS_PATH = registerBlock("amber_moss_path", new BasePathBlock(AMBER_MOSS));
public static final Block JUNGLE_MOSS_PATH = registerBlock("jungle_moss_path", new BasePathBlock(JUNGLE_MOSS));
public static final Block SANGNUM_PATH = registerBlock("sangnum_path", new BasePathBlock(SANGNUM));
public static final Block RUTISCUS_PATH = registerBlock("rutiscus_path", new BasePathBlock(RUTISCUS));
public static final Block MOSSY_OBSIDIAN = registerBlock("mossy_obsidian", new MossyObsidian());
public static final Block DRAGON_BONE_BLOCK = registerBlock("dragon_bone_block",
new BaseRotatedPillarBlock(Blocks.BONE_BLOCK));
public static final Block DRAGON_BONE_STAIRS = registerBlock("dragon_bone_stairs",
new BaseStairsBlock(DRAGON_BONE_BLOCK));
public static final Block DRAGON_BONE_SLAB = registerBlock("dragon_bone_slab",
new BaseSlabBlock(DRAGON_BONE_BLOCK));
public static final Block MOSSY_DRAGON_BONE = registerBlock("mossy_dragon_bone", new MossyDragonBoneBlock());
// Rocks //
public static final StoneMaterial FLAVOLITE = new StoneMaterial("flavolite", MaterialColor.SAND);
public static final StoneMaterial VIOLECITE = new StoneMaterial("violecite", MaterialColor.COLOR_PURPLE);
public static final StoneMaterial SULPHURIC_ROCK = new StoneMaterial("sulphuric_rock", MaterialColor.COLOR_BROWN);
public static final StoneMaterial VIRID_JADESTONE = new StoneMaterial("virid_jadestone", MaterialColor.COLOR_GREEN);
public static final StoneMaterial AZURE_JADESTONE = new StoneMaterial("azure_jadestone",
MaterialColor.COLOR_LIGHT_BLUE);
public static final StoneMaterial SANDY_JADESTONE = new StoneMaterial("sandy_jadestone",
MaterialColor.COLOR_YELLOW);
public static final StoneMaterial UMBRALITH = new StoneMaterial("umbralith", MaterialColor.DEEPSLATE);
public static final Block BRIMSTONE = registerBlock("brimstone", new BrimstoneBlock());
public static final Block SULPHUR_CRYSTAL = registerBlock("sulphur_crystal", new SulphurCrystalBlock());
public static final Block MISSING_TILE = registerBlock("missing_tile", new MissingTileBlock());
public static final Block ENDSTONE_FLOWER_POT = registerBlock("endstone_flower_pot",
new FlowerPotBlock(Blocks.END_STONE));
public static final Block FLAVOLITE_RUNED = registerBlock("flavolite_runed", new RunedFlavolite(false));
public static final Block FLAVOLITE_RUNED_ETERNAL = registerBlock("flavolite_runed_eternal",
new RunedFlavolite(true));
public static final Block ANDESITE_PEDESTAL = registerBlock("andesite_pedestal",
new PedestalVanilla(Blocks.ANDESITE));
public static final Block DIORITE_PEDESTAL = registerBlock("diorite_pedestal", new PedestalVanilla(Blocks.DIORITE));
public static final Block GRANITE_PEDESTAL = registerBlock("granite_pedestal", new PedestalVanilla(Blocks.GRANITE));
public static final Block QUARTZ_PEDESTAL = registerBlock("quartz_pedestal",
new PedestalVanilla(Blocks.QUARTZ_BLOCK));
public static final Block PURPUR_PEDESTAL = registerBlock("purpur_pedestal",
new PedestalVanilla(Blocks.PURPUR_BLOCK));
public static final Block HYDROTHERMAL_VENT = registerBlock("hydrothermal_vent", new HydrothermalVentBlock());
public static final Block VENT_BUBBLE_COLUMN = registerEndBlockOnly("vent_bubble_column",
new VentBubbleColumnBlock());
public static final Block DENSE_SNOW = registerBlock("dense_snow", new DenseSnowBlock());
public static final Block EMERALD_ICE = registerBlock("emerald_ice", new EmeraldIceBlock());
public static final Block DENSE_EMERALD_ICE = registerBlock("dense_emerald_ice", new DenseEmeraldIceBlock());
public static final Block ANCIENT_EMERALD_ICE = registerBlock("ancient_emerald_ice", new AncientEmeraldIceBlock());
public static final Block END_STONE_STALACTITE = registerBlock("end_stone_stalactite",
new StalactiteBlock(Blocks.END_STONE));
public static final Block END_STONE_STALACTITE_CAVEMOSS = registerBlock("end_stone_stalactite_cavemoss",
new StalactiteBlock(CAVE_MOSS));
// Wooden Materials And Trees //
public static final Block MOSSY_GLOWSHROOM_SAPLING = registerBlock("mossy_glowshroom_sapling",
new MossyGlowshroomSaplingBlock());
public static final Block MOSSY_GLOWSHROOM_CAP = registerBlock("mossy_glowshroom_cap",
new MossyGlowshroomCapBlock());
public static final Block MOSSY_GLOWSHROOM_HYMENOPHORE = registerBlock("mossy_glowshroom_hymenophore",
new GlowingHymenophoreBlock());
public static final Block MOSSY_GLOWSHROOM_FUR = registerBlock("mossy_glowshroom_fur",
new FurBlock(MOSSY_GLOWSHROOM_SAPLING,
15,
16,
true));
public static final EndWoodenComplexMaterial MOSSY_GLOWSHROOM = new EndWoodenComplexMaterial(
"mossy_glowshroom",
MaterialColor.COLOR_GRAY,
MaterialColor.WOOD
).init();
public static final Block PYTHADENDRON_SAPLING = registerBlock("pythadendron_sapling",
new PythadendronSaplingBlock());
public static final Block PYTHADENDRON_LEAVES = registerBlock("pythadendron_leaves",
new PottableLeavesBlock(PYTHADENDRON_SAPLING,
MaterialColor.COLOR_MAGENTA));
public static final EndWoodenComplexMaterial PYTHADENDRON = new EndWoodenComplexMaterial(
"pythadendron",
MaterialColor.COLOR_MAGENTA,
MaterialColor.COLOR_PURPLE
).init();
public static final Block END_LOTUS_SEED = registerBlock("end_lotus_seed", new EndLotusSeedBlock());
public static final Block END_LOTUS_STEM = registerBlock("end_lotus_stem", new EndLotusStemBlock());
public static final Block END_LOTUS_LEAF = registerEndBlockOnly("end_lotus_leaf", new EndLotusLeafBlock());
public static final Block END_LOTUS_FLOWER = registerEndBlockOnly("end_lotus_flower", new EndLotusFlowerBlock());
public static final EndWoodenComplexMaterial END_LOTUS = new EndWoodenComplexMaterial(
"end_lotus",
MaterialColor.COLOR_LIGHT_BLUE,
MaterialColor.COLOR_CYAN
).init();
public static final Block LACUGROVE_SAPLING = registerBlock("lacugrove_sapling", new LacugroveSaplingBlock());
public static final Block LACUGROVE_LEAVES = registerBlock("lacugrove_leaves",
new PottableLeavesBlock(LACUGROVE_SAPLING,
MaterialColor.COLOR_CYAN));
public static final EndWoodenComplexMaterial LACUGROVE = new EndWoodenComplexMaterial(
"lacugrove",
MaterialColor.COLOR_BROWN,
MaterialColor.COLOR_YELLOW
).init();
public static final Block DRAGON_TREE_SAPLING = registerBlock("dragon_tree_sapling", new DragonTreeSaplingBlock());
public static final Block DRAGON_TREE_LEAVES = registerBlock("dragon_tree_leaves",
new PottableLeavesBlock(DRAGON_TREE_SAPLING,
MaterialColor.COLOR_MAGENTA));
public static final EndWoodenComplexMaterial DRAGON_TREE = new EndWoodenComplexMaterial(
"dragon_tree",
MaterialColor.COLOR_BLACK,
MaterialColor.COLOR_MAGENTA
).init();
public static final Block TENANEA_SAPLING = registerBlock("tenanea_sapling", new TenaneaSaplingBlock());
public static final Block TENANEA_LEAVES = registerBlock("tenanea_leaves",
new PottableLeavesBlock(TENANEA_SAPLING,
MaterialColor.COLOR_PINK));
public static final Block TENANEA_FLOWERS = registerBlock("tenanea_flowers", new TenaneaFlowersBlock());
public static final Block TENANEA_OUTER_LEAVES = registerBlock("tenanea_outer_leaves",
new FurBlock(TENANEA_SAPLING, 32));
public static final EndWoodenComplexMaterial TENANEA = new EndWoodenComplexMaterial(
"tenanea",
MaterialColor.COLOR_BROWN,
MaterialColor.COLOR_PINK
).init();
public static final Block HELIX_TREE_SAPLING = registerBlock("helix_tree_sapling", new HelixTreeSaplingBlock());
public static final Block HELIX_TREE_LEAVES = registerBlock("helix_tree_leaves", new HelixTreeLeavesBlock());
public static final EndWoodenComplexMaterial HELIX_TREE = new EndWoodenComplexMaterial(
"helix_tree",
MaterialColor.COLOR_GRAY,
MaterialColor.COLOR_ORANGE
).init();
public static final Block UMBRELLA_TREE_SAPLING = registerBlock("umbrella_tree_sapling",
new UmbrellaTreeSaplingBlock());
public static final Block UMBRELLA_TREE_MEMBRANE = registerBlock("umbrella_tree_membrane",
new UmbrellaTreeMembraneBlock());
public static final Block UMBRELLA_TREE_CLUSTER = registerBlock("umbrella_tree_cluster",
new UmbrellaTreeClusterBlock());
public static final Block UMBRELLA_TREE_CLUSTER_EMPTY = registerBlock("umbrella_tree_cluster_empty",
new UmbrellaTreeClusterEmptyBlock());
public static final EndWoodenComplexMaterial UMBRELLA_TREE = new EndWoodenComplexMaterial(
"umbrella_tree",
MaterialColor.COLOR_BLUE,
MaterialColor.COLOR_GREEN
).init();
public static final Block JELLYSHROOM_CAP_PURPLE = registerBlock("jellyshroom_cap_purple",
new JellyshroomCapBlock(217,
142,
255,
164,
0,
255));
public static final EndWoodenComplexMaterial JELLYSHROOM = new EndWoodenComplexMaterial(
"jellyshroom",
MaterialColor.COLOR_PURPLE,
MaterialColor.COLOR_LIGHT_BLUE
).init();
public static final Block LUCERNIA_SAPLING = registerBlock("lucernia_sapling", new LucerniaSaplingBlock());
public static final Block LUCERNIA_LEAVES = registerBlock("lucernia_leaves",
new PottableLeavesBlock(LUCERNIA_SAPLING,
MaterialColor.COLOR_ORANGE));
public static final Block LUCERNIA_OUTER_LEAVES = registerBlock("lucernia_outer_leaves",
new FurBlock(LUCERNIA_SAPLING, 32));
public static final EndWoodenComplexMaterial LUCERNIA = new EndWoodenComplexMaterial(
"lucernia",
MaterialColor.COLOR_ORANGE,
MaterialColor.COLOR_ORANGE
).init();
// Small Plants //
public static final Block UMBRELLA_MOSS = registerBlock("umbrella_moss", new UmbrellaMossBlock());
public static final Block UMBRELLA_MOSS_TALL = registerBlock("umbrella_moss_tall", new UmbrellaMossTallBlock());
public static final Block CREEPING_MOSS = registerBlock("creeping_moss", new GlowingMossBlock(11));
public static final Block CHORUS_GRASS = registerBlock("chorus_grass", new ChorusGrassBlock());
public static final Block CAVE_GRASS = registerBlock("cave_grass", new TerrainPlantBlock(CAVE_MOSS));
public static final Block CRYSTAL_GRASS = registerBlock("crystal_grass", new TerrainPlantBlock(CRYSTAL_MOSS));
public static final Block SHADOW_PLANT = registerBlock("shadow_plant", new TerrainPlantBlock(SHADOW_GRASS));
public static final Block BUSHY_GRASS = registerBlock("bushy_grass", new TerrainPlantBlock(PINK_MOSS));
public static final Block AMBER_GRASS = registerBlock("amber_grass", new TerrainPlantBlock(AMBER_MOSS));
public static final Block TWISTED_UMBRELLA_MOSS = registerBlock("twisted_umbrella_moss",
new TwistedUmbrellaMossBlock());
public static final Block TWISTED_UMBRELLA_MOSS_TALL = registerBlock("twisted_umbrella_moss_tall",
new TwistedUmbrellaMossTallBlock());
public static final Block JUNGLE_GRASS = registerBlock("jungle_grass", new TerrainPlantBlock(JUNGLE_MOSS));
public static final Block BLOOMING_COOKSONIA = registerBlock("blooming_cooksonia", new TerrainPlantBlock(END_MOSS));
public static final Block SALTEAGO = registerBlock("salteago", new TerrainPlantBlock(END_MOSS));
public static final Block VAIOLUSH_FERN = registerBlock("vaiolush_fern", new TerrainPlantBlock(END_MOSS));
public static final Block FRACTURN = registerBlock("fracturn", new TerrainPlantBlock(END_MOSS));
public static final Block CLAWFERN = registerBlock("clawfern",
new TerrainPlantBlock(SANGNUM,
MOSSY_OBSIDIAN,
MOSSY_DRAGON_BONE));
public static final Block GLOBULAGUS = registerBlock("globulagus",
new TerrainPlantBlock(SANGNUM,
MOSSY_OBSIDIAN,
MOSSY_DRAGON_BONE));
public static final Block ORANGO = registerBlock("orango", new TerrainPlantBlock(RUTISCUS));
public static final Block AERIDIUM = registerBlock("aeridium", new TerrainPlantBlock(RUTISCUS));
public static final Block LUTEBUS = registerBlock("lutebus", new TerrainPlantBlock(RUTISCUS));
public static final Block LAMELLARIUM = registerBlock("lamellarium", new TerrainPlantBlock(RUTISCUS));
public static final Block INFLEXIA = registerBlock("inflexia",
new TerrainPlantBlock(PALLIDIUM_FULL,
PALLIDIUM_HEAVY,
PALLIDIUM_THIN,
PALLIDIUM_TINY));
public static final Block FLAMMALIX = registerBlock("flammalix", new FlammalixBlock());
public static final Block BLUE_VINE_SEED = registerBlock("blue_vine_seed", new BlueVineSeedBlock());
public static final Block BLUE_VINE = registerEndBlockOnly("blue_vine", new BlueVineBlock());
public static final Block BLUE_VINE_LANTERN = registerBlock("blue_vine_lantern", new BlueVineLanternBlock());
public static final Block BLUE_VINE_FUR = registerBlock("blue_vine_fur",
new FurBlock(BLUE_VINE_SEED, 15, 3, false));
public static final Block LANCELEAF_SEED = registerBlock("lanceleaf_seed", new LanceleafSeedBlock());
public static final Block LANCELEAF = registerEndBlockOnly("lanceleaf", new LanceleafBlock());
public static final Block GLOWING_PILLAR_SEED = registerBlock("glowing_pillar_seed", new GlowingPillarSeedBlock());
public static final Block GLOWING_PILLAR_ROOTS = registerEndBlockOnly("glowing_pillar_roots",
new GlowingPillarRootsBlock());
public static final Block GLOWING_PILLAR_LUMINOPHOR = registerBlock("glowing_pillar_luminophor",
new GlowingPillarLuminophorBlock());
public static final Block GLOWING_PILLAR_LEAVES = registerBlock("glowing_pillar_leaves",
new FurBlock(GLOWING_PILLAR_SEED, 15, 3, false));
public static final Block SMALL_JELLYSHROOM = registerBlock("small_jellyshroom", new SmallJellyshroomBlock());
public static final Block BOLUX_MUSHROOM = registerBlock("bolux_mushroom", new BoluxMushroomBlock());
public static final Block LUMECORN_SEED = registerBlock("lumecorn_seed", new LumecornSeedBlock());
public static final Block LUMECORN = registerEndBlockOnly("lumecorn", new LumecornBlock());
public static final Block SMALL_AMARANITA_MUSHROOM = registerBlock("small_amaranita_mushroom",
new SmallAmaranitaBlock());
public static final Block LARGE_AMARANITA_MUSHROOM = registerEndBlockOnly("large_amaranita_mushroom",
new LargeAmaranitaBlock());
public static final Block AMARANITA_STEM = registerBlock("amaranita_stem", new AmaranitaStemBlock());
public static final Block AMARANITA_HYPHAE = registerBlock("amaranita_hyphae", new AmaranitaStemBlock());
public static final Block AMARANITA_HYMENOPHORE = registerBlock("amaranita_hymenophore",
new AmaranitaHymenophoreBlock());
public static final Block AMARANITA_LANTERN = registerBlock("amaranita_lantern", new GlowingHymenophoreBlock());
public static final Block AMARANITA_FUR = registerBlock("amaranita_fur",
new FurBlock(SMALL_AMARANITA_MUSHROOM, 15, 4, true));
public static final Block AMARANITA_CAP = registerBlock("amaranita_cap", new AmaranitaCapBlock());
public static final Block NEON_CACTUS = registerBlock("neon_cactus", new NeonCactusPlantBlock());
public static final Block NEON_CACTUS_BLOCK = registerBlock("neon_cactus_block", new NeonCactusBlock());
public static final Block NEON_CACTUS_BLOCK_STAIRS = registerBlock("neon_cactus_stairs",
new BaseStairsBlock(NEON_CACTUS_BLOCK));
public static final Block NEON_CACTUS_BLOCK_SLAB = registerBlock("neon_cactus_slab",
new BaseSlabBlock(NEON_CACTUS_BLOCK));
// Crops
public static final Block SHADOW_BERRY = registerBlock("shadow_berry", new ShadowBerryBlock());
public static final Block BLOSSOM_BERRY = registerBlock("blossom_berry_seed",
new PottableCropBlock(EndItems.BLOSSOM_BERRY, PINK_MOSS));
public static final Block AMBER_ROOT = registerBlock("amber_root_seed",
new PottableCropBlock(EndItems.AMBER_ROOT_RAW, AMBER_MOSS));
public static final Block CHORUS_MUSHROOM = registerBlock("chorus_mushroom_seed",
new PottableCropBlock(EndItems.CHORUS_MUSHROOM_RAW,
CHORUS_NYLIUM));
//public static final Block PEARLBERRY = registerBlock("pearlberry_seed", new PottableCropBlock(EndItems.BLOSSOM_BERRY, END_MOSS, END_MYCELIUM));
public static final Block CAVE_PUMPKIN_SEED = registerBlock("cave_pumpkin_seed", new CavePumpkinVineBlock());
public static final Block CAVE_PUMPKIN = registerBlock("cave_pumpkin", new CavePumpkinBlock());
// Water plants
public static final Block BUBBLE_CORAL = registerBlock("bubble_coral", new BubbleCoralBlock());
public static final Block MENGER_SPONGE = registerBlock("menger_sponge", new MengerSpongeBlock());
public static final Block MENGER_SPONGE_WET = registerBlock("menger_sponge_wet", new MengerSpongeWetBlock());
public static final Block CHARNIA_RED = registerBlock("charnia_red", new CharniaBlock());
public static final Block CHARNIA_PURPLE = registerBlock("charnia_purple", new CharniaBlock());
public static final Block CHARNIA_ORANGE = registerBlock("charnia_orange", new CharniaBlock());
public static final Block CHARNIA_LIGHT_BLUE = registerBlock("charnia_light_blue", new CharniaBlock());
public static final Block CHARNIA_CYAN = registerBlock("charnia_cyan", new CharniaBlock());
public static final Block CHARNIA_GREEN = registerBlock("charnia_green", new CharniaBlock());
public static final Block END_LILY = registerEndBlockOnly("end_lily", new EndLilyBlock());
public static final Block END_LILY_SEED = registerBlock("end_lily_seed", new EndLilySeedBlock());
public static final Block HYDRALUX_SAPLING = registerBlock("hydralux_sapling", new HydraluxSaplingBlock());
public static final Block HYDRALUX = registerEndBlockOnly("hydralux", new HydraluxBlock());
public static final Block HYDRALUX_PETAL_BLOCK = registerBlock("hydralux_petal_block", new HydraluxPetalBlock());
public static final ColoredMaterial HYDRALUX_PETAL_BLOCK_COLORED = new ColoredMaterial(HydraluxPetalColoredBlock::new,
HYDRALUX_PETAL_BLOCK,
true);
public static final Block POND_ANEMONE = registerBlock("pond_anemone", new PondAnemoneBlock());
public static final Block FLAMAEA = registerBlock("flamaea", new FlamaeaBlock());
public static final Block CAVE_BUSH = registerBlock("cave_bush",
new SimpleLeavesBlock(MaterialColor.COLOR_MAGENTA));
public static final Block MURKWEED = registerBlock("murkweed", new MurkweedBlock());
public static final Block NEEDLEGRASS = registerBlock("needlegrass", new NeedlegrassBlock());
// Wall Plants //
public static final Block PURPLE_POLYPORE = registerBlock("purple_polypore", new EndWallMushroom(13));
public static final Block AURANT_POLYPORE = registerBlock("aurant_polypore", new EndWallMushroom(13));
public static final Block TAIL_MOSS = registerBlock("tail_moss", new EndWallPlantBlock());
public static final Block CYAN_MOSS = registerBlock("cyan_moss", new EndWallPlantBlock());
public static final Block TWISTED_MOSS = registerBlock("twisted_moss", new EndWallPlantBlock());
public static final Block TUBE_WORM = registerBlock("tube_worm", new EndUnderwaterWallPlantBlock());
public static final Block BULB_MOSS = registerBlock("bulb_moss", new EndWallPlantBlock(12));
public static final Block JUNGLE_FERN = registerBlock("jungle_fern", new EndWallPlantBlock());
public static final Block RUSCUS = registerBlock("ruscus", new EndWallPlantBlock());
// Vines //
public static final Block DENSE_VINE = registerBlock("dense_vine", new BaseVineBlock(15, true));
public static final Block TWISTED_VINE = registerBlock("twisted_vine", new BaseVineBlock());
public static final Block BULB_VINE_SEED = registerBlock("bulb_vine_seed", new BulbVineSeedBlock());
public static final Block BULB_VINE = registerBlock("bulb_vine", new BulbVineBlock());
public static final Block JUNGLE_VINE = registerBlock("jungle_vine", new BaseVineBlock());
public static final Block RUBINEA = registerBlock("rubinea", new BaseVineBlock());
public static final Block MAGNULA = registerBlock("magnula", new BaseVineBlock());
public static final Block FILALUX = registerBlock("filalux", new FilaluxBlock());
public static final Block FILALUX_WINGS = registerBlock("filalux_wings", new FilaluxWingsBlock());
public static final Block FILALUX_LANTERN = registerBlock("filalux_lantern", new FilaluxLanternBlock());
// Mob-Related
public static final Block SILK_MOTH_NEST = registerBlock("silk_moth_nest", new SilkMothNestBlock());
public static final Block SILK_MOTH_HIVE = registerBlock("silk_moth_hive", new SilkMothHiveBlock());
// Ores //
public static final Block ENDER_ORE = registerBlock("ender_ore",
new BaseOreBlock(() -> EndItems.ENDER_SHARD, 1, 3, 5));
public static final Block AMBER_ORE = registerBlock("amber_ore",
new BaseOreBlock(() -> EndItems.RAW_AMBER, 1, 2, 4));
// Materials //
public static final MetalMaterial THALLASIUM = MetalMaterial.makeNormal(
"thallasium",
MaterialColor.COLOR_BLUE,
EndToolMaterial.THALLASIUM,
EndArmorMaterial.THALLASIUM
);
public static final MetalMaterial TERMINITE = MetalMaterial.makeOreless(
"terminite",
MaterialColor.WARPED_WART_BLOCK,
7F,
9F,
EndToolMaterial.TERMINITE,
EndArmorMaterial.TERMINITE
);
public static final Block AETERNIUM_BLOCK = registerBlock("aeternium_block", new AeterniumBlock());
public static final Block CHARCOAL_BLOCK = registerBlock("charcoal_block", new CharcoalBlock());
public static final Block ENDER_BLOCK = registerBlock("ender_block", new EnderBlock());
public static final Block AURORA_CRYSTAL = registerBlock("aurora_crystal", new AuroraCrystalBlock());
public static final Block AMBER_BLOCK = registerBlock("amber_block", new AmberBlock());
public static final Block SMARAGDANT_CRYSTAL_SHARD = registerBlock(
"smaragdant_crystal_shard",
new SmaragdantCrystalShardBlock()
);
public static final Block SMARAGDANT_CRYSTAL = registerBlock("smaragdant_crystal", new SmaragdantCrystalBlock());
public static final CrystalSubblocksMaterial SMARAGDANT_SUBBLOCKS = new CrystalSubblocksMaterial(
"smaragdant_crystal",
SMARAGDANT_CRYSTAL
);
public static final Block RESPAWN_OBELISK = registerBlock("respawn_obelisk", new RespawnObeliskBlock());
// Lanterns
public static final Block ANDESITE_LANTERN = registerBlock(
"andesite_lantern",
new StoneLanternBlock(Blocks.ANDESITE)
);
public static final Block DIORITE_LANTERN = registerBlock("diorite_lantern", new StoneLanternBlock(Blocks.DIORITE));
public static final Block GRANITE_LANTERN = registerBlock("granite_lantern", new StoneLanternBlock(Blocks.GRANITE));
public static final Block QUARTZ_LANTERN = registerBlock(
"quartz_lantern",
new StoneLanternBlock(Blocks.QUARTZ_BLOCK)
);
public static final Block PURPUR_LANTERN = registerBlock(
"purpur_lantern",
new StoneLanternBlock(Blocks.PURPUR_BLOCK)
);
public static final Block END_STONE_LANTERN = registerBlock(
"end_stone_lantern",
new StoneLanternBlock(Blocks.END_STONE)
);
public static final Block BLACKSTONE_LANTERN = registerBlock(
"blackstone_lantern",
new StoneLanternBlock(Blocks.BLACKSTONE)
);
public static final Block IRON_BULB_LANTERN = registerBlock("iron_bulb_lantern", new BulbVineLanternBlock());
public static final ColoredMaterial IRON_BULB_LANTERN_COLORED = new ColoredMaterial(
BulbVineLanternColoredBlock::new,
IRON_BULB_LANTERN,
false
);
public static final Block IRON_CHANDELIER = EndBlocks.registerBlock(
"iron_chandelier",
new ChandelierBlock(Blocks.GOLD_BLOCK)
);
public static final Block GOLD_CHANDELIER = EndBlocks.registerBlock(
"gold_chandelier",
new ChandelierBlock(Blocks.GOLD_BLOCK)
);
// Blocks With Entity //
public static final Block END_STONE_FURNACE = registerBlock(
"end_stone_furnace",
new BaseFurnaceBlock(Blocks.END_STONE)
);
public static final Block END_STONE_SMELTER = registerBlock("end_stone_smelter", new EndStoneSmelter());
public static final Block ETERNAL_PEDESTAL = registerBlock("eternal_pedestal", new EternalPedestal());
public static final Block INFUSION_PEDESTAL = registerBlock("infusion_pedestal", new InfusionPedestal());
public static final Block AETERNIUM_ANVIL = registerBlock("aeternium_anvil", new AeterniumAnvil());
// Technical
public static final Block END_PORTAL_BLOCK = registerEndBlockOnly("end_portal_block", new EndPortalBlock());
public static List<Block> getModBlocks() {
return BlockRegistry.getModBlocks(BetterEnd.MOD_ID);
}
public static List<Item> getModBlockItems() {
return BlockRegistry.getModBlockItems(BetterEnd.MOD_ID);
}
public static Block registerBlock(ResourceLocation id, Block block) {
if (!Configs.BLOCK_CONFIG.getBooleanRoot(id.getPath(), true)) {
return block;
}
getBlockRegistry().register(id, block);
return block;
}
public static Block registerBlock(String name, Block block) {
return registerBlock(BetterEnd.makeID(name), block);
}
public static Block registerEndBlockOnly(String name, Block block) {
return getBlockRegistry().registerBlockOnly(BetterEnd.makeID(name), block);
}
public static FabricItemSettings makeBlockItemSettings() {
return getBlockRegistry().makeItemSettings();
}
@NotNull
public static BlockRegistry getBlockRegistry() {
return REGISTRY;
}
}

View file

@ -0,0 +1,22 @@
package org.betterx.betterend.registry;
import net.minecraft.core.Registry;
import net.minecraft.world.item.enchantment.Enchantment;
import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.config.Configs;
import org.betterx.betterend.effects.enchantment.EndVeilEnchantment;
public class EndEnchantments {
public final static Enchantment END_VEIL = registerEnchantment("end_veil", new EndVeilEnchantment());
public static Enchantment registerEnchantment(String name, Enchantment enchantment) {
if (!Configs.ENCHANTMENT_CONFIG.getBooleanRoot(name, true)) {
return enchantment;
}
return Registry.register(Registry.ENCHANTMENT, BetterEnd.makeID(name), enchantment);
}
public static void register() {
}
}

View file

@ -0,0 +1,151 @@
package org.betterx.betterend.registry;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.*;
import net.minecraft.world.entity.EntityType.EntityFactory;
import net.minecraft.world.entity.ai.attributes.AttributeSupplier.Builder;
import net.minecraft.world.level.levelgen.Heightmap.Types;
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricDefaultAttributeRegistry;
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityTypeBuilder;
import org.betterx.bclib.api.spawning.SpawnRuleBuilder;
import org.betterx.bclib.util.ColorUtil;
import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.config.Configs;
import org.betterx.betterend.entity.*;
public class EndEntities {
public static final EntityType<DragonflyEntity> DRAGONFLY = register(
"dragonfly",
MobCategory.AMBIENT,
0.6F,
0.5F,
DragonflyEntity::new,
DragonflyEntity.createMobAttributes(),
true,
ColorUtil.color(32, 42, 176),
ColorUtil.color(115, 225, 249)
);
public static final EntityType<EndSlimeEntity> END_SLIME = register(
"end_slime",
MobCategory.MONSTER,
2F,
2F,
EndSlimeEntity::new,
EndSlimeEntity.createMobAttributes(),
false,
ColorUtil.color(28, 28, 28),
ColorUtil.color(99, 11, 99)
);
public static final EntityType<EndFishEntity> END_FISH = register(
"end_fish",
MobCategory.WATER_AMBIENT,
0.5F,
0.5F,
EndFishEntity::new,
EndFishEntity.createMobAttributes(),
true,
ColorUtil.color(3, 50, 76),
ColorUtil.color(120, 206, 255)
);
public static final EntityType<ShadowWalkerEntity> SHADOW_WALKER = register(
"shadow_walker",
MobCategory.MONSTER,
0.6F,
1.95F,
ShadowWalkerEntity::new,
ShadowWalkerEntity.createMobAttributes(),
true,
ColorUtil.color(30, 30, 30),
ColorUtil.color(5, 5, 5)
);
public static final EntityType<CubozoaEntity> CUBOZOA = register(
"cubozoa",
MobCategory.WATER_AMBIENT,
0.6F,
1F,
CubozoaEntity::new,
CubozoaEntity.createMobAttributes(),
true,
ColorUtil.color(151, 77, 181),
ColorUtil.color(93, 176, 238)
);
public static final EntityType<SilkMothEntity> SILK_MOTH = register(
"silk_moth",
MobCategory.AMBIENT,
0.6F,
0.6F,
SilkMothEntity::new,
SilkMothEntity.createMobAttributes(),
true,
ColorUtil.color(198, 138, 204),
ColorUtil.color(242, 220, 236)
);
public static void register() {
// Air //
SpawnRuleBuilder.start(DRAGONFLY).aboveGround(2).maxNearby(8).buildNoRestrictions(Types.MOTION_BLOCKING);
SpawnRuleBuilder.start(SILK_MOTH).aboveGround(2).maxNearby(4).buildNoRestrictions(Types.MOTION_BLOCKING);
// Land //
SpawnRuleBuilder
.start(END_SLIME)
.notPeaceful()
.maxNearby(4, 64)
.onlyOnValidBlocks()
.customRule(EndSlimeEntity::canSpawn)
.buildNoRestrictions(Types.MOTION_BLOCKING);
SpawnRuleBuilder.start(SHADOW_WALKER)
.vanillaHostile()
.onlyOnValidBlocks()
.maxNearby(8, 64)
.buildNoRestrictions(Types.MOTION_BLOCKING);
// Water //
SpawnRuleBuilder.start(END_FISH).maxNearby(8, 64).buildInWater(Types.MOTION_BLOCKING);
SpawnRuleBuilder.start(CUBOZOA).maxNearby(8, 64).buildInWater(Types.MOTION_BLOCKING);
}
protected static <T extends Entity> EntityType<T> register(String name,
MobCategory group,
float width,
float height,
EntityFactory<T> entity) {
ResourceLocation id = BetterEnd.makeID(name);
EntityType<T> type = FabricEntityTypeBuilder
.create(group, entity)
.dimensions(EntityDimensions.fixed(width, height))
.build();
if (Configs.ENTITY_CONFIG.getBooleanRoot(id.getPath(), true)) {
return Registry.register(Registry.ENTITY_TYPE, id, type);
}
return type;
}
private static <T extends Mob> EntityType<T> register(String name,
MobCategory group,
float width,
float height,
EntityFactory<T> entity,
Builder attributes,
boolean fixedSize,
int eggColor,
int dotsColor) {
ResourceLocation id = BetterEnd.makeID(name);
EntityType<T> type = FabricEntityTypeBuilder
.create(group, entity)
.dimensions(fixedSize
? EntityDimensions.fixed(width, height)
: EntityDimensions.scalable(width, height))
.build();
if (Configs.ENTITY_CONFIG.getBooleanRoot(id.getPath(), true)) {
FabricDefaultAttributeRegistry.register(type, attributes);
EndItems.registerEndEgg("spawn_egg_" + name, type, eggColor, dotsColor);
return Registry.register(Registry.ENTITY_TYPE, BetterEnd.makeID(name), type);
}
return type;
}
}

View file

@ -0,0 +1,67 @@
package org.betterx.betterend.registry;
import net.minecraft.client.model.geom.ModelLayerLocation;
import net.minecraft.client.renderer.entity.EntityRendererProvider.Context;
import net.minecraft.client.renderer.entity.MobRenderer;
import net.minecraft.world.entity.EntityType;
import net.fabricmc.fabric.api.client.rendering.v1.EntityModelLayerRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.EntityRendererRegistry;
import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.entity.model.*;
import org.betterx.betterend.entity.render.*;
import org.betterx.betterend.item.model.*;
import java.util.function.Function;
public class EndEntitiesRenders {
public static final ModelLayerLocation DRAGONFLY_MODEL = registerMain("dragonfly");
public static final ModelLayerLocation END_SLIME_SHELL_MODEL = registerMain("endslime_shell");
public static final ModelLayerLocation END_SLIME_MODEL = registerMain("endslime");
public static final ModelLayerLocation END_FISH_MODEL = registerMain("endfish");
public static final ModelLayerLocation CUBOZOA_MODEL = registerMain("cubozoa");
public static final ModelLayerLocation SILK_MOTH_MODEL = registerMain("silkmoth");
public static final ModelLayerLocation TEST_MODEL = registerMain("test");
public static final ModelLayerLocation ARMORED_ELYTRA = registerMain("armored_elytra");
public static final ModelLayerLocation CRYSTALITE_CHESTPLATE = registerMain("crystalite_chestplate");
public static final ModelLayerLocation CRYSTALITE_CHESTPLATE_THIN = registerMain("crystalite_chestplate_thin");
public static final ModelLayerLocation CRYSTALITE_HELMET = registerMain("crystalite_helmet");
public static final ModelLayerLocation CRYSTALITE_LEGGINGS = registerMain("crystalite_leggings");
public static final ModelLayerLocation CRYSTALITE_BOOTS = registerMain("crystalite_boots");
public static void register() {
register(EndEntities.DRAGONFLY, RendererEntityDragonfly::new);
register(EndEntities.END_SLIME, RendererEntityEndSlime::new);
register(EndEntities.END_FISH, RendererEntityEndFish::new);
register(EndEntities.SHADOW_WALKER, RendererEntityShadowWalker::new);
register(EndEntities.CUBOZOA, RendererEntityCubozoa::new);
register(EndEntities.SILK_MOTH, SilkMothEntityRenderer::new);
EntityModelLayerRegistry.registerModelLayer(DRAGONFLY_MODEL, DragonflyEntityModel::getTexturedModelData);
EntityModelLayerRegistry.registerModelLayer(END_SLIME_SHELL_MODEL,
EndSlimeEntityModel::getShellOnlyTexturedModelData);
EntityModelLayerRegistry.registerModelLayer(END_SLIME_MODEL, EndSlimeEntityModel::getCompleteTexturedModelData);
EntityModelLayerRegistry.registerModelLayer(END_FISH_MODEL, EndFishEntityModel::getTexturedModelData);
EntityModelLayerRegistry.registerModelLayer(CUBOZOA_MODEL, CubozoaEntityModel::getTexturedModelData);
EntityModelLayerRegistry.registerModelLayer(SILK_MOTH_MODEL, SilkMothEntityModel::getTexturedModelData);
EntityModelLayerRegistry.registerModelLayer(ARMORED_ELYTRA, ArmoredElytraModel::getTexturedModelData);
EntityModelLayerRegistry.registerModelLayer(CRYSTALITE_CHESTPLATE,
CrystaliteChestplateModel::getRegularTexturedModelData);
EntityModelLayerRegistry.registerModelLayer(CRYSTALITE_CHESTPLATE_THIN,
CrystaliteChestplateModel::getThinTexturedModelData);
EntityModelLayerRegistry.registerModelLayer(CRYSTALITE_HELMET, CrystaliteHelmetModel::getTexturedModelData);
EntityModelLayerRegistry.registerModelLayer(CRYSTALITE_LEGGINGS, CrystaliteLeggingsModel::getTexturedModelData);
EntityModelLayerRegistry.registerModelLayer(CRYSTALITE_BOOTS, CrystaliteBootsModel::getTexturedModelData);
}
private static void register(EntityType<?> type, Function<Context, MobRenderer> renderer) {
EntityRendererRegistry.register(type, (context) -> renderer.apply(context));
}
private static ModelLayerLocation registerMain(String id) {
return new ModelLayerLocation(BetterEnd.makeID(id), "main");
}
}

View file

@ -0,0 +1,591 @@
package org.betterx.betterend.registry;
import net.minecraft.core.Holder;
import net.minecraft.core.Registry;
import net.minecraft.data.BuiltinRegistries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.levelgen.GenerationStep;
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
import net.minecraft.world.level.levelgen.VerticalAnchor;
import net.minecraft.world.level.levelgen.feature.Feature;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.levelgen.placement.CountPlacement;
import net.minecraft.world.level.levelgen.placement.HeightRangePlacement;
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
import com.google.common.collect.Lists;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import org.betterx.bclib.api.biomes.BCLBiomeBuilder;
import org.betterx.bclib.api.biomes.BiomeAPI;
import org.betterx.bclib.api.features.BCLCommonFeatures;
import org.betterx.bclib.api.features.BCLFeatureBuilder;
import org.betterx.bclib.util.JsonFactory;
import org.betterx.bclib.world.biomes.BCLBiome;
import org.betterx.bclib.world.features.BCLFeature;
import org.betterx.bclib.world.features.DefaultFeature;
import org.betterx.bclib.world.features.ListFeature.StructureInfo;
import org.betterx.bclib.world.features.NBTFeature.TerrainMerge;
import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.complexmaterials.StoneMaterial;
import org.betterx.betterend.config.Configs;
import org.betterx.betterend.world.biome.cave.EndCaveBiome;
import org.betterx.betterend.world.biome.land.UmbraValleyBiome;
import org.betterx.betterend.world.features.*;
import org.betterx.betterend.world.features.bushes.*;
import org.betterx.betterend.world.features.terrain.*;
import org.betterx.betterend.world.features.terrain.caves.RoundCaveFeature;
import org.betterx.betterend.world.features.terrain.caves.TunelCaveFeature;
import org.betterx.betterend.world.features.trees.*;
import java.io.InputStream;
import java.util.List;
public class EndFeatures {
// Trees //
public static final BCLFeature MOSSY_GLOWSHROOM = redisterVegetation("mossy_glowshroom",
new MossyGlowshroomFeature(),
2);
public static final BCLFeature PYTHADENDRON_TREE = redisterVegetation("pythadendron_tree",
new PythadendronTreeFeature(),
1);
public static final BCLFeature LACUGROVE = redisterVegetation("lacugrove", new LacugroveFeature(), 4);
public static final BCLFeature DRAGON_TREE = redisterVegetation("dragon_tree", new DragonTreeFeature(), 2);
public static final BCLFeature TENANEA = redisterVegetation("tenanea", new TenaneaFeature(), 2);
public static final BCLFeature HELIX_TREE = redisterVegetation("helix_tree", new HelixTreeFeature(), 1);
public static final BCLFeature UMBRELLA_TREE = redisterVegetation("umbrella_tree", new UmbrellaTreeFeature(), 2);
public static final BCLFeature JELLYSHROOM = redisterVegetation("jellyshroom", new JellyshroomFeature(), 2);
public static final BCLFeature GIGANTIC_AMARANITA = redisterVegetation("gigantic_amaranita",
new GiganticAmaranitaFeature(),
1);
public static final BCLFeature LUCERNIA = redisterVegetation("lucernia", new LucerniaFeature(), 3);
// Bushes //
public static final BCLFeature PYTHADENDRON_BUSH = redisterVegetation("pythadendron_bush",
new BushFeature(EndBlocks.PYTHADENDRON_LEAVES,
EndBlocks.PYTHADENDRON.getBark()),
3);
public static final BCLFeature DRAGON_TREE_BUSH = redisterVegetation("dragon_tree_bush",
new BushFeature(EndBlocks.DRAGON_TREE_LEAVES,
EndBlocks.DRAGON_TREE.getBark()),
5);
public static final BCLFeature TENANEA_BUSH = redisterVegetation("tenanea_bush", new TenaneaBushFeature(), 6);
public static final BCLFeature LUMECORN = redisterVegetation("lumecorn", new Lumecorn(), 5);
public static final BCLFeature LARGE_AMARANITA = redisterVegetation("large_amaranita",
new LargeAmaranitaFeature(),
5);
public static final BCLFeature LUCERNIA_BUSH = redisterVegetation("lucernia_bush",
new BushWithOuterFeature(EndBlocks.LUCERNIA_LEAVES,
EndBlocks.LUCERNIA_OUTER_LEAVES,
EndBlocks.LUCERNIA.getBark()),
10);
public static final BCLFeature LUCERNIA_BUSH_RARE = redisterVegetation("lucernia_bush_rare",
new BushWithOuterFeature(EndBlocks.LUCERNIA_LEAVES,
EndBlocks.LUCERNIA_OUTER_LEAVES,
EndBlocks.LUCERNIA.getBark()),
1);
public static final BCLFeature NEON_CACTUS = redisterVegetation("neon_cactus", new NeonCactusFeature(), 2);
// Plants //
public static final BCLFeature UMBRELLA_MOSS = redisterVegetation("umbrella_moss",
new DoublePlantFeature(EndBlocks.UMBRELLA_MOSS,
EndBlocks.UMBRELLA_MOSS_TALL,
5),
3);
public static final BCLFeature CREEPING_MOSS = redisterVegetation("creeping_moss",
new SinglePlantFeature(EndBlocks.CREEPING_MOSS,
5),
3);
public static final BCLFeature BLUE_VINE = redisterVegetation("blue_vine", new BlueVineFeature(), 1);
public static final BCLFeature CHORUS_GRASS = redisterVegetation("chorus_grass",
new SinglePlantFeature(EndBlocks.CHORUS_GRASS, 4),
3);
public static final BCLFeature CRYSTAL_GRASS = redisterVegetation("crystal_grass",
new SinglePlantFeature(EndBlocks.CRYSTAL_GRASS,
8,
false),
5);
public static final BCLFeature SHADOW_PLANT = redisterVegetation("shadow_plant",
new SinglePlantFeature(EndBlocks.SHADOW_PLANT, 6),
5);
public static final BCLFeature MURKWEED = redisterVegetation("murkweed",
new SinglePlantFeature(EndBlocks.MURKWEED, 3),
2);
public static final BCLFeature NEEDLEGRASS = redisterVegetation("needlegrass",
new SinglePlantFeature(EndBlocks.NEEDLEGRASS, 3),
1);
public static final BCLFeature SHADOW_BERRY = redisterVegetation("shadow_berry",
new SinglePlantFeature(EndBlocks.SHADOW_BERRY, 2),
1);
public static final BCLFeature BUSHY_GRASS = redisterVegetation("bushy_grass",
new SinglePlantFeature(EndBlocks.BUSHY_GRASS,
8,
false),
10);
public static final BCLFeature BUSHY_GRASS_WG = redisterVegetation("bushy_grass_wg",
new SinglePlantFeature(EndBlocks.BUSHY_GRASS, 5),
8);
public static final BCLFeature AMBER_GRASS = redisterVegetation("amber_grass",
new SinglePlantFeature(EndBlocks.AMBER_GRASS, 6),
7);
public static final BCLFeature LANCELEAF = redisterVegetation("lanceleaf", new LanceleafFeature(), 2);
public static final BCLFeature GLOW_PILLAR = redisterVegetation("glow_pillar", new GlowPillarFeature(), 1);
public static final BCLFeature TWISTED_UMBRELLA_MOSS = redisterVegetation("twisted_umbrella_moss",
new DoublePlantFeature(EndBlocks.TWISTED_UMBRELLA_MOSS,
EndBlocks.TWISTED_UMBRELLA_MOSS_TALL,
6),
3);
public static final BCLFeature JUNGLE_GRASS = redisterVegetation("jungle_grass",
new SinglePlantFeature(EndBlocks.JUNGLE_GRASS,
7,
3),
6);
public static final BCLFeature SMALL_JELLYSHROOM_FLOOR = redisterVegetation("small_jellyshroom_floor",
new SinglePlantFeature(EndBlocks.SMALL_JELLYSHROOM,
5,
5),
2);
public static final BCLFeature BLOSSOM_BERRY = redisterVegetation("blossom_berry",
new SinglePlantFeature(EndBlocks.BLOSSOM_BERRY,
3,
3),
2);
public static final BCLFeature BLOOMING_COOKSONIA = redisterVegetation("blooming_cooksonia",
new SinglePlantFeature(EndBlocks.BLOOMING_COOKSONIA,
5),
5);
public static final BCLFeature SALTEAGO = redisterVegetation("salteago",
new SinglePlantFeature(EndBlocks.SALTEAGO, 5),
5);
public static final BCLFeature VAIOLUSH_FERN = redisterVegetation("vaiolush_fern",
new SinglePlantFeature(EndBlocks.VAIOLUSH_FERN,
5),
5);
public static final BCLFeature FRACTURN = redisterVegetation("fracturn",
new SinglePlantFeature(EndBlocks.FRACTURN, 5),
5);
public static final BCLFeature UMBRELLA_MOSS_RARE = redisterVegetation("umbrella_moss_rare",
new SinglePlantFeature(EndBlocks.UMBRELLA_MOSS,
3),
2);
public static final BCLFeature CREEPING_MOSS_RARE = redisterVegetation("creeping_moss_rare",
new SinglePlantFeature(EndBlocks.CREEPING_MOSS,
3),
2);
public static final BCLFeature TWISTED_UMBRELLA_MOSS_RARE = redisterVegetation("twisted_umbrella_moss_rare",
new SinglePlantFeature(EndBlocks.TWISTED_UMBRELLA_MOSS,
3),
2);
public static final BCLFeature ORANGO = redisterVegetation("orango",
new SinglePlantFeature(EndBlocks.ORANGO, 5),
6);
public static final BCLFeature AERIDIUM = redisterVegetation("aeridium",
new SinglePlantFeature(EndBlocks.AERIDIUM, 5, 4),
5);
public static final BCLFeature LUTEBUS = redisterVegetation("lutebus",
new SinglePlantFeature(EndBlocks.LUTEBUS, 5, 2),
5);
public static final BCLFeature LAMELLARIUM = redisterVegetation("lamellarium",
new SinglePlantFeature(EndBlocks.LAMELLARIUM, 5),
6);
public static final BCLFeature SMALL_AMARANITA = redisterVegetation("small_amaranita",
new SinglePlantFeature(EndBlocks.SMALL_AMARANITA_MUSHROOM,
5,
5),
4);
public static final BCLFeature GLOBULAGUS = redisterVegetation("globulagus",
new SinglePlantFeature(EndBlocks.GLOBULAGUS, 5, 3),
6);
public static final BCLFeature CLAWFERN = redisterVegetation("clawfern",
new SinglePlantFeature(EndBlocks.CLAWFERN, 5, 4),
5);
public static final BCLFeature BOLUX_MUSHROOM = redisterVegetation("bolux_mushroom",
new SinglePlantFeature(EndBlocks.BOLUX_MUSHROOM,
5,
5),
2);
public static final BCLFeature CHORUS_MUSHROOM = redisterVegetation("chorus_mushroom",
new SinglePlantFeature(EndBlocks.CHORUS_MUSHROOM,
3,
5),
1);
public static final BCLFeature AMBER_ROOT = redisterVegetation("amber_root",
new SinglePlantFeature(EndBlocks.AMBER_ROOT, 5, 5),
1);
//public static final BCLFeature PEARLBERRY = redisterVegetation("pearlberry", new SinglePlantFeature(EndBlocks.PEARLBERRY, 5, 5), 1);
public static final BCLFeature INFLEXIA = redisterVegetation("inflexia",
new SinglePlantFeature(EndBlocks.INFLEXIA,
7,
false,
3),
16);
public static final BCLFeature FLAMMALIX = redisterVegetation("flammalix",
new SinglePlantFeature(EndBlocks.FLAMMALIX,
3,
false,
7),
5);
// Vines //
public static final BCLFeature DENSE_VINE = redisterVegetation("dense_vine",
new VineFeature(EndBlocks.DENSE_VINE, 24),
3);
public static final BCLFeature TWISTED_VINE = redisterVegetation("twisted_vine",
new VineFeature(EndBlocks.TWISTED_VINE, 24),
1);
public static final BCLFeature BULB_VINE = redisterVegetation("bulb_vine",
new VineFeature(EndBlocks.BULB_VINE, 24),
3);
public static final BCLFeature JUNGLE_VINE = redisterVegetation("jungle_vine",
new VineFeature(EndBlocks.JUNGLE_VINE, 24),
5);
// Ceil plants
public static final BCLFeature SMALL_JELLYSHROOM_CEIL = redisterVegetation("small_jellyshroom_ceil",
new SingleInvertedScatterFeature(
EndBlocks.SMALL_JELLYSHROOM,
8),
8);
// Wall Plants //
public static final BCLFeature PURPLE_POLYPORE = redisterVegetation("purple_polypore",
new WallPlantOnLogFeature(EndBlocks.PURPLE_POLYPORE,
3),
5);
public static final BCLFeature AURANT_POLYPORE = redisterVegetation("aurant_polypore",
new WallPlantOnLogFeature(EndBlocks.AURANT_POLYPORE,
3),
5);
public static final BCLFeature TAIL_MOSS = redisterVegetation("tail_moss",
new WallPlantFeature(EndBlocks.TAIL_MOSS, 3),
15);
public static final BCLFeature CYAN_MOSS = redisterVegetation("cyan_moss",
new WallPlantFeature(EndBlocks.CYAN_MOSS, 3),
15);
public static final BCLFeature TAIL_MOSS_WOOD = redisterVegetation("tail_moss_wood",
new WallPlantOnLogFeature(EndBlocks.TAIL_MOSS,
4),
25);
public static final BCLFeature CYAN_MOSS_WOOD = redisterVegetation("cyan_moss_wood",
new WallPlantOnLogFeature(EndBlocks.CYAN_MOSS,
4),
25);
public static final BCLFeature TWISTED_MOSS = redisterVegetation("twisted_moss",
new WallPlantFeature(EndBlocks.TWISTED_MOSS, 6),
15);
public static final BCLFeature TWISTED_MOSS_WOOD = redisterVegetation("twisted_moss_wood",
new WallPlantOnLogFeature(EndBlocks.TWISTED_MOSS,
6),
25);
public static final BCLFeature BULB_MOSS = redisterVegetation("bulb_moss",
new WallPlantFeature(EndBlocks.BULB_MOSS, 6),
1);
public static final BCLFeature BULB_MOSS_WOOD = redisterVegetation("bulb_moss_wood",
new WallPlantOnLogFeature(EndBlocks.BULB_MOSS,
6),
15);
public static final BCLFeature SMALL_JELLYSHROOM_WALL = redisterVegetation("small_jellyshroom_wall",
new WallPlantFeature(EndBlocks.SMALL_JELLYSHROOM,
4),
4);
public static final BCLFeature SMALL_JELLYSHROOM_WOOD = redisterVegetation("small_jellyshroom_wood",
new WallPlantOnLogFeature(EndBlocks.SMALL_JELLYSHROOM,
4),
8);
public static final BCLFeature JUNGLE_FERN_WOOD = redisterVegetation("jungle_fern_wood",
new WallPlantOnLogFeature(EndBlocks.JUNGLE_FERN,
3),
12);
public static final BCLFeature RUSCUS = redisterVegetation("ruscus", new WallPlantFeature(EndBlocks.RUSCUS, 6), 10);
public static final BCLFeature RUSCUS_WOOD = redisterVegetation("ruscus_wood",
new WallPlantOnLogFeature(EndBlocks.RUSCUS, 6),
10);
// Sky plants
public static final BCLFeature FILALUX = redisterVegetation("filalux", new FilaluxFeature(), 1);
// Water //
public static final BCLFeature BUBBLE_CORAL = redisterVegetation("bubble_coral",
new UnderwaterPlantFeature(EndBlocks.BUBBLE_CORAL,
6),
10);
public static final BCLFeature BUBBLE_CORAL_RARE = redisterVegetation("bubble_coral_rare",
new UnderwaterPlantFeature(EndBlocks.BUBBLE_CORAL,
3),
4);
public static final BCLFeature END_LILY = redisterVegetation("end_lily", new EndLilyFeature(6), 10);
public static final BCLFeature END_LILY_RARE = redisterVegetation("end_lily_rare", new EndLilyFeature(3), 4);
public static final BCLFeature END_LOTUS = redisterVegetation("end_lotus", new EndLotusFeature(7), 5);
public static final BCLFeature END_LOTUS_LEAF = redisterVegetation("end_lotus_leaf",
new EndLotusLeafFeature(20),
25);
public static final BCLFeature HYDRALUX = redisterVegetation("hydralux", new HydraluxFeature(5), 5);
public static final BCLFeature POND_ANEMONE = redisterVegetation("pond_anemone",
new UnderwaterPlantFeature(EndBlocks.POND_ANEMONE,
6),
10);
public static final BCLFeature CHARNIA_RED = redisterVegetation("charnia_red",
new CharniaFeature(EndBlocks.CHARNIA_RED),
10);
public static final BCLFeature CHARNIA_PURPLE = redisterVegetation("charnia_purple",
new CharniaFeature(EndBlocks.CHARNIA_PURPLE),
10);
public static final BCLFeature CHARNIA_CYAN = redisterVegetation("charnia_cyan",
new CharniaFeature(EndBlocks.CHARNIA_CYAN),
10);
public static final BCLFeature CHARNIA_LIGHT_BLUE = redisterVegetation("charnia_light_blue",
new CharniaFeature(EndBlocks.CHARNIA_LIGHT_BLUE),
10);
public static final BCLFeature CHARNIA_ORANGE = redisterVegetation("charnia_orange",
new CharniaFeature(EndBlocks.CHARNIA_ORANGE),
10);
public static final BCLFeature CHARNIA_GREEN = redisterVegetation("charnia_green",
new CharniaFeature(EndBlocks.CHARNIA_GREEN),
10);
public static final BCLFeature MENGER_SPONGE = redisterVegetation("menger_sponge", new MengerSpongeFeature(5), 1);
public static final BCLFeature CHARNIA_RED_RARE = redisterVegetation("charnia_red_rare",
new CharniaFeature(EndBlocks.CHARNIA_RED),
2);
public static final BCLFeature BIOME_ISLAND = BCLFeatureBuilder.start(BetterEnd.makeID("overworld_island"),
new BiomeIslandFeature())
.decoration(Decoration.RAW_GENERATION)
.build();
public static final BCLFeature FLAMAEA = redisterVegetation("flamaea",
new SinglePlantFeature(EndBlocks.FLAMAEA, 12, false, 5),
20);
// Terrain //
public static final BCLFeature END_LAKE = registerLake("end_lake", new EndLakeFeature(), 4);
public static final BCLFeature END_LAKE_NORMAL = registerLake("end_lake_normal", new EndLakeFeature(), 20);
public static final BCLFeature END_LAKE_RARE = registerLake("end_lake_rare", new EndLakeFeature(), 40);
public static final BCLFeature DESERT_LAKE = registerLake("desert_lake", new DesertLakeFeature(), 8);
public static final BCLFeature ROUND_CAVE = registerRawGen("round_cave", new RoundCaveFeature(), 2);
public static final BCLFeature SPIRE = registerRawGen("spire", new SpireFeature(), 4);
public static final BCLFeature FLOATING_SPIRE = registerRawGen("floating_spire", new FloatingSpireFeature(), 8);
public static final BCLFeature GEYSER = registerRawGen("geyser", new GeyserFeature(), 8);
public static final BCLFeature SULPHURIC_LAKE = registerLake("sulphuric_lake", new SulphuricLakeFeature(), 8);
public static final BCLFeature SULPHURIC_CAVE = BCLCommonFeatures.makeCountFeature(BetterEnd.makeID("sulphuric_cave"),
Decoration.RAW_GENERATION,
new SulphuricCaveFeature(),
2);
public static final BCLFeature ICE_STAR = registerRawGen("ice_star", new IceStarFeature(5, 15, 10, 25), 15);
public static final BCLFeature ICE_STAR_SMALL = registerRawGen("ice_star_small",
new IceStarFeature(3, 5, 7, 12),
8);
public static final BCLFeature SURFACE_VENT = registerChanced("surface_vent", new SurfaceVentFeature(), 4);
public static final BCLFeature SULPHUR_HILL = registerChanced("sulphur_hill", new SulphurHillFeature(), 8);
public static final BCLFeature OBSIDIAN_PILLAR_BASEMENT = registerChanced("obsidian_pillar_basement",
new ObsidianPillarBasementFeature(),
8);
public static final BCLFeature OBSIDIAN_BOULDER = registerChanced("obsidian_boulder",
new ObsidianBoulderFeature(),
10);
public static final BCLFeature FALLEN_PILLAR = registerChanced("fallen_pillar", new FallenPillarFeature(), 20);
public static final BCLFeature TUNEL_CAVE = BCLCommonFeatures.makeChunkFeature(BetterEnd.makeID("tunel_cave"),
Decoration.RAW_GENERATION,
new TunelCaveFeature());
public static final BCLFeature UMBRALITH_ARCH = registerChanced("umbralith_arch", new ArchFeature(
EndBlocks.UMBRALITH.stone,
pos -> UmbraValleyBiome.getSurface(pos.getX(), pos.getZ()).defaultBlockState()
), 10);
public static final BCLFeature THIN_UMBRALITH_ARCH = registerChanced("thin_umbralith_arch",
new ThinArchFeature(EndBlocks.UMBRALITH.stone),
15);
// Ores //
public static final BCLFeature THALLASIUM_ORE = registerOre("thallasium_ore", EndBlocks.THALLASIUM.ore, 24, 8);
public static final BCLFeature ENDER_ORE = registerOre("ender_ore", EndBlocks.ENDER_ORE, 12, 4);
public static final BCLFeature AMBER_ORE = registerOre("amber_ore", EndBlocks.AMBER_ORE, 60, 6);
public static final BCLFeature DRAGON_BONE_BLOCK_ORE = registerOre("dragon_bone_ore",
EndBlocks.DRAGON_BONE_BLOCK,
24,
8);
public static final BCLFeature VIOLECITE_LAYER = registerLayer("violecite_layer",
EndBlocks.VIOLECITE,
15,
16,
128,
8);
public static final BCLFeature FLAVOLITE_LAYER = registerLayer("flavolite_layer",
EndBlocks.FLAVOLITE,
12,
16,
128,
6);
// Buildings
public static final BCLFeature CRASHED_SHIP = registerChanced("crashed_ship", new CrashedShipFeature(), 500);
// Mobs
public static final BCLFeature SILK_MOTH_NEST = registerChanced("silk_moth_nest", new SilkMothNestFeature(), 2);
// Caves
public static final DefaultFeature SMARAGDANT_CRYSTAL = new SmaragdantCrystalFeature();
public static final DefaultFeature SMARAGDANT_CRYSTAL_SHARD = new SingleBlockFeature(EndBlocks.SMARAGDANT_CRYSTAL_SHARD);
public static final DefaultFeature BIG_AURORA_CRYSTAL = new BigAuroraCrystalFeature();
public static final DefaultFeature CAVE_BUSH = new BushFeature(EndBlocks.CAVE_BUSH, EndBlocks.CAVE_BUSH);
public static final DefaultFeature CAVE_GRASS = new SingleBlockFeature(EndBlocks.CAVE_GRASS);
public static final DefaultFeature RUBINEA = new VineFeature(EndBlocks.RUBINEA, 8);
public static final DefaultFeature MAGNULA = new VineFeature(EndBlocks.MAGNULA, 8);
public static final DefaultFeature END_STONE_STALACTITE = new StalactiteFeature(
true,
EndBlocks.END_STONE_STALACTITE,
Blocks.END_STONE
);
public static final DefaultFeature END_STONE_STALAGMITE = new StalactiteFeature(
false,
EndBlocks.END_STONE_STALACTITE,
Blocks.END_STONE
);
public static final DefaultFeature END_STONE_STALACTITE_CAVEMOSS = new StalactiteFeature(
true,
EndBlocks.END_STONE_STALACTITE_CAVEMOSS,
Blocks.END_STONE,
EndBlocks.CAVE_MOSS
);
public static final DefaultFeature END_STONE_STALAGMITE_CAVEMOSS = new StalactiteFeature(
false,
EndBlocks.END_STONE_STALACTITE_CAVEMOSS,
EndBlocks.CAVE_MOSS
);
public static final DefaultFeature CAVE_PUMPKIN = new CavePumpkinFeature();
private static BCLFeature redisterVegetation(String name, Feature<NoneFeatureConfiguration> feature, int density) {
ResourceLocation id = BetterEnd.makeID(name);
return BCLFeatureBuilder.start(id, feature).countLayersMax(density).onlyInBiome().build();
}
private static BCLFeature registerRawGen(String name, Feature<NoneFeatureConfiguration> feature, int chance) {
return BCLCommonFeatures.makeChancedFeature(BetterEnd.makeID(name), Decoration.RAW_GENERATION, feature, chance);
}
private static BCLFeature registerLake(String name, Feature<NoneFeatureConfiguration> feature, int chance) {
return BCLCommonFeatures.makeChancedFeature(BetterEnd.makeID(name), Decoration.LAKES, feature, chance);
}
private static BCLFeature registerChanced(String name, Feature<NoneFeatureConfiguration> feature, int chance) {
return BCLCommonFeatures.makeChancedFeature(BetterEnd.makeID(name),
Decoration.SURFACE_STRUCTURES,
feature,
chance);
}
private static BCLFeature registerOre(String name, Block blockOre, int veins, int veinSize) {
return BCLCommonFeatures.makeOreFeature(BetterEnd.makeID(name),
blockOre,
Blocks.END_STONE,
veins,
veinSize,
0,
HeightRangePlacement.uniform(VerticalAnchor.bottom(),
VerticalAnchor.absolute(128)),
false);
}
private static BCLFeature registerLayer(String name, Block block, float radius, int minY, int maxY, int count) {
OreLayerFeature layer = new OreLayerFeature(block.defaultBlockState(), radius, minY, maxY);
return BCLFeatureBuilder
.start(BetterEnd.makeID(name), layer)
.decoration(GenerationStep.Decoration.UNDERGROUND_ORES)
.modifier(CountPlacement.of(count))
.build();
}
private static BCLFeature registerLayer(String name,
StoneMaterial material,
float radius,
int minY,
int maxY,
int count) {
return registerLayer(name, material.stone, radius, minY, maxY, count);
}
public static void addBiomeFeatures(ResourceLocation id, Holder<Biome> biome) {
BiomeAPI.addBiomeFeature(biome, FLAVOLITE_LAYER);
BiomeAPI.addBiomeFeature(biome, THALLASIUM_ORE);
BiomeAPI.addBiomeFeature(biome, ENDER_ORE);
BiomeAPI.addBiomeFeature(biome, CRASHED_SHIP);
BCLBiome bclbiome = BiomeAPI.getBiome(id);
BCLFeature feature = getBiomeStructures(bclbiome);
if (feature != null) {
BiomeAPI.addBiomeFeature(biome, feature);
}
if (id.getNamespace().equals(BetterEnd.MOD_ID)) {
return;
}
boolean hasCaves = bclbiome.getCustomData("has_caves", true) && !(bclbiome instanceof EndCaveBiome);
//TODO: 1.19 Test Cave generation
if (hasCaves && !BiomeAPI.wasRegisteredAsEndVoidBiome(id) /*!BiomeAPI.END_VOID_BIOME_PICKER.containsImmutable(id)*/) {
if (Configs.BIOME_CONFIG.getBoolean(id, "hasCaves", true)) {
BiomeAPI.addBiomeFeature(biome, ROUND_CAVE);
BiomeAPI.addBiomeFeature(biome, TUNEL_CAVE);
}
}
}
private static BCLFeature getBiomeStructures(BCLBiome biome) {
String ns = biome.getID().getNamespace();
String nm = biome.getID().getPath();
ResourceLocation id = new ResourceLocation(ns, nm + "_structures");
if (BuiltinRegistries.PLACED_FEATURE.containsKey(id)) {
PlacedFeature placed = BuiltinRegistries.PLACED_FEATURE.get(id);
Feature<?> feature = Registry.FEATURE.get(id);
return BCLFeatureBuilder
.start(id, feature)
.decoration(Decoration.SURFACE_STRUCTURES)
.modifier(placed.placement())
.build(placed.feature().value().config());
}
String path = "/data/" + ns + "/structures/biome/" + nm + "/";
InputStream inputstream = EndFeatures.class.getResourceAsStream(path + "structures.json");
if (inputstream != null) {
JsonObject obj = JsonFactory.getJsonObject(inputstream);
JsonArray structures = obj.getAsJsonArray("structures");
if (structures != null) {
List<StructureInfo> list = Lists.newArrayList();
structures.forEach((entry) -> {
JsonObject e = entry.getAsJsonObject();
String structure = path + e.get("nbt").getAsString() + ".nbt";
TerrainMerge terrainMerge = TerrainMerge.getFromString(e.get("terrainMerge").getAsString());
int offsetY = e.get("offsetY").getAsInt();
list.add(new StructureInfo(structure, offsetY, terrainMerge));
});
if (!list.isEmpty()) {
return BCLCommonFeatures.makeChancedFeature(
new ResourceLocation(ns, nm + "_structures"),
Decoration.SURFACE_STRUCTURES,
new BuildingListFeature(list, Blocks.END_STONE.defaultBlockState()),
10
);
}
}
}
return null;
}
public static BCLBiomeBuilder addDefaultFeatures(BCLBiomeBuilder builder, boolean hasCaves) {
builder.feature(FLAVOLITE_LAYER);
builder.feature(THALLASIUM_ORE);
builder.feature(ENDER_ORE);
builder.feature(CRASHED_SHIP);
if (hasCaves) {
builder.feature(ROUND_CAVE);
builder.feature(TUNEL_CAVE);
}
return builder;
}
public static void register() {
}
}

View file

@ -0,0 +1,268 @@
package org.betterx.betterend.registry;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.food.FoodProperties;
import net.minecraft.world.food.Foods;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.TieredItem;
import net.minecraft.world.item.Tiers;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import org.betterx.bclib.items.BaseArmorItem;
import org.betterx.bclib.items.ModelProviderItem;
import org.betterx.bclib.items.tool.BaseAxeItem;
import org.betterx.bclib.items.tool.BaseHoeItem;
import org.betterx.bclib.items.tool.BaseShovelItem;
import org.betterx.bclib.items.tool.BaseSwordItem;
import org.betterx.bclib.registry.BaseRegistry;
import org.betterx.bclib.registry.ItemRegistry;
import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.config.Configs;
import org.betterx.betterend.item.*;
import org.betterx.betterend.item.material.EndArmorMaterial;
import org.betterx.betterend.item.material.EndToolMaterial;
import org.betterx.betterend.item.tool.EndHammerItem;
import org.betterx.betterend.item.tool.EndPickaxe;
import org.betterx.betterend.tab.CreativeTabs;
import java.util.List;
import org.jetbrains.annotations.NotNull;
public class EndItems {
private static final ItemRegistry REGISTRY = new ItemRegistry(CreativeTabs.TAB_ITEMS, Configs.ITEM_CONFIG);
// Materials //
public final static Item ENDER_DUST = registerEndItem("ender_dust");
public final static Item ENDER_SHARD = registerEndItem("ender_shard");
public final static Item AETERNIUM_INGOT = registerEndItem("aeternium_ingot",
new ModelProviderItem(makeEndItemSettings().fireResistant()));
public final static Item AETERNIUM_FORGED_PLATE = registerEndItem("aeternium_forged_plate",
new ModelProviderItem(makeEndItemSettings().fireResistant()));
public final static Item END_LILY_LEAF = registerEndItem("end_lily_leaf");
public final static Item END_LILY_LEAF_DRIED = registerEndItem("end_lily_leaf_dried");
public final static Item CRYSTAL_SHARDS = registerEndItem("crystal_shards");
public final static Item RAW_AMBER = registerEndItem("raw_amber");
public final static Item AMBER_GEM = registerEndItem("amber_gem");
public final static Item GLOWING_BULB = registerEndItem("glowing_bulb");
public final static Item CRYSTALLINE_SULPHUR = registerEndItem("crystalline_sulphur");
public final static Item HYDRALUX_PETAL = registerEndItem("hydralux_petal");
public final static Item GELATINE = registerEndItem("gelatine");
public static final Item ETERNAL_CRYSTAL = registerEndItem("eternal_crystal", new EternalCrystalItem());
public final static Item ENCHANTED_PETAL = registerEndItem("enchanted_petal", new EnchantedItem(HYDRALUX_PETAL));
public final static Item LEATHER_STRIPE = registerEndItem("leather_stripe");
public final static Item LEATHER_WRAPPED_STICK = registerEndItem("leather_wrapped_stick");
public final static Item SILK_FIBER = registerEndItem("silk_fiber");
public final static Item LUMECORN_ROD = registerEndItem("lumecorn_rod");
public final static Item SILK_MOTH_MATRIX = registerEndItem("silk_moth_matrix");
public final static Item ENCHANTED_MEMBRANE = registerEndItem(
"enchanted_membrane",
new EnchantedItem(Items.PHANTOM_MEMBRANE)
);
// Music Discs
public final static Item MUSIC_DISC_STRANGE_AND_ALIEN = registerEndDisc(
"music_disc_strange_and_alien",
0,
EndSounds.RECORD_STRANGE_AND_ALIEN
);
public final static Item MUSIC_DISC_GRASPING_AT_STARS = registerEndDisc(
"music_disc_grasping_at_stars",
0,
EndSounds.RECORD_GRASPING_AT_STARS
);
public final static Item MUSIC_DISC_ENDSEEKER = registerEndDisc(
"music_disc_endseeker",
0,
EndSounds.RECORD_ENDSEEKER
);
public final static Item MUSIC_DISC_EO_DRACONA = registerEndDisc(
"music_disc_eo_dracona",
0,
EndSounds.RECORD_EO_DRACONA
);
// Armor //
public static final Item AETERNIUM_HELMET = registerEndItem("aeternium_helmet",
new BaseArmorItem(EndArmorMaterial.AETERNIUM,
EquipmentSlot.HEAD,
makeEndItemSettings().fireResistant()));
public static final Item AETERNIUM_CHESTPLATE = registerEndItem("aeternium_chestplate",
new BaseArmorItem(EndArmorMaterial.AETERNIUM,
EquipmentSlot.CHEST,
makeEndItemSettings().fireResistant()));
public static final Item AETERNIUM_LEGGINGS = registerEndItem("aeternium_leggings",
new BaseArmorItem(EndArmorMaterial.AETERNIUM,
EquipmentSlot.LEGS,
makeEndItemSettings().fireResistant()));
public static final Item AETERNIUM_BOOTS = registerEndItem("aeternium_boots",
new BaseArmorItem(EndArmorMaterial.AETERNIUM,
EquipmentSlot.FEET,
makeEndItemSettings().fireResistant()));
public static final Item CRYSTALITE_HELMET = registerEndItem("crystalite_helmet", new CrystaliteHelmet());
public static final Item CRYSTALITE_CHESTPLATE = registerEndItem("crystalite_chestplate",
new CrystaliteChestplate());
public static final Item CRYSTALITE_LEGGINGS = registerEndItem("crystalite_leggings", new CrystaliteLeggings());
public static final Item CRYSTALITE_BOOTS = registerEndItem("crystalite_boots", new CrystaliteBoots());
public static final Item ARMORED_ELYTRA = registerEndItem("elytra_armored",
new ArmoredElytra("elytra_armored",
EndArmorMaterial.AETERNIUM,
Items.PHANTOM_MEMBRANE,
900,
0.975D,
true));
public static final Item CRYSTALITE_ELYTRA = registerEndItem("elytra_crystalite", new CrystaliteElytra(650, 0.99D));
// Tools //
public static final TieredItem AETERNIUM_SHOVEL = registerEndTool("aeternium_shovel", new BaseShovelItem(
EndToolMaterial.AETERNIUM, 1.5F, -3.0F, makeEndItemSettings().fireResistant()));
public static final TieredItem AETERNIUM_SWORD = registerEndTool("aeternium_sword",
new BaseSwordItem(EndToolMaterial.AETERNIUM,
3,
-2.4F,
makeEndItemSettings().fireResistant()));
public static final TieredItem AETERNIUM_PICKAXE = registerEndTool("aeternium_pickaxe",
new EndPickaxe(EndToolMaterial.AETERNIUM,
1,
-2.8F,
makeEndItemSettings().fireResistant()));
public static final TieredItem AETERNIUM_AXE = registerEndTool("aeternium_axe",
new BaseAxeItem(EndToolMaterial.AETERNIUM,
5.0F,
-3.0F,
makeEndItemSettings().fireResistant()));
public static final TieredItem AETERNIUM_HOE = registerEndTool("aeternium_hoe",
new BaseHoeItem(EndToolMaterial.AETERNIUM,
-3,
0.0F,
makeEndItemSettings().fireResistant()));
public static final TieredItem AETERNIUM_HAMMER = registerEndTool("aeternium_hammer",
new EndHammerItem(EndToolMaterial.AETERNIUM,
6.0F,
-3.0F,
0.3D,
makeEndItemSettings().fireResistant()));
// Toolparts //
public final static Item AETERNIUM_SHOVEL_HEAD = registerEndItem("aeternium_shovel_head",
new ModelProviderItem(makeEndItemSettings().fireResistant()));
public final static Item AETERNIUM_PICKAXE_HEAD = registerEndItem("aeternium_pickaxe_head",
new ModelProviderItem(makeEndItemSettings().fireResistant()));
public final static Item AETERNIUM_AXE_HEAD = registerEndItem("aeternium_axe_head",
new ModelProviderItem(makeEndItemSettings().fireResistant()));
public final static Item AETERNIUM_HOE_HEAD = registerEndItem("aeternium_hoe_head",
new ModelProviderItem(makeEndItemSettings().fireResistant()));
public final static Item AETERNIUM_HAMMER_HEAD = registerEndItem("aeternium_hammer_head",
new ModelProviderItem(makeEndItemSettings().fireResistant()));
public final static Item AETERNIUM_SWORD_BLADE = registerEndItem("aeternium_sword_blade",
new ModelProviderItem(makeEndItemSettings().fireResistant()));
public final static Item AETERNIUM_SWORD_HANDLE = registerEndItem("aeternium_sword_handle",
new ModelProviderItem(makeEndItemSettings().fireResistant()));
// ITEM_HAMMERS //
public static final TieredItem IRON_HAMMER = registerEndTool("iron_hammer",
new EndHammerItem(Tiers.IRON,
5.0F,
-3.2F,
0.2D,
makeEndItemSettings()));
public static final TieredItem GOLDEN_HAMMER = registerEndTool("golden_hammer",
new EndHammerItem(Tiers.GOLD,
4.5F,
-3.4F,
0.3D,
makeEndItemSettings()));
public static final TieredItem DIAMOND_HAMMER = registerEndTool("diamond_hammer",
new EndHammerItem(Tiers.DIAMOND,
5.5F,
-3.1F,
0.2D,
makeEndItemSettings()));
public static final TieredItem NETHERITE_HAMMER = registerEndTool("netherite_hammer",
new EndHammerItem(Tiers.NETHERITE,
5.0F,
-3.0F,
0.2D,
makeEndItemSettings().fireResistant()));
// Food //
public final static Item SHADOW_BERRY_RAW = registerEndFood("shadow_berry_raw", 4, 0.5F);
public final static Item SHADOW_BERRY_COOKED = registerEndFood("shadow_berry_cooked", 6, 0.7F);
public final static Item END_FISH_RAW = registerEndFood("end_fish_raw", Foods.SALMON);
public final static Item END_FISH_COOKED = registerEndFood("end_fish_cooked", Foods.COOKED_SALMON);
public final static Item BUCKET_END_FISH = registerEndItem("bucket_end_fish",
new EndBucketItem(EndEntities.END_FISH));
public final static Item BUCKET_CUBOZOA = registerEndItem("bucket_cubozoa", new EndBucketItem(EndEntities.CUBOZOA));
public final static Item SWEET_BERRY_JELLY = registerEndFood("sweet_berry_jelly", 8, 0.7F);
public final static Item SHADOW_BERRY_JELLY = registerEndFood("shadow_berry_jelly",
6,
0.8F,
new MobEffectInstance(MobEffects.NIGHT_VISION, 400));
public final static Item BLOSSOM_BERRY_JELLY = registerEndFood("blossom_berry_jelly", 8, 0.7F);
public final static Item BLOSSOM_BERRY = registerEndFood("blossom_berry", Foods.APPLE);
public final static Item AMBER_ROOT_RAW = registerEndFood("amber_root_raw", 2, 0.8F);
public final static Item CHORUS_MUSHROOM_RAW = registerEndFood("chorus_mushroom_raw", 3, 0.5F);
public final static Item CHORUS_MUSHROOM_COOKED = registerEndFood("chorus_mushroom_cooked", Foods.MUSHROOM_STEW);
public final static Item BOLUX_MUSHROOM_COOKED = registerEndFood("bolux_mushroom_cooked", Foods.MUSHROOM_STEW);
public final static Item CAVE_PUMPKIN_PIE = registerEndFood("cave_pumpkin_pie", Foods.PUMPKIN_PIE);
// Drinks //
public final static Item UMBRELLA_CLUSTER_JUICE = registerEndDrink("umbrella_cluster_juice", 5, 0.7F);
public static List<Item> getModItems() {
return BaseRegistry.getModItems(BetterEnd.MOD_ID);
}
public static Item registerEndDisc(String name, int power, SoundEvent sound) {
return getItemRegistry().registerDisc(BetterEnd.makeID(name), power, sound);
}
public static Item registerEndItem(String name) {
return getItemRegistry().register(BetterEnd.makeID(name));
}
public static Item registerEndItem(String name, Item item) {
if (item instanceof EndArmorItem) {
return getItemRegistry().register(BetterEnd.makeID(name), item, "armour");
}
return getItemRegistry().register(BetterEnd.makeID(name), item);
}
public static TieredItem registerEndTool(String name, TieredItem item) {
if (!Configs.ITEM_CONFIG.getBoolean("tools", name, true)) {
return item;
}
return (TieredItem) getItemRegistry().registerTool(BetterEnd.makeID(name), item);
}
public static Item registerEndEgg(String name, EntityType<? extends Mob> type, int background, int dots) {
return getItemRegistry().registerEgg(BetterEnd.makeID(name), type, background, dots);
}
public static Item registerEndFood(String name, int hunger, float saturation, MobEffectInstance... effects) {
return getItemRegistry().registerFood(BetterEnd.makeID(name), hunger, saturation, effects);
}
public static Item registerEndFood(String name, FoodProperties foodComponent) {
return getItemRegistry().registerFood(BetterEnd.makeID(name), foodComponent);
}
public static Item registerEndDrink(String name, int hunger, float saturation) {
return getItemRegistry().registerDrink(BetterEnd.makeID(name), hunger, saturation);
}
public static FabricItemSettings makeEndItemSettings() {
return getItemRegistry().makeItemSettings();
}
@NotNull
public static ItemRegistry getItemRegistry() {
return REGISTRY;
}
}

View file

@ -0,0 +1,18 @@
package org.betterx.betterend.registry;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import org.betterx.betterend.item.model.CrystaliteArmorProvider;
import shadow.fabric.api.client.rendering.v1.ArmorRenderingRegistry;
@Environment(EnvType.CLIENT)
public class EndModelProviders {
public final static CrystaliteArmorProvider CRYSTALITE_PROVIDER = new CrystaliteArmorProvider();
public final static void register() {
ArmorRenderingRegistry.registerModel(CRYSTALITE_PROVIDER, CRYSTALITE_PROVIDER.getRenderedItems());
ArmorRenderingRegistry.registerTexture(CRYSTALITE_PROVIDER, CRYSTALITE_PROVIDER.getRenderedItems());
}
}

View file

@ -0,0 +1,57 @@
package org.betterx.betterend.registry;
import net.minecraft.core.Registry;
import net.minecraft.core.particles.ParticleOptions;
import net.minecraft.core.particles.ParticleType;
import net.minecraft.core.particles.SimpleParticleType;
import net.fabricmc.fabric.api.client.particle.v1.ParticleFactoryRegistry;
import net.fabricmc.fabric.api.particle.v1.FabricParticleTypes;
import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.particle.*;
public class EndParticles {
public static final SimpleParticleType GLOWING_SPHERE = register("glowing_sphere");
public static final SimpleParticleType PORTAL_SPHERE = register("portal_sphere");
public static final ParticleType<InfusionParticleType> INFUSION = register(
"infusion",
FabricParticleTypes.complex(InfusionParticleType.PARAMETERS_FACTORY)
);
public static final SimpleParticleType SULPHUR_PARTICLE = register("sulphur_particle");
public static final SimpleParticleType GEYSER_PARTICLE = registerFar("geyser_particle");
public static final SimpleParticleType SNOWFLAKE = register("snowflake");
public static final SimpleParticleType AMBER_SPHERE = register("amber_sphere");
public static final SimpleParticleType BLACK_SPORE = register("black_spore");
public static final SimpleParticleType TENANEA_PETAL = register("tenanea_petal");
public static final SimpleParticleType JUNGLE_SPORE = register("jungle_spore");
public static final SimpleParticleType FIREFLY = register("firefly");
public static final SimpleParticleType SMARAGDANT = register("smaragdant_particle");
public static void register() {
ParticleFactoryRegistry.getInstance().register(GLOWING_SPHERE, ParticleGlowingSphere.FactoryGlowingSphere::new);
ParticleFactoryRegistry.getInstance().register(PORTAL_SPHERE, PaticlePortalSphere.FactoryPortalSphere::new);
ParticleFactoryRegistry.getInstance().register(INFUSION, InfusionParticle.InfusionFactory::new);
ParticleFactoryRegistry.getInstance().register(SULPHUR_PARTICLE, ParticleSulphur.FactorySulphur::new);
ParticleFactoryRegistry.getInstance().register(GEYSER_PARTICLE, ParticleGeyser.FactoryGeyser::new);
ParticleFactoryRegistry.getInstance().register(SNOWFLAKE, ParticleSnowflake.FactorySnowflake::new);
ParticleFactoryRegistry.getInstance().register(AMBER_SPHERE, ParticleGlowingSphere.FactoryGlowingSphere::new);
ParticleFactoryRegistry.getInstance().register(BLACK_SPORE, ParticleBlackSpore.FactoryBlackSpore::new);
ParticleFactoryRegistry.getInstance().register(TENANEA_PETAL, ParticleTenaneaPetal.FactoryTenaneaPetal::new);
ParticleFactoryRegistry.getInstance().register(JUNGLE_SPORE, ParticleJungleSpore.FactoryJungleSpore::new);
ParticleFactoryRegistry.getInstance().register(FIREFLY, FireflyParticle.FireflyParticleFactory::new);
ParticleFactoryRegistry.getInstance().register(SMARAGDANT, SmaragdantParticle.SmaragdantParticleFactory::new);
}
private static SimpleParticleType register(String name) {
return Registry.register(Registry.PARTICLE_TYPE, BetterEnd.makeID(name), FabricParticleTypes.simple());
}
private static SimpleParticleType registerFar(String name) {
return Registry.register(Registry.PARTICLE_TYPE, BetterEnd.makeID(name), FabricParticleTypes.simple(true));
}
private static <T extends ParticleOptions> ParticleType<T> register(String name, ParticleType<T> type) {
return Registry.register(Registry.PARTICLE_TYPE, BetterEnd.makeID(name), type);
}
}

View file

@ -0,0 +1,162 @@
package org.betterx.betterend.registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.level.Level;
import net.fabricmc.loader.api.FabricLoader;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import org.betterx.bclib.util.ColorUtil;
import org.betterx.bclib.util.JsonFactory;
import org.betterx.bclib.util.MHelper;
import org.betterx.betterend.BetterEnd;
import java.io.File;
public class EndPortals {
public final static ResourceLocation OVERWORLD_ID = Level.OVERWORLD.location();
private static PortalInfo[] portals;
public static void loadPortals() {
File file = new File(FabricLoader.getInstance().getConfigDir().toString(), "betterend/portals.json");
JsonObject json;
if (!file.exists()) {
file.getParentFile().mkdirs();
json = makeDefault(file);
} else {
json = JsonFactory.getJsonObject(file);
}
if (!json.has("portals") || !json.get("portals").isJsonArray()) {
json = makeDefault(file);
}
JsonArray array = json.get("portals").getAsJsonArray();
if (array.size() == 0) {
json = makeDefault(file);
array = json.get("portals").getAsJsonArray();
}
portals = new PortalInfo[array.size()];
for (int i = 0; i < portals.length; i++) {
portals[i] = new PortalInfo(array.get(i).getAsJsonObject());
}
}
public static int getCount() {
return MHelper.max(portals.length - 1, 1);
}
public static ServerLevel getWorld(MinecraftServer server, int portalId) {
if (portalId < 0 || portalId >= portals.length) {
return server.overworld();
}
return portals[portalId].getWorld(server);
}
public static ResourceLocation getWorldId(int portalId) {
if (portalId < 0 || portalId >= portals.length) {
return OVERWORLD_ID;
}
return portals[portalId].dimension;
}
public static int getPortalIdByItem(ResourceLocation item) {
for (int i = 0; i < portals.length; i++) {
if (portals[i].item.equals(item)) {
return i;
}
}
return 0;
}
public static int getPortalIdByWorld(ResourceLocation world) {
for (int i = 0; i < portals.length; i++) {
if (portals[i].dimension.equals(world)) {
return i;
}
}
return 0;
}
public static int getColor(int state) {
return portals[state].color;
}
public static boolean isAvailableItem(ResourceLocation item) {
for (PortalInfo portal : portals) {
if (portal.item.equals(item)) {
return true;
}
}
return false;
}
private static JsonObject makeDefault(File file) {
JsonObject jsonObject = new JsonObject();
JsonFactory.storeJson(file, jsonObject);
JsonArray array = new JsonArray();
jsonObject.add("portals", array);
array.add(makeDefault().toJson());
JsonFactory.storeJson(file, jsonObject);
return jsonObject;
}
private static PortalInfo makeDefault() {
return new PortalInfo(
new ResourceLocation("minecraft:overworld"),
BetterEnd.makeID("eternal_crystal"),
255,
255,
255
);
}
private static class PortalInfo {
private final ResourceLocation dimension;
private final ResourceLocation item;
private final int color;
private ServerLevel world;
PortalInfo(JsonObject obj) {
this(
new ResourceLocation(JsonFactory.getString(obj, "dimension", "minecraft:overworld")),
new ResourceLocation(JsonFactory.getString(obj, "item", "betterend:eternal_crystal")),
JsonFactory.getInt(obj, "colorRed", 255),
JsonFactory.getInt(obj, "colorGreen", 255),
JsonFactory.getInt(obj, "colorBlue", 255)
);
}
PortalInfo(ResourceLocation dimension, ResourceLocation item, int r, int g, int b) {
this.dimension = dimension;
this.item = item;
this.color = ColorUtil.color(r, g, b);
}
ServerLevel getWorld(MinecraftServer server) {
if (world != null) {
return world;
}
for (ServerLevel world : server.getAllLevels()) {
if (world.dimension().location().equals(dimension)) {
this.world = world;
return world;
}
}
return server.overworld();
}
JsonObject toJson() {
JsonObject obj = new JsonObject();
obj.addProperty("dimension", dimension.toString());
obj.addProperty("item", item.toString());
obj.addProperty("colorRed", (color >> 16) & 255);
obj.addProperty("colorGreen", (color >> 8) & 255);
obj.addProperty("colorBlue", color & 255);
return obj;
}
}
}

View file

@ -0,0 +1,12 @@
package org.betterx.betterend.registry;
import net.fabricmc.fabric.api.client.screenhandler.v1.ScreenRegistry;
import org.betterx.betterend.client.gui.EndStoneSmelterScreen;
import org.betterx.betterend.client.gui.EndStoneSmelterScreenHandler;
public class EndScreens {
public static void register() {
ScreenRegistry.register(EndStoneSmelterScreenHandler.HANDLER_TYPE, EndStoneSmelterScreen::new);
}
}

View file

@ -0,0 +1,49 @@
package org.betterx.betterend.registry;
import net.minecraft.core.Registry;
import net.minecraft.sounds.SoundEvent;
import org.betterx.betterend.BetterEnd;
public class EndSounds {
// Music
public static final SoundEvent MUSIC_FOREST = register("music", "forest");
public static final SoundEvent MUSIC_WATER = register("music", "water");
public static final SoundEvent MUSIC_DARK = register("music", "dark");
public static final SoundEvent MUSIC_OPENSPACE = register("music", "openspace");
public static final SoundEvent MUSIC_CAVES = register("music", "caves");
// Ambient
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");
public static final SoundEvent AMBIENT_MEGALAKE_GROVE = register("ambient", "megalake_grove");
public static final SoundEvent AMBIENT_BLOSSOMING_SPIRES = register("ambient", "blossoming_spires");
public static final SoundEvent AMBIENT_SULPHUR_SPRINGS = register("ambient", "sulphur_springs");
public static final SoundEvent AMBIENT_UMBRELLA_JUNGLE = register("ambient", "umbrella_jungle");
public static final SoundEvent AMBIENT_GLOWING_GRASSLANDS = register("ambient", "glowing_grasslands");
public static final SoundEvent AMBIENT_CAVES = register("ambient", "caves");
public static final SoundEvent AMBIENT_AMBER_LAND = register("ambient", "amber_land");
public static final SoundEvent UMBRA_VALLEY = register("ambient", "umbra_valley");
// Entity
public static final SoundEvent ENTITY_DRAGONFLY = register("entity", "dragonfly");
public static final SoundEvent ENTITY_SHADOW_WALKER = register("entity", "shadow_walker");
public static final SoundEvent ENTITY_SHADOW_WALKER_DAMAGE = register("entity", "shadow_walker_damage");
public static final SoundEvent ENTITY_SHADOW_WALKER_DEATH = register("entity", "shadow_walker_death");
// Records
public static final SoundEvent RECORD_STRANGE_AND_ALIEN = register("record", "strange_and_alien");
public static final SoundEvent RECORD_GRASPING_AT_STARS = register("record", "grasping_at_stars");
public static final SoundEvent RECORD_ENDSEEKER = register("record", "endseeker");
public static final SoundEvent RECORD_EO_DRACONA = register("record", "eo_dracona");
public static void register() {
}
private static SoundEvent register(String type, String id) {
id = "betterend." + type + "." + id;
return Registry.register(Registry.SOUND_EVENT, id, new SoundEvent(BetterEnd.makeID(id)));
}
}

View file

@ -0,0 +1,87 @@
package org.betterx.betterend.registry;
import net.minecraft.core.Holder;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
import net.minecraft.world.level.levelgen.structure.pieces.StructurePieceType;
import org.betterx.bclib.api.tag.TagAPI;
import org.betterx.bclib.world.structures.BCLStructure;
import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.world.structures.features.*;
import org.betterx.betterend.world.structures.piece.*;
public class EndStructures {
public static final StructurePieceType VOXEL_PIECE = register("voxel", VoxelPiece::new);
public static final StructurePieceType MOUNTAIN_PIECE = register("mountain_piece", CrystalMountainPiece::new);
public static final StructurePieceType CAVE_PIECE = register("cave_piece", CavePiece::new);
public static final StructurePieceType LAKE_PIECE = register("lake_piece", LakePiece::new);
public static final StructurePieceType PAINTED_MOUNTAIN_PIECE = register("painted_mountain_piece",
PaintedMountainPiece::new);
public static final StructurePieceType NBT_PIECE = register("nbt_piece", NBTPiece::new);
public static final BCLStructure<GiantMossyGlowshroomStructure> GIANT_MOSSY_GLOWSHROOM = new BCLStructure<>(
BetterEnd.makeID("giant_mossy_glowshroom"),
GiantMossyGlowshroomStructure::new,
Decoration.SURFACE_STRUCTURES,
16,
8
);
public static final BCLStructure<MegaLakeStructure> MEGALAKE = new BCLStructure<>(
BetterEnd.makeID("megalake"),
MegaLakeStructure::new,
Decoration.RAW_GENERATION,
4,
1
);
public static final BCLStructure<MegaLakeSmallStructure> MEGALAKE_SMALL = new BCLStructure<>(
BetterEnd.makeID("megalake_small"),
MegaLakeSmallStructure::new,
Decoration.RAW_GENERATION,
4,
1
);
public static final BCLStructure<MountainStructure> MOUNTAIN = new BCLStructure<>(
BetterEnd.makeID("mountain"),
MountainStructure::new,
Decoration.RAW_GENERATION,
3,
2
);
public static final BCLStructure<PaintedMountainStructure> PAINTED_MOUNTAIN = new BCLStructure<>(
BetterEnd.makeID("painted_mountain"),
PaintedMountainStructure::new,
Decoration.RAW_GENERATION,
3,
2
);
public static final BCLStructure<EternalPortalStructure> ETERNAL_PORTAL = new BCLStructure<>(
BetterEnd.makeID("eternal_portal"),
EternalPortalStructure::new,
Decoration.SURFACE_STRUCTURES,
16,
6
);
public static final BCLStructure<GiantIceStarStructure> GIANT_ICE_STAR = new BCLStructure<>(
BetterEnd.makeID("giant_ice_star"),
GiantIceStarStructure::new,
Decoration.SURFACE_STRUCTURES,
16,
8
);
public static void register() {
}
private static StructurePieceType register(String id, StructurePieceType pieceType) {
return Registry.register(Registry.STRUCTURE_PIECE, BetterEnd.makeID(id), pieceType);
}
public static void addBiomeStructures(ResourceLocation biomeID, Holder<Biome> biome) {
if (!biomeID.getPath().contains("mountain") && !biomeID.getPath().contains("lake")) {
TagAPI.addBiomeTag(ETERNAL_PORTAL.biomeTag, biome.value());
}
}
}

View file

@ -0,0 +1,149 @@
package org.betterx.betterend.registry;
import net.minecraft.core.Registry;
import net.minecraft.tags.TagKey;
import net.minecraft.world.food.FoodProperties;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.LeavesBlock;
import net.minecraft.world.level.block.state.BlockBehaviour.Properties;
import net.minecraft.world.level.material.Material;
import net.fabricmc.fabric.mixin.object.builder.AbstractBlockAccessor;
import net.fabricmc.fabric.mixin.object.builder.AbstractBlockSettingsAccessor;
import com.google.common.collect.Lists;
import org.betterx.bclib.api.BonemealAPI;
import org.betterx.bclib.api.ComposterAPI;
import org.betterx.bclib.api.tag.*;
import org.betterx.bclib.blocks.BaseVineBlock;
import org.betterx.bclib.blocks.SimpleLeavesBlock;
import org.betterx.betterend.BetterEnd;
import org.betterx.betterend.blocks.basis.EndTerrainBlock;
import org.betterx.betterend.blocks.basis.PedestalBlock;
import org.betterx.betterend.item.tool.EndHammerItem;
import org.betterx.betterend.world.biome.EndBiome;
import java.util.List;
public class EndTags {
// Table with common (c) tags:
// https://fabricmc.net/wiki/tutorial:tags
// Block Tags
public static final TagKey<Block> PEDESTALS = TagAPI.makeBlockTag(BetterEnd.MOD_ID, "pedestal");
// Item Tags
public static final TagKey<Item> ALLOYING_IRON = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_iron");
public static final TagKey<Item> ALLOYING_GOLD = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_gold");
public static final TagKey<Item> ALLOYING_COPPER = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_copper");
public static void register() {
addEndGround(EndBlocks.THALLASIUM.ore);
addEndGround(EndBlocks.ENDSTONE_DUST);
addEndGround(EndBlocks.AMBER_ORE);
EndBlocks.getModBlocks().forEach(block -> {
Properties properties = ((AbstractBlockAccessor) block).getSettings();
Material material = ((AbstractBlockSettingsAccessor) properties).getMaterial();
final Item item = block.asItem();
if (material.equals(Material.STONE) || material.equals(Material.METAL) || material.equals(Material.HEAVY_METAL)) {
TagAPI.addBlockTag(NamedMineableTags.PICKAXE, block);
} else if (material.equals(Material.WOOD)) {
TagAPI.addBlockTag(NamedMineableTags.AXE, block);
} else if (material.equals(Material.LEAVES) || material.equals(Material.PLANT) || material.equals(Material.WATER_PLANT) || material.equals(
Material.SPONGE)) {
TagAPI.addBlockTag(NamedMineableTags.HOE, block);
} else if (material.equals(Material.SAND)) {
TagAPI.addBlockTag(NamedMineableTags.SHOVEL, block);
}
if (block instanceof EndTerrainBlock) {
addEndGround(block);
TagAPI.addBlockTag(NamedBlockTags.NYLIUM, block);
BonemealAPI.addSpreadableBlock(block, Blocks.END_STONE);
} else if (block instanceof LeavesBlock || block instanceof SimpleLeavesBlock) {
TagAPI.addBlockTag(NamedBlockTags.LEAVES, block);
ComposterAPI.allowCompost(0.3f, item);
} else if (block instanceof BaseVineBlock) {
TagAPI.addBlockTag(NamedBlockTags.CLIMBABLE, block);
} else if (block instanceof PedestalBlock) {
TagAPI.addBlockTag(PEDESTALS, block);
}
Material mat = block.defaultBlockState().getMaterial();
if (mat.equals(Material.PLANT) || mat.equals(Material.REPLACEABLE_PLANT)) {
ComposterAPI.allowCompost(0.1F, item);
}
});
addEndGround(EndBlocks.CAVE_MOSS);
TagAPI.addBlockTag(NamedBlockTags.NYLIUM, EndBlocks.CAVE_MOSS);
BonemealAPI.addSpreadableBlock(EndBlocks.CAVE_MOSS, Blocks.END_STONE);
BonemealAPI.addSpreadableBlock(EndBlocks.MOSSY_OBSIDIAN, Blocks.OBSIDIAN);
BonemealAPI.addSpreadableBlock(EndBlocks.MOSSY_DRAGON_BONE, EndBlocks.DRAGON_BONE_BLOCK);
List<Item> ITEM_HAMMERS = Lists.newArrayList();
EndItems.getModItems().forEach(item -> {
if (item.isEdible()) {
FoodProperties food = item.getFoodProperties();
if (food != null) {
float compost = food.getNutrition() * food.getSaturationModifier() * 0.18F;
ComposterAPI.allowCompost(compost, item);
}
}
if (item instanceof EndHammerItem) {
ITEM_HAMMERS.add(item);
}
});
TagAPI.addBlockTag(
CommonBlockTags.END_STONES,
EndBlocks.ENDER_ORE,
EndBlocks.BRIMSTONE
);
TagAPI.addBlockTag(CommonBlockTags.END_STONES, EndBlocks.BRIMSTONE);
TagAPI.addBlockTag(NamedBlockTags.ANVIL, EndBlocks.AETERNIUM_ANVIL);
TagAPI.addBlockTag(NamedBlockTags.BEACON_BASE_BLOCKS, EndBlocks.AETERNIUM_BLOCK);
TagAPI.addItemTag(NamedItemTags.BEACON_PAYMENT_ITEMS, EndItems.AETERNIUM_INGOT);
TagAPI.addBlockTag(
CommonBlockTags.DRAGON_IMMUNE,
EndBlocks.ENDER_ORE,
EndBlocks.ETERNAL_PEDESTAL,
EndBlocks.FLAVOLITE_RUNED_ETERNAL,
EndBlocks.FLAVOLITE_RUNED
);
TagAPI.addItemTag(CommonItemTags.IRON_INGOTS, EndBlocks.THALLASIUM.ingot);
TagAPI.addItemTag(ALLOYING_IRON, Items.IRON_ORE, Items.DEEPSLATE_IRON_ORE, Items.RAW_IRON);
TagAPI.addItemTag(ALLOYING_GOLD, Items.GOLD_ORE, Items.DEEPSLATE_GOLD_ORE, Items.RAW_GOLD);
TagAPI.addItemTag(ALLOYING_COPPER, Items.COPPER_ORE, Items.DEEPSLATE_COPPER_ORE, Items.RAW_COPPER);
}
public static void addEndGround(Block bl) {
TagAPI.addBlockTag(CommonBlockTags.END_STONES, bl);
}
public static void addBiomeSurfaceToEndGroup(EndBiome b) {
addEndGround(b.getTopMaterial().getBlock());
addEndGround(b.getAltTopMaterial().getBlock());
addEndGround(b.getUnderMaterial().getBlock());
}
// TODO make getter for biome top blocks
public static void addTerrainTags(Registry<Biome> biomeRegistry) {
/*biomeRegistry.forEach((biome) -> {
if (biome.getBiomeCategory() == BiomeCategory.THEEND) {
SurfaceBuilderConfiguration config = biome.getGenerationSettings().getSurfaceBuilderConfig();
Block under = config.getUnderMaterial().getBlock();
Block surface = config.getTopMaterial().getBlock();
TagAPI.addTag(CommonBlockTags.GEN_END_STONES, under, surface);
TagAPI.addTag(CommonBlockTags.END_STONES, surface);
}
});
TagAPI.BLOCK_END_STONES.getValues().forEach(TagAPI::addEndGround);*/
}
}