-
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
15 changed files
with
397 additions
and
81 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
37 changes: 37 additions & 0 deletions
37
src/main/java/mods/railcraft/client/gui/screen/inventory/DumpingTrackScreen.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,37 @@ | ||
package mods.railcraft.client.gui.screen.inventory; | ||
|
||
import mods.railcraft.Railcraft; | ||
import mods.railcraft.Translations; | ||
import mods.railcraft.client.util.GuiUtil; | ||
import mods.railcraft.world.inventory.DumpingTrackMenu; | ||
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 DumpingTrackScreen extends RailcraftMenuScreen<DumpingTrackMenu> { | ||
|
||
private static final ResourceLocation WIDGETS_TEXTURE_LOCATION = | ||
new ResourceLocation(Railcraft.ID, "textures/gui/container/dumping_track.png"); | ||
|
||
private static final Component FILTERS = | ||
Component.translatable(Translations.Screen.ITEM_MANIPULATOR_FILTERS); | ||
private static final Component CARTS = | ||
Component.translatable(Translations.Screen.CART_FILTERS); | ||
|
||
public DumpingTrackScreen(DumpingTrackMenu menu, Inventory inventory, Component title) { | ||
super(menu, inventory, title); | ||
} | ||
|
||
@Override | ||
public ResourceLocation getWidgetsTexture() { | ||
return WIDGETS_TEXTURE_LOCATION; | ||
} | ||
|
||
@Override | ||
protected void renderLabels(GuiGraphics guiGraphics, int mouseX, int mouseY) { | ||
super.renderLabels(guiGraphics, mouseX, mouseY); | ||
GuiUtil.drawCenteredString(guiGraphics, this.font, FILTERS, 250, 26); | ||
GuiUtil.drawCenteredString(guiGraphics, this.font, CARTS, 100, 35); | ||
} | ||
} |
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
26 changes: 26 additions & 0 deletions
26
src/main/java/mods/railcraft/world/inventory/DumpingTrackMenu.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,26 @@ | ||
package mods.railcraft.world.inventory; | ||
|
||
import mods.railcraft.world.inventory.slot.BlockFilterSlot; | ||
import mods.railcraft.world.inventory.slot.PhantomMinecartSlot; | ||
import mods.railcraft.world.level.block.entity.track.DumpingTrackBlockEntity; | ||
import net.minecraft.world.entity.player.Inventory; | ||
|
||
public class DumpingTrackMenu extends RailcraftMenu { | ||
|
||
public DumpingTrackMenu(int id, Inventory inventory, DumpingTrackBlockEntity blockEntity) { | ||
super(RailcraftMenuTypes.DUMPING_TRACK.get(), id, inventory.player, blockEntity::isStillValid); | ||
|
||
for (int i = 0; i < 3; i++) { | ||
this.addSlot(new PhantomMinecartSlot(blockEntity.getCartFilter(), i, 25 + i * 18, 45)); | ||
} | ||
|
||
for (int i = 0; i < 2; i++) { | ||
for (int j = 0; j < 3; j++) { | ||
this.addSlot(new BlockFilterSlot(blockEntity.getItemFilter(), i * 3 + j, | ||
98 + j * 18, 36 + i * 18)); | ||
} | ||
} | ||
|
||
this.addInventorySlots(inventory); | ||
} | ||
} |
Oops, something went wrong.