Code style changes, entities fixes

This commit is contained in:
paulevsGitch 2021-07-08 00:21:47 +03:00
parent 9d604b2d25
commit 44962e18b6
377 changed files with 5038 additions and 4914 deletions

View file

@ -8,8 +8,9 @@ import ru.betterend.registry.EndBlocks;
public class BYGBlocks {
public static final Block IVIS_MOSS = EndBlocks.registerBlock("ivis_moss", new EndWallPlantBlock());
public static final Block NIGHTSHADE_MOSS = EndBlocks.registerBlock("nightshade_moss", new EndWallPlantBlock());
public static final Block IVIS_VINE = EndBlocks.registerBlock("ivis_vine", new BaseVineBlock());
public static void register() {}
public static void register() {
}
}

View file

@ -1,8 +1,5 @@
package ru.betterend.integration.byg;
import java.util.List;
import java.util.stream.Collectors;
import net.minecraft.data.BuiltinRegistries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.ai.behavior.ShufflingList;
@ -19,6 +16,9 @@ import ru.betterend.integration.byg.biomes.BYGBiomes;
import ru.betterend.integration.byg.features.BYGFeatures;
import ru.betterend.registry.EndBiomes;
import java.util.List;
import java.util.stream.Collectors;
public class BYGIntegration extends ModIntegration implements EndBiomeIntegration {
public BYGIntegration() {
super("byg");
@ -38,10 +38,10 @@ public class BYGIntegration extends ModIntegration implements EndBiomeIntegratio
@Override
public void addBiomes() {
BYGBiomes.addBiomes();
Class<?> biomeClass = this.getClass("corgiaoc.byg.common.world.biome.BYGEndBiome");
List<Object> biomes = this.getStaticFieldValue(biomeClass, "BYG_END_BIOMES");
if (biomes != null && biomeClass != null) {
biomes.forEach((obj) -> {
Biome biome = this.getAndExecuteRuntime(biomeClass, obj, "getBiome");

View file

@ -9,11 +9,11 @@ public class BYGBiomes {
public static final EndBiome OLD_BULBIS_GARDENS = EndBiomes.registerSubBiomeIntegration(new OldBulbisGardens());
public static final EndBiome NIGHTSHADE_REDWOODS = EndBiomes.registerSubBiomeIntegration(new NightshadeRedwoods());
//public static final EndBiome ETHERIAL_GROVE = EndBiomes.registerSubBiomeIntegration(new EterialGrove());
public static void register() {
System.out.println("Registered " + OLD_BULBIS_GARDENS);
}
public static void addBiomes() {
EndBiomes.addSubBiomeIntegration(OLD_BULBIS_GARDENS, Integrations.BYG.getID("bulbis_gardens"));
EndBiomes.addSubBiomeIntegration(NIGHTSHADE_REDWOODS, Integrations.BYG.getID("nightshade_forest"));

View file

@ -1,7 +1,5 @@
package ru.betterend.integration.byg.biomes;
import java.util.List;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.world.entity.MobCategory;
@ -17,15 +15,17 @@ import ru.betterend.integration.byg.features.BYGFeatures;
import ru.betterend.registry.EndFeatures;
import ru.betterend.world.biome.EndBiome;
import java.util.List;
public class NightshadeRedwoods extends EndBiome {
public NightshadeRedwoods() {
super(makeDef());
}
private static BCLBiomeDef makeDef() {
Biome biome = Integrations.BYG.getBiome("nightshade_forest");
BiomeSpecialEffects effects = biome.getSpecialEffects();
BCLBiomeDef def = new BCLBiomeDef(BetterEnd.makeID("nightshade_redwoods"))
.setFogColor(140, 108, 47)
.setFogDensity(1.5F)
@ -39,7 +39,7 @@ public class NightshadeRedwoods extends EndBiome {
.addFeature(BYGFeatures.NIGHTSHADE_REDWOOD_TREE)
.addFeature(BYGFeatures.NIGHTSHADE_MOSS_WOOD)
.addFeature(BYGFeatures.NIGHTSHADE_MOSS);
if (BCLib.isClient()) {
SoundEvent loop = effects.getAmbientLoopSoundEvent().get();
SoundEvent music = effects.getBackgroundMusic().get().getEvent();
@ -52,14 +52,14 @@ public class NightshadeRedwoods extends EndBiome {
def.addFeature(Decoration.VEGETAL_DECORATION, feature.get());
});
});
for (MobCategory group: MobCategory.values()) {
for (MobCategory group : MobCategory.values()) {
List<SpawnerData> list = biome.getMobSettings().getMobs(group).unwrap();
list.forEach((entry) -> {
def.addMobSpawn(entry);
});
}
return def;
}
}

View file

@ -1,8 +1,5 @@
package ru.betterend.integration.byg.biomes;
import java.util.List;
import java.util.function.Supplier;
import net.minecraft.core.Registry;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.data.BuiltinRegistries;
@ -16,7 +13,6 @@ import net.minecraft.world.level.biome.MobSpawnSettings.SpawnerData;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
import net.minecraft.world.level.levelgen.feature.Feature;
import net.minecraft.world.level.levelgen.placement.ConfiguredDecorator;
import ru.bclib.BCLib;
import ru.bclib.world.biomes.BCLBiomeDef;
@ -26,7 +22,10 @@ import ru.betterend.integration.byg.features.BYGFeatures;
import ru.betterend.registry.EndFeatures;
import ru.betterend.world.biome.EndBiome;
class FeaturesAccesor extends Features{
import java.util.List;
import java.util.function.Supplier;
class FeaturesAccesor extends Features {
static ConfiguredDecorator<?> shadowHEIGHTMAP_SQUARE;
static {
@ -38,11 +37,11 @@ public class OldBulbisGardens extends EndBiome {
public OldBulbisGardens() {
super(makeDef());
}
private static BCLBiomeDef makeDef() {
Biome biome = Integrations.BYG.getBiome("bulbis_gardens");
BiomeSpecialEffects effects = biome.getSpecialEffects();
Block ivis = Integrations.BYG.getBlock("ivis_phylium");
Block origin = biome.getGenerationSettings().getSurfaceBuilderConfig().getTopMaterial().getBlock();
BCLBiomeDef def = new BCLBiomeDef(BetterEnd.makeID("old_bulbis_gardens"))
@ -54,7 +53,7 @@ public class OldBulbisGardens extends EndBiome {
.setSurface(ivis, origin)
.addFeature(EndFeatures.END_LAKE_RARE)
.addFeature(BYGFeatures.OLD_BULBIS_TREE);
if (BCLib.isClient()) {
SoundEvent loop = effects.getAmbientLoopSoundEvent().get();
SoundEvent music = effects.getBackgroundMusic().get().getEvent();
@ -62,14 +61,14 @@ public class OldBulbisGardens extends EndBiome {
SoundEvent mood = effects.getAmbientMoodSettings().get().getSoundEvent();
def.setLoop(loop).setMusic(music).setAdditions(additions).setMood(mood);
}
for (MobCategory group: MobCategory.values()) {
for (MobCategory group : MobCategory.values()) {
List<SpawnerData> list = biome.getMobSettings().getMobs(group).unwrap();
list.forEach((entry) -> {
def.addMobSpawn(entry);
});
}
List<List<Supplier<ConfiguredFeature<?, ?>>>> features = biome.getGenerationSettings().features();
List<Supplier<ConfiguredFeature<?, ?>>> vegetal = features.get(Decoration.VEGETAL_DECORATION.ordinal());
if (vegetal.size() > 2) {
@ -90,13 +89,13 @@ public class OldBulbisGardens extends EndBiome {
def.addFeature(Decoration.VEGETAL_DECORATION, feature);
}
}
def.addFeature(EndFeatures.PURPLE_POLYPORE)
.addFeature(BYGFeatures.IVIS_MOSS_WOOD)
.addFeature(BYGFeatures.IVIS_MOSS)
.addFeature(BYGFeatures.IVIS_VINE)
.addFeature(BYGFeatures.IVIS_SPROUT);
.addFeature(BYGFeatures.IVIS_MOSS_WOOD)
.addFeature(BYGFeatures.IVIS_MOSS)
.addFeature(BYGFeatures.IVIS_VINE)
.addFeature(BYGFeatures.IVIS_SPROUT);
return def;
}
}

View file

@ -19,12 +19,13 @@ public class BYGFeatures {
public static final BCLFeature IVIS_MOSS_WOOD = redisterVegetation("ivis_moss_wood", new WallPlantOnLogFeature(BYGBlocks.IVIS_MOSS, 6), 15);
public static final BCLFeature NIGHTSHADE_MOSS = redisterVegetation("nightshade_moss", new WallPlantFeature(BYGBlocks.NIGHTSHADE_MOSS, 5), 2);
public static final BCLFeature NIGHTSHADE_MOSS_WOOD = redisterVegetation("nightshade_moss_wood", new WallPlantOnLogFeature(BYGBlocks.NIGHTSHADE_MOSS, 5), 8);
public static final BCLFeature NIGHTSHADE_REDWOOD_TREE = redisterVegetation("nightshade_redwood_tree", new NightshadeRedwoodTreeFeature(), 1);
public static final BCLFeature BIG_ETHER_TREE = redisterVegetation("big_ether_tree", new BigEtherTreeFeature(), 1);
public static void register() {}
public static void register() {
}
private static BCLFeature redisterVegetation(String name, Feature<NoneFeatureConfiguration> feature, int density) {
return BCLFeature.makeVegetationFeature(BetterEnd.makeID(name), feature, density);
}

View file

@ -1,15 +1,10 @@
package ru.betterend.integration.byg.features;
import java.util.List;
import java.util.Random;
import com.google.common.base.Function;
import com.mojang.math.Vector3f;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.Material;
@ -20,6 +15,9 @@ import ru.bclib.util.SplineHelper;
import ru.bclib.world.features.DefaultFeature;
import ru.betterend.integration.Integrations;
import java.util.List;
import java.util.Random;
public class BigEtherTreeFeature extends DefaultFeature {
@Override
public boolean place(FeaturePlaceContext<NoneFeatureConfiguration> featureConfig) {

View file

@ -1,12 +1,8 @@
package ru.betterend.integration.byg.features;
import java.util.List;
import java.util.Random;
import com.google.common.base.Function;
import com.google.common.collect.Lists;
import com.mojang.math.Vector3f;
import net.minecraft.core.BlockPos;
import net.minecraft.core.BlockPos.MutableBlockPos;
import net.minecraft.core.Direction;
@ -14,7 +10,6 @@ import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.LeavesBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.Material;
@ -32,6 +27,9 @@ import ru.bclib.util.SplineHelper;
import ru.bclib.world.features.DefaultFeature;
import ru.betterend.integration.Integrations;
import java.util.List;
import java.util.Random;
public class NightshadeRedwoodTreeFeature extends DefaultFeature {
private static final List<Vector3f> BRANCH;

View file

@ -1,18 +1,12 @@
package ru.betterend.integration.byg.features;
import java.util.List;
import java.util.Random;
import java.util.function.Function;
import com.google.common.collect.Lists;
import com.mojang.math.Vector3f;
import net.minecraft.core.BlockPos;
import net.minecraft.util.Mth;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.chunk.ChunkGenerator;
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration;
import net.minecraft.world.level.material.Material;
@ -30,6 +24,10 @@ import ru.bclib.world.features.DefaultFeature;
import ru.betterend.integration.Integrations;
import ru.betterend.noise.OpenSimplexNoise;
import java.util.List;
import java.util.Random;
import java.util.function.Function;
public class OldBulbisTreeFeature extends DefaultFeature {
private static final List<Vector3f> SPLINE;
private static final List<Vector3f> ROOT;
@ -104,7 +102,7 @@ public class OldBulbisTreeFeature extends DefaultFeature {
}
private void bigSphere(WorldGenLevel world, BlockPos pos, float radius, BlockState cap, BlockState glow,
BlockState wood, Function<BlockState, Boolean> replacement, Random random) {
BlockState wood, Function<BlockState, Boolean> replacement, Random random) {
OpenSimplexNoise noise = new OpenSimplexNoise(random.nextLong());
SDF sphere = new SDFSphere().setRadius(radius).setBlock(cap);
@ -152,7 +150,7 @@ public class OldBulbisTreeFeature extends DefaultFeature {
}
private void makeRoots(WorldGenLevel world, BlockPos pos, float radius, Random random, BlockState wood,
Function<BlockState, Boolean> replacement) {
Function<BlockState, Boolean> replacement) {
int count = (int) (radius * 1.5F);
for (int i = 0; i < count; i++) {
float angle = (float) i / (float) count * MHelper.PI2;