Skip to content

Commit

Permalink
new disc? and seacow fix
Browse files Browse the repository at this point in the history
  • Loading branch information
N1nn1 committed Apr 26, 2024
1 parent 39a5d97 commit 75e167d
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 11 deletions.
19 changes: 10 additions & 9 deletions src/main/java/com/ninni/spawn/entity/SeaCow.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,7 @@ public void ate() {
}

public void feed(ItemStack food, Player player) {
int amount = 0;

if (food.is(SpawnTags.SEA_COW_LIKES)) amount = 1;
else if (food.is(SpawnTags.SEA_COW_LOVES)) amount = 5;

player.playSound(food.getEatingSound(), 1.0f, 1.0f);

if (this.level() instanceof ServerLevel serverLevel && !food.isEmpty()) {
if (this.level() instanceof ServerLevel serverLevel && ((player.isCreative()) || (food.getCount() != 1 && !player.isCreative()))) {
serverLevel.sendParticles(
new ItemParticleOption(ParticleTypes.ITEM, food),
this.getHeadPos(false, 0).x,
Expand All @@ -209,7 +202,15 @@ public void feed(ItemStack food, Player player) {
this.getBbWidth() / 4.0f,
0.05);
}
this.addMunchingCooldown(20);

int amount = 0;

if (food.is(SpawnTags.SEA_COW_LIKES)) amount = 1;
else if (food.is(SpawnTags.SEA_COW_LOVES)) amount = 5;

player.playSound(food.getEatingSound(), 1.0f, 1.0f);

this.addMunchingCooldown(10);
this.setFullness(this.getFullness() + amount);

food.shrink(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class SpawnCreativeModeTab {
entries.addAfter(Items.AXOLOTL_BUCKET, KRILL_SWARM_BUCKET);
entries.addAfter(Items.MILK_BUCKET, CAPTURED_OCTOPUS, CLAM, ANT_PUPA);
entries.addAfter(Items.FISHING_ROD, CLAM_CASE);
entries.addAfter(Items.MUSIC_DISC_RELIC, MUSIC_DISC_ROT);
entries.addAfter(Items.MUSIC_DISC_RELIC, MUSIC_DISC_ROT, MUSIC_DISC_BLINK);
});

ItemGroupEvents.modifyEntriesEvent(CreativeModeTabs.REDSTONE_BLOCKS).register(entries -> {
Expand Down Expand Up @@ -176,6 +176,7 @@ public class SpawnCreativeModeTab {

//Seagrass meadows
output.accept(ALGAL_SAND);
output.accept(MUSIC_DISC_BLINK);

// sea cow
output.accept(SEA_COW_SPAWN_EGG);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/com/ninni/spawn/registry/SpawnItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ public class SpawnItems {
public static final Item SPADE_POTTERY_SHERD = register("spade_pottery_sherd", new Item(new Item.Properties()));

public static final Item ALGAL_SAND = register("algal_sand", new BlockItem(SpawnBlocks.ALGAL_SAND, new FabricItemSettings()));
public static final Item MUSIC_DISC_BLINK = register("music_disc_blink", new RecordItem(8, SpawnSoundEvents.MUSIC_DISC_BLINK, new Item.Properties().stacksTo(1).rarity(Rarity.RARE), 117));

// clam
public static final Item SHELL_FRAGMENTS = register("shell_fragments", new Item(new FabricItemSettings()));
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/ninni/spawn/registry/SpawnSoundEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ public interface SpawnSoundEvents {
//Whale
//Whale blocks

SoundEvent MUSIC_DISC_BLINK = register("music_disc.blink");

SoundEvent GOAT_HORN_OCTOPUS = register("item.goat_horn.octopus");

SoundType MUCUS = register("mucus", 1, 1);
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/spawn/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@

"block.spawn.algal_sand": "Algal Sand",
"block.spawn.trimmed_seagrass": "Trimmed Seagrass",
"item.spawn.music_disc_blink": "Music Disc",
"item.spawn.music_disc_blink.desc": "Ninni - blink",

"entity.spawn.clam": "Clam",
"item.spawn.clam_spawn_egg": "Clam Spawn Egg",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "spawn:item/music_disc_blink"
}
}
8 changes: 8 additions & 0 deletions src/main/resources/assets/spawn/sounds.json
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,14 @@
],
"subtitle": "subtitles.block.generic.footsteps"
},
"music_disc.blink": {
"sounds": [
{
"name": "spawn:records/music_disc_blink",
"stream": true
}
]
},
"item.goat_horn.octopus": {
"sounds": [
"spawn:item/goat_horn/octopus1",
Expand Down
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"replace": false,
"values": [
"spawn:music_disc_rot"
"spawn:music_disc_rot",
"spawn:music_disc_blink"
]
}

0 comments on commit 75e167d

Please sign in to comment.