mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-22 19:58:34 +01:00
make the wooden stand actually have the items just sitting on it
This commit is contained in:
parent
37da7f35e7
commit
43fb4daddc
2 changed files with 15 additions and 15 deletions
|
@ -66,10 +66,10 @@ public class TileEntityWoodStand extends TileEntityImpl implements ITickable {
|
||||||
if (this.timer % 5 == 0 && this.timer < this.totalTime / 2) {
|
if (this.timer % 5 == 0 && this.timer < this.totalTime / 2) {
|
||||||
for (BlockPos pos : this.involvedStands.keySet()) {
|
for (BlockPos pos : this.involvedStands.keySet()) {
|
||||||
PacketHandler.sendToAllAround(this.world, this.pos, 32, new PacketParticleStream(
|
PacketHandler.sendToAllAround(this.world, this.pos, 32, new PacketParticleStream(
|
||||||
(float) pos.getX() + 0.4F + this.world.rand.nextFloat() * 0.2F,
|
(float) pos.getX() + 0.2F + this.world.rand.nextFloat() * 0.6F,
|
||||||
(float) pos.getY() + 1.05F + this.world.rand.nextFloat() * 0.35F,
|
(float) pos.getY() + 0.85F,
|
||||||
(float) pos.getZ() + 0.4F + this.world.rand.nextFloat() * 0.2F,
|
(float) pos.getZ() + 0.2F + this.world.rand.nextFloat() * 0.6F,
|
||||||
this.ritualPos.getX() + 0.5F, this.ritualPos.getY() + this.world.rand.nextFloat() * 2F + 1F, this.ritualPos.getZ() + 0.5F,
|
this.ritualPos.getX() + 0.5F, this.ritualPos.getY() + this.world.rand.nextFloat() * 3F + 2F, this.ritualPos.getZ() + 0.5F,
|
||||||
this.world.rand.nextFloat() * 0.02F + 0.02F, 0x89cc37, this.world.rand.nextFloat() * 1F + 1F
|
this.world.rand.nextFloat() * 0.02F + 0.02F, 0x89cc37, this.world.rand.nextFloat() * 1F + 1F
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@ package de.ellpeck.naturesaura.blocks.tiles.render;
|
||||||
|
|
||||||
import de.ellpeck.naturesaura.Helper;
|
import de.ellpeck.naturesaura.Helper;
|
||||||
import de.ellpeck.naturesaura.blocks.tiles.TileEntityWoodStand;
|
import de.ellpeck.naturesaura.blocks.tiles.TileEntityWoodStand;
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
import net.minecraft.item.ItemBlock;
|
import net.minecraft.item.ItemBlock;
|
||||||
|
@ -10,20 +9,21 @@ import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
public class RenderWoodStand extends TileEntitySpecialRenderer<TileEntityWoodStand> {
|
public class RenderWoodStand extends TileEntitySpecialRenderer<TileEntityWoodStand> {
|
||||||
@Override
|
@Override
|
||||||
public void render(TileEntityWoodStand tile, double x, double y, double z, float par5, int par6, float f) {
|
public void render(TileEntityWoodStand tile, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
|
||||||
ItemStack stack = tile.stack;
|
ItemStack stack = tile.stack;
|
||||||
if (!stack.isEmpty()) {
|
if (!stack.isEmpty()) {
|
||||||
GlStateManager.pushMatrix();
|
GlStateManager.pushMatrix();
|
||||||
GlStateManager.translate((float) x + 0.5F, (float) y + 1.125F, (float) z + 0.5F);
|
if (stack.getItem() instanceof ItemBlock) {
|
||||||
|
GlStateManager.translate(x + 0.5F, y + 0.9735F, z + 0.5F);
|
||||||
double boop = Minecraft.getSystemTime() / 800D;
|
float scale = 0.65F;
|
||||||
GlStateManager.translate(0D, Math.sin(boop % (2 * Math.PI)) * 0.04, 0D);
|
|
||||||
GlStateManager.rotate((float) (((boop * 40D) % 360)), 0, 1, 0);
|
|
||||||
|
|
||||||
float scale = stack.getItem() instanceof ItemBlock ? 0.45F : 0.35F;
|
|
||||||
GlStateManager.scale(scale, scale, scale);
|
GlStateManager.scale(scale, scale, scale);
|
||||||
|
} else {
|
||||||
|
GlStateManager.translate(x + 0.5F, y + 0.825F, z + 0.5F);
|
||||||
|
float scale = 0.4F;
|
||||||
|
GlStateManager.scale(scale, scale, scale);
|
||||||
|
GlStateManager.rotate(90F, 1F, 0F, 0F);
|
||||||
|
}
|
||||||
Helper.renderItemInWorld(stack);
|
Helper.renderItemInWorld(stack);
|
||||||
|
|
||||||
GlStateManager.popMatrix();
|
GlStateManager.popMatrix();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue