Turn Up/Down & Grave Compat
This commit is contained in:
@@ -17,6 +17,18 @@ repositories {
|
|||||||
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
|
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
|
||||||
// for more information about repositories.
|
// for more information about repositories.
|
||||||
maven { url 'https://maven.nucleoid.xyz' }
|
maven { url 'https://maven.nucleoid.xyz' }
|
||||||
|
|
||||||
|
exclusiveContent {
|
||||||
|
forRepository {
|
||||||
|
maven {
|
||||||
|
name = "Modrinth"
|
||||||
|
url = "https://api.modrinth.com/maven"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
filter {
|
||||||
|
includeGroup "maven.modrinth"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
@@ -30,6 +42,8 @@ dependencies {
|
|||||||
modImplementation "eu.pb4:polymer-core:${project.polymer_version}"
|
modImplementation "eu.pb4:polymer-core:${project.polymer_version}"
|
||||||
modImplementation include("eu.pb4:sgui:${project.sgui_version}")
|
modImplementation include("eu.pb4:sgui:${project.sgui_version}")
|
||||||
modImplementation include("xyz.nucleoid:server-translations-api:${project.server_translations_version}")
|
modImplementation include("xyz.nucleoid:server-translations-api:${project.server_translations_version}")
|
||||||
|
|
||||||
|
modCompileOnly "maven.modrinth:universal-graves:${project.universal_graves_version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
processResources {
|
processResources {
|
||||||
|
|||||||
@@ -19,3 +19,5 @@ org.gradle.jvmargs=-Xmx1G
|
|||||||
polymer_version=0.10.0+1.21.2
|
polymer_version=0.10.0+1.21.2
|
||||||
sgui_version=1.7.1+1.21.2
|
sgui_version=1.7.1+1.21.2
|
||||||
server_translations_version=2.4.0+1.21.2-rc1
|
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))
|
.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 =
|
public static final SimpleModuleItem MOVE_MODULE =
|
||||||
register(Identifier.of(Minions.MOD_ID, "move_module"),
|
register(Identifier.of(Minions.MOD_ID, "move_module"),
|
||||||
List.of(),
|
List.of(),
|
||||||
List.of(
|
List.of(
|
||||||
WALK_COMMAND,
|
WALK_COMMAND,
|
||||||
TURN_RIGHT_COMMAND,
|
TURN_RIGHT_COMMAND,
|
||||||
TURN_LEFT_COMMAND
|
TURN_LEFT_COMMAND,
|
||||||
|
TURN_UP_COMMAND,
|
||||||
|
TURN_DOWN_COMMAND
|
||||||
),
|
),
|
||||||
Items.IRON_BOOTS
|
Items.IRON_BOOTS
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
"ChunkTicketManagerFixMixin",
|
"ChunkTicketManagerFixMixin",
|
||||||
"ConnectionMixin",
|
"ConnectionMixin",
|
||||||
"EntityAccessor",
|
"EntityAccessor",
|
||||||
|
"GraveCompatMixin",
|
||||||
"MinecraftServerMixin",
|
"MinecraftServerMixin",
|
||||||
"MobEntityMixin",
|
"MobEntityMixin",
|
||||||
"PlayerListEntryS2CPacket$EntryMixin",
|
"PlayerListEntryS2CPacket$EntryMixin",
|
||||||
|
|||||||
Reference in New Issue
Block a user