-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to 1.20.5, made "click to copy" hint to be translatable
- Loading branch information
Showing
9 changed files
with
38 additions
and
33 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
17 changes: 7 additions & 10 deletions
17
src/main/java/me/syberiak/colorful_hex/mixin/WrittenBookScreenMixin.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 |
---|---|---|
@@ -1,21 +1,18 @@ | ||
package me.syberiak.colorful_hex.mixin; | ||
|
||
import net.minecraft.text.Text; | ||
import net.minecraft.text.StringVisitable; | ||
import net.minecraft.text.MutableText; | ||
import net.minecraft.client.gui.screen.ingame.BookScreen; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.ModifyVariable; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
|
||
import me.syberiak.colorful_hex.ColorfulHEX; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
@Mixin(BookScreen.WrittenBookContents.class) | ||
@Mixin(BookScreen.Contents.class) | ||
public class WrittenBookScreenMixin { | ||
@SuppressWarnings("InvalidInjectorMethodSignature") | ||
@ModifyVariable(method = "getPageUnchecked(I)Lnet/minecraft/text/StringVisitable;", at = @At("STORE"), ordinal = 0) | ||
private StringVisitable injected(StringVisitable stringVisitable) { | ||
if (!(stringVisitable instanceof Text text)) return stringVisitable; | ||
|
||
return ColorfulHEX.formatHexColors(text); | ||
@Inject(method = "getPage(I)Lnet/minecraft/text/StringVisitable;", at = @At("RETURN"), cancellable = true) | ||
private void modifyPageContent(CallbackInfoReturnable<MutableText> cir) { | ||
cir.setReturnValue(ColorfulHEX.formatHexColors(cir.getReturnValue())); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
{ | ||
"modmenu.summaryTranslation.colorful_hex": "Makes HEX color tags in chat useful.", | ||
"modmenu.descriptionTranslation.colorful_hex": "Makes HEX color tags in chat useful.\nYou can see what color is represented by HEX code and copy it to clipboard in one click.\n[WORKS ON CLIENT-SIDE ONLY]" | ||
"modmenu.descriptionTranslation.colorful_hex": "Makes HEX color tags in chat useful.\nYou can see what color is represented by HEX code and copy it to clipboard in one click.\n[WORKS ON CLIENT-SIDE ONLY]", | ||
"colorful_hex.click_to_copy": "Click to copy this color code!" | ||
} |
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
{ | ||
"modmenu.summaryTranslation.colorful_hex": "Делает полезными цветовые коды формата HEX в чате.", | ||
"modmenu.descriptionTranslation.colorful_hex": "Делает полезными цветовые коды формата HEX в чате.\nВы можете увидеть, какой цвет обозначается данным кодом HEX, и скопировать его в буфер обмена в один клик.\n[РАБОТАЕТ ТОЛЬКО НА СТОРОНЕ КЛИЕНТА]" | ||
"modmenu.descriptionTranslation.colorful_hex": "Делает полезными цветовые коды формата HEX в чате.\nВы можете увидеть, какой цвет обозначается данным кодом HEX, и скопировать его в буфер обмена в один клик.\n[РАБОТАЕТ ТОЛЬКО НА СТОРОНЕ КЛИЕНТА]", | ||
"colorful_hex.click_to_copy": "Нажмите, чтобы скопировать цветовой код!" | ||
|
||
} |
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