Skip to content

Commit

Permalink
add music and support translations
Browse files Browse the repository at this point in the history
  • Loading branch information
lordIcocain committed Dec 16, 2023
1 parent a4c8be9 commit 2cd0baf
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 23 deletions.
62 changes: 40 additions & 22 deletions src/main/java/com/dreammaster/coremod/RealWinGame.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
package com.dreammaster.coremod;

import static net.minecraft.util.StatCollector.translateToLocal;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

import net.minecraft.client.audio.ISound;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.Tessellator;
Expand Down Expand Up @@ -49,7 +51,7 @@ public class RealWinGame extends GuiScreen {
private int textsize;
private int field_146579_r;
private float field_146578_s = 0.5F;
private ISound currentMusic;
int y = 0;

public RealWinGame() {}

Expand All @@ -70,6 +72,7 @@ protected void keyTyped(char typedChar, int keyCode) {
}

private void func_146574_g() {
this.mc.getSoundHandler().stopSounds();
this.mc.displayGuiScreen((GuiScreen) null);
}

Expand All @@ -95,25 +98,17 @@ public void initGui() {
// this.field_146582_i.add("");
try {
String s = "";
String s01 = "§oThe GTNH administrators, with their unwavering dedication, embody innovation and community spirit in crafting an unparalleled gaming experience. Their commitment to a supportive environment and adept management inspires players on extraordinary journeys within GregTech New Horizons. These administrators shape a modpack that challenges creativity and unites a diverse community, fostering collective achievement and enjoyment.";
String s01 = "";
String s1 = "§l";
String s02 = "§oThe passionate GTNH developers, dedicating their free time to bring a vision to life, exemplify the essence of creative commitment. Their tireless efforts and imaginative ingenuity not only shape the intricate world of GregTech New Horizons but also invite players into an extraordinary realm of limitless possibilities, showcasing the true artistry of their craft.";
String s02 = "";
String s2 = "§l";
String s03 = "§oThe invaluable contributions from the GTNH community reflect a collaborative spirit that elevates the modpack to new heights. These dedicated contributors, through their shared expertise and commitment, weave a tapestry of innovation, turning individual efforts into a collective masterpiece that enriches the gaming experience for all.";
String s03 = "";
String s3 = "";
String s04 = "§oThe generous support of GTNH donators serves as the backbone of a thriving community, enabling the modpack to flourish and evolve. Their contributions not only fuel the development but also stand as a testament to the shared passion that unites players in the pursuit of an extraordinary and continually enriching gaming adventure.";
String s04 = "";
String s4 = "";
String s05 = "§oThe triumph of GTNH players who conquer the pack takes note of their exceptional dedication, strategic brilliance, and unwavering perseverance. Their achievements stand as a testament to the indomitable spirit that transforms the challenging gaming experience of GregTech New Horizons into a remarkable journey of skill and triumph.";
String s05 = "";
String s5 = "";
String cg = "Congratulations on completing GregTech New Horizons (GTNH)! That's a significant achievement, and you've likely invested a considerable amount of time and effort into mastering the complexities of the modpack. Your dedication and problem-solving skills have paid off, and you've conquered the challenges that GTNH presents.\n"
+ "\n"
+ "Now that you've reached the endgame, take a moment to reflect on your journey and the skills you've acquired. Whether you've automated complex processes, built intricate machinery, or explored distant dimensions, you've demonstrated resilience and ingenuity.\n"
+ "\n"
+ "Consider sharing your accomplishments with the gaming community, perhaps by creating a post or video detailing your experiences and strategies. Your insights and expertise may inspire others who are still navigating the challenges of GTNH.\n"
+ "\n"
+ "As you bask in the glory of your success, you might also want to explore other modpacks or challenges within the Minecraft community. There's a vast array of content and experiences waiting for you, and your skills from GTNH will undoubtedly serve you well in new adventures.\n"
+ "\n"
+ "Once again, congratulations on your triumph in GTNH! May your future Minecraft endeavors be just as rewarding and enjoyable.";
String cg = "";
BufferedReader bufferedreader = new BufferedReader(
new InputStreamReader(
this.mc.getResourceManager()
Expand Down Expand Up @@ -160,17 +155,34 @@ public void initGui() {
s5 = s5 + ("§o§d" + this.mc.getSession().getUsername() + " ");
}

this.admindesc.addAll(this.mc.fontRenderer.listFormattedStringToWidth(s01, 320));
this.admindesc.addAll(
this.mc.fontRenderer.listFormattedStringToWidth(translateToLocal("dc.wingame.admindesc"), 320));
this.admin.addAll(this.mc.fontRenderer.listFormattedStringToWidth(s1, 320));
this.devdesc.addAll(this.mc.fontRenderer.listFormattedStringToWidth(s02, 320));
this.devdesc.addAll(
this.mc.fontRenderer.listFormattedStringToWidth(translateToLocal("dc.wingame.devdesc"), 320));
this.dev.addAll(this.mc.fontRenderer.listFormattedStringToWidth(s2, 320));
this.contributordesc.addAll(this.mc.fontRenderer.listFormattedStringToWidth(s03, 320));
this.contributordesc.addAll(
this.mc.fontRenderer
.listFormattedStringToWidth(translateToLocal("dc.wingame.contributordesc"), 320));
this.contributor.addAll(this.mc.fontRenderer.listFormattedStringToWidth(s3, 320));
this.donordesc.addAll(this.mc.fontRenderer.listFormattedStringToWidth(s04, 320));
this.donordesc.addAll(
this.mc.fontRenderer
.listFormattedStringToWidth(translateToLocal("dc.wingame.donatordesc"), 320));
this.donor.addAll(this.mc.fontRenderer.listFormattedStringToWidth(s4, 320));
this.gatedesc.addAll(this.mc.fontRenderer.listFormattedStringToWidth(s05, 320));
this.gatedesc.addAll(
this.mc.fontRenderer.listFormattedStringToWidth(translateToLocal("dc.wingame.gatedesc"), 320));
this.gate.addAll(this.mc.fontRenderer.listFormattedStringToWidth(s5, 320));
this.cg.addAll(this.mc.fontRenderer.listFormattedStringToWidth(cg, 320));
this.cg.addAll(
this.mc.fontRenderer.listFormattedStringToWidth(
(translateToLocal("dc.wingame.gc") + "\n\n"
+ translateToLocal("dc.wingame.gc1")
+ "\n\n"
+ translateToLocal("dc.wingame.gc2")
+ "\n\n"
+ translateToLocal("dc.wingame.gc3")
+ "\n\n"
+ translateToLocal("dc.wingame.gc4")),
320));
} catch (Exception var9) {
logger.error("Couldn't load credits", var9);
}
Expand Down Expand Up @@ -226,6 +238,12 @@ private void func_146575_b(int p_146575_1_, int p_146575_2_, float p_146575_3_)
}

public void drawScreen(int mouseX, int mouseY, float partialTicks) {
if (y == 0) {
mc.getSoundHandler().stopSounds();
mc.getSoundHandler().playSound(
PositionedSoundRecord.func_147673_a(new ResourceLocation("dreamcraft", "credits.wingame")));
y++;
}
this.func_146575_b(mouseX, mouseY, partialTicks);
Tessellator tessellator = Tessellator.instance;
int k = this.width / 2 - 160;
Expand Down
12 changes: 11 additions & 1 deletion src/main/resources/assets/dreamcraft/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -1526,4 +1526,14 @@ tc.research_text.WAYSTONE=[WI] Teleport
Witchery.research_page.WAYSTONE=A waystone is an etched piece of flint that is an important foci for circle magic involving transposition. A waystone can be bound to a specific location using the Rite of Binding described in the book, Witchcraft: Circle Magic.<BR>A bound waystone can also be made by dropping up to eight into a hollow 3x3 circle of Otherwhere runes and waiting.
tc.research_name.RUNEDTABLET=Runed Tablet
tc.research_text.RUNEDTABLET=[NH] Boss...? Yeee is farming time
kosh.research_page.RUNEDTABLET=Your desire get to the boss? DO IT !!!
kosh.research_page.RUNEDTABLET=Your desire get to the boss? DO IT !!!
dc.wingame.admindesc=§oThe GTNH administrators, with their unwavering dedication, embody innovation and community spirit in crafting an unparalleled gaming experience. Their commitment to a supportive environment and adept management inspires players on extraordinary journeys within GregTech New Horizons. These administrators shape a modpack that challenges creativity and unites a diverse community, fostering collective achievement and enjoyment.
dc.wingame.devdesc=§oThe passionate GTNH developers, dedicating their free time to bring a vision to life, exemplify the essence of creative commitment. Their tireless efforts and imaginative ingenuity not only shape the intricate world of GregTech New Horizons but also invite players into an extraordinary realm of limitless possibilities, showcasing the true artistry of their craft.
dc.wingame.contributordesc=§oThe invaluable contributions from the GTNH community reflect a collaborative spirit that elevates the modpack to new heights. These dedicated contributors, through their shared expertise and commitment, weave a tapestry of innovation, turning individual efforts into a collective masterpiece that enriches the gaming experience for all.
dc.wingame.donatordesc=§oThe generous support of GTNH donators serves as the backbone of a thriving community, enabling the modpack to flourish and evolve. Their contributions not only fuel the development but also stand as a testament to the shared passion that unites players in the pursuit of an extraordinary and continually enriching gaming adventure.
dc.wingame.gatedesc=§oThe triumph of GTNH players who conquer the pack takes note of their exceptional dedication, strategic brilliance, and unwavering perseverance. Their achievements stand as a testament to the indomitable spirit that transforms the challenging gaming experience of GregTech New Horizons into a remarkable journey of skill and triumph.
dc.wingame.gc=Congratulations on completing GregTech New Horizons (GTNH)! That's a significant achievement, and you've likely invested a considerable amount of time and effort into mastering the complexities of the modpack. Your dedication and problem-solving skills have paid off, and you've conquered the challenges that GTNH presents.
dc.wingame.gc1=Now that you've reached the endgame, take a moment to reflect on your journey and the skills you've acquired. Whether you've automated complex processes, built intricate machinery, or explored distant dimensions, you've demonstrated resilience and ingenuity.
dc.wingame.gc2=Consider sharing your accomplishments with the gaming community, perhaps by creating a post or video detailing your experiences and strategies. Your insights and expertise may inspire others who are still navigating the challenges of GTNH.
dc.wingame.gc3=As you bask in the glory of your success, you might also want to explore other modpacks or challenges within the Minecraft community. There's a vast array of content and experiences waiting for you, and your skills from GTNH will undoubtedly serve you well in new adventures.
dc.wingame.gc4=Once again, congratulations on your triumph in GTNH! May your future Minecraft endeavors be just as rewarding and enjoyable.
11 changes: 11 additions & 0 deletions src/main/resources/assets/dreamcraft/sounds.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"credits.wingame": {
"category": "block",
"sounds": [
{
"name": "WinGame",
"stream": false
}
]
}
}
Binary file not shown.

0 comments on commit 2cd0baf

Please sign in to comment.