-
Notifications
You must be signed in to change notification settings - Fork 13
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
11 changed files
with
563 additions
and
770 deletions.
There are no files selected for viewing
487 changes: 487 additions & 0 deletions
487
common/src/data/java/gripe/_90/megacells/datagen/CommonModelProvider.java
Large diffs are not rendered by default.
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
14 changes: 14 additions & 0 deletions
14
common/src/data/java/gripe/_90/megacells/mixin/data/TextureSlotAccessor.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,14 @@ | ||
package gripe._90.megacells.mixin.data; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.gen.Invoker; | ||
|
||
import net.minecraft.data.models.model.TextureSlot; | ||
|
||
@Mixin(TextureSlot.class) | ||
public interface TextureSlotAccessor { | ||
@Invoker | ||
static TextureSlot invokeCreate(String string) { | ||
throw new AssertionError(); | ||
} | ||
} |
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
429 changes: 0 additions & 429 deletions
429
fabric/src/data/java/gripe/_90/megacells/datagen/ModelProvider.java
This file was deleted.
Oops, something went wrong.
54 changes: 54 additions & 0 deletions
54
forge/src/data/java/gripe/_90/megacells/datagen/ForgeModelProvider.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,54 @@ | ||
package gripe._90.megacells.datagen; | ||
|
||
import net.minecraft.data.PackOutput; | ||
import net.minecraft.resources.ResourceLocation; | ||
import net.minecraftforge.client.model.generators.ItemModelProvider; | ||
import net.minecraftforge.common.data.ExistingFileHelper; | ||
|
||
import appeng.core.AppEng; | ||
import appeng.core.definitions.ItemDefinition; | ||
|
||
import gripe._90.megacells.MEGACells; | ||
import gripe._90.megacells.core.Addons; | ||
import gripe._90.megacells.integration.appmek.AppMekItems; | ||
|
||
class ForgeModelProvider extends ItemModelProvider { | ||
private static final ResourceLocation STORAGE_CELL_LED = AppEng.makeId("item/storage_cell_led"); | ||
private static final ResourceLocation PORTABLE_CELL_LED = AppEng.makeId("item/portable_cell_led"); | ||
|
||
private static final ResourceLocation DRIVE_CELL = AppEng.makeId("block/drive/drive_cell"); | ||
|
||
public ForgeModelProvider(PackOutput output, ExistingFileHelper existing) { | ||
super(output, MEGACells.MODID, existing); | ||
existing.trackGenerated(STORAGE_CELL_LED, TEXTURE); | ||
existing.trackGenerated(PORTABLE_CELL_LED, TEXTURE); | ||
existing.trackGenerated(DRIVE_CELL, MODEL); | ||
} | ||
|
||
@Override | ||
protected void registerModels() { | ||
if (MEGACells.PLATFORM.isAddonLoaded(Addons.APPMEK)) { | ||
basicItem(AppMekItems.MEGA_CHEMICAL_CELL_HOUSING.asItem()); | ||
|
||
AppMekItems.getCells().forEach(c -> cell(c, "standard", STORAGE_CELL_LED)); | ||
AppMekItems.getPortables().forEach(c -> cell(c, "portable", PORTABLE_CELL_LED)); | ||
|
||
basicItem(AppMekItems.RADIOACTIVE_CELL_COMPONENT.asItem()); | ||
cell(AppMekItems.RADIOACTIVE_CHEMICAL_CELL, "standard", STORAGE_CELL_LED); | ||
|
||
driveCell("mega_chemical_cell"); | ||
driveCell("radioactive_chemical_cell"); | ||
} | ||
} | ||
|
||
private void cell(ItemDefinition<?> cell, String type, ResourceLocation led) { | ||
var path = cell.id().getPath(); | ||
singleTexture(path, mcLoc("item/generated"), "layer0", MEGACells.makeId("item/cell/" + type + "/" + path)) | ||
.texture("layer1", led); | ||
} | ||
|
||
private void driveCell(String texture) { | ||
var path = "block/drive/cells/" + texture; | ||
withExistingParent(path, DRIVE_CELL).texture("cell", path); | ||
} | ||
} |
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
Oops, something went wrong.