Recipes for All

模组

· 作者 mallrat208

解锁完整的原版配方书

0 本站下载 0 关注 更新于 8 年前

最新 Recipes For All - 1.12.2 - 1.0.0 · 1.12.2

一键开服(送7天)

Recipes for All 是一个小型模组,当玩家加入世界时,会解锁原版配方书中的所有配方。连接到安装了此模组的服务器时,客户端无需安装该模组。不过,如果你希望在单人世界中启用此功能,建议将该模组安装在客户端。

没有材料或产出的配方不会被解锁,这样可以防止无法实际制作的损坏配方显示出来。

这是一个极其微小的模组,因此我没有为其托管 GitHub 仓库,而是将源代码附在下面

package com.mr208.rfa;

import com.google.common.collect.Lists; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent;

import java.util.ArrayList;

@EventBusSubscriber @Mod(modid = "rfa", name = "Recipes For All", version = "1.0.0", acceptableRemoteVersions = "*") public class RecipesForAll {

@SubscribeEvent
public static void onPlayerLoggin(PlayerLoggedInEvent event)
{
	if(event.player instanceof EntityPlayerMP)
	{
		ArrayList<IRecipe> recipes = Lists.newArrayList(CraftingManager.REGISTRY);
		recipes.removeIf((recipe)-> recipe.getRecipeOutput().isEmpty());
		recipes.removeIf((recipe)-> recipe.getIngredients().isEmpty());
		event.player.unlockRecipes(recipes);
	}
}

}

你是这个资源的作者?登录后可认领此资源。

评论 0

0.0
暂无评分
5 星
0
4 星
0
3 星
0
2 星
0
1 星
0
我的评分

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源