-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
40ccdb1
commit 6ae3676
Showing
72 changed files
with
472 additions
and
44 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
src/generated/resources/assets/malum/blockstates/soulwoven_banner_horns.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"variants": { | ||
"banner_type=hanging_x": { | ||
"model": "malum:block/soulwoven_banner", | ||
"y": 90 | ||
}, | ||
"banner_type=hanging_z": { | ||
"model": "malum:block/soulwoven_banner", | ||
"y": 180 | ||
}, | ||
"banner_type=mounted_east": { | ||
"model": "malum:block/soulwoven_banner_mounted", | ||
"y": 270 | ||
}, | ||
"banner_type=mounted_north": { | ||
"model": "malum:block/soulwoven_banner_mounted", | ||
"y": 180 | ||
}, | ||
"banner_type=mounted_south": { | ||
"model": "malum:block/soulwoven_banner_mounted" | ||
}, | ||
"banner_type=mounted_west": { | ||
"model": "malum:block/soulwoven_banner_mounted", | ||
"y": 90 | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/generated/resources/assets/malum/blockstates/soulwoven_banner_sigil.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"variants": { | ||
"banner_type=hanging_x": { | ||
"model": "malum:block/soulwoven_banner", | ||
"y": 90 | ||
}, | ||
"banner_type=hanging_z": { | ||
"model": "malum:block/soulwoven_banner", | ||
"y": 180 | ||
}, | ||
"banner_type=mounted_east": { | ||
"model": "malum:block/soulwoven_banner_mounted", | ||
"y": 270 | ||
}, | ||
"banner_type=mounted_north": { | ||
"model": "malum:block/soulwoven_banner_mounted", | ||
"y": 180 | ||
}, | ||
"banner_type=mounted_south": { | ||
"model": "malum:block/soulwoven_banner_mounted" | ||
}, | ||
"banner_type=mounted_west": { | ||
"model": "malum:block/soulwoven_banner_mounted", | ||
"y": 90 | ||
} | ||
} | ||
} |
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
6 changes: 6 additions & 0 deletions
6
src/generated/resources/assets/malum/models/item/soulwoven_banner_horns.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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"parent": "minecraft:item/generated", | ||
"textures": { | ||
"layer0": "malum:item/soulwoven_banner_horns" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
src/generated/resources/assets/malum/models/item/soulwoven_banner_sigil.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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"parent": "minecraft:item/generated", | ||
"textures": { | ||
"layer0": "malum:item/soulwoven_banner_sigil" | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...sets/malum/models/item/spirit_fabric.json → ...ets/malum/models/item/soulwoven_silk.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,6 @@ | ||
{ | ||
"parent": "minecraft:item/generated", | ||
"textures": { | ||
"layer0": "malum:item/spirit_fabric" | ||
"layer0": "malum:item/soulwoven_silk" | ||
} | ||
} |
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 |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
"conditions": { | ||
"items": [ | ||
{ | ||
"items": "malum:spirit_fabric" | ||
"items": "malum:soulwoven_silk" | ||
} | ||
] | ||
}, | ||
|
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
21 changes: 21 additions & 0 deletions
21
src/generated/resources/data/malum/loot_table/blocks/soulwoven_banner_horns.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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"type": "minecraft:block", | ||
"pools": [ | ||
{ | ||
"bonus_rolls": 0.0, | ||
"conditions": [ | ||
{ | ||
"condition": "minecraft:survives_explosion" | ||
} | ||
], | ||
"entries": [ | ||
{ | ||
"type": "minecraft:item", | ||
"name": "malum:soulwoven_banner_horns" | ||
} | ||
], | ||
"rolls": 1.0 | ||
} | ||
], | ||
"random_sequence": "malum:blocks/soulwoven_banner_horns" | ||
} |
21 changes: 21 additions & 0 deletions
21
src/generated/resources/data/malum/loot_table/blocks/soulwoven_banner_sigil.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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"type": "minecraft:block", | ||
"pools": [ | ||
{ | ||
"bonus_rolls": 0.0, | ||
"conditions": [ | ||
{ | ||
"condition": "minecraft:survives_explosion" | ||
} | ||
], | ||
"entries": [ | ||
{ | ||
"type": "minecraft:item", | ||
"name": "malum:soulwoven_banner_sigil" | ||
} | ||
], | ||
"rolls": 1.0 | ||
} | ||
], | ||
"random_sequence": "malum:blocks/soulwoven_banner_sigil" | ||
} |
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
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
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
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
67 changes: 67 additions & 0 deletions
67
src/main/java/com/sammy/malum/client/renderer/block/SoulwovenBannerRenderer.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,67 @@ | ||
package com.sammy.malum.client.renderer.block; | ||
|
||
import com.mojang.blaze3d.vertex.*; | ||
import com.mojang.math.*; | ||
import com.sammy.malum.*; | ||
import com.sammy.malum.client.*; | ||
import com.sammy.malum.common.block.curiosities.banner.*; | ||
import com.sammy.malum.common.block.curiosities.mana_mote.*; | ||
import com.sammy.malum.core.systems.spirit.*; | ||
import net.minecraft.client.renderer.*; | ||
import net.minecraft.client.renderer.blockentity.*; | ||
import net.minecraft.core.*; | ||
import net.minecraft.util.*; | ||
import net.minecraft.world.level.block.*; | ||
import net.minecraft.world.level.block.state.*; | ||
import org.joml.*; | ||
import team.lodestar.lodestone.registry.client.*; | ||
import team.lodestar.lodestone.systems.rendering.*; | ||
import team.lodestar.lodestone.systems.rendering.rendeertype.*; | ||
|
||
import java.lang.Math; | ||
|
||
import static com.sammy.malum.client.RenderUtils.*; | ||
|
||
|
||
public class SoulwovenBannerRenderer implements BlockEntityRenderer<SoulwovenBannerBlockEntity> { | ||
|
||
public SoulwovenBannerRenderer(BlockEntityRendererProvider.Context context) { | ||
} | ||
|
||
@Override | ||
public void render(SoulwovenBannerBlockEntity blockEntityIn, float partialTicks, PoseStack poseStack, MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn) { | ||
var blockState = blockEntityIn.getBlockState(); | ||
if (!(blockState.getBlock() instanceof SoulwovenBannerBlock block)) { | ||
return; | ||
} | ||
var pos = blockEntityIn.getBlockPos(); | ||
var type = blockState.getValue(SoulwovenBannerBlock.BANNER_TYPE); | ||
var direction = type.direction.getAxis().isVertical() ? type.equals(SoulwovenBannerBlock.BannerType.HANGING_Z) ? Direction.NORTH : Direction.WEST : type.direction; | ||
var builder = VFXBuilders.createWorld() | ||
.setRenderType(LodestoneRenderTypes.TRANSPARENT_TEXTURE.applyWithModifierAndCache(RenderTypeToken.createCachedToken(block.texture), b -> b.setCullState(RenderStateShard.NO_CULL))); | ||
float sway = ((float) Math.floorMod((pos.getX() * 7L + pos.getY() * 9L + pos.getZ() * 13L) + blockEntityIn.getLevel().getGameTime(), 100L) + partialTicks) / 100.0F; | ||
float swayRotation = (0.01F * Mth.cos((float) (Math.PI * 2) * sway)) * (float) Math.PI; | ||
|
||
poseStack.pushPose(); | ||
poseStack.translate(0.5f, 0.5f, 0.5f); | ||
poseStack.mulPose(Axis.YN.rotationDegrees(direction.toYRot())); | ||
poseStack.translate(-0.5f, -0.5f, -0.5f); | ||
if (type.direction.getAxis().isHorizontal()) { | ||
poseStack.translate(0, -0.25f, 0.0625f); | ||
swayRotation -= 0.0125f; | ||
} else { | ||
poseStack.translate(0, 0, 0.5f); | ||
swayRotation = swayRotation - 0.0157f; | ||
} | ||
poseStack.translate(0, 1f, 0); | ||
poseStack.mulPose(Axis.XP.rotation(swayRotation)); | ||
float xStart = 0; | ||
float xEnd = 1; | ||
float yStart = -2; | ||
float yEnd = 0; | ||
Vector3f[] vertices = new Vector3f[]{new Vector3f(xEnd, yStart, 0), new Vector3f(xStart, yStart, 0), new Vector3f(xStart, yEnd, 0), new Vector3f(xEnd, yEnd, 0)}; | ||
builder.renderQuad(poseStack, vertices, 1f); | ||
|
||
poseStack.popPose(); | ||
} | ||
} |
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
Oops, something went wrong.