Skip to content

Commit

Permalink
🐛 Fixed wheels not scaling when refreshing properties
Browse files Browse the repository at this point in the history
MrCrayfish committed May 30, 2022
1 parent 7cd4339 commit 02ce5db
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -36,20 +36,26 @@ public abstract class VehiclePropertiesProvider implements IDataProvider

private final DataGenerator generator;
private final Map<ResourceLocation, VehicleProperties> vehiclePropertiesMap = new HashMap<>();
private boolean scaleWheels = false;

protected VehiclePropertiesProvider(DataGenerator generator)
{
this.generator = generator;
}

public void setScaleWheels(boolean scaleWheels)
{
this.scaleWheels = scaleWheels;
}

protected final void add(EntityType<? extends VehicleEntity> type, VehicleProperties.Builder builder)
{
this.add(type.getRegistryName(), builder);
}

protected final void add(ResourceLocation id, VehicleProperties.Builder builder)
{
this.vehiclePropertiesMap.put(id, builder.build(false));
this.vehiclePropertiesMap.put(id, builder.build(this.scaleWheels));
}

public Map<ResourceLocation, VehicleProperties> getVehiclePropertiesMap()
Original file line number Diff line number Diff line change
@@ -347,6 +347,7 @@ public static void onKeyPress(InputEvent.KeyInputEvent event)
DYNAMIC_SUPPLIERS.forEach(supplier ->
{
VehiclePropertiesProvider provider = supplier.get();
provider.setScaleWheels(true);
provider.registerProperties();
provider.getVehiclePropertiesMap().forEach(DEFAULT_VEHICLE_PROPERTIES::put);
provider.getVehiclePropertiesMap().forEach(NETWORK_VEHICLE_PROPERTIES::put);

0 comments on commit 02ce5db

Please sign in to comment.