mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-22 03:43:30 +01:00
parent
d5278cb279
commit
3e4aa9c757
1 changed files with 3 additions and 1 deletions
|
@ -11,6 +11,7 @@ import net.minecraft.util.math.BlockPos;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.structure.Structure;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
import net.minecraft.world.storage.ServerWorldInfo;
|
||||
|
||||
public class ItemStructureFinder extends ItemImpl {
|
||||
private final Structure structureName;
|
||||
|
@ -25,7 +26,8 @@ public class ItemStructureFinder extends ItemImpl {
|
|||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(World worldIn, PlayerEntity playerIn, Hand handIn) {
|
||||
ItemStack stack = playerIn.getHeldItem(handIn);
|
||||
if (!worldIn.isRemote) {
|
||||
// ServerWorld.getStructureManager().doesGenerateFeatures()
|
||||
if (!worldIn.isRemote && ((ServerWorld) worldIn).func_241112_a_().func_235005_a_()) {
|
||||
BlockPos pos = ((ServerWorld) worldIn).getChunkProvider().getChunkGenerator().func_235956_a_((ServerWorld) worldIn, this.structureName, playerIn.getPosition(), 1024, false);
|
||||
if (pos != null) {
|
||||
EntityStructureFinder entity = new EntityStructureFinder(ModEntities.STRUCTURE_FINDER, worldIn);
|
||||
|
|
Loading…
Reference in a new issue