Skip to content

Commit b9dc873

Browse files
committed
Removed dubious ghost pickaxe feature as it could be considered a cheat
Improved custom chroma text to detect bold characters
1 parent e27765a commit b9dc873

6 files changed

Lines changed: 16 additions & 80 deletions

File tree

src/main/java/com/ownwn/ownwnaddons/OwnwnAddons.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ public void onFMLInitialization(net.minecraftforge.fml.common.event.FMLInitializ
5656
MinecraftForge.EVENT_BUS.register(new DungeonsMimicAlert());
5757
MinecraftForge.EVENT_BUS.register(new OwaDevMode());
5858
MinecraftForge.EVENT_BUS.register(new ThirdPersonFOV());
59-
//MinecraftForge.EVENT_BUS.register(new LoreCustomiser());
6059
MinecraftForge.EVENT_BUS.register(new SecretStuff());
6160
MinecraftForge.EVENT_BUS.register(new GardenMilestoneMsg());
6261
MinecraftForge.EVENT_BUS.register(new TickUtils());

src/main/java/com/ownwn/ownwnaddons/features/dungeons/CreateGhostPick.java

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/main/java/com/ownwn/ownwnaddons/mixin/MinecraftMixin.java renamed to src/main/java/com/ownwn/ownwnaddons/mixin/DrawStringMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import org.spongepowered.asm.mixin.injection.ModifyVariable;
88

99
@Mixin(FontRenderer.class)
10-
public class MinecraftMixin {
10+
public class DrawStringMixin {
1111
@ModifyVariable(method = "drawString(Ljava/lang/String;FFIZ)I", at = @At(value = "HEAD"), argsOnly = true) // https://github.com/Cephetir/SkySkipped/blob/kotlin/src/main/java/me/cephetir/skyskipped/mixins/render/MixinFontRenderer.java
1212
public String drawText(String text) {
1313

src/main/java/com/ownwn/ownwnaddons/utils/ColourUtils.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,23 +84,32 @@ public static String replacePlayerName(String text) {
8484
}
8585

8686
public static String replaceChromaMessages(String text) {
87+
88+
89+
8790
if (Minecraft.getMinecraft().thePlayer == null) {
8891
return text;
8992
}
9093
if (NewConfig.CHROMA_TEXT_REPLACE.equals("")) {
9194
return text;
9295
}
93-
String newColour;
96+
String newColour = "§"; // no im not using a stringbuilder
9497

9598
if (NewConfig.CHROMA_TYPE) {
96-
newColour = ColourUtils.getColour();
99+
newColour += ColourUtils.getColour();
97100
} else {
98-
newColour = "z";
101+
newColour += "z";
99102
}
100103

101104
for (String replacementText: NewConfig.CHROMA_TEXT_REPLACE.replace("&&", "§").split(", ")) {
102-
text = text.replace(replacementText, "§" + newColour + replacementText + "§r");
105+
if (replacementText.startsWith("§l") || replacementText.startsWith("§l", 2)) {
106+
newColour = newColour.replace("§l", "") + "§l";
107+
} else {
108+
newColour = newColour.replace("§l", "");
109+
}
110+
text = text.replace(replacementText, newColour + Utils.stripFormatting(replacementText) + "§r");
103111
}
112+
104113
return text;
105114
}
106115
}

src/main/java/com/ownwn/ownwnaddons/utils/NewConfig.java

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,13 @@
33
import cc.polyfrost.oneconfig.config.Config;
44
import cc.polyfrost.oneconfig.config.annotations.Number;
55
import cc.polyfrost.oneconfig.config.annotations.*;
6-
import cc.polyfrost.oneconfig.config.core.OneKeyBind;
76
import cc.polyfrost.oneconfig.config.data.InfoType;
87
import cc.polyfrost.oneconfig.config.data.Mod;
98
import cc.polyfrost.oneconfig.config.data.ModType;
10-
import cc.polyfrost.oneconfig.libs.universal.UKeyboard;
119
import com.ownwn.ownwnaddons.OwnwnAddons;
12-
import com.ownwn.ownwnaddons.features.dungeons.CreateGhostPick;
13-
import com.ownwn.ownwnaddons.features.dungeons.DungeonsTerminalDisplay;
1410
import com.ownwn.ownwnaddons.features.TrevorCooldown;
1511
import com.ownwn.ownwnaddons.features.TrevorLootTracker;
12+
import com.ownwn.ownwnaddons.features.dungeons.DungeonsTerminalDisplay;
1613

1714
public class NewConfig extends Config {
1815

@@ -37,14 +34,6 @@ public class NewConfig extends Config {
3734
)
3835
public static boolean CHECK_FOR_UPDATES = true;
3936

40-
@KeyBind(
41-
name = "Create Ghost Pickaxe",
42-
description = "Duplicates your current pickaxe client-side",
43-
category = "Features",
44-
subcategory = "Dungeons"
45-
)
46-
public static OneKeyBind GHOST_PICK_KEY = new OneKeyBind(UKeyboard.KEY_NONE);
47-
4837
@Switch(
4938
name = "Mimic Alert",
5039
description = "Alerts you when a mimic spawns in dungeons.",
@@ -81,15 +70,6 @@ public class NewConfig extends Config {
8170
)
8271
public static float SECRET_CLICK_PITCH = 10f;
8372

84-
// @Text(
85-
// name = "Lore Customiser",
86-
// description = "Allows you to customise how the lore looks on items",
87-
// multiline = true,
88-
// category = "Features",
89-
// subcategory = "Items"
90-
// )
91-
// public static String CUSTOM_TEXT_LORE = "";
92-
9373
@Switch(
9474
name = "Debug Mode",
9575
description = "Should the mod write things like HTTP responses to the log?"
@@ -339,7 +319,6 @@ public NewConfig() {
339319
super(new Mod(OwnwnAddons.NAME, ModType.UTIL_QOL), OwnwnAddons.MODID + ".json");
340320

341321
initialize();
342-
registerKeyBind(GHOST_PICK_KEY, () -> CreateGhostPick.runnable.run());
343322

344323
addDependency("CUSTOM_RANK_EDITOR", "CUSTOM_NAME_MODE", () -> CUSTOM_NAME_MODE == 0);
345324
addDependency("CUSTOM_NAME_EDITOR", "CUSTOM_NAME_MODE", () -> CUSTOM_NAME_MODE == 0);

src/main/resources/mixins.ownwnaddons.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"maxShiftBy": 5
88
},
99
"client": [
10-
"MinecraftMixin"
10+
"DrawStringMixin"
1111
],
1212
"verbose": true
1313
}

0 commit comments

Comments
 (0)