Skip to content

Commit

Permalink
Merge pull request #6 from GregTech-Exploring-Pioneer/fix
Browse files Browse the repository at this point in the history
修复模型有时候是透明的问题,大概修好了
  • Loading branch information
DancingSnow0517 authored May 7, 2024
2 parents 41ec594 + 31af755 commit 744b7ca
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mod_authors= DancingSnow
mod_description = A mod added more ae cells and so on.
mod_license = MIT
mod_url = https://github.com/GregTech-Exploring-Pioneer/BiggerAE2
mod_version = 1.2.0
mod_version = 1.2.1

maven_group = cn.dancingsnow.bigger_ae2

Expand Down
18 changes: 8 additions & 10 deletions src/main/java/cn/dancingsnow/bigger_ae2/BiggerAE2Mod.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,13 @@ private static void initStorageCells(FMLCommonSetupEvent event) {
}

private static void initCraftingUnitModels(FMLClientSetupEvent event) {
event.enqueueWork(() -> {
for (ModCraftingUnitType type : ModCraftingUnitType.values()) {
BuiltInModelHooks.addBuiltInModel(
BiggerAE2Mod.of("block/crafting/" + type.getAffix() + "_formed"),
new CraftingCubeModel(new ModCraftingUnitModelProvider(type))
);

ItemBlockRenderTypes.setRenderLayer(type.getBlockFromType(), RenderType.cutout());
}
});
for (ModCraftingUnitType type : ModCraftingUnitType.values()) {
BuiltInModelHooks.addBuiltInModel(
BiggerAE2Mod.of("block/crafting/" + type.getAffix() + "_formed"),
new CraftingCubeModel(new ModCraftingUnitModelProvider(type))
);

ItemBlockRenderTypes.setRenderLayer(type.getBlockFromType(), RenderType.cutout());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@

@Mixin(ModelBakery.class)
public abstract class ModelBakeryMixin {
@Shadow protected abstract void cacheAndQueueDependencies(ResourceLocation location, UnbakedModel model);
@Shadow
protected abstract void cacheAndQueueDependencies(ResourceLocation location, UnbakedModel model);

@Inject(method = "loadModel", at = @At("HEAD"), cancellable = true)
private void loadModelHook(ResourceLocation id, CallbackInfo ci) {
UnbakedModel model = bigger_ae2$getUnbakedModel(id);

if (model != null) {
cacheAndQueueDependencies(id, model);
ci.cancel();
Expand Down

0 comments on commit 744b7ca

Please sign in to comment.