Skip to content

Commit

Permalink
Removed the concept of border and influence flags from the game entir…
Browse files Browse the repository at this point in the history
…ely. The whole concept was confusing and made gameplay less dynamic and straightforward.
  • Loading branch information
remmintan committed Nov 22, 2024
1 parent aaf3d50 commit 7321c05
Show file tree
Hide file tree
Showing 52 changed files with 30 additions and 1,556 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ void sync(
FortressGamemode gamemode,
boolean connectedToTheServer,
int maxColonistsCount,
int reservedColonistCount,
boolean borderEnabled
int reservedColonistCount
);

void tick(IHoveredBlockProvider fortressClient);
Expand Down Expand Up @@ -79,8 +78,6 @@ void sync(

List<BuildingHealthRenderInfo> getBuildingHealths();

boolean isBorderEnabled();

void openRepairBuildingScreen(UUID buildingId, Map<BlockPos, BlockState> blocksToRepair);

IClientResourceManager getResourceManager();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import net.remmintan.mods.minefortress.core.interfaces.blueprints.IClientBlueprintManager;
import net.remmintan.mods.minefortress.core.interfaces.combat.IClientPawnsSelectionManager;
import net.remmintan.mods.minefortress.core.interfaces.combat.ITargetedSelectionManager;
import net.remmintan.mods.minefortress.core.interfaces.infuence.IClientInfluenceManager;
import net.remmintan.mods.minefortress.core.interfaces.selections.ISelectionManager;
import net.remmintan.mods.minefortress.core.interfaces.tasks.IAreasClientManager;

Expand All @@ -12,7 +11,6 @@ public interface IClientManagersProvider {
IAreasClientManager get_AreasClientManager();
IClientBlueprintManager get_BlueprintManager();
IClientFortressManager get_ClientFortressManager();
IClientInfluenceManager get_InfluenceManager();
IClientPawnsSelectionManager get_PawnsSelectionManager();
default ISelectedColonistProvider getSelectedColonistProvider() {
final var pawnsSelectionManager = get_PawnsSelectionManager();
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@ public interface IFortressModServerManager {
IServerManagersProvider getManagersProvider(UUID id);
IServerFortressManager getFortressManager(ServerPlayerEntity player);
IServerFortressManager getFortressManager(UUID id);
boolean isBorderEnabled();
void save();
void load();

void load(boolean border);
void tick(PlayerManager manager);
Optional<IServerManagersProvider> findReachableFortress(BlockPos pos, double reachRange);
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
import java.util.UUID;

public interface IServerFortressManager {
void setBorderVisibilityState(boolean borderEnabled);
void scheduleSync();

void syncOnJoin(boolean borderEnabled);
void syncOnJoin();
IPawnNameGenerator getNameGenerator();
void replaceColonistWithTypedPawn(LivingEntity colonist, String warriorId, EntityType<? extends LivingEntity> entityType);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import net.remmintan.mods.minefortress.core.interfaces.automation.server.IServerAutomationAreaManager;
import net.remmintan.mods.minefortress.core.interfaces.blueprints.buildings.IServerBuildingsManager;
import net.remmintan.mods.minefortress.core.interfaces.combat.IServerFightManager;
import net.remmintan.mods.minefortress.core.interfaces.infuence.IServerInfluenceManager;
import net.remmintan.mods.minefortress.core.interfaces.professions.IServerProfessionsManager;
import net.remmintan.mods.minefortress.core.interfaces.resources.IServerResourceManager;
import net.remmintan.mods.minefortress.core.interfaces.tasks.IServerTaskManager;
Expand All @@ -19,9 +18,6 @@ public interface IServerManagersProvider {
default IServerAutomationAreaManager getAutomationAreaManager() {
return getManager(IServerAutomationAreaManager.class);
}
default IServerInfluenceManager getInfluenceManager() {
return getManager(IServerInfluenceManager.class);
}
default IServerProfessionsManager getProfessionsManager() {
return getManager(IServerProfessionsManager.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import net.remmintan.mods.minefortress.core.interfaces.blueprints.*;
import net.remmintan.mods.minefortress.core.interfaces.client.IClientManagersProvider;
import org.jetbrains.annotations.Nullable;
import org.minefortress.utils.ModUtils;

import java.util.Map;
import java.util.Optional;
Expand Down Expand Up @@ -54,10 +53,6 @@ private void checkNotEnoughResources() {
}
}

protected boolean isEnoughResources() {
return enoughResources;
}

private void checkCantBuild() {
if(!enoughResources) {
cantBuild = true;
Expand All @@ -72,22 +67,19 @@ private void checkCantBuild() {
.collect(Collectors.toSet());
final int floorLevel = getSelectedStructure().getFloorLevel();

final var fortressBorder = ModUtils.getInfluenceManager().getFortressBorder();

final boolean blueprintPartInTheSurface = blueprintDataPositions.stream()
.filter(blockPos -> blockPos.getY() >= floorLevel)
.map(pos -> pos.add(structureBuildPos.down(floorLevel)))
.anyMatch(pos -> !BuildingHelper.canPlaceBlock(client.world, pos) ||
fortressBorder.map(border -> !border.contains(pos)).orElse(false));
.anyMatch(pos -> !BuildingHelper.canPlaceBlock(client.world, pos));

final boolean blueprintPartInTheAir = blueprintDataPositions.stream()
.filter(blockPos -> {
final int y = blockPos.getY();
return y<=floorLevel;
})
.map(pos -> pos.add(structureBuildPos.down(floorLevel)))
.anyMatch(pos -> BuildingHelper.canPlaceBlock(client.world, pos.down()) ||
fortressBorder.map(border -> !border.contains(pos)).orElse(false));
.anyMatch(pos -> BuildingHelper.canPlaceBlock(client.world, pos.down()));

cantBuild = blueprintPartInTheSurface || blueprintPartInTheAir;
}
Expand Down
27 changes: 0 additions & 27 deletions src/main/java/org/minefortress/commands/BorderToggleCommand.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ public class CommandsManager {
private static final List<MineFortressCommand> commands = Arrays.asList(
new DebugItemsCommand(),
new DebugPawnsCommand(),
new BorderToggleCommand(),
new SpawnPawnsCommand(),
new WarriorsCommand()
);
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/org/minefortress/entity/WarriorPawn.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@
import net.minecraft.world.LocalDifficulty;
import net.minecraft.world.ServerWorldAccess;
import net.minecraft.world.World;
import net.remmintan.mods.minefortress.core.interfaces.entities.pawns.IProfessional;
import net.remmintan.mods.minefortress.core.interfaces.entities.pawns.IWarrior;
import org.jetbrains.annotations.Nullable;
import org.minefortress.entity.ai.goal.EatGoal;
import org.minefortress.entity.ai.goal.SelectTargetToAttackGoal;
import org.minefortress.entity.ai.goal.warrior.CapturePositionGoal;
import org.minefortress.entity.ai.goal.warrior.FollowLivingEntityGoal;
import org.minefortress.entity.ai.goal.warrior.MeleeAttackGoal;
import org.minefortress.entity.ai.goal.warrior.MoveToBlockGoal;
import net.remmintan.mods.minefortress.core.interfaces.entities.pawns.IProfessional;
import net.remmintan.mods.minefortress.core.interfaces.entities.pawns.IWarrior;
import org.minefortress.professions.ServerProfessionManager;

public final class WarriorPawn extends TargetedPawn implements IProfessional, IWarrior {
Expand Down Expand Up @@ -55,7 +54,6 @@ protected void initGoals() {
this.goalSelector.add(2, new MoveToBlockGoal(this));
this.goalSelector.add(2, new FollowLivingEntityGoal(this));
this.goalSelector.add(3, new EatGoal(this));
this.goalSelector.add(3, new CapturePositionGoal(this));
this.goalSelector.add(9, new LookAtEntityGoal(this, LivingEntity.class, 4f));
this.goalSelector.add(10, new LookAroundGoal(this));

Expand Down

This file was deleted.

Loading

0 comments on commit 7321c05

Please sign in to comment.