Jump to content

thebest108

Members
  • Posts

    503
  • Joined

  • Last visited

Everything posted by thebest108

  1. How do I do that?
  2. package com.example.examplemod; import java.util.Map; import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin; import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.MCVersion; @MCVersion("1.8") @IFMLLoadingPlugin.SortingIndex(Integer.MAX_VALUE) // we want deobf no matter what public class CoreMod implements IFMLLoadingPlugin { public static boolean runtimeDeobfEnabled = false; @Override public String[] getASMTransformerClass() { System.out.println("test"); return null; } @Override public String getModContainerClass() { System.out.println("test"); return null; } @Override public String getSetupClass() { System.out.println("test"); return null; } @Override public void injectData(Map<String, Object> data) { runtimeDeobfEnabled = (Boolean) data.get("runtimeDeobfuscationEnabled"); } @Override public String getAccessTransformerClass() { System.out.println("test"); return null; } } ???
  3. Is it possible with all the gradle bloatware to make a portable version anyway?
  4. Try removing GL11.glDisable(GL11.GL_CULL_FACE);
  5. Do you have a render class with something like doRender()? If so just use GL11.rotateF(0,1,0,angle);
  6. I need to put a call into whenever an entity.moveEntity is called but theres no event for it? How would I do this
  7. I dont know anything about this, but I would guess you could possibly do that with the playerController. Theres some classes in minecraft called playercontroller that have direct control over the play and stuff
  8. Lol forget all of that. Its really easy Minecraft.getMinecraft().setIngameNotInFocus(); Plz give me thx
  9. This is hurting me to look. Its Minecraft.getMinecraft().objectMouseOver Also if you need a blockPos from it use objectMouseOver.getBlockPos(); Whatever that was was cancer
  10. K: well for a start you'll want an event set to @SubscribeEvent public void onRenderTick(RenderTickEvent event){ if (event.phase == Phase.START&& your boolean or whatever ){ Minecraft.getMinecraft().mouseObject.objectMouseOver.typeOfHit = MovingObjectType.MISS; } } This will prevent the player from being able to select anything. I think theres a boolean or something that handles if the mouse is rendered/moved, but I'm not too sure Edit: Look for something around these (not accurate names) org.lwjgl.input.Mouse.create(); this.mouseHelper = new net.minecraft.src.MouseHelper(this.mcCanvas);
  11. Here m8, since your so inclined: [embed=425,349]<iframe width="560" height="315" src="https://www.youtube.com/embed/zlUbqCobzug" frameborder="0" allowfullscreen></iframe>[/embed] When in between ticks the rendered outline will spaz out because the players hit vector updates every render(not tick), but the intercept Bounding Box is getting calculated on the old position and the result is the selected block will switch stupidly between ticks because only the hit vector got updated every frame. Now plz how do I fix it Edit: I cant achieve this by updating a number every time it gets a frame either because I need the tick server side too since its still handling collisions
  12. Its not really rendering, its just I have something that needs its movement updated (MORE) than 20 times a second. Im thinking the best way is to have a method that gets its position for that instant in time using a partial tick to get the effect that its constantly being updated. Similar to what the rendering does the entities but Im trying to extend that to the logic too. This would be used on both client and server in the end. Anyway how can I check how far between ticks I am?
  13. Isnt there some kind of hackery I could do with getSystemTime to find how far between the game is between ticks when calculating something?
  14. Is there something I could use in non-render things. I need like a Minecraft.getPartialTick
  15. Why dont you just use the normal doRender method in an entity renderer and do something like GLStateManager.pushMatrix(); GL11.scalef(); RenderMob.doRender(x,y,z,var8,partialTicks); GLStateManager.popMatrix(); It seems like you're overcomplicating thi.
  16. I would recommend expanding the falling block into a new entity and then you could just change its render method to render Exactly where the player is looking at for a nice effect. Edit: If you want it to spawn instantly you could technically allow the entity to only exist on client and instruct that one client to ignore the entity the server has (or just not render it). That way its really smooth and other people see it too
  17. player.onGround = true;
  18. Ive got something like this which kind of works but not yet. The collision detection is spot on but I think I screwed up the offsets package FlyingFortress.BoundingBoxes; import java.util.ArrayList; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.EnumFacing; import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import FlyingFortress.Entities.Ship; public class ShipBoundingBox extends AxisAlignedBB{ Ship parent; private static AxisAlignedBB tempBB; public ShipBoundingBox(double x1, double y1, double z1, double x2, double y2, double z2) { super(x1, y1, z1, x2, y2, z2); } public ShipBoundingBox(Ship ship){ //Will be the ship min/max coords super(ship.posX-10,ship.posY-10,ship.posZ-10,ship.posX+10,ship.posY+10,ship.posZ+10); parent = ship; } @Override public boolean intersectsWith(AxisAlignedBB other){ AxisAlignedBB translated = transformToLocal(other); for(Object o:parent.region.getCollidingBoundingBoxes(null, translated)){ tempBB = (AxisAlignedBB)o; if(translated.intersectsWith(tempBB)){ return true; } } return false; } @Override public double calculateXOffset(AxisAlignedBB other, double p_72316_2_){ ArrayList<AxisAlignedBB> m80s = new ArrayList<AxisAlignedBB>(); AxisAlignedBB translated = transformToLocal(other); m80s.addAll(parent.region.getCollidingBoundingBoxes(null, translated)); double highest = 0; for(AxisAlignedBB bb:m80s){ if(bb.calculateXOffset(translated, highest)>highest){ highest= bb.calculateXOffset(translated, highest); } } return highest; } @Override public double calculateYOffset(AxisAlignedBB other, double p_72316_2_){ ArrayList<AxisAlignedBB> m80s = new ArrayList<AxisAlignedBB>(); AxisAlignedBB translated = transformToLocal(other); m80s.addAll(parent.region.getCollidingBoundingBoxes(null, translated)); double highest = 0; for(AxisAlignedBB bb:m80s){ if(bb.calculateYOffset(translated, highest)>highest){ highest= bb.calculateYOffset(translated, highest); System.out.println("Obm"); } } return highest; } @Override public double calculateZOffset(AxisAlignedBB other, double p_72316_2_){ ArrayList<AxisAlignedBB> m80s = new ArrayList<AxisAlignedBB>(); AxisAlignedBB translated = transformToLocal(other); m80s.addAll(parent.region.getCollidingBoundingBoxes(null, translated)); double highest = 0; for(AxisAlignedBB bb:m80s){ if(bb.calculateZOffset(translated, highest)>highest){ highest= bb.calculateZOffset(translated, highest); } } return highest; } @Override public boolean isVecInside(Vec3 vec){ AxisAlignedBB temp = new AxisAlignedBB(vec.xCoord-.05D,vec.yCoord-.05D,vec.zCoord-.05D,vec.xCoord+.05D,vec.yCoord+.05D,vec.zCoord+.05D); AxisAlignedBB translated = transformToLocal(temp); ArrayList<AxisAlignedBB> m80s = new ArrayList<AxisAlignedBB>(); for(Object o:parent.region.getCollidingBoundingBoxes(null, translated)){ m80s.add((AxisAlignedBB)o); } for(AxisAlignedBB bb:m80s){ if(bb.isVecInside(vec)){ return true; } } return false; } @Override public AxisAlignedBB addCoord(double x, double y, double z){ return this; } @Override public AxisAlignedBB expand(double x, double y, double z){ return this; } @Override public AxisAlignedBB union(AxisAlignedBB other){ return this; } @Override public AxisAlignedBB offset(double x, double y, double z){ return this; } public AxisAlignedBB transformToLocal(AxisAlignedBB inRealWorld){ double xSize = (inRealWorld.maxX-inRealWorld.minX)/2.0D; double ySize = (inRealWorld.maxY-inRealWorld.minY)/2.0D; double zSize = (inRealWorld.maxZ-inRealWorld.minZ)/2.0D; double xPos = (inRealWorld.minX+inRealWorld.maxX)/2.0D; double yPos = (inRealWorld.minY+inRealWorld.maxY)/2.0D-parent.posY+64; double zPos = (inRealWorld.minZ+inRealWorld.maxZ)/2.0D; Vec3 rotatedPos = rotateVec3DAroundVec3D(new Vec3(xPos,yPos,zPos),new Vec3(parent.posX,parent.posY,parent.posZ),-parent.rotationYaw); Vec3 localCoords = new Vec3(rotatedPos.xCoord-parent.posX,yPos,rotatedPos.zCoord-parent.posZ); return new AxisAlignedBB(localCoords.xCoord-xSize+.5D,localCoords.yCoord-ySize,localCoords.zCoord-zSize+.5D,localCoords.xCoord+xSize+.5D,localCoords.yCoord+ySize,localCoords.zCoord+zSize+.5D); } public Vec3 rotateVec3DAroundVec3D(Vec3 var1, Vec3 var2, double var3){ double var5 = Math.cos(-var3 / 180.0D * Math.PI); double var7 = Math.sin(-var3 / 180.0D * Math.PI); double var9 = var1.xCoord - var2.xCoord; double var11 = var1.zCoord - var2.zCoord; double var13 = var9 * var5 - var11 * var7; double var15 = var9 * var7 + var11 * var5; double var17 = var13 + var2.xCoord; double var19 = var15 + var2.zCoord; return new Vec3(var17, var1.yCoord, var19); } } Any suggestions on how to fix?
  19. 1. I like boats 2. Im just wondering where I could get code for a bounding box thats able to rotate
  20. My ghetto version of rotated bounding boxes is too imprecise for me to keep using them. This is how crap they are: [embed=425,349]<iframe width="560" height="315" src="https://www.youtube.com/embed/qM5l3-U7ZX4" frameborder="0" allowfullscreen></iframe>[/embed] Hopefully showing I have something before asking will get me some sympathy, but anyway is there a library or something somewhere that can do rotated bounding boxes properly? I have no formal programming training so I dont know how to approach this
  21. What method does this
  22. How would I place a structure into the world with things like redstone timers and have them running when placed. The problem Im having is that it either isnt updating or its starting when only a part of the structure has been placed. Plz how do I get this right
  23. Well I would start by isolating the code that draws lines into another method, then try running your GL11.rotate before running the method. Edit: Try calling your GL11.glRotated(tile.rotation, 0, 1, 0); after you call the pushMatrix(); talking about the first 2 lines
×
×
  • Create New...

Important Information

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