Skip to content

Commit

Permalink
Updating OwO
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkKronicle committed Nov 2, 2021
1 parent 9296ba0 commit e1bc0f7
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies {
modImplementation "fi.dy.masa.malilib:malilib-fabric-1.17.1:${project.malilib_version}"
modImplementation "com.github.DarkKronicle:AdvancedChatCore:${project.advancedchat_version}"

implementation "com.github.maowcraft:owo:${project.owo_version}"
implementation "io.github.maowimpl:owo:${project.owo_version}"
include "com.github.maowcraft:owo:${project.owo_version}"

implementation 'org.openjdk.nashorn:nashorn-core:15.3'
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ org.gradle.jvmargs=-Xmx1G --add-exports jdk.compiler/com.sun.tools.javac.api=ALL
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
advancedchat_version=1.1.0-beta1
owo_version=master-SNAPSHOT
owo_version=2.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package io.github.darkkronicle.advancedchatfilters.config.gui;

import fi.dy.masa.malilib.gui.GuiTextFieldGeneric;
import fi.dy.masa.malilib.gui.widgets.WidgetDropDownList;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.sound.SoundManager;

public class WidgetSoundButton extends GuiTextFieldGeneric {

public WidgetSoundButton(int x, int y, int width, int height, TextRenderer textRenderer) {
super(x, y, width, height, textRenderer);
MinecraftClient.getInstance().getSoundManager().get
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
*/
package io.github.darkkronicle.advancedchatfilters.filters.matchreplace;

import dev.maow.owo.api.OwO;
import dev.maow.owo.api.OwOProvider;
import dev.maow.owo.util.OwOFactory;
import io.github.darkkronicle.advancedchatcore.util.FindType;
import io.github.darkkronicle.advancedchatcore.util.FluidText;
import io.github.darkkronicle.advancedchatcore.util.RawText;
Expand All @@ -18,15 +21,19 @@
import java.util.HashMap;
import java.util.List;
import java.util.Optional;
import maow.owo.OwO;
import maow.owo.util.ParsingUtil;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.text.Style;

@Environment(EnvType.CLIENT)
public class OwOTextReplace implements IMatchReplace {

private final OwO owo;

public OwOTextReplace() {
this.owo = OwOFactory.INSTANCE.create();
}

@Override
public Optional<FluidText> filter(ReplaceFilter filter, FluidText text, SearchResult search) {
HashMap<StringMatch, FluidText.StringInsert> replaceMatches = new HashMap<>();
Expand All @@ -47,17 +54,10 @@ public Optional<FluidText> filter(ReplaceFilter filter, FluidText text, SearchRe
m,
(current, match1) ->
new FluidText(
current.withMessage(OwO.INSTANCE.translate(match1.match))));
current.withMessage(owo.translate(OwO.TranslateMode.PLAIN, match1.match))));
}
}
text.replaceStrings(replaceMatches);
text.append(
new RawText(
" "
+ ParsingUtil.parseRandomizedLetters(
ParsingUtil.getRandomElement(OwO.INSTANCE.getSuffixes())),
Style.EMPTY),
true);
return Optional.of(text);
}
}

0 comments on commit e1bc0f7

Please sign in to comment.