Javadoc improvements

This commit is contained in:
tastybento 2023-05-31 20:15:39 -07:00
parent ff493444a7
commit 463ad68179
13 changed files with 43 additions and 20 deletions

1
src/main/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/.DS_Store

View File

@ -29,6 +29,7 @@ import world.bentobox.boxed.listeners.NewAreaListener;
import world.bentobox.boxed.listeners.NewAreaListener.Item;
/**
* Enables admins to place templates in a Box and have them recorded for future boxes.
* @author tastybento
*
*/
@ -74,11 +75,11 @@ public class AdminPlaceStructureCommand extends CompositeCommand {
// Check world
if (!((Boxed)getAddon()).inWorld(getWorld())) {
user.sendMessage("boxed.commands.boxadmin.place.wrong-world");
return false;
return false;
}
/*
* Acceptable syntax with number of args:
* 1. place <structure>
* 1. place <structure>
* 4. place <structure> ~ ~ ~
* 5. place <structure> ~ ~ ~ ROTATION
* 6. place <structure> ~ ~ ~ ROTATION MIRROR
@ -101,10 +102,10 @@ public class AdminPlaceStructureCommand extends CompositeCommand {
}
// Next come the coordinates - there must be at least 3 of them
if ((!args.get(1).equals("~") && !Util.isInteger(args.get(1), true))
|| (!args.get(2).equals("~") && !Util.isInteger(args.get(2), true))
|| (!args.get(2).equals("~") && !Util.isInteger(args.get(2), true))
|| (!args.get(3).equals("~") && !Util.isInteger(args.get(3), true))) {
user.sendMessage("boxed.commands.boxadmin.place.use-integers");
return false;
return false;
}
// If that is all we have, we're done
if (args.size() == 4) {
@ -115,7 +116,7 @@ public class AdminPlaceStructureCommand extends CompositeCommand {
if (sr == null) {
user.sendMessage("boxed.commands.boxadmin.place.unknown-rotation");
Arrays.stream(StructureRotation.values()).map(StructureRotation::name).forEach(user::sendRawMessage);
return false;
return false;
}
if (args.size() == 5) {
return true;
@ -125,11 +126,11 @@ public class AdminPlaceStructureCommand extends CompositeCommand {
if (mirror == null) {
user.sendMessage("boxed.commands.boxadmin.place.unknown-mirror");
Arrays.stream(Mirror.values()).map(Mirror::name).forEach(user::sendRawMessage);
return false;
return false;
}
if (args.size() == 7) {
if (args.get(6).toUpperCase(Locale.ENGLISH).equals("NO_MOBS")) {
noMobs = true;
noMobs = true;
} else {
user.sendMessage("boxed.commands.boxadmin.place.unknown", TextVariables.LABEL, args.get(6).toUpperCase(Locale.ENGLISH));
return false;
@ -149,7 +150,7 @@ public class AdminPlaceStructureCommand extends CompositeCommand {
Location spot = new Location(user.getWorld(), x, y, z);
s.place(spot, true, sr, mirror, PALETTE, INTEGRITY, new Random());
NewAreaListener.removeJigsaw(new Item(tag.getKey(), s, spot, sr, mirror, noMobs));
boolean result = saveStructure(spot, tag, user, sr, mirror);
boolean result = saveStructure(spot, tag, user, sr, mirror);
if (result) {
user.sendMessage("boxed.commands.boxadmin.place.saved");
} else {
@ -174,7 +175,7 @@ public class AdminPlaceStructureCommand extends CompositeCommand {
config.set(spot.getWorld().getEnvironment().name().toLowerCase(Locale.ENGLISH) + "." + xx + "," + spot.getBlockY() + "," + zz, v.toString());
config.save(structures);
} catch (IOException | InvalidConfigurationException e) {
// TODO Auto-generated catch block
// TODO Auto-generated catch block
e.printStackTrace();
return false;
}

View File

@ -14,8 +14,8 @@ import com.google.common.base.Enums;
import world.bentobox.bentobox.BentoBox;
import world.bentobox.boxed.Boxed;
import world.bentobox.boxed.generators.chunks.AbstractBoxedChunkGenerator;
import world.bentobox.boxed.generators.chunks.AbstractBoxedChunkGenerator.ChunkStore;
import world.bentobox.boxed.generators.chunks.BoxedChunkGenerator;
/**
* Copies biomes from seed world
@ -39,8 +39,8 @@ public abstract class AbstractCopyBiomeProvider extends BiomeProvider {
public Biome getBiome(WorldInfo worldInfo, int x, int y, int z) {
int chunkX = x >> 4;
int chunkZ = z >> 4;
chunkX = BoxedChunkGenerator.repeatCalc(chunkX);
chunkZ = BoxedChunkGenerator.repeatCalc(chunkZ);
chunkX = AbstractBoxedChunkGenerator.repeatCalc(chunkX);
chunkZ = AbstractBoxedChunkGenerator.repeatCalc(chunkZ);
@Nullable ChunkStore c = addon.getChunkGenerator(worldInfo.getEnvironment()).getChunk(chunkX, chunkZ);
if (c != null) {

View File

@ -26,7 +26,6 @@ import com.google.common.base.Enums;
import world.bentobox.boxed.Boxed;
import world.bentobox.boxed.generators.chunks.AbstractBoxedChunkGenerator;
import world.bentobox.boxed.generators.chunks.AbstractBoxedChunkGenerator.ChunkStore;
import world.bentobox.boxed.generators.chunks.BoxedChunkGenerator;
/**
* Generates the biomes for the seed world. A seed world is the template for the chunks that
@ -115,8 +114,8 @@ public abstract class AbstractSeedBiomeProvider extends BiomeProvider {
@NonNull
private Biome getVanillaBiome(WorldInfo worldInfo, int x, int y, int z) {
// Get the chunk coordinates
int chunkX = BoxedChunkGenerator.repeatCalc(x >> 4);
int chunkZ = BoxedChunkGenerator.repeatCalc(z >> 4);
int chunkX = AbstractBoxedChunkGenerator.repeatCalc(x >> 4);
int chunkZ = AbstractBoxedChunkGenerator.repeatCalc(z >> 4);
// Get the stored snapshot
ChunkStore snapshot = this.seedGen.getChunk(chunkX, chunkZ);
if (snapshot == null) {

View File

@ -6,6 +6,7 @@ import org.bukkit.block.Biome;
import world.bentobox.boxed.Boxed;
/**
* Generator for the over world
* @author tastybento
*
*/

View File

@ -6,6 +6,7 @@ import org.bukkit.block.Biome;
import world.bentobox.boxed.Boxed;
/**
* Generator for the nether world
* @author tastybento
*
*/

View File

@ -7,6 +7,7 @@ import world.bentobox.boxed.Boxed;
import world.bentobox.boxed.generators.chunks.AbstractBoxedChunkGenerator;
/**
* Generator for the Nether seed world
* @author tastybento
*
*/

View File

@ -7,6 +7,7 @@ import world.bentobox.boxed.Boxed;
import world.bentobox.boxed.generators.chunks.AbstractBoxedChunkGenerator;
/**
* Generator for the seed world
* @author tastybento
*
*/

View File

@ -1 +1,5 @@
/**
* Generators to make the worlds with the custom biomes
* @author tastybento
*/
package world.bentobox.boxed.generators.biomes;

View File

@ -1,4 +1,5 @@
/**
* Generators and populators to make the base world
* @author tastybento
*
*/

View File

@ -2,8 +2,13 @@ package world.bentobox.boxed.objects;
import com.google.gson.annotations.Expose;
/**
* This replicates a jigsaw block.
* @author tastybento
*
*/
public class BoxedJigsawBlock {
// final_state:"minecraft:polished_blackstone_bricks",joint:"aligned",name:"minecraft:empty",pool:"minecraft:bastion/bridge/legs",target:"minecraft:leg_connector"
// final_state:"minecraft:polished_blackstone_bricks",joint:"aligned",name:"minecraft:empty",pool:"minecraft:bastion/bridge/legs",target:"minecraft:leg_connector"
@Expose
private String final_state;
@Expose

View File

@ -7,11 +7,12 @@ import org.bukkit.block.structure.StructureRotation;
import com.google.gson.annotations.Expose;
/**
* This represents a Structure Block
* @author tastybento
*
*/
public class BoxedStructureBlock {
//{author:"LadyAgnes",ignoreEntities:1b,integrity:1.0f,metadata:"drowned",mirror:"NONE",mode:"DATA",name:"",posX:0,posY:1,posZ:0,powered:0b,rotation:"NONE",seed:0L,showair:0b
//{author:"LadyAgnes",ignoreEntities:1b,integrity:1.0f,metadata:"drowned",mirror:"NONE",mode:"DATA",name:"",posX:0,posY:1,posZ:0,powered:0b,rotation:"NONE",seed:0L,showair:0b
//,showboundingbox:1b,sizeX:0,sizeY:0,sizeZ:0}
@Expose
private String author;
@ -168,7 +169,7 @@ public class BoxedStructureBlock {
+ seed + ", showair=" + showair + ", showboundingbox=" + showboundingbox + ", sizeX=" + sizeX
+ ", sizeY=" + sizeY + ", sizeZ=" + sizeZ + "]";
}
}

View File

@ -10,6 +10,13 @@ import com.google.gson.annotations.Expose;
import world.bentobox.bentobox.database.objects.DataObject;
import world.bentobox.bentobox.database.objects.Table;
/**
* Stores all the structures placed in the box when it is made.
* These are used later to identify when a player enters such a structure and
* trigger an Advancement
* @author tastybento
*
*/
@Table(name = "IslandStructures")
public class IslandStructures implements DataObject {