Jump to content

Kloonder

Members
  • Posts

    171
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • URL
    http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2282680-over-10000-downloads-extrashoes-2-0-beta-jet
  • Location
    Germany
  • Personal Text
    cout << "Is this Java?" << endln;

Recent Profile Visitors

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

Kloonder's Achievements

Creeper Killer

Creeper Killer (4/8)

-1

Reputation

  1. 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
  2. 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?
  3. But how should that work on an EntityItem? I don't think armor is implemented for an EntityItem.
  4. 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);
  5. 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.
  6. 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
  7. Give the player some kind of verification password
  8. Well, I am aiming for a EntityHanging, so it won't move
  9. 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);
  10. 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
  11. 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
  12. Is there a good way to make a slot only can take a specific Item
  13. 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
  14. 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
  15. 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"));
×
×
  • Create New...

Important Information

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