update readme
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -124,6 +124,10 @@ public class VehicleBaseEntity extends Entity {
|
||||
@Override
|
||||
public void tick() {
|
||||
super.tick();
|
||||
TickUpdateEvent();
|
||||
}
|
||||
|
||||
public void TickUpdateEvent() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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(){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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(){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user