Skip to content

Commit

Permalink
🗿
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysdh540 committed Oct 11, 2023
1 parent 28d1036 commit 5d8c9e2
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 6 deletions.
4 changes: 4 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,7 @@ def setup() {

defineMixins()
}

subprojects {
remapJar.finalizedBy(mergeJars)
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import com.mojang.brigadier.arguments.IntegerArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder;

import com.mojang.brigadier.context.CommandContext;

import com.simibubi.create.foundation.config.ConfigBase.*;
import com.simibubi.create.foundation.utility.Components;

Expand All @@ -31,12 +29,12 @@

import java.util.List;

import manifold.ext.rt.extensions.java.lang.Object.ManObjectExt;
import manifold.rt.api.NoBootstrap;

import static net.minecraft.commands.Commands.argument;
import static net.minecraft.commands.Commands.literal;
import static net.minecraft.network.chat.Component.nullToEmpty;

@NoBootstrap
public class CUCommands {
public static void registerConfigCommand() {
List<MutableComponent> links = List.of(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package dev.rdh.createunlimited.extensions.com.mojang.brigadier.context.CommandContext;

import manifold.ext.rt.api.Extension;
import manifold.ext.rt.api.This;

import net.minecraft.commands.CommandSourceStack;
import net.minecraft.network.chat.Component;

import com.mojang.brigadier.context.CommandContext;

@Extension
public class CommandContextExt {
public static void message(@This CommandContext<CommandSourceStack> context, Component message) {
#if PRE_CURRENT_MC_1_19_2
context.getSource().sendSuccess(message, false);
#elif POST_CURRENT_MC_1_20_1
context.getSource().sendSuccess(() -> message, false);
#endif
}

public static void message(@This CommandContext<CommandSourceStack> context, String message) {
context.message(Component.nullToEmpty(message));
}

public static void error(@This CommandContext<CommandSourceStack> context, Component message) {
context.getSource().sendFailure(message);
}

public static void error(@This CommandContext<CommandSourceStack> context, String message) {
context.error(Component.nullToEmpty(message));
}
}
3 changes: 1 addition & 2 deletions gradle/subprojects.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ configurations {
addJar.extendsFrom addJarEverywhere

implementation.extendsFrom shade

remapJar.finalizedBy(mergeJars)
}

repositories {
Expand Down Expand Up @@ -89,6 +87,7 @@ dependencies {
})

manifold 'preprocessor'
manifold 'ext'
manifold 'props'

annotationProcessor implementation("com.github.LlamaLad7:MixinExtras:${rootProject.mixin_extras}")
Expand Down

0 comments on commit 5d8c9e2

Please sign in to comment.