-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/MC_1.17-Structures' into MC_1.17…
…_Jar
- Loading branch information
Showing
27 changed files
with
625 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...chunks/cubicchunks/mixin/core/common/world/structure/MixinConfiguredStructureFeature.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package io.github.opencubicchunks.cubicchunks.mixin.core.common.world.structure; | ||
|
||
import io.github.opencubicchunks.cubicchunks.world.CubeWorldGenRandom; | ||
import io.github.opencubicchunks.cubicchunks.world.gen.structure.ICubicConfiguredStructureFeature; | ||
import io.github.opencubicchunks.cubicchunks.world.gen.structure.ICubicStructureFeature; | ||
import net.minecraft.core.RegistryAccess; | ||
import net.minecraft.core.SectionPos; | ||
import net.minecraft.world.level.LevelHeightAccessor; | ||
import net.minecraft.world.level.biome.Biome; | ||
import net.minecraft.world.level.biome.BiomeSource; | ||
import net.minecraft.world.level.chunk.ChunkGenerator; | ||
import net.minecraft.world.level.levelgen.feature.ConfiguredStructureFeature; | ||
import net.minecraft.world.level.levelgen.feature.StructureFeature; | ||
import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration; | ||
import net.minecraft.world.level.levelgen.feature.configurations.StructureFeatureConfiguration; | ||
import net.minecraft.world.level.levelgen.structure.StructureStart; | ||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureManager; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
|
||
@Mixin(ConfiguredStructureFeature.class) | ||
public class MixinConfiguredStructureFeature<FC extends FeatureConfiguration, F extends StructureFeature<FC>> implements ICubicConfiguredStructureFeature { | ||
@Shadow @Final public F feature; | ||
|
||
@Shadow @Final public FC config; | ||
|
||
@SuppressWarnings("unchecked") @Override public StructureStart<?> generate(RegistryAccess registryManager, ChunkGenerator chunkGenerator, BiomeSource biomeSource, | ||
StructureManager structureManager, long worldSeed, SectionPos chunkPos, Biome biome, int referenceCount, | ||
StructureFeatureConfiguration structureConfig, LevelHeightAccessor levelHeightAccessor) { | ||
return ((ICubicStructureFeature<FC>) this.feature).generateCC(registryManager, chunkGenerator, biomeSource, structureManager, worldSeed, chunkPos, | ||
biome, referenceCount, new CubeWorldGenRandom(), structureConfig, this.config, levelHeightAccessor); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...hub/opencubicchunks/cubicchunks/mixin/core/common/world/structure/MixinLocateCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package io.github.opencubicchunks.cubicchunks.mixin.core.common.world.structure; | ||
|
||
import net.minecraft.commands.CommandSourceStack; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.network.chat.Style; | ||
import net.minecraft.server.commands.LocateCommand; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.Constant; | ||
import org.spongepowered.asm.mixin.injection.ModifyConstant; | ||
|
||
@Mixin(LocateCommand.class) | ||
public class MixinLocateCommand { | ||
|
||
@ModifyConstant(method = "showLocateResult", constant = @Constant(stringValue = "~")) | ||
private static String show3DLocateResultInBrackets(String arg0, CommandSourceStack source, String structure, BlockPos sourcePos, BlockPos structurePos, String successMessage) { | ||
return String.valueOf(structurePos.getY()); | ||
} | ||
|
||
// @SuppressWarnings("UnresolvedMixinReference") | ||
// @ModifyConstant(method = "lambda$showLocateResult$2(Lnet/minecraft/core/BlockPos;Lnet/minecraft/network/chat/Style;)Lnet/minecraft/network/chat/Style;", | ||
// constant = @Constant(stringValue = " ~ ")) | ||
// private static String show3DLocateResultForTPSuggestion(String arg0, BlockPos structurePos, Style style) { | ||
// return " " + structurePos.getY() + " "; | ||
// } | ||
} |
Oops, something went wrong.