Skip to content

Commit

Permalink
Update to 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyrofab committed Jun 5, 2024
1 parent 25ede9f commit b297afb
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 23 deletions.
10 changes: 5 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
id("fabric-loom") version "1.5-SNAPSHOT"
id("io.github.ladysnake.chenille") version "0.12.0"
id("io.github.juuxel.loom-quiltflower") version "1.6.0"
id("fabric-loom") version "1.6-SNAPSHOT"
id("io.github.ladysnake.chenille") version "0.13.0"
}

version = providers.gradleProperty("mod_version").get()
Expand All @@ -25,8 +24,9 @@ val dummy: SourceSet by sourceSets.creating {}
repositories {
mavenLocal()
mavenCentral()
chenille.repositories {
ladysnake()
maven {
name = "Ladysnake Mods"
setUrl("https://maven.ladysnake.org/releases")
}
}

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.13.0
------------------------------------------------------
Updated to 1.21

------------------------------------------------------
Version 0.12.0
------------------------------------------------------
Expand Down
14 changes: 7 additions & 7 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=24w05b
yarn_mappings=24w05b+build.2
loader_version=0.15.6
java_version=17
minecraft_version=1.21-pre2
yarn_mappings=1.21-pre2+build.1
loader_version=0.15.11
java_version=21

# Mod Properties
mod_version = 0.12.0-beta.1
mod_version = 0.13.0
maven_group = org.ladysnake
archives_base_name = elmendorf

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

# Dependencies
fabric_version=0.95.4+1.20.5
cca_version=6.0.0-SNAPSHOT
fabric_version=0.99.4+1.21
cca_version=6.0.0
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@

import net.minecraft.entity.Entity;
import net.minecraft.network.ClientConnection;
import net.minecraft.network.DisconnectionInfo;
import net.minecraft.network.NetworkSide;
import net.minecraft.network.PacketCallbacks;
import net.minecraft.network.listener.PacketListener;
import net.minecraft.network.packet.CustomPayload;
import net.minecraft.network.packet.Packet;
import net.minecraft.network.packet.s2c.common.CustomPayloadS2CPacket;
import net.minecraft.test.GameTestException;
import net.minecraft.text.Text;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.ladysnake.cca.api.v3.component.ComponentKey;
Expand Down Expand Up @@ -180,9 +180,9 @@ public void tryDisableAutoRead() {
}

@Override
public void disconnect(Text disconnectReason) {
public void disconnect(DisconnectionInfo disconnectReason) {
//noinspection ConstantConditions
((ClientConnectionAccessor)(Object)this).setDisconnectReason(disconnectReason);
((ClientConnectionAccessor)(Object)this).setDisconnectionInfo(disconnectReason);
}

public record PacketSequenceCheckerImpl(String defaultErrorMessage, List<SentPacket> packets) implements PacketSequenceChecker {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
package org.ladysnake.elmendorf.impl.mixin;

import net.minecraft.network.ClientConnection;
import net.minecraft.text.Text;
import net.minecraft.network.DisconnectionInfo;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(ClientConnection.class)
public interface ClientConnectionAccessor {
@Accessor
void setDisconnectReason(Text reason);
void setDisconnectionInfo(DisconnectionInfo reason);
}
5 changes: 5 additions & 0 deletions src/testmod/java/org/ladysnake/ripstop/Ripstop.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@

import net.fabricmc.api.ModInitializer;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.util.Identifier;
import org.ladysnake.elmendorf.Elmendorf;

public class Ripstop implements ModInitializer {
public static final String MOD_ID = "ripstop";
public static Identifier id(String path) {
return Identifier.of(MOD_ID, path);
}
@Override
public void onInitialize() {
if (FabricLoader.getInstance().isModLoaded("cardinal-components-entity")) {
Expand Down
8 changes: 4 additions & 4 deletions src/testmod/java/org/ladysnake/ripstop/RipstopComponents.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
package org.ladysnake.ripstop;

import net.minecraft.entity.passive.AxolotlEntity;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.network.RegistryByteBuf;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.Identifier;
import org.ladysnake.cca.api.v3.component.Component;
Expand All @@ -35,18 +35,18 @@
import org.ladysnake.cca.api.v3.entity.EntityComponentInitializer;

public class RipstopComponents implements EntityComponentInitializer {
public static final ComponentKey<Component> TEST = ComponentRegistry.getOrCreate(new Identifier("ripstop", "test-component"), Component.class);
public static final ComponentKey<Component> TEST = ComponentRegistry.getOrCreate(Identifier.of("ripstop", "test-component"), Component.class);

@Override
public void registerEntityComponentFactories(EntityComponentFactoryRegistry registry) {
class Impl extends TransientComponent.SimpleImpl implements AutoSyncedComponent {
@Override
public void writeSyncPacket(PacketByteBuf buf, ServerPlayerEntity recipient) {
public void writeSyncPacket(RegistryByteBuf buf, ServerPlayerEntity recipient) {

}

@Override
public void applySyncPacket(PacketByteBuf buf) {
public void applySyncPacket(RegistryByteBuf buf) {

}
}
Expand Down
2 changes: 1 addition & 1 deletion src/testmod/java/org/ladysnake/ripstop/TestPayload.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import net.minecraft.network.packet.CustomPayload;

public record TestPayload(PacketByteBuf rawData) implements CustomPayload {
public static final CustomPayload.Id<TestPayload> ID = CustomPayload.id("ripstop:test");
public static final CustomPayload.Id<TestPayload> ID = new CustomPayload.Id<>(Ripstop.id("test"));

@Override
public Id<? extends CustomPayload> getId() {
Expand Down

0 comments on commit b297afb

Please sign in to comment.