Class OrganicSpread

java.lang.Object
org.cyclops.evilcraft.core.algorithm.OrganicSpread

public class OrganicSpread extends Object
An algorithm that is able to organically spread an object in an area.
  • Constructor Details

    • OrganicSpread

      public OrganicSpread(net.minecraft.world.level.Level world, int dimensions, int radius, OrganicSpread.IOrganicSpreadable spreadable)
      Make a new instance.
      Parameters:
      world - The world.
      dimensions - The amount of dimensions in which this spreading should happen.
      radius - The radius in which the spreading should happen.
      spreadable - The spreadable object.
  • Method Details

    • getRadius

      public int getRadius()
      Returns:
      the radius
    • setRadius

      public void setRadius(int radius)
      Parameters:
      radius - the radius to set
    • getDimensions

      public int getDimensions()
      Returns:
      the dimensions
    • setDimensions

      public void setDimensions(int dimensions)
      Parameters:
      dimensions - the dimensions to set.
    • getSpreadable

      public OrganicSpread.IOrganicSpreadable getSpreadable()
      Returns:
      the spreadable
    • setSpreadable

      public void setSpreadable(OrganicSpread.IOrganicSpreadable spreadable)
      Parameters:
      spreadable - the spreadable to set
    • spreadTick

      public void spreadTick(net.minecraft.core.BlockPos startLocation)
      Perform one spreading tick so that one new blockState will be spread to.
      Parameters:
      startLocation - The location to start spreading from.
    • isInArea

      protected boolean isInArea(net.minecraft.core.BlockPos center, net.minecraft.core.BlockPos location)
    • isBigEnough

      protected boolean isBigEnough(net.minecraft.world.phys.Vec3 direction)
    • getRandomDirection

      protected net.minecraft.world.phys.Vec3 getRandomDirection()
      Get a random direction to spread in.
      Returns:
      An array of a choice of -1;0;1 per coordinate index.