Skip to content

Commit

Permalink
完成 1.20 的更新
Browse files Browse the repository at this point in the history
  • Loading branch information
TartaricAcid committed Nov 12, 2024
1 parent b219340 commit ff1d79c
Show file tree
Hide file tree
Showing 20 changed files with 160 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"touhou_little_maid:fairy"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"touhou_little_maid:danmaku"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"touhou_little_maid:fairy"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static void maidMove(ServerPlayer player, Level level, BlockPos pos, int
&& sit.getFirstPassenger() instanceof EntityMaid maid && maid.isOwnedBy(player)) {
// TODO: 暂时不加段位系统
maid.getFavorabilityManager().apply(Type.CCHESS_WIN);
maid.getGameRecordManager().markStatue(true);
maid.getGameRecordManager().markStatue(false);
InitTrigger.MAID_EVENT.trigger(player, TriggerType.WIN_CCHESS);
}

Expand Down Expand Up @@ -126,7 +126,7 @@ public static void maidMove(ServerPlayer player, Level level, BlockPos pos, int
if (level instanceof ServerLevel serverLevel && serverLevel.getEntity(sitId) instanceof EntitySit sit && sit.getFirstPassenger() instanceof EntityMaid maid) {
maid.swing(InteractionHand.MAIN_HAND);
if (playerLost) {
maid.getGameRecordManager().markStatue(false);
maid.getGameRecordManager().markStatue(true);
}
}
level.playSound(null, pos, InitSounds.GOMOKU.get(), SoundSource.BLOCKS, 1.0f, 0.8F + level.random.nextFloat() * 0.4F);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public InteractionResult use(BlockState state, Level level, BlockPos pos, Player
// 但是和其他人的女仆对弈不加好感哦
if (statue == Statue.WIN && maid.isOwnedBy(player)) {
maid.getFavorabilityManager().apply(Type.GOMOKU_WIN);
maid.getGameRecordManager().markStatue(true);
maid.getGameRecordManager().markStatue(false);
int rankBefore = MaidGomokuAI.getRank(maid);
maid.getGameRecordManager().increaseGomokuWinCount();
int rankAfter = MaidGomokuAI.getRank(maid);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static void maidMove(ServerPlayer player, Level level, BlockPos pos, int
&& sit.getFirstPassenger() instanceof EntityMaid maid && maid.isOwnedBy(player)) {
// TODO: 暂时不加段位系统
maid.getFavorabilityManager().apply(Type.WCHESS_WIN);
maid.getGameRecordManager().markStatue(true);
maid.getGameRecordManager().markStatue(false);
InitTrigger.MAID_EVENT.trigger(player, TriggerType.WIN_WCHESS);
}

Expand Down Expand Up @@ -129,7 +129,7 @@ public static void maidMove(ServerPlayer player, Level level, BlockPos pos, int
if (level instanceof ServerLevel serverLevel && serverLevel.getEntity(sitId) instanceof EntitySit sit && sit.getFirstPassenger() instanceof EntityMaid maid) {
maid.swing(InteractionHand.MAIN_HAND);
if (playerLost) {
maid.getGameRecordManager().markStatue(false);
maid.getGameRecordManager().markStatue(true);
}
}
level.playSound(null, pos, InitSounds.GOMOKU.get(), SoundSource.BLOCKS, 1.0f, 0.8F + level.random.nextFloat() * 0.4F);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@
import com.github.tartaricacid.touhoulittlemaid.compat.tacz.utils.GunBehaviorUtils;
import com.github.tartaricacid.touhoulittlemaid.config.subconfig.MaidConfig;
import com.github.tartaricacid.touhoulittlemaid.entity.passive.EntityMaid;
import com.github.tartaricacid.touhoulittlemaid.init.InitItems;
import com.github.tartaricacid.touhoulittlemaid.init.InitSounds;
import com.github.tartaricacid.touhoulittlemaid.util.SoundUtil;
import com.google.common.collect.Lists;
import com.mojang.datafixers.util.Pair;
import com.tacz.guns.GunMod;
import com.tacz.guns.api.TimelessAPI;
import com.tacz.guns.api.item.IGun;
import com.tacz.guns.api.item.builder.GunItemBuilder;
import net.minecraft.resources.ResourceLocation;
Expand All @@ -31,6 +33,7 @@

public class TaskGunAttack implements IAttackTask {
public static final ResourceLocation UID = new ResourceLocation(TouhouLittleMaid.MOD_ID, "gun_attack");
private ItemStack icon;

@Override
public ResourceLocation getUid() {
Expand All @@ -39,7 +42,12 @@ public ResourceLocation getUid() {

@Override
public ItemStack getIcon() {
return GunItemBuilder.create().setId(new ResourceLocation(GunMod.MOD_ID, "glock_17")).build();
ResourceLocation gunId = new ResourceLocation(GunMod.MOD_ID, "glock_17");
if (icon == null) {
TimelessAPI.getCommonGunIndex(gunId).ifPresentOrElse(index -> this.icon = GunItemBuilder.create().setId(gunId).build(),
() -> this.icon = InitItems.TACZ_GUN_ICON.get().getDefaultInstance());
}
return this.icon;
}

@Nullable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.github.tartaricacid.touhoulittlemaid.datagen;

import com.github.tartaricacid.touhoulittlemaid.TouhouLittleMaid;
import com.github.tartaricacid.touhoulittlemaid.datagen.tag.EntityTypeGenerator;
import net.minecraft.data.DataGenerator;
import net.minecraftforge.common.data.ExistingFileHelper;
import net.minecraftforge.eventbus.api.SubscribeEvent;
Expand All @@ -19,5 +20,8 @@ public static void gatherData(GatherDataEvent event) {

// Loot Tables
generator.addProvider(new LootTableGenerator.AdvancementLootTables(generator));

// Tags
generator.addProvider(new EntityTypeGenerator(generator, event.getExistingFileHelper()));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.github.tartaricacid.touhoulittlemaid.datagen.tag;

import com.github.tartaricacid.touhoulittlemaid.TouhouLittleMaid;
import com.github.tartaricacid.touhoulittlemaid.init.InitEntities;
import net.minecraft.data.DataGenerator;
import net.minecraft.data.tags.EntityTypeTagsProvider;
import net.minecraft.tags.EntityTypeTags;
import net.minecraftforge.common.data.ExistingFileHelper;

public class EntityTypeGenerator extends EntityTypeTagsProvider {
public EntityTypeGenerator(DataGenerator generator, ExistingFileHelper existingFileHelper) {
super(generator, TouhouLittleMaid.MOD_ID, existingFileHelper);
}

@Override
public void addTags() {
tag(EntityTypeTags.IMPACT_PROJECTILES).add(InitEntities.DANMAKU.get());
tag(EntityTypeTags.POWDER_SNOW_WALKABLE_MOBS).add(InitEntities.FAIRY.get());
tag(EntityTypeTags.FREEZE_IMMUNE_ENTITY_TYPES).add(InitEntities.FAIRY.get());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,5 @@ public final class InitItems {
public static RegistryObject<Item> ALL_NETHERITE_EQUIPMENT = ITEMS.register("all_netherite_equipment", ItemAdvancementIcon::new);
public static RegistryObject<Item> KILL_WITHER = ITEMS.register("kill_wither", ItemAdvancementIcon::new);
public static RegistryObject<Item> KILL_DRAGON = ITEMS.register("kill_dragon", ItemAdvancementIcon::new);
public static RegistryObject<Item> TACZ_GUN_ICON = ITEMS.register("tacz_gun_icon", ItemAdvancementIcon::new);
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public static void handle(GomokuToServerMessage message, Supplier<NetworkEvent.C
if (level instanceof ServerLevel serverLevel && serverLevel.getEntity(gomoku.getSitId()) instanceof EntitySit sit && sit.getFirstPassenger() instanceof EntityMaid maid) {
maid.swing(InteractionHand.MAIN_HAND);
if (!gomoku.isInProgress()) {
maid.getGameRecordManager().markStatue(false);
maid.getGameRecordManager().markStatue(true);
}
}
level.playSound(null, message.pos, InitSounds.GOMOKU.get(), SoundSource.BLOCKS, 1.0f, 0.8F + level.random.nextFloat() * 0.4F);
Expand Down
6 changes: 4 additions & 2 deletions src/main/resources/assets/touhou_little_maid/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,8 @@
"button.touhou_little_maid.maid.ai.tamed": "Tamed",
"button.touhou_little_maid.maid.ai.item_get": "Get Item",
"button.touhou_little_maid.maid.ai.death": "Death",
"button.touhou_little_maid.maid.ai.game_win": "Maid Win",
"button.touhou_little_maid.maid.ai.game_lost": "Maid Lost",
"button.touhou_little_maid.maid.environment.hot": "Feel Hot",
"button.touhou_little_maid.maid.environment.cold": "Feel Cold",
"button.touhou_little_maid.maid.environment.rain": "Rain",
Expand Down Expand Up @@ -678,8 +680,8 @@
"subtitle.touhou_little_maid.maid.ai.tamed": "Maid Tamed Sound",
"subtitle.touhou_little_maid.maid.ai.item_get": "Maid Get Item Sound",
"subtitle.touhou_little_maid.maid.ai.death": "Maid Death Sound",
"subtitle.touhou_little_maid.maid.ai.game_win": "Game Win Sound",
"subtitle.touhou_little_maid.maid.ai.game_lost": "Game Lost Sound",
"subtitle.touhou_little_maid.maid.ai.game_win": "Maid Win Sound",
"subtitle.touhou_little_maid.maid.ai.game_lost": "Maid Lost Sound",
"subtitle.touhou_little_maid.maid.environment.hot": "Maid Feel Hot Sound",
"subtitle.touhou_little_maid.maid.environment.cold": "Maid Feel Cold Sound",
"subtitle.touhou_little_maid.maid.environment.rain": "Maid Rain Sound",
Expand Down
6 changes: 4 additions & 2 deletions src/main/resources/assets/touhou_little_maid/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,8 @@
"button.touhou_little_maid.maid.ai.tamed": "被驯服",
"button.touhou_little_maid.maid.ai.item_get": "拾起物件",
"button.touhou_little_maid.maid.ai.death": "死亡",
"button.touhou_little_maid.maid.ai.game_win": "女仆获胜",
"button.touhou_little_maid.maid.ai.game_lost": "女仆失败",
"button.touhou_little_maid.maid.environment.hot": "",
"button.touhou_little_maid.maid.environment.cold": "",
"button.touhou_little_maid.maid.environment.rain": "下雨",
Expand Down Expand Up @@ -678,8 +680,8 @@
"subtitle.touhou_little_maid.maid.ai.tamed": "女仆:被驯服",
"subtitle.touhou_little_maid.maid.ai.item_get": "女仆:拾起物件",
"subtitle.touhou_little_maid.maid.ai.death": "女仆:死亡",
"subtitle.touhou_little_maid.maid.ai.game_win": "赢棋",
"subtitle.touhou_little_maid.maid.ai.game_lost": "输棋",
"subtitle.touhou_little_maid.maid.ai.game_win": "女仆:获胜",
"subtitle.touhou_little_maid.maid.ai.game_lost": "女仆:失败",
"subtitle.touhou_little_maid.maid.environment.hot": "女仆:热",
"subtitle.touhou_little_maid.maid.environment.cold": "女仆:冷",
"subtitle.touhou_little_maid.maid.environment.rain": "女仆:下雨",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "item/generated",
"textures": {
"layer0": "touhou_little_maid:item/tacz_gun_icon"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"replace": false,
"values": [
"touhou_little_maid:servant_bell",
"touhou_little_maid:trumpet"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"type": "touhou_little_maid:altar_crafting",
"output": {
"type": "minecraft:item",
"nbt": {
"Item": {
"id": "touhou_little_maid:cchess",
"Count": 1
}
}
},
"power": 0.1,
"ingredients": [
{
"tag": "minecraft:planks"
},
{
"tag": "minecraft:planks"
},
{
"tag": "minecraft:planks"
},
{
"tag": "forge:dyes/black"
},
{
"tag": "forge:dyes/red"
},
{
"tag": "forge:gems/diamond"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"type": "touhou_little_maid:altar_crafting",
"output": {
"type": "minecraft:item",
"nbt": {
"Item": {
"id": "touhou_little_maid:wchess",
"Count": 1
}
}
},
"power": 0.1,
"ingredients": [
{
"tag": "minecraft:planks"
},
{
"tag": "minecraft:planks"
},
{
"tag": "minecraft:planks"
},
{
"tag": "forge:dyes/black"
},
{
"tag": "forge:dyes/white"
},
{
"tag": "forge:gems/emerald"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"item": "minecraft:leather"
},
{
"item": "minecraft:paper"
}
],
"result": {
"item": "touhou_little_maid:entity_id_copy"
}
}

0 comments on commit ff1d79c

Please sign in to comment.