Compare commits

...

2 Commits

Author SHA1 Message Date
TheBlackfurGuy 3078c4a8ed fixed a bunch of typos and added sounds :D 2022-01-05 20:00:29 +01:00
TheBlackfurGuy fa7d83d5ff one texture file was missing 2022-01-05 16:58:18 +01:00
9 changed files with 82 additions and 13 deletions

View File

@ -4,9 +4,15 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="9d600e86-9aa6-49ee-bbc5-e23128c6a4d1" name="Changes" comment="welll it seems there is a fabric api bug">
<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" />
<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/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" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -99,7 +105,7 @@
<recent name="$PROJECT_DIR$/Temp" />
</key>
</component>
<component name="RunManager" selected="Gradle.tastytoasters [runClient]">
<component name="RunManager" selected="Gradle.tastytoasters [build]">
<configuration name="tastytoasters [buildDependents]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
@ -196,8 +202,8 @@
</list>
<recent_temporary>
<list>
<item itemvalue="Gradle.tastytoasters [buildDependents]" />
<item itemvalue="Gradle.tastytoasters [build]" />
<item itemvalue="Gradle.tastytoasters [buildDependents]" />
<item itemvalue="Gradle.tastytoasters [runClient]" />
</list>
</recent_temporary>
@ -274,7 +280,21 @@
<option name="project" value="LOCAL" />
<updated>1641316900137</updated>
</task>
<option name="localTasksCounter" value="10" />
<task id="LOCAL-00010" summary="Finally fixed a dumb sync issue :D">
<created>1641323089333</created>
<option name="number" value="00010" />
<option name="presentableId" value="LOCAL-00010" />
<option name="project" value="LOCAL" />
<updated>1641323089333</updated>
</task>
<task id="LOCAL-00011" summary="one texture file was missing">
<created>1641398298085</created>
<option name="number" value="00011" />
<option name="presentableId" value="LOCAL-00011" />
<option name="project" value="LOCAL" />
<updated>1641398298085</updated>
</task>
<option name="localTasksCounter" value="12" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -299,6 +319,8 @@
<MESSAGE value="toasting now fully implemented :DDD" />
<MESSAGE value="Its pretty much finished?" />
<MESSAGE value="welll it seems there is a fabric api bug" />
<option name="LAST_COMMIT_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" />
</component>
</project>

View File

@ -11,6 +11,7 @@ import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.sound.SoundEvent;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
@ -25,6 +26,11 @@ public class Tastytoasters implements ModInitializer {
public static final ToasterBlock TOASTER_BLOCK = new ToasterBlock(FabricBlockSettings.of(Material.METAL).hardness(4.0f).requiresTool());
public static BlockEntityType<ToasterBlockEntity> TOASTER_BLOCK_ENTITY;
public static final Identifier TOASTER_LOCK_SOUND_ID = new Identifier("tastytoasters:toaster_lock");
public static final Identifier TOASTER_RELEASE_SOUND_ID = new Identifier("tastytoasters:toaster_release");
public static SoundEvent TOASTER_LOCK_SOUND_EVENT = new SoundEvent(TOASTER_LOCK_SOUND_ID);
public static SoundEvent TOASTER_RELEASE_SOUND_EVENT = new SoundEvent(TOASTER_RELEASE_SOUND_ID);
@Override
public void onInitialize() {
@ -38,5 +44,8 @@ public class Tastytoasters implements ModInitializer {
Registry.register(Registry.ITEM, new Identifier("tastytoasters", "toaster"), new BlockItem(TOASTER_BLOCK, new Item.Settings().group(ItemGroup.FOOD)));
TOASTER_BLOCK_ENTITY = Registry.register(Registry.BLOCK_ENTITY_TYPE, new Identifier("tastytoasters", "toaster_entity"), FabricBlockEntityTypeBuilder.create(ToasterBlockEntity::new, TOASTER_BLOCK).build(null));
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);
}
}

View File

@ -7,6 +7,7 @@ import net.minecraft.block.entity.BlockEntityTicker;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemPlacementContext;
import net.minecraft.sound.SoundCategory;
import net.minecraft.state.StateManager;
import net.minecraft.state.property.BooleanProperty;
import net.minecraft.state.property.DirectionProperty;
@ -40,6 +41,16 @@ public class ToasterBlock extends BlockWithEntity implements BlockEntityProvider
player.getStackInHand(hand).setCount(player.getStackInHand(hand).getCount()-1);
world.setBlockState(pos, state.with(TOASTING, true));
toasterBlockEntity.handleUse();
if (!world.isClient) {
world.playSound(
null,
pos,
Tastytoasters.TOASTER_LOCK_SOUND_EVENT,
SoundCategory.BLOCKS,
1.0F,
1.0F
);
}
}
return ActionResult.success(world.isClient());
}

View File

@ -6,6 +6,7 @@ import net.minecraft.block.entity.BlockEntity;
import net.minecraft.entity.ItemEntity;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.sound.SoundCategory;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@ -19,16 +20,26 @@ public class ToasterBlockEntity extends BlockEntity {
public static void tick(World world, BlockPos pos, BlockState state, ToasterBlockEntity be) {
if (state.get(ToasterBlock.TOASTING)) {
if (be.cookTicks % 100 == 0) {
if (be.cookTicks % 50 == 0) {
world.addParticle(ParticleTypes.SMOKE, pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, 0, 0, 0);
}
if (be.cookTicks <= 0) {
world.setBlockState(pos, state.with(ToasterBlock.TOASTING, false));
if ((int) (Math.random() * 10) == 0) {
world.spawnEntity(new ItemEntity(world, pos.getX(), pos.getY() + 0.5, pos.getZ(), Tastytoasters.BURNT_TOAST_ITEM.getDefaultStack()));
} else {
world.spawnEntity(new ItemEntity(world, pos.getX(), pos.getY() + 0.5, pos.getZ(), Tastytoasters.TOAST_ITEM.getDefaultStack()));
}
if (!world.isClient) {
world.playSound(
null,
pos,
Tastytoasters.TOASTER_RELEASE_SOUND_EVENT,
SoundCategory.BLOCKS,
1.0F,
1.0F
);
}
if ((int) (Math.random() * 10) == 0) {
world.spawnEntity(new ItemEntity(world, pos.getX(), pos.getY() + 0.5, pos.getZ(), Tastytoasters.BURNT_TOAST_ITEM.getDefaultStack()));
} else {
world.spawnEntity(new ItemEntity(world, pos.getX(), pos.getY() + 0.5, pos.getZ(), Tastytoasters.TOAST_ITEM.getDefaultStack()));
}
}
be.cookTicks--;

View File

@ -5,11 +5,13 @@
"item.tastytoasters.toast.tooltip": "Tasty but you can do better",
"item.tastytoasters.burnt_toast": "Burnt Toast",
"item.tastytoasters.burnt_toast.tooltip": "What have you done??",
"item.tastytoasters.butter": "Butter,",
"item.tastytoasters.butter": "Butter",
"item.tastytoasters.butter.tooltip.1": "A yummy ingredient that",
"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",
"block.tastytoasters.toaster": "Toaster",
"block.tastytoasters.toaster.tooltip": "The gate to happiness"
"block.tastytoasters.toaster.tooltip": "The gate to happiness",
"subtitles.tastytoasters.toaster_lock": "Toaster locks",
"subtitles.tastytoasters.toaster_release": "Toaster releases"
}

View File

@ -0,0 +1,14 @@
{
"toaster_lock": {
"subtitle": "subtitles.tastytoasters.toaster_lock",
"sounds": [
"tastytoasters:toaster_lock"
]
},
"toaster_release": {
"subtitle": "subtitles.tastytoasters.toaster_release",
"sounds": [
"tastytoasters:toaster_release"
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 969 B