-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP. Rewrote buildings system to rely on block entities. Each buildin…
…g has one hidden block entity representing it. This will make the whole building system more reliable. Still fixes required to be done.
- Loading branch information
Showing
33 changed files
with
291 additions
and
674 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 15 additions & 9 deletions
24
...intan/mods/minefortress/core/interfaces/blueprints/buildings/IServerBuildingsManager.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,34 @@ | ||
package net.remmintan.mods.minefortress.core.interfaces.blueprints.buildings; | ||
|
||
import net.minecraft.block.BlockState; | ||
import net.minecraft.entity.mob.HostileEntity; | ||
import net.minecraft.server.network.ServerPlayerEntity; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.remmintan.mods.minefortress.core.dtos.buildings.BlueprintMetadata; | ||
import net.remmintan.mods.minefortress.core.interfaces.blueprints.ProfessionType; | ||
import net.remmintan.mods.minefortress.core.interfaces.buildings.IFortressBuilding; | ||
import net.remmintan.mods.minefortress.core.interfaces.server.IServerManager; | ||
import net.remmintan.mods.minefortress.core.interfaces.server.ITickableManager; | ||
import net.remmintan.mods.minefortress.core.interfaces.server.IWritableManager; | ||
|
||
import java.util.Map; | ||
import java.util.Optional; | ||
import java.util.UUID; | ||
|
||
public interface IServerBuildingsManager extends IServerManager { | ||
public interface IServerBuildingsManager extends IServerManager, IWritableManager, ITickableManager { | ||
void addBuilding(BlueprintMetadata metadata, BlockPos start, BlockPos end, Map<BlockPos, BlockState> mergedBlockData); | ||
|
||
void destroyBuilding(BlockPos pos); | ||
|
||
Optional<IFortressBuilding> getBuilding(BlockPos pos); | ||
|
||
long getTotalBedsCount(); | ||
void destroyBuilding(UUID id); | ||
void doRepairConfirmation(UUID id, ServerPlayerEntity player); | ||
Optional<IFortressBuilding> findNearest(BlockPos pos); | ||
|
||
void doRepairConfirmation(BlockPos pos, ServerPlayerEntity player); | ||
Optional<IFortressBuilding> findNearest(BlockPos pos); | ||
Optional<IFortressBuilding> findNearest(BlockPos pos, ProfessionType requirement); | ||
void addBuilding(IFortressBuilding building); | ||
|
||
Optional<HostileEntity> getRandomBuildingAttacker(); | ||
Optional<BlockPos> getFreeBed(); | ||
boolean isPartOfAnyBuilding(BlockPos pos); | ||
|
||
boolean hasRequiredBuilding(ProfessionType type, int level, int minCount); | ||
Optional<IFortressBuilding> getBuildingById(UUID id); | ||
|
||
} |
35 changes: 0 additions & 35 deletions
35
...ava/net/remmintan/mods/minefortress/core/interfaces/buildings/IEssentialBuildingInfo.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
...mmintan/mods/minefortress/core/interfaces/entities/player/FortressServerPlayerEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.