Skip to content

Commit

Permalink
1.2.7.c
Browse files Browse the repository at this point in the history
Fix furnace item input and output don't work correctly
Close #117
  • Loading branch information
MarbleGateKeeper committed Oct 8, 2023
1 parent 31e230b commit 05dd40a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ permissions:
env:
MINECRAFT_VERSION: 1.20.1
JAVA_VERSION: 17
VERSION: 1.2.7.b
VERSION: 1.2.7.c
CREATE_VERSION: 0.5.1.e

jobs:
Expand Down
4 changes: 4 additions & 0 deletions changelog/1.2.7.c.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## Create: Enchantment Industry 1.2.7.c

### Bugfix
- Fix furnace item input and output don't work correctly
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.jvmargs=-Xmx3G
org.gradle.daemon=false

# Mod Versions
mod_version = 1.2.7.b
mod_version = 1.2.7.c
artifact_minecraft_version = 1.20.1
minecraft_version = 1.20.1
forge_version = 47.0.43
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import plus.dragons.createenchantmentindustry.content.contraptions.fluids.experience.FurnaceExpExtractor;

import javax.annotation.Nullable;
Expand All @@ -42,23 +46,21 @@ protected AbstractFurnaceBlockEntityMixin(BlockEntityType<?> pType, BlockPos pPo
return new FurnaceExpExtractor(recipesUsed,(AbstractFurnaceBlockEntity)(Object)this);
}

@Override
public <T> @NotNull LazyOptional<T> getCapability(@NotNull Capability<T> capability, @Nullable Direction facing) {
@Inject(method = "getCapability", at = @At("HEAD"), cancellable = true, remap = false)
private void createEnchantmentIndustry$getCapability(Capability<T> capability, Direction facing, CallbackInfoReturnable<LazyOptional<T>> cir) {
if (!this.remove && facing != null && capability == ForgeCapabilities.FLUID_HANDLER) {
return createEnchantmentIndustry$expExtractor.cast();
cir.setReturnValue(createEnchantmentIndustry$expExtractor.cast());
}
return super.getCapability(capability, facing);
}

@Override
public void invalidateCaps() {
super.invalidateCaps();
@Inject(method = "invalidateCaps", at = @At("HEAD"), remap = false)
private void createEnchantmentIndustry$invalidateCaps(CallbackInfo ci) {
createEnchantmentIndustry$expExtractor.invalidate();
}

@Override
public void reviveCaps() {
super.reviveCaps();
@Inject(method = "reviveCaps", at = @At("HEAD"), remap = false)
private void createEnchantmentIndustry$reviveCaps(CallbackInfo ci) {
this.createEnchantmentIndustry$expExtractor = LazyOptional.of(this::createEnchantmentIndustry$createExpExtractor);
}

}

0 comments on commit 05dd40a

Please sign in to comment.