Skip to content

Commit cf5df38

Browse files
committed
l流重置
1 parent 39a9eea commit cf5df38

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

.github/workflows/build.yml

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ jobs:
3030
run: echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
3131
- name: Grant execute permission for gradlew
3232
run: chmod +x gradlew
33+
- name: Datagen with gradle
34+
run: ./gradlew runData
3335
- name: Build with Gradle
3436
run: ./gradlew build
3537
- name: Upload binaries to release

build.gradle

+1-3
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,4 @@ idea {
152152
}
153153
}
154154

155-
build {
156-
dependsOn(runData)
157-
}
155+
runClient.dependsOn(runData)

src/main/java/org/polaris_bear/wild_wind/common/entity/Firefly.java

+12-12
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@
3636
public class Firefly extends PathfinderMob implements FlyingAnimal, GeoEntity {
3737
private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
3838

39-
private static final EntityDataAccessor<Boolean> roost = SynchedEntityData.defineId(Firefly.class, EntityDataSerializers.BOOLEAN);
40-
private static final EntityDataAccessor<Integer> baby = SynchedEntityData.defineId(Firefly.class, EntityDataSerializers.INT);
39+
private static final EntityDataAccessor<Boolean> ROOST = SynchedEntityData.defineId(Firefly.class, EntityDataSerializers.BOOLEAN);
40+
private static final EntityDataAccessor<Integer> BABY = SynchedEntityData.defineId(Firefly.class, EntityDataSerializers.INT);
4141

42-
public static final RawAnimation idleRaw = RawAnimation.begin().thenLoop("idle");
43-
public static final RawAnimation babyRaw = RawAnimation.begin().thenLoop("baby");
42+
public static final RawAnimation IDLE_RAW = RawAnimation.begin().thenLoop("idle");
43+
public static final RawAnimation BABY_RAW = RawAnimation.begin().thenLoop("baby");
4444
public Firefly(EntityType<? extends PathfinderMob> type, Level level) {
4545
super(type, level);
4646
this.moveControl = new FlyingMoveControl(this, 20, true);
@@ -50,8 +50,8 @@ public Firefly(EntityType<? extends PathfinderMob> type, Level level) {
5050
@Override
5151
protected void defineSynchedData(SynchedEntityData.Builder builder) {
5252
super.defineSynchedData(builder);
53-
builder.define(roost, false);
54-
builder.define(baby, 0);
53+
builder.define(ROOST, false);
54+
builder.define(BABY, 0);
5555
}
5656

5757
@Nullable
@@ -62,23 +62,23 @@ public SpawnGroupData finalizeSpawn(ServerLevelAccessor level, DifficultyInstanc
6262
}
6363

6464
public void setRoost(boolean r) {
65-
this.entityData.set(roost, r);
65+
this.entityData.set(ROOST, r);
6666
}
6767

6868
public boolean isRoost() {
69-
return this.entityData.get(roost);
69+
return this.entityData.get(ROOST);
7070
}
7171

7272
@Override
7373
public boolean isBaby() {
74-
return this.entityData.get(baby) < 300;
74+
return this.entityData.get(BABY) < 300;
7575
}
7676

7777
public int getBaby() {
78-
return this.entityData.get(baby);
78+
return this.entityData.get(BABY);
7979
}
8080

81-
public void setBaby(int b) {this.entityData.set(baby, b);}
81+
public void setBaby(int b) {this.entityData.set(BABY, b);}
8282

8383
@Override
8484
public void tick() {
@@ -186,7 +186,7 @@ public void registerControllers(AnimatableManager.ControllerRegistrar controller
186186

187187
private PlayState handle(AnimationState<Firefly> state) {
188188
state.setControllerSpeed(isRoost() ? 0.3f: 1f);
189-
state.setAndContinue( isBaby() ? babyRaw : idleRaw);
189+
state.setAndContinue( isBaby() ? BABY_RAW : IDLE_RAW);
190190
return PlayState.CONTINUE;
191191
}
192192

0 commit comments

Comments
 (0)