Skip to content

Commit

Permalink
Update to Ars Nouveau 4.6.0
Browse files Browse the repository at this point in the history
Closes #7
  • Loading branch information
62832 committed Oct 9, 2023
1 parent 7e0d4b7 commit 7d1668d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ minecraft {
configureEach {
workingDirectory(project.file("run"))
property("forge.logging.markers", "REGISTRIES")
property("forge.logging.console.level", "info")
property("forge.logging.console.level", "debug")

mods {
create(modId) {
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencyResolutionManagement {
version("ae2", "15.0.11")
library("ae2", "appeng", "appliedenergistics2-forge").versionRef("ae2")

version("ars", "4.3.0.72")
version("ars", "4.6.0.99")
library("ars", "com.hollingsworth.ars_nouveau", "ars_nouveau-$minecraftVersion").versionRef("ars")

library("geckolib", "software.bernie.geckolib", "geckolib-forge-$minecraftVersion").version("4.2.1")
Expand Down
22 changes: 14 additions & 8 deletions src/main/java/gripe/_90/arseng/definition/ArsEngCapabilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,21 +70,27 @@ private boolean isNotBlackListed(ISourceTile tile) {
event.addListener(provider::invalidate);
}

event.addCapability(ArsEnergistique.makeId("generic_inv_wrapper"), new ICapabilityProvider() {
var genericInvWrapper = new ICapabilityProvider() {
private LazyOptional<ISourceTile> sourceHandler = LazyOptional.empty();

@SuppressWarnings("UnstableApiUsage")
@NotNull
@Override
public <T> LazyOptional<T> getCapability(@NotNull Capability<T> cap, @Nullable Direction side) {
if (cap == SOURCE_TILE) {
return be.getCapability(Capabilities.GENERIC_INTERNAL_INV, side)
.lazyMap(GenericStackSourceStorage::new)
.cast();
sourceHandler = be.getCapability(Capabilities.GENERIC_INTERNAL_INV, side)
.lazyMap(GenericStackSourceStorage::new);
}

// this probably shouldn't have an invalidator considering GENERIC_INTERNAL_INV doesn't typically
// provide invalidation anyway
return LazyOptional.empty();
return sourceHandler.cast();
}

private void invalidate() {
sourceHandler.invalidate();
}
});
};

event.addCapability(ArsEnergistique.makeId("generic_inv_wrapper"), genericInvWrapper);
event.addListener(genericInvWrapper::invalidate);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import com.hollingsworth.arsnouveau.client.particle.ParticleColor;
import com.hollingsworth.arsnouveau.client.particle.ParticleUtil;
import com.hollingsworth.arsnouveau.common.entity.AmethystGolem;
import com.hollingsworth.arsnouveau.common.entity.goal.amethyst_golem.ConvertBuddingGoal;
Expand Down Expand Up @@ -40,7 +41,7 @@ private void convertCertus(CallbackInfo ci) {
targetCluster,
AEBlocks.FLAWED_BUDDING_QUARTZ.block().defaultBlockState(),
3);
ParticleUtil.spawnTouchPacket(golem.level(), targetCluster, ParticleUtil.defaultParticleColorWrapper());
ParticleUtil.spawnTouchPacket(golem.level(), targetCluster, ParticleColor.defaultParticleColor());
}
}

Expand Down

0 comments on commit 7d1668d

Please sign in to comment.