Commit graph

1167 commits

Author SHA1 Message Date
SenseiKiwi
fb1713ae0e Improvements to TileEntityRift
Made some improvements to TileEntityRift. The main reason for these
changes was to remove the field nearestRift - we should not hold on to
references to links. Now we simply track the location of the nearest
rift. I also confirmed that closeRift() and updateNearestRift() must be
allowed to run on both the client and the server. If the client doesn't
run those functions, then adjacent rifts don't connect as expected and
the rift removal animation doesn't work.
2014-07-12 03:36:56 -04:00
StevenRS11
eff7abcbbc Merge pull request #173 from SenseiKiwi/master
Fixed Slow Rift Regeneration and Various Improvements
2014-07-11 15:12:08 -05:00
SenseiKiwi
2c7435585d Minor Changes
Removed a pointless check in yCoordHelper and corrected some comments in
RiftRegenerator. It turns out that ChunkProviderServer.chunkExists()
returns whether a chunk is loaded, not whether it has already been
created.
2014-07-11 15:44:01 -04:00
StevenRS11
349f162a7c Merge pull request #170 from SenseiKiwi/master
Fixed Pick Block Results
2014-07-11 10:38:21 -05:00
SenseiKiwi
107aa4b7f2 Cleaned up Transdimensional Trapdoor Code
Removed unnecessary code for the Transdimensional Trapdoor. Most of it
was code dedicated to updating TileEntityTransTrapdoor.hasRift. That
flag was never used for anything.
2014-07-11 04:33:19 -04:00
SenseiKiwi
1bf1f4f78c Improved Regeneration Code
1. Added code so that Transdimensional Trapdoors detect that they have
been broken and schedule rift regeneration at their location. This had
previously been neglected. Trapdoors deserve a little more attention.
2. Tweaked the breakBlock() code for BlockRift and BaseDimDoor so that
rift regeneration is only scheduled if the underlying block was removed.
We don't want that to happen if the only change was for metadata.
2014-07-11 04:10:12 -04:00
SenseiKiwi
29c8a09218 Improved Door Code
1. Removed code from BaseDimDoor that was already implemented almost
identically in BlockDoor. Clarified some uses of setBlock() by changing
them to setBlockToAir() instead.
2. Removed TileEntityDimDoor.invalidate() and moved the regeneration
scheduling code to BaseDimDoor.breakBlock(). I would prefer to move away
from overriding the invalidate() method. This also simplifies the code
since we don't need to perform some of the checks we had in
breakBlock().
2014-07-11 03:44:26 -04:00
SenseiKiwi
71e7fdaafc Implemented Regeneration for BlockRift
1. Made it so that rifts regenerate when rift blocks are replaced by
other blocks.
2. Changed the rift regeneration scheduling functions to streamline
their use in other classes. Common code that was needed to validate
links before calling those functions has been moved into them so that
the checks are always performed internally.
2014-07-11 03:26:40 -04:00
SenseiKiwi
1f59dc17d9 Implemented Scheduled Rift Regeneration
1. Implemented scheduled rift regeneration in RiftRegenerator. The
previous randomized selection algorithm has been removed completely. All
regeneration is scheduled now. We perform numerous checks to make sure
that regenerating a rift is safe.
2. Removed FastRiftRegenerator as RiftRegenerator performs roughly the
same task but with more flexibility. Updated TileEntityDimDoor to use
RiftRegenerator instead for creating rifts when doors are broken.
3. Modified EventHookContainer to receive the chunk loaded event. We
iterate over the list of links in a loaded chunk and schedule them for
regeneration.
4. Reorganized the code in BlockRift. Divided the list of immune blocks
into two lists - one for DD blocks and one for regular MC blocks.
RiftRegenerator has to be able to distinguish between the two types.
5. Factored out some duplicate code from ItemRiftSignature and
ItemStabilizedRiftSignature. Most of the block immunity checks were used
to check if it would be safe to spawn a rift when using one of those
items. BlockRift.tryPlacingRift() covers all that logic in a single
function and makes the item code a little simpler.
2014-07-11 01:21:43 -04:00
SenseiKiwi
79bd5102ba Minor Changes
Minor changes to DimLink to simplify DimLink.getDestinationOrientation()
and to clarify the output of DimLink.toString() when no destination is
available.
2014-07-10 18:29:48 -04:00
SenseiKiwi
b197237dfd Minor Change
Rewrote the NewDimData.deleteLink() version that would accept x, y, and
z as parameters. There was some redundant code for getting the
parameters from a Point4D instance just to create another one to find
the target link. Now we pass the source point in directly.
2014-07-10 18:25:41 -04:00
SenseiKiwi
85ff28298e Implemented Chunk-Links Mapping
Implemented support for tracking the list of links in each chunk in a
dimension. This will be used for scheduling rift regeneration when
chunks load.
2014-07-10 18:21:10 -04:00
SenseiKiwi
782c6d5e50 Minor Changes to NewDimData
Made some minor changes to NewDimData. Fixed some comments for the rift
search functions that incorrectly indicated the search would not detect
rifts adjacent to the center of the search range. That behavior changed
some time ago. Also added an unused field called "chunkMapping" for
associating chunks with lists of links. It'll be used for implementing
queuing of rift regeneration when chunks load.
2014-07-10 17:13:10 -04:00
SenseiKiwi
c00c65eeee Reorganized Tick Receivers
1. Reorganized our code to initialize tick receivers each time the
server starts rather than once when the mod is initialized. This is
needed because reusing a single instance of each class across different
single-player sessions could cause scheduled events for one world to
leak into another world. This approach ensures that we discard all
pending events.
2. Separated the implementation of Limbo decay from a tick receiver that
periodically triggers fast decay. All of the decay code has been kept in
LimboDecay, while the ticking is handled by LimboDecayScheduler. This
change separates some functionality that should be independent, but
also, it's needed so that BlockLimbo can have access to LimboDecay's
methods without holding on to a tick receiver instance.
3. Minor change: renamed ChunkLoaderHelper.loadChunkForcedWorlds() to
loadForcedChunkWorlds().
2014-07-10 15:11:44 -04:00
SenseiKiwi
c22479c0e8 Tick Handler Changes
1. Renamed CommonTickHandler to ServerTickHandler. Given that it only
handles server ticks, this seems like a reasonable name. Also changed
its profiler label to the new name.
2. Deleted ClientTickHandler and removed any references to it in
mod_pocketDim. It was never used for anything.
2014-07-10 08:28:42 -04:00
SenseiKiwi
8da0339c78 Improved DDTeleporter
Made various changes to clarify code in DDTeleporter. For instance, we
had a whole switch block that was used to give the same outcome on every
case except the default. I rewrote the code there to remove the block.
Also changed DDTeleporter.checkDestination() since it was redoing the
destination orientation checks unnecessarily, changing the entity's yaw
when it shouldn't have side effects, and some other little things.
2014-07-09 23:44:49 -04:00
SenseiKiwi
83998969f6 Fixed Version in mod_pocketDim
Forgot to change the placeholder in mod_pocketDim
2014-07-09 15:14:56 -04:00
SenseiKiwi
c4abae8fdd Fixed build.gradle (again)
Made some more changes to build.gradle in the hopes that the version
information will automatically update in mod_pocketDim.java. It has only
worked on mcmod.info in previous attempts.
2014-07-09 15:11:16 -04:00
SenseiKiwi
1106319f8c Fixed build.gradle
Fixed a mistake in specifying the path for mod_pocketDim.java.
2014-07-09 04:15:37 -04:00
SenseiKiwi
2904ec146d Implemented Automatic Versioning in Build Script
1. Changed build.gradle so that it edits the version numbers in
mod_pocketDim.java and mcmod.info.
2. Changed mod_pocketDim to use a placeholder for its version number and
fixed an annotation that was wrong. It would cause our mod_pocketDim
instance to not initialize properly. I removed what seemed to be
workarounds that were hiding the problem.
3. Fixed space in TileEntityDimDoor.invalidate() and corrected a
non-static access to a static field in mod_pocketDim.
4. Changed mcmod.info so that it users placeholders for the mod version
and MC version values.
2014-07-09 04:01:37 -04:00
SenseiKiwi
7d840ff895 Fixed Pick Block Results
We previously returned the Vanilla counterparts to our doors as the
items to be used by the pick block button - used in Creative mode for
replicating nearby blocks. This was incorrect because we would want to
return the actual door item needed to place the particular door in
question.

More importantly, this might solve our issues with WAILA reporting the
wrong information when players look at our doors. I read the code for
the most recent version of WAILA and it uses various functions to choose
how to identify a block. The result of Block.idPicked() is probably used
as the main source for the identities of our blocks.
2014-07-06 04:31:42 -04:00
SenseiKiwi
52bae00dc6 Minor Change
Minor change to remove a warning
2014-07-06 04:01:07 -04:00
SenseiKiwi
dc55359aaf Minor Changes
Made various minor changes to eliminate warnings or to improve clarity.
2014-07-07 03:56:47 -04:00
SenseiKiwi
58d5f6dd14 Minor Changes
Minor annotation changes to remove some warnings... and keep up my
GitHub spree.
2014-07-07 01:59:26 -04:00
StevenRS11
b40141f99d Merge pull request #169 from SenseiKiwi/master
Reviewed and Rewrote Commands
2014-07-05 20:59:42 -05:00
SenseiKiwi
06cf72f9f7 Fixed Flawed Link Redirection
Fixed the way in which we handle redirecting links to blacklisted
dimensions. The previous method always converted links into safe exits.
This lead to strange situations that could be seen as bugs. For
instance, using a dungeon entrance in a root dimension would generate an
exit door and a supporting platform directly above the entrance door.
That also meant that any visited dungeons would be unusable if they were
reset.

We now do different things depending on the location of the link and its
type. If the link is a dungeon link, then its destination is reset to
allow a new dungeon to form. For other link types, if the link is in a
pocket dimension, then it becomes a safe exit link, because it could be
the only way out. If it's in a root dimension, then there are no
reasonable destinations, so the teleport request is cancelled.
2014-07-05 21:28:10 -04:00
SenseiKiwi
100fa38c52 Minor Changes to DDTeleporter
Made some minor changes to DDTeleporter to get rid of a few warnings.
Also tweaked and commented DDTeleporter.initializeDestination(). There
were inappropriate references to a link's internal variables instead of
using its getters and there was a subtle link overwrite for blacklist
destinations. Without comments, it would probably be unclear that
overwriting that link is safe. This changes are in preparation for
fixing issues with blacklisted destination redirection.
2014-07-05 14:18:18 -04:00
SenseiKiwi
17a770eaf0 Minor Change
Added two comments to CommandTeleportPlayer
2014-07-04 20:55:57 -04:00
SenseiKiwi
16f0a8303a Rewrote CommandTeleportPlayer
Rewrote CommandTeleportPlayer for the same reason as usual. There were a
few bugs before, such as that lookups for players were limited to within
the world from which the command sender was using the command. Players
in other dimensions could not be teleported. The command would also
place people in the ground because it did not adjust its coordinates for
the way that DDTeleporter interprets them - as the location of the top
block of a door and the player's head.
2014-07-04 20:20:46 -04:00
SenseiKiwi
1e3b32a15c Minor Change
Removed a reference to CommandDeleteAllLinks from mod_pocketDim.
2014-07-04 14:06:41 -04:00
SenseiKiwi
4d53ae5f6a Removed CommandDeleteAllLinks
I removed CommandDeleteAllLinks because of the significant risk that it
would harm a server. It's possible that someone could run this by
accident instead of CommandDeleteRifts. It takes the same arguments or
even no arguments and it would immediately wipe all links in a
dimension. We can restore it later if it's really needed.
2014-07-04 13:53:44 -04:00
SenseiKiwi
d3860119e9 Minor Change to PocketManager
Added a minor check to PocketManager.loadDimension() so that an attempt
to load an unregistered dimension won't be passed on to Forge where it
would cause an exception - which is then caught by Forge before it can
cause problems. This isn't strictly necessary, but it's a nice
consideration.
2014-07-04 13:05:08 -04:00
SenseiKiwi
f64768ed16 Rewrote DeleteFolder
Rewrote the helper class DeleteFolder. It was leaving behind empty
directories when pockets were deleted.
2014-07-04 02:14:24 -04:00
SenseiKiwi
c1e58c25cc Increased Max Monolith Aggro
Increased the maximum Monolith aggro level and the cap range values by a
factor of 1.25. The max aggro increase is to slow down how long it takes
Monoliths to max out because they're just a little too fast right now.
The cap adjustments will preserve the range of texture states they can
have while idling.
2014-07-04 01:17:25 -04:00
SenseiKiwi
805e9dd040 Minor Changes
Fixed up a few spots to clear some warnings.
2014-07-03 22:49:15 -04:00
SenseiKiwi
972a67de76 Rewrote CommandResetDungeons
1. Rewrote CommandResetDungeons to improve clarity and remove bugs. This
version of the command preserves valid links. Those were previously
removed, which would break some dungeons unnecessarily.
2. Fixed NewDimData.setParentToRoot(). The function did not account for
the possibility that the target's parent might still exist and would
need to be updated, leading to conflicting data. It also did not reset
pack depth. We now correctly update a dimension and all its descendants.
2014-07-03 22:46:31 -04:00
SenseiKiwi
592aabf627 Minor Change
Added a comment in PocketManager to explain why we don't unregister
pocket dimensions with Forge when we delete them.
2014-07-03 17:32:40 -04:00
SenseiKiwi
b4a58f5c88 Simplified PocketManager
1. Rewrote or removed a few bits that were causing minor warnings.
2. Rewrote deleteDimensionFiles() and deleteDimensionData() to remove
unnecessary casts and checks. We can confirm that those checks are
unnecessary because those functions are only used inside PocketManager.
If they were ever exposed externally, then we would need to add checks
again.
2014-07-03 17:20:59 -04:00
SenseiKiwi
80bb87dac6 Rewrote CommandDeleteRifts
Rewrote CommandDeleteRifts for clarity and to remove several flaws.
Previously, the command would have removed non-immune blocks that were
in the same location as a rift. It also set blocks in the command
sender's dimension rather than the target dimension, so blocks would
have potentially disappeared from the wrong world.
2014-07-03 14:19:08 -04:00
SenseiKiwi
c5a77268fc Changes to Commands
Removed a few server-side checks that I missed on the previous commit.
2014-07-03 14:08:51 -04:00
SenseiKiwi
262595ff4d Changes to Commands
1. Fixed some warnings in the affected commands.
2. Removed checks for whether a command is running on the server or
client side. We have performed those checks inconsistently throughout
our commands without problems. I assume that they must be running on the
server side only. If I'm wrong, we can add a check to DDCommandBase.
3. Minor punctuation change in DDCommandResult
2014-07-03 12:25:00 -04:00
SenseiKiwi
c29db9b729 Minor Changes
Cleaned up the code in DDCommandBase a little.
2014-07-03 12:02:36 -04:00
StevenRS11
689df1ad6d Merge pull request #167 from SenseiKiwi/master
Fixed Bugs in Golden Dimensional Doors
2014-07-02 13:21:38 -05:00
SenseiKiwi
ec290b0dc1 Increased Version Number
Increased the mod's version number to account for recent fixes and small
features.
2014-07-02 13:59:55 -04:00
SenseiKiwi
3d88e72ecb Fixed Bugs in Golden Dimensional Doors
1. We weren't giving old tickets to the doors that owned them. That
would result in doors requesting new tickets and the old ones wouldn't
be released. Each time a server rebooted, a new ticket would be created.
Then Opis would report that many chunks were forcefully loaded in a
pocket because it doesn't consider overlapping tickets. We now give
doors their old tickets when they're reloaded and we release extra
tickets referring to the same door. That will also deal with the excess
tickets that already exist on servers.
2. Rewrote the logic for checking if a Golden Dimensional Door is
allowed to force-load a pocket. We now check if the door is within the
horizontal bounds of the pocket. This prevents the confusing scenario
where someone places a door far away from the pocket but the only chunks
affected are in the pocket.
3. Fixed the calculation for determining which chunks must be
force-loaded to cover a pocket. This has the benefit that fewer chunks
should need to be loaded. It should be enough to load 16 chunks. We
previously loaded 25 chunks just to err on the side of caution.
4. Golden Dimensional Doors only try to initialize as chunk loaders
once. We previously allowed them to keep trying every tick until they
could get a ticket.
2014-07-02 13:38:57 -04:00
SenseiKiwi
b2e086e7c1 Added the Universal Limbo Setting
Added the Universal Limbo config option to the world config settings.
When enabled, it causes players to get teleported to Limbo if they die
in any dimension except Limbo. It's disabled by default.

This feature was requested by Mr_Turing.
2014-07-01 21:55:57 -04:00
SenseiKiwi
e3665c09dd Added Hunger Restoration on Limbo Respawn
Added code to EventHookContainer.revivePlayerInLimbo() so that the
player's food level is restored upon respawning in Limbo. Apparently it
was possible for players to have death loops from starving to death in
Hardcore Limbo.
2014-06-28 13:06:22 -04:00
StevenRS11
fb4643d7cf deleted renderRift 2014-06-27 16:27:23 -04:00
StevenRS11
5ba58dc91b Merge remote-tracking branch 'origin/master' into StevenRS
Conflicts:
	src/main/java/StevenDimDoors/mod_pocketDim/CraftingManager.java
	src/main/java/StevenDimDoors/mod_pocketDim/EventHookContainer.java
	src/main/java/StevenDimDoors/mod_pocketDim/core/DDTeleporter.java
	src/main/java/StevenDimDoors/mod_pocketDim/core/DimLink.java
	src/main/java/StevenDimDoors/mod_pocketDim/items/ItemRiftSignature.java

	src/main/java/StevenDimDoors/mod_pocketDim/items/ItemStabilizedRiftSignature.java
	src/main/java/StevenDimDoors/mod_pocketDim/mod_pocketDim.java
	src/main/java/StevenDimDoors/mod_pocketDim/world/PocketBuilder.java
	src/main/java/StevenDimDoors/mod_pocketDimClient/RenderRift.java
2014-06-27 16:26:46 -04:00
StevenRS11
dea76b1a7e Merge pull request #166 from SenseiKiwi/master
Various Fixes
2014-06-26 18:17:34 -05:00