Skip to content

Commit

Permalink
1.19.2
Browse files Browse the repository at this point in the history
  • Loading branch information
unix-supremacist committed Dec 7, 2023
1 parent 3fc67c7 commit 9f82ffb
Show file tree
Hide file tree
Showing 14 changed files with 134 additions and 106 deletions.
24 changes: 15 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ sourceSets {
}
}

configurations.all {
resolutionStrategy {
force("net.fabricmc:fabric-loader:$loader_version")
}
}

dependencies {
// To change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
Expand All @@ -83,9 +89,9 @@ dependencies {
}
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
modImplementation "TechReborn:TechReborn-1.20:5.9.1"
include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:0.2.0-rc.4")))
include modImplementation("net.feltmc:felt-splash-api:1.0.0-1.20.1"){
//modImplementation "TechReborn:TechReborn-1.20:5.9.1"
//include(implementation(annotationProcessor("io.github.llamalad7:mixinextras-fabric:0.2.0-rc.4")))
include modImplementation("net.feltmc:felt-splash-api:1.0.0-1.19.2"){
exclude(group: "com.terraformersmc")
}
/*include modImplementation("net.feltmc:felt-tool-api:1.0.0-1.20.1"){
Expand All @@ -95,16 +101,16 @@ dependencies {
exclude(group: "com.terraformersmc")
}*/
modRuntimeOnly "maven.modrinth:modmenu:${project.modmenu_version}"
modImplementation "io.github.ladysnake:PlayerAbilityLib:1.9.0"
modImplementation "io.github.ladysnake:PlayerAbilityLib:1.6.0"
//required for trinkets
modRuntimeOnly "dev.onyxstudios.cardinal-components-api:cardinal-components-base:5.3.0"
modRuntimeOnly "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:5.3.0"
modImplementation "dev.emi:trinkets:3.8.0"
modRuntimeOnly "maven.modrinth:jei:16.0.0.28"
modRuntimeOnly "dev.onyxstudios.cardinal-components-api:cardinal-components-base:5.0.2"
modRuntimeOnly "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:5.0.2"
modImplementation "dev.emi:trinkets:3.4.1"
//modRuntimeOnly "maven.modrinth:jei:11.6.0.1018"
//modRuntimeOnly "maven.modrinth:architectury-api:10.0.7+fabric"
//modRuntimeOnly "maven.modrinth:cloth-config:12.0.107+fabric"
//modRuntimeOnly "maven.modrinth:rei:13.0.654+fabric"
modRuntimeOnly "maven.modrinth:modernfix:${project.modernfix_version}"
//modRuntimeOnly "maven.modrinth:modernfix:${project.modernfix_version}"
//modRuntimeOnly "maven.modrinth:ferrite-core:6.0.0-fabric"
compileOnly 'org.projectlombok:lombok:1.18.24'
annotationProcessor 'org.projectlombok:lombok:1.18.24'
Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.20.2
yarn_mappings=1.20.2+build.1
loader_version=0.14.22
minecraft_version=1.19.2
yarn_mappings=1.19.2+build.28
loader_version=0.15.0

# Mod Properties
mod_version=1.1.0
Expand All @@ -15,8 +15,8 @@ maven_group=com.example
archives_base_name=alchemist

# Dependencies
fabric_version=0.89.2+1.20.2
fabric_version=0.77.0+1.19.2

#Env
modernfix_version = 5.7.3-beta.1+mc1.20.2-pre3
modmenu_version = 8.0.0-beta.2
modernfix_version = 5.7.4+mc1.19.2
modmenu_version = 4.2.0-beta.2
10 changes: 4 additions & 6 deletions src/main/java/io/github/unix_supremacist/Alchemist.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@
import io.github.unix_supremacist.data.BlockTag;
import io.github.unix_supremacist.item.AbstractEmpowerableItem;
import net.fabricmc.fabric.api.event.lifecycle.v1.CommonLifecycleEvents;
import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroup;
import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking;
import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.ItemStack;
Expand All @@ -21,16 +19,16 @@ public class Alchemist {
public static final String MODID = "alchemist";
public static final Logger LOGGER = LoggerFactory.getLogger(MODID);
public static final ResourceLocation empower_packet = new ResourceLocation(Alchemist.MODID, "empower_packet");
public static final CreativeModeTab tab = FabricItemGroup.builder()
public static final CreativeModeTab tab = FabricItemGroupBuilder.create(new ResourceLocation(Alchemist.MODID, "tab"))
.icon(() -> new ItemStack(AlchemistItems.philosophers_stone.getItem()))
.title(Component.translatable("itemGroup."+MODID))
.build();



public static void Init(){
LOGGER.info("Welcome to the World of Alchemy!");
Registry.register(BuiltInRegistries.CREATIVE_MODE_TAB, new ResourceLocation(MODID, "tab"), tab);
AlchemistRegistry.registerExchanges();

AlchemistSplashes.init();
AlchemistBlocks.values(); //force the enum to load
AlchemistItems.values(); //force the enum to load
Expand Down
38 changes: 38 additions & 0 deletions src/main/java/io/github/unix_supremacist/AlchemistRegistry.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package io.github.unix_supremacist;

import io.github.unix_supremacist.data.BlockTag;
import net.fabricmc.fabric.api.event.lifecycle.v1.CommonLifecycleEvents;
import net.minecraft.core.Registry;
import net.minecraft.world.level.block.Block;

import java.util.ArrayList;
import java.util.HashSet;

public class AlchemistRegistry {
public static HashSet<ArrayList<Block>> exchanges = new HashSet<>();
public static ArrayList<Block> terra = new ArrayList<>();
public static ArrayList<Block> wood = new ArrayList<>();
public static ArrayList<Block> leave = new ArrayList<>();

public static void registerExchanges(){
CommonLifecycleEvents.TAGS_LOADED.register((registries, client) -> {
Registry.BLOCK.getTagOrEmpty(BlockTag.terratag).iterator().forEachRemaining(t ->terra.add(t.value()));
Registry.BLOCK.getTagOrEmpty(BlockTag.woodtag).iterator().forEachRemaining(t ->wood.add(t.value()));
Registry.BLOCK.getTagOrEmpty(BlockTag.leavetag).iterator().forEachRemaining(t ->leave.add(t.value()));
exchanges.add(terra);
exchanges.add(wood);
exchanges.add(leave);
});
}

public static Block getBlockWithOffset(Block b, ArrayList<Block> exchange, int o){
int id = exchange.indexOf(b);
int size = exchange.size();
id += o;
if (id < 0)
id = size + id % size;
else
id %= size;
return exchange.get(id);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
import lombok.Getter;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.material.Material;

public enum AlchemistBlocks {
transmutation_circle(new TransmutionCircleBlock(FabricBlockSettings.create()));
transmutation_circle(new TransmutionCircleBlock(FabricBlockSettings.of(Material.AIR)));
@Getter Block block;

AlchemistBlocks(Block block){
this.block = block;
Registry.register(BuiltInRegistries.BLOCK, new ResourceLocation(Alchemist.MODID, this.name()), block);
Registry.register(Registry.BLOCK, new ResourceLocation(Alchemist.MODID, this.name()), block);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
import io.github.unix_supremacist.Alchemist;
import io.github.unix_supremacist.item.*;
import lombok.Getter;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.fabricmc.fabric.api.registry.FuelRegistry;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item;
Expand All @@ -18,8 +16,8 @@ public enum AlchemistItems {
alchemical_coal(25600),
aeternalis_fuel(1638400),
//black_hole_band,
catalytic_lens(new DestructionItem(new Properties().stacksTo(1), 3, 10, 5)),
chalk(new AlchemistBlockItem(AlchemistBlocks.transmutation_circle.getBlock(), new Properties().durability(64))),
catalytic_lens(new DestructionItem(new Properties().tab(Alchemist.tab).stacksTo(1), 3, 10, 5)),
chalk(new AlchemistBlockItem(AlchemistBlocks.transmutation_circle.getBlock(), new Properties().tab(Alchemist.tab).durability(64))),
coal_coke(3200),
dark_matter,
//dark_matter_pickaxe,
Expand All @@ -28,26 +26,27 @@ public enum AlchemistItems {
//dark_matter_sword,
//dark_matter_axe,
//dark_matter_shears,
dark_matter_hammer(new AlchemistHammerItem(Tiers.NETHERITE, 1, -2.8f, new Properties())),
destruction_catalyst(new DestructionItem(new Properties().stacksTo(1), 3, 5, 1)),
evertide_amulet(new AlchemistBlockItem(Blocks.WATER, new Properties().stacksTo(1))),

dark_matter_hammer(new AlchemistHammerItem(Tiers.NETHERITE, 1, -2.8f, new Properties().tab(Alchemist.tab))),
destruction_catalyst(new DestructionItem(new Properties().tab(Alchemist.tab).stacksTo(1), 3, 5, 1)),
evertide_amulet(new AlchemistBlockItem(Blocks.WATER, new Properties().tab(Alchemist.tab).stacksTo(1))),
//gem_of_eternal_density,
//harvest_goddess_band,
//hyperkinetic_lens,
iron_band,
mobius_fuel(204800),
philosophers_stone(new PhilosophersStoneItem(new Properties().stacksTo(1))),
philosophers_stone(new PhilosophersStoneItem(new Properties().tab(Alchemist.tab).stacksTo(1))),
red_matter,
swiftwolfs_rending_gale(new GaleItem(new Properties().stacksTo(1))),
volcanite_amulet(new AlchemistBlockItem(Blocks.LAVA, new Properties().durability(64))),
volcanite_amulet(new AlchemistBlockItem(Blocks.LAVA, new Properties().tab(Alchemist.tab).durability(64))),
;
@Getter Item item;
AlchemistItems(){
this(0);
}

AlchemistItems(int burntime){
this(new Properties(), burntime);
this(new Properties().tab(Alchemist.tab), burntime);
}

AlchemistItems(Properties properties){
Expand All @@ -65,9 +64,6 @@ public enum AlchemistItems {
AlchemistItems(Item item, int burntime){
this.item = item;
FuelRegistry.INSTANCE.add(item, burntime);
Registry.register(BuiltInRegistries.ITEM, new ResourceLocation(Alchemist.MODID, this.name()), item);
ItemGroupEvents.modifyEntriesEvent(ResourceKey.create(BuiltInRegistries.CREATIVE_MODE_TAB.key(), new ResourceLocation(Alchemist.MODID, "tab"))).register(content -> {
content.accept(item);
});
Registry.register(Registry.ITEM, new ResourceLocation(Alchemist.MODID, this.name()), item);
}
}
32 changes: 13 additions & 19 deletions src/main/java/io/github/unix_supremacist/data/BlockTag.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package io.github.unix_supremacist.data;

import io.github.unix_supremacist.Alchemist;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.TagKey;
import net.minecraft.world.level.block.Block;
Expand All @@ -13,24 +13,22 @@
import java.util.ArrayList;
import java.util.HashSet;
import java.util.concurrent.CompletableFuture;

public class BlockTag extends FabricTagProvider.BlockTagProvider {
public class BlockTag extends FabricTagProvider<Block> {
public static HashSet<ArrayList<Block>> exchanges = new HashSet<>();
public static TagKey<Block> terratag = TagKey.create(BuiltInRegistries.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "terra"));
public static TagKey<Block> woodtag = TagKey.create(BuiltInRegistries.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "wood"));
public static TagKey<Block> netherwoodtag = TagKey.create(BuiltInRegistries.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "netherwood"));
public static TagKey<Block> leavetag = TagKey.create(BuiltInRegistries.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "leave"));
public static TagKey<Block> stonetag = TagKey.create(BuiltInRegistries.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "stone"));
public static TagKey<Block> obsidiantag = TagKey.create(BuiltInRegistries.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "obsidian"));
public static TagKey<Block> stonebrickstag = TagKey.create(BuiltInRegistries.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "stonebricks"));
public static TagKey<Block> terratag = TagKey.create(Registry.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "terra"));
public static TagKey<Block> woodtag = TagKey.create(Registry.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "wood"));
public static TagKey<Block> netherwoodtag = TagKey.create(Registry.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "netherwood"));
public static TagKey<Block> leavetag = TagKey.create(Registry.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "leave"));
public static TagKey<Block> stonetag = TagKey.create(Registry.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "stone")); public static TagKey<Block> obsidiantag = TagKey.create(Registry.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "obsidian"));
public static TagKey<Block> stonebrickstag = TagKey.create(Registry.BLOCK.key(), new ResourceLocation(Alchemist.MODID, "stonebricks"));

public BlockTag(FabricDataOutput output, CompletableFuture<HolderLookup.Provider> completableFuture) {
super(output, completableFuture);
public BlockTag(FabricDataGenerator dataGenerator) {
super(dataGenerator, Registry.BLOCK);
}

protected static void addExchange(TagKey<Block> tag){
ArrayList<Block> arrayList = new ArrayList<>();
BuiltInRegistries.BLOCK.getTagOrEmpty(tag).iterator().forEachRemaining(t ->arrayList.add(t.value()));
Registry.BLOCK.getTagOrEmpty(tag).iterator().forEachRemaining(t ->arrayList.add(t.value()));
exchanges.add(arrayList);
}

Expand All @@ -45,7 +43,7 @@ public static void init(){
}

@Override
protected void addTags(HolderLookup.Provider arg) {
protected void generateTags() {
FabricTagBuilder terra = getOrCreateTagBuilder(terratag);
terra.add(Blocks.GRASS_BLOCK);
terra.add(Blocks.DIRT);
Expand All @@ -63,23 +61,20 @@ protected void addTags(HolderLookup.Provider arg) {
wood.add(Blocks.OAK_LOG);
wood.add(Blocks.ACACIA_LOG);
wood.add(Blocks.BIRCH_LOG);
wood.add(Blocks.CHERRY_LOG);
wood.add(Blocks.JUNGLE_LOG);
wood.add(Blocks.DARK_OAK_LOG);
wood.add(Blocks.MANGROVE_LOG);
wood.add(Blocks.SPRUCE_LOG);
wood.add(Blocks.STRIPPED_OAK_LOG);
wood.add(Blocks.STRIPPED_ACACIA_LOG);
wood.add(Blocks.STRIPPED_BIRCH_LOG);
wood.add(Blocks.STRIPPED_CHERRY_LOG);
wood.add(Blocks.STRIPPED_JUNGLE_LOG);
wood.add(Blocks.STRIPPED_DARK_OAK_LOG);
wood.add(Blocks.STRIPPED_MANGROVE_LOG);
wood.add(Blocks.STRIPPED_SPRUCE_LOG);
wood.add(Blocks.OAK_WOOD);
wood.add(Blocks.ACACIA_LOG);
wood.add(Blocks.BIRCH_LOG);
wood.add(Blocks.CHERRY_LOG);
wood.add(Blocks.JUNGLE_LOG);
wood.add(Blocks.DARK_OAK_LOG);
wood.add(Blocks.MANGROVE_LOG);
Expand All @@ -95,7 +90,6 @@ protected void addTags(HolderLookup.Provider arg) {
leave.add(Blocks.OAK_LEAVES);
leave.add(Blocks.ACACIA_LEAVES);
leave.add(Blocks.BIRCH_LEAVES);
leave.add(Blocks.CHERRY_LEAVES);
leave.add(Blocks.JUNGLE_LEAVES);
leave.add(Blocks.DARK_OAK_LEAVES);
leave.add(Blocks.MANGROVE_LEAVES);
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/io/github/unix_supremacist/data/Datagen.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
public class Datagen implements DataGeneratorEntrypoint {
@Override
public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) {
FabricDataGenerator.Pack pack = fabricDataGenerator.createPack();
pack.addProvider(ItemTag::new);
pack.addProvider(BlockTag::new);
pack.addProvider(Recipe::new);
pack.addProvider(Language::new);
fabricDataGenerator.addProvider(ItemTag::new);
fabricDataGenerator.addProvider(BlockTag::new);
fabricDataGenerator.addProvider(Recipe::new);
fabricDataGenerator.addProvider(Language::new);
}
}
21 changes: 10 additions & 11 deletions src/main/java/io/github/unix_supremacist/data/ItemTag.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package io.github.unix_supremacist.data;

import dev.emi.trinkets.TrinketsMain;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
import net.minecraft.core.HolderLookup;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;
Expand All @@ -13,19 +12,19 @@

import static io.github.unix_supremacist.content.AlchemistItems.*;

public class ItemTag extends FabricTagProvider.ItemTagProvider {
public class ItemTag extends FabricTagProvider<Item> {
public static String common = "c";
public static TagKey<Item> handring = TagKey.create(BuiltInRegistries.ITEM.key(), new ResourceLocation(TrinketsMain.MOD_ID, "hand/ring"));
public static TagKey<Item> offhandring = TagKey.create(BuiltInRegistries.ITEM.key(), new ResourceLocation(TrinketsMain.MOD_ID, "offhand/ring"));
public static TagKey<Item> water_bucket = TagKey.create(BuiltInRegistries.ITEM.key(), new ResourceLocation(common, "water_buckets"));
public static TagKey<Item> lava_bucket = TagKey.create(BuiltInRegistries.ITEM.key(), new ResourceLocation(common, "lava_buckets"));
public static TagKey<Item> handring = TagKey.create(Registry.ITEM.key(), new ResourceLocation(TrinketsMain.MOD_ID, "hand/ring"));
public static TagKey<Item> offhandring = TagKey.create(Registry.ITEM.key(), new ResourceLocation(TrinketsMain.MOD_ID, "offhand/ring"));
public static TagKey<Item> water_bucket = TagKey.create(Registry.ITEM.key(), new ResourceLocation(common, "water_buckets"));
public static TagKey<Item> lava_bucket = TagKey.create(Registry.ITEM.key(), new ResourceLocation(common, "lava_buckets"));

public ItemTag(FabricDataOutput output, CompletableFuture<HolderLookup.Provider> completableFuture) {
super(output, completableFuture);
public ItemTag(FabricDataGenerator dataGenerator) {
super(dataGenerator, Registry.ITEM);
}

@Override
protected void addTags(HolderLookup.Provider arg) {
protected void generateTags() {
getOrCreateTagBuilder(handring).add(swiftwolfs_rending_gale.getItem());
getOrCreateTagBuilder(offhandring).add(swiftwolfs_rending_gale.getItem());
getOrCreateTagBuilder(water_bucket).add(evertide_amulet.getItem());
Expand Down
Loading

0 comments on commit 9f82ffb

Please sign in to comment.