-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove ae2.Integration and rename ae2.Registries to ae2.AE2Registries
- Loading branch information
Showing
6 changed files
with
30 additions
and
30 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
23 changes: 21 additions & 2 deletions
23
...pherals/common/addons/ae2/Registries.java → ...rals/common/addons/ae2/AE2Registries.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 |
---|---|---|
@@ -1,23 +1,42 @@ | ||
package de.srendi.advancedperipherals.common.addons.ae2; | ||
|
||
import appeng.api.features.P2PTunnelAttunement; | ||
import appeng.api.parts.IPart; | ||
import appeng.api.parts.IPartItem; | ||
import appeng.api.parts.PartModels; | ||
import appeng.items.parts.PartItem; | ||
import appeng.items.parts.PartModelsHelper; | ||
import dan200.computercraft.shared.Registry.ModItems; | ||
import de.srendi.advancedperipherals.common.setup.APRegistration; | ||
import net.minecraft.data.tags.TagsProvider; | ||
import net.minecraft.tags.TagKey; | ||
import net.minecraft.world.item.Item; | ||
import net.minecraftforge.registries.RegistryObject; | ||
|
||
import java.util.function.Function; | ||
|
||
public final class Registries { | ||
private Registries() {} | ||
public final class AE2Registries { | ||
private AE2Registries() {} | ||
|
||
public static final RegistryObject<PartItem<WiredCableP2PTunnelPart>> CABLE_P2P_TUNNEL = registerPart("cable_p2p_tunnel", WiredCableP2PTunnelPart.class, WiredCableP2PTunnelPart::new); | ||
|
||
private static <T extends IPart> RegistryObject<PartItem<T>> registerPart(String id, Class<T> clazz, Function<IPartItem<T>, T> factory) { | ||
PartModels.registerModels(PartModelsHelper.createModels(clazz)); | ||
return APRegistration.ITEMS.register(id, () -> new PartItem<>(new Item.Properties(), clazz, factory)); | ||
} | ||
|
||
public static void finishRegister() { | ||
P2PTunnelAttunement.registerAttunementTag(CABLE_P2P_TUNNEL.get()); | ||
} | ||
|
||
public static TagKey<Item> getCableP2PTag() { | ||
return P2PTunnelAttunement.getAttunementTag(CABLE_P2P_TUNNEL.get()); | ||
} | ||
|
||
public static void registerTags(Function<TagKey<Item>, TagsProvider.TagAppender<Item>> tagger) { | ||
tagger.apply(getCableP2PTag()) | ||
.add(ModItems.CABLE.get()) | ||
.add(ModItems.WIRED_MODEM.get()) | ||
.add(ModItems.WIRED_MODEM_FULL.get()); | ||
} | ||
} |
20 changes: 0 additions & 20 deletions
20
src/main/java/de/srendi/advancedperipherals/common/addons/ae2/Integration.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
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