-
-
Save adudewithapc/8e27f5869107594571eaca747ecfb6ad to your computer and use it in GitHub Desktop.
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
package thatmartinguy.thedarkness.world.gen; | |
import net.minecraft.init.Blocks; | |
import net.minecraft.tileentity.TileEntityShulkerBox; | |
import net.minecraft.util.EnumFacing; | |
import net.minecraft.util.math.BlockPos; | |
import net.minecraft.world.DimensionType; | |
import net.minecraft.world.World; | |
import net.minecraft.world.chunk.IChunkProvider; | |
import net.minecraft.world.gen.IChunkGenerator; | |
import net.minecraftforge.fml.common.IWorldGenerator; | |
import thatmartinguy.thedarkness.init.ModLootTables; | |
import java.util.Random; | |
public class WorldGenReliquaryChest implements IWorldGenerator | |
{ | |
@Override | |
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) | |
{ | |
if(world.provider.getDimensionType() == DimensionType.THE_END && chunkX == 0 && chunkZ == 0) | |
{ | |
BlockPos chestPosition = world.getSpawnPoint().offset(EnumFacing.NORTH); | |
world.setBlockState(chestPosition, Blocks.BLACK_SHULKER_BOX.getDefaultState(), 3); | |
if (world.getTileEntity(chestPosition) instanceof TileEntityShulkerBox) | |
{ | |
TileEntityShulkerBox entityBox = (TileEntityShulkerBox) world.getTileEntity(chestPosition); | |
entityBox.setLootTable(ModLootTables.lootReliquary, 1); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment