Skip to content

Commit

Permalink
basically done
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Sep 9, 2023
1 parent 283b4d4 commit f1bb8e1
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 7 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Build
on: [workflow_dispatch, push]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: temurin
cache: gradle

- name: Validate Gradle Wrapper Integrity
uses: gradle/wrapper-validation-action@v1

- name: Make Gradle wrapper executable
run: chmod +x ./gradlew

- name: Build
run: ./gradlew build

- name: Capture build artifacts
uses: actions/upload-artifact@v3
with:
name: Artifacts
path: build/libs
29 changes: 29 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Publish to CF & MR
on: [workflow_dispatch]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Setup JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: temurin
cache: gradle

- name: Validate Gradle Wrapper Integrity
uses: gradle/wrapper-validation-action@v1

- name: Make Gradle wrapper executable
run: chmod +x ./gradlew

- name: Build & Release
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
run: ./gradlew build publishMods
12 changes: 5 additions & 7 deletions src/main/java/org/prismlauncher/blahaj/Common.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
import net.fabricmc.fabric.api.loot.v2.LootTableEvents;
import net.fabricmc.fabric.api.object.builder.v1.trade.TradeOfferHelper;
import net.minecraft.core.Registry;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.core.registries.Registries;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.npc.VillagerProfession;
import net.minecraft.world.entity.npc.VillagerTrades;
Expand All @@ -18,7 +17,6 @@
import net.minecraft.world.level.storage.loot.BuiltInLootTables;
import net.minecraft.world.level.storage.loot.LootPool;
import net.minecraft.world.level.storage.loot.entries.LootItem;
import org.intellij.lang.annotations.Identifier;

import java.util.List;
import java.util.function.Consumer;
Expand All @@ -28,16 +26,16 @@ public class Common implements ModInitializer {

public void onInitialize() {
Item grayShark = new CuddlyItem(new Item.Properties().stacksTo(1), "item.blahaj.gray_shark.tooltip");
Registry.register(RegistryKeys.ITEM, asResource("gray_shark"), grayShark);
Registry.register(BuiltInRegistries.ITEM, asResource("gray_shark"), grayShark);

Item blueShark = new CuddlyItem(new Item.Properties().stacksTo(1), "item.blahaj.blue_shark.tooltip");
Registry.register(RegistryKeys.ITEM, asResource("blue_shark"), blueShark);
Registry.register(BuiltInRegistries.ITEM, asResource("blue_shark"), blueShark);

Item blueWhale = new ItemContainerCuddlyItem(new Item.Properties().stacksTo(1), "item.blahaj.blue_whale.tooltip");
Registry.register(RegistryKeys.ITEM, asResource("blue_whale"), blueWhale);
Registry.register(BuiltInRegistries.ITEM, asResource("blue_whale"), blueWhale);

Item breadPillow = new CuddlyItem(new Item.Properties().stacksTo(1), null);
Registry.register(RegistryKeys.ITEM, asResource("bread"), breadPillow);
Registry.register(BuiltInRegistries.ITEM, asResource("bread"), breadPillow);

// Register items to item group
ItemGroupEvents.modifyEntriesEvent(CreativeModeTabs.TOOLS_AND_UTILITIES).register((content) -> {
Expand Down

0 comments on commit f1bb8e1

Please sign in to comment.