-
Notifications
You must be signed in to change notification settings - Fork 73
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
1 parent
302f924
commit f4c25cc
Showing
5 changed files
with
65 additions
and
2 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
25 changes: 25 additions & 0 deletions
25
src/main/java/com/github/tartaricacid/touhoulittlemaid/api/entity/ai/IExtraMaidBrain.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,25 @@ | ||
package com.github.tartaricacid.touhoulittlemaid.api.entity.ai; | ||
|
||
import com.github.tartaricacid.touhoulittlemaid.entity.passive.EntityMaid; | ||
import net.minecraft.world.entity.ai.memory.MemoryModuleType; | ||
import net.minecraft.world.entity.ai.sensing.Sensor; | ||
import net.minecraft.world.entity.ai.sensing.SensorType; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
public interface IExtraMaidBrain { | ||
/** | ||
* 为女仆 AI 添加新的 MemoryModuleType | ||
*/ | ||
default List<MemoryModuleType<?>> getExtraMemoryTypes() { | ||
return Collections.emptyList(); | ||
} | ||
|
||
/** | ||
* 为女仆 AI 添加新的 SensorType | ||
*/ | ||
default List<SensorType<? extends Sensor<? super EntityMaid>>> getExtraSensorTypes() { | ||
return Collections.emptyList(); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
.../java/com/github/tartaricacid/touhoulittlemaid/entity/ai/brain/ExtraMaidBrainManager.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,23 @@ | ||
package com.github.tartaricacid.touhoulittlemaid.entity.ai.brain; | ||
|
||
import com.github.tartaricacid.touhoulittlemaid.TouhouLittleMaid; | ||
import com.github.tartaricacid.touhoulittlemaid.api.ILittleMaid; | ||
import com.github.tartaricacid.touhoulittlemaid.api.entity.ai.IExtraMaidBrain; | ||
import com.google.common.collect.Lists; | ||
|
||
import java.util.List; | ||
|
||
public final class ExtraMaidBrainManager { | ||
static List<IExtraMaidBrain> EXTRA_MAID_BRAINS = Lists.newArrayList(); | ||
|
||
public static void init() { | ||
ExtraMaidBrainManager manager = new ExtraMaidBrainManager(); | ||
for (ILittleMaid littleMaid : TouhouLittleMaid.EXTENSIONS) { | ||
littleMaid.addExtraMaidBrain(manager); | ||
} | ||
} | ||
|
||
public void addExtraMaidBrain(IExtraMaidBrain extraMaidBrain) { | ||
EXTRA_MAID_BRAINS.add(extraMaidBrain); | ||
} | ||
} |
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