-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4db957e
commit e768f6e
Showing
885 changed files
with
557 additions
and
30,787 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,30 @@ | ||
plugins { | ||
id 'java' | ||
id 'org.spongepowered.gradle.vanilla' version '0.2.1-SNAPSHOT' | ||
id 'maven-publish' | ||
} | ||
|
||
archivesBaseName = "${mod_name}-common-${minecraft_version}" | ||
|
||
minecraft { | ||
version(minecraft_version) | ||
runs { | ||
if (project.hasProperty('common_runs_enabled') ? project.findProperty('common_runs_enabled').toBoolean() : true) { | ||
|
||
server(project.hasProperty('common_server_run_name') ? project.findProperty('common_server_run_name') : 'vanilla_server') { | ||
workingDirectory(this.file("run")) | ||
} | ||
client(project.hasProperty('common_client_run_name') ? project.findProperty('common_client_run_name') : 'vanilla_client') { | ||
workingDirectory(this.file("run")) | ||
} | ||
} | ||
} | ||
architectury { | ||
common rootProject.enabled_platforms.split(',') | ||
} | ||
|
||
dependencies { | ||
compileOnly group:'org.spongepowered', name:'mixin', version:'0.8.5' | ||
implementation group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.1' | ||
} | ||
// We depend on Fabric Loader here to use the Fabric @Environment annotations, | ||
// which get remapped to the correct annotations on each platform. | ||
// Do NOT use other classes from Fabric Loader. | ||
modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version}" | ||
|
||
processResources { | ||
// Architectury API. This is optional, and you can comment it out if you don't need it. | ||
modImplementation "dev.architectury:architectury:${architectury_api_version}" | ||
|
||
def buildProps = project.properties.clone() | ||
|
||
filesMatching(['pack.mcmeta']) { | ||
|
||
expand buildProps | ||
} | ||
} | ||
|
||
publishing { | ||
publications { | ||
mavenJava(MavenPublication) { | ||
groupId project.group | ||
artifactId project.archivesBaseName | ||
version project.version | ||
from components.java | ||
} | ||
} | ||
|
||
repositories { | ||
maven { | ||
url "file://" + System.getenv("local_maven") | ||
} | ||
} | ||
} | ||
|
||
// REI | ||
// modCompileOnly "me.shedaniel:RoughlyEnoughItems-api-fabric:${rei_version}" | ||
// modCompileOnly "me.shedaniel:RoughlyEnoughItems-api-fabric:${rei_version}" | ||
// modRuntimeOnly "me.shedaniel:RoughlyEnoughItems-fabric:${rei_version}" | ||
// modCompileOnly "me.shedaniel:RoughlyEnoughItems-default-plugin-fabric:${rei_version}" | ||
modCompileOnly "me.shedaniel:RoughlyEnoughItems-api:${rei_version}" | ||
|
||
// Accessories | ||
//modImplementation("io.wispforest:accessories-common:${accessories_version}") | ||
|
||
// Patchouli | ||
modImplementation "vazkii.patchouli:Patchouli:${patchouli_version}-FABRIC-SNAPSHOT" | ||
} |
11 changes: 0 additions & 11 deletions
11
Common/src/main/java/net/dakotapride/hibernalHerbs/common/Constants.java
This file was deleted.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
Common/src/main/java/net/dakotapride/hibernalHerbs/common/HibernalHerbsCommonMod.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package net.dakotapride.hibernalHerbs.common; | ||
|
||
import com.google.common.base.Suppliers; | ||
import dev.architectury.registry.registries.RegistrarManager; | ||
import net.dakotapride.hibernalHerbs.common.init.BlockInit; | ||
import net.dakotapride.hibernalHerbs.common.init.ItemInit; | ||
import net.dakotapride.hibernalHerbs.common.init.item.HerbTypes; | ||
import net.minecraft.resources.ResourceLocation; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import java.util.function.Supplier; | ||
|
||
public class HibernalHerbsCommonMod { | ||
|
||
public static final String MOD_ID = "hibernalherbs"; | ||
public static final String MOD_NAME = "Hibernal Herbs"; | ||
public static final Logger LOG = LoggerFactory.getLogger(MOD_NAME); | ||
|
||
public static final Supplier<RegistrarManager> MANAGER = Suppliers.memoize(() -> RegistrarManager.get(MOD_ID)); | ||
|
||
|
||
public static void init() { | ||
ItemInit.register(); | ||
BlockInit.register(); | ||
|
||
// Herb Types - Herb Blocks, Pounded Herbs, Dried Herbs, Herb Lanterns, Herb Barrels, Herb Leaf Piles | ||
HerbTypes.register(); | ||
} | ||
|
||
|
||
public static ResourceLocation fromModId(String modId, String id) { | ||
return ResourceLocation.fromNamespaceAndPath(modId, id); | ||
} | ||
|
||
public static ResourceLocation asResource(String id) { | ||
return fromModId(MOD_ID, id); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
Common/src/main/java/net/dakotapride/hibernalHerbs/common/init/BlockInit.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package net.dakotapride.hibernalHerbs.common.init; | ||
|
||
import dev.architectury.registry.registries.Registrar; | ||
import dev.architectury.registry.registries.RegistrySupplier; | ||
import net.dakotapride.hibernalHerbs.common.HibernalHerbsCommonMod; | ||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.world.item.BlockItem; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.level.block.Block; | ||
|
||
public class BlockInit { | ||
public static Registrar<Block> blocks = HibernalHerbsCommonMod.MANAGER.get().get(Registries.BLOCK); | ||
|
||
// Collective Registration | ||
public static void register() {} | ||
|
||
public static RegistrySupplier<Block> register(String name, Block block) { | ||
registerBlockItem(name, block, new Item.Properties()); | ||
return blocks.register(HibernalHerbsCommonMod.asResource(name), () -> block); | ||
} | ||
|
||
public static RegistrySupplier<Item> registerBlockItem(String name, Block block, Item.Properties properties) { | ||
return ItemInit.register(name, new BlockItem(block, properties)); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
Common/src/main/java/net/dakotapride/hibernalHerbs/common/init/ItemInit.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package net.dakotapride.hibernalHerbs.common.init; | ||
|
||
import dev.architectury.registry.registries.Registrar; | ||
import dev.architectury.registry.registries.RegistrySupplier; | ||
import net.dakotapride.hibernalHerbs.common.HibernalHerbsCommonMod; | ||
import net.dakotapride.hibernalHerbs.common.item.HerbalGrimoireItem; | ||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.world.item.Item; | ||
|
||
public class ItemInit { | ||
public static Registrar<Item> items = HibernalHerbsCommonMod.MANAGER.get().get(Registries.ITEM); | ||
|
||
public static RegistrySupplier<Item> GRIMOIRE; | ||
public static RegistrySupplier<Item> SINGED_GRIMOIRE; | ||
|
||
// Collective Registration | ||
public static void register() { | ||
GRIMOIRE = register("grimoire", new HerbalGrimoireItem(new Item.Properties().stacksTo(1))); | ||
SINGED_GRIMOIRE = register("singed_grimoire", new HerbalGrimoireItem(new Item.Properties().stacksTo(1))); | ||
} | ||
|
||
public static RegistrySupplier<Item> register(String name, Item item) { | ||
return items.register(HibernalHerbsCommonMod.asResource(name), () -> item); | ||
} | ||
} |
63 changes: 63 additions & 0 deletions
63
Common/src/main/java/net/dakotapride/hibernalHerbs/common/init/item/HerbTypes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package net.dakotapride.hibernalHerbs.common.init.item; | ||
|
||
import dev.architectury.registry.registries.RegistrySupplier; | ||
import net.dakotapride.hibernalHerbs.common.HibernalHerbsCommonMod; | ||
import net.dakotapride.hibernalHerbs.common.block.LeafPileBlock; | ||
import net.dakotapride.hibernalHerbs.common.init.BlockInit; | ||
import net.dakotapride.hibernalHerbs.common.init.ItemInit; | ||
import net.minecraft.world.item.BlockItem; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.item.component.SuspiciousStewEffects; | ||
import net.minecraft.world.level.block.*; | ||
import net.minecraft.world.level.block.state.BlockBehaviour; | ||
|
||
import java.util.Locale; | ||
|
||
@SuppressWarnings({"unused"}) | ||
public enum HerbTypes { | ||
ROSEMARY(), | ||
THYME(), | ||
TARRAGON(), | ||
CHAMOMILE(), | ||
CHIVES(), | ||
VERBENA(), | ||
SORREL(), | ||
MARJORAM(), | ||
CHERVIL(), | ||
FENNSEL(), | ||
CEILLIS(), | ||
PUNUEL(), | ||
ESSITTE(), | ||
THYOCIELLE(), | ||
FENNKYSTRAL(), | ||
CALENDULA(), | ||
SAGE(); | ||
|
||
public final String herb_id; | ||
|
||
|
||
public final RegistrySupplier<Block> base_block; | ||
|
||
public final RegistrySupplier<Item> pounded_herb; | ||
public final RegistrySupplier<Item> dried_herb; | ||
|
||
public final RegistrySupplier<Block> lantern_block; | ||
|
||
public final RegistrySupplier<Block> herb_pile_block; | ||
public final RegistrySupplier<Block> herb_barrel_block; | ||
|
||
HerbTypes() { | ||
this.herb_id = name().toLowerCase(Locale.ROOT); | ||
this.base_block = BlockInit.register(herb_id, new FlowerBlock(SuspiciousStewEffects.EMPTY, BlockBehaviour.Properties.ofFullCopy(Blocks.POPPY))); | ||
|
||
this.pounded_herb = ItemInit.register("pounded_" + herb_id, new Item(new Item.Properties())); | ||
this.dried_herb = ItemInit.register("dried_" + herb_id, new Item(new Item.Properties())); | ||
|
||
this.lantern_block = BlockInit.register(herb_id + "_lantern", new LanternBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.LANTERN))); | ||
this.herb_pile_block = BlockInit.register(herb_id + "_herb_pile", new LeafPileBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.WHITE_CARPET).sound(SoundType.GRASS))); | ||
this.herb_barrel_block = BlockInit.register(herb_id + "_herb_barrel", new Block(BlockBehaviour.Properties.ofFullCopy(Blocks.BARREL))); | ||
|
||
} | ||
|
||
public static void register() {} | ||
} |
46 changes: 46 additions & 0 deletions
46
Common/src/main/java/net/dakotapride/hibernalHerbs/common/item/HerbalGrimoireItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package net.dakotapride.hibernalHerbs.common.item; | ||
|
||
import net.dakotapride.hibernalHerbs.common.HibernalHerbsCommonMod; | ||
import net.minecraft.ChatFormatting; | ||
import net.minecraft.client.gui.screens.Screen; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.server.level.ServerPlayer; | ||
import net.minecraft.world.InteractionHand; | ||
import net.minecraft.world.InteractionResultHolder; | ||
import net.minecraft.world.entity.player.Player; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.item.TooltipFlag; | ||
import net.minecraft.world.level.Level; | ||
import org.jetbrains.annotations.NotNull; | ||
import vazkii.patchouli.api.PatchouliAPI; | ||
|
||
import java.util.List; | ||
|
||
public class HerbalGrimoireItem extends Item { | ||
public HerbalGrimoireItem(Properties properties) { | ||
super(properties); | ||
} | ||
|
||
@Override | ||
public @NotNull InteractionResultHolder<ItemStack> use(@NotNull Level level, Player player, @NotNull InteractionHand hand) { | ||
ItemStack itemStack = player.getItemInHand(hand); | ||
|
||
if (player instanceof ServerPlayer serverPlayer) { | ||
|
||
PatchouliAPI.get().openBookGUI(serverPlayer, HibernalHerbsCommonMod.asResource("grimoire")); | ||
|
||
return InteractionResultHolder.success(itemStack); | ||
} else return InteractionResultHolder.fail(itemStack); | ||
} | ||
|
||
@Override | ||
public void appendHoverText(ItemStack itemStack, TooltipContext tooltipContext, List<Component> list, TooltipFlag tooltipFlag) { | ||
if (!Screen.hasShiftDown()) { | ||
list.add(Component.translatable("text.hibernalherbs.controls.shift").withStyle(ChatFormatting.DARK_GRAY)); | ||
} else if (Screen.hasShiftDown()) { | ||
list.add(Component.translatable("text.hibernalherbs.grimoire.integration.one").withStyle(ChatFormatting.GRAY).withStyle(ChatFormatting.ITALIC)); | ||
list.add(Component.translatable("text.hibernalherbs.grimoire.integration.two").withStyle(ChatFormatting.GRAY).withStyle(ChatFormatting.ITALIC)); | ||
} | ||
} | ||
} |
20 changes: 0 additions & 20 deletions
20
Common/src/main/java/net/dakotapride/hibernalHerbs/platform/Services.java
This file was deleted.
Oops, something went wrong.
26 changes: 0 additions & 26 deletions
26
Common/src/main/java/net/dakotapride/hibernalHerbs/platform/services/IPlatformHelper.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.