Skip to content

Commit

Permalink
dont initialize AlloyForgery as early, fix REI texture (closes #46), …
Browse files Browse the repository at this point in the history
…fix creative tab again (closes #42 and #44)
  • Loading branch information
gliscowo committed Apr 16, 2022
1 parent d332456 commit 36f41dc
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ minecraft_version=1.18.2
yarn_mappings=1.18.2+build.1
loader_version=0.13.3
# Mod Properties
mod_version=2.0.12
mod_version=2.0.13
maven_group=wraith
archives_base_name=wraith-alloy-forgery

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/wraith/alloyforgery/AlloyForgeryItemGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ protected AlloyForgeryItemGroup(Identifier id) {

@Override
public ItemStack createIcon() {
return this.controllerCache != null && this.controllerCache.isEmpty() ? Items.BRICKS.getDefaultStack() : this.controllerCache.get(0);
if (this.controllerCache == null) return Items.BRICKS.getDefaultStack();
return this.controllerCache.isEmpty() ? Items.BRICKS.getDefaultStack() : this.controllerCache.get(0);
}

@Override
Expand Down
14 changes: 9 additions & 5 deletions src/main/java/wraith/alloyforgery/compat/LegacyIdMappings.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,18 @@ public class LegacyIdMappings {
private static final Map<Identifier, Identifier> MAPPINGS = new HashMap<>();

static {
MAPPINGS.put(AlloyForgery.id("blackstone_forge_controller"), AlloyForgery.id("polished_blackstone_forge_controller"));
MAPPINGS.put(AlloyForgery.id("brick_forge_controller"), AlloyForgery.id("bricks_forge_controller"));
MAPPINGS.put(AlloyForgery.id("deepslate_forge_controller"), AlloyForgery.id("deepslate_bricks_forge_controller"));
MAPPINGS.put(AlloyForgery.id("end_stone_forge_controller"), AlloyForgery.id("end_stone_bricks_forge_controller"));
MAPPINGS.put(AlloyForgery.id("stone_brick_forge_controller"), AlloyForgery.id("stone_bricks_forge_controller"));
MAPPINGS.put(id("blackstone_forge_controller"), id("polished_blackstone_forge_controller"));
MAPPINGS.put(id("brick_forge_controller"), id("bricks_forge_controller"));
MAPPINGS.put(id("deepslate_forge_controller"), id("deepslate_bricks_forge_controller"));
MAPPINGS.put(id("end_stone_forge_controller"), id("end_stone_bricks_forge_controller"));
MAPPINGS.put(id("stone_brick_forge_controller"), id("stone_bricks_forge_controller"));
}

public static Identifier remap(Identifier original) {
return MAPPINGS.getOrDefault(original, original);
}

private static Identifier id(String path) {
return new Identifier(AlloyForgery.MOD_ID, path);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void registerCategories(CategoryRegistry registry) {
@Override
public void registerScreens(ScreenRegistry registry) {
registry.registerClickArea(screen -> {
return new Rectangle(screen.rootX() + 142, screen.rootY() + 4, 21, 24);
return new Rectangle(screen.rootX() + 142, screen.rootY() + 20, 21, 24);
}, AlloyForgeScreen.class, AlloyForgingCategory.ID);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public List<Widget> setupDisplay(AlloyForgingDisplay display, Rectangle bounds)

widgets.add(Widgets.createRecipeBase(bounds));

widgets.add(Widgets.createTexturedWidget(GUI_TEXTURE, origin.x + 10, origin.y + 18, 42, 5, 124, 58));
widgets.add(Widgets.createTexturedWidget(GUI_TEXTURE, origin.x + 10, origin.y + 18, 42, 21, 124, 58));
widgets.add(Widgets.createTexturedWidget(GUI_TEXTURE, origin.x + 115, origin.y + 21, 176, 0, 15, 19));

for (int i = 0; i < display.getInputEntries().size(); i++) {
Expand Down

0 comments on commit 36f41dc

Please sign in to comment.