Skip to content

Commit

Permalink
Fixed Climatologist house structures
Browse files Browse the repository at this point in the history
  • Loading branch information
Forstride committed Feb 3, 2024
1 parent 2882b26 commit 8cb0eca
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions common/src/main/java/toughasnails/init/ModVillages.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import com.google.common.collect.ImmutableSet;
import com.mojang.datafixers.util.Pair;
import glitchcore.event.village.WandererTradesEvent;
import net.minecraft.Util;
import net.minecraft.core.Holder;
import net.minecraft.core.Registry;
import net.minecraft.core.RegistryAccess;
Expand All @@ -27,30 +26,24 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.trading.MerchantOffer;
import net.minecraft.world.level.ItemLike;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.block.state.properties.NoteBlockInstrument;
import net.minecraft.world.level.levelgen.structure.pools.SinglePoolElement;
import net.minecraft.world.level.levelgen.structure.pools.StructurePoolElement;
import net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool;
import net.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessorList;
import net.minecraft.world.level.material.MapColor;
import toughasnails.api.TANAPI;
import toughasnails.api.block.TANBlocks;
import toughasnails.api.item.TANItems;
import toughasnails.api.village.TANPoiTypes;
import toughasnails.api.village.TANVillagerProfessions;
import toughasnails.block.RainCollectorBlock;
import toughasnails.block.TemperatureGaugeBlock;
import toughasnails.block.ThermoregulatorBlock;
import toughasnails.block.WaterPurifierBlock;
import toughasnails.core.ToughAsNails;

import javax.annotation.Nullable;
import java.util.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import java.util.function.BiConsumer;
import java.util.function.Predicate;

Expand Down Expand Up @@ -100,6 +93,27 @@ public static void registerProfessions(BiConsumer<ResourceLocation, VillagerProf
TANVillagerProfessions.CLIMATOLOGIST = register(func, "climatologist", TANPoiTypes.CLIMATOLOGIST, SoundEvents.VILLAGER_WORK_ARMORER);
}

static class EmeraldForItems implements VillagerTrades.ItemListing {
private final Item item;
private final int cost;
private final int maxUses;
private final int villagerXp;
private final float priceMultiplier;

public EmeraldForItems(ItemLike p_35657_, int p_35658_, int p_35659_, int p_35660_) {
this.item = p_35657_.asItem();
this.cost = p_35658_;
this.maxUses = p_35659_;
this.villagerXp = p_35660_;
this.priceMultiplier = 0.05F;
}

public MerchantOffer getOffer(Entity p_219682_, RandomSource p_219683_) {
ItemStack itemstack = new ItemStack(this.item, this.cost);
return new MerchantOffer(itemstack, new ItemStack(Items.EMERALD), this.maxUses, this.villagerXp, this.priceMultiplier);
}
}

static class ItemsForEmeralds implements VillagerTrades.ItemListing {
private final ItemStack itemStack;
private final int emeraldCost;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 8cb0eca

Please sign in to comment.