-
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 hanging signs (model still missing). * Update hanging sign models, add wall hanging sign. * Add uv maps and proper textures. * Add text to hanging signs. * Fix hanging sign text size and line height.
- Loading branch information
Showing
12 changed files
with
882 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package se.llbit.chunky.block; | ||
|
||
import se.llbit.chunky.entity.Entity; | ||
import se.llbit.chunky.entity.HangingSignEntity; | ||
import se.llbit.chunky.renderer.scene.Scene; | ||
import se.llbit.math.Ray; | ||
import se.llbit.math.Vector3; | ||
import se.llbit.nbt.CompoundTag; | ||
|
||
public class HangingSign extends MinecraftBlockTranslucent { | ||
private final String material; | ||
private final int rotation; | ||
private final boolean attached; | ||
|
||
public HangingSign(String name, String material, int rotation, boolean attached) { | ||
super(name, HangingSignEntity.textureFromMaterial(material)); | ||
this.material = material; | ||
this.rotation = rotation; | ||
this.attached = attached; | ||
invisible = true; | ||
solid = false; | ||
localIntersect = true; | ||
} | ||
|
||
@Override | ||
public boolean intersect(Ray ray, Scene scene) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean isBlockEntity() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public Entity toBlockEntity(Vector3 position, CompoundTag entityTag) { | ||
return new HangingSignEntity(position, entityTag, rotation, attached, material); | ||
} | ||
} |
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
71 changes: 71 additions & 0 deletions
71
chunky/src/java/se/llbit/chunky/block/WallHangingSign.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,71 @@ | ||
package se.llbit.chunky.block; | ||
|
||
import se.llbit.chunky.entity.Entity; | ||
import se.llbit.chunky.entity.HangingSignEntity; | ||
import se.llbit.chunky.entity.WallHangingSignEntity; | ||
import se.llbit.chunky.renderer.scene.Scene; | ||
import se.llbit.math.Ray; | ||
import se.llbit.math.Vector3; | ||
import se.llbit.nbt.CompoundTag; | ||
|
||
public class WallHangingSign extends MinecraftBlockTranslucent { | ||
private final String material; | ||
private final Facing facing; | ||
|
||
public WallHangingSign(String name, String material, String facing) { | ||
super(name, HangingSignEntity.textureFromMaterial(material)); | ||
this.material = material; | ||
this.facing = Facing.fromString(facing); | ||
invisible = true; | ||
solid = false; | ||
localIntersect = true; | ||
} | ||
|
||
@Override | ||
public boolean intersect(Ray ray, Scene scene) { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean isBlockEntity() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public Entity toBlockEntity(Vector3 position, CompoundTag entityTag) { | ||
return new WallHangingSignEntity(position, entityTag, facing, material); | ||
} | ||
|
||
public enum Facing { | ||
NORTH, EAST, SOUTH, WEST; | ||
|
||
public static Facing fromString(String facing) { | ||
switch (facing) { | ||
case "east": | ||
return EAST; | ||
case "south": | ||
return SOUTH; | ||
case "west": | ||
return WEST; | ||
case "north": | ||
default: | ||
return NORTH; | ||
} | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
switch (this) { | ||
case EAST: | ||
return "east"; | ||
case SOUTH: | ||
return "south"; | ||
case WEST: | ||
return "west"; | ||
case NORTH: | ||
default: | ||
return "north"; | ||
} | ||
} | ||
} | ||
} |
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
Oops, something went wrong.