1
0
mirror of https://github.com/chylex/Hardcore-Ender-Expansion-2.git synced 2025-04-11 03:15:44 +02:00

Add Void Portal blocks

This commit is contained in:
chylex 2019-04-14 09:44:29 +02:00
parent 5de2fc8d4e
commit 62f1e8bfa4
13 changed files with 117 additions and 0 deletions

View File

@ -0,0 +1,22 @@
package chylex.hee.game.block
import chylex.hee.game.block.entity.TileEntityPortalInner
import chylex.hee.game.block.entity.TileEntityVoidPortalStorage
import chylex.hee.system.util.closestTickingTile
import net.minecraft.entity.Entity
import net.minecraft.entity.EntityLivingBase
import net.minecraft.tileentity.TileEntity
import net.minecraft.util.math.BlockPos
import net.minecraft.world.World
class BlockVoidPortalInner(builder: BlockSimple.Builder) : BlockAbstractPortal(builder){
override fun createNewTileEntity(world: World, meta: Int): TileEntity{
return TileEntityPortalInner.Void()
}
override fun onEntityInside(world: World, pos: BlockPos, entity: Entity){
val acceptor = pos.closestTickingTile<TileEntityVoidPortalStorage>(world, MAX_DISTANCE_FROM_FRAME)
if (acceptor != null && entity.isNonBoss){
}
}
}

View File

@ -0,0 +1,26 @@
package chylex.hee.game.block
import chylex.hee.game.block.entity.TileEntityVoidPortalStorage
import chylex.hee.init.ModBlocks
import net.minecraft.block.ITileEntityProvider
import net.minecraft.block.state.IBlockState
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.World
class BlockVoidPortalStorage(builder: BlockSimple.Builder, aabb: AxisAlignedBB) : BlockSimpleShaped(builder, aabb), ITileEntityProvider{
override fun createNewTileEntity(world: World, meta: Int): TileEntity{
return TileEntityVoidPortalStorage()
}
override fun onBlockAdded(world: World, pos: BlockPos, state: IBlockState){
BlockAbstractPortal.spawnInnerBlocks(world, pos, ModBlocks.VOID_PORTAL_FRAME, ModBlocks.VOID_PORTAL_INNER)
}
override fun onBlockActivated(world: World, pos: BlockPos, state: IBlockState, player: EntityPlayer, hand: EnumHand, facing: EnumFacing, hitX: Float, hitY: Float, hitZ: Float): Boolean{
return true
}
}

View File

@ -13,4 +13,5 @@ sealed class TileEntityPortalInner : TileEntityEndPortal(){
override fun getRenderBoundingBox(): AxisAlignedBB = AxisAlignedBB(pos, pos.add(1, 1, 1))
class End : TileEntityPortalInner()
class Void : TileEntityPortalInner()
}

View File

@ -0,0 +1,8 @@
package chylex.hee.game.block.entity
import chylex.hee.game.block.entity.TileEntityBasePortalController.ForegroundRenderState.Invisible
class TileEntityVoidPortalStorage : TileEntityBasePortalController(){
override val serverRenderState = Invisible
override val clientAnimationFadeInSpeed = 0F
override val clientAnimationFadeOutSpeed = 0F
}

View File

@ -35,6 +35,8 @@ import chylex.hee.game.block.BlockStardustOre
import chylex.hee.game.block.BlockTableBase
import chylex.hee.game.block.BlockTablePedestal
import chylex.hee.game.block.BlockTableTile
import chylex.hee.game.block.BlockVoidPortalInner
import chylex.hee.game.block.BlockVoidPortalStorage
import chylex.hee.game.block.BlockWallCustom
import chylex.hee.game.block.entity.TileEntityAccumulationTable
import chylex.hee.game.block.entity.TileEntityDarkChest
@ -44,6 +46,7 @@ import chylex.hee.game.block.entity.TileEntityInfusedTNT
import chylex.hee.game.block.entity.TileEntityLootChest
import chylex.hee.game.block.entity.TileEntityPortalInner
import chylex.hee.game.block.entity.TileEntityTablePedestal
import chylex.hee.game.block.entity.TileEntityVoidPortalStorage
import chylex.hee.game.block.fluid.FluidEnderGoo
import chylex.hee.game.block.material.Materials
import chylex.hee.game.item.ItemAncientCobweb
@ -327,6 +330,10 @@ object ModBlocks{
@JvmField val END_PORTAL_FRAME = BlockSimpleShaped(buildPortalFrame, portalFrameAABB).apply { setup("end_portal_frame") }
@JvmField val END_PORTAL_ACCEPTOR = BlockEndPortalAcceptor(buildPortalFrame, portalFrameAABB).apply { setup("end_portal_acceptor") }
@JvmField val VOID_PORTAL_INNER = BlockVoidPortalInner(buildPortalInner).apply { setup("void_portal_inner", inCreativeTab = false) }
@JvmField val VOID_PORTAL_FRAME = BlockSimpleShaped(buildPortalFrame, portalFrameAABB).apply { setup("void_portal_frame") }
@JvmField val VOID_PORTAL_STORAGE = BlockVoidPortalStorage(buildPortalFrame, portalFrameAABB).apply { setup("void_portal_storage") }
// Blocks: Energy
private val buildEnergyCluster = BlockSimple.Builder(Materials.ENERGY_CLUSTER).apply {
@ -453,6 +460,9 @@ object ModBlocks{
register(END_PORTAL_INNER with basicItemBlock)
register(END_PORTAL_FRAME with basicItemBlock)
register(END_PORTAL_ACCEPTOR with basicItemBlock)
register(VOID_PORTAL_INNER with basicItemBlock)
register(VOID_PORTAL_FRAME with basicItemBlock)
register(VOID_PORTAL_STORAGE with basicItemBlock)
register(ENERGY_CLUSTER with basicItemBlock)
register(CORRUPTED_ENERGY)
@ -465,7 +475,9 @@ object ModBlocks{
}
tile<TileEntityPortalInner.End>("end_portal_inner")
tile<TileEntityPortalInner.Void>("void_portal_inner")
tile<TileEntityEndPortalAcceptor>("end_portal_acceptor")
tile<TileEntityVoidPortalStorage>("void_portal_storage")
tile<TileEntityEnergyCluster>("energy_cluster")
tile<TileEntityInfusedTNT>("infused_tnt")
tile<TileEntityDarkChest>("dark_chest")

View File

@ -134,6 +134,7 @@ class ModClientProxy : ModCommonProxy(){
ModelLoader.setCustomStateMapper(ModBlocks.END_PORTAL_INNER, emptyStateMapper)
ModelLoader.setCustomStateMapper(ModBlocks.ENDERMAN_HEAD, emptyStateMapper)
ModelLoader.setCustomStateMapper(ModBlocks.ENERGY_CLUSTER, emptyStateMapper)
ModelLoader.setCustomStateMapper(ModBlocks.VOID_PORTAL_INNER, emptyStateMapper)
ModelLoader.setCustomStateMapper(ModBlocks.CORRUPTED_ENERGY, singleStateMapper)
ModelLoader.setCustomStateMapper(ModBlocks.DARK_CHEST, singleStateMapper)

View File

@ -0,0 +1,16 @@
{
"forge_marker": 1,
"defaults": {
"model": "hee:portal_frame",
"textures": {
"particle": "hee:block/void_portal_frame_side",
"bottom": "minecraft:blocks/end_stone",
"top": "hee:block/void_portal_frame_top_plain",
"side": "hee:block/void_portal_frame_side"
}
},
"variants": {
"normal": [{}],
"inventory": [{}]
}
}

View File

@ -0,0 +1,12 @@
{
"forge_marker": 1,
"variants": {
"inventory": {
"model": "builtin/generated",
"transform": "forge:default-item",
"textures": {
"layer0": "blocks/portal"
}
}
}
}

View File

@ -0,0 +1,16 @@
{
"forge_marker": 1,
"defaults": {
"model": "hee:portal_frame",
"textures": {
"particle": "hee:block/void_portal_frame_side",
"bottom": "minecraft:blocks/end_stone",
"top": "hee:block/void_portal_frame_top_storage",
"side": "hee:block/void_portal_frame_side"
}
},
"variants": {
"normal": [{}],
"inventory": [{}]
}
}

View File

@ -58,6 +58,9 @@ tile.hee.dry_vines.name=Dry Vines
tile.hee.end_portal_inner.name=End Portal
tile.hee.end_portal_frame.name=End Portal Frame
tile.hee.end_portal_acceptor.name=End Portal Acceptor
tile.hee.void_portal_inner.name=Void Portal
tile.hee.void_portal_frame.name=Void Portal Frame
tile.hee.void_portal_storage.name=Void Portal Storage
tile.hee.energy_cluster.name=Energy Cluster

Binary file not shown.

After

(image error) Size: 381 B

Binary file not shown.

After

(image error) Size: 332 B

Binary file not shown.

After

(image error) Size: 416 B