-
Notifications
You must be signed in to change notification settings - Fork 4
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
3c5c28b
commit 3d13227
Showing
198 changed files
with
3,775 additions
and
470 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
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
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
22 changes: 22 additions & 0 deletions
22
src/main/java/net/dakotapride/garnished/block/EnderJellyBlock.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,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(); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
src/main/java/net/dakotapride/garnished/block/sapling/EndPlantBlock.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,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); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/net/dakotapride/garnished/effect/CognateMobEffect.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,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); | ||
} | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/net/dakotapride/garnished/effect/FlagrantMobEffect.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,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); | ||
} | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/net/dakotapride/garnished/enchantment/HatchetEnchantment.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,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; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/net/dakotapride/garnished/enchantment/RavagingEnchantment.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,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; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/net/dakotapride/garnished/enchantment/SalvagingEnchantment.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,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; | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
src/main/java/net/dakotapride/garnished/item/BottledEnderJellyFoodItem.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,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); | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
src/main/java/net/dakotapride/garnished/item/ChorusBowlFoodItem.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,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); | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
src/main/java/net/dakotapride/garnished/item/ChorusCocktailItem.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,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); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/net/dakotapride/garnished/item/ChorusCookieFoodItem.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,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)); | ||
} | ||
} |
Oops, something went wrong.