Added a Golden Toast similar to the Golden Apple

This commit is contained in:
TheBlackfurGuy 2022-01-06 18:30:01 +01:00
parent 63db9920b2
commit 18b71ec162
6 changed files with 74 additions and 11 deletions

View file

@ -4,14 +4,12 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="9d600e86-9aa6-49ee-bbc5-e23128c6a4d1" name="Changes" comment="one texture file was missing">
<change afterPath="$PROJECT_DIR$/src/main/resources/assets/tastytoasters/sounds.json" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/resources/assets/tastytoasters/sounds/toaster_lock.ogg" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/resources/assets/tastytoasters/sounds/toaster_release.ogg" afterDir="false" />
<list default="true" id="9d600e86-9aa6-49ee-bbc5-e23128c6a4d1" name="Changes" comment="fixed a bunch of typos and added sounds :D">
<change afterPath="$PROJECT_DIR$/src/main/java/blackfur/tastytoasters/items/GoldenToastItem.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/resources/assets/tastytoasters/textures/item/golden_toast.png" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/blackfur/tastytoasters/Tastytoasters.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/blackfur/tastytoasters/Tastytoasters.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/blackfur/tastytoasters/block/ToasterBlock.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/blackfur/tastytoasters/block/ToasterBlock.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/blackfur/tastytoasters/block/ToasterBlockEntity.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/blackfur/tastytoasters/block/ToasterBlockEntity.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/blackfur/tastytoasters/items/ToasterItem.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/blackfur/tastytoasters/items/ToasterItem.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/resources/assets/tastytoasters/lang/en_us.json" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/resources/assets/tastytoasters/lang/en_us.json" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
@ -105,7 +103,7 @@
<recent name="$PROJECT_DIR$/Temp" />
</key>
</component>
<component name="RunManager" selected="Gradle.tastytoasters [build]">
<component name="RunManager" selected="Application.Minecraft Client">
<configuration name="tastytoasters [buildDependents]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
@ -294,7 +292,14 @@
<option name="project" value="LOCAL" />
<updated>1641398298085</updated>
</task>
<option name="localTasksCounter" value="12" />
<task id="LOCAL-00012" summary="fixed a bunch of typos and added sounds :D">
<created>1641409229142</created>
<option name="number" value="00012" />
<option name="presentableId" value="LOCAL-00012" />
<option name="project" value="LOCAL" />
<updated>1641409229142</updated>
</task>
<option name="localTasksCounter" value="13" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -321,6 +326,7 @@
<MESSAGE value="welll it seems there is a fabric api bug" />
<MESSAGE value="Finally fixed a dumb sync issue :D" />
<MESSAGE value="one texture file was missing" />
<option name="LAST_COMMIT_MESSAGE" value="one texture file was missing" />
<MESSAGE value="fixed a bunch of typos and added sounds :D" />
<option name="LAST_COMMIT_MESSAGE" value="fixed a bunch of typos and added sounds :D" />
</component>
</project>

View file

@ -4,13 +4,18 @@ import blackfur.tastytoasters.block.ToasterBlock;
import blackfur.tastytoasters.block.ToasterBlockEntity;
import blackfur.tastytoasters.items.*;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.loot.v1.FabricLootPoolBuilder;
import net.fabricmc.fabric.api.loot.v1.event.LootTableLoadingCallback;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder;
import net.fabricmc.fabric.api.registry.FuelRegistry;
import net.minecraft.block.Material;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.loot.LootTables;
import net.minecraft.loot.entry.ItemEntry;
import net.minecraft.sound.SoundEvent;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
@ -22,6 +27,7 @@ public class Tastytoasters implements ModInitializer {
public static final Item BURNT_TOAST_ITEM = new BurntToastItem();
public static final Item BUTTER_ITEM = new ButterItem();
public static final Item BUTTERED_TOAST_ITEM = new ButteredToastItem();
public static final Item GOLDEN_TOAST_ITEM = new GoldenToastItem();
public static final ToasterBlock TOASTER_BLOCK = new ToasterBlock(FabricBlockSettings.of(Material.METAL).hardness(4.0f).requiresTool());
@ -39,6 +45,7 @@ public class Tastytoasters implements ModInitializer {
Registry.register(Registry.ITEM, new Identifier("tastytoasters", "burnt_toast"), BURNT_TOAST_ITEM);
Registry.register(Registry.ITEM, new Identifier("tastytoasters", "butter"), BUTTER_ITEM);
Registry.register(Registry.ITEM, new Identifier("tastytoasters", "buttered_toast"), BUTTERED_TOAST_ITEM);
Registry.register(Registry.ITEM, new Identifier("tastytoasters", "golden_toast"), GOLDEN_TOAST_ITEM);
Registry.register(Registry.BLOCK, new Identifier("tastytoasters", "toaster"), TOASTER_BLOCK);
Registry.register(Registry.ITEM, new Identifier("tastytoasters", "toaster"), new BlockItem(TOASTER_BLOCK, new Item.Settings().group(ItemGroup.FOOD)));
@ -47,5 +54,7 @@ public class Tastytoasters implements ModInitializer {
Registry.register(Registry.SOUND_EVENT, TOASTER_LOCK_SOUND_ID, TOASTER_LOCK_SOUND_EVENT);
Registry.register(Registry.SOUND_EVENT, TOASTER_RELEASE_SOUND_ID, TOASTER_RELEASE_SOUND_EVENT);
FuelRegistry.INSTANCE.add(BURNT_TOAST_ITEM, 1600);
}
}

View file

@ -0,0 +1,46 @@
package blackfur.tastytoasters.items;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.minecraft.client.item.TooltipContext;
import net.minecraft.entity.effect.StatusEffect;
import net.minecraft.entity.effect.StatusEffectInstance;
import net.minecraft.item.FoodComponent;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.item.ItemStack;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.Formatting;
import net.minecraft.util.Rarity;
import net.minecraft.world.World;
import java.util.List;
public class GoldenToastItem extends Item {
public GoldenToastItem() {
super(new FabricItemSettings()
.group(ItemGroup.FOOD)
.food(new FoodComponent.Builder()
.hunger(4)
.saturationModifier(2.4f)
.statusEffect(new StatusEffectInstance(
StatusEffect.byRawId(22),
120*20
), 1.0f)
.statusEffect(new StatusEffectInstance(
StatusEffect.byRawId(10),
5*20,
2
),
1.0f)
.build()
)
.rarity(Rarity.RARE)
);
}
@Override
public void appendTooltip(ItemStack itemStack, World world, List<Text> tooltip, TooltipContext tooltipContext) {
tooltip.add(new TranslatableText("item.tastytoasters.golden_toast.tooltip").formatted(Formatting.GOLD));
}
}

View file

@ -15,7 +15,7 @@ import java.util.List;
public class ToasterItem extends BlockItem {
public ToasterItem(Block block) {
super(block, new FabricItemSettings().group(ItemGroup.FOOD));
super(block, new FabricItemSettings().group(ItemGroup.DECORATIONS));
}
@Override

View file

@ -10,6 +10,8 @@
"item.tastytoasters.butter.tooltip.2": "inherits milk properties",
"item.tastytoasters.buttered_toast": "Buttered Toast",
"item.tastytoasters.buttered_toast.tooltip": "So great, but not shiny enough",
"item.tastytoasters.golden_toast": "Golden Toast",
"item.tastytoasters.golden_toast.tooltip": "The most shiny of them all",
"block.tastytoasters.toaster": "Toaster",
"block.tastytoasters.toaster.tooltip": "The gate to happiness",
"subtitles.tastytoasters.toaster_lock": "Toaster locks",

Binary file not shown.

After

Width:  |  Height:  |  Size: 791 B