mirror of
https://github.com/BentoBoxWorld/CaveBlock.git
synced 2024-11-25 12:05:11 +01:00
Merge pull request #10 from BentoBoxWorld/master
Merge 0.1.0 into development branch
This commit is contained in:
commit
fedd660bcb
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>world.bentobox</groupId>
|
||||
<artifactId>caveblock</artifactId>
|
||||
<version>0.1.0-SNAPSHOT</version>
|
||||
<version>0.1.0</version>
|
||||
|
||||
<name>CaveBlock</name>
|
||||
<description>CaveBlock is an add-on for BentoBox, an expandable Minecraft Bukkit plugin for island-type games like SkyBlock or AcidIsland.</description>
|
||||
|
@ -47,7 +47,6 @@ public class ChunkGeneratorWorld extends ChunkGenerator
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* This method sets if given coordinates can be set as spawn location
|
||||
*/
|
||||
@ -217,6 +216,4 @@ public class ChunkGeneratorWorld extends ChunkGenerator
|
||||
* This list contains block populators that will be applied after chunk is generated.
|
||||
*/
|
||||
private List<BlockPopulator> blockPopulators;
|
||||
|
||||
|
||||
}
|
||||
|
@ -37,11 +37,14 @@ public class EntitiesPopulator extends BlockPopulator
|
||||
public EntitiesPopulator(CaveBlock addon)
|
||||
{
|
||||
this.addon = addon;
|
||||
loadSettings();
|
||||
this.loadSettings();
|
||||
}
|
||||
|
||||
|
||||
public void loadSettings() {
|
||||
/**
|
||||
* This method load chances per environment.
|
||||
*/
|
||||
private void loadSettings() {
|
||||
// Set up chances
|
||||
chances = new HashMap<>();
|
||||
// Normal
|
||||
@ -157,6 +160,38 @@ public class EntitiesPopulator extends BlockPopulator
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
// Section: Private Classes
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
|
||||
/**
|
||||
* Chances class to store chances for environments and main material
|
||||
*/
|
||||
private class Chances
|
||||
{
|
||||
/**
|
||||
* @param entityChanceMap - contains chances for each entity.
|
||||
* @param mainMaterial - material on which entity can replace.
|
||||
*/
|
||||
Chances(Map<EntityType, Pair<Double, Integer>> entityChanceMap, Material mainMaterial)
|
||||
{
|
||||
this.entityChanceMap = entityChanceMap;
|
||||
this.mainMaterial = mainMaterial;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Map that contains chances for entity to spawn.
|
||||
*/
|
||||
final Map<EntityType, Pair<Double, Integer>> entityChanceMap;
|
||||
|
||||
/**
|
||||
* Main material that can be replaced.
|
||||
*/
|
||||
final Material mainMaterial;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
// Section: Variables
|
||||
@ -167,10 +202,19 @@ public class EntitiesPopulator extends BlockPopulator
|
||||
*/
|
||||
private CaveBlock addon;
|
||||
|
||||
/**
|
||||
* Map that contains chances for spawning per environment.
|
||||
*/
|
||||
private Map<Environment, Chances> chances;
|
||||
|
||||
/**
|
||||
* World height
|
||||
*/
|
||||
private int worldHeight;
|
||||
|
||||
/**
|
||||
* Water entities
|
||||
*/
|
||||
private final static List<EntityType> WATER_ENTITIES = Arrays.asList(EntityType.GUARDIAN,
|
||||
EntityType.SQUID,
|
||||
EntityType.COD,
|
||||
@ -179,22 +223,4 @@ public class EntitiesPopulator extends BlockPopulator
|
||||
EntityType.TROPICAL_FISH,
|
||||
EntityType.DROWNED,
|
||||
EntityType.DOLPHIN);
|
||||
|
||||
/**
|
||||
* Chances class to store chances for environments and main material
|
||||
*
|
||||
*/
|
||||
private class Chances {
|
||||
final Map<EntityType, Pair<Double, Integer>> entityChanceMap;
|
||||
final Material mainMaterial;
|
||||
|
||||
/**
|
||||
* @param materialChanceMap
|
||||
* @param mainMaterial
|
||||
*/
|
||||
public Chances(Map<EntityType, Pair<Double, Integer>> entityChanceMap, Material mainMaterial) {
|
||||
this.entityChanceMap = entityChanceMap;
|
||||
this.mainMaterial = mainMaterial;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,14 +32,14 @@ public class MaterialPopulator extends BlockPopulator
|
||||
{
|
||||
this.addon = addon;
|
||||
// Load settings
|
||||
loadSettings();
|
||||
this.loadSettings();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Loads chances for Material Populator
|
||||
*/
|
||||
public void loadSettings() {
|
||||
private void loadSettings() {
|
||||
// Set up chances
|
||||
chances = new HashMap<>();
|
||||
// Normal
|
||||
@ -158,6 +158,39 @@ public class MaterialPopulator extends BlockPopulator
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
// Section: Private Classes
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
|
||||
/**
|
||||
* Chances class to store chances for environments and main material
|
||||
*/
|
||||
private class Chances
|
||||
{
|
||||
/**
|
||||
* @param materialChanceMap - contains chances for each material.
|
||||
* @param mainMaterial - material on which material can replace.
|
||||
*/
|
||||
Chances(Map<Material, Pair<Double, Integer>> materialChanceMap, Material mainMaterial)
|
||||
{
|
||||
this.materialChanceMap = materialChanceMap;
|
||||
this.mainMaterial = mainMaterial;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Map that contains chances for entity to spawn.
|
||||
*/
|
||||
final Map<Material, Pair<Double, Integer>> materialChanceMap;
|
||||
|
||||
/**
|
||||
* Main material that can be replaced.
|
||||
*/
|
||||
final Material mainMaterial;
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------
|
||||
// Section: Variables
|
||||
// ---------------------------------------------------------------------
|
||||
@ -168,25 +201,13 @@ public class MaterialPopulator extends BlockPopulator
|
||||
*/
|
||||
private CaveBlock addon;
|
||||
|
||||
/**
|
||||
* Map that contains chances for spawning per environment.
|
||||
*/
|
||||
private Map<Environment, Chances> chances;
|
||||
|
||||
private int worldHeight;
|
||||
|
||||
/**
|
||||
* Chances class to store chances for environments and main material
|
||||
*
|
||||
* World height
|
||||
*/
|
||||
private class Chances {
|
||||
final Map<Material, Pair<Double, Integer>> materialChanceMap;
|
||||
final Material mainMaterial;
|
||||
|
||||
/**
|
||||
* @param materialChanceMap
|
||||
* @param mainMaterial
|
||||
*/
|
||||
public Chances(Map<Material, Pair<Double, Integer>> materialChanceMap, Material mainMaterial) {
|
||||
this.materialChanceMap = materialChanceMap;
|
||||
this.mainMaterial = mainMaterial;
|
||||
}
|
||||
}
|
||||
private int worldHeight;
|
||||
}
|
||||
|
@ -578,7 +578,7 @@ blocks:
|
||||
'24':
|
||||
==: org.bukkit.inventory.ItemStack
|
||||
v: 1631
|
||||
type: beetroot_seeds
|
||||
type: BEETROOT_SEEDS
|
||||
'26':
|
||||
==: org.bukkit.inventory.ItemStack
|
||||
v: 1631
|
||||
|
Loading…
Reference in New Issue
Block a user