Skip to content

Commit

Permalink
Port to 1.20.4
Browse files Browse the repository at this point in the history
Drop support for Forge
  • Loading branch information
Hidoni committed Jan 13, 2024
1 parent 420a3c3 commit 5cf686e
Show file tree
Hide file tree
Showing 37 changed files with 43 additions and 715 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ jobs:
echo "$EOF" >> $GITHUB_ENV
- uses: ncipollo/release-action@v1
with:
artifacts: "./Forge/build/libs/*.jar,./Fabric/build/libs/*.jar,./NeoForge/build/libs/*.jar"
artifacts: "./Fabric/build/libs/*.jar,./NeoForge/build/libs/*.jar"
body: "${{ env.changelog }}"
7 changes: 3 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# 2.2.0+1.20.2 - 18/11/2023
- Port to 1.20.2
- Add support for NeoForge
- Removed support for Quilt until it updates
# 2.2.0+1.20.4 - 18/11/2023
- Port to 1.20.4
- Drop support for Forge
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public static void init() {
return InteractionResult.sidedSuccess(world.isClientSide);

};
CauldronInteraction.WATER.put(ModItems.ELYTRA_WING.get(), clearElytraCustomization);
CauldronInteraction.WATER.put(Items.ELYTRA, clearElytraCustomization);
CauldronInteraction.WATER.map().put(ModItems.ELYTRA_WING.get(), clearElytraCustomization);
CauldronInteraction.WATER.map().put(Items.ELYTRA, clearElytraCustomization);
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import net.minecraft.world.item.ItemStack;

public class ModCreativeModeTabs {
public static final RegistryEntry<CreativeModeTab> CUSTOMIZABLE_ELYTRA_TAB = ModRegistries.CREATIVE_MODE_TABS.register(new ResourceLocation(Constants.MOD_ID, "creative_tab"), () -> CreativeModeTab.builder(CreativeModeTab.Row.TOP, 0)
public static final RegistryEntry<CreativeModeTab, ? extends CreativeModeTab> CUSTOMIZABLE_ELYTRA_TAB = ModRegistries.CREATIVE_MODE_TABS.register(new ResourceLocation(Constants.MOD_ID, "creative_tab"), () -> CreativeModeTab.builder(CreativeModeTab.Row.TOP, 0)
.icon(() -> new ItemStack(ModItems.ELYTRA_WING.get()))
.title(Component.translatable(TranslationKeys.CREATIVE_TAB_TRANSLATION_KEY))
.displayItems((itemDisplayParameters, output) -> output.accept(ModItems.ELYTRA_WING.get()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import net.minecraft.world.item.Rarity;

public class ModItems {
public static final RegistryEntry<Item> ELYTRA_WING = ModRegistries.ITEM.register(new ResourceLocation(Constants.MOD_ID, "elytra_wing"), () -> new ElytraWingItem(new Item.Properties().durability(Items.ELYTRA.getMaxDamage()).rarity(Rarity.UNCOMMON)));
public static final RegistryEntry<Item, ? extends Item> ELYTRA_WING = ModRegistries.ITEM.register(new ResourceLocation(Constants.MOD_ID, "elytra_wing"), () -> new ElytraWingItem(new Item.Properties().durability(Items.ELYTRA.getMaxDamage()).rarity(Rarity.UNCOMMON)));

public static void register() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
import com.hidoni.customizableelytra.Constants;
import com.hidoni.customizableelytra.recipe.*;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.crafting.RecipeSerializer;
import net.minecraft.world.item.crafting.SimpleCraftingRecipeSerializer;

public class ModRecipes {
public static final RegistryEntry<SimpleCraftingRecipeSerializer<ElytraMiscellaneousCustomizationRecipe>> ELYTRA_MISCELLANEOUS_CUSTOMIZATION_RECIPE = ModRegistries.RECIPE_SERIALIZER.register(new ResourceLocation(Constants.MOD_ID, "elytra_miscellaneous_customization_recipe"), () -> new SimpleCraftingRecipeSerializer<>(ElytraMiscellaneousCustomizationRecipe::new));
public static final RegistryEntry<SimpleCraftingRecipeSerializer<ElytraBannerRecipe>> ELYTRA_BANNER_RECIPE = ModRegistries.RECIPE_SERIALIZER.register(new ResourceLocation(Constants.MOD_ID, "elytra_banner_recipe"), () -> new SimpleCraftingRecipeSerializer<>(ElytraBannerRecipe::new));
public static final RegistryEntry<SimpleCraftingRecipeSerializer<ElytraDyeRecipe>> ELYTRA_DYE_RECIPE = ModRegistries.RECIPE_SERIALIZER.register(new ResourceLocation(Constants.MOD_ID, "elytra_dye_recipe"), () -> new SimpleCraftingRecipeSerializer<>(ElytraDyeRecipe::new));
public static final RegistryEntry<SimpleCraftingRecipeSerializer<SplitToWingsRecipe>> SPLIT_TO_WINGS_RECIPE = ModRegistries.RECIPE_SERIALIZER.register(new ResourceLocation(Constants.MOD_ID, "elytra_split_to_wings_recipe"), () -> new SimpleCraftingRecipeSerializer<>(SplitToWingsRecipe::new));
public static final RegistryEntry<SimpleCraftingRecipeSerializer<CombineWingsRecipe>> COMBINE_WINGS_RECIPE = ModRegistries.RECIPE_SERIALIZER.register(new ResourceLocation(Constants.MOD_ID, "combine_wings_recipe"), () -> new SimpleCraftingRecipeSerializer<>(CombineWingsRecipe::new));
public static final RegistryEntry<RecipeSerializer<?>, SimpleCraftingRecipeSerializer<ElytraMiscellaneousCustomizationRecipe>> ELYTRA_MISCELLANEOUS_CUSTOMIZATION_RECIPE = ModRegistries.RECIPE_SERIALIZER.register(new ResourceLocation(Constants.MOD_ID, "elytra_miscellaneous_customization_recipe"), () -> new SimpleCraftingRecipeSerializer<>(ElytraMiscellaneousCustomizationRecipe::new));
public static final RegistryEntry<RecipeSerializer<?>, SimpleCraftingRecipeSerializer<ElytraBannerRecipe>> ELYTRA_BANNER_RECIPE = ModRegistries.RECIPE_SERIALIZER.register(new ResourceLocation(Constants.MOD_ID, "elytra_banner_recipe"), () -> new SimpleCraftingRecipeSerializer<>(ElytraBannerRecipe::new));
public static final RegistryEntry<RecipeSerializer<?>, SimpleCraftingRecipeSerializer<ElytraDyeRecipe>> ELYTRA_DYE_RECIPE = ModRegistries.RECIPE_SERIALIZER.register(new ResourceLocation(Constants.MOD_ID, "elytra_dye_recipe"), () -> new SimpleCraftingRecipeSerializer<>(ElytraDyeRecipe::new));
public static final RegistryEntry<RecipeSerializer<?>, SimpleCraftingRecipeSerializer<SplitToWingsRecipe>> SPLIT_TO_WINGS_RECIPE = ModRegistries.RECIPE_SERIALIZER.register(new ResourceLocation(Constants.MOD_ID, "elytra_split_to_wings_recipe"), () -> new SimpleCraftingRecipeSerializer<>(SplitToWingsRecipe::new));
public static final RegistryEntry<RecipeSerializer<?>, SimpleCraftingRecipeSerializer<CombineWingsRecipe>> COMBINE_WINGS_RECIPE = ModRegistries.RECIPE_SERIALIZER.register(new ResourceLocation(Constants.MOD_ID, "combine_wings_recipe"), () -> new SimpleCraftingRecipeSerializer<>(CombineWingsRecipe::new));
public static void register() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import java.util.function.Supplier;

public interface RegistryEntry<T> extends Supplier<T> {
public interface RegistryEntry<T, I extends T> extends Supplier<I> {
ResourceLocation getResourceLocation();

@Nullable ResourceKey<T> getResourceKey();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
import java.util.function.Supplier;

public interface RegistryProvider<T> {
<I extends T> RegistryEntry<I> register(ResourceLocation location, Supplier<? extends I> entrySupplier);
<I extends T> RegistryEntry<T, I> register(ResourceLocation location, Supplier<? extends I> entrySupplier);
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@ public <T> RegistryProvider<T> getRegistry(ResourceKey<? extends Registry<T>> re
}
return new RegistryProvider<>() {
@Override
public <I extends T> RegistryEntry<I> register(ResourceLocation location, Supplier<? extends I> entrySupplier) {
public <I extends T> RegistryEntry<T, I> register(ResourceLocation location, Supplier<? extends I> entrySupplier) {
I registered = Registry.register(registry, location, entrySupplier.get());
return new RegistryEntry<>() {
private final ResourceKey<I> resourceKey = ResourceKey.create((ResourceKey<? extends Registry<I>>) registry.key(), location);
private final ResourceKey<T> resourceKey = ResourceKey.create(registry.key(), location);

@Override
public ResourceLocation getResourceLocation() {
return location;
}

@Override
public @Nullable ResourceKey<I> getResourceKey() {
public @Nullable ResourceKey<T> getResourceKey() {
return resourceKey;
}

@Override
public Holder<I> getHolder() {
return (Holder<I>) registry.getHolderOrThrow((ResourceKey<T>) this.getResourceKey());
public Holder<T> getHolder() {
return registry.getHolderOrThrow(this.getResourceKey());
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions Fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
"mixins.customizableelytra.fabric.json"
],
"depends": {
"fabricloader": ">=0.14",
"fabricloader": ">=0.15",
"fabric": "*",
"minecraft": [
"1.20.2"
"1.20.4"
],
"java": ">=17"
}
Expand Down
162 changes: 0 additions & 162 deletions Forge/build.gradle

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 5cf686e

Please sign in to comment.