Skip to content

Commit

Permalink
Update to new Lambda API 3.0.1 -> 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Avanatiker committed Feb 25, 2022
1 parent 66619c4 commit efd02c1
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 25 deletions.
31 changes: 14 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,14 @@ buildscript {
}

dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:4.+'
classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
classpath 'net.minecraftforge.gradle:ForgeGradle:5.+'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}

apply plugin: 'idea'
apply plugin: 'kotlin'
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.spongepowered.mixin'

compileJava {
sourceCompatibility = targetCompatibility = '1.8'
Expand Down Expand Up @@ -67,11 +65,10 @@ configurations {
dependencies {
minecraft "net.minecraftforge:forge:$minecraftVersion-$forgeVersion"

// API coming soon
// implementation 'com.github.lambda-client:lambda:2.12'
implementation(files("lib/lambda-3.0.1-api.jar"))
// Online maven dependency coming soon
implementation files("lib/lambda-3.1-api.jar")

implementation('org.spongepowered:mixin:0.7.11-SNAPSHOT') {
implementation('org.spongepowered:mixin:0.8.3') {
exclude module: 'commons-io'
exclude module: 'gson'
exclude module: 'guava'
Expand All @@ -80,7 +77,7 @@ dependencies {
}

// Hacky way to get mixin work
annotationProcessor('org.spongepowered:mixin:0.8.2:processor') {
annotationProcessor('org.spongepowered:mixin:0.8.3:processor') {
exclude module: 'gson'
}

Expand Down Expand Up @@ -113,29 +110,29 @@ dependencies {

// Add them back to compileOnly (provided)
compileOnly "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlinVersion"
compileOnly 'org.jetbrains:annotations:22.0.0'
compileOnly 'org.jetbrains:annotations:23.0.0'

// This Baritone will NOT be included in the jar
implementation 'com.github.cabaletta:baritone:1.2.14'

// Unit Testing frameworks
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'

// Add your dependencies below
// jarLibs 'com.lambda:example:1.0.0'
}

mixin {
defaultObfuscationEnv 'searge'
add sourceSets.main, 'mixins.lambda.refmap.json'
}

processResources {
inputs.property 'version', project.version

exclude '**/rawimagefiles'

from(sourceSets.main.resources.srcDirs) {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
include 'plugin_info.json'
expand 'version': project.version
}
}

jar.finalizedBy('reobfJar')
test {
useJUnitPlatform()
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ mappingsChannel=stable
mappingsVersion=39-1.12

kotlinVersion=1.6.10
kotlinxCoroutinesVersion=1.6.0
kotlinxCoroutinesVersion=1.6.0
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Binary file not shown.
Binary file renamed lib/lambda-3.0.1-api.jar → lib/lambda-3.1-api.jar
Binary file not shown.
23 changes: 23 additions & 0 deletions setupWorkspace.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh

# Used to setup workspace and fix building on unix / Git BASH
#
# Usage: "./setupWorkspace.sh"

#

# To allow use from outside the lambda directory
cd "$(dirname "$0")" || exit

echo "[$(date +"%H:%M:%S")] Running gradlew classes without daemon..."
./gradlew --no-daemon classes || {
echo "[$(date +"%H:%M:%S")] ERROR: Running gradlew build failed! Run './gradlew --no-daemon classes' manually"
exit 1
}

cat logo_ascii.txt 2>/dev/null
echo "=========================================================================="
echo ""
echo "[$(date +"%H:%M:%S")] Build succeeded! All checks passed, you can build normally now! Welcome to Lambda."
echo ""
echo "=========================================================================="
2 changes: 1 addition & 1 deletion src/main/kotlin/HighwayTools.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import com.lambda.client.event.events.PacketEvent
import com.lambda.client.event.events.PlayerTravelEvent
import com.lambda.client.event.events.RenderOverlayEvent
import com.lambda.client.event.events.RenderWorldEvent
import com.lambda.client.event.listener.listener
import com.lambda.client.module.Category
import com.lambda.client.plugin.api.PluginModule
import com.lambda.client.setting.settings.impl.collection.CollectionSetting
import com.lambda.client.util.items.shulkerList
import com.lambda.client.util.threads.runSafe
import com.lambda.client.util.threads.runSafeR
import com.lambda.client.util.threads.safeListener
import com.lambda.event.listener.listener
import net.minecraft.block.Block
import net.minecraft.init.Blocks
import net.minecraft.init.Items
Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/trombone/Blueprint.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ import HighwayTools.mode
import HighwayTools.railing
import HighwayTools.railingHeight
import HighwayTools.width
import com.lambda.client.commons.extension.ceilToInt
import com.lambda.client.commons.extension.floorToInt
import com.lambda.client.util.math.Direction
import com.lambda.client.util.math.VectorUtils.distanceTo
import com.lambda.client.util.math.VectorUtils.multiply
import com.lambda.commons.extension.ceilToInt
import com.lambda.commons.extension.floorToInt
import net.minecraft.block.Block
import net.minecraft.init.Blocks
import net.minecraft.util.math.BlockPos
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/trombone/handler/Container.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import HighwayTools.saveFood
import HighwayTools.saveMaterial
import HighwayTools.saveTools
import HighwayTools.searchEChest
import com.lambda.client.commons.extension.ceilToInt
import com.lambda.client.event.SafeClientEvent
import com.lambda.client.util.EntityUtils.getDroppedItems
import com.lambda.client.util.TickTimer
Expand All @@ -18,7 +19,6 @@ import com.lambda.client.util.math.VectorUtils.toVec3dCenter
import com.lambda.client.util.world.getVisibleSides
import com.lambda.client.util.world.isPlaceable
import com.lambda.client.util.world.isReplaceable
import com.lambda.commons.extension.ceilToInt
import net.minecraft.init.Blocks
import net.minecraft.init.Items
import net.minecraft.inventory.ItemStackHelper
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/trombone/handler/Tasks.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import HighwayTools.saveTools
import HighwayTools.saveFood
import HighwayTools.manageFood
import HighwayTools.storageManagement
import com.lambda.client.commons.extension.ceilToInt
import com.lambda.client.event.SafeClientEvent
import com.lambda.client.manager.managers.PlayerInventoryManager
import com.lambda.client.module.modules.player.InventoryManager
Expand All @@ -27,7 +28,6 @@ import com.lambda.client.util.math.VectorUtils.multiply
import com.lambda.client.util.math.VectorUtils.toVec3dCenter
import com.lambda.client.util.text.MessageSendHelper
import com.lambda.client.util.world.*
import com.lambda.commons.extension.ceilToInt
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/plugin_info.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
"description": "Build highways with ease",
"url": "https://github.com/lambda-plugins/HighwayTools",
"min_api_version": "3.0",
"hot_reload": true,
"main_class": "HighwayToolsPlugin"
}

0 comments on commit efd02c1

Please sign in to comment.