Skip to content

Commit

Permalink
Fix snowmen not spawning on snow layers
Browse files Browse the repository at this point in the history
  • Loading branch information
doctor4t committed Jan 21, 2021
1 parent 89212b8 commit cb14022
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
### Snow Mercy 1.0.3-beta - 1.16.5
- Fixed an issue with snowmen not spawning on snow layers
- Added Vanguard auto-updater
- Added Simplified Chinese Localization, thanks to linzexin022!

### Snow Mercy 1.0.2-beta - 1.16.4
- Aftermarket Snowmen now have a 25% chance to drop between 1 and 3 of their rockets
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/ladysnake/snowmercy/common/SnowMercy.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import net.minecraft.util.math.Box;
import net.minecraft.util.math.ChunkPos;
import net.minecraft.world.Heightmap;
import net.minecraft.world.LightType;

public class SnowMercy implements ModInitializer {
public static final String MODID = "snowmercy";
Expand Down Expand Up @@ -62,7 +63,7 @@ public void onInitialize() {

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

if (entity != null && world.getBlockState(spawnPos).isAir() && 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))) {
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 cb14022

Please sign in to comment.