Skip to content

Commit

Permalink
Split into api and impl packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Patbox committed Nov 6, 2024
1 parent 9992d78 commit 61ae525
Show file tree
Hide file tree
Showing 158 changed files with 528 additions and 549 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import net.minecraft.server.network.ServerPlayerEntity;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import xyz.nucleoid.plasmid.game.manager.GameSpaceManager;
import xyz.nucleoid.plasmid.impl.manager.GameSpaceManager;

@Mixin(IntegratedPlayerManager.class)
public abstract class IntegratedPlayerManagerMixin {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package xyz.nucleoid.plasmid.chat;
package xyz.nucleoid.plasmid.api.chat;

public enum ChatChannel {
ALL,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package xyz.nucleoid.plasmid.chat;
package xyz.nucleoid.plasmid.api.chat;

public interface HasChatChannel {
ChatChannel getChatChannel();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package xyz.nucleoid.plasmid.chat;
package xyz.nucleoid.plasmid.api.chat;

import net.minecraft.network.message.MessageType;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.util.Identifier;
import xyz.nucleoid.plasmid.Plasmid;
import xyz.nucleoid.plasmid.impl.Plasmid;

public final class PlasmidMessageTypes {
public static final RegistryKey<MessageType> TEAM_CHAT = RegistryKey.of(RegistryKeys.MESSAGE_TYPE, Identifier.of(Plasmid.ID, "team_chat"));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package xyz.nucleoid.plasmid.event;
package xyz.nucleoid.plasmid.api.event;

import net.fabricmc.fabric.api.event.Event;
import net.fabricmc.fabric.api.event.EventFactory;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.server.network.ServerPlayerEntity;
import org.jetbrains.annotations.Nullable;
import xyz.nucleoid.plasmid.game.GameActivity;
import xyz.nucleoid.plasmid.game.GameCloseReason;
import xyz.nucleoid.plasmid.game.GameResult;
import xyz.nucleoid.plasmid.game.GameSpace;
import xyz.nucleoid.plasmid.game.config.GameConfig;
import xyz.nucleoid.plasmid.api.game.GameActivity;
import xyz.nucleoid.plasmid.api.game.GameCloseReason;
import xyz.nucleoid.plasmid.api.game.GameResult;
import xyz.nucleoid.plasmid.api.game.GameSpace;
import xyz.nucleoid.plasmid.api.game.config.GameConfig;

import java.util.Set;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package xyz.nucleoid.plasmid.game;
package xyz.nucleoid.plasmid.api.game;

import xyz.nucleoid.plasmid.game.rule.GameRuleType;
import xyz.nucleoid.plasmid.api.game.rule.GameRuleType;
import xyz.nucleoid.stimuli.event.EventResult;
import xyz.nucleoid.stimuli.event.StimulusEvent;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package xyz.nucleoid.plasmid.game;
package xyz.nucleoid.plasmid.api.game;

import net.minecraft.util.Identifier;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package xyz.nucleoid.plasmid.game;
package xyz.nucleoid.plasmid.api.game;

import org.jetbrains.annotations.Nullable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package xyz.nucleoid.plasmid.game;
package xyz.nucleoid.plasmid.api.game;

import org.jetbrains.annotations.NotNull;
import xyz.nucleoid.plasmid.game.rule.GameRuleType;
import xyz.nucleoid.plasmid.api.game.rule.GameRuleType;
import xyz.nucleoid.stimuli.event.EventResult;
import xyz.nucleoid.stimuli.event.StimulusEvent;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package xyz.nucleoid.plasmid.game;
package xyz.nucleoid.plasmid.api.game;

import xyz.nucleoid.plasmid.api.event.GameEvents;

/**
* Represents a reason for a game to close.
*
* <p>To close a game, see {@link GameSpace#close}.
* <p>To listen for game closure, see {@link xyz.nucleoid.plasmid.event.GameEvents#CLOSING}.
* <p>To listen for game closure, see {@link GameEvents#CLOSING}.
*/
public enum GameCloseReason {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package xyz.nucleoid.plasmid.game;
package xyz.nucleoid.plasmid.api.game;

import net.minecraft.server.network.ServerPlayerEntity;
import org.jetbrains.annotations.Nullable;
import xyz.nucleoid.plasmid.game.manager.ManagedGameActivity;
import xyz.nucleoid.plasmid.impl.manager.ManagedGameActivity;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package xyz.nucleoid.plasmid.game;
package xyz.nucleoid.plasmid.api.game;

import net.minecraft.server.MinecraftServer;
import net.minecraft.server.world.ServerWorld;
import xyz.nucleoid.fantasy.RuntimeWorldConfig;
import xyz.nucleoid.plasmid.game.config.GameConfig;
import xyz.nucleoid.plasmid.game.rule.GameRuleType;
import xyz.nucleoid.plasmid.api.game.config.GameConfig;
import xyz.nucleoid.plasmid.api.game.rule.GameRuleType;
import xyz.nucleoid.stimuli.event.EventResult;
import xyz.nucleoid.stimuli.event.StimulusEvent;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package xyz.nucleoid.plasmid.game;
package xyz.nucleoid.plasmid.api.game;

import net.minecraft.text.Text;
import org.jetbrains.annotations.Nullable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package xyz.nucleoid.plasmid.game;
package xyz.nucleoid.plasmid.api.game;

import net.minecraft.registry.entry.RegistryEntry;
import xyz.nucleoid.plasmid.game.config.GameConfig;
import xyz.nucleoid.plasmid.api.game.config.GameConfig;

/**
* Holds the logic controlling how a {@link GameSpace} should be opened.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package xyz.nucleoid.plasmid.game;
package xyz.nucleoid.plasmid.api.game;

import xyz.nucleoid.plasmid.Plasmid;
import xyz.nucleoid.plasmid.impl.Plasmid;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package xyz.nucleoid.plasmid.game;
package xyz.nucleoid.plasmid.api.game;

import com.google.common.base.Preconditions;
import net.minecraft.text.MutableText;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package xyz.nucleoid.plasmid.game;
package xyz.nucleoid.plasmid.api.game;

import net.minecraft.server.MinecraftServer;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld;
import org.jetbrains.annotations.Nullable;
import xyz.nucleoid.fantasy.RuntimeWorldConfig;
import xyz.nucleoid.plasmid.game.event.GameActivityEvents;
import xyz.nucleoid.plasmid.game.event.GamePlayerEvents;
import xyz.nucleoid.plasmid.game.player.PlayerSet;
import xyz.nucleoid.plasmid.game.world.GameSpaceWorlds;
import xyz.nucleoid.plasmid.api.game.player.PlayerSet;
import xyz.nucleoid.plasmid.api.game.event.GameActivityEvents;
import xyz.nucleoid.plasmid.api.game.event.GamePlayerEvents;
import xyz.nucleoid.plasmid.api.game.world.GameSpaceWorlds;

import java.util.function.Consumer;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package xyz.nucleoid.plasmid.game;
package xyz.nucleoid.plasmid.api.game;

import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.util.Identifier;
import xyz.nucleoid.plasmid.game.config.GameConfig;
import xyz.nucleoid.plasmid.api.game.config.GameConfig;

import java.util.UUID;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package xyz.nucleoid.plasmid.game;
package xyz.nucleoid.plasmid.api.game;

import net.minecraft.server.network.ServerPlayerEntity;
import xyz.nucleoid.plasmid.game.event.GamePlayerEvents;
import xyz.nucleoid.plasmid.game.player.JoinIntent;
import xyz.nucleoid.plasmid.game.player.PlayerOps;
import xyz.nucleoid.plasmid.game.player.PlayerSet;
import xyz.nucleoid.plasmid.api.game.event.GamePlayerEvents;
import xyz.nucleoid.plasmid.api.game.player.GamePlayerJoiner;
import xyz.nucleoid.plasmid.api.game.player.JoinIntent;
import xyz.nucleoid.plasmid.api.game.player.PlayerOps;
import xyz.nucleoid.plasmid.api.game.player.PlayerSet;

import java.util.Collection;

Expand All @@ -25,7 +26,7 @@ public interface GameSpacePlayers extends PlayerSet {
* @param intent the intent of the players trying to join, such as whether they want to participate or spectate
* @return a {@link GameResult} describing whether these players can join this game, or an error if not
* @see GameSpacePlayers#offer(Collection, JoinIntent)
* @see xyz.nucleoid.plasmid.game.player.GamePlayerJoiner
* @see GamePlayerJoiner
*/
GameResult simulateOffer(Collection<ServerPlayerEntity> players, JoinIntent intent);

Expand All @@ -39,7 +40,7 @@ public interface GameSpacePlayers extends PlayerSet {
* @param intent the intent of the players trying to join, such as whether they want to participate or spectate
* @return a {@link GameResult} describing whether these players joined the game, or an error if not
* @see GamePlayerEvents#OFFER
* @see xyz.nucleoid.plasmid.game.player.GamePlayerJoiner
* @see GamePlayerJoiner
*/
GameResult offer(Collection<ServerPlayerEntity> players, JoinIntent intent);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package xyz.nucleoid.plasmid.game;
package xyz.nucleoid.plasmid.api.game;

import it.unimi.dsi.fastutil.objects.Object2ObjectMap;
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
import xyz.nucleoid.plasmid.game.stats.GameStatisticBundle;
import xyz.nucleoid.plasmid.api.game.stats.GameStatisticBundle;

import java.util.function.BiConsumer;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package xyz.nucleoid.plasmid.game;
package xyz.nucleoid.plasmid.api.game;

import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.text.*;
import net.minecraft.util.Formatting;
import xyz.nucleoid.plasmid.game.config.GameConfig;
import xyz.nucleoid.plasmid.api.game.config.GameConfig;

/**
* Utility class containing various functions that supply {@link Text} instances.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package xyz.nucleoid.plasmid.game;
package xyz.nucleoid.plasmid.api.game;

import com.mojang.serialization.MapCodec;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import net.minecraft.util.Util;
import org.jetbrains.annotations.Nullable;
import xyz.nucleoid.plasmid.game.config.GameConfig;
import xyz.nucleoid.plasmid.registry.TinyRegistry;
import xyz.nucleoid.plasmid.api.game.config.GameConfig;
import xyz.nucleoid.plasmid.api.util.TinyRegistry;

import java.util.function.Consumer;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
package xyz.nucleoid.plasmid.game.common;
package xyz.nucleoid.plasmid.api.game.common;

import com.google.common.hash.Hashing;
import eu.pb4.polymer.resourcepack.api.PolymerResourcePackUtils;
import eu.pb4.polymer.resourcepack.api.ResourcePackCreator;
import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.network.packet.s2c.common.ResourcePackRemoveS2CPacket;
import net.minecraft.network.packet.s2c.common.ResourcePackSendS2CPacket;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import xyz.nucleoid.plasmid.Plasmid;
import xyz.nucleoid.plasmid.PlasmidConfig;
import xyz.nucleoid.plasmid.PlasmidWebServer;
import xyz.nucleoid.plasmid.game.GameActivity;
import xyz.nucleoid.plasmid.game.event.GamePlayerEvents;
import xyz.nucleoid.plasmid.api.game.event.GamePlayerEvents;
import xyz.nucleoid.plasmid.impl.Plasmid;
import xyz.nucleoid.plasmid.impl.PlasmidWebServer;
import xyz.nucleoid.plasmid.api.game.GameActivity;

import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.HashMap;
import java.util.Optional;
import java.util.UUID;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package xyz.nucleoid.plasmid.game.common;
package xyz.nucleoid.plasmid.api.game.common;

import com.mojang.authlib.GameProfile;
import net.minecraft.entity.boss.BossBar;
import net.minecraft.screen.ScreenTexts;
import net.minecraft.server.network.ServerPlayerEntity;
Expand All @@ -11,24 +10,24 @@
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import org.jetbrains.annotations.Nullable;
import xyz.nucleoid.plasmid.game.GameActivity;
import xyz.nucleoid.plasmid.game.GameResult;
import xyz.nucleoid.plasmid.game.GameSpace;
import xyz.nucleoid.plasmid.game.GameTexts;
import xyz.nucleoid.plasmid.game.common.config.PlayerConfig;
import xyz.nucleoid.plasmid.game.common.widget.BossBarWidget;
import xyz.nucleoid.plasmid.game.common.widget.SidebarWidget;
import xyz.nucleoid.plasmid.game.config.GameConfig;
import xyz.nucleoid.plasmid.game.event.GameActivityEvents;
import xyz.nucleoid.plasmid.game.event.GamePlayerEvents;
import xyz.nucleoid.plasmid.game.manager.GameSpaceManager;
import xyz.nucleoid.plasmid.game.player.JoinOffer;
import xyz.nucleoid.plasmid.game.player.JoinOfferResult;
import xyz.nucleoid.plasmid.game.rule.GameRuleType;
import xyz.nucleoid.plasmid.util.compatibility.AfkDisplayCompatibility;
import xyz.nucleoid.plasmid.api.game.GameSpace;
import xyz.nucleoid.plasmid.api.game.common.config.PlayerConfig;
import xyz.nucleoid.plasmid.api.game.common.team.TeamSelectionLobby;
import xyz.nucleoid.plasmid.api.game.common.widget.BossBarWidget;
import xyz.nucleoid.plasmid.api.game.config.GameConfig;
import xyz.nucleoid.plasmid.api.game.event.GameActivityEvents;
import xyz.nucleoid.plasmid.api.game.event.GamePlayerEvents;
import xyz.nucleoid.plasmid.api.game.player.JoinOffer;
import xyz.nucleoid.plasmid.api.game.player.JoinOfferResult;
import xyz.nucleoid.plasmid.api.game.rule.GameRuleType;
import xyz.nucleoid.plasmid.api.game.GameActivity;
import xyz.nucleoid.plasmid.api.game.GameResult;
import xyz.nucleoid.plasmid.api.game.GameTexts;
import xyz.nucleoid.plasmid.api.game.common.widget.SidebarWidget;
import xyz.nucleoid.plasmid.impl.manager.GameSpaceManager;
import xyz.nucleoid.plasmid.impl.compatibility.AfkDisplayCompatibility;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
Expand All @@ -39,7 +38,7 @@
*
* @see GameWaitingLobby#addTo(GameActivity, PlayerConfig)
* @see PlayerConfig
* @see xyz.nucleoid.plasmid.game.common.team.TeamSelectionLobby
* @see TeamSelectionLobby
*/
public final class GameWaitingLobby {
private static final Text WAITING_TITLE = Text.translatable("text.plasmid.game.waiting_lobby.bar.waiting");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package xyz.nucleoid.plasmid.game.common;
package xyz.nucleoid.plasmid.api.game.common;

import net.minecraft.entity.boss.BossBar;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.text.Text;
import xyz.nucleoid.plasmid.game.GameActivity;
import xyz.nucleoid.plasmid.game.GameSpace;
import xyz.nucleoid.plasmid.game.common.widget.BossBarWidget;
import xyz.nucleoid.plasmid.game.common.widget.GameWidget;
import xyz.nucleoid.plasmid.game.common.widget.ScrollableSidebarWidget;
import xyz.nucleoid.plasmid.game.common.widget.SidebarWidget;
import xyz.nucleoid.plasmid.game.event.GameActivityEvents;
import xyz.nucleoid.plasmid.game.event.GamePlayerEvents;
import xyz.nucleoid.plasmid.api.game.GameSpace;
import xyz.nucleoid.plasmid.api.game.common.widget.BossBarWidget;
import xyz.nucleoid.plasmid.api.game.common.widget.GameWidget;
import xyz.nucleoid.plasmid.api.game.common.widget.ScrollableSidebarWidget;
import xyz.nucleoid.plasmid.api.game.event.GameActivityEvents;
import xyz.nucleoid.plasmid.api.game.event.GamePlayerEvents;
import xyz.nucleoid.plasmid.api.game.GameActivity;
import xyz.nucleoid.plasmid.api.game.common.widget.SidebarWidget;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package xyz.nucleoid.plasmid.game.common;
package xyz.nucleoid.plasmid.api.game.common;

import net.minecraft.component.DataComponentTypes;
import net.minecraft.component.type.AttributeModifierSlot;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package xyz.nucleoid.plasmid.game.common.config;
package xyz.nucleoid.plasmid.api.game.common.config;

import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
Expand Down
Loading

0 comments on commit 61ae525

Please sign in to comment.