mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-14 01:24:09 +00:00
21 lines
647 B
Java
21 lines
647 B
Java
package noppes.npcs.containers;
|
|||
|
|
|
||
|
|
import net.minecraft.entity.player.EntityPlayer;
|
||
|
|
import net.minecraft.inventory.Container;
|
||
|
|
import net.minecraft.util.MathHelper;
|
||
|
|
|
||
|
|
public class ContainerNpcInterface extends Container{
|
||
|
|
private int posX, posZ;
|
||
|
|
|
||
|
|
public ContainerNpcInterface(EntityPlayer player){
|
||
|
|
posX = MathHelper.floor_double(player.posX);
|
||
|
|
posZ = MathHelper.floor_double(player.posZ);
|
||
|
|
player.motionX = 0;
|
||
|
|
player.motionZ = 0;
|
||
|
|
}
|
||
|
|
@Override
|
||
|
|
public boolean canInteractWith(EntityPlayer player) {
|
||
|
|
return !player.isDead && posX == MathHelper.floor_double(player.posX) && posZ == MathHelper.floor_double(player.posZ);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|