Skip to content

Commit

Permalink
Merge branch 'version/main' of https://github.com/ldtteam/minecolonies
Browse files Browse the repository at this point in the history
…into version/main
  • Loading branch information
Raycoms committed Nov 25, 2024
2 parents 14b0518 + 438e653 commit 8094c37
Show file tree
Hide file tree
Showing 27 changed files with 443 additions and 355 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ mappingsVersion=1.20.1

dataGeneratorsVersion=1.19.3-0.1.54-ALPHA
blockUI_version=1.20.1-1.0.139-BETA
structurize_version=1.20.1-1.0.740-BETA
structurize_version=1.20.1-1.0.759-snapshot
domumOrnamentumVersion=1.20.1-1.0.184-BETA
multiPistonVersion=1.20-1.2.30-ALPHA

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
{
"values": [
{
"id": "waystones:waystone",
"required": false
},
{
"id": "waystones:sandy_waystone",
"required": false
},
{
"id": "waystones:mossy_waystone",
"id": "#waystones:waystones",
"required": false
}
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"values": [
"#minecraft:logs",
"#minecolonies:mangrove_tree",
"minecraft:mushroom_stem"
"minecraft:mushroom_stem",
{
"id": "#productivebees:nests/wood_nests",
"required": false
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ public class ServerConfiguration extends AbstractConfiguration
* ------------------- ######## Claim settings ######## ------------------- *
* --------------------------------------------------------------------------- */

public final ForgeConfigSpec.IntValue maxColonySize;
public final ForgeConfigSpec.IntValue minColonyDistance;
public final ForgeConfigSpec.IntValue initialColonySize;
public final ForgeConfigSpec.IntValue maxDistanceFromWorldSpawn;
public final ForgeConfigSpec.IntValue minDistanceFromWorldSpawn;
public final ForgeConfigSpec.IntValue maxColonySize;
public final ForgeConfigSpec.IntValue minColonyDistance;
public final ForgeConfigSpec.IntValue initialColonySize;
public final ForgeConfigSpec.IntValue maxDistanceFromWorldSpawn;
public final ForgeConfigSpec.IntValue minDistanceFromWorldSpawn;

/* ------------------------------------------------------------------------- *
* ------------------- ######## Combat Settings ######## ------------------- *
Expand Down Expand Up @@ -96,7 +96,6 @@ public class ServerConfiguration extends AbstractConfiguration
* ------------------- ######## Compatibility Settings ######## ------------------- *
* -------------------------------------------------------------------------------- */

public final ForgeConfigSpec.ConfigValue<List<? extends String>> configListStudyItems;
public final ForgeConfigSpec.ConfigValue<List<? extends String>> configListRecruitmentItems;
public final ForgeConfigSpec.ConfigValue<List<? extends String>> diseases;
public final ForgeConfigSpec.BooleanValue auditCraftingTags;
Expand All @@ -117,7 +116,6 @@ public class ServerConfiguration extends AbstractConfiguration

public final ForgeConfigSpec.BooleanValue creativeResolve;


/**
* Builds server configuration.
*
Expand Down Expand Up @@ -193,11 +191,6 @@ protected ServerConfiguration(final ForgeConfigSpec.Builder builder)

swapToCategory(builder, "compatibility");

configListStudyItems = defineList(builder, "configliststudyitems",
Arrays.asList
("minecraft:paper;400;100", "minecraft:book;600;10"),
s -> s instanceof String);

configListRecruitmentItems = defineList(builder, "configlistrecruitmentitems",
Arrays.asList
("minecraft:hay_block;3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import com.minecolonies.api.util.OptionalPredicate;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.inventory.CraftingContainer;
Expand Down Expand Up @@ -93,7 +93,7 @@ public static IGenericRecipe of(@Nullable final IToken<?> recipeToken)
private final Block intermediate;
private final ResourceLocation lootTable;
private final EquipmentTypeEntry requiredTool;
private final LivingEntity requiredEntity;
private final EntityType<?> requiredEntity;
private final List<Component> restrictions;
private final int levelSort;

Expand Down Expand Up @@ -129,7 +129,7 @@ public GenericRecipe(@Nullable final ResourceLocation id,
final int gridSize, @NotNull final Block intermediate,
@Nullable final ResourceLocation lootTable,
@NotNull final EquipmentTypeEntry requiredTool,
@Nullable final LivingEntity requiredEntity,
@Nullable final EntityType<?> requiredEntity,
@NotNull final List<Component> restrictions,
final int levelSort)
{
Expand Down Expand Up @@ -246,8 +246,9 @@ public EquipmentTypeEntry getRequiredTool()
return this.requiredTool;
}

@Nullable
@Override
public @Nullable LivingEntity getRequiredEntity()
public EntityType<?> getRequiredEntity()
{
return this.requiredEntity;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.minecolonies.api.util.OptionalPredicate;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Block;
import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -134,7 +134,7 @@ public interface IGenericRecipe
* @return The required creature.
*/
@Nullable
LivingEntity getRequiredEntity();
EntityType<?> getRequiredEntity();

/**
* Gets some human-readable restrictions on when this recipe is valid.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,21 @@ public enum AIWorkerState implements IAIState
/**
* Harvest the netherwart.
*/
HARVEST_NETHERWART(true);
HARVEST_NETHERWART(true),

/*
###Concrete mixers###
*/

/**
* Continues placing blocks until can't place anymore.
*/
CONCRETE_MIXER_PLACING(true),

/**
* Harvest all blocks placed in the water.
*/
CONCRETE_MIXER_HARVESTING(true);

/**
* Is it okay to eat.
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion src/main/java/com/minecolonies/api/items/ModTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.minecolonies.api.util.constant.TagConstants;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.BiomeTags;
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.ItemTags;
import net.minecraft.tags.TagKey;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public List<IGenericRecipe> getRecipesForDisplayPurposesOnly(@NotNull final Anim
Blocks.AIR,
animal.getLootTable(),
ModEquipmentTypes.axe.get(),
animal,
animal.getType(),
Collections.emptyList(),
0));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,12 +265,12 @@ public List<IGenericRecipe> getRecipesForDisplayPurposesOnly(@NotNull Animal ani

recipes.add(new GenericRecipe(null, new ItemStack(Items.HONEYCOMB),
Collections.emptyList(), Collections.emptyList(), Collections.emptyList(),
0, Blocks.AIR, null, ModEquipmentTypes.shears.get(), animal, Collections.emptyList(), 0));
0, Blocks.AIR, null, ModEquipmentTypes.shears.get(), animal.getType(), Collections.emptyList(), 0));

recipes.add(new GenericRecipe(null, new ItemStack(Items.HONEY_BOTTLE),
Collections.emptyList(), Collections.emptyList(),
Collections.singletonList(Collections.singletonList(new ItemStack(Items.GLASS_BOTTLE))),
0, Blocks.AIR, null, ModEquipmentTypes.none.get(), animal, Collections.emptyList(), 0));
0, Blocks.AIR, null, ModEquipmentTypes.none.get(), animal.getType(), Collections.emptyList(), 0));

return recipes;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public List<IGenericRecipe> getRecipesForDisplayPurposesOnly(@NotNull Animal ani
final List<IGenericRecipe> recipes = new ArrayList<>(super.getRecipesForDisplayPurposesOnly(animal));

recipes.add(new GenericRecipe(null, new ItemStack(Items.EGG), Collections.emptyList(), Collections.emptyList(),
Collections.emptyList(), 0, Blocks.AIR, null, ModEquipmentTypes.none.get(), animal, Collections.emptyList(), 0));
Collections.emptyList(), 0, Blocks.AIR, null, ModEquipmentTypes.none.get(), animal.getType(), Collections.emptyList(), 0));

return recipes;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import com.minecolonies.api.colony.IColony;
import com.minecolonies.api.colony.jobs.registry.JobEntry;
import com.minecolonies.api.colony.requestsystem.token.IToken;
import com.minecolonies.api.items.ModTags;
import com.minecolonies.api.equipment.ModEquipmentTypes;
import com.minecolonies.api.util.ItemStackUtils;
import com.minecolonies.core.colony.buildings.AbstractBuilding;
Expand Down Expand Up @@ -51,11 +50,6 @@ public class BuildingConcreteMixer extends AbstractBuilding
*/
private final Map<Integer, List<BlockPos>> waterPos = new HashMap<>();

/**
* The minimum found water level
*/
private int minWaterLevel = WATER_DEPTH_SUPPORT;

/**
* Instantiates a new concrete mason building.
*
Expand All @@ -81,7 +75,6 @@ public void registerBlockPosition(@NotNull final BlockState blockState, @NotNull
fluidPos.add(pos);
}
waterPos.put(blockState.getFluidState().getAmount(), fluidPos);
minWaterLevel = Math.min(minWaterLevel, blockState.getFluidState().getAmount());
}
}

Expand Down Expand Up @@ -123,7 +116,6 @@ public void deserializeNBT(final CompoundTag compound)
{
final CompoundTag waterCompound = waterMapList.getCompound(i);
final int level = waterCompound.getInt(TAG_LEVEL);
minWaterLevel = Math.min(minWaterLevel, level);

final ListTag waterTagList = waterCompound.getList(TAG_WATER, Tag.TAG_COMPOUND);
final List<BlockPos> water = new ArrayList<>();
Expand Down Expand Up @@ -154,6 +146,21 @@ public int getMaxBuildingLevel()
return CONST_DEFAULT_MAX_BUILDING_LEVEL;
}

/**
* Get the max amount of concrete placed at once.
*
* @return the number of concrete.
*/
public int getMaxConcretePlaced()
{
int size = 0;
for (List<BlockPos> positions : waterPos.values())
{
size += positions.size();
}
return size;
}

/**
* Check if there are open positions to mine.
*
Expand All @@ -162,17 +169,18 @@ public int getMaxBuildingLevel()
@Nullable
public BlockPos getBlockToMine()
{
for (int i = 1; i <= minWaterLevel; i++)
for (int i = 1; i <= WATER_DEPTH_SUPPORT; i++)
{
for (final BlockPos pos : waterPos.getOrDefault(i, Collections.emptyList()))
{
if (colony.getWorld().getBlockState(pos).is(ModTags.concreteBlocks))
final BlockState state = colony.getWorld().getBlockState(pos);
if (!state.isAir() && !state.is(Blocks.WATER))
{
return pos;
}
}
}

return null;
}

Expand All @@ -184,18 +192,18 @@ public BlockPos getBlockToMine()
@Nullable
public BlockPos getBlockToPlace()
{
for (int i = 1; i <= minWaterLevel; i++)
for (int i = 1; i <= WATER_DEPTH_SUPPORT; i++)
{
for (final BlockPos pos : waterPos.getOrDefault(i, Collections.emptyList()))
{
final BlockState state = colony.getWorld().getBlockState(pos);
if (!state.getFluidState().isEmpty() && state.getBlock() == Blocks.WATER)
if (state.is(Blocks.WATER))
{
return pos;
}
}
}

return null;
}

Expand All @@ -210,7 +218,7 @@ public int outputBlockCountInWorld(final ItemStack primaryOutput)
int count = 0;
if (primaryOutput.getItem() instanceof BlockItem)
{
for (int i = 1; i <= minWaterLevel; i++)
for (int i = 1; i <= WATER_DEPTH_SUPPORT; i++)
{
for (final BlockPos pos : waterPos.getOrDefault(i, Collections.emptyList()))
{
Expand Down
Loading

0 comments on commit 8094c37

Please sign in to comment.