
Kloonder
Members-
Posts
171 -
Joined
-
Last visited
Everything posted by Kloonder
-
I now figured out how I wanna do it. That way @SubscribeEvent public void renderGameOverlayEvent(RenderWorldLastEvent event) { EntityPlayer player = mc.thePlayer; if (getItemPlayerIsLookingAt(player) != null) { if (getItemPlayerIsLookingAt(player) instanceof EntityItem) { EntityItem item = (EntityItem) getItemPlayerIsLookingAt(player); RenderHelper.drawCube(item.posX, item.posY, item.posZ); } } } But my problem is, no matter what I try, the cube will always stick to my feet https://lh4.googleusercontent.com/-cp4SDkOgJJA/VpI-_p8EjpI/AAAAAAAAA-o/ffJWop51ItU/w1597-h846-no/2016-01-10_12.20.03.png[/img] If anyone knows how to move that cube away, feel free to leave a reply THe code for rendering the block is in my first post
-
For me it seems more like like its an ArrayList, and in this array list all textures are rendered, nothing I could use I guess, or can I?
-
But how should that work on an EntityItem? I don't think armor is implemented for an EntityItem.
-
So I am wondering if it is possible to draw a cube above an entity. No matter what kind of entity it is. Where should I start, with event handler? Because ther isn't an actual event for every entity rendered, is it? public static void drawCube(double x, double y, double z) { GL11.glBegin(GL11.GL_QUADS); GL11.glColor3f(0.5f, 0.5f, 0.0f); GL11.glVertex3f(0.5f, 0.5f, -0.5f); GL11.glVertex3f(-0.5f, 0.5f, -0.5f); GL11.glVertex3f(-0.5f, 0.5f, 0.5f); GL11.glVertex3f(0.5f, 0.5f, 0.5f); GL11.glColor3f(0.5f, 0.5f, 0.0f); GL11.glVertex3f(0.5f, -0.5f, 0.5f); GL11.glVertex3f(-0.5f, -0.5f, 0.5f); GL11.glVertex3f(-0.5f, -0.5f, -0.5f); GL11.glVertex3f(0.5f, -0.5f, -0.5f); GL11.glColor3f(0.5f, 0.0f, 0.0f); GL11.glVertex3f(0.5f, 0.5f, 0.5f); GL11.glVertex3f(-0.5f, 0.5f, 0.5f); GL11.glVertex3f(-0.5f, -0.5f, 0.5f); GL11.glVertex3f(0.5f, -0.5f, 0.5f); GL11.glColor3f(0.5f, 0.5f, 0.0f); GL11.glVertex3f(0.5f, -0.5f, -0.5f); GL11.glVertex3f(-0.5f, -0.5f, -0.5f); GL11.glVertex3f(-0.5f, 0.5f, -0.5f); GL11.glVertex3f(0.5f, 0.5f, -0.5f); GL11.glColor3f(0.0f, 0.0f, 0.5f); GL11.glVertex3f(-0.5f, 0.5f, 0.5f); GL11.glVertex3f(-0.5f, 0.5f, -0.5f); GL11.glVertex3f(-0.5f, -0.5f, -0.5f); GL11.glVertex3f(-0.5f, -0.5f, 0.5f); GL11.glColor3f(0.5f, 0.0f, 0.5f); GL11.glVertex3f(0.5f, 0.5f, -0.5f); GL11.glVertex3f(0.5f, 0.5f, 0.5f); GL11.glVertex3f(0.5f, -0.5f, 0.5f); GL11.glVertex3f(0.5f, -0.5f, -0.5f); GL11.glEnd(); GL11.glTranslated(x, y, z);
-
So I am wondering how to render text into the world, pretty much the same way like a name tag. I found out that RenderWorldEvent.Pre/Post is never actually called, or is it? So I tried using RenderWorldLastEvent. Now ehen I try rendering, it does not really render, maybe the problem is, that RenderWorldLastEvent does not call it correctly, or my code is wrong. @SubscribeEvent public void renderGameOverlayEvent(RenderWorldLastEvent event) { EntityPlayer player = mc.thePlayer; if (getItemPlayerIsLookingAt(player) != null) { if (getItemPlayerIsLookingAt(player) instanceof EntityItem) { EntityItem item = (EntityItem) getItemPlayerIsLookingAt(player); renderText(item, "heyyy )", item.posX, item.posY + 1, item.posZ, 64); } } } The method gets called This is only copied from the RenderEntity class protected void renderText(Entity entity, String text, double x, double y, double z, int p_147906_9_) { renderManager = mc.getRenderManager(); double d3 = entity.getDistanceSqToEntity(renderManager.livingPlayer); if (d3 <= (double) (p_147906_9_ * p_147906_9_)) { FontRenderer fontrenderer = renderManager.getFontRenderer(); float f = 1.6F; float f1 = 0.016666668F * f; GlStateManager.pushMatrix(); GlStateManager.translate((float) x + 0.0F, (float) y + entity.height + 0.5F, (float) z); GL11.glNormal3f(0.0F, 1.0F, 0.0F); GlStateManager.rotate(-this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F); GlStateManager.rotate(this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F); GlStateManager.scale(-f1, -f1, f1); GlStateManager.disableLighting(); GlStateManager.depthMask(false); GlStateManager.disableDepth(); GlStateManager.enableBlend(); GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); Tessellator tessellator = Tessellator.getInstance(); WorldRenderer worldrenderer = tessellator.getWorldRenderer(); byte b0 = 0; GlStateManager.disableTexture2D(); worldrenderer.startDrawingQuads(); int j = fontrenderer.getStringWidth(text) / 2; worldrenderer.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F); worldrenderer.addVertex((double) (-j - 1), (double) (-1 + b0), 0.0D); worldrenderer.addVertex((double) (-j - 1), (double) (8 + b0), 0.0D); worldrenderer.addVertex((double) (j + 1), (double) (8 + b0), 0.0D); worldrenderer.addVertex((double) (j + 1), (double) (-1 + b0), 0.0D); tessellator.draw(); GlStateManager.enableTexture2D(); fontrenderer.drawString(text, -fontrenderer.getStringWidth(text) / 2, b0, 553648127); GlStateManager.enableDepth(); GlStateManager.depthMask(true); fontrenderer.drawString(text, -fontrenderer.getStringWidth(text) / 2, b0, -1); GlStateManager.enableLighting(); GlStateManager.disableBlend(); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.popMatrix(); } } Frankly, my knowledge about rendering is not the best, but there is no error when rendering and the game does not crash, but it is simply not getting rendered.
-
I'd be sending a password through a non-encrypted POST. Very unsafe. If it doesn't improve the security of the change, I wouldn't want to make the client store any additional data anywhere. E-Mail? Something like that
-
Give the player some kind of verification password
-
Well, I am aiming for a EntityHanging, so it won't move
-
Hello, my qustion is, if there is a poibility of getting the probably best rayTrace of the player, bacause the normal rayTrace method is not enought, I need to check 4 times more exact for a pixel, that means every pixel in game are 4 pixels. Is that possible? A example: If you had a 64x64 texture pack, I wanna check what pixel theplayer is aiming for float distance = 10; MovingObjectPosition mop; Vec3 vec3 = Vec3.createVectorHelper(player.posX, player.posY, player.posZ); Vec3 vec31 = player.getLook(0); Vec3 vec32 = vec3.addVector(vec31.xCoord * distance, vec31.yCoord * distance, vec31.zCoord * distance); mop = player.worldObj.rayTraceBlocks(vec3, vec32, false, false, true);
-
Well, although I can't really understand you, the method doesn't even get called, it doesn't print out hello when I hit the entity
-
I have the problem that my Entity won't get attacked EntityRegistry.registerModEntity(MyEntity.class, "my.camera", 1, this, 160, Integer.MAX_VALUE, false); public class MyEntity extends Entity { public MyEntity (World worldIn) { super(worldIn); this.setSize(1, 1); } public MyEntity (World world, double posX, double posY, double posZ) { super(world); this.posX = posX; this.posY = posY; this.posZ = posZ; this.setSize(1, 1); } @Override protected void entityInit() { } @Override protected void readEntityFromNBT(NBTTagCompound nbt) { } @Override protected void writeEntityToNBT(NBTTagCompound nbt) { } @Override public void onUpdate() { super.onUpdate(); } @Override public boolean attackEntityFrom(DamageSource source, float amount) { System.out.println("hello"); return super.attackEntityFrom(source, amount); } If you have any Idea please tell me
-
Is there a good way to make a slot only can take a specific Item
-
Well, I'm sorry but I never used the cmd, so I have no idea how to do it, I put the jar in my forge folder, and then I tried this: gradlew deobfJar klooncore-1.0.jar gradlew deobfJar klooncore-1.0 gradlew deobfJar -jar klooncore-1.0.jar gradlew deobfJar -jar klooncore-1.0 nothing worked it didn't find it
-
So I was trying to create some "Core" mod, it is not a real core mod, to make changes of vanilla classes or so, but I was tired of creating the same classes and methods in every mod again, so I decided to create my own core mod, but my problem now is, that that my mod crashes when I'm trying to do something with it, for example: BasicGun = new BasicGun(); public class BasicGun extends BasicItem{ public BasicGun() { super("BasicGun", 1, CreativeTabs.tabCombat, AdvancedGuns.MODID); } //this is the class from the core ´public class BasicItem extends Item{ protected String name; public BasicItem(String name, int maxStackSize, CreativeTabs tab, String modid){ this.name = name; setCreativeTab(tab); setMaxStackSize(maxStackSize); setUnlocalizedName(modid + "_" + name); Side side = FMLCommonHandler.instance().getEffectiveSide(); GameRegistry.registerItem(this, name, modid); if(side == Side.CLIENT){ Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(this, 0, new ModelResourceLocation(modid + ":" + name, "inventory")); } } public String getName(){ return name; } } And then it crahses I added my mod only in the main folder of forge and added it then to the build path
-
But well, this model thing does only, like model, is called when the player holds it in his hand, I much more smarter thing would be, because I want to use the already existing jsons from other items, so does anyone know how to get them, and then bind them to the renderer? I don't think that will work, because that qould change all the Items: BTTagCompound nbt = stack.getTagCompound(); String renderItem = nbt.getString("unlocalizedRender"); ItemStack theRenderStack = ItemStack.loadItemStackFromNBT((NBTTagCompound) nbt.getTag("stackTag")); IBakedModel model = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(theRenderStack); Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(this, new ModelResourceLocation(model.getTexture().toString(), "inventory"));
-
Yes based on the NBT, so I will try this getModel thingy out, lets see how this one works
-
How can I change the texture of an item ingame?
-
Get extact MovingObjectPoition from the Player
Kloonder replied to Kloonder's topic in Modder Support
Well, I now use this code if(world.isRemote){ if(player.rayTrace(7, 1) != null){ if(player.rayTrace(7, 1).hitVec != null){ MovingObjectPosition mop = player.rayTrace(7, 1); Vec3 hit = mop.hitVec; int side = mop.sideHit.getIndex(); MoreMinecraft.network.sendToServer(new MessageToServer(2, hit.xCoord, hit.yCoord, hit.zCoord, side, halfStep ? 1 : 0, rootUp ? 1 : 0)); But I somehow have the problem, that it is sometimes wrong about one block in x or z position, any ideas -
Well, I think thats bad code of Mojang, because in a game like CSGO, everything has to be handled by server, otherways player would start hacking, but well, its not the time to dicuss why minecraft is coded bad. Anyone has an idea how to make the player knockback?
-
Well I didn't find the solution so far, but what I also found out is, that you can't giva a player a potion effect only on server side, so you can only make the player move if the client agrees with that, thats why there can be a NoKnockBack hack, because the client doen't react on the motion change, but that doen't help me, my idea was, to give the player an Item, which makes him move, but that won't work if he has full inventory, so I don't have any idea what to do
-
you can also just copy the code from EntityThrowable, it exactly that what you want
-
There are to things that matter so your mod gets popular. First: Your mod has to be good, it should be something like, RottenFleshToLeather, that thing is shit Second: Luck, my Extra Shoes mod only got over 10000 Downloads, because on the daya after release, somebody reviewd my mod with around 2M subscribers, on my second mod, I only got hard over 1000 downloads, because nobody reviewed it. But anyway, mjobody will review your mod if it bad
-
stack.stackTagCompound was removed in 1.8, I had my problems too
-
Dude, please tell us if you want a 3D line or 2D, if you want 2D, there is a very good method in the vanilla Gui class
-
Get extact MovingObjectPoition from the Player
Kloonder replied to Kloonder's topic in Modder Support
And that will crash your game when used on the SERVER, which is where the OP is trying to get a MovingObjectPosition. Not only that, but the objectMouseOver is limited in range and thus limited in use. @OP What about the code is not working for you? Works fine for me: Vec3 vec31 = new Vec3(player.posX, player.posY + player.getEyeHeight(), player.posZ); Vec3 vec32 = new Vec3(i, j, k); // where i, j, k are coordinates of some place in the world, such as the normalized coordinates from the player's look vector multiplied by some amount indicating maximum range, e.g. 100 MovingObjectPosition mop = world.rayTraceBlocks(vec31, vec32); However, that will only result in a hit on BLOCKS; if you want to check for an entity within the player's line of sight, this is not the solution. Well, that doen't work, because, you know, look: I'm not quite sure what you mean with those i, j, k, so I assumed I take the players look coords and multiplie them by 100: Vec3 vec31 = new Vec3(player.posX, player.posY + player.getEyeHeight(), player.posZ); Vec3 vec32 = new Vec3(player.getLookVec().xCoord*100, player.getLookVec().yCoord*100, player.getLookVec().zCoord*100); MovingObjectPosition mop = world.rayTraceBlocks(vec31, vec32); System.out.println(mop); That gives back coords, wich are totally wrong. Also: Vec3 vec31 = new Vec3(player.posX, player.posY + player.getEyeHeight(), player.posZ); Vec3 vec32 = player.getLookVec(); MovingObjectPosition mop = world.rayTraceBlocks(vec31, vec32); System.out.println(mop); This gives back nothing So I have really no idea what to do