diff --git a/build.gradle b/build.gradle index afec9977..80ff5ba1 100644 --- a/build.gradle +++ b/build.gradle @@ -128,8 +128,8 @@ dependencies { } implementation 'software.bernie.geckolib:geckolib-forge-1.12.2:3.0.31' compileOnly "net.ilexiconn:llibrary:1.7.19-1.12.2" -// compileOnly 'curse.maven:shoulder-surfing-reloaded-243190:4757879' - compileOnly files('libs/ShoulderSurfing-1.12.2-2.6.jar') + compileOnly 'curse.maven:shoulder-surfing-reloaded-243190:4757879' +// compileOnly files('libs/ShoulderSurfing-1.12.2-2.6.jar') } // Adds Access Transformer files to tasks diff --git a/src/main/java/anightdazingzoroark/prift/server/entity/creature/RiftCreature.java b/src/main/java/anightdazingzoroark/prift/server/entity/creature/RiftCreature.java index 6da9c402..6f3cfcf5 100644 --- a/src/main/java/anightdazingzoroark/prift/server/entity/creature/RiftCreature.java +++ b/src/main/java/anightdazingzoroark/prift/server/entity/creature/RiftCreature.java @@ -47,6 +47,7 @@ import net.minecraft.world.DifficultyInstance; import net.minecraft.world.World; import net.minecraft.world.storage.loot.LootTableList; +import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import software.bernie.geckolib3.core.IAnimatable; @@ -252,18 +253,20 @@ public void setControls() { RiftMessages.WRAPPER.sendToServer(new RiftManageUtilizingControl(this, 2, settings.keyBindJump.isKeyDown())); if (settings.keyBindAttack.isKeyDown() && !this.isActing() && this.getLeftClickCooldown() == 0) { - if (ShoulderInstance.getInstance().doShoulderSurfing()) { - Entity toBeAttacked = SSRCompatUtils.getEntities(this.attackWidth * (64D/39D)).entityHit; - if (this.hasLeftClickChargeBar()) { - RiftMessages.WRAPPER.sendToServer(new RiftIncrementControlUse(this, 0)); - } - else { - if (toBeAttacked != null) { - int targetId = toBeAttacked.getEntityId(); - RiftMessages.WRAPPER.sendToServer(new RiftMountControl(this, targetId,0)); + if (Loader.isModLoaded(RiftInitialize.SSR_MOD_ID)) { + if (ShoulderInstance.getInstance().doShoulderSurfing()) { + Entity toBeAttacked = SSRCompatUtils.getEntities(this.attackWidth * (64D/39D)).entityHit; + if (this.hasLeftClickChargeBar()) { + RiftMessages.WRAPPER.sendToServer(new RiftIncrementControlUse(this, 0)); } else { - RiftMessages.WRAPPER.sendToServer(new RiftMountControl(this, -1,0)); + if (toBeAttacked != null) { + int targetId = toBeAttacked.getEntityId(); + RiftMessages.WRAPPER.sendToServer(new RiftMountControl(this, targetId,0)); + } + else { + RiftMessages.WRAPPER.sendToServer(new RiftMountControl(this, -1,0)); + } } } } @@ -290,7 +293,8 @@ else if (settings.keyBindJump.isKeyDown() && this.getSpacebarCooldown() == 0) { } } else if (!settings.keyBindAttack.isKeyDown() && !settings.keyBindUseItem.isKeyDown()) { - Entity toBeAttacked = SSRCompatUtils.getEntities(this.attackWidth * (64D/39D)).entityHit; + Entity toBeAttacked = null; + if (Loader.isModLoaded(RiftInitialize.SSR_MOD_ID)) toBeAttacked = SSRCompatUtils.getEntities(this.attackWidth * (64D/39D)).entityHit; if (this.hasLeftClickChargeBar()) { if (this.getLeftClickUse() > 0) { if (toBeAttacked != null) {