|
37 | 37 | import java.util.Locale; |
38 | 38 |
|
39 | 39 | public class FieldGuideEntryScreen extends BookScreen { |
40 | | - private final FieldGuideScreen parent; |
| 40 | + private final FieldGuideCategoryScreen parent; |
41 | 41 | private final Object entry; |
42 | 42 | private final List<ResourceLocation> spawnBiomes = new ArrayList<>(); |
43 | 43 | private Entity renderedEntity; |
44 | 44 | private long lastClickTime = 0; |
45 | 45 |
|
46 | | - public FieldGuideEntryScreen(FieldGuideScreen parent, Object entry) { |
| 46 | + public FieldGuideEntryScreen(FieldGuideCategoryScreen parent, Object entry) { |
47 | 47 | super(getTitleForEntry(entry)); |
48 | 48 | this.parent = parent; |
49 | 49 | this.entry = entry; |
@@ -103,6 +103,9 @@ private void setupEntityPreview() { |
103 | 103 | if (renderEntry instanceof EntityType<?> type && this.minecraft != null && this.minecraft.level != null) { |
104 | 104 | try { |
105 | 105 | this.renderedEntity = type.create(this.minecraft.level); |
| 106 | + if (Services.PLATFORM.isModLoaded("mixed_litter")) { |
| 107 | + Services.PLATFORM.applyMixedLitterCompat(this.renderedEntity); |
| 108 | + } |
106 | 109 | } catch (Exception ignored) { |
107 | 110 | } |
108 | 111 | } |
@@ -164,7 +167,7 @@ private void setupBiomeWidget(boolean unlocked) { |
164 | 167 | graphics.renderTooltip(this.font, Component.translatable("biome." + item.getNamespace() + "." + item.getPath()), mouseX, mouseY); |
165 | 168 | } |
166 | 169 | }, item -> { |
167 | | - if (this.minecraft != null) this.minecraft.setScreen(new FieldGuideScreen("=!" + item, this)); |
| 170 | + if (this.minecraft != null) this.minecraft.setScreen(new FieldGuideCategoryScreen("=!" + item, this)); |
168 | 171 | })); |
169 | 172 | } |
170 | 173 | } |
@@ -193,7 +196,7 @@ private void setupDropWidget(boolean unlocked) { |
193 | 196 | } |
194 | 197 | }, stack -> { |
195 | 198 | if (this.minecraft != null) |
196 | | - this.minecraft.setScreen(new FieldGuideScreen("=^" + stack.getHoverName().getString().toLowerCase(Locale.ROOT), this)); |
| 199 | + this.minecraft.setScreen(new FieldGuideCategoryScreen("=^" + stack.getHoverName().getString().toLowerCase(Locale.ROOT), this)); |
197 | 200 | })); |
198 | 201 | } |
199 | 202 | } |
@@ -225,7 +228,7 @@ private void setupNavigationButtons() { |
225 | 228 |
|
226 | 229 | this.addRenderableWidget(new FieldGuideSearchBox(this.font, this.width / 2 - 70, this.bounds.bottom() + 5, 140, 20, "", q -> { |
227 | 230 | if (!q.isEmpty() && this.minecraft != null) { |
228 | | - FieldGuideScreen searchScreen = new FieldGuideScreen(q, this); |
| 231 | + FieldGuideCategoryScreen searchScreen = new FieldGuideCategoryScreen(q, this); |
229 | 232 | searchScreen.setInitialSearchFocus(true); |
230 | 233 | this.minecraft.setScreen(searchScreen); |
231 | 234 | } |
|
0 commit comments