mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-13 20:44:08 +00:00
Wrapper Naming Improvement Scheme
This commit is contained in:
1 parent
3a8b75f152
commit
11a4d0b61d
94 files changed
+558
-370
No files matched your search
+2
-2
@@ -3,7 +3,7 @@ package kamkeel.npcs.platform.entity;
|
||||
/**
|
||||
* Platform-independent damage source abstraction.
|
||||
*/
|
||||
public interface IPlatformDamageSource {
|
||||
public interface IDamage {
|
||||
|
||||
/**
|
||||
* @return the damage type identifier (e.g., "player", "mob", "generic")
|
||||
@@ -13,7 +13,7 @@ public interface IPlatformDamageSource {
|
||||
/**
|
||||
* @return the entity that caused this damage, or null if none (e.g., fall damage)
|
||||
*/
|
||||
IPlatformEntity getSourceEntity();
|
||||
IMob getSourceEntity();
|
||||
|
||||
/**
|
||||
* Returns the underlying MC DamageSource object.
|
||||
+2
-2
@@ -3,7 +3,7 @@ package kamkeel.npcs.platform.entity;
|
||||
/**
|
||||
* Platform-independent world abstraction.
|
||||
*/
|
||||
public interface IPlatformWorld {
|
||||
public interface IGameWorld {
|
||||
|
||||
/**
|
||||
* @return the dimension ID (e.g., 0 for overworld, -1 for nether)
|
||||
@@ -21,7 +21,7 @@ public interface IPlatformWorld {
|
||||
* @param id the entity ID
|
||||
* @return the entity, or null if not found
|
||||
*/
|
||||
IPlatformEntity getEntityById(int id);
|
||||
IMob getEntityById(int id);
|
||||
|
||||
/**
|
||||
* Returns the underlying MC World object.
|
||||
+3
-3
@@ -2,9 +2,9 @@ package kamkeel.npcs.platform.entity;
|
||||
|
||||
/**
|
||||
* Platform-independent living entity abstraction.
|
||||
* Extends {@link IPlatformEntity} with health and damage operations.
|
||||
* Extends {@link IMob} with health and damage operations.
|
||||
*/
|
||||
public interface IPlatformLiving extends IPlatformEntity {
|
||||
public interface ILiving extends IMob {
|
||||
|
||||
float getHealth();
|
||||
|
||||
@@ -18,5 +18,5 @@ public interface IPlatformLiving extends IPlatformEntity {
|
||||
* @param amount the damage amount
|
||||
* @param source the damage source, or null for generic damage
|
||||
*/
|
||||
void damage(float amount, IPlatformDamageSource source);
|
||||
void damage(float amount, IDamage source);
|
||||
}
|
||||
+2
-2
@@ -7,7 +7,7 @@ package kamkeel.npcs.platform.entity;
|
||||
* Each MC version provides an implementation wrapping the native Entity class.
|
||||
* Use {@link #getHandle()} to retrieve the underlying MC object in platform code.
|
||||
*/
|
||||
public interface IPlatformEntity {
|
||||
public interface IMob {
|
||||
|
||||
/**
|
||||
* @return the entity's numeric ID in the world
|
||||
@@ -43,7 +43,7 @@ public interface IPlatformEntity {
|
||||
/**
|
||||
* @return the dimension/world the entity is in
|
||||
*/
|
||||
IPlatformWorld getWorld();
|
||||
IGameWorld getWorld();
|
||||
|
||||
// --- Escape hatch ---
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@ import noppes.npcs.platform.nbt.INBTCompound;
|
||||
/**
|
||||
* Platform-independent item stack abstraction.
|
||||
*/
|
||||
public interface IPlatformStack {
|
||||
public interface IStack {
|
||||
|
||||
/**
|
||||
* @return the item's registry ID (e.g., "minecraft:stone")
|
||||
@@ -38,7 +38,7 @@ public interface IPlatformStack {
|
||||
/**
|
||||
* @return a deep copy of this stack
|
||||
*/
|
||||
IPlatformStack copy();
|
||||
IStack copy();
|
||||
|
||||
/**
|
||||
* Returns the underlying MC ItemStack object.
|
||||
+3
-3
@@ -2,9 +2,9 @@ package kamkeel.npcs.platform.entity;
|
||||
|
||||
/**
|
||||
* Platform-independent player abstraction.
|
||||
* Extends {@link IPlatformLiving} with player-specific operations.
|
||||
* Extends {@link ILiving} with player-specific operations.
|
||||
*/
|
||||
public interface IPlatformPlayer extends IPlatformLiving {
|
||||
public interface IUser extends ILiving {
|
||||
|
||||
/**
|
||||
* @return the player's username
|
||||
@@ -32,5 +32,5 @@ public interface IPlatformPlayer extends IPlatformLiving {
|
||||
/**
|
||||
* @return the item currently held in the player's main hand, or null if empty
|
||||
*/
|
||||
IPlatformStack getHeldItem();
|
||||
IStack getHeldItem();
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
package noppes.npcs.platform;
|
||||
|
||||
import kamkeel.npcs.platform.entity.IPlatformDamageSource;
|
||||
import kamkeel.npcs.platform.entity.IPlatformEntity;
|
||||
import kamkeel.npcs.platform.entity.IPlatformLiving;
|
||||
import kamkeel.npcs.platform.entity.IPlatformPlayer;
|
||||
import kamkeel.npcs.platform.entity.IPlatformStack;
|
||||
import kamkeel.npcs.platform.entity.IPlatformWorld;
|
||||
import kamkeel.npcs.platform.entity.IDamage;
|
||||
import kamkeel.npcs.platform.entity.ILiving;
|
||||
import kamkeel.npcs.platform.entity.IMob;
|
||||
import kamkeel.npcs.platform.entity.IUser;
|
||||
import kamkeel.npcs.platform.entity.IStack;
|
||||
import kamkeel.npcs.platform.entity.IGameWorld;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.platform.nbt.INBTList;
|
||||
import noppes.npcs.platform.nbt.NBTFactory;
|
||||
@@ -75,29 +75,14 @@ public interface PlatformService {
|
||||
|
||||
// --- Logging ---
|
||||
|
||||
/**
|
||||
* Logs at INFO level.
|
||||
*/
|
||||
void logInfo(String message);
|
||||
|
||||
/**
|
||||
* Logs at WARN level.
|
||||
*/
|
||||
void logWarn(String message);
|
||||
|
||||
/**
|
||||
* Logs at ERROR level.
|
||||
*/
|
||||
void logError(String message);
|
||||
|
||||
/**
|
||||
* Logs at ERROR level with a throwable.
|
||||
*/
|
||||
void logError(String message, Throwable t);
|
||||
|
||||
/**
|
||||
* Logs at DEBUG level.
|
||||
*/
|
||||
void logDebug(String message);
|
||||
|
||||
// --- Entity Wrapping ---
|
||||
@@ -108,7 +93,7 @@ public interface PlatformService {
|
||||
* @param mcPlayer the MC player object (e.g., EntityPlayerMP on 1.7.10)
|
||||
* @return a platform player wrapper
|
||||
*/
|
||||
IPlatformPlayer wrapPlayer(Object mcPlayer);
|
||||
IUser wrapPlayer(Object mcPlayer);
|
||||
|
||||
/**
|
||||
* Wraps a raw MC entity into a platform-independent entity.
|
||||
@@ -116,7 +101,7 @@ public interface PlatformService {
|
||||
* @param mcEntity the MC entity object
|
||||
* @return a platform entity wrapper
|
||||
*/
|
||||
IPlatformEntity wrapEntity(Object mcEntity);
|
||||
IMob wrapEntity(Object mcEntity);
|
||||
|
||||
/**
|
||||
* Wraps a raw MC living entity into a platform-independent living entity.
|
||||
@@ -124,7 +109,7 @@ public interface PlatformService {
|
||||
* @param mcLiving the MC living entity object (e.g., EntityLivingBase on 1.7.10)
|
||||
* @return a platform living wrapper
|
||||
*/
|
||||
IPlatformLiving wrapLiving(Object mcLiving);
|
||||
ILiving wrapLiving(Object mcLiving);
|
||||
|
||||
/**
|
||||
* Wraps a raw MC item stack into a platform-independent stack.
|
||||
@@ -132,7 +117,7 @@ public interface PlatformService {
|
||||
* @param mcStack the MC ItemStack object
|
||||
* @return a platform stack wrapper
|
||||
*/
|
||||
IPlatformStack wrapStack(Object mcStack);
|
||||
IStack wrapStack(Object mcStack);
|
||||
|
||||
/**
|
||||
* Wraps a raw MC world into a platform-independent world.
|
||||
@@ -140,7 +125,7 @@ public interface PlatformService {
|
||||
* @param mcWorld the MC World object
|
||||
* @return a platform world wrapper
|
||||
*/
|
||||
IPlatformWorld wrapWorld(Object mcWorld);
|
||||
IGameWorld wrapWorld(Object mcWorld);
|
||||
|
||||
/**
|
||||
* Wraps a raw MC damage source into a platform-independent damage source.
|
||||
@@ -148,7 +133,7 @@ public interface PlatformService {
|
||||
* @param mcSource the MC DamageSource object
|
||||
* @return a platform damage source wrapper
|
||||
*/
|
||||
IPlatformDamageSource wrapDamageSource(Object mcSource);
|
||||
IDamage wrapDamageSource(Object mcSource);
|
||||
|
||||
// --- Scheduling ---
|
||||
|
||||
|
||||
Reference in new issue
Block a user