welll it seems there is a fabric api bug

This commit is contained in:
TheBlackfurGuy 2022-01-04 18:21:40 +01:00
parent b996f00c60
commit 119cdd01b4
3 changed files with 78 additions and 27 deletions

View file

@ -4,9 +4,9 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="9d600e86-9aa6-49ee-bbc5-e23128c6a4d1" name="Changes" comment="toasting now fully implemented :DDD">
<list default="true" id="9d600e86-9aa6-49ee-bbc5-e23128c6a4d1" name="Changes" comment="Its pretty much finished?">
<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/block/ToasterBlock.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/blackfur/tastytoasters/block/ToasterBlock.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/gradle.properties" beforeDir="false" afterPath="$PROJECT_DIR$/gradle.properties" 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" />
</list>
<option name="SHOW_DIALOG" value="false" />
@ -47,7 +47,18 @@
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
<item name="tastytoasters" type="f1a62948:ProjectNode" />
<item name="Tasks" type="e4a08cd1:TasksNode" />
<item name="documentation" type="c8890929:TasksNode$1" />
<item name="fabric" type="c8890929:TasksNode$1" />
</path>
<path>
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
<item name="tastytoasters" type="f1a62948:ProjectNode" />
<item name="Tasks" type="e4a08cd1:TasksNode" />
<item name="ide" type="c8890929:TasksNode$1" />
</path>
<path>
<item name="" type="6a2764b6:ExternalProjectsStructure$RootNode" />
<item name="tastytoasters" type="f1a62948:ProjectNode" />
<item name="Run Configurations" type="7b0102dc:RunConfigurationsNode" />
</path>
</expand>
<select />
@ -78,18 +89,19 @@
<property name="ASKED_ADD_EXTERNAL_FILES" value="true" />
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="project.structure.last.edited" value="Libraries" />
<property name="project.structure.proportion" value="0.0" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="project.structure.last.edited" value="SDKs" />
<property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.2" />
<property name="settings.editor.selected.configurable" value="preferences.pluginManager" />
<property name="settings.editor.selected.configurable" value="reference.settings.ide.settings.notifications" />
</component>
<component name="RecentsManager">
<key name="MoveFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/Temp" />
</key>
</component>
<component name="RunManager" selected="Application.Minecraft Client">
<configuration name="tastytoasters [genSources]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<component name="RunManager" selected="Gradle.tastytoasters [migrateMappings] (2)">
<configuration name="tastytoasters [buildDependents]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
@ -100,7 +112,7 @@
</option>
<option name="taskNames">
<list>
<option value="genSources" />
<option value="buildDependents" />
</list>
</option>
<option name="vmOptions" />
@ -110,7 +122,7 @@
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
<configuration name="tastytoasters [jar]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<configuration name="tastytoasters [build]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
@ -121,7 +133,7 @@
</option>
<option name="taskNames">
<list>
<option value="jar" />
<option value="build" />
</list>
</option>
<option name="vmOptions" />
@ -131,18 +143,20 @@
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
<configuration name="tastytoasters [javadoc]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<configuration name="tastytoasters [migrateMappings] (1)" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="javadoc" />
<option value="migrateMappings" />
<option value="--mappings" />
<option value="&quot;1.18.1+build.17&quot;" />
</list>
</option>
<option name="vmOptions" />
@ -152,7 +166,7 @@
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
<configuration name="tastytoasters [migrateMappings]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<configuration name="tastytoasters [migrateMappings] (2)" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
@ -173,6 +187,29 @@
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
<configuration name="tastytoasters [migrateMappings]" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="migrateMappings" />
<option value="--mappings" />
<option value="&quot;1.18.1+build.17&quot;" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
<configuration name="tastytoasters [runClient]" type="GradleRunConfiguration" factoryName="Gradle" temporary="true">
<ExternalSystemSettings>
<option name="executionName" />
@ -196,11 +233,11 @@
</configuration>
<recent_temporary>
<list>
<item itemvalue="Gradle.tastytoasters [jar]" />
<item itemvalue="Gradle.tastytoasters [javadoc]" />
<item itemvalue="Gradle.tastytoasters [genSources]" />
<item itemvalue="Gradle.tastytoasters [migrateMappings] (2)" />
<item itemvalue="Gradle.tastytoasters [migrateMappings] (1)" />
<item itemvalue="Gradle.tastytoasters [buildDependents]" />
<item itemvalue="Gradle.tastytoasters [build]" />
<item itemvalue="Gradle.tastytoasters [runClient]" />
<item itemvalue="Gradle.tastytoasters [migrateMappings]" />
</list>
</recent_temporary>
</component>
@ -262,7 +299,14 @@
<option name="project" value="LOCAL" />
<updated>1638729298970</updated>
</task>
<option name="localTasksCounter" value="8" />
<task id="LOCAL-00008" summary="Its pretty much finished?">
<created>1638808282960</created>
<option name="number" value="00008" />
<option name="presentableId" value="LOCAL-00008" />
<option name="project" value="LOCAL" />
<updated>1638808282960</updated>
</task>
<option name="localTasksCounter" value="9" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -285,6 +329,7 @@
<MESSAGE value="I did a thing and nothing broke OMG" />
<MESSAGE value="commit so I don't loose progress" />
<MESSAGE value="toasting now fully implemented :DDD" />
<option name="LAST_COMMIT_MESSAGE" value="toasting now fully implemented :DDD" />
<MESSAGE value="Its pretty much finished?" />
<option name="LAST_COMMIT_MESSAGE" value="Its pretty much finished?" />
</component>
</project>

View file

@ -2,13 +2,13 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.18
yarn_mappings=1.18+build.1
loader_version=0.12.8
minecraft_version=1.18.1
yarn_mappings=1.18.1+build.17
loader_version=0.12.12
# Mod Properties
mod_version=1.0-SNAPSHOT
maven_group=blackfur
archives_base_name=tastytoasters
# Dependencies
# check this on https://modmuss50.me/fabric.html
fabric_version=0.44.0+1.18
fabric_version=0.45.1+1.18

View file

@ -3,14 +3,15 @@ package blackfur.tastytoasters.block;
import blackfur.tastytoasters.Tastytoasters;
import net.minecraft.block.BlockState;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.entity.Entity;
import net.minecraft.entity.ItemEntity;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.particle.ParticleTypes;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.fabricmc.fabric.api.block.entity.BlockEntityClientSerializable;
public class ToasterBlockEntity extends BlockEntity {
public class ToasterBlockEntity extends BlockEntity implements BlockEntityClientSerializable {
private int cookTicks;
public ToasterBlockEntity(BlockPos pos, BlockState state) {
@ -19,6 +20,9 @@ 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) {
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) {
@ -28,6 +32,8 @@ public class ToasterBlockEntity extends BlockEntity {
}
}
be.cookTicks--;
be.markDirty();
}
}