Jump to content

Player131

Members
  • Posts

    37
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Player131's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  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; }
×
×
  • Create New...

Important Information

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