Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

完善配方 #550

Merged
merged 1 commit into from Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/main/java/cn/nukkit/item/MinecraftItemID.java
Expand Up @@ -33,6 +33,7 @@

/**
* An enum containing all valid vanilla Minecraft items.
* 添加原版新物品时一定不要忘记在这里补上命名空间的枚举(例如 minecraft:quartz_bricks 这里填写QUARTZ_BRICKS)
*
* @author joserobjr
* @since 2020-12-20
Expand Down Expand Up @@ -1085,7 +1086,20 @@ public enum MinecraftItemID {
@PowerNukkitOnly @Since("FUTURE") AMETHYST_SHARD,
@PowerNukkitOnly @Since("FUTURE") SPYGLASS,
@PowerNukkitOnly @Since("FUTURE") GLOW_BERRIES,

@PowerNukkitXOnly @Since("1.19.20-r4") MANGROVE_STAIRS,
@PowerNukkitXOnly @Since("1.19.20-r4") MANGROVE_TRAPDOOR,
@PowerNukkitXOnly @Since("1.19.20-r4") MANGROVE_ROOTS,
@PowerNukkitXOnly @Since("1.19.20-r4") MUDDY_MANGROVE_ROOTS,
@PowerNukkitXOnly @Since("1.19.20-r4") MANGROVE_SLAB,
@PowerNukkitXOnly @Since("1.19.20-r4") MANGROVE_BUTTON,
@PowerNukkitXOnly @Since("1.19.20-r4") MANGROVE_LOG,
@PowerNukkitXOnly @Since("1.19.20-r4") MANGROVE_FENCE,
@PowerNukkitXOnly @Since("1.19.20-r4") MANGROVE_FENCE_GATE,
@PowerNukkitXOnly @Since("1.19.20-r4") STRIPPED_MANGROVE_LOG,
@PowerNukkitXOnly @Since("1.19.20-r4") STRIPPED_MANGROVE_WOOD,
@PowerNukkitXOnly @Since("1.19.20-r4") MANGROVE_PLANKS,
@PowerNukkitXOnly @Since("1.19.20-r4") MANGROVE_WOOD,
@PowerNukkitXOnly @Since("1.19.20-r4") MANGROVE_PRESSURE_PLATE,
@PowerNukkitXOnly @Since("1.6.0.0-PNX") MANGROVE_BOAT,
@PowerNukkitXOnly @Since("1.6.0.0-PNX") MANGROVE_DOOR,
@PowerNukkitXOnly @Since("1.6.0.0-PNX") MANGROVE_SIGN,
Expand Down
63 changes: 39 additions & 24 deletions src/main/resources/recipes.json
Expand Up @@ -14427,6 +14427,7 @@
},
"output": [
{
"damage": 1,
"legacyId": 155,
"id": "minecraft:quartz_block"
}
Expand All @@ -14450,6 +14451,7 @@
},
"output": [
{
"damage": 3,
"legacyId": 98,
"id": "minecraft:stonebrick"
}
Expand Down Expand Up @@ -14900,9 +14902,10 @@
},
"output": [
{
"damage": 4,
"count": 3,
"legacyId": -212,
"id": "minecraft:wood",
"count": 3
"id": "minecraft:wood"
}
],
"shape": [
Expand All @@ -14924,9 +14927,10 @@
},
"output": [
{
"damage": 12,
"count": 3,
"legacyId": -212,
"id": "minecraft:wood",
"count": 3
"id": "minecraft:wood"
}
],
"shape": [
Expand Down Expand Up @@ -15935,9 +15939,10 @@
},
"output": [
{
"damage": 2,
"count": 3,
"legacyId": -212,
"id": "minecraft:wood",
"count": 3
"id": "minecraft:wood"
}
],
"shape": [
Expand All @@ -15959,9 +15964,10 @@
},
"output": [
{
"damage": 10,
"count": 3,
"legacyId": -212,
"id": "minecraft:wood",
"count": 3
"id": "minecraft:wood"
}
],
"shape": [
Expand Down Expand Up @@ -21462,9 +21468,10 @@
},
"output": [
{
"damage": 5,
"count": 3,
"legacyId": -212,
"id": "minecraft:wood",
"count": 3
"id": "minecraft:wood"
}
],
"shape": [
Expand All @@ -21486,9 +21493,10 @@
},
"output": [
{
"damage": 13,
"count": 3,
"legacyId": -212,
"id": "minecraft:wood",
"count": 3
"id": "minecraft:wood"
}
],
"shape": [
Expand Down Expand Up @@ -25787,9 +25795,10 @@
},
"output": [
{
"damage": 3,
"count": 3,
"legacyId": -212,
"id": "minecraft:wood",
"count": 3
"id": "minecraft:wood"
}
],
"shape": [
Expand All @@ -25811,9 +25820,10 @@
},
"output": [
{
"damage": 11,
"count": 3,
"legacyId": -212,
"id": "minecraft:wood",
"count": 3
"id": "minecraft:wood"
}
],
"shape": [
Expand Down Expand Up @@ -29574,9 +29584,10 @@
},
"output": [
{
"damage": 8,
"count": 3,
"legacyId": -212,
"id": "minecraft:wood",
"count": 3
"id": "minecraft:wood"
}
],
"shape": [
Expand Down Expand Up @@ -30041,9 +30052,10 @@
},
"output": [
{
"damage": 2,
"count": 2,
"legacyId": 155,
"id": "minecraft:quartz_block",
"count": 2
"id": "minecraft:quartz_block"
}
],
"shape": [
Expand Down Expand Up @@ -35483,9 +35495,10 @@
},
"output": [
{
"damage": 1,
"count": 3,
"legacyId": -212,
"id": "minecraft:wood",
"count": 3
"id": "minecraft:wood"
}
],
"shape": [
Expand All @@ -35507,9 +35520,10 @@
},
"output": [
{
"damage": 9,
"count": 3,
"legacyId": -212,
"id": "minecraft:wood",
"count": 3
"id": "minecraft:wood"
}
],
"shape": [
Expand Down Expand Up @@ -58563,6 +58577,7 @@
"id": "minecraft:quartz_block"
},
"output": {
"damage": 3,
"legacyId": 155,
"id": "minecraft:quartz_block"
},
Expand Down
12 changes: 8 additions & 4 deletions src/main/resources/runtime_item_ids.json
Expand Up @@ -34,11 +34,13 @@
},
{
"name": "minecraft:mangrove_fence_gate",
"id": -492
"id": -492,
"oldId": -492
},
{
"name": "minecraft:mangrove_fence",
"id": -491
"id": -491,
"oldId": -491
},
{
"name": "minecraft:mangrove_pressure_plate",
Expand All @@ -52,11 +54,13 @@
},
{
"name": "minecraft:mangrove_stairs",
"id": -488
"id": -488,
"oldId": -488
},
{
"name": "minecraft:mangrove_button",
"id": -487
"id": -487,
"oldId": -487
},
{
"name": "minecraft:mangrove_planks",
Expand Down
29 changes: 27 additions & 2 deletions src/test/java/cn/powernukkitx/tools/ModifyRecipes.java
Expand Up @@ -18,6 +18,17 @@ public static void main(String[] args) {
public static void modifyRecipes() {
HashMap<String, Integer> modify = new HashMap<>();
//fix recipes for a variety of logs and wood
modify.put("minecraft:oak_wood_stripped", 8);
modify.put("minecraft:spruce_wood", 1);
modify.put("minecraft:spruce_wood_stripped", 9);
modify.put("minecraft:acacia_wood", 4);
modify.put("minecraft:acacia_wood_stripped", 12);
modify.put("minecraft:birch_wood", 2);
modify.put("minecraft:birch_wood_stripped", 10);
modify.put("minecraft:dark_oak_wood", 5);
modify.put("minecraft:dark_oak_wood_stripped", 13);
modify.put("minecraft:jungle_wood", 3);
modify.put("minecraft:jungle_wood_stripped", 11);
modify.put("minecraft:spruce_planks", 1);
modify.put("minecraft:spruce_wooden_slab", 1);
modify.put("minecraft:spruce_planks_from_wood", 1);
Expand Down Expand Up @@ -127,8 +138,11 @@ public static void modifyRecipes() {
modify.put("minecraft:stonecutter_double_stone_slab", 2);
modify.put("stoneslab4_cut_sandstone_cut_recipeId", 3);
modify.put("stoneslab4_cut_redsandstone_cut_recipeId", 4);


//fix recipes for stone_block_slab to Chiseled Quartz Block
modify.put("chiseled_quartz_recipeId", 1);
modify.put("chiseled_stonebrick_recipeId", 3);
//fix recipes for pillar_quartz_block
modify.put("minecraft:pillar_quartz_block", 2);
Config config = new Config(Config.JSON);
try (InputStream recipesStream = new FileInputStream("src/main/resources/recipes.json")) {
if (recipesStream == null) {
Expand Down Expand Up @@ -181,6 +195,7 @@ public static void modifyRecipes() {
}
}
}
//修复玻璃 玻璃板 地毯 粘土
var input2 = castMap(map.get("input"), String.class, Object.class);
if (input2 != null) {
if (input2.keySet().size() == 2 && input2.containsKey("A") && input2.containsKey("B")) {
Expand All @@ -203,6 +218,16 @@ public static void modifyRecipes() {
}
}
}
var block = map.get("block");
if (block != null) {
if (block.equals("furnace") && input2.get("id").equals("minecraft:quartz_block")) {
var output = castMap(map.get("output"), String.class, Object.class);
if (output != null) {
output.put("damage", 3);
map.put("output", output);
}
}
}
for (var id : modify.keySet()) {
if (map.get("id") != null && map.get("id").equals(id)) {
var output = castList(map.get("output"), Object.class);
Expand Down