Skip to content

Commit

Permalink
Update to 1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyrofab committed May 21, 2023
1 parent e03275f commit a03537e
Show file tree
Hide file tree
Showing 9 changed files with 101 additions and 26 deletions.
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'io.github.ladysnake.chenille' version '0.8.0'
id 'fabric-loom' version '1.2-SNAPSHOT'
id 'io.github.ladysnake.chenille' version '0.10.2'
id 'io.github.juuxel.loom-quiltflower' version '1.6.0'
}

Expand Down Expand Up @@ -38,9 +38,9 @@ dependencies {
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

modApi fabricApi.module("fabric-gametest-api-v1", fabric_version)
modLocalRuntime fabricApi.module("fabric-networking-api-v1", fabric_version)
modLocalImplementation("dev.onyxstudios.cardinal-components-api:cardinal-components-base:${cca_version}")
modLocalImplementation("dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${cca_version}")
modLocalImplementation fabricApi.module("fabric-networking-api-v1", fabric_version)
modCompileOnly("dev.onyxstudios.cardinal-components-api:cardinal-components-base:${cca_version}")
modCompileOnly("dev.onyxstudios.cardinal-components-api:cardinal-components-entity:${cca_version}")
api 'junit:junit:4.13'
testmodImplementation sourceSets.main.output
annotationProcessor(sourceSets.dummy.output)
Expand Down
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
------------------------------------------------------
Version 0.11.0
------------------------------------------------------
Updated to 1.20

------------------------------------------------------
Version 0.10.0
------------------------------------------------------
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/versions.html
minecraft_version=1.19.4
yarn_mappings=1.19.4+build.1
loader_version=0.14.17
minecraft_version=1.20-pre3
yarn_mappings=1.20-pre3+build.1
loader_version=0.14.19
java_version=17

# Mod Properties
mod_version = 0.10.0
mod_version = 0.11.0
maven_group = io.github.ladysnake
archives_base_name = elmendorf

Expand All @@ -18,5 +18,5 @@ org.gradle.jvmargs=-Xmx1G
owners = Ladysnake

# Dependencies
fabric_version=0.76.0+1.19.4
fabric_version=0.81.2+1.20
cca_version=5.0.1
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

"depends": {
"fabricloader": ">=0.11.3",
"minecraft": "1.19.x",
"minecraft": ">=1.19-",
"java": ">=17"
},
"custom": {
Expand Down
36 changes: 36 additions & 0 deletions src/testmod/java/io/github/ladysnake/ripstop/Ripstop.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Elmendorf
* Copyright (C) 2021-2023 Ladysnake
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
* OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.ladysnake.ripstop;

import io.github.ladysnake.elmendorf.Elmendorf;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.loader.api.FabricLoader;

public class Ripstop implements ModInitializer {
@Override
public void onInitialize() {
if (FabricLoader.getInstance().isModLoaded("cardinal-components-entity")) {
Elmendorf.registerTestClass(RipstopCcaTestSuite.class, "ripstop");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Elmendorf
* Copyright (C) 2021-2023 Ladysnake
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
* OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.github.ladysnake.ripstop;

import io.github.ladysnake.elmendorf.ByteBufChecker;
import io.github.ladysnake.elmendorf.GameTestUtil;
import net.fabricmc.fabric.api.gametest.v1.FabricGameTest;
import net.minecraft.entity.EntityType;
import net.minecraft.test.GameTest;
import net.minecraft.test.GameTestException;
import net.minecraft.test.TestContext;

public class RipstopCcaTestSuite implements FabricGameTest {
@GameTest(templateName = EMPTY_STRUCTURE)
public void testComponentSyncChecks(TestContext ctx) {
var player = ctx.spawnServerPlayer(5, 0, 5);
var key = RipstopComponents.TEST;
var entity = ctx.spawnEntity(EntityType.AXOLOTL, 1, 0, 1);
key.sync(entity);
GameTestUtil.assertThrows("Expected " + player + " to provide component ripstop:test-component", GameTestException.class, () -> ctx.verifyConnection(player, conn -> conn.sentEntityComponentUpdate(player, key, ByteBufChecker::noMoreData)));
ctx.verifyConnection(player, conn -> conn.sentEntityComponentUpdate(entity, key, ByteBufChecker::noMoreData));
ctx.complete();
}
}
13 changes: 0 additions & 13 deletions src/testmod/java/io/github/ladysnake/ripstop/RipstopTestSuite.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@
*/
package io.github.ladysnake.ripstop;

import io.github.ladysnake.elmendorf.ByteBufChecker;
import io.github.ladysnake.elmendorf.GameTestUtil;
import io.github.ladysnake.elmendorf.PacketSequenceChecker;
import net.fabricmc.fabric.api.gametest.v1.FabricGameTest;
import net.fabricmc.fabric.api.networking.v1.PacketByteBufs;
import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking;
import net.minecraft.entity.EntityType;
import net.minecraft.network.packet.s2c.play.BlockBreakingProgressS2CPacket;
import net.minecraft.network.packet.s2c.play.ClearTitleS2CPacket;
import net.minecraft.test.GameTest;
Expand Down Expand Up @@ -77,15 +75,4 @@ public void testPacketSequenceChecks(TestContext ctx) {
.exactly(2));
ctx.complete();
}

@GameTest(templateName = EMPTY_STRUCTURE)
public void testComponentSyncChecks(TestContext ctx) {
var player = ctx.spawnServerPlayer(5, 0, 5);
var key = RipstopComponents.TEST;
var entity = ctx.spawnEntity(EntityType.AXOLOTL, 1, 0, 1);
key.sync(entity);
GameTestUtil.assertThrows("Expected " + player + " to provide component ripstop:test-component", GameTestException.class, () -> ctx.verifyConnection(player, conn -> conn.sentEntityComponentUpdate(player, key, ByteBufChecker::noMoreData)));
ctx.verifyConnection(player, conn -> conn.sentEntityComponentUpdate(entity, key, ByteBufChecker::noMoreData));
ctx.complete();
}
}
5 changes: 4 additions & 1 deletion src/testmod/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

"environment": "*",
"entrypoints": {
"main": [
"io.github.ladysnake.ripstop.Ripstop"
],
"cardinal-components": [
"io.github.ladysnake.ripstop.RipstopComponents"
],
Expand All @@ -30,7 +33,7 @@

"depends": {
"fabricloader": ">=0.11.3",
"minecraft": "1.19.x",
"minecraft": ">=1.19-",
"elmendorf": "*",
"java": ">=17"
},
Expand Down

0 comments on commit a03537e

Please sign in to comment.