Skip to content

Commit

Permalink
Fix/jei fake level (#10487)
Browse files Browse the repository at this point in the history
Fixes missing JEI pages.
Also fixes missing JEI tooltips.
  • Loading branch information
uecasm authored Nov 29, 2024
1 parent 99c6330 commit f942ccd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,8 @@ public void getTooltip(@NotNull final ITooltipBuilder tooltip,
@NotNull final IRecipeSlotsView recipeSlotsView,
final double mouseX, final double mouseY)
{
super.getTooltip(tooltip, recipe, recipeSlotsView, mouseX, mouseY);

if (recipe.getIntermediate() != Blocks.AIR)
{
if (new Rect2i(CITIZEN_X + CITIZEN_W + 4, CITIZEN_Y - 2, 24, 24).contains((int) mouseX, (int) mouseY))
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
import com.ldtteam.blockui.UiRenderMacros;
import com.ldtteam.common.fakelevel.FakeLevel;
import com.ldtteam.common.fakelevel.SingleBlockFakeLevel;
import com.minecolonies.api.MinecoloniesAPIProxy;
import com.minecolonies.api.colony.buildings.registry.BuildingEntry;
import com.minecolonies.api.colony.jobs.IJob;
Expand Down Expand Up @@ -60,7 +62,6 @@
*/
public abstract class JobBasedRecipeCategory<T> extends AbstractRecipeCategory<T>
{
protected static final JeiFakeLevel FAKE_LEVEL = new JeiFakeLevel();
private static final Map<EquipmentTypeEntry, List<ItemStack>> TOOL_CACHE = new HashMap<>();

protected static final ResourceLocation TEXTURE = new ResourceLocation(Constants.MOD_ID, "textures/gui/jei_recipe.png");
Expand Down Expand Up @@ -285,7 +286,8 @@ public InfoBlock(final String text, final String tip, final Rect2i bounds)
@NotNull
private static EntityCitizen createCitizenWithJob(@NotNull final IJob<?> job)
{
final EntityCitizen citizen = new EntityCitizen(ModEntities.CITIZEN, FAKE_LEVEL);
final FakeLevel level = new SingleBlockFakeLevel(Minecraft.getInstance().level);
final EntityCitizen citizen = new EntityCitizen(ModEntities.CITIZEN, level);
citizen.setFemale(citizen.getRandom().nextBoolean());
citizen.setTextureId(citizen.getRandom().nextInt(255));
citizen.getEntityData().set(EntityCitizen.DATA_TEXTURE_SUFFIX, CitizenData.SUFFIXES.get(citizen.getRandom().nextInt(CitizenData.SUFFIXES.size())));
Expand Down

0 comments on commit f942ccd

Please sign in to comment.