mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-11-06 00:22:58 +00:00
Backport small changes from the 1.20.4 branch
- Add support for version overrides/exclusions in our dependency check. Sometimes mod loaders use different versions to vanilla, and we need some way to handle that. - Rescan wired network connections on the tick after invalidation, rather than when invalidated. - Convert some constant lambdas to static method references. Lambdas don't allocate if they don't capture variables, so this has the same performance and is a little less ugly. - Small code-style/formatting changes.
This commit is contained in:
@@ -7,7 +7,10 @@ package dan200.computercraft.gametest
|
||||
import dan200.computercraft.api.lua.ObjectArguments
|
||||
import dan200.computercraft.core.apis.PeripheralAPI
|
||||
import dan200.computercraft.core.computer.ComputerSide
|
||||
import dan200.computercraft.gametest.api.*
|
||||
import dan200.computercraft.gametest.api.getBlockEntity
|
||||
import dan200.computercraft.gametest.api.sequence
|
||||
import dan200.computercraft.gametest.api.thenOnComputer
|
||||
import dan200.computercraft.gametest.api.thenStartComputer
|
||||
import dan200.computercraft.shared.ModRegistry
|
||||
import dan200.computercraft.shared.peripheral.modem.wired.CableBlock
|
||||
import dan200.computercraft.test.core.assertArrayEquals
|
||||
|
||||
@@ -21,7 +21,6 @@ import net.minecraft.world.entity.EntityType
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import net.minecraft.world.level.block.Blocks
|
||||
import org.junit.jupiter.api.Assertions.*
|
||||
import java.util.*
|
||||
|
||||
class Monitor_Test {
|
||||
@GameTest
|
||||
|
||||
@@ -19,7 +19,6 @@ import net.minecraft.world.inventory.MenuType
|
||||
import net.minecraft.world.inventory.TransientCraftingContainer
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import net.minecraft.world.item.Items
|
||||
import net.minecraft.world.item.crafting.CraftingRecipe
|
||||
import net.minecraft.world.item.crafting.RecipeType
|
||||
import org.junit.jupiter.api.Assertions.assertEquals
|
||||
import java.util.*
|
||||
@@ -37,11 +36,11 @@ class Recipe_Test {
|
||||
container.setItem(0, ItemStack(Items.SKELETON_SKULL))
|
||||
container.setItem(1, ItemStack(ModRegistry.Items.COMPUTER_ADVANCED.get()))
|
||||
|
||||
val recipe: Optional<CraftingRecipe> = context.level.server.recipeManager
|
||||
val recipe = context.level.server.recipeManager
|
||||
.getRecipeFor(RecipeType.CRAFTING, container, context.level)
|
||||
if (!recipe.isPresent) throw GameTestAssertException("No recipe matches")
|
||||
.orElseThrow { GameTestAssertException("No recipe matches") }
|
||||
|
||||
val result = recipe.get().assemble(container, context.level.registryAccess())
|
||||
val result = recipe.assemble(container, context.level.registryAccess())
|
||||
|
||||
val profile = GameProfile(UUID.fromString("f3c8d69b-0776-4512-8434-d1b2165909eb"), "dan200")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user