Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void initializeClient(Consumer<IClientItemExtensions> consumer) {

@Override
public BlockEntityWithoutLevelRenderer getCustomRenderer() {
return LampItemRenderer.INSTANCE;
return LampItemRenderer.getInstance();
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@
*/
public class LampItemRenderer extends BlockEntityWithoutLevelRenderer {

public static final LampItemRenderer INSTANCE = new LampItemRenderer();
private static LampItemRenderer INSTANCE = null;

public static LampItemRenderer getInstance() {
if (INSTANCE == null) {
INSTANCE = new LampItemRenderer();
}
return INSTANCE;
}

protected final ItemRenderer itemRenderer;
protected final BlockRenderDispatcher blockRenderer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.gregtechceu.gtceu.api.item.tool.ToolHelper;
import com.gregtechceu.gtceu.data.recipe.builder.*;

import net.minecraft.advancements.critereon.InventoryChangeTrigger;
import net.minecraft.data.recipes.FinishedRecipe;
import net.minecraft.data.recipes.RecipeCategory;
import net.minecraft.data.recipes.SmithingTransformRecipeBuilder;
Expand All @@ -33,8 +34,6 @@

import java.util.function.Consumer;

import static com.tterrag.registrate.providers.RegistrateRecipeProvider.has;

public class VanillaRecipeHelper {

public static void addSmeltingRecipe(Consumer<FinishedRecipe> provider, @NotNull String regName, TagKey<Item> input,
Expand Down Expand Up @@ -631,7 +630,7 @@ public static void addSmithingTransformRecipe(Consumer<FinishedRecipe> provider,
@NotNull RecipeCategory category) {
SmithingTransformRecipeBuilder
.smithing(Ingredient.of(template), Ingredient.of(baseInput), Ingredient.of(addition), category, result)
.unlocks(String.format("has_%s", baseInput), has(baseInput))
.unlocks(String.format("has_%s", baseInput), InventoryChangeTrigger.TriggerInstance.hasItems(baseInput))
.save(provider, regName);
}

Expand Down