Class CompatibilityUtils

java.lang.Object
com.minecolonies.api.util.CompatibilityUtils

public final class CompatibilityUtils extends Object
This class group method use to insure compatibility between minecraft version.

This is the 1.15 version

  • Method Details

    • getWorldFromEntity

      public static net.minecraft.world.level.Level getWorldFromEntity(net.minecraft.world.entity.Entity entity)
      get the world from the entity.

      This method is aiming to hide the difference between 1.10.2 and 1.11.2

      Parameters:
      entity - to which we get the world from
      Returns:
      the world
    • getWorldFromCitizen

      public static net.minecraft.world.level.Level getWorldFromCitizen(AbstractEntityCitizen baseEntityCitizen)
    • addEntity

      public static void addEntity(net.minecraft.world.level.Level world, net.minecraft.world.entity.Entity entityToSpawn)
      spawn an entity in the world

      This method is aiming to hide the difference between 1.10.2 and 1.11.2

      Parameters:
      world - The world which we are spawning the entity in.
      entityToSpawn - The entity which we are spawning.