diff --git a/src/main/kotlin/net/shadowfacts/phycon/init/PhyBlockEntities.kt b/src/main/kotlin/net/shadowfacts/phycon/init/PhyBlockEntities.kt index cb898bd..4791bbe 100644 --- a/src/main/kotlin/net/shadowfacts/phycon/init/PhyBlockEntities.kt +++ b/src/main/kotlin/net/shadowfacts/phycon/init/PhyBlockEntities.kt @@ -5,8 +5,8 @@ import net.minecraft.block.entity.BlockEntity import net.minecraft.block.entity.BlockEntityType import net.minecraft.util.Identifier import net.minecraft.util.registry.Registry -import net.shadowfacts.phycon.network.block.networkinterface.NetworkInterfaceBlock -import net.shadowfacts.phycon.network.block.networkinterface.NetworkInterfaceBlockEntity +import net.shadowfacts.phycon.network.block.netinterface.InterfaceBlock +import net.shadowfacts.phycon.network.block.netinterface.InterfaceBlockEntity import net.shadowfacts.phycon.network.block.terminal.TerminalBlock import net.shadowfacts.phycon.network.block.terminal.TerminalBlockEntity @@ -15,7 +15,7 @@ import net.shadowfacts.phycon.network.block.terminal.TerminalBlockEntity */ object PhyBlockEntities { - val NETWORK_INTERFACE = create(::NetworkInterfaceBlockEntity, PhyBlocks.NETWORK_INTERFACE) + val INTERFACE = create(::InterfaceBlockEntity, PhyBlocks.INTERFACE) val TERMINAL = create(::TerminalBlockEntity, PhyBlocks.TERMINAL) private fun create(builder: () -> T, block: Block): BlockEntityType { @@ -23,7 +23,7 @@ object PhyBlockEntities { } fun init() { - register(NetworkInterfaceBlock.ID, NETWORK_INTERFACE) + register(InterfaceBlock.ID, INTERFACE) register(TerminalBlock.ID, TERMINAL) } diff --git a/src/main/kotlin/net/shadowfacts/phycon/init/PhyBlocks.kt b/src/main/kotlin/net/shadowfacts/phycon/init/PhyBlocks.kt index 9def846..afd7d41 100644 --- a/src/main/kotlin/net/shadowfacts/phycon/init/PhyBlocks.kt +++ b/src/main/kotlin/net/shadowfacts/phycon/init/PhyBlocks.kt @@ -3,7 +3,7 @@ package net.shadowfacts.phycon.init import net.minecraft.block.Block import net.minecraft.util.Identifier import net.minecraft.util.registry.Registry -import net.shadowfacts.phycon.network.block.networkinterface.NetworkInterfaceBlock +import net.shadowfacts.phycon.network.block.netinterface.InterfaceBlock import net.shadowfacts.phycon.network.block.terminal.TerminalBlock /** @@ -11,11 +11,11 @@ import net.shadowfacts.phycon.network.block.terminal.TerminalBlock */ object PhyBlocks { - val NETWORK_INTERFACE = NetworkInterfaceBlock() + val INTERFACE = InterfaceBlock() val TERMINAL = TerminalBlock() fun init() { - register(NetworkInterfaceBlock.ID, NETWORK_INTERFACE) + register(InterfaceBlock.ID, INTERFACE) register(TerminalBlock.ID, TERMINAL) } @@ -23,4 +23,4 @@ object PhyBlocks { Registry.register(Registry.BLOCK, id, block) } -} \ No newline at end of file +} diff --git a/src/main/kotlin/net/shadowfacts/phycon/init/PhyItems.kt b/src/main/kotlin/net/shadowfacts/phycon/init/PhyItems.kt index e9172eb..7b03128 100644 --- a/src/main/kotlin/net/shadowfacts/phycon/init/PhyItems.kt +++ b/src/main/kotlin/net/shadowfacts/phycon/init/PhyItems.kt @@ -4,7 +4,7 @@ import net.minecraft.item.BlockItem import net.minecraft.item.Item import net.minecraft.util.Identifier import net.minecraft.util.registry.Registry -import net.shadowfacts.phycon.network.block.networkinterface.NetworkInterfaceBlock +import net.shadowfacts.phycon.network.block.netinterface.InterfaceBlock import net.shadowfacts.phycon.network.block.terminal.TerminalBlock /** @@ -12,11 +12,11 @@ import net.shadowfacts.phycon.network.block.terminal.TerminalBlock */ object PhyItems { - val NETWORK_INTERFACE = BlockItem(PhyBlocks.NETWORK_INTERFACE, Item.Settings()) + val INTERFACE = BlockItem(PhyBlocks.INTERFACE, Item.Settings()) val TERMINAL = BlockItem(PhyBlocks.TERMINAL, Item.Settings()) fun init() { - register(NetworkInterfaceBlock.ID, NETWORK_INTERFACE) + register(InterfaceBlock.ID, INTERFACE) register(TerminalBlock.ID, TERMINAL) } diff --git a/src/main/kotlin/net/shadowfacts/phycon/network/block/networkinterface/NetworkInterfaceBlock.kt b/src/main/kotlin/net/shadowfacts/phycon/network/block/netinterface/InterfaceBlock.kt similarity index 81% rename from src/main/kotlin/net/shadowfacts/phycon/network/block/networkinterface/NetworkInterfaceBlock.kt rename to src/main/kotlin/net/shadowfacts/phycon/network/block/netinterface/InterfaceBlock.kt index f14926e..c2e1e33 100644 --- a/src/main/kotlin/net/shadowfacts/phycon/network/block/networkinterface/NetworkInterfaceBlock.kt +++ b/src/main/kotlin/net/shadowfacts/phycon/network/block/netinterface/InterfaceBlock.kt @@ -1,4 +1,4 @@ -package net.shadowfacts.phycon.network.block.networkinterface +package net.shadowfacts.phycon.network.block.netinterface import alexiil.mc.lib.attributes.AttributeList import alexiil.mc.lib.attributes.AttributeProvider @@ -6,14 +6,11 @@ import net.minecraft.block.Block import net.minecraft.block.BlockState import net.minecraft.block.Material import net.minecraft.entity.LivingEntity -import net.minecraft.entity.player.PlayerEntity import net.minecraft.item.ItemPlacementContext import net.minecraft.item.ItemStack import net.minecraft.state.StateFactory import net.minecraft.state.property.Properties -import net.minecraft.util.Hand import net.minecraft.util.Identifier -import net.minecraft.util.hit.BlockHitResult import net.minecraft.util.math.BlockPos import net.minecraft.world.BlockView import net.minecraft.world.World @@ -23,7 +20,7 @@ import net.shadowfacts.phycon.block.BlockWithEntity /** * @author shadowfacts */ -class NetworkInterfaceBlock: BlockWithEntity(Settings.of(Material.METAL)), AttributeProvider { +class InterfaceBlock: BlockWithEntity(Settings.of(Material.METAL)), AttributeProvider { companion object { val ID = Identifier(PhysicalConnectivity.MODID, "network_interface") val FACING = Properties.FACING @@ -34,7 +31,7 @@ class NetworkInterfaceBlock: BlockWithEntity(Settin builder.add(FACING) } - override fun createBlockEntity(world: BlockView) = NetworkInterfaceBlockEntity() + override fun createBlockEntity(world: BlockView) = InterfaceBlockEntity() override fun getPlacementState(context: ItemPlacementContext): BlockState { val facing = if (context.player?.isSneaking == true) context.playerFacing else context.playerFacing.opposite diff --git a/src/main/kotlin/net/shadowfacts/phycon/network/block/networkinterface/NetworkInterfaceBlockEntity.kt b/src/main/kotlin/net/shadowfacts/phycon/network/block/netinterface/InterfaceBlockEntity.kt similarity index 86% rename from src/main/kotlin/net/shadowfacts/phycon/network/block/networkinterface/NetworkInterfaceBlockEntity.kt rename to src/main/kotlin/net/shadowfacts/phycon/network/block/netinterface/InterfaceBlockEntity.kt index 8ed1f81..3263831 100644 --- a/src/main/kotlin/net/shadowfacts/phycon/network/block/networkinterface/NetworkInterfaceBlockEntity.kt +++ b/src/main/kotlin/net/shadowfacts/phycon/network/block/netinterface/InterfaceBlockEntity.kt @@ -1,4 +1,4 @@ -package net.shadowfacts.phycon.network.block.networkinterface +package net.shadowfacts.phycon.network.block.netinterface import alexiil.mc.lib.attributes.SearchOptions import alexiil.mc.lib.attributes.item.GroupedItemInv @@ -14,10 +14,10 @@ import net.shadowfacts.phycon.network.packet.RequestReadAllPacket /** * @author shadowfacts */ -class NetworkInterfaceBlockEntity: DeviceBlockEntity(PhyBlockEntities.NETWORK_INTERFACE) { +class InterfaceBlockEntity: DeviceBlockEntity(PhyBlockEntities.INTERFACE) { private val facing: Direction - get() = world!!.getBlockState(pos)[NetworkInterfaceBlock.FACING] + get() = world!!.getBlockState(pos)[InterfaceBlock.FACING] // todo: should this be a weak ref? private var inventory: GroupedItemInv? = null