Jump to content

f1rSt1kChannel

Members
  • Posts

    138
  • Joined

  • Last visited

Everything posted by f1rSt1kChannel

  1. 1.8 is necessary, rather than 1.7. Thank you so much!
  2. I understand. But it is impossible to fix it.
  3. There all private variables, I'll get them?
  4. Okay. I need to replace the standard chat (GuiNewChat) on your own. How can I make it better?
  5. I need to get every tick field + override a private method of the super class.
  6. How to get a private field using acces transformer?
  7. OMG, ti daje ne pereopredilil metodi... Ny tebe je pomogli na mcmodding, nah suda pista'?
  8. Sorry, i'm use google translate. How to use the external library with my mod? Javassist, for example.
  9. How to use the external library with my mod? Javassist, for example.
  10. public static void increaseArray(Class<?> clazz, int length, String... args){ Object[] oldArray = null; for(Field field : clazz.getDeclaredFields()){ try{ for(String s : args){ if(field.getName().equals(s)){ field.setAccessible(true); if(Modifier.isFinal(field.getModifiers())){ Field modfield = Field.class.getDeclaredField("modifiers"); modfield.setAccessible(true); modfield.setInt(field, field.getModifiers() & ~Modifier.FINAL); } oldArray = (Object[])field.get(null); Object newArray = Array.newInstance(field.get(null).getClass().getComponentType(), length); System.arraycopy(oldArray, 0, newArray, 0, oldArray.length); field.set(null, newArray); } } }catch(ReflectiveOperationException e){ e.printStackTrace(); } } } And call in your main class: increaseArray(Potion.class, 256, "potionTypes", "obfName");
  11. Change mode Mine & Blade: BattleGear 2. Remove button from the inventory and add new slots. And many other things. Please, just tell me how to make a patch file.
  12. We need to do some of the fields of public and change some of the conditions.
  13. I need. Just tell me, how can I do so that I can use in your Eclipse changes. Suppose adding a method to the class World. worldObj.getMyMethod();
  14. Sorry for my bad english. Try again Here Forge modifies files minecraft. But so that we can see the changes in Eclipse, he patches them their *.patch files. I also changed the files using IClassTransformer and ASM. How can I make my *.patch file?
  15. As all the same patch in his class? I am using ASM changed it, but of course, IDE does not understand this, and I can not get their fields / methods...
  16. Solved. Thanks. if(attacker != null && living != null){ double angle = MathHelper.wrapAngleTo180_double(attacker.rotationYaw); double angleTarget = MathHelper.wrapAngleTo180_double(living.getRotationYawHead()); if(Math.abs(angle - angleTarget) < 22.5D){ System.out.println("DUDE"); } }
  17. @SubscribeEvent public void hurt(LivingHurtEvent e){ Entity attacker = e.source.getSourceOfDamage(); EntityLivingBase living = e.entityLiving; if(attacker != null && living != null){ if((attacker.getRotationYawHead() % 360) + 45 > (living.getRotationYawHead() % 360)){ System.out.println("Blow from back!"); } } } Always works
  18. How to check that a player hit a mob from the back?
  19. THANKS!!! Code: public Entity getMouseOver(float partialTicks, double distance, boolean canBeCollidedWith){ Minecraft mc = Minecraft.getMinecraft(); Entity pointedEntity = null; MovingObjectPosition rayTrace = null; if(mc.renderViewEntity != null){ if(mc.theWorld != null){ rayTrace = mc.renderViewEntity.rayTrace(distance, partialTicks); Vec3 positionVec = mc.renderViewEntity.getPosition(partialTicks); double distanceToVec3 = distance; if(rayTrace != null){ distanceToVec3 = rayTrace.hitVec.distanceTo(positionVec); } Vec3 lookVec = mc.renderViewEntity.getLook(partialTicks); Vec3 posDistVec = positionVec.addVector(lookVec.xCoord * distance, lookVec.yCoord * distance, lookVec.zCoord * distance); Vec3 tempVec = null; double boxExpand = 1.0F; List<Entity> entities = mc.theWorld.getEntitiesWithinAABBExcludingEntity(mc.renderViewEntity, mc.renderViewEntity.boundingBox.addCoord(lookVec.xCoord * distance, lookVec.yCoord * distance, lookVec.zCoord * distance).expand(boxExpand, boxExpand, boxExpand)); double vecInsideDist = distanceToVec3; for(int i = 0; i < entities.size(); i++){ Entity entity = entities.get(i); if(!canBeCollidedWith || entity.canBeCollidedWith()){ double borderSize = entity.getCollisionBorderSize(); AxisAlignedBB expEntityBox = entity.boundingBox.expand(borderSize, borderSize, borderSize); MovingObjectPosition calculateInterceptPos = expEntityBox.calculateIntercept(positionVec, posDistVec); if(expEntityBox.isVecInside(positionVec)){ if(0.0D < vecInsideDist || vecInsideDist == 0.0D){ pointedEntity = entity; tempVec = calculateInterceptPos == null ? positionVec : calculateInterceptPos.hitVec; vecInsideDist = 0.0D; } }else if(calculateInterceptPos != null){ double calcInterceptPosDist = positionVec.distanceTo(calculateInterceptPos.hitVec); if(calcInterceptPosDist < vecInsideDist || vecInsideDist == 0.0D){ if(entity == mc.renderViewEntity.ridingEntity && !entity.canRiderInteract()){ if(vecInsideDist == 0.0D){ pointedEntity = entity; tempVec = calculateInterceptPos.hitVec; } }else{ pointedEntity = entity; tempVec = calculateInterceptPos.hitVec; vecInsideDist = calcInterceptPosDist; } } } } } if(pointedEntity != null && (vecInsideDist < distanceToVec3 || rayTrace == null)){ return pointedEntity; } } } return null; }
  20. MovingObjectPosition mop = player.rayTrace(40, 1.0F); Entity ent = mop.entityHit;
×
×
  • Create New...

Important Information

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