Skip to content

Commit 62e90bd

Browse files
gabizouChris Sanders
authored andcommitted
Complete javadocs for all DataManipulators. Add getters for guaranteed
DataManipulators with entities. Signed-off-by: Gabriel Harris-Rouquette <[email protected]>
1 parent a6ce75f commit 62e90bd

File tree

126 files changed

+845
-98
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+845
-98
lines changed

src/main/java/org/spongepowered/api/CatalogTypes.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
import org.spongepowered.api.data.types.Comparison;
3939
import org.spongepowered.api.data.types.CookedFish;
4040
import org.spongepowered.api.data.types.DirtType;
41-
import org.spongepowered.api.data.types.DisgusedBlockType;
41+
import org.spongepowered.api.data.types.DisguisedBlockType;
4242
import org.spongepowered.api.data.types.DoubleSizePlantType;
4343
import org.spongepowered.api.data.types.DyeColor;
4444
import org.spongepowered.api.data.types.Fish;
@@ -88,7 +88,6 @@
8888
import org.spongepowered.api.text.chat.ChatType;
8989
import org.spongepowered.api.text.format.TextColor;
9090
import org.spongepowered.api.text.selector.SelectorType;
91-
import org.spongepowered.api.text.translation.Translation;
9291
import org.spongepowered.api.util.rotation.Rotation;
9392
import org.spongepowered.api.world.DimensionType;
9493
import org.spongepowered.api.world.GeneratorType;
@@ -122,7 +121,7 @@ public final class CatalogTypes {
122121
public static final Class<Difficulty> DIFFICULTY = Difficulty.class;
123122
public static final Class<DimensionType> DIMENSION_TYPE = DimensionType.class;
124123
public static final Class<DirtType> DIRT_TYPE = DirtType.class;
125-
public static final Class<DisgusedBlockType> DISGUSED_BLOCK_TYPE = DisgusedBlockType.class;
124+
public static final Class<DisguisedBlockType> DISGUSED_BLOCK_TYPE = DisguisedBlockType.class;
126125
public static final Class<DoubleSizePlantType> DOUBLE_SIZE_PLANT_TYPE = DoubleSizePlantType.class;
127126
public static final Class<DyeColor> DYE_COLOR = DyeColor.class;
128127
public static final Class<Enchantment> ENCHANTMENT = Enchantment.class;

src/main/java/org/spongepowered/api/block/tile/Jukebox.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*/
2525
package org.spongepowered.api.block.tile;
2626

27-
import org.spongepowered.api.data.manipulators.entities.RepresentedItemData;
27+
import org.spongepowered.api.data.manipulators.RepresentedItemData;
2828
import org.spongepowered.api.item.inventory.ItemStack;
2929

3030
/**

src/main/java/org/spongepowered/api/block/tile/MobSpawner.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
*/
2525
package org.spongepowered.api.block.tile;
2626

27+
import org.spongepowered.api.data.manipulators.MobSpawnerData;
28+
2729
/**
2830
* Represents a Monster Spawner.
2931
*/
@@ -39,4 +41,11 @@ public interface MobSpawner extends TileEntity {
3941
*/
4042
void spawnEntityBatchImmediately(boolean force);
4143

44+
/**
45+
* Gets a copy of the currently used {@link MobSpawnerData} for this mob spawner.
46+
*
47+
* @return A copy of the mob spawner data
48+
*/
49+
MobSpawnerData getSpawnerData();
50+
4251
}

src/main/java/org/spongepowered/api/block/tile/Note.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,11 @@ public interface Note extends TileEntity {
4040
*/
4141
void playNote();
4242

43+
/**
44+
* Gets a copy of the currently used {@link NoteData}.
45+
*
46+
* @return The currently used note data
47+
*/
48+
NoteData getNoteData();
49+
4350
}

src/main/java/org/spongepowered/api/block/tile/Sign.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,18 @@
2424
*/
2525
package org.spongepowered.api.block.tile;
2626

27+
import org.spongepowered.api.data.manipulators.tileentities.SignData;
28+
2729
/**
2830
* Represents a sign.
2931
*/
3032
public interface Sign extends TileEntity {
3133

34+
/**
35+
* Gets a copy of the currently used {@link SignData}.
36+
*
37+
* @return A copy of the currently used sign data
38+
*/
39+
SignData getSignData();
40+
3241
}

src/main/java/org/spongepowered/api/data/manipulators/DisplayNameData.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,18 @@ public interface DisplayNameData extends SingleValueData<Text, DisplayNameData>
5454
*/
5555
void setDisplayName(Text displayName);
5656

57+
/**
58+
* Returns whether the custom name is visible to players.
59+
*
60+
* @return Whether the custom name is visible or not
61+
*/
62+
boolean isCustomNameVisible();
63+
64+
/**
65+
* Sets whether the custom name is visible to players.
66+
*
67+
* @param visible Whether the custom name is visible
68+
*/
69+
void setCustomNameVisible(boolean visible);
70+
5771
}

src/main/java/org/spongepowered/api/data/manipulators/DyeableData.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,18 @@
2424
*/
2525
package org.spongepowered.api.data.manipulators;
2626

27+
import org.spongepowered.api.block.BlockTypes;
28+
import org.spongepowered.api.data.DataHolder;
2729
import org.spongepowered.api.data.types.DyeColor;
30+
import org.spongepowered.api.entity.living.animal.Sheep;
31+
import org.spongepowered.api.entity.living.animal.Wolf;
32+
import org.spongepowered.api.item.ItemTypes;
2833

34+
/**
35+
* Signifies that a {@link DataHolder} can be "dyed" a specific
36+
* {@link DyeColor}. Usually applicable to {@link BlockTypes#WOOL},
37+
* {@link Sheep}, {@link Wolf} collars, and {@link ItemTypes#DYE}, etc.
38+
*/
2939
public interface DyeableData extends SingleValueData<DyeColor, DyeableData> {
3040

3141
}

src/main/java/org/spongepowered/api/data/manipulators/IntData.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
*/
2525
package org.spongepowered.api.data.manipulators;
2626

27+
/**
28+
* Represents an abstract {@link SingleValueData} that has an int value.
29+
*
30+
* @param <T> The type of implementing data
31+
*/
2732
public interface IntData<T extends IntData<T>> extends SingleValueData<Integer, T> {
2833

2934
/**

src/main/java/org/spongepowered/api/data/manipulators/PotionEffectData.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,21 @@
2424
*/
2525
package org.spongepowered.api.data.manipulators;
2626

27+
import org.spongepowered.api.data.DataHolder;
28+
import org.spongepowered.api.entity.Entity;
29+
import org.spongepowered.api.item.ItemTypes;
30+
import org.spongepowered.api.item.inventory.ItemStack;
2731
import org.spongepowered.api.potion.PotionEffect;
2832
import org.spongepowered.api.potion.PotionEffectType;
2933

3034
import java.util.Collection;
3135
import java.util.List;
3236

37+
/**
38+
* Represents a {@link List} of {@link PotionEffect}s that can be applicable to
39+
* various {@link DataHolder}s such as {@link Entity}s, {@link ItemStack}s as
40+
* {@link ItemTypes#POTION}, etc.
41+
*/
3342
public interface PotionEffectData extends ListData<PotionEffect, PotionEffectData> {
3443

3544
/**

src/main/java/org/spongepowered/api/data/manipulators/entities/RepresentedItemData.java renamed to src/main/java/org/spongepowered/api/data/manipulators/RepresentedItemData.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@
2222
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2323
* THE SOFTWARE.
2424
*/
25-
package org.spongepowered.api.data.manipulators.entities;
25+
package org.spongepowered.api.data.manipulators;
2626

27-
import org.spongepowered.api.block.tile.FlowerPot;
28-
import org.spongepowered.api.block.tile.Jukebox;
29-
import org.spongepowered.api.block.tile.TileEntity;
30-
import org.spongepowered.api.data.manipulators.SingleValueData;
27+
import org.spongepowered.api.entity.Entity;
28+
import org.spongepowered.api.entity.Item;
29+
import org.spongepowered.api.entity.hanging.ItemFrame;
3130
import org.spongepowered.api.item.inventory.ItemStack;
3231

3332
/**
34-
* Represents a {@link TileEntity} that acts on an {@link ItemStack}.
35-
* Usually applicable to {@link Jukebox}es and {@link FlowerPot}s.
33+
* Represents an {@link ItemStack} being "represented" graphically by an
34+
* {@link Entity}. Usually applicable to {@link Item}s, {@link ItemFrame}s,
35+
* etc.
3636
*/
3737
public interface RepresentedItemData extends SingleValueData<ItemStack, RepresentedItemData> {
3838

0 commit comments

Comments
 (0)