Skip to content

Commit

Permalink
v1.7 - initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
DakotaPride committed Mar 12, 2024
1 parent 3ab5889 commit c829873
Show file tree
Hide file tree
Showing 215 changed files with 5,319 additions and 100 deletions.
17 changes: 15 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ repositories {
maven { url = "https://maven.jamieswhiteshirt.com/libs-release" } // Reach Entity Attributes
maven { url = "https://jitpack.io/" } // Mixin Extras, Fabric ASM
maven { url = "https://maven.tterrag.com/" } // Flywheel
maven { url = "https://mvn.devos.one/releases" } // Porting Lib Releases
maven { url = "https://raw.githubusercontent.com/Fuzss/modresources/main/maven/" } // Forge config api port
}

dependencies {
Expand All @@ -43,6 +45,11 @@ dependencies {
})
modImplementation("net.fabricmc:fabric-loader:${fabric_loader_version}")

// Create Dragon Lib
// include(modImplementation("plus.dragons.createdragonlib:create_dragon_lib-fabric-${minecraft_version}:${dragonlib_version}"){
// transitive = false
// })

// dependencies
modImplementation("net.fabricmc.fabric-api:fabric-api:${fabric_api_version}")

Expand All @@ -68,11 +75,17 @@ dependencies {
default: println("Unknown recipe viewer specified: ${recipe_viewer}. Must be JEI, REI, EMI, or disabled.")
}
// if you would like to add integration with them, uncomment them here.
// modCompileOnly("mezz.jei:jei-${minecraft_version}-fabric:${jei_fabric_version}")
// modCompileOnly("mezz.jei:jei-${minecraft_version}-common:${jei_fabric_version}")
// modCompileOnly("mezz.jei:jei-${minecraft_version}-fabric:${jei_version}")
// modCompileOnly("mezz.jei:jei-${minecraft_version}-common:${jei_version}")
// modCompileOnly("me.shedaniel:RoughlyEnoughItems-api-fabric:${rei_version}")
// modCompileOnly("me.shedaniel:RoughlyEnoughItems-default-plugin-fabric:${rei_version}")
// modCompileOnly("dev.emi:emi:${emi_version}")

// compile against the JEI API but do not include it at runtime
modCompileOnlyApi("mezz.jei:jei-${minecraft_version}-common-api:${jei_version}")
modCompileOnlyApi("mezz.jei:jei-${minecraft_version}-fabric-api:${jei_version}")
// at runtime, use the full JEI jar for Fabric
modRuntimeOnly("mezz.jei:jei-${minecraft_version}-fabric:${jei_version}")
}

loom {
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ parchment_version = 2022.11.06

# Create
# https://modrinth.com/mod/create-fabric/versions
create_version = 0.5.1-c-build.1159+mc1.18.2
create_version = 0.5.1-f-build.1333+mc1.18.2

# Development QOL
# Create supports all 3 recipe viewers: JEI, REI, and EMI. This decides which is enabled at runtime.
# set to disabled to have none of them.
recipe_viewer = disabled
recipe_viewer = jei
# https://modrinth.com/mod/jei/versions
jei_version = 10.2.1.1002
jei_version = 10.2.1.283
# https://modrinth.com/mod/rei/versions
rei_version = 8.3.662
# https://modrinth.com/mod/emi/versions
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/net/dakotapride/garnished/CreateGarnished.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

import net.dakotapride.garnished.mixin.PotionBrewingMixin;
import net.dakotapride.garnished.modifier.LootTableModifiers;
import net.dakotapride.garnished.recipe.GarnishedFanProcessing;
import net.dakotapride.garnished.registry.GarnishedEnchantments;
import net.dakotapride.garnished.registry.GarnishedRecipeTypes;
import net.dakotapride.garnished.registry.utility.GarnishedLang;
import net.fabricmc.fabric.api.biome.v1.BiomeModifications;

import net.fabricmc.fabric.api.biome.v1.BiomeSelectors;
Expand Down Expand Up @@ -58,6 +61,8 @@ public void onInitialize() {
GarnishedTags.setRegister();
GarnishedEnchantments.setRegister();
LootTableModifiers.modifyLootTables();
GarnishedRecipeTypes.register();
GarnishedFanProcessing.register();
REGISTRATE.get().register();

// Generation
Expand Down Expand Up @@ -108,6 +113,9 @@ public void onInitialize() {

PotionBrewing.addMix(Potions.MUNDANE, GarnishedItems.SOLEMN_DUST.get(), GarnishedEffects.MUMMIFICATION_POTION);

PotionBrewing.addMix(Potions.THICK, GarnishedItems.FROST.get(), GarnishedEffects.FREEZING_POTION);
PotionBrewing.addMix(GarnishedEffects.FREEZING_POTION, Items.REDSTONE, GarnishedEffects.LONG_FREEZING_POTION);

StrippableBlockRegistry.register(GarnishedBlocks.SEPIA_STEM.get(), GarnishedBlocks.STRIPPED_SEPIA_STEM.get());
StrippableBlockRegistry.register(GarnishedBlocks.SEPIA_HYPHAE.get(), GarnishedBlocks.STRIPPED_SEPIA_HYPHAE.get());
StrippableBlockRegistry.register(GarnishedBlocks.NUT_LOG.get(), GarnishedBlocks.STRIPPED_NUT_LOG.get());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package net.dakotapride.garnished.effect;

import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.effect.MobEffectCategory;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;

import org.jetbrains.annotations.Nullable;

public class FreezingMobEffect extends MobEffect {
public FreezingMobEffect() {
super(MobEffectCategory.HARMFUL, 0xBEF0F0);
}

@Override
public boolean isInstantenous() {
return true;
}

@Override
public void applyInstantenousEffect(@Nullable Entity pSource, @Nullable Entity pIndirectSource, LivingEntity living, int amplifier, double pHealth) {
living.setTicksFrozen(400 * (amplifier + 1));
}
}
19 changes: 5 additions & 14 deletions src/main/java/net/dakotapride/garnished/item/CashewFruitItem.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package net.dakotapride.garnished.item;

import java.util.List;
import java.util.Random;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
Expand All @@ -11,8 +10,6 @@
import net.minecraft.network.chat.Component;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.stats.Stats;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
Expand All @@ -27,28 +24,22 @@ public CashewFruitItem(Properties properties) {
@Override
public void appendHoverText(ItemStack stack, @Nullable Level level, List<Component> tooltip, TooltipFlag isAdvanced) {
// if (!Screen.hasShiftDown()) {
// tooltip.add(new TranslatableComponent("text.garnished.hold_shift").withStyle(ChatFormatting.GRAY));
// tooltip.add(Component.translatable("text.garnished.hold_shift").withStyle(ChatFormatting.GRAY));
// }
//
// if (Screen.hasShiftDown()) {
// tooltip.add(new TextComponent(""));
// tooltip.add(new TranslatableComponent("text.garnished.cashew_fruit.poisoning").withStyle(ChatFormatting.DARK_PURPLE));
// tooltip.add(new TextComponent(""));
// tooltip.add(new TranslatableComponent("text.garnished.cashew_fruit.poisoning.chance").withStyle(ChatFormatting.DARK_PURPLE));
// tooltip.add(Component.literal(""));
// tooltip.add(Component.translatable("text.garnished.cashew_fruit.poisoning").withStyle(ChatFormatting.DARK_PURPLE));
// tooltip.add(Component.literal(""));
// tooltip.add(Component.translatable("text.garnished.cashew_fruit.poisoning.chance").withStyle(ChatFormatting.DARK_PURPLE));
// }
}

@Override
public @NotNull ItemStack finishUsingItem(@NotNull ItemStack stack, @NotNull Level level, @NotNull LivingEntity livingEntity) {
int random = new Random().nextInt(4);

if (livingEntity instanceof ServerPlayer serverPlayer) {
CriteriaTriggers.CONSUME_ITEM.trigger(serverPlayer, stack);
serverPlayer.awardStat(Stats.ITEM_USED.get(this));

if (random == 1) {
livingEntity.addEffect(new MobEffectInstance(MobEffects.POISON, getCashewFruitEffectDuration));
}
}

return super.finishUsingItem(stack, level, livingEntity);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package net.dakotapride.garnished.item;

import net.dakotapride.garnished.registry.GarnishedFoods;
import net.minecraft.world.item.Item;

public class ChilledAppleFoodItem extends Item implements IGarnishedItem {
public ChilledAppleFoodItem(Properties properties) {
super(properties.food(GarnishedFoods.CHILLED_APPLE));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package net.dakotapride.garnished.item;

import net.dakotapride.garnished.registry.GarnishedFoods;
import net.minecraft.world.item.Item;

public class CookedPolarBearMeatItem extends Item implements IGarnishedItem {
public CookedPolarBearMeatItem(Properties properties) {
super(properties.food(GarnishedFoods.COOKED_POLAR_BEAR_MEAT));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

import org.jetbrains.annotations.NotNull;

import net.dakotapride.garnished.registry.GarnishedEffects;
import net.dakotapride.garnished.registry.GarnishedFoods;
import net.minecraft.advancements.CriteriaTriggers;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.stats.Stats;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResultHolder;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
Expand All @@ -31,11 +29,9 @@ public DesolateStewFoodItem(Properties properties) {
serverPlayer.awardStat(Stats.ITEM_USED.get(this));
}

if (livingEntity instanceof ServerPlayer serverPlayer && getWrappedTangleEffectChance()) {
if (livingEntity instanceof ServerPlayer serverPlayer) {
CriteriaTriggers.CONSUME_ITEM.trigger(serverPlayer, stack);
serverPlayer.awardStat(Stats.ITEM_USED.get(this));

livingEntity.addEffect(new MobEffectInstance(GarnishedEffects.COGNATE, getCognateEffectBaseTick, 1));
}

if (stack.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,52 @@
package net.dakotapride.garnished.item;

import org.jetbrains.annotations.NotNull;

import net.dakotapride.garnished.registry.GarnishedFoods;
import net.minecraft.advancements.CriteriaTriggers;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.stats.Stats;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResultHolder;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.ItemUtils;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.Level;

public class DustyRegaleFoodItem extends Item implements IGarnishedItem {
public DustyRegaleFoodItem(Properties properties) {
super(properties.food(GarnishedFoods.DUSTY_REGALE));
}

@Override
public @NotNull ItemStack finishUsingItem(@NotNull ItemStack stack, @NotNull Level level, @NotNull LivingEntity livingEntity) {
super.finishUsingItem(stack, level, livingEntity);
if (livingEntity instanceof ServerPlayer serverPlayer) {
CriteriaTriggers.CONSUME_ITEM.trigger(serverPlayer, stack);
serverPlayer.awardStat(Stats.ITEM_USED.get(this));
}

if (stack.isEmpty()) {
return new ItemStack(Items.BOWL);
} else {
if (livingEntity instanceof Player && !((Player)livingEntity).getAbilities().instabuild) {
ItemStack itemStack = new ItemStack(Items.BOWL);
Player player = (Player)livingEntity;
if (!player.getInventory().add(itemStack)) {
player.drop(itemStack, false);
}
}

return stack;
}

}

@Override
public @NotNull InteractionResultHolder<ItemStack> use(@NotNull Level level, @NotNull Player player, @NotNull InteractionHand usedHand) {
return ItemUtils.startUsingInstantly(level, player, usedHand);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

import org.jetbrains.annotations.NotNull;

import net.dakotapride.garnished.registry.GarnishedEffects;
import net.dakotapride.garnished.registry.GarnishedFoods;
import net.minecraft.advancements.CriteriaTriggers;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.stats.Stats;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResultHolder;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
Expand All @@ -31,11 +29,9 @@ public EtherealConcoctionFoodItem(Properties properties) {
serverPlayer.awardStat(Stats.ITEM_USED.get(this));
}

if (livingEntity instanceof ServerPlayer serverPlayer && getWrappedTangleEffectChance()) {
if (livingEntity instanceof ServerPlayer serverPlayer) {
CriteriaTriggers.CONSUME_ITEM.trigger(serverPlayer, stack);
serverPlayer.awardStat(Stats.ITEM_USED.get(this));

livingEntity.addEffect(new MobEffectInstance(GarnishedEffects.COGNATE, getCognateEffectBaseTick, 1));
}

if (stack.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package net.dakotapride.garnished.item;

import org.jetbrains.annotations.NotNull;

import net.dakotapride.garnished.registry.GarnishedFoods;
import net.minecraft.advancements.CriteriaTriggers;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.stats.Stats;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResultHolder;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.ItemUtils;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.Level;

public class ExplorersConcoctionFoodItem extends Item implements IGarnishedItem {
public ExplorersConcoctionFoodItem(Properties properties) {
super(properties.food(GarnishedFoods.EXPLORERS_CONCOCTION).stacksTo(1));
}

@Override
public @NotNull ItemStack finishUsingItem(@NotNull ItemStack stack, @NotNull Level level, @NotNull LivingEntity livingEntity) {
super.finishUsingItem(stack, level, livingEntity);
if (livingEntity instanceof ServerPlayer serverPlayer) {
CriteriaTriggers.CONSUME_ITEM.trigger(serverPlayer, stack);
serverPlayer.awardStat(Stats.ITEM_USED.get(this));
}

if (stack.isEmpty()) {
return new ItemStack(Items.BOWL);
} else {
if (livingEntity instanceof Player && !((Player)livingEntity).getAbilities().instabuild) {
ItemStack itemStack = new ItemStack(Items.BOWL);
Player player = (Player)livingEntity;
if (!player.getInventory().add(itemStack)) {
player.drop(itemStack, false);
}
}

return stack;
}

}

@Override
public @NotNull InteractionResultHolder<ItemStack> use(@NotNull Level level, @NotNull Player player, @NotNull InteractionHand usedHand) {
return ItemUtils.startUsingInstantly(level, player, usedHand);
}

}
Loading

0 comments on commit c829873

Please sign in to comment.