Skip to content
This repository was archived by the owner on Mar 11, 2023. It is now read-only.

Commit 5aa96c9

Browse files
committed
[Everything] I changed everything, it all works. I don't know how else to explain this
1 parent c20f7e8 commit 5aa96c9

File tree

19 files changed

+387
-69
lines changed

19 files changed

+387
-69
lines changed

.gitmodules

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
[submodule "shared/dependencies/Zippy"]
2-
path = shared/dependencies/Zippy
3-
url = https://github.com/troldal/Zippy
1+
[submodule "shared/dependencies/jnif"]
2+
path = shared/dependencies/jnif
3+
url = https://gitlab.com/acuarica/jnif

Client/src/main/java/com/cero/Client.java Client/src/java/com/cero/Client.java

+6-13
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
import com.cero.sdk.client.Minecraft;
5-
import com.cero.sdk.entity.Player;
5+
import com.cero.sdk.client.entity.EntityPlayerSP;
66
import com.cero.utilities.ClientConstants;
77
import com.cero.utilities.Logger;
88
import com.cero.utilities.runtime.Interface;
@@ -133,20 +133,13 @@ void clientLoop() {
133133
printedEnter = true;
134134
}
135135

136-
Player player = minecraft.thePlayer;
136+
EntityPlayerSP player = minecraft.thePlayer;
137137

138-
double hurtTime = player.getPlayerHurtTime();
139-
double maxTime = player.getMaxHurtTime();
140-
141-
if (maxTime > 0 && hurtTime == maxTime) {
142-
double xv = player.getMotionX();
143-
double zv = player.getMotionZ();
144-
double veloReduction = 0.4;
145-
xv *= veloReduction;
146-
zv *= veloReduction;
147-
player.setMotionX(xv);
148-
player.setMotionZ(zv);
138+
if (player.maxHurtTime > 0 && player.hurtTime == player.maxHurtTime) {
139+
player.motionX *= 0.4;
140+
player.motionZ *= 0.4;
149141
}
142+
150143
} else {
151144
if (printedEnter) {
152145
Logger.info("Exited world.");

Client/src/main/java/com/cero/sdk/client/Minecraft.java Client/src/java/com/cero/sdk/client/Minecraft.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.cero.sdk.client;
22

33
import com.cero.Client;
4-
import com.cero.sdk.entity.Player;
4+
import com.cero.sdk.client.entity.EntityPlayerSP;
55
import com.cero.sdk.world.World;
66
import com.cero.utilities.runtime.Interface;
77
import org.jetbrains.annotations.NotNull;
@@ -146,7 +146,7 @@ public static class Identifiers {
146146
public Object renderManager;
147147
public Object renderItem;
148148
public Object itemRenderer;
149-
public Player thePlayer;
149+
public EntityPlayerSP thePlayer;
150150
public Object renderViewEntity;
151151
public Object pointedEntity;
152152
public Object effectRenderer;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.cero.sdk.client.entity;
2+
3+
import com.cero.sdk.entity.player.EntityPlayer;
4+
import org.jetbrains.annotations.NotNull;
5+
6+
public class AbstractClientPlayer extends EntityPlayer {
7+
public AbstractClientPlayer(@NotNull Class<?> type, @NotNull Object entity) {
8+
super(type, entity);
9+
}
10+
11+
public Object playerInfo;
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
package com.cero.sdk.client.entity;
2+
3+
import org.jetbrains.annotations.NotNull;
4+
5+
public class EntityPlayerSP extends AbstractClientPlayer {
6+
7+
public EntityPlayerSP(@NotNull Class<?> type, @NotNull Object entity) {
8+
super(type, entity);
9+
}
10+
11+
public Object sendQueue;
12+
public Object statWriter;
13+
public double lastReportedPosX;
14+
public double lastReportedPosY;
15+
public double lastReportedPosZ;
16+
public float lastReportedPitch;
17+
public boolean serverSneakState;
18+
public boolean serverSprintState;
19+
public int positionUpdateTicks;
20+
public boolean hasValidHealth;
21+
public String clientBrand;
22+
public Object movementInput;
23+
public Object minecraft; // Don't set this to interface.
24+
public int sprintToggleTimer;
25+
public int sprintingTicksLeft;
26+
public float renderArmYaw;
27+
public float renderArmPitch;
28+
public float prevRenderArmYaw;
29+
public float prevRenderArmPitch;
30+
public int horseJumpPowerCounter;
31+
public float horseJumpPower;
32+
public float timeInPortal;
33+
public float prevTimeInPortal;
34+
35+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
package com.cero.sdk.entity;
2+
3+
import com.cero.sdk.util.AxisAlignedBB;
4+
import com.cero.sdk.util.BlockPos;
5+
import com.cero.sdk.util.Vec3;
6+
import com.cero.utilities.runtime.Interface;
7+
import org.jetbrains.annotations.NotNull;
8+
9+
import java.util.Random;
10+
import java.util.UUID;
11+
12+
public class Entity extends Interface {
13+
14+
public Entity(@NotNull Class<?> type, @NotNull Object entity) { super(type, entity); }
15+
16+
public AxisAlignedBB ZERO_AXIS_ALIGNED_BOUNDING_BOX;
17+
18+
public int nextEntityID;
19+
public int entityID;
20+
public double renderDistanceWeight;
21+
public boolean preventEntitySpawning;
22+
public Entity riddenByEntity;
23+
public Entity ridingEntity;
24+
public boolean forceSpawn;
25+
public Object worldObj; // Don't set this to interface.
26+
public double prevPosX;
27+
public double prevPosY;
28+
public double prevPosZ;
29+
public double posX;
30+
public double posY;
31+
public double posZ;
32+
public double motionX;
33+
public double motionY;
34+
public double motionZ;
35+
public float rotationYaw;
36+
public float rotationPitch;
37+
public float prevRotationYaw;
38+
public float prevRotationPitch;
39+
public AxisAlignedBB boundingBox;
40+
public boolean onGround;
41+
public boolean isCollidedHorizontally;
42+
public boolean isCollidedVertically;
43+
public boolean isCollided;
44+
public boolean velocityChanged;
45+
public boolean isInWeb;
46+
public boolean isOutsideBorder;
47+
public boolean isDead;
48+
public float width;
49+
public float height;
50+
public float prevDistanceWalkedModified;
51+
public float distanceWalkedModified;
52+
public float distanceWalkedOnStepModified;
53+
public int nextStepDistance;
54+
public double lastTickPosX;
55+
public double lastTickPosY;
56+
public double lastTickPosZ;
57+
public float stepHeight;
58+
public float noClip;
59+
public float entityCollisionReduction;
60+
public Random rand;
61+
public int ticksExisted;
62+
public int fireResistance;
63+
public int fire;
64+
public boolean inWater;
65+
public int hurtResistantTime;
66+
public boolean firstUpdate;
67+
public boolean isImmuneToFire;
68+
public Object dataWatcher;
69+
public double entityRiderPitchDelta;
70+
public double entityRiderYawDelta;
71+
public boolean addedToChunk;
72+
public int chunkCoordX;
73+
public int chunkCoordY;
74+
public int chunkCoordZ;
75+
public int serverPosX;
76+
public int serverPosY;
77+
public int serverPosZ;
78+
public boolean ignoreFrustumCheck;
79+
public boolean isAirBorne;
80+
public int timeUntilPortal;
81+
public boolean inPortal;
82+
public int portalCounter;
83+
public int dimension;
84+
public BlockPos lastPortalPos;
85+
public Vec3 lastPortalVec;
86+
public Object teleportDirection; // TODO: Figure out interfacing enumerations
87+
public boolean invulnerable;
88+
public UUID entityUniqueID;
89+
90+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
package com.cero.sdk.entity;
2+
3+
import org.jetbrains.annotations.NotNull;
4+
5+
import java.util.Map;
6+
import java.util.UUID;
7+
8+
public class EntityLivingBase extends Entity {
9+
public EntityLivingBase(@NotNull Class<?> type, @NotNull Object entity) {
10+
super(type, entity);
11+
}
12+
13+
public UUID sprintingSpeedBoostModifierUUID;
14+
public Object sprintingSpeedBoostModifier;
15+
16+
public Object attributeMap;
17+
public Object combatTracker;
18+
public Map<Integer, Object> activePotionsMap;
19+
public Object previousEquipment;
20+
21+
public boolean isSwingInProgress;
22+
public int swingProgressInt;
23+
24+
public int arrowHitTimer;
25+
26+
public int hurtTime;
27+
public int maxHurtTime;
28+
29+
public float attackedAtYaw;
30+
public int deathTime;
31+
32+
public float prevSwingProgress;
33+
public float swingProgress;
34+
public float prevLimbSwingAmount;
35+
public float limbSwingAmount;
36+
public float limbSwing;
37+
38+
public int maxHurtResistantTime;
39+
40+
public float prevCameraPitch;
41+
public float cameraPitch;
42+
43+
public float randomUnused1;
44+
public float randomUnused2;
45+
46+
public float renderYawOffset;
47+
public float prevRenderYawOffset;
48+
49+
public float rotationYawHead;
50+
public float prevRotationYawHead;
51+
52+
public float jumpMovementFactor;
53+
54+
public Object attackingPlayer;
55+
56+
public int recentlyHit;
57+
public boolean dead;
58+
59+
public int entityAge;
60+
61+
public float prevOnGroundSpeedFactor;
62+
public float onGroundSpeedFactor;
63+
64+
public float movedDistance;
65+
public float prevMovedDistance;
66+
67+
public float randomUnused3;
68+
public int scoreValue;
69+
public float lastDamage;
70+
71+
public boolean isJumping;
72+
public float moveStrafing;
73+
public float moveForward;
74+
75+
public float randomYawVelocity;
76+
77+
public int newPosRotationIncrements;
78+
79+
public double newPosX;
80+
public double newPosY;
81+
public double newPosZ;
82+
83+
public double newRotationYaw;
84+
public double newRotationPitch;
85+
86+
public boolean potionsNeedUpdate;
87+
88+
public EntityLivingBase entityLivingToAttack;
89+
90+
public int revengeTimer;
91+
92+
public EntityLivingBase lastAttacker;
93+
public int lastAttackerTime;
94+
95+
public float langMovementFactor;
96+
97+
public int jumpTicks;
98+
public float absorptionAmount;
99+
100+
101+
102+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
package com.cero.sdk.entity.player;
2+
3+
import com.cero.sdk.entity.EntityLivingBase;
4+
import com.cero.sdk.util.BlockPos;
5+
import org.jetbrains.annotations.NotNull;
6+
7+
public class EntityPlayer extends EntityLivingBase {
8+
9+
public EntityPlayer(@NotNull Class<?> type, @NotNull Object entity) {
10+
super(type, entity);
11+
}
12+
13+
public Object inventory;
14+
public Object enderChest;
15+
public Object inventoryContainer;
16+
public Object currentOpenContainer;
17+
public Object foodStats;
18+
public int flyToggleTimer;
19+
public float prevCameraYaw;
20+
public float cameraYaw;
21+
public int xpCoolDown;
22+
public double prevChasingPosX;
23+
public double prevChasingPosY;
24+
public double prevChasingPosZ;
25+
public double chasingPosX;
26+
public double chasingPosY;
27+
public double chasingPosZ;
28+
public boolean sleeping;
29+
public BlockPos playerLocation;
30+
public int sleepTimer;
31+
public float renderOffsetX;
32+
public float renderOffsetY;
33+
public float renderOffsetZ;
34+
public BlockPos spawnChunk;
35+
public boolean spawnForced;
36+
public BlockPos startMineCartRidingCoordinate;
37+
public Object capabilities;
38+
public int experienceLevel;
39+
public int experienceTotal;
40+
public float experience;
41+
public int xpSeed;
42+
public Object itemInUse;
43+
public int itemInUseCount;
44+
public float speedOnGround;
45+
public float speedInAir;
46+
public int lastXPSound;
47+
public Object gameProfile;
48+
public boolean hasReducedDebug;
49+
public Object fishEntity;
50+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.cero.sdk.util;
2+
3+
import com.cero.utilities.runtime.Interface;
4+
import org.jetbrains.annotations.NotNull;
5+
6+
public class AxisAlignedBB extends Interface {
7+
8+
public AxisAlignedBB(@NotNull Class<?> type, @NotNull Object boundingBox) { super(type, boundingBox); }
9+
10+
// TODO: Figure out a way to guard setting these + implement remote constructors
11+
12+
public double minX;
13+
public double minY;
14+
public double minZ;
15+
16+
public double maxX;
17+
public double maxY;
18+
public double maxZ;
19+
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.cero.sdk.util;
2+
3+
import org.jetbrains.annotations.NotNull;
4+
5+
public class BlockPos extends Vec3i {
6+
7+
public BlockPos(@NotNull Class<?> type, @NotNull Object blockPos) { super(type, blockPos); }
8+
9+
public BlockPos ORIGIN;
10+
11+
public int NUM_X_BITS;
12+
public int NUM_Z_BITS;
13+
public int NUM_Y_BITS;
14+
15+
public int Y_SHIFT;
16+
public int X_SHIFT;
17+
18+
public long X_MASK;
19+
public long Y_MASK;
20+
public long Z_MASK;
21+
22+
}

0 commit comments

Comments
 (0)