diff --git a/ReadMe.md b/ReadMe.md index 631c1aa..5ac6b2e 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -16,11 +16,26 @@ public class MyVehicleClass extends VehicleBaseEntity { .SetGasCelCapacity(1000); public MyVehicleClass(EntityType Type, World WorldIn) { + //The parameters in this super are the Type, the World, an array of seat positions and the vehicle build info + //specify as many seat positions as you want in this array as it loads all of them as player seats on the entity + super(Type, WorldIn, new Vector3d[]{new Vector3d(0.0D, -1D, 0.0D)}, buildInfo); // The super class handles everything entity related + + //this allows you to completely customise how the camera is structure for the vehicle, + //the first Vector is position offset, the 2nd vector is rotation, + //and then the first float value is 1st person FOV with the 2nd float value being 3rd person FOV + VehicleCameraSettings.AddEntityCameraPreset(this.getType(), new VehicleCameraPreset(new Vector3f(0,4.0f, 16.0f), new Vector3f(0,0,0),70,65f)); } + + @Override + public void TickUpdateEvent(){ + //this is called by the super class every tick update + //and is a safer way to add code without overriding what happens in the parent class + //you can still @Override the normal tick update though + } } ``` ### The entity renderer: diff --git a/src/main/java/net/halbear/hvf/Entity/VehicleBaseEntity.java b/src/main/java/net/halbear/hvf/Entity/VehicleBaseEntity.java index e0a4503..7f9450d 100644 --- a/src/main/java/net/halbear/hvf/Entity/VehicleBaseEntity.java +++ b/src/main/java/net/halbear/hvf/Entity/VehicleBaseEntity.java @@ -124,6 +124,10 @@ public class VehicleBaseEntity extends Entity { @Override public void tick() { super.tick(); + TickUpdateEvent(); + } + + public void TickUpdateEvent() { } diff --git a/src/main/java/net/halbear/hvf/Example/Aeroplane.java b/src/main/java/net/halbear/hvf/Example/Aeroplane.java index 5a9cc92..387870e 100644 --- a/src/main/java/net/halbear/hvf/Example/Aeroplane.java +++ b/src/main/java/net/halbear/hvf/Example/Aeroplane.java @@ -26,5 +26,10 @@ public class Aeroplane extends VehicleBaseEntity { new VehicleCameraPreset(new Vector3f(0,0,4.5f), new Vector3f(0,0,0),70,60)); } + + @Override + public void TickUpdateEvent(){ + + } } diff --git a/src/main/java/net/halbear/hvf/Example/Airboat.java b/src/main/java/net/halbear/hvf/Example/Airboat.java index 85af72c..ac7f2c1 100644 --- a/src/main/java/net/halbear/hvf/Example/Airboat.java +++ b/src/main/java/net/halbear/hvf/Example/Airboat.java @@ -27,4 +27,9 @@ public class Airboat extends VehicleBaseEntity { new VehicleCameraPreset(new Vector3f(0,4.0f, 16.0f), new Vector3f(0,0,0),70,65f)); } + + @Override + public void TickUpdateEvent(){ + + } }