-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for 1.19.3, updated code base sync scripts
- Loading branch information
1 parent
c44733c
commit 309fb0f
Showing
60 changed files
with
2,662 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Done to increase the memory available to gradle. | ||
org.gradle.jvmargs=-Xmx2G | ||
# Mod Properties | ||
mod_version=3.0 | ||
mod_version=3.1 | ||
maven_group=net.fabricmc | ||
archives_base_name=litematica-printer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ pluginManagement { | |
gradlePluginPortal() | ||
} | ||
} | ||
include 'v1_19_3' | ||
include 'v1_19' | ||
include 'v1_18' | ||
include 'v1_17' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
v1_19/src/main/java/me/aleksilassila/litematica/printer/v1_19/BlockHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package me.aleksilassila.litematica.printer.v1_19; | ||
|
||
import net.minecraft.block.*; | ||
|
||
abstract public class BlockHelper { | ||
abstract public Class<?>[] getInteractiveBlocks(); | ||
|
||
public static Class<?>[] interactiveBlocks = new Class[]{ | ||
AbstractChestBlock.class, AbstractFurnaceBlock.class, CraftingTableBlock.class, LeverBlock.class, | ||
DoorBlock.class, TrapdoorBlock.class, BedBlock.class, RedstoneWireBlock.class, ScaffoldingBlock.class, | ||
HopperBlock.class, EnchantingTableBlock.class, NoteBlock.class, JukeboxBlock.class, CakeBlock.class, | ||
FenceGateBlock.class, BrewingStandBlock.class, DragonEggBlock.class, CommandBlock.class, | ||
BeaconBlock.class, AnvilBlock.class, ComparatorBlock.class, RepeaterBlock.class, | ||
DropperBlock.class, DispenserBlock.class, ShulkerBoxBlock.class, LecternBlock.class, | ||
FlowerPotBlock.class, BarrelBlock.class, BellBlock.class, SmithingTableBlock.class, | ||
LoomBlock.class, CartographyTableBlock.class, GrindstoneBlock.class, | ||
StonecutterBlock.class, AbstractSignBlock.class, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...c/main/java/me/aleksilassila/litematica/printer/v1_19/implementation/BlockHelperImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package me.aleksilassila.litematica.printer.v1_19.implementation; | ||
|
||
import me.aleksilassila.litematica.printer.v1_19.BlockHelper; | ||
|
||
public class BlockHelperImpl extends BlockHelper { | ||
@Override | ||
public Class<?>[] getInteractiveBlocks() { | ||
return BlockHelper.interactiveBlocks; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
plugins { | ||
id("fabric-loom").version("1.0-SNAPSHOT") | ||
id("maven-publish") | ||
} | ||
|
||
java.sourceCompatibility = JavaVersion.VERSION_17 | ||
java.targetCompatibility = JavaVersion.VERSION_17 | ||
|
||
val archives_base_name: String by project | ||
val minecraft_version: String by project | ||
val yarn_mappings: String by project | ||
val loader_version: String by project | ||
val fabric_version: String by project | ||
val malilib_version: String by project | ||
val litematica_projectid: String by project | ||
val litematica_fileid: String by project | ||
|
||
dependencies { | ||
// implementation(project(":common")) | ||
minecraft("com.mojang:minecraft:${minecraft_version}") | ||
mappings("net.fabricmc:yarn:${yarn_mappings}:v2") | ||
|
||
modImplementation("net.fabricmc:fabric-loader:${loader_version}") | ||
modImplementation("net.fabricmc.fabric-api:fabric-api:${fabric_version}") | ||
modImplementation("fi.dy.masa.malilib:malilib-fabric-${malilib_version}") | ||
modImplementation("curse.maven:litematica-${litematica_projectid}:${litematica_fileid}") | ||
} | ||
|
||
repositories { | ||
maven("https://masa.dy.fi/maven") | ||
maven("https://www.cursemaven.com") | ||
} | ||
|
||
val sourceModule = "v1_19_3" | ||
val targetModules = arrayOf("v1_19", "v1_18", "v1_17") | ||
|
||
fun copyFile(source: File) { | ||
for (targetModule in targetModules) { | ||
val destination = file(source.absolutePath.replace(sourceModule, targetModule)) | ||
println("Copying ${source.absolutePath} to ${destination.absolutePath}") | ||
destination.parentFile.mkdirs() | ||
source.copyTo(destination, true) | ||
destination.writeText(destination.readText().replace(sourceModule, targetModule)) | ||
} | ||
} | ||
|
||
fun deleteOldFiles(sourceBase: File) { | ||
for (targetModule in targetModules) { | ||
val targetBase = file(sourceBase.absolutePath.replace(sourceModule, targetModule)) | ||
|
||
for (file in targetBase.listFiles()) { | ||
if (file.name.equals("implementation")) continue | ||
println("Deleting recursively ${file.absolutePath}") | ||
file.deleteRecursively() | ||
} | ||
} | ||
} | ||
|
||
val syncImplementations = tasks.create("syncImplementations") { | ||
doFirst { | ||
val sourceStart = | ||
this.project.projectDir.absolutePath + "/src/main/java/me/aleksilassila/litematica/printer/" + sourceModule | ||
val sourceDir = file(sourceStart) | ||
|
||
deleteOldFiles(sourceDir) | ||
|
||
for (sourceFile in sourceDir.listFiles()) { | ||
if (sourceFile.name.equals("implementation")) continue | ||
|
||
sourceFile.walk() | ||
.filter { it.isFile } | ||
.forEach { | ||
copyFile(it) | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.