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