Skip to content

Commit

Permalink
Make snowmen not spawn in player lit areas
Browse files Browse the repository at this point in the history
  • Loading branch information
doctor4t committed Jan 21, 2021
1 parent cb14022 commit 2bc25ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### Snow Mercy 1.0.3-beta - 1.16.5
- Fixed an issue with snowmen not spawning on snow layers
- Snowmen will no longer spawn in player lit areas (if the light level is superior to 5)
- Added Vanguard auto-updater
- Added Simplified Chinese Localization, thanks to linzexin022!

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ladysnake/snowmercy/common/SnowMercy.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void onInitialize() {

LivingEntity entity = SPAWN_CANDIDATES.next(world.getRandom()).create(world);

if (entity != null && !world.getBlockState(spawnPos).isSolidBlock(world, spawnPos) && world.getBlockState(spawnPos.add(0, -1, 0)).isSolidBlock(world, spawnPos.add(0, -1, 0))) {
if (entity != null && !world.getBlockState(spawnPos).isSolidBlock(world, spawnPos) && world.getBlockState(spawnPos.add(0, -1, 0)).isSolidBlock(world, spawnPos.add(0, -1, 0)) && world.getLightLevel(LightType.BLOCK, spawnPos) <= 5) {
entity.setPos(spawnPos.getX(), spawnPos.getY(), spawnPos.getZ());
entity.updateTrackedPosition(spawnPos.getX(), spawnPos.getY(), spawnPos.getZ());
entity.updatePosition(spawnPos.getX(), spawnPos.getY(), spawnPos.getZ());
Expand Down

0 comments on commit 2bc25ce

Please sign in to comment.