Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexModGuy committed Oct 21, 2024
1 parent b5a1bb7 commit ae82d91
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ public void rerollWantedItem() {
this.updateTopAndBottomBlocks();
this.level.playSound(null, this.getBlockPos(), getFilledLevel() >= MAX_FILL_AMOUNT ? ACSoundRegistry.CONVERSION_CRUCIBLE_ACTIVATE.get() : ACSoundRegistry.CONVERSION_CRUCIBLE_ADD.get(), SoundSource.BLOCKS);
if (this.isWitchMode()) {
this.wantStack = new ItemStack(ACItemRegistry.RADIANT_ESSENCE.get());
this.wantStack = new ItemStack(ACItemRegistry.LICOWITCH_RADIANT_ESSENCE.get());
} else if (getFilledLevel() > MAX_FILL_AMOUNT - 2) {
Registry<Biome> registry = level.registryAccess().registryOrThrow(Registries.BIOME);
Optional<Holder.Reference<Biome>> biomeHolder = registry.getHolder(this.convertingToBiome);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,9 @@ public void tick() {
mob.setItemInHand(InteractionHand.MAIN_HAND, ItemStack.EMPTY);
Vec3 from = mob.getSwingArmPosition();
ItemStack stack = crucibleBlock.getWantItem().copy();
CompoundTag tag = new CompoundTag();
tag.putBoolean("ThrownByLicowitch", true);
stack.setTag(tag);
tossedItem = new ItemEntity(mob.level(), from.x, from.y, from.z, stack);
Vec3 delta = center.subtract(from).normalize().scale(0.13F).add(0, 0.4F, 0);
tossedItem.setNeverPickUp();
tossedItem.setDeltaMovement(delta);
tossedItem.checkDespawn();
mob.level().addFreshEntity(tossedItem);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public class ACFoods {
public static final FoodProperties CARAMEL = (new FoodProperties.Builder()).nutrition(2).saturationMod(0.3F).effect(() -> new MobEffectInstance(ACEffectRegistry.SUGAR_RUSH.get(), 200), 0.04F).build();
public static final FoodProperties CARAMEL_APPLE = (new FoodProperties.Builder()).nutrition(6).saturationMod(0.2F).effect(() -> new MobEffectInstance(ACEffectRegistry.SUGAR_RUSH.get(), 200), 0.02F).build();
public static final FoodProperties GUMBALL_PILE = (new FoodProperties.Builder()).nutrition(3).saturationMod(0.2F).effect(() -> new MobEffectInstance(ACEffectRegistry.SUGAR_RUSH.get(), 200), 0.01F).build();
public static final FoodProperties ALEX_MEAL = (new FoodProperties.Builder()).nutrition(100).saturationMod(5.0F).effect(() -> new MobEffectInstance(MobEffects.CONFUSION, 200), 1.0F).effect(() -> new MobEffectInstance(MobEffects.BAD_OMEN, 48000), 1.0F).build();
public static final FoodProperties ALEX_MEAL = (new FoodProperties.Builder()).nutrition(40).saturationMod(5.0F).effect(() -> new MobEffectInstance(MobEffects.CONFUSION, 200), 1.0F).effect(() -> new MobEffectInstance(MobEffects.BAD_OMEN, 48000), 1.0F).build();
public static final FoodProperties BIOME_TREAT = (new FoodProperties.Builder()).nutrition(20).saturationMod(0.1F).build();
public static final FoodProperties BIOME_TREAT_DONE = (new FoodProperties.Builder()).nutrition(1).saturationMod(0.1F).build();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ public class ACItemRegistry {
public static final RegistryObject<Item> CANDY_CANE_HOOK = DEF_REG.register("candy_cane_hook", () -> new CandyCaneHookItem());
public static final RegistryObject<Item> SWEET_TOOTH = DEF_REG.register("sweet_tooth", () -> new Item(new Item.Properties().rarity(RARITY_SWEET)));
public static final RegistryObject<Item> RADIANT_ESSENCE = DEF_REG.register("radiant_essence", () -> new RadiantEssenceItem());
public static final RegistryObject<Item> LICOWITCH_RADIANT_ESSENCE = DEF_REG.register("licowitch_radiant_essence", () -> new RadiantEssenceItem());
public static final RegistryObject<Item> SACK_OF_SATING = DEF_REG.register("sack_of_sating", () -> new SackOfSatingItem());
public static final RegistryObject<Item> SUGAR_STAFF = DEF_REG.register("sugar_staff", () -> new SugarStaffItem(new Item.Properties().defaultDurability(100).rarity(Rarity.UNCOMMON)));
public static final RegistryObject<Item> SUGAR_STAFF_SPRITE = DEF_REG.register("sugar_staff_inventory", () -> new Item(new Item.Properties()));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,34 +1,30 @@
package com.github.alexmodguy.alexscaves.server.item;

import net.minecraft.ChatFormatting;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.LivingEntity;
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 javax.annotation.Nullable;
import java.util.List;

public class RadiantEssenceItem extends Item {

public RadiantEssenceItem() {
super(new Item.Properties().rarity(ACItemRegistry.RARITY_RAINBOW));
}

public void inventoryTick(ItemStack itemStack, Level level, Entity entity, int i, boolean b) {
if (!level.isClientSide) {
if (wasThrownByLicowitch(itemStack) && entity.tickCount % 10 == 0) {
itemStack.shrink(1);
if(entity instanceof LivingEntity living){
living.addEffect(new MobEffectInstance(MobEffects.HUNGER, 3000));
}
}
public void appendHoverText(ItemStack stack, @Nullable Level worldIn, List<Component> tooltip, TooltipFlag flagIn) {
if(this == ACItemRegistry.LICOWITCH_RADIANT_ESSENCE.get()){
tooltip.add(Component.translatable("item.alexscaves.licowitch_radiant_essence.desc").withStyle(ChatFormatting.GRAY).withStyle(ChatFormatting.ITALIC));
}
super.appendHoverText(stack, worldIn, tooltip, flagIn);
}

public static boolean wasThrownByLicowitch(ItemStack stack) {
CompoundTag compoundtag = stack.getTag();
return compoundtag != null && compoundtag.getBoolean("ThrownByLicowitch");
}

}
2 changes: 2 additions & 0 deletions src/main/resources/assets/alexscaves/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,8 @@
"item.alexscaves.candy_cane_hook": "Candy Cane Hook",
"item.alexscaves.sweet_tooth": "Sweet Tooth",
"item.alexscaves.radiant_essence": "Radiant Essence",
"item.alexscaves.licowitch_radiant_essence": "Radiant Essence",
"item.alexscaves.licowitch_radiant_essence.desc": "On closer inspection, it appears you ordered this Radiant Essence off of Temu",
"item.alexscaves.sack_of_sating": "Sack of Sating",
"item.alexscaves.sugar_staff": "Sugar Staff",
"item.alexscaves.sugar_staff_inventory": "Sugar Staff",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "alexscaves:item/radiant_essence"
}
}

0 comments on commit ae82d91

Please sign in to comment.