1.0.8
RelicCraft/pipeline/head This commit looks good Details

Fix Lakes Cutting Off Time Temples
This commit is contained in:
TheBrokenRail 2020-04-07 17:51:42 -04:00
parent 942dfdf197
commit f82ca29245
4 changed files with 48 additions and 1 deletions

View File

@ -1,5 +1,8 @@
# Changelog
**1.0.8**
* Fix Lakes Cutting Off Time Temples
**1.0.7**
* Tweak Crafting Slightly

View File

@ -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

View File

@ -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;
}
}
}
}

View File

@ -12,6 +12,7 @@
"MixinEnderPearlItem",
"MixinEntity",
"MixinItemStack",
"MixinLakeFeature",
"MixinLevelProperties",
"MixinLivingEntity",
"MixinLocateCommand",