Skip to content

Commit

Permalink
Made a working version on 1.18.2
Browse files Browse the repository at this point in the history
  • Loading branch information
I-No-oNe committed Jan 9, 2024
1 parent 671cb22 commit ca73004
Show file tree
Hide file tree
Showing 14 changed files with 88 additions and 146 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Automatically build the project and run any configured tests for every push
# and submitted pull request. This can help catch issues that only occur on
# certain platforms or Java versions, and provides a first line of defence
# against bad commits.

name: build
on: [pull_request, push]

jobs:
build:
strategy:
matrix:
# Use these Java versions
java: [
17, # Current Java LTS & minimum supported by Minecraft
21, # Current Java LTS
]
# and run on both Linux and Windows
os: [ubuntu-22.04, windows-2022]
runs-on: ${{ matrix.os }}
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'microsoft'
- name: make gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: build
run: ./gradlew build
- name: capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '21' }} # Only upload artifacts built from latest java on one OS
uses: actions/upload-artifact@v3
with:
name: Artifacts
path: build/libs/
41 changes: 0 additions & 41 deletions .github/workflows/gradle.yml

This file was deleted.

14 changes: 1 addition & 13 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.4-SNAPSHOT'
id 'fabric-loom' version '1.5-SNAPSHOT'
id 'maven-publish'
}

Expand All @@ -18,18 +18,6 @@ repositories {
// for more information about repositories.
}

loom {
splitEnvironmentSourceSets()

mods {
"glowing_entities" {
sourceSet sourceSets.main
sourceSet sourceSets.client
}
}

}

dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
Expand Down
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.3
minecraft_version=1.18.2
yarn_mappings=1.18.2+build.4
loader_version=0.15.3

# Mod Properties
mod_version=1.0.0
mod_version=2.0
maven_group=net.i_no_am.glowing_entities
archives_base_name=glowing_entities

# Dependencies
fabric_version=0.92.0+1.20.4
fabric_version=0.77.0+1.18.2

This file was deleted.

12 changes: 0 additions & 12 deletions src/client/resources/glowing_entities.client.mixins.json

This file was deleted.

22 changes: 0 additions & 22 deletions src/main/java/net/i_no_am/glowing_entities/GlowingEntities.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package net.i_no_am.glowing_entities;

import com.mojang.brigadier.arguments.IntegerArgumentType;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.command.v1.ClientCommandManager;
import net.minecraft.text.Text;

import static net.fabricmc.fabric.api.client.command.v1.ClientCommandManager.argument;
import static net.fabricmc.fabric.api.client.command.v1.ClientCommandManager.literal;

@Environment(EnvType.CLIENT)
public class GlowingEntitiesClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
ClientCommandManager.DISPATCHER.register(
literal("glowing_effect")
.then(argument("glowing", IntegerArgumentType.integer())
.executes(context -> {
int value = IntegerArgumentType.getInteger(context, "glowing");
IEntityDataSaver playerData = (IEntityDataSaver) context.getSource().getPlayer();
playerData.getPersistentData().putInt("glow", value);
if (value > 15)
value = 15;
String glow = value < 0 ? "Normal" : String.valueOf(value);
context.getSource().sendFeedback(Text.of("§l§6Glowing Entities: §bThe Entity Glowing set to: " + glow));
return value;
})
)
);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.i_no_am.glowing_entities.mixin.client;
package net.i_no_am.glowing_entities.mixin;

import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.entity.EntityRenderer;
Expand Down
15 changes: 0 additions & 15 deletions src/main/java/net/i_no_am/glowing_entities/mixin/ExampleMixin.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.i_no_am.glowing_entities.mixin.client;
package net.i_no_am.glowing_entities.mixin;

import net.minecraft.entity.Entity;
import net.minecraft.nbt.NbtCompound;
Expand Down
12 changes: 4 additions & 8 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "glowing_entities",
"version": "2",
"version": "2.0",
"name": "Glowing-Entities",
"description": "Minecraft client-sided mod that makes entities glow!",
"authors": [
Expand All @@ -17,17 +17,13 @@
"icon": "assets/glowing_entities/icon.png",
"environment": "*",
"entrypoints": {
"main": [
"net.i_no_am.glowing_entities.GlowingEntities"
],
"client": [
"net.i_no_am.glowing_entities.GlowingEntitiesClient"
]
},
"mixins": [
"glowing_entities.mixins.json",
{
"config": "glowing_entities.client.mixins.json",
"config": "glowing_entities.mixins.json",
"environment": "client"
}
],
Expand All @@ -45,6 +41,6 @@
"fabric-api": "*"
},
"suggests": {
"another-mod": "*"
"another-mod": "ClickCrystals"
}
}
}
5 changes: 3 additions & 2 deletions src/main/resources/glowing_entities.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
"required": true,
"package": "net.i_no_am.glowing_entities.mixin",
"compatibilityLevel": "JAVA_17",
"mixins": [
"ExampleMixin"
"client": [
"EntityRendererMixin",
"ModEntityDataSaverMixin"
],
"injectors": {
"defaultRequire": 1
Expand Down

0 comments on commit ca73004

Please sign in to comment.