Compare commits

...
Sign in to create a new pull request.

2 commits

Author SHA1 Message Date
ed15ccd307 Update README.md
fuck old template message!

Signed-off-by: Stachelbeere1248 <stachelbeere1248@noreply.localhost>
2025-08-15 20:47:21 +02:00
b5e1c3b786
some features
All checks were successful
/ build (push) Successful in 3m59s
+ !reinv transfer fix
+ leap msgs
+ ?m7 carry guide

bump version

fix missing concat operator

Update .forgejo/workflows/check.yaml

Signed-off-by: Stachelbeere1248 <stachelbeere1248@noreply.localhost>

fix typo

fix wrong variable

fix typo
2025-08-15 20:12:16 +02:00
4 changed files with 118 additions and 140 deletions

View file

@ -29,4 +29,10 @@ jobs:
curl -L "$JRE17_URL" | tar -xz -C "$INSTALL_DIR" curl -L "$JRE17_URL" | tar -xz -C "$INSTALL_DIR"
- name: build - name: build
run: JDK8=/opt/java/zulu8.84.0.15-ca-jdk8.0.442-linux_x64 JAVA_HOME=/opt/java/zulu17.56.15-ca-jre17.0.14-linux_x64 ./gradlew check run: JDK8=/opt/java/zulu8.84.0.15-ca-jdk8.0.442-linux_x64 JAVA_HOME=/opt/java/zulu17.56.15-ca-jre17.0.14-linux_x64 ./gradlew build
- name: capture build artifacts
uses: https://code.forgejo.org/forgejo/upload-artifact@v3
with:
name: Artifacts
path: 'build/libs'

View file

@ -1,43 +0,0 @@
# Architectury Loom based template for 1.8.9 forge mods
**For other templates, do check out the [other branches of this repository](https://github.com/romangraef/Forge1.8.9Template/branches/all)**
## Usage
Check out https://moddev.nea.moe/ for a full tutorial on legacy modding.
Alternatively, read here for a basic overview on how to use this repository.
To get started, [Use this template](https://github.com/new?template_name=Forge1.8.9Template&template_owner=nea89o).
> [!WARNING]
> Do not Fork or Clone or Download ZIP this template. If you "use" this template a custom mod id will be generated. You can do that manually using the `make-my-own` script, if you are on linux. If not, just click the use this template button. If you want to use kotlin or make a 1.12 mod check the "Include all branches" and change the default branch in https://github.com/yourname/yourreponame/branches
This project uses [DevAuth](https://github.com/DJtheRedstoner/DevAuth) per default, so you can log in using your real
minecraft account. If you don't need that, you can remove it from the buildscript.
To run the mod you will need two JDKs, one Java 17 jdk and one Java 1.8 jdk. You can download those
from [here](https://adoptium.net/temurin/releases) (or use your own downloads).
When you import your project into IntelliJ, you need to set the gradle jvm to the Java 17 JDK in the gradle tab, and the
Project SDK to the Java 1.8 JDK. Then click on the sync button in IntelliJ, and it should create a run task
called `Minecraft Client`. If it doesn't then try relaunching your IntelliJ. **Warning for Mac users**: You might have to remove the `-XStartOnFirstThread` vm argument from your run configuration. In the future, that should be handled by the plugin, but for now you'll probably have to do that manually.
To export your project, run the `gradle build` task, and give other people the
file `build/libs/<modid>-<version>.jar`. Ignore the jars in the `build/badjars` folder. Those are intermediary jars that
are used by the build system but *do not work* in a normal forge installation.
If you don't want mixins (which allow for modifying vanilla code), then you can remove the references to mixins from
the `build.gradle.kts` at the lines specified with comments and the `com.example.mixin` package.
If you don't want access transformers (which allow for making methods public/non-final) you can delete the
`accesstransformer.cfg` file. If you make a change to the `accesstransformers.cfg` you might need to rebuild your
project using `./gradlew build --refresh-dependencies`.
### For those who have not an attention span
[![Youtube Tutorial](https://i.ytimg.com/vi/nWzHlomdCgc/maxresdefault.jpg)](https://www.youtube.com/watch?v=nWzHlomdCgc)
## Licensing
This template is licensed under the Unlicense (license copy present in this repository), or alternatively under [Creative Commons 1.0 Universal (CC0 1.0)](https://creativecommons.org/publicdomain/zero/1.0/), and all contributions and PR to this template are expected to follow this. This means your mod, based on this template can be licensed whatever way you want, and does not need to reference back to this template in any way.

View file

@ -3,5 +3,5 @@ org.gradle.jvmargs=-Xmx2g
baseGroup = xyz.stachel.bonzotimer baseGroup = xyz.stachel.bonzotimer
mcVersion = 1.8.9 mcVersion = 1.8.9
modid = bonzo-timer modid = bonzo-timer
version = 1.3.0 version = 1.4.0
org.gradle.java.installations.fromEnv=JDK8,JRE17 org.gradle.java.installations.fromEnv=JDK8,JRE17

View file

@ -15,16 +15,16 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
public class ChatHandler { public class ChatHandler {
private static final String PLAYER_PATTERN = "(?:\\[(?:VIP\\+?|MVP\\+{0,2}|YOUTUBE|MOD|ADMIN)\\] )?([a-zA-Z0-9_]{2,16})"; private static final String IGN_PATTERN = "([a-zA-Z0-9_]{2,16})";
private static final String PLAYER_PATTERN = "(?:\\[(?:VIP\\+?|MVP\\+{0,2}|YOUTUBE|MOD|ADMIN)\\] )?" + IGN_PATTERN;
private static final Pattern PARTY_PATTERN = Pattern.compile("Party > " + PLAYER_PATTERN + ": (.*)"); private static final Pattern PARTY_PATTERN = Pattern.compile("Party > " + PLAYER_PATTERN + ": (.*)");
private static final Pattern TRANSFER_PATTERN = Pattern.compile("The party was transferred to " + PLAYER_PATTERN +" by " + PLAYER_PATTERN); private static final Pattern TRANSFER_PATTERN = Pattern.compile("The party was transferred to " + PLAYER_PATTERN +" by " + PLAYER_PATTERN);
private static final Pattern TRANSFER_LEAVE_PATTERN = Pattern.compile("The party was transferred to " + PLAYER_PATTERN + " because " + PLAYER_PATTERN + "left");
private static final Pattern PROMOTE_PATTERN = Pattern.compile(PLAYER_PATTERN + " has promoted " + PLAYER_PATTERN + " to Party Leader"); private static final Pattern PROMOTE_PATTERN = Pattern.compile(PLAYER_PATTERN + " has promoted " + PLAYER_PATTERN + " to Party Leader");
private static final Pattern LEAVE_PATTERN = Pattern.compile(PLAYER_PATTERN + " has left the party."); private static final Pattern LEAVE_PATTERN = Pattern.compile(PLAYER_PATTERN + " has left the party.");
//private static final String[] COLOR_MAPPING = { "§6ORANGE", "§aGREEN", "§4RED" ,"§9BLUE", "§5PRPLX" }; private static final Pattern LEAP_PATTERN = Pattern.compile("You have teleported to " + IGN_PATTERN + "!");
private int transferCountdown = 0; private int transferCountdown = 0;
private boolean autotransferEnabled = false; private boolean autotransferEnabled = false;
//private int colorChangeCooldown = 0;
//private int color = 0;
private String oldLeader = null; private String oldLeader = null;
private HashMap<String, Byte> rejoiners = new HashMap<>(); private HashMap<String, Byte> rejoiners = new HashMap<>();
@ -34,12 +34,6 @@ public class ChatHandler {
@SubscribeEvent @SubscribeEvent
public void onTick(TickEvent.@NotNull ClientTickEvent event) { public void onTick(TickEvent.@NotNull ClientTickEvent event) {
/*if (colorChangeCooldown > 0) {
colorChangeCooldown--;
} else {
color = 0;
}*/
if (transferCountdown > 1) { if (transferCountdown > 1) {
transferCountdown--; transferCountdown--;
} else if (transferCountdown == 1 && Minecraft.getMinecraft().thePlayer != null && this.oldLeader != null) { } else if (transferCountdown == 1 && Minecraft.getMinecraft().thePlayer != null && this.oldLeader != null) {
@ -53,94 +47,115 @@ public class ChatHandler {
@SubscribeEvent @SubscribeEvent
public void onChatReceived(@NotNull ClientChatReceivedEvent event) { public void onChatReceived(@NotNull ClientChatReceivedEvent event) {
if (event.type == 2) return; if (event.type == 2) return;
final String strippedMessage = event.message.getUnformattedText().replaceAll("§[0-9a-fklmnor]", "").trim(); final String strippedMessage = event.message.getUnformattedText().replaceAll("§[0-9a-fklmnor]", "").trim();
if (autotransferEnabled) { branched: {
final Matcher transfer = TRANSFER_PATTERN.matcher(strippedMessage);
final Matcher promote = PROMOTE_PATTERN.matcher(strippedMessage);
String newLeader = "";
if (transfer.matches()) {
this.oldLeader = transfer.group(2);
newLeader = transfer.group(1);
} else if (promote.matches()) {
this.oldLeader = promote.group(1);
newLeader = promote.group(2);
}
if (!newLeader.equals("") && newLeader.equals(Minecraft.getMinecraft().thePlayer.getName())) { literal: switch (strippedMessage) {
this.transferCountdown = 10; case "Your Bonzo's Mask saved your life!":
} case "Your ⚚ Bonzo's Mask saved your life!":
} Timer.setInstance(new Timer((byte) 60));
Minecraft.getMinecraft().thePlayer.sendChatMessage("Bonzo's Mask popped (3s)");
break branched;
case "Second Wind Activated! Your Spirit Mask saved your life!":
case "Second Wind Activated! Your ⚚ Spirit Mask saved your life!":
Timer.setInstance(new Timer((byte) 60));
Minecraft.getMinecraft().thePlayer.sendChatMessage("Spirit Mask popped (3s)");
break branched;
case "Your Phoenix Pet saved you from certain death!":
Timer.setInstance(new Timer((byte) 60));
Minecraft.getMinecraft().thePlayer.sendChatMessage("Phoenix pet popped (3s)");
break branched;
default:
break literal;
};
final Matcher partyChat = PARTY_PATTERN.matcher(strippedMessage); if (autotransferEnabled) {
if (partyChat.matches()) { final Matcher transfer = TRANSFER_PATTERN.matcher(strippedMessage);
final String partyMessage = partyChat.group(2); final Matcher promote = PROMOTE_PATTERN.matcher(strippedMessage);
final String user = partyChat.group(1); String newLeader = "";
switch (partyMessage) { if (transfer.matches()) {
case "!warp": this.oldLeader = transfer.group(2);
Minecraft.getMinecraft().thePlayer.sendChatMessage("/p warp"); newLeader = transfer.group(1);
break; } else if (promote.matches()) {
case "!help": this.oldLeader = promote.group(1);
Minecraft.getMinecraft().thePlayer.sendChatMessage("Commands: !warp, !m7, !f7, !ptme, !allinv"); newLeader = promote.group(2);
break; }
case "!m7":
Minecraft.getMinecraft().thePlayer.sendChatMessage("/joindungeon master_catacombs_floor_seven");
break;
case "!f7":
Minecraft.getMinecraft().thePlayer.sendChatMessage("/joindungeon catacombs_floor_seven");
break;
case "!allinvite":
case "!allinv":
Minecraft.getMinecraft().thePlayer.sendChatMessage("/p settings allinvite");
break;
case "!reinv":
rejoiners.put(user, (byte) 100);
break;
case "!ptme":
event.message.appendSibling(
new ChatComponentText(" [ACCEPT]")
.setChatStyle(new ChatStyle()
.setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/p transfer " + user))
.setColor(EnumChatFormatting.RED).setBold(true))
);
break;
}
} else {
switch (strippedMessage) {
case "Your Bonzo's Mask saved your life!":
case "Your ⚚ Bonzo's Mask saved your life!":
Timer.setInstance(new Timer((byte) 60));
Minecraft.getMinecraft().thePlayer.sendChatMessage("Bonzo's Mask popped (3s)");
break;
case "Second Wind Activated! Your Spirit Mask saved your life!":
case "Second Wind Activated! Your ⚚ Spirit Mask saved your life!":
Timer.setInstance(new Timer((byte) 60));
Minecraft.getMinecraft().thePlayer.sendChatMessage("Spirit Mask popped (3s)");
break;
case "Your Phoenix Pet saved you from certain death!":
Timer.setInstance(new Timer((byte) 60));
Minecraft.getMinecraft().thePlayer.sendChatMessage("Phoenix pet popped (3s)");
break;
default:
break;
}
final Matcher leave = LEAVE_PATTERN.matcher(strippedMessage); if (!newLeader.isEmpty() && newLeader.equals(Minecraft.getMinecraft().thePlayer.getName())) {
if (leave.matches()) { this.transferCountdown = 10;
final String leaver = leave.group(1).trim(); break branched;
if (rejoiners.getOrDefault(leaver, (byte) 0) != 0) { }
Minecraft.getMinecraft().thePlayer.sendChatMessage("/party invite " + leaver); }
}
}
}
}
/* private void changeColor(final int color) { final Matcher partyChat = PARTY_PATTERN.matcher(strippedMessage);
if (this.color < color || this.colorChangeCooldown == 0) { if (partyChat.matches()) {
this.color = color; final String partyMessage = partyChat.group(2);
this.colorChangeCooldown = 10; final String user = partyChat.group(1);
final String title = ChatHandler.COLOR_MAPPING[color-1]; switch (partyMessage) {
Minecraft.getMinecraft().ingameGUI.displayTitle(title, "", 0, 5, 1); case "!warp":
}; case "!w":
}*/ Minecraft.getMinecraft().thePlayer.sendChatMessage("/p warp");
break branched;
case "!help":
Minecraft.getMinecraft().thePlayer.sendChatMessage("Commands: !warp, !m7, !f7, !ptme, !allinv, !reinv");
break branched;
case "!m7":
Minecraft.getMinecraft().thePlayer.sendChatMessage("/joindungeon master_catacombs_floor_seven");
break branched;
case "!f7":
Minecraft.getMinecraft().thePlayer.sendChatMessage("/joindungeon catacombs_floor_seven");
break branched;
case "!allinvite":
case "!allinv":
Minecraft.getMinecraft().thePlayer.sendChatMessage("/p settings allinvite");
break branched;
case "!reinv":
rejoiners.put(user, (byte) 100);
break branched;
case "!ptme":
case "!pt":
event.message.appendSibling(
new ChatComponentText(" [ACCEPT]")
.setChatStyle(new ChatStyle()
.setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/p transfer " + user))
.setColor(EnumChatFormatting.RED).setBold(true))
);
break branched;
case "?m7":
Minecraft.getMinecraft().thePlayer.sendChatMessage("Please select the MAGE or BERSERK dungeon class and stay with the tank while trying to reach MILESTONE 3. After reaching milestone 3, please run /hub, you will be warped back later! :D");
break branched;
case "?help":
Minecraft.getMinecraft().thePlayer.sendChatMessage("Helper messages: ?m7");
break branched;
}
}
final Matcher leave = LEAVE_PATTERN.matcher(strippedMessage);
if (leave.matches()) {
final String leaver = leave.group(1).trim();
if (rejoiners.getOrDefault(leaver, (byte) 0) != 0) {
Minecraft.getMinecraft().thePlayer.sendChatMessage("/party invite " + leaver);
}
break branched;
};
final Matcher transLeave = TRANSFER_LEAVE_PATTERN.matcher(strippedMessage);
if (transLeave.matches()) {
final String leaver = transLeave.group(2).trim();
if (rejoiners.getOrDefault(leaver, (byte) 0) != 0) {
Minecraft.getMinecraft().thePlayer.sendChatMessage("/party invite " + leaver);
}
break branched;
};
final Matcher leap = LEAP_PATTERN.matcher(strippedMessage);
if (leap.matches()) {
final String target = leap.group(1).trim();
Minecraft.getMinecraft().thePlayer.sendChatMessage("Gonna touch " + target + ".");
break branched;
}
};
};
} }