mirror of
https://github.com/FabricMC/fabric.git
synced 2024-11-14 19:25:23 -05:00
Split all duplicated packages (#2617)
* Move duplicated v0/v1 impl packages to v0 subpackages Fixes #2616. The convention is adopted from the command API (v1) whose impl classes have the v1 subpackage. * Separate client code into its own packages everywhere * Fix code style * Fix code style, part 2 * Allow v0 in package names * Allow v0 in package names (fixed)
This commit is contained in:
parent
28270f5886
commit
9244241639
27 changed files with 39 additions and 35 deletions
|
@ -181,7 +181,7 @@
|
|||
- net.fabricmc.fabric.(impl|mixin).<module-name>[.v<version>][.<extra packages...>]
|
||||
- <any legacy package>
|
||||
where <module-name> is a set of '.'-separated words, all in singular (not ending with s except for ss) and not starting with client. or server.
|
||||
and <version> is a positive integer (1, 2, 3, ...)
|
||||
and <version> is a non-negative integer (0, 1, 2, 3, ...)
|
||||
and <extra packages...> is a set of '.'-separated words with all the first potentially containing digits.
|
||||
Negative lookahead ensures that client/server can't be replaced with common disguised as the module name.
|
||||
|
||||
|
@ -194,7 +194,7 @@
|
|||
- largely unconstained trailing subpackages
|
||||
-->
|
||||
<property name="format"
|
||||
value="^net\.fabricmc\.fabric\.(api(?!\.common\.)(\.client|\.server|)(\.(?!client\.|server\.)[a-z]+([a-rt-z]|ss))+\.v[1-9][0-9]*|(impl|mixin|test)(?!\.common\.)(\.client|\.server|)(\.(?!client\.|server\.)[a-z]+([a-rt-z]|ss))+(\.v[1-9][0-9]*)?|api\.(event|util|biomes\.v1|registry|client\.screen|container|block|entity|client\.itemgroup|client\.keybinding|tag|tools|client\.model|network|server|client\.render|resource|client\.texture))(|\.[a-z]+(\.[a-z0-9]+)*)$"/>
|
||||
value="^net\.fabricmc\.fabric\.(api(?!\.common\.)(\.client|\.server|)(\.(?!client\.|server\.)[a-z]+([a-rt-z]|ss))+\.v[0-9]+|(impl|mixin|test)(?!\.common\.)(\.client|\.server|)(\.(?!client\.|server\.)[a-z]+([a-rt-z]|ss))+(\.v[0-9]+)?|api\.(event|util|biomes\.v1|registry|client\.screen|container|block|entity|client\.itemgroup|client\.keybinding|tag|tools|client\.model|network|server|client\.render|resource|client\.texture))(|\.[a-z]+(\.[a-z0-9]+)*)$"/>
|
||||
</module>
|
||||
|
||||
<!--<module name="InvalidJavadocPosition"/>-->
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.fabricmc.fabric.impl.event.lifecycle.client;
|
||||
package net.fabricmc.fabric.impl.event.lifecycle.v0.client;
|
||||
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.fabricmc.fabric.impl.event.lifecycle;
|
||||
package net.fabricmc.fabric.impl.event.lifecycle.v0;
|
||||
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
|
|
@ -17,10 +17,10 @@
|
|||
],
|
||||
"entrypoints": {
|
||||
"main": [
|
||||
"net.fabricmc.fabric.impl.event.lifecycle.LegacyEventInvokers"
|
||||
"net.fabricmc.fabric.impl.event.lifecycle.v0.LegacyEventInvokers"
|
||||
],
|
||||
"client": [
|
||||
"net.fabricmc.fabric.impl.event.lifecycle.client.LegacyClientEventInvokers"
|
||||
"net.fabricmc.fabric.impl.event.lifecycle.v0.client.LegacyClientEventInvokers"
|
||||
]
|
||||
},
|
||||
"depends": {
|
||||
|
|
|
@ -23,7 +23,7 @@ import net.minecraft.network.Packet;
|
|||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
|
||||
import net.fabricmc.fabric.impl.networking.ClientSidePacketRegistryImpl;
|
||||
import net.fabricmc.fabric.impl.client.networking.v0.ClientSidePacketRegistryImpl;
|
||||
|
||||
/**
|
||||
* The client-side packet registry.
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.fabricmc.fabric.impl.networking;
|
||||
package net.fabricmc.fabric.impl.client.networking.v0;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
@ -34,6 +34,7 @@ import net.fabricmc.fabric.api.network.ClientSidePacketRegistry;
|
|||
import net.fabricmc.fabric.api.network.PacketConsumer;
|
||||
import net.fabricmc.fabric.api.network.PacketContext;
|
||||
import net.fabricmc.fabric.api.network.PacketRegistry;
|
||||
import net.fabricmc.fabric.impl.networking.GenericFutureListenerHolder;
|
||||
|
||||
public class ClientSidePacketRegistryImpl implements ClientSidePacketRegistry, PacketRegistry {
|
||||
@Override
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.fabricmc.fabric.impl.networking;
|
||||
package net.fabricmc.fabric.impl.client.networking.v0;
|
||||
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.event.network.S2CPacketTypeCallback;
|
|
@ -26,7 +26,7 @@ import net.minecraft.network.PacketByteBuf;
|
|||
|
||||
import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking;
|
||||
import net.fabricmc.fabric.api.server.PlayerStream;
|
||||
import net.fabricmc.fabric.impl.networking.ServerSidePacketRegistryImpl;
|
||||
import net.fabricmc.fabric.impl.networking.v0.ServerSidePacketRegistryImpl;
|
||||
|
||||
/**
|
||||
* The server-side packet registry.
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.fabricmc.fabric.impl.networking;
|
||||
package net.fabricmc.fabric.impl.networking.v0;
|
||||
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
import net.fabricmc.fabric.api.event.network.C2SPacketTypeCallback;
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.fabricmc.fabric.impl.networking;
|
||||
package net.fabricmc.fabric.impl.networking.v0;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
|
@ -35,6 +35,7 @@ import net.fabricmc.fabric.api.network.PacketContext;
|
|||
import net.fabricmc.fabric.api.network.PacketRegistry;
|
||||
import net.fabricmc.fabric.api.network.ServerSidePacketRegistry;
|
||||
import net.fabricmc.fabric.api.networking.v1.ServerPlayNetworking;
|
||||
import net.fabricmc.fabric.impl.networking.GenericFutureListenerHolder;
|
||||
|
||||
public class ServerSidePacketRegistryImpl implements ServerSidePacketRegistry, PacketRegistry {
|
||||
@Override
|
|
@ -17,10 +17,10 @@
|
|||
],
|
||||
"entrypoints": {
|
||||
"main": [
|
||||
"net.fabricmc.fabric.impl.networking.OldNetworkingHooks"
|
||||
"net.fabricmc.fabric.impl.networking.v0.OldNetworkingHooks"
|
||||
],
|
||||
"client": [
|
||||
"net.fabricmc.fabric.impl.networking.OldClientNetworkingHooks"
|
||||
"net.fabricmc.fabric.impl.client.networking.v0.OldClientNetworkingHooks"
|
||||
]
|
||||
},
|
||||
"depends": {
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.fabricmc.fabric.impl.client.rendering;
|
||||
package net.fabricmc.fabric.impl.client.rendering.v0;
|
||||
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.InvalidateRenderStateCallback;
|
|
@ -17,7 +17,7 @@
|
|||
],
|
||||
"entrypoints": {
|
||||
"client": [
|
||||
"net.fabricmc.fabric.impl.client.rendering.RenderingCallbackInvoker"
|
||||
"net.fabricmc.fabric.impl.client.rendering.v0.RenderingCallbackInvoker"
|
||||
]
|
||||
},
|
||||
"depends": {
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.fabricmc.fabric.mixin.entity.event.elytra;
|
||||
package net.fabricmc.fabric.mixin.client.entity.event.elytra;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import org.spongepowered.asm.mixin.Final;
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"required": true,
|
||||
"package": "net.fabricmc.fabric.mixin.entity.event",
|
||||
"package": "net.fabricmc.fabric.mixin.client.entity.event",
|
||||
"compatibilityLevel": "JAVA_16",
|
||||
"client": [
|
||||
"elytra.ClientPlayerEntityMixin"
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.fabricmc.fabric.impl.item.group;
|
||||
package net.fabricmc.fabric.impl.client.item.group;
|
||||
|
||||
public interface CreativeGuiExtensions {
|
||||
void fabric_nextPage();
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.fabricmc.fabric.impl.item.group;
|
||||
package net.fabricmc.fabric.impl.client.item.group;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
|
@ -31,8 +31,8 @@ import net.minecraft.entity.player.PlayerInventory;
|
|||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import net.fabricmc.fabric.impl.item.group.CreativeGuiExtensions;
|
||||
import net.fabricmc.fabric.impl.item.group.FabricCreativeGuiComponents;
|
||||
import net.fabricmc.fabric.impl.client.item.group.CreativeGuiExtensions;
|
||||
import net.fabricmc.fabric.impl.client.item.group.FabricCreativeGuiComponents;
|
||||
|
||||
@Mixin(CreativeInventoryScreen.class)
|
||||
public abstract class CreativeInventoryScreenMixin extends AbstractInventoryScreen implements CreativeGuiExtensions {
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
|||
|
||||
import net.minecraft.item.ItemGroup;
|
||||
|
||||
import net.fabricmc.fabric.impl.item.group.FabricCreativeGuiComponents;
|
||||
import net.fabricmc.fabric.impl.client.item.group.FabricCreativeGuiComponents;
|
||||
|
||||
@Mixin(ItemGroup.class)
|
||||
public abstract class ItemGroupMixin {
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.fabricmc.fabric.impl.event.lifecycle;
|
||||
package net.fabricmc.fabric.impl.client.event.lifecycle;
|
||||
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
|
||||
|
@ -23,6 +23,7 @@ import net.fabricmc.api.EnvType;
|
|||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientBlockEntityEvents;
|
||||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientChunkEvents;
|
||||
import net.fabricmc.fabric.impl.event.lifecycle.LoadedChunksCache;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public final class ClientLifecycleEventsImpl implements ClientModInitializer {
|
|
@ -20,7 +20,7 @@
|
|||
"net.fabricmc.fabric.impl.event.lifecycle.LifecycleEventsImpl"
|
||||
],
|
||||
"client": [
|
||||
"net.fabricmc.fabric.impl.event.lifecycle.ClientLifecycleEventsImpl"
|
||||
"net.fabricmc.fabric.impl.client.event.lifecycle.ClientLifecycleEventsImpl"
|
||||
]
|
||||
},
|
||||
"mixins": [
|
||||
|
|
|
@ -43,8 +43,8 @@ import net.fabricmc.fabric.impl.networking.ChannelInfoHolder;
|
|||
import net.fabricmc.fabric.impl.networking.GlobalReceiverRegistry;
|
||||
import net.fabricmc.fabric.impl.networking.NetworkHandlerExtensions;
|
||||
import net.fabricmc.fabric.impl.networking.NetworkingImpl;
|
||||
import net.fabricmc.fabric.mixin.networking.accessor.ConnectScreenAccessor;
|
||||
import net.fabricmc.fabric.mixin.networking.accessor.MinecraftClientAccessor;
|
||||
import net.fabricmc.fabric.mixin.networking.client.accessor.ConnectScreenAccessor;
|
||||
import net.fabricmc.fabric.mixin.networking.client.accessor.MinecraftClientAccessor;
|
||||
|
||||
@Environment(EnvType.CLIENT)
|
||||
public final class ClientNetworkingImpl {
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.fabricmc.fabric.mixin.networking.accessor;
|
||||
package net.fabricmc.fabric.mixin.networking.client.accessor;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.fabricmc.fabric.mixin.networking.accessor;
|
||||
package net.fabricmc.fabric.mixin.networking.client.accessor;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
|
@ -1,13 +1,13 @@
|
|||
{
|
||||
"required": true,
|
||||
"package": "net.fabricmc.fabric.mixin.networking",
|
||||
"package": "net.fabricmc.fabric.mixin.networking.client",
|
||||
"compatibilityLevel": "JAVA_16",
|
||||
"client": [
|
||||
"accessor.ConnectScreenAccessor",
|
||||
"accessor.MinecraftClientAccessor",
|
||||
"client.ClientLoginNetworkHandlerMixin",
|
||||
"client.ClientPlayNetworkHandlerMixin",
|
||||
"client.DisconnectedScreenMixin"
|
||||
"ClientLoginNetworkHandlerMixin",
|
||||
"ClientPlayNetworkHandlerMixin",
|
||||
"DisconnectedScreenMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.fabricmc.fabric.impl.registry.sync;
|
||||
package net.fabricmc.fabric.impl.client.registry.sync;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -23,6 +23,7 @@ import net.minecraft.text.Text;
|
|||
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
|
||||
import net.fabricmc.fabric.impl.registry.sync.RegistrySyncManager;
|
||||
import net.fabricmc.fabric.impl.registry.sync.packet.RegistryPacketHandler;
|
||||
|
||||
public class FabricRegistryClientInit implements ClientModInitializer {
|
|
@ -33,7 +33,7 @@
|
|||
"net.fabricmc.fabric.impl.registry.sync.FabricRegistryInit"
|
||||
],
|
||||
"client": [
|
||||
"net.fabricmc.fabric.impl.registry.sync.FabricRegistryClientInit"
|
||||
"net.fabricmc.fabric.impl.client.registry.sync.FabricRegistryClientInit"
|
||||
]
|
||||
},
|
||||
"custom": {
|
||||
|
|
Loading…
Reference in a new issue