Giter VIP home page Giter VIP logo

mirage's Introduction

Mirage

>> Jenkins (Downloads) <<

Neat rendering tricks with an API.

Mirage is a library and coremod containing some neat rendering tricks for use in any mod. It started life as an update of Elucent's Albedo to 1.12 (best known for the lighting effects in Embers), and is slowly becoming a more complete render tweaks library.

The library was renamed from Albedo to Mirage to avoid naming conflicts after Elucent picked Albedo back up. Mirage's API is intentionally incompatible with Albedo as a result.

Usage

First off, add the Elytra Maven to your build.gradle:

repositories {
	maven {
		url = 'https://repo.elytradev.com/'
	}
}

Then, add this to your dependencies block:

compile 'com.elytradev:mirage:2.0.3-rc3-SNAPSHOT'

Switch to the 1.11.2 branch for 1.11.2 instructions, which are for Albedo post-fork instead of Mirage. You may also want to try just using Albedo pre-fork.

Note: If you get a 'peer not authenticated' error, you need to update Gradle. Older versions of Gradle include a broken Apache HttpClient that doesn't support our HTTPS certificate.

Finally, you can do something similar to this for any TileEntity:

import net.minecraftforge.fml.common.Optional;

@Optional.Interface(iface="com.elytradev.mirage.lighting.ILightEventConsumer", modid="mirage")
public class MyTileEntity extends TileEntity implements ILightEventConsumer {
	
	@Optional.Method(modid="mirage")
	@Override
	public void gatherLights(GatherLightsEvent evt) {
		evt.add( Light.builder()
				.pos(/* ... */)
				.color(1, 1, 1)
				.radius(2)
				.build());
	}
	
}

Or this for any Item or Entity:

import net.minecraftforge.fml.common.Optional;

@Optional.Interface(iface="com.elytradev.mirage.lighting.IEntityLightEventConsumer", modid="mirage")
public class MyItem extends Item implements IEntityLightEventConsumer {
	
	@Optional.Method(modid="mirage")
	@Override
	public void gatherLights(GatherLightsEvent evt, Entity e) {
		evt.add( Light.builder()
				.pos(/* ... */)
				.color(1, 1, 1)
				.radius(2)
				.build());
	}
	
}

The @Optionals let people use your mod without needing to install Mirage. Your mod will take advantage of Mirage when possible.

If you need more control, listen for the GatherLightsEvent and add your own Light object.

mirage's People

Contributors

asiekierka avatar falkreon avatar jamierocks avatar unascribed avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.