mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-17 19:15:32 +00:00
Add support for server side only recipes, as well as detection of vanilla client recipe book filter to prevent errors.
This commit is contained in:
1 parent
ee27276ba2
commit
28e341002f
14 files changed
+168
-55
No files matched your search
@@ -17,7 +17,7 @@ import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
@Mod(modid = BlockstateRetextureTest.MODID, name = "BlockstateRetextureTest", version = BlockstateRetextureTest.VERSION, acceptableRemoteVersions = "*")
|
||||
@Mod(modid = BlockstateRetextureTest.MODID, name = "BlockstateRetextureTest", version = BlockstateRetextureTest.VERSION, acceptableRemoteVersions = "*", clientSideOnly = true)
|
||||
public class BlockstateRetextureTest
|
||||
{
|
||||
public static final String MODID = "forge_blockstate_retexture_test";
|
||||
|
||||
@@ -28,8 +28,9 @@ 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.registry.GameRegistry.ObjectHolder;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
@EventBusSubscriber
|
||||
@EventBusSubscriber(Side.CLIENT)
|
||||
@Mod (modid = "guicontainereventtest", name = "GuiContainer Event Tests!", version = "1.0", acceptableRemoteVersions = "*")
|
||||
public class GuiContainerEventTest
|
||||
{
|
||||
|
||||
@@ -11,6 +11,8 @@ import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.relauncher.FMLLaunchHandler;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
@Mod(modid = "recipetest", version = "1.0", acceptableRemoteVersions = "*")
|
||||
@@ -30,10 +32,13 @@ public class RecipeTestMod
|
||||
recipe1.setRegistryName(location1);
|
||||
event.getRegistry().register(recipe1);
|
||||
|
||||
ResourceLocation location2 = new ResourceLocation("recipetest", "stone");
|
||||
CraftingHelper.ShapedPrimer primer1 = CraftingHelper.parseShaped("SSS", 'S', new ItemStack(Blocks.IRON_BLOCK));
|
||||
ShapedRecipes recipe2 = new ShapedRecipes(location2.getResourcePath(), primer1.width, primer1.height, primer1.input, new ItemStack(Blocks.GOLD_BLOCK));
|
||||
recipe2.setRegistryName(location2);
|
||||
event.getRegistry().register(recipe2);
|
||||
if (FMLLaunchHandler.side() == Side.SERVER)
|
||||
{
|
||||
ResourceLocation location2 = new ResourceLocation("recipetest", "stone");
|
||||
CraftingHelper.ShapedPrimer primer1 = CraftingHelper.parseShaped("SSS", 'S', new ItemStack(Blocks.IRON_BLOCK));
|
||||
ShapedRecipes recipe2 = new ShapedRecipes(location2.getResourcePath(), primer1.width, primer1.height, primer1.input, new ItemStack(Blocks.GOLD_BLOCK));
|
||||
recipe2.setRegistryName(location2);
|
||||
event.getRegistry().register(recipe2);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user