Skip to content
Open
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
10 changes: 3 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'fabric-loom' version '1.16-SNAPSHOT'
id 'maven-publish'
id "me.modmuss50.mod-publish-plugin" version "0.5.1"
}
Expand All @@ -12,14 +12,10 @@ base {
}

repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
maven { url "https://maven.wispforest.io/releases/" }
maven { url "https://maven.axoga.to/releases" }
//maven { url "https://maven.axoga.to/releases" } // no longer online, not really relevant?
maven { url "https://api.modrinth.com/maven" }
maven { url 'https://jitpack.io' }
}

loom {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ org.gradle.parallel=true
# check these on https://fabricmc.net/develop
minecraft_version=1.21
yarn_mappings=1.21+build.4
loader_version=0.15.11
loader_version=0.19.0

# Mod Properties
mod_name=Particular
Expand All @@ -16,6 +16,6 @@ archives_base_name=particular

# Dependencies
fabric_version=0.100.3+1.21
owo_version=0.12.10+1.21
owo_version=0.13.0-alpha.15+1.21
sushi_version=0.2.1+1.21
seasons_version=2.2.1+1.20
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
15 changes: 7 additions & 8 deletions gradlew
100644 → 100755

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 12 additions & 22 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,40 +1,36 @@
package com.chailotl.particular.mixin;

import blue.endless.jankson.Jankson;
import com.chailotl.particular.sushi_bar.owo.config.SushiConfigScreen;
import com.chailotl.particular.sushi_bar.owo.config.SushiModmenu;
import com.llamalad7.mixinextras.expression.Definition;
import com.llamalad7.mixinextras.expression.Expression;
import io.wispforest.owo.config.ConfigWrapper;
import io.wispforest.owo.config.ui.ConfigScreen;
import net.fabricmc.api.EnvType;
import net.fabricmc.loader.api.FabricLoader;
import io.wispforest.owo.config.annotation.Modmenu;
import io.wispforest.owo.config.ui.ConfigScreenProviders;
import net.minecraft.util.Identifier;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Pseudo;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import java.util.function.Consumer;

@Pseudo
@Mixin(ConfigWrapper.class)
public class InjectConfigWrapper
{
@Definition(id = "getAnnotation", method = "Ljava/lang/Class;getAnnotation(Ljava/lang/Class;)Ljava/lang/annotation/Annotation;")
@Definition(id = "ModMenu", type = Modmenu.class)
@Expression("?.getAnnotation(ModMenu.class)")
@Inject(
method = "<init>(Ljava/lang/Class;Ljava/util/function/Consumer;)V",
at = @At(
value = "INVOKE",
target = "Lnet/fabricmc/loader/api/FabricLoader;getEnvironmentType()Lnet/fabricmc/api/EnvType;"
)
method = "<init>(Ljava/lang/Class;Lio/wispforest/owo/config/ConfigWrapper$BuilderConsumer;)V",
at = @At(value = "MIXINEXTRAS:EXPRESSION")
)
private <C> void injectSushiModmenu(Class<C> clazz, Consumer<Jankson.Builder> janksonBuilder, CallbackInfo info)
private <C> void injectSushiModmenu(Class clazz, ConfigWrapper.BuilderConsumer consumer, CallbackInfo ci)
{
if (FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT && clazz.isAnnotationPresent(SushiModmenu.class))
if (clazz.isAnnotationPresent(SushiModmenu.class))
{
SushiModmenu annotation = clazz.getAnnotation(SushiModmenu.class);
ConfigScreen.registerProvider(
annotation.modId(),
screen -> SushiConfigScreen.createWithCustomModel(Identifier.of(annotation.uiModelId()), (ConfigWrapper<C>)(Object)this, screen)
SushiModmenu annotation = (SushiModmenu) clazz.getAnnotation(SushiModmenu.class);
ConfigScreenProviders.register(
annotation.modId(),
screen -> SushiConfigScreen.createWithCustomModel(Identifier.of(annotation.uiModelId()), (ConfigWrapper<C>)(Object)this, screen)
);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
package com.chailotl.particular.mixin;

import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.ViewerCountManager;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;

@Environment(EnvType.CLIENT)
@Mixin(ViewerCountManager.class)
public interface InvokerViewerCountManager {
@Invoker
public abstract void invokeOnContainerOpen(World world, BlockPos pos, BlockState state);
void invokeOnContainerOpen(World world, BlockPos pos, BlockState state);

@Invoker
public abstract void invokeOnContainerClose(World world, BlockPos pos, BlockState state);

@Invoker
public abstract void invokeScheduleBlockTick(World world, BlockPos pos, BlockState state);
void invokeOnContainerClose(World world, BlockPos pos, BlockState state);

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import io.wispforest.owo.config.ConfigWrapper;
import io.wispforest.owo.config.ui.ConfigScreen;
import io.wispforest.owo.config.ui.ConfigScreenProviders;
import io.wispforest.owo.config.ui.OptionComponentFactory;
import io.wispforest.owo.util.ReflectionUtils;
import net.minecraft.client.gui.screen.Screen;
Expand Down Expand Up @@ -33,9 +34,8 @@ public static SushiConfigScreen createWithCustomModel(Identifier modelId, Config
return new SushiConfigScreen(modelId, config, parent);
}

public static void registerConfig(String modId, ConfigWrapper<?> config)
{
ConfigScreen.registerProvider(modId, screen -> new SushiConfigScreen(config, screen));
public static void registerConfig(String modId, ConfigWrapper<?> config) {
ConfigScreenProviders.register(modId, screen -> new SushiConfigScreen(config, screen));
}

private static boolean isIdentifierList(Field field)
Expand Down
19 changes: 17 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,21 @@
"name": "${name}",
"description": "Enhances Minecraft's ambience with hand-crafted visual effects like fireflies, falling leaves, and waterfall cascades",
"authors": [
"Chai"
{
"name": "Chai",
"contact": {
"homepage": "https://axoga.to/",
"sources": "https://github.com/Chailotl/"
}
}
],
"contributors": [
{
"name": "Nerjal Nosk",
"contact": {
"homepage": "https://codeberg.org/NerjalNosk/"
}
}
],
"contact": {
"homepage": "https://modrinth.com/mod/particular/",
Expand All @@ -15,7 +29,8 @@
"custom": {
"modmenu": {
"links": {
"modmenu.discord": "https://discord.gg/SuZb3aJUCx"
"modmenu.discord": "https://discord.gg/SuZb3aJUCx",
"modmenu.buymeacoffee": "https://www.buymeacoffee.com/chailotl"
}
}
},
Expand Down
9 changes: 5 additions & 4 deletions src/main/resources/particular.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"required": true,
"package": "com.chailotl.particular.mixin",
"compatibilityLevel": "JAVA_17",
"mixins": [
"InvokerViewerCountManager"
],
"injectors": {
"defaultRequire": 1
},
"mixinextras": {
"minVersion": "0.5.0-beta.1"
},
"client": [
"AccessorBillboardParticle",
"AccessorBiome",
Expand All @@ -22,6 +22,7 @@
"InjectCakeBlock",
"InjectChestBlock",
"InjectChestBlockEntity",
"InjectConfigWrapper",
"InjectContinuousFalling",
"InjectEnderChestBlock",
"InjectEnderChestBlockEntity",
Expand All @@ -32,6 +33,6 @@
"InjectWaterFluid",
"InjectWorldRenderer",
"InvokerLivingEntity",
"InjectConfigWrapper"
"InvokerViewerCountManager"
]
}