Skip to content

Commit

Permalink
init push
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelHillcox committed Sep 2, 2024
0 parents commit a7eaac1
Show file tree
Hide file tree
Showing 1,395 changed files with 8,209 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
build
.idea
.DS_Store
.gradle
run
runs
Binary file added assets/ore_overlays/aluminum_ore_overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/ore_overlays/antimony_ore_overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/ore_overlays/apatite_ore_overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/ore_overlays/gold_ore_overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/ore_overlays/iridium_ore_overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/ore_overlays/iron_ore_overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/ore_overlays/lead_ore_overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/ore_overlays/nickel_ore_overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/ore_overlays/osmium_ore_overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/ore_overlays/platinum_ore_overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/ore_overlays/silver_ore_overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/ore_overlays/tin_ore_overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/ore_overlays/titanium_ore_overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/ore_overlays/tungsten_ore_overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/ore_overlays/uranium_ore_overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/ore_overlays/zinc_ore_overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions build.gradle
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 {
}
}
}
8 changes: 8 additions & 0 deletions common/build.gradle
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 common/src/main/java/dev/ftb/mods/ftbmaterials/AssetImportTmp.java
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 common/src/main/java/dev/ftb/mods/ftbmaterials/FTBMaterials.java
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();
}
}
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));
}
}
}
}
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() {

}
}
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();
}
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);
}
}
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() {

}
}
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() {

}
}
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);
}
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()
);
}
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());
}
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(

) {

}
Loading

0 comments on commit a7eaac1

Please sign in to comment.