diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/tags/Tags.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/tags/Tags.kt index 2d46e61b2..5a3d44dcb 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/tags/Tags.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/tags/Tags.kt @@ -133,7 +133,7 @@ fun addTags(tagsProvider: TagsProvider) { tagsProvider.items.Appender(ItemTags.AXES).add(MItems.TRITANIUM_AXE) tagsProvider.items.Appender(ItemTags.PICKAXES).add(MItems.TRITANIUM_PICKAXE) tagsProvider.items.Appender(ItemTags.SHOVELS).add(MItems.TRITANIUM_SHOVEL) - tagsProvider.items.Appender(ItemTags.SHOVELS).add(MItems.TRITANIUM_HOE) + tagsProvider.items.Appender(ItemTags.HOES).add(MItems.TRITANIUM_HOE) tagsProvider.items.Appender(Tags.Items.TOOLS_SHEAR).add(MItems.TRITANIUM_SHEARS) tagsProvider.items.Appender(Tags.Items.TOOLS_SHIELD).add(MItems.TRITANIUM_SHIELD) @@ -180,6 +180,23 @@ fun addTags(tagsProvider: TagsProvider) { .add(MRegistry.TRITANIUM_STRIPED_WALL.flatItems) .add(MItems.TRITANIUM_STRIPED_WALL.values) + tagsProvider.items.Appender(MItemTags.NO_REPLICATION) + .add(Items.WRITTEN_BOOK) + .add(Tags.Items.ORES) + .add(Tags.Items.RAW_MATERIALS) + .add(MItems.PILL_ANDROID) + .add(MItems.PILL_HUMANE) + .add(MItems.PILL_OBLIVION) + .add(MItems.QUANTUM_BATTERY) + .add(MItems.QUANTUM_CAPACITOR) + .add(MItems.QUANTUM_BATTERY_CREATIVE) + .add(MItems.ZPM_BATTERY) + .add(MItems.PROCEDURAL_BATTERY) + .add(MItems.EXOPACK_PROBE) + .add(MItems.ExopackUpgrades.INVENTORY_UPGRADE_PROCEDURAL) + .add(MItems.ExopackUpgrades.INVENTORY_UPGRADE_WITHER) + .add(MItems.ExopackUpgrades.INVENTORY_UPGRADE_ENDER_DRAGON) + tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_DOOR.values, Tiers.IRON) tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_TRAPDOOR.values, Tiers.IRON) tagsProvider.requiresPickaxe(MBlocks.PAINTER, Tiers.STONE) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/StarChairBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/StarChairBlock.kt index 1620e2966..81b1b94b8 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/StarChairBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/decorative/StarChairBlock.kt @@ -28,13 +28,12 @@ class StarChairBlock(val color: DyeColor?) : RotatableMatteryBlock(DEFAULT_PROPE override fun useWithoutItem(blockState: BlockState, level: Level, blockPos: BlockPos, ply: Player, blockHitResult: BlockHitResult): InteractionResult { if (ply.isCrouching) return super.useWithoutItem(blockState, level, blockPos, ply, blockHitResult) + if (level.isClientSide) return InteractionResult.SUCCESS val entities = level.getEntitiesOfClass(RideableDummy::class.java, AABB(blockPos, blockPos + BlockPos(1, 1, 1))) if (entities.isNotEmpty()) return InteractionResult.FAIL - val entity = RideableDummy(level) - entity.blockPos = blockPos - entity.blockState = blockState + val entity = RideableDummy(level, blockPos, blockState) entity.yRot = blockState[rotationFreedom()].front.toYRot() entity.setPos(blockPos.x + 0.5, blockPos.y.toDouble(), blockPos.z + 0.5) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterReplicatorBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterReplicatorBlockEntity.kt index 6e50499f5..69fd5f3e0 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterReplicatorBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterReplicatorBlockEntity.kt @@ -35,6 +35,7 @@ import ru.dbotthepony.mc.otm.graph.matter.MatterNode import ru.dbotthepony.mc.otm.matter.MatterManager import ru.dbotthepony.mc.otm.menu.matter.MatterReplicatorMenu import ru.dbotthepony.mc.otm.registry.MBlockEntities +import ru.dbotthepony.mc.otm.registry.MItemTags import ru.dbotthepony.mc.otm.registry.MItems import java.util.* @@ -168,10 +169,11 @@ class MatterReplicatorBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : } val allocation = matterNode.graph.allocateTask(simulate = false) ?: return JobContainer.observe() - val stack = allocation.task.stack(1) - val matter = MatterManager.get(stack) - // ???????? + val stack = allocation.task.stack(1) + if (stack.`is`(MItemTags.NO_REPLICATION)) return JobContainer.failure() + + val matter = MatterManager.get(stack) if (!matter.hasMatterValue) return JobContainer.failure() val ticks = matter.complexity diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterScannerBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterScannerBlockEntity.kt index e87161070..7e55749fa 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterScannerBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterScannerBlockEntity.kt @@ -27,6 +27,7 @@ import ru.dbotthepony.mc.otm.menu.matter.MatterScannerMenu import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.graph.matter.MatterNode import ru.dbotthepony.mc.otm.matter.MatterManager +import ru.dbotthepony.mc.otm.registry.MItemTags import java.util.* import kotlin.math.pow @@ -114,7 +115,7 @@ class MatterScannerBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : } val stack = container.getItem(0) - if (stack.isEmpty || !MatterManager.canDecompose(stack)) return JobContainer.noItem() + if (stack.isEmpty || !MatterManager.canDecompose(stack) || stack.`is`(MItemTags.NO_DECOMPOSING) || stack.`is`(MItemTags.NO_REPLICATION)) return JobContainer.noItem() var findState: PatternState? = null diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/entity/RideableDummy.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/entity/RideableDummy.kt index 8f12bba1a..0b8dc9950 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/entity/RideableDummy.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/entity/RideableDummy.kt @@ -15,6 +15,11 @@ class RideableDummy(level: Level) : Entity(MEntityTypes.RIDEABLE_DUMMY, level) { var blockPos: BlockPos = BlockPos.ZERO var blockState: BlockState = Blocks.AIR.defaultBlockState() + constructor(level: Level, blockPos: BlockPos, blockState: BlockState) : this(level) { + this.blockPos = blockPos + this.blockState = blockState + } + init { isNoGravity = true noPhysics = true @@ -23,10 +28,9 @@ class RideableDummy(level: Level) : Entity(MEntityTypes.RIDEABLE_DUMMY, level) { override fun tick() { super.tick() + if (level().isClientSide) return if (level().getBlockState(blockPos) != blockState || passengers.isEmpty()) { discard() - - return } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/item/armor/TritaniumArmorItem.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/item/armor/TritaniumArmorItem.kt index 0ee46f6f8..cecba4c59 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/item/armor/TritaniumArmorItem.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/item/armor/TritaniumArmorItem.kt @@ -33,7 +33,7 @@ private object TritaniumArmorRenderProperties : IClientItemExtensions { } } -class TritaniumArmorItem(slot: Type) : ArmorItem(MArmorMaterials.TRITANIUM, slot, Properties().stacksTo(1).rarity(Rarity.RARE)), +class TritaniumArmorItem(slot: Type) : ArmorItem(MArmorMaterials.TRITANIUM, slot, Properties().stacksTo(1).rarity(Rarity.RARE).durability(slot.getDurability(48))), ClientExtensionsListener { override fun registerClientExtensions(event: RegisterClientExtensionsEvent) { event.registerItem(TritaniumArmorRenderProperties, this) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MEntityTypes.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MEntityTypes.kt index 18a2a378f..beb4f5153 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MEntityTypes.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MEntityTypes.kt @@ -29,7 +29,11 @@ object MEntityTypes { } val RIDEABLE_DUMMY: EntityType by registry.register(MNames.RIDEABLE_DUMMY) { - EntityType.Builder.of({ _, level -> RideableDummy(level)}, MobCategory.MISC).sized(0.5f, 0.5f).build(MNames.RIDEABLE_DUMMY) + EntityType.Builder.of({ _, level -> RideableDummy(level) }, MobCategory.MISC) + .sized(0.5f, 0.5f) + .passengerAttachments(0.5f) + .clientTrackingRange(8) + .build(MNames.RIDEABLE_DUMMY) } fun register(bus: IEventBus) { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItemTags.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItemTags.kt index d3f941454..08afc394b 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItemTags.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItemTags.kt @@ -80,6 +80,12 @@ object MItemTags { val HARDENED_GLASS_WHITE: TagKey = ItemTags.create(ResourceLocation("c", "hardened_glass/white")) val HARDENED_GLASS_YELLOW: TagKey = ItemTags.create(ResourceLocation("c", "hardened_glass/yellow")) - val MACHINES: TagKey = ItemTags.create(ResourceLocation(OverdriveThatMatters.MOD_ID, "machines")) + val MACHINES: TagKey = ItemTags.create(modLoc("machines")) + + val NO_DECOMPOSING: TagKey = ItemTags.create(modLoc("matter/no_decomposing")) + val NO_REPLICATION: TagKey = ItemTags.create(modLoc("matter/no_replication")) + val NO_REPAIR: TagKey = ItemTags.create(modLoc("matter/no_repair")) + + fun modLoc(path: String) : ResourceLocation = ResourceLocation(OverdriveThatMatters.MOD_ID, path) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItems.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItems.kt index a99e66d3a..26b0dd0fe 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItems.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItems.kt @@ -376,10 +376,10 @@ object MItems { val TRITANIUM_PANTS: TritaniumArmorItem by registry.register(MNames.TRITANIUM_PANTS) { TritaniumArmorItem(ArmorItem.Type.LEGGINGS) } val TRITANIUM_BOOTS: TritaniumArmorItem by registry.register(MNames.TRITANIUM_BOOTS) { TritaniumArmorItem(ArmorItem.Type.BOOTS) } - val SIMPLE_TRITANIUM_HELMET: ArmorItem by registry.register(MNames.SIMPLE_TRITANIUM_HELMET) { ArmorItem(MArmorMaterials.SIMPLE_TRITANIUM, ArmorItem.Type.HELMET, Properties().stacksTo(1)) } - val SIMPLE_TRITANIUM_CHESTPLATE: ArmorItem by registry.register(MNames.SIMPLE_TRITANIUM_CHESTPLATE) { ArmorItem(MArmorMaterials.SIMPLE_TRITANIUM, ArmorItem.Type.CHESTPLATE, Properties().stacksTo(1)) } - val SIMPLE_TRITANIUM_PANTS: ArmorItem by registry.register(MNames.SIMPLE_TRITANIUM_PANTS) { ArmorItem(MArmorMaterials.SIMPLE_TRITANIUM, ArmorItem.Type.LEGGINGS, Properties().stacksTo(1)) } - val SIMPLE_TRITANIUM_BOOTS: ArmorItem by registry.register(MNames.SIMPLE_TRITANIUM_BOOTS) { ArmorItem(MArmorMaterials.SIMPLE_TRITANIUM, ArmorItem.Type.BOOTS, Properties().stacksTo(1)) } + val SIMPLE_TRITANIUM_HELMET: ArmorItem by registry.register(MNames.SIMPLE_TRITANIUM_HELMET) { ArmorItem(MArmorMaterials.SIMPLE_TRITANIUM, ArmorItem.Type.HELMET, Properties().stacksTo(1).durability(ArmorItem.Type.HELMET.getDurability(24))) } + val SIMPLE_TRITANIUM_CHESTPLATE: ArmorItem by registry.register(MNames.SIMPLE_TRITANIUM_CHESTPLATE) { ArmorItem(MArmorMaterials.SIMPLE_TRITANIUM, ArmorItem.Type.CHESTPLATE, Properties().stacksTo(1).durability(ArmorItem.Type.CHESTPLATE.getDurability(24))) } + val SIMPLE_TRITANIUM_PANTS: ArmorItem by registry.register(MNames.SIMPLE_TRITANIUM_PANTS) { ArmorItem(MArmorMaterials.SIMPLE_TRITANIUM, ArmorItem.Type.LEGGINGS, Properties().stacksTo(1).durability(ArmorItem.Type.LEGGINGS.getDurability(24))) } + val SIMPLE_TRITANIUM_BOOTS: ArmorItem by registry.register(MNames.SIMPLE_TRITANIUM_BOOTS) { ArmorItem(MArmorMaterials.SIMPLE_TRITANIUM, ArmorItem.Type.BOOTS, Properties().stacksTo(1).durability(ArmorItem.Type.BOOTS.getDurability(24))) } val TRITANIUM_ARMOR = SupplierList( ::TRITANIUM_HELMET,