Class NbtPlacer
java.lang.Object
net.rodofire.easierworldcreator.structure.NbtPlacer
Class to place nbt structures in the world. To use a NbtPlacer, you can use this code:
NbtPlacer placer = new NbtPlacer(world, new Identifier("Path_of_your_structure"));
placer.place(pos)
-
Constructor Summary
ConstructorsConstructorDescriptionNbtPlacer(net.minecraft.world.StructureWorldAccess world, net.minecraft.util.Identifier templateName) init a NbtPlacerNbtPlacer(net.minecraft.world.StructureWorldAccess world, net.minecraft.util.Identifier templateName, StructurePlaceAnimator animator) init a NbtPlacer -
Method Summary
Modifier and TypeMethodDescriptionmethod to get the animator of the objectvoidplace(float integrity, net.minecraft.util.math.BlockPos pos, net.minecraft.util.math.BlockPos offset, net.minecraft.util.BlockMirror mirror, net.minecraft.util.BlockRotation rotation, boolean ignoreEntities) this method allows you to place a structure in the world during world gen or notvoidplace(float integrity, net.minecraft.util.math.BlockPos pos, net.minecraft.util.math.BlockPos offset, net.minecraft.util.BlockMirror mirror, net.minecraft.util.BlockRotation rotation, boolean ignoreEntities, boolean force, Set<net.minecraft.block.Block> blockToForce, Set<net.minecraft.block.Block> blockToSkip) this method allows you to place a structure in the world during world gen or notvoidplace(net.minecraft.util.math.BlockPos pos) this method allows you to place a structure in the world during world gen or notvoidsetAnimator(StructurePlaceAnimator animator) method to change the animator
-
Constructor Details
-
NbtPlacer
public NbtPlacer(net.minecraft.world.StructureWorldAccess world, net.minecraft.util.Identifier templateName) init a NbtPlacer- Parameters:
world- the world the structure will spawn intemplateName- the identifier of the structure
-
NbtPlacer
public NbtPlacer(net.minecraft.world.StructureWorldAccess world, net.minecraft.util.Identifier templateName, StructurePlaceAnimator animator) init a NbtPlacer- Parameters:
world- the world the structure will spawn intemplateName- the identifier of the structureanimator- the animation of the structure place
-
-
Method Details
-
getAnimator
method to get the animator of the object- Returns:
- the animator of the object
-
setAnimator
method to change the animator- Parameters:
animator- the animator that will be changed
-
place
public void place(net.minecraft.util.math.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.util.math.BlockPos pos, net.minecraft.util.math.BlockPos offset, net.minecraft.util.BlockMirror mirror, net.minecraft.util.BlockRotation 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 1fpos- the pos of the structureoffset- the offset of the pos structuremirror- the block mirror if wantedrotation- the structure rotation if wantedignoreEntities- ignore entities of the structure
-
place
public void place(float integrity, net.minecraft.util.math.BlockPos pos, net.minecraft.util.math.BlockPos offset, net.minecraft.util.BlockMirror mirror, net.minecraft.util.BlockRotation rotation, boolean ignoreEntities, boolean force, Set<net.minecraft.block.Block> blockToForce, Set<net.minecraft.block.Block> blockToSkip) 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 1fpos- the pos of the structureoffset- the offset of the pos structuremirror- the block mirror if wantedrotation- the structure rotation if wantedignoreEntities- ignore entities of the structureforce- determines if each block has to replace the already existing block if it existsblockToForce- set of block that the structure can still force in the case force = falseblockToSkip- the list of blocks to skip during the pos
-