Skip to content

Commit 4be7a78

Browse files
committed
feat: add salmon size data
Signed-off-by: Gabriel Harris-Rouquette <[email protected]>
1 parent cc2de8f commit 4be7a78

File tree

7 files changed

+102
-6
lines changed

7 files changed

+102
-6
lines changed

src/main/java/org/spongepowered/api/data/Keys.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
import org.spongepowered.api.data.type.PushReaction;
8686
import org.spongepowered.api.data.type.RabbitType;
8787
import org.spongepowered.api.data.type.RailDirection;
88+
import org.spongepowered.api.data.type.SalmonSize;
8889
import org.spongepowered.api.data.type.SculkSensorState;
8990
import org.spongepowered.api.data.type.SkinPart;
9091
import org.spongepowered.api.data.type.SlabPortion;
@@ -165,6 +166,7 @@
165166
import org.spongepowered.api.entity.living.animal.horse.llama.Llama;
166167
import org.spongepowered.api.entity.living.animal.horse.llama.TraderLlama;
167168
import org.spongepowered.api.entity.living.aquatic.Dolphin;
169+
import org.spongepowered.api.entity.living.aquatic.fish.school.Salmon;
168170
import org.spongepowered.api.entity.living.aquatic.fish.school.TropicalFish;
169171
import org.spongepowered.api.entity.living.golem.IronGolem;
170172
import org.spongepowered.api.entity.living.golem.Shulker;
@@ -2901,6 +2903,11 @@ public final class Keys {
29012903
*/
29022904
public static final Key<Value<Ticks>> ROARING_TIME = Keys.key(ResourceKey.sponge("roaring_time"), Ticks.class);
29032905

2906+
/**
2907+
* The {@link SalmonSize} of a {@link Salmon} entity.
2908+
*/
2909+
public static final Key<Value<SalmonSize>> SALMON_SIZE = Keys.key(ResourceKey.sponge("salmon_size"), SalmonSize.class);
2910+
29042911
/**
29052912
* The current saturation of a {@link Player}.
29062913
*
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
3+
*
4+
* Copyright (c) SpongePowered <https://www.spongepowered.org>
5+
* Copyright (c) contributors
6+
*
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy
8+
* of this software and associated documentation files (the "Software"), to deal
9+
* in the Software without restriction, including without limitation the rights
10+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
* copies of the Software, and to permit persons to whom the Software is
12+
* furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be included in
15+
* all copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
* THE SOFTWARE.
24+
*/
25+
package org.spongepowered.api.data.type;
26+
27+
import org.spongepowered.api.registry.DefaultedRegistryValue;
28+
import org.spongepowered.api.util.annotation.CatalogedBy;
29+
30+
@CatalogedBy(SalmonSizes.class)
31+
public interface SalmonSize extends DefaultedRegistryValue, StringRepresentable {
32+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
3+
*
4+
* Copyright (c) SpongePowered <https://www.spongepowered.org>
5+
* Copyright (c) contributors
6+
*
7+
* Permission is hereby granted, free of charge, to any person obtaining a copy
8+
* of this software and associated documentation files (the "Software"), to deal
9+
* in the Software without restriction, including without limitation the rights
10+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11+
* copies of the Software, and to permit persons to whom the Software is
12+
* furnished to do so, subject to the following conditions:
13+
*
14+
* The above copyright notice and this permission notice shall be included in
15+
* all copies or substantial portions of the Software.
16+
*
17+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23+
* THE SOFTWARE.
24+
*/
25+
package org.spongepowered.api.data.type;
26+
27+
import org.spongepowered.api.ResourceKey;
28+
import org.spongepowered.api.Sponge;
29+
import org.spongepowered.api.registry.DefaultedRegistryReference;
30+
import org.spongepowered.api.registry.RegistryKey;
31+
import org.spongepowered.api.registry.RegistryTypes;
32+
33+
/**
34+
* <!-- This file is automatically generated. Any manual changes will be overwritten. -->
35+
*/
36+
public final class SalmonSizes {
37+
38+
public static final DefaultedRegistryReference<SalmonSize> LARGE = SalmonSizes.key(ResourceKey.sponge("large"));
39+
40+
public static final DefaultedRegistryReference<SalmonSize> MEDIUM = SalmonSizes.key(ResourceKey.sponge("medium"));
41+
42+
public static final DefaultedRegistryReference<SalmonSize> SMALL = SalmonSizes.key(ResourceKey.sponge("small"));
43+
44+
private static DefaultedRegistryReference<SalmonSize> key(ResourceKey key) {
45+
return RegistryKey.of(RegistryTypes.SALMON_SIZE, key).asDefaultedReference(Sponge::game);
46+
}
47+
}

src/main/java/org/spongepowered/api/entity/living/aquatic/fish/school/Salmon.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,14 @@
2424
*/
2525
package org.spongepowered.api.entity.living.aquatic.fish.school;
2626

27+
import org.spongepowered.api.data.Keys;
28+
import org.spongepowered.api.data.type.SalmonSize;
29+
import org.spongepowered.api.data.value.Value;
30+
2731
public interface Salmon extends SchoolingFish {
32+
33+
default Value.Mutable<SalmonSize> size() {
34+
return this.requireValue(Keys.SALMON_SIZE).asMutable();
35+
}
36+
2837
}

src/main/java/org/spongepowered/api/registry/RegistryTypes.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@
8282
import org.spongepowered.api.data.type.RabbitType;
8383
import org.spongepowered.api.data.type.RaidStatus;
8484
import org.spongepowered.api.data.type.RailDirection;
85+
import org.spongepowered.api.data.type.SalmonSize;
86+
import org.spongepowered.api.data.type.SalmonSizes;
8587
import org.spongepowered.api.data.type.SculkSensorState;
8688
import org.spongepowered.api.data.type.SkinPart;
8789
import org.spongepowered.api.data.type.SlabPortion;
@@ -476,6 +478,8 @@ public final class RegistryTypes {
476478

477479
public static final DefaultedRegistryType<Rotation> ROTATION = RegistryTypes.spongeKeyInGame("rotation");
478480

481+
public static final DefaultedRegistryType<SalmonSize> SALMON_SIZE = RegistryTypes.spongeKeyInGame("salmon_size");
482+
479483
public static final DefaultedRegistryType<SculkSensorState> SCULK_SENSOR_STATE = RegistryTypes.spongeKeyInGame("sculk_sensor_state");
480484

481485
public static final DefaultedRegistryType<SelectorSortAlgorithm> SELECTOR_SORT_ALGORITHM = RegistryTypes.spongeKeyInGame("selector_sort_algorithm");

src/main/java/org/spongepowered/api/world/biome/Biomes.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,13 @@
2424
*/
2525
package org.spongepowered.api.world.biome;
2626

27-
import org.jetbrains.annotations.ApiStatus;
2827
import org.spongepowered.api.ResourceKey;
2928
import org.spongepowered.api.registry.Registry;
3029
import org.spongepowered.api.registry.RegistryKey;
3130
import org.spongepowered.api.registry.RegistryReference;
3231
import org.spongepowered.api.registry.RegistryScope;
3332
import org.spongepowered.api.registry.RegistryScopes;
3433
import org.spongepowered.api.registry.RegistryTypes;
35-
import org.spongepowered.api.util.annotation.Experimental;
3634
import org.spongepowered.api.world.server.ServerWorld;
3735

3836
/**
@@ -120,10 +118,6 @@ public final class Biomes {
120118

121119
public static final RegistryReference<Biome> OLD_GROWTH_SPRUCE_TAIGA = Biomes.key(ResourceKey.minecraft("old_growth_spruce_taiga"));
122120

123-
@Experimental("winter_drop")
124-
@ApiStatus.Experimental
125-
public static final RegistryReference<Biome> PALE_GARDEN = Biomes.key(ResourceKey.minecraft("pale_garden"));
126-
127121
public static final RegistryReference<Biome> PLAINS = Biomes.key(ResourceKey.minecraft("plains"));
128122

129123
public static final RegistryReference<Biome> RIVER = Biomes.key(ResourceKey.minecraft("river"));

src/main/java/org/spongepowered/api/world/explosion/ExplosionBlockInteractions.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
import org.spongepowered.api.registry.RegistryKey;
3232
import org.spongepowered.api.registry.RegistryTypes;
3333

34+
/**
35+
* <!-- This file is automatically generated. Any manual changes will be overwritten. -->
36+
*/
3437
public final class ExplosionBlockInteractions {
3538

3639
public static final DefaultedRegistryReference<ExplosionBlockInteraction> DESTROY = ExplosionBlockInteractions.key(ResourceKey.sponge("destroy"));

0 commit comments

Comments
 (0)