diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..bc4961c --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +patreon: raoulvdberge \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 86c7323..714276f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,18 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ### Added +- Added German translation by [@Wizqok](https://github.com/Wizqok). +- Added Korean translation by [@mindy15963](https://github.com/mindy15963). + +### Fixed + +- Fixed random client crashes by [@malte0811](https://github.com/malte0811). +- Fixed crash when Extractor Attachment is interacting with inventories that have no slots. + +## [0.6.0] - 2021-12-18 + +### Added + - Ported to Minecraft 1.18.1. ## [0.5.1] - 2021-11-28 diff --git a/build.gradle b/build.gradle index bf492dc..2126a3f 100644 --- a/build.gradle +++ b/build.gradle @@ -25,7 +25,7 @@ apply plugin: 'maven-publish' group = 'com.refinedmods' archivesBaseName = 'refinedpipes' -version = '0.6.0' +version = '0.6.1' if (System.getenv('GITHUB_SHA') != null) { version += '+' + System.getenv('GITHUB_SHA').substring(0, 7) @@ -86,7 +86,7 @@ processResources { } dependencies { - minecraft 'net.minecraftforge:forge:1.18.1-39.0.0' + minecraft 'net.minecraftforge:forge:1.18.1-39.0.59' runtimeOnly fg.deobf("mezz.jei:jei-1.18.1:9.1.0.41") } diff --git a/images/energy_pipes.png b/images/energy_pipes.png deleted file mode 100644 index 645d190..0000000 Binary files a/images/energy_pipes.png and /dev/null differ diff --git a/images/fluid_pipes.png b/images/fluid_pipes.png deleted file mode 100644 index c259d95..0000000 Binary files a/images/fluid_pipes.png and /dev/null differ diff --git a/images/icon.png b/images/icon.png index da76256..ae82857 100644 Binary files a/images/icon.png and b/images/icon.png differ diff --git a/images/item_pipes.png b/images/item_pipes.png deleted file mode 100644 index ae81d1c..0000000 Binary files a/images/item_pipes.png and /dev/null differ diff --git a/src/main/java/com/refinedmods/refinedpipes/RefinedPipes.java b/src/main/java/com/refinedmods/refinedpipes/RefinedPipes.java index 84a9150..c7611d2 100644 --- a/src/main/java/com/refinedmods/refinedpipes/RefinedPipes.java +++ b/src/main/java/com/refinedmods/refinedpipes/RefinedPipes.java @@ -20,14 +20,13 @@ @Mod(RefinedPipes.ID) public class RefinedPipes { public static final String ID = "refinedpipes"; - public static final CreativeModeTab MAIN_GROUP = new MainCreativeModeTab(); + public static final CreativeModeTab CREATIVE_MODE_TAB = new MainCreativeModeTab(); public static final RefinedPipesNetwork NETWORK = new RefinedPipesNetwork(); public static final ServerConfig SERVER_CONFIG = new ServerConfig(); public RefinedPipes() { DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> { - FMLJavaModLoadingContext.get().getModEventBus().addListener(ClientSetup::onClientSetup); - FMLJavaModLoadingContext.get().getModEventBus().addListener(ClientSetup::onModelBake); + FMLJavaModLoadingContext.get().getModEventBus().register(ClientSetup.class); }); ModLoadingContext.get().registerConfig(ModConfig.Type.SERVER, SERVER_CONFIG.getSpec()); diff --git a/src/main/java/com/refinedmods/refinedpipes/item/AttachmentItem.java b/src/main/java/com/refinedmods/refinedpipes/item/AttachmentItem.java index e49de8f..12578a1 100644 --- a/src/main/java/com/refinedmods/refinedpipes/item/AttachmentItem.java +++ b/src/main/java/com/refinedmods/refinedpipes/item/AttachmentItem.java @@ -15,7 +15,7 @@ public class AttachmentItem extends Item { private final AttachmentFactory type; public AttachmentItem(AttachmentFactory type) { - super(new Item.Properties().tab(RefinedPipes.MAIN_GROUP)); + super(new Item.Properties().tab(RefinedPipes.CREATIVE_MODE_TAB)); this.type = type; diff --git a/src/main/java/com/refinedmods/refinedpipes/item/BaseBlockItem.java b/src/main/java/com/refinedmods/refinedpipes/item/BaseBlockItem.java index 7e178bc..bcf09bc 100644 --- a/src/main/java/com/refinedmods/refinedpipes/item/BaseBlockItem.java +++ b/src/main/java/com/refinedmods/refinedpipes/item/BaseBlockItem.java @@ -7,7 +7,7 @@ public class BaseBlockItem extends BlockItem { public BaseBlockItem(Block block) { - super(block, new Item.Properties().tab(RefinedPipes.MAIN_GROUP)); + super(block, new Item.Properties().tab(RefinedPipes.CREATIVE_MODE_TAB)); this.setRegistryName(block.getRegistryName()); } diff --git a/src/main/java/com/refinedmods/refinedpipes/network/graph/NetworkGraph.java b/src/main/java/com/refinedmods/refinedpipes/network/graph/NetworkGraph.java index a2c208f..1a12fc6 100644 --- a/src/main/java/com/refinedmods/refinedpipes/network/graph/NetworkGraph.java +++ b/src/main/java/com/refinedmods/refinedpipes/network/graph/NetworkGraph.java @@ -19,10 +19,10 @@ public NetworkGraph(Network network) { this.network = network; } - public NetworkGraphScannerResult scan(Level originWorld, BlockPos originPos) { + public NetworkGraphScannerResult scan(Level originLevel, BlockPos originPos) { NetworkGraphScanner scanner = new NetworkGraphScanner(pipes, network.getType()); - NetworkGraphScannerResult result = scanner.scanAt(originWorld, originPos); + NetworkGraphScannerResult result = scanner.scanAt(originLevel, originPos); this.pipes = result.getFoundPipes(); diff --git a/src/main/java/com/refinedmods/refinedpipes/network/pipe/attachment/extractor/ExtractorAttachment.java b/src/main/java/com/refinedmods/refinedpipes/network/pipe/attachment/extractor/ExtractorAttachment.java index 9d2c8cd..b62ca8c 100644 --- a/src/main/java/com/refinedmods/refinedpipes/network/pipe/attachment/extractor/ExtractorAttachment.java +++ b/src/main/java/com/refinedmods/refinedpipes/network/pipe/attachment/extractor/ExtractorAttachment.java @@ -163,6 +163,10 @@ private void update(ItemNetwork network, BlockPos sourcePos, IItemHandler source } private Pair findDestinationAndSourceSlot(BlockPos sourcePos, IItemHandler source) { + if (source.getSlots() <= 0) { + return null; + } + int startIndex = 0; do { diff --git a/src/main/java/com/refinedmods/refinedpipes/setup/ClientSetup.java b/src/main/java/com/refinedmods/refinedpipes/setup/ClientSetup.java index 5e40b0b..8bcda7e 100644 --- a/src/main/java/com/refinedmods/refinedpipes/setup/ClientSetup.java +++ b/src/main/java/com/refinedmods/refinedpipes/setup/ClientSetup.java @@ -21,6 +21,7 @@ import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.resources.ResourceLocation; import net.minecraftforge.client.event.ModelBakeEvent; +import net.minecraftforge.client.event.ModelRegistryEvent; import net.minecraftforge.client.model.ForgeModelBakery; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; @@ -38,7 +39,7 @@ private ClientSetup() { } @SubscribeEvent - public static void onClientSetup(FMLClientSetupEvent e) { + public static void registerSpecialModels(ModelRegistryEvent ev) { for (AttachmentFactory factory : AttachmentRegistry.INSTANCE.all()) { LOGGER.debug("Registering attachment model {}", factory.getModelLocation()); @@ -70,7 +71,10 @@ public static void onClientSetup(FMLClientSetupEvent e) { } ForgeModelBakery.addSpecialModel(new ResourceLocation(RefinedPipes.ID + ":block/pipe/attachment/inventory_attachment")); + } + @SubscribeEvent + public static void onClientSetup(FMLClientSetupEvent e) { MenuScreens.register(RefinedPipesContainerMenus.EXTRACTOR_ATTACHMENT, ExtractorAttachmentScreen::new); ItemBlockRenderTypes.setRenderLayer(RefinedPipesBlocks.BASIC_ITEM_PIPE, RenderType.cutout()); diff --git a/src/main/resources/assets/refinedpipes/lang/de_de.json b/src/main/resources/assets/refinedpipes/lang/de_de.json new file mode 100644 index 0000000..e35178b --- /dev/null +++ b/src/main/resources/assets/refinedpipes/lang/de_de.json @@ -0,0 +1,49 @@ +{ + "itemGroup.refinedpipes": "Refined Pipes", + "block.refinedpipes.basic_item_pipe": "Einfaches Item Rohr", + "block.refinedpipes.improved_item_pipe": "Verbessertes Item Rohr", + "block.refinedpipes.advanced_item_pipe": "Fortgeschrittenes Item Rohr", + "block.refinedpipes.basic_fluid_pipe": "Einfaches Flüssigkeits Rohr", + "block.refinedpipes.improved_fluid_pipe": "Verbessertes Flüssigkeits Rohr", + "block.refinedpipes.advanced_fluid_pipe": "Fortgeschrittenes Flüssigkeits Rohr", + "block.refinedpipes.elite_fluid_pipe": "Elite Flüssigkeits Rohr", + "block.refinedpipes.ultimate_fluid_pipe": "Ultimatives Flüssigkeits Rohr", + "block.refinedpipes.basic_energy_pipe": "Einfaches Energie Rohr", + "block.refinedpipes.improved_energy_pipe": "Verbessertes Energie Rohr", + "block.refinedpipes.advanced_energy_pipe": "Fortgeschrittenes Energie Rohr", + "block.refinedpipes.elite_energy_pipe": "Elite Energie Rohr", + "block.refinedpipes.ultimate_energy_pipe": "Ultimatives Energie Rohr", + "item.refinedpipes.basic_extractor_attachment": "Einfacher Extraktor Aufsatz", + "item.refinedpipes.improved_extractor_attachment": "Verbesserter Extraktor Aufsatz", + "item.refinedpipes.advanced_extractor_attachment": "Fortgeschrittener Extraktor Aufsatz", + "item.refinedpipes.elite_extractor_attachment": "Elite Extraktor Aufsatz", + "item.refinedpipes.ultimate_extractor_attachment": "Ultimativer Extraktor Aufsatz", + "misc.refinedpipes.tier": "Stufe %s", + "tooltip.refinedpipes.fluid_pipe.capacity": "Kapazität: %s", + "tooltip.refinedpipes.item_pipe.speed": "Tempo: %s", + "tooltip.refinedpipes.fluid_pipe.transfer_rate": "Transferrate: %s", + "tooltip.refinedpipes.energy_pipe.capacity": "Kapazität: %s", + "tooltip.refinedpipes.energy_pipe.transfer_rate": "Transferrate: %s", + "tooltip.refinedpipes.extractor_attachment.item_extraction_rate": "Extrahiert %s jede %s", + "tooltip.refinedpipes.extractor_attachment.fluid_extraction_rate": "Extrahiert %s jede %s", + "tooltip.refinedpipes.extractor_attachment.filter_slots": "%d Filterplätze", + "misc.refinedpipes.second": "Sekunde", + "misc.refinedpipes.seconds": "Sekunden", + "misc.refinedpipes.item": "Item", + "misc.refinedpipes.items": "Items", + "misc.refinedpipes.redstone_mode": "Redstone-Modus", + "misc.refinedpipes.redstone_mode.ignored": "Ignoriert", + "misc.refinedpipes.redstone_mode.high": "Hoch", + "misc.refinedpipes.redstone_mode.low": "Tief", + "misc.refinedpipes.mode": "Filter-Modus", + "misc.refinedpipes.mode.blacklist": "Blacklist", + "misc.refinedpipes.mode.whitelist": "Whitelist", + "misc.refinedpipes.routing_mode": "Routing-Modus", + "misc.refinedpipes.routing_mode.nearest": "Näheste erstes", + "misc.refinedpipes.routing_mode.furthest": "Weiteste erstes", + "misc.refinedpipes.routing_mode.random": "Zufällig", + "misc.refinedpipes.routing_mode.round_robin": "Round-robin", + "misc.refinedpipes.exact_mode": "Exakter-Modus", + "misc.refinedpipes.exact_mode.on": "An", + "misc.refinedpipes.exact_mode.off": "Aus" +} diff --git a/src/main/resources/assets/refinedpipes/lang/ko_kr.json b/src/main/resources/assets/refinedpipes/lang/ko_kr.json new file mode 100644 index 0000000..c4c48aa --- /dev/null +++ b/src/main/resources/assets/refinedpipes/lang/ko_kr.json @@ -0,0 +1,49 @@ +{ + "itemGroup.refinedpipes": "리파인드 파이프즈", + "block.refinedpipes.basic_item_pipe": "기본 아이템 파이프", + "block.refinedpipes.improved_item_pipe": "강화 아이템 파이프", + "block.refinedpipes.advanced_item_pipe": "고급 아이템 파이프", + "block.refinedpipes.basic_fluid_pipe": "기본 액체 파이프", + "block.refinedpipes.improved_fluid_pipe": "강화 액체 파이프", + "block.refinedpipes.advanced_fluid_pipe": "고급 액체 파이프", + "block.refinedpipes.elite_fluid_pipe": "특급 액체 파이프", + "block.refinedpipes.ultimate_fluid_pipe": "초특급 액체 파이프", + "block.refinedpipes.basic_energy_pipe": "기본 에너지 파이프", + "block.refinedpipes.improved_energy_pipe": "강화 에너지 파이프", + "block.refinedpipes.advanced_energy_pipe": "고급 에너지 파이프", + "block.refinedpipes.elite_energy_pipe": "특급 에너지 파이프", + "block.refinedpipes.ultimate_energy_pipe": "초특급 에너지 파이프", + "item.refinedpipes.basic_extractor_attachment": "기본 추출기 부가 기구", + "item.refinedpipes.improved_extractor_attachment": "강화 추출기 부가 기구", + "item.refinedpipes.advanced_extractor_attachment": "고급 추출기 부가 기구", + "item.refinedpipes.elite_extractor_attachment": "특급 추출기 부가 기구", + "item.refinedpipes.ultimate_extractor_attachment": "초특급 추출기 부가 기구", + "misc.refinedpipes.tier": "%s 단계", + "tooltip.refinedpipes.fluid_pipe.capacity": "용량: %s", + "tooltip.refinedpipes.item_pipe.speed": "속도: %s", + "tooltip.refinedpipes.fluid_pipe.transfer_rate": "전송률: %s", + "tooltip.refinedpipes.energy_pipe.capacity": "용량: %s", + "tooltip.refinedpipes.energy_pipe.transfer_rate": "전송률: %s", + "tooltip.refinedpipes.extractor_attachment.item_extraction_rate": "%s마다 %s 추출", + "tooltip.refinedpipes.extractor_attachment.fluid_extraction_rate": "%s마다 %s 추출", + "tooltip.refinedpipes.extractor_attachment.filter_slots": "%d개의 필터 슬롯", + "misc.refinedpipes.second": "초", + "misc.refinedpipes.seconds": "초", + "misc.refinedpipes.item": "아이템", + "misc.refinedpipes.items": "아이템", + "misc.refinedpipes.redstone_mode": "레드스톤 모드", + "misc.refinedpipes.redstone_mode.ignored": "무시됨", + "misc.refinedpipes.redstone_mode.high": "높음", + "misc.refinedpipes.redstone_mode.low": "낮음", + "misc.refinedpipes.mode": "필터 모드", + "misc.refinedpipes.mode.blacklist": "블랙리스트", + "misc.refinedpipes.mode.whitelist": "화이트리스트", + "misc.refinedpipes.routing_mode": "라우팅 모드", + "misc.refinedpipes.routing_mode.nearest": "선입선출", + "misc.refinedpipes.routing_mode.furthest": "후입선출", + "misc.refinedpipes.routing_mode.random": "랜덤", + "misc.refinedpipes.routing_mode.round_robin": "라운드 로빈", + "misc.refinedpipes.exact_mode": "추출 모드", + "misc.refinedpipes.exact_mode.on": "켜짐", + "misc.refinedpipes.exact_mode.off": "꺼짐" +}