This commit is contained in:
Aleksey 2020-12-27 22:06:20 +03:00
commit 8da3d01e5c
21 changed files with 100 additions and 144 deletions

View file

@ -6,9 +6,9 @@ import java.util.List;
import com.google.common.collect.Lists;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.AbstractGlassBlock;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.SlimeBlock;
import net.minecraft.client.color.block.BlockColorProvider;
import net.minecraft.client.color.item.ItemColorProvider;
import net.minecraft.item.ItemStack;
@ -22,7 +22,7 @@ import ru.betterend.patterns.BlockPatterned;
import ru.betterend.patterns.Patterns;
import ru.betterend.util.MHelper;
public class BlockJellyshroomCap extends AbstractGlassBlock implements IRenderTypeable, BlockPatterned, IColorProvider {
public class BlockJellyshroomCap extends SlimeBlock implements IRenderTypeable, BlockPatterned, IColorProvider {
private final int color;
public BlockJellyshroomCap(int r, int g, int b) {

View file

@ -9,10 +9,10 @@ import com.google.common.collect.Lists;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.AbstractGlassBlock;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.SlimeBlock;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext;
@ -31,7 +31,7 @@ import ru.betterend.patterns.Patterns;
import ru.betterend.registry.EndBlocks;
import ru.betterend.util.MHelper;
public class BlockUmbrellaTreeMembrane extends AbstractGlassBlock implements IRenderTypeable, BlockPatterned {
public class BlockUmbrellaTreeMembrane extends SlimeBlock implements IRenderTypeable, BlockPatterned {
public static final IntProperty COLOR = IntProperty.of("color", 0, 7);
private static final OpenSimplexNoise NOISE = new OpenSimplexNoise(0);

View file

@ -7,12 +7,12 @@ import ru.betterend.world.biome.EndBiome;
public class BYGBiomes {
// New Biomes
public static final EndBiome OLD_BULBIS_GARDENS = EndBiomes.registerSubBiomeIntegration(new OldBulbisGardens());
public static final EndBiome ETHERIAL_GROVE = EndBiomes.registerSubBiomeIntegration(new EterialGrove());
//public static final EndBiome ETHERIAL_GROVE = EndBiomes.registerSubBiomeIntegration(new EterialGrove());
public static void register() {}
public static void addBiomes() {
EndBiomes.addSubBiomeIntegration(OLD_BULBIS_GARDENS, Integrations.BYG.getID("bulbis_gardens"));
EndBiomes.addSubBiomeIntegration(ETHERIAL_GROVE, Integrations.BYG.getID("ethereal_islands"));
//EndBiomes.addSubBiomeIntegration(ETHERIAL_GROVE, Integrations.BYG.getID("ethereal_islands"));
}
}

View file

@ -18,9 +18,6 @@ import ru.betterend.registry.EndTags;
import ru.betterend.util.MHelper;
import ru.betterend.util.SplineHelper;
import ru.betterend.util.sdf.SDF;
import ru.betterend.util.sdf.operator.SDFSmoothUnion;
import ru.betterend.util.sdf.operator.SDFTranslate;
import ru.betterend.util.sdf.operator.SDFUnion;
import ru.betterend.world.features.DefaultFeature;
public class BigEtherTreeFeature extends DefaultFeature {
@ -41,14 +38,14 @@ public class BigEtherTreeFeature extends DefaultFeature {
SplineHelper.offsetParts(trunk, random, 2F, 0, 2F);
SDF sdf = SplineHelper.buildSDF(trunk, 2.3F, 0.8F, splinePlacer);
int count = height / 10;
int count = height / 15;
for (int i = 1; i < count; i++) {
float splinePos = (float) i / count;
float splinePos = (float) i / (float) count;
float startAngle = random.nextFloat() * MHelper.PI2;
float length = (1 - splinePos) * height * 0.4F;
int points = (int) (length / 3);
List<Vector3f> branch = SplineHelper.makeSpline(0, 0, 0, length, 0, 0, points < 2 ? 2 : points);
SplineHelper.powerOffset(branch, length * 0.5F, 1.5F);
SplineHelper.powerOffset(branch, length, 2F);
int rotCount = MHelper.randRange(5, 7, random);
float startRad = MathHelper.lerp(splinePos, 2.3F, 0.8F) * 0.8F;
Vector3f start = SplineHelper.getPos(trunk, splinePos * (trunk.size() - 1));
@ -58,10 +55,8 @@ public class BigEtherTreeFeature extends DefaultFeature {
List<Vector3f> br = SplineHelper.copySpline(branch);
SplineHelper.offsetParts(br, random, 0, 1, 1);
SplineHelper.rotateSpline(br, angle);
//SDF branchSDF = SplineHelper.buildSDF(br, startRad, 0.5F, splinePlacer);
//branchSDF = new SDFTranslate().setTranslate(start.getX(), start.getY(), start.getZ()).setSource(branchSDF);
//sdf = new SDFSmoothUnion().setRadius(2).setSourceA(sdf).setSourceB(branchSDF);
//sdf = new SDFUnion().setSourceA(sdf).setSourceB(branchSDF);
SplineHelper.offset(br, start);
SplineHelper.fillSpline(br, world, wood, pos, replace);
}
}

View file

@ -48,33 +48,32 @@ public class BoneMealItemMixin {
}
}
else {
if (!world.getBlockState(offseted).equals(Blocks.WATER)) {
info.cancel();
}
else if (!world.getFluidState(offseted).isEmpty() && endBiome) {
if (!world.getFluidState(offseted).isEmpty() && endBiome) {
if (world.getBlockState(offseted).equals(Blocks.WATER)) {
consume = beGrowWaterGrass(world, blockPos);
}
}
else {
consume = beGrowGrass(world, blockPos);
}
}
if (consume) {
if (!context.getPlayer().isCreative())
if (!context.getPlayer().isCreative()) {
context.getStack().decrement(1);
}
world.syncWorldEvent(2005, blockPos, 0);
info.setReturnValue(ActionResult.SUCCESS);
info.cancel();
}
}
else if (!world.getBlockState(offseted).equals(Blocks.WATER)) {
info.cancel();
}
else if (!world.getFluidState(offseted).isEmpty() && endBiome) {
if (world.getBlockState(offseted).equals(Blocks.WATER)) {
info.setReturnValue(ActionResult.FAIL);
info.cancel();
}
}
}
}
private boolean beGrowGrass(World world, BlockPos pos) {
int y1 = pos.getY() + 3;

View file

@ -6,15 +6,10 @@ import ru.betterend.BetterEnd;
public class EndSounds {
// Music
public static final SoundEvent MUSIC_FOGGY_MUSHROOMLAND = register("music", "foggy_mushroomland");
public static final SoundEvent MUSIC_CHORUS_FOREST = register("music", "chorus_forest");
public static final SoundEvent MUSIC_CRYSTAL_MOUNTAINS = register("music", "crystal_mountains");
public static final SoundEvent MUSIC_MEGALAKE = register("music", "megalake");
public static final SoundEvent MUSIC_DUST_WASTELANDS = register("music", "dust_wastelands");
public static final SoundEvent MUSIC_SHADOW_FOREST = register("music", "shadow_forest");
public static final SoundEvent MUSIC_BLOSSOMING_SPIRES = register("music", "blossoming_spires");
public static final SoundEvent MUSIC_AMBER_LAND = register("music", "amber_land");
public static final SoundEvent MUSIC_SULPHUR_SPRINGS = register("music", "sulphur_springs");
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");
// Ambient
public static final SoundEvent AMBIENT_FOGGY_MUSHROOMLAND = register("ambient", "foggy_mushroomland");

View file

@ -14,7 +14,7 @@ public class BiomeAmberLand extends EndBiome {
.setFogDensity(2.0F)
.setPlantsColor(219, 115, 38)
.setWaterAndFogColor(145, 108, 72)
.setMusic(EndSounds.MUSIC_AMBER_LAND)
.setMusic(EndSounds.MUSIC_FOREST)
.setParticles(EndParticles.AMBER_SPHERE, 0.001F)
.setSurface(EndBlocks.AMBER_MOSS)
.addFeature(EndFeatures.AMBER_ORE)

View file

@ -13,7 +13,7 @@ public class BiomeBlossomingSpires extends EndBiome {
.setPlantsColor(122, 45, 122)
.setCaves(false)
.setSurface(EndBlocks.PINK_MOSS)
.setMusic(EndSounds.MUSIC_BLOSSOMING_SPIRES)
.setMusic(EndSounds.MUSIC_FOREST)
.setLoop(EndSounds.AMBIENT_BLOSSOMING_SPIRES)
.addFeature(EndFeatures.SPIRE)
.addFeature(EndFeatures.FLOATING_SPIRE)

View file

@ -20,7 +20,7 @@ public class BiomeChorusForest extends EndBiome {
.setSurface(EndBlocks.CHORUS_NYLIUM)
.setParticles(ParticleTypes.PORTAL, 0.01F)
.setLoop(EndSounds.AMBIENT_CHORUS_FOREST)
.setMusic(EndSounds.MUSIC_CHORUS_FOREST)
.setMusic(EndSounds.MUSIC_DARK)
.addFeature(EndFeatures.VIOLECITE_LAYER)
.addFeature(EndFeatures.END_LAKE_RARE)
.addFeature(EndFeatures.PYTHADENDRON_TREE)

View file

@ -11,7 +11,7 @@ public class BiomeCrystalMountains extends EndBiome {
super(new BiomeDefinition("crystal_mountains")
.setPlantsColor(255, 133, 211)
.setSurface(EndBlocks.CRYSTAL_MOSS)
.setMusic(EndSounds.MUSIC_CRYSTAL_MOUNTAINS)
.setMusic(EndSounds.MUSIC_OPENSPACE)
.addStructureFeature(EndStructures.MOUNTAIN)
.addFeature(EndFeatures.ROUND_CAVE)
.addFeature(EndFeatures.CRYSTAL_GRASS)

View file

@ -16,7 +16,7 @@ public class BiomeDustWastelands extends EndBiome {
.setSurface(EndBlocks.ENDSTONE_DUST)
.setParticles(ParticleTypes.WHITE_ASH, 0.01F)
.setLoop(EndSounds.AMBIENT_DUST_WASTELANDS)
.setMusic(EndSounds.MUSIC_DUST_WASTELANDS)
.setMusic(EndSounds.MUSIC_OPENSPACE)
.addStructureFeature(ConfiguredStructureFeatures.END_CITY)
.addMobSpawn(EntityType.ENDERMAN, 50, 1, 2));
}

View file

@ -19,7 +19,7 @@ public class BiomeFoggyMushroomland extends EndBiome {
.setSurface(EndBlocks.END_MOSS, EndBlocks.END_MYCELIUM)
.setParticles(EndParticles.GLOWING_SPHERE, 0.001F)
.setLoop(EndSounds.AMBIENT_FOGGY_MUSHROOMLAND)
.setMusic(EndSounds.MUSIC_FOGGY_MUSHROOMLAND)
.setMusic(EndSounds.MUSIC_FOREST)
.addStructureFeature(EndStructures.GIANT_MOSSY_GLOWSHROOM)
.addFeature(EndFeatures.END_LAKE)
.addFeature(EndFeatures.MOSSY_GLOWSHROOM)

View file

@ -14,7 +14,7 @@ public class BiomeMegalake extends EndBiome {
.setFogColor(178, 209, 248)
.setWaterAndFogColor(96, 163, 255)
.setFogDensity(1.75F)
.setMusic(EndSounds.MUSIC_MEGALAKE)
.setMusic(EndSounds.MUSIC_WATER)
.setLoop(EndSounds.AMBIENT_MEGALAKE)
.setSurface(EndBlocks.END_MOSS, EndBlocks.ENDSTONE_DUST)
.addStructureFeature(EndStructures.MEGALAKE)

View file

@ -16,7 +16,7 @@ public class BiomeMegalakeGrove extends EndBiome {
.setWaterAndFogColor(96, 163, 255)
.setFogDensity(2.0F)
.setParticles(EndParticles.GLOWING_SPHERE, 0.001F)
.setMusic(EndSounds.MUSIC_MEGALAKE)
.setMusic(EndSounds.MUSIC_WATER)
.setLoop(EndSounds.AMBIENT_MEGALAKE_GROVE)
.setSurface(EndBlocks.END_MOSS)
.addStructureFeature(EndStructures.MEGALAKE)

View file

@ -13,7 +13,7 @@ public class BiomePaintedMountains extends EndBiome {
.setFogDensity(2)
.setCaves(false)
.setWaterAndFogColor(192, 180, 131)
.setMusic(EndSounds.MUSIC_DUST_WASTELANDS)
.setMusic(EndSounds.MUSIC_OPENSPACE)
.setLoop(EndSounds.AMBIENT_DUST_WASTELANDS)
.setSurface(EndBlocks.ENDSTONE_DUST)
.setParticles(ParticleTypes.WHITE_ASH, 0.01F)

View file

@ -18,7 +18,7 @@ public class BiomeShadowForest extends EndBiome {
.setSurface(EndBlocks.SHADOW_GRASS)
.setParticles(ParticleTypes.MYCELIUM, 0.01F)
.setLoop(EndSounds.AMBIENT_CHORUS_FOREST)
.setMusic(EndSounds.MUSIC_SHADOW_FOREST)
.setMusic(EndSounds.MUSIC_DARK)
.addFeature(EndFeatures.VIOLECITE_LAYER)
.addFeature(EndFeatures.END_LAKE_RARE)
.addFeature(EndFeatures.DRAGON_TREE)

View file

@ -11,7 +11,7 @@ public class BiomeSulphurSprings extends EndBiome {
public BiomeSulphurSprings() {
super(new BiomeDefinition("sulphur_springs")
.setSurface(SurfaceBuilders.SULPHURIC_SURFACE)
.setMusic(EndSounds.MUSIC_SULPHUR_SPRINGS)
.setMusic(EndSounds.MUSIC_OPENSPACE)
.setLoop(EndSounds.AMBIENT_SULPHUR_SPRINGS)
.setWaterColor(25, 90, 157)
.setWaterFogColor(30, 65, 61)

View file

@ -2,6 +2,7 @@ package ru.betterend.world.biome;
import ru.betterend.registry.EndBlocks;
import ru.betterend.registry.EndFeatures;
import ru.betterend.registry.EndSounds;
public class BiomeUmbrellaJungle extends EndBiome {
public BiomeUmbrellaJungle() {
@ -10,6 +11,7 @@ public class BiomeUmbrellaJungle extends EndBiome {
.setWaterAndFogColor(119, 198, 253)
.setFoliageColor(27, 183, 194)
.setFogDensity(2.3F)
.setMusic(EndSounds.MUSIC_FOREST)
.setSurface(EndBlocks.JUNGLE_MOSS)
.addFeature(EndFeatures.END_LAKE)
.addFeature(EndFeatures.UMBRELLA_TREE)

View file

@ -1,5 +1,5 @@
{
"betterend.music.foggy_mushroomland": {
"betterend.music.forest": {
"category": "music",
"sounds": [
{
@ -11,102 +11,7 @@
"name": "betterend:music/dan_henig-nebular_focus",
"volume": 0.2,
"stream": false
}
]
},
"betterend.music.chorus_forest": {
"category": "music",
"sounds": [
{
"name": "betterend:music/emmit_fenn-creep",
"volume": 0.2,
"stream": false
},
{
"name": "betterend:music/jesse_gallagher-the_anunnaki_return",
"volume": 0.2,
"stream": false
}
]
},
"betterend.music.crystal_mountains": {
"category": "music",
"sounds": [
{
"name": "betterend:music/jesse_gallagher-spenta_mainyu",
"volume": 0.2,
"stream": false
},
{
"name": "betterend:music/jesse_gallagher-obelisks",
"volume": 0.2,
"stream": false
}
]
},
"betterend.music.megalake": {
"category": "music",
"sounds": [
{
"name": "betterend:music/jesse_gallagher-the_blue_pearl",
"volume": 0.2,
"stream": false
},
{
"name": "betterend:music/jesse_gallagher-venkatesananda",
"volume": 0.2,
"stream": false
}
]
},
"betterend.music.dust_wastelands": {
"category": "music",
"sounds": [
{
"name": "betterend:music/the-tides-ammil",
"volume": 0.2,
"stream": false
},
{
"name": "betterend:music/vyen-amber",
"volume": 0.2,
"stream": false
}
]
},
"betterend.music.shadow_forest": {
"category": "music",
"sounds": [
{
"name": "betterend:music/i_think_i_can_help_you-the_six_realms",
"volume": 0.2,
"stream": false
},
{
"name": "betterend:music/jesse_gallagher-maestro_tlakaelel",
"volume": 0.2,
"stream": false
}
]
},
"betterend.music.blossoming_spires": {
"category": "music",
"sounds": [
{
"name": "betterend:music/benjamin_martins-verve",
"volume": 0.2,
"stream": false
},
{
"name": "betterend:music/the_tides-somnolent",
"volume": 0.2,
"stream": false
}
]
},
"betterend.music.amber_land": {
"category": "music",
"sounds": [
{
"name": "betterend:music/bobby_richards-two_moons",
"volume": 0.2,
@ -119,7 +24,57 @@
}
]
},
"betterend.music.sulphur_springs": {
"betterend.music.water": {
"category": "music",
"sounds": [
{
"name": "betterend:music/jesse_gallagher-the_blue_pearl",
"volume": 0.2,
"stream": false
},
{
"name": "betterend:music/jesse_gallagher-venkatesananda",
"volume": 0.2,
"stream": false
},
{
"name": "betterend:music/the_tides-somnolent",
"volume": 0.2,
"stream": false
},
{
"name": "betterend:music/benjamin_martins-verve",
"volume": 0.2,
"stream": false
}
]
},
"betterend.music.dark": {
"category": "music",
"sounds": [
{
"name": "betterend:music/emmit_fenn-creep",
"volume": 0.2,
"stream": false
},
{
"name": "betterend:music/jesse_gallagher-the_anunnaki_return",
"volume": 0.2,
"stream": false
},
{
"name": "betterend:music/i_think_i_can_help_you-the_six_realms",
"volume": 0.2,
"stream": false
},
{
"name": "betterend:music/jesse_gallagher-maestro_tlakaelel",
"volume": 0.2,
"stream": false
}
]
},
"betterend.music.openspace": {
"category": "music",
"sounds": [
{
@ -131,6 +86,16 @@
"name": "betterend:music/asher_fulero-elegy",
"volume": 0.2,
"stream": false
},
{
"name": "betterend:music/the-tides-ammil",
"volume": 0.2,
"stream": false
},
{
"name": "betterend:music/vyen-amber",
"volume": 0.2,
"stream": false
}
]
},