Skip to content

Commit 3707c6c

Browse files
committed
贴图错误归为
1 parent 850b46f commit 3707c6c

File tree

5 files changed

+80
-5
lines changed

5 files changed

+80
-5
lines changed

processor/src/main/java/org/polaris2023/utils/Codes.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,10 @@ public final class %%classname%% implements DataProvider, IModel<%%classname%%>
224224
MODELS.put(hangingBlockKey, Map.of("textures", Map.of("particle", strippedLog.toString())));
225225
basicItem(() -> block.get().asItem());
226226
basicItem(() -> BuiltInRegistries.BLOCK.get(replace(key, "hanging_sign")).asItem());
227-
BLOCKSTATES.put(key, Map.of("variants", model(blockKey, null, null, null, false)));
228-
BLOCKSTATES.put(hangingKey, Map.of("variants", model(hangingBlockKey, null, null, null, false)));
229-
BLOCKSTATES.put(wallKey, Map.of("variants", model(blockKey, null, null, null, false)));
230-
BLOCKSTATES.put(wallHangingKey, Map.of("variants", model(hangingBlockKey, null, null, null, false)));
227+
BLOCKSTATES.put(key, Map.of("variants", Map.of("", model(blockKey, null, null, null, false))));
228+
BLOCKSTATES.put(hangingKey, Map.of("variants", Map.of("", model(hangingBlockKey, null, null, null, false))));
229+
BLOCKSTATES.put(wallKey, Map.of("variants", Map.of("", model(blockKey, null, null, null, false))));
230+
BLOCKSTATES.put(wallHangingKey, Map.of("variants", Map.of("", model(hangingBlockKey, null, null, null, false))));
231231
return this;
232232
}
233233
@@ -523,7 +523,7 @@ private ResourceLocation replace(ResourceLocation blockKey, String tPath) {
523523
ResourceLocation blockKey = key.withPrefix("block/");
524524
ResourceLocation horizontal = blockKey.withSuffix("_horizontal");
525525
ResourceLocation top = blockKey.withSuffix("_top");
526-
cubeColumn(block, blockKey.toString(), top.toString(), isItem, false, true);
526+
cubeColumn(block, top.toString(), blockKey.toString(), isItem, false, true);
527527
cubeColumn(block, top.toString(), blockKey.toString(), isItem, true, true);
528528
BLOCKSTATES.put(key, Map.of(
529529
"variants", Map.of(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package org.polaris2023.wild_wind.common.init;
2+
3+
import net.minecraft.resources.ResourceLocation;
4+
import net.minecraft.tags.ItemTags;
5+
import net.minecraft.util.FastColor;
6+
import net.minecraft.world.item.DyeColor;
7+
import net.minecraft.world.level.material.MapColor;
8+
9+
/**
10+
* @author : baka4n
11+
* {@code @Date : 2025/03/06 20:51:24}
12+
*/
13+
public enum ModDyeColor {
14+
;
15+
public DyeColor dyeColor;
16+
public int id;
17+
public final int color;
18+
public final MapColor mapColor;
19+
public final String name;
20+
21+
ModDyeColor(String name, int color, MapColor mapColor) {
22+
this.name = name;
23+
this.mapColor = mapColor;
24+
this.color = color;
25+
}
26+
}

src/main/java/org/polaris2023/wild_wind/datagen/ModRecipeProvider.java

+6
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ protected void addShapedRecipe() {
135135
.group("carpet")
136136
.define('S', ModBlocks.WOOL.get());
137137
}));
138+
138139
}
139140

140141
protected static <T extends RecipeBuilder> void unlockedBy(T t, ItemLike... likes) {
@@ -265,6 +266,11 @@ protected void addShapelessRecipe() {
265266
unlockedBy(salt, ModBlocks.SALT_BLOCK_ITEM);
266267
salt.requires(ModBlocks.SALT_BLOCK_ITEM);
267268
}));
269+
add(shapeless(RecipeCategory.MISC, ModBlocks.AZALEA_PLANKS, 1, azalea_planks -> {
270+
unlockedBy(azalea_planks, ModBlocks.AZALEA_WOOD, ModBlocks.AZALEA_LOG, ModBlocks.STRIPPED_AZALEA_WOOD, ModBlocks.STRIPPED_AZALEA_LOG);
271+
azalea_planks.requires(Ingredient.of(ModBlocks.AZALEA_WOOD, ModBlocks.AZALEA_LOG, ModBlocks.STRIPPED_AZALEA_WOOD, ModBlocks.STRIPPED_AZALEA_LOG));
272+
}));
273+
268274
}
269275

270276
public static ShapedRecipeBuilder shaped(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package org.polaris2023.wild_wind.mixin;
2+
3+
import net.minecraft.world.item.DyeColor;
4+
import net.minecraft.world.level.material.MapColor;
5+
import org.polaris2023.wild_wind.common.init.ModDyeColor;
6+
import org.spongepowered.asm.mixin.*;
7+
import org.spongepowered.asm.mixin.gen.Invoker;
8+
9+
import java.util.Arrays;
10+
11+
/**
12+
* @author : baka4n
13+
* {@code @Date : 2025/03/06 21:00:21}
14+
*/
15+
@Mixin(DyeColor.class)
16+
@Debug(export = true)
17+
public class DyeColorMixin {
18+
@Shadow
19+
@Mutable
20+
@Final
21+
private static DyeColor[] $VALUES;
22+
23+
@Invoker("<init>")
24+
private static DyeColor init(
25+
String enumName, int ordinal,int id, String name, int textureDefuseColor, MapColor mapColor, int fireworkColor, int textColor
26+
) {
27+
throw new AssertionError();
28+
}
29+
30+
static {
31+
int size = ModDyeColor.values().length;
32+
int length = $VALUES.length;
33+
$VALUES = Arrays.copyOf($VALUES, length + size);
34+
for (ModDyeColor value : ModDyeColor.values()) {
35+
value.dyeColor = init(value.name(), length, value.color, value.name, value.color, value.mapColor, value.color, value.color);
36+
value.id = length;
37+
$VALUES[length] = value.dyeColor;
38+
length++;
39+
}
40+
}
41+
42+
}

src/main/resources/wild_wind.mixins.json

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"mixins": [
77
"AnimalMixin",
88
"CowMixin",
9+
"DyeColorMixin",
910
"EggMixin",
1011
"GoatMixin",
1112
"HalfTransparentBlockMixin",

0 commit comments

Comments
 (0)