-
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
3ab5889
commit c829873
Showing
215 changed files
with
5,319 additions
and
100 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
24 changes: 24 additions & 0 deletions
24
src/main/java/net/dakotapride/garnished/effect/FreezingMobEffect.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,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)); | ||
} | ||
} |
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
10 changes: 10 additions & 0 deletions
10
src/main/java/net/dakotapride/garnished/item/ChilledAppleFoodItem.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 ChilledAppleFoodItem extends Item implements IGarnishedItem { | ||
public ChilledAppleFoodItem(Properties properties) { | ||
super(properties.food(GarnishedFoods.CHILLED_APPLE)); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/net/dakotapride/garnished/item/CookedPolarBearMeatItem.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.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)); | ||
} | ||
|
||
} |
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
42 changes: 42 additions & 0 deletions
42
src/main/java/net/dakotapride/garnished/item/DustyRegaleFoodItem.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 |
---|---|---|
@@ -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); | ||
} | ||
} |
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
53 changes: 53 additions & 0 deletions
53
src/main/java/net/dakotapride/garnished/item/ExplorersConcoctionFoodItem.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,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); | ||
} | ||
|
||
} |
Oops, something went wrong.