Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mc1.20.4 #4

Open
wants to merge 1 commit into
base: 8-advancedItems
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
tab_width = 4

[*.gradle]
indent_style = tab

[*.java]
indent_style = tab
ij_continuation_indent_size = 4
ij_java_imports_layout = $*,|,java.**,|,javax.**,|,*,|,net.minecraft.**,|,net.fabricmc.**
ij_java_class_count_to_use_import_on_demand = 999

[*.json]
indent_style = tab
indent_size = 4

[*.properties]
indent_style = space
indent_size = 2

[.editorconfig]
indent_style = space
indent_size = 4

[*.{yaml,yml}]
indent_style = space
indent_size = 2
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ hs_err_*.log
replay_*.log
*.hprof
*.jfr

# datagen generated

.cache/
38 changes: 21 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
plugins {
id 'fabric-loom' version '1.2-SNAPSHOT'
id 'fabric-loom' version '1.4-SNAPSHOT'
id 'maven-publish'
}

version = project.mod_version
version = project.mod_version + "+mc" + project.minecraft_version
group = project.maven_group

base {
archivesName = project.archives_base_name
}

repositories {
// Add repositories to retrieve artifacts from in here.
// You should only use this when depending on other mods because
// Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
// See https://docs.gradle.org/current/userguide/declaring_repositories.html
// for more information about repositories.
maven { url = "https://maven.fabricmc.net/" } // Fabric
maven { url = "https://maven.shedaniel.me/" } // Cloth Config
maven { url = "https://maven.terraformersmc.com/releases/" } // Mod Menu
}

loom {
Expand All @@ -26,7 +24,7 @@ loom {
name "Data Generation"
vmArg "-Dfabric-api.datagen"
vmArg "-Dfabric-api.datagen.output-dir=${file("src/main/generated")}"
vmArg "-Dfabric-api.datagen.modid=mccourse"
vmArg "-Dfabric-api.datagen.modid=${project.archives_base_name}"

runDir "build/datagen"
}
Expand All @@ -43,6 +41,7 @@ sourceSets {
}
}
}

dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
Expand All @@ -51,11 +50,21 @@ dependencies {

// Fabric API. This is technically optional, but you probably want it anyway.
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"

// Uncomment the following line to enable the deprecated Fabric API modules.
// These are included in the Fabric API production distribution and allow you to update your mod to the latest modules at a later more convenient time.

// modImplementation "net.fabricmc.fabric-api:fabric-api-deprecated:${project.fabric_version}"
// ModMenu and ClothConfig
modApi "com.terraformersmc:modmenu:${project.modmenu_version}"
modApi("me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config_version}") {
exclude(group: "net.fabricmc.fabric-api")
}

// REI
modCompileOnly "me.shedaniel:RoughlyEnoughItems-api-fabric:${project.rei_version}"
modRuntimeOnly "me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}"

// Tech Reborn Energy
modApi("teamreborn:energy:${project.teamreborn_energy_version}") {
exclude(group: "net.fabricmc.fabric-api")
}
}

processResources {
Expand All @@ -71,11 +80,6 @@ tasks.withType(JavaCompile).configureEach {
}

java {
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task
// if it is present.
// If you remove this line, sources will not be generated.
withSourcesJar()

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
Expand Down
18 changes: 13 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,22 @@ org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.1
loader_version=0.14.21
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.3
loader_version=0.15.3

# Mod Properties
mod_version=0.1-1.20.1
mod_version=0.1.1
maven_group=net.kaupenjoe.mccourse
archives_base_name=mccourse

# Dependencies
fabric_version=0.83.1+1.20.1
fabric_version=0.91.3+1.20.4

# Shedaniel API's: https://linkie.shedaniel.me/dependencies
modmenu_version = 9.0.0
cloth_config_version = 13.0.114
rei_version = 14.0.687

# Team Reborn API
teamreborn_energy_version = 3.0.0
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
8 changes: 4 additions & 4 deletions src/main/java/net/kaupenjoe/mccourse/MCCourseMod.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package net.kaupenjoe.mccourse;

import net.fabricmc.api.ModInitializer;

import net.kaupenjoe.mccourse.block.ModBlocks;
import net.kaupenjoe.mccourse.item.ModItemGroup;
import net.kaupenjoe.mccourse.item.ModItems;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import net.fabricmc.api.ModInitializer;

public class MCCourseMod implements ModInitializer {
public static final String MOD_ID = "mccourse";
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);
public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);

@Override
public void onInitialize() {
Expand All @@ -20,4 +20,4 @@ public void onInitialize() {
ModBlocks.registerModBlocks();

}
}
}
6 changes: 3 additions & 3 deletions src/main/java/net/kaupenjoe/mccourse/MCCourseModClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import net.fabricmc.api.ClientModInitializer;

public class MCCourseModClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
@Override
public void onInitializeClient() {

}
}
}
71 changes: 42 additions & 29 deletions src/main/java/net/kaupenjoe/mccourse/block/ModBlocks.java
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package net.kaupenjoe.mccourse.block;

import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.kaupenjoe.mccourse.MCCourseMod;

import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.block.ExperienceDroppingBlock;
Expand All @@ -13,32 +12,46 @@
import net.minecraft.util.Identifier;
import net.minecraft.util.math.intprovider.UniformIntProvider;

import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;

public class ModBlocks {
public static final Block PINK_GARNET_BLOCK = registerBlock("pink_garnet_block",
new Block(FabricBlockSettings.copyOf(Blocks.IRON_BLOCK)));
public static final Block RAW_PINK_GARNET_BLOCK = registerBlock("raw_pink_garnet_block",
new Block(FabricBlockSettings.copyOf(Blocks.IRON_BLOCK)));

public static final Block PINK_GARNET_ORE = registerBlock("pink_garnet_ore",
new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.STONE), UniformIntProvider.create(3, 6)));
public static final Block DEEPSLATE_PINK_GARNET_ORE = registerBlock("deepslate_pink_garnet_ore",
new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.DEEPSLATE), UniformIntProvider.create(3, 6)));
public static final Block END_STONE_PINK_GARNET_ORE = registerBlock("end_stone_pink_garnet_ore",
new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.END_STONE), UniformIntProvider.create(3, 6)));
public static final Block NETHER_PINK_GARNET_ORE = registerBlock("nether_pink_garnet_ore",
new ExperienceDroppingBlock(FabricBlockSettings.copyOf(Blocks.NETHERRACK), UniformIntProvider.create(3, 6)));

private static Block registerBlock(String name, Block block) {
registerBlockItem(name, block);
return Registry.register(Registries.BLOCK, new Identifier(MCCourseMod.MOD_ID, name), block);
}

private static Item registerBlockItem(String name, Block block) {
return Registry.register(Registries.ITEM, new Identifier(MCCourseMod.MOD_ID, name),
new BlockItem(block, new FabricItemSettings()));
}

public static void registerModBlocks() {
MCCourseMod.LOGGER.info("Registering ModBlocks for " + MCCourseMod.MOD_ID);
}
public static final Block PINK_GARNET_BLOCK = registerBlock("pink_garnet_block",
new Block(FabricBlockSettings.copyOf(Blocks.IRON_BLOCK)));
public static final Block RAW_PINK_GARNET_BLOCK = registerBlock("raw_pink_garnet_block",
new Block(FabricBlockSettings.copyOf(Blocks.IRON_BLOCK)));

public static final Block PINK_GARNET_ORE = registerBlock("pink_garnet_ore",
new ExperienceDroppingBlock(
UniformIntProvider.create(3, 6),
FabricBlockSettings.copyOf(Blocks.STONE)));
public static final Block DEEPSLATE_PINK_GARNET_ORE = registerBlock("deepslate_pink_garnet_ore",
new ExperienceDroppingBlock(
UniformIntProvider.create(3, 6),
FabricBlockSettings.copyOf(Blocks.DEEPSLATE)));
public static final Block END_STONE_PINK_GARNET_ORE = registerBlock("end_stone_pink_garnet_ore",
new ExperienceDroppingBlock(
UniformIntProvider.create(3, 6),
FabricBlockSettings.copyOf(Blocks.END_STONE)));
public static final Block NETHER_PINK_GARNET_ORE = registerBlock("nether_pink_garnet_ore",
new ExperienceDroppingBlock(
UniformIntProvider.create(3, 6),
FabricBlockSettings.copyOf(Blocks.NETHERRACK)));

@SuppressWarnings("UnusedReturnValue")
private static Block registerBlock(String name, Block block) {
registerBlockItem(name, block);
return Registry.register(Registries.BLOCK, new Identifier(MCCourseMod.MOD_ID, name), block);
}

@SuppressWarnings("UnusedReturnValue")
private static Item registerBlockItem(String name, Block block) {
return Registry.register(Registries.ITEM, new Identifier(MCCourseMod.MOD_ID, name),
new BlockItem(block, new FabricItemSettings()));
}

@SuppressWarnings("UnusedReturnValue")
public static void registerModBlocks() {
MCCourseMod.LOGGER.info("Registering ModBlocks for " + MCCourseMod.MOD_ID);
}
}
36 changes: 19 additions & 17 deletions src/main/java/net/kaupenjoe/mccourse/item/ModItemGroup.java
Original file line number Diff line number Diff line change
@@ -1,35 +1,37 @@
package net.kaupenjoe.mccourse.item;

import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup;
import net.kaupenjoe.mccourse.MCCourseMod;
import net.kaupenjoe.mccourse.block.ModBlocks;

import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;

import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup;

public class ModItemGroup {
public static final ItemGroup PINK_GARNET_GROUP = Registry.register(Registries.ITEM_GROUP,
new Identifier(MCCourseMod.MOD_ID, "pink_garnet_group"),
FabricItemGroup.builder().displayName(Text.translatable("itemgroup.pink_garnet_group"))
.icon(() -> new ItemStack(ModItems.PINK_GARNET)).entries((displayContext, entries) -> {
entries.add(ModItems.PINK_GARNET);
entries.add(ModItems.RAW_PINK_GARNET);
entries.add(ModItems.METAL_DETECTOR);
public static final ItemGroup PINK_GARNET_GROUP = Registry.register(Registries.ITEM_GROUP,
new Identifier(MCCourseMod.MOD_ID, "pink_garnet_group"),
FabricItemGroup.builder().displayName(Text.translatable("itemgroup.pink_garnet_group"))
.icon(() -> new ItemStack(ModItems.PINK_GARNET)).entries((displayContext, entries) -> {
entries.add(ModItems.PINK_GARNET);
entries.add(ModItems.RAW_PINK_GARNET);
entries.add(ModItems.METAL_DETECTOR);

entries.add(ModBlocks.PINK_GARNET_BLOCK);
entries.add(ModBlocks.RAW_PINK_GARNET_BLOCK);
entries.add(ModBlocks.PINK_GARNET_BLOCK);
entries.add(ModBlocks.RAW_PINK_GARNET_BLOCK);

entries.add(ModBlocks.PINK_GARNET_ORE);
entries.add(ModBlocks.DEEPSLATE_PINK_GARNET_ORE);
entries.add(ModBlocks.END_STONE_PINK_GARNET_ORE);
entries.add(ModBlocks.NETHER_PINK_GARNET_ORE);
entries.add(ModBlocks.PINK_GARNET_ORE);
entries.add(ModBlocks.DEEPSLATE_PINK_GARNET_ORE);
entries.add(ModBlocks.END_STONE_PINK_GARNET_ORE);
entries.add(ModBlocks.NETHER_PINK_GARNET_ORE);

}).build());
}).build());

public static void registerItemGroups() {
public static void registerItemGroups() {

}
}
}
Loading