Skip to content

Commit

Permalink
Done Fabric 1.21.1
Browse files Browse the repository at this point in the history
  • Loading branch information
MarbleGateKeeper committed Oct 18, 2024
1 parent 084caec commit a8e3a31
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 64 deletions.
59 changes: 3 additions & 56 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ permissions:
contents: write

env:
MINECRAFT_VERSION: 1.20.4
JAVA_VERSION: 17
MINECRAFT_VERSION: 1.21.1
JAVA_VERSION: 21
VERSION: 2.1.0
MODRINTH_ID: ELrdP6OH
CURSEFORGE_ID: 564244
Expand All @@ -24,7 +24,7 @@ jobs:
uses: actions/setup-java@v2
with:
distribution: "temurin"
java-version: 17
java-version: 21

- name: Make Gradle Wrapper Executable
if: ${{ runner.os != 'Windows' }}
Expand Down Expand Up @@ -56,29 +56,6 @@ jobs:
retry-attempts: 2
retry-delay: 10000

- name: Publish Forge to CurseForge
uses: Kir-Antipov/[email protected]
with:
# CurseForge
curseforge-id: ${{ env.CURSEFORGE_ID }}
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}

# Config
name: "[Forge] Splash Milk ${{ env.VERSION }} for ${{ env.MINECRAFT_VERSION }}"
version: ${{ env.VERSION }}
version-type: release
changelog-file: changelog/${{ env.VERSION }}.md
files: forge/build/libs/*-${{ env.VERSION }}!(-@(dev|sources|slim|dev-shadow)).jar

loaders: |
forge
game-versions: |
${{ env.MINECRAFT_VERSION }}
java: |
${{ env.JAVA_VERSION }}
retry-attempts: 2
retry-delay: 10000

- name: Publish Fabric/Quilt to CurseForge
uses: Kir-Antipov/[email protected]
with:
Expand All @@ -98,9 +75,6 @@ jobs:
quilt
game-versions: |
${{ env.MINECRAFT_VERSION }}
dependencies: |
cloth-config(required)
modmenu(optional)
java: |
${{ env.JAVA_VERSION }}
retry-attempts: 2
Expand Down Expand Up @@ -130,30 +104,6 @@ jobs:
retry-attempts: 2
retry-delay: 10000

- name: Publish Forge to Modrinth
uses: Kir-Antipov/[email protected]
with:
# Modrinth
modrinth-id: ${{ env.MODRINTH_ID }}
modrinth-featured: true
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}

# Config
name: "The Splash Milk ${{ env.VERSION }} for ${{ env.MINECRAFT_VERSION }}"
version: ${{ env.VERSION }}
version-type: release
changelog-file: changelog/${{ env.VERSION }}.md
files: forge/build/libs/*-${{ env.VERSION }}!(-@(dev|sources|slim|dev-shadow)).jar

loaders: |
forge
game-versions: |
${{ env.MINECRAFT_VERSION }}
java: |
${{ env.JAVA_VERSION }}
retry-attempts: 2
retry-delay: 10000

- name: Publish Fabric/Quilt to Modrinth
uses: Kir-Antipov/[email protected]
with:
Expand All @@ -174,9 +124,6 @@ jobs:
quilt
game-versions: |
${{ env.MINECRAFT_VERSION }}
dependencies: |
cloth-config(required)
modmenu(optional)
java: |
${{ env.JAVA_VERSION }}
retry-attempts: 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import net.minecraft.component.type.PotionContentsComponent;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.item.ThrowablePotionItem;
import net.minecraft.item.PotionItem;
import net.minecraft.potion.Potion;
import net.minecraft.potion.Potions;
import net.minecraft.recipe.BrewingRecipeRegistry;
Expand Down Expand Up @@ -42,6 +42,7 @@ private static void injected(BrewingRecipeRegistry brewingRecipeRegistry, Defaul
cir.setReturnValue(true);
}
}

if (itemStack.isOf(Items.DRAGON_BREATH)) {
for (int i = 0; i < 3; ++i) {
ItemStack itemStack2 = slots.get(i);
Expand All @@ -57,10 +58,14 @@ private static void injected(World world, BlockPos pos, DefaultedList<ItemStack>
if (itemStack.isOf(Items.MILK_BUCKET)) {
for (int i = 0; i < 3; ++i) {
if (qualifiedWaterBottle(slots.get(i))) {
ItemStack brewed = slots.get(i).isOf(Items.LINGERING_POTION) ?
ItemRegistry.LINGERING_MILK_BOTTLE.getDefaultStack() :
ItemRegistry.SPLASH_MILK_BOTTLE.getDefaultStack();
slots.set(i, brewed);
if(slots.get(i).isOf(Items.POTION)){
slots.set(i, ItemRegistry.MILK_BOTTLE.getDefaultStack());
} else{
ItemStack brewed = slots.get(i).isOf(Items.LINGERING_POTION) ?
ItemRegistry.LINGERING_MILK_BOTTLE.getDefaultStack() :
ItemRegistry.SPLASH_MILK_BOTTLE.getDefaultStack();
slots.set(i, brewed);
}
}
}
slots.set(3, Items.BUCKET.getDefaultStack());
Expand All @@ -84,7 +89,7 @@ private static void injected(World world, BlockPos pos, DefaultedList<ItemStack>
}

private static boolean qualifiedWaterBottle(ItemStack itemStack) {
if (itemStack.getItem() instanceof ThrowablePotionItem) {
if (itemStack.getItem() instanceof PotionItem) {
Optional<RegistryEntry<Potion>> optional = itemStack.getOrDefault(DataComponentTypes.POTION_CONTENTS, PotionContentsComponent.DEFAULT).potion();
if(optional.isPresent()){
var op = optional.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
import net.neoforged.neoforge.event.brewing.RegisterBrewingRecipesEvent;
import plus.dragons.splashmilk.neoforge.SplashMilk;

import java.util.Optional;

@EventBusSubscriber(modid = SplashMilk.MOD_ID)
public class RecipeRegistry {
@SubscribeEvent
Expand Down

0 comments on commit a8e3a31

Please sign in to comment.