Merge pull request #555 from CocoTheOwner/fixEntitySpawn

Spawn entity using block instead of tile since it was causing issues
This commit is contained in:
Dan 2021-08-16 11:17:59 -08:00 committed by GitHub
commit e8fe58438d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -134,7 +134,7 @@ public class IrisEntitySpawn implements IRare {
try {
IrisEntity irisEntity = getRealEntity(g);
if (!irisEntity.getSurface().matches(at.clone().subtract(0, 1, 0).getBlock().getState()))
if (!irisEntity.getSurface().matches(at.clone().subtract(0, 1, 0).getBlock()))
return null; //Make sure it can spawn on the block
Entity e = irisEntity.spawn(g, at.add(0.5, 0, 0.5), rng.aquire(() -> new RNG(g.getTarget().getWorld().seed() + 4)));

View File

@ -20,6 +20,7 @@ package com.volmit.iris.engine.object.spawners;
import com.volmit.iris.engine.object.annotations.Desc;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.block.data.Waterlogged;
@ -47,7 +48,7 @@ public enum IrisSurface {
* @param state The blockstate
* @return True if it matches
*/
public boolean matches(BlockState state) {
public boolean matches(Block state) {
Material type = state.getType();
if (type.isSolid()) {
return this == LAND || this == OVERWORLD || (this == ANIMAL