-
Notifications
You must be signed in to change notification settings - Fork 10
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
9 changed files
with
157 additions
and
58 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
65 changes: 65 additions & 0 deletions
65
fabric/src/main/java/org/cneko/toneko/fabric/entities/ToNekoEntities.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,65 @@ | ||
package org.cneko.toneko.fabric.entities; | ||
|
||
import net.fabricmc.fabric.api.biome.v1.BiomeModifications; | ||
import net.fabricmc.fabric.api.biome.v1.BiomeSelectors; | ||
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityType; | ||
import net.minecraft.core.Registry; | ||
import net.minecraft.core.registries.BuiltInRegistries; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.world.entity.EntityType; | ||
import net.minecraft.world.entity.MobCategory; | ||
import org.cneko.toneko.common.mod.api.NekoNameRegistry; | ||
import org.cneko.toneko.common.mod.api.NekoSkinRegistry; | ||
import org.cneko.toneko.common.mod.entities.AdventurerNeko; | ||
import org.cneko.toneko.common.mod.entities.CrystalNekoEntity; | ||
import org.cneko.toneko.common.util.ConfigUtil; | ||
|
||
import java.util.Set; | ||
|
||
import static org.cneko.toneko.common.Bootstrap.MODID; | ||
import static org.cneko.toneko.common.mod.entities.ToNekoEntities.*; | ||
|
||
public class ToNekoEntities { | ||
public static void init(){ | ||
ADVENTURER_NEKO = Registry.register( | ||
BuiltInRegistries.ENTITY_TYPE, | ||
ResourceLocation.fromNamespaceAndPath(MODID,"adventurer_neko"), | ||
FabricEntityType.Builder.createMob(AdventurerNeko::new, MobCategory.CREATURE, builder -> builder.defaultAttributes(AdventurerNeko::createAdventurerNekoAttributes) | ||
). | ||
sized(0.5f,1.7f).eyeHeight(1.6f).build() | ||
); | ||
CRYSTAL_NEKO = Registry.register( | ||
BuiltInRegistries.ENTITY_TYPE, | ||
ResourceLocation.fromNamespaceAndPath(MODID,"crystal_neko"), | ||
FabricEntityType.Builder.createMob(CrystalNekoEntity::new, MobCategory.CREATURE, builder -> builder.defaultAttributes(CrystalNekoEntity::createNekoAttributes) | ||
) | ||
.sized(0.5f,1.7f).eyeHeight(1.6f).clientTrackingRange(8).build() | ||
); | ||
|
||
// 注册皮肤 | ||
NekoSkinRegistry.register(ADVENTURER_NEKO,AdventurerNeko.nekoSkins); | ||
// 注册名字 | ||
Set<String> names = Set.of( | ||
"Luna","Mochi","Poppy","Misty","Snowy","Coco","Peaches","Bubbles","Daisy","Cherry", | ||
"ひなた","もふこ","ちゃちゃまる","ひめにゃん", | ||
"Felicity","Purrin","Catrina","Fluffy","Meowgical","Felina","Ayame","Cinnamon","Momo" | ||
); | ||
NekoNameRegistry.register(names); | ||
|
||
/* | ||
不知道为什么喵,我测试的时候总是不生成,真的好奇怪的问题 | ||
后来测试了很多次喵,都没生成 | ||
这个我也是改来改去的喵,就是很奇怪 | ||
哪怕我看了其它模组的代码,和我的似乎也差不多,但是我的就是不生成喵 | ||
太她喵的奇怪了! | ||
但是喵... | ||
重新创建了个世界,它生成了喵!好逆天的Bug喵! | ||
*/ | ||
// 设置生成条件 | ||
BiomeModifications.addSpawn(BiomeSelectors.foundInOverworld(), MobCategory.CREATURE, ADVENTURER_NEKO, 5, 1, 1); // 在主世界的高山会生成一只 | ||
|
||
if (ConfigUtil.IS_BIRTHDAY){ | ||
BiomeModifications.addSpawn(BiomeSelectors.all(), MobCategory.CREATURE, CRYSTAL_NEKO, 10, 1, 4); // 在所有世界生成一只 | ||
} | ||
} | ||
} |
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
44 changes: 44 additions & 0 deletions
44
neoforge/src/main/java/org/cneko/toneko/neoforge/entities/ToNekoEntities.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,44 @@ | ||
package org.cneko.toneko.neoforge.entities; | ||
|
||
import net.fabricmc.fabric.api.object.builder.v1.entity.FabricEntityType; | ||
import net.minecraft.world.entity.Entity; | ||
import net.minecraft.world.entity.EntityType; | ||
import net.minecraft.world.entity.MobCategory; | ||
import net.neoforged.neoforge.registries.DeferredHolder; | ||
import org.cneko.toneko.common.mod.api.NekoNameRegistry; | ||
import org.cneko.toneko.common.mod.api.NekoSkinRegistry; | ||
import org.cneko.toneko.common.mod.entities.AdventurerNeko; | ||
import org.cneko.toneko.common.mod.entities.CrystalNekoEntity; | ||
import org.cneko.toneko.neoforge.ToNekoNeoForge; | ||
|
||
import java.util.Set; | ||
|
||
import static org.cneko.toneko.common.mod.entities.ToNekoEntities.*; | ||
public class ToNekoEntities { | ||
public static DeferredHolder<EntityType<?>, EntityType<?>> CRYSTAL_NEKO_HOLDER; | ||
public static DeferredHolder<EntityType<?>, EntityType<?>> ADVENTURER_NEKO_HOLDER; | ||
public static void init(){ | ||
CRYSTAL_NEKO_HOLDER = ToNekoNeoForge.ENTITY_TYPES.register("crystal_neko", | ||
()-> EntityType.Builder.of(CrystalNekoEntity::new, MobCategory.CREATURE) | ||
.sized(0.5f,1.7f).eyeHeight(1.6f).clientTrackingRange(8) | ||
.build("crystal_neko") | ||
); | ||
ADVENTURER_NEKO_HOLDER = ToNekoNeoForge.ENTITY_TYPES.register("adventurer_neko", | ||
()-> EntityType.Builder.of(AdventurerNeko::new, MobCategory.CREATURE) | ||
.sized(0.5f,1.7f).eyeHeight(1.6f).clientTrackingRange(8) | ||
.build("adventurer_neko") | ||
); | ||
|
||
// 注册皮肤 | ||
NekoSkinRegistry.register(ADVENTURER_NEKO,AdventurerNeko.nekoSkins); | ||
// 注册名字 | ||
Set<String> names = Set.of( | ||
"Luna","Mochi","Poppy","Misty","Snowy","Coco","Peaches","Bubbles","Daisy","Cherry", | ||
"ひなた","もふこ","ちゃちゃまる","ひめにゃん", | ||
"Felicity","Purrin","Catrina","Fluffy","Meowgical","Felina","Ayame","Cinnamon","Momo" | ||
); | ||
NekoNameRegistry.register(names); | ||
|
||
|
||
} | ||
} |
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