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,17 +1,17 @@
|
||||
package com.tiedup.remake.events.restriction;
|
||||
|
||||
import com.tiedup.remake.core.SystemMessageManager;
|
||||
import com.tiedup.remake.core.SystemMessageManager.MessageCategory;
|
||||
import com.tiedup.remake.core.TiedUpMod;
|
||||
import com.tiedup.remake.dialogue.EntityDialogueManager;
|
||||
import com.tiedup.remake.dialogue.EntityDialogueManager.DialogueCategory;
|
||||
import com.tiedup.remake.entities.EntityKidnapper;
|
||||
import com.tiedup.remake.items.ItemLockpick;
|
||||
import com.tiedup.remake.items.base.IKnife;
|
||||
import com.tiedup.remake.state.IBondageState;
|
||||
import com.tiedup.remake.state.IRestrainable;
|
||||
import com.tiedup.remake.dialogue.EntityDialogueManager;
|
||||
import com.tiedup.remake.dialogue.EntityDialogueManager.DialogueCategory;
|
||||
import com.tiedup.remake.util.KidnappedHelper;
|
||||
import com.tiedup.remake.core.SystemMessageManager;
|
||||
import com.tiedup.remake.core.SystemMessageManager.MessageCategory;
|
||||
import com.tiedup.remake.util.GameConstants;
|
||||
import com.tiedup.remake.util.KidnappedHelper;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
@@ -29,9 +29,9 @@ import net.minecraft.world.level.block.TrapDoorBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
import net.minecraftforge.event.TickEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEntityUseItemEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingEntityUseItemEvent;
|
||||
import net.minecraftforge.event.entity.player.AttackEntityEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
@@ -43,7 +43,6 @@ import net.minecraftforge.fml.common.Mod;
|
||||
/**
|
||||
* Unified event handler for all bondage item restrictions.
|
||||
*
|
||||
* Phase 14.4+: Centralized restriction system
|
||||
* Leg Binding: Separate arm/leg restrictions
|
||||
*
|
||||
* This handler manages restrictions based on equipped bondage items:
|
||||
@@ -90,9 +89,7 @@ public class BondageItemRestrictionHandler {
|
||||
Map<MessageCategory, Long>
|
||||
> messageCooldowns = new HashMap<>();
|
||||
|
||||
// ========================================
|
||||
// MOVEMENT RESTRICTIONS
|
||||
// ========================================
|
||||
|
||||
/**
|
||||
* Movement restrictions per tick (throttled to every 5 ticks).
|
||||
@@ -135,9 +132,11 @@ public class BondageItemRestrictionHandler {
|
||||
// === SWIM SPEED RESTRICTION ===
|
||||
if (player.isInWater() && player.isSwimming()) {
|
||||
Vec3 motion = player.getDeltaMovement();
|
||||
player.setDeltaMovement(motion.scale(
|
||||
com.tiedup.remake.core.ModConfig.SERVER.tiedSwimSpeedMultiplier.get()
|
||||
));
|
||||
player.setDeltaMovement(
|
||||
motion.scale(
|
||||
com.tiedup.remake.core.ModConfig.SERVER.tiedSwimSpeedMultiplier.get()
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,9 +159,7 @@ public class BondageItemRestrictionHandler {
|
||||
sendRestrictionMessage(player, MessageCategory.NO_ELYTRA);
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// INTERACTION RESTRICTIONS
|
||||
// ========================================
|
||||
|
||||
/**
|
||||
* Block breaking restrictions.
|
||||
@@ -334,10 +331,7 @@ public class BondageItemRestrictionHandler {
|
||||
event.setCanceled(true);
|
||||
|
||||
// Kidnapper responds with dialogue
|
||||
kidnapper.talkTo(
|
||||
player,
|
||||
DialogueCategory.ATTACK_SLAVE
|
||||
);
|
||||
kidnapper.talkTo(player, DialogueCategory.ATTACK_SLAVE);
|
||||
|
||||
// Shock the captive/worker
|
||||
IRestrainable playerState = KidnappedHelper.getKidnappedState(
|
||||
@@ -426,12 +420,16 @@ public class BondageItemRestrictionHandler {
|
||||
if (event.getAmount() <= 0) return;
|
||||
|
||||
// Find if this player has a nearby Master who owns them
|
||||
var masters = pet.level().getEntitiesOfClass(
|
||||
com.tiedup.remake.entities.EntityMaster.class,
|
||||
pet.getBoundingBox().inflate(32.0),
|
||||
m -> m.isAlive() && m.hasPet()
|
||||
&& pet.getUUID().equals(m.getStateManager().getPetPlayerUUID())
|
||||
);
|
||||
var masters = pet
|
||||
.level()
|
||||
.getEntitiesOfClass(
|
||||
com.tiedup.remake.entities.EntityMaster.class,
|
||||
pet.getBoundingBox().inflate(32.0),
|
||||
m ->
|
||||
m.isAlive() &&
|
||||
m.hasPet() &&
|
||||
pet.getUUID().equals(m.getStateManager().getPetPlayerUUID())
|
||||
);
|
||||
|
||||
for (var master : masters) {
|
||||
master.onPetHurt(event.getSource(), event.getAmount());
|
||||
@@ -483,9 +481,7 @@ public class BondageItemRestrictionHandler {
|
||||
}
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// HELPER METHODS
|
||||
// ========================================
|
||||
|
||||
/**
|
||||
* Check if a block interaction should be allowed when tied.
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.tiedup.remake.prison.PrisonerManager;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
@@ -20,6 +19,7 @@ import net.minecraftforge.event.entity.item.ItemTossEvent;
|
||||
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Event handler for labor tool protection.
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.tiedup.remake.events.restriction;
|
||||
|
||||
import com.tiedup.remake.core.TiedUpMod;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import com.tiedup.remake.entities.EntityMaster;
|
||||
import com.tiedup.remake.items.ItemChokeCollar;
|
||||
import com.tiedup.remake.state.PlayerBindState;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import com.tiedup.remake.v2.blocks.PetBedManager;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
@@ -50,9 +50,7 @@ public class PetPlayRestrictionHandler {
|
||||
private static final java.util.Map<java.util.UUID, Long> lastMessageTime =
|
||||
new java.util.HashMap<>();
|
||||
|
||||
// ========================================
|
||||
// EATING RESTRICTION
|
||||
// ========================================
|
||||
|
||||
/**
|
||||
* Prevent pet play players from eating food from hand.
|
||||
@@ -156,9 +154,7 @@ public class PetPlayRestrictionHandler {
|
||||
// Pet bed interaction (carpet placeholder) - handled in sleep event
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// SLEEPING RESTRICTION
|
||||
// ========================================
|
||||
|
||||
/**
|
||||
* Prevent pet play players from sleeping in normal beds.
|
||||
@@ -264,9 +260,7 @@ public class PetPlayRestrictionHandler {
|
||||
return null;
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// CHOKE COLLAR EFFECT
|
||||
// ========================================
|
||||
|
||||
/**
|
||||
* Apply choke collar effect on player tick.
|
||||
@@ -318,9 +312,7 @@ public class PetPlayRestrictionHandler {
|
||||
}
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// UTILITY
|
||||
// ========================================
|
||||
|
||||
/**
|
||||
* BUG FIX: Clean up player data to prevent memory leak.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.tiedup.remake.events.restriction;
|
||||
|
||||
import com.tiedup.remake.core.SettingsAccessor;
|
||||
import com.tiedup.remake.core.TiedUpMod;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import com.tiedup.remake.entities.EntityKidnapper;
|
||||
import com.tiedup.remake.items.base.ItemCollar;
|
||||
import com.tiedup.remake.minigame.StruggleSessionManager;
|
||||
@@ -15,7 +15,7 @@ import com.tiedup.remake.tasks.UntyingPlayerTask;
|
||||
import com.tiedup.remake.tasks.UntyingTask;
|
||||
import com.tiedup.remake.util.GameConstants;
|
||||
import com.tiedup.remake.util.KidnappedHelper;
|
||||
import com.tiedup.remake.core.SettingsAccessor;
|
||||
import com.tiedup.remake.v2.BodyRegionV2;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import net.minecraft.network.chat.Component;
|
||||
@@ -228,7 +228,6 @@ public class RestraintTaskTickHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
// Phase 13: Auto-shock collar logic (Player-specific feature)
|
||||
if (playerState != null) {
|
||||
playerState.checkAutoShockCollar();
|
||||
}
|
||||
@@ -284,9 +283,7 @@ public class RestraintTaskTickHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// SECURITY: Distance and line-of-sight validation
|
||||
// ========================================
|
||||
double maxUntieDistance = 4.0; // Max distance to untie (blocks)
|
||||
double distance = helper.distanceTo(targetEntity);
|
||||
if (distance > maxUntieDistance) {
|
||||
@@ -310,7 +307,10 @@ public class RestraintTaskTickHandler {
|
||||
}
|
||||
|
||||
// Check for Kidnapper fight back - block untying if Kidnapper is nearby
|
||||
if (targetEntity instanceof com.tiedup.remake.entities.AbstractTiedUpNpc npc) {
|
||||
if (
|
||||
targetEntity instanceof
|
||||
com.tiedup.remake.entities.AbstractTiedUpNpc npc
|
||||
) {
|
||||
if (
|
||||
npc.getCaptor() instanceof EntityKidnapper kidnapper &&
|
||||
kidnapper.isAlive()
|
||||
@@ -413,9 +413,11 @@ public class RestraintTaskTickHandler {
|
||||
// Get untying duration (default: 10 seconds)
|
||||
int untyingSeconds = getUntyingDuration(helper);
|
||||
|
||||
// Phase 11: Check collar ownership for TiedUp NPCs
|
||||
// Non-owners take 3x longer and trigger alert to owners
|
||||
if (targetEntity instanceof com.tiedup.remake.entities.AbstractTiedUpNpc npc) {
|
||||
if (
|
||||
targetEntity instanceof
|
||||
com.tiedup.remake.entities.AbstractTiedUpNpc npc
|
||||
) {
|
||||
if (!npc.isCollarOwner(helper)) {
|
||||
// Non-owner: triple the untying time
|
||||
untyingSeconds *= 3;
|
||||
@@ -513,7 +515,9 @@ public class RestraintTaskTickHandler {
|
||||
* @return Duration in seconds (default: 10)
|
||||
*/
|
||||
private static int getUntyingDuration(Player player) {
|
||||
return SettingsAccessor.getUntyingPlayerTime(player.level().getGameRules());
|
||||
return SettingsAccessor.getUntyingPlayerTime(
|
||||
player.level().getGameRules()
|
||||
);
|
||||
}
|
||||
|
||||
// ========== FORCE FEEDING MECHANIC ==========
|
||||
@@ -627,7 +631,6 @@ public class RestraintTaskTickHandler {
|
||||
|
||||
/**
|
||||
* Alert all collar owners that someone is trying to free their slave.
|
||||
* Phase 11: Multiplayer protection system
|
||||
*
|
||||
* @param slave The slave being freed
|
||||
* @param liberator The player trying to free them
|
||||
|
||||
Reference in New Issue
Block a user