mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 02:37:27 +00:00
Added a few more functions having to do with capturing picked up drops to IEntity.
This commit is contained in:
1 parent
828d03a0cb
commit
1df7819931
2 files changed
+35
-1
No files matched your search
@@ -6,6 +6,7 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.monster.EntityMob;
|
||||
import net.minecraft.entity.passive.EntityAnimal;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -779,6 +780,39 @@ public class ScriptEntity<T extends Entity> implements IEntity {
|
||||
return entity.isCollided;
|
||||
}
|
||||
|
||||
public boolean hasCollidedVertically() {
|
||||
return entity.isCollidedVertically;
|
||||
}
|
||||
|
||||
public boolean hasCollidedHorizontally() {
|
||||
return entity.isCollidedHorizontally;
|
||||
}
|
||||
|
||||
public boolean capturesDrops() {
|
||||
return entity.captureDrops;
|
||||
}
|
||||
|
||||
public void setCapturesDrops(boolean capture) {
|
||||
entity.captureDrops = capture;
|
||||
}
|
||||
|
||||
public void setCapturedDrops(IEntity[] capturedDrops) {
|
||||
entity.capturedDrops.clear();
|
||||
for (IEntity<?> iEntity : capturedDrops) {
|
||||
if (iEntity.getMCEntity() instanceof EntityItem) {
|
||||
entity.capturedDrops.add((EntityItem) iEntity.getMCEntity());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public IEntity<?>[] getCapturedDrops() {
|
||||
ArrayList<IEntity<?>> iEntityList = new ArrayList<>();
|
||||
for (EntityItem entityItem : entity.capturedDrops) {
|
||||
iEntityList.add(NpcAPI.Instance().getIEntity(entityItem));
|
||||
}
|
||||
return iEntityList.toArray(new IEntity[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @since 1.7.10c
|
||||
* @return Returns whether or not this entity is sneaking
|
||||
|
||||
Reference in new issue
Block a user