Skip to content

Commit

Permalink
add ae2-style-crafting-terminal as a builtin texture pack (close #262)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mari023 committed May 26, 2024
1 parent 1bedd4f commit aac5385
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
- add all terminals to the universal terminal in the creative tab (fix #266)
- show the next terminal on the next terminal button (fix #265)
- change how addon terminals are registered
- add ae2-style-crafting-terminal as a builtin texture pack (close #262)
13 changes: 13 additions & 0 deletions src/main/java/de/mari_023/ae2wtlib/AE2wtlibForge.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.RegistryFriendlyByteBuf;
import net.minecraft.network.chat.Component;
import net.minecraft.network.codec.StreamCodec;
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.server.packs.PackType;
import net.minecraft.server.packs.repository.Pack;
import net.minecraft.server.packs.repository.PackSource;
import net.minecraft.world.item.ItemStack;
import net.neoforged.bus.api.EventPriority;
import net.neoforged.bus.api.IEventBus;
Expand All @@ -18,6 +23,7 @@
import net.neoforged.neoforge.capabilities.Capabilities;
import net.neoforged.neoforge.capabilities.RegisterCapabilitiesEvent;
import net.neoforged.neoforge.common.CommonHooks;
import net.neoforged.neoforge.event.AddPackFindersEvent;
import net.neoforged.neoforge.event.BuildCreativeModeTabContentsEvent;
import net.neoforged.neoforge.event.entity.living.LivingEntityUseItemEvent;
import net.neoforged.neoforge.event.entity.player.ArrowLooseEvent;
Expand Down Expand Up @@ -69,6 +75,13 @@ public AE2wtlibForge(IEventBus modEventBus) {
registerPowerStorageItem(event, AE2wtlibItems.PATTERN_ACCESS_TERMINAL);
registerPowerStorageItem(event, AE2wtlibItems.PATTERN_ENCODING_TERMINAL);
});
modEventBus.addListener((AddPackFindersEvent event) -> event.addPackFinders(
new ResourceLocation(AE2wtlib.MOD_NAME, "ae2_style_wireless_crafting_terminal"),
PackType.CLIENT_RESOURCES,
Component.literal("AE2 style wireless crafting terminal"),
PackSource.BUILT_IN,
false,
Pack.Position.TOP));
}

private static <T extends AE2wtlibPacket> void registerPacket(PayloadRegistrar registrar,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"includes": [
"../terminals/crafting_terminal.json",
"universal_terminal_with_viewcells.json"
],
"slots": {
"AE2WTLIB_TRASH": {
"left": -9999,
"bottom": -9999,
"hidden": true
},
"AE2WTLIB_HELMET": {
"left": -9999,
"bottom": -9999,
"hidden": true
},
"AE2WTLIB_CHESTPLATE": {
"left": -9999,
"bottom": -9999,
"hidden": true
},
"AE2WTLIB_LEGGINGS": {
"left": -9999,
"bottom": -9999,
"hidden": true
},
"AE2WTLIB_BOOTS": {
"left": -9999,
"bottom": -9999,
"hidden": true
},
"AE2WTLIB_OFFHAND": {
"left": -9999,
"bottom": -9999,
"hidden": true
}
},
"widgets": {
"player": {
"left": -9999,
"bottom": -9999
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"pack": {
"pack_format": 32,
"description": "makes ae2wtlib's crafting terminal look like ae2's"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/main/resources/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"pack": {
"pack_format": 8,
"pack_format": 32,
"description": "Resources used for AE2 Wireless Terminals "
}
}

0 comments on commit aac5385

Please sign in to comment.