Skip to content

Commit

Permalink
Fix issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
OroArmor committed Mar 28, 2024
1 parent d8d4475 commit 3c60ce6
Show file tree
Hide file tree
Showing 12 changed files with 32 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package net.fabricmc.fabric.mixin.biome;

import net.fabricmc.fabric.api.biome.v1.BiomeModificationContext;

import org.spongepowered.asm.mixin.Mixin;

import net.fabricmc.fabric.api.biome.v1.BiomeModificationContext;

@Mixin(org.quiltmc.qsl.worldgen.biome.impl.modification.BiomeModificationContextImpl.class)
public class BiomeModificationContextImplMixin implements BiomeModificationContext {
}
4 changes: 4 additions & 0 deletions fabric-gametest-api-v1/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ loom {
}
}

dependencies {
modApi(getQslModule('core', 'testing'))
}

moduleDependencies(project, [
'fabric-api-base',
'fabric-resource-loader-v0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ private static void register(Registry<ArgumentSerializer<?, ?>> registry, Callba
if (FabricGameTestHelper.COMMAND_ENABLED && !SharedConstants.isDevelopment) {
register(registry, "test_argument", TestFunctionArgumentType.class, ConstantArgumentSerializer.of(TestFunctionArgumentType::testFunction));
register(registry, "test_class", TestClassArgumentType.class, ConstantArgumentSerializer.of(TestClassArgumentType::testClass));

// TODO: Make sure that QGT only applies when active through a mixin plugin.
register(registry, "quilt_game_test:test_name", org.quiltmc.qsl.testing.impl.game.command.TestNameArgumentType.class,
ConstantArgumentSerializer.of(org.quiltmc.qsl.testing.impl.game.command.TestNameArgumentType::new)
);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public void receive(MinecraftClient client, ClientConfigurationNetworkHandler ha
actualHandler.receive(packet, responseSender);
} else {
client.execute(() -> {
if (((org.quiltmc.qsl.networking.mixin.accessor.AbstractServerPacketHandlerAccessor) handler).getConnection().isOpen()) {
if (((org.quiltmc.qsl.networking.mixin.accessor.AbstractClientNetworkHandlerAccessor) handler).getConnection().isOpen()) {
actualHandler.receive(packet, responseSender);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
import net.minecraft.util.Identifier;

import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.EventFactory;
import net.fabricmc.fabric.impl.base.event.QuiltCompatEvent;
import net.fabricmc.fabric.impl.networking.QuiltUtils;

/**
* Offers access to events related to the indication of a connected client's ability to receive packets in certain channels.
Expand All @@ -34,21 +35,17 @@ public final class S2CConfigurationChannelEvents {
* An event for the server configuration network handler receiving an update indicating the connected client's ability to receive packets in certain channels.
* This event may be invoked at any time after login and up to disconnection.
*/
public static final Event<Register> REGISTER = EventFactory.createArrayBacked(Register.class, callbacks -> (handler, sender, server, channels) -> {
for (Register callback : callbacks) {
callback.onChannelRegister(handler, sender, server, channels);
}
});
public static final Event<Register> REGISTER = QuiltCompatEvent.fromQuilt(org.quiltmc.qsl.networking.api.S2CConfigurationChannelEvents.REGISTER,
register -> (handler, sender, server, channels) -> register.onChannelRegister(handler, QuiltUtils.toFabricSender(sender), server, channels),
register -> (handler, sender, server, channels) -> register.get().onChannelRegister(handler, QuiltUtils.toQuiltSender(sender), server, channels));

/**
* An event for the server configuration network handler receiving an update indicating the connected client's lack of ability to receive packets in certain channels.
* This event may be invoked at any time after login and up to disconnection.
*/
public static final Event<Unregister> UNREGISTER = EventFactory.createArrayBacked(Unregister.class, callbacks -> (handler, sender, server, channels) -> {
for (Unregister callback : callbacks) {
callback.onChannelUnregister(handler, sender, server, channels);
}
});
public static final Event<Unregister> UNREGISTER = QuiltCompatEvent.fromQuilt(org.quiltmc.qsl.networking.api.S2CConfigurationChannelEvents.UNREGISTER,
register -> (handler, sender, server, channels) -> register.onChannelUnregister(handler, QuiltUtils.toFabricSender(sender), server, channels),
register -> (handler, sender, server, channels) -> register.get().onChannelUnregister(handler, QuiltUtils.toQuiltSender(sender), server, channels));

private S2CConfigurationChannelEvents() {
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ public final class ServerConfigurationConnectionEvents {
* }</pre>
*/
public static final Event<Configure> CONFIGURE = QuiltCompatEvent.fromQuilt(
org.quiltmc.qsl.networking.api.ServerConfigurationConnectionEvents.READY,
configure -> (handler, sender, server) -> configure.onSendConfiguration(handler, server),
invokerGetter -> (handler, server) -> invokerGetter.get().onConfigurationReady(handler, org.quiltmc.qsl.networking.impl.server.ServerNetworkingImpl.getAddon(handler), server));
org.quiltmc.qsl.networking.api.ServerConfigurationConnectionEvents.ADD_TASKS,
configure -> configure::onSendConfiguration,
invokerGetter -> invokerGetter.get()::onAddTasks);

/**
* An event for the disconnection of the server configuration network handler.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"quilt.QuiltEntityTypeBuilderMobAccessor",
"AbstractBlockAccessor",
"AbstractBlockSettingsAccessor",
"MinecartComparatorLogicMixin"
"MinecartComparatorLogicMixin",
"PersistentStateManagerMixin"
],
"injectors": {
"defaultRequire": 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Predicate;

import net.fabricmc.fabric.api.resource.ModResourcePack;

import org.jetbrains.annotations.Nullable;

Expand All @@ -33,6 +29,8 @@
import net.minecraft.resource.ResourceType;
import net.minecraft.text.Text;

import net.fabricmc.fabric.api.resource.ModResourcePack;

/**
* Represents a resource pack provider for mods and built-in mods resource packs.
*/
Expand Down Expand Up @@ -67,7 +65,6 @@ public void register(Consumer<ResourcePackProfile> consumer) {
// This should stay as it's been used in *some* mods, it's bad I know, but it's an easy way to inject resource
// packs, it highlights the need for an API.

// throw new RuntimeException("Not Currently implemented in QSL. If your mod uses this, please make a issue at https://github.com/QuiltMC/quilted-fabric-api");
consumer.accept(ResourcePackProfile.create(
FABRIC,
Text.translatable("pack.name.fabricMods"),
Expand All @@ -89,7 +86,6 @@ public void register(Consumer<ResourcePackProfile> consumer) {

// Register all built-in resource packs provided by mods.
org.quiltmc.qsl.resource.loader.impl.ResourceLoaderImpl.registerBuiltinPacks(this.type, consumer);

}

private void registerModPack(Consumer<ResourcePackProfile> consumer, @Nullable String subPath) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,20 @@
import com.google.common.base.Charsets;
import com.google.gson.Gson;
import com.google.gson.JsonObject;

import net.fabricmc.fabric.api.resource.ModResourcePack;

import net.fabricmc.fabric.api.resource.ResourcePackActivationType;

import org.apache.commons.io.IOUtils;
import org.jetbrains.annotations.Nullable;

import net.minecraft.SharedConstants;
import net.minecraft.resource.ResourceType;
import net.minecraft.resource.metadata.PackResourceMetadata;
import net.minecraft.text.Text;

import net.fabricmc.fabric.api.resource.ModResourcePack;
import net.fabricmc.fabric.api.resource.ResourcePackActivationType;
import net.fabricmc.loader.api.FabricLoader;
import net.fabricmc.loader.api.ModContainer;
import net.fabricmc.loader.api.metadata.ModMetadata;

import org.jetbrains.annotations.Nullable;

/**
* Internal utilities for managing resource packs.
*/
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ org.gradle.parallel=true
fabric.loom.multiProjectOptimisation=true

archivesBaseName=quilted_fabric_api
version=9.0.0-alpha.3
version=9.0.0-alpha.5
upstream_version=0.96.11
minecraft_version=1.20.4
yarn_version=+build.1
loader_version=0.23.1
qsl_version=8.0.0-alpha.1+1.20.4
qsl_version=8.0.0-alpha.10+1.20.4
installer_version=0.11.1

prerelease=true
Expand Down

0 comments on commit 3c60ce6

Please sign in to comment.