• Un jetpack

    Résolu 1.7.x
    9
    0 Votes
    9 Messages
    2k Vues
    MultiM
    Oui, c’est déjà fait, ça marche que si la touche a été pressé et pas quand elle est maintenue pressé. En gros qu’en elle est maintenue sa retourne true, et relachée retourne false.
  • Custom menu ingame

    Résolu 1.7.x
    10
    0 Votes
    10 Messages
    3k Vues
    robin4002R
    Non, ça écrasera pas normal, mais par précaution fait quand même une copie du dossier src que se trouve dans le dossier de forge. Pense a refaire un gradlew eclipse après le gradlew setupDecompWorkspace
  • Drop des blocs et modification d'un harvestlevel

    Résolu 1.7.x
    20
    0 Votes
    20 Messages
    3k Vues
    robin4002R
    Problème réglé, ça venant de la majuscule à Pickaxe. Il ne dois pas en avoir : this.setHarvestLevel(“pickaxe”, 4);
  • Problème ClientProxy

    Résolu 1.7.x
    3
    0 Votes
    3 Messages
    901 Vues
    MultiM
    Merci, c’est vraiment con j’ai du le supprimer
  • ObfuscationReflectionHelper problème !

    Résolu 1.7.x
    7
    0 Votes
    7 Messages
    2k Vues
    MultiM
    Ok merci beaucoup Résolu.
  • [1.7.x]Extended Entity Properties/Dimension/Particules/Rotation d'un Item

    Résolu
    37
    0 Votes
    37 Messages
    9k Vues
    mindany2M
    Merci ^^ Je l’avais essayé en utilisant le RenderGameOverlayEvent.Post (je n’avais pas fait attention à l’évent utilisé, je l’avais juste mis dans la fonction permettant d’afficher mon texte) >.<’
  • Crash grâce à un ISBRH

    Résolu 1.7.2
    6
    0 Votes
    6 Messages
    1k Vues
    utyboU
    RESOLU! En fait je suis juste un étourdi. L’auto-remplissage d’Eclipse m’a trollé…
  • Problème avec hasEffect

    Résolu 1.7.x
    5
    0 Votes
    5 Messages
    2k Vues
    VayperV
    @‘utybo’: Sauf que si tu connaissais les bases du Java tu aurais sû qu’il faut utiliser les noms des paramètres et non leur type. Openclassrooms à la rescousse! T’as raison j’avais fais une pause au milieu du chapitre 2 de la POO pour me lancer dans le modding parce que je pensais que ca serait suffisant pour le début mais ca m’a fait oublier quelques notions ^^ J’y retourne
  • Enlever le texte de forge

    Résolu 1.7.x
    4
    0 Votes
    4 Messages
    2k Vues
    robin4002R
    Ce texte permet d’indiquer que forge est utilisé. Je vois pas pourquoi tu veux le cacher. Imagine tu te lance dans un gros projet, tu passe beaucoup de temps dessus, et là quelqu’un utilise ton projet et supprime les endroits ou ton nom est écrit. Il s’attribue donc de ton travail, et personne ne peut savoir que c’est le tiens. Ça serait complètement irrespectueux envers toi, et je pense pas que tu vas bien le prendre. Donc ne fait pas aux autres ce que tu n’aimerais pas qu’on te fasse. Après si tu veux juste cacher par exemple le nombre de mods utilisés et mettre juste forge et fml, c’est cette fonction qui affiche : List <string>brandings = Lists.reverse(FMLCommonHandler.instance().getBrandings(true)); for (int i = 0; i < brandings.size(); i++) { String brd = brandings.get(i); if (!Strings.isNullOrEmpty(brd)) { this.drawString(this.fontRendererObj, brd, 2, this.height - ( 10 + i * (this.fontRendererObj.FONT_HEIGHT + 1)), 16777215); } } ```</string>
  • Problème de projectile

    Résolu 1.7.2
    10
    0 Votes
    10 Messages
    2k Vues
    P
    Non mais c’etait pas un up dans le sens “up”, j’ai avancer, le problème avance et donc je ne cherche pas à avoir la même réponse. Et pour les packet faut que je me renseigne mais les properties utilise les packets hors j’utilise les properties donc logiquement j’utilise les packet. Okay j’ai réussi enfète c’était vraiment VRAIMENT tout bête et je suis désolé d’avoir déranger pour si peu voila je pensai que l’event KeyInputEvent était obligatoire pour récupéré si le joueur tape sur la touche ou non mais enfete rien du tout donc j’ai juste rajouté isPressed dans l’event playerEvent.
  • [1.7.2]Création d'achievement

    Résolu
    14
    0 Votes
    14 Messages
    2k Vues
    zery59Z
    Ok, merci de toute façon, je voulais juste créer quelques items pour test. Du coup je vais réinstaller forge et faire un vrai mod (Parce avoir comme modid Modtest c’est pas très pro). Merci quand même, sujet résolu !
  • Génération Nether

    Résolu 1.7.x
    12
    0 Votes
    12 Messages
    3k Vues
    robin4002R
    Par contre MrDiaboloz, tu pourrai réduire ta signature ? 11 lignes c’est beaucoup trop grand à mon goût.
  • Un fire rate

    Résolu 1.7.x
    9
    0 Votes
    9 Messages
    2k Vues
    mindany2M
    Résolu ?
  • Problème de texture du Gui de mon four

    Résolu 1.7.x
    9
    0 Votes
    9 Messages
    2k Vues
    robin4002R
    Du-coup si c’est résolu tu peux mettre la balise résolu.
  • Un joueur résistant au feu

    Résolu 1.7.x
    9
    0 Votes
    9 Messages
    1k Vues
    P
    Sa marche merci!
  • Crash a cause des creative tabs

    Résolu 1.7.2
    18
    0 Votes
    18 Messages
    11k Vues
    mindany2M
    Oui je sais ._. c’est pour ça qu’il a pu trouvé que mon code marchait sans pour autant mettre Item.getItemFromBlock() puisqu’il utilisait un item
  • Problème blocks transparents

    Résolu 1.7.x
    13
    1
    0 Votes
    13 Messages
    3k Vues
    robin4002R
    Pour les escaliers tu es juste sensé mettre l’extends, rien d’autre.
  • Problème au chargement d'une fonction (GuiOpenEvent)

    Résolu 1.7.2
    3
    0 Votes
    3 Messages
    1k Vues
    samhalo007S
    Tu m’as fait mourir avec ton image… :') Et sinon je vais aller tester je vous revient avec les résultats… Sinon merci:) Ah bahh voila… Excusez-moi d’avoir posé la question sans avoir regardé et du dérangement…
  • Recuper la variable lorsque le joueur spawn pour la tout première fois.

    Résolu 1.7.x
    39
    0 Votes
    39 Messages
    6k Vues
    P
    ouai : package portuar.otherWorld.client.alteration; import java.util.*; import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; import io.netty.handler.codec.MessageToMessageCodec; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.network.INetHandler; import net.minecraft.network.NetHandlerPlayServer; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.network.FMLEmbeddedChannel; import cpw.mods.fml.common.network.FMLOutboundHandler; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.network.internal.FMLProxyPacket; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; /** * Packet pipeline class. Directs all registered packet data to be handled by the packets themselves. * @author sirgingalot * some code from: cpw */ @ChannelHandler.Sharable public class PacketHandler extends MessageToMessageCodec <fmlproxypacket, abstractpacket="">{ private EnumMap <side, fmlembeddedchannel="">channels; private LinkedList<class<? extends="" abstractpacket="">> packets = new LinkedList<class<? extends="" abstractpacket="">>(); private boolean isPostInitialised = false; /** * Register your packet with the pipeline. Discriminators are automatically set. * * @param clazz the class to register * * @return whether registration was successful. Failure may occur if 256 packets have been registered or if the registry already contains this packet */ public boolean registerPacket(Class clazz) { if (this.packets.size() > 256) { return false; } if (this.packets.contains(clazz)) { return false; } if (this.isPostInitialised) { return false; } this.packets.add(clazz); return true; } @Override protected void encode(ChannelHandlerContext ctx, AbstractPacket msg, List <object>out) throws Exception { ByteBuf buffer = Unpooled.buffer(); Class clazz = msg.getClass(); if (!this.packets.contains(msg.getClass())) { throw new NullPointerException("No Packet Registered for: " + msg.getClass().getCanonicalName()); } byte discriminator = (byte) this.packets.indexOf(clazz); buffer.writeByte(discriminator); msg.encodeInto(ctx, buffer); FMLProxyPacket proxyPacket = new FMLProxyPacket(buffer.copy(), ctx.channel().attr(NetworkRegistry.FML_CHANNEL).get()); out.add(proxyPacket); } @Override protected void decode(ChannelHandlerContext ctx, FMLProxyPacket msg, List <object>out) throws Exception { ByteBuf payload = msg.payload(); byte discriminator = payload.readByte(); Class clazz = this.packets.get(discriminator); if (clazz == null) { throw new NullPointerException("No packet registered for discriminator: " + discriminator); } AbstractPacket pkt = clazz.newInstance(); pkt.decodeInto(ctx, payload.slice()); EntityPlayer player; switch (FMLCommonHandler.instance().getEffectiveSide()) { case CLIENT: player = this.getClientPlayer(); pkt.handleClientSide(player); break; case SERVER: INetHandler netHandler = ctx.channel().attr(NetworkRegistry.NET_HANDLER).get(); player = ((NetHandlerPlayServer) netHandler).playerEntity; pkt.handleServerSide(player); break; default: } out.add(pkt); } public void initialise() { this.channels = NetworkRegistry.INSTANCE.newChannel("TUT", this); } public void postInitialise() { if (this.isPostInitialised) { return; } this.isPostInitialised = true; Collections.sort(this.packets, new Comparator<class<? extends="" abstractpacket="">>() { @Override public int compare(Class clazz1, Class clazz2) { int com = String.CASE_INSENSITIVE_ORDER.compare(clazz1.getCanonicalName(), clazz2.getCanonicalName()); if (com == 0) { com = clazz1.getCanonicalName().compareTo(clazz2.getCanonicalName()); } return com; } }); } @SideOnly(Side.CLIENT) private EntityPlayer getClientPlayer() { return Minecraft.getMinecraft().thePlayer; } /** * Send this message to everyone. * * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper * * @param message The message to send */ public void sendToAll(AbstractPacket message) { this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALL); this.channels.get(Side.SERVER).writeAndFlush(message); } /** * Send this message to the specified player. * * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper * * @param message The message to send * @param player The player to send it to */ public void sendTo(AbstractPacket message, EntityPlayerMP player) { this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.PLAYER); this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(player); this.channels.get(Side.SERVER).writeAndFlush(message); } /** * Send this message to everyone within a certain range of a point. * * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper * * @param message The message to send * @param point The {@link cpw.mods.fml.common.network.NetworkRegistry.TargetPoint} around which to send */ public void sendToAllAround(AbstractPacket message, NetworkRegistry.TargetPoint point) { this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.ALLAROUNDPOINT); this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(point); this.channels.get(Side.SERVER).writeAndFlush(message); } /** * Send this message to everyone within the supplied dimension. * * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper * * @param message The message to send * @param dimensionId The dimension id to target */ public void sendToDimension(AbstractPacket message, int dimensionId) { this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.DIMENSION); this.channels.get(Side.SERVER).attr(FMLOutboundHandler.FML_MESSAGETARGETARGS).set(dimensionId); this.channels.get(Side.SERVER).writeAndFlush(message); } /** * Send this message to the server. * * Adapted from CPW's code in cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper * * @param message The message to send */ public void sendToServer(AbstractPacket message) { this.channels.get(Side.CLIENT).attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.TOSERVER); this.channels.get(Side.CLIENT).writeAndFlush(message); } } package portuar.otherWorld.client.alteration; import io.netty.buffer.ByteBuf; import io.netty.channel.ChannelHandlerContext; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import cpw.mods.fml.common.network.ByteBufUtils; public class PacketAlteration extends AbstractPacket { private NBTTagCompound data; public PacketAlteration() {} public PacketAlteration(EntityPlayer player) { data = new NBTTagCompound(); ExtendedEntityPropAlteration.get(player).saveNBTData(data); } @Override public void encodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { ByteBufUtils.writeTag(buffer, data); } @Override public void decodeInto(ChannelHandlerContext ctx, ByteBuf buffer) { data = ByteBufUtils.readTag(buffer); } @Override public void handleClientSide(EntityPlayer player) { ExtendedEntityPropAlteration.get(player).loadNBTData(data); } @Override public void handleServerSide(EntityPlayer player) { } } Dans la MainClass : @EventHandler public void init(FMLInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new EventAlteration()); packetHandler.initialise(); } @EventHandler public void postInit(FMLPostInitializationEvent event) { packetHandler.postInitialise(); } package portuar.otherWorld.client.alteration; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.event.entity.EntityEvent.EntityConstructing; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.event.entity.living.LivingDeathEvent; import portuar.otherWorld.proxy.CommonProxy; import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class EventAlteration { @SubscribeEvent public void onEntityConstructing(EntityConstructing event) { if (event.entity instanceof EntityPlayer && ExtendedEntityPropAlteration.get((EntityPlayer) event.entity) == null) ExtendedEntityPropAlteration.register((EntityPlayer) event.entity); if (event.entity instanceof EntityPlayer && event.entity.getExtendedProperties(ExtendedEntityPropAlteration.EXT_PROP_NAME) == null) event.entity.registerExtendedProperties(ExtendedEntityPropAlteration.EXT_PROP_NAME, new ExtendedEntityPropAlteration((EntityPlayer) event.entity)); } public static void register(EntityPlayer player) { player.registerExtendedProperties(ExtendedEntityPropAlteration.EXT_PROP_NAME, new ExtendedEntityPropAlteration(player)); } @SubscribeEvent public void onLivingDeathEvent(LivingDeathEvent event) { if (!event.entity.worldObj.isRemote && event.entity instanceof EntityPlayer) { NBTTagCompound playerData = new NBTTagCompound(); ((ExtendedEntityPropAlteration)(event.entity.getExtendedProperties(ExtendedEntityPropAlteration.EXT_PROP_NAME))).saveNBTData(playerData); CommonProxy.storeEntityData(((EntityPlayer) event.entity).getCommandSenderName(), playerData); ExtendedEntityPropAlteration.saveProxyData((EntityPlayer) event.entity); } } // we already have this event, but we need to modify it some @SubscribeEvent public void onEntityJoinWorld(EntityJoinWorldEvent event) { if (!event.entity.worldObj.isRemote && event.entity instanceof EntityPlayer) { NBTTagCompound playerData = CommonProxy.getEntityData(((EntityPlayer) event.entity).getCommandSenderName()); if (playerData != null) { ((ExtendedEntityPropAlteration)(event.entity.getExtendedProperties(ExtendedEntityPropAlteration.EXT_PROP_NAME))).loadNBTData(playerData); } ((ExtendedEntityPropAlteration)(event.entity.getExtendedProperties(ExtendedEntityPropAlteration.EXT_PROP_NAME))).sync(); } } } puis l’extendproperties que vous prenez dans le tuto de ce forum.</class<?></object></object></class<?></class<?></side,></fmlproxypacket,>
  • Les projectiles

    Résolu 1.7.x
    2
    0 Votes
    2 Messages
    955 Vues
    jglrxavpokJ
    C’est décrit dans ce tutoriel: http://www.minecraftforgefrance.fr/showthread.php?tid=18 Dans ton proxy client, quand tu initialise tes données, ajoute cette ligne: RenderingRegistry.registerEntityRenderingHandler(EntityDisk.class, new RenderDisk(new ModelDisk())); Et ajoute un constructeur dans ta classe RenderDisk qui en argument une instance de ModelDisk, assigne cette instance à une variable et dans doRenderDisk avant le glPopMatrix(); ajoute model.render(var1,0,0,0,0,0.0625f);