-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: jutsu sounds are now detected by the warden and skulk
- Loading branch information
Showing
10 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/main/java/com/sekwah/narutomod/datagen/NarutoGameEventTagGen.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.sekwah.narutomod.datagen; | ||
|
||
import com.sekwah.narutomod.NarutoMod; | ||
import com.sekwah.narutomod.gameevents.NarutoGameEvents; | ||
import net.minecraft.data.DataGenerator; | ||
import net.minecraft.data.tags.GameEventTagsProvider; | ||
import net.minecraft.tags.GameEventTags; | ||
import net.minecraft.world.level.gameevent.GameEvent; | ||
import net.minecraftforge.common.data.ExistingFileHelper; | ||
|
||
public class NarutoGameEventTagGen extends GameEventTagsProvider { | ||
public NarutoGameEventTagGen(DataGenerator p_176826_, ExistingFileHelper existingFileHelper) { | ||
super(p_176826_, NarutoMod.MOD_ID, existingFileHelper); | ||
} | ||
|
||
private void soundDetected(GameEvent event) { | ||
this.tag(GameEventTags.WARDEN_CAN_LISTEN).add(event); | ||
this.tag(GameEventTags.VIBRATIONS).add(event); | ||
this.tag(GameEventTags.SHRIEKER_CAN_LISTEN).add(event); | ||
} | ||
|
||
protected void addTags() { | ||
soundDetected(NarutoGameEvents.JUTSU_CASTING.get()); | ||
soundDetected(NarutoGameEvents.DOUBLE_JUMP.get()); | ||
soundDetected(NarutoGameEvents.LEAP.get()); | ||
} | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/com/sekwah/narutomod/gameevents/NarutoGameEvents.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.sekwah.narutomod.gameevents; | ||
|
||
import net.minecraft.core.Registry; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.level.gameevent.GameEvent; | ||
import net.minecraftforge.eventbus.api.IEventBus; | ||
import net.minecraftforge.registries.DeferredRegister; | ||
import net.minecraftforge.registries.RegistryObject; | ||
|
||
import static com.sekwah.narutomod.NarutoMod.MOD_ID; | ||
|
||
public class NarutoGameEvents { | ||
|
||
public static final DeferredRegister<GameEvent> GAME_EVENTS = DeferredRegister.create(Registry.GAME_EVENT_REGISTRY, MOD_ID); | ||
|
||
public static final RegistryObject<GameEvent> JUTSU_CASTING = GAME_EVENTS.register("jutsu_casting", () -> wardenAlert("jutsu_casting")); | ||
|
||
public static final RegistryObject<GameEvent> LEAP = GAME_EVENTS.register("leap", () -> wardenAlert("leap")); | ||
|
||
public static final RegistryObject<GameEvent> DOUBLE_JUMP = GAME_EVENTS.register("double_jump", () -> wardenAlert("double_jump")); | ||
|
||
public static GameEvent wardenAlert(String name) { | ||
return new GameEvent(name, 16); | ||
} | ||
|
||
|
||
public static void register(IEventBus eventBus) { | ||
GAME_EVENTS.register(eventBus); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters