mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2025-01-23 11:27:54 +01:00
feat(api): Make PartialModel's use RL's instead of MRL's
This commit is contained in:
parent
1d9f96a822
commit
6533723fdf
2 changed files with 6 additions and 6 deletions
|
@ -4,7 +4,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.resources.model.BakedModel;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
/**
|
||||
* A helper class for loading and accessing JSON models not directly used by any blocks or items.
|
||||
|
@ -19,10 +19,10 @@ public class PartialModel {
|
|||
static final List<PartialModel> ALL = new ArrayList<>();
|
||||
static boolean tooLate = false;
|
||||
|
||||
protected final ModelResourceLocation modelLocation;
|
||||
protected final ResourceLocation modelLocation;
|
||||
protected BakedModel bakedModel;
|
||||
|
||||
public PartialModel(ModelResourceLocation modelLocation) {
|
||||
public PartialModel(ResourceLocation modelLocation) {
|
||||
if (tooLate) {
|
||||
throw new RuntimeException("Attempted to create PartialModel with location '" + modelLocation + "' after start of initial resource reload!");
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ public class PartialModel {
|
|||
}
|
||||
}
|
||||
|
||||
public ModelResourceLocation getLocation() {
|
||||
public ResourceLocation getLocation() {
|
||||
return modelLocation;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ public final class PartialModelEventHandler {
|
|||
|
||||
public static void onRegisterAdditional(ModelEvent.RegisterAdditional event) {
|
||||
for (PartialModel partial : PartialModel.ALL) {
|
||||
event.register(partial.getLocation());
|
||||
event.register(ModelResourceLocation.standalone(partial.getLocation()));
|
||||
}
|
||||
|
||||
PartialModel.tooLate = true;
|
||||
|
@ -25,7 +25,7 @@ public final class PartialModelEventHandler {
|
|||
Map<ModelResourceLocation, BakedModel> models = event.getModels();
|
||||
|
||||
for (PartialModel partial : PartialModel.ALL) {
|
||||
partial.set(models.get(partial.getLocation()));
|
||||
partial.set(models.get(ModelResourceLocation.standalone(partial.getLocation())));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue