-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add open eyeblossom and potted open eyeblossom.
- Loading branch information
Showing
5 changed files
with
105 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
chunky/src/java/se/llbit/chunky/block/minecraft/OpenEyeBlossom.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package se.llbit.chunky.block.minecraft; | ||
|
||
import se.llbit.chunky.block.MinecraftBlockTranslucent; | ||
import se.llbit.chunky.model.minecraft.SpriteModel; | ||
import se.llbit.chunky.renderer.scene.Scene; | ||
import se.llbit.chunky.resources.Texture; | ||
import se.llbit.chunky.world.Material; | ||
import se.llbit.chunky.world.material.TextureMaterial; | ||
import se.llbit.math.Ray; | ||
|
||
public class OpenEyeBlossom extends MinecraftBlockTranslucent { | ||
public static final Material emissiveMaterial = new TextureMaterial(Texture.openEyeblossomEmissive); | ||
private static final SpriteModel base = new SpriteModel(Texture.openEyeblossom, "up"); | ||
private static final SpriteModel emissive = new SpriteModel(Texture.openEyeblossomEmissive, "up"); | ||
|
||
public OpenEyeBlossom() { | ||
super("open_eyeblossom", Texture.openEyeblossom); | ||
localIntersect = true; | ||
} | ||
|
||
@Override | ||
public boolean intersect(Ray ray, Scene scene) { | ||
if (emissive.intersect(ray, scene)) { | ||
ray.setCurrentMaterial(emissiveMaterial); | ||
return true; | ||
} | ||
return base.intersect(ray, scene); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters