-
Notifications
You must be signed in to change notification settings - Fork 55
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
27c57d1
commit fdc5f07
Showing
27 changed files
with
502 additions
and
457 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
3 changes: 2 additions & 1 deletion
3
src/generated/resources/data/vampirism/vampirism/convertibles/minecraft/cow.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,6 +1,7 @@ | ||
{ | ||
"handler": { | ||
"type": "vampirism:cow" | ||
"type": "vampirism:special", | ||
"converted_type": "vampirism:converted_cow" | ||
}, | ||
"overlay": "vampirism:textures/entity/vanilla/cow_overlay.png" | ||
} |
3 changes: 2 additions & 1 deletion
3
src/generated/resources/data/vampirism/vampirism/convertibles/minecraft/sheep.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,6 +1,7 @@ | ||
{ | ||
"handler": { | ||
"type": "vampirism:sheep" | ||
"type": "vampirism:special", | ||
"converted_type": "vampirism:converted_sheep" | ||
}, | ||
"overlay": "vampirism:textures/entity/vanilla/sheep_overlay.png" | ||
} |
6 changes: 4 additions & 2 deletions
6
src/generated/resources/data/vampirism/vampirism/convertibles/minecraft/villager.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,7 @@ | ||
{ | ||
"handler": { | ||
"type": "vampirism:villager" | ||
} | ||
"type": "vampirism:special", | ||
"converted_type": "vampirism:villager_converted" | ||
}, | ||
"overlay": "vampirism:textures/entity/vanilla/villager_overlay_overlay.png" | ||
} |
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
14 changes: 0 additions & 14 deletions
14
src/main/java/de/teamlapen/vampirism/client/renderer/entity/ConvertedFoxRenderer.java
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
src/main/java/de/teamlapen/vampirism/client/renderer/entity/ConvertedGoatRenderer.java
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
src/main/java/de/teamlapen/vampirism/client/renderer/entity/ConvertedVillagerRenderer.java
This file was deleted.
Oops, something went wrong.
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
43 changes: 43 additions & 0 deletions
43
...ava/de/teamlapen/vampirism/client/renderer/entity/layers/ConvertedVampireEntityLayer.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,43 @@ | ||
package de.teamlapen.vampirism.client.renderer.entity.layers; | ||
|
||
import com.mojang.blaze3d.vertex.PoseStack; | ||
import de.teamlapen.vampirism.client.renderer.entity.ConvertedCreatureRenderer; | ||
import de.teamlapen.vampirism.entity.ConvertedCreature; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.model.EntityModel; | ||
import net.minecraft.client.renderer.MultiBufferSource; | ||
import net.minecraft.client.renderer.entity.RenderLayerParent; | ||
import net.minecraft.client.renderer.entity.layers.RenderLayer; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.world.entity.LivingEntity; | ||
import net.minecraftforge.api.distmarker.Dist; | ||
import net.minecraftforge.api.distmarker.OnlyIn; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
/** | ||
* Render the vampire overlay for converted creatures | ||
*/ | ||
@OnlyIn(Dist.CLIENT) | ||
public class ConvertedVampireEntityLayer<T extends LivingEntity, U extends EntityModel<T>> extends RenderLayer<T, U> { | ||
|
||
private final boolean checkIfRender; | ||
|
||
/** | ||
* @param checkIfRender If it should check if {@link ConvertedCreatureRenderer#renderOverlay} is true | ||
*/ | ||
public ConvertedVampireEntityLayer(@NotNull RenderLayerParent<T, U> entityRendererIn, boolean checkIfRender) { | ||
super(entityRendererIn); | ||
this.checkIfRender = checkIfRender; | ||
} | ||
|
||
@Override | ||
public void render(@NotNull PoseStack matrixStack, @NotNull MultiBufferSource iRenderTypeBuffer, int i, @NotNull T entity, float v, float v1, float v2, float v3, float v4, float v5) { | ||
if (entity instanceof ConvertedCreature<?> converted && !entity.isInvisible() && (!checkIfRender || ConvertedCreatureRenderer.renderOverlay)) { | ||
ResourceLocation texture = converted.data().texture; | ||
//noinspection ConstantValue,DataFlowIssue | ||
if (texture != null && Minecraft.getInstance().textureManager.getTexture(texture, null) != null) { | ||
renderColoredCutoutModel(this.getParentModel(), texture, matrixStack, iRenderTypeBuffer, i, entity, 1, 1, 1); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.