Bonjour,
Voila je cherchais via un mod forge à modifier une class du jeu (impossible de modder directement le .jar quand c'est pour un serveur ^^)
C'est en fait pour changer les potions (nerf des potions de force 2).
Je ne suis pas le meilleur en modage (c'est pourquoi je suis ici ) donc j'ai essayé pas mal de trucs.
J'ai vu sur un site qu'il fallais creer un event du coup la class de mon mod est comme ceci :
Le changement se situe sur le glowstone effect. Mais pour une raison que j'ignore forge reconnais bien le mod mais le changement ne se fais pas. J'ai peux être tout raté, si c'est le cas merci de votre aide
Voila je cherchais via un mod forge à modifier une class du jeu (impossible de modder directement le .jar quand c'est pour un serveur ^^)
C'est en fait pour changer les potions (nerf des potions de force 2).
Je ne suis pas le meilleur en modage (c'est pourquoi je suis ici ) donc j'ai essayé pas mal de trucs.
J'ai vu sur un site qu'il fallais creer un event du coup la class de mon mod est comme ceci :
Code:
package yPotion;
/**
*
*/
/**
* @author NTE
*
*/
import net.minecraft.block.Block;
import net.minecraft.block.BlockOre;
import net.minecraft.block.BlockOreStorage;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.EnumArmorMaterial;
import net.minecraft.item.EnumToolMaterial;
import net.minecraft.item.Item;
import net.minecraft.item.ItemAppleGold;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemAxe;
import net.minecraft.item.ItemFood;
import net.minecraftforge.common.EnumHelper;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemSpade;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.potion.*;
import net.minecraft.src.ModLoader;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenMinable;
import torti.mod.common.CommonProxy;
import cpw.mods.fml.common.Mod;
import net.minecraft.potion.*;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.Mod.PreInit;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import torti.mod.*;
import yPotion3.CommonProxy2;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Random;
@Mod(modid = "19999", name = "Tortiiiiiicounette", version = "1.0.0.0")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)
public class Potion extends net.minecraft.potion.PotionHelper
{
public static final String MODID = null;
@Instance("ModCatnos")
public static Potion modInstance;
@SidedProxy(clientSide="yPotion2.ClientProxy2", serverSide="yPotion3.CommonProxy2", bukkitSide="yPotion3.CommonProxy2")
public static CommonProxy2 proxy;
@PreInit
public void initConfig(FMLPreInitializationEvent event)
{
proxy.registerRender();
}
@Init
public void load(FMLInitializationEvent event)
{
net.minecraft.potion.PotionHelper.potionRequirements.put(Integer.valueOf(net.minecraft.potion.Potion.regeneration.getId()), "0 & !1 & !2 & !3 & 0+6");
net.minecraft.potion.PotionHelper.sugarEffect = "-0+1-2-3&4-4+13";
net.minecraft.potion.PotionHelper.potionRequirements.put(Integer.valueOf(net.minecraft.potion.Potion.moveSpeed.getId()), "!0 & 1 & !2 & !3 & 1+6");
net.minecraft.potion.PotionHelper.magmaCreamEffect = "+0+1-2-3&4-4+13";
net.minecraft.potion.PotionHelper.potionRequirements.put(Integer.valueOf(net.minecraft.potion.Potion.fireResistance.getId()), "0 & 1 & !2 & !3 & 0+6");
net.minecraft.potion.PotionHelper.speckledMelonEffect = "+0-1+2-3&4-4+13";
net.minecraft.potion.PotionHelper.potionRequirements.put(Integer.valueOf(net.minecraft.potion.Potion.heal.getId()), "0 & !1 & 2 & !3");
net.minecraft.potion.PotionHelper.spiderEyeEffect = "-0-1+2-3&4-4+13";
net.minecraft.potion.PotionHelper.potionRequirements.put(Integer.valueOf(net.minecraft.potion.Potion.poison.getId()), "!0 & !1 & 2 & !3 & 2+6");
net.minecraft.potion.PotionHelper.fermentedSpiderEyeEffect = "-0+3-4+13";
net.minecraft.potion.PotionHelper.potionRequirements.put(Integer.valueOf(net.minecraft.potion.Potion.weakness.getId()), "!0 & !1 & !2 & 3 & 3+6");
net.minecraft.potion.PotionHelper.potionRequirements.put(Integer.valueOf(net.minecraft.potion.Potion.harm.getId()), "!0 & !1 & 2 & 3");
net.minecraft.potion.PotionHelper.potionRequirements.put(Integer.valueOf(net.minecraft.potion.Potion.moveSlowdown.getId()), "!0 & 1 & !2 & 3 & 3+6");
net.minecraft.potion.PotionHelper.blazePowderEffect = "+0-1-2+3&4-4+13";
net.minecraft.potion.PotionHelper.potionRequirements.put(Integer.valueOf(net.minecraft.potion.Potion.damageBoost.getId()), "0 & !1 & !2 & 3 & 3+6");
net.minecraft.potion.PotionHelper.goldenCarrotEffect = "-0+1+2-3+13&4-4";
net.minecraft.potion.PotionHelper.potionRequirements.put(Integer.valueOf(net.minecraft.potion.Potion.nightVision.getId()), "!0 & 1 & 2 & !3 & 2+6");
net.minecraft.potion.PotionHelper.potionRequirements.put(Integer.valueOf(net.minecraft.potion.Potion.invisibility.getId()), "!0 & 1 & 2 & 3 & 2+6");
net.minecraft.potion.PotionHelper.glowstoneEffect = "3+6";
net.minecraft.potion.PotionHelper.potionAmplifiers.put(Integer.valueOf(net.minecraft.potion.Potion.moveSpeed.getId()), "5");
net.minecraft.potion.PotionHelper.potionAmplifiers.put(Integer.valueOf(net.minecraft.potion.Potion.digSpeed.getId()), "5");
net.minecraft.potion.PotionHelper.potionAmplifiers.put(Integer.valueOf(net.minecraft.potion.Potion.damageBoost.getId()), "5");
net.minecraft.potion.PotionHelper.potionAmplifiers.put(Integer.valueOf(net.minecraft.potion.Potion.regeneration.getId()), "5");
net.minecraft.potion.PotionHelper.potionAmplifiers.put(Integer.valueOf(net.minecraft.potion.Potion.harm.getId()), "5");
net.minecraft.potion.PotionHelper.potionAmplifiers.put(Integer.valueOf(net.minecraft.potion.Potion.heal.getId()), "5");
net.minecraft.potion.PotionHelper.potionAmplifiers.put(Integer.valueOf(net.minecraft.potion.Potion.resistance.getId()), "5");
net.minecraft.potion.PotionHelper.potionAmplifiers.put(Integer.valueOf(net.minecraft.potion.Potion.poison.getId()), "5");
net.minecraft.potion.PotionHelper.redstoneEffect = "-5+6-7";
net.minecraft.potion.PotionHelper.gunpowderEffect = "+14&13-13";
net.minecraft.potion.PotionHelper.field_77925_n = new HashMap();
net.minecraft.potion.PotionHelper.potionPrefixes = new String[] {"potion.prefix.mundane", "potion.prefix.uninteresting", "potion.prefix.bland", "potion.prefix.clear", "potion.prefix.milky", "potion.prefix.diffuse", "potion.prefix.artless", "potion.prefix.thin", "potion.prefix.awkward", "potion.prefix.flat", "potion.prefix.bulky", "potion.prefix.bungling", "potion.prefix.buttered", "potion.prefix.smooth", "potion.prefix.suave", "potion.prefix.debonair", "potion.prefix.thick", "potion.prefix.elegant", "potion.prefix.fancy", "potion.prefix.charming", "potion.prefix.dashing", "potion.prefix.refined", "potion.prefix.cordial", "potion.prefix.sparkling", "potion.prefix.potent", "potion.prefix.foul", "potion.prefix.odorless", "potion.prefix.rank", "potion.prefix.harsh", "potion.prefix.acrid", "potion.prefix.gross", "potion.prefix.stinky"};
}
}
Le changement se situe sur le glowstone effect. Mais pour une raison que j'ignore forge reconnais bien le mod mais le changement ne se fais pas. J'ai peux être tout raté, si c'est le cas merci de votre aide