Skip to content

Commit

Permalink
Merge remote-tracking branch 'blusunrize/1.20.4' into fix/manualrewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
voidsong-dragonfly committed Apr 13, 2024
2 parents 4de20bc + 3ba0e47 commit bdfaa62
Show file tree
Hide file tree
Showing 850 changed files with 11,419 additions and 1,733 deletions.
4 changes: 1 addition & 3 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ body:
*If your version does not show up here, support for it has been ended.*
options:
- '1.19.2'
- '1.19.3'
- '1.19.4'
- '1.20.1'
- '1.20.4'
validations:
required: true

Expand Down
4 changes: 1 addition & 3 deletions .github/ISSUE_TEMPLATE/crash_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ body:
*If your version does not show up here, support for it has been ended.*
options:
- '1.19.2'
- '1.19.3'
- '1.19.4'
- '1.20.1'
- '1.20.4'
validations:
required: true

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
run: ./gradlew compileJava
- name: Run unit tests
run: ./gradlew test
- name: Update APT cached
run: sudo apt update
- name: Install ffprobe
run: sudo apt install ffmpeg
- name: Check for stereo sound files
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ Wires, transformers, capacitors!
# Asset Credits
- Sound for the collapsible glider is by Iain McCurdy on [freesound.org](https://freesound.org/people/iainmccurdy/sounds/645974/), licensed under CC BY 4.0
- Sound for the excavator ore conveyor is by tosha73 on [freesound.org](https://freesound.org/people/tosha73/sounds/584592/), licensed under CC BY 4.0
- Sound for the electromagnet is by _MC5_ on [freesound.org](https://freesound.org/people/_MC5_/sounds/672082/), licensed under CC BY 4.0
- Sound for the electromagnet is by _MC5_ on [freesound.org](https://freesound.org/people/_MC5_/sounds/672082/), licensed under CC BY 4.0
- Assets for several blocks are derived from @stfwi assets in [Engineer's Decor](https://github.com/stfwi/engineers-decor), licensed under MIT
- These assets include clinker bricks, slag bricks, and grit sand
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ dependencies {

compileOnly "mezz.jei:jei-1.20.4-neoforge-api:${version_jei}"
compileOnly "mezz.jei:jei-1.20.4-common-api:${version_jei}"
compileOnly "com.blamejared.crafttweaker:CraftTweaker-forge-1.18.2:9.1.137"
compileOnly "com.blamejared.crafttweaker:CraftTweaker-forge-1.20.1:14.0.34"
//TODO only API. For some reason IPeripheral (an API class) does not show up in the API artifact
// compileOnly "cc.tweaked:cc-tweaked-1.19.3-forge-api:${version_cctweaked}")
compileOnly "cc.tweaked:cc-tweaked-1.19.3-forge:${version_cctweaked}"
Expand Down
6 changes: 5 additions & 1 deletion changelog.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"homepage": "https://minecraft.curseforge.com/projects/immersive-engineering",
"promos": {

"1.20.4-latest": "1.20.4-11.1.0-172",
"1.20.4-recommended": "1.20.4-11.1.0-172"
},
"1.20.4": {
"1.20.4-11.1.0-172": "- First release for 1.20.4\n- Includes all features from 10.1.0\n- **All** of the porting work and bugfixing courtesy of Malte\n- Overhauled Mineral Veins (BluSunrize, voidsong-dragonfly)\n - Mineral veins now use biome tags as conditions, this replaces dimension keys and allows more precise filtering\n - New Vein: **Banded Iron**, a primary iron deposit because it's IE's most common resource\n - New Vein: **Lazulitic Intrusion**, comprised of lapis and gold, making it ideal for decoration and enchanting\n - New Vein: **Alluvial Sift**, only found in river biomes, this allows the excavator to mine for diamonds\n - New Vein: **Rich Auricupride**, only found in mesa biomes, high in gold and some copper\n - Changed **Pentlandite** to be primarily a nickel vein since its essential for IE's mid- and lategame architecture\n - Changed **Wolframite** to include tin when present\n - Changed all veins to output less sulfur\n - Changed a variety of other veins to prioritze secondary ores that IE relies on (lead, silver)\n - Changed weight and failchance on various veins, this makes \"necessary\" resources more common\n - Changed various veins to only show up in certain biomes, making \"decorative\" veins like Silt less common\n - Actually increased the weight of \"rare\" veins such as **Beryl** and **Uraninite**, because they are now limited by biome\n - Allow survey tools to be used on netherrack and soul sand, to make searching in the Nether viable"
}
}
57 changes: 49 additions & 8 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
##### Version 1.20.1-10.0.1-pre
##### Version 1.20.4-11.1.0-172
- First release for 1.20.4
- Includes all features from 10.1.0
- **All** of the porting work and bugfixing courtesy of Malte
- Overhauled Mineral Veins (BluSunrize, voidsong-dragonfly)
- Mineral veins now use biome tags as conditions, this replaces dimension keys and allows more precise filtering
- New Vein: **Banded Iron**, a primary iron deposit because it's IE's most common resource
- New Vein: **Lazulitic Intrusion**, comprised of lapis and gold, making it ideal for decoration and enchanting
- New Vein: **Alluvial Sift**, only found in river biomes, this allows the excavator to mine for diamonds
- New Vein: **Rich Auricupride**, only found in mesa biomes, high in gold and some copper
- Changed **Pentlandite** to be primarily a nickel vein since its essential for IE's mid- and lategame architecture
- Changed **Wolframite** to include tin when present
- Changed all veins to output less sulfur
- Changed a variety of other veins to prioritze secondary ores that IE relies on (lead, silver)
- Changed weight and failchance on various veins, this makes "necessary" resources more common
- Changed various veins to only show up in certain biomes, making "decorative" veins like Silt less common
- Actually increased the weight of "rare" veins such as **Beryl** and **Uraninite**, because they are now limited by biome
- Allow survey tools to be used on netherrack and soul sand, to make searching in the Nether viable

##### Version 1.20.1-10.1.0-171
- Includes all features from 9.2.4
- Add sounds for Arc Furnace, Excavator, and Automated Workbench (voidsong-dragonfly)
- Add burn times for the diesel generator to the manual (BluSunrize)
Expand All @@ -12,6 +31,12 @@
- It attracts nearby items when given power!
- Add the portable electromagnet! (BluSunrize)
- Install it as an upgrade on your accumulator backpack to have a magnet on the go!
- Add various blocks from Engineer's Decor (voidsong-dragonfly)
- Thank you wilechaote for giving us permission to include these blocks in the mod <3
- Add additional fertilizers for the cloche (voidsong-dragonfly)
- This should allow people to use up their surplus suflur!
- Add ability to place Engineer's Manual in a chiseled bookshelf (BluSunrize)
- Add sawmill recipes for bamboo (BluSunrize)
- Change hemp blocks to notify their neighbours when they grow (jrtc27)
- Change Jade Tooltips for multiblocks to work when looking at any part of the machine (HermitOwO)
- Fix conveyor rendering in the manual (Malte)
Expand All @@ -20,19 +45,31 @@
- Fix taiga villager houses being surrounded by air blocks (BluSunrize)
- Fix redstone control not working on the assembler (BluSunrize)
- Fix villager names not being translated in JER and EMI (BluSunrize)

##### Version 1.19.2-9.2.4-pre
- Fix error related to deprecated unicode font (BluSunrize)
- Fix bottling machine deleting items on the conveyor (BluSunrize)
- Fix bottling machine not rendering bucket-filling recipes properly (BluSunrize)
- Fix hemp replacing blocks above it when growing (BluSunrize)
- Fix fluid pipes losing their colour because the chunk wasn't marked as dirty (BluSunrize)
- Fix transparency issues with the shield and a few other item models (BluSunrize)
- Fix spawn interdiction from lanterns not working (BluSunrize)
- Fix rare crash in arc recycling calculation (BluSunrize)
- Fix possible crash in conveyor rendering (BluSunrize)
- Translations Added/Updated: ja_jo (karakufire)

##### Version 1.19.2-9.2.4-170
- Add new excavator veins for decoration blocks (voidsong-dragonfly)
- Amethyst Crevasse, a geode vein
- Hardened Claypan, a red sand & terracotta vein
- Ancient Seabed, a dead coral & dripstone vein
- Amethyst Crevasse, a geode vein
- Hardened Claypan, a red sand & terracotta vein
- Ancient Seabed, a dead coral & dripstone vein
- Add cloche recipes to grow flowers (voidsong-dragonfly)
- Add crusher recipes to make dyes (voidsong-dragonfly)
- Add items directly to inventory when: (voidsong-dragonfly)
- Cutting wires
- Picking up fluorescent tubes, core samples or the toolbox
- Cutting wires
- Picking up fluorescent tubes, core samples or the toolbox
- Add the plated shield to the "forge:tools/shields" tag (BluSunrize)
- Change turrets to accept generic entity terms like "Villager" for their black/whitelist (BluSunrize)
- Change text rendering in GUIs to be more readable (BluSunrize)
- Change assembler to handle buckets in recipes better (BluSunrize)
- Fix issues with multiblocks being accessed before being full formed (Malte)
- Fix items with obj renders breaking in the AE2 inscriber
- Fix drill overlay highlighting too many blocks (Malte)
Expand All @@ -43,6 +80,10 @@
- Fix synchronization errors in the garden clocke (voidsong-dragonfly, Malte)
- Fix induction charging on the accumulator backpack not working (BluSunrize)
- Fix multiblock sounds not triggering subtitles continuously (BluSunrize)
- Fix hemp seeds being tagged as "rods" (BluSunrize)
- Fix railgun rods applying damage like a normal arrow (BluSunrize)
- Fix villager houses for structural engineer and machinist having the wrong workstation (BluSunrize)
- Fix blueprint crafting with split up ingredients (BluSunrize)
- Translations Added/Updated: cs_cz (RomanPlayer22)

##### Version 1.20.1-10.0.0-169
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ version_neoforge=20.4.196
# "random" times. Updating this should usually be done in sync with updating the NeoForge version as there sometimes are
# cross-dependencies in e.g. argument generation.
version_neogradle=7.0.96
version_ie=11.0.1
version_ie=11.1.0
version_jei=17.0.0.30
version_cctweaked=1.102.0-SNAPSHOT
version_buildnumber=169
version_buildnumber=172
modid=immersiveengineering
15 changes: 11 additions & 4 deletions src/api/java/blusunrize/immersiveengineering/api/IETags.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import net.minecraft.tags.TagKey;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.material.Fluid;
import net.neoforged.neoforge.common.Tags.Blocks;
Expand Down Expand Up @@ -57,9 +58,11 @@ public class IETags
public static final TagKey<Block> glowstoneBlock = createBlockTag(getStorageBlock("glowstone"));
public static final TagKey<Block> colorlessSandstoneBlocks = createBlockTag(forgeLoc("sandstone/colorless"));
public static final TagKey<Block> redSandstoneBlocks = createBlockTag(forgeLoc("sandstone/red"));
public static final TagKey<Item> cutCopperBlocks = createItemWrapper(rl("cut_blocks/copper"));
public static final TagKey<Item> cutCopperStairs = createItemWrapper(rl("cut_stairs/copper"));
public static final TagKey<Item> cutCopperSlabs = createItemWrapper(rl("cut_slabs/copper"));
public static final TagKey<Block> copperBlocks = createBlockTag(rl("blocks/copper"));
public static final TagKey<Block> cutCopperBlocks = createBlockTag(rl("cut_blocks/copper"));

public static final TagKey<Block> cutCopperStairs = createBlockTag(rl("cut_stairs/copper"));
public static final TagKey<Block> cutCopperSlabs = createBlockTag(rl("cut_slabs/copper"));
//IE Blocks
public static final TagKey<Block> treatedWood = createBlockTag(forgeLoc("treated_wood"));
public static final TagKey<Block> treatedWoodSlab = createBlockTag(forgeLoc("treated_wood_slab"));
Expand All @@ -80,7 +83,7 @@ public class IETags
public static final TagKey<Item> steelRod = createItemWrapper(getRod("steel"));
public static final TagKey<Item> metalRods = createItemWrapper(getRod("all_metal"));
public static final TagKey<Item> aluminumRod = createItemWrapper(getRod("aluminum"));
public static final TagKey<Item> seedsHemp = createItemWrapper(getRod("seeds/hemp"));
public static final TagKey<Item> seedsHemp = createItemWrapper(forgeLoc("seeds/hemp"));
public static final TagKey<Item> fiberHemp = createItemWrapper(forgeLoc("fiber_hemp"));
public static final TagKey<Item> fabricHemp = createItemWrapper(forgeLoc("fabric_hemp"));
public static final TagKey<Item> coalCoke = createItemWrapper(forgeLoc("coal_coke"));
Expand Down Expand Up @@ -148,6 +151,10 @@ public class IETags
public static final TagKey<EntityType<?>> shaderbagWhitelist = createEntityWrapper(rl("shaderbag/whitelist"));
public static final TagKey<EntityType<?>> shaderbagBlacklist = createEntityWrapper(rl("shaderbag/blacklist"));

public static final TagKey<Biome> is_swamp = createBiomeWrapper(forgeLoc("is_swamp"));
public static final TagKey<Biome> generateClaypan = createBiomeWrapper(rl("generate_hardened_clay_pan"));
public static final TagKey<Biome> generateSeabed = createBiomeWrapper(rl("generate_ancient_seabed"));

static
{
for(EnumMetals m : EnumMetals.values())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public int getMaxCrafted(NonNullList<ItemStack> query)
{
Entry<ItemStack, Integer> e = queryIt.next();
ItemStack compStack = e.getKey();
if(ingr.test(compStack))
if(ingr.testIgnoringSize(compStack))
{
int taken = e.getValue()/req;
if(taken > 0)
Expand Down Expand Up @@ -134,7 +134,7 @@ public NonNullList<ItemStack> consumeInputs(NonNullList<ItemStack> query, int cr
for(int i = 0; i < query.size(); i++)
{
ItemStack queryStack = query.get(i);
if(!queryStack.isEmpty()&&ingr.test(queryStack))
if(!queryStack.isEmpty()&&ingr.testIgnoringSize(queryStack))
{
int taken = Math.min(queryStack.getCount(), inputSize);
consumed.add(ItemHandlerHelper.copyStackWithSize(queryStack, taken));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import net.minecraft.world.item.crafting.RecipeManager;
import net.minecraft.world.item.crafting.RecipeType;
import net.minecraft.world.level.Level;
import net.neoforged.bus.api.EventPriority;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.common.Mod.EventBusSubscriber;
import net.neoforged.neoforge.client.event.RecipesUpdatedEvent;
Expand All @@ -27,9 +28,6 @@
import java.util.List;
import java.util.Map;
import java.util.Objects;
import net.neoforged.neoforge.registries.DeferredHolder;
import net.minecraft.world.item.crafting.RecipeSerializer;

import java.util.function.Supplier;
import java.util.stream.Collectors;
import java.util.stream.Stream;
Expand Down Expand Up @@ -58,13 +56,13 @@ public CachedRecipeList(IERecipeTypes.TypeWithClass<R> type)
this(type.type(), type.recipeClass());
}

@SubscribeEvent
@SubscribeEvent(priority = EventPriority.HIGH)
public static void onTagsUpdated(TagsUpdatedEvent ev)
{
++reloadCount;
}

@SubscribeEvent
@SubscribeEvent(priority = EventPriority.HIGH)
public static void onRecipeUpdatedClient(RecipesUpdatedEvent ev)
{
++reloadCount;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,17 @@
import com.google.common.collect.Multimap;
import com.mojang.datafixers.util.Pair;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.resources.ResourceKey;
import net.minecraft.server.level.ColumnPos;
import net.minecraft.util.RandomSource;
import net.minecraft.world.item.crafting.RecipeHolder;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.biome.BiomeManager;
import net.minecraft.world.level.levelgen.Heightmap.Types;
import net.minecraft.world.level.levelgen.synth.PerlinSimplexNoise;

import javax.annotation.Nullable;
Expand Down Expand Up @@ -130,7 +135,7 @@ public static List<MineralVein> findVeinsForVillager(
return foundVeins;
}

public static void generatePotentialVein(Level world, ChunkPos chunkpos, RandomSource rand)
public static void generatePotentialVein(Level world, WorldGenLevel worldGenLevel, ChunkPos chunkpos, RandomSource rand)
{
int xStart = chunkpos.getMinBlockX();
int zStart = chunkpos.getMinBlockZ();
Expand Down Expand Up @@ -168,7 +173,12 @@ public static void generatePotentialVein(Level world, ChunkPos chunkpos, RandomS
if(!crossover)
{
RecipeHolder<MineralMix> mineralMix = null;
MineralSelection selection = new MineralSelection(world);
Set<Holder<Biome>> biomes = new HashSet<>();
BiomeManager biomeManager = worldGenLevel.getBiomeManager();
int surfaceHeight = worldGenLevel.getHeight(Types.WORLD_SURFACE_WG, finalPos.x(), finalPos.z());
for(int i = worldGenLevel.getMinBuildHeight(); i <= surfaceHeight; i++)
biomes.add(biomeManager.getNoiseBiomeAtPosition(pos.x(), i, pos.z()));
MineralSelection selection = new MineralSelection(world, biomes);
if(selection.getTotalWeight() > 0)
{
int weight = selection.getRandomWeight(rand);
Expand Down Expand Up @@ -222,12 +232,12 @@ public static class MineralSelection
private final int totalWeight;
private final Set<RecipeHolder<MineralMix>> validMinerals;

public MineralSelection(Level dimension)
public MineralSelection(Level world, Set<Holder<Biome>> biomes)
{
int weight = 0;
this.validMinerals = new HashSet<>();
for(RecipeHolder<MineralMix> e : MineralMix.RECIPES.getRecipes(dimension))
if(e.value().validDimension(dimension.dimensionTypeId()))
for(RecipeHolder<MineralMix> e : MineralMix.RECIPES.getRecipes(world))
if(biomes.stream().anyMatch(biome -> e.value().validBiome(biome)))
{
validMinerals.add(e);
weight += e.value().weight;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,21 @@
import blusunrize.immersiveengineering.api.crafting.*;
import blusunrize.immersiveengineering.api.crafting.cache.CachedRecipeList;
import com.google.common.collect.ImmutableSet;
import net.minecraft.core.Holder;
import net.minecraft.core.RegistryAccess;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.RecipeSerializer;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.dimension.DimensionType;
import net.neoforged.neoforge.registries.DeferredHolder;

import java.util.Collection;
import java.util.List;
import java.util.Random;
import java.util.Set;
import java.util.function.Predicate;

public class MineralMix extends IESerializableRecipe
{
Expand All @@ -36,18 +39,18 @@ public class MineralMix extends IESerializableRecipe
public final List<StackWithChance> spoils;
public final int weight;
public final float failChance;
public final ImmutableSet<ResourceKey<DimensionType>> dimensions;
public final ImmutableSet<BiomeTagPredicate> biomeTagPredicates;
public final Block background;

public MineralMix(List<StackWithChance> outputs, List<StackWithChance> spoils, int weight,
float failChance, List<ResourceKey<DimensionType>> dimensions, Block background)
float failChance, Collection<BiomeTagPredicate> biomeTagPredicates, Block background)
{
super(TagOutput.EMPTY, IERecipeTypes.MINERAL_MIX);
this.weight = weight;
this.failChance = failChance;
this.outputs = outputs;
this.spoils = spoils;
this.dimensions = ImmutableSet.copyOf(dimensions);
this.biomeTagPredicates = ImmutableSet.copyOf(biomeTagPredicates);
this.background = background;
}

Expand Down Expand Up @@ -100,10 +103,30 @@ public ItemStack getRandomSpoil(Random rand)
return ItemStack.EMPTY;
}

public boolean validDimension(ResourceKey<DimensionType> dim)
public boolean validBiome(Holder<Biome> biome)
{
if(dimensions!=null&&!dimensions.isEmpty())
return dimensions.contains(dim);
return true;
if(biomeTagPredicates.isEmpty())
return true;
return biomeTagPredicates.stream().allMatch(
predicate -> predicate.test(biome)
);
}

/**
* A predicate for checking a biome against multiple tags.
* Returns true if ANY of the tags match.
*/
public record BiomeTagPredicate(Set<TagKey<Biome>> tags) implements Predicate<Holder<Biome>>
{
public BiomeTagPredicate(TagKey<Biome> singular)
{
this(ImmutableSet.of(singular));
}

@Override
public boolean test(Holder<Biome> biomeHolder)
{
return this.tags().stream().anyMatch(biomeHolder::is);
}
}
}
Loading

0 comments on commit bdfaa62

Please sign in to comment.