Jump to content

Player131

Members
  • Posts

    37
  • Joined

  • Last visited

Everything posted by Player131

  1. At the end 1.8 is completely broken, no more any way to render things using direct Java. My mod will never update to 1.8, ask Mojang to re add the old rendering way.
  2. Thanks, well I'm using 1.7.10... The way is that I can't use predefined models, I need real time updating models. That means I absolutely need to code everything. So the IItemRenderer is dead and will never be back. That means I have only one solution for my mod : coremod... I will need to search on the Minecraft's engine, and overwrite all rendering classes to add the old rendering system.
  3. Hello all, So I downloaded and installed the src for MC 1.8 but I have some problems updating mods : - No more setBlockName in every of my block classes ! - No more ISimpleBlockRendering !! - Tesselator is now broken (do we need to use directly OpenGL now ?) - No more getIconIndex in my TileEntitySpecialRenderers ! - No more getCollisionBoundingBoxFromPool(World, x, y, z). - IItemRenderer deprecated, but I absolutely need that because I'm using Java methods, so the model file can't work... (can we still use it ?) Now last question, because it's much more simple to use code for rendering instead of model files due to the fact all my block updates their textures in real time which means a model file can't work... So the question is : is there any forge event or any way to hook directly in world blocks rendering (a method like onBlockRender(Block b, int x, int y, int z)) ? I can use directly OpenGL, all I need is a direct hook into minecraft world blocks rendering so I can workaround and restore the old rendering way.
  4. Hello everyone, I'm trying to add a water bar like the food bar. But i need the PlayerInitialSpawn hook and the PlayerRespawn hook. What i mean is fire a method when player spawns after die, and fire the same method with a boolean set to false when the player first spawns in world, so i can send the NBT water level manager data to the client. Does anyone know a way to achieve this in server side and not client side ?
  5. I just clicked Chat Now >> link, and i entered Player131 on the username and #mcpbot on the channel name. And about the snapshots, how do you use them in the ForgeGradle because everytime i add mappings = 'stable_10' to my build.gradle, it refuses to compile saying that there is no longer class Item, no longer class Block no longer methods any methods on the Minecraft, so it's strange... EDIT : Visibly it's working without #
  6. Ok, i'll try the download snapshots because visibly the bot isn't working at all here is what i get when connecting to #mcpbot : [13:12] qwebirc v0.90 [13:12] Copyright (C) 2008-2010 Chris Porter and the qwebirc project. [13:12] http://www.qwebirc.org [13:12] Licensed under the GNU General Public License, Version 2. //I typed just cameraZoom (private field on the EntityRenderer) [13:12] Can't use this command in this window //Typed again to be sure [13:12] Can't use this command in this window //And finaly "help"... [13:12] Can't use this command in this window
  7. Ok, i found the original cause of the left/right bug, it's because of the rotation everytime i rotate, x and z position aren't updated correctly with the player yaw rotation... Here is my new code without rotation (working, but difficult to see where entities are coming from) : public float[] get2DFrom3D(float x, float y, float z, ScaledResolution resolution, EntityPlayer player) { int centerX = resolution.getScaledWidth() - 30; int centerY = resolution.getScaledHeight() - 30; Vec3 supperPos = Vec3.createVectorHelper(x, y, z); Vec3 playerPos = Vec3.createVectorHelper(player.posX, player.posY, player.posZ); Vec3 pos = playerPos.subtract(supperPos); //float rotation = (float) ((double) ((player.rotationYaw * 4F) / 360F) + 0.5D); //pos.rotateAroundY(-1 * (rotation)); float x1 = (float) (centerX + pos.zCoord / 1); float y1 = (float) (centerY + 0.7 * pos.xCoord); return new float[]{x1, y1}; }
  8. Yes but the problem of reflexion is that you need the name of your field ! The problem is here, you can't have the exact name of the field because of obfuscation !!! When the game will be re-obfuscated, you'll not be able to get back your field by the name. Otherwise you know the obfuscated name + the de obfuscated name witch is in many cases impossible to get in the Minecraft Forge Gradle system...
  9. I found what action seams to be breaking the function : Move Right and Move Left keys are breaking the function. Indead, sometimes, left/right keys will be forward/backward key for the minimap and sometimes this is completely correct... How can you explain that ?
  10. So i made two videos to show what the problem is. Note that the code i'm using in GMod Lua is based of the CAP one, so i give you the CAP code. Here is what it should look like (don't care of textures or positions, they aren't corresponding to my mod) : Here is what it renders on my Minecraft Mod. You can see that on my mod, sometimes you have position moving from up to down relative to yellow point (you), and sometimes it makes the contrary (witch is completely unexpected) And at least the updated code on my mod : public float[] get2DFrom3D(float x, float y, float z, ScaledResolution resolution, EntityPlayer player) { int centerX = resolution.getScaledWidth() - 30; int centerY = resolution.getScaledHeight() - 30; Vec3 supperPos = Vec3.createVectorHelper(x, y, z); Vec3 playerPos = Vec3.createVectorHelper(player.posX, player.posY, player.posZ); Vec3 pos = playerPos.subtract(supperPos); // / (mc.gameSettings.mouseSensitivity * 100) float rotation = (float) ((double) ((player.rotationYaw * 4F) / 360F) + 0.5D); pos.rotateAroundY(-1 * (rotation)); float x1 = (float) (centerX + pos.xCoord / 5); float y1 = (float) (centerY + 0.6 * pos.zCoord); return new float[]{x1, y1}; } And finaly the code that CAP uses (Pasted from their Github, and comented by me) for k, v in pairs(ents.GetAll()) do //Don't care it's a loop over every world entities if v:IsNPC() or v:IsPlayer() then //If this is a form of EntityLiving, don't care local ang = ply:GetAngles(); //There you go, interesting code starts here, local pos = ply:GetPos() - v:GetPos(); pos:Rotate(Angle(0, -1*ang.Yaw, 0)); local x1 = 256 + pos.y/5; local y1 = 512 + 0.3*pos.x; //And ends here if (math.abs(pos.z)<200) then surface.DrawTexturedRect(x1-16, y1-24, 32, 48); end end end
  11. I updated the code... Now it's a little bit more good... Indead, i just used the code i was using on Garry's Mod Lua to make minimaps, but it seams that all coords systems are screwed up on Minecraft Forge... The new function get2DFrom3D public int[] get2DFrom3D(float x, float y, float z, ScaledResolution resolution, EntityPlayer player) { int centerX = resolution.getScaledWidth() - 30; int centerY = resolution.getScaledHeight() - 30; Vec3 pos = Vec3.createVectorHelper(player.posX - x, player.posY - y, player.posZ - z); // / (mc.gameSettings.mouseSensitivity * 100) pos.rotateAroundY(-1 * (player.rotationYaw)); int x1 = (int) (centerX + pos.yCoord / 5); int y1 = (int) (centerY + 0.6 * pos.xCoord); return new int[]{x1, y1}; }
  12. Hello, I'm trying to make a system like radar i made on GMod using 3D Vector projection. However it seams that Minecraft Forge refuses my formula. I'm trying to transpose every entities 3D World coords into a 2D screen position, to be able to render red or green points in a box of 64x64 in the bottom right corner of the screen, here is my current code. List<Entity> l = EntityFinder.findEntitiesInRayon(EntityType.LIVING, mc.thePlayer, 30, false); // This is a fuction i made using old classes of Minecraft 1.6, i reimplemented. drawString(mc.fontRenderer, "Entities arround you : " + l.size(), 5, 30, 0xE6FF00); ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight); int j = resolution.getScaledWidth(); int k = resolution.getScaledHeight(); drawScreenAlphaColoredRect(j - 64, k - 64, 64, 64, new int[]{133, 133, 133, 16});//This function draws any rectangle you want at coords xy, with width and height. It supports alpha values too. for (Entity e : l){ int[] xy = get2DFrom3D((float)e.posX, (float)e.posY, (float)e.posZ, resolution); int x = xy[0]; int y = xy[1]; drawScreenAlphaColoredRect(x, y, 2, 2, new int[]{255, 0, 0, 255}); } The get2DFrom3D void (it would more interesting if mc.entityRenderer.cameraZoom would be public) : public int[] get2DFrom3D(float x, float y, float z, ScaledResolution resolution) { int centerX = resolution.getScaledWidth() / 2; int centerY = resolution.getScaledHeight() / 2; Double d = ObfuscationReflectionHelper.getPrivateValue(EntityRenderer.class, FMLClientHandler.instance().getClient().entityRenderer, "cameraZoom"); double zoom = d; int u = (int) (x / z * zoom + centerX); int v = (int) (y / z * zoom + centerY); return new int[]{u, v}; }
  13. You can change your passed parameter data[1] by null, in most cases this isn't requiered. That's what i done on my Mod, you can see source code here https://github.com/Yuri6037/AncientAddinMod/blob/master/src/main/java/net/yuri6037/AncientAddinMod/items/render/RenderDroneLauncher.java I hope you'll find what you're searching for on my Mod.
  14. The only problem is that it can crash the game if your input string is null or if given string is incorrect...
  15. Exactly the same problem than me ! However i just made a method, but incomplete and not realy clean : private ItemStack pirateMinecraftForgeUnmodifiableArrayList(String s){ String s1 = s.split("\\[")[1]; String s2 = s1.split("\\]")[0]; String s3 = s2.split("x")[1]; String s4 = s3.split("@")[0]; if (s4.startsWith("tile.")) { for (Object i : Block.blockRegistry){ Block item = (Block) i; if (item.getUnlocalizedName().equalsIgnoreCase(s4)){ return new ItemStack(item); } } } else if (s4.startsWith("item.")) { for (Object i : Item.itemRegistry){ Item item = (Item) i; if (item.getUnlocalizedName().equalsIgnoreCase(s4)){ return new ItemStack(item); } } } return null; }
  16. Hello, I'm trying to reverse engineer crafting table items. I already arrive to retrieve and throw every items for many crafts, but some aren't usable. I found that it's linked to 2 new classes that are managing recipes : ShapedOreRecipe and ShapelessOreRecipe. So, i extended my if block to use these new classes, but the getInput method on them don't give something usable for me. Indead, istead of an ItemStack/Block/Item array it returns UnmodifiableArrayList witch is completely blocked from access and can't be passed as ItemStack. So i'm asking you if you do know a way for passing this Unmodifiable into an ItemStack/Block/Item so i can read the composition of the item i want to reverse engineer. Thanks by advance
  17. Ok, I already done that, it's seriously the most simple in my drone launcher weapon. Take example on the code, here is my github link https://github.com/Yuri6037/AncientAddinMod/blob/master/src/main/java/net/yuri6037/AncientAddinMod/items/ItemHandDroneLauncher.java Just watch on my onUpdate and onItemRightClick, it's not as much complicated, just use the Minecraft damage system to make the timer, and use some nbt booleans.
  18. That's ok, problem solved. For anyone who wants what was the problem, well it's simple, just add implements IMessageHandler<MessageClass, IMessage>
  19. That's the way i'm making it, it's my way... The problem is not happening on the way i'm doing that, it's happening when i try to call the registerMessage ! I can register anything even register the old packet i made before but it's crashing always and only if the registerMessage is called. If i comment these registrations, the client launches server too, but the rest isn't working, because the client and server don't know what are MessageMinecraftMessageClient or MessageMinecraftMessageServer. So i need help to find out why the register is causing a Java Compiler crash... EDIT : I got another idea, but i'm not sure it's the right way. I can use SLDT's GameEngine networking protocol. Indead, i made a network protocol using Java TCP sockets. The only problem is that it can cause conflicts with Netty. I'm not sure, because i never used, in any of my programms, librarys. The only library i'm using are LWGJL OpenGL and LWJGL OpenAL, or STD Lib when i code C++.
  20. So for the code now it's much more longer, i hope you'll understand that, because i'm not realy liking comments... Sorry... So the Client Message : package net.yuri6037.AncientAddinMod.packet.mcNet; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; public class HandlerMinecraftMessageClient implements IMessageHandler { public IMessage onMessage(IMessage message, MessageContext ctx) { if (message instanceof MessageMinecraftMessageServer){ MessageMinecraftMessageServer ms = (MessageMinecraftMessageServer) message; if (ms.thePacket != null){ ms.thePacket.handleData(ctx); } } return message; } } package net.yuri6037.AncientAddinMod.packet.mcNet; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.relauncher.Side; import io.netty.buffer.ByteBuf; import net.yuri6037.AncientAddinMod.packet.data.Packet; import net.yuri6037.AncientAddinMod.packet.data.PacketList; import org.apache.logging.log4j.LogManager; public class MessageMinecraftMessageClient implements IMessage { protected Packet thePacket; public MessageMinecraftMessageClient(){} public MessageMinecraftMessageClient(Packet packet){ thePacket = packet; } public void fromBytes(ByteBuf buf) { int id = buf.readInt(); try { Packet packet = PacketList.getPacketFromID(id, Side.SERVER); packet.readData(buf); thePacket = packet; } catch (IllegalAccessException e) { LogManager.getLogger().warn("Unable to read Ancient packet : IllegalAccessException !"); } catch (InstantiationException e) { LogManager.getLogger().warn("Unable to read Ancient packet : InstantiationException !"); } } public void toBytes(ByteBuf buf) { thePacket.writeData(buf); } } The Server Message now : package net.yuri6037.AncientAddinMod.packet.mcNet; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; import cpw.mods.fml.common.network.simpleimpl.MessageContext; public class HandlerMinecraftMessageServer implements IMessageHandler { public IMessage onMessage(IMessage message, MessageContext ctx) { if (message instanceof MessageMinecraftMessageServer){ MessageMinecraftMessageServer ms = (MessageMinecraftMessageServer) message; if (ms.thePacket != null){ ms.thePacket.handleData(ctx); } } return message; } } package net.yuri6037.AncientAddinMod.packet.mcNet; import cpw.mods.fml.common.network.simpleimpl.IMessage; import cpw.mods.fml.relauncher.Side; import io.netty.buffer.ByteBuf; import net.yuri6037.AncientAddinMod.packet.data.Packet; import net.yuri6037.AncientAddinMod.packet.data.PacketList; import org.apache.logging.log4j.LogManager; public class MessageMinecraftMessageServer implements IMessage { protected Packet thePacket; public MessageMinecraftMessageServer(){} public MessageMinecraftMessageServer(Packet packet){ thePacket = packet; } public void fromBytes(ByteBuf buf) { int id = buf.readInt(); try { Packet packet = PacketList.getPacketFromID(id, Side.CLIENT); packet.readData(buf); thePacket = packet; } catch (IllegalAccessException e) { LogManager.getLogger().warn("Unable to read Ancient packet : IllegalAccessException !"); } catch (InstantiationException e) { LogManager.getLogger().warn("Unable to read Ancient packet : InstantiationException !"); } } public void toBytes(ByteBuf buf) { thePacket.writeData(buf); } } My registry for SimpleNetworkWrapper (Packet interface is an interface that i made to be able to handle packets directly in the packet class) : package net.yuri6037.AncientAddinMod.packet; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.player.EntityPlayer; import net.yuri6037.AncientAddinMod.packet.data.Packet; import net.yuri6037.AncientAddinMod.packet.mcNet.HandlerMinecraftMessageClient; import net.yuri6037.AncientAddinMod.packet.mcNet.HandlerMinecraftMessageServer; import net.yuri6037.AncientAddinMod.packet.mcNet.MessageMinecraftMessageClient; import net.yuri6037.AncientAddinMod.packet.mcNet.MessageMinecraftMessageServer; public class PacketManager { private static SimpleNetworkWrapper networkSystem; @SideOnly(Side.CLIENT) public static void sendPacketToServer(Packet packet){ networkSystem.sendToServer(new MessageMinecraftMessageClient(packet)); } public static void sendPacketToClient(Packet packet, EntityPlayer to){ networkSystem.sendTo(new MessageMinecraftMessageServer(packet), (net.minecraft.entity.player.EntityPlayerMP) to); } static { networkSystem = NetworkRegistry.INSTANCE.newSimpleChannel("AncientAddinMod"); networkSystem.registerMessage(HandlerMinecraftMessageClient.class, MessageMinecraftMessageClient.class, 0, Side.SERVER); //Here, i got the cannot find symbol registerMessage networkSystem.registerMessage(HandlerMinecraftMessageServer.class, MessageMinecraftMessageServer.class, 1, Side.CLIENT); //Here, i got the cannot find symbol registerMessage } } The new principe is realy simple now, i got 2 messages (One for handling client sent, and the other for server sent). You'll send a Packet that will be wrote using the client message or the server message, and after, when i recieve the client or server message, i read the ID of the Packet, create an instance of it, and after read data, and call a handling method in it. The PacketManager class is instanciated by my main mod class in the init function.
  21. So i remade the way i was handling that. I made 2 MinecraftForge messages (one for client packets and one for server packets), but again impossible to run the Client or the Server. I got exactly the same problem saying that the method registerMessage isn't existing in the SimpleNetworkWrapper. I don't know why it's happening. The most problematic thing is that it's not the IDE that is causing the bug but the Java Compiler that i throwing this exception !! I made some tests to find why it's happening, but it seams to be a problem with MinecraftForge running incrrectly on Java Compiler 1.6.0
  22. The problem is that the positions are not rotating with the player legs and are not animating with the legs animations...
  23. This is compiling now, just made a Refactor->Rename on the Message class and now it's working. However i got a new problem happening everytime i send a packet to the server ! I got this crash from Minecraft Server Thread (Integrated server) [15:52:12] [server thread/ERROR] [FML]: There was a critical exception handling a packet on channel AncientAddinMod io.netty.handler.codec.DecoderException: java.lang.NullPointerException: Undefined message for discriminator 0 in channel AncientAddinMod at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:99) ~[MessageToMessageDecoder.class:?] at io.netty.handler.codec.MessageToMessageCodec.channelRead(MessageToMessageCodec.java:111) ~[MessageToMessageCodec.class:?] at io.netty.channel.DefaultChannelHandlerContext.invokeChannelRead(DefaultChannelHandlerContext.java:337) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelHandlerContext.fireChannelRead(DefaultChannelHandlerContext.java:323) ~[DefaultChannelHandlerContext.class:?] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:785) ~[DefaultChannelPipeline.class:?] at io.netty.channel.embedded.EmbeddedChannel.writeInbound(EmbeddedChannel.java:169) ~[EmbeddedChannel.class:?] at cpw.mods.fml.common.network.internal.FMLProxyPacket.processPacket(FMLProxyPacket.java:86) [FMLProxyPacket.class:?] at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:241) [NetworkManager.class:?] at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:182) [NetworkSystem.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:726) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:614) [MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:118) [integratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:485) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:752) [MinecraftServer$2.class:?] Caused by: java.lang.NullPointerException: Undefined message for discriminator 0 in channel AncientAddinMod at cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:73) ~[FMLIndexedMessageToMessageCodec.class:?] at cpw.mods.fml.common.network.FMLIndexedMessageToMessageCodec.decode(FMLIndexedMessageToMessageCodec.java:17) ~[FMLIndexedMessageToMessageCodec.class:?] at io.netty.handler.codec.MessageToMessageCodec$2.decode(MessageToMessageCodec.java:81) ~[MessageToMessageCodec$2.class:?] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:89) ~[MessageToMessageDecoder.class:?] ... 13 more
  24. Yes because my Message class is implementing both IMessage and IMessageHandler.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.