generated from neoforged/MDK
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experience Holder Blocks/BE/Container/Screen/etc
- Loading branch information
1 parent
d1b5430
commit 8ca3661
Showing
31 changed files
with
1,301 additions
and
14 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
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
4 changes: 2 additions & 2 deletions
4
src/generated/resources/.cache/8202586f691eec5ad0bb88d13a278951d0c130fb
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,2 +1,2 @@ | ||
// 1.21.1 2024-09-08T10:48:40.1210526 Languages: en_us for mod: justdirethings | ||
d5878f400337646026ccd4b5a26fd0191197b510 assets/justdirethings/lang/en_us.json | ||
// 1.21.1 2024-09-12T11:15:53.905581 Languages: en_us for mod: justdirethings | ||
80317086157715c924dcacf357e72efab49d8580 assets/justdirethings/lang/en_us.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
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/justdirethings/models/item/experienceholder.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": "justdirethings:block/experienceholder" | ||
} |
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
32 changes: 32 additions & 0 deletions
32
src/generated/resources/data/justdirethings/advancement/recipes/misc/experienceholder.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,32 @@ | ||
{ | ||
"parent": "minecraft:recipes/root", | ||
"criteria": { | ||
"has_blazegold_ingot": { | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"items": "justdirethings:blazegold_ingot" | ||
} | ||
] | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
}, | ||
"has_the_recipe": { | ||
"conditions": { | ||
"recipe": "justdirethings:experienceholder" | ||
}, | ||
"trigger": "minecraft:recipe_unlocked" | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"has_the_recipe", | ||
"has_blazegold_ingot" | ||
] | ||
], | ||
"rewards": { | ||
"recipes": [ | ||
"justdirethings:experienceholder" | ||
] | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
...ted/resources/data/justdirethings/advancement/recipes/misc/experienceholder_nbtclear.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,32 @@ | ||
{ | ||
"parent": "minecraft:recipes/root", | ||
"criteria": { | ||
"has_experienceholder": { | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"items": "justdirethings:experienceholder" | ||
} | ||
] | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
}, | ||
"has_the_recipe": { | ||
"conditions": { | ||
"recipe": "justdirethings:experienceholder_nbtclear" | ||
}, | ||
"trigger": "minecraft:recipe_unlocked" | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"has_the_recipe", | ||
"has_experienceholder" | ||
] | ||
], | ||
"rewards": { | ||
"recipes": [ | ||
"justdirethings:experienceholder_nbtclear" | ||
] | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
src/generated/resources/data/justdirethings/loot_table/blocks/experienceholder.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": "justdirethings:experienceholder" | ||
} | ||
], | ||
"rolls": 1.0 | ||
} | ||
], | ||
"random_sequence": "justdirethings:blocks/experienceholder" | ||
} |
28 changes: 28 additions & 0 deletions
28
src/generated/resources/data/justdirethings/recipe/experienceholder.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,28 @@ | ||
{ | ||
"type": "minecraft:crafting_shaped", | ||
"category": "misc", | ||
"group": "justdirethings", | ||
"key": { | ||
"d": { | ||
"item": "minecraft:emerald" | ||
}, | ||
"e": { | ||
"item": "minecraft:ender_pearl" | ||
}, | ||
"f": { | ||
"item": "justdirethings:blazegold_ingot" | ||
}, | ||
"h": { | ||
"item": "minecraft:book" | ||
} | ||
}, | ||
"pattern": [ | ||
" d ", | ||
"heh", | ||
"fff" | ||
], | ||
"result": { | ||
"count": 1, | ||
"id": "justdirethings:experienceholder" | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/generated/resources/data/justdirethings/recipe/experienceholder_nbtclear.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,14 @@ | ||
{ | ||
"type": "minecraft:crafting_shapeless", | ||
"category": "misc", | ||
"group": "justdirethings", | ||
"ingredients": [ | ||
{ | ||
"item": "justdirethings:experienceholder" | ||
} | ||
], | ||
"result": { | ||
"count": 1, | ||
"id": "justdirethings:experienceholder" | ||
} | ||
} |
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
49 changes: 49 additions & 0 deletions
49
...ain/java/com/direwolf20/justdirethings/client/blockentityrenders/ExperienceHolderBER.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 com.direwolf20.justdirethings.client.blockentityrenders; | ||
|
||
import com.direwolf20.justdirethings.client.blockentityrenders.baseber.AreaAffectingBER; | ||
import com.direwolf20.justdirethings.common.blockentities.ExperienceHolderBE; | ||
import com.mojang.blaze3d.vertex.PoseStack; | ||
import com.mojang.math.Axis; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.renderer.LightTexture; | ||
import net.minecraft.client.renderer.MultiBufferSource; | ||
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; | ||
import net.minecraft.client.renderer.entity.ItemRenderer; | ||
import net.minecraft.core.Direction; | ||
import net.minecraft.world.item.ItemDisplayContext; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.item.Items; | ||
import net.minecraft.world.level.block.entity.BlockEntity; | ||
import net.minecraft.world.level.block.state.properties.BlockStateProperties; | ||
|
||
public class ExperienceHolderBER extends AreaAffectingBER { | ||
public static final ItemStack itemStack = new ItemStack(Items.EXPERIENCE_BOTTLE); | ||
|
||
public ExperienceHolderBER(BlockEntityRendererProvider.Context context) { | ||
|
||
} | ||
|
||
@Override | ||
public void render(BlockEntity blockentity, float partialTicks, PoseStack matrixStackIn, MultiBufferSource bufferIn, int combinedLightsIn, int combinedOverlayIn) { | ||
super.render(blockentity, partialTicks, matrixStackIn, bufferIn, combinedLightsIn, combinedOverlayIn); | ||
if (blockentity instanceof ExperienceHolderBE experienceHolderBE) | ||
this.renderItemStack(experienceHolderBE, matrixStackIn, bufferIn, combinedOverlayIn); | ||
} | ||
|
||
private void renderItemStack(ExperienceHolderBE blockEntity, PoseStack poseStack, MultiBufferSource bufferIn, int combinedOverlayIn) { | ||
ItemRenderer itemRenderer = Minecraft.getInstance().getItemRenderer(); | ||
Direction direction = blockEntity.getBlockState().getValue(BlockStateProperties.FACING).getOpposite(); | ||
long millis = System.currentTimeMillis(); | ||
|
||
poseStack.pushPose(); | ||
poseStack.translate(0.5f + (direction.getStepX() * 0.3f), 0.5f + (direction.getStepY() * 0.3f), 0.5f + (direction.getStepZ() * 0.3f)); | ||
poseStack.mulPose(Axis.XP.rotationDegrees(direction.getStepZ() * -90)); | ||
poseStack.mulPose(Axis.ZP.rotationDegrees(direction.getStepX() * 90)); | ||
poseStack.mulPose(Axis.XP.rotationDegrees(direction.getStepY() == 1 ? 0 : 180)); | ||
float angle = ((millis / 15) % 360); | ||
poseStack.mulPose(Axis.YP.rotationDegrees(angle)); | ||
poseStack.scale(.15f, .15f, .15f); | ||
itemRenderer.renderStatic(itemStack, ItemDisplayContext.FIXED, LightTexture.FULL_BRIGHT, combinedOverlayIn, poseStack, bufferIn, Minecraft.getInstance().level, 0); | ||
poseStack.popPose(); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/com/direwolf20/justdirethings/client/screens/ExperienceHolderScreen.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,17 @@ | ||
package com.direwolf20.justdirethings.client.screens; | ||
|
||
import com.direwolf20.justdirethings.client.screens.basescreens.BaseMachineScreen; | ||
import com.direwolf20.justdirethings.common.containers.ExperienceHolderContainer; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.world.entity.player.Inventory; | ||
|
||
public class ExperienceHolderScreen extends BaseMachineScreen<ExperienceHolderContainer> { | ||
public ExperienceHolderScreen(ExperienceHolderContainer container, Inventory inv, Component name) { | ||
super(container, inv, name); | ||
} | ||
|
||
@Override | ||
public void init() { | ||
super.init(); | ||
} | ||
} |
Oops, something went wrong.