Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
started work on beeswax
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed May 16, 2024
1 parent bfcbf2f commit 51fac88
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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<CircuitRecipeMode> CIRCUIT_RECIPE_MODE;

public static void createConfig(){
Expand All @@ -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();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));


/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.*;
Expand Down Expand Up @@ -51,6 +53,19 @@ private static void loadOverrides(Consumer<FinishedRecipe> 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",
Expand Down Expand Up @@ -123,6 +138,11 @@ static void addWoodRecipe(Consumer<FinishedRecipe> 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<FinishedRecipe> 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<FinishedRecipe> 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");
Expand Down
Original file line number Diff line number Diff line change
@@ -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<InteractionResult> cir){
if (GTCoreConfig.HONEYCOMB_REPLACEMENT.get()){
cir.setReturnValue(InteractionResult.PASS);
}
}
}
1 change: 1 addition & 0 deletions common/src/main/resources/gtcore.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"mixins": [
"MixinBlock",
"MixinComposterBlock",
"MixinHoneycombItem",
"MixinMerchantOffer"
],
"client": [
Expand Down

0 comments on commit 51fac88

Please sign in to comment.