版本更新到0.0.0.9
对WayStone做适配
This commit is contained in:
parent
8367efcf57
commit
186103e0c5
|
|
@ -165,6 +165,8 @@ dependencies {
|
||||||
modImplementation("blank:curtain-1.20.1:1.3.2")
|
modImplementation("blank:curtain-1.20.1:1.3.2")
|
||||||
modImplementation("dev.kosmx.player-anim:player-animation-lib-forge:${player_anim_version}")
|
modImplementation("dev.kosmx.player-anim:player-animation-lib-forge:${player_anim_version}")
|
||||||
modImplementation("curse.maven:bendy-lib-623373:4550371")
|
modImplementation("curse.maven:bendy-lib-623373:4550371")
|
||||||
|
modImplementation("curse.maven:waystones-245755:6856603")
|
||||||
|
modImplementation("curse.maven:balm-531761:7087245")
|
||||||
// modRuntimeOnly("curse.maven:luckperms-431733:4738950")
|
// modRuntimeOnly("curse.maven:luckperms-431733:4738950")
|
||||||
modImplementation("software.bernie.geckolib:geckolib-forge-${minecraft_version}:${geckolib_version}")
|
modImplementation("software.bernie.geckolib:geckolib-forge-${minecraft_version}:${geckolib_version}")
|
||||||
implementation("com.eliotlash.mclib:mclib:20")
|
implementation("com.eliotlash.mclib:mclib:20")
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ mod_name=Super Lead Rope
|
||||||
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
||||||
mod_license=GPLv3
|
mod_license=GPLv3
|
||||||
# The mod version. See https://semver.org/
|
# The mod version. See https://semver.org/
|
||||||
mod_version=0.0.0.8
|
mod_version=0.0.0.9
|
||||||
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
||||||
# This should match the base package used for the mod sources.
|
# This should match the base package used for the mod sources.
|
||||||
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import net.minecraftforge.fml.config.ModConfig;
|
||||||
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
import top.r3944realms.superleadrope.compat.WayStoneCompat;
|
||||||
import top.r3944realms.superleadrope.config.LeashCommonConfig;
|
import top.r3944realms.superleadrope.config.LeashCommonConfig;
|
||||||
import top.r3944realms.superleadrope.core.register.SLPEntityTypes;
|
import top.r3944realms.superleadrope.core.register.SLPEntityTypes;
|
||||||
import top.r3944realms.superleadrope.core.register.SLPItems;
|
import top.r3944realms.superleadrope.core.register.SLPItems;
|
||||||
|
|
@ -68,6 +69,7 @@ public class SuperLeadRope {
|
||||||
ConfigUtil.createFile(new String[]{c});
|
ConfigUtil.createFile(new String[]{c});
|
||||||
ModLoadingContext modLoadingContext = ModLoadingContext.get();
|
ModLoadingContext modLoadingContext = ModLoadingContext.get();
|
||||||
ConfigUtil.registerConfig(modLoadingContext, ModConfig.Type.COMMON, LeashCommonConfig.SPEC, c, "leash");
|
ConfigUtil.registerConfig(modLoadingContext, ModConfig.Type.COMMON, LeashCommonConfig.SPEC, c, "leash");
|
||||||
|
WayStoneCompat.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
package top.r3944realms.superleadrope.compat;
|
||||||
|
|
||||||
|
import net.blay09.mods.waystones.api.WaystoneTeleportEvent;
|
||||||
|
import net.minecraft.world.entity.Entity;
|
||||||
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
import net.minecraftforge.fml.ModList;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import top.r3944realms.superleadrope.api.type.util.ILeashHelper;
|
||||||
|
import top.r3944realms.superleadrope.api.workspace.Services;
|
||||||
|
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
public class WayStoneCompat {
|
||||||
|
public final static boolean isModLoaded = ModList.get().isLoaded("waystones");
|
||||||
|
public static void init() {
|
||||||
|
if (isModLoaded) {
|
||||||
|
MinecraftForge.EVENT_BUS.addListener(WayStoneCompat::onWayStoneTeleport);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static void onWayStoneTeleport(WaystoneTeleportEvent.@NotNull Pre event) {
|
||||||
|
Entity entity = event.getContext().getEntity();
|
||||||
|
ILeashHelper.IHolder holderHelper = Services.WORK_SPACE.getLeashHelper().getHolderHelper(entity);
|
||||||
|
Set<Entity> allLeashedEntities = holderHelper.getAllLeashedEntities();
|
||||||
|
allLeashedEntities.forEach(event::addAdditionalEntity);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user