-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
db09298
commit bb95be0
Showing
5 changed files
with
57 additions
and
3 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
39 changes: 39 additions & 0 deletions
39
core/src/main/java/de/bluecolored/bluemap/core/map/hires/entity/OcelotRenderer.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,39 @@ | ||
package de.bluecolored.bluemap.core.map.hires.entity; | ||
|
||
import de.bluecolored.bluemap.core.map.TextureGallery; | ||
import de.bluecolored.bluemap.core.map.hires.RenderSettings; | ||
import de.bluecolored.bluemap.core.map.hires.TileModelView; | ||
import de.bluecolored.bluemap.core.resources.ResourcePath; | ||
import de.bluecolored.bluemap.core.resources.pack.resourcepack.ResourcePack; | ||
import de.bluecolored.bluemap.core.resources.pack.resourcepack.entitystate.Part; | ||
import de.bluecolored.bluemap.core.resources.pack.resourcepack.model.Model; | ||
import de.bluecolored.bluemap.core.util.Key; | ||
import de.bluecolored.bluemap.core.world.Entity; | ||
import de.bluecolored.bluemap.core.world.block.BlockNeighborhood; | ||
import de.bluecolored.bluemap.core.world.mca.entity.Ocelot; | ||
|
||
public class OcelotRenderer extends ResourceModelRenderer { | ||
|
||
private final ResourcePath<Model> | ||
OCELOT = new ResourcePath<>(Key.MINECRAFT_NAMESPACE, "entity/cat/cat_ocelot"); | ||
|
||
public OcelotRenderer(ResourcePack resourcePack, TextureGallery textureGallery, RenderSettings renderSettings) { | ||
super(resourcePack, textureGallery, renderSettings); | ||
} | ||
|
||
@Override | ||
public void render(Entity entity, BlockNeighborhood block, Part part, TileModelView tileModel) { | ||
if (!(entity instanceof Ocelot ocelot)) return; | ||
|
||
// choose correct model | ||
ResourcePath<Model> model = OCELOT; | ||
|
||
// render chosen model | ||
super.render(entity, block, model.getResource(resourcePack::getModel), TintColorProvider.NO_TINT, tileModel); | ||
|
||
// apply part transform | ||
if (part.isTransformed()) | ||
tileModel.transform(part.getTransformMatrix()); | ||
} | ||
|
||
} |
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
15 changes: 15 additions & 0 deletions
15
core/src/main/java/de/bluecolored/bluemap/core/world/mca/entity/Ocelot.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,15 @@ | ||
package de.bluecolored.bluemap.core.world.mca.entity; | ||
|
||
import de.bluecolored.bluenbt.NBTName; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.ToString; | ||
|
||
@Getter | ||
@EqualsAndHashCode(callSuper = true) | ||
@ToString | ||
@SuppressWarnings("FieldMayBeFinal") | ||
public class Ocelot extends AgeEntity { | ||
|
||
@NBTName("Sitting") int sitting; | ||
} |
2 changes: 1 addition & 1 deletion
2
core/src/main/resourceExtensions/assets/minecraft/entitystates/ocelot.json
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"parts": [ | ||
{ "model": "minecraft:entity/cat/cat_ocelot" } | ||
{ "renderer": "minecraft:ocelot" } | ||
] | ||
} |