Вопрос Gif manager

Начинающий
Статус
Оффлайн
Регистрация
17 Май 2023
Сообщения
225
Реакции[?]
2
Поинты[?]
1K

Перед прочтением основного контента ниже, пожалуйста, обратите внимание на обновление внутри секции Майна на нашем форуме. У нас появились:

  • бесплатные читы для Майнкрафт — любое использование на свой страх и риск;
  • маркетплейс Майнкрафт — абсолютно любая коммерция, связанная с игрой, за исключением продажи читов (аккаунты, предоставления услуг, поиск кодеров читов и так далее);
  • приватные читы для Minecraft — в этом разделе только платные хаки для игры, покупайте группу "Продавец" и выставляйте на продажу свой софт;
  • обсуждения и гайды — всё тот же раздел с вопросами, но теперь модернизированный: поиск нужных хаков, пати с игроками-читерами и другая полезная информация.

Спасибо!

где найти gif manager? для воспроизведение гифок? ну или как сделать что бы можно было отрендерить гифку?
 
Начинающий
Статус
Оффлайн
Регистрация
7 Июл 2023
Сообщения
38
Реакции[?]
1
Поинты[?]
0
ну можно просто сконвертировать с гиф в пнг и по кадрово их проиграть
 
Начинающий
Статус
Оффлайн
Регистрация
4 Дек 2021
Сообщения
121
Реакции[?]
6
Поинты[?]
3K
где найти gif manager? для воспроизведение гифок? ну или как сделать что бы можно было отрендерить гифку?
Ни где так как это не возможно. Но ты можешь покрадово рендерить картинку
 
Начинающий
Статус
Оффлайн
Регистрация
17 Май 2023
Сообщения
225
Реакции[?]
2
Поинты[?]
1K
Начинающий
Статус
Оффлайн
Регистрация
7 Июл 2023
Сообщения
38
Реакции[?]
1
Поинты[?]
0
и как это примерно реализовать? через time?
вот пример

gif:
int gif = (Minecraft.getInstance().player.ticksExisted % 4) + 1; // 4 = количество картинок, картинки должны быть прономерованны
VisualHelper.drawImage(new ResourceLocation("client/gifs/" + gif + ".png"), 0,0,32,32,-1);
 
Начинающий
Статус
Оффлайн
Регистрация
8 Май 2023
Сообщения
435
Реакции[?]
5
Поинты[?]
6K
где найти gif manager? для воспроизведение гифок? ну или как сделать что бы можно было отрендерить гифку?
Megacode:
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.DynamicTexture;
import net.minecraft.util.ResourceLocation;

import javax.imageio.ImageIO;
import javax.imageio.ImageReader;
import javax.imageio.stream.ImageInputStream;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

public class GifEngine {
    private int current = 0;
    private Counter counter = new Counter();
    private DynamicTexture texture;
    private List<DynamicTexture> frames;
    private int x;
    private int y;
    private int width;
    private int height;
    private int tiktok;
    private int ticks;

    public GifEngine(ResourceLocation rs, int width, int height, int tt) {
        this.texture = new DynamicTexture(width, height);
        this.width = width;
        this.height = height;
        this.frames = this.images(rs);
        this.ticks = tt;
    }

    public void update() {
        if (tiktok > ticks) {
            //1 seconds = 20 ticks
            if (this.counter.hasReached(Minecraft.getMinecraft().getTickLength()) && this.frames.size() > 0) {
                if (this.current > this.frames.size() - 1) {
                    this.current = 0;
                }
                this.texture = this.frames.get(this.current);
                ++this.current;
                this.counter.reset();
            }
            tiktok = 0;
        }
        tiktok++;
    }

    public void bind(int x, int y) {
        this.x = x;
        this.y = y;
        UIRender.bind((float)this.x + 5.0f, this.y, this.width / java777.scale.getScale(), this.height / java777.scale.getScale(), 1.0f, this.getTexture().getGlTextureId());
    }

    public List<DynamicTexture> images(ResourceLocation rs) {
        ArrayList<DynamicTexture> images = new ArrayList<DynamicTexture>();
        try {
            ImageReader reader = ImageIO.getImageReadersByFormatName("gif").next();
            InputStream xui = Minecraft.getMinecraft().getResourceManager().getResource(rs).getInputStream();
            ImageInputStream stream = ImageIO.createImageInputStream(xui);
            reader.setInput(stream);
            int count = reader.getNumImages(true);
            for (int index = 0; index < count; ++index) {
                BufferedImage frame = reader.read(index);
                images.add(new DynamicTexture(frame));
            }
        }
        catch (IOException iOException) {
            // empty catch block
        }
        return images;
    }

    public DynamicTexture getTexture() {
        return this.texture;
    }

    public void setTexture(DynamicTexture texture) {
        this.texture = texture;
    }

    public List<DynamicTexture> getFrames() {
        return this.frames;
    }

    public void setFrames(List<DynamicTexture> frames) {
        this.frames = frames;
    }
}
Megacode:
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.DynamicTexture;
import net.minecraft.util.ResourceLocation;

import javax.imageio.ImageIO;
import javax.imageio.ImageReader;
import javax.imageio.stream.ImageInputStream;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

public class GifEngine {
    private int current = 0;
    private Counter counter = new Counter();
    private DynamicTexture texture;
    private List<DynamicTexture> frames;
    private int x;
    private int y;
    private int width;
    private int height;
    private int tiktok;
    private int ticks;

    public GifEngine(ResourceLocation rs, int width, int height, int tt) {
        this.texture = new DynamicTexture(width, height);
        this.width = width;
        this.height = height;
        this.frames = this.images(rs);
        this.ticks = tt;
    }

    public void update() {
        if (tiktok > ticks) {
            //1 seconds = 20 ticks
            if (this.counter.hasReached(Minecraft.getMinecraft().getTickLength()) && this.frames.size() > 0) {
                if (this.current > this.frames.size() - 1) {
                    this.current = 0;
                }
                this.texture = this.frames.get(this.current);
                ++this.current;
                this.counter.reset();
            }
            tiktok = 0;
        }
        tiktok++;
    }

    public void bind(int x, int y) {
        this.x = x;
        this.y = y;
        UIRender.bind((float)this.x + 5.0f, this.y, this.width / java777.scale.getScale(), this.height / java777.scale.getScale(), 1.0f, this.getTexture().getGlTextureId());
    }

    public List<DynamicTexture> images(ResourceLocation rs) {
        ArrayList<DynamicTexture> images = new ArrayList<DynamicTexture>();
        try {
            ImageReader reader = ImageIO.getImageReadersByFormatName("gif").next();
            InputStream xui = Minecraft.getMinecraft().getResourceManager().getResource(rs).getInputStream();
            ImageInputStream stream = ImageIO.createImageInputStream(xui);
            reader.setInput(stream);
            int count = reader.getNumImages(true);
            for (int index = 0; index < count; ++index) {
                BufferedImage frame = reader.read(index);
                images.add(new DynamicTexture(frame));
            }
        }
        catch (IOException iOException) {
            // empty catch block
        }
        return images;
    }

    public DynamicTexture getTexture() {
        return this.texture;
    }

    public void setTexture(DynamicTexture texture) {
        this.texture = texture;
    }

    public List<DynamicTexture> getFrames() {
        return this.frames;
    }

    public void setFrames(List<DynamicTexture> frames) {
        this.frames = frames;
    }
}
Хз работает ли на 1.16
 
Начинающий
Статус
Оффлайн
Регистрация
31 Июл 2022
Сообщения
405
Реакции[?]
15
Поинты[?]
20K
Megacode:
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.texture.DynamicTexture;
import net.minecraft.util.ResourceLocation;

import javax.imageio.ImageIO;
import javax.imageio.ImageReader;
import javax.imageio.stream.ImageInputStream;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

public class GifEngine {
    private int current = 0;
    private Counter counter = new Counter();
    private DynamicTexture texture;
    private List<DynamicTexture> frames;
    private int x;
    private int y;
    private int width;
    private int height;
    private int tiktok;
    private int ticks;

    public GifEngine(ResourceLocation rs, int width, int height, int tt) {
        this.texture = new DynamicTexture(width, height);
        this.width = width;
        this.height = height;
        this.frames = this.images(rs);
        this.ticks = tt;
    }

    public void update() {
        if (tiktok > ticks) {
            //1 seconds = 20 ticks
            if (this.counter.hasReached(Minecraft.getMinecraft().getTickLength()) && this.frames.size() > 0) {
                if (this.current > this.frames.size() - 1) {
                    this.current = 0;
                }
                this.texture = this.frames.get(this.current);
                ++this.current;
                this.counter.reset();
            }
            tiktok = 0;
        }
        tiktok++;
    }

    public void bind(int x, int y) {
        this.x = x;
        this.y = y;
        UIRender.bind((float)this.x + 5.0f, this.y, this.width / java777.scale.getScale(), this.height / java777.scale.getScale(), 1.0f, this.getTexture().getGlTextureId());
    }

    public List<DynamicTexture> images(ResourceLocation rs) {
        ArrayList<DynamicTexture> images = new ArrayList<DynamicTexture>();
        try {
            ImageReader reader = ImageIO.getImageReadersByFormatName("gif").next();
            InputStream xui = Minecraft.getMinecraft().getResourceManager().getResource(rs).getInputStream();
            ImageInputStream stream = ImageIO.createImageInputStream(xui);
            reader.setInput(stream);
            int count = reader.getNumImages(true);
            for (int index = 0; index < count; ++index) {
                BufferedImage frame = reader.read(index);
                images.add(new DynamicTexture(frame));
            }
        }
        catch (IOException iOException) {
            // empty catch block
        }
        return images;
    }

    public DynamicTexture getTexture() {
        return this.texture;
    }

    public void setTexture(DynamicTexture texture) {
        this.texture = texture;
    }

    public List<DynamicTexture> getFrames() {
        return this.frames;
    }

    public void setFrames(List<DynamicTexture> frames) {
        this.frames = frames;
    }
}
Хз работает ли на 1.16
это все миф и ложь.
 
Сверху Снизу