| 1 | package net.minecraft.world.entity.decoration.painting;
|
| 2 |
|
| 3 | import java.util.Optional;
|
| 4 | import net.minecraft.ChatFormatting;
|
| 5 | import net.minecraft.core.registries.Registries;
|
| 6 | import net.minecraft.data.worldgen.BootstrapContext;
|
| 7 | import net.minecraft.network.chat.Component;
|
| 8 | import net.minecraft.resources.Identifier;
|
| 9 | import net.minecraft.resources.ResourceKey;
|
| 10 |
|
| 11 | public class PaintingVariants {
|
| 12 | public static final ResourceKey<PaintingVariant> KEBAB = create("kebab");
|
| 13 | public static final ResourceKey<PaintingVariant> AZTEC = create("aztec");
|
| 14 | public static final ResourceKey<PaintingVariant> ALBAN = create("alban");
|
| 15 | public static final ResourceKey<PaintingVariant> AZTEC2 = create("aztec2");
|
| 16 | public static final ResourceKey<PaintingVariant> BOMB = create("bomb");
|
| 17 | public static final ResourceKey<PaintingVariant> PLANT = create("plant");
|
| 18 | public static final ResourceKey<PaintingVariant> WASTELAND = create("wasteland");
|
| 19 | public static final ResourceKey<PaintingVariant> POOL = create("pool");
|
| 20 | public static final ResourceKey<PaintingVariant> COURBET = create("courbet");
|
| 21 | public static final ResourceKey<PaintingVariant> SEA = create("sea");
|
| 22 | public static final ResourceKey<PaintingVariant> SUNSET = create("sunset");
|
| 23 | public static final ResourceKey<PaintingVariant> CREEBET = create("creebet");
|
| 24 | public static final ResourceKey<PaintingVariant> WANDERER = create("wanderer");
|
| 25 | public static final ResourceKey<PaintingVariant> GRAHAM = create("graham");
|
| 26 | public static final ResourceKey<PaintingVariant> MATCH = create("match");
|
| 27 | public static final ResourceKey<PaintingVariant> BUST = create("bust");
|
| 28 | public static final ResourceKey<PaintingVariant> STAGE = create("stage");
|
| 29 | public static final ResourceKey<PaintingVariant> VOID = create("void");
|
| 30 | public static final ResourceKey<PaintingVariant> SKULL_AND_ROSES = create("skull_and_roses");
|
| 31 | public static final ResourceKey<PaintingVariant> WITHER = create("wither");
|
| 32 | public static final ResourceKey<PaintingVariant> FIGHTERS = create("fighters");
|
| 33 | public static final ResourceKey<PaintingVariant> POINTER = create("pointer");
|
| 34 | public static final ResourceKey<PaintingVariant> PIGSCENE = create("pigscene");
|
| 35 | public static final ResourceKey<PaintingVariant> BURNING_SKULL = create("burning_skull");
|
| 36 | public static final ResourceKey<PaintingVariant> SKELETON = create("skeleton");
|
| 37 | public static final ResourceKey<PaintingVariant> DONKEY_KONG = create("donkey_kong");
|
| 38 | public static final ResourceKey<PaintingVariant> EARTH = create("earth");
|
| 39 | public static final ResourceKey<PaintingVariant> WIND = create("wind");
|
| 40 | public static final ResourceKey<PaintingVariant> WATER = create("water");
|
| 41 | public static final ResourceKey<PaintingVariant> FIRE = create("fire");
|
| 42 | public static final ResourceKey<PaintingVariant> BAROQUE = create("baroque");
|
| 43 | public static final ResourceKey<PaintingVariant> HUMBLE = create("humble");
|
| 44 | public static final ResourceKey<PaintingVariant> MEDITATIVE = create("meditative");
|
| 45 | public static final ResourceKey<PaintingVariant> PRAIRIE_RIDE = create("prairie_ride");
|
| 46 | public static final ResourceKey<PaintingVariant> UNPACKED = create("unpacked");
|
| 47 | public static final ResourceKey<PaintingVariant> BACKYARD = create("backyard");
|
| 48 | public static final ResourceKey<PaintingVariant> BOUQUET = create("bouquet");
|
| 49 | public static final ResourceKey<PaintingVariant> CAVEBIRD = create("cavebird");
|
| 50 | public static final ResourceKey<PaintingVariant> CHANGING = create("changing");
|
| 51 | public static final ResourceKey<PaintingVariant> COTAN = create("cotan");
|
| 52 | public static final ResourceKey<PaintingVariant> ENDBOSS = create("endboss");
|
| 53 | public static final ResourceKey<PaintingVariant> FERN = create("fern");
|
| 54 | public static final ResourceKey<PaintingVariant> FINDING = create("finding");
|
| 55 | public static final ResourceKey<PaintingVariant> LOWMIST = create("lowmist");
|
| 56 | public static final ResourceKey<PaintingVariant> ORB = create("orb");
|
| 57 | public static final ResourceKey<PaintingVariant> OWLEMONS = create("owlemons");
|
| 58 | public static final ResourceKey<PaintingVariant> PASSAGE = create("passage");
|
| 59 | public static final ResourceKey<PaintingVariant> POND = create("pond");
|
| 60 | public static final ResourceKey<PaintingVariant> SUNFLOWERS = create("sunflowers");
|
| 61 | public static final ResourceKey<PaintingVariant> TIDES = create("tides");
|
| 62 | public static final ResourceKey<PaintingVariant> DENNIS = create("dennis");
|
| 63 |
|
| 64 | public static void bootstrap(final BootstrapContext<PaintingVariant> context) {
|
| 65 | register(context, KEBAB, 1, 1);
|
| 66 | register(context, AZTEC, 1, 1);
|
| 67 | register(context, ALBAN, 1, 1);
|
| 68 | register(context, AZTEC2, 1, 1);
|
| 69 | register(context, BOMB, 1, 1);
|
| 70 | register(context, PLANT, 1, 1);
|
| 71 | register(context, WASTELAND, 1, 1);
|
| 72 | register(context, POOL, 2, 1);
|
| 73 | register(context, COURBET, 2, 1);
|
| 74 | register(context, SEA, 2, 1);
|
| 75 | register(context, SUNSET, 2, 1);
|
| 76 | register(context, CREEBET, 2, 1);
|
| 77 | register(context, WANDERER, 1, 2);
|
| 78 | register(context, GRAHAM, 1, 2);
|
| 79 | register(context, MATCH, 2, 2);
|
| 80 | register(context, BUST, 2, 2);
|
| 81 | register(context, STAGE, 2, 2);
|
| 82 | register(context, VOID, 2, 2);
|
| 83 | register(context, SKULL_AND_ROSES, 2, 2);
|
| 84 | register(context, WITHER, 2, 2, false);
|
| 85 | register(context, FIGHTERS, 4, 2);
|
| 86 | register(context, POINTER, 4, 4);
|
| 87 | register(context, PIGSCENE, 4, 4);
|
| 88 | register(context, BURNING_SKULL, 4, 4);
|
| 89 | register(context, SKELETON, 4, 3);
|
| 90 | register(context, EARTH, 2, 2, false);
|
| 91 | register(context, WIND, 2, 2, false);
|
| 92 | register(context, WATER, 2, 2, false);
|
| 93 | register(context, FIRE, 2, 2, false);
|
| 94 | register(context, DONKEY_KONG, 4, 3);
|
| 95 | register(context, BAROQUE, 2, 2);
|
| 96 | register(context, HUMBLE, 2, 2);
|
| 97 | register(context, MEDITATIVE, 1, 1);
|
| 98 | register(context, PRAIRIE_RIDE, 1, 2);
|
| 99 | register(context, UNPACKED, 4, 4);
|
| 100 | register(context, BACKYARD, 3, 4);
|
| 101 | register(context, BOUQUET, 3, 3);
|
| 102 | register(context, CAVEBIRD, 3, 3);
|
| 103 | register(context, CHANGING, 4, 2);
|
| 104 | register(context, COTAN, 3, 3);
|
| 105 | register(context, ENDBOSS, 3, 3);
|
| 106 | register(context, FERN, 3, 3);
|
| 107 | register(context, FINDING, 4, 2);
|
| 108 | register(context, LOWMIST, 4, 2);
|
| 109 | register(context, ORB, 4, 4);
|
| 110 | register(context, OWLEMONS, 3, 3);
|
| 111 | register(context, PASSAGE, 4, 2);
|
| 112 | register(context, POND, 3, 4);
|
| 113 | register(context, SUNFLOWERS, 3, 3);
|
| 114 | register(context, TIDES, 3, 3);
|
| 115 | register(context, DENNIS, 3, 3);
|
| 116 | }
|
| 117 |
|
| 118 | private static void register(final BootstrapContext<PaintingVariant> context, final ResourceKey<PaintingVariant> id, final int width, final int height) {
|
| 119 | register(context, id, width, height, true);
|
| 120 | }
|
| 121 |
|
| 122 | private static void register(
|
| 123 | final BootstrapContext<PaintingVariant> context, final ResourceKey<PaintingVariant> id, final int width, final int height, final boolean hasAuthor
|
| 124 | ) {
|
| 125 | context.register(
|
| 126 | id,
|
| 127 | new PaintingVariant(
|
| 128 | width,
|
| 129 | height,
|
| 130 | id.identifier(),
|
| 131 | Optional.of(Component.translatable(id.identifier().toLanguageKey("painting", "title")).withStyle(ChatFormatting.YELLOW)),
|
| 132 | hasAuthor ? Optional.of(Component.translatable(id.identifier().toLanguageKey("painting", "author")).withStyle(ChatFormatting.GRAY)) : Optional.empty()
|
| 133 | )
|
| 134 | );
|
| 135 | }
|
| 136 |
|
| 137 | private static ResourceKey<PaintingVariant> create(final String name) {
|
| 138 | return ResourceKey.create(Registries.PAINTING_VARIANT, Identifier.withDefaultNamespace(name));
|
| 139 | }
|
| 140 | }
|
| 141 |
|