use of net.minecraft.entity.item.EntityItem in project LogisticsPipes by RS485.
the class MainProxy method dropItems.
public static EntityItem dropItems(World worldObj, ItemStack stack, int xCoord, int yCoord, int zCoord) {
EntityItem item = new EntityItem(worldObj, xCoord, yCoord, zCoord, stack);
worldObj.spawnEntityInWorld(item);
return item;
}
use of net.minecraft.entity.item.EntityItem in project LogisticsPipes by RS485.
the class FluidContainerRenderer method doRenderItem.
public void doRenderItem(ItemStack itemstack, Minecraft mc, ItemRenderType type, Object[] data) {
useThis = false;
if (renderItem == null) {
renderItem = new RenderItem() {
@Override
public boolean shouldBob() {
return false;
}
;
@Override
public boolean shouldSpreadItems() {
return false;
}
;
};
renderItem.setRenderManager(RenderManager.instance);
}
if (type == ItemRenderType.INVENTORY) {
renderItem.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, itemstack, 0, 0);
} else {
GL11.glPushMatrix();
dummyEntityItem.setEntityItemStack(itemstack);
dummyEntityItem.hoverStart = 0;
GL11.glScalef(2F, 2F, 2F);
GL11.glRotatef(((((EntityItem) data[1]).age) / 20.0F + ((EntityItem) data[1]).hoverStart) * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F);
renderItem.doRender(dummyEntityItem, 0, 0, 0, 0, 0);
GL11.glPopMatrix();
}
useThis = true;
}
use of net.minecraft.entity.item.EntityItem in project LogisticsPipes by RS485.
the class FluidContainerRenderer method doRenderFluid.
public void doRenderFluid(FluidStack liquid, Minecraft mc, ItemRenderType type, Object[] data) {
GL11.glPushMatrix();
if (type == ItemRenderType.ENTITY) {
GL11.glRotatef(((((EntityItem) data[1]).age) / 20.0F + ((EntityItem) data[1]).hoverStart) * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F);
GL11.glScaled(0.063, 0.065, 1);
GL11.glTranslated(-8, -4, -0.02);
}
GL11.glDisable(GL11.GL_LIGHTING);
ResourceLocation resourcelocation = mc.renderEngine.getResourceLocation(liquid.getFluid().getSpriteNumber());
mc.renderEngine.bindTexture(resourcelocation);
int i1 = liquid.getFluid().getColor();
float f = (i1 >> 16 & 255) / 255.0F;
float f1 = (i1 >> 8 & 255) / 255.0F;
float f2 = (i1 & 255) / 255.0F;
GL11.glColor4f(f, f1, f2, 1.0F);
IIcon icon = liquid.getFluid().getIcon();
if (icon != null) {
renderIcon(5, 2, icon, 6, 12, 0);
if (type == ItemRenderType.ENTITY) {
GL11.glPopMatrix();
GL11.glPushMatrix();
GL11.glRotatef(((((EntityItem) data[1]).age) / 20.0F + ((EntityItem) data[1]).hoverStart) * (180F / (float) Math.PI) + 180, 0.0F, 1.0F, 0.0F);
GL11.glScaled(0.063, 0.065, 1);
GL11.glTranslated(-8, -4, -0.042);
renderIcon(5, 2, icon, 6, 12, 0);
}
}
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopMatrix();
}
use of net.minecraft.entity.item.EntityItem in project LogisticsPipes by RS485.
the class PipeTransportLogistics method dropItem.
private void dropItem(LPTravelingItemServer item) {
if (container.getWorldObj().isRemote) {
return;
}
item.setSpeed(0.05F);
item.setContainer(container);
EntityItem entity = item.toEntityItem();
if (entity != null) {
container.getWorldObj().spawnEntityInWorld(entity);
}
}
use of net.minecraft.entity.item.EntityItem in project LogisticsPipes by RS485.
the class ItemIdentifierInventory method dropItems.
public static void dropItems(World world, ItemStack stack, int i, int j, int k) {
if (stack.stackSize <= 0) {
return;
}
float f1 = 0.7F;
double d = (world.rand.nextFloat() * f1) + (1.0F - f1) * 0.5D;
double d1 = (world.rand.nextFloat() * f1) + (1.0F - f1) * 0.5D;
double d2 = (world.rand.nextFloat() * f1) + (1.0F - f1) * 0.5D;
EntityItem entityitem = new EntityItem(world, i + d, j + d1, k + d2, stack);
entityitem.delayBeforeCanPickup = 10;
world.spawnEntityInWorld(entityitem);
}
Aggregations