mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-21 19:33:29 +01:00
fixed nature altar lagging on laggy servers
This commit is contained in:
parent
5456262cf1
commit
0e93ebc2fd
2 changed files with 8 additions and 1 deletions
|
@ -22,6 +22,8 @@ import net.minecraft.util.ITickable;
|
|||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.items.IItemHandlerModifiable;
|
||||
import net.minecraftforge.items.ItemStackHandler;
|
||||
|
||||
|
@ -49,6 +51,9 @@ public class TileEntityNatureAltar extends TileEntityImpl implements ITickable {
|
|||
}
|
||||
};
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int bobTimer;
|
||||
|
||||
private final BasicAuraContainer container = new BasicAuraContainer(AuraType.OVERWORLD, 5000);
|
||||
public boolean structureFine;
|
||||
|
||||
|
@ -170,6 +175,8 @@ public class TileEntityNatureAltar extends TileEntityImpl implements ITickable {
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
this.bobTimer++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ public class RenderNatureAltar extends TileEntitySpecialRenderer<TileEntityNatur
|
|||
ItemStack stack = tile.items.getStackInSlot(0);
|
||||
if (!stack.isEmpty()) {
|
||||
GlStateManager.pushMatrix();
|
||||
float time = tile.getWorld().getTotalWorldTime() + partialTicks;
|
||||
float time = tile.bobTimer + partialTicks;
|
||||
float bob = (float) Math.sin(time / 10F) * 0.1F;
|
||||
GlStateManager.translate(x + 0.5F, y + 1.2F + bob, z + 0.5F);
|
||||
GlStateManager.rotate((time * 3) % 360, 0F, 1F, 0F);
|
||||
|
|
Loading…
Reference in a new issue