mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-18 07:59:08 +00:00
Another MEGA COMMIT to Core Structure
This commit is contained in:
1 parent
cb6e1ca386
commit
3a8b75f152
79 files changed
+4557
-96
No files matched your search
@@ -1,12 +1,21 @@
|
||||
package noppes.npcs.wrapper;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
import noppes.npcs.CustomNpcs;
|
||||
import noppes.npcs.platform.PlatformService;
|
||||
import kamkeel.npcs.platform.entity.*;
|
||||
import noppes.npcs.platform.nbt.INBTCompound;
|
||||
import noppes.npcs.platform.nbt.INBTList;
|
||||
import noppes.npcs.platform.nbt.NBTFactory;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTFactory;
|
||||
import noppes.npcs.wrapper.nbt.MC1710NBTIO;
|
||||
import kamkeel.npcs.wrapper.platform.*;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -91,4 +100,50 @@ public class MC1710PlatformService implements PlatformService {
|
||||
public void logDebug(String message) {
|
||||
System.out.println("[CustomNPC+ DEBUG] " + message);
|
||||
}
|
||||
|
||||
// --- Entity Wrapping ---
|
||||
|
||||
@Override
|
||||
public IPlatformPlayer wrapPlayer(Object mcPlayer) {
|
||||
return new MC1710PlatformPlayer((EntityPlayerMP) mcPlayer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPlatformEntity wrapEntity(Object mcEntity) {
|
||||
return new MC1710PlatformEntity((Entity) mcEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPlatformLiving wrapLiving(Object mcLiving) {
|
||||
return new MC1710PlatformLiving((EntityLivingBase) mcLiving);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPlatformStack wrapStack(Object mcStack) {
|
||||
return new MC1710PlatformStack((ItemStack) mcStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPlatformWorld wrapWorld(Object mcWorld) {
|
||||
return new MC1710PlatformWorld((World) mcWorld);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPlatformDamageSource wrapDamageSource(Object mcSource) {
|
||||
return new MC1710PlatformDamageSource((DamageSource) mcSource);
|
||||
}
|
||||
|
||||
// --- Scheduling ---
|
||||
|
||||
@Override
|
||||
public void runOnMainThread(Runnable task) {
|
||||
MinecraftServer server = MinecraftServer.getServer();
|
||||
if (server != null) {
|
||||
// 1.7.10 doesn't have addScheduledTask — just run directly if on main thread
|
||||
// or queue via the server's next tick
|
||||
task.run();
|
||||
} else {
|
||||
task.run();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user