Skip to content

Commit

Permalink
修正与 JEI 的兼容
Browse files Browse the repository at this point in the history
- 现在丢失的图标能显示了
  • Loading branch information
TartaricAcid committed Dec 23, 2024
1 parent 0083c7e commit ed9dd79
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 11 deletions.
16 changes: 13 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -117,16 +117,26 @@ repositories {
maven {
url = "https://maven.conczin.net/Artifacts"
}
maven {
// location of the maven that hosts JEI files since January 2023
name = "Jared's maven"
url = "https://maven.blamejared.com/"
}
maven {
// location of a maven mirror for JEI files, as a fallback
name = "ModMaven"
url = "https://modmaven.dev"
}
}

dependencies {
minecraft "net.minecraftforge:forge:${forge_version}"

// compile against the JEI API but do not include it at runtime
compileOnly(fg.deobf("libs:jei-1.20.1-common-api:${jei_version}"))
compileOnly(fg.deobf("libs:jei-1.20.1-forge-api:${jei_version}"))
compileOnly(fg.deobf("mezz.jei:jei-1.20.1-common-api:${jei_version}"))
compileOnly(fg.deobf("mezz.jei:jei-1.20.1-forge-api:${jei_version}"))
// at runtime, use the full JEI jar for Forge
runtimeOnly(fg.deobf("libs:jei-1.20.1-forge:${jei_version}"))
runtimeOnly(fg.deobf("mezz.jei:jei-1.20.1-forge:${jei_version}"))

// rei
compileOnly fg.deobf("curse.maven:architectury-api-419699:${architectury_api_id}")
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.daemon=false
mod_version=1.1.13
forge_version=1.20.1-47.1.0
mc_version=1.20.1
jei_version=15.0.0.12
jei_version=15.20.0.105
patchouli_version=1.20.1-80-FORGE
jade_id=4768593
top_id=4629624
Expand Down
Binary file removed libs/jei-1.20.1-common-api-15.0.0.12.jar
Binary file not shown.
Binary file removed libs/jei-1.20.1-forge-15.0.0.12.jar
Binary file not shown.
Binary file removed libs/jei-1.20.1-forge-api-15.0.0.12.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Collections;
import java.util.List;

public class PerspectiveBakedModel implements BakedModel {
Expand All @@ -26,7 +25,7 @@ public PerspectiveBakedModel(BakedModel bakedModel2d, BakedModel bakedModel3d) {

@Override
public List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction side, RandomSource rand) {
return Collections.emptyList();
return this.bakedModel2d.getQuads(state, side, rand);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import net.minecraft.world.level.block.state.BlockState;
import org.jetbrains.annotations.Nullable;

import java.util.Collections;
import java.util.List;
import java.util.function.Supplier;

Expand All @@ -28,7 +27,11 @@ public ReplaceableBakedModel(BakedModel rawBakedModel, BakedModel replacedBakedM

@Override
public List<BakedQuad> getQuads(@Nullable BlockState pState, @Nullable Direction pDirection, RandomSource random) {
return Collections.emptyList();
if (isReplace.get()) {
return this.replacedBakedModel.getQuads(pState, pDirection, random);
} else {
return this.rawBakedModel.getQuads(pState, pDirection, random);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
"translation": [0, 0.5, 0],
"scale": [0.75, 0.75, 0.75]
},
"gui": {
"rotation": [0, 180, 0]
},
"head": {
"translation": [0, 15, 0]
}
Expand Down

0 comments on commit ed9dd79

Please sign in to comment.