Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Agravaine

Members
  • Joined

  • Last visited

Everything posted by Agravaine

  1. Thanks, bro! I'm not using names. I just need to get the inventory by name (in the command). But how to get the UUID by name without the player? I do so: Map<String, UUID> players = flipMap(UsernameCache.getMap()); UUID uuid = players.get(name); It is right?
  2. Any ideas? I need an array ItemStack.
  3. @SideOnly(Side.CLIENT) public static BufferedImage getPlayerSkinAsBufferedImage(AbstractClientPlayer player){ Minecraft mc = Minecraft.getMinecraft(); String playerName = player.getCommandSenderName(); Map<Type, MinecraftProfileTexture> map = mc.func_152342_ad().func_152788_a(player.getGameProfile()); BufferedImage image = null; InputStream stream = null; ITextureObject skin; try{ if(map.containsKey(MinecraftProfileTexture.Type.SKIN)){ ResourceLocation loc = mc.func_152342_ad().func_152792_a(map.get(Type.SKIN), Type.SKIN); skin = mc.getTextureManager().getTexture(loc); }else{ skin = mc.getTextureManager().getTexture(player.getLocationSkin()); } if(skin instanceof ThreadDownloadImageData){ ThreadDownloadImageData imageData = (ThreadDownloadImageData)skin; image = ObfuscationReflectionHelper.getPrivateValue(ThreadDownloadImageData.class, imageData, "field_110560_d", "bufferedImage"); System.out.println("1"); }else if(skin instanceof DynamicTexture){ DynamicTexture imageData = (DynamicTexture)skin; int width = ObfuscationReflectionHelper.getPrivateValue(DynamicTexture.class, imageData, "field_94233_j", "width"); int height = ObfuscationReflectionHelper.getPrivateValue(DynamicTexture.class, imageData, "field_94234_k", "height"); image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); image.setRGB(0, 0, width, height, imageData.getTextureData(), 0, width); System.out.println("2"); }else{ stream = mc.getResourceManager().getResource(AbstractClientPlayer.locationStevePng).getInputStream(); image = ImageIO.read(stream); System.out.println("3"); } }catch(IOException e){ e.printStackTrace(); }finally{ IOUtils.closeQuietly(stream); } return image; } I took the skin and made me change. As it is now loaded back?
  4. No, I do not want to upload to minecraft.net. I want to make a character editor (change the eyes, hair, clothes, etc.) directly in the game.
  5. How to get the player skin as BufferedImage, change it a few pixels and upload back to the player?
  6. Alternate variant, please.
  7. Add level up hook and change experience for next level.
  8. Hello. I am create transformer, it works. But the usual mod will not work at all. He just will not load. Help, please.
  9. Use Main Menu API: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2404643-main-menu-api-custom-main-menu
  10. public boolean hitEntity(ItemStack stack, EntityLivingBase target, EntityLivingBase attacker){ target.hurtTime = 0; stack.damageItem(1, attacker); return true; }
  11. Hello. I changed the maximum health of the player, but there was a problem: After the death of the player or rejoining is not saved! Help me please. IAttributeInstance healthAttribute = player.getEntityAttribute(SharedMonsterAttributes.maxHealth); AttributeModifier moras = new AttributeModifier(UUID.fromString("B9766C51-9566-4402-BC1F-2EE2A276D836"), "Moras Health Boost", abilities[i], 0).setSaved(true); healthAttribute.removeModifier(moras); healthAttribute.applyModifier(moras);
  12. Hi. Please tell me how to make a character editor? To be able to change her hair, eye color and so on. Thank you.
  13. /** * Returns true if the mob was killed by player. */ public static boolean wasEntityKilledByPlayer(DamageSource source){ if(source.getDamageType().equals("player")){ return true; } Entity atacker = source.getSourceOfDamage(); if(atacker instanceof EntityArrow){ EntityArrow arrow = (EntityArrow)atacker; atacker = arrow.shootingEntity; }else if(atacker instanceof IThrowableEntity){ IThrowableEntity throwable = (IThrowableEntity)atacker; atacker = throwable.getThrower(); }else if(atacker instanceof EntityThrowable){ EntityThrowable throwable = (EntityThrowable)atacker; atacker = throwable.getThrower(); } return atacker instanceof EntityPlayer; }
  14. Hi. Why player is null? @SubscribeEvent @SideOnly(Side.CLIENT) public void onClientPacket(ClientCustomPacketEvent event){ EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; ByteBuf buf = event.packet.payload(); System.out.println(player); //this is null packetHandler.handleClientSide(new PacketBuffer(buf), (WorldClient)player.worldObj, player); }
  15. I want to make a light grenade as in CS. How can I verify that the entity grenades on the screen and there are no obstacles (blocks)? I have tried so, but I did not work: @SubscribeEvent public void check(RenderTickEvent e){ if(Minecraft.getMinecraft().currentScreen == null && Minecraft.getMinecraft().renderViewEntity != null){ EntityLivingBase entity = Minecraft.getMinecraft().renderViewEntity; double d0 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double)e.renderTickTime; double d1 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double)e.renderTickTime; double d2 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double)e.renderTickTime; Frustrum frustrum = new Frustrum(); frustrum.setPosition(d0, d1, d2); Minecraft.getMinecraft().renderGlobal.clipRenderersByFrustum(frustrum, e.renderTickTime); List<EntityPig> arrows = Minecraft.getMinecraft().theWorld.getEntitiesWithinAABB(EntityPig.class, AxisAlignedBB.getBoundingBox(d0 - 10, d1 - 10, d2 - 10, d0 + 10, d1 + 10, d2 + 10)); for(EntityPig arrow : arrows){ System.out.println(frustrum.isBoundingBoxInFrustum(arrow.boundingBox)); } } }
  16. Thanks! public class TextureBarrier extends TextureAtlasSprite{ public TextureBarrier(String name){ super(name); } public void updateAnimation(){ if(!framesTextureData.isEmpty()){ Minecraft minecraft = Minecraft.getMinecraft(); int prevFrameCount; if(minecraft.thePlayer != null && minecraft.thePlayer.capabilities.isCreativeMode){ prevFrameCount = 0; }else{ prevFrameCount = 1; } if(prevFrameCount != frameCounter){ frameCounter = prevFrameCount; TextureUtil.uploadTextureMipmap((int[][])framesTextureData.get(frameCounter), width, height, originX, originY, false, false); } } } } Solved.
  17. I do not understand how to make a choice of two textures.
  18. Example with custom texture, please.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.