-
Notifications
You must be signed in to change notification settings - Fork 14
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
Showing
39 changed files
with
451 additions
and
87 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
src/generated/resources/.cache/8d2d12b1afa7ce5215f596487c98e31b6ceb5491
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.20.1 2023-06-29T09:27:06.401274 atlases generator for railcraft | ||
b73fc94a6ff6a47ae7916b24e9f0a7f7ba2bd7fd assets/minecraft/atlases/blocks.json | ||
// 1.20.1 2024-03-14T09:36:47.045308 atlases generator for railcraft | ||
5d6c5eb6b85c11266e4fb7771a607f15e770cf62 assets/minecraft/atlases/blocks.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
4 changes: 2 additions & 2 deletions
4
src/generated/resources/.cache/c622617f6fabf890a00b9275cd5f643584a8a2c8
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.20.1 2024-03-13T13:11:54.703285 Languages: en_us | ||
05e8a7cd6ca20cd8f6103a563640bbf6779668a8 assets/railcraft/lang/en_us.json | ||
// 1.20.1 2024-03-14T10:02:21.002961 Languages: en_us | ||
fafdc29c1651188bf7e6cd558f854b196852895b assets/railcraft/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
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/railcraft/models/item/energy_minecart.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": "railcraft:item/energy_minecart" | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
src/generated/resources/data/railcraft/advancements/recipes/misc/energy_minecart.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,35 @@ | ||
{ | ||
"parent": "minecraft:recipes/root", | ||
"criteria": { | ||
"has_lead_ingot": { | ||
"conditions": { | ||
"items": [ | ||
{ | ||
"items": [ | ||
"railcraft:lead_ingot" | ||
] | ||
} | ||
] | ||
}, | ||
"trigger": "minecraft:inventory_changed" | ||
}, | ||
"has_the_recipe": { | ||
"conditions": { | ||
"recipe": "railcraft:energy_minecart" | ||
}, | ||
"trigger": "minecraft:recipe_unlocked" | ||
} | ||
}, | ||
"requirements": [ | ||
[ | ||
"has_lead_ingot", | ||
"has_the_recipe" | ||
] | ||
], | ||
"rewards": { | ||
"recipes": [ | ||
"railcraft:energy_minecart" | ||
] | ||
}, | ||
"sends_telemetry_event": false | ||
} |
24 changes: 24 additions & 0 deletions
24
src/generated/resources/data/railcraft/recipes/energy_minecart.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,24 @@ | ||
{ | ||
"type": "minecraft:crafting_shaped", | ||
"category": "misc", | ||
"key": { | ||
"a": { | ||
"tag": "forge:ingots/lead" | ||
}, | ||
"b": { | ||
"item": "minecraft:redstone_block" | ||
}, | ||
"c": { | ||
"item": "minecraft:minecart" | ||
} | ||
}, | ||
"pattern": [ | ||
"aba", | ||
"bcb", | ||
"aba" | ||
], | ||
"result": { | ||
"item": "railcraft:energy_minecart" | ||
}, | ||
"show_notification": true | ||
} |
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
33 changes: 33 additions & 0 deletions
33
src/main/java/mods/railcraft/client/gui/screen/inventory/EnergyMinecartScreen.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,33 @@ | ||
package mods.railcraft.client.gui.screen.inventory; | ||
|
||
import mods.railcraft.api.core.RailcraftConstants; | ||
import mods.railcraft.client.gui.screen.IngameWindowScreen; | ||
import mods.railcraft.client.gui.screen.inventory.widget.GaugeRenderer; | ||
import mods.railcraft.world.inventory.EnergyMinecartMenu; | ||
import net.minecraft.client.gui.GuiGraphics; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.world.entity.player.Inventory; | ||
|
||
public class EnergyMinecartScreen extends RailcraftMenuScreen<EnergyMinecartMenu> { | ||
|
||
private static final ResourceLocation WIDGETS_TEXTURE_LOCATION = | ||
RailcraftConstants.rl("textures/gui/container/energy_minecart.png"); | ||
|
||
public EnergyMinecartScreen(EnergyMinecartMenu menu, Inventory inventory, | ||
Component title) { | ||
super(menu, inventory, title); | ||
this.registerWidgetRenderer(new GaugeRenderer(menu.getEnergyGauge())); | ||
} | ||
|
||
@Override | ||
protected void renderLabels(GuiGraphics guiGraphics, int mouseX, int mouseY) { | ||
guiGraphics.drawString(this.font, this.title, this.titleLabelX, this.titleLabelY, | ||
IngameWindowScreen.TEXT_COLOR, false); | ||
} | ||
|
||
@Override | ||
public ResourceLocation getWidgetsTexture() { | ||
return WIDGETS_TEXTURE_LOCATION; | ||
} | ||
} |
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
88 changes: 88 additions & 0 deletions
88
src/main/java/mods/railcraft/client/renderer/entity/cart/EnergyMinecartRenderer.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,88 @@ | ||
package mods.railcraft.client.renderer.entity.cart; | ||
|
||
import com.mojang.blaze3d.vertex.PoseStack; | ||
import mods.railcraft.api.core.RailcraftConstants; | ||
import mods.railcraft.client.model.LowSidesMinecartModel; | ||
import mods.railcraft.client.model.RailcraftModelLayers; | ||
import mods.railcraft.client.util.CuboidModel; | ||
import mods.railcraft.client.util.CuboidModelRenderer; | ||
import mods.railcraft.world.entity.vehicle.EnergyMinecart; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.model.EntityModel; | ||
import net.minecraft.client.renderer.MultiBufferSource; | ||
import net.minecraft.client.renderer.RenderType; | ||
import net.minecraft.client.renderer.entity.EntityRendererProvider; | ||
import net.minecraft.client.renderer.texture.OverlayTexture; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.world.inventory.InventoryMenu; | ||
|
||
public class EnergyMinecartRenderer extends ContentsMinecartRenderer<EnergyMinecart> { | ||
|
||
private static final ResourceLocation FRAME = | ||
RailcraftConstants.rl("entity/minecart/energy_minecart_flux_frame"); | ||
|
||
private static final ResourceLocation CORE = | ||
RailcraftConstants.rl("entity/minecart/energy_minecart_flux_core"); | ||
|
||
private static final float PIXEL_OFFSET = 0.5F / 16F; | ||
|
||
private static final CuboidModel FRAME_MODEL = | ||
new CuboidModel(PIXEL_OFFSET, PIXEL_OFFSET, PIXEL_OFFSET, | ||
1 - PIXEL_OFFSET, 1 - PIXEL_OFFSET, 1 - PIXEL_OFFSET); | ||
|
||
private static final CuboidModel CORE_MODEL = | ||
new CuboidModel(1 / 16F, 1 / 16F, 1 / 16F, 15 / 16F, 15 / 16F, 15 / 16F); | ||
|
||
private final LowSidesMinecartModel<EnergyMinecart> bodyModel; | ||
private final LowSidesMinecartModel<EnergyMinecart> snowModel; | ||
|
||
public EnergyMinecartRenderer(EntityRendererProvider.Context context) { | ||
super(context); | ||
this.bodyModel = new LowSidesMinecartModel<>( | ||
context.bakeLayer(RailcraftModelLayers.LOW_SIDES_MINECART)); | ||
this.snowModel = new LowSidesMinecartModel<>( | ||
context.bakeLayer(RailcraftModelLayers.LOW_SIDES_MINECART_SNOW)); | ||
} | ||
|
||
@Override | ||
protected void renderContents(EnergyMinecart cart, float partialTicks, PoseStack poseStack, | ||
MultiBufferSource bufferSource, int packedLight, float red, float green, float blue, | ||
float alpha) { | ||
var minecraft = Minecraft.getInstance(); | ||
|
||
CuboidModel.Face frameFace = FRAME_MODEL.new Face() | ||
.setSprite(minecraft.getTextureAtlas(InventoryMenu.BLOCK_ATLAS) | ||
.apply(FRAME)); | ||
|
||
CuboidModel.Face coreFace = CORE_MODEL.new Face() | ||
.setSprite(minecraft.getTextureAtlas(InventoryMenu.BLOCK_ATLAS) | ||
.apply(CORE)); | ||
|
||
FRAME_MODEL.setAll(frameFace); | ||
FRAME_MODEL.setPackedLight(packedLight); | ||
FRAME_MODEL.setPackedOverlay(OverlayTexture.NO_OVERLAY); | ||
|
||
CORE_MODEL.setAll(coreFace); | ||
CORE_MODEL.setPackedLight(packedLight); | ||
CORE_MODEL.setPackedOverlay(OverlayTexture.NO_OVERLAY); | ||
|
||
poseStack.pushPose(); | ||
var vertexBuilder = | ||
bufferSource.getBuffer(RenderType.entityCutout(InventoryMenu.BLOCK_ATLAS)); | ||
CuboidModelRenderer.render(FRAME_MODEL, poseStack, vertexBuilder, 0xFFFFFFFF, | ||
CuboidModelRenderer.FaceDisplay.BOTH, false); | ||
CuboidModelRenderer.render(CORE_MODEL, poseStack, vertexBuilder, 0xFFFFFFFF, | ||
CuboidModelRenderer.FaceDisplay.BOTH, false); | ||
poseStack.popPose(); | ||
} | ||
|
||
@Override | ||
protected EntityModel<? super EnergyMinecart> getBodyModel(EnergyMinecart cart) { | ||
return this.bodyModel; | ||
} | ||
|
||
@Override | ||
protected EntityModel<? super EnergyMinecart> getSnowModel(EnergyMinecart cart) { | ||
return this.snowModel; | ||
} | ||
} |
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.