net.minecraft.client.texture.SpriteAtlasTexture Java Examples

The following examples show how to use net.minecraft.client.texture.SpriteAtlasTexture. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HallowedLoadingScreen.java    From the-hallow with MIT License 6 votes vote down vote up
@Override
public void render(int mouseX, int mouseY, float delta) {
	renderDirtBackground(0);
	this.drawCenteredString(font, I18n.translate(message), width / 2, height / 2 - 50, 0xFFFFFF);
	
	float scale = 100f;
	RenderSystem.pushMatrix();
	RenderSystem.translatef(width / 2f, height / 2f + 65 + MathHelper.sin(floatingTick / 6.5f) * 25, 500f);
	RenderSystem.scalef(scale, scale, scale);
	RenderSystem.rotatef(180, 1, 0, 0);
	RenderSystem.rotatef(rotation, 0, 1, 0);
	
	minecraft.getTextureManager().bindTexture(SpriteAtlasTexture.BLOCK_ATLAS_TEX);
	minecraft.getItemRenderer().renderGuiItem(pumpkinStack, 0, 0);
	
	RenderSystem.popMatrix();
}
 
Example #2
Source File: HallowedCactusEntityRenderer.java    From the-hallow with MIT License 5 votes vote down vote up
@Override
public void render(RestlessCactusEntity entity, float yaw, float tickDelta, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int light) {
	BlockRenderManager manager = MinecraftClient.getInstance().getBlockRenderManager();
	BlockState state = HallowedBlocks.RESTLESS_CACTUS.getDefaultState();
	renderManager.textureManager.bindTexture(SpriteAtlasTexture.BLOCK_ATLAS_TEX);
	matrixStack.push();
	matrixStack.multiply(Vector3f.POSITIVE_Y.getDegreesQuaternion(-yaw));
	matrixStack.translate(-0.5f, 0.0f, -0.5f);
	
	for (int i = 0; i < entity.getCactusHeight(); i++) {
		manager.renderBlockAsEntity(state, matrixStack, vertexConsumerProvider, light, OverlayTexture.DEFAULT_UV);
		matrixStack.translate(0.0F, 1.0F, 0.0F);
	}
	matrixStack.pop();
}
 
Example #3
Source File: MixinFluidRenderer.java    From Sandbox with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Inject(at = @At("RETURN"), method = "onResourceReload")
public void reload(CallbackInfo info) {
    SpriteAtlasTexture spriteAtlasTexture_1 = (SpriteAtlasTexture) MinecraftClient.getInstance().getTextureManager().getTexture(SpriteAtlasTexture.BLOCK_ATLAS_TEX);
    spriteMap.clear();
    Registry.FLUID.forEach(fluid -> {
        if (fluid instanceof FluidWrapper) {
            Sprite[] sprites = new Sprite[2];
            sprites[0] = spriteAtlasTexture_1.getSprite(WrappingUtil.convert(((FluidWrapper) fluid).fluid.getTexturePath(false)));
            sprites[1] = spriteAtlasTexture_1.getSprite(WrappingUtil.convert(((FluidWrapper) fluid).fluid.getTexturePath(true)));
            spriteMap.put(((FluidWrapper) fluid).fluid, sprites);
        }
    });
}
 
Example #4
Source File: MixinModelLoader.java    From Sandbox with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Redirect(method = "<init>", at = @At(value = "INVOKE", target = "Ljava/util/Set;addAll(Ljava/util/Collection;)Z"))
public boolean addAll(Set<SpriteIdentifier> set, Collection<SpriteIdentifier> set2) {
    for (Fluid fluid : Registry.FLUID) {
        if (fluid instanceof FluidWrapper) {
            set.add(new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEX, WrappingUtil.convert(((FluidWrapper) fluid).fluid.getTexturePath(false))));
            set.add(new SpriteIdentifier(SpriteAtlasTexture.BLOCK_ATLAS_TEX, WrappingUtil.convert(((FluidWrapper) fluid).fluid.getTexturePath(true))));
        }
    }
    return set.addAll(set2);
}
 
Example #5
Source File: LevitatingItemRenderer.java    From MineLittlePony with MIT License 5 votes vote down vote up
public static RenderLayer getRenderLayer() {
    return getRenderLayer(SpriteAtlasTexture.BLOCK_ATLAS_TEX);
}
 
Example #6
Source File: TextureStitchEvent.java    From patchwork-api with GNU Lesser General Public License v2.1 4 votes vote down vote up
public TextureStitchEvent(SpriteAtlasTexture map) {
	this.map = map;
}
 
Example #7
Source File: TextureStitchEvent.java    From patchwork-api with GNU Lesser General Public License v2.1 4 votes vote down vote up
public SpriteAtlasTexture getMap() {
	return map;
}
 
Example #8
Source File: TextureStitchEvent.java    From patchwork-api with GNU Lesser General Public License v2.1 4 votes vote down vote up
public Pre(SpriteAtlasTexture map, Set<Identifier> sprites) {
	super(map);
	this.sprites = sprites;
}
 
Example #9
Source File: TextureStitchEvent.java    From patchwork-api with GNU Lesser General Public License v2.1 4 votes vote down vote up
public Post(SpriteAtlasTexture map) {
	super(map);
}
 
Example #10
Source File: RenderEvents.java    From patchwork-api with GNU Lesser General Public License v2.1 4 votes vote down vote up
public static void onTextureStitchPre(SpriteAtlasTexture spriteAtlasTexture, Set<Identifier> set) {
	eventDispatcher.accept(new TextureStitchEvent.Pre(spriteAtlasTexture, set));
}
 
Example #11
Source File: RenderEvents.java    From patchwork-api with GNU Lesser General Public License v2.1 4 votes vote down vote up
public static void onTextureStitchPost(SpriteAtlasTexture spriteAtlasTexture) {
	eventDispatcher.accept(new TextureStitchEvent.Post(spriteAtlasTexture));
}
 
Example #12
Source File: MixinSpriteAtlasTexture.java    From patchwork-api with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Inject(method = "stitch", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/texture/SpriteAtlasTexture;loadSprites(Lnet/minecraft/resource/ResourceManager;Ljava/util/Set;)Ljava/util/Collection;", ordinal = 0), locals = LocalCapture.CAPTURE_FAILHARD)
private void onStitch(ResourceManager resourceManager, Iterable<Identifier> iterable, Profiler profiler, CallbackInfoReturnable<SpriteAtlasTexture.Data> cir, Set<Identifier> set) {
	RenderEvents.onTextureStitchPre((SpriteAtlasTexture) (Object) this, set);
}
 
Example #13
Source File: MixinSpriteAtlasTexture.java    From patchwork-api with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Inject(method = "upload", at = @At("RETURN"))
private void onUpload(SpriteAtlasTexture.Data data, CallbackInfo ci) {
	RenderEvents.onTextureStitchPost((SpriteAtlasTexture) (Object) this);
}