Files
Applied-Energistics-2/src/main/java/appeng/mixins/spatial/DimensionOptionMixin.java
T
shartte d1ba26311b One Spatial Dimension (#4570)
* Ported the "one spatial dimension" concept from pre-1.15

* Apply lighting updates after moving chunks.
Mark world data as dirty when changing it.

* Consolidated naming of spatial storage world/dimension.
Use server light manager to update lighting info in chunk.

* Save last transition information,
and add ae2 spatial command to interact with spatial storage.

* Formatting fixes.

* Improved docs for the origin generation.

Inverted condition on when the x/z axis are flipped.
Also added a helper to map a plot to a region file

* Remove TransitionResult since it's only used in lieu of a boolean.
Rework transition to make the checks BEFORE allocating a new cell.

* Removed unused imports.

Co-authored-by: yueh <yueh@users.noreply.github.com>
2020-08-10 11:29:07 +02:00

38 lines
1.5 KiB
Java

package appeng.mixins.spatial;
import java.util.List;
import java.util.Map;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
import net.minecraft.util.RegistryKey;
import net.minecraft.world.Dimension;
import appeng.spatial.SpatialStorageDimensionIds;
/**
* This Mixin tries to hide the screen that warns users about experimental
* features being used, but only if AE2's dimension is the only added dimension.
*/
@Mixin(Dimension.class)
public class DimensionOptionMixin {
/**
* This injects right after the method makes a local copy of all present
* dimensions, and modifies the list by removing our mod-provided dimension from
* it.
* <p>
* This means Vanilla will perform it's check whether it should display an
* experimental warning without considering our dimension.
*/
@ModifyVariable(method = "func_236060_a_", at = @At(value = "INVOKE_ASSIGN", ordinal = 0, target = "Lcom/google/common/collect/Lists;newArrayList(Ljava/lang/Iterable;)Ljava/util/ArrayList;", remap = false), allow = 1)
private static List<Map.Entry<RegistryKey<Dimension>, Dimension>> overrideExperimentalCheck(
List<Map.Entry<RegistryKey<Dimension>, Dimension>> dimensions) {
// this only removes our dimension from the check
dimensions.removeIf(e -> e.getKey() == SpatialStorageDimensionIds.DIMENSION_ID);
return dimensions;
}
}