Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update JEI and Zeta #5045

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,13 @@ repositories {
mavenLocal()

maven {
// for Zeta
// for Zeta and JEI
name "blamejared"
url "https://maven.blamejared.com"
content {
includeGroup("org.violetmoon.zeta")
includeGroup("mezz.jei")
}
}
maven {
name "TerraformersMC"
Expand All @@ -102,12 +106,24 @@ repositories {
}
maven { // Curios api
url = "https://maven.theillusivec4.top/"
content {
includeGroup("top.theillusivec4.curios")
}
}

maven {
name "jitpack"
url "https://jitpack.io"
}
maven {
// mirrors many mavens, useful as a backup in case one goes down for a bit
name = "ModMaven"
url = "https://modmaven.dev"
content {
includeGroup("org.violetmoon.zeta")
includeGroup("mezz.jei")
}
}
}

dependencies {
Expand All @@ -124,13 +140,11 @@ dependencies {
//runtimeOnly fg.deobf("dev.emi:emi-forge:${deps.emi}")
runtimeOnly fg.deobf("curse.maven:spark-361579:${deps.spark}")

//implementation fg.deobf("org.violetmoon.zeta:Zeta:1.0-25a")
implementation fg.deobf("curse.maven:zeta-968868:5597406")
implementation fg.deobf("org.violetmoon.zeta:Zeta:${deps.zeta}")
implementation fg.deobf("com.github.glitchfiend:TerraBlender-forge:${deps.terrablender}")
implementation fg.deobf("curse.maven:jei-238222:${deps.jei}")
implementation fg.deobf("curse.maven:flan-forge-493246:${deps.flan}")
implementation fg.deobf("curse.maven:lootr-361276:${deps.lootr}")
implementation fg.deobf("curse.maven:just-enough-resources-jer-240630:4689010")
runtimeOnly fg.deobf("curse.maven:just-enough-resources-jer-240630:4689010")

runtimeOnly fg.deobf("curse.maven:nofog-296468:4601446")
runtimeOnly fg.deobf("curse.maven:woodworks-543610:5292418")
Expand All @@ -139,6 +153,12 @@ dependencies {

runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:${deps.curios}")
compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:${deps.curios}:api")

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

spotless {
Expand Down
6 changes: 4 additions & 2 deletions dependencies.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
forge=47.1.3
zeta=1.0-19
jei=4712868
# zeta versions: https://maven.blamejared.com/org/violetmoon/zeta/Zeta/maven-metadata.xml
zeta=1.0-25.120
# jei versions: https://maven.blamejared.com/mezz/jei/jei-1.20.1-forge/maven-metadata.xml
jei=15.18.0.79
terrablender=1.20.1-3.0.0.169
flan=5290172
lootr=4608503
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public MagnetBlock(@Nullable ZetaModule module) {
return;
setCreativeTab(CreativeModeTabs.REDSTONE_BLOCKS);

module.zeta.renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT);
module.zeta().renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public MatrixEnchantingTableBlock(ZetaModule module) {
super(Block.Properties.copy(Blocks.ENCHANTING_TABLE));

this.module = module;
module.zeta.registry.registerBlock(this, "matrix_enchanter", true);
module.zeta().registry.registerBlock(this, "matrix_enchanter", true);

if(!MatrixEnchantingModule.automaticallyConvert)
setCreativeTab(CreativeModeTabs.FUNCTIONAL_BLOCKS, Blocks.ENCHANTING_TABLE, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected BasePipeBlock(String name, @Nullable ZetaModule module, BlockBehaviou
return;

setCreativeTab(CreativeModeTabs.REDSTONE_BLOCKS);
module.zeta.renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT);
module.zeta().renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT);
}

public BlockState getDefaultPipeState() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public BackpackItem(@Nullable ZetaModule module) {

if (module == null)return;

module.zeta.registry.registerItem(this, "backpack");
module.zeta().registry.registerItem(this, "backpack");

CreativeTabManager.addToCreativeTabNextTo(CreativeModeTabs.TOOLS_AND_UTILITIES, this, Items.SADDLE, true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
import org.violetmoon.zeta.event.play.ZBlock;
import org.violetmoon.zeta.event.play.ZItemTooltip;
import org.violetmoon.zeta.event.play.entity.player.ZPlayerInteract;
import org.violetmoon.zeta.event.play.loading.ZGatherHints;
import org.violetmoon.zeta.event.load.ZGatherHints;
import org.violetmoon.zeta.module.ZetaLoadModule;
import org.violetmoon.zeta.module.ZetaModule;
import org.violetmoon.zeta.util.ItemNBTHelper;
Expand Down Expand Up @@ -184,7 +184,7 @@ public final void register(ZRegister event) {
influenceTrigger = event.getAdvancementModifierRegistry().registerManualTrigger("influence");
}

@PlayEvent
@LoadEvent
public void addAdditionalHints(ZGatherHints event) {
MutableComponent comp = Component.translatable("quark.jei.hint.matrix_enchanting");
if(allowInfluencing)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public void onPlayerDrops(ZLivingDrops.Lowest event) {
.map(ItemEntity::getItem)
.filter(stack -> !stack.isEmpty())
.forEach(totem::addItem);
if (zeta.isModLoaded("curios"))
if (zeta().isModLoaded("curios"))
TotemOfHoldingCuriosCompat.saveCurios(player, totem);
if(!player.level().isClientSide)
player.level().addFreshEntity(totem);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public int compareTo(@NotNull ButtonProviderHolder o) {
}

public MiniInventoryButton getButton(AbstractContainerScreen<?> parent, int x, int y) {
MiniInventoryButton b = (module.enabled && (enableCond == null || enableCond.getAsBoolean()))
MiniInventoryButton b = (module.isEnabled() && (enableCond == null || enableCond.getAsBoolean()))
? provider.provide(parent, x, y) : null;

if(b != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public ChuteBlock(String regname, @Nullable ZetaModule module, Properties proper
if(module == null) //auto registration below this line
return;

module.zeta.renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT_MIPPED);
module.zeta().renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT_MIPPED);
setCreativeTab(CreativeModeTabs.REDSTONE_BLOCKS);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ public IronRodBlock(ZetaModule module) {
.noOcclusion()
.forceSolidOn());

module.zeta.registry.registerBlock(this, "iron_rod", true);
module.zeta().registry.registerBlock(this, "iron_rod", true);
CreativeTabManager.addToCreativeTab(CreativeModeTabs.REDSTONE_BLOCKS, this);

module.zeta.renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT);
module.zeta().renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT);

this.module = module;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public RedstoneRandomizerBlock(String regname, @Nullable ZetaModule module, Prop

if(module == null) //auto registration below this line
return;
module.zeta.renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT);
module.zeta().renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT);
setCreativeTab(CreativeModeTabs.REDSTONE_BLOCKS, Blocks.COMPARATOR, false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import org.violetmoon.zeta.event.load.ZConfigChanged;
import org.violetmoon.zeta.event.load.ZRegister;
import org.violetmoon.zeta.event.play.ZLevelTick;
import org.violetmoon.zeta.event.play.loading.ZGatherHints;
import org.violetmoon.zeta.event.load.ZGatherHints;
import org.violetmoon.zeta.module.ZetaLoadModule;
import org.violetmoon.zeta.module.ZetaModule;
import org.violetmoon.zeta.piston.ZetaPistonStructureResolver;
Expand Down Expand Up @@ -90,7 +90,7 @@ public void onWorldTick(ZLevelTick.End event) {
delays.clear();
}

@PlayEvent
@LoadEvent
public void addAdditionalHints(ZGatherHints event) {
MutableComponent comp = Component.translatable("quark.jei.hint.piston_te");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public GrateBlock(@Nullable ZetaModule module) {

if(module == null) //auto registration below this line
return;
module.zeta.renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT);
module.zeta().renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT);
setCreativeTab(CreativeModeTabs.FUNCTIONAL_BLOCKS, Blocks.CHAIN, false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public HedgeBlock(String regname, @Nullable ZetaModule module, Block fence, Bloc
return;

CreativeTabManager.addToCreativeTabNextTo(CreativeModeTabs.NATURAL_BLOCKS, this, leaf, false);
module.zeta.renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT);
module.zeta().renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT);
}

@Deprecated(forRemoval = true) //for bin compat; requires early registry-name-retrieval of blocks, which isn't composable with other mods etc.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public HollowLogBlock(String name, Block sourceLog, @Nullable ZetaModule module,
if(module == null) //auto registration below this line
return;

module.zeta.renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT_MIPPED);
module.zeta().renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT_MIPPED);
setCreativeTab(CreativeModeTabs.BUILDING_BLOCKS, sourceLog, false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public HollowWoodBlock(String name, Block sourceLog, @Nullable ZetaModule module

if(module == null) //auto registration below this line
return;
module.zeta.renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT_MIPPED);
module.zeta().renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT_MIPPED);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public LeafCarpetBlock(String name, Block base, @Nullable ZetaModule module) {

if(module == null) //auto registration below this line
return;
module.zeta.renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT_MIPPED);
module.zeta().renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT_MIPPED);
setCreativeTab(CreativeModeTabs.NATURAL_BLOCKS, base, false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public RopeBlock(String regname, @Nullable ZetaModule module, Properties propert

if(module == null) //auto registration below this line
return;
module.zeta.renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT);
module.zeta().renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT);
setCreativeTab(CreativeModeTabs.FUNCTIONAL_BLOCKS, Blocks.CHAIN, true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public VariantChestBlock(String prefix, String type, ZetaModule module, Supplier
return;

String resloc = (prefix != null ? prefix + "_" : "") + type + "_chest";
module.zeta.registry.registerBlock(this, resloc, true);
module.zeta().registry.registerBlock(this, resloc, true);
}

public VariantChestBlock(String type, ZetaModule module, Supplier<BlockEntityType<? extends ChestBlockEntity>> supplier, Properties props) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class VariantFurnaceBlock extends FurnaceBlock implements IZetaBlock {
public VariantFurnaceBlock(String type, ZetaModule module, Properties props) {
super(props);

module.zeta.registry.registerBlock(this, type + "_furnace", true);
module.zeta().registry.registerBlock(this, type + "_furnace", true);
CreativeTabManager.addToCreativeTabNextTo(CreativeModeTabs.FUNCTIONAL_BLOCKS, this, Blocks.FURNACE, false);

this.module = module;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public VariantLadderBlock(String type, @Nullable ZetaModule module, Block.Proper
if(module == null) //auto registration below this line
return;

module.zeta.registry.registerBlock(this, type + "_ladder", true);
module.zeta().registry.registerBlock(this, type + "_ladder", true);
CreativeTabManager.addToCreativeTabNextTo(CreativeModeTabs.FUNCTIONAL_BLOCKS, this, Blocks.LADDER, false);
module.zeta.renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT);
module.zeta().renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public VariantTrappedChestBlock(String prefix, String type, @Nullable ZetaModule
return;

String resloc = (prefix != null ? prefix + "_" : "") + type + "_trapped_chest";
module.zeta.registry.registerBlock(this, resloc, true);
module.zeta().registry.registerBlock(this, resloc, true);
}

public VariantTrappedChestBlock(String type, ZetaModule module, Supplier<BlockEntityType<? extends ChestBlockEntity>> supplier, Properties props) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public WoodPostBlock(@Nullable ZetaModule module, Block parent, String prefix, S
if(module == null) //auto registration below this line
return;

module.zeta.renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT);
module.zeta().renderLayerRegistry.put(this, RenderLayerRegistry.Layer.CUTOUT);
setCreativeTab(CreativeModeTabs.BUILDING_BLOCKS, parent, true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ public static class Client extends HedgesModule {

@LoadEvent
public void blockColorProviders(ZAddBlockColorHandlers event) {
event.registerNamed(zeta, b -> new AlikeColorHandler((HedgeBlock) b, HedgeBlock::getLeaf), "hedge");
event.registerNamed(zeta(), b -> new AlikeColorHandler((HedgeBlock) b, HedgeBlock::getLeaf), "hedge");
}

@LoadEvent
public void itemColorProviders(ZAddItemColorHandlers event) {
event.registerNamed(zeta, i -> new AlikeColorHandler(i, HedgeBlock::getLeaf), "hedge");
event.registerNamed(zeta(), i -> new AlikeColorHandler(i, HedgeBlock::getLeaf), "hedge");
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ public static class Client extends LeafCarpetModule {

@LoadEvent
public void blockColorHandlers(ZAddBlockColorHandlers event) {
event.registerNamed(zeta,b -> new AlikeColorHandler((LeafCarpetBlock) b, LeafCarpetBlock::getBaseState), "leaf_carpet");
event.registerNamed(zeta(), b -> new AlikeColorHandler((LeafCarpetBlock) b, LeafCarpetBlock::getBaseState), "leaf_carpet");
}

@LoadEvent
public void itemColorHandlers(ZAddItemColorHandlers event) {
event.registerNamed(zeta, i -> new AlikeColorHandler(i, LeafCarpetBlock::getBaseState), "leaf_carpet");
event.registerNamed(zeta(), i -> new AlikeColorHandler(i, LeafCarpetBlock::getBaseState), "leaf_carpet");
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public final void register(ZRegister event) {
@PlayEvent
public void onRightClick(ZRightClickBlock event) {
ItemStack stack = event.getItemStack();
if(zeta.itemExtensions.get(stack).canShearZeta(stack)) {
if(zeta().itemExtensions.get(stack).canShearZeta(stack)) {
BlockPos pos = event.getPos();
Level world = event.getLevel();
BlockState state = world.getBlockState(pos);
Expand Down Expand Up @@ -88,12 +88,12 @@ public static class Client extends ShearVinesModule {

@LoadEvent
public void blockColors(ZAddBlockColorHandlers event) {
event.registerNamed(zeta, b -> LIKE_VINE, "vine");
event.registerNamed(zeta(), b -> LIKE_VINE, "vine");
}

@LoadEvent
public void itemColors(ZAddItemColorHandlers event) {
event.registerNamed(zeta, i -> LIKE_VINE, "vine");
event.registerNamed(zeta(), i -> LIKE_VINE, "vine");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ public final void register(ZRegister event) {

@LoadEvent
public final void configChanged(ZConfigChanged event) {
zeta.nameChanger.changeBlock(Blocks.BOOKSHELF, "block.quark.oak_bookshelf", changeNames && enabled);
zeta().nameChanger.changeBlock(Blocks.BOOKSHELF, "block.quark.oak_bookshelf", changeNames && enabled);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public void loadComplete(ZLoadComplete e) {
@LoadEvent
public final void configChanged(ZConfigChanged event) {
moduleEnabled = this.enabled;
zeta.nameChanger.changeBlock(Blocks.LADDER, "block.quark.oak_ladder", changeNames && enabled);
zeta().nameChanger.changeBlock(Blocks.LADDER, "block.quark.oak_ladder", changeNames && enabled);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ private static void refreshShader() {
}
} else {
OverlayShaderModule shaderModule = Quark.ZETA.modules.get(OverlayShaderModule.class);
if(shaderModule != null && shaderModule.enabled) {
if(shaderModule != null && shaderModule.isEnabled()) {
for(ResourceLocation l : SHADERS) {
if(l != null && l.getPath().contains(shaderModule.shader + ".json")) {
render.loadEffect(l);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public boolean namesMatch(ItemStack stack, String search) {

ResourceLocation itemName = BuiltInRegistries.ITEM.getKey(item);
@Nullable
String modDisplayName = zeta.getModDisplayName(itemName.getNamespace());
String modDisplayName = zeta().getModDisplayName(itemName.getNamespace());

if(modDisplayName != null && matcher.test(modDisplayName.toLowerCase(Locale.ROOT), search))
return true;
Expand Down
Loading
Loading