generated from Fabricators-of-Create/create-fabric-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 2
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
126 additions
and
39 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
2 changes: 1 addition & 1 deletion
2
src/generated/resources/.cache/89111a76195d73c279f4f0f24afedf84338f085b
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-09-13T17:58:50.441093 Create: Sandpaper Overhaul/Create Sandpaper Overhaul's Damage Type Data | ||
// 1.20.1 2023-09-18T20:20:22.192754 Create: Sandpaper Overhaul/Create Sandpaper Overhaul's Damage Type Data | ||
132c7d6042e5e957f5eebe5fdbbb2dcd39c07ff7 data/create_so/damage_type/sandpaper.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
41 changes: 41 additions & 0 deletions
41
src/main/java/com/ghasto/create_so/compat/emi/ModEMICompat.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,41 @@ | ||
package com.ghasto.create_so.compat.emi; | ||
|
||
import com.ghasto.create_so.CreateSandpaperOverhaul; | ||
import com.ghasto.create_so.ModBlocks; | ||
import com.ghasto.create_so.ModRecipeTypes; | ||
import com.ghasto.create_so.content.polishing_wheel.PolishingRecipe; | ||
import com.simibubi.create.AllItems; | ||
import com.simibubi.create.compat.emi.DoubleItemIcon; | ||
import dev.emi.emi.api.EmiPlugin; | ||
import dev.emi.emi.api.EmiRegistry; | ||
import dev.emi.emi.api.recipe.EmiRecipeCategory; | ||
import dev.emi.emi.api.render.EmiRenderable; | ||
import dev.emi.emi.api.stack.EmiStack; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraft.world.item.crafting.RecipeManager; | ||
|
||
import java.util.LinkedHashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class ModEMICompat implements EmiPlugin { | ||
public static final Map<ResourceLocation, EmiRecipeCategory> ALL = new LinkedHashMap<>(); | ||
public static final EmiRecipeCategory | ||
POLISHING = register("polishing", DoubleItemIcon.of(ModBlocks.POLISHING_WHEEL.get(), AllItems.SAND_PAPER.get())); | ||
@Override | ||
public void register(EmiRegistry registry) { | ||
ALL.forEach((id, category) -> registry.addCategory(category)); | ||
registry.addWorkstation(POLISHING, EmiStack.of(ModBlocks.POLISHING_WHEEL.get())); | ||
RecipeManager manager = registry.getRecipeManager(); | ||
List<PolishingRecipe> polishingRecipes = (List<PolishingRecipe>) (List) manager.getAllRecipesFor(ModRecipeTypes.POLISHING.getType()); | ||
for (PolishingRecipe recipe : polishingRecipes) { | ||
registry.addRecipe(new PolishingEmiRecipe(recipe)); | ||
} | ||
} | ||
private static EmiRecipeCategory register(String name, EmiRenderable icon) { | ||
ResourceLocation id = CreateSandpaperOverhaul.id(name); | ||
EmiRecipeCategory category = new EmiRecipeCategory(id, icon); | ||
ALL.put(id, category); | ||
return category; | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
src/main/java/com/ghasto/create_so/compat/emi/ModEmiAnimations.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,34 @@ | ||
package com.ghasto.create_so.compat.emi; | ||
|
||
import com.ghasto.create_so.ModBlocks; | ||
import com.mojang.blaze3d.vertex.PoseStack; | ||
import dev.emi.emi.api.widget.WidgetHolder; | ||
import net.minecraft.core.Direction; | ||
import net.minecraft.world.level.block.state.BlockState; | ||
import net.minecraft.world.level.block.state.properties.BlockStateProperties; | ||
|
||
import static com.simibubi.create.compat.emi.CreateEmiAnimations.blockElement; | ||
import static com.simibubi.create.compat.emi.CreateEmiAnimations.getCurrentAngle; | ||
|
||
public class ModEmiAnimations { | ||
private static final BlockState WHEEL = ModBlocks.POLISHING_WHEEL.getDefaultState().setValue(BlockStateProperties.AXIS, Direction.Axis.X); | ||
public static void addPolishingWheels(WidgetHolder widgets, int x, int y) { | ||
widgets.addDrawable(x, y, 0, 0, (graphics, mouseX, mouseY, delta) -> { | ||
PoseStack matrices = graphics.pose(); | ||
matrices.translate(0, 0, 100); | ||
matrices.mulPose(com.mojang.math.Axis.YP.rotationDegrees(-22.5f)); | ||
int scale = 22; | ||
|
||
blockElement(WHEEL) | ||
.rotateBlock(0, 90, -getCurrentAngle()) | ||
.scale(scale) | ||
.render(graphics); | ||
|
||
blockElement(WHEEL) | ||
.rotateBlock(0, 90, getCurrentAngle()) | ||
.atLocal(2, 0, 0) | ||
.scale(scale) | ||
.render(graphics); | ||
}); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/main/java/com/ghasto/create_so/compat/emi/PolishingEmiRecipe.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,31 @@ | ||
package com.ghasto.create_so.compat.emi; | ||
|
||
import com.ghasto.create_so.content.polishing_wheel.PolishingRecipe; | ||
import com.simibubi.create.compat.emi.recipes.CreateEmiRecipe; | ||
import com.simibubi.create.content.kinetics.crusher.AbstractCrushingRecipe; | ||
import com.simibubi.create.foundation.gui.AllGuiTextures; | ||
import dev.emi.emi.api.widget.WidgetHolder; | ||
import net.minecraft.resources.ResourceLocation; | ||
|
||
public class PolishingEmiRecipe extends CreateEmiRecipe<AbstractCrushingRecipe> { | ||
|
||
public PolishingEmiRecipe(PolishingRecipe recipe) { | ||
super(ModEMICompat.POLISHING, recipe, 134, 110); | ||
ResourceLocation rid = recipe.getId(); | ||
this.id = new ResourceLocation("emi", "create_so/polishing/" + rid.getNamespace() + "/" + rid.getPath()); | ||
} | ||
|
||
@Override | ||
public void addWidgets(WidgetHolder widgets) { | ||
addTexture(widgets, AllGuiTextures.JEI_DOWN_ARROW, 51, 11); | ||
|
||
addSlot(widgets, input.get(0), 29, 6); | ||
|
||
int xOff = -output.size() * 19 / 2; | ||
for (int i = 0; i < output.size(); i++) { | ||
addSlot(widgets, output.get(i), 67 + xOff + 19 * i, 82).recipeContext(this); | ||
} | ||
|
||
ModEmiAnimations.addPolishingWheels(widgets, 41, 63); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/com/ghasto/create_so/compat/rei/ModReiCompat.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,4 @@ | ||
package com.ghasto.create_so.compat.rei; | ||
|
||
public class ModReiCompat { | ||
} |
15 changes: 0 additions & 15 deletions
15
src/main/java/com/ghasto/create_so/mixin/BeltInventoryAccess.java
This file was deleted.
Oops, something went wrong.
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
15 changes: 0 additions & 15 deletions
15
src/main/resources/data/create_so/recipes/polishing/test_polishing.json
This file was deleted.
Oops, something went wrong.
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