Compare commits

..

No commits in common. "f574925a47c2d9624b3bcc57a8515428c3c80f27" and "43a23883e3f35e6dc60e3856c6effb4cd6d7763a" have entirely different histories.

37 changed files with 35 additions and 371 deletions

View file

@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false org.gradle.daemon=false
# Actually Additions # Actually Additions
mod_version=1.3.6 mod_version=1.3.5
# Forge # Forge
game_version=1.21.1 game_version=1.21.1

View file

@ -1,19 +1,10 @@
// 1.21.1 2024-10-22T22:13:28.2925645 Registries // 1.21.1 2024-08-11T19:30:01.8308187 Registries
74628b34b75e1a2fa2ac1f6282b7d9d4e155c254 data/actuallyadditions/banner_pattern/book.json 74628b34b75e1a2fa2ac1f6282b7d9d4e155c254 data/actuallyadditions/banner_pattern/book.json
899dfa1e0d0b15ffc090605543ec144bbfcacc4c data/actuallyadditions/banner_pattern/drill.json 899dfa1e0d0b15ffc090605543ec144bbfcacc4c data/actuallyadditions/banner_pattern/drill.json
7d9a33a9a151ad83de36e9af8822d08c86137adc data/actuallyadditions/banner_pattern/leaf_blo.json 7d9a33a9a151ad83de36e9af8822d08c86137adc data/actuallyadditions/banner_pattern/leaf_blo.json
2e09aca41de0d283a4db78add64744852788bbeb data/actuallyadditions/banner_pattern/phan_con.json 2e09aca41de0d283a4db78add64744852788bbeb data/actuallyadditions/banner_pattern/phan_con.json
020d2b1f1c21d6c6663ef8126a52e2b9deb0e52e data/actuallyadditions/damage_type/atomicreconstructor.json 020d2b1f1c21d6c6663ef8126a52e2b9deb0e52e data/actuallyadditions/damage_type/atomicreconstructor.json
4ba41428fdcf03f52855029153722e22e8702823 data/actuallyadditions/neoforge/biome_modifier/add_black_quartz.json 4ba41428fdcf03f52855029153722e22e8702823 data/actuallyadditions/neoforge/biome_modifier/add_black_quartz.json
360756e7cd20afc4c6b2ad58b2fd4f37358f2ee6 data/actuallyadditions/neoforge/biome_modifier/add_canola.json
0f06d7aad676a45a4ca187552ac8c4bbd6f1b1b7 data/actuallyadditions/neoforge/biome_modifier/add_coffee.json
1401a66bbf2e1daaa459381103ffba9d02be352d data/actuallyadditions/neoforge/biome_modifier/add_flax.json
dceca4be717b43a4dfc945f62f5c09622604d7f4 data/actuallyadditions/worldgen/configured_feature/canola_patch.json
d56ed72dde226d9ac5eb07fa701f7a3902f1dcf2 data/actuallyadditions/worldgen/configured_feature/coffee_patch.json
9a42d5943e40d102c5e9efee988527da3622d88d data/actuallyadditions/worldgen/configured_feature/flax_patch.json
80765c24aa747df53139d14a9ac3293b4b3eab16 data/actuallyadditions/worldgen/configured_feature/ore_black_quartz.json 80765c24aa747df53139d14a9ac3293b4b3eab16 data/actuallyadditions/worldgen/configured_feature/ore_black_quartz.json
0401f9a4edd53ed76536a2c050364a6a442185bd data/actuallyadditions/worldgen/placed_feature/canola_patch.json
d7358c6519319ed3950dcdc34102504c53ccaf22 data/actuallyadditions/worldgen/placed_feature/coffee_patch.json
fb7baf3c1d721832a9b5bcea7ac7dd3ee2c50118 data/actuallyadditions/worldgen/placed_feature/flax_patch.json
efb41395b407edbd91712bcb63976de46fed5d04 data/actuallyadditions/worldgen/placed_feature/ore_black_quartz.json efb41395b407edbd91712bcb63976de46fed5d04 data/actuallyadditions/worldgen/placed_feature/ore_black_quartz.json
7cf126882346a296f045db75facf741c77b7d3b1 data/actuallyadditions/worldgen/processor_list/engineer_house.json 7cf126882346a296f045db75facf741c77b7d3b1 data/actuallyadditions/worldgen/processor_list/engineer_house.json

View file

@ -0,0 +1 @@
// 1.21.1 2024-10-22T19:46:05.5548254 Update structure files in /structure

View file

@ -1 +0,0 @@
// 1.21.1 2024-10-22T20:41:07.9123026 Update structure files in /structure/

View file

@ -1,13 +0,0 @@
{
"type": "actuallyadditions:bool_config_feature_modifier",
"biomes": {
"type": "neoforge:or",
"values": [
"#c:is_hot/overworld",
"#c:is_sparse_vegetation/overworld"
]
},
"boolConfig": "generateCanola",
"features": "actuallyadditions:canola_patch",
"step": "vegetal_decoration"
}

View file

@ -1,7 +0,0 @@
{
"type": "actuallyadditions:bool_config_feature_modifier",
"biomes": "#c:is_hot/overworld",
"boolConfig": "generateCoffee",
"features": "actuallyadditions:coffee_patch",
"step": "vegetal_decoration"
}

View file

@ -1,13 +0,0 @@
{
"type": "actuallyadditions:bool_config_feature_modifier",
"biomes": {
"type": "neoforge:or",
"values": [
"#c:is_dense_vegetation/overworld",
"#c:is_cold/overworld"
]
},
"boolConfig": "generateFlax",
"features": "actuallyadditions:flax_patch",
"step": "vegetal_decoration"
}

View file

@ -1,33 +0,0 @@
{
"type": "minecraft:random_patch",
"config": {
"feature": {
"feature": {
"type": "minecraft:simple_block",
"config": {
"to_place": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "actuallyadditions:canola",
"Properties": {
"age": "7"
}
}
}
}
},
"placement": [
{
"type": "minecraft:block_predicate_filter",
"predicate": {
"type": "minecraft:matching_blocks",
"blocks": "minecraft:air"
}
}
]
},
"tries": 10,
"xz_spread": 7,
"y_spread": 3
}
}

View file

@ -1,33 +0,0 @@
{
"type": "minecraft:random_patch",
"config": {
"feature": {
"feature": {
"type": "minecraft:simple_block",
"config": {
"to_place": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "actuallyadditions:coffee",
"Properties": {
"age": "7"
}
}
}
}
},
"placement": [
{
"type": "minecraft:block_predicate_filter",
"predicate": {
"type": "minecraft:matching_blocks",
"blocks": "minecraft:air"
}
}
]
},
"tries": 6,
"xz_spread": 7,
"y_spread": 3
}
}

View file

@ -1,33 +0,0 @@
{
"type": "minecraft:random_patch",
"config": {
"feature": {
"feature": {
"type": "minecraft:simple_block",
"config": {
"to_place": {
"type": "minecraft:simple_state_provider",
"state": {
"Name": "actuallyadditions:flax",
"Properties": {
"age": "7"
}
}
}
}
},
"placement": [
{
"type": "minecraft:block_predicate_filter",
"predicate": {
"type": "minecraft:matching_blocks",
"blocks": "minecraft:air"
}
}
]
},
"tries": 8,
"xz_spread": 7,
"y_spread": 3
}
}

View file

@ -1,25 +0,0 @@
{
"feature": "actuallyadditions:canola_patch",
"placement": [
{
"type": "minecraft:rarity_filter",
"chance": 8
},
{
"type": "minecraft:noise_threshold_count",
"above_noise": 10,
"below_noise": 5,
"noise_level": -0.8
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "WORLD_SURFACE_WG"
},
{
"type": "minecraft:biome"
}
]
}

View file

@ -1,25 +0,0 @@
{
"feature": "actuallyadditions:coffee_patch",
"placement": [
{
"type": "minecraft:rarity_filter",
"chance": 8
},
{
"type": "minecraft:noise_threshold_count",
"above_noise": 10,
"below_noise": 5,
"noise_level": -0.8
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "WORLD_SURFACE_WG"
},
{
"type": "minecraft:biome"
}
]
}

View file

@ -1,25 +0,0 @@
{
"feature": "actuallyadditions:flax_patch",
"placement": [
{
"type": "minecraft:rarity_filter",
"chance": 8
},
{
"type": "minecraft:noise_threshold_count",
"above_noise": 10,
"below_noise": 5,
"noise_level": -0.8
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "WORLD_SURFACE_WG"
},
{
"type": "minecraft:biome"
}
]
}

View file

@ -20,7 +20,6 @@ import net.minecraft.data.PackOutput;
import net.minecraft.data.registries.VanillaRegistries; import net.minecraft.data.registries.VanillaRegistries;
import net.minecraft.world.damagesource.DamageType; import net.minecraft.world.damagesource.DamageType;
import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.ModList;
import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.fml.common.EventBusSubscriber;
import net.neoforged.neoforge.common.data.DatapackBuiltinEntriesProvider; import net.neoforged.neoforge.common.data.DatapackBuiltinEntriesProvider;
import net.neoforged.neoforge.common.data.ExistingFileHelper; import net.neoforged.neoforge.common.data.ExistingFileHelper;
@ -68,7 +67,6 @@ public class ActuallyAdditionsData {
generator.addProvider(true, new SoundsGenerator(packOutput, helper)); generator.addProvider(true, new SoundsGenerator(packOutput, helper));
if (ModList.get().isLoaded("patchouli"))
generator.addProvider(true, new PatchouliGenerator(packOutput, lookupProvider)); generator.addProvider(true, new PatchouliGenerator(packOutput, lookupProvider));
generator.addProvider(true, new GlobalLootModifierGenerator(packOutput, lookupProvider)); generator.addProvider(true, new GlobalLootModifierGenerator(packOutput, lookupProvider));

View file

@ -73,6 +73,8 @@ import net.neoforged.neoforge.client.settings.KeyConflictContext;
import net.neoforged.neoforge.common.NeoForge; import net.neoforged.neoforge.common.NeoForge;
import net.neoforged.neoforge.network.PacketDistributor; import net.neoforged.neoforge.network.PacketDistributor;
import java.util.Optional;
public class ActuallyAdditionsClient { public class ActuallyAdditionsClient {
private static final KeyMapping OPEN_CRAFTING_KEY = new KeyMapping("key.actualladditions.crafting_stick_open.desc", KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM, -1, "key.actuallyadditions.category"); private static final KeyMapping OPEN_CRAFTING_KEY = new KeyMapping("key.actualladditions.crafting_stick_open.desc", KeyConflictContext.IN_GAME, InputConstants.Type.KEYSYM, -1, "key.actuallyadditions.category");

View file

@ -1,13 +1,8 @@
package de.ellpeck.actuallyadditions.mod.blocks.base; package de.ellpeck.actuallyadditions.mod.blocks.base;
import net.minecraft.core.BlockPos;
import net.minecraft.server.level.WorldGenRegion;
import net.minecraft.tags.BlockTags;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.ItemLike; import net.minecraft.world.level.ItemLike;
import net.minecraft.world.level.block.CropBlock; import net.minecraft.world.level.block.CropBlock;
import net.minecraft.world.level.block.state.BlockState;
import java.util.function.Supplier; import java.util.function.Supplier;
@ -22,12 +17,4 @@ public class AACrops extends CropBlock {
protected ItemLike getBaseSeedId() { protected ItemLike getBaseSeedId() {
return this.itemSupplier.get(); return this.itemSupplier.get();
} }
@Override
protected boolean mayPlaceOn(BlockState state, BlockGetter level, BlockPos pos) {
if (level instanceof WorldGenRegion) {
return state.is(BlockTags.DIRT);
}
return super.mayPlaceOn(state, level, pos);
}
} }

View file

@ -13,6 +13,7 @@ package de.ellpeck.actuallyadditions.mod.blocks.base;
import de.ellpeck.actuallyadditions.mod.config.CommonConfig; import de.ellpeck.actuallyadditions.mod.config.CommonConfig;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityInventoryBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityInventoryBase;
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.ChatFormatting; import net.minecraft.ChatFormatting;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.Component; import net.minecraft.network.chat.Component;

View file

@ -72,17 +72,11 @@ public class CommonConfig {
public static class Worldgen { public static class Worldgen {
public static ModConfigSpec.BooleanValue GENERATE_QUARTZ; public static ModConfigSpec.BooleanValue GENERATE_QUARTZ;
public static ModConfigSpec.BooleanValue GENERATE_CANOLA;
public static ModConfigSpec.BooleanValue GENERATE_FLAX;
public static ModConfigSpec.BooleanValue GENERATE_COFFEE;
public static void build() { public static void build() {
BUILDER.comment("Worldgen Settings").push("worldgenSettings"); BUILDER.comment("Worldgen Settings").push("worldgenSettings");
GENERATE_QUARTZ = BUILDER.comment("Should Black Quartz generate in the world?").define("generateQuartz", true); GENERATE_QUARTZ = BUILDER.comment("Should Black Quartz generate in the world?").define("laserRelayLoss", true);
GENERATE_CANOLA = BUILDER.comment("Should Canola generate in the World?").define("generateCanola", true);
GENERATE_FLAX = BUILDER.comment("Should Flax generate in the world?").define("generateFlax", true);
GENERATE_COFFEE = BUILDER.comment("Should Coffee generate in the world?").define("generateCoffee", true);
BUILDER.pop(); BUILDER.pop();
} }

View file

@ -23,6 +23,7 @@ import de.ellpeck.actuallyadditions.mod.items.ItemDrillUpgrade;
import de.ellpeck.actuallyadditions.mod.tile.IEnergyDisplay; import de.ellpeck.actuallyadditions.mod.tile.IEnergyDisplay;
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase; import de.ellpeck.actuallyadditions.mod.tile.TileEntityBase;
import de.ellpeck.actuallyadditions.mod.util.AssetUtil; import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import io.netty.util.internal.ConcurrentSet; import io.netty.util.internal.ConcurrentSet;
import net.minecraft.ChatFormatting; import net.minecraft.ChatFormatting;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;

View file

@ -16,13 +16,11 @@ import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.levelgen.GenerationStep; import net.minecraft.world.level.levelgen.GenerationStep;
import net.minecraft.world.level.levelgen.placement.PlacedFeature; import net.minecraft.world.level.levelgen.placement.PlacedFeature;
import net.neoforged.bus.api.IEventBus; import net.neoforged.bus.api.IEventBus;
import net.neoforged.neoforge.common.Tags;
import net.neoforged.neoforge.common.conditions.ICondition; import net.neoforged.neoforge.common.conditions.ICondition;
import net.neoforged.neoforge.common.world.BiomeModifier; import net.neoforged.neoforge.common.world.BiomeModifier;
import net.neoforged.neoforge.registries.DeferredHolder; import net.neoforged.neoforge.registries.DeferredHolder;
import net.neoforged.neoforge.registries.DeferredRegister; import net.neoforged.neoforge.registries.DeferredRegister;
import net.neoforged.neoforge.registries.NeoForgeRegistries; import net.neoforged.neoforge.registries.NeoForgeRegistries;
import net.neoforged.neoforge.registries.holdersets.OrHolderSet;
import java.util.function.Supplier; import java.util.function.Supplier;
@ -48,12 +46,6 @@ public final class ActuallyBiomeModifiers {
protected static final ResourceKey<BiomeModifier> ADD_BLACK_QUARTZ_ORE_MODIFIER = ResourceKey.create(NeoForgeRegistries.Keys.BIOME_MODIFIERS, protected static final ResourceKey<BiomeModifier> ADD_BLACK_QUARTZ_ORE_MODIFIER = ResourceKey.create(NeoForgeRegistries.Keys.BIOME_MODIFIERS,
ActuallyAdditions.modLoc("add_black_quartz")); ActuallyAdditions.modLoc("add_black_quartz"));
protected static final ResourceKey<BiomeModifier> ADD_CANOLA = ResourceKey.create(NeoForgeRegistries.Keys.BIOME_MODIFIERS,
ActuallyAdditions.modLoc("add_canola"));
protected static final ResourceKey<BiomeModifier> ADD_FLAX = ResourceKey.create(NeoForgeRegistries.Keys.BIOME_MODIFIERS,
ActuallyAdditions.modLoc("add_flax"));
protected static final ResourceKey<BiomeModifier> ADD_COFFEE = ResourceKey.create(NeoForgeRegistries.Keys.BIOME_MODIFIERS,
ActuallyAdditions.modLoc("add_coffee"));
public static void bootstrap(BootstrapContext<BiomeModifier> context) { public static void bootstrap(BootstrapContext<BiomeModifier> context) {
HolderGetter<Biome> biomeGetter = context.lookup(Registries.BIOME); HolderGetter<Biome> biomeGetter = context.lookup(Registries.BIOME);
@ -66,20 +58,5 @@ public final class ActuallyBiomeModifiers {
HolderSet.direct(placedGetter.getOrThrow(ActuallyPlacedFeatures.PLACED_ORE_BLACK_QUARTZ)), HolderSet.direct(placedGetter.getOrThrow(ActuallyPlacedFeatures.PLACED_ORE_BLACK_QUARTZ)),
GenerationStep.Decoration.UNDERGROUND_ORES, "generateQuartz" GenerationStep.Decoration.UNDERGROUND_ORES, "generateQuartz"
)); ));
context.register(ADD_CANOLA, new BoolConfigFeatureBiomeModifier(
new OrHolderSet<>(biomeGetter.getOrThrow(Tags.Biomes.IS_HOT_OVERWORLD), biomeGetter.getOrThrow(Tags.Biomes.IS_SPARSE_VEGETATION_OVERWORLD)),
HolderSet.direct(placedGetter.getOrThrow(ActuallyPlacedFeatures.CANOLA_PATCH)),
GenerationStep.Decoration.VEGETAL_DECORATION, "generateCanola"
));
context.register(ADD_FLAX, new BoolConfigFeatureBiomeModifier(
new OrHolderSet<>(biomeGetter.getOrThrow(Tags.Biomes.IS_DENSE_VEGETATION_OVERWORLD), biomeGetter.getOrThrow(Tags.Biomes.IS_COLD_OVERWORLD)),
HolderSet.direct(placedGetter.getOrThrow(ActuallyPlacedFeatures.FLAX_PATCH)),
GenerationStep.Decoration.VEGETAL_DECORATION, "generateFlax"
));
context.register(ADD_COFFEE, new BoolConfigFeatureBiomeModifier(
biomeGetter.getOrThrow(Tags.Biomes.IS_HOT_OVERWORLD),
HolderSet.direct(placedGetter.getOrThrow(ActuallyPlacedFeatures.COFFEE_PATCH)),
GenerationStep.Decoration.VEGETAL_DECORATION, "generateCoffee"
));
} }
} }

View file

@ -2,20 +2,14 @@ package de.ellpeck.actuallyadditions.mod.gen;
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions; import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.blocks.base.AACrops;
import net.minecraft.core.registries.Registries; import net.minecraft.core.registries.Registries;
import net.minecraft.data.worldgen.BootstrapContext; import net.minecraft.data.worldgen.BootstrapContext;
import net.minecraft.data.worldgen.features.FeatureUtils; import net.minecraft.data.worldgen.features.FeatureUtils;
import net.minecraft.data.worldgen.placement.PlacementUtils;
import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceKey;
import net.minecraft.tags.BlockTags; import net.minecraft.tags.BlockTags;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; import net.minecraft.world.level.levelgen.feature.ConfiguredFeature;
import net.minecraft.world.level.levelgen.feature.Feature; import net.minecraft.world.level.levelgen.feature.Feature;
import net.minecraft.world.level.levelgen.feature.configurations.OreConfiguration; import net.minecraft.world.level.levelgen.feature.configurations.OreConfiguration;
import net.minecraft.world.level.levelgen.feature.configurations.RandomPatchConfiguration;
import net.minecraft.world.level.levelgen.feature.configurations.SimpleBlockConfiguration;
import net.minecraft.world.level.levelgen.feature.stateproviders.BlockStateProvider;
import net.minecraft.world.level.levelgen.structure.templatesystem.RuleTest; import net.minecraft.world.level.levelgen.structure.templatesystem.RuleTest;
import net.minecraft.world.level.levelgen.structure.templatesystem.TagMatchTest; import net.minecraft.world.level.levelgen.structure.templatesystem.TagMatchTest;
@ -23,9 +17,6 @@ import java.util.List;
public class ActuallyConfiguredFeatures { public class ActuallyConfiguredFeatures {
public static final ResourceKey<ConfiguredFeature<?, ?>> ORE_BLACK_QUARTZ = createKey("ore_black_quartz"); public static final ResourceKey<ConfiguredFeature<?, ?>> ORE_BLACK_QUARTZ = createKey("ore_black_quartz");
public static final ResourceKey<ConfiguredFeature<?, ?>> CANOLA_PATCH = createKey("canola_patch");
public static final ResourceKey<ConfiguredFeature<?, ?>> FLAX_PATCH = createKey("flax_patch");
public static final ResourceKey<ConfiguredFeature<?, ?>> COFFEE_PATCH = createKey("coffee_patch");
public static void bootstrap(BootstrapContext<ConfiguredFeature<?, ?>> context) { public static void bootstrap(BootstrapContext<ConfiguredFeature<?, ?>> context) {
RuleTest stoneRuleTest = new TagMatchTest(BlockTags.STONE_ORE_REPLACEABLES); RuleTest stoneRuleTest = new TagMatchTest(BlockTags.STONE_ORE_REPLACEABLES);
@ -35,16 +26,6 @@ public class ActuallyConfiguredFeatures {
OreConfiguration.target(deepslateRuleTest, ActuallyBlocks.BLACK_QUARTZ_ORE.get().defaultBlockState()) OreConfiguration.target(deepslateRuleTest, ActuallyBlocks.BLACK_QUARTZ_ORE.get().defaultBlockState())
); );
FeatureUtils.register(context, ORE_BLACK_QUARTZ, Feature.ORE, new OreConfiguration(list, 6)); FeatureUtils.register(context, ORE_BLACK_QUARTZ, Feature.ORE, new OreConfiguration(list, 6));
FeatureUtils.register(context, CANOLA_PATCH, Feature.RANDOM_PATCH, plantPatch(ActuallyBlocks.CANOLA.get(), 10));
FeatureUtils.register(context, FLAX_PATCH, Feature.RANDOM_PATCH, plantPatch(ActuallyBlocks.FLAX.get(), 8));
FeatureUtils.register(context, COFFEE_PATCH, Feature.RANDOM_PATCH, plantPatch(ActuallyBlocks.COFFEE.get(), 6));
}
private static RandomPatchConfiguration plantPatch(Block crop, int tries) {
BlockStateProvider stateProvider = BlockStateProvider.simple(crop.defaultBlockState().setValue(AACrops.AGE, AACrops.MAX_AGE));
return FeatureUtils.simpleRandomPatchConfiguration(
tries, PlacementUtils.onlyWhenEmpty(Feature.SIMPLE_BLOCK, new SimpleBlockConfiguration(stateProvider))
);
} }
private static ResourceKey<ConfiguredFeature<?, ?>> createKey(String name) { private static ResourceKey<ConfiguredFeature<?, ?>> createKey(String name) {

View file

@ -12,55 +12,19 @@ import net.minecraft.world.level.levelgen.placement.BiomeFilter;
import net.minecraft.world.level.levelgen.placement.CountPlacement; import net.minecraft.world.level.levelgen.placement.CountPlacement;
import net.minecraft.world.level.levelgen.placement.HeightRangePlacement; import net.minecraft.world.level.levelgen.placement.HeightRangePlacement;
import net.minecraft.world.level.levelgen.placement.InSquarePlacement; import net.minecraft.world.level.levelgen.placement.InSquarePlacement;
import net.minecraft.world.level.levelgen.placement.NoiseThresholdCountPlacement;
import net.minecraft.world.level.levelgen.placement.PlacedFeature; import net.minecraft.world.level.levelgen.placement.PlacedFeature;
import net.minecraft.world.level.levelgen.placement.PlacementModifier; import net.minecraft.world.level.levelgen.placement.PlacementModifier;
import net.minecraft.world.level.levelgen.placement.RarityFilter;
import java.util.List; import java.util.List;
public class ActuallyPlacedFeatures { public class ActuallyPlacedFeatures {
public static final ResourceKey<PlacedFeature> PLACED_ORE_BLACK_QUARTZ = createKey("ore_black_quartz"); public static final ResourceKey<PlacedFeature> PLACED_ORE_BLACK_QUARTZ = createKey("ore_black_quartz");
public static final ResourceKey<PlacedFeature> CANOLA_PATCH = createKey("canola_patch");
public static final ResourceKey<PlacedFeature> FLAX_PATCH = createKey("flax_patch");
public static final ResourceKey<PlacedFeature> COFFEE_PATCH = createKey("coffee_patch");
public static void bootstrap(BootstrapContext<PlacedFeature> context) { public static void bootstrap(BootstrapContext<PlacedFeature> context) {
HolderGetter<ConfiguredFeature<?, ?>> holdergetter = context.lookup(Registries.CONFIGURED_FEATURE); HolderGetter<ConfiguredFeature<?, ?>> holdergetter = context.lookup(Registries.CONFIGURED_FEATURE);
PlacementUtils.register(context, PLACED_ORE_BLACK_QUARTZ, holdergetter.getOrThrow(ActuallyConfiguredFeatures.ORE_BLACK_QUARTZ), PlacementUtils.register(context, PLACED_ORE_BLACK_QUARTZ, holdergetter.getOrThrow(ActuallyConfiguredFeatures.ORE_BLACK_QUARTZ),
commonOrePlacement(8, HeightRangePlacement.triangle(VerticalAnchor.absolute(-25), VerticalAnchor.absolute(45)))); commonOrePlacement(8, HeightRangePlacement.triangle(VerticalAnchor.absolute(-25), VerticalAnchor.absolute(45))));
PlacementUtils.register(
context,
CANOLA_PATCH,
holdergetter.getOrThrow(ActuallyConfiguredFeatures.CANOLA_PATCH),
RarityFilter.onAverageOnceEvery(8),
NoiseThresholdCountPlacement.of(-0.8, 5, 10),
InSquarePlacement.spread(),
PlacementUtils.HEIGHTMAP_WORLD_SURFACE,
BiomeFilter.biome()
);
PlacementUtils.register(
context,
FLAX_PATCH,
holdergetter.getOrThrow(ActuallyConfiguredFeatures.FLAX_PATCH),
RarityFilter.onAverageOnceEvery(8),
NoiseThresholdCountPlacement.of(-0.8, 5, 10),
InSquarePlacement.spread(),
PlacementUtils.HEIGHTMAP_WORLD_SURFACE,
BiomeFilter.biome()
);
PlacementUtils.register(
context,
COFFEE_PATCH,
holdergetter.getOrThrow(ActuallyConfiguredFeatures.COFFEE_PATCH),
RarityFilter.onAverageOnceEvery(8),
NoiseThresholdCountPlacement.of(-0.8, 5, 10),
InSquarePlacement.spread(),
PlacementUtils.HEIGHTMAP_WORLD_SURFACE,
BiomeFilter.biome()
);
} }
private static List<PlacementModifier> orePlacement(PlacementModifier modifier, PlacementModifier modifier1) { private static List<PlacementModifier> orePlacement(PlacementModifier modifier, PlacementModifier modifier1) {

View file

@ -29,12 +29,6 @@ public record BoolConfigFeatureBiomeModifier(HolderSet<Biome> biomes, HolderSet<
return true; return true;
case "generateQuartz": case "generateQuartz":
return CommonConfig.Worldgen.GENERATE_QUARTZ.get(); return CommonConfig.Worldgen.GENERATE_QUARTZ.get();
case "generateCanola":
return CommonConfig.Worldgen.GENERATE_CANOLA.get();
case "generateFlax":
return CommonConfig.Worldgen.GENERATE_FLAX.get();
case "generateCoffee":
return CommonConfig.Worldgen.GENERATE_COFFEE.get();
} }
} }

View file

@ -24,6 +24,7 @@ import net.neoforged.neoforge.capabilities.Capabilities;
import net.neoforged.neoforge.energy.IEnergyStorage; import net.neoforged.neoforge.energy.IEnergyStorage;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;

View file

@ -61,9 +61,9 @@ public class ItemCoffee extends ItemBase { //TODO: Do we want to change the satu
public ItemStack finishUsingItem(ItemStack stack, Level level, LivingEntity livingEntity) { public ItemStack finishUsingItem(ItemStack stack, Level level, LivingEntity livingEntity) {
ItemStack theStack = stack.copy(); ItemStack theStack = stack.copy();
super.finishUsingItem(stack, level, livingEntity); super.finishUsingItem(stack, level, livingEntity);
applyPotionEffectsFromStack(theStack, livingEntity); applyPotionEffectsFromStack(stack, livingEntity);
theStack.setDamageValue(theStack.getDamageValue() + 1); theStack.setDamageValue(theStack.getDamageValue() + 1);
if (theStack.getMaxDamage() - theStack.getDamageValue() <= 0) { if (theStack.getMaxDamage() - theStack.getDamageValue() < 0) {
return new ItemStack(ActuallyItems.EMPTY_CUP.get()); return new ItemStack(ActuallyItems.EMPTY_CUP.get());
} else { } else {
return theStack; return theStack;

View file

@ -13,6 +13,7 @@ package de.ellpeck.actuallyadditions.mod.items.lens;
import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor; import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor;
import de.ellpeck.actuallyadditions.api.lens.Lens; import de.ellpeck.actuallyadditions.api.lens.Lens;
import de.ellpeck.actuallyadditions.mod.crafting.ColorChangeRecipe; import de.ellpeck.actuallyadditions.mod.crafting.ColorChangeRecipe;
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.core.HolderLookup; import net.minecraft.core.HolderLookup;

View file

@ -109,32 +109,18 @@ public class MethodHandler implements IMethodHandler {
@Override @Override
public void addEffectProperties(ItemStack stack, MobEffectInstance effect, boolean addDur, boolean addAmp) { public void addEffectProperties(ItemStack stack, MobEffectInstance effect, boolean addDur, boolean addAmp) {
MobEffectInstance[] effects = this.getEffectsFromStack(stack); MobEffectInstance[] effects = this.getEffectsFromStack(stack);
boolean effectUpdated = false;
for (int i = 0; i < effects.length; i++) { for (int i = 0; i < effects.length; i++) {
if (effects[i].getEffect() == effect.getEffect()) { if (effects[i].getEffect() == effect.getEffect()) {
effects[i] = new MobEffectInstance(effects[i].getEffect(), effects[i] = new MobEffectInstance(effects[i].getEffect(), effects[i].getDuration() + (addDur
effects[i].getDuration() + (addDur ? effect.getDuration() : 0), ? effect.getDuration()
effects[i].getAmplifier() + (addAmp ? effect.getAmplifier() > 0 ? effect.getAmplifier() : 1 : 0)); : 0), effects[i].getAmplifier() + (addAmp
effectUpdated = true; ? effect.getAmplifier() > 0
break; ? effect.getAmplifier()
: 1
: 0));
} }
this.addEffectToStack(stack, effects[i]);
} }
if (!effectUpdated) {
this.addEffectToStack(stack, effect);
} else {
// Clear existing effects from the stack
this.clearEffectsFromStack(stack);
// Add updated effects to the stack
for (MobEffectInstance updatedEffect : effects) {
this.addEffectToStack(stack, updatedEffect);
}
}
}
private void clearEffectsFromStack(ItemStack stack) {
CompoundTag tag = stack.getOrDefault(DataComponents.CUSTOM_DATA, CustomData.EMPTY).copyTag();
tag.remove("Counter");
stack.set(DataComponents.CUSTOM_DATA, CustomData.of(tag));
} }
@Override @Override

View file

@ -10,9 +10,12 @@
package de.ellpeck.actuallyadditions.mod.misc.special; package de.ellpeck.actuallyadditions.mod.misc.special;
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Block;
import net.neoforged.bus.api.EventPriority; import net.neoforged.bus.api.EventPriority;
import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.neoforge.client.event.RenderPlayerEvent; import net.neoforged.neoforge.client.event.RenderPlayerEvent;

View file

@ -26,7 +26,6 @@ import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
@ -103,7 +102,7 @@ public class TileEntityBreaker extends TileEntityInventoryBase implements MenuPr
} }
private void doWork() { private void doWork() {
Direction side = WorldUtil.getDirectionByPistonRotation(getBlockState()); Direction side = WorldUtil.getDirectionByPistonRotation(this.level.getBlockState(this.worldPosition));
BlockPos breakCoords = this.worldPosition.relative(side); BlockPos breakCoords = this.worldPosition.relative(side);
BlockState stateToBreak = this.level.getBlockState(breakCoords); BlockState stateToBreak = this.level.getBlockState(breakCoords);
Block blockToBreak = stateToBreak.getBlock(); Block blockToBreak = stateToBreak.getBlock();
@ -111,7 +110,6 @@ public class TileEntityBreaker extends TileEntityInventoryBase implements MenuPr
if (!this.isPlacer && blockToBreak != Blocks.AIR && stateToBreak.getDestroySpeed(this.level, breakCoords) >= 0.0F) { if (!this.isPlacer && blockToBreak != Blocks.AIR && stateToBreak.getDestroySpeed(this.level, breakCoords) >= 0.0F) {
List<ItemStack> drops = Block.getDrops(stateToBreak, (ServerLevel) this.level, breakCoords, this.level.getBlockEntity(breakCoords)); List<ItemStack> drops = Block.getDrops(stateToBreak, (ServerLevel) this.level, breakCoords, this.level.getBlockEntity(breakCoords));
FakePlayer fake = FakePlayerFactory.getMinecraft((ServerLevel) this.level); FakePlayer fake = FakePlayerFactory.getMinecraft((ServerLevel) this.level);
fake.getInventory().items.set(fake.getInventory().selected, Items.NETHERITE_PICKAXE.getDefaultInstance());
if (stateToBreak.canHarvestBlock(this.level, breakCoords, fake)) { //TODO might double check this is right mikey if (stateToBreak.canHarvestBlock(this.level, breakCoords, fake)) { //TODO might double check this is right mikey
if (StackUtil.canAddAll(this.inv, drops, false)) { if (StackUtil.canAddAll(this.inv, drops, false)) {
this.level.destroyBlock(breakCoords, false); this.level.destroyBlock(breakCoords, false);

View file

@ -14,7 +14,6 @@ import de.ellpeck.actuallyadditions.api.ActuallyTags;
import de.ellpeck.actuallyadditions.mod.AASounds; import de.ellpeck.actuallyadditions.mod.AASounds;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.crafting.CoffeeIngredientRecipe; import de.ellpeck.actuallyadditions.mod.crafting.CoffeeIngredientRecipe;
import de.ellpeck.actuallyadditions.mod.fluids.AATank;
import de.ellpeck.actuallyadditions.mod.inventory.ContainerCoffeeMachine; import de.ellpeck.actuallyadditions.mod.inventory.ContainerCoffeeMachine;
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems; import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
import de.ellpeck.actuallyadditions.mod.items.ItemCoffee; import de.ellpeck.actuallyadditions.mod.items.ItemCoffee;
@ -42,6 +41,7 @@ import net.neoforged.neoforge.energy.IEnergyStorage;
import net.neoforged.neoforge.fluids.FluidStack; import net.neoforged.neoforge.fluids.FluidStack;
import net.neoforged.neoforge.fluids.FluidType; import net.neoforged.neoforge.fluids.FluidType;
import net.neoforged.neoforge.fluids.capability.IFluidHandler; import net.neoforged.neoforge.fluids.capability.IFluidHandler;
import net.neoforged.neoforge.fluids.capability.templates.FluidTank;
import javax.annotation.Nonnull; import javax.annotation.Nonnull;
import javax.annotation.Nullable; import javax.annotation.Nullable;
@ -59,7 +59,7 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
public final CustomEnergyStorage storage = new CustomEnergyStorage(300000, 250, 0); public final CustomEnergyStorage storage = new CustomEnergyStorage(300000, 250, 0);
public final AATank tank = new AATank(4 * FluidType.BUCKET_VOLUME) { public final FluidTank tank = new FluidTank(4 * FluidType.BUCKET_VOLUME) {
@Nonnull @Nonnull
@Override @Override
public FluidStack drain(int maxDrain, FluidAction action) { public FluidStack drain(int maxDrain, FluidAction action) {
@ -206,7 +206,7 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
this.inv.setStackInSlot(SLOT_OUTPUT, output.copy()); this.inv.setStackInSlot(SLOT_OUTPUT, output.copy());
this.inv.getStackInSlot(SLOT_INPUT).shrink(1); this.inv.getStackInSlot(SLOT_INPUT).shrink(1);
this.coffeeCacheAmount -= CACHE_USE; this.coffeeCacheAmount -= CACHE_USE;
this.tank.drainInternal(WATER_USE, IFluidHandler.FluidAction.EXECUTE); this.tank.drain(WATER_USE, IFluidHandler.FluidAction.EXECUTE);
} }
} }
} else { } else {

View file

@ -12,6 +12,7 @@ package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.api.misc.IDisplayStandItem; import de.ellpeck.actuallyadditions.api.misc.IDisplayStandItem;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;
import net.minecraft.core.HolderLookup; import net.minecraft.core.HolderLookup;

View file

@ -13,6 +13,7 @@ package de.ellpeck.actuallyadditions.mod.tile;
import de.ellpeck.actuallyadditions.api.laser.Network; import de.ellpeck.actuallyadditions.api.laser.Network;
import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks; import de.ellpeck.actuallyadditions.mod.blocks.ActuallyBlocks;
import de.ellpeck.actuallyadditions.mod.network.packet.SpawnLaserParticlePacket; import de.ellpeck.actuallyadditions.mod.network.packet.SpawnLaserParticlePacket;
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import de.ellpeck.actuallyadditions.mod.util.WorldUtil;
import de.ellpeck.actuallyadditions.mod.util.compat.SlotlessableItemHandlerWrapper; import de.ellpeck.actuallyadditions.mod.util.compat.SlotlessableItemHandlerWrapper;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;

View file

@ -16,6 +16,7 @@ import de.ellpeck.actuallyadditions.api.laser.LaserType;
import de.ellpeck.actuallyadditions.api.laser.Network; import de.ellpeck.actuallyadditions.api.laser.Network;
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems; import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
import de.ellpeck.actuallyadditions.mod.misc.apiimpl.ConnectionPair; import de.ellpeck.actuallyadditions.mod.misc.apiimpl.ConnectionPair;
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import io.netty.util.internal.ConcurrentSet; import io.netty.util.internal.ConcurrentSet;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction; import net.minecraft.core.Direction;

View file

@ -95,7 +95,7 @@ public class TileEntityLongRangeBreaker extends TileEntityInventoryBase implemen
private void doWork() { private void doWork() {
if (this.storage.getEnergyStored() >= ENERGY_USE * RANGE) { if (this.storage.getEnergyStored() >= ENERGY_USE * RANGE) {
BlockState state = getBlockState(); BlockState state = this.level.getBlockState(this.worldPosition);
Direction sideToManipulate = WorldUtil.getDirectionByPistonRotation(state); Direction sideToManipulate = WorldUtil.getDirectionByPistonRotation(state);
for (int i = 0; i < RANGE; i++) { for (int i = 0; i < RANGE; i++) {

View file

@ -30,7 +30,6 @@ import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.entity.player.Player; import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.Level; import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
@ -139,13 +138,13 @@ public class TileEntityVerticalDigger extends TileEntityInventoryBase implements
: 1); : 1);
if (this.storage.getEnergyStored() >= actualUse) { if (this.storage.getEnergyStored() >= actualUse) {
BlockPos pos = new BlockPos(this.worldPosition.getX() + this.checkX, this.checkY, this.worldPosition.getZ() + this.checkZ); BlockPos pos = new BlockPos(this.worldPosition.getX() + this.checkX, this.checkY, this.worldPosition.getZ() + this.checkZ);
ItemStack fakePickaxe = Items.NETHERITE_PICKAXE.getDefaultInstance();
BlockState state = this.level.getBlockState(pos); BlockState state = this.level.getBlockState(pos);
Block block = state.getBlock(); Block block = state.getBlock();
ItemStack stack = block.getCloneItemStack(state, new BlockHitResult(new Vec3(0, 0, 0), Direction.DOWN, pos, false), this.level, pos, FakePlayerFactory.getMinecraft((ServerLevel) this.level)); ItemStack stack = block.getCloneItemStack(state, new BlockHitResult(new Vec3(0, 0, 0), Direction.DOWN, pos, false), this.level, pos, FakePlayerFactory.getMinecraft((ServerLevel) this.level));
if (!state.isAir()) { if (!state.isAir()) {
if (fakePickaxe.isCorrectToolForDrops(state) && state.getDestroySpeed(this.level, pos) >= 0F && this.isMinable(state, stack)) { //block.getHarvestLevel(state) <= DrillItem.HARVEST_LEVEL
if (stack.isCorrectToolForDrops(state) && state.getDestroySpeed(this.level, pos) >= 0F && this.isMinable(state, stack)) {
List<ItemStack> drops = Block.getDrops(state, (ServerLevel) this.level, pos, this.level.getBlockEntity(pos)); List<ItemStack> drops = Block.getDrops(state, (ServerLevel) this.level, pos, this.level.getBlockEntity(pos));
float chance = WorldUtil.fireFakeHarvestEventsForDropChance(this, drops, this.level, pos); float chance = WorldUtil.fireFakeHarvestEventsForDropChance(this, drops, this.level, pos);

View file

@ -17,6 +17,7 @@ import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
import de.ellpeck.actuallyadditions.mod.items.ItemSolidifiedExperience; import de.ellpeck.actuallyadditions.mod.items.ItemSolidifiedExperience;
import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor; import de.ellpeck.actuallyadditions.mod.network.gui.IButtonReactor;
import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor; import de.ellpeck.actuallyadditions.mod.util.ItemStackHandlerAA.IAcceptor;
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.core.HolderLookup; import net.minecraft.core.HolderLookup;
import net.minecraft.nbt.CompoundTag; import net.minecraft.nbt.CompoundTag;

View file

@ -1,14 +1,3 @@
# 1.3.6+mc1.21.1
* Add the ability to open the Crafting Table On A Stick while inside a Curios slot
* Add missing XP Solidifier recipe
* Fixed All In One tool not having attributes
* Fix Engineer's House not generating
* Add worldgen of Canola, Flax and Coffee patches (With a config option to disable)
* Fix Breaker and Vertical Digger being unable to break blocks tougher than dirt
* Fix Coffee Machine not consuming water
* Fix Coffee not applying effects
* Fix Coffee not transforming into Empty Cup when consumed entirely
# 1.3.5+mc1.21.1 # 1.3.5+mc1.21.1
* Overhaul networking, should fix a lot of issues with crashes on servers * Overhaul networking, should fix a lot of issues with crashes on servers
* Add storage block tags for the crystals * Add storage block tags for the crystals