-
Notifications
You must be signed in to change notification settings - Fork 15
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
1 parent
3e13d9c
commit 9590738
Showing
57 changed files
with
720 additions
and
645 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* Updated to 1.21.2 | ||
* Marked as beta due to using hacks to make graphlib work on newer versions |
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 |
---|---|---|
@@ -1,17 +1,16 @@ | ||
org.gradle.jvmargs=-Xmx1G | ||
|
||
minecraft_version=1.21.1 | ||
yarn_mappings=1.21.1+build.3 | ||
loader_version=0.15.11 | ||
minecraft_version=1.21.2 | ||
yarn_mappings=1.21.2+build.1 | ||
loader_version=0.16.7 | ||
|
||
mod_version=3.0.5 | ||
mod_version=4.0.0 | ||
maven_group=io.github.mattidragon | ||
archives_base_name=ExtendedDrawers | ||
|
||
fabric_version=0.102.0+1.21.1 | ||
fabric_version=0.106.1+1.21.2 | ||
graphlib_version=2.0.0+1.21 | ||
patchouli_version=1.20.1-81-FABRIC | ||
yacl_version=3.5.0+1.21 | ||
modmenu_version=11.0.1 | ||
yacl_version=3.6.1+1.21.2 | ||
modmenu_version=12.0.0-beta.1 | ||
configtoolkit_version=1.1.1 | ||
noindium_version=1.1.0+1.20.4 |
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
37 changes: 37 additions & 0 deletions
37
...github/mattidragon/extendeddrawers/client/compression/ClientCompressionRecipeManager.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,37 @@ | ||
package io.github.mattidragon.extendeddrawers.client.compression; | ||
|
||
import io.github.mattidragon.extendeddrawers.compacting.CompressionLadder; | ||
import io.github.mattidragon.extendeddrawers.compacting.CompressionRecipeManager; | ||
import net.fabricmc.fabric.api.transfer.v1.item.ItemVariant; | ||
import net.minecraft.client.network.ClientPlayNetworkHandler; | ||
import net.minecraft.world.World; | ||
|
||
import java.util.HashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class ClientCompressionRecipeManager implements CompressionRecipeManager { | ||
private final Map<ItemVariant, CompressionLadder> ladders = new HashMap<>(); | ||
|
||
public static ClientCompressionRecipeManager of(ClientPlayNetworkHandler handler) { | ||
return ((Provider) handler).extended_drawers$getCompactingManager(); | ||
} | ||
|
||
public void addLadders(List<CompressionLadder> recipes) { | ||
for (var recipe : recipes) { | ||
recipe.steps().forEach(step -> ladders.put(step.item(), recipe)); | ||
} | ||
} | ||
|
||
@Override | ||
public CompressionLadder getLadder(ItemVariant item, World world) { | ||
if (ladders.containsKey(item)) { | ||
return ladders.get(item); | ||
} | ||
return new CompressionLadder(List.of(new CompressionLadder.Step(item, 1))); | ||
} | ||
|
||
public interface Provider extends CompressionRecipeManager.Provider { | ||
ClientCompressionRecipeManager extended_drawers$getCompactingManager(); | ||
} | ||
} |
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
17 changes: 17 additions & 0 deletions
17
...ava/io/github/mattidragon/extendeddrawers/client/mixin/ClientPlayNetworkHandlerMixin.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,17 @@ | ||
package io.github.mattidragon.extendeddrawers.client.mixin; | ||
|
||
import io.github.mattidragon.extendeddrawers.client.compression.ClientCompressionRecipeManager; | ||
import net.minecraft.client.network.ClientPlayNetworkHandler; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Unique; | ||
|
||
@Mixin(ClientPlayNetworkHandler.class) | ||
public class ClientPlayNetworkHandlerMixin implements ClientCompressionRecipeManager.Provider { | ||
@Unique | ||
private final ClientCompressionRecipeManager compactingManager = new ClientCompressionRecipeManager(); | ||
|
||
@Override | ||
public ClientCompressionRecipeManager extended_drawers$getCompactingManager() { | ||
return compactingManager; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/client/java/io/github/mattidragon/extendeddrawers/client/mixin/ClientWorldMixin.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,18 @@ | ||
package io.github.mattidragon.extendeddrawers.client.mixin; | ||
|
||
import io.github.mattidragon.extendeddrawers.client.compression.ClientCompressionRecipeManager; | ||
import io.github.mattidragon.extendeddrawers.compacting.CompressionRecipeManager; | ||
import io.github.mattidragon.extendeddrawers.mixin.WorldMixin; | ||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.client.world.ClientWorld; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
|
||
import java.util.Objects; | ||
|
||
@Mixin(ClientWorld.class) | ||
public class ClientWorldMixin extends WorldMixin { | ||
@Override | ||
public CompressionRecipeManager extended_drawers$getCompactingManager() { | ||
return ((ClientCompressionRecipeManager.Provider) Objects.requireNonNull(MinecraftClient.getInstance().getNetworkHandler(), "network handler should exist")).extended_drawers$getCompactingManager(); | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.