Skip to content

Commit

Permalink
Fix #6, #5, #4
Browse files Browse the repository at this point in the history
  • Loading branch information
Takakura-Anri committed Nov 4, 2020
1 parent c41d8dd commit 0ddefc9
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 123 deletions.
1 change: 1 addition & 0 deletions PERMISSIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
本 Mod 作者 Lasm Gratel ([email protected]) 已在网易上通过账号 Munich ([email protected]) 申请并发布付费 PC 组件版本.
11 changes: 0 additions & 11 deletions docs/Heating.md

This file was deleted.

64 changes: 0 additions & 64 deletions docs/PURPOSE.md

This file was deleted.

23 changes: 0 additions & 23 deletions docs/Planting.md

This file was deleted.

20 changes: 0 additions & 20 deletions docs/README.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import com.projecturanus.foodcraft.common.capability.fromMinecraftTemperature
import com.projecturanus.foodcraft.common.heat.HeatHandler
import com.projecturanus.foodcraft.common.init.FcTabMachine
import com.projecturanus.foodcraft.common.util.iterator
import com.projecturanus.foodcraft.logger
import net.minecraft.block.BlockHorizontal
import net.minecraft.block.ITileEntityProvider
import net.minecraft.block.material.MapColor
Expand Down Expand Up @@ -93,7 +92,6 @@ abstract class BlockMachine : BlockHorizontal(Material.IRON), ITileEntityProvide
if (thisHandler is HeatHandler) {
if (handler is HeatHandler) {
thisHandler.bind(handler)
logger.info("$movedPos is bound to $pos")
}
}
}
Expand Down Expand Up @@ -124,7 +122,6 @@ abstract class BlockMachine : BlockHorizontal(Material.IRON), ITileEntityProvide
heatHandler.bind(neighborHandler as HeatHandler)
else
heatHandler.bind(neighborHandler)
logger.info("$neighbor is bound to $pos")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ abstract class TileEntityRecipeMachine<T>(val recipeRegistry: IForgeRegistry<T>,
if (it in inputSlots || it in outputSlots) {
// When there is only one item left in machine, do not lookup recipes again
if (recipe == null) recipe = findRecipe()
if (recipe == null) {
reset()
working = false
progress = 0
markDirty()
}
}
}
inventory.validation = { slot, stack ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ class TileEntityStove : TileEntity(), ITickable {
if (!inventory[0].isEmpty && heatHandler.burnTime <= 0.0)
currentItemBurnTime = heatHandler.addFuel(inventory[0])
}

// Detect heat consumer on the top of this stove
// And auto bind them
val consumer = world.getTileEntity(pos.up())
if (consumer is TileEntityHeatRecipeMachine<*>) {
consumer.heatHandler.boundHandlers.clear()
consumer.heatHandler.bind(this.heatHandler)
}
}

@Suppress("UNCHECKED_CAST")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public static class MachineConfig {
public static class ClientConfig {
@Config.Name("Enable Hovering Info")
@Config.Comment({"Hovering info for machine GUI, displays detailed data about widgets", "Disable this if you encountered performance decrease or exceptions"})
public boolean enableHoverInfo = true;
public boolean enableHoverInfo = false;
}

@SideOnly(Side.CLIENT)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ItemCrop(val plantBlock: BlockCrops) : FCRItemFood(), IPlantable {
} else if (!playerIn.canPlayerEdit(pos.offset(side), side, stack)) {
EnumActionResult.FAIL
} else if (worldIn.getBlockState(pos).block.canSustainPlant(worldIn.getBlockState(pos), worldIn, pos, EnumFacing.UP, this) && worldIn.isAirBlock(pos.up())) {
worldIn.setBlockState(pos.up(), worldIn.getBlockState(pos).withProperty(BlockCrops.AGE, 0))
worldIn.setBlockState(pos.up(), plantBlock.defaultState.withProperty(BlockCrops.AGE, 0))
stack.shrink(1)
EnumActionResult.SUCCESS
} else {
Expand Down

0 comments on commit 0ddefc9

Please sign in to comment.