Compare commits

...

3 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
be25889e20 Add .forgejo/workflows/check.yaml 2025-08-15 19:34:31 +02:00
4 changed files with 149 additions and 139 deletions

View file

@ -0,0 +1,38 @@
on:
push:
branches:
- 'check'
jobs:
build:
runs-on: docker
steps:
- name: checkout repository
uses: actions/checkout@v3
- name: make gradle wrapper executable
run: chmod +x ./gradlew
- name: set up jdk
run: |
INSTALL_DIR="/opt/java"
mkdir -p "$INSTALL_DIR"
JDK8_URL="https://cdn.azul.com/zulu/bin/zulu8.84.0.15-ca-jdk8.0.442-linux_x64.tar.gz"
JRE17_URL="https://cdn.azul.com/zulu/bin/zulu17.56.15-ca-jre17.0.14-linux_x64.tar.gz"
echo "Downloading JDK8 from $JDK8_URL"
curl -L "$JDK8_URL" | tar -xz -C "$INSTALL_DIR"
echo "Downloading JRE17 from $JRE17_URL"
curl -L "$JRE17_URL" | tar -xz -C "$INSTALL_DIR"
- 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 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) {
@ -55,6 +49,27 @@ public class ChatHandler {
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();
branched: {
literal: 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 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;
};
if (autotransferEnabled) { if (autotransferEnabled) {
final Matcher transfer = TRANSFER_PATTERN.matcher(strippedMessage); final Matcher transfer = TRANSFER_PATTERN.matcher(strippedMessage);
final Matcher promote = PROMOTE_PATTERN.matcher(strippedMessage); final Matcher promote = PROMOTE_PATTERN.matcher(strippedMessage);
@ -67,8 +82,9 @@ public class ChatHandler {
newLeader = promote.group(2); newLeader = promote.group(2);
} }
if (!newLeader.equals("") && newLeader.equals(Minecraft.getMinecraft().thePlayer.getName())) { if (!newLeader.isEmpty() && newLeader.equals(Minecraft.getMinecraft().thePlayer.getName())) {
this.transferCountdown = 10; this.transferCountdown = 10;
break branched;
} }
} }
@ -78,69 +94,68 @@ public class ChatHandler {
final String user = partyChat.group(1); final String user = partyChat.group(1);
switch (partyMessage) { switch (partyMessage) {
case "!warp": case "!warp":
case "!w":
Minecraft.getMinecraft().thePlayer.sendChatMessage("/p warp"); Minecraft.getMinecraft().thePlayer.sendChatMessage("/p warp");
break; break branched;
case "!help": case "!help":
Minecraft.getMinecraft().thePlayer.sendChatMessage("Commands: !warp, !m7, !f7, !ptme, !allinv"); Minecraft.getMinecraft().thePlayer.sendChatMessage("Commands: !warp, !m7, !f7, !ptme, !allinv, !reinv");
break; break branched;
case "!m7": case "!m7":
Minecraft.getMinecraft().thePlayer.sendChatMessage("/joindungeon master_catacombs_floor_seven"); Minecraft.getMinecraft().thePlayer.sendChatMessage("/joindungeon master_catacombs_floor_seven");
break; break branched;
case "!f7": case "!f7":
Minecraft.getMinecraft().thePlayer.sendChatMessage("/joindungeon catacombs_floor_seven"); Minecraft.getMinecraft().thePlayer.sendChatMessage("/joindungeon catacombs_floor_seven");
break; break branched;
case "!allinvite": case "!allinvite":
case "!allinv": case "!allinv":
Minecraft.getMinecraft().thePlayer.sendChatMessage("/p settings allinvite"); Minecraft.getMinecraft().thePlayer.sendChatMessage("/p settings allinvite");
break; break branched;
case "!reinv": case "!reinv":
rejoiners.put(user, (byte) 100); rejoiners.put(user, (byte) 100);
break; break branched;
case "!ptme": case "!ptme":
case "!pt":
event.message.appendSibling( event.message.appendSibling(
new ChatComponentText(" [ACCEPT]") new ChatComponentText(" [ACCEPT]")
.setChatStyle(new ChatStyle() .setChatStyle(new ChatStyle()
.setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/p transfer " + user)) .setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/p transfer " + user))
.setColor(EnumChatFormatting.RED).setBold(true)) .setColor(EnumChatFormatting.RED).setBold(true))
); );
break; 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;
} }
} 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); final Matcher leave = LEAVE_PATTERN.matcher(strippedMessage);
if (leave.matches()) { if (leave.matches()) {
final String leaver = leave.group(1).trim(); final String leaver = leave.group(1).trim();
if (rejoiners.getOrDefault(leaver, (byte) 0) != 0) { if (rejoiners.getOrDefault(leaver, (byte) 0) != 0) {
Minecraft.getMinecraft().thePlayer.sendChatMessage("/party invite " + leaver); Minecraft.getMinecraft().thePlayer.sendChatMessage("/party invite " + leaver);
} }
} break branched;
} };
}
final Matcher transLeave = TRANSFER_LEAVE_PATTERN.matcher(strippedMessage);
/* private void changeColor(final int color) { if (transLeave.matches()) {
if (this.color < color || this.colorChangeCooldown == 0) { final String leaver = transLeave.group(2).trim();
this.color = color; if (rejoiners.getOrDefault(leaver, (byte) 0) != 0) {
this.colorChangeCooldown = 10; Minecraft.getMinecraft().thePlayer.sendChatMessage("/party invite " + leaver);
final String title = ChatHandler.COLOR_MAPPING[color-1]; }
Minecraft.getMinecraft().ingameGUI.displayTitle(title, "", 0, 5, 1); 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;
}
};
}; };
}*/
} }