-
-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
292 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
src/main/java/org/spongepowered/api/item/recipe/smithing/ArmorTrim.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* 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.item.recipe.smithing; | ||
|
||
import org.spongepowered.api.Sponge; | ||
|
||
import java.util.function.Supplier; | ||
|
||
public interface ArmorTrim { | ||
|
||
static ArmorTrim of(TrimMaterial material, TrimPattern pattern) { | ||
return Sponge.game().factoryProvider().provide(Factory.class).create(material, pattern); | ||
} | ||
|
||
TrimMaterial material(); | ||
|
||
TrimPattern pattern(); | ||
|
||
interface Factory { | ||
|
||
ArmorTrim create(TrimMaterial material, TrimPattern pattern); | ||
|
||
default ArmorTrim create(Supplier<? extends TrimMaterial> material, Supplier<? extends TrimPattern> pattern) { | ||
return create(material.get(), pattern.get()); | ||
} | ||
|
||
default ArmorTrim create(Supplier<? extends TrimMaterial> material, TrimPattern pattern) { | ||
return create(material.get(), pattern); | ||
} | ||
|
||
default ArmorTrim create(TrimMaterial material, Supplier<? extends TrimPattern> pattern) { | ||
return create(material, pattern.get()); | ||
} | ||
|
||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/main/java/org/spongepowered/api/item/recipe/smithing/TrimMaterial.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/* | ||
* 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.item.recipe.smithing; | ||
|
||
import org.spongepowered.api.registry.DefaultedRegistryValue; | ||
import org.spongepowered.api.util.annotation.CatalogedBy; | ||
|
||
@CatalogedBy(TrimMaterials.class) | ||
public interface TrimMaterial extends DefaultedRegistryValue { | ||
|
||
} |
70 changes: 70 additions & 0 deletions
70
src/main/java/org/spongepowered/api/item/recipe/smithing/TrimMaterials.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* 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.item.recipe.smithing; | ||
|
||
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.RegistryScope; | ||
import org.spongepowered.api.registry.RegistryScopes; | ||
import org.spongepowered.api.registry.RegistryTypes; | ||
|
||
@SuppressWarnings("unused") | ||
@RegistryScopes(scopes = RegistryScope.ENGINE) | ||
public final class TrimMaterials { | ||
|
||
public static final DefaultedRegistryReference<TrimMaterial> AMETHYST = TrimMaterials.key(ResourceKey.minecraft("amethyst")); | ||
|
||
public static final DefaultedRegistryReference<TrimMaterial> COPPER = TrimMaterials.key(ResourceKey.minecraft("copper")); | ||
|
||
public static final DefaultedRegistryReference<TrimMaterial> DIAMOND = TrimMaterials.key(ResourceKey.minecraft("diamond")); | ||
|
||
public static final DefaultedRegistryReference<TrimMaterial> EMERALD = TrimMaterials.key(ResourceKey.minecraft("emerald")); | ||
|
||
public static final DefaultedRegistryReference<TrimMaterial> GOLD = TrimMaterials.key(ResourceKey.minecraft("gold")); | ||
|
||
public static final DefaultedRegistryReference<TrimMaterial> IRON = TrimMaterials.key(ResourceKey.minecraft("iron")); | ||
|
||
public static final DefaultedRegistryReference<TrimMaterial> LAPIS = TrimMaterials.key(ResourceKey.minecraft("lapis")); | ||
|
||
public static final DefaultedRegistryReference<TrimMaterial> NETHERITE = TrimMaterials.key(ResourceKey.minecraft("netherite")); | ||
|
||
public static final DefaultedRegistryReference<TrimMaterial> QUARTZ = TrimMaterials.key(ResourceKey.minecraft("quartz")); | ||
|
||
public static final DefaultedRegistryReference<TrimMaterial> REDSTONE = TrimMaterials.key(ResourceKey.minecraft("redstone")); | ||
|
||
private TrimMaterials() { | ||
} | ||
|
||
public static Registry<TrimMaterial> registry() { | ||
return Sponge.server().registry(RegistryTypes.TRIM_MATERIAL); | ||
} | ||
|
||
private static DefaultedRegistryReference<TrimMaterial> key(final ResourceKey location) { | ||
return RegistryKey.of(RegistryTypes.TRIM_MATERIAL, location).asDefaultedReference(Sponge::server); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
src/main/java/org/spongepowered/api/item/recipe/smithing/TrimPattern.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.item.recipe.smithing; | ||
|
||
import org.spongepowered.api.registry.DefaultedRegistryValue; | ||
import org.spongepowered.api.util.annotation.CatalogedBy; | ||
|
||
@CatalogedBy(TrimPatterns.class) | ||
public interface TrimPattern extends DefaultedRegistryValue { | ||
} |
86 changes: 86 additions & 0 deletions
86
src/main/java/org/spongepowered/api/item/recipe/smithing/TrimPatterns.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
/* | ||
* 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.item.recipe.smithing; | ||
|
||
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.RegistryScope; | ||
import org.spongepowered.api.registry.RegistryScopes; | ||
import org.spongepowered.api.registry.RegistryTypes; | ||
|
||
@SuppressWarnings("unused") | ||
@RegistryScopes(scopes = RegistryScope.ENGINE) | ||
public final class TrimPatterns { | ||
|
||
public static final DefaultedRegistryReference<TrimPattern> BOLT = TrimPatterns.key(ResourceKey.minecraft("bolt")); | ||
|
||
public static final DefaultedRegistryReference<TrimPattern> COAST = TrimPatterns.key(ResourceKey.minecraft("coast")); | ||
|
||
public static final DefaultedRegistryReference<TrimPattern> DUNE = TrimPatterns.key(ResourceKey.minecraft("dune")); | ||
|
||
public static final DefaultedRegistryReference<TrimPattern> EYE = TrimPatterns.key(ResourceKey.minecraft("eye")); | ||
|
||
public static final DefaultedRegistryReference<TrimPattern> FLOW = TrimPatterns.key(ResourceKey.minecraft("flow")); | ||
|
||
public static final DefaultedRegistryReference<TrimPattern> HOST = TrimPatterns.key(ResourceKey.minecraft("host")); | ||
|
||
public static final DefaultedRegistryReference<TrimPattern> RAISER = TrimPatterns.key(ResourceKey.minecraft("raiser")); | ||
|
||
public static final DefaultedRegistryReference<TrimPattern> RIB = TrimPatterns.key(ResourceKey.minecraft("rib")); | ||
|
||
public static final DefaultedRegistryReference<TrimPattern> SENTRY = TrimPatterns.key(ResourceKey.minecraft("sentry")); | ||
|
||
public static final DefaultedRegistryReference<TrimPattern> SHAPER = TrimPatterns.key(ResourceKey.minecraft("shaper")); | ||
|
||
public static final DefaultedRegistryReference<TrimPattern> SILENCE = TrimPatterns.key(ResourceKey.minecraft("silence")); | ||
|
||
public static final DefaultedRegistryReference<TrimPattern> SNOUT = TrimPatterns.key(ResourceKey.minecraft("snout")); | ||
|
||
public static final DefaultedRegistryReference<TrimPattern> SPIRE = TrimPatterns.key(ResourceKey.minecraft("spire")); | ||
|
||
public static final DefaultedRegistryReference<TrimPattern> TIDE = TrimPatterns.key(ResourceKey.minecraft("tide")); | ||
|
||
public static final DefaultedRegistryReference<TrimPattern> VEX = TrimPatterns.key(ResourceKey.minecraft("vex")); | ||
|
||
public static final DefaultedRegistryReference<TrimPattern> WARD = TrimPatterns.key(ResourceKey.minecraft("ward")); | ||
|
||
public static final DefaultedRegistryReference<TrimPattern> WAYFINDER = TrimPatterns.key(ResourceKey.minecraft("wayfinder")); | ||
|
||
public static final DefaultedRegistryReference<TrimPattern> WILD = TrimPatterns.key(ResourceKey.minecraft("wild")); | ||
|
||
private TrimPatterns() { | ||
} | ||
|
||
public static Registry<TrimPattern> registry() { | ||
return Sponge.server().registry(RegistryTypes.TRIM_PATTERN); | ||
} | ||
|
||
private static DefaultedRegistryReference<TrimPattern> key(final ResourceKey location) { | ||
return RegistryKey.of(RegistryTypes.TRIM_PATTERN, location).asDefaultedReference(Sponge::server); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters