diff --git a/src/main/java/org/arsparadox/mobtalkerredux/CustomItem.java b/src/main/java/org/arsparadox/mobtalkerredux/CustomItem.java new file mode 100644 index 0000000..d30118c --- /dev/null +++ b/src/main/java/org/arsparadox/mobtalkerredux/CustomItem.java @@ -0,0 +1,35 @@ +package org.arsparadox.mobtalkerredux; + +import net.minecraft.network.chat.Component; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; +import net.minecraft.world.level.Level; + +import javax.annotation.Nullable; +import java.util.List; + +public class CustomItem extends Item { + // No Like, Literally Custom Item + + public CustomItem(Properties properties) { + super(properties); + } + + @Override + public Component getName(ItemStack stack) { + if (stack.hasTag() && stack.getTag().contains("CustomName")) { + return Component.translatable(stack.getTag().getString("CustomName")); + } + return super.getName(stack); + } + + // Override texture retrieval + @Override + public void appendHoverText(ItemStack stack, @Nullable Level level, List tooltip, TooltipFlag flag) { + if (stack.hasTag() && stack.getTag().contains("TextureKey")) { + tooltip.add(Component.translatable("Texture: " + stack.getTag().getString("TextureKey"))); + } + super.appendHoverText(stack, level, tooltip, flag); + } +} diff --git a/src/main/java/org/arsparadox/mobtalkerredux/DemoCommand.java b/src/main/java/org/arsparadox/mobtalkerredux/DemoCommand.java index d0bac1a..4b88c90 100644 --- a/src/main/java/org/arsparadox/mobtalkerredux/DemoCommand.java +++ b/src/main/java/org/arsparadox/mobtalkerredux/DemoCommand.java @@ -36,7 +36,7 @@ public static void register(CommandDispatcher dispatcher) { } private static void serverSideExecute(ServerPlayer player, String scriptFileName) { - String uid = player.getName().toString(); + String uid = player.getName().getString(); PlayerInventoryHandler inventory = new PlayerInventoryHandler(player); boolean day = player.level().isDay(); try { diff --git a/src/main/java/org/arsparadox/mobtalkerredux/MobTalkerItem.java b/src/main/java/org/arsparadox/mobtalkerredux/MobTalkerItem.java index 47b7b12..ec73067 100644 --- a/src/main/java/org/arsparadox/mobtalkerredux/MobTalkerItem.java +++ b/src/main/java/org/arsparadox/mobtalkerredux/MobTalkerItem.java @@ -32,7 +32,6 @@ public InteractionResult interactLivingEntity(ItemStack stack, Player player, Li // Check if the entity has a custom name if (target.getCustomName() != null) { String entityName = target.getCustomName().getString(); - boolean day = world.isDay(); if (!world.isClientSide()) { // Only run on the server side diff --git a/src/main/java/org/arsparadox/mobtalkerredux/vn/controller/VisualNovelEngine.java b/src/main/java/org/arsparadox/mobtalkerredux/vn/controller/VisualNovelEngine.java index 4341f38..fd6dca0 100644 --- a/src/main/java/org/arsparadox/mobtalkerredux/vn/controller/VisualNovelEngine.java +++ b/src/main/java/org/arsparadox/mobtalkerredux/vn/controller/VisualNovelEngine.java @@ -65,9 +65,11 @@ private void processAction(Map action) { removeSprite((String) action.get("sprite"), this); return; case "dialogue": + String sound = (String) action.get("voice"); updateDialogue( (String) action.get("label"), (String) action.get("content"), + (String) action.get("voice"), this); return; case "modify_variable": @@ -120,6 +122,15 @@ private void processAction(Map action) { this.variables.put("unlocked_events", events); this.currentState.incrementAndGet(); break; + case "play_sound": + updateSound(this, (String) action.get("sound")); + case "play_music": + if(action.get("music")!=null){ + updateMusic(this, (String) action.get("music")); + }else{ + stopMusic(this); + } + case "next": processNext(action,this); this.currentState.incrementAndGet(); diff --git a/src/main/java/org/arsparadox/mobtalkerredux/vn/controller/vnmodules/SoundHandler.java b/src/main/java/org/arsparadox/mobtalkerredux/vn/controller/vnmodules/SoundHandler.java new file mode 100644 index 0000000..b5ee1ee --- /dev/null +++ b/src/main/java/org/arsparadox/mobtalkerredux/vn/controller/vnmodules/SoundHandler.java @@ -0,0 +1,4 @@ +package org.arsparadox.mobtalkerredux.vn.controller.vnmodules; + +public class SoundHandler { +} diff --git a/src/main/java/org/arsparadox/mobtalkerredux/vn/controller/vnmodules/StateHandler.java b/src/main/java/org/arsparadox/mobtalkerredux/vn/controller/vnmodules/StateHandler.java index 8a9de8f..7616c6a 100644 --- a/src/main/java/org/arsparadox/mobtalkerredux/vn/controller/vnmodules/StateHandler.java +++ b/src/main/java/org/arsparadox/mobtalkerredux/vn/controller/vnmodules/StateHandler.java @@ -26,10 +26,13 @@ public static Map getDictById(long targetId, List sprites = new ArrayList<>(); private List> choices; @@ -62,4 +64,18 @@ public String getCommand(){ public void setCommand(String action) { this.command = action; } + + public String getMusic(){return this.music;} + + public void setMusic(String music) { + this.music = music; + } + + public String getSound() { + return sound; + } + + public void setSound(String sound) { + this.sound = sound; + } } diff --git a/src/main/java/org/arsparadox/mobtalkerredux/vn/view/DialogueScreen.java b/src/main/java/org/arsparadox/mobtalkerredux/vn/view/DialogueScreen.java index 52f1f5b..9cb1300 100644 --- a/src/main/java/org/arsparadox/mobtalkerredux/vn/view/DialogueScreen.java +++ b/src/main/java/org/arsparadox/mobtalkerredux/vn/view/DialogueScreen.java @@ -33,6 +33,9 @@ public class DialogueScreen extends Screen{ private String background; private String command; + private String music; + private String sound; + private SoundUtils se; @@ -40,6 +43,8 @@ public class DialogueScreen extends Screen{ public DialogueScreen(VisualNovelEngine vn) throws FileNotFoundException { super(Component.empty()); this.vn = vn; + this.se = new SoundUtils(); + TextureLoader.loadTexturesFromConfig(); //this.player = player; //dialogueBox = new DialogueBoxComponent(); @@ -62,6 +67,46 @@ public void update(){ // if(player.server.isSingleplayer()){ // //ForgeCommandRunner.runCommand(player.server,command); // } + + if(state.getSound()!=null){ + if(!state.getSound().equals(sound)){ + sound = state.getSound(); + playSound(sound); + System.out.println("Current Sound: "+state.getSound()); + } + } + if(state.getMusic()!=null){ + if(!state.getMusic().equals(music)){ + music = state.getMusic(); + playMusic(music); + System.out.println("Current Music: "+music); + } + }else{ + playMusic(music); + music = state.getMusic(); + } + + + } + + public void playMusic(String music){ + if(music!=null){ + ResourceLocation musicPath = new ResourceLocation("mobtalkerredux","music."+music); + se.playMusic(musicPath); + System.out.println("Playing: "+music); + }else{ + se.stopMusic(); + } + + } + public void playSound(String sound){ + if(sound!=null){ + ResourceLocation soundPath = new ResourceLocation("mobtalkerredux","sound."+sound); + se.playSound(soundPath); + System.out.println("Playing: "+sound); + }else{ + se.stopSound(); + } } public void updateSprites(DialogueState state){ diff --git a/src/main/java/org/arsparadox/mobtalkerredux/vn/view/SoundUtils.java b/src/main/java/org/arsparadox/mobtalkerredux/vn/view/SoundUtils.java new file mode 100644 index 0000000..6d2150a --- /dev/null +++ b/src/main/java/org/arsparadox/mobtalkerredux/vn/view/SoundUtils.java @@ -0,0 +1,118 @@ +package org.arsparadox.mobtalkerredux.vn.view; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.sounds.SimpleSoundInstance; +import net.minecraft.client.resources.sounds.SoundInstance; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.sounds.SoundSource; + +public class SoundUtils { + + private SimpleSoundInstance currentMusic = null; + private SimpleSoundInstance currentSound = null; + + /** + * Plays a sound effect once at full volume + * Stops any currently playing sound effect + * @param sound The ResourceLocation of the sound to play + */ + public void playSound(ResourceLocation sound) { + if (currentSound != null) { + Minecraft.getInstance().getSoundManager().stop(currentSound); + } + currentSound = SimpleSoundInstance.forUI( + net.minecraft.sounds.SoundEvent.createVariableRangeEvent(sound), + 1.0F, // Pitch + 1.5F // Volume + ); + Minecraft.getInstance().getSoundManager().play(currentSound); + } + + /** + * Plays a sound effect with custom volume and pitch + * Stops any currently playing sound effect + * @param sound The ResourceLocation of the sound to play + * @param volume Volume from 0.0 to 1.0 + * @param pitch Pitch from 0.5 to 2.0 + */ + public void playSound(ResourceLocation sound, float volume, float pitch) { + if (currentSound != null) { + Minecraft.getInstance().getSoundManager().stop(currentSound); + } + currentSound = SimpleSoundInstance.forUI( + net.minecraft.sounds.SoundEvent.createVariableRangeEvent(sound), + volume, + pitch + ); + Minecraft.getInstance().getSoundManager().play(currentSound); + } + + /** + * Plays music that will loop continuously + * Automatically stops any currently playing music + * @param music The ResourceLocation of the music to play + */ + public void playMusic(ResourceLocation music) { + stopMusic(); + currentMusic = new SimpleSoundInstance( + music, + SoundSource.MUSIC, + 1.0F, // Volume + 1.0F, // Pitch + SoundInstance.createUnseededRandom(), + true, // Loop + 0, // Delay + SoundInstance.Attenuation.NONE, + 0.0D, // x + 0.0D, // y + 0.0D, // z + true // Relative + ); + Minecraft.getInstance().getSoundManager().play(currentMusic); + } + + /** + * Plays music with custom volume that will loop continuously + * Automatically stops any currently playing music + * @param music The ResourceLocation of the music to play + * @param volume Volume from 0.0 to 1.0 + */ + public void playMusic(ResourceLocation music, float volume) { + stopMusic(); + currentMusic = new SimpleSoundInstance( + music, + SoundSource.MUSIC, + volume, + 1.0F, + SoundInstance.createUnseededRandom(), + true, + 0, + SoundInstance.Attenuation.NONE, + 0.0D, + 0.0D, + 0.0D, + true + ); + Minecraft.getInstance().getSoundManager().play(currentMusic); + } + + /** + * Stops any currently playing music + */ + public void stopMusic() { + if (currentMusic != null) { + Minecraft.getInstance().getSoundManager().stop(currentMusic); + currentMusic = null; + } + } + + /** + * Stops any currently playing sound effect + */ + public void stopSound() { + if (currentSound != null) { + Minecraft.getInstance().getSoundManager().stop(currentSound); + currentSound = null; + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/mobtalkerredux/demo.json b/src/main/resources/assets/mobtalkerredux/demo.json index f23f8ef..75794e6 100644 --- a/src/main/resources/assets/mobtalkerredux/demo.json +++ b/src/main/resources/assets/mobtalkerredux/demo.json @@ -1,8 +1,9 @@ [ { "type": "meta", - "action": "initialize", - "scriptName": "demo", + "action": "create_var", + "var": "background", + "init": false, "id": 0 }, { @@ -16,106 +17,6 @@ "label": "start", "id": 2 }, - { - "type": "conditional", - "action": "conditional", - "condition": "equal", - "var": "background", - "value": true, - "actions": [ - { - "type": "show_sprite", - "action": "show", - "sprite": "andr", - "location": "characters/andr/default/normal.png", - "position": "CENTER", - "wRatio": 16, - "hRatio": 9, - "wFrameRatio": 5, - "hFrameRatio": 8, - "column": 7, - "row": 1, - "id": 4 - }, - { - "type": "dialogue", - "action": "say", - "label": "Andr", - "content": "Ah, wait, let's go back to the void real quick...", - "id": 5 - }, - { - "type": "modify_background", - "background": "asset/end.png", - "id": 6 - } - ], - "id": 3, - "end": 7 - }, - { - "type": "show_sprite", - "action": "show", - "sprite": "andr", - "location": "characters/andr/default/normal.png", - "position": "CENTER", - "wRatio": 16, - "hRatio": 9, - "wFrameRatio": 5, - "hFrameRatio": 8, - "column": 7, - "row": 1, - "id": 4 - }, - { - "type": "dialogue", - "action": "say", - "label": "Andr", - "content": "Ah, wait, let's go back to the void real quick...", - "id": 5 - }, - { - "type": "modify_background", - "background": "asset/end.png", - "id": 6 - }, - { - "type": "conditional", - "action": "conditional", - "condition": "equal", - "var": "seen", - "value": true, - "actions": [ - { - "type": "dialogue", - "action": "say", - "label": "Andr", - "content": "Hello again Player, something you'd like to know?", - "id": 8 - }, - { - "type": "transition", - "action": "jump", - "label": "demo_menu", - "id": 9 - } - ], - "id": 7, - "end": 10 - }, - { - "type": "dialogue", - "action": "say", - "label": "Andr", - "content": "Hello again Player, something you'd like to know?", - "id": 8 - }, - { - "type": "transition", - "action": "jump", - "label": "demo_menu", - "id": 9 - }, { "type": "show_sprite", "action": "show", @@ -124,18 +25,18 @@ "position": "CENTER", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 7, "row": 1, - "id": 10 + "id": 3 }, { "type": "dialogue", "action": "say", "label": "Cupa", "content": "Oh hey Player! Long time no see! Ahaha~", - "id": 11 + "id": 4 }, { "type": "show_sprite", @@ -145,32 +46,32 @@ "position": "CENTER", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 7, "row": 1, - "id": 12 + "id": 5 }, { "type": "dialogue", "action": "say", "label": "Cupa", "content": "Anyway, it's been a while~", - "id": 13 + "id": 6 }, { "type": "dialogue", "action": "say", "label": "Cupa", "content": "When was the last version again?", - "id": 14 + "id": 7 }, { "type": "dialogue", "action": "say", "label": "Cupa", "content": "1.8?? What's the current version?", - "id": 15 + "id": 8 }, { "type": "show_sprite", @@ -180,18 +81,18 @@ "position": "CENTER", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 7, "row": 1, - "id": 16 + "id": 9 }, { "type": "dialogue", "action": "say", "label": "Cupa", "content": "1.21!? I've been dead for that long!?", - "id": 17 + "id": 10 }, { "type": "show_sprite", @@ -201,25 +102,25 @@ "position": "CENTER", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 7, "row": 1, - "id": 18 + "id": 11 }, { "type": "dialogue", "action": "say", "label": "Cupa", "content": "Can't believe this mod's been abandoned for that long!!!", - "id": 19 + "id": 12 }, { "type": "dialogue", "action": "say", "label": "Cupa", "content": "I mean how hard can it be to remake this mod???", - "id": 20 + "id": 13 }, { "type": "show_sprite", @@ -229,18 +130,18 @@ "position": "LEFT", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 10, "row": 1, - "id": 21 + "id": 14 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "It wasn't easy Cupa, recreating this mod requires the use of DSL", - "id": 22 + "id": 15 }, { "type": "show_sprite", @@ -250,18 +151,18 @@ "position": "LEFT", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 3, "row": 1, - "id": 23 + "id": 16 }, { "type": "dialogue", "action": "say", "label": "Cupa", "content": "Bloody hell! Andr, where did you come from?", - "id": 24 + "id": 17 }, { "type": "show_sprite", @@ -271,18 +172,18 @@ "position": "LEFT", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 10, "row": 1, - "id": 25 + "id": 18 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "I was in the Stronghold Perusing the archive for...", - "id": 26 + "id": 19 }, { "type": "show_sprite", @@ -292,25 +193,25 @@ "position": "LEFT", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 3, "row": 1, - "id": 27 + "id": 20 }, { "type": "dialogue", "action": "say", "label": "Cupa", "content": "I was being rhetoric... Anyway, why are you here?", - "id": 28 + "id": 21 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "I'm here to explain how this mod work. The fact that they see this means that they downloaded the framework, but not load a single a script.", - "id": 29 + "id": 22 }, { "type": "show_sprite", @@ -320,24 +221,24 @@ "position": "LEFT", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 3, "row": 1, - "id": 30 + "id": 23 }, { "type": "dialogue", "action": "say", "label": "Cupa", "content": "Ahh... You go do that then~", - "id": 31 + "id": 24 }, { "type": "remove_sprite", "action": "remove_character", "sprite": "cupa", - "id": 32 + "id": 25 }, { "type": "show_sprite", @@ -347,57 +248,63 @@ "position": "CENTER", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 7, "row": 1, - "id": 33 + "id": 26 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Mmm, good to meet you player~", - "id": 34 - }, - { - "type": "modify_variable", - "action": "modify_var", - "var": "seen", - "value": true, - "id": 35 + "id": 27 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Let's go somewhere else more comfortable...", - "id": 36 + "id": 28 }, { "type": "modify_background", "background": "asset/end.png", - "id": 37 + "id": 29 + }, + { + "type": "dialogue", + "action": "say", + "label": "Andr", + "content": "Ah wait, let me check if the music works as intended...", + "id": 30 + }, + { + "type": "play_music", + "action": "play_music", + "music": "revenge", + "id": 31 }, { "type": "modify_variable", "action": "modify_var", "var": "background", "value": true, - "id": 38 + "id": 32 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Now what do you wish to know?", - "id": 39 + "id": 33 }, { "type": "label", "action": "label", "label": "demo_menu", - "id": 40 + "id": 34 }, { "type": "show_sprite", @@ -407,11 +314,11 @@ "position": "CENTER", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 7, "row": 1, - "id": 41 + "id": 35 }, { "type": "choice", @@ -434,13 +341,13 @@ "display": "I like to ask something else" } ], - "id": 42 + "id": 36 }, { "type": "label", "action": "label", "label": "next", - "id": 43 + "id": 37 }, { "type": "choice", @@ -463,13 +370,13 @@ "display": "I like to ask something else" } ], - "id": 44 + "id": 38 }, { "type": "label", "action": "label", "label": "next2", - "id": 45 + "id": 39 }, { "type": "conditional", @@ -499,11 +406,11 @@ "display": "That's all, thanks!" } ], - "id": 47 + "id": 41 } ], - "id": 46, - "end": 48 + "id": 40, + "end": 42 }, { "type": "choice", @@ -526,7 +433,7 @@ "display": "That's all, thanks!" } ], - "id": 47 + "id": 41 }, { "type": "choice", @@ -549,13 +456,13 @@ "display": "That's all, thanks!" } ], - "id": 48 + "id": 42 }, { "type": "label", "action": "label", "label": "void", - "id": 49 + "id": 43 }, { "type": "show_sprite", @@ -565,163 +472,156 @@ "position": "CENTER", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 7, "row": 1, - "id": 50 + "id": 44 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "For Sure!", - "id": 51 + "id": 45 }, { "type": "modify_background", "background": "asset/end.png", - "id": 52 + "id": 46 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "There we go, the void~", - "id": 53 - }, - { - "type": "modify_variable", - "action": "modify_var", - "var": "background", - "value": true, - "id": 54 + "id": 47 }, { "type": "transition", "action": "jump", "label": "demo_menu", - "id": 55 + "id": 48 }, { "type": "label", "action": "label", "label": "background", - "id": 56 + "id": 49 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Oh, no worries, we're not actually in the void", - "id": 57 + "id": 50 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Just showing off what the mod can do!", - "id": 58 + "id": 51 }, { "type": "clear_background", - "id": 59 + "id": 52 }, { "type": "modify_variable", "action": "modify_var", "var": "background", "value": false, - "id": 60 + "id": 53 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "There, all back to normal~", - "id": 61 + "id": 54 }, { "type": "transition", "action": "jump", "label": "demo_menu", - "id": 62 + "id": 55 }, { "type": "label", "action": "label", "label": "bugs", - "id": 63 + "id": 56 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Since this is a framework, some bugs can be not from this mod itself...", - "id": 64 + "id": 57 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Soo, let me list off some known bugs as of right now, ahem...", - "id": 65 + "id": 58 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "1. We don't support multiple character sprite yet", - "id": 66 + "id": 59 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "The dev is working on that currently, most likely this bug is already fixed", - "id": 67 + "id": 60 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "This is the mod's fault, not the SDK's fault, so, report the issue correctly", - "id": 68 + "id": 61 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "2. The images are not displayed correctly", - "id": 69 + "id": 62 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "As of right now, the size of the image are hardcoded to 530 by 900 pixels", - "id": 70 + "id": 63 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "3. There is no way to programatically remove a sprite that's already appeared, only replace", - "id": 71 + "id": 64 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "All of these sprite and image showing issue is being reworked as of writing this", - "id": 72 + "id": 65 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "The dev is looking to solve problem 1 and 2 at the same time right now", - "id": 73 + "id": 66 }, { "type": "show_sprite", @@ -731,18 +631,18 @@ "position": "CENTER", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 7, "row": 1, - "id": 74 + "id": 67 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "See minecraft just updated how they handle Screens and it kinda throw them off...", - "id": 75 + "id": 68 }, { "type": "show_sprite", @@ -752,30 +652,30 @@ "position": "CENTER", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 7, "row": 1, - "id": 76 + "id": 69 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "So yeah, send some love his way alright???", - "id": 77 + "id": 70 }, { "type": "transition", "action": "jump", "label": "demo_menu", - "id": 78 + "id": 71 }, { "type": "label", "action": "label", "label": "about_you", - "id": 79 + "id": 72 }, { "type": "show_sprite", @@ -785,32 +685,32 @@ "position": "CENTER", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 7, "row": 1, - "id": 80 + "id": 73 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "About me... Umm...", - "id": 81 + "id": 74 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "I was a character designed by AT2, a digital artist. Inspired by an Enderman...", - "id": 82 + "id": 75 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "I suppose the dev who remade this mod haven't really asked for AT2's permission to use my character sprite", - "id": 83 + "id": 76 }, { "type": "show_sprite", @@ -820,65 +720,65 @@ "position": "CENTER", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 7, "row": 1, - "id": 84 + "id": 77 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "If you are seeing this, we apologize for using your artwork", - "id": 85 + "id": 78 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "This is in good faith in the spirit and legacy of the original mod", - "id": 86 + "id": 79 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Is there anything else you wish to know?", - "id": 87 + "id": 80 }, { "type": "transition", "action": "jump", "label": "demo_menu", - "id": 88 + "id": 81 }, { "type": "label", "action": "label", "label": "dev_history", - "id": 89 + "id": 82 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Ah... about that...", - "id": 90 + "id": 83 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Please don't blame the original developer for 'abandoning' this project", - "id": 91 + "id": 84 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "The Mob Talker Mod is deceptively complicated due to a simple thing...", - "id": 92 + "id": 85 }, { "type": "show_sprite", @@ -888,11 +788,11 @@ "position": "LEFT", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 3, "row": 1, - "id": 93 + "id": 86 }, { "type": "show_sprite", @@ -906,35 +806,35 @@ "hFrameRatio": 6, "column": 6, "row": 1, - "id": 94 + "id": 87 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "The developer must create a DSL or a Domain Specific Language", - "id": 95 + "id": 88 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "This is what the original Mob Talker Script looks like...", - "id": 96 + "id": 89 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Think about it, you have to translate this script into something that Minecraft can read", - "id": 97 + "id": 90 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "In essence, you're creating an entire Programming Language and a Game Engine", - "id": 98 + "id": 91 }, { "type": "show_sprite", @@ -944,18 +844,18 @@ "position": "CENTER", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 7, "row": 1, - "id": 99 + "id": 92 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Not to mention you have to make the programming language interop with Java and run the Game Engine inside of Minecraft", - "id": 100 + "id": 93 }, { "type": "choice", @@ -970,13 +870,13 @@ "display": "Oh, okay cool, so how did the dev do it?" } ], - "id": 101 + "id": 94 }, { "type": "label", "action": "label", "label": "lua", - "id": 102 + "id": 95 }, { "type": "show_sprite", @@ -986,46 +886,46 @@ "position": "CENTER", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 7, "row": 1, - "id": 103 + "id": 96 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Good Question", - "id": 104 + "id": 97 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Lua seems to be an obvious choice. It is lightweight and many mods rely on it.", - "id": 105 + "id": 98 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Why not write the script in Lua? Define a few methods to control the screen?", - "id": 106 + "id": 99 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "The main problem faced by the dev of *this* mod, is that Lua is an Interpreted Language", - "id": 107 + "id": 100 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Java on the other hand is compiled language", - "id": 108 + "id": 101 }, { "type": "show_sprite", @@ -1035,32 +935,32 @@ "position": "CENTER", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 7, "row": 1, - "id": 109 + "id": 102 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "What happens is that Java will try to run the entire script at once...", - "id": 110 + "id": 103 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Getting Java to interpret lua line by line is extremely hard, you see?", - "id": 111 + "id": 104 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "This is most likely why most people abandoned this project", - "id": 112 + "id": 105 }, { "type": "show_sprite", @@ -1070,58 +970,58 @@ "position": "CENTER", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 7, "row": 1, - "id": 113 + "id": 106 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "An experienced Java Developer would understand how hard it is to get Lua or any scripting language to Interop with Java", - "id": 114 + "id": 107 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "A non experienced Java developer would just get stuck after realizing they need to make a new programming language for this", - "id": 115 + "id": 108 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Because, to recreate this mod properly, you HAVE to make something that a community can use", - "id": 116 + "id": 109 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "A way to create a DSL that is human readable and can be read by java.", - "id": 117 + "id": 110 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "And thus, the developer of this mod, created this", - "id": 118 + "id": 111 }, { "type": "label", "action": "label", "label": "cool", - "id": 119 + "id": 112 }, { "type": "remove_sprite", "action": "remove", "sprite": "old-dsl", - "id": 120 + "id": 113 }, { "type": "show_sprite", @@ -1131,11 +1031,11 @@ "position": "LEFT", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 3, "row": 1, - "id": 121 + "id": 114 }, { "type": "show_sprite", @@ -1149,69 +1049,69 @@ "hFrameRatio": 6, "column": 6, "row": 1, - "id": 122 + "id": 115 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "This is a DSL written in Python.", - "id": 123 + "id": 116 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Instead of getting Lua to interop with Java, the developer sidestepped this problem entirely", - "id": 124 + "id": 117 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "The developer created a Python SDK Framework that translates python-dsl readable script...", - "id": 125 + "id": 118 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Into Json FSM (Finite State Machine)", - "id": 126 + "id": 119 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "This Json FSM is very easy to interpret and read in Java", - "id": 127 + "id": 120 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "All the dev has to do is to make a simple class that can read the Json FSM", - "id": 128 + "id": 121 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Mod creator and players can just put this Json FSM into the mod Config folder.", - "id": 129 + "id": 122 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "And that's a little history of how this mod is created", - "id": 130 + "id": 123 }, { "type": "remove_sprite", "action": "remove", "sprite": "python-dsl", - "id": 131 + "id": 124 }, { "type": "show_sprite", @@ -1221,93 +1121,93 @@ "position": "CENTER", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 7, "row": 1, - "id": 132 + "id": 125 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Is there anything else you wish to know?", - "id": 133 + "id": 126 }, { "type": "transition", "action": "jump", "label": "demo_menu", - "id": 134 + "id": 127 }, { "type": "label", "action": "label", "label": "dev_excuses", - "id": 135 + "id": 128 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "I was contractually obligated to inform you that...", - "id": 136 + "id": 129 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Ahem...", - "id": 137 + "id": 130 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "The developer of this mod, Iteranya, is not responsible with any content written or created in the game", - "id": 138 + "id": 131 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "If there's a person claiming that there's a 'default' or 'official' script for this mod...", - "id": 139 + "id": 132 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "They are lying", - "id": 140 + "id": 133 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "To answer your other question about 'default' script", - "id": 141 + "id": 134 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "The developer is working on it, but they are most likely not going to claim it to be 'official', most likely under pseudonym", - "id": 142 + "id": 135 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "And that's all I can tell you", - "id": 143 + "id": 136 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Is there anything else?", - "id": 144 + "id": 137 }, { "type": "choice", @@ -1322,13 +1222,13 @@ "display": "Yeah, that's all, thank you!" } ], - "id": 145 + "id": 138 }, { "type": "label", "action": "label", "label": "avoid", - "id": 146 + "id": 139 }, { "type": "show_sprite", @@ -1338,209 +1238,209 @@ "position": "CENTER", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 7, "row": 1, - "id": 147 + "id": 140 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "To be frank with you, the dev had no intention on making this mod safe for work", - "id": 148 + "id": 141 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Nor does the dev has any intention on making a PG version script", - "id": 149 + "id": 142 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "In other words, the dev chooses not to make an official script due to legal/ethical/moral issues", - "id": 150 + "id": 143 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Now, let's talk about something else", - "id": 151 + "id": 144 }, { "type": "transition", "action": "jump", "label": "demo_menu", - "id": 152 + "id": 145 }, { "type": "label", "action": "label", "label": "mod_feature", - "id": 153 + "id": 146 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "In a sense, this is 'VN Cutscenes Mod', it empowers mod maker to add 'cutscenes' into their game", - "id": 154 + "id": 147 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "By cutscenes, it's things like what you're seeing right now", - "id": 155 + "id": 148 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Everything in this mod is very barebones, you see? It's made for collaboration", - "id": 156 + "id": 149 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "What you've seen so far is everything it has to offer", - "id": 157 + "id": 150 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Dialogue, Branching Path, Sprite Showing, Background Swapping, etc", - "id": 158 + "id": 151 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "There's really not much to say, you see?", - "id": 159 + "id": 152 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Ah, it also supports minecraft slash commmands", - "id": 160 + "id": 153 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "For more technical details, feel free to check the dev's github page.", - "id": 161 + "id": 154 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "It's attached in where you find this mod", - "id": 162 + "id": 155 }, { "type": "label", "action": "label", "label": "mod_sdk", - "id": 163 + "id": 156 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Making the script is simple.", - "id": 164 + "id": 157 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Well you need to use the Mob Talker SDK to create a script", - "id": 165 + "id": 158 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "https://github.com/Iteranya/MobTalkerSDK", - "id": 166 + "id": 159 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Can you click that link? Probably not...", - "id": 167 + "id": 160 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "But yes, using the SDK, it will turn the human readable script into Json", - "id": 168 + "id": 161 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "More information on how to use the SDK can be found in the github page", - "id": 169 + "id": 162 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "That json will then be sent to the minecraft mod to read. Any question?", - "id": 170 + "id": 163 }, { "type": "transition", "action": "jump", "label": "demo_menu", - "id": 171 + "id": 164 }, { "type": "label", "action": "label", "label": "mod_compatibility", - "id": 172 + "id": 165 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "This mod is surprisingly compatible and easy to maintain.", - "id": 173 + "id": 166 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Due to a lack of Java Interop and separation of concerns... The only 'modded' part is the screen/gui", - "id": 174 + "id": 167 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "The Game Engine that reads the Json FSM is written in Pure Java", - "id": 175 + "id": 168 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "You don't even have to worry about cross-version script compatiblity", - "id": 176 + "id": 169 }, { "type": "show_sprite", @@ -1550,32 +1450,32 @@ "position": "CENTER", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 7, "row": 1, - "id": 177 + "id": 170 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Personally I love this approach, the Mob Talker Mod might become timeless again!", - "id": 178 + "id": 171 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "The CMM team is still active with making cute mob models too!", - "id": 179 + "id": 172 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Imagine this possibilities~", - "id": 180 + "id": 173 }, { "type": "show_sprite", @@ -1585,44 +1485,44 @@ "position": "CENTER", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 7, "row": 1, - "id": 181 + "id": 174 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "But yes, mod creator still have to work on adding script if they wish to use this framework", - "id": 182 + "id": 175 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Do you have anymore questions?", - "id": 183 + "id": 176 }, { "type": "transition", "action": "jump", "label": "demo_menu", - "id": 184 + "id": 177 }, { "type": "label", "action": "label", "label": "community", - "id": 185 + "id": 178 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "There should be a Discord Link in this Mod's download page", - "id": 186 + "id": 179 }, { "type": "show_sprite", @@ -1632,25 +1532,25 @@ "position": "CENTER", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 7, "row": 1, - "id": 187 + "id": 180 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Feel free to make your own script! Make your own character, the Overworld and beyond is your oyster~", - "id": 188 + "id": 181 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "The dev's desire is just to recreate, revive, and immortalize this mod! Adding the beauty of 2D CG Graphics in Minecraft", - "id": 189 + "id": 182 }, { "type": "show_sprite", @@ -1660,18 +1560,18 @@ "position": "CENTER", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 7, "row": 1, - "id": 190 + "id": 183 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "The other desire is to date me and Cupa...", - "id": 191 + "id": 184 }, { "type": "show_sprite", @@ -1681,44 +1581,44 @@ "position": "CENTER", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 7, "row": 1, - "id": 192 + "id": 185 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "But really, at the end of the day, the dev only provide the tools", - "id": 193 + "id": 186 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "So please don't go reporting for bug about the lack of interaction... okay?", - "id": 194 + "id": 187 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Something else you want to ask?", - "id": 195 + "id": 188 }, { "type": "transition", "action": "jump", "label": "demo_menu", - "id": 196 + "id": 189 }, { "type": "label", "action": "label", "label": "end", - "id": 197 + "id": 190 }, { "type": "show_sprite", @@ -1728,22 +1628,22 @@ "position": "CENTER", "wRatio": 16, "hRatio": 9, - "wFrameRatio": 5, + "wFrameRatio": 4, "hFrameRatio": 8, "column": 7, "row": 1, - "id": 198 + "id": 191 }, { "type": "dialogue", "action": "say", "label": "Andr", "content": "Happy to Help, see you later Player!", - "id": 199 + "id": 192 }, { "type": "finish_dialogue", "action": "finish_dialogue", - "id": 200 + "id": 193 } ] \ No newline at end of file diff --git a/src/main/resources/assets/mobtalkerredux/textures/asset/void.png b/src/main/resources/assets/mobtalkerredux/textures/asset/void.png new file mode 100644 index 0000000..3fc98ee Binary files /dev/null and b/src/main/resources/assets/mobtalkerredux/textures/asset/void.png differ diff --git a/src/main/resources/assets/mobtalkerredux/textures/characters/andr/default/angry.png b/src/main/resources/assets/mobtalkerredux/textures/characters/andr/default/angry.png deleted file mode 100644 index 21f2b4f..0000000 Binary files a/src/main/resources/assets/mobtalkerredux/textures/characters/andr/default/angry.png and /dev/null differ diff --git a/src/main/resources/assets/mobtalkerredux/textures/characters/andr/default/happy.png b/src/main/resources/assets/mobtalkerredux/textures/characters/andr/default/happy.png deleted file mode 100644 index 05dce5d..0000000 Binary files a/src/main/resources/assets/mobtalkerredux/textures/characters/andr/default/happy.png and /dev/null differ diff --git a/src/main/resources/assets/mobtalkerredux/textures/characters/andr/default/normal.png b/src/main/resources/assets/mobtalkerredux/textures/characters/andr/default/normal.png deleted file mode 100644 index e2deb8e..0000000 Binary files a/src/main/resources/assets/mobtalkerredux/textures/characters/andr/default/normal.png and /dev/null differ diff --git a/src/main/resources/assets/mobtalkerredux/textures/characters/andr/default/sad.png b/src/main/resources/assets/mobtalkerredux/textures/characters/andr/default/sad.png deleted file mode 100644 index 7c638e4..0000000 Binary files a/src/main/resources/assets/mobtalkerredux/textures/characters/andr/default/sad.png and /dev/null differ diff --git a/src/main/resources/assets/mobtalkerredux/textures/characters/andr/default/scared.png b/src/main/resources/assets/mobtalkerredux/textures/characters/andr/default/scared.png deleted file mode 100644 index 62edfd2..0000000 Binary files a/src/main/resources/assets/mobtalkerredux/textures/characters/andr/default/scared.png and /dev/null differ diff --git a/src/main/resources/assets/mobtalkerredux/textures/characters/andr/default/shy.png b/src/main/resources/assets/mobtalkerredux/textures/characters/andr/default/shy.png deleted file mode 100644 index 985f42c..0000000 Binary files a/src/main/resources/assets/mobtalkerredux/textures/characters/andr/default/shy.png and /dev/null differ diff --git a/src/main/resources/assets/mobtalkerredux/textures/characters/andr/default/tired.png b/src/main/resources/assets/mobtalkerredux/textures/characters/andr/default/tired.png deleted file mode 100644 index bacadf4..0000000 Binary files a/src/main/resources/assets/mobtalkerredux/textures/characters/andr/default/tired.png and /dev/null differ diff --git a/src/main/resources/data/mobtalkerredux/recipes/mob_talker_item.json b/src/main/resources/data/mobtalkerredux/recipes/mob_talker_item.json new file mode 100644 index 0000000..9114594 --- /dev/null +++ b/src/main/resources/data/mobtalkerredux/recipes/mob_talker_item.json @@ -0,0 +1,23 @@ +{ + "type": "minecraft:crafting_shaped", + "pattern": [ + " G ", + " I ", + " S " + ], + "key": { + "I": { + "item": "minecraft:iron_ingot" + }, + "G": { + "item": "minecraft:glowstone" + }, + "S": { + "item": "minecraft:stick" + } + }, + "result": { + "item": "mobtalkerredux:mob_talker_item", + "count": 1 + } +} \ No newline at end of file