Removed color provider

This commit is contained in:
paulevsGitch 2021-07-10 16:25:34 +03:00
parent 2c8862a37b
commit 4040597a6d
475 changed files with 5411 additions and 7521 deletions

View file

@ -8,11 +8,11 @@ import ru.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

@ -62,23 +62,23 @@ import java.util.Set;
public class EndBiomes {
public static final Set<ResourceLocation> FABRIC_VOID = Sets.newHashSet();
private static final Set<ResourceLocation> SUBBIOMES_UNMUTABLES = Sets.newHashSet();
public static final BiomePicker LAND_BIOMES = new BiomePicker();
public static final BiomePicker VOID_BIOMES = new BiomePicker();
public static final BiomePicker CAVE_BIOMES = new BiomePicker();
public static final List<BCLBiome> SUBBIOMES = Lists.newArrayList();
private static final JsonObject EMPTY_JSON = new JsonObject();
private static BiomeMap caveBiomeMap;
// Vanilla Land
public static final EndBiome END = registerBiome(Biomes.THE_END, BiomeType.LAND, 1F);
public static final EndBiome END_MIDLANDS = registerSubBiome(Biomes.END_MIDLANDS, END, 0.5F);
public static final EndBiome END_HIGHLANDS = registerSubBiome(Biomes.END_HIGHLANDS, END, 0.5F);
// Vanilla Void
public static final EndBiome END_BARRENS = registerBiome(Biomes.END_BARRENS, BiomeType.VOID, 1F);
public static final EndBiome SMALL_END_ISLANDS = registerBiome(Biomes.SMALL_END_ISLANDS, BiomeType.VOID, 1);
// 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);
@ -97,10 +97,10 @@ public class EndBiomes {
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);
// 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());
@ -108,28 +108,28 @@ public class EndBiomes {
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() {
CAVE_BIOMES.rebuild();
}
public static void onWorldLoad(long seed) {
if (caveBiomeMap == null || caveBiomeMap.getSeed() != seed) {
caveBiomeMap = new BiomeMap(seed, GeneratorOptions.getBiomeSizeCaves(), CAVE_BIOMES);
}
}
public static void mutateRegistry(Registry<Biome> biomeRegistry) {
LAND_BIOMES.clearMutables();
VOID_BIOMES.clearMutables();
CAVE_BIOMES.clearMutables();
if (FABRIC_VOID.isEmpty()) {
loadFabricAPIBiomes();
}
Map<String, JsonObject> configs = Maps.newHashMap();
biomeRegistry.forEach((biome) -> {
if (biome.getBiomeCategory() == BiomeCategory.THEEND) {
ResourceLocation id = biomeRegistry.getKey(biome);
@ -152,7 +152,7 @@ public class EndBiomes {
hasCaves = JsonFactory.getBoolean(element.getAsJsonObject(), "has_caves", true);
}
EndBiome endBiome = new EndBiome(id, biome, fog, chance, hasCaves);
if (isVoid) {
VOID_BIOMES.addBiomeMutable(endBiome);
}
@ -170,30 +170,30 @@ public class EndBiomes {
}
});
Configs.BIOME_CONFIG.saveChanges();
rebuildPicker(LAND_BIOMES, biomeRegistry);
rebuildPicker(VOID_BIOMES, biomeRegistry);
rebuildPicker(CAVE_BIOMES, biomeRegistry);
SUBBIOMES.forEach((endBiome) -> {
endBiome.updateActualBiomes(biomeRegistry);
});
}
private static void rebuildPicker(BiomePicker picker, Registry<Biome> biomeRegistry) {
picker.rebuild();
picker.getBiomes().forEach((endBiome) -> {
endBiome.updateActualBiomes(biomeRegistry);
});
}
private static void loadFabricAPIBiomes() {
List<ResourceKey<Biome>> biomes = Lists.newArrayList();
biomes.addAll(getBiomes(InternalBiomeData.getEndBiomesMap().get(Biomes.SMALL_END_ISLANDS)));
biomes.addAll(getBiomes(InternalBiomeData.getEndBarrensMap().get(Biomes.END_BARRENS)));
biomes.forEach((key) -> FABRIC_VOID.add(key.location()));
FABRIC_VOID.removeIf(id -> id.getNamespace().equals("endplus"));
if (BCLib.isDevEnvironment()) {
System.out.println("==================================");
System.out.println("Added void biomes from Fabric API:");
@ -203,12 +203,12 @@ public class EndBiomes {
System.out.println("==================================");
}
}
private static List<ResourceKey<Biome>> getBiomes(WeightedBiomePicker picker) {
IBiomeList biomeList = (IBiomeList) (Object) picker;
return biomeList == null ? Collections.emptyList() : biomeList.getBiomes();
}
private static JsonObject loadJsonConfig(String namespace) {
InputStream inputstream = EndBiomes.class.getResourceAsStream("/data/" + namespace + "/end_biome_properties.json");
if (inputstream != null) {
@ -218,7 +218,7 @@ public class EndBiomes {
return EMPTY_JSON;
}
}
/**
* Registers new {@link EndBiome} and adds it to picker, can be used to add existing mod biomes into the End.
*
@ -230,7 +230,7 @@ public class EndBiomes {
public static EndBiome registerBiome(Biome biome, BiomeType type, float genChance) {
return registerBiome(biome, type, 1, genChance);
}
/**
* Registers new {@link EndBiome} and adds it to picker, can be used to add existing mod biomes into the End.
*
@ -247,7 +247,7 @@ public class EndBiomes {
}
return endBiome;
}
/**
* Registers new {@link EndBiome} from existed {@link Biome} and put as a sub-biome into selected parent.
*
@ -259,7 +259,7 @@ public class EndBiomes {
public static EndBiome registerSubBiome(Biome biome, EndBiome parent, float genChance, boolean hasCaves) {
return registerSubBiome(biome, parent, 1, genChance, hasCaves);
}
/**
* Registers new {@link EndBiome} from existed {@link Biome} and put as a sub-biome into selected parent.
*
@ -280,7 +280,7 @@ public class EndBiomes {
}
return endBiome;
}
/**
* Put existing {@link EndBiome} as a sub-biome into selected parent.
*
@ -298,7 +298,7 @@ public class EndBiomes {
}
return biome;
}
/**
* Registers {@link EndBiome} and adds it into worldgen.
*
@ -319,7 +319,7 @@ public class EndBiomes {
}
return biome;
}
/**
* Put integration sub-biome {@link EndBiome} into subbiomes list and registers it.
*
@ -335,7 +335,7 @@ public class EndBiomes {
}
return biome;
}
/**
* Link integration sub-biome with parent.
*
@ -350,15 +350,15 @@ public class EndBiomes {
}
}
}
public static EndBiome registerBiome(ResourceKey<Biome> key, BiomeType type, float genChance) {
return registerBiome(BuiltinRegistries.BIOME.get(key), type, genChance);
}
public static EndBiome registerSubBiome(ResourceKey<Biome> key, EndBiome parent, float genChance) {
return registerSubBiome(BuiltinRegistries.BIOME.get(key), parent, genChance, true);
}
private static void addToPicker(EndBiome biome, BiomeType type) {
if (type == BiomeType.LAND) {
LAND_BIOMES.addBiome(biome);
@ -367,7 +367,7 @@ public class EndBiomes {
VOID_BIOMES.addBiome(biome);
}
}
public static EndCaveBiome registerCaveBiome(EndCaveBiome biome) {
if (Configs.BIOME_CONFIG.getBoolean(biome.getID(), "enabled", true)) {
BiomeAPI.registerBiome(biome);
@ -375,7 +375,7 @@ public class EndBiomes {
}
return biome;
}
public static EndCaveBiome getCaveBiome(int x, int z) {
return (EndCaveBiome) caveBiomeMap.getBiome(x, z);
}

View file

@ -15,29 +15,22 @@ import ru.betterend.blocks.entities.InfusionPedestalEntity;
import ru.betterend.blocks.entities.PedestalBlockEntity;
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 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);
return EndBlocks.getModBlocks().stream().filter(block -> block instanceof PedestalBlock && !((PedestalBlock) block).hasUniqueEntity()).toArray(Block[]::new);
}
}

View file

@ -68,6 +68,7 @@ import ru.betterend.blocks.FilaluxBlock;
import ru.betterend.blocks.FilaluxLanternBlock;
import ru.betterend.blocks.FilaluxWingsBlock;
import ru.betterend.blocks.FlamaeaBlock;
import ru.betterend.blocks.FlowerPotBlock;
import ru.betterend.blocks.GlowingHymenophoreBlock;
import ru.betterend.blocks.GlowingMossBlock;
import ru.betterend.blocks.GlowingPillarLuminophorBlock;
@ -160,7 +161,7 @@ public class EndBlocks extends BlocksRegistry {
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));
// 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));
@ -173,13 +174,13 @@ public class EndBlocks extends BlocksRegistry {
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);
@ -190,76 +191,76 @@ public class EndBlocks extends BlocksRegistry {
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 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 WoodenMaterial MOSSY_GLOWSHROOM = new WoodenMaterial("mossy_glowshroom", MaterialColor.COLOR_GRAY, MaterialColor.WOOD);
public static final Block PYTHADENDRON_SAPLING = registerBlock("pythadendron_sapling", new PythadendronSaplingBlock());
public static final Block PYTHADENDRON_LEAVES = registerBlock("pythadendron_leaves", new BaseLeavesBlock(PYTHADENDRON_SAPLING, MaterialColor.COLOR_MAGENTA));
public static final WoodenMaterial PYTHADENDRON = new WoodenMaterial("pythadendron", MaterialColor.COLOR_MAGENTA, MaterialColor.COLOR_PURPLE);
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 WoodenMaterial END_LOTUS = new WoodenMaterial("end_lotus", MaterialColor.COLOR_LIGHT_BLUE, MaterialColor.COLOR_CYAN);
public static final Block LACUGROVE_SAPLING = registerBlock("lacugrove_sapling", new LacugroveSaplingBlock());
public static final Block LACUGROVE_LEAVES = registerBlock("lacugrove_leaves", new BaseLeavesBlock(LACUGROVE_SAPLING, MaterialColor.COLOR_CYAN));
public static final WoodenMaterial LACUGROVE = new WoodenMaterial("lacugrove", MaterialColor.COLOR_BROWN, MaterialColor.COLOR_YELLOW);
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 BaseLeavesBlock(DRAGON_TREE_SAPLING, MaterialColor.COLOR_MAGENTA));
public static final WoodenMaterial DRAGON_TREE = new WoodenMaterial("dragon_tree", MaterialColor.COLOR_BLACK, MaterialColor.COLOR_MAGENTA);
public static final Block TENANEA_SAPLING = registerBlock("tenanea_sapling", new TenaneaSaplingBlock());
public static final Block TENANEA_LEAVES = registerBlock("tenanea_leaves", new BaseLeavesBlock(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 WoodenMaterial TENANEA = new WoodenMaterial("tenanea", MaterialColor.COLOR_BROWN, MaterialColor.COLOR_PINK);
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 WoodenMaterial HELIX_TREE = new WoodenMaterial("helix_tree", MaterialColor.COLOR_GRAY, MaterialColor.COLOR_ORANGE);
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 WoodenMaterial UMBRELLA_TREE = new WoodenMaterial("umbrella_tree", MaterialColor.COLOR_BLUE, MaterialColor.COLOR_GREEN);
public static final Block JELLYSHROOM_CAP_PURPLE = registerBlock("jellyshroom_cap_purple", new JellyshroomCapBlock(217, 142, 255, 164, 0, 255));
public static final WoodenMaterial JELLYSHROOM = new WoodenMaterial("jellyshroom", MaterialColor.COLOR_PURPLE, MaterialColor.COLOR_LIGHT_BLUE);
public static final Block LUCERNIA_SAPLING = registerBlock("lucernia_sapling", new LucerniaSaplingBlock());
public static final Block LUCERNIA_LEAVES = registerBlock("lucernia_leaves", new BaseLeavesBlock(LUCERNIA_SAPLING, MaterialColor.COLOR_ORANGE));
public static final Block LUCERNIA_OUTER_LEAVES = registerBlock("lucernia_outer_leaves", new FurBlock(LUCERNIA_SAPLING, 32));
public static final WoodenMaterial LUCERNIA = new WoodenMaterial("lucernia", MaterialColor.COLOR_ORANGE, MaterialColor.COLOR_ORANGE);
// 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());
@ -283,26 +284,26 @@ public class EndBlocks extends BlocksRegistry {
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 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());
@ -311,12 +312,12 @@ public class EndBlocks extends BlocksRegistry {
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 BaseCropBlock(EndItems.BLOSSOM_BERRY, PINK_MOSS));
@ -325,7 +326,7 @@ public class EndBlocks extends BlocksRegistry {
//public static final Block PEARLBERRY = registerBlock("pearlberry_seed", new EndCropBlock(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());
@ -336,24 +337,24 @@ public class EndBlocks extends BlocksRegistry {
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));
@ -364,7 +365,7 @@ public class EndBlocks extends BlocksRegistry {
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());
@ -376,30 +377,30 @@ public class EndBlocks extends BlocksRegistry {
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));
@ -408,34 +409,34 @@ public class EndBlocks extends BlocksRegistry {
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 ENDSTONE_FLOWER_POT = registerBlock("endstone_flower_pot", new FlowerPotBlock(Blocks.END_STONE));
public static final Block END_PORTAL_BLOCK = registerEndBlockOnly("end_portal_block", new EndPortalBlock());
private static BlocksRegistry BLOCKS_REGISTRY;
private EndBlocks(CreativeModeTab creativeTab) {
super(creativeTab);
}
public static List<Block> getModBlocks() {
return getModBlocks(BetterEnd.MOD_ID).stream().filter(BlockItem.class::isInstance)
.map(item -> ((BlockItem) item).getBlock()).collect(Collectors.toList());
return getModBlocks(BetterEnd.MOD_ID).stream().filter(BlockItem.class::isInstance).map(item -> ((BlockItem) item).getBlock()).collect(Collectors.toList());
}
public static Block registerBlock(ResourceLocation id, Block block) {
if (!Configs.BLOCK_CONFIG.getBooleanRoot(id.getPath(), true)) {
return block;
@ -455,24 +456,24 @@ public class EndBlocks extends BlocksRegistry {
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(name, block);
}
public static FabricItemSettings makeBlockItemSettings() {
return getBlockRegistry().makeItemSettings();
}
@Override
public ResourceLocation createModId(String name) {
return BetterEnd.makeID(name);
}
@NotNull
private static BlocksRegistry getBlockRegistry() {
if (BLOCKS_REGISTRY == null) {

View file

@ -29,7 +29,7 @@ public class EndEntities {
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() {
SpawnHelper.restrictionAir(DRAGONFLY, DragonflyEntity::canSpawn);
SpawnHelper.restrictionLand(END_SLIME, EndSlimeEntity::canSpawn);
@ -38,7 +38,7 @@ public class EndEntities {
SpawnHelper.restrictionWater(CUBOZOA, CubozoaEntity::canSpawn);
SpawnHelper.restrictionAir(SILK_MOTH, SilkMothEntity::canSpawn);
}
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.<T>create(group, entity).dimensions(EntityDimensions.fixed(width, height)).build();
@ -47,7 +47,7 @@ public class EndEntities {
}
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.<T>create(group, entity).dimensions(fixedSize ? EntityDimensions.fixed(width, height) : EntityDimensions.scalable(width, height)).build();

View file

@ -25,14 +25,14 @@ import ru.betterend.item.model.CrystaliteHelmetModel;
import ru.betterend.item.model.CrystaliteLeggingsModel;
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");
//Not sure if this should go to another registry
public static final ModelLayerLocation ARMORED_ELYTRA = registerMain("armored_elytra");
public static final ModelLayerLocation CRYSTALITE_CHESTPLATE = registerMain("crystalite_chestplate");
@ -40,7 +40,7 @@ public class EndEntitiesRenders {
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.class);
register(EndEntities.END_SLIME, RendererEntityEndSlime.class);
@ -48,14 +48,14 @@ public class EndEntitiesRenders {
register(EndEntities.SHADOW_WALKER, RendererEntityShadowWalker.class);
register(EndEntities.CUBOZOA, RendererEntityCubozoa.class);
register(EndEntities.SILK_MOTH, SilkMothEntityRenderer.class);
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);
@ -63,7 +63,7 @@ public class EndEntitiesRenders {
EntityModelLayerRegistry.registerModelLayer(CRYSTALITE_LEGGINGS, CrystaliteLeggingsModel::getTexturedModelData);
EntityModelLayerRegistry.registerModelLayer(CRYSTALITE_BOOTS, CrystaliteBootsModel::getTexturedModelData);
}
private static void register(EntityType<?> type, Class<? extends MobRenderer<?, ?>> renderer) {
EntityRendererRegistry.INSTANCE.register(type, (context) -> {
MobRenderer render = null;
@ -76,7 +76,7 @@ public class EndEntitiesRenders {
return render;
});
}
private static ModelLayerLocation registerMain(String id) {
return new ModelLayerLocation(new ResourceLocation(BetterEnd.MOD_ID, id), "main");
}

View file

@ -93,7 +93,7 @@ public class EndFeatures {
public static final BCLFeature JELLYSHROOM = redisterVegetation("jellyshroom", new JellyshroomFeature(), 3);
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.bark), 4);
public static final BCLFeature DRAGON_TREE_BUSH = redisterVegetation("dragon_tree_bush", new BushFeature(EndBlocks.DRAGON_TREE_LEAVES, EndBlocks.DRAGON_TREE.bark), 15);
@ -103,7 +103,7 @@ public class EndFeatures {
public static final BCLFeature LUCERNIA_BUSH = redisterVegetation("lucernia_bush", new BushWithOuterFeature(EndBlocks.LUCERNIA_LEAVES, EndBlocks.LUCERNIA_OUTER_LEAVES, EndBlocks.LUCERNIA.bark), 10);
public static final BCLFeature LUCERNIA_BUSH_RARE = redisterVegetation("lucernia_bush_rare", new BushWithOuterFeature(EndBlocks.LUCERNIA_LEAVES, EndBlocks.LUCERNIA_OUTER_LEAVES, EndBlocks.LUCERNIA.bark), 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), 5);
public static final BCLFeature CREEPING_MOSS = redisterVegetation("creeping_moss", new SinglePlantFeature(EndBlocks.CREEPING_MOSS, 5), 5);
@ -141,16 +141,16 @@ public class EndFeatures {
public static final BCLFeature CHORUS_MUSHROOM = redisterVegetation("chorus_mushroom", new SinglePlantFeature(EndBlocks.CHORUS_MUSHROOM, 5, 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);
// 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), 3);
public static final BCLFeature BULB_VINE = redisterVegetation("bulb_vine", new VineFeature(EndBlocks.BULB_VINE, 24), 5);
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);
@ -167,10 +167,10 @@ public class EndFeatures {
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);
@ -180,7 +180,7 @@ public class EndFeatures {
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);
@ -191,7 +191,7 @@ public class EndFeatures {
public static final BCLFeature CHARNIA_RED_RARE = redisterVegetation("charnia_red_rare", new CharniaFeature(EndBlocks.CHARNIA_RED), 2);
public static final BCLFeature BIOME_ISLAND = BCLFeature.makeFeatureConfigured(BetterEnd.makeID("overworld_island"), new BiomeIslandFeature());
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);
@ -211,20 +211,20 @@ public class EndFeatures {
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 = BCLFeature.makeChunkFeature(BetterEnd.makeID("tunel_cave"), new TunelCaveFeature());
// Ores //
public static final BCLFeature THALLASIUM_ORE = registerOre("thallasium_ore", EndBlocks.THALLASIUM.ore, 24, 8, 0, 5, 128);
public static final BCLFeature ENDER_ORE = registerOre("ender_ore", EndBlocks.ENDER_ORE, 12, 4, 0, 5, 128);
public static final BCLFeature AMBER_ORE = registerOre("amber_ore", EndBlocks.AMBER_ORE, 24, 6, 0, 5, 128);
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);
@ -238,43 +238,43 @@ public class EndFeatures {
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) {
return BCLFeature.makeVegetationFeature(BetterEnd.makeID(name), feature, density);
}
private static BCLFeature registerRawGen(String name, Feature<NoneFeatureConfiguration> feature, int chance) {
return BCLFeature.makeRawGenFeature(BetterEnd.makeID(name), feature, chance);
}
private static BCLFeature registerLake(String name, Feature<NoneFeatureConfiguration> feature, int chance) {
//return BCLFeature.makeLakeFeature(BetterEnd.makeID(name), feature, chance);
return BCLFeature.makeRawGenFeature(BetterEnd.makeID(name), feature, chance);
}
private static BCLFeature registerChanced(String name, Feature<NoneFeatureConfiguration> feature, int chance) {
return BCLFeature.makeChansedFeature(BetterEnd.makeID(name), feature, chance);
}
private static BCLFeature registerOre(String name, Block blockOre, int veins, int veinSize, int offset, int minY, int maxY) {
return BCLFeature.makeOreFeature(BetterEnd.makeID(name), blockOre, veins, veinSize, offset, minY, maxY);
}
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);
ConfiguredFeature<?, ?> configured = layer.configured(FeatureConfiguration.NONE).decorated(FeatureDecorator.COUNT.configured(new CountConfiguration(count)));
return new BCLFeature(BetterEnd.makeID(name), layer, GenerationStep.Decoration.UNDERGROUND_ORES, configured);
}
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 registerBiomeFeatures(ResourceLocation id, Biome biome, List<List<Supplier<ConfiguredFeature<?, ?>>>> features) {
if (id.getNamespace().equals(BetterEnd.MOD_ID)) {
return;
}
if (GeneratorOptions.removeChorusFromVanillaBiomes()) {
if (id.getNamespace().equals("minecraft")) {
String path = id.getPath();
@ -290,38 +290,38 @@ public class EndFeatures {
}
}
}
addFeature(FLAVOLITE_LAYER, features);
addFeature(THALLASIUM_ORE, features);
addFeature(ENDER_ORE, features);
addFeature(CRASHED_SHIP, features);
BCLBiome bclbiome = BiomeAPI.getBiome(id);
boolean hasCaves = bclbiome.getCustomData("has_caves", true);
if (hasCaves && !EndBiomes.VOID_BIOMES.containsImmutable(id)) {
addFeature(ROUND_CAVE, features);
addFeature(TUNEL_CAVE, features);
}
BCLFeature feature = BiomeAPI.getBiome(id).getStructuresFeature();
if (feature != null) {
addFeature(feature, features);
}
}
public static void addDefaultFeatures(BCLBiomeDef def) {
def.addFeature(FLAVOLITE_LAYER);
def.addFeature(THALLASIUM_ORE);
def.addFeature(ENDER_ORE);
def.addFeature(CRASHED_SHIP);
boolean hasCaves = def.getCustomData("has_caves", true);
if (hasCaves) {
def.addFeature(ROUND_CAVE);
def.addFeature(TUNEL_CAVE);
}
}
private static void addFeature(BCLFeature feature, List<List<Supplier<ConfiguredFeature<?, ?>>>> features) {
int index = feature.getFeatureStep().ordinal();
if (features.size() > index) {
@ -337,7 +337,7 @@ public class EndFeatures {
features.add(newFeature);
}
}
public static void register() {
}
}

View file

@ -65,13 +65,13 @@ public class EndItems extends ItemsRegistry {
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()));
@ -83,7 +83,7 @@ public class EndItems extends ItemsRegistry {
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()));
@ -91,7 +91,7 @@ public class EndItems extends ItemsRegistry {
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");
public final static Item AETERNIUM_PICKAXE_HEAD = registerEndItem("aeternium_pickaxe_head");
@ -100,13 +100,13 @@ public class EndItems extends ItemsRegistry {
public final static Item AETERNIUM_HAMMER_HEAD = registerEndItem("aeternium_hammer_head");
public final static Item AETERNIUM_SWORD_BLADE = registerEndItem("aeternium_sword_blade");
public final static Item AETERNIUM_SWORD_HANDLE = registerEndItem("aeternium_sword_handle");
// 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);
@ -123,32 +123,32 @@ public class EndItems extends ItemsRegistry {
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);
private static ItemsRegistry itemRegistry;
protected EndItems(CreativeModeTab creativeTab) {
super(creativeTab);
}
public static List<Item> getModItems() {
return getModItems(BetterEnd.MOD_ID);
}
public static Item registerEndDisc(String name, int power, SoundEvent sound) {
return getItemRegistry().registerDisc(name, power, sound);
}
public static Item registerEndItem(String name) {
return getItemRegistry().registerItem(name);
}
public static Item registerEndItem(String name, Item item) {
return getItemRegistry().register(BetterEnd.makeID(name), item);
}
public static Item registerEndItem(ResourceLocation id, Item item) {
if (item instanceof ArmorItem) {
return registerEndArmor(id, item);
@ -159,7 +159,7 @@ public class EndItems extends ItemsRegistry {
getItemRegistry().register(id, item);
return item;
}
private static Item registerEndArmor(ResourceLocation itemId, Item item) {
if (!Configs.ITEM_CONFIG.getBoolean("armor", itemId.getPath(), true)) {
return item;
@ -167,47 +167,47 @@ public class EndItems extends ItemsRegistry {
getItemRegistry().register(itemId, item);
return item;
}
public static TieredItem registerEndTool(String name, TieredItem item) {
if (!Configs.ITEM_CONFIG.getBoolean("tools", name, true)) {
return item;
}
return getItemRegistry().registerTool(name, item);
}
public static Item registerEndEgg(String name, EntityType<? extends Mob> type, int background, int dots) {
return getItemRegistry().registerEgg(name, type, background, dots);
}
public static Item registerEndFood(String name, int hunger, float saturation, MobEffectInstance... effects) {
return getItemRegistry().registerFood(name, hunger, saturation, effects);
}
public static Item registerEndFood(String name, FoodProperties foodComponent) {
return getItemRegistry().registerFood(name, foodComponent);
}
public static Item registerEndDrink(String name) {
return getItemRegistry().registerDrink(name);
}
public static Item registerEndDrink(String name, FoodProperties foodComponent) {
return getItemRegistry().registerDrink(name, foodComponent);
}
public static Item registerEndDrink(String name, int hunger, float saturation) {
return getItemRegistry().registerDrink(name, hunger, saturation);
}
public static FabricItemSettings makeEndItemSettings() {
return itemRegistry.makeItemSettings();
}
@Override
public ResourceLocation createModId(String name) {
return BetterEnd.makeID(name);
}
@NotNull
private static ItemsRegistry getItemRegistry() {
if (itemRegistry == null) {

View file

@ -7,9 +7,9 @@ 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

@ -33,7 +33,7 @@ public class EndParticles {
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);
@ -48,15 +48,15 @@ public class EndParticles {
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

@ -15,11 +15,11 @@ import ru.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;
@ -43,25 +43,25 @@ public class EndPortals {
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)) {
@ -70,7 +70,7 @@ public class EndPortals {
}
return 0;
}
public static int getPortalIdByWorld(ResourceLocation world) {
for (int i = 0; i < portals.length; i++) {
if (portals[i].dimension.equals(world)) {
@ -79,11 +79,11 @@ public class EndPortals {
}
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)) {
@ -92,7 +92,7 @@ public class EndPortals {
}
return false;
}
private static JsonObject makeDefault(File file) {
JsonObject jsonObject = new JsonObject();
JsonFactory.storeJson(file, jsonObject);
@ -102,33 +102,27 @@ public class EndPortals {
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)
);
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;
@ -141,7 +135,7 @@ public class EndPortals {
}
return server.overworld();
}
JsonObject toJson() {
JsonObject obj = new JsonObject();
obj.addProperty("dimension", dimension.toString());

View file

@ -11,7 +11,7 @@ public class EndSounds {
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");
@ -24,22 +24,22 @@ public class EndSounds {
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");
// 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

@ -6,8 +6,8 @@ import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
import net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature;
import net.minecraft.world.level.levelgen.feature.StructurePieceType;
import ru.bclib.world.structures.BCLStructureFeature;
import ru.betterend.BetterEnd;
import ru.betterend.world.structures.EndStructureFeature;
import ru.betterend.world.structures.features.EternalPortalStructure;
import ru.betterend.world.structures.features.GiantIceStarStructure;
import ru.betterend.world.structures.features.GiantMossyGlowshroomStructure;
@ -32,29 +32,29 @@ public class EndStructures {
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 EndStructureFeature GIANT_MOSSY_GLOWSHROOM = new EndStructureFeature("giant_mossy_glowshroom", new GiantMossyGlowshroomStructure(), Decoration.SURFACE_STRUCTURES, 16, 8);
public static final EndStructureFeature MEGALAKE = new EndStructureFeature("megalake", new MegaLakeStructure(), Decoration.RAW_GENERATION, 4, 1);
public static final EndStructureFeature MEGALAKE_SMALL = new EndStructureFeature("megalake_small", new MegaLakeSmallStructure(), Decoration.RAW_GENERATION, 4, 1);
public static final EndStructureFeature MOUNTAIN = new EndStructureFeature("mountain", new MountainStructure(), Decoration.RAW_GENERATION, 3, 2);
public static final EndStructureFeature PAINTED_MOUNTAIN = new EndStructureFeature("painted_mountain", new PaintedMountainStructure(), Decoration.RAW_GENERATION, 3, 2);
public static final EndStructureFeature ETERNAL_PORTAL = new EndStructureFeature("eternal_portal", new EternalPortalStructure(), Decoration.SURFACE_STRUCTURES, 16, 6);
public static final EndStructureFeature GIANT_ICE_STAR = new EndStructureFeature("giant_ice_star", new GiantIceStarStructure(), Decoration.SURFACE_STRUCTURES, 16, 8);
public static final BCLStructureFeature GIANT_MOSSY_GLOWSHROOM = new BCLStructureFeature(BetterEnd.makeID("giant_mossy_glowshroom"), new GiantMossyGlowshroomStructure(), Decoration.SURFACE_STRUCTURES, 16, 8);
public static final BCLStructureFeature MEGALAKE = new BCLStructureFeature(BetterEnd.makeID("megalake"), new MegaLakeStructure(), Decoration.RAW_GENERATION, 4, 1);
public static final BCLStructureFeature MEGALAKE_SMALL = new BCLStructureFeature(BetterEnd.makeID("megalake_small"), new MegaLakeSmallStructure(), Decoration.RAW_GENERATION, 4, 1);
public static final BCLStructureFeature MOUNTAIN = new BCLStructureFeature(BetterEnd.makeID("mountain"), new MountainStructure(), Decoration.RAW_GENERATION, 3, 2);
public static final BCLStructureFeature PAINTED_MOUNTAIN = new BCLStructureFeature(BetterEnd.makeID("painted_mountain"), new PaintedMountainStructure(), Decoration.RAW_GENERATION, 3, 2);
public static final BCLStructureFeature ETERNAL_PORTAL = new BCLStructureFeature(BetterEnd.makeID("eternal_portal"), new EternalPortalStructure(), Decoration.SURFACE_STRUCTURES, 16, 6);
public static final BCLStructureFeature GIANT_ICE_STAR = new BCLStructureFeature(BetterEnd.makeID("giant_ice_star"), new GiantIceStarStructure(), 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 registerBiomeStructures(ResourceLocation id, Biome biome, Collection<Supplier<ConfiguredStructureFeature<?, ?>>> structures) {
if (!id.getPath().contains("mountain") && !id.getPath().contains("lake")) {
addStructure(ETERNAL_PORTAL, structures);
}
}
private static void addStructure(EndStructureFeature feature, Collection<Supplier<ConfiguredStructureFeature<?, ?>>> structures) {
private static void addStructure(BCLStructureFeature feature, Collection<Supplier<ConfiguredStructureFeature<?, ?>>> structures) {
structures.add(() -> {
return feature.getFeatureConfigured();
});

View file

@ -32,20 +32,20 @@ import java.util.List;
public class EndTags {
// Table with common (c) tags:
// https://fabricmc.net/wiki/tutorial:tags
// Block Tags
public static final Tag.Named<Block> PEDESTALS = TagAPI.makeBlockTag(BetterEnd.MOD_ID, "pedestal");
public static final Tag.Named<Block> END_STONES = TagAPI.makeCommonBlockTag("end_stones");
public static final Tag.Named<Item> ALLOYING_IRON = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_iron");
public static final Tag.Named<Item> ALLOYING_GOLD = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_gold");
public static final Tag.Named<Item> ALLOYING_COPPER = TagAPI.makeItemTag(BetterEnd.MOD_ID, "alloying_copper");
public static void register() {
TagAPI.addEndGround(EndBlocks.THALLASIUM.ore);
TagAPI.addEndGround(EndBlocks.ENDSTONE_DUST);
TagAPI.addEndGround(EndBlocks.AMBER_ORE);
EndBlocks.getModBlocks().forEach(block -> {
if (block instanceof EndTerrainBlock) {
TagAPI.addEndGround(block);
@ -62,7 +62,7 @@ public class EndTags {
else if (block instanceof PedestalBlock) {
TagHelper.addTag(PEDESTALS, block);
}
Material mat = block.defaultBlockState().getMaterial();
if (mat.equals(Material.PLANT) || mat.equals(Material.REPLACEABLE_PLANT)) {
ComposterBlockAccessor.callAdd(0.1F, block);
@ -71,7 +71,7 @@ public class EndTags {
TagAPI.addEndGround(EndBlocks.CAVE_MOSS);
TagHelper.addTag(BlockTags.NYLIUM, EndBlocks.CAVE_MOSS);
BonemealAPI.addSpreadableBlock(EndBlocks.CAVE_MOSS);
List<Item> hammers = Lists.newArrayList();
EndItems.getModItems(BetterEnd.MOD_ID).forEach(item -> {
if (item.isEdible()) {
@ -86,35 +86,20 @@ public class EndTags {
}
});
ToolManagerImpl.tag(TagAPI.HAMMERS).register(new ModdedToolsVanillaBlocksToolHandler(hammers));
TagHelper.addTag(
TagAPI.GEN_TERRAIN,
EndBlocks.ENDER_ORE,
EndBlocks.FLAVOLITE.stone,
EndBlocks.VIOLECITE.stone,
EndBlocks.SULPHURIC_ROCK.stone,
EndBlocks.BRIMSTONE,
EndBlocks.VIRID_JADESTONE.stone,
EndBlocks.AZURE_JADESTONE.stone,
EndBlocks.SANDY_JADESTONE.stone
);
TagHelper.addTag(TagAPI.GEN_TERRAIN, EndBlocks.ENDER_ORE, EndBlocks.FLAVOLITE.stone, EndBlocks.VIOLECITE.stone, EndBlocks.SULPHURIC_ROCK.stone, EndBlocks.BRIMSTONE, EndBlocks.VIRID_JADESTONE.stone, EndBlocks.AZURE_JADESTONE.stone, EndBlocks.SANDY_JADESTONE.stone);
TagHelper.addTag(TagAPI.END_GROUND, EndBlocks.SULPHURIC_ROCK.stone, EndBlocks.BRIMSTONE);
TagHelper.addTag(BlockTags.ANVIL, EndBlocks.AETERNIUM_ANVIL);
TagHelper.addTag(BlockTags.BEACON_BASE_BLOCKS, EndBlocks.AETERNIUM_BLOCK);
TagHelper.addTag(ItemTags.BEACON_PAYMENT_ITEMS, EndItems.AETERNIUM_INGOT);
TagHelper.addTag(TagAPI.DRAGON_IMMUNE,
EndBlocks.ENDER_ORE,
EndBlocks.ETERNAL_PEDESTAL,
EndBlocks.FLAVOLITE_RUNED_ETERNAL,
EndBlocks.FLAVOLITE_RUNED
);
TagHelper.addTag(TagAPI.DRAGON_IMMUNE, EndBlocks.ENDER_ORE, EndBlocks.ETERNAL_PEDESTAL, EndBlocks.FLAVOLITE_RUNED_ETERNAL, EndBlocks.FLAVOLITE_RUNED);
TagHelper.addTag(TagAPI.IRON_INGOTS, EndBlocks.THALLASIUM.ingot);
TagHelper.addTag(ALLOYING_IRON, Items.IRON_ORE, Items.DEEPSLATE_IRON_ORE, Items.RAW_IRON);
TagHelper.addTag(ALLOYING_GOLD, Items.GOLD_ORE, Items.DEEPSLATE_GOLD_ORE, Items.RAW_GOLD);
TagHelper.addTag(ALLOYING_COPPER, Items.COPPER_ORE, Items.DEEPSLATE_COPPER_ORE, Items.RAW_COPPER);
}
public static void addTerrainTags(Registry<Biome> biomeRegistry) {
biomeRegistry.forEach((biome) -> {
if (biome.getBiomeCategory() == BiomeCategory.THEEND) {