diff --git a/common/src/main/kotlin/quaedam/Quaedam.kt b/common/src/main/kotlin/quaedam/Quaedam.kt index 6cc98c5..3152338 100644 --- a/common/src/main/kotlin/quaedam/Quaedam.kt +++ b/common/src/main/kotlin/quaedam/Quaedam.kt @@ -10,7 +10,7 @@ import net.minecraft.world.item.CreativeModeTab import net.minecraft.world.item.ItemStack import org.slf4j.LoggerFactory import quaedam.config.QuaedamConfig -import quaedam.misc.cts.ConstantTemporalSink +import quaedam.misc.causality.CausalityAnchor import quaedam.projection.ProjectionCommand import quaedam.projection.ProjectionEffectType import quaedam.projection.SimpleProjectionUpdate @@ -55,7 +55,7 @@ object Quaedam { ProjectionCommand SimpleProjectionUpdate ProjectionShell - ConstantTemporalSink + CausalityAnchor creativeModeTabs.register() items.register() diff --git a/common/src/main/kotlin/quaedam/misc/cts/CTSBlock.kt b/common/src/main/kotlin/quaedam/misc/causality/CABlock.kt similarity index 96% rename from common/src/main/kotlin/quaedam/misc/cts/CTSBlock.kt rename to common/src/main/kotlin/quaedam/misc/causality/CABlock.kt index c11156b..829a735 100644 --- a/common/src/main/kotlin/quaedam/misc/cts/CTSBlock.kt +++ b/common/src/main/kotlin/quaedam/misc/causality/CABlock.kt @@ -1,4 +1,4 @@ -package quaedam.misc.cts +package quaedam.misc.causality import net.minecraft.core.BlockPos import net.minecraft.core.Direction @@ -15,7 +15,7 @@ import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.Shapes import net.minecraft.world.phys.shapes.VoxelShape -object CTSBlock : HorizontalDirectionalBlock( +object CABlock : HorizontalDirectionalBlock( Properties.of() .lightLevel { 2 } .noOcclusion() @@ -31,7 +31,7 @@ object CTSBlock : HorizontalDirectionalBlock( ) } - override fun newBlockEntity(pos: BlockPos, state: BlockState) = CTSBlockEntity(pos, state) + override fun newBlockEntity(pos: BlockPos, state: BlockState) = CABlockEntity(pos, state) override fun createBlockStateDefinition(builder: StateDefinition.Builder) { super.createBlockStateDefinition(builder) diff --git a/common/src/main/kotlin/quaedam/misc/cts/CTSBlockEntity.kt b/common/src/main/kotlin/quaedam/misc/causality/CABlockEntity.kt similarity index 75% rename from common/src/main/kotlin/quaedam/misc/cts/CTSBlockEntity.kt rename to common/src/main/kotlin/quaedam/misc/causality/CABlockEntity.kt index 1d509f3..3aa7361 100644 --- a/common/src/main/kotlin/quaedam/misc/cts/CTSBlockEntity.kt +++ b/common/src/main/kotlin/quaedam/misc/causality/CABlockEntity.kt @@ -1,4 +1,4 @@ -package quaedam.misc.cts +package quaedam.misc.causality import net.minecraft.core.BlockPos import net.minecraft.nbt.CompoundTag @@ -7,10 +7,9 @@ import net.minecraft.network.protocol.game.ClientGamePacketListener import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket import net.minecraft.world.level.block.entity.BlockEntity import net.minecraft.world.level.block.state.BlockState -import quaedam.projector.Projector -class CTSBlockEntity(pos: BlockPos, state: BlockState) : - BlockEntity(ConstantTemporalSink.blockEntity.get(), pos, state) { +class CABlockEntity(pos: BlockPos, state: BlockState) : + BlockEntity(CausalityAnchor.blockEntity.get(), pos, state) { override fun getUpdateTag(): CompoundTag = saveWithoutMetadata() diff --git a/common/src/main/kotlin/quaedam/misc/cts/ConstantTemporalSink.kt b/common/src/main/kotlin/quaedam/misc/causality/CausalityAnchor.kt similarity index 64% rename from common/src/main/kotlin/quaedam/misc/cts/ConstantTemporalSink.kt rename to common/src/main/kotlin/quaedam/misc/causality/CausalityAnchor.kt index fe9dac1..86e7a05 100644 --- a/common/src/main/kotlin/quaedam/misc/cts/ConstantTemporalSink.kt +++ b/common/src/main/kotlin/quaedam/misc/causality/CausalityAnchor.kt @@ -1,4 +1,4 @@ -package quaedam.misc.cts +package quaedam.misc.causality import net.minecraft.core.BlockPos import net.minecraft.world.item.BlockItem @@ -7,26 +7,26 @@ import net.minecraft.world.level.Level import net.minecraft.world.level.block.entity.BlockEntityType import quaedam.Quaedam -object ConstantTemporalSink { +object CausalityAnchor { - const val ID = "cts" + const val ID = "causality_anchor" - val block = Quaedam.blocks.register(ID) { CTSBlock }!! + val block = Quaedam.blocks.register(ID) { CABlock }!! val item = Quaedam.items.register(ID) { BlockItem( - CTSBlock, Item.Properties() + CABlock, Item.Properties() .stacksTo(1) .`arch$tab`(Quaedam.creativeModeTab) ) }!! val blockEntity = Quaedam.blockEntities.register(ID) { - BlockEntityType.Builder.of(::CTSBlockEntity, block.get()).build(null) + BlockEntityType.Builder.of(::CABlockEntity, block.get()).build(null) }!! fun checkEffect(level: Level, pos: BlockPos) = level.getChunkAt(pos) .blockEntities - .any { (_, v) -> v is CTSBlockEntity } + .any { (_, v) -> v is CABlockEntity } } \ No newline at end of file diff --git a/common/src/main/kotlin/quaedam/projection/swarm/ProjectedPersonEntity.kt b/common/src/main/kotlin/quaedam/projection/swarm/ProjectedPersonEntity.kt index 4d7d307..f42e8d3 100644 --- a/common/src/main/kotlin/quaedam/projection/swarm/ProjectedPersonEntity.kt +++ b/common/src/main/kotlin/quaedam/projection/swarm/ProjectedPersonEntity.kt @@ -26,7 +26,7 @@ import net.minecraft.world.entity.npc.InventoryCarrier import net.minecraft.world.level.Level import net.minecraft.world.level.ServerLevelAccessor import quaedam.Quaedam -import quaedam.misc.cts.ConstantTemporalSink +import quaedam.misc.causality.CausalityAnchor import quaedam.projection.misc.SoundProjection import quaedam.projection.swarm.ai.ProjectedPersonAI import quaedam.projection.swarm.ai.ProjectedPersonNavigation @@ -178,7 +178,7 @@ class ProjectedPersonEntity(entityType: EntityType, level: Le override fun checkDespawn() { super.checkDespawn() - if (!checkProjectionEffect() && !ConstantTemporalSink.checkEffect(level(), blockPosition())) { + if (!checkProjectionEffect() && !CausalityAnchor.checkEffect(level(), blockPosition())) { dropEquipment() remove(RemovalReason.KILLED) } diff --git a/common/src/main/kotlin/quaedam/projection/swarm/ai/ProjectedPersonNavigation.kt b/common/src/main/kotlin/quaedam/projection/swarm/ai/ProjectedPersonNavigation.kt index 65613d2..e8ecc27 100644 --- a/common/src/main/kotlin/quaedam/projection/swarm/ai/ProjectedPersonNavigation.kt +++ b/common/src/main/kotlin/quaedam/projection/swarm/ai/ProjectedPersonNavigation.kt @@ -4,7 +4,7 @@ import net.minecraft.core.BlockPos import net.minecraft.world.entity.ai.navigation.GroundPathNavigation import net.minecraft.world.level.Level import net.minecraft.world.level.pathfinder.Path -import quaedam.misc.cts.ConstantTemporalSink +import quaedam.misc.causality.CausalityAnchor import quaedam.projection.swarm.ProjectedPersonEntity import quaedam.projection.swarm.SwarmProjection import quaedam.projector.Projector @@ -14,7 +14,7 @@ class ProjectedPersonNavigation(val entity: ProjectedPersonEntity, level: Level) override fun createPath(set: MutableSet, i: Int, bl: Boolean, j: Int, f: Float): Path? { if (set.any { Projector.findNearbyProjections(level, it, SwarmProjection.effect.get()) - .isEmpty() && !ConstantTemporalSink.checkEffect(level, it) + .isEmpty() && !CausalityAnchor.checkEffect(level, it) }) { return null } diff --git a/common/src/main/resources/assets/quaedam/blockstates/causality_anchor.json b/common/src/main/resources/assets/quaedam/blockstates/causality_anchor.json new file mode 100644 index 0000000..d8319e2 --- /dev/null +++ b/common/src/main/resources/assets/quaedam/blockstates/causality_anchor.json @@ -0,0 +1,20 @@ +{ + "variants": { + "facing=east": { + "model": "quaedam:block/causality_anchor", + "y": 270 + }, + "facing=south": { + "model": "quaedam:block/causality_anchor", + "y": 0 + }, + "facing=west": { + "model": "quaedam:block/causality_anchor", + "y": 90 + }, + "facing=north": { + "model": "quaedam:block/causality_anchor", + "y": 180 + } + } +} diff --git a/common/src/main/resources/assets/quaedam/blockstates/cts.json b/common/src/main/resources/assets/quaedam/blockstates/cts.json deleted file mode 100644 index 7299687..0000000 --- a/common/src/main/resources/assets/quaedam/blockstates/cts.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "variants": { - "facing=east": { - "model": "quaedam:block/cts", - "y": 270 - }, - "facing=south": { - "model": "quaedam:block/cts", - "y": 0 - }, - "facing=west": { - "model": "quaedam:block/cts", - "y": 90 - }, - "facing=north": { - "model": "quaedam:block/cts", - "y": 180 - } - } -} diff --git a/common/src/main/resources/assets/quaedam/lang/en_us.json b/common/src/main/resources/assets/quaedam/lang/en_us.json index 087cb41..49568fb 100644 --- a/common/src/main/resources/assets/quaedam/lang/en_us.json +++ b/common/src/main/resources/assets/quaedam/lang/en_us.json @@ -5,6 +5,7 @@ "block.quaedam.swarm_projection": "Swarm Projection", "block.quaedam.sound_projection": "Sound Projection", "block.quaedam.noise_projection": "Noise Projection", + "block.quaedam.causality_anchor": "Causality Anchor", "entity.quaedam.projected_person": "Virtual Person", "item.quaedam.projection_shell": "Projection Shell", "quaedam.screen.projection_shell": "Projection Shell", diff --git a/common/src/main/resources/assets/quaedam/lang/zh_cn.json b/common/src/main/resources/assets/quaedam/lang/zh_cn.json index c491595..d2adefe 100644 --- a/common/src/main/resources/assets/quaedam/lang/zh_cn.json +++ b/common/src/main/resources/assets/quaedam/lang/zh_cn.json @@ -5,6 +5,7 @@ "block.quaedam.swarm_projection": "人群投影", "block.quaedam.sound_projection": "声音投影", "block.quaedam.noise_projection": "噪音投影", + "block.quaedam.causality_anchor": "因果锚", "entity.quaedam.projected_person": "虚拟个体", "item.quaedam.projection_shell": "投影操作面板", "quaedam.screen.projection_shell": "投影操作", diff --git a/common/src/main/resources/assets/quaedam/models/block/cts.json b/common/src/main/resources/assets/quaedam/models/block/causality_anchor.json similarity index 98% rename from common/src/main/resources/assets/quaedam/models/block/cts.json rename to common/src/main/resources/assets/quaedam/models/block/causality_anchor.json index fe5d004..7d177e5 100644 --- a/common/src/main/resources/assets/quaedam/models/block/cts.json +++ b/common/src/main/resources/assets/quaedam/models/block/causality_anchor.json @@ -5,8 +5,8 @@ 64 ], "textures": { - "0": "quaedam:block/cts", - "particle": "quaedam:block/cts" + "0": "quaedam:block/causality_anchor", + "particle": "quaedam:block/causality_anchor" }, "elements": [ { diff --git a/common/src/main/resources/assets/quaedam/textures/block/cts.png b/common/src/main/resources/assets/quaedam/textures/block/causality_anchor.png similarity index 100% rename from common/src/main/resources/assets/quaedam/textures/block/cts.png rename to common/src/main/resources/assets/quaedam/textures/block/causality_anchor.png