Added docs and made temperature for islands be based on origin.

This commit is contained in:
Harrison Deng 2020-05-15 01:56:33 -05:00
parent 63ecfedf71
commit ec006ffbb2
2 changed files with 48 additions and 0 deletions

View File

@ -12,14 +12,61 @@ import org.bukkit.inventory.Recipe;
import ca.recrown.islandsurvivalcraft.IslandSurvivalCraft;
public interface VariedItem {
/**
* Should be used to perform anything that need only be called once.
* Is called only when the needInitialization method returns true.
* Is called after assigning identity.
* @param islandSurvivalCraft The IslandSurvivalCraft plugin object that contains references to various managers that may be used.
*/
public void initialize(IslandSurvivalCraft islandSurvivalCraft);
/**
* @return the recipe to be registered with bukkit.
*/
public Recipe getRecipe();
/**
* @return The official, displayed name of the item.
*/
public String getName();
/**
*
* @return The material item this item is a variation of.
*/
public Material getBaseItem();
/**
* @return The namespaced key Bukkit will use to identify this variation of the item.
*/
public NamespacedKey getNamespacedKey();
/**
* Assigns a persistent metadata identifier.
* This identifier should be saved to the recipe's resulting itemstack.
* @param identifier The identifier.
*/
public void assignIdentifier(VariationItemIdentifier identifier);
/**
* Should give the identifier used identify this variation of the base item from the original.
* This usually should just return the assigned identifier.
* @return The identifier metadata.
*/
public VariationItemIdentifier getIdentifier();
/**
* If this item needs initializing.
* If returning true, the initialize method will be called before being registered as a recipe.
* @return True if the initialize method should be called.
*/
public boolean needInitialization();
/**
* Called when this variety of the item is crafted.
* @param item the resulting itemstack.
* @param crafter the entity performing the crafting.
*/
public void onItemCrafted(ItemStack item, HumanEntity crafter);
/**

View File

@ -43,6 +43,7 @@ public class UniqueBiomeGenerator implements BiomeGenerator {
}
});
if (currentIslandInfo.value == null) {
temperature = tempGenerator.getTemperature(islandOrigin.x, islandOrigin.y);
currentIslandInfo.value = biomeSelector.getLandBiomeInfo(temperature, islandOrigin.x, islandOrigin.y);
}
Flooder flooder = new Flooder(worldCoords, new CoordinateValidatable() {