Skip to content

Commit

Permalink
Update to 1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyrofab committed Jul 2, 2022
1 parent 79f44e5 commit dd222b3
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@
public class ComponentRegistryImplTest implements CardinalGameTest {

@SuppressWarnings({"unchecked", "rawtypes"})
@GameTest(structureName = FabricGameTest.EMPTY_STRUCTURE)
@GameTest(templateName = FabricGameTest.EMPTY_STRUCTURE)
public void checksRegisteredClasses() {
ComponentRegistryImpl registry = ComponentRegistryImpl.INSTANCE;
Assert.assertThrows("Component class must extend Component", IllegalArgumentException.class, () -> registry.getOrCreate(CcaTesting.TEST_ID_1, (Class) TestNotComponentItf.class));
registry.getOrCreate(CcaTesting.TEST_ID_1, TestComponentNotItf.class);
registry.getOrCreate(CcaTesting.TEST_ID_2, TestComponentItf.class);
}

@GameTest(structureName = FabricGameTest.EMPTY_STRUCTURE)
@GameTest(templateName = FabricGameTest.EMPTY_STRUCTURE)
public void doesNotDuplicateComponentTypes() {
ComponentRegistryImpl registry = ComponentRegistryImpl.INSTANCE;
Identifier id = CcaTesting.TEST_ID_1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void tearDown() {
}
}

@GameTest(structureName = FabricGameTest.EMPTY_STRUCTURE)
@GameTest(templateName = FabricGameTest.EMPTY_STRUCTURE)
public void sortKeepsOrderByDefault() {
Map<ComponentKey<?>, QualifiedComponentFactory<Object>> map = new LinkedHashMap<>();
var key1 = ComponentRegistry.getOrCreate(CcaTesting.TEST_ID_1, ComponentRegistryImplTest.TestComponentNotItf.class);
Expand All @@ -65,7 +65,7 @@ public void sortKeepsOrderByDefault() {
Assert.assertEquals(List.copyOf(map.keySet()), List.copyOf(sorted.keySet()));
}

@GameTest(structureName = FabricGameTest.EMPTY_STRUCTURE)
@GameTest(templateName = FabricGameTest.EMPTY_STRUCTURE)
public void sortThrowsOnUnsatisfiedDependency() {
Map<ComponentKey<?>, QualifiedComponentFactory<Object>> map = new LinkedHashMap<>();
var key1 = ComponentRegistry.getOrCreate(CcaTesting.TEST_ID_1, ComponentRegistryImplTest.TestComponentNotItf.class);
Expand All @@ -76,7 +76,7 @@ public void sortThrowsOnUnsatisfiedDependency() {
QualifiedComponentFactory.checkDependenciesSatisfied(map);
}

@GameTest(structureName = FabricGameTest.EMPTY_STRUCTURE)
@GameTest(templateName = FabricGameTest.EMPTY_STRUCTURE)
public void sortThrowsOnCircularDependency() {
Map<ComponentKey<?>, QualifiedComponentFactory<Object>> map = new LinkedHashMap<>();
var key1 = ComponentRegistry.getOrCreate(CcaTesting.TEST_ID_1, ComponentRegistryImplTest.TestComponentNotItf.class);
Expand All @@ -95,7 +95,7 @@ public void sortThrowsOnCircularDependency() {
QualifiedComponentFactory.sort(map);
}

@GameTest(structureName = FabricGameTest.EMPTY_STRUCTURE)
@GameTest(templateName = FabricGameTest.EMPTY_STRUCTURE)
public void sortRespectsDependencyOrdering() {
Map<ComponentKey<?>, QualifiedComponentFactory<Object>> map = new LinkedHashMap<>();
var key1 = ComponentRegistry.getOrCreate(CcaTesting.TEST_ID_1, ComponentRegistryImplTest.TestComponentNotItf.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import net.minecraft.world.chunk.WorldChunk;

public class CcaChunkTestSuite implements FabricGameTest {
@GameTest(structureName = EMPTY_STRUCTURE)
@GameTest(templateName = EMPTY_STRUCTURE)
public void chunksSerialize(TestContext ctx) {
ChunkPos pos = new ChunkPos(ctx.getAbsolutePos(new BlockPos(1, 0, 1)));
Chunk c = new WorldChunk(ctx.getWorld(), pos);
Expand All @@ -47,7 +47,7 @@ public void chunksSerialize(TestContext ctx) {
ctx.complete();
}

@GameTest(structureName = EMPTY_STRUCTURE)
@GameTest(templateName = EMPTY_STRUCTURE)
public void chunksTick(TestContext ctx) {
int baseTicks = ctx.getWorld().getChunk(ctx.getAbsolutePos(BlockPos.ORIGIN)).getComponent(TickingTestComponent.KEY).serverTicks();
ctx.waitAndRun(5, () -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import net.minecraft.util.math.BlockPos;

public class CcaEntityTestSuite implements FabricGameTest {
@GameTest(structureName = EMPTY_STRUCTURE)
@GameTest(templateName = EMPTY_STRUCTURE)
public void bucketableWorks(TestContext ctx) {
ServerPlayerEntity player = ctx.spawnServerPlayer(1, 0, 1);
player.setStackInHand(Hand.MAIN_HAND, new ItemStack(Items.WATER_BUCKET));
Expand All @@ -48,7 +48,7 @@ public void bucketableWorks(TestContext ctx) {
ctx.expectEntityWithDataEnd(pos, EntityType.AXOLOTL, a -> a.getComponent(Vita.KEY).getVitality(), 3);
}

@GameTest(structureName = EMPTY_STRUCTURE)
@GameTest(templateName = EMPTY_STRUCTURE)
public void moddedEntitiesWork(TestContext ctx) {
ctx.spawnEntity(CcaEntityTestMod.TEST_ENTITY, 0, 0, 0);
ctx.complete();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import net.minecraft.test.TestContext;

public class CcaLevelTestSuite implements FabricGameTest {
@GameTest(structureName = EMPTY_STRUCTURE)
@GameTest(templateName = EMPTY_STRUCTURE)
public void levelComponentsTick(TestContext ctx) {
int baseTicks = ctx.getWorld().getLevelProperties().getComponent(TickingTestComponent.KEY).serverTicks();
ctx.waitAndRun(5, () -> {
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
org.gradle.jvmargs = -Xmx3G

#see https://modmuss50.me/fabric.html
minecraft_version=1.19-pre1
minecraft_version=1.19
yarn_mappings=1
loader_version=0.14.5
#Fabric api
Expand All @@ -11,10 +11,10 @@ fabric_api_version=0.52.4+1.19
elmendorf_version=0.6.0

#Publishing
mod_version = 5.0.0-beta.1
mod_version = 5.0.0
curseforge_id = 318449
modrinth_id = K01OU20C
curseforge_versions = 1.19-Snapshot
curseforge_versions = 1.19
modrinth_versions = 1.19
changelog_url = https://github.com/OnyxStudios/Cardinal-Components-API/blob
release_type = release
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.random.AbstractRandom;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.World;
import org.jetbrains.annotations.ApiStatus;

Expand All @@ -46,7 +46,7 @@ public VitalityCondenser(Settings settings) {
@SuppressWarnings("deprecation")
@ApiStatus.OverrideOnly
@Override
public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, AbstractRandom rand) {
public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random rand) {
Vita.get(world).transferTo(Vita.get(world.getChunk(pos)), 1);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
import java.util.Objects;

public final class CcaTestSuite implements FabricGameTest {
@GameTest(structureName = EMPTY_STRUCTURE)
@GameTest(templateName = EMPTY_STRUCTURE)
public void interfacesGetInjected(TestContext context) {
// CCA Block
context.setBlockState(1, 0, 2, Blocks.CHEST);
Expand Down

0 comments on commit dd222b3

Please sign in to comment.