Spawn entity using block instead of tile since it was causing issues

https://pastebin.com/gwXGK8qd
This commit is contained in:
CocoTheOwner 2021-08-16 18:50:14 +02:00
parent b7c67a16d9
commit f1df8d07bb
2 changed files with 3 additions and 2 deletions

View File

@ -134,7 +134,7 @@ public class IrisEntitySpawn implements IRare {
try { try {
IrisEntity irisEntity = getRealEntity(g); 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 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))); 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 com.volmit.iris.engine.object.annotations.Desc;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState; import org.bukkit.block.BlockState;
import org.bukkit.block.data.Waterlogged; import org.bukkit.block.data.Waterlogged;
@ -47,7 +48,7 @@ public enum IrisSurface {
* @param state The blockstate * @param state The blockstate
* @return True if it matches * @return True if it matches
*/ */
public boolean matches(BlockState state) { public boolean matches(Block state) {
Material type = state.getType(); Material type = state.getType();
if (type.isSolid()) { if (type.isSolid()) {
return this == LAND || this == OVERWORLD || (this == ANIMAL return this == LAND || this == OVERWORLD || (this == ANIMAL