Class NbtPlacer

java.lang.Object
fr.rodofire.ewc.structure.NbtPlacer

public class NbtPlacer extends Object
Class to place nbt structures in the world. To use a NbtPlacer, you can use this code:
NbtPlacer placer = new NbtPlacer(world, new ResourceLocation("Path_of_your_structure"));
 placer.place(pos)
 
  • Constructor Summary

    Constructors
    Constructor
    Description
    NbtPlacer(net.minecraft.world.level.WorldGenLevel world, net.minecraft.resources.ResourceLocation templateName)
    init a NbtPlacer
    NbtPlacer(net.minecraft.world.level.WorldGenLevel world, net.minecraft.resources.ResourceLocation templateName, StructurePlaceAnimator animator)
    init a NbtPlacer
  • Method Summary

    Modifier and Type
    Method
    Description
    get(float integrity, net.minecraft.core.BlockPos pos, net.minecraft.core.BlockPos offset, net.minecraft.world.level.block.Mirror mirror, net.minecraft.world.level.block.Rotation rotation, boolean ignoreEntities)
    method to get a BlockListManager based on a structure
    method to get the animator of the object
    void
    place(float integrity, net.minecraft.core.BlockPos pos, net.minecraft.core.BlockPos offset, net.minecraft.world.level.block.Mirror mirror, net.minecraft.world.level.block.Rotation rotation, boolean ignoreEntities)
    this method allows you to place a structure in the world during world gen or not
    void
    place(net.minecraft.core.BlockPos pos)
    this method allows you to place a structure in the world during world gen or not
    void
    method to change the animator

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NbtPlacer

      public NbtPlacer(net.minecraft.world.level.WorldGenLevel world, net.minecraft.resources.ResourceLocation templateName)
      init a NbtPlacer
      Parameters:
      world - the world the structure will spawn in
      templateName - the ResourceLocation of the structure
    • NbtPlacer

      public NbtPlacer(net.minecraft.world.level.WorldGenLevel world, net.minecraft.resources.ResourceLocation templateName, StructurePlaceAnimator animator)
      init a NbtPlacer
      Parameters:
      world - the world the structure will spawn in
      templateName - the ResourceLocation of the structure
      animator - the animation of the structure place
  • Method Details

    • getAnimator

      public StructurePlaceAnimator getAnimator()
      method to get the animator of the object
      Returns:
      the animator of the object
    • setAnimator

      public void setAnimator(StructurePlaceAnimator animator)
      method to change the animator
      Parameters:
      animator - the animator that will be changed
    • place

      public void place(net.minecraft.core.BlockPos pos)
      this method allows you to place a structure in the world during world gen or not
      Parameters:
      pos - the pos of the structure
    • place

      public void place(float integrity, net.minecraft.core.BlockPos pos, net.minecraft.core.BlockPos offset, net.minecraft.world.level.block.Mirror mirror, net.minecraft.world.level.block.Rotation rotation, boolean ignoreEntities)
      this method allows you to place a structure in the world during world gen or not
      Parameters:
      integrity - the integrity of the structure must be between 0f and 1f
      pos - the pos of the structure
      offset - the offset of the pos structure
      mirror - the block mirror if wanted
      rotation - the structure rotation if wanted
      ignoreEntities - ignore entities of the structure
    • get

      public BlockListManager get(float integrity, net.minecraft.core.BlockPos pos, net.minecraft.core.BlockPos offset, net.minecraft.world.level.block.Mirror mirror, net.minecraft.world.level.block.Rotation rotation, boolean ignoreEntities)
      method to get a BlockListManager based on a structure
      Parameters:
      integrity - the integrity of the structure must be between 0f and 1f
      pos - the pos of the structure
      offset - the offset of the pos structure
      mirror - the block mirror if wanted
      rotation - the structure rotation if wanted
      ignoreEntities - ignore entities of the structure
      Returns:
      the Structure converted into BlockListManager