-
Notifications
You must be signed in to change notification settings - Fork 16
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
1 parent
b5f34f7
commit 511b222
Showing
15 changed files
with
569 additions
and
4 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
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
37 changes: 37 additions & 0 deletions
37
src/main/java/com/nomiceu/nomilabs/integration/architecturecraft/LabsShapes.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 com.nomiceu.nomilabs.integration.architecturecraft; | ||
|
||
import com.elytradev.architecture.common.shape.Shape; | ||
import com.elytradev.architecture.common.shape.ShapeKind; | ||
import com.elytradev.architecture.common.shape.ShapeSymmetry; | ||
import com.nomiceu.nomilabs.mixin.architecturecraft.ShapeAccessor; | ||
import net.minecraftforge.common.util.EnumHelper; | ||
|
||
public class LabsShapes { | ||
public static final Shape SLOPE_TILE_A1 = addShape("SLOPE_TILE_A1", 94, "Slope A Start", ShapeKind.Roof, ShapeSymmetry.BILATERAL, 1, 1, 0xcf); | ||
public static final Shape SLOPE_TILE_A2 = addShape("SLOPE_TILE_A2", 95, "Slope A End", ShapeKind.Roof, ShapeSymmetry.BILATERAL, 1, 3, 0x0f); | ||
public static final Shape SLOPE_TILE_B1 = addShape("SLOPE_TILE_B1", 96, "Slope B Start", ShapeKind.Roof, ShapeSymmetry.BILATERAL, 1, 1, 0xff); | ||
public static final Shape SLOPE_TILE_B2 = addShape("SLOPE_TILE_B2", 97, "Slope B Middle", ShapeKind.Roof, ShapeSymmetry.BILATERAL, 1, 2, 0xcf); | ||
public static final Shape SLOPE_TILE_B3 = addShape("SLOPE_TILE_B3", 98, "Slope B End", ShapeKind.Roof, ShapeSymmetry.BILATERAL, 1, 3, 0x0f); | ||
public static final Shape SLOPE_TILE_C1 = addShape("SLOPE_TILE_C1", 99, "Slope C 1", ShapeKind.Roof, ShapeSymmetry.BILATERAL, 1, 1, 0xff); | ||
public static final Shape SLOPE_TILE_C2 = addShape("SLOPE_TILE_C2", 100, "Slope C 2", ShapeKind.Roof, ShapeSymmetry.BILATERAL, 1, 2, 0xcf); | ||
public static final Shape SLOPE_TILE_C3 = addShape("SLOPE_TILE_C3", 101, "Slope C 3", ShapeKind.Roof, ShapeSymmetry.BILATERAL, 1, 3, 0x0f); | ||
public static final Shape SLOPE_TILE_C4 = addShape("SLOPE_TILE_C4", 102, "Slope C 4", ShapeKind.Roof, ShapeSymmetry.BILATERAL, 1, 4, 0x0f); | ||
|
||
/** | ||
* Essentially, this loads the class, allowing the above values to be added. | ||
* <p> | ||
* If for some reason, the values are needed before this, they will still be loaded, and calling init will have no affect on that. | ||
*/ | ||
public static void preInit() { | ||
|
||
} | ||
|
||
@SuppressWarnings("SameParameterValue") | ||
private static Shape addShape(String name, int id, String title, ShapeKind kind, ShapeSymmetry sym, int used, int made, int occ) { | ||
var shape = EnumHelper.addEnum(Shape.class, name, | ||
new Class<?>[]{int.class, String.class, ShapeKind.class, ShapeSymmetry.class, int.class, int.class, int.class}, | ||
id, title, kind, sym, used, made, occ); | ||
ShapeAccessor.getIDMap().put(id, shape) ; | ||
return shape; | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
src/main/java/com/nomiceu/nomilabs/mixin/architecturecraft/GuiSawbenchMixin.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 com.nomiceu.nomilabs.mixin.architecturecraft; | ||
|
||
import com.elytradev.architecture.client.gui.GuiSawbench; | ||
import com.elytradev.architecture.legacy.base.BaseGui; | ||
import net.minecraft.inventory.Container; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Unique; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
/** | ||
* Changes the Gui Shape Item Texture Used. | ||
*/ | ||
@Mixin(value = GuiSawbench.class, remap = false) | ||
public class GuiSawbenchMixin extends BaseGui.Screen { | ||
@Unique | ||
private static final String ORIGINAL_GUI_ITEMS_PATH = "gui/shapemenu_items.png"; | ||
|
||
@Unique | ||
private static final String NEW_GUI_ITEMS_PATH = "gui/labs_shapemenu_items.png"; | ||
|
||
/** | ||
* Default Ignored Constructor. | ||
*/ | ||
public GuiSawbenchMixin(Container container, int width, int height) { | ||
super(container, width, height); | ||
} | ||
|
||
@Redirect(method = "drawShapeMenu", at = @At(value = "INVOKE", target = "Lcom/elytradev/architecture/client/gui/GuiSawbench;bindTexture(Ljava/lang/String;II)V"), remap = false) | ||
public void bindNewGuiTexture(GuiSawbench instance, String texture, int u, int v) { | ||
if (texture.equals(ORIGINAL_GUI_ITEMS_PATH)) { | ||
instance.bindTexture(NEW_GUI_ITEMS_PATH, u, v); | ||
return; | ||
} | ||
instance.bindTexture(texture, u, v); | ||
} | ||
} |
Oops, something went wrong.