Skip to content

Commit

Permalink
v1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
DakotaPride committed Oct 14, 2023
1 parent 3c5c28b commit 3d13227
Show file tree
Hide file tree
Showing 198 changed files with 3,775 additions and 470 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx2G
# Mod Info
maven_group = net.dakotapride
archives_base_name = garnished
mod_version = 0.9
mod_version = 1.0

minecraft_version = 1.20.1

Expand Down
3 changes: 3 additions & 0 deletions src/main/java/net/dakotapride/garnished/CreateGarnished.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package net.dakotapride.garnished;

import net.dakotapride.garnished.registry.GarnishedEnchantments;
import net.fabricmc.fabric.api.registry.StrippableBlockRegistry;

import org.slf4j.Logger;
Expand Down Expand Up @@ -44,6 +45,7 @@ public void onInitialize() {
GarnishedFluids.setRegister();
GarnishedFoods.setRegister();
GarnishedEffects.setRegister();
GarnishedEnchantments.setRegister();
GarnishedTags.setRegister();
REGISTRATE.get().register();

Expand All @@ -63,6 +65,7 @@ public void onInitialize() {

PotionBrewing.addMix(Potions.AWKWARD, GarnishedItems.BRITTLE_DUST.get(), GarnishedEffects.AVERSION_POTION);
PotionBrewing.addMix(GarnishedEffects.AVERSION_POTION, Items.REDSTONE, GarnishedEffects.LONG_AVERSION_POTION);
PotionBrewing.addMix(Potions.AWKWARD, GarnishedItems.ENDER_JELLY_BLOB.get(), GarnishedEffects.FLAGRANT_POTION);

PotionBrewing.addMix(Potions.AWKWARD, GarnishedItems.SENILE_SWEET_BLACKSTONE.get(), GarnishedEffects.BLINDNESS_POTION);
PotionBrewing.addMix(Potions.AWKWARD, GarnishedItems.SENILE_SWEET_BASALT.get(), Potions.WEAKNESS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import net.minecraft.client.color.item.ItemColor;
import net.minecraft.client.color.item.ItemColors;
import net.minecraft.client.renderer.BiomeColors;
import net.minecraft.client.renderer.ItemBlockRenderTypes;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.level.FoliageColor;
Expand Down Expand Up @@ -43,6 +44,10 @@ public void onInitializeClient() {
BlockRenderLayerMap.INSTANCE.putBlock(GarnishedBlocks.SEPIA_TRAPDOOR.get(), RenderType.cutout());
BlockRenderLayerMap.INSTANCE.putBlock(GarnishedBlocks.SOUL_ROOTS.get(), RenderType.cutout());

BlockRenderLayerMap.INSTANCE.putBlock(GarnishedBlocks.BLOCK_OF_ENDER_JELLY.get(), RenderType.translucent());
BlockRenderLayerMap.INSTANCE.putBlock(GarnishedBlocks.BARREN_ROOTS.get(), RenderType.cutout());
BlockRenderLayerMap.INSTANCE.putBlock(GarnishedBlocks.SMALL_CHORUS_PLANT.get(), RenderType.cutout());

FluidRenderHandlerRegistry.INSTANCE.register(GarnishedFluids.GARNISH.get().getSource(),
GarnishedFluids.GARNISH.get().getFlowing(), FluidRenderHandlerRegistry.INSTANCE.get(GarnishedFluids.GARNISH.get()));
FluidRenderHandlerRegistry.INSTANCE.register(GarnishedFluids.APPLE_CIDER.get().getSource(),
Expand Down
22 changes: 22 additions & 0 deletions src/main/java/net/dakotapride/garnished/block/EnderJellyBlock.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package net.dakotapride.garnished.block;

import org.jetbrains.annotations.NotNull;

import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.HalfTransparentBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;

public class EnderJellyBlock extends HalfTransparentBlock {
public EnderJellyBlock(Properties properties) {
super(properties);
}

@Override
public @NotNull VoxelShape getVisualShape(@NotNull BlockState state, @NotNull BlockGetter level, @NotNull BlockPos pos, @NotNull CollisionContext ctx) {
return Shapes.empty();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package net.dakotapride.garnished.block.sapling;

import org.jetbrains.annotations.NotNull;

import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.BushBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;

public class EndPlantBlock extends BushBlock {
protected static final VoxelShape SHAPE = Block.box(4.0, 0.0, 4.0, 12.0, 9.0, 12.0);
public EndPlantBlock(Properties properties) {
super(properties);
}

@Override
public @NotNull VoxelShape getShape(@NotNull BlockState state, @NotNull BlockGetter level, @NotNull BlockPos pos, @NotNull CollisionContext context) {
return SHAPE;
}

@Override
public boolean mayPlaceOn(BlockState state, @NotNull BlockGetter level, @NotNull BlockPos pos) {
return state.is(Blocks.END_STONE);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package net.dakotapride.garnished.effect;

import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.effect.MobEffectCategory;

public class CognateMobEffect extends MobEffect {
public CognateMobEffect() {
super(MobEffectCategory.BENEFICIAL, 0xBA9BBA);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package net.dakotapride.garnished.effect;

import net.minecraft.world.effect.MobEffect;
import net.minecraft.world.effect.MobEffectCategory;

public class FlagrantMobEffect extends MobEffect {
public FlagrantMobEffect() {
super(MobEffectCategory.HARMFUL, 0x683B5C);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package net.dakotapride.garnished.enchantment;

import io.github.fabricators_of_create.porting_lib.enchant.CustomEnchantingTableBehaviorEnchantment;
import net.dakotapride.garnished.item.hatchet.HatchetToolItem;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.enchantment.Enchantment;
import net.minecraft.world.item.enchantment.EnchantmentCategory;

public class HatchetEnchantment extends Enchantment implements CustomEnchantingTableBehaviorEnchantment {
public HatchetEnchantment(Rarity rarity, EnchantmentCategory category, EquipmentSlot[] slots) {
super(rarity, category, slots);
}

@Override
public boolean canApplyAtEnchantingTable(ItemStack stack) {
return stack.getItem() instanceof HatchetToolItem;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package net.dakotapride.garnished.enchantment;

import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.item.enchantment.EnchantmentCategory;

public class RavagingEnchantment extends HatchetEnchantment {
public RavagingEnchantment(Rarity rarity, EnchantmentCategory category, EquipmentSlot[] slots) {
super(rarity, category, slots);
}

@Override
public int getMaxLevel() {
return 1;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package net.dakotapride.garnished.enchantment;

import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.item.enchantment.EnchantmentCategory;

public class SalvagingEnchantment extends HatchetEnchantment {
public SalvagingEnchantment(Rarity rarity, EnchantmentCategory category, EquipmentSlot[] slots) {
super(rarity, category, slots);
}

@Override
public int getMaxLevel() {
return 2;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +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 BottledEnderJellyFoodItem extends Item implements IGarnishedItem {
public BottledEnderJellyFoodItem(Properties properties) {
super(properties.food(GarnishedFoods.BOTTLED_ENDER_JELLY).stacksTo(16));
}

@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.GLASS_BOTTLE);
} else {
if (livingEntity instanceof Player && !((Player)livingEntity).getAbilities().instabuild) {
ItemStack itemStack = new ItemStack(Items.GLASS_BOTTLE);
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
@@ -0,0 +1,52 @@
package net.dakotapride.garnished.item;

import org.jetbrains.annotations.NotNull;

import net.dakotapride.garnished.registry.GarnishedFoods;
import net.dakotapride.garnished.registry.GarnishedItems;
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.level.Level;

public class ChorusBowlFoodItem extends Item implements IGarnishedItem {
public ChorusBowlFoodItem(Properties properties) {
super(properties.food(GarnishedFoods.CHORUS_BOWL).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(GarnishedItems.HOLLOWED_CHORUS_FRUIT.get());
} else {
if (livingEntity instanceof Player && !((Player)livingEntity).getAbilities().instabuild) {
ItemStack itemStack = new ItemStack(GarnishedItems.HOLLOWED_CHORUS_FRUIT.get());
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
@@ -0,0 +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 ChorusCocktailItem extends Item implements IGarnishedItem {
public ChorusCocktailItem(Properties properties) {
super(properties.food(GarnishedFoods.CHORUS_COCKTAIL).stacksTo(16));
}

@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.GLASS_BOTTLE);
} else {
if (livingEntity instanceof Player && !((Player)livingEntity).getAbilities().instabuild) {
ItemStack itemStack = new ItemStack(Items.GLASS_BOTTLE);
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
@@ -0,0 +1,10 @@
package net.dakotapride.garnished.item;

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

public class ChorusCookieFoodItem extends Item implements IGarnishedItem {
public ChorusCookieFoodItem(Properties properties) {
super(properties.food(GarnishedFoods.CHORUS_COOKIE));
}
}
Loading

0 comments on commit 3d13227

Please sign in to comment.