Skip to content

Commit

Permalink
Add images for education area
Browse files Browse the repository at this point in the history
  • Loading branch information
Gegy committed Nov 18, 2024
1 parent 24a62ac commit 8484239
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/main/java/com/lovetropics/extras/item/ImageItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,25 @@ public class ImageItem extends Item {
new ImageData(Component.literal("[Redacted]"), LTExtras.location("textures/images/ccfucc_banner.png"), 3.0f, 5.0f),
new ImageData(Component.literal("Plantain Ent"), LTExtras.location("textures/images/plantain_ent.png"), 2.5f, 3.0f),
new ImageData(Component.literal("Manatee"), LTExtras.location("textures/images/manatee.png"), 2.5f, 3.0f),
new ImageData(Component.literal("Shoebill"), LTExtras.location("textures/images/shoebill.png"), 2.5f, 3.0f)
new ImageData(Component.literal("Shoebill"), LTExtras.location("textures/images/shoebill.png"), 2.5f, 3.0f),
imageWithHeight("Papyrus Canary", "canary_papyrus", 3.0f, 256, 335),
imageWithHeight("Habitat Restoration - Riverbank", "habitat_restoration_riverbank_1", 3.0f, 256, 340),
imageWithWidth("Papyrus Gonolek", "papyrus_gonolek", 2.0f, 266, 200),
imageWithHeight("Papyrus Harvest", "papyrus_harvest", 2.0f, 340, 256),
imageWithWidth("Shoebill Stork", "shoebill_stork", 3.0f, 317, 256),
imageWithWidth("White-Winged Warbler", "white_winged_warbler", 3.0f, 301, 200)
);

private static ImageData imageWithWidth(String name, String path, float blockWidth, int textureWidth, int textureHeight) {
float blockHeight = blockWidth / textureWidth * textureHeight;
return new ImageData(Component.literal(name), LTExtras.location("textures/images/" + path + ".png"), blockWidth, blockHeight);
}

private static ImageData imageWithHeight(String name, String path, float blockHeight, int textureWidth, int textureHeight) {
float blockWidth = blockHeight / textureHeight * textureWidth;
return new ImageData(Component.literal(name), LTExtras.location("textures/images/" + path + ".png"), blockWidth, blockHeight);
}

public ImageItem(Properties properties) {
super(properties);
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8484239

Please sign in to comment.