Remove internal phase comments and format code
Strip all Phase references, TODO/FUTURE roadmap notes, and internal planning comments from the codebase. Run Prettier for consistent formatting across all Java files.
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
package com.tiedup.remake.entities;
|
||||
|
||||
import com.tiedup.remake.core.SettingsAccessor;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import com.tiedup.remake.core.TiedUpMod;
|
||||
import com.tiedup.remake.entities.damsel.components.*;
|
||||
import com.tiedup.remake.entities.skins.DamselSkinManager;
|
||||
import com.tiedup.remake.entities.skins.Gender;
|
||||
import com.tiedup.remake.items.base.ItemCollar;
|
||||
import com.tiedup.remake.state.ICaptor;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import java.util.UUID;
|
||||
import javax.annotation.Nullable;
|
||||
import net.minecraft.ChatFormatting;
|
||||
@@ -28,7 +28,6 @@ import net.minecraft.world.level.Level;
|
||||
/**
|
||||
* EntityDamsel - Capturable female NPC with full bondage support.
|
||||
*
|
||||
* Phase 3 audit: Now extends AbstractTiedUpNpc instead of PathfinderMob.
|
||||
* All shared NPC functionality (bondage, equipment, animation, pose, name, gender)
|
||||
* has been extracted to AbstractTiedUpNpc.
|
||||
*
|
||||
@@ -45,13 +44,10 @@ import net.minecraft.world.level.Level;
|
||||
*/
|
||||
public class EntityDamsel
|
||||
extends AbstractTiedUpNpc
|
||||
implements
|
||||
net.minecraft.world.MenuProvider
|
||||
implements net.minecraft.world.MenuProvider
|
||||
{
|
||||
|
||||
// ========================================
|
||||
// DAMSEL-SPECIFIC DATA SYNC
|
||||
// ========================================
|
||||
|
||||
/**
|
||||
* Personality type name (e.g., "TIMID", "FIERCE").
|
||||
@@ -73,46 +69,39 @@ public class EntityDamsel
|
||||
EntityDataSerializers.STRING
|
||||
);
|
||||
|
||||
// ========================================
|
||||
// DAMSEL-SPECIFIC COMPONENTS
|
||||
// ========================================
|
||||
|
||||
/**
|
||||
* Manages visual appearance (variant, skin, gender, name, slim arms).
|
||||
* Phase 1 component extraction.
|
||||
*/
|
||||
private final DamselAppearance appearance;
|
||||
|
||||
/**
|
||||
* Manages all personality-related systems.
|
||||
* Phase 6: Extracted from EntityDamsel (~700 lines)
|
||||
*/
|
||||
private DamselPersonalitySystem personalitySystem;
|
||||
|
||||
/**
|
||||
* Manages all AI-related systems.
|
||||
* Phase 5: Extracted from EntityDamsel (~450 lines)
|
||||
*/
|
||||
private DamselAIController aiController;
|
||||
|
||||
/**
|
||||
* Manages all dialogue-related systems.
|
||||
* Phase 4: Extracted from EntityDamsel (~180 lines)
|
||||
*/
|
||||
private DamselDialogueHandler dialogueHandler;
|
||||
|
||||
/**
|
||||
* Orchestrates NBT serialization for all components.
|
||||
* Phase 8: Final refactoring phase.
|
||||
*/
|
||||
private DamselDataSerializer serializer;
|
||||
|
||||
/** Tracks savior and reward state */
|
||||
private final DamselRewardTracker rewardTracker = new DamselRewardTracker(this);
|
||||
private final DamselRewardTracker rewardTracker = new DamselRewardTracker(
|
||||
this
|
||||
);
|
||||
|
||||
// ========================================
|
||||
// CONSTRUCTOR
|
||||
// ========================================
|
||||
|
||||
@Override
|
||||
protected IBondageHost createBondageHost() {
|
||||
@@ -121,31 +110,26 @@ public class EntityDamsel
|
||||
|
||||
public EntityDamsel(EntityType<? extends EntityDamsel> type, Level level) {
|
||||
super(type, level);
|
||||
|
||||
// Phase 1: Initialize appearance component
|
||||
this.appearance = new DamselAppearance(this);
|
||||
|
||||
// Phase 6: Initialize personality component
|
||||
this.personalitySystem = new DamselPersonalitySystem(
|
||||
this,
|
||||
new com.tiedup.remake.entities.damsel.hosts.PersonalityTickContextHost(this)
|
||||
new com.tiedup.remake.entities.damsel.hosts.PersonalityTickContextHost(
|
||||
this
|
||||
)
|
||||
);
|
||||
|
||||
// Phase 5: Initialize AI controller component
|
||||
this.aiController = new DamselAIController(
|
||||
this,
|
||||
new com.tiedup.remake.entities.damsel.hosts.AIHost(this)
|
||||
);
|
||||
|
||||
// Phase 3: Initialize animation controller component
|
||||
// (already done in AbstractTiedUpNpc constructor)
|
||||
|
||||
// Phase 4: Initialize dialogue handler component
|
||||
this.dialogueHandler = new DamselDialogueHandler(
|
||||
new com.tiedup.remake.entities.damsel.hosts.DialogueHost(this)
|
||||
);
|
||||
|
||||
// Phase 8: Initialize data serializer
|
||||
this.serializer = new DamselDataSerializer(this);
|
||||
|
||||
// CRITICAL: Register AI goals now that aiController is initialized
|
||||
@@ -153,9 +137,7 @@ public class EntityDamsel
|
||||
this.registerGoals();
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// ENTITY INITIALIZATION
|
||||
// ========================================
|
||||
|
||||
@Override
|
||||
protected void defineSynchedData() {
|
||||
@@ -168,7 +150,6 @@ public class EntityDamsel
|
||||
@Override
|
||||
public void onSyncedDataUpdated(EntityDataAccessor<?> key) {
|
||||
super.onSyncedDataUpdated(key);
|
||||
// Phase 1: Invalidate variant cache when variant ID changes (from server sync)
|
||||
if (DATA_VARIANT_ID.equals(key)) {
|
||||
this.appearance.invalidateVariantCache();
|
||||
}
|
||||
@@ -178,13 +159,13 @@ public class EntityDamsel
|
||||
public void onAddedToWorld() {
|
||||
super.onAddedToWorld();
|
||||
|
||||
// Phase 1: Server-side only: Select deterministic variant based on UUID on spawn
|
||||
if (
|
||||
!this.level().isClientSide &&
|
||||
this.appearance.getVariantId().isEmpty()
|
||||
) {
|
||||
Gender preferredGender = SettingsAccessor.getPreferredSpawnGender(
|
||||
this.level().getGameRules());
|
||||
this.level().getGameRules()
|
||||
);
|
||||
|
||||
DamselVariant variant = DamselSkinManager.CORE.getVariantForEntity(
|
||||
this.getUUID(),
|
||||
@@ -209,7 +190,6 @@ public class EntityDamsel
|
||||
|
||||
/**
|
||||
* Register all AI goals for this entity.
|
||||
* Phase 5: Delegated to DamselAIController component.
|
||||
*
|
||||
* CRITICAL: This method is called by Mob constructor BEFORE our constructor finishes.
|
||||
* We must null-check aiController and defer goal registration until after initialization.
|
||||
@@ -245,9 +225,7 @@ public class EntityDamsel
|
||||
.add(Attributes.FOLLOW_RANGE, 60.0);
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// TICK (damsel-specific extensions)
|
||||
// ========================================
|
||||
|
||||
/**
|
||||
* Damsel-specific tick logic.
|
||||
@@ -255,28 +233,20 @@ public class EntityDamsel
|
||||
*/
|
||||
@Override
|
||||
protected void tickSubclass() {
|
||||
// Phase 5: Call for help when being led as captive
|
||||
aiController.tickCallForHelp();
|
||||
|
||||
// Phase 5: Leash traction system (teleport if stuck)
|
||||
aiController.tickLeashTraction();
|
||||
|
||||
// Phase 6: Personality system tick (needs decay, mood updates)
|
||||
personalitySystem.tickPersonality();
|
||||
|
||||
// Phase 6: Idle dialogue system
|
||||
personalitySystem.tickIdleDialogue();
|
||||
|
||||
// Phase 6: Approach detection (player enters radius)
|
||||
personalitySystem.tickApproachDetection();
|
||||
|
||||
// Phase 6: Environmental dialogue (weather, time)
|
||||
personalitySystem.tickEnvironmentDialogue();
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// VARIANT SYSTEM (Delegated to DamselAppearance)
|
||||
// ========================================
|
||||
|
||||
@Nullable
|
||||
public DamselVariant getVariant() {
|
||||
@@ -291,19 +261,15 @@ public class EntityDamsel
|
||||
return this.appearance.getVariantId();
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// SKIN TEXTURE (ISkinnedEntity implementation)
|
||||
// ========================================
|
||||
|
||||
@Override
|
||||
public ResourceLocation getSkinTexture() {
|
||||
return this.appearance.getSkinTexture();
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// NAME SYSTEM OVERRIDE
|
||||
// (DamselAppearance also sets custom name visible, delegate to it)
|
||||
// ========================================
|
||||
|
||||
@Override
|
||||
public String getNpcName() {
|
||||
@@ -315,10 +281,8 @@ public class EntityDamsel
|
||||
this.appearance.setNpcName(name);
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// GENDER/SLIMARMS OVERRIDE
|
||||
// (DamselAppearance manages these for damsels)
|
||||
// ========================================
|
||||
|
||||
@Override
|
||||
public boolean hasSlimArms() {
|
||||
@@ -335,9 +299,7 @@ public class EntityDamsel
|
||||
return this.appearance.getGender();
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// COMPONENT ACCESSORS
|
||||
// ========================================
|
||||
|
||||
public DamselAppearance getAppearance() {
|
||||
return appearance;
|
||||
@@ -351,9 +313,7 @@ public class EntityDamsel
|
||||
return rewardTracker;
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// NBT PERSISTENCE (damsel-specific)
|
||||
// ========================================
|
||||
|
||||
@Override
|
||||
public void addAdditionalSaveData(CompoundTag tag) {
|
||||
@@ -367,9 +327,7 @@ public class EntityDamsel
|
||||
serializer.load(tag);
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// BONDAGE SERVICE OVERRIDES
|
||||
// ========================================
|
||||
|
||||
/**
|
||||
* Override hurt to intercept player attacks for bondage service.
|
||||
@@ -398,13 +356,13 @@ public class EntityDamsel
|
||||
return super.getDisplayName();
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// DIALOGUE SYSTEM
|
||||
// ========================================
|
||||
|
||||
public void talkTo(Player player, String message) {
|
||||
com.tiedup.remake.dialogue.EntityDialogueManager.talkTo(
|
||||
this, player, message
|
||||
this,
|
||||
player,
|
||||
message
|
||||
);
|
||||
}
|
||||
|
||||
@@ -413,13 +371,17 @@ public class EntityDamsel
|
||||
com.tiedup.remake.dialogue.EntityDialogueManager.DialogueCategory category
|
||||
) {
|
||||
com.tiedup.remake.dialogue.EntityDialogueManager.talkTo(
|
||||
this, player, category
|
||||
this,
|
||||
player,
|
||||
category
|
||||
);
|
||||
}
|
||||
|
||||
public void actionTo(Player player, String action) {
|
||||
com.tiedup.remake.dialogue.EntityDialogueManager.actionTo(
|
||||
this, player, action
|
||||
this,
|
||||
player,
|
||||
action
|
||||
);
|
||||
}
|
||||
|
||||
@@ -428,13 +390,17 @@ public class EntityDamsel
|
||||
com.tiedup.remake.dialogue.EntityDialogueManager.DialogueCategory category
|
||||
) {
|
||||
com.tiedup.remake.dialogue.EntityDialogueManager.actionTo(
|
||||
this, player, category
|
||||
this,
|
||||
player,
|
||||
category
|
||||
);
|
||||
}
|
||||
|
||||
public void talkToPlayersInRadius(String message, int radius) {
|
||||
com.tiedup.remake.dialogue.EntityDialogueManager.talkToNearby(
|
||||
this, message, radius
|
||||
this,
|
||||
message,
|
||||
radius
|
||||
);
|
||||
}
|
||||
|
||||
@@ -443,7 +409,9 @@ public class EntityDamsel
|
||||
int radius
|
||||
) {
|
||||
com.tiedup.remake.dialogue.EntityDialogueManager.talkToNearby(
|
||||
this, category, radius
|
||||
this,
|
||||
category,
|
||||
radius
|
||||
);
|
||||
}
|
||||
|
||||
@@ -451,12 +419,17 @@ public class EntityDamsel
|
||||
com.tiedup.remake.dialogue.EntityDialogueManager.DialogueCategory category,
|
||||
int radius
|
||||
) {
|
||||
return dialogueHandler.talkToPlayersInRadiusWithCooldown(category, radius);
|
||||
return dialogueHandler.talkToPlayersInRadiusWithCooldown(
|
||||
category,
|
||||
radius
|
||||
);
|
||||
}
|
||||
|
||||
public void actionToPlayersInRadius(String action, int radius) {
|
||||
com.tiedup.remake.dialogue.EntityDialogueManager.actionToNearby(
|
||||
this, action, radius
|
||||
this,
|
||||
action,
|
||||
radius
|
||||
);
|
||||
}
|
||||
|
||||
@@ -465,13 +438,13 @@ public class EntityDamsel
|
||||
int radius
|
||||
) {
|
||||
com.tiedup.remake.dialogue.EntityDialogueManager.actionToNearby(
|
||||
this, category, radius
|
||||
this,
|
||||
category,
|
||||
radius
|
||||
);
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// SAVIOR & REWARD SYSTEM
|
||||
// ========================================
|
||||
|
||||
public void setSavior(@Nullable Player player) {
|
||||
rewardTracker.setSavior(player);
|
||||
@@ -507,9 +480,7 @@ public class EntityDamsel
|
||||
rewardTracker.rewardSavior(savior);
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// PERSONALITY SYSTEM ACCESS
|
||||
// ========================================
|
||||
|
||||
@Nullable
|
||||
public com.tiedup.remake.personality.PersonalityState getPersonalityState() {
|
||||
@@ -536,9 +507,7 @@ public class EntityDamsel
|
||||
return personalitySystem.getActiveCommand();
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// ANTI-FLEE SYSTEM
|
||||
// ========================================
|
||||
|
||||
public long getLastWhipTime() {
|
||||
return personalitySystem.getLastWhipTime();
|
||||
@@ -548,9 +517,7 @@ public class EntityDamsel
|
||||
personalitySystem.setLastWhipTime(time);
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// COMMAND SYSTEM
|
||||
// ========================================
|
||||
|
||||
public boolean giveCommand(
|
||||
Player commander,
|
||||
@@ -564,7 +531,9 @@ public class EntityDamsel
|
||||
if (!collarItem.getOwners(collar).contains(commander.getUUID())) {
|
||||
if (!this.isGagged()) {
|
||||
com.tiedup.remake.dialogue.EntityDialogueManager.talkByDialogueId(
|
||||
this, commander, "command.reject.not_master"
|
||||
this,
|
||||
commander,
|
||||
"command.reject.not_master"
|
||||
);
|
||||
}
|
||||
return false;
|
||||
@@ -573,14 +542,17 @@ public class EntityDamsel
|
||||
if (this.personalitySystem.getPersonalityState() != null) {
|
||||
if (
|
||||
!this.personalitySystem.getPersonalityState().willObeyCommand(
|
||||
commander, command
|
||||
commander,
|
||||
command
|
||||
)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.personalitySystem.getPersonalityState().setActiveCommand(
|
||||
command, commander.getUUID(), targetPos
|
||||
command,
|
||||
commander.getUUID(),
|
||||
targetPos
|
||||
);
|
||||
personalitySystem.syncPersonalityData();
|
||||
return true;
|
||||
@@ -600,7 +572,9 @@ public class EntityDamsel
|
||||
targetPos2 != null &&
|
||||
this.personalitySystem.getPersonalityState() != null
|
||||
) {
|
||||
this.personalitySystem.getPersonalityState().setCommandTarget2(targetPos2);
|
||||
this.personalitySystem.getPersonalityState().setCommandTarget2(
|
||||
targetPos2
|
||||
);
|
||||
personalitySystem.syncPersonalityData();
|
||||
}
|
||||
return success;
|
||||
@@ -613,9 +587,7 @@ public class EntityDamsel
|
||||
}
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// NPC INVENTORY ACCESS
|
||||
// ========================================
|
||||
|
||||
public net.minecraft.core.NonNullList<ItemStack> getNpcInventory() {
|
||||
return this.getInventoryManager().getNpcInventory();
|
||||
@@ -646,20 +618,17 @@ public class EntityDamsel
|
||||
);
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// DIRECT FEEDING SYSTEM
|
||||
// ========================================
|
||||
|
||||
public boolean feedByPlayer(Player player, ItemStack foodStack) {
|
||||
return this.getInventoryManager().feedByPlayer(
|
||||
player, foodStack,
|
||||
player,
|
||||
foodStack,
|
||||
this.personalitySystem.getPersonalityState()
|
||||
);
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// INTERACTION
|
||||
// ========================================
|
||||
|
||||
@Override
|
||||
protected net.minecraft.world.InteractionResult mobInteract(
|
||||
@@ -671,7 +640,9 @@ public class EntityDamsel
|
||||
// Check if holding edible item
|
||||
if (heldItem.getItem().isEdible()) {
|
||||
if (!this.hasCollar()) {
|
||||
if (player instanceof net.minecraft.server.level.ServerPlayer sp) {
|
||||
if (
|
||||
player instanceof net.minecraft.server.level.ServerPlayer sp
|
||||
) {
|
||||
sp.displayClientMessage(
|
||||
Component.literal(
|
||||
"This NPC needs a collar before you can feed them."
|
||||
@@ -684,10 +655,14 @@ public class EntityDamsel
|
||||
ItemStack collar = this.getEquipment(BodyRegionV2.NECK);
|
||||
if (collar.getItem() instanceof ItemCollar collarItem) {
|
||||
if (!collarItem.isOwner(collar, player)) {
|
||||
if (player instanceof net.minecraft.server.level.ServerPlayer sp) {
|
||||
if (
|
||||
player instanceof
|
||||
net.minecraft.server.level.ServerPlayer sp
|
||||
) {
|
||||
sp.displayClientMessage(
|
||||
Component.literal("You don't own this NPC's collar.")
|
||||
.withStyle(ChatFormatting.RED),
|
||||
Component.literal(
|
||||
"You don't own this NPC's collar."
|
||||
).withStyle(ChatFormatting.RED),
|
||||
true
|
||||
);
|
||||
}
|
||||
@@ -696,10 +671,13 @@ public class EntityDamsel
|
||||
if (this.feedByPlayer(player, heldItem)) {
|
||||
return net.minecraft.world.InteractionResult.SUCCESS;
|
||||
}
|
||||
if (player instanceof net.minecraft.server.level.ServerPlayer sp) {
|
||||
if (
|
||||
player instanceof net.minecraft.server.level.ServerPlayer sp
|
||||
) {
|
||||
sp.displayClientMessage(
|
||||
Component.literal("This NPC can't eat that right now.")
|
||||
.withStyle(ChatFormatting.RED),
|
||||
Component.literal(
|
||||
"This NPC can't eat that right now."
|
||||
).withStyle(ChatFormatting.RED),
|
||||
true
|
||||
);
|
||||
}
|
||||
@@ -718,11 +696,13 @@ public class EntityDamsel
|
||||
if (collar.getItem() instanceof ItemCollar collarItem) {
|
||||
if (
|
||||
collarItem.isOwner(collar, player) &&
|
||||
player instanceof net.minecraft.server.level.ServerPlayer serverPlayer
|
||||
player instanceof
|
||||
net.minecraft.server.level.ServerPlayer serverPlayer
|
||||
) {
|
||||
if (
|
||||
com.tiedup.remake.dialogue.conversation.ConversationManager.openConversation(
|
||||
this, serverPlayer
|
||||
this,
|
||||
serverPlayer
|
||||
)
|
||||
) {
|
||||
return net.minecraft.world.InteractionResult.SUCCESS;
|
||||
@@ -751,9 +731,7 @@ public class EntityDamsel
|
||||
return super.mobInteract(player, hand);
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// MENU PROVIDER
|
||||
// ========================================
|
||||
|
||||
@Override
|
||||
@javax.annotation.Nullable
|
||||
@@ -763,19 +741,20 @@ public class EntityDamsel
|
||||
Player player
|
||||
) {
|
||||
return this.getInventoryManager().createMenu(
|
||||
containerId, playerInventory, player
|
||||
containerId,
|
||||
playerInventory,
|
||||
player
|
||||
);
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// LIFECYCLE - DEATH
|
||||
// ========================================
|
||||
|
||||
@Override
|
||||
public void die(DamageSource damageSource) {
|
||||
if (
|
||||
!this.level().isClientSide &&
|
||||
this.level() instanceof net.minecraft.server.level.ServerLevel serverLevel
|
||||
this.level() instanceof
|
||||
net.minecraft.server.level.ServerLevel serverLevel
|
||||
) {
|
||||
UUID uuid = this.getUUID();
|
||||
|
||||
@@ -785,14 +764,18 @@ public class EntityDamsel
|
||||
|
||||
com.tiedup.remake.prison.PrisonerManager manager =
|
||||
com.tiedup.remake.prison.PrisonerManager.get(serverLevel);
|
||||
com.tiedup.remake.prison.PrisonerState state = manager.getState(uuid);
|
||||
com.tiedup.remake.prison.PrisonerState state = manager.getState(
|
||||
uuid
|
||||
);
|
||||
|
||||
if (
|
||||
state == com.tiedup.remake.prison.PrisonerState.IMPRISONED ||
|
||||
state == com.tiedup.remake.prison.PrisonerState.WORKING
|
||||
) {
|
||||
com.tiedup.remake.prison.service.PrisonerService.get().escape(
|
||||
serverLevel, uuid, "player_death"
|
||||
serverLevel,
|
||||
uuid,
|
||||
"player_death"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -804,9 +787,7 @@ public class EntityDamsel
|
||||
super.die(damageSource);
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// IDIALOGUESPEAKER - Personality-specific methods
|
||||
// ========================================
|
||||
|
||||
@Override
|
||||
public com.tiedup.remake.dialogue.SpeakerType getSpeakerType() {
|
||||
|
||||
Reference in New Issue
Block a user