-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
starting new entity system and fixed a few chunk issues
- Loading branch information
Showing
18 changed files
with
330 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package dev.hilligans.ourcraft.entity; | ||
|
||
public class Entities { | ||
|
||
public static final EntityType PLAYER = new EntityType("player", "ourcraft"); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/dev/hilligans/ourcraft/entity/EntityType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package dev.hilligans.ourcraft.entity; | ||
|
||
import dev.hilligans.ourcraft.util.registry.IRegistryElement; | ||
|
||
public class EntityType implements IRegistryElement { | ||
|
||
public String owner; | ||
public String name; | ||
|
||
public EntityType(String name, String modID) { | ||
this.name = name; | ||
this.owner = modID; | ||
} | ||
|
||
@Override | ||
public String getResourceName() { | ||
return name; | ||
} | ||
|
||
@Override | ||
public String getResourceOwner() { | ||
return owner; | ||
} | ||
|
||
@Override | ||
public String getResourceType() { | ||
return "entity_type"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
src/main/java/dev/hilligans/ourcraft/entity/ILivingEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package dev.hilligans.ourcraft.entity; | ||
|
||
public interface ILivingEntity extends IEntity { | ||
|
||
int getHealth(); | ||
|
||
void setHealth(int health); | ||
|
||
void dealDamage(int dmg); | ||
|
||
void heal(int amount); | ||
|
||
boolean alive(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
src/main/java/dev/hilligans/ourcraft/entity/NewEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
package dev.hilligans.ourcraft.entity; | ||
|
||
import dev.hilligans.ourcraft.data.other.IBoundingBox; | ||
import dev.hilligans.ourcraft.world.newworldsystem.IWorld; | ||
|
||
public class NewEntity implements IEntity { | ||
|
||
public IWorld world; | ||
public EntityType entityType; | ||
public long entityID; | ||
|
||
public float pitch, yaw, velX, velY, velZ; | ||
public double x, y, z; | ||
|
||
public IBoundingBox boundingBox = IBoundingBox.EMPTY_BOX; | ||
|
||
public NewEntity(EntityType entityType) { | ||
this.entityType = entityType; | ||
} | ||
|
||
@Override | ||
public IWorld getWorld() { | ||
return this.world; | ||
} | ||
|
||
@Override | ||
public void setWorld(IWorld world) { | ||
this.world = world; | ||
} | ||
|
||
@Override | ||
public void setRot(float pitch, float yaw, float roll) { | ||
this.pitch = pitch; | ||
this.yaw = yaw; | ||
} | ||
|
||
@Override | ||
public long getID() { | ||
return entityID; | ||
} | ||
|
||
@Override | ||
public void setID(long id) { | ||
this.entityID = id; | ||
} | ||
|
||
@Override | ||
public EntityType getEntityType() { | ||
return entityType; | ||
} | ||
|
||
@Override | ||
public IBoundingBox getEntityBoundingBox() { | ||
return boundingBox; | ||
} | ||
|
||
@Override | ||
public float getPitch() { | ||
return pitch; | ||
} | ||
|
||
@Override | ||
public float getYaw() { | ||
return yaw; | ||
} | ||
|
||
@Override | ||
public float getRoll() { | ||
return 0; | ||
} | ||
|
||
@Override | ||
public void setVel(float velX, float velY, float velZ) { | ||
this.velX = velX; | ||
this.velY = velY; | ||
this.velZ = velZ; | ||
} | ||
|
||
@Override | ||
public float getVelX() { | ||
return velX; | ||
} | ||
|
||
@Override | ||
public float getVelY() { | ||
return velY; | ||
} | ||
|
||
@Override | ||
public float getVelZ() { | ||
return velZ; | ||
} | ||
|
||
@Override | ||
public void setPosition(double x, double y, double z) { | ||
this.x = x; | ||
this.y = y; | ||
this.z = z; | ||
} | ||
|
||
@Override | ||
public double getX() { | ||
return x; | ||
} | ||
|
||
@Override | ||
public double getY() { | ||
return y; | ||
} | ||
|
||
@Override | ||
public double getZ() { | ||
return z; | ||
} | ||
|
||
@Override | ||
public void tick() { | ||
|
||
} | ||
} |
Oops, something went wrong.