generated from Fabricators-of-Create/create-multiloader-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed changed creative mode tab ordering (Also should help for when latest create releases) Also removed some random comments
- Loading branch information
Showing
9 changed files
with
1,223 additions
and
14 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
32 changes: 32 additions & 0 deletions
32
common/src/main/java/com/cak/pattern_schematics/mixin/CreateCreativeModeTabMixin.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,32 @@ | ||
package com.cak.pattern_schematics.mixin; | ||
|
||
import com.cak.pattern_schematics.registry.PatternSchematicsTabInsertions; | ||
import net.minecraft.world.item.Item; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Redirect; | ||
|
||
import java.util.List; | ||
|
||
@Mixin(remap = false, targets = "com.simibubi.create.AllCreativeModeTabs$RegistrateDisplayItemsGenerator") | ||
public class CreateCreativeModeTabMixin { | ||
|
||
@Redirect(method = "collectItems", at = @At(value = "INVOKE", target = "Ljava/util/List;add(Ljava/lang/Object;)Z")) | ||
private boolean addAdditionalItemInject(List<Item> instance, Object element) { | ||
Item itemToAdd = (Item) element; | ||
boolean result = instance.add(itemToAdd); | ||
|
||
if ( | ||
PatternSchematicsTabInsertions.getAllInsertsAfter() | ||
.containsKey(itemToAdd) | ||
) { | ||
instance.add( | ||
PatternSchematicsTabInsertions.getAllInsertsAfter() | ||
.get(itemToAdd) | ||
); | ||
} | ||
|
||
return result; | ||
} | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
common/src/main/java/com/cak/pattern_schematics/registry/PatternSchematicsTabInsertions.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,32 @@ | ||
package com.cak.pattern_schematics.registry; | ||
|
||
import com.google.common.collect.ImmutableMap; | ||
import com.simibubi.create.AllItems; | ||
import com.tterrag.registrate.util.entry.ItemEntry; | ||
import net.minecraft.world.item.Item; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
public class PatternSchematicsTabInsertions { | ||
|
||
|
||
private static Map<Item, Item> INSERTS_AFTER = null; | ||
|
||
public static final Map<ItemEntry<Item>, ItemEntry<Item>> REGISTRY_INSERTS_AFTER = Map.of( | ||
AllItems.EMPTY_SCHEMATIC, PatternSchematicsRegistry.EMPTY_PATTERN_SCHEMATIC | ||
); | ||
|
||
public static Map<Item, Item> getAllInsertsAfter() { | ||
if (INSERTS_AFTER != null) { | ||
return INSERTS_AFTER; | ||
} | ||
|
||
INSERTS_AFTER = new HashMap<>(); | ||
for (Map.Entry<ItemEntry<Item>, ItemEntry<Item>> entry : REGISTRY_INSERTS_AFTER.entrySet()) { | ||
INSERTS_AFTER.put(entry.getKey().get(), entry.getValue().get()); | ||
} | ||
return INSERTS_AFTER; | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"pack": { | ||
"description": "Example Mod", | ||
"description": "Create: Pattern Schematics", | ||
"pack_format": 8 | ||
} | ||
} |