Fix Lakes Cutting Off Time Temples
This commit is contained in:
parent
942dfdf197
commit
f82ca29245
@ -1,5 +1,8 @@
|
||||
# Changelog
|
||||
|
||||
**1.0.8**
|
||||
* Fix Lakes Cutting Off Time Temples
|
||||
|
||||
**1.0.7**
|
||||
* Tweak Crafting Slightly
|
||||
|
||||
|
@ -10,7 +10,7 @@ org.gradle.jvmargs = -Xmx1G
|
||||
fabric_loader_version = 0.7.10+build.191
|
||||
|
||||
# Mod Properties
|
||||
mod_version = 1.0.7
|
||||
mod_version = 1.0.8
|
||||
maven_group = com.thebrokenrail
|
||||
archives_base_name = reliccraft
|
||||
|
||||
|
@ -0,0 +1,43 @@
|
||||
package com.thebrokenrail.reliccraft.mixin;
|
||||
|
||||
import com.thebrokenrail.reliccraft.RelicCraft;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.gen.chunk.ChunkGenerator;
|
||||
import net.minecraft.world.gen.chunk.ChunkGeneratorConfig;
|
||||
import net.minecraft.world.gen.feature.LakeFeature;
|
||||
import net.minecraft.world.gen.feature.SingleStateFeatureConfig;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@Mixin(LakeFeature.class)
|
||||
public class MixinLakeFeature {
|
||||
@Inject(at = @At("HEAD"), method = "generate", cancellable = true)
|
||||
public void fixTimeTemple(IWorld world, ChunkGenerator<? extends ChunkGeneratorConfig> chunkGenerator, Random random, BlockPos blockPos, SingleStateFeatureConfig singleStateFeatureConfig, CallbackInfoReturnable<Boolean> info) {
|
||||
List<Chunk> chunksToScan = new ArrayList<>();
|
||||
chunksToScan.add(world.getChunk(blockPos));
|
||||
chunksToScan.add(world.getChunk(blockPos.add(16, 0, 16)));
|
||||
chunksToScan.add(world.getChunk(blockPos.add(-16, 0, -16)));
|
||||
chunksToScan.add(world.getChunk(blockPos.add(0, 0, 16)));
|
||||
chunksToScan.add(world.getChunk(blockPos.add(16, 0, 0)));
|
||||
chunksToScan.add(world.getChunk(blockPos.add(-16, 0, 0)));
|
||||
chunksToScan.add(world.getChunk(blockPos.add(0, 0, -16)));
|
||||
chunksToScan.add(world.getChunk(blockPos.add(16, 0, -16)));
|
||||
chunksToScan.add(world.getChunk(blockPos.add(-16, 0, 16)));
|
||||
|
||||
for (Chunk chunk : chunksToScan) {
|
||||
if (!chunk.getStructureReferences(RelicCraft.TIME_TEMPLE_ID).isEmpty()) {
|
||||
info.setReturnValue(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -12,6 +12,7 @@
|
||||
"MixinEnderPearlItem",
|
||||
"MixinEntity",
|
||||
"MixinItemStack",
|
||||
"MixinLakeFeature",
|
||||
"MixinLevelProperties",
|
||||
"MixinLivingEntity",
|
||||
"MixinLocateCommand",
|
||||
|
Reference in New Issue
Block a user