-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
559 additions
and
513 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 0 additions & 43 deletions
43
common/src/main/java/gripe/_90/megacells/crafting/DecompressionPatternDecoder.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
common/src/main/java/gripe/_90/megacells/crafting/DecompressionPatternItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package gripe._90.megacells.crafting; | ||
|
||
import org.jetbrains.annotations.Nullable; | ||
|
||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.level.Level; | ||
|
||
import appeng.api.stacks.AEItemKey; | ||
import appeng.crafting.pattern.EncodedPatternItem; | ||
|
||
import gripe._90.megacells.MEGACells; | ||
|
||
public class DecompressionPatternItem extends EncodedPatternItem { | ||
public DecompressionPatternItem(Properties properties) { | ||
super(properties); | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public DecompressionPattern decode(ItemStack stack, Level level, boolean tryRecovery) { | ||
return decode(AEItemKey.of(stack), level); | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public DecompressionPattern decode(AEItemKey what, Level level) { | ||
if (what == null || !(what.hasTag())) { | ||
return null; | ||
} | ||
|
||
try { | ||
return new DecompressionPattern(what); | ||
} catch (Exception e) { | ||
MEGACells.LOGGER.warn( | ||
"Could not decode an invalid decompression pattern %s: %s".formatted(what.getTag(), e)); | ||
return null; | ||
} | ||
} | ||
} |
Oops, something went wrong.