Skip to content

Commit

Permalink
Add java headers
Browse files Browse the repository at this point in the history
  • Loading branch information
senseiwells committed Dec 18, 2024
1 parent d18b761 commit df8b98b
Show file tree
Hide file tree
Showing 125 changed files with 507 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ repositories {
}

dependencies {
include(modImplementation("net.casualchampionships:arcade:0.4.0-alpha.16+1.21.4")!!)
include(modImplementation("net.casualchampionships:arcade:0.4.0-beta.1+1.21.4")!!)
}
```

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.commands.ducks;

public interface DeletableCommand {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.commands.mixins;

import com.llamalad7.mixinextras.injector.ModifyReceiver;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.commands.mixins;

import com.mojang.brigadier.arguments.ArgumentType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.commands.mixins;

import net.minecraft.commands.synchronization.ArgumentTypeInfo;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.commands.mixins;

import com.mojang.brigadier.suggestion.SuggestionProvider;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.commands.mixins;

import com.mojang.brigadier.CommandDispatcher;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.commands.mixins;

import com.mojang.brigadier.tree.ArgumentCommandNode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.commands.mixins;

import net.casual.arcade.commands.hidden.HiddenCommandManager;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.commands.mixins;

import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.commands.mixins;

import net.casual.arcade.commands.hidden.HiddenCommandManager;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.dimensions.ducks;

import net.casual.arcade.dimensions.level.spawner.CustomMobSpawningRules;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
package net.casual.arcade.dimensions.mixins.vanilla;
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.dimensions.mixins.command;

import com.mojang.brigadier.context.CommandContext;
import net.minecraft.commands.CommandSourceStack;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.dimensions.mixins.command;

import com.mojang.brigadier.arguments.ArgumentType;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.dimensions.mixins.level;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.dimensions.mixins.level;

import net.minecraft.resources.ResourceKey;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.dimensions.mixins.level;

import com.google.common.collect.Lists;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.dimensions.mixins.level;

import net.minecraft.server.level.ServerLevel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.dimensions.mixins.level;

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.dimensions.mixins.level.spawning;

import net.casual.arcade.dimensions.ducks.CustomMobSpawningPredicate;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.dimensions.mixins.level.spawning;

import it.unimi.dsi.fastutil.objects.Object2IntMap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.dimensions.mixins.level.spawning;

import net.minecraft.world.level.NaturalSpawner;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.dimensions.mixins.level.spawning;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.dimensions.mixins.level.spawning;

import net.minecraft.world.level.LocalMobCapCalculator;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.dimensions.mixins.vanilla;

import net.casual.arcade.dimensions.level.vanilla.VanillaLikeLevel;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.dimensions.mixins.vanilla;

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.dimensions.mixins.vanilla;

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.dimensions.mixins.vanilla;

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.dimensions.mixins.vanilla;

import com.llamalad7.mixinextras.sugar.Local;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.dimensions.mixins.vanilla;

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.dimensions.mixins.vanilla;

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.dimensions.mixins.vanilla;

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import net.minecraft.resources.ResourceKey
import net.minecraft.server.MinecraftServer
import net.minecraft.server.level.ServerLevel
import net.minecraft.util.ProgressListener
import net.minecraft.world.level.ChunkPos
import net.minecraft.world.level.ForcedChunksSavedData
import net.minecraft.world.level.GameRules
import net.minecraft.world.level.Level
import net.minecraft.world.level.biome.BiomeManager
Expand All @@ -31,6 +33,7 @@ import org.jetbrains.annotations.ApiStatus.OverrideOnly
import java.io.IOException
import java.nio.file.Path
import java.util.concurrent.Executor
import java.util.function.BooleanSupplier
import kotlin.io.path.createParentDirectories

/**
Expand Down Expand Up @@ -82,8 +85,6 @@ public open class CustomLevel(
get() = this.levelData as DerivedLevelData

init {
this.loadCustomSpawners()

// In case of server crash, we should still delete temporary levels
if (!this.persistence.shouldSave()) {
PathUtils.deleteOnExit(server.getDimensionPath(key))
Expand All @@ -96,7 +97,9 @@ public open class CustomLevel(
*/
@OverrideOnly
public fun onLoad() {

this.loadCustomSpawners()
this.loadForcedChunks()
this.setSpawnSettings(this.server.isSpawningMonsters)
}

/**
Expand Down Expand Up @@ -157,6 +160,16 @@ public open class CustomLevel(
}
}

protected open fun loadForcedChunks() {
val forced = this.dataStorage.get(ForcedChunksSavedData.factory(), "chunks")
if (forced != null) {
val iter = forced.chunks.iterator()
while (iter.hasNext()) {
this.chunkSource.updateChunkForced(ChunkPos(iter.nextLong()), true)
}
}
}

public companion object {
/**
* This reads the custom dimension data for a given
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"vanilla.BaseFireBlockMixin",
"vanilla.EndPortalBlockMixin",
"vanilla.FallingBlockEntityMixin",
"vanilla.GameRuleCommandMixin",
"command.GameRuleCommandMixin",
"vanilla.NetherPortalBlockMixin",
"vanilla.ServerLevelMixin",
"vanilla.ServerPlayerMixin",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.events.client.mixins;

import net.casual.arcade.events.BuiltInEventPhases;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.events.client.mixins;

import com.llamalad7.mixinextras.sugar.Local;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.events.client.mixins;

import net.casual.arcade.events.BuiltInEventPhases;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.events.server.ducks;

import org.jetbrains.annotations.ApiStatus;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.events.server.mixins;

import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.events.server.mixins;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.events.server.mixins;

import net.minecraft.world.level.block.entity.BrewingStandBlockEntity;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.events.server.mixins;

import net.casual.arcade.events.GlobalEventHandler;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
* Copyright (c) 2024 senseiwells
* Licensed under the MIT License. See LICENSE file in the project root for details.
*/
package net.casual.arcade.events.server.mixins;

import com.llamalad7.mixinextras.sugar.Local;
Expand Down
Loading

0 comments on commit df8b98b

Please sign in to comment.