-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a7eaac1
Showing
1,395 changed files
with
8,209 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
build | ||
.idea | ||
.DS_Store | ||
.gradle | ||
run | ||
runs |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,59 @@ | ||
plugins { | ||
id 'dev.architectury.loom' version '1.6-SNAPSHOT' apply false | ||
id 'architectury-plugin' version '3.4-SNAPSHOT' | ||
id 'com.github.johnrengelman.shadow' version '8.1.1' apply false | ||
} | ||
|
||
architectury { | ||
minecraft = project.minecraft_version | ||
} | ||
|
||
allprojects { | ||
group = rootProject.maven_group | ||
version = rootProject.mod_version | ||
} | ||
|
||
subprojects { | ||
apply plugin: 'dev.architectury.loom' | ||
apply plugin: 'architectury-plugin' | ||
apply plugin: 'maven-publish' | ||
|
||
base { | ||
archivesName = "$rootProject.archives_name-$project.name" | ||
} | ||
|
||
repositories { | ||
} | ||
|
||
loom { | ||
silentMojangMappingsLicense() | ||
} | ||
|
||
dependencies { | ||
minecraft "net.minecraft:minecraft:$rootProject.minecraft_version" | ||
mappings loom.officialMojangMappings() | ||
} | ||
|
||
java { | ||
withSourcesJar() | ||
|
||
sourceCompatibility = JavaVersion.VERSION_21 | ||
targetCompatibility = JavaVersion.VERSION_21 | ||
} | ||
|
||
tasks.withType(JavaCompile).configureEach { | ||
it.options.release = 21 | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
artifactId = base.archivesName.get() | ||
from components.java | ||
} | ||
} | ||
|
||
repositories { | ||
} | ||
} | ||
} |
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,8 @@ | ||
architectury { | ||
common rootProject.enabled_platforms.split(',') | ||
} | ||
|
||
dependencies { | ||
modImplementation "net.fabricmc:fabric-loader:$rootProject.fabric_loader_version" | ||
modImplementation "dev.architectury:architectury:$rootProject.architectury_api_version" | ||
} |
35 changes: 35 additions & 0 deletions
35
common/src/main/java/dev/ftb/mods/ftbmaterials/AssetImportTmp.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,35 @@ | ||
package dev.ftb.mods.ftbmaterials; | ||
|
||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
|
||
public class AssetImportTmp { | ||
static Path fromPath = Path.of("/Users/michael/Downloads/Mod textures"); | ||
|
||
public static void main(String[] args) { | ||
try (var files = Files.walk(fromPath)) { | ||
var justPngs = files.filter(p -> p.toString().endsWith(".png")).toList(); | ||
|
||
for (var file : justPngs) { | ||
var fileName = file.getFileName().toString(); | ||
var fixedName = fileName | ||
.replaceAll("_", ":") | ||
.replaceAll(" ", ":") | ||
.replaceAll(":", "_"); | ||
|
||
fixedName = fixedName.toLowerCase(); | ||
var outPath = Path.of("/Users/michael/Dev/work/ftb/mods/FTB-Resources/common/src/main/resources/assets/ftbmaterials/textures"); | ||
if (fixedName.contains("block")) { | ||
outPath = outPath.resolve("block"); | ||
} else { | ||
outPath = outPath.resolve("item"); | ||
} | ||
|
||
Files.write(outPath.resolve(fixedName), Files.readAllBytes(file)); | ||
System.out.println(fixedName); | ||
} | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
common/src/main/java/dev/ftb/mods/ftbmaterials/FTBMaterials.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 dev.ftb.mods.ftbmaterials; | ||
|
||
import dev.ftb.mods.ftbmaterials.registry.ModBlocks; | ||
import dev.ftb.mods.ftbmaterials.registry.ModCreativeTab; | ||
import dev.ftb.mods.ftbmaterials.registry.ModItems; | ||
import dev.ftb.mods.ftbmaterials.resources.ResourceRegistry; | ||
|
||
public final class FTBMaterials { | ||
public static final String MOD_ID = "ftbmaterials"; | ||
|
||
public static void init() { | ||
// Write common init code here. | ||
ModCreativeTab.REGISTRY.register(); | ||
|
||
ResourceRegistry.init(); | ||
ModBlocks.REGISTRY.register(); | ||
ModItems.REGISTRY.register(); | ||
} | ||
} |
64 changes: 64 additions & 0 deletions
64
common/src/main/java/dev/ftb/mods/ftbmaterials/OreVariantsGenerator.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,64 @@ | ||
package dev.ftb.mods.ftbmaterials; | ||
|
||
import javax.imageio.ImageIO; | ||
import java.awt.*; | ||
import java.awt.image.BufferedImage; | ||
import java.io.File; | ||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
import java.util.List; | ||
|
||
public class OreVariantsGenerator { | ||
static Path rootPath = Path.of("/Users/michael/.gradle/caches/fabric-loom/1.21/neoforge/21.0.85-beta/client-extra/assets/minecraft/"); | ||
|
||
static Path stoneTexture = rootPath.resolve("textures/block/stone.png"); | ||
static Path netherrackTexture = rootPath.resolve("textures/block/netherrack.png"); | ||
static Path endStoneTexture = rootPath.resolve("textures/block/end_stone.png"); | ||
static Path deepslateTexture = rootPath.resolve("textures/block/deepslate.png"); | ||
|
||
static List<Path> variants = List.of( | ||
stoneTexture, | ||
netherrackTexture, | ||
endStoneTexture, | ||
deepslateTexture | ||
); | ||
|
||
static List<String> variantNames = List.of( | ||
"stone_ore", | ||
"nether_ore", | ||
"end_ore", | ||
"deepslate_ore" | ||
); | ||
|
||
static Path fromPath = Path.of("/Users/michael/Dev/work/ftb/mods/FTB-Resources/assets/ore_overlays"); | ||
|
||
public static void main(String[] args) throws IOException { | ||
var overlays = Files.list(fromPath).toList(); | ||
for (var overlayFile : overlays) { | ||
// Read the file | ||
var overlayBytes = ImageIO.read(overlayFile.toFile()); | ||
|
||
for (var variant : variants) { | ||
var arrayIndex = variants.indexOf(variant); | ||
var variantName = variantNames.get(arrayIndex); | ||
|
||
// Read in the base texture | ||
var variantBytes = ImageIO.read(variant.toFile()); | ||
|
||
BufferedImage combinedImage = new BufferedImage(variantBytes.getWidth(), variantBytes.getHeight(), BufferedImage.TYPE_INT_ARGB); | ||
Graphics g = combinedImage.createGraphics(); | ||
g.drawImage(variantBytes, 0, 0, null); | ||
g.drawImage(overlayBytes, 0, 0, null); | ||
g.dispose(); | ||
|
||
var outputName = overlayFile.getFileName().toString() | ||
.replace("_ore_overlay", "") | ||
.replace(".png", "") | ||
+ "_" + variantName + ".png"; | ||
|
||
ImageIO.write(combinedImage, "png", new File("/Users/michael/Dev/work/ftb/mods/FTB-Resources/assets/tmp/" + outputName)); | ||
} | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
common/src/main/java/dev/ftb/mods/ftbmaterials/integration/Mek.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,8 @@ | ||
package dev.ftb.mods.ftbmaterials.integration; | ||
|
||
public class Mek implements ModIntegration { | ||
@Override | ||
public void setup() { | ||
|
||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
common/src/main/java/dev/ftb/mods/ftbmaterials/integration/ModIntegration.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,5 @@ | ||
package dev.ftb.mods.ftbmaterials.integration; | ||
|
||
public interface ModIntegration { | ||
void setup(); | ||
} |
43 changes: 43 additions & 0 deletions
43
common/src/main/java/dev/ftb/mods/ftbmaterials/integration/ModIntegrations.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,43 @@ | ||
package dev.ftb.mods.ftbmaterials.integration; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.util.HashMap; | ||
import java.util.function.Supplier; | ||
|
||
public enum ModIntegrations { | ||
INSTANCE; | ||
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(ModIntegrations.class); | ||
|
||
private boolean setup = false; | ||
private HashMap<String, Supplier<ModIntegration>> integrations = new HashMap<>(); | ||
|
||
public void init() { | ||
addIntegration("thermal", Thermal::new); | ||
addIntegration("modern_industrialization", ModernIndustrialization::new); | ||
addIntegration("mekanism", Mek::new); | ||
|
||
setupIntegrations(); | ||
} | ||
|
||
private void setupIntegrations() { | ||
if (setup) throw new IllegalStateException("Already setup!"); | ||
setup = true; | ||
|
||
integrations.forEach((modid, integration) -> { | ||
|
||
|
||
try { | ||
integration.get().setup(); | ||
} catch (Exception ex) { | ||
LOGGER.error("Failed to setup integration for mod {}", modid, ex); | ||
} | ||
}); | ||
} | ||
|
||
public void addIntegration(String modid, Supplier<ModIntegration> integration) { | ||
integrations.put(modid, integration); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
common/src/main/java/dev/ftb/mods/ftbmaterials/integration/ModernIndustrialization.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,8 @@ | ||
package dev.ftb.mods.ftbmaterials.integration; | ||
|
||
public class ModernIndustrialization implements ModIntegration { | ||
@Override | ||
public void setup() { | ||
|
||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
common/src/main/java/dev/ftb/mods/ftbmaterials/integration/Thermal.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,8 @@ | ||
package dev.ftb.mods.ftbmaterials.integration; | ||
|
||
public class Thermal implements ModIntegration { | ||
@Override | ||
public void setup() { | ||
|
||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
common/src/main/java/dev/ftb/mods/ftbmaterials/registry/ModBlocks.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,13 @@ | ||
package dev.ftb.mods.ftbmaterials.registry; | ||
|
||
import dev.architectury.registry.registries.DeferredRegister; | ||
import dev.ftb.mods.ftbmaterials.FTBMaterials; | ||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.block.Blocks; | ||
|
||
public class ModBlocks { | ||
public static final DeferredRegister<Block> REGISTRY = DeferredRegister.create(FTBMaterials.MOD_ID, Registries.BLOCK); | ||
|
||
public static final Block.Properties DEFAULT_PROPS = Block.Properties.ofFullCopy(Blocks.STONE); | ||
} |
20 changes: 20 additions & 0 deletions
20
common/src/main/java/dev/ftb/mods/ftbmaterials/registry/ModCreativeTab.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,20 @@ | ||
package dev.ftb.mods.ftbmaterials.registry; | ||
|
||
import dev.architectury.registry.registries.DeferredRegister; | ||
import dev.architectury.registry.registries.DeferredSupplier; | ||
import dev.ftb.mods.ftbmaterials.FTBMaterials; | ||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.world.item.CreativeModeTab; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.level.block.Blocks; | ||
|
||
public class ModCreativeTab { | ||
public static final DeferredRegister<CreativeModeTab> REGISTRY = DeferredRegister.create(FTBMaterials.MOD_ID, Registries.CREATIVE_MODE_TAB); | ||
|
||
public static final DeferredSupplier<CreativeModeTab> TAB = REGISTRY.register("ftbmaterials", () -> CreativeModeTab.builder(CreativeModeTab.Row.TOP, 0) | ||
.title(Component.translatable("itemGroup.ftbmaterials.ftbmaterials_main")) | ||
.icon(() -> new ItemStack(Blocks.DIAMOND_BLOCK)) | ||
.build() | ||
); | ||
} |
12 changes: 12 additions & 0 deletions
12
common/src/main/java/dev/ftb/mods/ftbmaterials/registry/ModItems.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,12 @@ | ||
package dev.ftb.mods.ftbmaterials.registry; | ||
|
||
import dev.architectury.registry.registries.DeferredRegister; | ||
import dev.ftb.mods.ftbmaterials.FTBMaterials; | ||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.world.item.Item; | ||
|
||
public class ModItems { | ||
public static final DeferredRegister<Item> REGISTRY = DeferredRegister.create(FTBMaterials.MOD_ID, Registries.ITEM); | ||
|
||
public static final Item.Properties DEFAULT_PROPS = new Item.Properties().arch$tab(ModCreativeTab.TAB.get()); | ||
} |
10 changes: 10 additions & 0 deletions
10
common/src/main/java/dev/ftb/mods/ftbmaterials/resources/ConfiguredGeneration.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 dev.ftb.mods.ftbmaterials.resources; | ||
|
||
/** | ||
* Config backed generation setup | ||
*/ | ||
public record ConfiguredGeneration( | ||
|
||
) { | ||
|
||
} |
Oops, something went wrong.