Skip to content

Commit

Permalink
Add Tempad back to the creative menu
Browse files Browse the repository at this point in the history
  • Loading branch information
CodexAdrian committed Aug 5, 2023
1 parent af1ca5c commit 4a01419
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 6 deletions.
11 changes: 5 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,13 @@ subprojects {

if (isCommon) {
// "modCompileOnly"(group = "earth.terrarium.prometheus", name = "prometheus-$modLoader-$minecraftVersion", version = prometheusVersion) { isTransitive = false }
"modCompileOnly"(group = "me.shedaniel", name = "RoughlyEnoughItems-api", version = reiVersion)
"modCompileOnly"(group = "me.shedaniel", name = "RoughlyEnoughItems-default-plugin", version = reiVersion)
// "modCompileOnly"(group = "me.shedaniel", name = "RoughlyEnoughItems-api", version = reiVersion)
// "modCompileOnly"(group = "me.shedaniel", name = "RoughlyEnoughItems-default-plugin", version = reiVersion)
} else {
// "modLocalRuntime"(group = "earth.terrarium.prometheus", name = "prometheus-$modLoader-$minecraftVersion", version = prometheusVersion)

"modRuntimeOnly"(group = "me.shedaniel", name = "RoughlyEnoughItems-$modLoader", version = reiVersion)
"modCompileOnly"(group = "me.shedaniel", name = "RoughlyEnoughItems-api-$modLoader", version = reiVersion)
"modCompileOnly"(group = "me.shedaniel", name = "RoughlyEnoughItems-default-plugin-$modLoader", version = reiVersion)
// "modRuntimeOnly"(group = "me.shedaniel", name = "RoughlyEnoughItems-$modLoader", version = reiVersion)
// "modCompileOnly"(group = "me.shedaniel", name = "RoughlyEnoughItems-api-$modLoader", version = reiVersion)
// "modCompileOnly"(group = "me.shedaniel", name = "RoughlyEnoughItems-default-plugin-$modLoader", version = reiVersion)
}

"modApi"(group = "earth.terrarium", name = "botarium-$modLoader-$minecraftVersion", version = botariumVersion)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
package me.codexadrian.tempad.common.fabric;

import com.teamresourceful.resourcefullib.common.registry.RegistryEntry;
import me.codexadrian.tempad.common.Tempad;
import me.codexadrian.tempad.common.compat.fabricwaystones.FabricWaystoneLocationGetter;
import me.codexadrian.tempad.common.network.NetworkHandler;
import me.codexadrian.tempad.common.registry.TempadRegistry;
import me.codexadrian.tempad.common.utils.PlatformUtils;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.fabricmc.fabric.api.loot.v2.LootTableEvents;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.CreativeModeTabs;
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;
Expand Down Expand Up @@ -37,5 +42,9 @@ public void onInitialize() {
if (PlatformUtils.isModLoaded("fwaystones")) {
FabricWaystoneLocationGetter.init();
}

ItemGroupEvents.modifyEntriesEvent(CreativeModeTabs.TOOLS_AND_UTILITIES).register(group -> {
TempadRegistry.ITEMS.stream().map(RegistryEntry::get).forEach(group::accept);
});
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
package me.codexadrian.tempad.common.forge;

import com.mojang.serialization.Codec;
import com.teamresourceful.resourcefullib.common.registry.RegistryEntry;
import me.codexadrian.tempad.common.Tempad;
import me.codexadrian.tempad.common.network.NetworkHandler;
import me.codexadrian.tempad.common.registry.TempadRegistry;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.item.CreativeModeTabs;
import net.minecraft.world.item.Item;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.loot.IGlobalLootModifier;
import net.minecraftforge.event.BuildCreativeModeTabContentsEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.common.Mod;
Expand Down Expand Up @@ -37,5 +42,9 @@ public ForgeTempad() {
NetworkHandler.register();
MinecraftForge.EVENT_BUS.register(this);
DistExecutor.safeRunWhenOn(Dist.CLIENT, () -> ForgeTempadClient::registerBlurReloader);

bus.addListener((BuildCreativeModeTabContentsEvent event) -> {
if (event.getTab() == BuiltInRegistries.CREATIVE_MODE_TAB.get(CreativeModeTabs.TOOLS_AND_UTILITIES)) TempadRegistry.ITEMS.stream().map(RegistryEntry::get).forEach(event::accept);
});
}
}
32 changes: 32 additions & 0 deletions templates/embed.json.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"embeds": [
{
"title": "Tempad",
"description": "**Changelog:**\\n${changelog}",
"color": 5814783,
"fields": [
{
"name": "Minecraft Version",
"value": "${minecraft}"
},
{
"name": "Mod Version",
"value": "${version}"
},
{
"name": "Download",
"value": "<:modrinth:1083795635414773760> [Modrinth](https://modrinth.com/mod/cadmus)\\n<:curseforge:978684543026462790> [Curseforge](https://www.curseforge.com/minecraft/mc-mods/cadmus)"
}
],
"footer": {
"text": "Want to support us? Check out our Ko-fi! http://kofi.terrarium.earth",
"icon_url": "https://media.discordapp.net/attachments/881367981463072809/1044025688719626250/61e1116779fc0a9bd5bdbcc7_Frame_6.png"
},
"thumbnail": {
"url": "https://media.forgecdn.net/avatars/500/177/637818622588372032.gif"
}
}
],
"username": "Terrarium Releases",
"avatar_url": "https://cdn.discordapp.com/avatars/955572264823300096/3c226580b871a57b6da095fea1cccf1e.webp"
}

0 comments on commit 4a01419

Please sign in to comment.