Turn Up/Down & Grave Compat

This commit is contained in:
skippyall
2025-04-12 19:08:25 +02:00
parent 8007778c39
commit cc69b22aba
5 changed files with 58 additions and 1 deletions
+14
View File
@@ -17,6 +17,18 @@ repositories {
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
maven { url 'https://maven.nucleoid.xyz' }
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
filter {
includeGroup "maven.modrinth"
}
}
}
dependencies {
@@ -30,6 +42,8 @@ dependencies {
modImplementation "eu.pb4:polymer-core:${project.polymer_version}"
modImplementation include("eu.pb4:sgui:${project.sgui_version}")
modImplementation include("xyz.nucleoid:server-translations-api:${project.server_translations_version}")
modCompileOnly "maven.modrinth:universal-graves:${project.universal_graves_version}"
}
processResources {
+2
View File
@@ -19,3 +19,5 @@ org.gradle.jvmargs=-Xmx1G
polymer_version=0.10.0+1.21.2
sgui_version=1.7.1+1.21.2
server_translations_version=2.4.0+1.21.2-rc1
universal_graves_version=3.5.0+1.21.2
@@ -0,0 +1,20 @@
package io.github.skippyall.minions.mixins;
import com.llamalad7.mixinextras.sugar.Local;
import eu.pb4.graves.grave.Grave;
import io.github.skippyall.minions.minion.fakeplayer.MinionFakePlayer;
import net.minecraft.server.network.ServerPlayerEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;
@Mixin(Grave.class)
public class GraveCompatMixin {
@ModifyArg(method = "createBlock", at = @At(value = "INVOKE", target = "Leu/pb4/graves/grave/Grave;<init>(JLcom/mojang/authlib/GameProfile;BLnet/minecraft/util/Arm;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/Identifier;Leu/pb4/graves/grave/GraveType;JJILnet/minecraft/text/Text;Ljava/util/Collection;Ljava/util/Collection;ZI)V"))
private static boolean createGrave(boolean profile, @Local(argsOnly = true) ServerPlayerEntity player) {
if(player instanceof MinionFakePlayer) {
return false;
}
return profile;
}
}
@@ -39,13 +39,33 @@ public class MoveModule {
.thenAccept(degrees -> minion.getMinionActionPack().turn(-degrees, 0))
);
public static final SimpleCommand TURN_UP_COMMAND =
new SimpleCommand(
Text.literal("Turn Up"),
Text.literal("Turn a specific amount of degrees up"),
Items.COMPASS,
(player, minion) -> TextInput.inputFloat(player, Text.literal("Degrees"), "90")
.thenAccept(degrees -> minion.getMinionActionPack().turn(0, -degrees))
);
public static final SimpleCommand TURN_DOWN_COMMAND =
new SimpleCommand(
Text.literal("Turn Down"),
Text.literal("Turn a specific amount of degrees down"),
Items.COMPASS,
(player, minion) -> TextInput.inputFloat(player, Text.literal("Degrees"), "90")
.thenAccept(degrees -> minion.getMinionActionPack().turn(0, degrees))
);
public static final SimpleModuleItem MOVE_MODULE =
register(Identifier.of(Minions.MOD_ID, "move_module"),
List.of(),
List.of(
WALK_COMMAND,
TURN_RIGHT_COMMAND,
TURN_LEFT_COMMAND
TURN_LEFT_COMMAND,
TURN_UP_COMMAND,
TURN_DOWN_COMMAND
),
Items.IRON_BOOTS
);
+1
View File
@@ -7,6 +7,7 @@
"ChunkTicketManagerFixMixin",
"ConnectionMixin",
"EntityAccessor",
"GraveCompatMixin",
"MinecraftServerMixin",
"MobEntityMixin",
"PlayerListEntryS2CPacket$EntryMixin",