Skip to content

Commit

Permalink
Fixed collision bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Takakura-Anri committed Mar 23, 2020
1 parent ff3ba70 commit c41d8dd
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 26 deletions.
11 changes: 11 additions & 0 deletions docs/Heating.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# 热量系统

_加热加热加热加热加热加热加热加热加热加热加热加热加热加热加热_

热量系统是除了菜板以外所有食物工艺机器能正常运转的关键部分. 机器需要达到一定温度才能工作.

所有的温度标准都能在配置文件中查看并更改.

一般来说, 你需要在机器的热量槽旁边放入燃料, 机器便可开始加热并正常工作.

平底锅与锅需要放置在灶炉上方, 通过灶炉进行加热.
23 changes: 23 additions & 0 deletions docs/Planting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 播种与收获

食材的种植方法分为三种: 耕作, 树叶收获与芦苇式作物.

## 耕作

所有的耕作作物有: 玉米, 黄瓜, 茄子, 朝天椒, 青椒, 花生, 大米, 糯米, 红薯, 番茄, 白萝卜, 白菜, 草莓.

耕作作物可以直接在耕地上右键耕种, 以小麦的方式收获, 或者右键收获.

所有耕作作物均可以通过清理草地的方式获得.

## 树叶收获

除草莓外的所有水果有: 柚子, 樱桃, 椰子, 橡胶, 桃, 柿子, 石榴, 山楂, 枇杷, 柠檬, 木瓜, 龙眼, 芒果, 荔枝, 梨, 橘子, 红枣.

所有水果均可以在世界中探索水果树来获得, 水果树是一种叶子均为水果的从林木(该设定可能更改).

## 芦苇式作物

芦苇式作物有: 葱.

最典型的芦苇式作物: 甘蔗. 不需要做过多解释.
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,12 @@ import net.minecraft.world.IBlockAccess
import net.minecraft.world.World

class BlockChoppingBoard : BlockMachine() {
val collisionBox = AxisAlignedBB(0.0, 0.0, 2.5, 16.0, 0.8, 13.5)
val collisionBox = AxisAlignedBB(0.0, 0.0, 2.5 / 16, 1.0, 0.8 / 16, 13.5 / 16)

override fun getCollisionBoundingBox(blockState: IBlockState, worldIn: IBlockAccess, pos: BlockPos): AxisAlignedBB? {
override fun getSelectedBoundingBox(blockState: IBlockState, worldIn: World, pos: BlockPos): AxisAlignedBB? {
return collisionBox
}

override fun addCollisionBoxToList(state: IBlockState, worldIn: World, pos: BlockPos, entityBox: AxisAlignedBB, collidingBoxes: MutableList<AxisAlignedBB>, entityIn: Entity?, isActualState: Boolean) {
collidingBoxes += collisionBox
}

override fun createNewTileEntity(worldIn: World, meta: Int): TileEntity = TileEntityChoppingBoard()

override fun onBlockActivated(worldIn: World, pos: BlockPos, state: IBlockState, playerIn: EntityPlayer, hand: EnumHand, facing: EnumFacing, hitX: Float, hitY: Float, hitZ: Float): Boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,21 @@ import com.projecturanus.foodcraft.FoodCraftReloaded
import com.projecturanus.foodcraft.common.PAN
import com.projecturanus.foodcraft.common.block.entity.TileEntityPan
import net.minecraft.block.state.IBlockState
import net.minecraft.entity.Entity
import net.minecraft.entity.player.EntityPlayer
import net.minecraft.tileentity.TileEntity
import net.minecraft.util.EnumFacing
import net.minecraft.util.EnumHand
import net.minecraft.util.math.AxisAlignedBB
import net.minecraft.util.math.BlockPos
import net.minecraft.world.IBlockAccess
import net.minecraft.world.World

class BlockPan : BlockMachine() {
val collisionBox = AxisAlignedBB(3.0, 1.0, 2.5, 13.0, 0.8, 13.5)
val collisionBox = AxisAlignedBB(3.0 / 16, 1.0 / 16, 2.5 / 16, 13.0 / 16, 0.8 / 16, 13.5 / 16)

override fun getCollisionBoundingBox(blockState: IBlockState, worldIn: IBlockAccess, pos: BlockPos): AxisAlignedBB? {
override fun getSelectedBoundingBox(blockState: IBlockState, worldIn: World, pos: BlockPos): AxisAlignedBB? {
return collisionBox
}

override fun addCollisionBoxToList(state: IBlockState, worldIn: World, pos: BlockPos, entityBox: AxisAlignedBB, collidingBoxes: MutableList<AxisAlignedBB>, entityIn: Entity?, isActualState: Boolean) {
collidingBoxes += collisionBox
}

override fun createNewTileEntity(worldIn: World, meta: Int): TileEntity = TileEntityPan()

override fun setDefaultTemperature(worldIn: World, pos: BlockPos, temperature: Double) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,12 @@ import net.minecraft.world.IBlockAccess
import net.minecraft.world.World

class BlockPot : BlockMachine() {
val collisionBox = AxisAlignedBB(0.0, 0.0, 2.5, 16.0, 0.8, 13.5)
val collisionBox = AxisAlignedBB(0.0, 0.0, 2.5 / 16, 16.0 / 16, 0.8 / 16, 13.5 / 16)

override fun getCollisionBoundingBox(blockState: IBlockState, worldIn: IBlockAccess, pos: BlockPos): AxisAlignedBB? {
override fun getSelectedBoundingBox(blockState: IBlockState, worldIn: World, pos: BlockPos): AxisAlignedBB? {
return collisionBox
}

override fun addCollisionBoxToList(state: IBlockState, worldIn: World, pos: BlockPos, entityBox: AxisAlignedBB, collidingBoxes: MutableList<AxisAlignedBB>, entityIn: Entity?, isActualState: Boolean) {
collidingBoxes += collisionBox
}

override fun createNewTileEntity(worldIn: World, meta: Int): TileEntity = TileEntityPot()

override fun setDefaultTemperature(worldIn: World, pos: BlockPos, temperature: Double) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,12 @@ import net.minecraft.world.IBlockAccess
import net.minecraft.world.World

class BlockPressureCooker : BlockMachine() {
val collisionBox = AxisAlignedBB(0.0, 0.0, 2.5, 16.0, 0.8, 13.5)
val collisionBox = AxisAlignedBB(0.0, 0.0, 2.5 / 16, 16.0 / 16, 0.8 / 16, 13.5 / 16)

override fun getCollisionBoundingBox(blockState: IBlockState, worldIn: IBlockAccess, pos: BlockPos): AxisAlignedBB? {
override fun getSelectedBoundingBox(blockState: IBlockState, worldIn: World, pos: BlockPos): AxisAlignedBB? {
return collisionBox
}

override fun addCollisionBoxToList(state: IBlockState, worldIn: World, pos: BlockPos, entityBox: AxisAlignedBB, collidingBoxes: MutableList<AxisAlignedBB>, entityIn: Entity?, isActualState: Boolean) {
collidingBoxes += collisionBox
}

override fun createNewTileEntity(worldIn: World, meta: Int): TileEntity = TileEntityPressureCooker()

override fun setDefaultTemperature(worldIn: World, pos: BlockPos, temperature: Double) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "Pressure Cooker",
"icon": "foodcraftreloaded:pressure_cooker",
"category": "machines",
"pages": [
{
"type": "text",
"text": "Pressure Cooker can be used to make meals."
},
{
"type": "crafting",
"recipe": "foodcraftreloaded:pressure_cooker"
}
]
}

0 comments on commit c41d8dd

Please sign in to comment.