Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ASSETS_LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
All rights reserved unless explicitly stated.
857 changes: 857 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

34 changes: 23 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
[![CurseForge downloads](http://cf.way2muchnoise.eu/full_1380275_downloads.svg)](https://www.curseforge.com/minecraft/mc-mods/anvilcraft-pigsplus)
[![Modrinth downloads](https://img.shields.io/modrinth/dt/nGMOJKQp?color=00AF5C&label=Modrinth%20downloads&logo=modrinth)](https://modrinth.com/mod/nGMOJKQp)
[![GitHub downloads](https://img.shields.io/github/downloads/TBPig/AnvilCraft-PigsPlus/total?label=Github%20downloads&logo=github)](https://github.com/TBPig/AnvilCraft-PigsPlus/releases)
> 欢迎来到模组《铁砧工艺:猪+》的页面!模组是铁砧工艺的附属,主要内容包括有利于生产的机器:

* 虚弱树脂块:自带虚弱效果的树脂块
* 连锁锻造台:放入工具升级路径上的所有模板材料,一次性升至满级
* 自动皇家锻造台:效果如其名
* 混沌粗矿:合成后可以通过矿脉涌泉生产,高温熔炼随机生产8种金属
* 附魔发电机:根据附魔发电
* 电力附魔台:消耗电力附魔
> 欢迎来到模组《铁砧工艺:猪+》的页面!模组是铁砧工艺的附属,主要内容包括:
* 自动化机器:自动皇家锻造台、自动皇家砂轮、自动珠宝加工台和电力附魔台
* 便捷道具:
* 虚弱树脂块(自带虚弱效果)
* 混沌粗矿(高温熔炼随机生产8种金属)
* 连锁锻造台(将工具一次性升至满级)
* 电网改革:
* 附魔发电机:根据附魔发电
* 可调式能量转换器:将kW与FE双向转换
* 幽匿技术
* 回响母岩:生产幽匿方块与回响碎片
* 幽匿萃取体:获取大量经验

## 使用许可

Expand All @@ -35,28 +39,36 @@
<a title="Ideas, Planning, & Feedback">🤔</a><br />
<a href="https://space.bilibili.com/87423598">87423598</a>
</td>
<td align="center">
<a href="https://github.com/WhereisFff">
<img src="https://avatars.githubusercontent.com/u/141797114?v=4" width="100px;" height="100px" alt=""/><br />
<sub><b>WhereisFff</b></sub>
</a><br />
<a title="Code">💻</a> <br />
<a href="https://space.bilibili.com/347845823">347845823</a>
</td>
<td align="center">
<a href="https://github.com/CgAu3">
<img src="https://avatars.githubusercontent.com/u/52217193?v=4" width="100px;" height="100px" alt=""/><br />
<sub><b>Abslb</b></sub>
</a><br />
<a title="Code">🎨</a> <br />
<a title="Art">🎨</a> <br />
<a href="https://space.bilibili.com/3546626188643186">35466261...</a>
</td>
<td align="center">
<a href="https://github.com/CrazyDataVolt">
<img src="https://avatars.githubusercontent.com/u/224349552?v=4" width="100px;" height="100px" alt=""/><br />
<sub><b>CrazyDataVolt</b></sub>
</a><br />
<a title="Code">🎨</a> <br />
<a title="Art">🎨</a> <br />
<a href="https://space.bilibili.com/336411075">336411075</a>
</td>
<td align="center">
<a href="https://github.com/fnshwj">
<img src="https://avatars.githubusercontent.com/u/138283006?v=4" width="100px;" height="100px" alt=""/><br />
<sub><b>fnshwj</b></sub>
</a><br />
<a title="Code">🎨</a> <br />
<a title="Art">🎨</a> <br />
</td>
</tr>
</table>
Expand Down
34 changes: 23 additions & 11 deletions README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
[![CurseForge downloads](http://cf.way2muchnoise.eu/full_1380275_downloads.svg)](https://www.curseforge.com/minecraft/mc-mods/anvilcraft-pigsplus)
[![Modrinth downloads](https://img.shields.io/modrinth/dt/nGMOJKQp?color=00AF5C&label=Modrinth%20downloads&logo=modrinth)](https://modrinth.com/mod/nGMOJKQp)
[![GitHub downloads](https://img.shields.io/github/downloads/TBPig/AnvilCraft-PigsPlus/total?label=Github%20downloads&logo=github)](https://github.com/TBPig/AnvilCraft-PigsPlus/releases)
> Welcome to the page for the mod "AnvilCraft: PigsPlus"! This mod is an addon for AnvilCraft, with main content including production-friendly machines:

- Weak Resin Block: Resin block with built-in Weakness effect
- Chain Forge: Place all templates and materials in the tool upgrade path to upgrade to maximum level in one go
- Automatic Royal Forge: Effect is as the name suggests
- Chaotic Raw Ore: After crafting, it can be produced through ore vein springs, and high-temperature smelting randomly produces 8 types of metals
- Enchantment Generator: Generates power based on enchantments
- Electric Enchantment Table: Consumes electricity for enchanting
> Welcome to the page for the mod "AnvilCraft: PigsPlus"! This mod is an addon for AnvilCraft, with main content including:
* Automated Machines: Automatic Royal Smithing Table, Automatic Royal Grindstone, Automatic Jewel Crafting Table, and Electric Enchanting Table
* Convenient Items:
* Weak Resin Block (Built-in Weakness effect)
* Chaotic Raw Ore (Randomly produces 8 types of metals when smelted at high temperature)
* Chain Smithing Table (Upgrades tools to maximum level in one go)
* Power Grid Reform:
* Enchantment Generator: Generates power based on enchantments
* Adjustable Power Converter: Bidirectional conversion between kW and FE
* Sculk Technology:
* Echo Cluster: Produces sculk blocks and echo shards
* Sculk Extractor: Obtain large amounts of experience

## Usage License

Expand All @@ -35,28 +39,36 @@
<a title="Ideas, Planning, & Feedback">🤔</a><br />
<a href="https://space.bilibili.com/87423598">87423598</a>
</td>
<td align="center">
<a href="https://github.com/WhereisFff">
<img src="https://avatars.githubusercontent.com/u/141797114?v=4" width="100px;" height="100px" alt=""/><br />
<sub><b>WhereisFff</b></sub>
</a><br />
<a title="Code">💻</a> <br />
<a href="https://space.bilibili.com/347845823">347845823</a>
</td>
<td align="center">
<a href="https://github.com/CgAu3">
<img src="https://avatars.githubusercontent.com/u/52217193?v=4" width="100px;" height="100px" alt=""/><br />
<sub><b>Abslb</b></sub>
</a><br />
<a title="Code">🎨</a> <br />
<a title="Art">🎨</a> <br />
<a href="https://space.bilibili.com/3546626188643186">35466261...</a>
</td>
<td align="center">
<a href="https://github.com/CrazyDataVolt">
<img src="https://avatars.githubusercontent.com/u/224349552?v=4" width="100px;" height="100px" alt=""/><br />
<sub><b>CrazyDataVolt</b></sub>
</a><br />
<a title="Code">🎨</a> <br />
<a title="Art">🎨</a> <br />
<a href="https://space.bilibili.com/336411075">336411075</a>
</td>
<td align="center">
<a href="https://github.com/fnshwj">
<img src="https://avatars.githubusercontent.com/u/138283006?v=4" width="100px;" height="100px" alt=""/><br />
<sub><b>fnshwj</b></sub>
</a><br />
<a title="Code">🎨</a> <br />
<a title="Art">🎨</a> <br />
</td>
</tr>
</table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
"item.anvilcraft_pigsplus.karakuri_component": "ʇuǝuodɯoƆ ıɹnʞɐɹɐʞ",
"item.anvilcraft_pigsplus.spiritual_component": "ʇuǝuodɯoƆ ןɐnʇıɹıdS",
"itemGroup.anvilcraft_pigsplus.addon_items": "snןԀ sbıԀ :ʇɟɐɹƆןıʌuⱯ",
"jei.anvilcraft.pigsplus.info.ender_component": "˙ʇuǝuodɯoƆ ɹǝpuƎ ɐ uıɐʇqo oʇ ǝɔuɐɥɔ %0ᄅ ɐ sı ǝɹǝɥʇ 'ןɐʇɹod puƎ ǝɥʇ oʇuı ʇuǝuodɯoƆ ıɹnʞɐɹɐʞ ɐ ʍoɹɥ⟘",
"jei.anvilcraft.pigsplus.info.spiritual_component": "˙ʇuǝuodɯoƆ ɯnıpǝW ǝuo ʇsoɯ ʇɐ ǝʇɐɹǝuǝb oʇ ǝɔuɐɥɔ %0ᄅ ɐ sǝpıʌoɹd ʇuǝɯʇuɐɥɔuǝ ɥɔɐǝ 'pǝʎoɹʇsǝp sı ʇuǝuodɯoƆ ıɹnʞɐɹɐʞ ɐ uǝɥM",
"tooltip.anvilcraft.pigsplus.enchanted_generator.max_power_value": "Mʞ %d :uoıʇdɯnsuoɔ ɹǝʍod xɐW",
"tooltip.anvilcraft.pigsplus.enchanted_generator.power_rate": "%s :ǝʇɐɹ uoıʇdɯnsuoɔ ɹǝʍoԀ",
"tooltip.anvilcraft.pigsplus.enchanted_generator.time": "%s :ǝɯıʇ buıuıɐɯǝᴚ"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
"item.anvilcraft_pigsplus.karakuri_component": "Karakuri Component",
"item.anvilcraft_pigsplus.spiritual_component": "Spiritual Component",
"itemGroup.anvilcraft_pigsplus.addon_items": "AnvilCraft: Pigs Plus",
"jei.anvilcraft.pigsplus.info.ender_component": "Throw a Karakuri Component into the End portal, there is a 20% chance to obtain a Ender Component.",
"jei.anvilcraft.pigsplus.info.spiritual_component": "When a Karakuri Component is destroyed, each enchantment provides a 20% chance to generate at most one Medium Component.",
"tooltip.anvilcraft.pigsplus.enchanted_generator.max_power_value": "Max power consumption: %d kW",
"tooltip.anvilcraft.pigsplus.enchanted_generator.power_rate": "Power consumption rate: %s",
"tooltip.anvilcraft.pigsplus.enchanted_generator.time": "Remaining time: %s"
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/dev/anvilcraft/pigsplus/data/lang/JeiLang.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package dev.anvilcraft.pigsplus.data.lang;

import com.tterrag.registrate.providers.RegistrateLangProvider;

public class JeiLang {
@SuppressWarnings("checkstyle:LineLength")
public static void init(RegistrateLangProvider provider) {
provider.add(
"jei.anvilcraft.pigsplus.info.spiritual_component",
"When a Karakuri Component is destroyed, each enchantment provides a 20% chance to generate at most one Medium Component."
);

provider.add(
"jei.anvilcraft.pigsplus.info.ender_component",
"Throw a Karakuri Component into the End portal, there is a 20% chance to obtain a Ender Component."
);


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class LangHandler {
*/
public static void init(RegistrateLangProvider provider) {
ConfigData.readConfigClass(provider, AddonServerConfig.class);
JeiLang.init(provider);

provider.add(
"block.anvilcraft_pigsplus.enchanted_generator.placement_too_close_to_another",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.tterrag.registrate.providers.RegistrateRecipeProvider;
import dev.anvilcraft.pigsplus.init.AddonBlocks;
import dev.anvilcraft.pigsplus.init.AddonItems;
import dev.dubhe.anvilcraft.init.item.ModItems;
import dev.dubhe.anvilcraft.recipe.anvil.wrap.ItemInjectRecipe;
import dev.dubhe.anvilcraft.recipe.anvil.wrap.TimeWarpRecipe;
import dev.dubhe.anvilcraft.recipe.mineral.MineralFountainRecipe;
Expand Down Expand Up @@ -33,6 +34,7 @@ public static void init(RegistrateRecipeProvider provider) {
.requires(Items.ENDER_PEARL)
.requires(Items.END_STONE,3)
.result(AddonItems.ENDER_COMPONENT,0.2f)
.result(ModItems.LEVITATION_POWDER)
.save(provider);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package dev.anvilcraft.pigsplus.integration.jei;

import dev.anvilcraft.pigsplus.AnvilCraftPigsPlus;
import dev.anvilcraft.pigsplus.init.AddonItems;
import mezz.jei.api.IModPlugin;
import mezz.jei.api.JeiPlugin;
import mezz.jei.api.registration.IRecipeRegistration;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;

@JeiPlugin
public class AddonJeiPlugin implements IModPlugin {

@Override
public ResourceLocation getPluginUid() {
return AnvilCraftPigsPlus.of("jei_plugin");
}

@Override
public void registerRecipes(IRecipeRegistration registration) {
registration.addItemStackInfo(
AddonItems.SPIRITUAL_COMPONENT.asStack(),
Component.translatable("jei.anvilcraft.pigsplus.info.spiritual_component")
);

registration.addItemStackInfo(
AddonItems.ENDER_COMPONENT.asStack(),
Component.translatable("jei.anvilcraft.pigsplus.info.ender_component")
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@net.minecraft.MethodsReturnNonnullByDefault
@javax.annotation.ParametersAreNonnullByDefault
package dev.anvilcraft.pigsplus.integration.jei;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@net.minecraft.MethodsReturnNonnullByDefault
@javax.annotation.ParametersAreNonnullByDefault
package dev.anvilcraft.pigsplus.integration.jei.recipe;
18 changes: 9 additions & 9 deletions src/main/java/dev/anvilcraft/pigsplus/mixin/EntityMixin.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package dev.anvilcraft.pigsplus.mixin;

import dev.anvilcraft.pigsplus.init.AddonItems;
import dev.anvilcraft.pigsplus.util.MathUtil;
import dev.dubhe.anvilcraft.api.injection.entity.IEntityExtension;
import dev.dubhe.anvilcraft.init.item.ModItems;
import net.minecraft.world.entity.Entity;
Expand All @@ -13,6 +14,8 @@
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import static dev.anvilcraft.pigsplus.util.EnderComponentConversionUtil.ConversionChance;

@Mixin(Entity.class)
public abstract class EntityMixin implements IEntityExtension {

Expand All @@ -29,15 +32,11 @@ private void handlePortal(CallbackInfo ci) {
if ((Object) this instanceof ItemEntity itemEntity) {
if (itemEntity.getItem().is(AddonItems.KARAKURI_COMPONENT)) {
int count = itemEntity.getItem().getCount();
int spiritualCount = 0;
int levitationCount = 0;
// 循环使用随机数判断漂浮粉和灵媒部件的数量
for (int i = 0; i < count; i++) {
if (this.level.random.nextDouble() < 0.2) spiritualCount++;
else levitationCount++;
} // 三种情况 ↓
int spiritualCount = MathUtil.getCount(ConversionChance, count, level);
int levitationCount = count - spiritualCount;
// 三种情况 ↓
if (spiritualCount == count) { // 都转化成灵媒部件,如一两个机巧部件,又或者……欧洲人打过来了?
itemEntity.setItem(new ItemStack(AddonItems.SPIRITUAL_COMPONENT.get(), count));
itemEntity.setItem(new ItemStack(AddonItems.ENDER_COMPONENT.get(), count));
} else if (levitationCount == count) { // 都转化成漂浮粉,如一两个机巧部件,又或者……酋长我们回非洲吧(
itemEntity.setItem(new ItemStack(ModItems.LEVITATION_POWDER.get(), count));
} else { // 原物品堆转化成漂浮粉,原位置生成新的灵媒核心物品堆
Expand All @@ -47,9 +46,10 @@ private void handlePortal(CallbackInfo ci) {
itemEntity.getX(),
itemEntity.getY(),
itemEntity.getZ(),
new ItemStack(AddonItems.SPIRITUAL_COMPONENT.get(), spiritualCount)
new ItemStack(AddonItems.ENDER_COMPONENT.get(), spiritualCount)
); // 让新物品堆和原来的动量一样
newEntity.setDeltaMovement(itemEntity.getDeltaMovement());
newEntity.setDefaultPickUpDelay();
this.level.addFreshEntity(newEntity);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package dev.anvilcraft.pigsplus.util;

public class EnderComponentConversionUtil {
public static final float ConversionChance = 0.2f;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
{
"type": "anvilcraft:time_warp",
"recipe": "anvilcraft:time_warp/ender_component",
"text": "只有20%%成功合成率 $(p)蕴涵传送之力"
"text": "只有20%%成功合成率 $(li)将$(item)机巧部件$()丢入末地传送门,同样有20%%概率获得 $(p)$(#888888)蕴涵传送之力$()"
}
]
}
2 changes: 2 additions & 0 deletions src/main/resources/assets/anvilcraft_pigsplus/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
"item.anvilcraft_pigsplus.karakuri_component": "机巧部件",
"item.anvilcraft_pigsplus.spiritual_component": "灵媒部件",
"itemGroup.anvilcraft_pigsplus.addon_items": "铁砧工艺:猪+",
"jei.anvilcraft.pigsplus.info.ender_component": "将机巧部件丢入末地传送门,有20%概率获得",
"jei.anvilcraft.pigsplus.info.spiritual_component": "携带附魔的机巧部件被摧毁时,每条附魔提供20%的概率,生成最多一个灵媒部件",
"tooltip.anvilcraft.pigsplus.enchanted_generator.max_power_value": "耗电上限: %d kW",
"tooltip.anvilcraft.pigsplus.enchanted_generator.power_rate": "耗能率: %s",
"tooltip.anvilcraft.pigsplus.enchanted_generator.time": "剩余时间: %s"
Expand Down