Skip to content

Commit

Permalink
initial 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
unix-supremacist committed Jun 13, 2024
1 parent 5312448 commit 8a2d2f7
Show file tree
Hide file tree
Showing 12 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ dependencies {
//required for trinkets
modRuntimeOnly "dev.onyxstudios.cardinal-components-api:cardinal-components-base:${ccomponents_version}"
modRuntimeOnly "dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${ccomponents_version}"
modImplementation "eu.pb4.polyport:trinkets:${trinkets_version}"
//modImplementation "eu.pb4.polyport:trinkets:${trinkets_version}"
//Polymer
modImplementation include("eu.pb4:polymer-core:${polymer_version}")
modImplementation include("eu.pb4:polymer-virtual-entity:${polymer_version}")
Expand Down
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.20.6
yarn_mappings=1.20.6+build.1
minecraft_version=1.21-rc1
yarn_mappings=1.21-rc1+build.1
loader_version=0.15.11

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

# Dependencies
fabric_version=0.100.0+1.20.6
polymer_version=0.8.3+1.20.6
ccomponents_version=6.0.0
pal_version=1.9.0
fabric_version=0.100.1+1.21
polymer_version=0.9.0+1.21-rc1
ccomponents_version=6.1.0
pal_version=1.10.0
trinkets_version=3.9.0+polymerport.1
factory_version=0.2.2+1.20.6
factory_version=0.3.0+1.21
lombok_version=1.18.32
4 changes: 2 additions & 2 deletions src/main/java/io/github/unix_supremacist/Alchemist.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public class Alchemist implements ModInitializer {
@Override
public void onInitialize() {
LOGGER.info("Welcome to the World of Alchemy!");
Registry.register(BuiltInRegistries.DATA_COMPONENT_TYPE, new ResourceLocation(MODID, "empowered"), Alchemist.POWER);
Registry.register(BuiltInRegistries.CREATIVE_MODE_TAB, new ResourceLocation(MODID, "tab"), Alchemist.tab);
Registry.register(BuiltInRegistries.DATA_COMPONENT_TYPE, ResourceLocation.fromNamespaceAndPath(MODID, "empowered"), Alchemist.POWER);
Registry.register(BuiltInRegistries.CREATIVE_MODE_TAB, ResourceLocation.fromNamespaceAndPath(MODID, "tab"), Alchemist.tab);
AlchemistBlocks.values(); //force the enum to load
AlchemistItems.values(); //force the enum to load
CommonLifecycleEvents.TAGS_LOADED.register((registries, client) -> BlockTag.init());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class TransmutionCircleBlock extends Block implements TransmuteEntity, Po
BlockState blockState;
public TransmutionCircleBlock(Properties properties) {
super(properties);
blockState = PolymerBlockResourceUtils.requestBlock(BlockModelType.PLANT_BLOCK, PolymerBlockModel.of(new ResourceLocation(Alchemist.MODID, "block/transmutation_circle")));
blockState = PolymerBlockResourceUtils.requestBlock(BlockModelType.PLANT_BLOCK, PolymerBlockModel.of(ResourceLocation.fromNamespaceAndPath(Alchemist.MODID, "block/transmutation_circle")));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ public enum AlchemistBlocks {

AlchemistBlocks(TransmutionCircleBlock block){
this.block = block;
Registry.register(BuiltInRegistries.BLOCK, new ResourceLocation(Alchemist.MODID, this.name()), block);
Registry.register(BuiltInRegistries.BLOCK, ResourceLocation.fromNamespaceAndPath(Alchemist.MODID, this.name()), block);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ 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(BuiltInRegistries.ITEM, ResourceLocation.fromNamespaceAndPath(Alchemist.MODID, this.name()), item);
ItemGroupEvents.modifyEntriesEvent(ResourceKey.create(BuiltInRegistries.CREATIVE_MODE_TAB.key(), ResourceLocation.fromNamespaceAndPath(Alchemist.MODID, "tab"))).register(content -> content.accept(item));
}
}
14 changes: 7 additions & 7 deletions src/main/java/io/github/unix_supremacist/data/BlockTag.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

public class BlockTag extends FabricTagProvider.BlockTagProvider {
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(BuiltInRegistries.BLOCK.key(), ResourceLocation.fromNamespaceAndPath(Alchemist.MODID, "terra"));
public static TagKey<Block> woodtag = TagKey.create(BuiltInRegistries.BLOCK.key(), ResourceLocation.fromNamespaceAndPath(Alchemist.MODID, "wood"));
public static TagKey<Block> netherwoodtag = TagKey.create(BuiltInRegistries.BLOCK.key(), ResourceLocation.fromNamespaceAndPath(Alchemist.MODID, "netherwood"));
public static TagKey<Block> leavetag = TagKey.create(BuiltInRegistries.BLOCK.key(), ResourceLocation.fromNamespaceAndPath(Alchemist.MODID, "leave"));
public static TagKey<Block> stonetag = TagKey.create(BuiltInRegistries.BLOCK.key(), ResourceLocation.fromNamespaceAndPath(Alchemist.MODID, "stone"));
public static TagKey<Block> obsidiantag = TagKey.create(BuiltInRegistries.BLOCK.key(), ResourceLocation.fromNamespaceAndPath(Alchemist.MODID, "obsidian"));
public static TagKey<Block> stonebrickstag = TagKey.create(BuiltInRegistries.BLOCK.key(), ResourceLocation.fromNamespaceAndPath(Alchemist.MODID, "stonebricks"));

public BlockTag(FabricDataOutput output, CompletableFuture<HolderLookup.Provider> completableFuture) {
super(output, completableFuture);
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/io/github/unix_supremacist/data/ItemTag.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.unix_supremacist.data;

import dev.emi.trinkets.TrinketsMain;
//import dev.emi.trinkets.TrinketsMain;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider;
import net.minecraft.core.HolderLookup;
Expand All @@ -15,10 +15,11 @@

public class ItemTag extends FabricTagProvider.ItemTagProvider {
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, "buckets/water"));
public static TagKey<Item> lava_bucket = TagKey.create(BuiltInRegistries.ITEM.key(), new ResourceLocation(common, "buckets/lava"));
public static String trinkets = "trinkets";
public static TagKey<Item> handring = TagKey.create(BuiltInRegistries.ITEM.key(), ResourceLocation.fromNamespaceAndPath(trinkets, "hand/ring"));
public static TagKey<Item> offhandring = TagKey.create(BuiltInRegistries.ITEM.key(), ResourceLocation.fromNamespaceAndPath(trinkets, "offhand/ring"));
public static TagKey<Item> water_bucket = TagKey.create(BuiltInRegistries.ITEM.key(), ResourceLocation.fromNamespaceAndPath(common, "buckets/water"));
public static TagKey<Item> lava_bucket = TagKey.create(BuiltInRegistries.ITEM.key(), ResourceLocation.fromNamespaceAndPath(common, "buckets/lava"));
public ItemTag(FabricDataOutput output, CompletableFuture<HolderLookup.Provider> completableFuture) {
super(output, completableFuture);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ public void generateTranslations(HolderLookup.Provider registryLookup, Translati
for (AlchemistBlocks block : AlchemistBlocks.values())
translationBuilder.add(block.getBlock(), WordUtils.capitalize(block.name().replace("_", " ")));

translationBuilder.add(ResourceKey.create(BuiltInRegistries.CREATIVE_MODE_TAB.key(), new ResourceLocation(Alchemist.MODID, "tab")), WordUtils.capitalize(Alchemist.MODID.replace("_", " ")));
translationBuilder.add(ResourceKey.create(BuiltInRegistries.CREATIVE_MODE_TAB.key(), ResourceLocation.fromNamespaceAndPath(Alchemist.MODID, "tab")), WordUtils.capitalize(Alchemist.MODID.replace("_", " ")));
}
}
2 changes: 1 addition & 1 deletion src/main/java/io/github/unix_supremacist/data/Recipe.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,6 @@ public void philStoneRecipe(Item output, int outputcount, Item input, int inputc
.requires(philosophers_stone.getItem())
.requires(input, inputcount)
.unlockedBy(RecipeProvider.getHasName(philosophers_stone.getItem()), RecipeProvider.has(philosophers_stone.getItem()))
.save(recipeoutput, new ResourceLocation(Alchemist.MODID, output +"_to_"+input));
.save(recipeoutput, ResourceLocation.fromNamespaceAndPath(Alchemist.MODID, output +"_to_"+input));
}
}
8 changes: 4 additions & 4 deletions src/main/java/io/github/unix_supremacist/item/GaleItem.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.unix_supremacist.item;

import dev.emi.trinkets.api.*;
//import dev.emi.trinkets.api.*;
import eu.pb4.factorytools.api.item.AutoModeledPolymerItem;
import io.github.ladysnake.pal.AbilitySource;
import io.github.ladysnake.pal.Pal;
Expand All @@ -15,13 +15,13 @@
import net.minecraft.world.item.Items;
import net.minecraft.world.level.Level;

public class GaleItem extends TrinketItem implements AutoModeledPolymerItem {
public class GaleItem extends Item implements AutoModeledPolymerItem {
public GaleItem(Properties properties) {
super(properties);
}
public static final AbilitySource gale_ability = Pal.getAbilitySource(Alchemist.MODID, "swiftwolfs_rending_gale");

@Override
/*@Override
public void onEquip(ItemStack stack, SlotReference slot, LivingEntity entity) {
if (!entity.level().isClientSide())
if (entity instanceof Player)
Expand All @@ -42,7 +42,7 @@ public InteractionResultHolder<ItemStack> use(Level world, Player user, Interact
return InteractionResultHolder.sidedSuccess(stack, world.isClientSide());
}
return super.use(world, user, hand);
}
}*/

@Override
public Item getPolymerItem() {
Expand Down
3 changes: 1 addition & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@
},
"depends": {
"fabricloader": ">=0.15.11",
"minecraft": "~1.20.6",
"minecraft": "~1.21-rc.1",
"java": ">=21",
"fabric-api": "*",
"trinkets": "*",
"playerabilitylib": "*"
}
}

0 comments on commit 8a2d2f7

Please sign in to comment.