Skip to content

Commit

Permalink
feat: Add Vault and Trial states
Browse files Browse the repository at this point in the history
  • Loading branch information
gabizou committed Jun 4, 2024
1 parent 779d472 commit 6eb0d9b
Show file tree
Hide file tree
Showing 5 changed files with 173 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.spongepowered.api.data.type;

import org.spongepowered.api.util.annotation.CatalogedBy;

@CatalogedBy(TrialSpawnerStates.class)
public interface TrialSpawnerState extends Comparable<TrialSpawnerState>, StringRepresentable {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.spongepowered.api.data.type;

import org.spongepowered.api.ResourceKey;
import org.spongepowered.api.Sponge;
import org.spongepowered.api.registry.DefaultedRegistryReference;
import org.spongepowered.api.registry.Registry;
import org.spongepowered.api.registry.RegistryKey;
import org.spongepowered.api.registry.RegistryTypes;

public final class TrialSpawnerStates {

public static final DefaultedRegistryReference<TrialSpawnerState> INACTIVE = TrialSpawnerStates.key(ResourceKey.sponge("INACTIVE"));

public static final DefaultedRegistryReference<TrialSpawnerState> WAITING_FOR_PLAYERS = TrialSpawnerStates.key(ResourceKey.sponge("WAITING_FOR_PLAYERS"));

public static final DefaultedRegistryReference<TrialSpawnerState> ACTIVE = TrialSpawnerStates.key(ResourceKey.sponge("ACTIVE"));

public static final DefaultedRegistryReference<TrialSpawnerState> WAITING_FOR_REWARD_EJECTION = TrialSpawnerStates.key(ResourceKey.sponge("WAITING_FOR_REWARD_EJECTION"));

public static final DefaultedRegistryReference<TrialSpawnerState> EJECTING_REWARD = TrialSpawnerStates.key(ResourceKey.sponge("EJECTING_REWARD"));

public static final DefaultedRegistryReference<TrialSpawnerState> COOLDOWN = TrialSpawnerStates.key(ResourceKey.sponge("COOLDOWN"));


public static Registry<TrialSpawnerState> registry() {
return Sponge.game().registry(RegistryTypes.TRIAL_SPAWNER_STATE);
}

private static DefaultedRegistryReference<TrialSpawnerState> key(final ResourceKey location) {
return RegistryKey.of(RegistryTypes.TRIAL_SPAWNER_STATE, location).asDefaultedReference(Sponge::game);
}
}
32 changes: 32 additions & 0 deletions src/main/java/org/spongepowered/api/data/type/VaultState.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.spongepowered.api.data.type;

import org.spongepowered.api.util.annotation.CatalogedBy;

@CatalogedBy(VaultStates.class)
public interface VaultState extends Comparable<VaultStates>, StringRepresentable {

}
49 changes: 49 additions & 0 deletions src/main/java/org/spongepowered/api/data/type/VaultStates.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* This file is part of SpongeAPI, licensed under the MIT License (MIT).
*
* Copyright (c) SpongePowered <https://www.spongepowered.org>
* Copyright (c) contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package org.spongepowered.api.data.type;

import org.spongepowered.api.ResourceKey;
import org.spongepowered.api.Sponge;
import org.spongepowered.api.registry.DefaultedRegistryReference;
import org.spongepowered.api.registry.Registry;
import org.spongepowered.api.registry.RegistryKey;
import org.spongepowered.api.registry.RegistryTypes;

public final class VaultStates {

public static final DefaultedRegistryReference<VaultState> INACTIVE = VaultStates.key(ResourceKey.sponge("inactive"));
public static final DefaultedRegistryReference<VaultState> ACTIVE = VaultStates.key(ResourceKey.sponge("active"));
public static final DefaultedRegistryReference<VaultState> UNLOCKING = VaultStates.key(ResourceKey.sponge("unlocking"));
public static final DefaultedRegistryReference<VaultState> EJECTING = VaultStates.key(ResourceKey.sponge("ejecting"));

public static Registry<VaultState> registry() {
return Sponge.game().registry(RegistryTypes.VAULT_STATE);
}

private static DefaultedRegistryReference<VaultState> key(final ResourceKey location) {
return RegistryKey.of(RegistryTypes.VAULT_STATE, location).asDefaultedReference(Sponge::game);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
import org.spongepowered.api.data.type.StairShape;
import org.spongepowered.api.data.type.StructureMode;
import org.spongepowered.api.data.type.Tilt;
import org.spongepowered.api.data.type.TrialSpawnerState;
import org.spongepowered.api.data.type.VaultState;
import org.spongepowered.api.data.type.WallConnectionState;
import org.spongepowered.api.data.type.WireAttachmentType;
import org.spongepowered.api.util.Axis;
Expand Down Expand Up @@ -179,11 +181,11 @@ public static EnumStateProperty<Tilt> property_TILT() {
return EnumStateProperty.of("TILT");
}

public static EnumStateProperty<?> property_TRIAL_SPAWNER_STATE() {
public static EnumStateProperty<TrialSpawnerState> property_TRIAL_SPAWNER_STATE() {
return EnumStateProperty.of("TRIAL_SPAWNER_STATE");
}

public static EnumStateProperty<?> property_VAULT_STATE() {
public static EnumStateProperty<VaultState> property_VAULT_STATE() {
return EnumStateProperty.of("VAULT_STATE");
}

Expand Down

0 comments on commit 6eb0d9b

Please sign in to comment.