Firefly sounds
This commit is contained in:
parent
70e9813002
commit
be7fdf20e6
8 changed files with 44 additions and 16 deletions
|
@ -19,7 +19,7 @@ import ru.betterend.registry.EntityRegistry;
|
||||||
import ru.betterend.registry.FeatureRegistry;
|
import ru.betterend.registry.FeatureRegistry;
|
||||||
import ru.betterend.registry.ItemRegistry;
|
import ru.betterend.registry.ItemRegistry;
|
||||||
import ru.betterend.registry.ItemTagRegistry;
|
import ru.betterend.registry.ItemTagRegistry;
|
||||||
import ru.betterend.registry.SoundsRegistry;
|
import ru.betterend.registry.SoundRegistry;
|
||||||
import ru.betterend.util.Logger;
|
import ru.betterend.util.Logger;
|
||||||
import ru.betterend.world.generator.BetterEndBiomeSource;
|
import ru.betterend.world.generator.BetterEndBiomeSource;
|
||||||
import ru.betterend.world.surface.DoubleBlockSurfaceBuilder;
|
import ru.betterend.world.surface.DoubleBlockSurfaceBuilder;
|
||||||
|
@ -31,7 +31,7 @@ public class BetterEnd implements ModInitializer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onInitialize() {
|
public void onInitialize() {
|
||||||
SoundsRegistry.register();
|
SoundRegistry.register();
|
||||||
DoubleBlockSurfaceBuilder.register();
|
DoubleBlockSurfaceBuilder.register();
|
||||||
ItemRegistry.register();
|
ItemRegistry.register();
|
||||||
BlockRegistry.register();
|
BlockRegistry.register();
|
||||||
|
|
|
@ -23,12 +23,15 @@ import net.minecraft.entity.mob.MobEntity;
|
||||||
import net.minecraft.entity.passive.AnimalEntity;
|
import net.minecraft.entity.passive.AnimalEntity;
|
||||||
import net.minecraft.entity.passive.PassiveEntity;
|
import net.minecraft.entity.passive.PassiveEntity;
|
||||||
import net.minecraft.server.world.ServerWorld;
|
import net.minecraft.server.world.ServerWorld;
|
||||||
|
import net.minecraft.sound.SoundEvent;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.WorldView;
|
import net.minecraft.world.WorldView;
|
||||||
import ru.betterend.registry.EntityRegistry;
|
import ru.betterend.registry.EntityRegistry;
|
||||||
|
import ru.betterend.registry.SoundRegistry;
|
||||||
import ru.betterend.util.BlocksHelper;
|
import ru.betterend.util.BlocksHelper;
|
||||||
|
import ru.betterend.util.MHelper;
|
||||||
|
|
||||||
public class EntityDragonfly extends AnimalEntity implements Flutterer {
|
public class EntityDragonfly extends AnimalEntity implements Flutterer {
|
||||||
public EntityDragonfly(EntityType<EntityDragonfly> entityType, World world) {
|
public EntityDragonfly(EntityType<EntityDragonfly> entityType, World world) {
|
||||||
|
@ -104,6 +107,16 @@ public class EntityDragonfly extends AnimalEntity implements Flutterer {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SoundEvent getAmbientSound() {
|
||||||
|
return SoundRegistry.ENTITY_DRAGONFLY;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected float getSoundVolume() {
|
||||||
|
return MHelper.randRange(0.25F, 0.5F, random);
|
||||||
|
}
|
||||||
|
|
||||||
class DragonflyLookControl extends LookControl {
|
class DragonflyLookControl extends LookControl {
|
||||||
DragonflyLookControl(MobEntity entity) {
|
DragonflyLookControl(MobEntity entity) {
|
||||||
super(entity);
|
super(entity);
|
||||||
|
|
|
@ -4,25 +4,22 @@ import net.minecraft.sound.SoundEvent;
|
||||||
import net.minecraft.util.registry.Registry;
|
import net.minecraft.util.registry.Registry;
|
||||||
import ru.betterend.BetterEnd;
|
import ru.betterend.BetterEnd;
|
||||||
|
|
||||||
public class SoundsRegistry
|
public class SoundRegistry
|
||||||
{
|
{
|
||||||
// Music
|
// Music
|
||||||
public static final SoundEvent MUSIC_FOGGY_MUSHROOMLAND = registerMusic("foggy_mushroomland");
|
public static final SoundEvent MUSIC_FOGGY_MUSHROOMLAND = register("music", "foggy_mushroomland");
|
||||||
|
|
||||||
// Ambient
|
// Ambient
|
||||||
public static final SoundEvent AMBIENT_FOGGY_MUSHROOMLAND = registerAmbient("foggy_mushroomland");
|
public static final SoundEvent AMBIENT_FOGGY_MUSHROOMLAND = register("ambient", "foggy_mushroomland");
|
||||||
|
|
||||||
|
// Entity
|
||||||
|
public static final SoundEvent ENTITY_DRAGONFLY = register("entity", "dragonfly");
|
||||||
|
|
||||||
public static void register() {}
|
public static void register() {}
|
||||||
|
|
||||||
private static SoundEvent registerMusic(String id)
|
private static SoundEvent register(String type, String id)
|
||||||
{
|
{
|
||||||
id = "betterend.music." + id;
|
id = "betterend." + type + "." + id;
|
||||||
return Registry.register(Registry.SOUND_EVENT, id, new SoundEvent(BetterEnd.makeID(id)));
|
|
||||||
}
|
|
||||||
|
|
||||||
private static SoundEvent registerAmbient(String id)
|
|
||||||
{
|
|
||||||
id = "betterend.ambient." + id;
|
|
||||||
return Registry.register(Registry.SOUND_EVENT, id, new SoundEvent(BetterEnd.makeID(id)));
|
return Registry.register(Registry.SOUND_EVENT, id, new SoundEvent(BetterEnd.makeID(id)));
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -4,7 +4,7 @@ import ru.betterend.registry.BlockRegistry;
|
||||||
import ru.betterend.registry.EntityRegistry;
|
import ru.betterend.registry.EntityRegistry;
|
||||||
import ru.betterend.registry.FeatureRegistry;
|
import ru.betterend.registry.FeatureRegistry;
|
||||||
import ru.betterend.registry.ParticleRegistry;
|
import ru.betterend.registry.ParticleRegistry;
|
||||||
import ru.betterend.registry.SoundsRegistry;
|
import ru.betterend.registry.SoundRegistry;
|
||||||
|
|
||||||
public class BiomeFoggyMushroomland extends EndBiome {
|
public class BiomeFoggyMushroomland extends EndBiome {
|
||||||
public BiomeFoggyMushroomland() {
|
public BiomeFoggyMushroomland() {
|
||||||
|
@ -15,8 +15,8 @@ public class BiomeFoggyMushroomland extends EndBiome {
|
||||||
.setWaterFogColor(119, 227, 250)
|
.setWaterFogColor(119, 227, 250)
|
||||||
.setSurface(BlockRegistry.END_MOSS, BlockRegistry.END_MYCELIUM)
|
.setSurface(BlockRegistry.END_MOSS, BlockRegistry.END_MYCELIUM)
|
||||||
.setParticles(ParticleRegistry.GLOWING_SPHERE, 0.001F)
|
.setParticles(ParticleRegistry.GLOWING_SPHERE, 0.001F)
|
||||||
.setLoop(SoundsRegistry.AMBIENT_FOGGY_MUSHROOMLAND)
|
.setLoop(SoundRegistry.AMBIENT_FOGGY_MUSHROOMLAND)
|
||||||
.setMusic(SoundsRegistry.MUSIC_FOGGY_MUSHROOMLAND)
|
.setMusic(SoundRegistry.MUSIC_FOGGY_MUSHROOMLAND)
|
||||||
.addFeature(FeatureRegistry.ENDER_ORE)
|
.addFeature(FeatureRegistry.ENDER_ORE)
|
||||||
.addFeature(FeatureRegistry.END_LAKE)
|
.addFeature(FeatureRegistry.END_LAKE)
|
||||||
.addFeature(FeatureRegistry.MOSSY_GLOWSHROOM)
|
.addFeature(FeatureRegistry.MOSSY_GLOWSHROOM)
|
||||||
|
|
|
@ -23,5 +23,23 @@
|
||||||
"stream": false
|
"stream": false
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
|
||||||
|
"betterend.entity.dragonfly": {
|
||||||
|
"category": "entity",
|
||||||
|
"sounds": [
|
||||||
|
{
|
||||||
|
"name": "betterend:entity/dragonfly/dragonfly_1",
|
||||||
|
"stream": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "betterend:entity/dragonfly/dragonfly_2",
|
||||||
|
"stream": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "betterend:entity/dragonfly/dragonfly_3",
|
||||||
|
"stream": false
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue