use of arekkuusu.solar.common.entity.EntityTemporalItem in project Solar by ArekkuusuJerii.
the class TileQSquared method map.
private EntityTemporalItem map(EntityItem entity) {
if (entity instanceof EntityTemporalItem) {
((EntityTemporalItem) entity).lifeTime = 10;
return (EntityTemporalItem) entity;
}
EntityTemporalItem item = new EntityTemporalItem(entity);
item.setMotion(entity.motionX, entity.motionY, entity.motionZ);
item.setMotionRest(0.85F);
world.spawnEntity(item);
entity.setDead();
return item;
}
use of arekkuusu.solar.common.entity.EntityTemporalItem in project Solar by ArekkuusuJerii.
the class TileVacuumConveyor method map.
private EntityTemporalItem map(EntityItem entity) {
if (entity instanceof EntityTemporalItem) {
((EntityTemporalItem) entity).lifeTime = 360;
return (EntityTemporalItem) entity;
}
EntityTemporalItem item = new EntityTemporalItem(entity);
world.spawnEntity(item);
entity.setDead();
return item;
}
use of arekkuusu.solar.common.entity.EntityTemporalItem in project Solar by ArekkuusuJerii.
the class TileVacuumConveyor method dropItems.
private void dropItems() {
if (cooldown <= 0) {
IItemHandler handler = from.getKey();
ISidedInventory sidedInv = from.getValue();
for (int slot = 0; slot < handler.getSlots(); slot++) {
ItemStack inSlot = handler.getStackInSlot(slot);
if (!inSlot.isEmpty() && (lookup.isEmpty() || ItemHandlerHelper.canItemStacksStack(lookup, inSlot)) && (sidedInv == null || sidedInv.canExtractItem(slot, inSlot, getFacingLazy()))) {
BlockPos offset = pos.offset(getFacingLazy());
Vector3 spawn = Vector3.apply(offset.getX(), offset.getY(), offset.getZ()).add(0.5D);
ItemStack out = handler.extractItem(slot, Integer.MAX_VALUE, false);
EntityTemporalItem entity = new EntityTemporalItem(world, spawn.x(), spawn.y(), spawn.z(), out);
impulseEntityItem(spawn, entity);
world.spawnEntity(entity);
break;
}
}
cooldown = 5;
} else
cooldown--;
applyGravity(repulse, -1.25D);
}
Aggregations