Skip to content

Commit

Permalink
Create grave at falling into the void in end dimension, #289
Browse files Browse the repository at this point in the history
  • Loading branch information
NightKosh committed Oct 28, 2018
1 parent 5291d34 commit 050d88e
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.passive.*;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
Expand All @@ -17,6 +18,7 @@
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.text.translation.I18n;
import net.minecraft.world.DimensionType;
import net.minecraft.world.World;
import net.minecraftforge.common.BiomeDictionary;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
Expand Down Expand Up @@ -672,6 +674,14 @@ private static BlockPos findPlaceForGrave(World world, Entity entity, BlockPos p
}
}

if (world.provider.getDimensionType() == DimensionType.THE_END && pos.getY() <= 0) {
BlockPos groundPos = new BlockPos(pos.getX(), 0, pos.getZ());
if (world.isAirBlock(pos)) {
world.setBlockState(groundPos, Blocks.END_STONE.getDefaultState());
return groundPos.up();
}
}

int x = pos.getX();
int y = pos.getY();
int z = pos.getZ();
Expand Down

0 comments on commit 050d88e

Please sign in to comment.