Skip to content

Commit

Permalink
1.20 starters
Browse files Browse the repository at this point in the history
  • Loading branch information
xanthian committed Jul 13, 2023
1 parent 61ae2f1 commit 3cbb43d
Show file tree
Hide file tree
Showing 24 changed files with 226 additions and 26 deletions.
18 changes: 7 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.2-SNAPSHOT'
id 'fabric-loom' version '1.3-SNAPSHOT'
id 'maven-publish'
}

Expand All @@ -11,11 +11,7 @@ base {
}

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.shedaniel.me/" }
}

loom {
Expand Down Expand Up @@ -44,18 +40,18 @@ sourceSets {
}
}
dependencies {
implementation 'org.jetbrains:annotations:24.0.0'

// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

// 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}"
//Tech Reborn
modCompileOnly ("TechReborn:TechReborn-${project.techreborn_version}") { exclude group: "net.fabricmc.fabric-api" exclude group: "RebornCore"}
modCompileOnly ("RebornCore:RebornCore-${project.reborncore_version}") { exclude group: "net.fabricmc.fabric-api"}
}

processResources {
Expand Down
6 changes: 4 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ org.gradle.parallel=true

# Fabric Properties
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.5
yarn_mappings=1.20.1+build.9
loader_version=0.14.21

#Fabric api
fabric_version=0.84.0+1.20.1
fabric_version=0.85.0+1.20.1

# Mod Properties
mod_version=6.0
maven_group=xanthian
archives_base_name=variantcraftingtables
techreborn_version=1.20:5.8.3
reborncore_version=1.20:5.8.3


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.2-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "variantcraftingtables:block/tr_rubber_crafting_table"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"block.variantcraftingtables.jungle_crafting_table": "Jungle Crafting Table",
"block.variantcraftingtables.mangrove_crafting_table": "Mangrove Crafting Table",
"block.variantcraftingtables.spruce_crafting_table": "Spruce Crafting Table",
"block.variantcraftingtables.tr_rubber_crafting_table": "Rubber Crafting Table",
"block.variantcraftingtables.warped_crafting_table": "Warped Crafting Table",
"variantcraftingtables.group.variantcraftingtables": "Variant Crafting Tables"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"parent": "minecraft:block/cube",
"textures": {
"down": "techreborn:block/rubber_planks",
"east": "variantcraftingtables:block/tr_rubber_crafting_table_side",
"north": "variantcraftingtables:block/tr_rubber_crafting_table_front",
"particle": "variantcraftingtables:block/tr_rubber_crafting_table_front",
"south": "variantcraftingtables:block/tr_rubber_crafting_table_side",
"up": "variantcraftingtables:block/tr_rubber_crafting_table_top",
"west": "variantcraftingtables:block/tr_rubber_crafting_table_front"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "variantcraftingtables:block/tr_rubber_crafting_table"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"fabric:load_conditions": [
{
"condition": "fabric:all_mods_loaded",
"values": [
"techreborn"
]
}
],
"parent": "minecraft:recipes/root",
"criteria": {
"has_rubber_planks": {
"conditions": {
"items": [
{
"items": [
"techreborn:rubber_planks"
]
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "variantcraftingtables:tr_rubber_crafting_table"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_rubber_planks",
"has_the_recipe"
]
],
"rewards": {
"recipes": [
"variantcraftingtables:tr_rubber_crafting_table"
]
},
"sends_telemetry_event": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"fabric:load_conditions": [
{
"condition": "fabric:all_mods_loaded",
"values": [
"techreborn"
]
}
],
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "variantcraftingtables:tr_rubber_crafting_table"
}
],
"rolls": 1.0
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"fabric:load_conditions": [
{
"condition": "fabric:all_mods_loaded",
"values": [
"techreborn"
]
}
],
"type": "minecraft:crafting_shaped",
"category": "misc",
"key": {
"#": {
"item": "techreborn:rubber_planks"
}
},
"pattern": [
"##",
"##"
],
"result": {
"item": "variantcraftingtables:tr_rubber_crafting_table"
},
"show_notification": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
"variantcraftingtables:jungle_crafting_table",
"variantcraftingtables:mangrove_crafting_table",
"variantcraftingtables:spruce_crafting_table",
"variantcraftingtables:warped_crafting_table"
"variantcraftingtables:warped_crafting_table",
{
"id": "variantcraftingtables:tr_rubber_crafting_table",
"required": false
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
"variantcraftingtables:jungle_crafting_table",
"variantcraftingtables:mangrove_crafting_table",
"variantcraftingtables:spruce_crafting_table",
"variantcraftingtables:warped_crafting_table"
"variantcraftingtables:warped_crafting_table",
{
"id": "variantcraftingtables:tr_rubber_crafting_table",
"required": false
}
]
}
11 changes: 9 additions & 2 deletions src/main/java/net/xanthian/variantcraftingtables/Initialise.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup;

import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.block.Blocks;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
Expand All @@ -14,10 +15,9 @@
import net.minecraft.util.Identifier;

import net.xanthian.variantcraftingtables.block.CraftingTables;
import net.xanthian.variantcraftingtables.block.compatability.TechReborn;
import net.xanthian.variantcraftingtables.util.ModRegistries;

import java.util.Comparator;

public class Initialise implements ModInitializer {

public static final String MOD_ID = "variantcraftingtables";
Expand All @@ -44,10 +44,17 @@ public void onInitialize() {
entries.add(Blocks.CRAFTING_TABLE); // Oak
entries.add(CraftingTables.SPRUCE_CRAFTING_TABLE);
entries.add(CraftingTables.WARPED_CRAFTING_TABLE);
if (FabricLoader.getInstance().isModLoaded("techreborn")) {
entries.add(TechReborn.TR_RUBBER_CRAFTING_TABLE);
}
})
.build());

CraftingTables.registerVanillaTables();
ModRegistries.registerFuelandFlammable();

if (FabricLoader.getInstance().isModLoaded("techreborn")) {
TechReborn.registerTechRebornTables();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package net.xanthian.variantcraftingtables.block.compatability;

import net.fabricmc.fabric.api.item.v1.FabricItemSettings;

import net.minecraft.block.Block;
import net.minecraft.item.BlockItem;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.util.Identifier;
import net.xanthian.variantcraftingtables.Initialise;
import net.xanthian.variantcraftingtables.block.VariantCraftingTableBlock;

public class TechReborn {

// Vanilla
public static Block TR_RUBBER_CRAFTING_TABLE;

public static void registerTechRebornTables() {
TR_RUBBER_CRAFTING_TABLE = registerCraftingTable("tr_rubber_crafting_table");

}

public static Block register(String Id, Block block) {
Identifier identifier = new Identifier(Initialise.MOD_ID, Id.toLowerCase());
Registry.register(Registries.BLOCK, identifier, block);
Registry.register(Registries.ITEM, identifier, new BlockItem(block, new FabricItemSettings()));

return block;
}

public static Block registerCraftingTable(String id) {
return register(id, new VariantCraftingTableBlock());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ protected void configure (RegistryWrapper.WrapperLookup arg){
.add(CraftingTables.JUNGLE_CRAFTING_TABLE)
.add(CraftingTables.MANGROVE_CRAFTING_TABLE)
.add(CraftingTables.SPRUCE_CRAFTING_TABLE)
.add(CraftingTables.WARPED_CRAFTING_TABLE);
.add(CraftingTables.WARPED_CRAFTING_TABLE)
.addOptional(new Identifier("variantcraftingtables:tr_rubber_crafting_table"));


getOrCreateTagBuilder(MINEABLE_AXE)
.addTag(CRAFTINGTABLES);
.forceAddTag(CRAFTINGTABLES);

getOrCreateTagBuilder(WORKBENCH)
.addTag(CRAFTINGTABLES);
.forceAddTag(CRAFTINGTABLES);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ protected void configure (RegistryWrapper.WrapperLookup arg){
.add(CraftingTables.JUNGLE_CRAFTING_TABLE.asItem())
.add(CraftingTables.MANGROVE_CRAFTING_TABLE.asItem())
.add(CraftingTables.SPRUCE_CRAFTING_TABLE.asItem())
.add(CraftingTables.WARPED_CRAFTING_TABLE.asItem());
.add(CraftingTables.WARPED_CRAFTING_TABLE.asItem())
.addOptional(new Identifier("variantcraftingtables:tr_rubber_crafting_table"));

getOrCreateTagBuilder(NON_FLAMMABLE_WOOD)
.add(CraftingTables.CRIMSON_CRAFTING_TABLE.asItem())
.add(CraftingTables.WARPED_CRAFTING_TABLE.asItem());

getOrCreateTagBuilder(WORKBENCH)
.addTag(CRAFTINGTABLES);
.forceAddTag(CRAFTINGTABLES);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import net.xanthian.variantcraftingtables.Initialise;
import net.xanthian.variantcraftingtables.block.*;
import net.xanthian.variantcraftingtables.block.compatability.TechReborn;

public class LangFileGenerator extends FabricLanguageProvider {
public LangFileGenerator(FabricDataOutput dataOutput) {
Expand All @@ -29,5 +30,6 @@ public void generateTranslations(TranslationBuilder translationBuilder) {
translationBuilder.add(Blocks.CRAFTING_TABLE, "Oak Crafting Table");
translationBuilder.add(CraftingTables.SPRUCE_CRAFTING_TABLE, "Spruce Crafting Table");
translationBuilder.add(CraftingTables.WARPED_CRAFTING_TABLE, "Warped Crafting Table");
translationBuilder.add(TechReborn.TR_RUBBER_CRAFTING_TABLE, "Rubber Crafting Table");
}
}
Loading

0 comments on commit 3cbb43d

Please sign in to comment.