Everything posted by f1rSt1kChannel
-
Help with compiling mod
1.8 is necessary, rather than 1.7. Thank you so much!
-
Help with compiling mod
I understand. But it is impossible to fix it.
- Help with compiling mod
-
Get private field
There all private variables, I'll get them?
-
Get private field
Okay. I need to replace the standard chat (GuiNewChat) on your own. How can I make it better?
-
Get private field
I need to get every tick field + override a private method of the super class.
-
Get private field
How to get a private field using acces transformer?
-
[1.8] Updating Tile Entities???
Look TileEntityFurnace.
-
[1.7.10][API] Interaction with pipes BuildCraft
Sorry
-
[1.7.10][API] Interaction with pipes BuildCraft
OMG, ti daje ne pereopredilil metodi... Ny tebe je pomogli na mcmodding, nah suda pista'?
-
How to use the external library with my mod?
Sorry, i'm use google translate. How to use the external library with my mod? Javassist, for example.
-
How to use the external library with my mod?
How to use the external library with my mod? Javassist, for example.
-
[1.7.10] Potion IDs
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");
-
*.patch files
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.
-
*.patch files
We need to do some of the fields of public and change some of the conditions.
-
*.patch files
I really need to change.
-
*.patch files
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();
-
*.patch files
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?
-
*.patch files
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...
-
Blow from back
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"); } }
-
Blow from back
@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
-
Blow from back
How to check that a player hit a mob from the back?
-
How to get EntityItem from cursor?
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; }
-
How to get EntityItem from cursor?
MovingObjectPosition mop = player.rayTrace(40, 1.0F); Entity ent = mop.entityHit;
-
How to get EntityItem from cursor?
UP
IPS spam blocked by CleanTalk.