Skip to content

Commit

Permalink
[1.21.1] Fix WeightedBakedModel not calling getModelData() on the nes…
Browse files Browse the repository at this point in the history
…ted model (#1539)
  • Loading branch information
XFactHD authored Sep 15, 2024
1 parent f3bea96 commit 3ae5774
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
public boolean isGui3d() {
return this.wrapped.isGui3d();
}
@@ -61,8 +_,25 @@
@@ -61,8 +_,30 @@
}

@Override
Expand All @@ -57,6 +57,11 @@
+ return WeightedRandom.getWeightedItem(this.list, Math.abs((int)rand.nextLong()) % this.totalWeight)
+ .map((p_235065_) -> p_235065_.data().getRenderTypes(state, rand, data))
+ .orElse(net.neoforged.neoforge.client.ChunkRenderTypeSet.none());
+ }
+
+ @Override
+ public net.neoforged.neoforge.client.model.data.ModelData getModelData(net.minecraft.world.level.BlockAndTintGetter level, net.minecraft.core.BlockPos pos, BlockState state, net.neoforged.neoforge.client.model.data.ModelData modelData) {
+ return this.wrapped.getModelData(level, pos, state, modelData);
}

@Override

0 comments on commit 3ae5774

Please sign in to comment.