1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-08-30 17:17:55 +00:00

Initial pass of the API breaking changes for 1.19.3 (#1232)

- Remove deprecated API members in prep for 1.19.3. This allows us to
   remove the mc-stubs and forge-stubs projects.

 - Make several methods take a MinecraftServer instead of a Level (or
   nothing at all).

 - Remove I prefixes from a whole bunch of interfaces, making things a
   little more consistent with Java conventions.

   This avoids touching the "main" interfaces people consume for now. I
   want to do that another Minecraft version, to avoid making the update
   too painful.

 - Remove IFileSystem and associated getters. This has never worked very
   well and I don't think has got much (any?) usage.
This commit is contained in:
Jonathan Coates
2022-12-03 15:02:00 +00:00
committed by GitHub
parent 95c57e843d
commit 87c6d3aef6
157 changed files with 619 additions and 1272 deletions

View File

@@ -1,5 +1,3 @@
import cc.tweaked.gradle.mavenDependencies
plugins {
id("cc-tweaked.fabric")
id("cc-tweaked.publishing")
@@ -15,7 +13,6 @@ cct.inlineProject(":common-api")
dependencies {
api(project(":core-api"))
compileOnly(project(":forge-stubs"))
}
tasks.jar {
@@ -23,24 +20,5 @@ tasks.jar {
attributes["Fabric-Loom-Remap"] = "true"
}
from(project(":core-api").sourceSets.main.get().output) // TODO(1.19.3): Remove when we've fixed GenericSource
from("src/main/modJson") // TODO: Remove once Loom 1.1 is out.
}
// TODO(1.19.3): Remove when GenericSource no longer uses ResourceLocation. This forces us to bundle the core API with
// the Fabric API, in order to remap those classes.
tasks.sourcesJar {
from(project(":core-api").sourceSets.main.get().allJava)
}
tasks.withType(GenerateModuleMetadata::class).configureEach { isEnabled = false }
publishing {
publications {
named("maven", MavenPublication::class) {
mavenDependencies {
exclude(dependencies.create("cc.tweaked:"))
}
}
}
}

View File

@@ -6,24 +6,24 @@
package dan200.computercraft.api.node.wired;
import dan200.computercraft.api.ComputerCraftAPI;
import dan200.computercraft.api.network.wired.IWiredElement;
import dan200.computercraft.api.network.wired.WiredElement;
import net.fabricmc.fabric.api.lookup.v1.block.BlockApiLookup;
import net.minecraft.core.Direction;
import net.minecraft.resources.ResourceLocation;
/**
* {@linkplain BlockApiLookup Block API lookup} for {@link IWiredElement}s. This should be used to query wired elements
* {@linkplain BlockApiLookup Block API lookup} for {@link WiredElement}s. This should be used to query wired elements
* from a block.
*/
public final class WiredElementLookup {
public static final ResourceLocation ID = new ResourceLocation(ComputerCraftAPI.MOD_ID, "wired_node");
private static final BlockApiLookup<IWiredElement, Direction> lookup = BlockApiLookup.get(ID, IWiredElement.class, Direction.class);
private static final BlockApiLookup<WiredElement, Direction> lookup = BlockApiLookup.get(ID, WiredElement.class, Direction.class);
private WiredElementLookup() {
}
public static BlockApiLookup<IWiredElement, Direction> get() {
public static BlockApiLookup<WiredElement, Direction> get() {
return lookup;
}
}