diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 18e1b13..0aac695 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,24 +6,18 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Cache - uses: actions/cache@v2 - with: - path: | - ~/.gradle/loom-cache - ~/.gradle/caches - key: gradle-${{hashFiles('**/*.gradle*')}} - restore-keys: gradle- - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Java - uses: actions/setup-java@v1 + uses: actions/setup-java@v4 with: - java-version: 17 + cache: gradle + distribution: microsoft + java-version: 21 - name: Build with Gradle run: gradle build - name: Upload Artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: artifacts path: build/libs \ No newline at end of file diff --git a/build.gradle b/build.gradle index f3bd8e2..52a4ede 100644 --- a/build.gradle +++ b/build.gradle @@ -1,11 +1,8 @@ plugins { - id "fabric-loom" version "1.5.7" + id "fabric-loom" version "1.9.2" id "maven-publish" } -sourceCompatibility = JavaVersion.VERSION_17 -targetCompatibility = JavaVersion.VERSION_17 - archivesBaseName = project.archives_base_name version = project.mod_version group = project.maven_group @@ -46,7 +43,13 @@ processResources { } } +java { + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 +} + tasks.withType(JavaCompile) { + options.release = 21 options.encoding = "UTF-8" } diff --git a/gradle.properties b/gradle.properties index 3afac03..180d42a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,9 +5,9 @@ mod_version = 1.0.0 org.gradle.jvmargs = -Xmx1G # Versions -minecraft_version = 1.20.4 -yarn_mappings = 1.20.4+build.3 -loader_version = 0.15.6 -fabric_version = 0.96.0+1.20.4 +minecraft_version = 1.21.3 +yarn_mappings = 1.21.3+build.2 +loader_version = 0.16.9 +fabric_version = 0.110.0+1.21.3 -plasmid_version = 0.5.102-SNAPSHOT+1.20.4 \ No newline at end of file +plasmid_version = 0.6.1+1.21.3 \ No newline at end of file diff --git a/src/main/java/io/github/haykam821/beaconbreakers/Main.java b/src/main/java/io/github/haykam821/beaconbreakers/Main.java index de71e79..c47cdf2 100644 --- a/src/main/java/io/github/haykam821/beaconbreakers/Main.java +++ b/src/main/java/io/github/haykam821/beaconbreakers/Main.java @@ -7,19 +7,23 @@ import net.minecraft.registry.RegistryKeys; import net.minecraft.registry.tag.TagKey; import net.minecraft.util.Identifier; -import xyz.nucleoid.plasmid.game.GameType; +import xyz.nucleoid.plasmid.api.game.GameType; public class Main implements ModInitializer { - public static final String MOD_ID = "beaconbreakers"; + private static final String MOD_ID = "beaconbreakers"; - private static final Identifier RESPAWN_BEACONS_ID = new Identifier(MOD_ID, "respawn_beacons"); + private static final Identifier RESPAWN_BEACONS_ID = Main.identifier("respawn_beacons"); public static final TagKey RESPAWN_BEACONS = TagKey.of(RegistryKeys.BLOCK, RESPAWN_BEACONS_ID); - private static final Identifier BEACON_BREAKERS_ID = new Identifier(MOD_ID, "beacon_breakers"); + private static final Identifier BEACON_BREAKERS_ID = Main.identifier("beacon_breakers"); public static final GameType BEACON_BREAKERS_TYPE = GameType.register(BEACON_BREAKERS_ID, BeaconBreakersConfig.CODEC, BeaconBreakersWaitingPhase::open); @Override public void onInitialize() { return; } + + public static Identifier identifier(String path) { + return Identifier.of(MOD_ID, path); + } } diff --git a/src/main/java/io/github/haykam821/beaconbreakers/game/BeaconBreakersConfig.java b/src/main/java/io/github/haykam821/beaconbreakers/game/BeaconBreakersConfig.java index f616767..ed53705 100644 --- a/src/main/java/io/github/haykam821/beaconbreakers/game/BeaconBreakersConfig.java +++ b/src/main/java/io/github/haykam821/beaconbreakers/game/BeaconBreakersConfig.java @@ -3,19 +3,20 @@ import java.util.Optional; import com.mojang.serialization.Codec; +import com.mojang.serialization.MapCodec; import com.mojang.serialization.codecs.RecordCodecBuilder; import io.github.haykam821.beaconbreakers.game.map.BeaconBreakersMapConfig; import net.minecraft.SharedConstants; import net.minecraft.util.math.intprovider.ConstantIntProvider; import net.minecraft.util.math.intprovider.IntProvider; -import xyz.nucleoid.plasmid.game.common.config.PlayerConfig; -import xyz.nucleoid.plasmid.game.common.team.GameTeamList; +import xyz.nucleoid.plasmid.api.game.common.config.WaitingLobbyConfig; +import xyz.nucleoid.plasmid.api.game.common.team.GameTeamList; public class BeaconBreakersConfig { - public static final Codec CODEC = RecordCodecBuilder.create(instance -> { + public static final MapCodec CODEC = RecordCodecBuilder.mapCodec(instance -> { return instance.group( - PlayerConfig.CODEC.fieldOf("players").forGetter(BeaconBreakersConfig::getPlayerConfig), + WaitingLobbyConfig.CODEC.fieldOf("players").forGetter(BeaconBreakersConfig::getPlayerConfig), BeaconBreakersMapConfig.CODEC.fieldOf("map").forGetter(BeaconBreakersConfig::getMapConfig), GameTeamList.CODEC.optionalFieldOf("teams").forGetter(BeaconBreakersConfig::getTeams), IntProvider.NON_NEGATIVE_CODEC.optionalFieldOf("ticks_until_close", ConstantIntProvider.create(SharedConstants.TICKS_PER_SECOND * 10)).forGetter(BeaconBreakersConfig::getTicksUntilClose), @@ -25,7 +26,7 @@ public class BeaconBreakersConfig { ).apply(instance, BeaconBreakersConfig::new); }); - private final PlayerConfig playerConfig; + private final WaitingLobbyConfig playerConfig; private final BeaconBreakersMapConfig mapConfig; private final Optional teams; private final IntProvider ticksUntilClose; @@ -33,7 +34,7 @@ public class BeaconBreakersConfig { private final boolean keepInventory; private final boolean allowSelfBreaking; - public BeaconBreakersConfig(PlayerConfig playerConfig, BeaconBreakersMapConfig mapConfig, Optional teams, IntProvider ticksUntilClose, int invulnerability, boolean keepInventory, boolean allowSelfBreaking) { + public BeaconBreakersConfig(WaitingLobbyConfig playerConfig, BeaconBreakersMapConfig mapConfig, Optional teams, IntProvider ticksUntilClose, int invulnerability, boolean keepInventory, boolean allowSelfBreaking) { this.playerConfig = playerConfig; this.mapConfig = mapConfig; this.teams = teams; @@ -43,7 +44,7 @@ public BeaconBreakersConfig(PlayerConfig playerConfig, BeaconBreakersMapConfig m this.allowSelfBreaking = allowSelfBreaking; } - public PlayerConfig getPlayerConfig() { + public WaitingLobbyConfig getPlayerConfig() { return this.playerConfig; } diff --git a/src/main/java/io/github/haykam821/beaconbreakers/game/BeaconBreakersSidebar.java b/src/main/java/io/github/haykam821/beaconbreakers/game/BeaconBreakersSidebar.java index ec74bb6..6ac49ec 100644 --- a/src/main/java/io/github/haykam821/beaconbreakers/game/BeaconBreakersSidebar.java +++ b/src/main/java/io/github/haykam821/beaconbreakers/game/BeaconBreakersSidebar.java @@ -3,8 +3,8 @@ import io.github.haykam821.beaconbreakers.game.phase.BeaconBreakersActivePhase; import io.github.haykam821.beaconbreakers.game.player.team.TeamEntry; import net.minecraft.text.Text; -import xyz.nucleoid.plasmid.game.common.GlobalWidgets; -import xyz.nucleoid.plasmid.game.common.widget.SidebarWidget; +import xyz.nucleoid.plasmid.api.game.common.GlobalWidgets; +import xyz.nucleoid.plasmid.api.game.common.widget.SidebarWidget; public class BeaconBreakersSidebar { private final SidebarWidget widget; diff --git a/src/main/java/io/github/haykam821/beaconbreakers/game/InvulnerabilityTimerBar.java b/src/main/java/io/github/haykam821/beaconbreakers/game/InvulnerabilityTimerBar.java index c1ad965..f1c606d 100644 --- a/src/main/java/io/github/haykam821/beaconbreakers/game/InvulnerabilityTimerBar.java +++ b/src/main/java/io/github/haykam821/beaconbreakers/game/InvulnerabilityTimerBar.java @@ -3,8 +3,8 @@ import io.github.haykam821.beaconbreakers.game.phase.BeaconBreakersActivePhase; import net.minecraft.entity.boss.BossBar; import net.minecraft.text.Text; -import xyz.nucleoid.plasmid.game.common.GlobalWidgets; -import xyz.nucleoid.plasmid.game.common.widget.BossBarWidget; +import xyz.nucleoid.plasmid.api.game.common.GlobalWidgets; +import xyz.nucleoid.plasmid.api.game.common.widget.BossBarWidget; public class InvulnerabilityTimerBar { private static final Text TITLE = Text.translatable("text.beaconbreakers.invulnerability.title"); diff --git a/src/main/java/io/github/haykam821/beaconbreakers/game/map/BeaconBreakersChunkGenerator.java b/src/main/java/io/github/haykam821/beaconbreakers/game/map/BeaconBreakersChunkGenerator.java index 6fbd0c1..ce09f76 100644 --- a/src/main/java/io/github/haykam821/beaconbreakers/game/map/BeaconBreakersChunkGenerator.java +++ b/src/main/java/io/github/haykam821/beaconbreakers/game/map/BeaconBreakersChunkGenerator.java @@ -1,7 +1,6 @@ package io.github.haykam821.beaconbreakers.game.map; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.Executor; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; @@ -15,7 +14,6 @@ import net.minecraft.world.biome.source.BiomeAccess; import net.minecraft.world.biome.source.BiomeSource; import net.minecraft.world.chunk.Chunk; -import net.minecraft.world.gen.GenerationStep.Carver; import net.minecraft.world.gen.StructureAccessor; import net.minecraft.world.gen.chunk.Blender; import net.minecraft.world.gen.chunk.ChunkGenerator; @@ -24,7 +22,7 @@ import net.minecraft.world.gen.chunk.VerticalBlockSample; import net.minecraft.world.gen.noise.NoiseConfig; import xyz.nucleoid.fantasy.util.ChunkGeneratorSettingsProvider; -import xyz.nucleoid.plasmid.game.world.generator.GameChunkGenerator; +import xyz.nucleoid.plasmid.api.game.world.generator.GameChunkGenerator; public final class BeaconBreakersChunkGenerator extends GameChunkGenerator implements ChunkGeneratorSettingsProvider { private static final BlockState BARRIER = Blocks.BARRIER.getDefaultState(); @@ -57,20 +55,20 @@ private boolean isChunkWithinArea(Chunk chunk) { } @Override - public CompletableFuture populateBiomes(Executor executor, NoiseConfig noiseConfig, Blender blender, StructureAccessor structures, Chunk chunk) { + public CompletableFuture populateBiomes(NoiseConfig noiseConfig, Blender blender, StructureAccessor structures, Chunk chunk) { if (this.isChunkWithinArea(chunk)) { - return this.chunkGenerator.populateBiomes(executor, noiseConfig, blender, structures, chunk); + return this.chunkGenerator.populateBiomes(noiseConfig, blender, structures, chunk); } else { - return super.populateBiomes(executor, noiseConfig, blender, structures, chunk); + return super.populateBiomes(noiseConfig, blender, structures, chunk); } } @Override - public CompletableFuture populateNoise(Executor executor, Blender blender, NoiseConfig noiseConfig, StructureAccessor structures, Chunk chunk) { + public CompletableFuture populateNoise(Blender blender, NoiseConfig noiseConfig, StructureAccessor structures, Chunk chunk) { if (this.isChunkWithinArea(chunk)) { - return this.chunkGenerator.populateNoise(executor, blender, noiseConfig, structures, chunk); + return this.chunkGenerator.populateNoise(blender, noiseConfig, structures, chunk); } - return super.populateNoise(executor, blender, noiseConfig, structures, chunk); + return super.populateNoise(blender, noiseConfig, structures, chunk); } @Override @@ -99,7 +97,7 @@ public void generateFeatures(StructureWorldAccess world, Chunk chunk, StructureA BlockPos.Mutable mutablePos = new BlockPos.Mutable(); int bottomY = chunk.getBottomY(); - int topY = chunk.getTopY() - 1; + int topY = chunk.getTopYInclusive(); // Top for (int x = 0; x < 16; x++) { @@ -151,9 +149,9 @@ public void generateFeatures(StructureWorldAccess world, Chunk chunk, StructureA } @Override - public void carve(ChunkRegion region, long seed, NoiseConfig noiseConfig, BiomeAccess access, StructureAccessor structures, Chunk chunk, Carver carver) { + public void carve(ChunkRegion region, long seed, NoiseConfig noiseConfig, BiomeAccess access, StructureAccessor structures, Chunk chunk) { if (this.isChunkWithinArea(chunk)) { - this.chunkGenerator.carve(region, seed, noiseConfig, access, structures, chunk, carver); + this.chunkGenerator.carve(region, seed, noiseConfig, access, structures, chunk); } } diff --git a/src/main/java/io/github/haykam821/beaconbreakers/game/phase/BeaconBreakersActivePhase.java b/src/main/java/io/github/haykam821/beaconbreakers/game/phase/BeaconBreakersActivePhase.java index 03be306..6ef678e 100644 --- a/src/main/java/io/github/haykam821/beaconbreakers/game/phase/BeaconBreakersActivePhase.java +++ b/src/main/java/io/github/haykam821/beaconbreakers/game/phase/BeaconBreakersActivePhase.java @@ -3,6 +3,8 @@ import java.util.Iterator; import java.util.List; import java.util.Optional; +import java.util.Set; +import java.util.UUID; import io.github.haykam821.beaconbreakers.Main; import io.github.haykam821.beaconbreakers.game.BeaconBreakersConfig; @@ -44,17 +46,22 @@ import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.explosion.Explosion; -import xyz.nucleoid.plasmid.game.GameCloseReason; -import xyz.nucleoid.plasmid.game.GameSpace; -import xyz.nucleoid.plasmid.game.common.GlobalWidgets; -import xyz.nucleoid.plasmid.game.common.team.TeamChat; -import xyz.nucleoid.plasmid.game.common.team.TeamManager; -import xyz.nucleoid.plasmid.game.common.team.TeamSelectionLobby; -import xyz.nucleoid.plasmid.game.event.GameActivityEvents; -import xyz.nucleoid.plasmid.game.event.GamePlayerEvents; -import xyz.nucleoid.plasmid.game.player.PlayerOffer; -import xyz.nucleoid.plasmid.game.player.PlayerOfferResult; -import xyz.nucleoid.plasmid.game.rule.GameRuleType; +import xyz.nucleoid.plasmid.api.game.GameCloseReason; +import xyz.nucleoid.plasmid.api.game.GameSpace; +import xyz.nucleoid.plasmid.api.game.GameTexts; +import xyz.nucleoid.plasmid.api.game.common.GlobalWidgets; +import xyz.nucleoid.plasmid.api.game.common.team.TeamChat; +import xyz.nucleoid.plasmid.api.game.common.team.TeamManager; +import xyz.nucleoid.plasmid.api.game.common.team.TeamSelectionLobby; +import xyz.nucleoid.plasmid.api.game.event.GameActivityEvents; +import xyz.nucleoid.plasmid.api.game.event.GamePlayerEvents; +import xyz.nucleoid.plasmid.api.game.player.JoinAcceptor; +import xyz.nucleoid.plasmid.api.game.player.JoinAcceptorResult; +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.util.PlayerPos; +import xyz.nucleoid.stimuli.event.EventResult; import xyz.nucleoid.stimuli.event.block.BlockBreakEvent; import xyz.nucleoid.stimuli.event.block.BlockUseEvent; import xyz.nucleoid.stimuli.event.item.ItemThrowEvent; @@ -114,7 +121,8 @@ public static void open(GameSpace gameSpace, ServerWorld world, TeamSelectionLob activity.listen(BlockBreakEvent.EVENT, active::onBreakBlock); activity.listen(GameActivityEvents.ENABLE, active::enable); activity.listen(GameActivityEvents.TICK, active::tick); - activity.listen(GamePlayerEvents.OFFER, active::offerPlayer); + activity.listen(GamePlayerEvents.ACCEPT, active::onAcceptPlayers); + activity.listen(GamePlayerEvents.OFFER, active::onOfferPlayers); activity.listen(PlayerDamageEvent.EVENT, active::onPlayerDamage); activity.listen(PlayerDeathEvent.EVENT, active::onPlayerDeath); activity.listen(GamePlayerEvents.REMOVE, active::removePlayer); @@ -242,32 +250,62 @@ private PlayerEntry getEntryFromPlayer(ServerPlayerEntity player) { return null; } - private PlayerOfferResult offerPlayer(PlayerOffer offer) { - ServerPlayerEntity player = offer.player(); - + private PlayerEntry getEntryByUuid(UUID uuid) { for (TeamEntry team : this.teams) { for (PlayerEntry entry : team.getPlayers()) { - if (player.getUuid().equals(entry.getUuid())) { + if (uuid.equals(entry.getUuid())) { + return entry; + } + } + } + return null; + } + + private JoinAcceptorResult onAcceptPlayers(JoinAcceptor acceptor) { + return acceptor.teleport(player -> { + if (acceptor.intent().canPlay()) { + PlayerEntry entry = this.getEntryByUuid(player.getId()); + + if (entry != null) { Vec3d spawnPos = this.getRespawnPos(entry); - if (spawnPos == null) { - spawnPos = BeaconBreakersActivePhase.getSpawnPos(world, map, this.config.getMapConfig(), player); + if (spawnPos != null) { + return new PlayerPos(this.world, spawnPos, 0, 0); } + } + } + + return new PlayerPos(this.world, BeaconBreakersActivePhase.getSpawnPos(world, map, this.config.getMapConfig()), 0, 0); + }).thenRunForEach(player -> { + if (acceptor.intent().canPlay()) { + PlayerEntry entry = this.getEntryByUuid(player.getUuid()); + + if (entry != null) { + entry.restorePlayer(player); + entry.initializePlayer(); - return offer.accept(this.world, spawnPos).and(() -> { - entry.restorePlayer(player); - entry.initializePlayer(); - }); + return; } } - } - Vec3d spawnPos = BeaconBreakersActivePhase.getSpawnPos(world, map, this.config.getMapConfig(), player); - return offer.accept(this.world, spawnPos).and(() -> { this.setSpectator(player); }); } + private JoinOfferResult onOfferPlayers(JoinOffer offer) { + for (UUID player : offer.playerIds()) { + PlayerEntry entry = this.getEntryByUuid(player); + + if (offer.intent().canPlay() && entry == null) { + return offer.reject(GameTexts.Join.spectatorsOnly()); + } else if (offer.intent().canSpectate() && entry != null) { + return offer.reject(GameTexts.Join.participantsOnly()); + } + } + + return offer.accept(); + } + private void removePlayer(ServerPlayerEntity player) { PlayerEntry entry = this.getEntryFromPlayer(player); @@ -288,7 +326,7 @@ private Vec3d getRespawnPos(PlayerEntry entry) { return null; } - int topY = this.world.getTopY() - 3; + int topY = this.world.getTopYInclusive() - 2; Optional spawnOptional = RespawnAnchorBlock.findRespawnPosition(EntityType.PLAYER, world, beaconPos); if (spawnOptional.isPresent()) { @@ -315,19 +353,19 @@ private ActionResult attemptBeaconRespawn(PlayerEntry entry) { return ActionResult.FAIL; } - entry.getPlayer().teleport(world, spawn.getX(), spawn.getY(), spawn.getZ(), 0, 0);; + entry.getPlayer().teleport(world, spawn.getX(), spawn.getY(), spawn.getZ(), Set.of(), 0, 0, true); return ActionResult.SUCCESS; } - private ActionResult onPlayerDamage(ServerPlayerEntity player, DamageSource source, float amount) { - return this.invulnerability > 0 || this.isGameEnding() ? ActionResult.FAIL : ActionResult.PASS; + private EventResult onPlayerDamage(ServerPlayerEntity player, DamageSource source, float amount) { + return this.invulnerability > 0 || this.isGameEnding() ? EventResult.DENY : EventResult.PASS; } - private ActionResult onPlayerDeath(ServerPlayerEntity player, DamageSource source) { + private EventResult onPlayerDeath(ServerPlayerEntity player, DamageSource source) { if (this.isGameEnding()) { BeaconBreakersActivePhase.spawn(this.world, this.map, this.config.getMapConfig(), player); - return ActionResult.FAIL; + return EventResult.DENY; } PlayerEntry entry = this.getEntryFromPlayer(player); @@ -338,7 +376,7 @@ private ActionResult onPlayerDeath(ServerPlayerEntity player, DamageSource sourc } if (!this.config.shouldKeepInventory()) { - entry.dropInventory(); + entry.dropInventory(source); } if (this.attemptBeaconRespawn(entry) == ActionResult.FAIL) { @@ -346,7 +384,7 @@ private ActionResult onPlayerDeath(ServerPlayerEntity player, DamageSource sourc BeaconBreakersActivePhase.spawn(this.world, this.map, this.config.getMapConfig(), entry.getPlayer()); } else { if (this.config.shouldKeepInventory()) { - entry.dropInventory(); + entry.dropInventory(source); } this.eliminate(entry); @@ -362,7 +400,7 @@ private ActionResult onPlayerDeath(ServerPlayerEntity player, DamageSource sourc player.getDamageTracker().update(); player.fallDistance = 0; - return ActionResult.FAIL; + return EventResult.DENY; } private void breakBeacon(PlayerEntry breaker, BlockPos pos, boolean explosion) { @@ -391,9 +429,9 @@ private void breakBeacon(PlayerEntry breaker, BlockPos pos, boolean explosion) { } } - private ActionResult onBreakBlock(ServerPlayerEntity player, ServerWorld world, BlockPos pos) { + private EventResult onBreakBlock(ServerPlayerEntity player, ServerWorld world, BlockPos pos) { PlayerEntry entry = this.getEntryFromPlayer(player); - if (entry == null) return ActionResult.PASS; + if (entry == null) return EventResult.PASS; BlockState state = world.getBlockState(pos); TeamEntry team = entry.getTeam(); @@ -410,20 +448,20 @@ private ActionResult onBreakBlock(ServerPlayerEntity player, ServerWorld world, player.sendMessage(team.getCannotBreakOwnBeaconMessage().formatted(Formatting.RED), false); } - return ActionResult.FAIL; + return EventResult.DENY; } - if (!state.isIn(Main.RESPAWN_BEACONS)) return ActionResult.SUCCESS; + if (!state.isIn(Main.RESPAWN_BEACONS)) return EventResult.ALLOW; if (this.invulnerability > 0) { player.sendMessage(Text.translatable("text.beaconbreakers.cannot_break_invulnerable_beacon").formatted(Formatting.RED), false); - return ActionResult.FAIL; + return EventResult.DENY; } this.breakBeacon(entry, pos, false); world.setBlockState(pos, state.getFluidState().getBlockState()); - return ActionResult.FAIL; + return EventResult.DENY; } private void afterBlockPlace(BlockPos pos, World world, ServerPlayerEntity player, ItemStack stack, BlockState state) { @@ -465,14 +503,13 @@ private ActionResult onUseBlock(ServerPlayerEntity player, Hand hand, BlockHitRe return ActionResult.PASS; } - private void onExplosionDetonated(Explosion explosion, boolean particles) { - if (explosion.world.isClient()) return; - ServerWorld world = (ServerWorld) explosion.world; + private EventResult onExplosionDetonated(Explosion explosion, List blocksToDestroy) { + ServerWorld world = explosion.getWorld(); LivingEntity causingEntity = explosion.getCausingEntity(); PlayerEntry entry = causingEntity instanceof ServerPlayerEntity player ? this.getEntryFromPlayer(player) : null; - Iterator iterator = explosion.getAffectedBlocks().iterator(); + Iterator iterator = blocksToDestroy.iterator(); while (iterator.hasNext()) { BlockPos pos = iterator.next(); @@ -496,19 +533,21 @@ private void onExplosionDetonated(Explosion explosion, boolean particles) { this.breakBeacon(entry, pos, true); world.setBlockState(pos, state.getFluidState().getBlockState()); } + + return EventResult.PASS; } @SuppressWarnings("deprecation") - private ActionResult onThrowItem(ServerPlayerEntity player, int slot, ItemStack stack) { + private EventResult onThrowItem(ServerPlayerEntity player, int slot, ItemStack stack) { if (stack.getItem() instanceof BlockItem blockItem) { RegistryEntry entry = blockItem.getBlock().getRegistryEntry(); if (entry.isIn(Main.RESPAWN_BEACONS)) { - return ActionResult.FAIL; + return EventResult.DENY; } } - return ActionResult.PASS; + return EventResult.PASS; } public GameSpace getGameSpace() { @@ -531,12 +570,12 @@ public Iterable getTeams() { return this.teams; } - public static Vec3d getSpawnPos(ServerWorld world, BeaconBreakersMap map, BeaconBreakersMapConfig mapConfig, ServerPlayerEntity player) { + public static Vec3d getSpawnPos(ServerWorld world, BeaconBreakersMap map, BeaconBreakersMapConfig mapConfig) { int x = mapConfig.getX() * 8; int z = mapConfig.getZ() * 8; int bottomY = world.getBottomY(); - int maxY = Math.min(world.getTopY(), bottomY + world.getLogicalHeight()) - 1; + int maxY = Math.min(world.getTopYInclusive(), bottomY + world.getLogicalHeight() - 1); BlockPos.Mutable pos = new BlockPos.Mutable(x, maxY, z); Chunk chunk = world.getChunk(pos); @@ -564,7 +603,7 @@ public static Vec3d getSpawnPos(ServerWorld world, BeaconBreakersMap map, Beacon } public static void spawn(ServerWorld world, BeaconBreakersMap map, BeaconBreakersMapConfig mapConfig, ServerPlayerEntity player) { - Vec3d spawnPos = BeaconBreakersActivePhase.getSpawnPos(world, map, mapConfig, player); - player.teleport(world, spawnPos.getX(), spawnPos.getY(), spawnPos.getZ(), 0, 0); + Vec3d spawnPos = BeaconBreakersActivePhase.getSpawnPos(world, map, mapConfig); + player.teleport(world, spawnPos.getX(), spawnPos.getY(), spawnPos.getZ(), Set.of(), 0, 0, true); } } diff --git a/src/main/java/io/github/haykam821/beaconbreakers/game/phase/BeaconBreakersWaitingPhase.java b/src/main/java/io/github/haykam821/beaconbreakers/game/phase/BeaconBreakersWaitingPhase.java index 520c49d..83ea0d5 100644 --- a/src/main/java/io/github/haykam821/beaconbreakers/game/phase/BeaconBreakersWaitingPhase.java +++ b/src/main/java/io/github/haykam821/beaconbreakers/game/phase/BeaconBreakersWaitingPhase.java @@ -6,23 +6,24 @@ import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; -import net.minecraft.util.ActionResult; import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.random.RandomSeed; import net.minecraft.world.GameMode; import net.minecraft.world.dimension.DimensionType; import xyz.nucleoid.fantasy.RuntimeWorldConfig; -import xyz.nucleoid.plasmid.game.GameOpenContext; -import xyz.nucleoid.plasmid.game.GameOpenProcedure; -import xyz.nucleoid.plasmid.game.GameResult; -import xyz.nucleoid.plasmid.game.GameSpace; -import xyz.nucleoid.plasmid.game.common.GameWaitingLobby; -import xyz.nucleoid.plasmid.game.common.team.TeamSelectionLobby; -import xyz.nucleoid.plasmid.game.event.GameActivityEvents; -import xyz.nucleoid.plasmid.game.event.GamePlayerEvents; -import xyz.nucleoid.plasmid.game.player.PlayerOffer; -import xyz.nucleoid.plasmid.game.player.PlayerOfferResult; -import xyz.nucleoid.plasmid.game.rule.GameRuleType; +import xyz.nucleoid.plasmid.api.game.GameOpenContext; +import xyz.nucleoid.plasmid.api.game.GameOpenProcedure; +import xyz.nucleoid.plasmid.api.game.GameResult; +import xyz.nucleoid.plasmid.api.game.GameSpace; +import xyz.nucleoid.plasmid.api.game.common.GameWaitingLobby; +import xyz.nucleoid.plasmid.api.game.common.team.TeamSelectionLobby; +import xyz.nucleoid.plasmid.api.game.event.GameActivityEvents; +import xyz.nucleoid.plasmid.api.game.event.GamePlayerEvents; +import xyz.nucleoid.plasmid.api.game.player.JoinAcceptor; +import xyz.nucleoid.plasmid.api.game.player.JoinAcceptorResult; +import xyz.nucleoid.plasmid.api.game.player.JoinOffer; +import xyz.nucleoid.plasmid.api.game.rule.GameRuleType; +import xyz.nucleoid.stimuli.event.EventResult; import xyz.nucleoid.stimuli.event.player.PlayerDamageEvent; import xyz.nucleoid.stimuli.event.player.PlayerDeathEvent; @@ -71,7 +72,8 @@ public static GameOpenProcedure open(GameOpenContext conte // Listeners activity.listen(PlayerDamageEvent.EVENT, waiting::onPlayerDamage); activity.listen(PlayerDeathEvent.EVENT, waiting::onPlayerDeath); - activity.listen(GamePlayerEvents.OFFER, waiting::offerPlayer); + activity.listen(GamePlayerEvents.ACCEPT, waiting::onAcceptPlayers); + activity.listen(GamePlayerEvents.OFFER, JoinOffer::accept); activity.listen(GameActivityEvents.REQUEST_START, waiting::requestStart); }); } @@ -81,21 +83,21 @@ private GameResult requestStart() { return GameResult.ok(); } - private PlayerOfferResult offerPlayer(PlayerOffer offer) { - Vec3d spawnPos = BeaconBreakersActivePhase.getSpawnPos(this.world, this.map, this.config.getMapConfig(), offer.player()); - return offer.accept(this.world, spawnPos).and(() -> { - offer.player().changeGameMode(GameMode.ADVENTURE); + private JoinAcceptorResult onAcceptPlayers(JoinAcceptor acceptor) { + Vec3d spawnPos = BeaconBreakersActivePhase.getSpawnPos(this.world, this.map, this.config.getMapConfig()); + return acceptor.teleport(this.world, spawnPos).thenRunForEach(player -> { + player.changeGameMode(GameMode.ADVENTURE); }); } - private ActionResult onPlayerDamage(ServerPlayerEntity player, DamageSource source, float amount) { - return ActionResult.FAIL; + private EventResult onPlayerDamage(ServerPlayerEntity player, DamageSource source, float amount) { + return EventResult.DENY; } - private ActionResult onPlayerDeath(ServerPlayerEntity player, DamageSource source) { + private EventResult onPlayerDeath(ServerPlayerEntity player, DamageSource source) { // Respawn player BeaconBreakersActivePhase.spawn(this.world, this.map, this.config.getMapConfig(), player); player.setHealth(player.getMaxHealth()); - return ActionResult.FAIL; + return EventResult.DENY; } } diff --git a/src/main/java/io/github/haykam821/beaconbreakers/game/player/PlayerEntry.java b/src/main/java/io/github/haykam821/beaconbreakers/game/player/PlayerEntry.java index 5ee4758..af81ff5 100644 --- a/src/main/java/io/github/haykam821/beaconbreakers/game/player/PlayerEntry.java +++ b/src/main/java/io/github/haykam821/beaconbreakers/game/player/PlayerEntry.java @@ -6,16 +6,18 @@ import io.github.haykam821.beaconbreakers.Main; import io.github.haykam821.beaconbreakers.game.player.team.TeamEntry; import net.minecraft.block.Block; +import net.minecraft.entity.damage.DamageSource; import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffects; import net.minecraft.item.ItemStack; -import net.minecraft.registry.Registries; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.RegistryWrapper; import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.registry.entry.RegistryEntryList; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.text.Text; import net.minecraft.world.GameMode; -import xyz.nucleoid.plasmid.util.InventoryUtil; +import xyz.nucleoid.plasmid.api.util.InventoryUtil; public class PlayerEntry { private ServerPlayerEntity player; @@ -58,7 +60,9 @@ public void giveRespawnBeacon() { if (this.player == null) return; if (!(this.team.getBeacon() instanceof BeaconPlacement.Unplaced)) return; - Optional> maybeBeacons = Registries.BLOCK.getEntryList(Main.RESPAWN_BEACONS); + RegistryWrapper.WrapperLookup registries = this.player.getWorld().getRegistryManager(); + RegistryWrapper blocks = registries.getOrThrow(RegistryKeys.BLOCK); + Optional> maybeBeacons = blocks.getOptional(Main.RESPAWN_BEACONS); if (maybeBeacons.isPresent()) { Optional> maybeBeacon = maybeBeacons.get().getRandom(this.player.getRandom()); if (maybeBeacon.isPresent()) { @@ -84,11 +88,11 @@ public void initializePlayer() { this.player.addStatusEffect(new StatusEffectInstance(StatusEffects.SATURATION, invulnerability, 127, true, false)); } - public void dropInventory() { + public void dropInventory(DamageSource source) { this.player.vanishCursedItems(); this.player.getInventory().dropAll(); - this.player.dropXp(); + this.player.dropXp(this.player.getServerWorld(), source.getAttacker()); this.player.dropShoulderEntities(); } diff --git a/src/main/java/io/github/haykam821/beaconbreakers/game/player/team/MultipleTeamEntry.java b/src/main/java/io/github/haykam821/beaconbreakers/game/player/team/MultipleTeamEntry.java index 0025fb5..9b7fa12 100644 --- a/src/main/java/io/github/haykam821/beaconbreakers/game/player/team/MultipleTeamEntry.java +++ b/src/main/java/io/github/haykam821/beaconbreakers/game/player/team/MultipleTeamEntry.java @@ -12,13 +12,13 @@ import net.minecraft.scoreboard.Team; import net.minecraft.text.MutableText; import net.minecraft.text.Text; -import xyz.nucleoid.plasmid.game.common.team.GameTeam; -import xyz.nucleoid.plasmid.game.common.team.GameTeamConfig; -import xyz.nucleoid.plasmid.game.common.team.GameTeamKey; -import xyz.nucleoid.plasmid.game.common.team.GameTeamList; -import xyz.nucleoid.plasmid.game.common.team.TeamManager; -import xyz.nucleoid.plasmid.game.common.team.TeamSelectionLobby; -import xyz.nucleoid.plasmid.game.player.PlayerSet; +import xyz.nucleoid.plasmid.api.game.common.team.GameTeam; +import xyz.nucleoid.plasmid.api.game.common.team.GameTeamConfig; +import xyz.nucleoid.plasmid.api.game.common.team.GameTeamKey; +import xyz.nucleoid.plasmid.api.game.common.team.GameTeamList; +import xyz.nucleoid.plasmid.api.game.common.team.TeamManager; +import xyz.nucleoid.plasmid.api.game.common.team.TeamSelectionLobby; +import xyz.nucleoid.plasmid.api.game.player.PlayerSet; public class MultipleTeamEntry extends TeamEntry { private final List players = new ArrayList<>(); diff --git a/src/main/java/io/github/haykam821/beaconbreakers/game/player/team/SingleTeamEntry.java b/src/main/java/io/github/haykam821/beaconbreakers/game/player/team/SingleTeamEntry.java index 2b91c43..9b00a68 100644 --- a/src/main/java/io/github/haykam821/beaconbreakers/game/player/team/SingleTeamEntry.java +++ b/src/main/java/io/github/haykam821/beaconbreakers/game/player/team/SingleTeamEntry.java @@ -10,7 +10,7 @@ import io.github.haykam821.beaconbreakers.game.player.PlayerEntry; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.text.Text; -import xyz.nucleoid.plasmid.game.player.PlayerSet; +import xyz.nucleoid.plasmid.api.game.player.PlayerSet; public class SingleTeamEntry extends TeamEntry { private PlayerEntry player = null; diff --git a/src/main/resources/beaconbreakers.accesswidener b/src/main/resources/beaconbreakers.accesswidener index 4e16fdd..9d34f25 100644 --- a/src/main/resources/beaconbreakers.accesswidener +++ b/src/main/resources/beaconbreakers.accesswidener @@ -1,6 +1,5 @@ accessWidener v1 named -accessible method net/minecraft/entity/LivingEntity dropXp ()V +accessible method net/minecraft/entity/LivingEntity dropXp (Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/entity/Entity;)V accessible method net/minecraft/entity/player/PlayerEntity vanishCursedItems ()V accessible method net/minecraft/entity/player/PlayerEntity dropShoulderEntities ()V -accessible field net/minecraft/world/explosion/Explosion world Lnet/minecraft/world/World; accessible method net/minecraft/world/biome/source/MultiNoiseBiomeSource getBiomeEntries ()Lnet/minecraft/world/biome/source/util/MultiNoiseUtil$Entries; \ No newline at end of file diff --git a/src/main/resources/data/beaconbreakers/games/amplified_beacon_breakers.json b/src/main/resources/data/beaconbreakers/plasmid/game/amplified_beacon_breakers.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/amplified_beacon_breakers.json rename to src/main/resources/data/beaconbreakers/plasmid/game/amplified_beacon_breakers.json diff --git a/src/main/resources/data/beaconbreakers/games/amplified_beacon_breakers_2_teams.json b/src/main/resources/data/beaconbreakers/plasmid/game/amplified_beacon_breakers_2_teams.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/amplified_beacon_breakers_2_teams.json rename to src/main/resources/data/beaconbreakers/plasmid/game/amplified_beacon_breakers_2_teams.json diff --git a/src/main/resources/data/beaconbreakers/games/amplified_beacon_breakers_4_teams.json b/src/main/resources/data/beaconbreakers/plasmid/game/amplified_beacon_breakers_4_teams.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/amplified_beacon_breakers_4_teams.json rename to src/main/resources/data/beaconbreakers/plasmid/game/amplified_beacon_breakers_4_teams.json diff --git a/src/main/resources/data/beaconbreakers/games/amplified_beacon_breakers_keep_inventory.json b/src/main/resources/data/beaconbreakers/plasmid/game/amplified_beacon_breakers_keep_inventory.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/amplified_beacon_breakers_keep_inventory.json rename to src/main/resources/data/beaconbreakers/plasmid/game/amplified_beacon_breakers_keep_inventory.json diff --git a/src/main/resources/data/beaconbreakers/games/amplified_beacon_breakers_keep_inventory_2_teams.json b/src/main/resources/data/beaconbreakers/plasmid/game/amplified_beacon_breakers_keep_inventory_2_teams.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/amplified_beacon_breakers_keep_inventory_2_teams.json rename to src/main/resources/data/beaconbreakers/plasmid/game/amplified_beacon_breakers_keep_inventory_2_teams.json diff --git a/src/main/resources/data/beaconbreakers/games/amplified_beacon_breakers_keep_inventory_4_teams.json b/src/main/resources/data/beaconbreakers/plasmid/game/amplified_beacon_breakers_keep_inventory_4_teams.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/amplified_beacon_breakers_keep_inventory_4_teams.json rename to src/main/resources/data/beaconbreakers/plasmid/game/amplified_beacon_breakers_keep_inventory_4_teams.json diff --git a/src/main/resources/data/beaconbreakers/games/amplified_beacon_breakers_tiny.json b/src/main/resources/data/beaconbreakers/plasmid/game/amplified_beacon_breakers_tiny.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/amplified_beacon_breakers_tiny.json rename to src/main/resources/data/beaconbreakers/plasmid/game/amplified_beacon_breakers_tiny.json diff --git a/src/main/resources/data/beaconbreakers/games/amplified_beacon_breakers_tiny_2_teams.json b/src/main/resources/data/beaconbreakers/plasmid/game/amplified_beacon_breakers_tiny_2_teams.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/amplified_beacon_breakers_tiny_2_teams.json rename to src/main/resources/data/beaconbreakers/plasmid/game/amplified_beacon_breakers_tiny_2_teams.json diff --git a/src/main/resources/data/beaconbreakers/games/amplified_beacon_breakers_tiny_4_teams.json b/src/main/resources/data/beaconbreakers/plasmid/game/amplified_beacon_breakers_tiny_4_teams.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/amplified_beacon_breakers_tiny_4_teams.json rename to src/main/resources/data/beaconbreakers/plasmid/game/amplified_beacon_breakers_tiny_4_teams.json diff --git a/src/main/resources/data/beaconbreakers/games/end_beacon_breakers.json b/src/main/resources/data/beaconbreakers/plasmid/game/end_beacon_breakers.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/end_beacon_breakers.json rename to src/main/resources/data/beaconbreakers/plasmid/game/end_beacon_breakers.json diff --git a/src/main/resources/data/beaconbreakers/games/end_beacon_breakers_2_teams.json b/src/main/resources/data/beaconbreakers/plasmid/game/end_beacon_breakers_2_teams.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/end_beacon_breakers_2_teams.json rename to src/main/resources/data/beaconbreakers/plasmid/game/end_beacon_breakers_2_teams.json diff --git a/src/main/resources/data/beaconbreakers/games/end_beacon_breakers_4_teams.json b/src/main/resources/data/beaconbreakers/plasmid/game/end_beacon_breakers_4_teams.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/end_beacon_breakers_4_teams.json rename to src/main/resources/data/beaconbreakers/plasmid/game/end_beacon_breakers_4_teams.json diff --git a/src/main/resources/data/beaconbreakers/games/end_beacon_breakers_keep_inventory.json b/src/main/resources/data/beaconbreakers/plasmid/game/end_beacon_breakers_keep_inventory.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/end_beacon_breakers_keep_inventory.json rename to src/main/resources/data/beaconbreakers/plasmid/game/end_beacon_breakers_keep_inventory.json diff --git a/src/main/resources/data/beaconbreakers/games/end_beacon_breakers_keep_inventory_2_teams.json b/src/main/resources/data/beaconbreakers/plasmid/game/end_beacon_breakers_keep_inventory_2_teams.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/end_beacon_breakers_keep_inventory_2_teams.json rename to src/main/resources/data/beaconbreakers/plasmid/game/end_beacon_breakers_keep_inventory_2_teams.json diff --git a/src/main/resources/data/beaconbreakers/games/end_beacon_breakers_keep_inventory_4_teams.json b/src/main/resources/data/beaconbreakers/plasmid/game/end_beacon_breakers_keep_inventory_4_teams.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/end_beacon_breakers_keep_inventory_4_teams.json rename to src/main/resources/data/beaconbreakers/plasmid/game/end_beacon_breakers_keep_inventory_4_teams.json diff --git a/src/main/resources/data/beaconbreakers/games/end_beacon_breakers_tiny.json b/src/main/resources/data/beaconbreakers/plasmid/game/end_beacon_breakers_tiny.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/end_beacon_breakers_tiny.json rename to src/main/resources/data/beaconbreakers/plasmid/game/end_beacon_breakers_tiny.json diff --git a/src/main/resources/data/beaconbreakers/games/end_beacon_breakers_tiny_2_teams.json b/src/main/resources/data/beaconbreakers/plasmid/game/end_beacon_breakers_tiny_2_teams.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/end_beacon_breakers_tiny_2_teams.json rename to src/main/resources/data/beaconbreakers/plasmid/game/end_beacon_breakers_tiny_2_teams.json diff --git a/src/main/resources/data/beaconbreakers/games/end_beacon_breakers_tiny_4_teams.json b/src/main/resources/data/beaconbreakers/plasmid/game/end_beacon_breakers_tiny_4_teams.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/end_beacon_breakers_tiny_4_teams.json rename to src/main/resources/data/beaconbreakers/plasmid/game/end_beacon_breakers_tiny_4_teams.json diff --git a/src/main/resources/data/beaconbreakers/games/nether_beacon_breakers.json b/src/main/resources/data/beaconbreakers/plasmid/game/nether_beacon_breakers.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/nether_beacon_breakers.json rename to src/main/resources/data/beaconbreakers/plasmid/game/nether_beacon_breakers.json diff --git a/src/main/resources/data/beaconbreakers/games/nether_beacon_breakers_2_teams.json b/src/main/resources/data/beaconbreakers/plasmid/game/nether_beacon_breakers_2_teams.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/nether_beacon_breakers_2_teams.json rename to src/main/resources/data/beaconbreakers/plasmid/game/nether_beacon_breakers_2_teams.json diff --git a/src/main/resources/data/beaconbreakers/games/nether_beacon_breakers_4_teams.json b/src/main/resources/data/beaconbreakers/plasmid/game/nether_beacon_breakers_4_teams.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/nether_beacon_breakers_4_teams.json rename to src/main/resources/data/beaconbreakers/plasmid/game/nether_beacon_breakers_4_teams.json diff --git a/src/main/resources/data/beaconbreakers/games/nether_beacon_breakers_keep_inventory.json b/src/main/resources/data/beaconbreakers/plasmid/game/nether_beacon_breakers_keep_inventory.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/nether_beacon_breakers_keep_inventory.json rename to src/main/resources/data/beaconbreakers/plasmid/game/nether_beacon_breakers_keep_inventory.json diff --git a/src/main/resources/data/beaconbreakers/games/nether_beacon_breakers_keep_inventory_2_teams.json b/src/main/resources/data/beaconbreakers/plasmid/game/nether_beacon_breakers_keep_inventory_2_teams.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/nether_beacon_breakers_keep_inventory_2_teams.json rename to src/main/resources/data/beaconbreakers/plasmid/game/nether_beacon_breakers_keep_inventory_2_teams.json diff --git a/src/main/resources/data/beaconbreakers/games/nether_beacon_breakers_keep_inventory_4_teams.json b/src/main/resources/data/beaconbreakers/plasmid/game/nether_beacon_breakers_keep_inventory_4_teams.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/nether_beacon_breakers_keep_inventory_4_teams.json rename to src/main/resources/data/beaconbreakers/plasmid/game/nether_beacon_breakers_keep_inventory_4_teams.json diff --git a/src/main/resources/data/beaconbreakers/games/nether_beacon_breakers_tiny.json b/src/main/resources/data/beaconbreakers/plasmid/game/nether_beacon_breakers_tiny.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/nether_beacon_breakers_tiny.json rename to src/main/resources/data/beaconbreakers/plasmid/game/nether_beacon_breakers_tiny.json diff --git a/src/main/resources/data/beaconbreakers/games/nether_beacon_breakers_tiny_2_teams.json b/src/main/resources/data/beaconbreakers/plasmid/game/nether_beacon_breakers_tiny_2_teams.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/nether_beacon_breakers_tiny_2_teams.json rename to src/main/resources/data/beaconbreakers/plasmid/game/nether_beacon_breakers_tiny_2_teams.json diff --git a/src/main/resources/data/beaconbreakers/games/nether_beacon_breakers_tiny_4_teams.json b/src/main/resources/data/beaconbreakers/plasmid/game/nether_beacon_breakers_tiny_4_teams.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/nether_beacon_breakers_tiny_4_teams.json rename to src/main/resources/data/beaconbreakers/plasmid/game/nether_beacon_breakers_tiny_4_teams.json diff --git a/src/main/resources/data/beaconbreakers/games/standard_beacon_breakers.json b/src/main/resources/data/beaconbreakers/plasmid/game/standard_beacon_breakers.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/standard_beacon_breakers.json rename to src/main/resources/data/beaconbreakers/plasmid/game/standard_beacon_breakers.json diff --git a/src/main/resources/data/beaconbreakers/games/standard_beacon_breakers_2_teams.json b/src/main/resources/data/beaconbreakers/plasmid/game/standard_beacon_breakers_2_teams.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/standard_beacon_breakers_2_teams.json rename to src/main/resources/data/beaconbreakers/plasmid/game/standard_beacon_breakers_2_teams.json diff --git a/src/main/resources/data/beaconbreakers/games/standard_beacon_breakers_4_teams.json b/src/main/resources/data/beaconbreakers/plasmid/game/standard_beacon_breakers_4_teams.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/standard_beacon_breakers_4_teams.json rename to src/main/resources/data/beaconbreakers/plasmid/game/standard_beacon_breakers_4_teams.json diff --git a/src/main/resources/data/beaconbreakers/games/standard_beacon_breakers_keep_inventory.json b/src/main/resources/data/beaconbreakers/plasmid/game/standard_beacon_breakers_keep_inventory.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/standard_beacon_breakers_keep_inventory.json rename to src/main/resources/data/beaconbreakers/plasmid/game/standard_beacon_breakers_keep_inventory.json diff --git a/src/main/resources/data/beaconbreakers/games/standard_beacon_breakers_keep_inventory_2_teams.json b/src/main/resources/data/beaconbreakers/plasmid/game/standard_beacon_breakers_keep_inventory_2_teams.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/standard_beacon_breakers_keep_inventory_2_teams.json rename to src/main/resources/data/beaconbreakers/plasmid/game/standard_beacon_breakers_keep_inventory_2_teams.json diff --git a/src/main/resources/data/beaconbreakers/games/standard_beacon_breakers_keep_inventory_4_teams.json b/src/main/resources/data/beaconbreakers/plasmid/game/standard_beacon_breakers_keep_inventory_4_teams.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/standard_beacon_breakers_keep_inventory_4_teams.json rename to src/main/resources/data/beaconbreakers/plasmid/game/standard_beacon_breakers_keep_inventory_4_teams.json diff --git a/src/main/resources/data/beaconbreakers/games/standard_beacon_breakers_tiny.json b/src/main/resources/data/beaconbreakers/plasmid/game/standard_beacon_breakers_tiny.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/standard_beacon_breakers_tiny.json rename to src/main/resources/data/beaconbreakers/plasmid/game/standard_beacon_breakers_tiny.json diff --git a/src/main/resources/data/beaconbreakers/games/standard_beacon_breakers_tiny_2_teams.json b/src/main/resources/data/beaconbreakers/plasmid/game/standard_beacon_breakers_tiny_2_teams.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/standard_beacon_breakers_tiny_2_teams.json rename to src/main/resources/data/beaconbreakers/plasmid/game/standard_beacon_breakers_tiny_2_teams.json diff --git a/src/main/resources/data/beaconbreakers/games/standard_beacon_breakers_tiny_4_teams.json b/src/main/resources/data/beaconbreakers/plasmid/game/standard_beacon_breakers_tiny_4_teams.json similarity index 100% rename from src/main/resources/data/beaconbreakers/games/standard_beacon_breakers_tiny_4_teams.json rename to src/main/resources/data/beaconbreakers/plasmid/game/standard_beacon_breakers_tiny_4_teams.json diff --git a/src/main/resources/data/beaconbreakers/tags/blocks/respawn_beacons.json b/src/main/resources/data/beaconbreakers/tags/block/respawn_beacons.json similarity index 100% rename from src/main/resources/data/beaconbreakers/tags/blocks/respawn_beacons.json rename to src/main/resources/data/beaconbreakers/tags/block/respawn_beacons.json diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 738ef68..9ebf44c 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -24,6 +24,7 @@ "icon": "assets/beaconbreakers/icon.png", "depends": { "fabricloader": ">=0.8.0", - "plasmid": ">=0.5.0" + "java": ">=21", + "plasmid": ">=0.6.0" } } \ No newline at end of file