Compare commits

...

31 Commits

Author SHA1 Message Date
2354190184
Update method references after merge 2025-03-31 08:23:17 +07:00
0783e83465
Merge branch '1.21' into world-structures
# Conflicts:
#	src/data/kotlin/ru/dbotthepony/mc/otm/datagen/advancements/AdvancementData.kt
#	src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/LootTablesChests.kt
#	src/main/kotlin/ru/dbotthepony/mc/otm/entity/Loader.kt
2025-03-31 08:20:12 +07:00
12241ead12
Remove outdated code 2025-03-31 08:12:09 +07:00
a4b54f052c
Bump kommons 2025-03-30 23:56:43 +07:00
4b38528fe0
Switch more code to use kommons 2025-03-30 23:56:05 +07:00
c5c7e1bac4
Remove operator modifier on blockstate#set alias 2025-03-30 18:51:25 +07:00
339cacc545
Remove toImmutableList 2025-03-30 18:47:18 +07:00
844323ead6
Move streams exts from Utils to FriendlyStreams 2025-03-30 18:46:36 +07:00
ca95da8c6f
Move level extensions to separate file 2025-03-30 18:45:45 +07:00
3cbcd9e280
Use immutableMap provided by kommons 2025-03-30 18:42:42 +07:00
118f5e1b5c
Use immutableSet provided by kommons 2025-03-30 18:18:59 +07:00
1241d2368e
a? 2025-03-30 18:17:59 +07:00
4b5602404d
wtfffff 2025-03-30 18:17:28 +07:00
e0aa5ebbae
Compile against kommons immutable* factory functions and mapped comparator 2025-03-30 18:16:43 +07:00
88d47ef4d5
Remove enum.next/prev 2025-03-30 16:39:08 +07:00
46eebd236a
Rename file to Utils 2025-03-30 16:37:02 +07:00
4207be5078
Remove byte supplier and short supplier 2025-03-30 16:35:19 +07:00
2f03d6730a
Fix IDAllocator not being utilized properly in dynamic synchable group 2025-03-30 16:34:18 +07:00
30fb67f63a
Remove NotNullVar
lateinit should be used instead, really
2025-03-30 16:32:04 +07:00
6f12295245
Move nbt extensions to util subpackage 2025-03-30 16:27:40 +07:00
a2c5b84e77
Move observed config list to config subpackage 2025-03-30 16:24:06 +07:00
1a94ab6634
Split core into util package
for no reason of course
2025-03-30 16:23:46 +07:00
078b3dba9a
Move Multiblock subpackage to root 2025-03-30 15:32:32 +07:00
4c41128b37
Remove RandomSource2Generator 2025-03-30 15:28:44 +07:00
a49754e5cc
Move random utils to util subpackage 2025-03-30 15:24:29 +07:00
929049f24c
YuRaNnNzZZ — 21:17
даблклик теперь не собирает все итемы
в экзопаке
2025-03-29 21:19:37 +07:00
20c58c578d
okey 2025-03-29 21:08:54 +07:00
e3f9b8dc64
i'm with stupid 2025-03-29 20:44:56 +07:00
e85bc72ef2
Handle recursive lively nodes removal gracefully 2025-03-29 20:42:14 +07:00
03dfef00c4
??? 2025-03-29 20:30:38 +07:00
69e4747363
Try to prevent recursive energy transfer on cables 2025-03-29 20:22:44 +07:00
531 changed files with 1954 additions and 2935 deletions

View File

@ -22,7 +22,7 @@ mixin_version=0.8.5
neogradle.subsystems.parchment.minecraftVersion=1.21.1
neogradle.subsystems.parchment.mappingsVersion=2024.11.17
kommons_version=3.6.0
kommons_version=3.9.1
caffeine_cache_version=3.1.5
jei_version=19.16.4.171

View File

@ -24,17 +24,17 @@ import net.neoforged.neoforge.data.event.GatherDataEvent
import net.neoforged.neoforge.registries.NeoForgeRegistries
import ru.dbotthepony.mc.otm.OverdriveThatMatters
import ru.dbotthepony.mc.otm.player.android.AndroidResearchDataProvider
import ru.dbotthepony.mc.otm.core.ResourceLocation
import ru.dbotthepony.mc.otm.core.math.yRotationBlockstateNorth
import ru.dbotthepony.mc.otm.core.util.WriteOnce
import ru.dbotthepony.mc.otm.util.ResourceLocation
import ru.dbotthepony.mc.otm.util.math.yRotationBlockstateNorth
import ru.dbotthepony.mc.otm.util.WriteOnce
import ru.dbotthepony.mc.otm.datagen.blocks.BatteryBankProvider
import ru.dbotthepony.mc.otm.datagen.blocks.MatterBankProvider
import ru.dbotthepony.mc.otm.datagen.blocks.MatteryBlockStateProvider
import ru.dbotthepony.mc.otm.datagen.items.MatteryItemModelProvider
import ru.dbotthepony.mc.otm.datagen.lang.AddEnglishLanguage
import ru.dbotthepony.mc.otm.datagen.models.MatteryBlockModelProvider
import ru.dbotthepony.mc.otm.core.registryName
import ru.dbotthepony.mc.otm.core.util.GJRAND64RandomSource
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.util.GJRAND64RandomSource
import ru.dbotthepony.mc.otm.data.FlywheelMaterialDataProvider
import ru.dbotthepony.mc.otm.datagen.advancements.addAdvancements
import ru.dbotthepony.mc.otm.datagen.advancements.addAndroidAdvancements

View File

@ -9,11 +9,11 @@ import net.minecraft.world.level.block.state.properties.BlockStateProperties
import net.neoforged.neoforge.client.model.generators.BlockModelBuilder
import net.neoforged.neoforge.client.model.generators.ConfiguredModel
import net.neoforged.neoforge.client.model.generators.ModelFile
import ru.dbotthepony.mc.otm.core.get
import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.core.math.xRotationBlockstateNorth
import ru.dbotthepony.mc.otm.core.math.yRotationBlockstateNorth
import ru.dbotthepony.mc.otm.core.registryName
import ru.dbotthepony.mc.otm.util.get
import ru.dbotthepony.mc.otm.util.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.util.math.xRotationBlockstateNorth
import ru.dbotthepony.mc.otm.util.math.yRotationBlockstateNorth
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.blocks.MatteryBlockStateProvider
import ru.dbotthepony.mc.otm.datagen.items.MatteryItemModelProvider
import ru.dbotthepony.mc.otm.datagen.models.MatteryBlockModelProvider

View File

@ -1,7 +1,7 @@
package ru.dbotthepony.mc.otm.datagen
import net.neoforged.neoforge.common.Tags
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.data.FlywheelMaterialDataProvider
import ru.dbotthepony.mc.otm.registry.MBlockTags

View File

@ -4,7 +4,7 @@ import net.minecraft.tags.ItemTags
import net.minecraft.world.item.Item
import net.minecraft.world.item.Items
import net.neoforged.neoforge.common.Tags
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.matter.MatterDataProvider
import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.game.MItems

View File

@ -8,8 +8,8 @@ import ru.dbotthepony.mc.otm.player.android.AndroidResearchDescriptions
import ru.dbotthepony.mc.otm.player.android.AndroidResearchResults
import ru.dbotthepony.mc.otm.player.android.AndroidResearchType
import ru.dbotthepony.mc.otm.client.render.ResearchIcons
import ru.dbotthepony.mc.otm.core.TextComponent
import ru.dbotthepony.mc.otm.core.TranslatableComponent
import ru.dbotthepony.mc.otm.util.TextComponent
import ru.dbotthepony.mc.otm.util.TranslatableComponent
import ru.dbotthepony.mc.otm.datagen.lang.MatteryLanguageProvider
import ru.dbotthepony.mc.otm.registry.game.AndroidFeatures
import ru.dbotthepony.mc.otm.registry.MItemTags

View File

@ -24,7 +24,7 @@ import net.minecraft.world.level.levelgen.placement.RarityFilter
import net.minecraft.world.level.levelgen.structure.templatesystem.TagMatchTest
import net.neoforged.neoforge.common.world.BiomeModifier
import net.neoforged.neoforge.registries.NeoForgeRegistries
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.data.world.EllipsoidPlacement
import ru.dbotthepony.mc.otm.data.world.StandardDeviationHeightProvider
import ru.dbotthepony.mc.otm.registry.game.MBlocks

View File

@ -1,23 +1,20 @@
package ru.dbotthepony.mc.otm.datagen.advancements
import net.minecraft.advancements.AdvancementHolder
import net.minecraft.advancements.AdvancementRewards
import net.minecraft.advancements.AdvancementRequirements.Strategy
import net.minecraft.advancements.AdvancementRewards
import net.minecraft.advancements.AdvancementType
import net.minecraft.advancements.Criterion
import net.minecraft.advancements.critereon.*
import net.minecraft.advancements.critereon.InventoryChangeTrigger
import net.minecraft.world.item.DyeColor
import net.minecraft.world.item.ItemStack
import ru.dbotthepony.mc.otm.core.ResourceLocation
import ru.dbotthepony.mc.otm.core.registryName
import ru.dbotthepony.mc.otm.datagen.lang.MatteryLanguageProvider
import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.game.MItems
import ru.dbotthepony.mc.otm.registry.MRegistry
import ru.dbotthepony.mc.otm.registry.game.MEntityTypes
import ru.dbotthepony.mc.otm.registry.game.MItems
import ru.dbotthepony.mc.otm.triggers.BlackHoleTrigger
import ru.dbotthepony.mc.otm.triggers.NailedEntityTrigger
import ru.dbotthepony.mc.otm.util.registryName
import java.util.function.Consumer
fun addAdvancements(serializer: Consumer<AdvancementHolder>, lang: MatteryLanguageProvider) {

View File

@ -15,7 +15,7 @@ import net.minecraft.tags.TagKey
import net.minecraft.world.item.Item
import net.minecraft.world.item.ItemStack
import net.minecraft.world.level.ItemLike
import ru.dbotthepony.mc.otm.core.TextComponent
import ru.dbotthepony.mc.otm.util.TextComponent
import ru.dbotthepony.mc.otm.datagen.modLocation
import java.util.function.Consumer

View File

@ -7,9 +7,9 @@ import net.minecraft.advancements.critereon.ItemPredicate
import net.minecraft.world.item.Item
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.Items
import ru.dbotthepony.mc.otm.core.TranslatableComponent
import ru.dbotthepony.mc.otm.core.key
import ru.dbotthepony.mc.otm.core.registryName
import ru.dbotthepony.mc.otm.util.TranslatableComponent
import ru.dbotthepony.mc.otm.util.key
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.lang.MatteryLanguageProvider
import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.registry.game.MItems

View File

@ -5,9 +5,9 @@ import net.minecraft.world.level.block.Block
import net.neoforged.neoforge.client.model.generators.BlockStateProvider
import net.neoforged.neoforge.client.model.generators.ConfiguredModel
import net.neoforged.neoforge.data.event.GatherDataEvent
import ru.dbotthepony.mc.otm.core.get
import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.core.math.yRotationBlockstateNorth
import ru.dbotthepony.mc.otm.util.get
import ru.dbotthepony.mc.otm.util.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.util.math.yRotationBlockstateNorth
import ru.dbotthepony.mc.otm.datagen.DataGen
import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.registry.game.MBlocks

View File

@ -9,14 +9,14 @@ import ru.dbotthepony.mc.otm.block.entity.WorkerState
import ru.dbotthepony.mc.otm.block.matter.MatterBottlerBlock
import ru.dbotthepony.mc.otm.block.tech.AndroidChargerBlock
import ru.dbotthepony.mc.otm.block.tech.EssenceStorageBlock
import ru.dbotthepony.mc.otm.core.ResourceLocation
import ru.dbotthepony.mc.otm.core.get
import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.core.math.xRotationBlockstateNorth
import ru.dbotthepony.mc.otm.core.math.xRotationBlockstateSouth
import ru.dbotthepony.mc.otm.core.math.yRotationBlockstateNorth
import ru.dbotthepony.mc.otm.core.math.yRotationBlockstateSouth
import ru.dbotthepony.mc.otm.core.registryName
import ru.dbotthepony.mc.otm.util.ResourceLocation
import ru.dbotthepony.mc.otm.util.get
import ru.dbotthepony.mc.otm.util.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.util.math.xRotationBlockstateNorth
import ru.dbotthepony.mc.otm.util.math.xRotationBlockstateSouth
import ru.dbotthepony.mc.otm.util.math.yRotationBlockstateNorth
import ru.dbotthepony.mc.otm.util.math.yRotationBlockstateSouth
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.registry.game.MBlocks
import ru.dbotthepony.mc.otm.registry.MNames

View File

@ -5,9 +5,9 @@ import ru.dbotthepony.mc.otm.block.tech.EnergyCounterBlock
import ru.dbotthepony.mc.otm.block.entity.WorkerState
import ru.dbotthepony.mc.otm.block.matter.PatternStorageBlock
import ru.dbotthepony.mc.otm.block.storage.DriveViewerBlock
import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.core.math.yRotationBlockstateNorth
import ru.dbotthepony.mc.otm.core.registryName
import ru.dbotthepony.mc.otm.util.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.util.math.yRotationBlockstateNorth
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.registry.game.MBlocks

View File

@ -11,11 +11,11 @@ import net.neoforged.neoforge.client.model.generators.ConfiguredModel
import net.neoforged.neoforge.data.event.GatherDataEvent
import ru.dbotthepony.mc.otm.OverdriveThatMatters
import ru.dbotthepony.mc.otm.block.entity.WorkerState
import ru.dbotthepony.mc.otm.core.getValueNullable
import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.core.math.xRotationBlockstateNorth
import ru.dbotthepony.mc.otm.core.math.yRotationBlockstateNorth
import ru.dbotthepony.mc.otm.core.registryName
import ru.dbotthepony.mc.otm.util.getValueNullable
import ru.dbotthepony.mc.otm.util.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.util.math.xRotationBlockstateNorth
import ru.dbotthepony.mc.otm.util.math.yRotationBlockstateNorth
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.DataGen
import ru.dbotthepony.mc.otm.datagen.modLocation
import java.util.*

View File

@ -1,8 +1,8 @@
package ru.dbotthepony.mc.otm.datagen.items
import net.minecraft.world.item.DyeColor
import ru.dbotthepony.mc.otm.core.ResourceLocation
import ru.dbotthepony.mc.otm.core.registryName
import ru.dbotthepony.mc.otm.util.ResourceLocation
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.registry.game.MItems
import ru.dbotthepony.mc.otm.registry.MRegistry

View File

@ -9,8 +9,8 @@ import net.minecraft.world.item.Item
import net.neoforged.neoforge.client.model.generators.ItemModelProvider
import net.neoforged.neoforge.data.event.GatherDataEvent
import org.apache.logging.log4j.LogManager
import ru.dbotthepony.mc.otm.core.ResourceLocation
import ru.dbotthepony.mc.otm.core.registryName
import ru.dbotthepony.mc.otm.util.ResourceLocation
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.DataGen
import ru.dbotthepony.mc.otm.datagen.modLocation
import java.util.LinkedList

View File

@ -17,7 +17,7 @@ import net.neoforged.neoforge.common.data.LanguageProvider
import ru.dbotthepony.mc.otm.OverdriveThatMatters
import ru.dbotthepony.mc.otm.player.android.AndroidFeatureType
import ru.dbotthepony.mc.otm.player.android.AndroidResearchType
import ru.dbotthepony.mc.otm.core.TranslatableComponent
import ru.dbotthepony.mc.otm.util.TranslatableComponent
import ru.dbotthepony.mc.otm.datagen.DataGen
import ru.dbotthepony.mc.otm.registry.objects.ColoredDecorativeBlock

View File

@ -11,8 +11,8 @@ import net.minecraft.world.level.storage.loot.LootTable
import net.minecraft.world.level.storage.loot.predicates.LootItemCondition
import net.neoforged.neoforge.common.loot.AddTableLootModifier
import net.neoforged.neoforge.common.loot.LootTableIdCondition
import ru.dbotthepony.mc.otm.core.ResourceLocation
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.util.ResourceLocation
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.data.world.UniformDecimal
import ru.dbotthepony.mc.otm.data.condition.ChanceWithPlaytimeCondition
import ru.dbotthepony.mc.otm.data.condition.HasExoPackCondition

View File

@ -8,7 +8,6 @@ import it.unimi.dsi.fastutil.objects.Reference2ObjectFunction
import net.minecraft.advancements.critereon.StatePropertiesPredicate
import net.minecraft.core.HolderLookup
import net.minecraft.core.WritableRegistry
import net.minecraft.data.DataGenerator
import net.minecraft.data.loot.LootTableProvider
import net.minecraft.data.loot.LootTableSubProvider
import net.minecraft.resources.ResourceKey
@ -28,7 +27,7 @@ import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets
import net.minecraft.world.level.storage.loot.predicates.LootItemBlockStatePropertyCondition
import net.minecraft.world.level.storage.loot.providers.number.ConstantValue
import net.neoforged.neoforge.data.event.GatherDataEvent
import ru.dbotthepony.mc.otm.core.stream
import ru.dbotthepony.kommons.collect.stream
import ru.dbotthepony.mc.otm.data.loot.CopyTileNbtFunction
import java.util.concurrent.CompletableFuture

View File

@ -1,20 +1,16 @@
package ru.dbotthepony.mc.otm.datagen.loot
import net.minecraft.resources.ResourceLocation
import net.minecraft.util.valueproviders.UniformInt
import net.minecraft.world.item.Items
import net.minecraft.world.level.storage.loot.entries.NestedLootTable
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets
import ru.dbotthepony.mc.otm.OverdriveThatMatters
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.data.world.UniformDecimal
import ru.dbotthepony.mc.otm.datagen.modLootTable
import ru.dbotthepony.mc.otm.item.ProceduralBatteryItem
import ru.dbotthepony.mc.otm.item.exopack.ProceduralExopackSlotUpgradeItem
import ru.dbotthepony.mc.otm.item.matter.MatterDustItem
import ru.dbotthepony.mc.otm.registry.game.MItems
import net.minecraft.world.level.storage.loot.entries.NestedLootTable
import net.neoforged.neoforge.common.Tags.Enchantments
import ru.dbotthepony.mc.otm.core.ResourceLocation
import ru.dbotthepony.mc.otm.util.math.Decimal
fun addChestLootTables(loot: LootTables) {
loot.builder(LootContextParamSets.CHEST, modLootTable("food_box")) {

View File

@ -15,7 +15,7 @@ import net.minecraft.world.level.storage.loot.functions.ApplyBonusCount
import net.minecraft.world.level.storage.loot.functions.SetItemCountFunction
import net.minecraft.world.level.storage.loot.predicates.ExplosionCondition
import net.minecraft.world.level.storage.loot.predicates.MatchTool
import ru.dbotthepony.mc.otm.core.lookupOrThrow
import ru.dbotthepony.mc.otm.util.lookupOrThrow
import ru.dbotthepony.mc.otm.data.loot.Int2NumberProvider
import ru.dbotthepony.mc.otm.registry.game.MBlocks
import ru.dbotthepony.mc.otm.registry.game.MItems

View File

@ -2,7 +2,7 @@ package ru.dbotthepony.mc.otm.datagen.loot
import net.minecraft.util.valueproviders.UniformInt
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.data.world.UniformDecimal
import ru.dbotthepony.mc.otm.datagen.modLootTable
import ru.dbotthepony.mc.otm.item.ProceduralBatteryItem

View File

@ -2,14 +2,13 @@ package ru.dbotthepony.mc.otm.datagen.models
import net.minecraft.world.item.DyeColor
import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.WaterloggedTransparentBlock
import net.neoforged.neoforge.client.model.generators.BlockModelProvider
import net.neoforged.neoforge.data.event.GatherDataEvent
import ru.dbotthepony.mc.otm.core.ResourceLocation
import ru.dbotthepony.mc.otm.util.ResourceLocation
import ru.dbotthepony.mc.otm.datagen.DataGen
import ru.dbotthepony.mc.otm.core.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation
import java.util.LinkedList
import ru.dbotthepony.mc.otm.util.registryName
import java.util.*
class MatteryBlockModelProvider(event: GatherDataEvent) : BlockModelProvider(event.generator.packOutput, DataGen.MOD_ID, event.existingFileHelper) {
private val callbacks = LinkedList<(MatteryBlockModelProvider) -> Unit>()

View File

@ -8,7 +8,7 @@ import net.minecraft.world.item.Item
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.crafting.Ingredient
import net.minecraft.world.level.ItemLike
import ru.dbotthepony.mc.otm.core.registryName
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.game.MItems

View File

@ -13,12 +13,12 @@ import net.neoforged.neoforge.common.conditions.NotCondition
import net.neoforged.neoforge.common.conditions.TagEmptyCondition
import ru.dbotthepony.mc.otm.block.entity.MatteryBlockEntity
import ru.dbotthepony.mc.otm.config.CablesConfig
import ru.dbotthepony.mc.otm.core.ResourceLocation
import ru.dbotthepony.mc.otm.util.ResourceLocation
import ru.dbotthepony.mc.otm.registry.game.MBlocks
import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.game.MItems
import ru.dbotthepony.mc.otm.registry.MRegistry
import ru.dbotthepony.mc.otm.core.registryName
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.recipe.UpgradeRecipe

View File

@ -8,7 +8,7 @@ import net.minecraft.world.item.Items
import net.minecraft.world.item.crafting.Ingredient
import net.minecraft.world.level.ItemLike
import net.neoforged.neoforge.common.Tags
import ru.dbotthepony.mc.otm.core.registryName
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.registry.game.MBlocks
import ru.dbotthepony.mc.otm.registry.MItemTags

View File

@ -6,7 +6,7 @@ import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.crafting.Ingredient
import net.minecraft.world.item.crafting.ShapedRecipePattern
import net.neoforged.neoforge.common.Tags
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.recipe.MatterEntanglerRecipe
import ru.dbotthepony.mc.otm.registry.MItemTags

View File

@ -17,7 +17,7 @@ import net.minecraft.world.item.crafting.ShapedRecipe
import net.minecraft.world.level.ItemLike
import net.neoforged.neoforge.common.conditions.ICondition
import ru.dbotthepony.mc.otm.OverdriveThatMatters
import ru.dbotthepony.mc.otm.core.registryName
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.recipe.UpgradeRecipe

View File

@ -24,8 +24,8 @@ import net.minecraft.world.item.crafting.ShapedRecipePattern
import net.minecraft.world.level.ItemLike
import net.neoforged.neoforge.common.conditions.ICondition
import net.neoforged.neoforge.data.event.GatherDataEvent
import ru.dbotthepony.mc.otm.core.ResourceLocation
import ru.dbotthepony.mc.otm.core.registryName
import ru.dbotthepony.mc.otm.util.ResourceLocation
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.recipe.MicrowaveRecipe
import ru.dbotthepony.mc.otm.recipe.PlatePressRecipe

View File

@ -13,7 +13,7 @@ import net.minecraft.world.item.Items
import net.minecraft.world.item.crafting.Ingredient
import net.neoforged.fml.ModList
import net.neoforged.neoforge.common.conditions.ModLoadedCondition
import ru.dbotthepony.mc.otm.core.registryName
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.recipe.PainterArmorDyeRecipe
import ru.dbotthepony.mc.otm.recipe.PainterRecipe

View File

@ -11,7 +11,7 @@ import net.minecraft.world.item.Items
import net.minecraft.world.item.crafting.Ingredient
import net.minecraft.world.level.ItemLike
import net.neoforged.neoforge.common.Tags
import ru.dbotthepony.mc.otm.core.registryName
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.game.MItems

View File

@ -7,7 +7,7 @@ import net.minecraft.data.recipes.SimpleCookingRecipeBuilder
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.crafting.Ingredient
import net.neoforged.neoforge.common.Tags
import ru.dbotthepony.mc.otm.core.registryName
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.registry.game.MItems

View File

@ -6,7 +6,7 @@ import net.minecraft.world.effect.MobEffects
import net.minecraft.world.item.Items
import net.neoforged.neoforge.common.Tags
import ru.dbotthepony.kommons.collect.flatMap
import ru.dbotthepony.mc.otm.core.ResourceLocation
import ru.dbotthepony.mc.otm.util.ResourceLocation
import ru.dbotthepony.mc.otm.registry.MBlockTags
import ru.dbotthepony.mc.otm.registry.game.MBlocks
import ru.dbotthepony.mc.otm.registry.game.MFluids

View File

@ -20,7 +20,7 @@ import net.neoforged.neoforge.common.Tags
import net.neoforged.neoforge.data.event.GatherDataEvent
import net.neoforged.neoforge.registries.NeoForgeRegistries
import ru.dbotthepony.mc.otm.player.MatteryPlayer
import ru.dbotthepony.mc.otm.core.ResourceLocation
import ru.dbotthepony.mc.otm.util.ResourceLocation
import ru.dbotthepony.mc.otm.datagen.DataGen
import java.util.EnumMap
import java.util.stream.Stream

View File

@ -5,7 +5,7 @@ import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import ru.dbotthepony.mc.otm.core.multiblock.GlobalBlockEntityRemovalListener;
import ru.dbotthepony.mc.otm.multiblock.GlobalBlockEntityRemovalListener;
// because i know
// someone

View File

@ -5,8 +5,8 @@ import net.minecraft.world.level.Level;
import net.neoforged.fml.ModList;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Mixin;
import ru.dbotthepony.mc.otm.core.IMatteryLevel;
import ru.dbotthepony.mc.otm.core.util.GJRAND64RandomSource;
import ru.dbotthepony.mc.otm.util.IMatteryLevel;
import ru.dbotthepony.mc.otm.util.GJRAND64RandomSource;
@Mixin(Level.class)
public abstract class LevelMixin implements IMatteryLevel {

View File

@ -8,7 +8,7 @@ import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import ru.dbotthepony.mc.otm.player.IMatteryPlayer;
import ru.dbotthepony.mc.otm.core.IMatteryLevel;
import ru.dbotthepony.mc.otm.util.IMatteryLevel;
import ru.dbotthepony.mc.otm.registry.game.MSoundEvents;
@Mixin(AbstractHurtingProjectile.class)

View File

@ -13,8 +13,8 @@ import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import ru.dbotthepony.mc.otm.player.IMatteryPlayer;
import ru.dbotthepony.mc.otm.config.ServerConfig;
import ru.dbotthepony.mc.otm.core.util.ExperienceUtilsKt;
import ru.dbotthepony.mc.otm.registry.game.MItems;
import ru.dbotthepony.mc.otm.util.ExperienceUtilsKt;
@SuppressWarnings("ConstantConditions")
@Mixin(LivingEntity.class)

View File

@ -5,7 +5,7 @@ import net.minecraft.core.Direction;
import net.minecraft.world.phys.shapes.BooleanOp;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import ru.dbotthepony.mc.otm.core.math.BlockRotation;
import ru.dbotthepony.mc.otm.util.math.BlockRotation;
import javax.annotation.ParametersAreNonnullByDefault;

View File

@ -19,12 +19,12 @@ import net.neoforged.neoforge.event.tick.ServerTickEvent
import org.apache.logging.log4j.LogManager
import ru.dbotthepony.mc.otm.capability.AbstractProfiledStorage
import ru.dbotthepony.mc.otm.client.minecraft
import ru.dbotthepony.mc.otm.core.collect.WeakHashSet
import ru.dbotthepony.mc.otm.core.util.AtomicallyInvalidatedLazy
import ru.dbotthepony.mc.otm.core.util.GJRAND64RandomSource
import ru.dbotthepony.mc.otm.core.util.IConditionalTickable
import ru.dbotthepony.mc.otm.core.util.ITickable
import ru.dbotthepony.mc.otm.core.util.TickList
import ru.dbotthepony.mc.otm.util.collect.WeakHashSet
import ru.dbotthepony.mc.otm.util.AtomicallyInvalidatedLazy
import ru.dbotthepony.mc.otm.util.GJRAND64RandomSource
import ru.dbotthepony.mc.otm.util.IConditionalTickable
import ru.dbotthepony.mc.otm.util.ITickable
import ru.dbotthepony.mc.otm.util.TickList
import ru.dbotthepony.mc.otm.graph.GraphNodeList
import java.lang.ref.Cleaner
import java.util.*

View File

@ -1,7 +1,7 @@
package ru.dbotthepony.mc.otm
import net.minecraft.util.TimeSource
import ru.dbotthepony.mc.otm.core.util.formatTickDuration
import ru.dbotthepony.mc.otm.util.formatTickDuration
import java.util.function.LongSupplier
/**

View File

@ -36,16 +36,16 @@ import org.apache.logging.log4j.LogManager
import ru.dbotthepony.mc.otm.block.entity.IRedstoneControlled
import ru.dbotthepony.mc.otm.block.entity.MatteryBlockEntity
import ru.dbotthepony.mc.otm.block.entity.WorkerState
import ru.dbotthepony.mc.otm.core.TooltipList
import ru.dbotthepony.mc.otm.core.TranslatableComponent
import ru.dbotthepony.mc.otm.core.asSupplier
import ru.dbotthepony.mc.otm.core.collect.SupplierMap
import ru.dbotthepony.mc.otm.core.get
import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.core.math.component1
import ru.dbotthepony.mc.otm.core.math.component2
import ru.dbotthepony.mc.otm.core.math.component3
import ru.dbotthepony.mc.otm.core.nbt.set
import ru.dbotthepony.mc.otm.util.TooltipList
import ru.dbotthepony.mc.otm.util.TranslatableComponent
import ru.dbotthepony.mc.otm.util.asSupplier
import ru.dbotthepony.mc.otm.util.collect.SupplierMap
import ru.dbotthepony.mc.otm.util.get
import ru.dbotthepony.mc.otm.util.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.util.math.component1
import ru.dbotthepony.mc.otm.util.math.component2
import ru.dbotthepony.mc.otm.util.math.component3
import ru.dbotthepony.mc.otm.util.set
import ru.dbotthepony.mc.otm.once
import java.util.concurrent.Callable
import java.util.function.Function

View File

@ -6,9 +6,9 @@ import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.Rotation
import net.minecraft.world.level.block.state.BlockState
import net.minecraft.world.level.block.state.StateDefinition
import ru.dbotthepony.mc.otm.core.get
import ru.dbotthepony.mc.otm.core.math.BlockRotation
import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.util.get
import ru.dbotthepony.mc.otm.util.math.BlockRotation
import ru.dbotthepony.mc.otm.util.math.BlockRotationFreedom
open class RotatableMatteryBlock(properties: Properties = DEFAULT_PROPERTIES) : MatteryBlock(properties) {
init {

View File

@ -19,7 +19,7 @@ import net.minecraft.world.phys.shapes.Shapes
import net.minecraft.world.phys.shapes.VoxelShape
import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
import ru.dbotthepony.mc.otm.block.entity.decorative.CargoCrateBlockEntity
import ru.dbotthepony.mc.otm.core.get
import ru.dbotthepony.mc.otm.util.get
import ru.dbotthepony.mc.otm.shapes.BlockShapes
class CargoCrateBlock(val color: DyeColor?) : RotatableMatteryBlock(

View File

@ -4,15 +4,12 @@ import net.minecraft.ChatFormatting
import net.minecraft.core.BlockPos
import net.minecraft.core.Direction
import net.minecraft.server.level.ServerLevel
import net.minecraft.sounds.SoundEvent
import net.minecraft.sounds.SoundEvents
import net.minecraft.sounds.SoundSource
import net.minecraft.util.RandomSource
import net.minecraft.util.StringRepresentable
import net.minecraft.world.InteractionResult
import net.minecraft.world.entity.player.Player
import net.minecraft.world.item.DyeColor
import net.minecraft.world.item.context.BlockPlaceContext
import net.minecraft.world.level.BlockGetter
import net.minecraft.world.level.Level
import net.minecraft.world.level.block.Block
@ -28,10 +25,10 @@ import net.minecraft.world.phys.shapes.CollisionContext
import net.minecraft.world.phys.shapes.VoxelShape
import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
import ru.dbotthepony.mc.otm.block.getShapeForEachState
import ru.dbotthepony.mc.otm.core.TranslatableComponent
import ru.dbotthepony.mc.otm.core.get
import ru.dbotthepony.mc.otm.core.math.plus
import ru.dbotthepony.mc.otm.core.set
import ru.dbotthepony.mc.otm.util.TranslatableComponent
import ru.dbotthepony.mc.otm.util.get
import ru.dbotthepony.mc.otm.util.math.plus
import ru.dbotthepony.mc.otm.util.set
import ru.dbotthepony.mc.otm.item.tool.RedstoneInteractorItem
import ru.dbotthepony.mc.otm.shapes.BlockShapes

View File

@ -14,9 +14,9 @@ import net.minecraft.world.level.material.PushReaction
import net.minecraft.world.phys.shapes.CollisionContext
import net.minecraft.world.phys.shapes.VoxelShape
import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
import ru.dbotthepony.mc.otm.core.TranslatableComponent
import ru.dbotthepony.mc.otm.core.get
import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.util.TranslatableComponent
import ru.dbotthepony.mc.otm.util.get
import ru.dbotthepony.mc.otm.util.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.shapes.BlockShapes
class EngineBlock : RotatableMatteryBlock(Properties.of().mapColor(MapColor.COLOR_ORANGE).sound(SoundType.VAULT).explosionResistance(14f).destroyTime(2.5f).requiresCorrectToolForDrops().pushReaction(PushReaction.NORMAL)) {

View File

@ -2,7 +2,6 @@ package ru.dbotthepony.mc.otm.block.decorative
import net.minecraft.core.BlockPos
import net.minecraft.world.InteractionHand
import net.minecraft.world.InteractionResult
import net.minecraft.world.ItemInteractionResult
import net.minecraft.world.entity.player.Player
import net.minecraft.world.item.ItemStack
@ -20,7 +19,7 @@ import net.neoforged.neoforge.fluids.FluidUtil
import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
import ru.dbotthepony.mc.otm.block.entity.decorative.FluidTankBlockEntity
import ru.dbotthepony.mc.otm.block.getShapeForEachState
import ru.dbotthepony.mc.otm.core.get
import ru.dbotthepony.mc.otm.util.get
import ru.dbotthepony.mc.otm.shapes.BlockShapes
class FluidTankBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock {

View File

@ -19,10 +19,10 @@ import net.minecraft.world.level.block.state.properties.EnumProperty
import net.minecraft.world.level.material.MapColor
import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
import ru.dbotthepony.mc.otm.block.entity.decorative.GrillBlockEntity
import ru.dbotthepony.mc.otm.core.get
import ru.dbotthepony.mc.otm.core.math.component1
import ru.dbotthepony.mc.otm.core.math.component2
import ru.dbotthepony.mc.otm.core.math.component3
import ru.dbotthepony.mc.otm.util.get
import ru.dbotthepony.mc.otm.util.math.component1
import ru.dbotthepony.mc.otm.util.math.component2
import ru.dbotthepony.mc.otm.util.math.component3
import kotlin.math.absoluteValue
class GrillBlock(val color: DyeColor?) : RotatableMatteryBlock(Properties.of().mapColor(color?.mapColor ?: MapColor.METAL).destroyTime(0.75f).explosionResistance(10.0f)), EntityBlock {

View File

@ -9,8 +9,8 @@ import net.minecraft.world.phys.shapes.CollisionContext
import net.minecraft.world.phys.shapes.VoxelShape
import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
import ru.dbotthepony.mc.otm.block.entity.decorative.HoloSignBlockEntity
import ru.dbotthepony.mc.otm.core.get
import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.util.get
import ru.dbotthepony.mc.otm.util.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.shapes.BlockShapes
class HoloSignBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock {

View File

@ -2,7 +2,6 @@ package ru.dbotthepony.mc.otm.block.decorative
import net.minecraft.core.BlockPos
import net.minecraft.world.InteractionHand
import net.minecraft.world.InteractionResult
import net.minecraft.world.ItemInteractionResult
import net.minecraft.world.entity.player.Player
import net.minecraft.world.item.ItemStack
@ -23,7 +22,7 @@ import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
import ru.dbotthepony.mc.otm.block.addSimpleDescription
import ru.dbotthepony.mc.otm.block.entity.decorative.InfiniteWaterSourceBlockEntity
import ru.dbotthepony.mc.otm.block.getShapeForEachState
import ru.dbotthepony.mc.otm.core.get
import ru.dbotthepony.mc.otm.util.get
import ru.dbotthepony.mc.otm.shapes.BlockShapes
class InfiniteWaterSourceBlock : RotatableMatteryBlock(

View File

@ -20,11 +20,11 @@ import net.minecraft.world.phys.shapes.CollisionContext
import net.minecraft.world.phys.shapes.Shapes
import net.minecraft.world.phys.shapes.VoxelShape
import ru.dbotthepony.mc.otm.config.ServerConfig
import ru.dbotthepony.mc.otm.core.TranslatableComponent
import ru.dbotthepony.mc.otm.core.get
import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.core.math.blockRotation
import ru.dbotthepony.mc.otm.core.math.plus
import ru.dbotthepony.mc.otm.util.TranslatableComponent
import ru.dbotthepony.mc.otm.util.get
import ru.dbotthepony.mc.otm.util.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.util.math.blockRotation
import ru.dbotthepony.mc.otm.util.math.plus
import ru.dbotthepony.mc.otm.once
import ru.dbotthepony.mc.otm.registry.game.MBlocks

View File

@ -2,7 +2,6 @@ package ru.dbotthepony.mc.otm.block.decorative
import net.minecraft.core.BlockPos
import net.minecraft.world.InteractionHand
import net.minecraft.world.InteractionResult
import net.minecraft.world.ItemInteractionResult
import net.minecraft.world.entity.player.Player
import net.minecraft.world.item.ItemStack
@ -20,7 +19,7 @@ import net.neoforged.neoforge.fluids.FluidUtil
import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
import ru.dbotthepony.mc.otm.block.entity.decorative.PainterBlockEntity
import ru.dbotthepony.mc.otm.block.getShapeForEachState
import ru.dbotthepony.mc.otm.core.get
import ru.dbotthepony.mc.otm.util.get
import ru.dbotthepony.mc.otm.shapes.BlockShapes
class PainterBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock {

View File

@ -14,10 +14,10 @@ import net.minecraft.world.phys.shapes.VoxelShape
import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
import ru.dbotthepony.mc.otm.block.addSimpleDescription
import ru.dbotthepony.mc.otm.block.getShapeForEachState
import ru.dbotthepony.mc.otm.core.AABB
import ru.dbotthepony.mc.otm.core.get
import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.core.math.plus
import ru.dbotthepony.mc.otm.util.AABB
import ru.dbotthepony.mc.otm.util.get
import ru.dbotthepony.mc.otm.util.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.util.math.plus
import ru.dbotthepony.mc.otm.entity.RideableDummy
import ru.dbotthepony.mc.otm.shapes.BlockShapes

View File

@ -16,9 +16,8 @@ import net.minecraft.world.level.block.DoorBlock
import net.minecraft.world.level.block.state.BlockState
import net.minecraft.world.level.block.state.properties.BlockSetType
import net.minecraft.world.level.material.PushReaction
import ru.dbotthepony.mc.otm.core.TooltipList
import ru.dbotthepony.mc.otm.core.TranslatableComponent
import ru.dbotthepony.mc.otm.core.collect.iteratorOf
import ru.dbotthepony.mc.otm.util.TooltipList
import ru.dbotthepony.mc.otm.util.TranslatableComponent
import java.util.*
import kotlin.jvm.optionals.getOrNull

View File

@ -14,14 +14,13 @@ import net.minecraft.world.level.Level
import net.minecraft.world.level.block.BasePressurePlateBlock
import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.SoundType
import net.minecraft.world.level.block.state.BlockBehaviour
import net.minecraft.world.level.block.state.BlockState
import net.minecraft.world.level.block.state.StateDefinition
import net.minecraft.world.level.block.state.properties.BlockSetType
import net.minecraft.world.level.block.state.properties.BlockStateProperties
import ru.dbotthepony.mc.otm.core.TooltipList
import ru.dbotthepony.mc.otm.core.TranslatableComponent
import ru.dbotthepony.mc.otm.core.get
import ru.dbotthepony.mc.otm.util.TooltipList
import ru.dbotthepony.mc.otm.util.TranslatableComponent
import ru.dbotthepony.mc.otm.util.get
import java.util.Optional
import kotlin.jvm.optionals.getOrNull

View File

@ -16,9 +16,8 @@ import net.minecraft.world.level.BlockGetter
import net.minecraft.world.level.block.TrapDoorBlock
import net.minecraft.world.level.block.state.BlockState
import net.minecraft.world.level.block.state.properties.BlockSetType
import ru.dbotthepony.mc.otm.core.TooltipList
import ru.dbotthepony.mc.otm.core.TranslatableComponent
import ru.dbotthepony.mc.otm.core.collect.iteratorOf
import ru.dbotthepony.mc.otm.util.TooltipList
import ru.dbotthepony.mc.otm.util.TranslatableComponent
import java.util.*
import kotlin.jvm.optionals.getOrNull

View File

@ -16,7 +16,7 @@ import net.neoforged.neoforge.fluids.FluidStack
import net.neoforged.neoforge.fluids.capability.IFluidHandler
import ru.dbotthepony.mc.otm.block.INeighbourChangeListener
import ru.dbotthepony.mc.otm.block.entity.tech.EssenceStorageBlockEntity
import ru.dbotthepony.mc.otm.core.math.plus
import ru.dbotthepony.mc.otm.util.math.plus
import ru.dbotthepony.mc.otm.registry.game.MFluids
import java.util.function.DoubleSupplier

View File

@ -12,11 +12,11 @@ import org.apache.logging.log4j.LogManager
import ru.dbotthepony.mc.otm.capability.IMatteryUpgrade
import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage
import ru.dbotthepony.mc.otm.config.MachinesConfig
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.core.math.weakEqualDoubles
import ru.dbotthepony.mc.otm.core.math.weakGreaterThan
import ru.dbotthepony.mc.otm.core.math.weakLessThan
import ru.dbotthepony.mc.otm.core.nbt.set
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.util.math.weakEqualDoubles
import ru.dbotthepony.mc.otm.util.math.weakGreaterThan
import ru.dbotthepony.mc.otm.util.math.weakLessThan
import ru.dbotthepony.mc.otm.util.set
import ru.dbotthepony.mc.otm.data.codec.DecimalCodec
private fun isReason(status: Any?, reason: Any) = status == null || status == reason

View File

@ -44,15 +44,15 @@ import ru.dbotthepony.mc.otm.block.INeighbourChangeListener
import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
import ru.dbotthepony.mc.otm.capability.MatteryCapability
import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage
import ru.dbotthepony.mc.otm.core.collect.WeakHashSet
import ru.dbotthepony.mc.otm.core.get
import ru.dbotthepony.mc.otm.core.math.BlockRotation
import ru.dbotthepony.mc.otm.core.math.RelativeSide
import ru.dbotthepony.mc.otm.core.math.plus
import ru.dbotthepony.mc.otm.core.util.IntCounter
import ru.dbotthepony.mc.otm.core.util.Savetables
import ru.dbotthepony.mc.otm.core.util.TickList
import ru.dbotthepony.mc.otm.core.util.countingLazy
import ru.dbotthepony.mc.otm.util.collect.WeakHashSet
import ru.dbotthepony.mc.otm.util.get
import ru.dbotthepony.mc.otm.util.math.BlockRotation
import ru.dbotthepony.mc.otm.util.math.RelativeSide
import ru.dbotthepony.mc.otm.util.math.plus
import ru.dbotthepony.mc.otm.util.IntCounter
import ru.dbotthepony.mc.otm.util.Savetables
import ru.dbotthepony.mc.otm.util.TickList
import ru.dbotthepony.mc.otm.util.countingLazy
import ru.dbotthepony.mc.otm.network.BlockEntitySyncPacket
import ru.dbotthepony.mc.otm.network.syncher.SynchableGroup
import ru.dbotthepony.mc.otm.once
@ -358,6 +358,9 @@ abstract class MatteryBlockEntity(type: BlockEntityType<*>, pos: BlockPos, state
}
override fun get(): T? {
if (isRemoved)
return null
return cache?.capability
}
@ -371,13 +374,13 @@ abstract class MatteryBlockEntity(type: BlockEntityType<*>, pos: BlockPos, state
if (!SERVER_IS_LIVE) return
val level = level as? ServerLevel
val creationVersion = ++currentVersion
if (level == null) {
cache = null
return
}
val creationVersion = ++currentVersion
val direction = blockRotation.side2Dir(side)
cache = BlockCapabilityCache.create(

View File

@ -4,9 +4,7 @@ import com.google.common.collect.ImmutableSet
import net.minecraft.core.BlockPos
import net.minecraft.core.HolderLookup
import net.minecraft.nbt.CompoundTag
import net.minecraft.nbt.NbtOps
import net.minecraft.network.chat.Component
import net.minecraft.network.chat.ComponentSerialization
import net.minecraft.server.level.ServerLevel
import net.minecraft.world.MenuProvider
import net.minecraft.world.entity.player.Inventory
@ -32,15 +30,13 @@ import ru.dbotthepony.mc.otm.capability.item.UnmodifiableItemHandler
import ru.dbotthepony.mc.otm.capability.moveBetweenSlots
import ru.dbotthepony.mc.otm.capability.moveEnergy
import ru.dbotthepony.mc.otm.capability.moveFluid
import ru.dbotthepony.mc.otm.core.TextComponent
import ru.dbotthepony.mc.otm.core.getValue
import ru.dbotthepony.mc.otm.core.immutableMap
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.core.math.RelativeSide
import ru.dbotthepony.mc.otm.core.nbt.set
import ru.dbotthepony.mc.otm.core.util.ITickable
import ru.dbotthepony.mc.otm.util.TextComponent
import ru.dbotthepony.mc.otm.util.getValue
import ru.dbotthepony.kommons.guava.immutableMap
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.util.math.RelativeSide
import ru.dbotthepony.mc.otm.util.ITickable
import ru.dbotthepony.mc.otm.once
import kotlin.jvm.optionals.getOrNull
/**
* Device block entity base, implementing [MenuProvider] and [IRedstoneControlled], and also tracks custom display name

View File

@ -8,7 +8,7 @@ import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage
import ru.dbotthepony.mc.otm.capability.extractEnergy
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.util.math.Decimal
abstract class MatteryPoweredBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: BlockPos, p_155230_: BlockState) : MatteryDeviceBlockEntity(p_155228_, p_155229_, p_155230_) {
val batteryContainer = SlottedContainer.simple(1, AutomationFilters.DISCHARGABLE.filteredProvider, ::markDirtyFast).also(::addDroppableContainer)

View File

@ -6,23 +6,17 @@ import net.minecraft.core.BlockPos
import net.minecraft.core.HolderLookup
import net.minecraft.nbt.CompoundTag
import net.minecraft.nbt.ListTag
import net.minecraft.network.chat.Component
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.TooltipFlag
import net.minecraft.world.level.BlockGetter
import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.entity.BlockEntityType
import net.minecraft.world.level.block.state.BlockState
import org.apache.logging.log4j.LogManager
import ru.dbotthepony.kommons.guava.immutableList
import ru.dbotthepony.mc.otm.capability.IMatteryUpgrade
import ru.dbotthepony.mc.otm.capability.UpgradeType
import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
import ru.dbotthepony.mc.otm.container.UpgradeContainer
import ru.dbotthepony.mc.otm.core.immutableList
import ru.dbotthepony.mc.otm.core.nbt.getCompoundList
import ru.dbotthepony.mc.otm.core.nbt.set
import ru.dbotthepony.mc.otm.core.util.countingLazy
import ru.dbotthepony.mc.otm.util.getCompoundList
import ru.dbotthepony.mc.otm.util.set
import ru.dbotthepony.mc.otm.util.countingLazy
/**
* Simple machine, which can work on only one job type.

View File

@ -6,9 +6,9 @@ import net.minecraft.world.level.block.Blocks
import net.minecraft.world.level.block.entity.FurnaceBlockEntity
import net.minecraft.world.level.block.entity.HopperBlockEntity
import net.minecraft.world.level.block.state.BlockState
import ru.dbotthepony.mc.otm.core.multiblock.MultiblockStatus
import ru.dbotthepony.mc.otm.core.multiblock.multiblockEntity
import ru.dbotthepony.mc.otm.core.multiblock.shapedMultiblock
import ru.dbotthepony.mc.otm.multiblock.MultiblockStatus
import ru.dbotthepony.mc.otm.multiblock.multiblockEntity
import ru.dbotthepony.mc.otm.multiblock.shapedMultiblock
import ru.dbotthepony.mc.otm.registry.game.MBlockEntities
import ru.dbotthepony.mc.otm.registry.game.MBlocks

View File

@ -7,8 +7,8 @@ import ru.dbotthepony.mc.otm.network.syncher.SynchableGroup
import ru.dbotthepony.kommons.util.Listenable
import ru.dbotthepony.kommons.util.getValue
import ru.dbotthepony.kommons.util.setValue
import ru.dbotthepony.mc.otm.core.nbt.mapString
import ru.dbotthepony.mc.otm.core.nbt.set
import ru.dbotthepony.mc.otm.util.mapString
import ru.dbotthepony.mc.otm.util.set
import java.util.function.Consumer
interface IRedstoneControlled {

View File

@ -1,7 +1,7 @@
package ru.dbotthepony.mc.otm.block.entity
import net.minecraft.network.chat.Component
import ru.dbotthepony.mc.otm.core.TranslatableComponent
import ru.dbotthepony.mc.otm.util.TranslatableComponent
import java.util.function.IntPredicate
import java.util.function.Predicate

View File

@ -22,9 +22,9 @@ import net.minecraft.world.level.block.state.BlockState
import net.minecraft.world.level.levelgen.structure.BoundingBox
import net.minecraft.world.phys.AABB
import net.minecraft.world.phys.Vec3
import net.neoforged.api.distmarker.Dist
import net.neoforged.api.distmarker.OnlyIn
import net.neoforged.neoforge.common.Tags
import ru.dbotthepony.kommons.collect.addAll
import ru.dbotthepony.kommons.collect.map
import ru.dbotthepony.kommons.util.getValue
import ru.dbotthepony.kommons.util.setValue
import ru.dbotthepony.mc.otm.block.BlackHoleBlock
@ -33,30 +33,25 @@ import ru.dbotthepony.mc.otm.block.entity.MatteryBlockEntity
import ru.dbotthepony.mc.otm.client.minecraft
import ru.dbotthepony.mc.otm.client.sound.BlackHoleAmbientSoundInstance
import ru.dbotthepony.mc.otm.config.ServerConfig
import ru.dbotthepony.mc.otm.core.addAll
import ru.dbotthepony.mc.otm.core.collect.map
import ru.dbotthepony.mc.otm.core.damageType
import ru.dbotthepony.mc.otm.core.getExplosionResistance
import ru.dbotthepony.mc.otm.core.gracefulBlockBreak
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.core.math.plus
import ru.dbotthepony.mc.otm.util.damageType
import ru.dbotthepony.mc.otm.util.getExplosionResistance
import ru.dbotthepony.mc.otm.util.gracefulBlockBreak
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.util.math.plus
import ru.dbotthepony.mc.otm.registry.game.MBlockEntities
import ru.dbotthepony.mc.otm.registry.game.MItems
import ru.dbotthepony.mc.otm.core.math.getSphericalBlockPositions
import ru.dbotthepony.mc.otm.core.math.times
import ru.dbotthepony.mc.otm.core.nbt.map
import ru.dbotthepony.mc.otm.core.nbt.set
import ru.dbotthepony.mc.otm.core.otmRandom
import ru.dbotthepony.mc.otm.isClient
import ru.dbotthepony.mc.otm.util.math.getSphericalBlockPositions
import ru.dbotthepony.mc.otm.util.math.times
import ru.dbotthepony.mc.otm.util.map
import ru.dbotthepony.mc.otm.util.set
import ru.dbotthepony.mc.otm.util.otmRandom
import ru.dbotthepony.mc.otm.matter.MatterManager
import ru.dbotthepony.mc.otm.registry.MDamageTypes
import ru.dbotthepony.mc.otm.registry.MatteryDamageSource
import ru.dbotthepony.mc.otm.runIfClient
import ru.dbotthepony.mc.otm.triggers.BlackHoleTrigger
import kotlin.math.pow
import kotlin.math.roundToInt
import kotlin.math.sqrt
import kotlin.properties.Delegates
class BlackHoleBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : MatteryBlockEntity(MBlockEntities.BLACK_HOLE, p_155229_, p_155230_) {
var mass by syncher.decimal(ServerConfig.Blackhole.BASELINE_MASS, setter = setter@{ field, mass ->

View File

@ -9,6 +9,7 @@ import net.minecraft.world.entity.player.Player
import net.minecraft.world.inventory.AbstractContainerMenu
import net.minecraft.world.level.block.state.BlockState
import net.neoforged.neoforge.capabilities.Capabilities
import ru.dbotthepony.kommons.collect.map
import ru.dbotthepony.kommons.collect.toList
import ru.dbotthepony.kommons.util.DelegateSetter
import ru.dbotthepony.kommons.util.getValue
@ -23,19 +24,18 @@ import ru.dbotthepony.mc.otm.capability.energy.CombinedProfiledEnergyStorage
import ru.dbotthepony.mc.otm.capability.matter.CombinedProfiledMatterStorage
import ru.dbotthepony.mc.otm.config.MachinesConfig
import ru.dbotthepony.mc.otm.config.ServerConfig
import ru.dbotthepony.mc.otm.core.TranslatableComponent
import ru.dbotthepony.mc.otm.core.collect.map
import ru.dbotthepony.mc.otm.core.multiblock.ShapedMultiblock
import ru.dbotthepony.mc.otm.core.getBlockStateNow
import ru.dbotthepony.mc.otm.core.immutableList
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.core.math.plus
import ru.dbotthepony.mc.otm.core.math.times
import ru.dbotthepony.mc.otm.core.multiblock.BlockEntityTag
import ru.dbotthepony.mc.otm.core.multiblock.MultiblockStatus
import ru.dbotthepony.mc.otm.core.multiblock.shapedMultiblock
import ru.dbotthepony.mc.otm.core.otmRandom
import ru.dbotthepony.mc.otm.core.util.InvalidableLazy
import ru.dbotthepony.mc.otm.util.TranslatableComponent
import ru.dbotthepony.mc.otm.multiblock.ShapedMultiblock
import ru.dbotthepony.mc.otm.util.getBlockStateNow
import ru.dbotthepony.kommons.guava.immutableList
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.util.math.plus
import ru.dbotthepony.mc.otm.util.math.times
import ru.dbotthepony.mc.otm.multiblock.BlockEntityTag
import ru.dbotthepony.mc.otm.multiblock.MultiblockStatus
import ru.dbotthepony.mc.otm.multiblock.shapedMultiblock
import ru.dbotthepony.mc.otm.util.otmRandom
import ru.dbotthepony.mc.otm.util.InvalidableLazy
import ru.dbotthepony.mc.otm.menu.tech.BlackHoleGeneratorMenu
import ru.dbotthepony.mc.otm.registry.game.MBlockEntities
import ru.dbotthepony.mc.otm.registry.MBlockTags

View File

@ -1,5 +1,6 @@
package ru.dbotthepony.mc.otm.block.entity.cable
import it.unimi.dsi.fastutil.objects.ObjectArraySet
import net.minecraft.core.BlockPos
import net.minecraft.core.Direction
import net.minecraft.world.level.Level
@ -15,13 +16,13 @@ import ru.dbotthepony.mc.otm.capability.FlowDirection
import ru.dbotthepony.mc.otm.capability.MatteryCapability
import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage
import ru.dbotthepony.mc.otm.config.CablesConfig
import ru.dbotthepony.mc.otm.core.get
import ru.dbotthepony.mc.otm.core.math.BlockRotation
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.core.math.RelativeSide
import ru.dbotthepony.mc.otm.core.set
import ru.dbotthepony.mc.otm.core.util.TickList
import ru.dbotthepony.mc.otm.core.util.countingLazy
import ru.dbotthepony.mc.otm.util.get
import ru.dbotthepony.mc.otm.util.math.BlockRotation
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.util.math.RelativeSide
import ru.dbotthepony.mc.otm.util.set
import ru.dbotthepony.mc.otm.util.TickList
import ru.dbotthepony.mc.otm.util.countingLazy
import ru.dbotthepony.mc.otm.graph.GraphNode
import ru.dbotthepony.mc.otm.once
import ru.dbotthepony.mc.otm.onceServer
@ -114,6 +115,8 @@ abstract class EnergyCableBlockEntity(type: BlockEntityType<*>, blockPos: BlockP
val sides get() = energySides
val currentlyTransferringTo = ObjectArraySet<Pair<Node, RelativeSide>>()
override fun onNeighbour(link: Link) {
if (link is DirectionLink) {
updateBlockState(link.direction, true)

View File

@ -1,21 +1,20 @@
package ru.dbotthepony.mc.otm.block.entity.cable
import it.unimi.dsi.fastutil.ints.IntRBTreeSet
import it.unimi.dsi.fastutil.objects.Reference2ObjectOpenHashMap
import it.unimi.dsi.fastutil.objects.ReferenceArraySet
import it.unimi.dsi.fastutil.objects.ReferenceLinkedOpenHashSet
import net.minecraft.core.Direction
import org.apache.logging.log4j.LogManager
import ru.dbotthepony.mc.otm.SERVER_IS_LIVE
import ru.dbotthepony.mc.otm.UNIVERSE_TICKS
import ru.dbotthepony.mc.otm.capability.receiveEnergy
import ru.dbotthepony.mc.otm.config.CablesConfig
import ru.dbotthepony.mc.otm.core.addAll
import ru.dbotthepony.mc.otm.core.collect.map
import ru.dbotthepony.mc.otm.core.collect.reduce
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.core.math.RelativeSide
import ru.dbotthepony.mc.otm.core.otmRandom
import ru.dbotthepony.mc.otm.core.shuffle
import ru.dbotthepony.kommons.collect.map
import ru.dbotthepony.kommons.collect.reduce
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.util.math.RelativeSide
import ru.dbotthepony.mc.otm.util.otmRandom
import ru.dbotthepony.mc.otm.util.shuffle
import ru.dbotthepony.mc.otm.graph.GraphNodeList
import ru.dbotthepony.mc.otm.onceServer
import java.util.*
@ -626,108 +625,138 @@ class EnergyCableGraph : GraphNodeList<EnergyCableBlockEntity.Node, EnergyCableG
notifyThroughputsChanged()
}
fun receiveEnergy(howMuch: Decimal, simulate: Boolean, fromNode: EnergyCableBlockEntity.Node, fromSide: RelativeSide): Decimal {
livelyNodesList.shuffle(fromNode.blockEntity.level!!.otmRandom)
private val indicesToRemove = IntRBTreeSet()
private var recursionLevel = 0
fun receiveEnergy(howMuch: Decimal, simulate: Boolean, fromNode: EnergyCableBlockEntity.Node, fromSide: RelativeSide): Decimal {
val thisLevel = ++recursionLevel
val isMaster = thisLevel == 1
if (isMaster)
livelyNodesList.shuffle(fromNode.blockEntity.level!!.otmRandom)
var i = -1
val itr = livelyNodesList.iterator()
var received = Decimal.ZERO
var residue = howMuch.coerceAtMost(fromNode.energyThroughput)
val snapshot = Reference2ObjectOpenHashMap<Segment, Decimal>()
for (pair in itr) {
val (node, relSide) = pair
val side = node.sides[relSide]!!
i++
if (!side.isEnabled) {
itr.remove()
check(livelyNodes.remove(pair)) { "Lively nodes Set does not contain $pair" }
// recursion prevention
if (!fromNode.currentlyTransferringTo.add(pair))
continue
} else if (fromNode === node && side.side === fromSide) {
continue
}
val it = side.neighbour.get()
try {
val (node, relSide) = pair
val side = node.sides[relSide]!!
if (it == null || it is EnergyCableBlockEntity.CableSide) {
itr.remove()
check(livelyNodes.remove(pair)) { "Lively nodes Set does not contain $pair" }
continue
}
val paths = getPath(fromNode, node, it.receiveEnergy(residue, true), !simulate)
if (paths.size == 1) {
// Single path, fast scenario
val path = paths[0]
val pathTransferred = path.transfer(residue, simulate, snapshot)
if (pathTransferred <= Decimal.ZERO) continue
val thisReceived = it.receiveEnergy(pathTransferred, simulate)
// If cable transferred more than machine accepted, then "refund" energy
// so cables record actual value transferred through them
if (thisReceived != pathTransferred) {
path.refund(pathTransferred - thisReceived, simulate, snapshot)
if (!simulate && thisReceived != Decimal.ZERO) {
path.triggerBlockstateUpdates()
}
} else if (!simulate) {
path.triggerBlockstateUpdates()
}
received += thisReceived
residue -= thisReceived
if (!residue.isPositive) return received
} else if (paths.size >= 2) {
// Multiple paths, a bit more complicated
// Determine how much machine is likely to accept
val potentiallyAccepted = it.receiveEnergy(residue, true)
// Won't accept anything
if (potentiallyAccepted <= Decimal.ZERO) continue
// Now determine combined available throughput
// Make a copy of snapshot, so we can freely write into it
val copy = snapshot.clone()
var calcResidue = potentiallyAccepted
// TODO: Currently, all transfers cause Braess's paradox, because of greedy selection of "fastest" cable
// Need to implement heuristics to better distribute load across different paths/segments
for (path in paths) {
val passed = path.transfer(calcResidue, true, copy)
calcResidue -= passed
if (calcResidue <= Decimal.ZERO) break
}
if (calcResidue == potentiallyAccepted) {
// мда
if (!side.isEnabled) {
indicesToRemove.add(i)
livelyNodes.remove(pair)
continue
} else if (fromNode === node && side.side === fromSide) {
continue
}
var thisReceived = it.receiveEnergy(potentiallyAccepted - calcResidue, simulate)
received += thisReceived
residue -= thisReceived
val it = side.neighbour.get()
for (path in paths) {
val passed = path.transfer(thisReceived, simulate, snapshot)
if (it == null || it is EnergyCableBlockEntity.CableSide) {
indicesToRemove.add(i)
livelyNodes.remove(pair)
continue
}
if (!simulate)
val paths = getPath(fromNode, node, it.receiveEnergy(residue, true), !simulate)
if (paths.size == 1) {
// Single path, fast scenario
val path = paths[0]
val pathTransferred = path.transfer(residue, simulate, snapshot)
if (pathTransferred <= Decimal.ZERO) continue
val thisReceived = it.receiveEnergy(pathTransferred, simulate)
// If cable transferred more than machine accepted, then "refund" energy
// so cables record actual value transferred through them
if (thisReceived != pathTransferred) {
path.refund(pathTransferred - thisReceived, simulate, snapshot)
if (!simulate && thisReceived != Decimal.ZERO) {
path.triggerBlockstateUpdates()
}
} else if (!simulate) {
path.triggerBlockstateUpdates()
}
thisReceived -= passed
if (thisReceived <= Decimal.ZERO) break
}
if (!residue.isPositive) return received
//check(thisReceived <= Decimal.ZERO) { "Путом, алло, Путом, какого чёрта Путом? Путом почему ты заблокировал логику, а Путом?" }
if (thisReceived > Decimal.ZERO) {
LOGGER.warn("Cable path from $fromNode to $node doesn't follow common sense, disabling.")
paths.forEach { it.shortCircuit = true }
received += thisReceived
residue -= thisReceived
if (!residue.isPositive) return received
} else if (paths.size >= 2) {
// Multiple paths, a bit more complicated
// Determine how much machine is likely to accept
val potentiallyAccepted = it.receiveEnergy(residue, true)
// Won't accept anything
if (potentiallyAccepted <= Decimal.ZERO) continue
// Now determine combined available throughput
// Make a copy of snapshot, so we can freely write into it
val copy = snapshot.clone()
var calcResidue = potentiallyAccepted
// TODO: Currently, all transfers cause Braess's paradox, because of greedy selection of "fastest" cable
// Need to implement heuristics to better distribute load across different paths/segments
for (path in paths) {
val passed = path.transfer(calcResidue, true, copy)
calcResidue -= passed
if (calcResidue <= Decimal.ZERO) break
}
if (calcResidue == potentiallyAccepted) {
// мда
continue
}
var thisReceived = it.receiveEnergy(potentiallyAccepted - calcResidue, simulate)
received += thisReceived
residue -= thisReceived
for (path in paths) {
val passed = path.transfer(thisReceived, simulate, snapshot)
if (!simulate)
path.triggerBlockstateUpdates()
thisReceived -= passed
if (thisReceived <= Decimal.ZERO) break
}
if (!residue.isPositive) return received
//check(thisReceived <= Decimal.ZERO) { "Путом, алло, Путом, какого чёрта Путом? Путом почему ты заблокировал логику, а Путом?" }
if (thisReceived > Decimal.ZERO) {
LOGGER.warn("Cable path from $fromNode to $node doesn't follow common sense, disabling.")
paths.forEach { it.shortCircuit = true }
}
}
} finally {
fromNode.currentlyTransferringTo.remove(pair)
}
}
recursionLevel--
if (isMaster && indicesToRemove.isNotEmpty()) {
val indices = indicesToRemove.iterator(indicesToRemove.lastInt())
while (indices.hasPrevious()) {
livelyNodesList.removeAt(indices.previousInt())
}
indicesToRemove.clear()
}
return received
}

View File

@ -5,7 +5,7 @@ import net.minecraft.core.HolderLookup
import net.minecraft.nbt.CompoundTag
import net.minecraft.world.level.block.state.BlockState
import ru.dbotthepony.mc.otm.block.entity.MatteryBlockEntity
import ru.dbotthepony.mc.otm.core.util.BlockLootTableHolder
import ru.dbotthepony.mc.otm.util.BlockLootTableHolder
import ru.dbotthepony.mc.otm.registry.game.MBlockEntities
class BreakableContainerBlockEntity(blockPos: BlockPos, blockState: BlockState) : MatteryBlockEntity(MBlockEntities.BREAKABLE, blockPos, blockState) {

View File

@ -21,10 +21,10 @@ import ru.dbotthepony.mc.otm.capability.IQuickStackContainer
import ru.dbotthepony.mc.otm.capability.MatteryCapability
import ru.dbotthepony.mc.otm.container.slotted.FilteredContainerSlot
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
import ru.dbotthepony.mc.otm.core.TranslatableComponent
import ru.dbotthepony.mc.otm.core.otmRandom
import ru.dbotthepony.mc.otm.util.TranslatableComponent
import ru.dbotthepony.mc.otm.util.otmRandom
import ru.dbotthepony.mc.otm.menu.MatteryMenuSlot
import ru.dbotthepony.mc.otm.core.util.BlockLootTableHolder
import ru.dbotthepony.mc.otm.util.BlockLootTableHolder
import ru.dbotthepony.mc.otm.menu.decorative.CargoCrateMenu
import ru.dbotthepony.mc.otm.menu.makeSlots
import ru.dbotthepony.mc.otm.registry.game.MBlockEntities

View File

@ -14,18 +14,15 @@ import net.neoforged.neoforge.fluids.capability.IFluidHandler
import org.apache.logging.log4j.LogManager
import ru.dbotthepony.kommons.util.ListenableDelegate
import ru.dbotthepony.mc.otm.block.entity.MatteryDeviceBlockEntity
import ru.dbotthepony.mc.otm.capability.item.CombinedItemHandler
import ru.dbotthepony.mc.otm.capability.fluid.BlockMatteryFluidHandler
import ru.dbotthepony.mc.otm.capability.moveFluid
import ru.dbotthepony.mc.otm.config.ItemsConfig
import ru.dbotthepony.mc.otm.container.get
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilter
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
import ru.dbotthepony.mc.otm.container.slotted.ContainerSlot
import ru.dbotthepony.mc.otm.container.slotted.FilteredContainerSlot
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
import ru.dbotthepony.mc.otm.core.isNotEmpty
import ru.dbotthepony.mc.otm.core.isNotSameAs
import ru.dbotthepony.mc.otm.util.isNotEmpty
import ru.dbotthepony.mc.otm.util.isNotSameAs
import ru.dbotthepony.mc.otm.menu.decorative.FluidTankMenu
import ru.dbotthepony.mc.otm.network.wrap
import ru.dbotthepony.mc.otm.registry.game.MBlockEntities

View File

@ -20,24 +20,22 @@ import net.minecraft.world.item.crafting.SmokingRecipe
import net.minecraft.world.level.block.Block
import net.minecraft.world.level.block.state.BlockState
import ru.dbotthepony.kommons.util.Delegate
import ru.dbotthepony.kommons.util.KOptional
import ru.dbotthepony.mc.otm.block.IBlockWithCustomName
import ru.dbotthepony.mc.otm.block.decorative.GrillBlock
import ru.dbotthepony.mc.otm.block.entity.ExperienceStorage
import ru.dbotthepony.mc.otm.block.entity.MatteryBlockEntity
import ru.dbotthepony.mc.otm.config.MachinesConfig
import ru.dbotthepony.mc.otm.container.set
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
import ru.dbotthepony.mc.otm.container.slotted.ContainerSlot
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
import ru.dbotthepony.mc.otm.core.TextComponent
import ru.dbotthepony.mc.otm.core.get
import ru.dbotthepony.mc.otm.core.isNotEmpty
import ru.dbotthepony.mc.otm.core.math.component1
import ru.dbotthepony.mc.otm.core.math.component2
import ru.dbotthepony.mc.otm.core.math.component3
import ru.dbotthepony.mc.otm.core.set
import ru.dbotthepony.mc.otm.core.util.countingLazy
import ru.dbotthepony.mc.otm.util.TextComponent
import ru.dbotthepony.mc.otm.util.get
import ru.dbotthepony.mc.otm.util.isNotEmpty
import ru.dbotthepony.mc.otm.util.math.component1
import ru.dbotthepony.mc.otm.util.math.component2
import ru.dbotthepony.mc.otm.util.math.component3
import ru.dbotthepony.mc.otm.util.set
import ru.dbotthepony.mc.otm.util.countingLazy
import ru.dbotthepony.mc.otm.data.codec.minRange
import ru.dbotthepony.mc.otm.menu.decorative.GrillMenu
import ru.dbotthepony.mc.otm.registry.game.MBlockEntities

View File

@ -18,9 +18,9 @@ import ru.dbotthepony.mc.otm.block.entity.IRedstoneControlled
import ru.dbotthepony.mc.otm.block.entity.MatteryBlockEntity
import ru.dbotthepony.mc.otm.block.entity.SynchronizedRedstoneControl
import ru.dbotthepony.mc.otm.client.minecraft
import ru.dbotthepony.mc.otm.core.math.component1
import ru.dbotthepony.mc.otm.core.math.component2
import ru.dbotthepony.mc.otm.core.math.component3
import ru.dbotthepony.mc.otm.util.math.component1
import ru.dbotthepony.mc.otm.util.math.component2
import ru.dbotthepony.mc.otm.util.math.component3
import ru.dbotthepony.mc.otm.menu.decorative.HoloSignMenu
import ru.dbotthepony.mc.otm.once
import ru.dbotthepony.mc.otm.registry.game.MBlockEntities

View File

@ -7,7 +7,7 @@ import net.neoforged.neoforge.capabilities.Capabilities
import net.neoforged.neoforge.fluids.FluidStack
import net.neoforged.neoforge.fluids.capability.IFluidHandler
import ru.dbotthepony.mc.otm.block.entity.MatteryBlockEntity
import ru.dbotthepony.mc.otm.core.math.RelativeSide
import ru.dbotthepony.mc.otm.util.math.RelativeSide
import ru.dbotthepony.mc.otm.registry.game.MBlockEntities
import java.util.function.Consumer

View File

@ -20,11 +20,11 @@ import net.neoforged.neoforge.fluids.capability.IFluidHandler
import ru.dbotthepony.mc.otm.block.entity.MatteryDeviceBlockEntity
import ru.dbotthepony.mc.otm.container.slotted.ContainerSlot
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
import ru.dbotthepony.mc.otm.core.immutableList
import ru.dbotthepony.mc.otm.core.immutableMap
import ru.dbotthepony.mc.otm.core.isNotEmpty
import ru.dbotthepony.mc.otm.core.nbt.mapPresent
import ru.dbotthepony.mc.otm.core.nbt.set
import ru.dbotthepony.kommons.guava.immutableList
import ru.dbotthepony.kommons.guava.immutableMap
import ru.dbotthepony.mc.otm.util.isNotEmpty
import ru.dbotthepony.mc.otm.util.mapPresent
import ru.dbotthepony.mc.otm.util.set
import ru.dbotthepony.mc.otm.menu.decorative.PainterMenu
import ru.dbotthepony.mc.otm.registry.game.MBlockEntities
import java.util.*

View File

@ -26,8 +26,8 @@ import ru.dbotthepony.mc.otm.container.slotted.FilteredContainerSlot
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
import ru.dbotthepony.mc.otm.menu.matter.MatterBottlerMenu
import ru.dbotthepony.mc.otm.registry.game.MBlockEntities
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.core.util.countingLazy
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.util.countingLazy
import ru.dbotthepony.mc.otm.graph.matter.SimpleMatterNode
import java.util.function.BooleanSupplier

View File

@ -18,8 +18,8 @@ import ru.dbotthepony.mc.otm.capability.matter.IMatterStorage
import ru.dbotthepony.mc.otm.capability.matter.ProfiledMatterStorage
import ru.dbotthepony.mc.otm.container.slotted.ContainerSlot
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
import ru.dbotthepony.mc.otm.core.immutableList
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.kommons.guava.immutableList
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.graph.matter.SimpleMatterNode
import ru.dbotthepony.mc.otm.menu.matter.MatterCapacitorBankMenu
import ru.dbotthepony.mc.otm.registry.game.MBlockEntities

View File

@ -22,11 +22,10 @@ import ru.dbotthepony.mc.otm.capability.matter.MatterStorageImpl
import ru.dbotthepony.mc.otm.capability.matter.ProfiledMatterStorage
import ru.dbotthepony.mc.otm.config.MachinesConfig
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
import ru.dbotthepony.mc.otm.container.slotted.ContainerSlot
import ru.dbotthepony.mc.otm.container.slotted.FilteredContainerSlot
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.core.otmRandom
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.util.otmRandom
import ru.dbotthepony.mc.otm.data.codec.DecimalCodec
import ru.dbotthepony.mc.otm.data.codec.minRange
import ru.dbotthepony.mc.otm.graph.matter.SimpleMatterNode

View File

@ -29,12 +29,12 @@ import ru.dbotthepony.mc.otm.container.IEnhancedCraftingContainer
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
import ru.dbotthepony.mc.otm.container.slotted.FilteredContainerSlot
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
import ru.dbotthepony.mc.otm.core.SimpleCache
import ru.dbotthepony.mc.otm.core.collect.filter
import ru.dbotthepony.mc.otm.core.collect.forEach
import ru.dbotthepony.mc.otm.core.collect.map
import ru.dbotthepony.mc.otm.core.collect.toList
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.util.SimpleCache
import ru.dbotthepony.kommons.collect.filter
import ru.dbotthepony.kommons.collect.forEach
import ru.dbotthepony.kommons.collect.map
import ru.dbotthepony.kommons.collect.toList
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.container.ItemStackKey
import ru.dbotthepony.mc.otm.container.asKey
import ru.dbotthepony.mc.otm.data.codec.DecimalCodec

View File

@ -17,11 +17,11 @@ import ru.dbotthepony.mc.otm.capability.matter.IReplicationTaskProvider
import ru.dbotthepony.mc.otm.capability.matter.PatternState
import ru.dbotthepony.mc.otm.capability.matter.ReplicationTask
import ru.dbotthepony.mc.otm.capability.matter.ReplicationTaskAllocation
import ru.dbotthepony.mc.otm.core.collect.WeakHashSet
import ru.dbotthepony.mc.otm.core.nbt.getCompoundList
import ru.dbotthepony.mc.otm.core.nbt.map
import ru.dbotthepony.mc.otm.core.nbt.set
import ru.dbotthepony.mc.otm.core.util.ItemSorter
import ru.dbotthepony.mc.otm.util.collect.WeakHashSet
import ru.dbotthepony.mc.otm.util.getCompoundList
import ru.dbotthepony.mc.otm.util.map
import ru.dbotthepony.mc.otm.util.set
import ru.dbotthepony.mc.otm.util.ItemSorter
import ru.dbotthepony.mc.otm.graph.matter.SimpleMatterNode
import ru.dbotthepony.mc.otm.menu.IItemSortingSettings
import ru.dbotthepony.mc.otm.menu.matter.MatterPanelMenu

View File

@ -27,9 +27,9 @@ import ru.dbotthepony.mc.otm.config.MachinesConfig
import ru.dbotthepony.mc.otm.container.UpgradeContainer
import ru.dbotthepony.mc.otm.container.slotted.FilteredContainerSlot
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.core.otmRandom
import ru.dbotthepony.mc.otm.core.registryName
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.util.otmRandom
import ru.dbotthepony.mc.otm.util.registryName
import ru.dbotthepony.mc.otm.graph.matter.MatterNode
import ru.dbotthepony.mc.otm.matter.IMatterValue
import ru.dbotthepony.mc.otm.matter.MatterManager

View File

@ -23,9 +23,9 @@ import ru.dbotthepony.mc.otm.capability.matter.ProfiledMatterStorage
import ru.dbotthepony.mc.otm.config.MachinesConfig
import ru.dbotthepony.mc.otm.container.slotted.ContainerSlot
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.core.nextDecimal
import ru.dbotthepony.mc.otm.core.otmRandom
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.util.nextDecimal
import ru.dbotthepony.mc.otm.util.otmRandom
import ru.dbotthepony.mc.otm.graph.matter.MatterGraph
import ru.dbotthepony.mc.otm.item.matter.MatterDustItem
import ru.dbotthepony.mc.otm.menu.matter.MatterRecyclerMenu

View File

@ -27,8 +27,8 @@ import ru.dbotthepony.mc.otm.capability.matter.*
import ru.dbotthepony.mc.otm.config.MachinesConfig
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.core.otmRandom
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.util.otmRandom
import ru.dbotthepony.mc.otm.data.codec.DecimalCodec
import ru.dbotthepony.mc.otm.data.codec.minRange
import ru.dbotthepony.mc.otm.graph.matter.MatterNode

View File

@ -12,14 +12,13 @@ import net.minecraft.world.inventory.AbstractContainerMenu
import ru.dbotthepony.mc.otm.menu.matter.PatternStorageMenu
import net.minecraft.world.level.Level
import net.minecraft.world.level.block.Block
import ru.dbotthepony.kommons.collect.filterNotNull
import ru.dbotthepony.mc.otm.block.entity.MatteryDeviceBlockEntity
import ru.dbotthepony.mc.otm.capability.matter.*
import ru.dbotthepony.mc.otm.container.slotted.ContainerSlot
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
import ru.dbotthepony.mc.otm.core.collect.filterNotNull
import ru.dbotthepony.mc.otm.core.collect.map
import ru.dbotthepony.mc.otm.core.filterNotNull
import ru.dbotthepony.mc.otm.core.isNotEmpty
import ru.dbotthepony.kommons.collect.map
import ru.dbotthepony.mc.otm.util.isNotEmpty
import ru.dbotthepony.mc.otm.graph.matter.SimpleMatterNode
import ru.dbotthepony.mc.otm.registry.game.MBlockEntities
import java.util.stream.Stream

View File

@ -18,9 +18,9 @@ import ru.dbotthepony.mc.otm.capability.energy.ProfiledEnergyStorage
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
import ru.dbotthepony.mc.otm.config.MachinesConfig
import ru.dbotthepony.mc.otm.container.EnhancedContainer
import ru.dbotthepony.mc.otm.core.get
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.core.util.ItemStorageStackSorter
import ru.dbotthepony.mc.otm.util.get
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.util.ItemStorageStackSorter
import ru.dbotthepony.mc.otm.registry.game.MBlockEntities
import ru.dbotthepony.mc.otm.menu.storage.DriveViewerMenu
import java.util.UUID

View File

@ -32,14 +32,12 @@ import ru.dbotthepony.mc.otm.container.CombinedContainer
import ru.dbotthepony.mc.otm.container.EnhancedContainer
import ru.dbotthepony.mc.otm.container.IEnhancedCraftingContainer
import ru.dbotthepony.mc.otm.container.util.slotIterator
import ru.dbotthepony.mc.otm.core.TranslatableComponent
import ru.dbotthepony.mc.otm.core.collect.map
import ru.dbotthepony.mc.otm.core.collect.toList
import ru.dbotthepony.mc.otm.core.isNotEmpty
import ru.dbotthepony.mc.otm.core.nbt.map
import ru.dbotthepony.mc.otm.core.nbt.mapString
import ru.dbotthepony.mc.otm.core.nbt.set
import ru.dbotthepony.mc.otm.core.util.ItemStorageStackSorter
import ru.dbotthepony.mc.otm.util.TranslatableComponent
import ru.dbotthepony.mc.otm.util.isNotEmpty
import ru.dbotthepony.mc.otm.util.map
import ru.dbotthepony.mc.otm.util.mapString
import ru.dbotthepony.mc.otm.util.set
import ru.dbotthepony.mc.otm.util.ItemStorageStackSorter
import ru.dbotthepony.mc.otm.graph.storage.StorageGraph
import ru.dbotthepony.mc.otm.graph.storage.StorageNode
import ru.dbotthepony.mc.otm.menu.storage.ItemMonitorMenu

View File

@ -24,14 +24,15 @@ import ru.dbotthepony.mc.otm.capability.energy.ProfiledEnergyStorage
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
import ru.dbotthepony.mc.otm.config.MachinesConfig
import ru.dbotthepony.mc.otm.container.ItemFilterSet
import ru.dbotthepony.mc.otm.core.*
import ru.dbotthepony.mc.otm.core.math.RelativeSide
import ru.dbotthepony.mc.otm.core.math.isPositive
import ru.dbotthepony.mc.otm.core.math.toIntSafe
import ru.dbotthepony.mc.otm.util.math.RelativeSide
import ru.dbotthepony.mc.otm.util.math.isPositive
import ru.dbotthepony.mc.otm.util.math.toIntSafe
import ru.dbotthepony.mc.otm.graph.storage.StorageNode
import ru.dbotthepony.mc.otm.menu.storage.StorageBusMenu
import ru.dbotthepony.mc.otm.registry.game.MBlockEntities
import ru.dbotthepony.mc.otm.storage.*
import ru.dbotthepony.mc.otm.util.get
import ru.dbotthepony.mc.otm.util.isNotEmpty
import java.math.BigInteger
import java.util.*
import java.util.function.Consumer

View File

@ -24,9 +24,9 @@ import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
import ru.dbotthepony.mc.otm.config.EnergyBalanceValues
import ru.dbotthepony.mc.otm.config.MachinesConfig
import ru.dbotthepony.mc.otm.container.ItemFilterSet
import ru.dbotthepony.mc.otm.core.TranslatableComponent
import ru.dbotthepony.mc.otm.core.isNotEmpty
import ru.dbotthepony.mc.otm.core.math.RelativeSide
import ru.dbotthepony.mc.otm.util.TranslatableComponent
import ru.dbotthepony.mc.otm.util.isNotEmpty
import ru.dbotthepony.mc.otm.util.math.RelativeSide
import ru.dbotthepony.mc.otm.graph.storage.StorageNode
import ru.dbotthepony.mc.otm.menu.storage.StorageImporterExporterMenu
import ru.dbotthepony.mc.otm.once

View File

@ -11,7 +11,7 @@ import ru.dbotthepony.mc.otm.capability.MatteryCapability
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
import ru.dbotthepony.mc.otm.capability.energy.transferChecked
import ru.dbotthepony.mc.otm.config.MachinesConfig
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.graph.storage.StorageNode
import ru.dbotthepony.mc.otm.menu.storage.StoragePowerSupplierMenu
import ru.dbotthepony.mc.otm.registry.game.MBlockEntities

View File

@ -34,9 +34,9 @@ import ru.dbotthepony.mc.otm.container.balance
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
import ru.dbotthepony.mc.otm.container.slotted.FilteredContainerSlot
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
import ru.dbotthepony.mc.otm.core.SimpleCache
import ru.dbotthepony.mc.otm.core.immutableList
import ru.dbotthepony.mc.otm.core.otmRandom
import ru.dbotthepony.mc.otm.util.SimpleCache
import ru.dbotthepony.kommons.guava.immutableList
import ru.dbotthepony.mc.otm.util.otmRandom
import ru.dbotthepony.mc.otm.container.ItemStackKey
import ru.dbotthepony.mc.otm.container.asKey
import ru.dbotthepony.mc.otm.menu.tech.PoweredFurnaceMenu

View File

@ -16,9 +16,9 @@ import ru.dbotthepony.mc.otm.capability.energy.ProxiedEnergyStorage
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
import ru.dbotthepony.mc.otm.player.matteryPlayer
import ru.dbotthepony.mc.otm.config.MachinesConfig
import ru.dbotthepony.mc.otm.core.getEntitiesInEllipsoid
import ru.dbotthepony.mc.otm.core.otmRandom
import ru.dbotthepony.mc.otm.core.shuffle
import ru.dbotthepony.mc.otm.util.getEntitiesInEllipsoid
import ru.dbotthepony.mc.otm.util.otmRandom
import ru.dbotthepony.mc.otm.util.shuffle
import ru.dbotthepony.mc.otm.menu.tech.AndroidChargerMenu
import ru.dbotthepony.mc.otm.registry.game.MBlockEntities

View File

@ -16,10 +16,10 @@ import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
import ru.dbotthepony.mc.otm.player.matteryPlayer
import ru.dbotthepony.mc.otm.capability.moveEnergy
import ru.dbotthepony.mc.otm.config.MachinesConfig
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.core.otmRandom
import ru.dbotthepony.mc.otm.core.shuffle
import ru.dbotthepony.mc.otm.core.util.countingLazy
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.util.otmRandom
import ru.dbotthepony.mc.otm.util.shuffle
import ru.dbotthepony.mc.otm.util.countingLazy
import ru.dbotthepony.mc.otm.menu.tech.AndroidStationMenu
import ru.dbotthepony.mc.otm.registry.game.MBlockEntities

View File

@ -13,7 +13,6 @@ import ru.dbotthepony.kommons.util.setValue
import ru.dbotthepony.kommons.util.value
import ru.dbotthepony.mc.otm.block.entity.MatteryDeviceBlockEntity
import ru.dbotthepony.mc.otm.capability.FlowDirection
import ru.dbotthepony.mc.otm.capability.MatteryCapability
import ru.dbotthepony.mc.otm.capability.energy
import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage
import ru.dbotthepony.mc.otm.capability.energy.ProfiledEnergyStorage
@ -21,15 +20,13 @@ import ru.dbotthepony.mc.otm.capability.energyStoredMattery
import ru.dbotthepony.mc.otm.capability.matteryEnergy
import ru.dbotthepony.mc.otm.capability.maxEnergyStoredMattery
import ru.dbotthepony.mc.otm.capability.transcieveEnergy
import ru.dbotthepony.mc.otm.container.slotRange
import ru.dbotthepony.mc.otm.container.slotted.ContainerSlot
import ru.dbotthepony.mc.otm.container.slotted.FilteredContainerSlot
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
import ru.dbotthepony.mc.otm.core.immutableList
import ru.dbotthepony.mc.otm.core.isNotEmpty
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.core.otmRandom
import ru.dbotthepony.mc.otm.core.shuffle
import ru.dbotthepony.kommons.guava.immutableList
import ru.dbotthepony.mc.otm.util.isNotEmpty
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.util.otmRandom
import ru.dbotthepony.mc.otm.util.shuffle
import ru.dbotthepony.mc.otm.menu.tech.BatteryBankMenu
import ru.dbotthepony.mc.otm.registry.game.MBlockEntities
import java.util.function.Supplier

View File

@ -16,7 +16,7 @@ import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
import ru.dbotthepony.mc.otm.menu.tech.ChemicalGeneratorMenu
import ru.dbotthepony.mc.otm.registry.game.MBlockEntities
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.util.math.Decimal
class ChemicalGeneratorBlockEntity(pos: BlockPos, state: BlockState) : MatteryDeviceBlockEntity(MBlockEntities.CHEMICAL_GENERATOR, pos, state) {
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {

View File

@ -17,17 +17,18 @@ import ru.dbotthepony.mc.otm.block.tech.EnergyCounterBlock
import ru.dbotthepony.mc.otm.block.entity.MatteryDeviceBlockEntity
import ru.dbotthepony.mc.otm.capability.*
import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage
import ru.dbotthepony.mc.otm.core.*
import ru.dbotthepony.mc.otm.core.chart.DecimalHistoryChart
import ru.dbotthepony.mc.otm.core.math.BlockRotation
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.core.math.RelativeSide
import ru.dbotthepony.mc.otm.core.nbt.getDecimal
import ru.dbotthepony.mc.otm.core.nbt.mapPresent
import ru.dbotthepony.mc.otm.core.nbt.set
import ru.dbotthepony.mc.otm.core.util.countingLazy
import ru.dbotthepony.mc.otm.util.chart.DecimalHistoryChart
import ru.dbotthepony.mc.otm.util.math.BlockRotation
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.util.math.RelativeSide
import ru.dbotthepony.mc.otm.util.getDecimal
import ru.dbotthepony.mc.otm.util.mapPresent
import ru.dbotthepony.mc.otm.util.set
import ru.dbotthepony.mc.otm.util.countingLazy
import ru.dbotthepony.mc.otm.menu.tech.EnergyCounterMenu
import ru.dbotthepony.mc.otm.registry.game.MBlockEntities
import ru.dbotthepony.mc.otm.util.TranslatableComponent
import ru.dbotthepony.mc.otm.util.get
class EnergyCounterBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : MatteryDeviceBlockEntity(MBlockEntities.ENERGY_COUNTER, p_155229_, p_155230_) {
var passed by syncher.decimal()

View File

@ -4,7 +4,6 @@ import net.minecraft.core.BlockPos
import net.minecraft.world.entity.player.Inventory
import net.minecraft.world.entity.player.Player
import net.minecraft.world.inventory.AbstractContainerMenu
import net.minecraft.world.item.ItemStack
import net.minecraft.world.level.block.entity.BlockEntityType
import net.minecraft.world.level.block.state.BlockState
import net.neoforged.neoforge.capabilities.Capabilities
@ -18,8 +17,8 @@ import ru.dbotthepony.mc.otm.config.EnergyBalanceValues
import ru.dbotthepony.mc.otm.config.MachinesConfig
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
import ru.dbotthepony.mc.otm.core.math.RelativeSide
import ru.dbotthepony.mc.otm.core.multiblock.BlockEntityTag
import ru.dbotthepony.mc.otm.util.math.RelativeSide
import ru.dbotthepony.mc.otm.multiblock.BlockEntityTag
import ru.dbotthepony.mc.otm.menu.tech.EnergyHatchMenu
import ru.dbotthepony.mc.otm.registry.game.MBlockEntities

View File

@ -4,7 +4,6 @@ import net.minecraft.core.BlockPos
import net.minecraft.world.entity.player.Inventory
import net.minecraft.world.entity.player.Player
import net.minecraft.world.inventory.AbstractContainerMenu
import net.minecraft.world.item.ItemStack
import net.minecraft.world.level.block.entity.BlockEntityType
import net.minecraft.world.level.block.state.BlockState
import net.neoforged.neoforge.capabilities.Capabilities
@ -20,12 +19,12 @@ import ru.dbotthepony.mc.otm.capability.energy.ProfiledEnergyStorage
import ru.dbotthepony.mc.otm.capability.moveEnergy
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
import ru.dbotthepony.mc.otm.core.math.RelativeSide
import ru.dbotthepony.mc.otm.core.multiblock.BlockEntityTag
import ru.dbotthepony.mc.otm.core.multiblock.IMultiblockAccess
import ru.dbotthepony.mc.otm.core.multiblock.IMultiblockListener
import ru.dbotthepony.mc.otm.core.otmRandom
import ru.dbotthepony.mc.otm.core.util.InvalidableLazy
import ru.dbotthepony.mc.otm.util.math.RelativeSide
import ru.dbotthepony.mc.otm.multiblock.BlockEntityTag
import ru.dbotthepony.mc.otm.multiblock.IMultiblockAccess
import ru.dbotthepony.mc.otm.multiblock.IMultiblockListener
import ru.dbotthepony.mc.otm.util.otmRandom
import ru.dbotthepony.mc.otm.util.InvalidableLazy
import ru.dbotthepony.mc.otm.registry.game.MBlockEntities
class EnergyInterfaceBlockEntity(

View File

@ -20,7 +20,7 @@ import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
import ru.dbotthepony.mc.otm.container.slotted.FilteredContainerSlot
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
import ru.dbotthepony.mc.otm.container.slotted.and
import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.util.math.Decimal
import ru.dbotthepony.mc.otm.menu.tech.EnergyServoMenu
import ru.dbotthepony.mc.otm.registry.game.MBlockEntities

View File

@ -27,11 +27,11 @@ import ru.dbotthepony.mc.otm.container.EnhancedContainer
import ru.dbotthepony.mc.otm.container.slotted.ContainerSlot
import ru.dbotthepony.mc.otm.container.slotted.FilteredContainerSlot
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
import ru.dbotthepony.mc.otm.core.getEntitiesInEllipsoid
import ru.dbotthepony.mc.otm.core.lookupOrThrow
import ru.dbotthepony.mc.otm.core.math.Vector
import ru.dbotthepony.mc.otm.core.otmRandom
import ru.dbotthepony.mc.otm.core.util.countingLazy
import ru.dbotthepony.mc.otm.util.getEntitiesInEllipsoid
import ru.dbotthepony.mc.otm.util.lookupOrThrow
import ru.dbotthepony.mc.otm.util.math.Vector
import ru.dbotthepony.mc.otm.util.otmRandom
import ru.dbotthepony.mc.otm.util.countingLazy
import ru.dbotthepony.mc.otm.item.consumables.EssenceCapsuleItem
import ru.dbotthepony.mc.otm.item.EssenceServoItem
import ru.dbotthepony.mc.otm.menu.tech.EssenceStorageMenu

Some files were not shown because too many files have changed in this diff Show More