Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.8.9 client command fix #44

Merged
merged 7 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/1.8.9.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build 1.8.9

on:
push:
paths:
- 'MinecraftMod/forge/1.8.9/**'

jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

# Setup JDK
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
distribution: adopt
java-version: 8

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v3

# Build Core
- name: Build/Install Core
working-directory: ./MinecraftMod/core
run: './gradlew publishToMavenLocal'

# Setup Minecraft Forge Workspace
- name: Setup Forge Workspace
working-directory: ./MinecraftMod/forge/1.8.9
run: './gradlew setupCiWorkspace --no-daemon'

# Build Minecraft Mod
- name: Build Mod
working-directory: ./MinecraftMod/forge/1.8.9
run: './gradlew build --no-daemon'

# Upload Artifact
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: forge 1.8.9
path: ./MinecraftMod/forge/1.8.9/build/libs/*.jar
22 changes: 11 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
java-version: 8

- name: Set up Gradle
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3

# Build Core
- name: Build/Install Core
Expand All @@ -28,7 +28,7 @@ jobs:

# Upload Maven Local
- name: Upload
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
path: ~/.m2/repository
name: maven
Expand Down Expand Up @@ -60,11 +60,11 @@ jobs:
java-version: 8

- name: Set up Gradle
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3

# Download Core
- name: Download Core Artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: maven
path: ~/.m2/repository
Expand All @@ -81,7 +81,7 @@ jobs:

# Upload Artifact
- name: Upload Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.mod-loader }} ${{ matrix.mc-version }}
path: ./MinecraftMod/${{ matrix.mod-loader }}/${{ matrix.mc-version }}/build/libs/*.jar
Expand Down Expand Up @@ -125,11 +125,11 @@ jobs:
java-version: 17

- name: Set up Gradle
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3

# Download Core
- name: Download Core Artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: maven
path: ~/.m2/repository
Expand All @@ -141,7 +141,7 @@ jobs:

# Upload Artifact
- name: Upload Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.mod-loader }} ${{ matrix.mc-version }}
path: ./MinecraftMod/${{ matrix.mod-loader }}/${{ matrix.mc-version }}/build/libs/*.jar
Expand Down Expand Up @@ -175,11 +175,11 @@ jobs:
java-version: 16

- name: Set up Gradle
uses: gradle/gradle-build-action@v2
uses: gradle/actions/setup-gradle@v3

# Download Core
- name: Download Core Artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: maven
path: ~/.m2/repository
Expand All @@ -198,7 +198,7 @@ jobs:

# Upload Artifact
- name: Upload Artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Stream Deck Plugin
path: ./StreamDeckPlugin/*.streamDeckPlugin
5 changes: 3 additions & 2 deletions MinecraftMod/forge/1.8.9/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

This is not going to get updated often because the tools are extremely out of date & hard to use compared to modern tools. 1.8.9 has been unsupported for years as a modding version at this point. There are no plans to backport to any other version of Minecraft.

This was a "I wonder if I could" situation. You'll also notice I did not add this to the CI build system, this version will only be manually built.
This was a "I wonder if I could" situation. Support may be slow or non-existent for this version. (Still report issues though, I'll try to help.)

For the Stream Deck plugin, use the version from [this release (v2.2.0)](https://github.com/MoSadie/EffectMC/releases/tag/v2.2.0). It still has the built-in web dashboard and accepts the same http requests, if alternate methods are needed.
For the Stream Deck plugin, use the version from [this release (v2.3.0)](https://github.com/MoSadie/EffectMC/releases/tag/v2.3.0). It still has the built-in web dashboard and accepts the same http requests, if alternate methods are needed.

## Effect Changes

Expand All @@ -18,3 +18,4 @@ Due to the large Minecraft version difference, some effects do not work in the u
- [Open Book](https://github.com/MoSadie/EffectMC/wiki/open-book) does not work.
- [Narrate](https://github.com/MoSadie/EffectMC/wiki/narrate) does not work.
- [Open Screen](https://github.com/MoSadie/EffectMC/wiki/open-screen) may crash your game. Sorry.
- [Show Item Toast](https://github.com/MoSadie/EffectMC/wiki/show-item-toast) does not work.
4 changes: 2 additions & 2 deletions MinecraftMod/forge/1.8.9/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ plugins {
id "net.minecraftforge.gradle.forge" version "2.0.2"
}
*/
version = "2.2.0"
version = "2.3.0"
group= "com.mosadie.effectmc" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "effectmc-forge-1.8.9"

Expand Down Expand Up @@ -72,7 +72,7 @@ dependencies {
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html

shade 'com.mosadie.effectmc:core:2.2'
shade 'com.mosadie.effectmc:core:2.3'

}

Expand Down
Empty file modified MinecraftMod/forge/1.8.9/gradlew
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.google.gson.JsonPrimitive;
import com.mosadie.effectmc.core.EffectExecutor;
import com.mosadie.effectmc.core.EffectMCCore;
import com.mosadie.effectmc.core.WorldState;
import com.mosadie.effectmc.core.handler.*;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.ISound;
Expand Down Expand Up @@ -33,6 +34,7 @@
import net.minecraft.nbt.JsonToNBT;
import net.minecraft.nbt.NBTException;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.server.integrated.IntegratedServer;
import net.minecraft.stats.Achievement;
import net.minecraft.util.BlockPos;
import net.minecraft.util.ChatComponentText;
Expand Down Expand Up @@ -65,7 +67,7 @@
@Mod(modid = EffectMC.MODID, version = EffectMC.VERSION)
public class EffectMC implements EffectExecutor {
public static final String MODID = "effectmc";
public static final String VERSION = "2.2";
public static final String VERSION = "2.3";

public static EffectMCCore core;

Expand Down Expand Up @@ -317,6 +319,9 @@ public boolean toggleSkinLayer(SkinLayerHandler.SKIN_SECTION section) {
public boolean sendChatMessage(String message) {
if (Minecraft.getMinecraft().thePlayer != null) {
LOGGER.info("Sending chat message: " + message);
if (ClientCommandHandler.instance.executeCommand(Minecraft.getMinecraft().thePlayer, message) != 0) {
return true; // Client Command Handler handled it.
}
Minecraft.getMinecraft().thePlayer.sendChatMessage(message);
return true;
}
Expand Down Expand Up @@ -747,4 +752,53 @@ public boolean setRenderDistance(int chunks) {
// Minecraft.getMinecraft().gameSettings.saveOptions();
return true;
}

@Override
public boolean showItemToast(String itemData, String title, String subtitle) {
LOGGER.warn("Item Toasts are not supported in this version!");
return false;
}

@Override
public WorldState getWorldState() {
if (Minecraft.getMinecraft().theWorld == null) {
return WorldState.OTHER;
}

if (Minecraft.getMinecraft().isSingleplayer()) {
return WorldState.SINGLEPLAYER;
}

return WorldState.MULTIPLAYER;
}

@Override
public String getSPWorldName() {
if (getWorldState() != WorldState.SINGLEPLAYER) {
return null;
}

IntegratedServer server = Minecraft.getMinecraft().getIntegratedServer();

if (server != null) {
return server.getName();
}

LOGGER.info("Attempted to get SP World Name, but no integrated server was found!");
return null;
}

@Override
public String getServerIP() {
if (getWorldState() != WorldState.MULTIPLAYER) {
return null;
}

if (Minecraft.getMinecraft().getCurrentServerData() != null) {
return Minecraft.getMinecraft().getCurrentServerData().serverIP;
}

LOGGER.info("Attempted to get Server IP, but no server data was found!");
return null;
}
}