-
-
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.
Signed-off-by: Gabriel Harris-Rouquette <[email protected]>
- Loading branch information
Showing
8 changed files
with
381 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
src/main/java/org/spongepowered/api/block/entity/DecoratedPot.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,50 @@ | ||
/* | ||
* 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.block.entity; | ||
|
||
import org.spongepowered.api.data.Keys; | ||
import org.spongepowered.api.data.value.Value; | ||
import org.spongepowered.api.item.ItemType; | ||
|
||
public interface DecoratedPot extends BlockEntity { | ||
|
||
default Value.Mutable<ItemType> front() { | ||
return this.requireValue(Keys.POT_FRONT_DECORATION).asMutable(); | ||
} | ||
|
||
default Value.Mutable<ItemType> back() { | ||
return this.requireValue(Keys.POT_BACK_DECORATION).asMutable(); | ||
} | ||
|
||
|
||
default Value.Mutable<ItemType> left() { | ||
return this.requireValue(Keys.POT_LEFT_DECORATION).asMutable(); | ||
} | ||
|
||
default Value.Mutable<ItemType> right() { | ||
return this.requireValue(Keys.POT_RIGHT_DECORATION).asMutable(); | ||
} | ||
|
||
} |
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
69 changes: 69 additions & 0 deletions
69
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,69 @@ | ||
/* | ||
* 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); | ||
} | ||
|
||
static ArmorTrim of(Supplier<? extends TrimMaterial> material, Supplier<? extends TrimPattern> pattern) { | ||
return Sponge.game().factoryProvider().provide(Factory.class).create(material, pattern); | ||
} | ||
static ArmorTrim of(TrimMaterial material, Supplier<? extends TrimPattern> pattern) { | ||
return Sponge.game().factoryProvider().provide(Factory.class).create(material, pattern); | ||
} | ||
|
||
static ArmorTrim of(Supplier<? extends 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 { | ||
} |
Oops, something went wrong.