generated from GenerationsMod/GenerationsModuleTemplateOld
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Customize pokeshops and marts for desert biome
- Loading branch information
Showing
6 changed files
with
69 additions
and
11 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
41 changes: 41 additions & 0 deletions
41
...structures/processors/structure_processors/pokevillage/PokeCenterMartDesertProcessor.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,41 @@ | ||
package generations.gg.generations.structures.generationsstructures.processors.structure_processors.pokevillage; | ||
|
||
import com.mojang.serialization.Codec; | ||
import generations.gg.generations.structures.generationsstructures.processors.StructureProcessors; | ||
import generations.gg.generations.structures.generationsstructures.village.VanillaVillages; | ||
import net.minecraft.core.BlockPos; | ||
import net.minecraft.tags.BlockTags; | ||
import net.minecraft.world.level.LevelReader; | ||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.level.block.Blocks; | ||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructurePlaceSettings; | ||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessor; | ||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessorType; | ||
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public class PokeCenterMartDesertProcessor extends StructureProcessor { | ||
|
||
public static final PokeCenterMartDesertProcessor INSTANCE = new PokeCenterMartDesertProcessor(); | ||
public static final Codec<PokeCenterMartDesertProcessor> CODEC = Codec.unit(() -> INSTANCE); | ||
|
||
@Nullable | ||
@Override | ||
public StructureTemplate.StructureBlockInfo processBlock(@NotNull LevelReader level, @NotNull BlockPos blockPos, @NotNull BlockPos pos, StructureTemplate.@NotNull StructureBlockInfo blockInfo, StructureTemplate.@NotNull StructureBlockInfo relativeBlockInfo, @NotNull StructurePlaceSettings settings) { | ||
if (level.getBiome(blockPos).is(VanillaVillages.DESERT.getVillageTag())) { | ||
Block block = relativeBlockInfo.state().getBlock(); | ||
if (block.defaultBlockState().is(BlockTags.LEAVES)) | ||
return new StructureTemplate.StructureBlockInfo(relativeBlockInfo.pos(), Blocks.CACTUS.withPropertiesOf(relativeBlockInfo.state()), relativeBlockInfo.nbt()); | ||
else if (block.defaultBlockState().is(BlockTags.FLOWER_POTS)) | ||
return new StructureTemplate.StructureBlockInfo(relativeBlockInfo.pos(), Blocks.POTTED_CACTUS.defaultBlockState(), relativeBlockInfo.nbt()); | ||
} | ||
|
||
return relativeBlockInfo; | ||
} | ||
|
||
@Override | ||
protected @NotNull StructureProcessorType<?> getType() { | ||
return StructureProcessors.POKECENTER_MART_DESERT_PROCESSOR; | ||
} | ||
} |
3 changes: 2 additions & 1 deletion
3
...cture_processors/PokeCenterProcessor.java → ...sors/pokevillage/PokeCenterProcessor.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
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