Skip to content

Commit

Permalink
feat(api): Make PartialModel's use RL's instead of MRL's
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Jul 15, 2024
1 parent 1d9f96a commit 6533723
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
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.
Expand All @@ -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!");
}
Expand All @@ -34,7 +34,7 @@ public PartialModel(ModelResourceLocation modelLocation) {
}
}

public ModelResourceLocation getLocation() {
public ResourceLocation getLocation() {
return modelLocation;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ private 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;
Expand All @@ -25,7 +25,7 @@ public static void onBakingCompleted(ModelEvent.BakingCompleted event) {
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())));
}
}
}

0 comments on commit 6533723

Please sign in to comment.