-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
170 additions
and
26 deletions.
There are no files selected for viewing
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
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
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
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
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
41 changes: 41 additions & 0 deletions
41
common/src/main/java/dev/dubhe/chinesefestivals/features/impl/QingTuan.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,41 @@ | ||
package dev.dubhe.chinesefestivals.features.impl; | ||
|
||
import dev.dubhe.chinesefestivals.features.Feature; | ||
import dev.dubhe.chinesefestivals.features.IFeature; | ||
import dev.dubhe.chinesefestivals.festivals.Festivals; | ||
import dev.dubhe.chinesefestivals.festivals.IFestival; | ||
import net.minecraft.world.food.Foods; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.item.Items; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.concurrent.ConcurrentHashMap; | ||
import java.util.function.Supplier; | ||
|
||
public class QingTuan extends Feature { | ||
public static final Supplier<Item> QING_TUAN = IFeature.createItem("qing_tuan", new Item.Properties().food(Foods.BAKED_POTATO), Item::new); | ||
|
||
public QingTuan(String id, IFestival @NotNull ... enableTimes) { | ||
super(id, Festivals.QING_MING); | ||
if (enableTimes.length > 0) { | ||
super.enableTimes.clear(); | ||
super.enableTimes.addAll(List.of(enableTimes)); | ||
} | ||
} | ||
|
||
@Override | ||
public Map<Item, Supplier<Item>> getItemReplace() { | ||
Map<Item, Supplier<Item>> map = new ConcurrentHashMap<>(); | ||
map.put(Items.BAKED_POTATO, QING_TUAN); | ||
return map; | ||
} | ||
|
||
@Override | ||
public Map<String, Supplier<String>> getTranslationReplace() { | ||
Map<String, Supplier<String>> map = new ConcurrentHashMap<>(); | ||
map.put("item.minecraft.baked_potato", () -> "item.chinesefestivals.qing_tuan"); | ||
return map; | ||
} | ||
} |
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
40 changes: 40 additions & 0 deletions
40
common/src/main/java/dev/dubhe/chinesefestivals/features/impl/ThreeDFood.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,40 @@ | ||
package dev.dubhe.chinesefestivals.features.impl; | ||
|
||
import dev.dubhe.chinesefestivals.ChineseFestivals; | ||
import dev.dubhe.chinesefestivals.features.Feature; | ||
import dev.dubhe.chinesefestivals.features.IFeature; | ||
import dev.dubhe.chinesefestivals.festivals.Festivals; | ||
import dev.dubhe.chinesefestivals.festivals.IFestival; | ||
import net.minecraft.core.registries.Registries; | ||
import net.minecraft.tags.TagKey; | ||
import net.minecraft.world.food.Foods; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraft.world.item.Items; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.concurrent.ConcurrentHashMap; | ||
import java.util.function.Supplier; | ||
|
||
public class ThreeDFood extends Feature { | ||
public static final TagKey<Item> HAS_PLATE = TagKey.create(Registries.ITEM, ChineseFestivals.of("has_plate")); | ||
public static final Supplier<Item> APPLE_3D = IFeature.createItem("apple_3d", new Item.Properties().food(Foods.APPLE), Item::new); | ||
public static final Supplier<Item> COOKIE_3D = IFeature.createItem("cookie_3d", new Item.Properties().food(Foods.COOKIE), Item::new); | ||
|
||
public ThreeDFood(String id, IFestival @NotNull ... enableTimes) { | ||
super(id, Festivals.QING_MING, Festivals.CHINESE_SPRING_FESTIVAL); | ||
if (enableTimes.length > 0) { | ||
super.enableTimes.clear(); | ||
super.enableTimes.addAll(List.of(enableTimes)); | ||
} | ||
} | ||
|
||
@Override | ||
public Map<Item, Supplier<Item>> get3DFoodReplace() { | ||
Map<Item, Supplier<Item>> map = new ConcurrentHashMap<>(); | ||
map.put(Items.APPLE, APPLE_3D); | ||
map.put(Items.COOKIE, COOKIE_3D); | ||
return map; | ||
} | ||
} |
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
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
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
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
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
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
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
2 changes: 1 addition & 1 deletion
2
...inesefestivals/models/item/dumplings.json → ...chinesefestivals/models/item/jiao_zi.json
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"parent": "minecraft:item/generated", | ||
"textures": { | ||
"layer0": "chinesefestivals:item/dumplings" | ||
"layer0": "chinesefestivals:item/jiao_zi" | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...estivals/models/item/sweet_dumplings.json → ...inesefestivals/models/item/qing_tuan.json
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"parent": "minecraft:item/generated", | ||
"textures": { | ||
"layer0": "chinesefestivals:item/sweet_dumplings" | ||
"layer0": "chinesefestivals:item/qing_tuan" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
common/src/main/resources/assets/chinesefestivals/models/item/tang_yuan.json
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,6 @@ | ||
{ | ||
"parent": "minecraft:item/generated", | ||
"textures": { | ||
"layer0": "chinesefestivals:item/tang_yuan" | ||
} | ||
} |
Binary file removed
BIN
-270 Bytes
common/src/main/resources/assets/chinesefestivals/textures/item/dumplings.png
Binary file not shown.
Binary file removed
BIN
-244 Bytes
...on/src/main/resources/assets/chinesefestivals/textures/item/sweet_dumplings.png
Binary file not shown.
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