diff --git a/common/src/main/java/io/github/gregtechintergalactical/gtcore/GTCore.java b/common/src/main/java/io/github/gregtechintergalactical/gtcore/GTCore.java index 6282256..0946e81 100644 --- a/common/src/main/java/io/github/gregtechintergalactical/gtcore/GTCore.java +++ b/common/src/main/java/io/github/gregtechintergalactical/gtcore/GTCore.java @@ -153,6 +153,7 @@ public String getId() { @Override public void onMaterialEvent(MaterialEvent event) { event.setMaterial(GTCoreMaterials.Rubber).asSolid(295, PLATE, RING); + event.setMaterial(Beeswax).asDust(); event.setMaterial(GTCoreMaterials.FierySteel).asMetal().tool().toolDamage(4).toolSpeed(9).toolDurability(1024).toolQuality(4) .toolEnchantments(ImmutableMap.of(Enchantments.FIRE_ASPECT, 2)).handleMaterial(AntimatterMaterials.Blaze) .blacklistToolTypes(PICKAXE, SWORD).build(); diff --git a/common/src/main/java/io/github/gregtechintergalactical/gtcore/GTCoreConfig.java b/common/src/main/java/io/github/gregtechintergalactical/gtcore/GTCoreConfig.java index 581532f..0a6769c 100644 --- a/common/src/main/java/io/github/gregtechintergalactical/gtcore/GTCoreConfig.java +++ b/common/src/main/java/io/github/gregtechintergalactical/gtcore/GTCoreConfig.java @@ -5,6 +5,7 @@ import carbonconfiglib.config.ConfigEntry.EnumValue; import muramasa.antimatter.AntimatterAPI; import muramasa.antimatter.util.AntimatterPlatformUtils; +import net.minecraft.world.item.Items; public class GTCoreConfig { public static ConfigHandler CONFIG; @@ -20,6 +21,7 @@ public class GTCoreConfig { public static BoolValue DISABLE_CHARCOAL_SMELTING; public static BoolValue VILLAGER_TRADE_REPLACEMENTS; public static BoolValue COMPOSTER_OUTPUT_REPLACEMENT; + public static BoolValue HONEYCOMB_REPLACEMENT; public static EnumValue CIRCUIT_RECIPE_MODE; public static void createConfig(){ @@ -40,6 +42,7 @@ public static void createConfig(){ DISABLE_CHARCOAL_SMELTING = section.addBool("disable_charcoal_smelting", true, "If true disables log to charcoal recipes in the vanilla furnace - Default: true"); VILLAGER_TRADE_REPLACEMENTS = section.addBool("villager_trade_replacements", true, "If true replaces emeralds with gt credits in all villager trades - Default: true"); COMPOSTER_OUTPUT_REPLACEMENT = section.addBool("composter_output_replacement", true, "If true makes the composter make fertilizer instead of bonemeal - Default: true"); + HONEYCOMB_REPLACEMENT = section.addBool("honeycomb_replacement", true, "If true honeycomb usage for making waxed copper is replaced by beeswax - Default: true"); CONFIG = AntimatterPlatformUtils.createConfig(GTCore.ID, config); CONFIG.register(); } diff --git a/common/src/main/java/io/github/gregtechintergalactical/gtcore/data/GTCoreMaterials.java b/common/src/main/java/io/github/gregtechintergalactical/gtcore/data/GTCoreMaterials.java index c50908f..8b9ce9f 100644 --- a/common/src/main/java/io/github/gregtechintergalactical/gtcore/data/GTCoreMaterials.java +++ b/common/src/main/java/io/github/gregtechintergalactical/gtcore/data/GTCoreMaterials.java @@ -198,6 +198,7 @@ public class GTCoreMaterials { public static Material Energium = AntimatterAPI.register(Material.class, new Material(GTCore.ID, "energium", 0xe81e21, NONE)); public static Material Lapotronium = AntimatterAPI.register(Material.class, new Material(GTCore.ID, "lapotronium", 0x6464c8, NONE)); public static Material Fireclay = AntimatterAPI.register(Material.class, new Material(GTCore.ID, "fireclay", 0xada09b, ROUGH)); + public static Material Beeswax = AntimatterAPI.register(Material.class, new Material(GTCore.ID, "beeswax", 0xfadc6e, TextureSets.FOOD)); /** diff --git a/common/src/main/java/io/github/gregtechintergalactical/gtcore/data/TextureSets.java b/common/src/main/java/io/github/gregtechintergalactical/gtcore/data/TextureSets.java index 0eacb4b..fc3964a 100644 --- a/common/src/main/java/io/github/gregtechintergalactical/gtcore/data/TextureSets.java +++ b/common/src/main/java/io/github/gregtechintergalactical/gtcore/data/TextureSets.java @@ -6,4 +6,5 @@ public class TextureSets { public static final TextureSet LEAF = new TextureSet(GTCore.ID, "leaf"); public static final TextureSet FIERY = new TextureSet(GTCore.ID, "fiery", true); + public static final TextureSet FOOD = new TextureSet(GTCore.ID, "food"); } diff --git a/common/src/main/java/io/github/gregtechintergalactical/gtcore/loader/crafting/VanillaRecipes.java b/common/src/main/java/io/github/gregtechintergalactical/gtcore/loader/crafting/VanillaRecipes.java index ff3b7f8..7279fa0 100644 --- a/common/src/main/java/io/github/gregtechintergalactical/gtcore/loader/crafting/VanillaRecipes.java +++ b/common/src/main/java/io/github/gregtechintergalactical/gtcore/loader/crafting/VanillaRecipes.java @@ -20,10 +20,12 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.WeatheringCopper; import java.util.function.Consumer; import static com.google.common.collect.ImmutableMap.of; +import static io.github.gregtechintergalactical.gtcore.data.GTCoreMaterials.Beeswax; import static muramasa.antimatter.data.AntimatterDefaultTools.*; import static muramasa.antimatter.data.AntimatterMaterialTypes.*; import static muramasa.antimatter.data.AntimatterMaterials.*; @@ -51,6 +53,19 @@ private static void loadOverrides(Consumer consumer, AntimatterR provider.removeRecipe(new ResourceLocation("charcoal")); provider.removeRecipe(new ResourceLocation("energizedpower", "smelting/charcoal_from_smelting_sawdust_block")); } + if (GTCoreConfig.HONEYCOMB_REPLACEMENT.get()){ + for (WeatheringCopper.WeatherState weatherState : WeatheringCopper.WeatherState.values()) { + String prefix = weatherState == WeatheringCopper.WeatherState.UNAFFECTED ? "" : weatherState.name().toLowerCase() + "_"; + if (prefix.isEmpty()){ + addBeeswaxRecipe(consumer, provider, "copper_block"); + } else { + addBeeswaxRecipe(consumer, provider, prefix + "copper"); + } + addBeeswaxRecipe(consumer, provider, prefix + "cut_copper"); + addBeeswaxRecipe(consumer, provider, prefix + "cut_copper_stairs"); + addBeeswaxRecipe(consumer, provider, prefix + "cut_copper_slab"); + } + } if (!GTCoreConfig.VANILLA_OVERRIDES.get()) return; provider.addStackRecipe(consumer, "minecraft", "", "misc", new ItemStack(Items.IRON_BARS, 8), of('R', ROD.getMaterialTag(Iron)), "RRR", "RRR"); provider.addItemRecipe(consumer, "minecraft", "", "misc", @@ -123,6 +138,11 @@ static void addWoodRecipe(Consumer consumer, AntimatterRecipePro provider.addStackRecipe(consumer, domain, AntimatterPlatformUtils.getIdFromItem(plank).getPath() + "_" + amount2, "planks", new ItemStack(plank, amount2), of('S', SAW.getTag(), 'P', log), "S", "P"); } + static void addBeeswaxRecipe(Consumer consumer, AntimatterRecipeProvider provider, String id){ + provider.shapeless(consumer, "minecraft", "waxed_" + id + "_from_honeycomb", "waxed_blocks", new ItemStack(AntimatterPlatformUtils.getItemFromID(new ResourceLocation("waxed_" + id))), + AntimatterPlatformUtils.getItemFromID(new ResourceLocation(id)), DUST.getMaterialTag(Beeswax)); + } + private static void loadWood(Consumer consumer, AntimatterRecipeProvider provider) { if (GTCoreConfig.HARDER_WOOD.get()){ provider.addStackRecipe(consumer, "minecraft", "", "wood_stuff", new ItemStack(Items.STICK, 2), of('P', ItemTags.PLANKS), "P", "P"); diff --git a/common/src/main/java/io/github/gregtechintergalactical/gtcore/mixin/MixinHoneycombItem.java b/common/src/main/java/io/github/gregtechintergalactical/gtcore/mixin/MixinHoneycombItem.java new file mode 100644 index 0000000..1ab975d --- /dev/null +++ b/common/src/main/java/io/github/gregtechintergalactical/gtcore/mixin/MixinHoneycombItem.java @@ -0,0 +1,21 @@ +package io.github.gregtechintergalactical.gtcore.mixin; + +import io.github.gregtechintergalactical.gtcore.GTCoreConfig; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.item.HoneycombItem; +import net.minecraft.world.item.context.UseOnContext; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(HoneycombItem.class) +public class MixinHoneycombItem { + + @Inject(method = "useOn", at = @At("HEAD"), cancellable = true) + private void injectUseOn(UseOnContext context, CallbackInfoReturnable cir){ + if (GTCoreConfig.HONEYCOMB_REPLACEMENT.get()){ + cir.setReturnValue(InteractionResult.PASS); + } + } +} diff --git a/common/src/main/resources/gtcore.mixins.json b/common/src/main/resources/gtcore.mixins.json index 31aab69..d82fbd2 100644 --- a/common/src/main/resources/gtcore.mixins.json +++ b/common/src/main/resources/gtcore.mixins.json @@ -6,6 +6,7 @@ "mixins": [ "MixinBlock", "MixinComposterBlock", + "MixinHoneycombItem", "MixinMerchantOffer" ], "client": [