Skip to content

Commit 327c205

Browse files
committed
feat: 0.2.2 release
1 parent 6aaae84 commit 327c205

27 files changed

+148
-33
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
# 0.2.2
2+
## Features
3+
- Add music disc 1000年生きてる
4+
- Change sound files from stereo to mono, so that volume change with direction and distance
5+
> I recommend that you watch this artwork by 零悠: [【Neuro-sama/授权搬运】AI少女的存活千年 (Neuro's living millennium)【手书】](https://www.youtube.com/watch?v=yHY05a-N96A)
6+
17
# 0.2.1
28
## Features
9+
- Nearby chicken and frog will ride on Neuro-sama's head
310
- Neuro-sama named "jeb_" or anything that includes "RGB" (case insensitive) will change color
411
- Hiyori named "hiyori" (lower case) will change skin
512
- Add sound effects (the sound effects become annoying when you add too many Neuro-sama in the world)

common/src/main/java/jimenezli/neuro21/ModSoundEvents.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package jimenezli.neuro21;
22

33
import dev.architectury.injectables.annotations.ExpectPlatform;
4+
import jimenezli.neuro21.util.Neuro21DiscType;
45
import jimenezli.neuro21.util.Neuro21SoundType;
56
import net.minecraft.sounds.SoundEvent;
67

@@ -19,4 +20,9 @@ public static SoundEvent getNeurosamaSound(Neuro21SoundType type) {
1920
public static SoundEvent getEvilNeurosamaSound(Neuro21SoundType type) {
2021
throw new AssertionError();
2122
}
23+
24+
@ExpectPlatform
25+
public static SoundEvent getDiscSound(Neuro21DiscType type) {
26+
throw new AssertionError();
27+
}
2228
}

common/src/main/java/jimenezli/neuro21/entity/EvilNeurosamaEntity.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import jimenezli.neuro21.ModSoundEvents;
44
import jimenezli.neuro21.util.Neuro21SoundType;
55
import jimenezli.neuro21.util.NeurosamaType;
6+
import net.minecraft.sounds.SoundEvent;
67
import net.minecraft.world.entity.EntityType;
78
import net.minecraft.world.entity.Mob;
89
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
@@ -16,8 +17,9 @@ public EvilNeurosamaEntity(EntityType<? extends Animal> entityType, Level level)
1617
this.neurosamaType = NeurosamaType.EVIL_NEUROSAMA;
1718
}
1819

19-
public void playAmbientSound() {
20-
this.playSound(ModSoundEvents.getEvilNeurosamaSound(Neuro21SoundType.AMBIENT));
20+
@Override
21+
protected SoundEvent getAmbientSound() {
22+
return ModSoundEvents.getEvilNeurosamaSound(Neuro21SoundType.AMBIENT);
2123
}
2224

2325
@Override

common/src/main/java/jimenezli/neuro21/entity/NeurosamaEntity.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
import net.minecraft.core.BlockPos;
1010
import net.minecraft.nbt.CompoundTag;
1111
import net.minecraft.server.level.ServerLevel;
12+
import net.minecraft.sounds.SoundEvent;
13+
import net.minecraft.sounds.SoundEvents;
1214
import net.minecraft.world.entity.AgeableMob;
1315
import net.minecraft.world.entity.Entity;
1416
import net.minecraft.world.entity.EntityType;
@@ -75,7 +77,7 @@ public void aiStep() {
7577

7678
if (!this.level.isClientSide && this.isAlive() && !this.isBaby()) {
7779
if (--this.heartTime <= 0) {
78-
this.playHeartSound();
80+
this.playSound(this.getHeartSound(), 1.0F, (this.random.nextFloat() - this.random.nextFloat()) * 0.2F + 1.0F);
7981
this.spawnAtLocation(ModItems.getHeartItem());
8082
this.heartTime = this.random.nextInt(6000) + 6000;
8183
}
@@ -91,12 +93,12 @@ public void aiStep() {
9193
}
9294
}
9395

94-
public void playAmbientSound() {
95-
this.playSound(ModSoundEvents.getNeurosamaSound(Neuro21SoundType.AMBIENT));
96+
protected SoundEvent getAmbientSound() {
97+
return ModSoundEvents.getNeurosamaSound(Neuro21SoundType.AMBIENT);
9698
}
9799

98-
public void playHeartSound() {
99-
this.playSound(ModSoundEvents.getNeurosamaSound(Neuro21SoundType.HEART));
100+
protected SoundEvent getHeartSound() {
101+
return ModSoundEvents.getNeurosamaSound(Neuro21SoundType.HEART);
100102
}
101103

102104
public void readAdditionalSaveData(CompoundTag compoundTag) {

common/src/main/java/jimenezli/neuro21/handler/ItemHandler.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,12 @@
33
import dev.architectury.registry.CreativeTabRegistry;
44
import jimenezli.neuro21.ModItems;
55
import jimenezli.neuro21.Neuro21Mod;
6-
import jimenezli.neuro21.item.ChipItem;
7-
import jimenezli.neuro21.item.HeartItem;
8-
import jimenezli.neuro21.item.IronmilkItem;
9-
import jimenezli.neuro21.item.UpgradeChipItem;
6+
import jimenezli.neuro21.item.*;
7+
import jimenezli.neuro21.item.disc.DiscLivingMillenniumItem;
108
import net.minecraft.resources.ResourceLocation;
119
import net.minecraft.world.entity.EntityType;
1210
import net.minecraft.world.entity.Mob;
13-
import net.minecraft.world.item.CreativeModeTab;
14-
import net.minecraft.world.item.Item;
15-
import net.minecraft.world.item.ItemStack;
16-
import net.minecraft.world.item.SpawnEggItem;
11+
import net.minecraft.world.item.*;
1712

1813
import java.util.function.Supplier;
1914

@@ -27,7 +22,7 @@ public static Item.Properties defaultBuilder() {
2722
return new Item.Properties().tab(NEURO21);
2823
}
2924

30-
public static Supplier<SpawnEggItem> spawnEggSupplierBuilder(EntityType<? extends Mob> type, int primaryColor, int secondaryColor) {
25+
public static Supplier<SpawnEggItem> SpawnEggSupplierBuilder(EntityType<? extends Mob> type, int primaryColor, int secondaryColor) {
3126
return () -> new SpawnEggItem(type, primaryColor, secondaryColor, defaultBuilder());
3227
}
3328

@@ -42,4 +37,6 @@ public static Supplier<SpawnEggItem> spawnEggSupplierBuilder(EntityType<? extend
4237

4338
public static final String UPGRADE_CHIP_NAME = "upgrade_chip";
4439
public static final Supplier<UpgradeChipItem> UPGRADE_CHIP_ITEM = UpgradeChipItem::new;
40+
41+
public static final Supplier<RecordItem> DISC_LIVING_MILLENNIUM_ITEM = DiscLivingMillenniumItem::new;
4542
}
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,18 @@
11
package jimenezli.neuro21.handler;
22

3-
import jimenezli.neuro21.Neuro21Mod;
43
import net.minecraft.resources.ResourceLocation;
4+
import net.minecraft.sounds.SoundEvent;
55

66
import static jimenezli.neuro21.Neuro21Mod.prefix;
77

88
public class SoundHandler {
99
public static final ResourceLocation NEUROSAMA_AMBIENT = prefix("neurosama_ambient");
1010
public static final ResourceLocation NEUROSAMA_HEART = prefix("neurosama_heart");
1111
public static final ResourceLocation EVIL_NEUROSAMA_AMBIENT = prefix("evil_neurosama_ambient");
12+
13+
public static final String DISC_LIVING_MILLENNIUM = "living_millennium";
14+
15+
public static ResourceLocation Disc(String discName) {
16+
return prefix("music_disc." + discName);
17+
}
1218
}

common/src/main/java/jimenezli/neuro21/item/ChipItem.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package jimenezli.neuro21.item;
22

33
import jimenezli.neuro21.handler.ItemHandler;
4+
import net.minecraft.ChatFormatting;
45
import net.minecraft.network.chat.Component;
56
import net.minecraft.world.item.Item;
67
import net.minecraft.world.item.ItemStack;
@@ -16,6 +17,6 @@ public ChipItem() {
1617
}
1718

1819
public void appendHoverText(ItemStack itemStack, @Nullable Level level, List<Component> list, TooltipFlag tooltipFlag) {
19-
list.add(Component.translatable("item.neuro21.chip.description"));
20+
list.add(Component.translatable("item.neuro21.chip.desc").withStyle(ChatFormatting.GRAY));
2021
}
2122
}

common/src/main/java/jimenezli/neuro21/item/UpgradeChipItem.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import jimenezli.neuro21.ModEntityTypes;
44
import jimenezli.neuro21.handler.ItemHandler;
5+
import net.minecraft.ChatFormatting;
56
import net.minecraft.network.chat.Component;
67
import net.minecraft.network.chat.contents.TranslatableContents;
78
import net.minecraft.world.InteractionHand;
@@ -49,6 +50,6 @@ public InteractionResult interactLivingEntity(ItemStack itemStack, Player player
4950
}
5051

5152
public void appendHoverText(ItemStack itemStack, @Nullable Level level, List<Component> list, TooltipFlag tooltipFlag) {
52-
list.add(Component.translatable("item.neuro21.upgrade_chip.description"));
53+
list.add(Component.translatable("item.neuro21.upgrade_chip.desc").withStyle(ChatFormatting.GRAY));
5354
}
5455
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package jimenezli.neuro21.item.disc;
2+
3+
import jimenezli.neuro21.ModSoundEvents;
4+
import jimenezli.neuro21.util.Neuro21DiscType;
5+
import net.minecraft.ChatFormatting;
6+
import net.minecraft.network.chat.Component;
7+
import net.minecraft.world.item.ItemStack;
8+
import net.minecraft.world.item.RecordItem;
9+
import net.minecraft.world.item.TooltipFlag;
10+
import net.minecraft.world.level.Level;
11+
import org.jetbrains.annotations.Nullable;
12+
13+
import java.util.List;
14+
15+
import static jimenezli.neuro21.handler.ItemHandler.defaultBuilder;
16+
import static net.minecraft.world.item.Rarity.RARE;
17+
18+
public class DiscLivingMillenniumItem extends RecordItem {
19+
public DiscLivingMillenniumItem() {
20+
super(
21+
0,
22+
ModSoundEvents.getDiscSound(Neuro21DiscType.LIVING_MILLENNIUM),
23+
defaultBuilder().stacksTo(1).rarity(RARE),
24+
188
25+
);
26+
}
27+
28+
public void appendHoverText(ItemStack itemStack, @Nullable Level level, List<Component> list, TooltipFlag tooltipFlag) {
29+
super.appendHoverText(itemStack, level, list, tooltipFlag);
30+
list.add(Component.translatable("item.neuro21.music_disc_living_millennium.desc1").withStyle(ChatFormatting.GRAY));
31+
list.add(Component.translatable("item.neuro21.music_disc_living_millennium.desc2").withStyle(ChatFormatting.GRAY));
32+
}
33+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package jimenezli.neuro21.util;
2+
3+
public enum Neuro21DiscType {
4+
LIVING_MILLENNIUM,
5+
}

0 commit comments

Comments
 (0)