Skip to content

Commit bdff097

Browse files
committed
喵喵喵
1 parent c03a281 commit bdff097

9 files changed

Lines changed: 110 additions & 5 deletions

File tree

build/resources/main/assets/justarod/lang/zh_cn.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"item.justarod.uterus": "子宫",
7878
"item.justarod.scalpel": "手术刀",
7979
"item.justarod.brith_controlling_pill": "避孕药",
80+
"item.justarod.estrogen": "雌激素",
8081
"block.justarod.golden_leaves": "金叶",
8182
"itemGroup.justarod": "只是根棍子",
8283
"effect.justarod.orgasm": "高潮",

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
org.gradle.jvmargs=-Xmx1G
33
# Fabric Properties
44
# check these on https://modmuss50.me/fabric.html
5-
mod_version=0.1.8
5+
mod_version=0.1.9
66
maven_group=org.cneko
77
archives_base_name=JustARod
88
# Dependencies

src/main/java/org/cneko/justarod/entity/RodEntity.kt

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
package org.cneko.justarod.entity
22

3-
import net.minecraft.entity.Entity
4-
import net.minecraft.entity.EntityStatuses
5-
import net.minecraft.entity.EntityType
6-
import net.minecraft.entity.LivingEntity
3+
import net.minecraft.entity.*
74
import net.minecraft.entity.ai.goal.*
85
import net.minecraft.entity.attribute.DefaultAttributeContainer
96
import net.minecraft.entity.attribute.EntityAttributes
@@ -20,6 +17,7 @@ import net.minecraft.item.ItemStack
2017
import net.minecraft.item.Items
2118
import net.minecraft.nbt.NbtCompound
2219
import net.minecraft.particle.ParticleTypes
20+
import net.minecraft.registry.tag.FluidTags
2321
import net.minecraft.server.world.ServerWorld
2422
import net.minecraft.util.ActionResult
2523
import net.minecraft.util.Hand
@@ -34,6 +32,11 @@ import org.cneko.toneko.common.mod.misc.mixininterface.SlowTickable
3432
import software.bernie.geckolib.animatable.GeoEntity
3533
import software.bernie.geckolib.animatable.instance.AnimatableInstanceCache
3634
import software.bernie.geckolib.animation.AnimatableManager
35+
import software.bernie.geckolib.animation.AnimationController
36+
import software.bernie.geckolib.animation.AnimationController.AnimationStateHandler
37+
import software.bernie.geckolib.animation.AnimationState
38+
import software.bernie.geckolib.animation.RawAnimation
39+
import software.bernie.geckolib.constant.DefaultAnimations
3740
import software.bernie.geckolib.util.GeckoLibUtil
3841
import java.util.*
3942

@@ -106,6 +109,23 @@ class RodEntity(private val entityType:EntityType<RodEntity>, world: World):Tame
106109
}
107110

108111
override fun registerControllers(controllers: AnimatableManager.ControllerRegistrar?) {
112+
controllers!!.add(AnimationController<RodEntity>(this, 20, AnimationStateHandler { state: AnimationState<*>? ->
113+
if (this.pose == EntityPose.SWIMMING && !this.isInFluid) {
114+
return@AnimationStateHandler state!!.setAndContinue(DefaultAnimations.CRAWL)
115+
} else if (this.isInFluid && this.isSubmergedIn(FluidTags.WATER)) {
116+
return@AnimationStateHandler if (state!!.isMoving) state.setAndContinue(DefaultAnimations.SWIM) else state.setAndContinue(
117+
DefaultAnimations.CRAWL
118+
)
119+
} else if (!state!!.isMoving) {
120+
return@AnimationStateHandler if (this.isSitting) state.setAndContinue(
121+
RawAnimation.begin().thenLoop("misc.sit")
122+
) else state.setAndContinue(DefaultAnimations.IDLE)
123+
} else {
124+
return@AnimationStateHandler if (this.velocity.length() > 0.2) state.setAndContinue(
125+
DefaultAnimations.RUN
126+
) else state.setAndContinue(DefaultAnimations.WALK)
127+
}
128+
}))
109129
}
110130

111131
override fun getAnimatableInstanceCache(): AnimatableInstanceCache {

src/main/java/org/cneko/justarod/item/JRItems.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import org.cneko.justarod.item.electric.TribochargingRod
2828
import org.cneko.justarod.item.medical.AbortionPillItem
2929
import org.cneko.justarod.item.medical.BrithControllingPill
3030
import org.cneko.justarod.item.medical.CottonSwabItem
31+
import org.cneko.justarod.item.medical.EstrogenItem
3132
import org.cneko.justarod.item.medical.HPVVaccine
3233
import org.cneko.justarod.item.medical.SanitaryTowel
3334
import org.cneko.justarod.item.medical.ScalpelItem
@@ -80,6 +81,7 @@ class JRItems {
8081
val UTERUS = Item(Item.Settings().food(FoodComponent.Builder().nutrition(6).alwaysEdible().build()))
8182
val BRITH_CONTROLLING_PILL = BrithControllingPill(Item.Settings())
8283
val ABORtiON_PILL = AbortionPillItem(Item.Settings())
84+
val ESTROGEN = EstrogenItem(Item.Settings())
8385

8486
var JR_ITEM_GROUP_KEY: RegistryKey<ItemGroup>? = null
8587
var JR_ITEM_GROUP: ItemGroup? = null
@@ -122,6 +124,7 @@ class JRItems {
122124
Registry.register(Registries.ITEM, Identifier.of(MODID, "uterus"), UTERUS)
123125
Registry.register(Registries.ITEM, Identifier.of(MODID, "brith_controlling_pill"), BRITH_CONTROLLING_PILL)
124126
Registry.register(Registries.ITEM, Identifier.of(MODID, "abortion_pill"), ABORtiON_PILL)
127+
Registry.register(Registries.ITEM, Identifier.of(MODID, "estrogen"), ESTROGEN)
125128

126129
// 注册物品组
127130
JR_ITEM_GROUP_KEY = RegistryKey.of(Registries.ITEM_GROUP.key, Identifier.of(MODID, "item_group"))
@@ -170,6 +173,7 @@ class JRItems {
170173
entries.add(UTERUS)
171174
entries.add(BRITH_CONTROLLING_PILL)
172175
entries.add(ABORtiON_PILL)
176+
entries.add(ESTROGEN)
173177
}
174178
}
175179
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
package org.cneko.justarod.item.medical
2+
3+
import net.minecraft.entity.LivingEntity
4+
import net.minecraft.entity.effect.StatusEffectInstance
5+
import net.minecraft.entity.effect.StatusEffects
6+
import net.minecraft.entity.player.PlayerEntity
7+
import net.minecraft.item.ItemStack
8+
import net.minecraft.text.Text
9+
import net.minecraft.util.Hand
10+
import org.cneko.justarod.entity.Pregnant
11+
12+
class EstrogenItem(settings: Settings): MedicalItem(settings) {
13+
override fun canApply(
14+
user: PlayerEntity,
15+
target: LivingEntity,
16+
stack: ItemStack,
17+
hand: Hand
18+
): Boolean {
19+
return target is Pregnant
20+
}
21+
22+
override fun getFailureMessage(
23+
user: PlayerEntity,
24+
target: LivingEntity,
25+
stack: ItemStack
26+
): Text {
27+
return Text.empty()
28+
}
29+
30+
override fun applyEffect(
31+
user: PlayerEntity,
32+
target: LivingEntity,
33+
stack: ItemStack,
34+
hand: Hand
35+
) {
36+
target as Pregnant
37+
target.menstruation+=12000 // 调节月经是吗,不会喵!
38+
if (target.random.nextBoolean()){
39+
// 稍微恶心
40+
target.addStatusEffect(StatusEffectInstance(StatusEffects.NAUSEA,120,0))
41+
}
42+
if (target.random.nextBoolean()){
43+
// 好痛
44+
target.damage(target.damageSources.mobAttack(user),0.5f)
45+
}
46+
}
47+
48+
override fun consumeItem(
49+
user: PlayerEntity,
50+
target: LivingEntity,
51+
stack: ItemStack,
52+
hand: Hand
53+
) {
54+
stack.decrement(1)
55+
}
56+
57+
override fun getSuccessMessages(
58+
user: PlayerEntity,
59+
target: LivingEntity,
60+
stack: ItemStack
61+
): ActionMessages {
62+
return ActionMessages(
63+
userSuccessMessage = Text.of(""),
64+
targetSuccessMessage = Text.of("")
65+
)
66+
}
67+
}

src/main/resources/assets/justarod/lang/zh_cn.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
"item.justarod.uterus": "子宫",
7878
"item.justarod.scalpel": "手术刀",
7979
"item.justarod.brith_controlling_pill": "避孕药",
80+
"item.justarod.estrogen": "雌激素",
8081
"block.justarod.golden_leaves": "金叶",
8182
"itemGroup.justarod": "只是根棍子",
8283
"effect.justarod.orgasm": "高潮",
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"parent": "item/generated",
3+
"textures": {
4+
"layer0": "justarod:item/brith_controlling_pill"
5+
}
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"parent": "item/generated",
3+
"textures": {
4+
"layer0": "justarod:item/estrogen"
5+
}
6+
}
193 Bytes
Loading

0 commit comments

Comments
 (0)