Skip to content
Merged
Show file tree
Hide file tree
Changes from 71 commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
59181d1
Third party world generator support + rewrite CubicPlayerManager
RecursivePineapple Apr 7, 2026
9bbe100
Sort out chunk + cube ticking
RecursivePineapple Apr 8, 2026
6f0e392
Reduce allocations
RecursivePineapple Apr 8, 2026
29d141c
Cleanup
RecursivePineapple Apr 8, 2026
5dd87b5
Update buildscript
RecursivePineapple Apr 8, 2026
801f620
:prayge: it works + cleanup
RecursivePineapple Apr 10, 2026
0759cc0
Last round of fixes
RecursivePineapple Apr 11, 2026
c8d7a31
Sync per player
RecursivePineapple Apr 11, 2026
15ecac4
Don't reuse player array
RecursivePineapple Apr 11, 2026
d8c4b43
oops :innocent:
RecursivePineapple Apr 12, 2026
f2cea19
cleanup packet creation
RecursivePineapple Apr 12, 2026
392ad03
spotless
RecursivePineapple Apr 12, 2026
6035dc9
Fix client height map
RecursivePineapple Apr 12, 2026
40730e8
Update dependencies.gradle
RecursivePineapple Apr 14, 2026
dff74e2
Update CubeProviderServer.java
RecursivePineapple Apr 14, 2026
d362333
Introduce pooled zero sized EBS array + fix shrinking issue with tick…
RecursivePineapple May 25, 2026
26ec0cb
Fix crash when running /help command
RecursivePineapple May 25, 2026
ccc5931
Init light manager in the world constructors
RecursivePineapple May 25, 2026
fedbcd9
Remove list from cube packet
RecursivePineapple May 25, 2026
c059d79
Move contents of _Column into _Cubes
RecursivePineapple May 25, 2026
cb0f046
Remove _Column mixin
RecursivePineapple May 25, 2026
d6d4a4f
Rename _Cubes into MixinChunk
RecursivePineapple May 25, 2026
1971c37
Fix trivial MixinChunk warnings
RecursivePineapple May 25, 2026
fba1d7d
Add Overrides + more cleanup
RecursivePineapple May 25, 2026
be10f74
Replace redundant references to ICube in MixinChunk (et al) with dire…
RecursivePineapple May 26, 2026
d1ba159
Clean up entity list mixins in MixinChunk
RecursivePineapple May 26, 2026
c04f36a
Minor clean up + reformatting
RecursivePineapple May 26, 2026
769800f
Remove redundant EBS mixins in MixinChunk
RecursivePineapple May 26, 2026
6a34777
Fix chunks per second tracker not printing anything
RecursivePineapple May 26, 2026
9547c76
Call onSendCubes again
RecursivePineapple May 26, 2026
a073411
Fix sync issues related to cube/column watching
RecursivePineapple May 26, 2026
579bf4b
Remove 'optimized' compat generator hook and replace it with code tha…
RecursivePineapple May 26, 2026
00a6cad
Merge remote-tracking branch 'upstream/world-generators-and-player-ma…
RecursivePineapple May 26, 2026
8ece4a0
Fix whitespace
RecursivePineapple May 26, 2026
3a6b59b
spotless
RecursivePineapple May 26, 2026
ed87537
Swap dirty block ShortArrayList -> ShortOpenHashSet
RecursivePineapple May 26, 2026
8945bd2
Make isCubeWatched/isColumnWatched more efficient
RecursivePineapple May 26, 2026
64eb8e2
Remove unused Cube.lastTicked + Cube.checkAndUpdateTick
RecursivePineapple May 26, 2026
a502f70
Sort out cube + chunk events
RecursivePineapple May 26, 2026
c2f83a2
.size() -> .cardinality()
RecursivePineapple May 26, 2026
05f6f77
AddressTools add &0xF to getLocalAddress for column
RecursivePineapple May 26, 2026
7bd5433
CuboidalCubeSelector typo
RecursivePineapple May 26, 2026
2377299
Make ColumnTileEntityMap methods behave more similarly
RecursivePineapple May 26, 2026
b36200a
spotless
RecursivePineapple May 26, 2026
026dc4e
Rename WSSM methods
RecursivePineapple May 26, 2026
7709ae5
Mark unwatched cubes dirty
RecursivePineapple May 26, 2026
b212e0a
Fix cubes rarely getting unwatched
RecursivePineapple May 26, 2026
5ea56bc
Split CubeStackBlockView ctor into factory methods
RecursivePineapple May 26, 2026
6a6bd80
Fix NPE in wireless redstone (from full pack)
RecursivePineapple May 26, 2026
121e476
spotless
RecursivePineapple May 26, 2026
2312907
Restore Chunk.inhabitedTime increment
RecursivePineapple May 26, 2026
74d5eba
Merge branch 'master' into world-generators-and-player-manager
RecursivePineapple May 26, 2026
57e0ab2
Merge fixes
RecursivePineapple May 26, 2026
cd15cfc
Guard for null columns
RecursivePineapple May 26, 2026
939cdcd
Remove player.isWatchingColumn
RecursivePineapple May 26, 2026
b3740df
Whitespace changes that got skipped
RecursivePineapple May 26, 2026
c4081b9
Remove redundant getTopFilledSegment inject because it breaks special…
RecursivePineapple May 26, 2026
1879693
spotless
RecursivePineapple May 26, 2026
fa7d4ec
Pull player map + array into separate wrapper collection
RecursivePineapple May 26, 2026
939fb09
Rename PacketEncoderCubes
RecursivePineapple May 28, 2026
f89a7b5
Defer WorldServer init to prevent ChunkEvent.Load from being sent bef…
RecursivePineapple May 28, 2026
fbcb2e0
Remove commented out method
RecursivePineapple May 28, 2026
f545054
Remove CompatHandler fakeWorldHeight code because no mod ever expects…
RecursivePineapple May 28, 2026
5026348
Make a MC mixin early
RecursivePineapple May 28, 2026
5fd55d1
Rename BlockPosMap -> HashMap3D
RecursivePineapple May 28, 2026
0857fc0
Replace custom Tuple with fastutils Pair
RecursivePineapple May 28, 2026
87ea96c
Minor Cleanup
RecursivePineapple May 28, 2026
f663424
Rename block/chunk maps and make API more similar
RecursivePineapple May 28, 2026
c88a973
spotless
RecursivePineapple May 28, 2026
a7b84f2
Update mod info and add RegionLib as a forge dependency
RecursivePineapple May 28, 2026
ff50366
Patch MixinWorldGenLakes
RecursivePineapple May 28, 2026
a6792bf
Use primitive maps & sets for player manager cube/column deltas
RecursivePineapple May 28, 2026
f8ad6ea
Fix inhabitedTime incrementing
RecursivePineapple May 28, 2026
8f70345
spotless
RecursivePineapple May 28, 2026
ef4fd86
Fix lastChunkInhabitedUpdate always remaining 0
RecursivePineapple May 29, 2026
eb8984f
Clean up packChunk casting
RecursivePineapple May 29, 2026
60deb8d
Merge branch 'master' into world-generators-and-player-manager
RecursivePineapple May 30, 2026
44b67f0
Restore previous buildscript files (gradle broke for some reason)
RecursivePineapple May 30, 2026
0d25365
update bs
RecursivePineapple May 30, 2026
70bd4c6
update deps
RecursivePineapple May 30, 2026
53a4687
disable tests
RecursivePineapple May 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 41 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,33 @@ remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/co
# `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE.
developmentEnvironmentUserName = Developer

# Enables using modern Java syntax (up to version 17) via Jabel, while still targeting JVM 8.
# See https://github.com/bsideup/jabel for details on how this works.
enableModernJavaSyntax = true
# Enables modern Java syntax support. Valid values:
# - false: No modern syntax, Java 8 only
# - jabel: Jabel syntax-only support, compiles to J8 bytecode
# - jvmDowngrader: Full modern Java via JVM Downgrader (syntax + stdlib APIs)
# - modern: Native modern Java bytecode, no downgrading
enableModernJavaSyntax = jabel

# If set, ignores the above setting and compiles with the given toolchain. This may cause unexpected issues,
# and should *not* be used in most situations. -1 disables this.
# forceToolchainVersion = -1

# Target JVM version for JVM Downgrader bytecode downgrading.
# Only used when enableModernJavaSyntax = jvmDowngrader
# downgradeTargetVersion = 8

# Comma-separated list of Java versions for multi-release jar support (JVM Downgrader only).
# Classes will be available in META-INF/versions/N/ for each version N in this list.
# Default: "21,25" (J25+ gets native classes, J21-24 gets partial downgrade, J8-20 gets full downgrade).
# jvmDowngraderMultiReleaseVersions = 21,25

# Specifies how JVM Downgrader API stubs are provided. Options:
# - shade: Shade minimized stubs into the jar
# - gtnhlib: GTNHLib provides stubs at runtime (adds version constraint)
# - external: Another dependency provides stubs (no constraint, no warning)
# - (empty): Warning reminding you to configure stubs
# Note: 'shade' option requires you to verify license compliance, see: https://github.com/unimined/JvmDowngrader/blob/main/LICENSE.md
# jvmDowngraderStubsProvider =

# Enables injecting missing generics into the decompiled source code for a better coding experience.
# Turns most publicly visible List, Map, etc. into proper List<E>, Map<K, V> types.
Expand Down Expand Up @@ -82,12 +106,14 @@ usesMixins = true
separateMixinSourceSet =

# Adds some debug arguments like verbose output and class export.
usesMixinDebug = false
usesMixinDebug = true

# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
mixinPlugin =

# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
# Specify the package that contains all of your Mixins. The package must exist or
# the build will fail. If you have a package property defined in your mixins.<modid>.json,
# it must match with this or the build will fail.
mixinsPackage = mixin

# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
Expand Down Expand Up @@ -142,7 +168,7 @@ modrinthProjectId =
# type can be one of [project, version],
# and the name is the Modrinth project or version slug/id of the other mod.
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
modrinthRelations =

# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
Expand All @@ -163,6 +189,12 @@ curseForgeRelations =
# projects. New projects should not use this parameter.
# customArchiveBaseName =

# Optional parameter to customize the default working directory used by the runClient* tasks. Relative to the project directory.
# runClientWorkingDirectory = run/client

# Optional parameter to customize the default working directory used by the runServer* tasks. Relative to the project directory.
# runServerWorkingDirectory = run/server

# Optional parameter to have the build automatically fail if an illegal version is used.
# This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'.
# The check is ONLY performed if the version is a git tag.
Expand Down Expand Up @@ -192,3 +224,6 @@ curseForgeRelations =
# This is meant to be set in $HOME/.gradle/gradle.properties.
# ideaCheckSpotlessOnBuild = true

# Non-GTNH properties
org.gradle.configuration-cache = true
org.gradle.parallel = true
12 changes: 12 additions & 0 deletions gradle/gradle-daemon-jvm.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#This file is generated by updateDaemonJvm
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/d4fd992c9557644e637ebe98263e0ae7/redirect
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/faa12903720d410b387cc69ccafb1a74/redirect
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1630f7ebef05444cb27a2709ea0249b3/redirect
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/cd495626d2ee49a75447e3fdc6afb287/redirect
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/8e1d9ee5d0f13e442218f6884a306da1/redirect
toolchainVendor=ADOPTIUM
toolchainVersion=25
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
9 changes: 3 additions & 6 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ pluginManagement {
}

plugins {
id("com.gtnewhorizons.gtnhsettingsconvention") version("1.0.42")
id("com.gtnewhorizons.gtnhsettingsconvention") version("2.0.24")
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
import cpw.mods.fml.relauncher.Side;

@ParametersAreNonnullByDefault
@Mod(modid = CubicChunks.MODID, useMetadata = true)
@Mod(modid = CubicChunks.MODID, useMetadata = true, dependencies = "required-after:RegionLib;")
public class CubicChunks {

public static final int MAX_RENDER_DISTANCE = 64;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@
@Config(modid = CubicChunks.MODID, category = "general")
public class CubicChunksConfig {

@Config.Comment("Eliminates a few data copies in compatibility generator. May break some mods."
+ " Disable if you experience issues in modded dimensions or world types")
@Config.LangKey("cubicchunks.config.optimized_compatibility_generator")
public static boolean optimizedCompatibilityGenerator = true;

@Config.Ignore
public static Map<Integer, FillerInfo> configuredDimensionalFillerMap = new HashMap<>();

Expand Down
9 changes: 5 additions & 4 deletions src/main/java/com/cardinalstar/cubicchunks/api/CCAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.cardinalstar.cubicchunks.world.api.ICubeProviderServer;
import com.cardinalstar.cubicchunks.world.api.ICubeProviderServer.Requirement;
import com.cardinalstar.cubicchunks.world.column.EmptyEBS;
import com.cardinalstar.cubicchunks.world.cube.Cube;
import com.google.common.collect.AbstractIterator;

@SuppressWarnings("unused")
Expand Down Expand Up @@ -46,22 +47,22 @@ public static ICube getCube(World world, int cubeX, int cubeY, int cubeZ, Requir
}

/// Gets all loaded cubes in a column.
public static Collection<ICube> getLoadedCubes(Chunk chunk) {
public static Collection<Cube> getLoadedCubes(Chunk chunk) {
// noinspection unchecked
return (Collection<ICube>) ((IColumn) chunk).getLoadedCubes();
return (Collection<Cube>) ((IColumn) chunk).getLoadedCubes();
}

/// Gets all loaded block storages in a column.
public static Iterable<ExtendedBlockStorage> getLoadedBlockStorages(Chunk chunk) {
return () -> new AbstractIterator<>() {

private final Iterator<? extends ICube> iter = ((IColumn) chunk).getLoadedCubes()
private final Iterator<? extends Cube> iter = ((IColumn) chunk).getLoadedCubes()
.iterator();

@Override
protected ExtendedBlockStorage computeNext() {
while (iter.hasNext()) {
ICube cube = iter.next();
Cube cube = iter.next();

if (cube == null) continue;

Expand Down
23 changes: 13 additions & 10 deletions src/main/java/com/cardinalstar/cubicchunks/api/IColumn.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@
import javax.annotation.Nullable;
import javax.annotation.ParametersAreNonnullByDefault;

import net.minecraft.world.chunk.storage.ExtendedBlockStorage;

import com.cardinalstar.cubicchunks.util.XZAddressable;
import com.cardinalstar.cubicchunks.world.cube.Cube;

@ParametersAreNonnullByDefault
public interface IColumn extends XZAddressable {
Expand Down Expand Up @@ -85,7 +88,10 @@ public interface IColumn extends XZAddressable {
*
* @return the cubes
*/
Collection<? extends ICube> getLoadedCubes();
Collection<? extends Cube> getLoadedCubes();

/// Returns an array of contained EBSes that need to be ticked.
ExtendedBlockStorage[] getTickableStorages();
Comment thread
Cardinalstars marked this conversation as resolved.

/**
* Iterate over all loaded cubes in this column in order. If {@code startY < endY}, order is bottom to top,
Expand All @@ -96,43 +102,40 @@ public interface IColumn extends XZAddressable {
*
* @return an iterator over all loaded cubes between {@code startY} and {@code endY} (inclusive)
*/
Iterable<? extends ICube> getLoadedCubes(int startY, int endY);
Iterable<? extends Cube> getLoadedCubes(int startY, int endY);

/**
* Retrieve the cube at the specified location if it is loaded.
*
* @param cubeY cube y position
*
* @return the cube at that position, or {@code null} if it is not loaded
*/
@Nullable
ICube getLoadedCube(int cubeY);
Cube getLoadedCube(int cubeY);

/**
* Retrieve the cube at the specified location
*
* @param cubeY cube y position
*
* @return the cube at that position
*/
ICube getCube(int cubeY);
Cube getCube(int cubeY);

/**
* Add a cube to this column
*
* @param cube the cube being added
*/
void addCube(ICube cube);
void addCube(Cube cube);

/**
* Remove the cube at the specified height
*
* @param cubeY cube y position
*
* @return the removed cube if it existed, otherwise {@code null}
*/
@Nullable
ICube removeCube(int cubeY);
Cube removeCube(int cubeY);

/**
* Check if there are any loaded cube in this column
Expand All @@ -149,5 +152,5 @@ public interface IColumn extends XZAddressable {
*
* @param cube the cube to precache
*/
void preCacheCube(ICube cube);
void preCacheCube(Cube cube);
}
3 changes: 3 additions & 0 deletions src/main/java/com/cardinalstar/cubicchunks/api/ICube.java
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ public interface ICube extends XYZAddressable, MetaContainer {
@Nullable
ExtendedBlockStorage getStorage();

/// Returns true when this cube's [ExtendedBlockStorage] needs to be ticked.
boolean shouldTick();

/**
* Retrieve a map of positions to their respective tile entities
*
Expand Down
46 changes: 24 additions & 22 deletions src/main/java/com/cardinalstar/cubicchunks/api/XYZAddressable.java
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
package com.cardinalstar.cubicchunks.api;/*
* This file is part of Cubic Chunks Mod, licensed under the MIT License (MIT).
* Copyright (c) 2015-2021 OpenCubicChunks
* Copyright (c) 2015-2021 contributors
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/*
* This file is part of Cubic Chunks Mod, licensed under the MIT License (MIT).
* Copyright (c) 2015-2021 OpenCubicChunks
* Copyright (c) 2015-2021 contributors
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/

package com.cardinalstar.cubicchunks.api;

public interface XYZAddressable {

Expand Down
Loading
Loading