Skip to content

Commit

Permalink
完成 1.18.2 的同步更新
Browse files Browse the repository at this point in the history
  • Loading branch information
TartaricAcid committed Apr 7, 2024
1 parent c314e31 commit 7023162
Show file tree
Hide file tree
Showing 241 changed files with 11,759 additions and 2,332 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ test

# Files from Forge MDK
forge*changelog.txt

# vscode
.vscode
18 changes: 11 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -131,29 +131,33 @@ dependencies {
compileOnly fg.deobf("vazkii.patchouli:Patchouli:${patchouli_version}")
runtimeOnly fg.deobf("vazkii.patchouli:Patchouli:${patchouli_version}")

implementation fg.deobf("teamtwilight:twilightforest:${twilight_forest_version}:universal")
runtimeOnly fg.deobf("teamtwilight:twilightforest:${twilight_forest_version}:universal")

implementation fg.deobf("curse.maven:jade-324717:${jade_id}")
implementation fg.deobf("curse.maven:the-one-probe-245211:${top_id}")

implementation fg.deobf("me.shedaniel.cloth:cloth-config-forge:${cloth_config_forge}")

implementation fg.deobf("curse.maven:citadel-331936:${citadel_id}")
runtimeOnly fg.deobf("curse.maven:citadel-331936:${citadel_id}")
implementation fg.deobf("curse.maven:domestication-innovation-591149:${domestication_innovation_id}")

implementation fg.deobf("curse.maven:slashblade-241596:${slashblade_id}")

implementation fg.deobf("curse.maven:iron-chests-228756:${iron_chests_id}")

implementation fg.deobf("curse.maven:carry-on-274259:${carry_on_id}")
runtimeOnly fg.deobf("curse.maven:carry-on-274259:${carry_on_id}")

implementation "curse.maven:kotlin-for-forge-351264:${kotlin_id}"
implementation fg.deobf("curse.maven:libipn-679177:${libipn_id}")
runtimeOnly "curse.maven:kotlin-for-forge-351264:${kotlin_id}"
runtimeOnly fg.deobf("curse.maven:libipn-679177:${libipn_id}")
implementation fg.deobf("curse.maven:inventory-profiles-next-495267:${ipn_id}")

implementation fg.deobf("org.embeddedt:embeddium-1.18.2:${embeddedt_id}")
runtimeOnly fg.deobf("org.embeddedt:embeddium-1.18.2:${embeddedt_id}")
runtimeOnly fg.deobf("curse.maven:oculus-581495:${oculus_id}")

implementation fg.deobf("curse.maven:catalogue-459701:${catalogue_id}")
runtimeOnly fg.deobf("curse.maven:catalogue-459701:${catalogue_id}")

runtimeOnly fg.deobf("curse.maven:bookshelf-228525:${bookshelf_id}")
runtimeOnly fg.deobf("curse.maven:enchantment-descriptions-250419:${enchantment_descriptions_id}")

annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
}
Expand Down
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ kotlin_id=4439494
libipn_id=4870129
ipn_id=4813454
embeddedt_id=0.2.18-git.bcaf64a+mc1.18.2
catalogue_id=3803098
oculus_id=4578744
catalogue_id=3803098
bookshelf_id=4556713
enchantment_descriptions_id=4277221
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
package com.github.tartaricacid.touhoulittlemaid;

import com.github.tartaricacid.touhoulittlemaid.api.ILittleMaid;
import com.github.tartaricacid.touhoulittlemaid.api.game.gomoku.AIService;
import com.github.tartaricacid.touhoulittlemaid.api.game.gomoku.ZhiZhangAIService;
import com.github.tartaricacid.touhoulittlemaid.block.multiblock.MultiBlockManager;
import com.github.tartaricacid.touhoulittlemaid.config.GeneralConfig;
import com.github.tartaricacid.touhoulittlemaid.entity.backpack.BackpackManager;
import com.github.tartaricacid.touhoulittlemaid.entity.chatbubble.ChatBubbleManger;
import com.github.tartaricacid.touhoulittlemaid.entity.task.TaskManager;
import com.github.tartaricacid.touhoulittlemaid.entity.task.meal.MaidMealManager;
import com.github.tartaricacid.touhoulittlemaid.init.*;
import com.github.tartaricacid.touhoulittlemaid.inventory.chest.ChestManager;
import com.github.tartaricacid.touhoulittlemaid.item.bauble.BaubleManager;
import com.github.tartaricacid.touhoulittlemaid.util.AnnotatedInstanceUtil;
import com.google.common.collect.Lists;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.config.ModConfig;
Expand All @@ -26,30 +27,40 @@ public final class TouhouLittleMaid {
public static final String MOD_ID = "touhou_little_maid";
public static final Logger LOGGER = LogManager.getLogger(MOD_ID);
public static List<ILittleMaid> EXTENSIONS = Lists.newArrayList();
public static AIService SERVICE = new ZhiZhangAIService(new AIService.AIConfig(4, 10, false, 0, 6));

public TouhouLittleMaid() {
InitEntities.ENTITY_TYPES.register(FMLJavaModLoadingContext.get().getModEventBus());
InitEntities.ATTRIBUTES.register(FMLJavaModLoadingContext.get().getModEventBus());
InitEntities.MEMORY_MODULE_TYPES.register(FMLJavaModLoadingContext.get().getModEventBus());
InitEntities.SENSOR_TYPES.register(FMLJavaModLoadingContext.get().getModEventBus());
InitEntities.SCHEDULES.register(FMLJavaModLoadingContext.get().getModEventBus());
InitEntities.DATA_SERIALIZERS.register(FMLJavaModLoadingContext.get().getModEventBus());
InitBlocks.BLOCKS.register(FMLJavaModLoadingContext.get().getModEventBus());
InitBlocks.TILE_ENTITIES.register(FMLJavaModLoadingContext.get().getModEventBus());
InitItems.ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
InitContainer.CONTAINER_TYPE.register(FMLJavaModLoadingContext.get().getModEventBus());
InitSounds.SOUNDS.register(FMLJavaModLoadingContext.get().getModEventBus());
InitRecipes.RECIPE_SERIALIZERS.register(FMLJavaModLoadingContext.get().getModEventBus());
InitLootModifier.GLOBAL_LOOT_MODIFIER_SERIALIZER.register(FMLJavaModLoadingContext.get().getModEventBus());
InitPoi.POI_TYPES.register(FMLJavaModLoadingContext.get().getModEventBus());
initRegister(FMLJavaModLoadingContext.get().getModEventBus());
InitTrigger.init();
ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, GeneralConfig.init());
ChatBubbleManger.initDefaultChat();
modApiInit();
}

private static void initRegister(IEventBus eventBus) {
InitEntities.ENTITY_TYPES.register(eventBus);
InitEntities.ATTRIBUTES.register(eventBus);
InitEntities.MEMORY_MODULE_TYPES.register(eventBus);
InitEntities.SENSOR_TYPES.register(eventBus);
InitEntities.SCHEDULES.register(eventBus);
InitEntities.DATA_SERIALIZERS.register(eventBus);
InitBlocks.BLOCKS.register(eventBus);
InitBlocks.TILE_ENTITIES.register(eventBus);
InitItems.ITEMS.register(eventBus);
InitEnchantments.ENCHANTMENTS.register(eventBus);
InitContainer.CONTAINER_TYPE.register(eventBus);
InitSounds.SOUNDS.register(eventBus);
InitRecipes.RECIPE_SERIALIZERS.register(eventBus);
InitLootModifier.GLOBAL_LOOT_MODIFIER_SERIALIZER.register(eventBus);
InitPoi.POI_TYPES.register(eventBus);
}

private static void modApiInit() {
EXTENSIONS = AnnotatedInstanceUtil.getModExtensions();
TaskManager.init();
BackpackManager.init();
BaubleManager.init();
MultiBlockManager.init();
ChatBubbleManger.initDefaultChat();
ChestManager.init();
MaidMealManager.init();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import com.github.tartaricacid.touhoulittlemaid.block.multiblock.MultiBlockManager;
import com.github.tartaricacid.touhoulittlemaid.entity.backpack.BackpackManager;
import com.github.tartaricacid.touhoulittlemaid.entity.task.TaskManager;
import com.github.tartaricacid.touhoulittlemaid.entity.task.meal.MaidMealManager;
import com.github.tartaricacid.touhoulittlemaid.inventory.chest.ChestManager;
import com.github.tartaricacid.touhoulittlemaid.item.bauble.BaubleManager;

public interface ILittleMaid {
Expand Down Expand Up @@ -37,4 +39,20 @@ default void addMaidBackpack(BackpackManager manager) {
*/
default void addMultiBlock(MultiBlockManager manager) {
}

/**
* 添加箱子类型,用于隙间饰品的箱子识别
*
* @param manager 注册器
*/
default void addChestType(ChestManager manager) {
}

/**
* 添加女仆饭类型
*
* @param manager 注册器
*/
default void addMaidMeal(MaidMealManager manager) {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.github.tartaricacid.touhoulittlemaid.api.bauble;

import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.block.entity.BlockEntity;

public interface IChestType {
int ALLOW_COUNT = 0;
int DENY_COUNT = Integer.MAX_VALUE;

/**
* 该传入的 BlockEntity 是不是可识别的箱子
*
* @param chest 待检测的箱子
* @return 是否能识别
*/
boolean isChest(BlockEntity chest);

/**
* 用于检测箱子能否被玩家打开,防止标记非法的箱子
*
* @param chest 需要检查权限的箱子
* @param player 检查权限的玩家
* @return 能否打开
*/
boolean canOpenByPlayer(BlockEntity chest, Player player);

/**
* 目前箱子的打开计数,原版用这个方法防止多个玩家同时操作一个箱子
*
* @param level 世界
* @param pos 坐标
* @param chest 箱子
* @return <=0 代表可以放入,其他情况表示不能放入
*/
int getOpenCount(BlockGetter level, BlockPos pos, BlockEntity chest);
}
Loading

0 comments on commit 7023162

Please sign in to comment.