Skip to content

Commit

Permalink
Change BannerPatternShape to engine scope
Browse files Browse the repository at this point in the history
  • Loading branch information
aromaa committed May 20, 2024
1 parent a6f2cfd commit b41a947
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import org.spongepowered.api.data.type.BannerPatternShape;
import org.spongepowered.api.data.type.DyeColor;
import org.spongepowered.api.registry.DefaultedRegistryReference;
import org.spongepowered.api.registry.RegistryReference;
import org.spongepowered.api.util.CopyableBuilder;

import java.util.function.Supplier;
Expand All @@ -49,7 +48,7 @@ public interface BannerPatternLayer extends DataSerializable {
* @param color The color
* @return The new pattern layer
*/
static BannerPatternLayer of(RegistryReference<? extends BannerPatternShape> shape, DefaultedRegistryReference<? extends DyeColor> color) {
static BannerPatternLayer of(DefaultedRegistryReference<? extends BannerPatternShape> shape, DefaultedRegistryReference<? extends DyeColor> color) {
return BannerPatternLayer.of(shape.get(), color.get());
}

Expand All @@ -61,7 +60,7 @@ static BannerPatternLayer of(RegistryReference<? extends BannerPatternShape> sha
* @param color The color
* @return The new pattern layer
*/
static BannerPatternLayer of(RegistryReference<? extends BannerPatternShape> shape, DyeColor color) {
static BannerPatternLayer of(DefaultedRegistryReference<? extends BannerPatternShape> shape, DyeColor color) {
return BannerPatternLayer.of(shape.get(), color);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,111 +25,111 @@
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.RegistryReference;
import org.spongepowered.api.registry.RegistryScope;
import org.spongepowered.api.registry.RegistryScopes;
import org.spongepowered.api.registry.RegistryTypes;
import org.spongepowered.api.world.server.ServerWorld;

/**
* <!-- This file is automatically generated. Any manual changes will be overwritten. -->
*/
@SuppressWarnings("unused")
@RegistryScopes(scopes = RegistryScope.WORLD)
@RegistryScopes(scopes = RegistryScope.ENGINE)
public final class BannerPatternShapes {

public static final RegistryReference<BannerPatternShape> BASE = BannerPatternShapes.key(ResourceKey.minecraft("base"));
public static final DefaultedRegistryReference<BannerPatternShape> BASE = BannerPatternShapes.key(ResourceKey.minecraft("base"));

public static final RegistryReference<BannerPatternShape> BORDER = BannerPatternShapes.key(ResourceKey.minecraft("border"));
public static final DefaultedRegistryReference<BannerPatternShape> BORDER = BannerPatternShapes.key(ResourceKey.minecraft("border"));

public static final RegistryReference<BannerPatternShape> BRICKS = BannerPatternShapes.key(ResourceKey.minecraft("bricks"));
public static final DefaultedRegistryReference<BannerPatternShape> BRICKS = BannerPatternShapes.key(ResourceKey.minecraft("bricks"));

public static final RegistryReference<BannerPatternShape> CIRCLE = BannerPatternShapes.key(ResourceKey.minecraft("circle"));
public static final DefaultedRegistryReference<BannerPatternShape> CIRCLE = BannerPatternShapes.key(ResourceKey.minecraft("circle"));

public static final RegistryReference<BannerPatternShape> CREEPER = BannerPatternShapes.key(ResourceKey.minecraft("creeper"));
public static final DefaultedRegistryReference<BannerPatternShape> CREEPER = BannerPatternShapes.key(ResourceKey.minecraft("creeper"));

public static final RegistryReference<BannerPatternShape> CROSS = BannerPatternShapes.key(ResourceKey.minecraft("cross"));
public static final DefaultedRegistryReference<BannerPatternShape> CROSS = BannerPatternShapes.key(ResourceKey.minecraft("cross"));

public static final RegistryReference<BannerPatternShape> CURLY_BORDER = BannerPatternShapes.key(ResourceKey.minecraft("curly_border"));
public static final DefaultedRegistryReference<BannerPatternShape> CURLY_BORDER = BannerPatternShapes.key(ResourceKey.minecraft("curly_border"));

public static final RegistryReference<BannerPatternShape> DIAGONAL_LEFT = BannerPatternShapes.key(ResourceKey.minecraft("diagonal_left"));
public static final DefaultedRegistryReference<BannerPatternShape> DIAGONAL_LEFT = BannerPatternShapes.key(ResourceKey.minecraft("diagonal_left"));

public static final RegistryReference<BannerPatternShape> DIAGONAL_RIGHT = BannerPatternShapes.key(ResourceKey.minecraft("diagonal_right"));
public static final DefaultedRegistryReference<BannerPatternShape> DIAGONAL_RIGHT = BannerPatternShapes.key(ResourceKey.minecraft("diagonal_right"));

public static final RegistryReference<BannerPatternShape> DIAGONAL_UP_LEFT = BannerPatternShapes.key(ResourceKey.minecraft("diagonal_up_left"));
public static final DefaultedRegistryReference<BannerPatternShape> DIAGONAL_UP_LEFT = BannerPatternShapes.key(ResourceKey.minecraft("diagonal_up_left"));

public static final RegistryReference<BannerPatternShape> DIAGONAL_UP_RIGHT = BannerPatternShapes.key(ResourceKey.minecraft("diagonal_up_right"));
public static final DefaultedRegistryReference<BannerPatternShape> DIAGONAL_UP_RIGHT = BannerPatternShapes.key(ResourceKey.minecraft("diagonal_up_right"));

public static final RegistryReference<BannerPatternShape> FLOWER = BannerPatternShapes.key(ResourceKey.minecraft("flower"));
public static final DefaultedRegistryReference<BannerPatternShape> FLOWER = BannerPatternShapes.key(ResourceKey.minecraft("flower"));

public static final RegistryReference<BannerPatternShape> GLOBE = BannerPatternShapes.key(ResourceKey.minecraft("globe"));
public static final DefaultedRegistryReference<BannerPatternShape> GLOBE = BannerPatternShapes.key(ResourceKey.minecraft("globe"));

public static final RegistryReference<BannerPatternShape> GRADIENT = BannerPatternShapes.key(ResourceKey.minecraft("gradient"));
public static final DefaultedRegistryReference<BannerPatternShape> GRADIENT = BannerPatternShapes.key(ResourceKey.minecraft("gradient"));

public static final RegistryReference<BannerPatternShape> GRADIENT_UP = BannerPatternShapes.key(ResourceKey.minecraft("gradient_up"));
public static final DefaultedRegistryReference<BannerPatternShape> GRADIENT_UP = BannerPatternShapes.key(ResourceKey.minecraft("gradient_up"));

public static final RegistryReference<BannerPatternShape> HALF_HORIZONTAL = BannerPatternShapes.key(ResourceKey.minecraft("half_horizontal"));
public static final DefaultedRegistryReference<BannerPatternShape> HALF_HORIZONTAL = BannerPatternShapes.key(ResourceKey.minecraft("half_horizontal"));

public static final RegistryReference<BannerPatternShape> HALF_HORIZONTAL_BOTTOM = BannerPatternShapes.key(ResourceKey.minecraft("half_horizontal_bottom"));
public static final DefaultedRegistryReference<BannerPatternShape> HALF_HORIZONTAL_BOTTOM = BannerPatternShapes.key(ResourceKey.minecraft("half_horizontal_bottom"));

public static final RegistryReference<BannerPatternShape> HALF_VERTICAL = BannerPatternShapes.key(ResourceKey.minecraft("half_vertical"));
public static final DefaultedRegistryReference<BannerPatternShape> HALF_VERTICAL = BannerPatternShapes.key(ResourceKey.minecraft("half_vertical"));

public static final RegistryReference<BannerPatternShape> HALF_VERTICAL_RIGHT = BannerPatternShapes.key(ResourceKey.minecraft("half_vertical_right"));
public static final DefaultedRegistryReference<BannerPatternShape> HALF_VERTICAL_RIGHT = BannerPatternShapes.key(ResourceKey.minecraft("half_vertical_right"));

public static final RegistryReference<BannerPatternShape> MOJANG = BannerPatternShapes.key(ResourceKey.minecraft("mojang"));
public static final DefaultedRegistryReference<BannerPatternShape> MOJANG = BannerPatternShapes.key(ResourceKey.minecraft("mojang"));

public static final RegistryReference<BannerPatternShape> PIGLIN = BannerPatternShapes.key(ResourceKey.minecraft("piglin"));
public static final DefaultedRegistryReference<BannerPatternShape> PIGLIN = BannerPatternShapes.key(ResourceKey.minecraft("piglin"));

public static final RegistryReference<BannerPatternShape> RHOMBUS = BannerPatternShapes.key(ResourceKey.minecraft("rhombus"));
public static final DefaultedRegistryReference<BannerPatternShape> RHOMBUS = BannerPatternShapes.key(ResourceKey.minecraft("rhombus"));

public static final RegistryReference<BannerPatternShape> SKULL = BannerPatternShapes.key(ResourceKey.minecraft("skull"));
public static final DefaultedRegistryReference<BannerPatternShape> SKULL = BannerPatternShapes.key(ResourceKey.minecraft("skull"));

public static final RegistryReference<BannerPatternShape> SMALL_STRIPES = BannerPatternShapes.key(ResourceKey.minecraft("small_stripes"));
public static final DefaultedRegistryReference<BannerPatternShape> SMALL_STRIPES = BannerPatternShapes.key(ResourceKey.minecraft("small_stripes"));

public static final RegistryReference<BannerPatternShape> SQUARE_BOTTOM_LEFT = BannerPatternShapes.key(ResourceKey.minecraft("square_bottom_left"));
public static final DefaultedRegistryReference<BannerPatternShape> SQUARE_BOTTOM_LEFT = BannerPatternShapes.key(ResourceKey.minecraft("square_bottom_left"));

public static final RegistryReference<BannerPatternShape> SQUARE_BOTTOM_RIGHT = BannerPatternShapes.key(ResourceKey.minecraft("square_bottom_right"));
public static final DefaultedRegistryReference<BannerPatternShape> SQUARE_BOTTOM_RIGHT = BannerPatternShapes.key(ResourceKey.minecraft("square_bottom_right"));

public static final RegistryReference<BannerPatternShape> SQUARE_TOP_LEFT = BannerPatternShapes.key(ResourceKey.minecraft("square_top_left"));
public static final DefaultedRegistryReference<BannerPatternShape> SQUARE_TOP_LEFT = BannerPatternShapes.key(ResourceKey.minecraft("square_top_left"));

public static final RegistryReference<BannerPatternShape> SQUARE_TOP_RIGHT = BannerPatternShapes.key(ResourceKey.minecraft("square_top_right"));
public static final DefaultedRegistryReference<BannerPatternShape> SQUARE_TOP_RIGHT = BannerPatternShapes.key(ResourceKey.minecraft("square_top_right"));

public static final RegistryReference<BannerPatternShape> STRAIGHT_CROSS = BannerPatternShapes.key(ResourceKey.minecraft("straight_cross"));
public static final DefaultedRegistryReference<BannerPatternShape> STRAIGHT_CROSS = BannerPatternShapes.key(ResourceKey.minecraft("straight_cross"));

public static final RegistryReference<BannerPatternShape> STRIPE_BOTTOM = BannerPatternShapes.key(ResourceKey.minecraft("stripe_bottom"));
public static final DefaultedRegistryReference<BannerPatternShape> STRIPE_BOTTOM = BannerPatternShapes.key(ResourceKey.minecraft("stripe_bottom"));

public static final RegistryReference<BannerPatternShape> STRIPE_CENTER = BannerPatternShapes.key(ResourceKey.minecraft("stripe_center"));
public static final DefaultedRegistryReference<BannerPatternShape> STRIPE_CENTER = BannerPatternShapes.key(ResourceKey.minecraft("stripe_center"));

public static final RegistryReference<BannerPatternShape> STRIPE_DOWNLEFT = BannerPatternShapes.key(ResourceKey.minecraft("stripe_downleft"));
public static final DefaultedRegistryReference<BannerPatternShape> STRIPE_DOWNLEFT = BannerPatternShapes.key(ResourceKey.minecraft("stripe_downleft"));

public static final RegistryReference<BannerPatternShape> STRIPE_DOWNRIGHT = BannerPatternShapes.key(ResourceKey.minecraft("stripe_downright"));
public static final DefaultedRegistryReference<BannerPatternShape> STRIPE_DOWNRIGHT = BannerPatternShapes.key(ResourceKey.minecraft("stripe_downright"));

public static final RegistryReference<BannerPatternShape> STRIPE_LEFT = BannerPatternShapes.key(ResourceKey.minecraft("stripe_left"));
public static final DefaultedRegistryReference<BannerPatternShape> STRIPE_LEFT = BannerPatternShapes.key(ResourceKey.minecraft("stripe_left"));

public static final RegistryReference<BannerPatternShape> STRIPE_MIDDLE = BannerPatternShapes.key(ResourceKey.minecraft("stripe_middle"));
public static final DefaultedRegistryReference<BannerPatternShape> STRIPE_MIDDLE = BannerPatternShapes.key(ResourceKey.minecraft("stripe_middle"));

public static final RegistryReference<BannerPatternShape> STRIPE_RIGHT = BannerPatternShapes.key(ResourceKey.minecraft("stripe_right"));
public static final DefaultedRegistryReference<BannerPatternShape> STRIPE_RIGHT = BannerPatternShapes.key(ResourceKey.minecraft("stripe_right"));

public static final RegistryReference<BannerPatternShape> STRIPE_TOP = BannerPatternShapes.key(ResourceKey.minecraft("stripe_top"));
public static final DefaultedRegistryReference<BannerPatternShape> STRIPE_TOP = BannerPatternShapes.key(ResourceKey.minecraft("stripe_top"));

public static final RegistryReference<BannerPatternShape> TRIANGLE_BOTTOM = BannerPatternShapes.key(ResourceKey.minecraft("triangle_bottom"));
public static final DefaultedRegistryReference<BannerPatternShape> TRIANGLE_BOTTOM = BannerPatternShapes.key(ResourceKey.minecraft("triangle_bottom"));

public static final RegistryReference<BannerPatternShape> TRIANGLE_TOP = BannerPatternShapes.key(ResourceKey.minecraft("triangle_top"));
public static final DefaultedRegistryReference<BannerPatternShape> TRIANGLE_TOP = BannerPatternShapes.key(ResourceKey.minecraft("triangle_top"));

public static final RegistryReference<BannerPatternShape> TRIANGLES_BOTTOM = BannerPatternShapes.key(ResourceKey.minecraft("triangles_bottom"));
public static final DefaultedRegistryReference<BannerPatternShape> TRIANGLES_BOTTOM = BannerPatternShapes.key(ResourceKey.minecraft("triangles_bottom"));

public static final RegistryReference<BannerPatternShape> TRIANGLES_TOP = BannerPatternShapes.key(ResourceKey.minecraft("triangles_top"));
public static final DefaultedRegistryReference<BannerPatternShape> TRIANGLES_TOP = BannerPatternShapes.key(ResourceKey.minecraft("triangles_top"));

private BannerPatternShapes() {
}

public static Registry<BannerPatternShape> registry(final ServerWorld world) {
return world.registry(RegistryTypes.BANNER_PATTERN_SHAPE);
public static Registry<BannerPatternShape> registry() {
return Sponge.server().registry(RegistryTypes.BANNER_PATTERN_SHAPE);
}

private static RegistryReference<BannerPatternShape> key(final ResourceKey location) {
return RegistryKey.of(RegistryTypes.BANNER_PATTERN_SHAPE, location).asReference();
private static DefaultedRegistryReference<BannerPatternShape> key(final ResourceKey location) {
return RegistryKey.of(RegistryTypes.BANNER_PATTERN_SHAPE, location).asDefaultedReference(Sponge::server);
}
}

0 comments on commit b41a947

Please sign in to comment.