Skip to content

Commit

Permalink
1.20.x release 3
Browse files Browse the repository at this point in the history
Adds support for Deeper & Darker
Removed Variant block type in favor of vanilla CraftingTableBlock
Fixed Oak Crafting Table lang file
Moved created tab to separate class
fixed some janky datagen
  • Loading branch information
xanthian committed Aug 26, 2023
1 parent a7bf8fa commit dfb5d8c
Show file tree
Hide file tree
Showing 54 changed files with 411 additions and 169 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

## MIT License

Copyright (c) 2022 Xanthian
Copyright (c) 2023 Xanthian

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
Expand Down
8 changes: 8 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ sourceSets {
}
}
}
configurations.all {
resolutionStrategy {
force("net.fabricmc:fabric-loader:$loader_version")
}
}
dependencies {
implementation 'org.jetbrains:annotations:24.0.0'

Expand Down Expand Up @@ -84,6 +89,9 @@ dependencies {
modApi "dev.onyxstudios.cardinal-components-api:cardinal-components-base:5.2.1"
modApi "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:5.2.1"

// Deeper & Darker - (some sht about CustomPortalBlocks)
//modRuntimeOnly("curse.maven:deeperdarker-659011:4715721") {transitive false}

// Promenade
modRuntimeOnly("curse.maven:promenade-399648:4611967") {transitive false}
modRuntimeOnly("com.github.DawnTeamMC:DawnAPI:5.0.0")
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ loader_version=0.14.22
fabric_version=0.87.0+1.20.1

# Mod Properties
mod_version=6.1
mod_version=6.1.5
maven_group=xanthian
archives_base_name=variantcraftingtables
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 4 additions & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "variantcraftingtables:block/dad_echo_crafting_table"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"block.variantcraftingtables.bw_juniper_crafting_table": "Juniper Crafting Table",
"block.variantcraftingtables.cherry_crafting_table": "Cherry Crafting Table",
"block.variantcraftingtables.crimson_crafting_table": "Crimson Crafting Table",
"block.variantcraftingtables.dad_echo_crafting_table": "Echo Crafting Table",
"block.variantcraftingtables.dark_oak_crafting_table": "Dark Oak Crafting Table",
"block.variantcraftingtables.jungle_crafting_table": "Jungle Crafting Table",
"block.variantcraftingtables.ldbp_palm_crafting_table": "Palm Crafting Table",
Expand Down Expand Up @@ -57,6 +58,5 @@
"block.variantcraftingtables.sp_stone_pine_crafting_table": "Stone Pine 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"
"block.variantcraftingtables.warped_crafting_table": "Warped Crafting Table"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"parent": "minecraft:block/cube",
"textures": {
"down": "deeperdarker:block/echo_planks",
"east": "variantcraftingtables:block/dad_echo_crafting_table_side",
"north": "variantcraftingtables:block/dad_echo_crafting_table_front",
"particle": "variantcraftingtables:block/dad_echo_crafting_table_front",
"south": "variantcraftingtables:block/dad_echo_crafting_table_side",
"up": "variantcraftingtables:block/dad_echo_crafting_table_top",
"west": "variantcraftingtables:block/dad_echo_crafting_table_front"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"parent": "variantcraftingtables:block/dad_echo_crafting_table"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"fabric:load_conditions": [
{
"condition": "fabric:all_mods_loaded",
"values": [
"deeperdarker"
]
}
],
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"conditions": [
{
"condition": "minecraft:survives_explosion"
}
],
"entries": [
{
"type": "minecraft:item",
"name": "variantcraftingtables:dad_echo_crafting_table"
}
],
"rolls": 1.0
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
"id": "variantcraftingtables:bw_juniper_crafting_table",
"required": false
},
{
"id": "variantcraftingtables:dad_echo_crafting_table",
"required": false
},
{
"id": "variantcraftingtables:prom_dark_amaranth_crafting_table",
"required": false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@
"id": "variantcraftingtables:bw_juniper_crafting_table",
"required": false
},
{
"id": "variantcraftingtables:dad_echo_crafting_table",
"required": false
},
{
"id": "variantcraftingtables:prom_dark_amaranth_crafting_table",
"required": false
Expand Down
104 changes: 5 additions & 99 deletions src/main/java/net/xanthian/variantcraftingtables/Initialise.java
Original file line number Diff line number Diff line change
@@ -1,119 +1,21 @@
package net.xanthian.variantcraftingtables;

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;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;

import net.xanthian.variantcraftingtables.block.Vanilla;
import net.xanthian.variantcraftingtables.block.compatability.*;
import net.xanthian.variantcraftingtables.util.ModCreativeTab;
import net.xanthian.variantcraftingtables.util.ModRegistries;

public class Initialise implements ModInitializer {

public static final String MOD_ID = "variantcraftingtables";

public static final RegistryKey<ItemGroup> ITEM_GROUP = RegistryKey.of(RegistryKeys.ITEM_GROUP, new Identifier(MOD_ID, "variantcraftingtables"));

@Override
public void onInitialize() {

Registry.register(Registries.ITEM_GROUP, ITEM_GROUP, FabricItemGroup.builder()
.displayName(Text.translatable("variantcraftingtables.group.variantcraftingtables"))
.icon(() -> new ItemStack(Vanilla.MANGROVE_CRAFTING_TABLE))
.entries((context, entries) -> {

entries.add(Vanilla.ACACIA_CRAFTING_TABLE);
entries.add(Vanilla.BAMBOO_CRAFTING_TABLE);
entries.add(Vanilla.BIRCH_CRAFTING_TABLE);
entries.add(Vanilla.CHERRY_CRAFTING_TABLE);
entries.add(Vanilla.CRIMSON_CRAFTING_TABLE);
entries.add(Vanilla.DARK_OAK_CRAFTING_TABLE);
entries.add(Vanilla.JUNGLE_CRAFTING_TABLE);
entries.add(Vanilla.MANGROVE_CRAFTING_TABLE);
entries.add(Blocks.CRAFTING_TABLE); // Oak
entries.add(Vanilla.SPRUCE_CRAFTING_TABLE);
entries.add(Vanilla.WARPED_CRAFTING_TABLE);

if (FabricLoader.getInstance().isModLoaded("ad_astra")) {
entries.add(AdAstra.AA_AERONOS_CRAFTING_TABLE);
entries.add(AdAstra.AA_GLACIAN_CRAFTING_TABLE);
entries.add(AdAstra.AA_STROPHAR_CRAFTING_TABLE);
}
if (FabricLoader.getInstance().isModLoaded("beachparty")) {
entries.add(BeachParty.LDBP_PALM_CRAFTING_TABLE);
}
if (FabricLoader.getInstance().isModLoaded("betterarcheology")) {
entries.add(BetterArcheology.BA_ROTTEN_CRAFTING_TABLE);
}
if (FabricLoader.getInstance().isModLoaded("bewitchment")){
entries.add(Bewitchment.BW_CYPRESS_CRAFTING_TABLE);
entries.add(Bewitchment.BW_DRAGONS_BLOOD_CRAFTING_TABLE);
entries.add(Bewitchment.BW_ELDER_CRAFTING_TABLE);
entries.add(Bewitchment.BW_JUNIPER_CRAFTING_TABLE);
}
if (FabricLoader.getInstance().isModLoaded("promenade")) {
entries.add(Promenade.PROM_DARK_AMARANTH_CRAFTING_TABLE);
entries.add(Promenade.PROM_MAPLE_CRAFTING_TABLE);
entries.add(Promenade.PROM_PALM_CRAFTING_TABLE);
entries.add(Promenade.PROM_SAKURA_CRAFTING_TABLE);
}
if (FabricLoader.getInstance().isModLoaded("regions_unexplored")){
entries.add(RegionsUnexplored.RU_ALPHA_OAK_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_BAOBAB_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_BLACK_PAINTED_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_BLACKWOOD_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_BLUE_PAINTED_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_BROWN_PAINTED_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_CHERRY_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_CYAN_PAINTED_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_CYPRESS_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_DEAD_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_EUCALYPTUS_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_GRAY_PAINTED_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_GREEN_PAINTED_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_JOSHUA_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_LARCH_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_LIGHT_BLUE_PAINTED_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_LIGHT_GRAY_PAINTED_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_LIME_PAINTED_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_MAGENTA_PAINTED_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_MAPLE_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_MAUVE_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_ORANGE_PAINTED_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_PALM_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_PINE_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_PINK_PAINTED_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_PURPLE_PAINTED_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_REDWOOD_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_RED_PAINTED_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_SCULKWOOD_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_WHITE_PAINTED_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_WILLOW_CRAFTING_TABLE);
entries.add(RegionsUnexplored.RU_YELLOW_PAINTED_CRAFTING_TABLE);
}
if (FabricLoader.getInstance().isModLoaded("snifferplus")) {
entries.add(SnifferPlus.SP_STONE_PINE_CRAFTING_TABLE);
}
if (FabricLoader.getInstance().isModLoaded("techreborn")) {
entries.add(TechReborn.TR_RUBBER_CRAFTING_TABLE);
}
if (FabricLoader.getInstance().isModLoaded("vinery")) {
entries.add(Vinery.LDV_CHERRY_CRAFTING_TABLE);
}

})
.build());

Vanilla.registerTables();

if (FabricLoader.getInstance().isModLoaded("ad_astra")) { // DISABLE FOR DATAGEN
Expand All @@ -128,6 +30,9 @@ public void onInitialize() {
if (FabricLoader.getInstance().isModLoaded("bewitchment")) {
Bewitchment.registerTables();
}
if (FabricLoader.getInstance().isModLoaded("deeperdarker")) { // DISABLE FOR DATAGEN
DeeperAndDarker.registerTables();
}
if (FabricLoader.getInstance().isModLoaded("promenade")) {
Promenade.registerTables();
}
Expand All @@ -145,5 +50,6 @@ public void onInitialize() {
}

ModRegistries.registerFuelandFlammable();
ModCreativeTab.registerItemGroup();
}
}
28 changes: 18 additions & 10 deletions src/main/java/net/xanthian/variantcraftingtables/block/Vanilla.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,34 @@

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

import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.block.CraftingTableBlock;
import net.minecraft.block.MapColor;
import net.minecraft.block.enums.Instrument;
import net.minecraft.item.BlockItem;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.sound.BlockSoundGroup;
import net.minecraft.util.Identifier;

import net.xanthian.variantcraftingtables.Initialise;

public class Vanilla {

public static final VariantCraftingTableBlock ACACIA_CRAFTING_TABLE = new VariantCraftingTableBlock();
public static final VariantCraftingTableBlock BAMBOO_CRAFTING_TABLE = new VariantCraftingTableBlock();
public static final VariantCraftingTableBlock BIRCH_CRAFTING_TABLE = new VariantCraftingTableBlock();
public static final VariantCraftingTableBlock CHERRY_CRAFTING_TABLE = new VariantCraftingTableBlock();
public static final VariantCraftingTableBlock DARK_OAK_CRAFTING_TABLE = new VariantCraftingTableBlock();
public static final VariantCraftingTableBlock JUNGLE_CRAFTING_TABLE = new VariantCraftingTableBlock();
public static final VariantCraftingTableBlock MANGROVE_CRAFTING_TABLE = new VariantCraftingTableBlock();
public static final VariantCraftingTableBlock SPRUCE_CRAFTING_TABLE = new VariantCraftingTableBlock();
public static final VariantCraftingTableBlock WARPED_CRAFTING_TABLE = new VariantCraftingTableBlock();
public static final VariantCraftingTableBlock CRIMSON_CRAFTING_TABLE = new VariantCraftingTableBlock();
public static final CraftingTableBlock ACACIA_CRAFTING_TABLE = new CraftingTableBlock(FabricBlockSettings.copy(Blocks.CRAFTING_TABLE));
public static final CraftingTableBlock BAMBOO_CRAFTING_TABLE = new CraftingTableBlock(FabricBlockSettings.copy(Blocks.CRAFTING_TABLE));
public static final CraftingTableBlock BIRCH_CRAFTING_TABLE = new CraftingTableBlock(FabricBlockSettings.copy(Blocks.CRAFTING_TABLE));
public static final CraftingTableBlock CHERRY_CRAFTING_TABLE = new CraftingTableBlock(FabricBlockSettings.copy(Blocks.CRAFTING_TABLE));
public static final CraftingTableBlock CRIMSON_CRAFTING_TABLE = new CraftingTableBlock(FabricBlockSettings.create().mapColor(MapColor.DARK_CRIMSON).instrument(Instrument.BASS).strength(2.5F).sounds(BlockSoundGroup.WOOD));
public static final CraftingTableBlock DARK_OAK_CRAFTING_TABLE = new CraftingTableBlock(FabricBlockSettings.copy(Blocks.CRAFTING_TABLE));
public static final CraftingTableBlock JUNGLE_CRAFTING_TABLE = new CraftingTableBlock(FabricBlockSettings.copy(Blocks.CRAFTING_TABLE));
public static final CraftingTableBlock MANGROVE_CRAFTING_TABLE = new CraftingTableBlock(FabricBlockSettings.copy(Blocks.CRAFTING_TABLE));
// Vanilla Crafting Table is made from Oak
public static final CraftingTableBlock SPRUCE_CRAFTING_TABLE = new CraftingTableBlock(FabricBlockSettings.copy(Blocks.CRAFTING_TABLE));
public static final CraftingTableBlock WARPED_CRAFTING_TABLE = new CraftingTableBlock(FabricBlockSettings.create().mapColor(MapColor.DARK_AQUA).instrument(Instrument.BASS).strength(2.5F).sounds(BlockSoundGroup.WOOD));


public static void registerTables() {
registerCraftingTableBlock("acacia_crafting_table", ACACIA_CRAFTING_TABLE);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

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

import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.Blocks;
import net.minecraft.block.CraftingTableBlock;
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 AdAstra {

Expand All @@ -31,6 +33,6 @@ public static Block register(String Id, Block block) {
}

public static Block registerCraftingTable(String id) {
return register(id, new VariantCraftingTableBlock());
return register(id, new CraftingTableBlock(FabricBlockSettings.copy(Blocks.CRAFTING_TABLE)));
}
}
Loading

0 comments on commit dfb5d8c

Please sign in to comment.