refactor: 提取IEDGAnimation接口方便第三方注册动画
This commit is contained in:
parent
df4bb43186
commit
ccb3146a0c
|
|
@ -54,4 +54,4 @@ mod_authors=R3944Realms
|
|||
# The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list.
|
||||
mod_description=EtroicDungeon Game
|
||||
|
||||
mod_credits=
|
||||
mod_credits= Thanks for Autumn_Wish, Mc_haonan, Zershyan, BiliBili User 349888651.
|
||||
|
|
@ -1,118 +0,0 @@
|
|||
/*
|
||||
* Copyright 2025-2026 R3944Realms
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.r3944realms.eroticdungeongame.content.animation;
|
||||
|
||||
|
||||
import io.zershyan.sccore.animation.AnimationApi;
|
||||
import io.zershyan.sccore.animation.helper.AnimationHelper;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import top.r3944realms.eroticdungeongame.EroticDungeon;
|
||||
import top.r3944realms.eroticdungeongame.content.block.ISeatBlock;
|
||||
import top.r3944realms.eroticdungeongame.content.block.type.*;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public enum EDGAnimation {
|
||||
CUFF_BED("cuff_bed", CuffBedBlock.class),
|
||||
PRONE_BENCH("prone_bench", ProneBenchBlock.class),
|
||||
IRON_CAGE("iron_cage", IronCageBlock.class),
|
||||
SPANISH_DONKEY("spanish_donkey", SpanishDonkeyBlock.class),
|
||||
HANGING_POST("hanging_post", HangingPostBlock.class),
|
||||
CUFF_POLE("cuff_pole", CuffPoleBlock.class),
|
||||
CRUX("crux", CruxBlock.class),
|
||||
PETRINE_CROSS("petrine_cross", PetrineCrossBlock.class),
|
||||
PILLORY("pillory", PilloryBlock.class),
|
||||
RACK("rack", RackBlock.class),
|
||||
WALL_RACK("wall_rack", WallRackBlock.class),
|
||||
X_CROSS("x_cross", XCrossBlock.class),
|
||||
DISPLAY_RACK("display_rack", DisplayRackBlock.class),
|
||||
GLASS_DISPLAY_RACK("glass_display_rack", GlassDisplayRackBlock.class),;
|
||||
private final ResourceLocation baseId;
|
||||
private final Class<?> blockClass;
|
||||
public static final ResourceLocation LAYER = EroticDungeon.rl("top_height_layer");
|
||||
EDGAnimation(String baseId, Class<?> blockClass) {
|
||||
this.baseId = EroticDungeon.rl(baseId + "_pose_");
|
||||
this.blockClass = blockClass;
|
||||
}
|
||||
public @NotNull ResourceLocation getDefaultRL() {
|
||||
return this.baseId.withSuffix("01");
|
||||
}
|
||||
|
||||
public @NotNull ResourceLocation getVarietyRL(int varNumber) {
|
||||
return this.baseId.withSuffix(String.format("%02d", Math.max(1, Math.min(99, varNumber))));
|
||||
}
|
||||
|
||||
public static @NotNull ResourceLocation getDefaultRLStatic(@NotNull EDGAnimation animation) {
|
||||
return animation.getDefaultRL();
|
||||
}
|
||||
|
||||
public static @NotNull ResourceLocation getVarietyRLStatic(@NotNull EDGAnimation animation, int varNumber) {
|
||||
return animation.getVarietyRL(varNumber);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static EDGAnimation getAnimation(@NotNull Class<?> blockClass) {
|
||||
if (ISeatBlock.class.isAssignableFrom(blockClass)) {
|
||||
for (EDGAnimation value : values()) {
|
||||
if (value.blockClass.equals(blockClass)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
public void play(Player player) {
|
||||
if (player != null && !player.level().isClientSide) {
|
||||
AnimationHelper helper = AnimationApi.getHelper(player);
|
||||
helper.playAnimation(EDGAnimation.LAYER, baseId.withSuffix("01"));
|
||||
|
||||
}
|
||||
}
|
||||
public void play(Player player, int varNumber) {
|
||||
if (player != null && !player.level().isClientSide) {
|
||||
AnimationHelper helper = AnimationApi.getHelper(player);
|
||||
helper.playAnimation(EDGAnimation.LAYER, baseId.withSuffix(String.format("%02d", Math.max(1, Math.min(99, varNumber)))));
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static ResourceLocation getPlayingAnimation(Player player) {
|
||||
if (player != null && !player.level().isClientSide) {
|
||||
AnimationHelper helper = AnimationApi.getHelper(player);
|
||||
return helper.getAnimationPlaying(EDGAnimation.LAYER);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean isPlayerAnimation(Player player, @NotNull EDGAnimation animation) {
|
||||
return Objects.equals(getPlayingAnimation(player), animation.getDefaultRL());
|
||||
}
|
||||
|
||||
public static boolean isPlayerAnimation(Player player, @NotNull EDGAnimation animation, int varNumber) {
|
||||
return Objects.equals(getPlayingAnimation(player), animation.getVarietyRL(varNumber));
|
||||
}
|
||||
|
||||
public static void stop(Player player) {
|
||||
if (player != null && !player.level().isClientSide) {
|
||||
AnimationHelper helper = AnimationApi.getHelper(player);
|
||||
helper.removeAnimation(EDGAnimation.LAYER);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
/*
|
||||
* Copyright 2025-2026 R3944Realms
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.r3944realms.eroticdungeongame.content.animation;
|
||||
|
||||
|
||||
import com.google.common.collect.Sets;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import top.r3944realms.eroticdungeongame.EroticDungeon;
|
||||
import top.r3944realms.eroticdungeongame.content.block.ISeatBlock;
|
||||
import top.r3944realms.eroticdungeongame.content.block.type.*;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public enum EDGAnimations implements IEDGAnimation {
|
||||
CUFF_BED("cuff_bed", CuffBedBlock.class),
|
||||
PRONE_BENCH("prone_bench", ProneBenchBlock.class),
|
||||
IRON_CAGE("iron_cage", IronCageBlock.class),
|
||||
SPANISH_DONKEY("spanish_donkey", SpanishDonkeyBlock.class),
|
||||
HANGING_POST("hanging_post", HangingPostBlock.class),
|
||||
CUFF_POLE("cuff_pole", CuffPoleBlock.class),
|
||||
CRUX("crux", CruxBlock.class),
|
||||
PETRINE_CROSS("petrine_cross", PetrineCrossBlock.class),
|
||||
PILLORY("pillory", PilloryBlock.class),
|
||||
RACK("rack", RackBlock.class),
|
||||
WALL_RACK("wall_rack", WallRackBlock.class),
|
||||
X_CROSS("x_cross", XCrossBlock.class),
|
||||
DISPLAY_RACK("display_rack", DisplayRackBlock.class),
|
||||
GLASS_DISPLAY_RACK("glass_display_rack", GlassDisplayRackBlock.class),;
|
||||
private final ResourceLocation baseId;
|
||||
private final Class<?> blockClass;
|
||||
|
||||
EDGAnimations(String baseId, Class<?> blockClass) {
|
||||
this.baseId = EroticDungeon.rl(baseId + "_pose_");
|
||||
this.blockClass = blockClass;
|
||||
}
|
||||
private static final Set<IEDGAnimation> extraAnimations = new HashSet<>();
|
||||
|
||||
public static void registerExtraAnimation(IEDGAnimation animation) {
|
||||
extraAnimations.add(animation);
|
||||
}
|
||||
|
||||
public static @NotNull Set<IEDGAnimation> getExtraAnimations() {
|
||||
return Sets.newHashSet(extraAnimations);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static IEDGAnimation getAnimation(@NotNull Class<?> blockClass) {
|
||||
if (ISeatBlock.class.isAssignableFrom(blockClass)) {
|
||||
for (EDGAnimations value : values()) {
|
||||
if (value.blockClass.equals(blockClass)) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
for (IEDGAnimation extraAnimation : extraAnimations) {
|
||||
if (extraAnimation.getBlockClass().equals(blockClass)) {
|
||||
return extraAnimation;
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getBaseId() {
|
||||
return baseId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?> getBlockClass() {
|
||||
return blockClass;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
/*
|
||||
* Copyright 2025-2026 R3944Realms
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.r3944realms.eroticdungeongame.content.animation;
|
||||
|
||||
import io.zershyan.sccore.animation.AnimationApi;
|
||||
import io.zershyan.sccore.animation.helper.AnimationHelper;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import top.r3944realms.eroticdungeongame.EroticDungeon;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public interface IEDGAnimation {
|
||||
ResourceLocation LAYER = EroticDungeon.rl("top_height_layer");
|
||||
ResourceLocation getBaseId();
|
||||
Class<?> getBlockClass();
|
||||
@NotNull
|
||||
default ResourceLocation getDefaultRL() {
|
||||
return getBaseId().withSuffix("01");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
default ResourceLocation getVarietyRL(int varNumber) {
|
||||
return getBaseId().withSuffix(String.format("%02d", Math.max(1, Math.min(99, varNumber))));
|
||||
}
|
||||
|
||||
static @NotNull ResourceLocation getDefaultRLStatic(@NotNull IEDGAnimation animation) {
|
||||
return animation.getDefaultRL();
|
||||
}
|
||||
|
||||
static @NotNull ResourceLocation getVarietyRLStatic(@NotNull IEDGAnimation animation, int varNumber) {
|
||||
return animation.getVarietyRL(varNumber);
|
||||
}
|
||||
|
||||
|
||||
default void play(Player player) {
|
||||
if (player != null && !player.level().isClientSide) {
|
||||
AnimationHelper helper = AnimationApi.getHelper(player);
|
||||
helper.playAnimation(IEDGAnimation.LAYER, getBaseId().withSuffix("01"));
|
||||
|
||||
}
|
||||
}
|
||||
default void play(Player player, int varNumber) {
|
||||
if (player != null && !player.level().isClientSide) {
|
||||
AnimationHelper helper = AnimationApi.getHelper(player);
|
||||
helper.playAnimation(IEDGAnimation.LAYER, getBaseId().withSuffix(String.format("%02d", Math.max(1, Math.min(99, varNumber)))));
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
static ResourceLocation getPlayingAnimation(Player player) {
|
||||
if (player != null && !player.level().isClientSide) {
|
||||
AnimationHelper helper = AnimationApi.getHelper(player);
|
||||
return helper.getAnimationPlaying(IEDGAnimation.LAYER);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static boolean isPlayerAnimation(Player player, @NotNull IEDGAnimation animation) {
|
||||
return Objects.equals(getPlayingAnimation(player), animation.getDefaultRL());
|
||||
}
|
||||
|
||||
static boolean isPlayerAnimation(Player player, @NotNull IEDGAnimation animation, int varNumber) {
|
||||
return Objects.equals(getPlayingAnimation(player), animation.getVarietyRL(varNumber));
|
||||
}
|
||||
|
||||
static void stop(Player player) {
|
||||
if (player != null && !player.level().isClientSide) {
|
||||
AnimationHelper helper = AnimationApi.getHelper(player);
|
||||
helper.removeAnimation(IEDGAnimation.LAYER);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -30,7 +30,8 @@ import software.bernie.geckolib.core.animation.AnimatableManager;
|
|||
import software.bernie.geckolib.core.animation.AnimationController;
|
||||
import software.bernie.geckolib.core.animation.RawAnimation;
|
||||
import software.bernie.geckolib.util.GeckoLibUtil;
|
||||
import top.r3944realms.eroticdungeongame.content.animation.EDGAnimation;
|
||||
import top.r3944realms.eroticdungeongame.content.animation.EDGAnimations;
|
||||
import top.r3944realms.eroticdungeongame.content.animation.IEDGAnimation;
|
||||
import top.r3944realms.eroticdungeongame.content.block.type.SpanishDonkeyBlock;
|
||||
import top.r3944realms.eroticdungeongame.core.register.EDGBlockEntities;
|
||||
import top.r3944realms.lib39.util.nbt.NBTReader;
|
||||
|
|
@ -62,16 +63,16 @@ public class SpanishDonkeyBlockEntity extends BaseSeatBlockEntity implements Geo
|
|||
UUID boundPlayerUUID = pBlockEntity.getBoundPlayerUUID();
|
||||
if (boundPlayerUUID != null) {
|
||||
Player playerByUUID = pLevel.getPlayerByUUID(boundPlayerUUID);
|
||||
if (playerByUUID != null && !EDGAnimation.isPlayerAnimation(playerByUUID, EDGAnimation.SPANISH_DONKEY, 3)) {
|
||||
EDGAnimation.SPANISH_DONKEY.play(playerByUUID, 3);
|
||||
if (playerByUUID != null && !IEDGAnimation.isPlayerAnimation(playerByUUID, EDGAnimations.SPANISH_DONKEY, 3)) {
|
||||
EDGAnimations.SPANISH_DONKEY.play(playerByUUID, 3);
|
||||
}
|
||||
}
|
||||
} else if (pBlockEntity.shouldPlayUnrouting) {
|
||||
UUID boundPlayerUUID = pBlockEntity.getBoundPlayerUUID();
|
||||
if (boundPlayerUUID != null) {
|
||||
Player playerByUUID = pLevel.getPlayerByUUID(boundPlayerUUID);
|
||||
if (playerByUUID != null && !EDGAnimation.isPlayerAnimation(playerByUUID, EDGAnimation.SPANISH_DONKEY, 4)) {
|
||||
EDGAnimation.SPANISH_DONKEY.play(playerByUUID, 4);
|
||||
if (playerByUUID != null && !IEDGAnimation.isPlayerAnimation(playerByUUID, EDGAnimations.SPANISH_DONKEY, 4)) {
|
||||
EDGAnimations.SPANISH_DONKEY.play(playerByUUID, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,13 +18,11 @@ package top.r3944realms.eroticdungeongame.content.block.type;
|
|||
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||
import net.minecraft.world.level.BlockGetter;
|
||||
import net.minecraft.world.level.block.SoundType;
|
||||
import net.minecraft.world.level.block.state.BlockBehaviour;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import top.r3944realms.eroticdungeongame.content.block.IColorBlock;
|
||||
import top.r3944realms.eroticdungeongame.content.block.multiply.vertical.VerticalDoubleSeatBlock;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
|||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import top.r3944realms.eroticdungeongame.api.EroticDungeonGameApi;
|
||||
import top.r3944realms.eroticdungeongame.content.animation.EDGAnimation;
|
||||
import top.r3944realms.eroticdungeongame.content.animation.IEDGAnimation;
|
||||
import top.r3944realms.eroticdungeongame.content.block.ISeatBlock;
|
||||
import top.r3944realms.eroticdungeongame.content.block.blockentity.BaseSeatBlockEntity;
|
||||
import top.r3944realms.eroticdungeongame.content.util.FurnitureHelper;
|
||||
|
|
@ -58,7 +58,7 @@ public class DungeonDataSyncManager extends CachedSyncManager<UUID, AbstractPlay
|
|||
player.eyeHeight = cap.getEyeHeight() * dimensions.height;
|
||||
}
|
||||
|
||||
} else EDGAnimation.stop(player);
|
||||
} else IEDGAnimation.stop(player);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
@ -79,7 +79,7 @@ public class DungeonDataSyncManager extends CachedSyncManager<UUID, AbstractPlay
|
|||
} else return;
|
||||
}
|
||||
}
|
||||
EDGAnimation.stop(player);
|
||||
IEDGAnimation.stop(player);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import net.minecraft.world.phys.Vec3;
|
|||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import top.r3944realms.eroticdungeongame.content.animation.EDGAnimation;
|
||||
import top.r3944realms.eroticdungeongame.content.animation.IEDGAnimation;
|
||||
import top.r3944realms.eroticdungeongame.content.block.FurnitureShapeType;
|
||||
import top.r3944realms.eroticdungeongame.content.entity.SeatEntity;
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ public interface ISeatType {
|
|||
AABB getPlayerBB();
|
||||
|
||||
@Nullable
|
||||
EDGAnimation getAnimation();
|
||||
IEDGAnimation getAnimation();
|
||||
|
||||
@Contract()
|
||||
@NotNull
|
||||
|
|
|
|||
|
|
@ -22,7 +22,8 @@ import net.minecraft.world.phys.Vec3;
|
|||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import top.r3944realms.eroticdungeongame.content.animation.EDGAnimation;
|
||||
import top.r3944realms.eroticdungeongame.content.animation.EDGAnimations;
|
||||
import top.r3944realms.eroticdungeongame.content.animation.IEDGAnimation;
|
||||
import top.r3944realms.eroticdungeongame.content.block.FurnitureShapeType;
|
||||
import top.r3944realms.eroticdungeongame.content.block.type.*;
|
||||
import top.r3944realms.eroticdungeongame.content.entity.SeatEntity;
|
||||
|
|
@ -59,7 +60,7 @@ public enum SeatTypes implements ISeatType {
|
|||
private final AABB playerBB;
|
||||
private final float eyeHeight;
|
||||
|
||||
public final Map<ISeatType, EDGAnimation> cache = new WeakHashMap<>();
|
||||
public final Map<ISeatType, IEDGAnimation> cache = new WeakHashMap<>();
|
||||
|
||||
public static final SeatTypeRegistry REGISTRY = new SeatTypeRegistry();
|
||||
|
||||
|
|
@ -135,10 +136,10 @@ public enum SeatTypes implements ISeatType {
|
|||
}
|
||||
|
||||
@Override
|
||||
public @Nullable EDGAnimation getAnimation() {
|
||||
EDGAnimation edgAnimation = cache.get(this);
|
||||
public @Nullable IEDGAnimation getAnimation() {
|
||||
IEDGAnimation edgAnimation = cache.get(this);
|
||||
if (edgAnimation == null) {
|
||||
EDGAnimation animation = EDGAnimation.getAnimation(blockClass);
|
||||
IEDGAnimation animation = EDGAnimations.getAnimation(blockClass);
|
||||
if (animation != null) {
|
||||
cache.put(this, animation);
|
||||
return animation;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ import top.r3944realms.eroticdungeongame.EroticDungeon;
|
|||
import top.r3944realms.eroticdungeongame.api.EroticDungeonGameApi;
|
||||
import top.r3944realms.eroticdungeongame.api.event.RideDeviceEvent;
|
||||
import top.r3944realms.eroticdungeongame.api.event.UnRideDeviceEvent;
|
||||
import top.r3944realms.eroticdungeongame.content.animation.EDGAnimation;
|
||||
import top.r3944realms.eroticdungeongame.content.animation.IEDGAnimation;
|
||||
import top.r3944realms.eroticdungeongame.content.block.AbstractSeatBlock;
|
||||
import top.r3944realms.eroticdungeongame.content.block.blockentity.BaseSeatBlockEntity;
|
||||
import top.r3944realms.eroticdungeongame.content.block.multiply.AbstractTwoPartSeatBlock;
|
||||
|
|
@ -224,13 +224,13 @@ public class SeatService {
|
|||
}
|
||||
|
||||
public static void playBindingAnimation(@NotNull Player player, @NotNull ISeatType ISeatType) {
|
||||
EDGAnimation animation = ISeatType.getAnimation();
|
||||
IEDGAnimation animation = ISeatType.getAnimation();
|
||||
if (animation != null) {
|
||||
animation.play(player);
|
||||
}
|
||||
}
|
||||
public static void playBindingAnimation(@NotNull Player player, @NotNull ISeatType ISeatType, int varNumber) {
|
||||
EDGAnimation animation = ISeatType.getAnimation();
|
||||
IEDGAnimation animation = ISeatType.getAnimation();
|
||||
if (animation != null) {
|
||||
animation.play(player, varNumber);
|
||||
}
|
||||
|
|
@ -276,7 +276,7 @@ public class SeatService {
|
|||
|
||||
// 停止动画
|
||||
if (playerByUUID != null) {
|
||||
EDGAnimation.stop(playerByUUID);
|
||||
IEDGAnimation.stop(playerByUUID);
|
||||
EroticDungeon.EVENT_BUS.post(new UnRideDeviceEvent.Post(playerByUUID, blockPos, blockState, be));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ package top.r3944realms.eroticdungeongame.datagen.provider;
|
|||
import net.minecraft.data.DataGenerator;
|
||||
import top.leisuretimedock.animationcore.animation.data.ACAnimationLayerProvider;
|
||||
import top.r3944realms.eroticdungeongame.EroticDungeon;
|
||||
import top.r3944realms.eroticdungeongame.content.animation.EDGAnimation;
|
||||
import top.r3944realms.eroticdungeongame.content.animation.EDGAnimations;
|
||||
|
||||
public class EDGAnimationLayerProvider extends ACAnimationLayerProvider {
|
||||
public EDGAnimationLayerProvider(DataGenerator generator) {
|
||||
|
|
@ -29,6 +29,6 @@ public class EDGAnimationLayerProvider extends ACAnimationLayerProvider {
|
|||
@Override
|
||||
protected LayerBuilder createLayerData() {
|
||||
return LayerBuilder.create()
|
||||
.addBaseLayer(EDGAnimation.LAYER, Integer.MAX_VALUE);
|
||||
.addBaseLayer(EDGAnimations.LAYER, Integer.MAX_VALUE);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import net.minecraft.world.phys.Vec3;
|
|||
import top.leisuretimedock.animationcore.animation.AnimationDataBuilder;
|
||||
import top.leisuretimedock.animationcore.animation.data.ACAnimationProvider;
|
||||
import top.r3944realms.eroticdungeongame.EroticDungeon;
|
||||
import top.r3944realms.eroticdungeongame.content.animation.EDGAnimation;
|
||||
import top.r3944realms.eroticdungeongame.content.animation.EDGAnimations;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
|
|
@ -36,7 +36,7 @@ public class EDGAnimationProvider extends ACAnimationProvider {
|
|||
@Override
|
||||
protected void registerAnimations(Consumer<GenericAnimationData> consumer) {
|
||||
GenericAnimationData cuff_bed = AnimationDataBuilder
|
||||
.create(EDGAnimation.CUFF_BED.getDefaultRL())
|
||||
.create(EDGAnimations.CUFF_BED.getDefaultRL())
|
||||
.withName("cuff_bed")
|
||||
.withCamPitch(-90.0f) // 垂直旋转(向上看90度)
|
||||
.addCamPosOffset(new Vec3(0, -0.75, -1)) // 向后移动1格
|
||||
|
|
@ -45,7 +45,7 @@ public class EDGAnimationProvider extends ACAnimationProvider {
|
|||
consumer.accept(cuff_bed);
|
||||
|
||||
GenericAnimationData prone_bench = AnimationDataBuilder
|
||||
.create(EDGAnimation.PRONE_BENCH.getDefaultRL())
|
||||
.create(EDGAnimations.PRONE_BENCH.getDefaultRL())
|
||||
.withName("prone_bench")
|
||||
.withCamPitch(90.0f)
|
||||
.addCamPosOffset(new Vec3(0, -0.9, 0.8))
|
||||
|
|
@ -53,33 +53,33 @@ public class EDGAnimationProvider extends ACAnimationProvider {
|
|||
consumer.accept(prone_bench);
|
||||
|
||||
GenericAnimationData iron_cage = AnimationDataBuilder
|
||||
.create(EDGAnimation.IRON_CAGE.getDefaultRL())
|
||||
.create(EDGAnimations.IRON_CAGE.getDefaultRL())
|
||||
.withName("iron_cage")
|
||||
.withCamPosOffsetRelative(true)
|
||||
.buildGeneric();
|
||||
consumer.accept(iron_cage);
|
||||
|
||||
GenericAnimationData spanishDonkeyUp = AnimationDataBuilder
|
||||
.create(EDGAnimation.SPANISH_DONKEY.getDefaultRL())
|
||||
.create(EDGAnimations.SPANISH_DONKEY.getDefaultRL())
|
||||
.withName("spanish_donkey_up")
|
||||
.addCamPosOffset(new Vec3(0, 0, 0.35))
|
||||
.withCamPosOffsetRelative(true)
|
||||
.buildGeneric();
|
||||
GenericAnimationData spanishDonkeyUpWithRoute = AnimationDataBuilder
|
||||
.create(EDGAnimation.SPANISH_DONKEY.getVarietyRL(2))
|
||||
.create(EDGAnimations.SPANISH_DONKEY.getVarietyRL(2))
|
||||
.withName("spanish_donkey_up_with_route")
|
||||
.addCamPosOffset(new Vec3(0, 0, 0.35))
|
||||
.withCamPosOffsetRelative(true)
|
||||
.buildGeneric();
|
||||
|
||||
GenericAnimationData spanishDonkeyChangeRoute = AnimationDataBuilder
|
||||
.create(EDGAnimation.SPANISH_DONKEY.getVarietyRL(3))
|
||||
.create(EDGAnimations.SPANISH_DONKEY.getVarietyRL(3))
|
||||
.withName("spanish_donkey_change_route")
|
||||
.addCamPosOffset(new Vec3(0, 0, 0.35))
|
||||
.withCamPosOffsetRelative(true)
|
||||
.buildGeneric();
|
||||
GenericAnimationData spanishDonkeyChangeNotRoute = AnimationDataBuilder
|
||||
.create(EDGAnimation.SPANISH_DONKEY.getVarietyRL(4))
|
||||
.create(EDGAnimations.SPANISH_DONKEY.getVarietyRL(4))
|
||||
.withName("spanish_donkey_change_not_route")
|
||||
.addCamPosOffset(new Vec3(0, 0, 0.35))
|
||||
.withCamPosOffsetRelative(true)
|
||||
|
|
@ -91,7 +91,7 @@ public class EDGAnimationProvider extends ACAnimationProvider {
|
|||
consumer.accept(spanishDonkeyChangeNotRoute);
|
||||
|
||||
GenericAnimationData crux = AnimationDataBuilder
|
||||
.create(EDGAnimation.CRUX.getDefaultRL())
|
||||
.create(EDGAnimations.CRUX.getDefaultRL())
|
||||
.withName("crux")
|
||||
.withCamPosOffsetRelative(true)
|
||||
.withCamPosOffset(new Vec3(0, 0.0, 0.2))
|
||||
|
|
@ -99,7 +99,7 @@ public class EDGAnimationProvider extends ACAnimationProvider {
|
|||
consumer.accept(crux);
|
||||
|
||||
GenericAnimationData cuffPole = AnimationDataBuilder
|
||||
.create(EDGAnimation.CUFF_POLE.getDefaultRL())
|
||||
.create(EDGAnimations.CUFF_POLE.getDefaultRL())
|
||||
.withName("cuff_pole")
|
||||
.withCamPosOffsetRelative(true)
|
||||
.withCamPosOffset(new Vec3(0, 0.0, 0.2))
|
||||
|
|
@ -107,7 +107,7 @@ public class EDGAnimationProvider extends ACAnimationProvider {
|
|||
consumer.accept(cuffPole);
|
||||
|
||||
GenericAnimationData hangingPost = AnimationDataBuilder
|
||||
.create(EDGAnimation.HANGING_POST.getDefaultRL())
|
||||
.create(EDGAnimations.HANGING_POST.getDefaultRL())
|
||||
.withName("hanging_post")
|
||||
.withCamPitch(25f)
|
||||
.withCamPosOffset(new Vec3(0, -0.2, 0.2))
|
||||
|
|
@ -116,7 +116,7 @@ public class EDGAnimationProvider extends ACAnimationProvider {
|
|||
consumer.accept(hangingPost);
|
||||
|
||||
GenericAnimationData petrineCross = AnimationDataBuilder
|
||||
.create(EDGAnimation.PETRINE_CROSS.getDefaultRL())
|
||||
.create(EDGAnimations.PETRINE_CROSS.getDefaultRL())
|
||||
.withName("petrine_cross")
|
||||
.withCamPosOffset(new Vec3(0, 0.0, 0.2))
|
||||
.withCamPosOffsetRelative(true)
|
||||
|
|
@ -124,7 +124,7 @@ public class EDGAnimationProvider extends ACAnimationProvider {
|
|||
consumer.accept(petrineCross);
|
||||
|
||||
GenericAnimationData pillory = AnimationDataBuilder
|
||||
.create(EDGAnimation.PILLORY.getDefaultRL())
|
||||
.create(EDGAnimations.PILLORY.getDefaultRL())
|
||||
.withName("pillory")
|
||||
.addCamPosOffset(new Vec3(0, -0.5, 0.7))
|
||||
.withCamPitch(90.0f)
|
||||
|
|
@ -133,7 +133,7 @@ public class EDGAnimationProvider extends ACAnimationProvider {
|
|||
consumer.accept(pillory);
|
||||
|
||||
GenericAnimationData rack = AnimationDataBuilder
|
||||
.create(EDGAnimation.RACK.getDefaultRL())
|
||||
.create(EDGAnimations.RACK.getDefaultRL())
|
||||
.withName("rack")
|
||||
.withCamPitch(-90.0f)
|
||||
.addCamPosOffset(new Vec3(0, -0.75, -1)) // 向后移动1格
|
||||
|
|
@ -142,7 +142,7 @@ public class EDGAnimationProvider extends ACAnimationProvider {
|
|||
consumer.accept(rack);
|
||||
|
||||
GenericAnimationData xCross = AnimationDataBuilder
|
||||
.create(EDGAnimation.X_CROSS.getDefaultRL())
|
||||
.create(EDGAnimations.X_CROSS.getDefaultRL())
|
||||
.withName("x_cross")
|
||||
.withCamPosOffset(new Vec3(0, 0.0, 0.2))
|
||||
.withCamPosOffsetRelative(true)
|
||||
|
|
@ -150,7 +150,7 @@ public class EDGAnimationProvider extends ACAnimationProvider {
|
|||
consumer.accept(xCross);
|
||||
|
||||
GenericAnimationData wallRack = AnimationDataBuilder
|
||||
.create(EDGAnimation.WALL_RACK.getDefaultRL())
|
||||
.create(EDGAnimations.WALL_RACK.getDefaultRL())
|
||||
.withName("wall_rack")
|
||||
.withCamPosOffsetRelative(true)
|
||||
.withCamPosOffset(new Vec3(0, 0.0, 0.1))
|
||||
|
|
@ -158,7 +158,7 @@ public class EDGAnimationProvider extends ACAnimationProvider {
|
|||
consumer.accept(wallRack);
|
||||
|
||||
GenericAnimationData displayRack = AnimationDataBuilder
|
||||
.create(EDGAnimation.DISPLAY_RACK.getDefaultRL())
|
||||
.create(EDGAnimations.DISPLAY_RACK.getDefaultRL())
|
||||
.withName("display_rack")
|
||||
.withCamPosOffsetRelative(true)
|
||||
.withCamPosOffset(new Vec3(0, 0.0, 0))
|
||||
|
|
@ -166,7 +166,7 @@ public class EDGAnimationProvider extends ACAnimationProvider {
|
|||
consumer.accept(displayRack);
|
||||
|
||||
GenericAnimationData glassDisplayRack = AnimationDataBuilder
|
||||
.create(EDGAnimation.GLASS_DISPLAY_RACK.getDefaultRL())
|
||||
.create(EDGAnimations.GLASS_DISPLAY_RACK.getDefaultRL())
|
||||
.withName("glass_display_rack")
|
||||
.withCamPosOffsetRelative(true)
|
||||
.withCamPosOffset(new Vec3(0, 0.0, 0))
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user