generated from NeoForgeMDKs/MDK-1.21-NeoGradle
-
Notifications
You must be signed in to change notification settings - Fork 0
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
MCZME
committed
Aug 26, 2024
1 parent
144699c
commit fc3943a
Showing
23 changed files
with
324 additions
and
54 deletions.
There are no files selected for viewing
3 changes: 2 additions & 1 deletion
3
src/generated/resources/.cache/71e72dbdeb626cc835aaccd2ae47fd3d8794cd24
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
20 changes: 10 additions & 10 deletions
20
src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e
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: 3 additions & 0 deletions
3
src/generated/resources/assets/lingshi/models/item/cooking_pot.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,3 @@ | ||
{ | ||
"parent": "lingshi:block/cooking_pot" | ||
} |
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": "minecraft:baked_potato" | ||
"items": "lingshi:skillet" | ||
} | ||
] | ||
}, | ||
|
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": "minecraft:cooked_beef" | ||
"items": "lingshi:skillet" | ||
} | ||
] | ||
}, | ||
|
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": "minecraft:cooked_chicken" | ||
"items": "lingshi:skillet" | ||
} | ||
] | ||
}, | ||
|
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": "minecraft:cooked_cod" | ||
"items": "lingshi:skillet" | ||
} | ||
] | ||
}, | ||
|
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": "minecraft:cooked_mutton" | ||
"items": "lingshi:skillet" | ||
} | ||
] | ||
}, | ||
|
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": "minecraft:cooked_porkchop" | ||
"items": "lingshi:skillet" | ||
} | ||
] | ||
}, | ||
|
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": "minecraft:cooked_rabbit" | ||
"items": "lingshi:skillet" | ||
} | ||
] | ||
}, | ||
|
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": "minecraft:cooked_salmon" | ||
"items": "lingshi:skillet" | ||
} | ||
] | ||
}, | ||
|
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": "lingshi:fried_egg" | ||
"items": "lingshi:skillet" | ||
} | ||
] | ||
}, | ||
|
49 changes: 49 additions & 0 deletions
49
src/main/java/mczme/lingshi/client/BlockEntityRenderer/CookingPotBER.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,49 @@ | ||
package mczme.lingshi.client.BlockEntityRenderer; | ||
|
||
import com.mojang.blaze3d.vertex.PoseStack; | ||
import com.mojang.math.Axis; | ||
import mczme.lingshi.common.block.ChoppingBoardBlock; | ||
import mczme.lingshi.common.block.entity.CookingPotBlockEntity; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.renderer.MultiBufferSource; | ||
import net.minecraft.client.renderer.blockentity.BlockEntityRenderer; | ||
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; | ||
import net.minecraft.core.Direction; | ||
import net.minecraft.world.item.ItemDisplayContext; | ||
import net.neoforged.neoforge.fluids.FluidStack; | ||
import net.neoforged.neoforge.items.ItemStackHandler; | ||
|
||
import static mczme.lingshi.client.util.RenderUtil.fluidRender; | ||
import static mczme.lingshi.common.block.CookingPotBlock.COVER; | ||
|
||
public class CookingPotBER implements BlockEntityRenderer<CookingPotBlockEntity> { | ||
|
||
public CookingPotBER(BlockEntityRendererProvider.Context pContext) { | ||
|
||
} | ||
|
||
@Override | ||
public void render(CookingPotBlockEntity pBlockEntity, float pPartialTick, PoseStack pPoseStack, MultiBufferSource pBufferSource, int pPackedLight, int pPackedOverlay) { | ||
if(!pBlockEntity.getBlockState().getValue(COVER)){ | ||
ItemStackHandler itemStack = pBlockEntity.getItemStacks(); | ||
FluidStack fluidStack = pBlockEntity.getFluid(); | ||
Direction direction = pBlockEntity.getBlockState().getValue(ChoppingBoardBlock.FACING); | ||
|
||
if (!pBlockEntity.isEmpty()) { | ||
if (!fluidStack.isEmpty()) { | ||
fluidRender(fluidStack.getFluid(), pPoseStack, pBufferSource, pBlockEntity.getLevel(), pBlockEntity.getBlockPos(), pPackedLight, new float[]{10F/16.0F,16/16.0F,10F/16.0F,5F/16.0F,5F/16.0F,11F}); | ||
} | ||
|
||
for (int i = 0; i < pBlockEntity.getMAX(); i++) { | ||
if (itemStack.getStackInSlot(i).isEmpty()) continue; | ||
pPoseStack.pushPose(); | ||
pPoseStack.translate(0.5, 0.2 + i / 16.0, 0.5); | ||
pPoseStack.mulPose(Axis.YP.rotationDegrees(-direction.toYRot())); | ||
pPoseStack.scale(0.5F, 0.5F, 0.5F); | ||
Minecraft.getInstance().getItemRenderer().renderStatic(itemStack.getStackInSlot(i), ItemDisplayContext.FIXED, pPackedLight, pPackedOverlay, pPoseStack, pBufferSource, pBlockEntity.getLevel(), (int) pBlockEntity.getBlockPos().asLong()); | ||
pPoseStack.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
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.