Commit graph

1019 commits

Author SHA1 Message Date
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
dea76b1a7e Merge pull request #166 from SenseiKiwi/master
Various Fixes
2014-06-26 18:17:34 -05:00
SenseiKiwi
42568a1864 Removed RenderRift
Removed the RenderRift class since it relates to unused functionality
and references fields that I removed from TileEntityRift.
2014-06-26 12:20:19 -04:00
SenseiKiwi
e40168954f Minor Change to TileEntityRift
Changed the function call for playing the rift-closing sound to match
other similar calls in Minecraft - the sound should target the center of
the block. I also switched the last flag argument. It seems to determine
whether distance between the player and the source should be checked
when playing back the sound, although documentation is lacking so I
can't be sure. Other blocks that use that function use "false", while
things involving sounds that should be heard uniformly, such as
rainfall, use "true".
---
I noticed that this code runs on the client and server. Some parts
modify link data and rifts on the client side. We should really stop
this from happening as it could lead to inconsistencies.
2014-06-26 12:17:59 -04:00
SenseiKiwi
59f335ac8c Added Dispenser Support for SRS
Added support for using Stabilized Rift Signatures from dispensers under
specific conditions. Everything works except for playing the sound that
occurs when an SRS is used. Not sure why that's not working.
2014-06-26 12:11:51 -04:00
SenseiKiwi
444b862b12 Minor Change
Renamed the field mod_pocketDim.itemStabilizedLinkSignature to
itemStabilizedRiftSignature to follow the item's actual name.
2014-06-26 09:19:04 -04:00
SenseiKiwi
a0629b51a3 Improvements to TileEntityRift
1. Removed several fields and functions referring to the newer rendering
code. The functions were just cluttering up the code and the fields were
consuming additional memory that was never being used for anything.
2. Updated NBT reading and writing functions to give some tags proper
names and to remove references to unused fields.
Removed the tag for riftCloseTimer because it was unnecessary alongside
the shouldClose flag. If a server reboots while a rift is closing, the
rift can start over upon reloading.
3. Renamed some fields and functions to have better names.
4. Changed the various checks for closing rifts. There were a few
redundant parts. We don't have to put calls to "this.invalidate()"
everywhere on top of explicitly removing the tile entity and destroying
its block.
5. Rewrote update timing checks. The rift spread and Enderman spawning
calls have been separated to distribute the impact of updating a rift.
Also, a flaw in the timing logic meant that the calculations for
particle offsets would only run when a rift was first created. That's
been fixed.
2014-06-26 07:06:17 -04:00
SenseiKiwi
364ba11f81 Updates to TileEntityRift
1. Fixed the bug where the setting that controls whether Endermen can
spawn from rifts was being ignored. It was never checked at all.
2. Cleaned up some formatting and annotations.
3. Removed call to World.removeBlockTileEntity() following a call to
World.setBlockToAir(). The latter function already handles removing the
tile entity.
2014-06-26 05:40:35 -04:00
SenseiKiwi
96238d6b53 Minor Change
Minor spacing and annotation changes.
2014-06-26 04:52:32 -04:00
SenseiKiwi
448890207f Completed Changes to Stabilized Rift Signature
Completed the change to Stabilized Rift Signatures so that overwriting
links that already belonged to an SRS is done for free.
2014-06-26 04:52:03 -04:00
SenseiKiwi
fe035f6677 Renamed Function in NewDimData
Renamed NewDimData.setDestination() to setLinkDestination(). I realized
that the name was a little confusing at first sight - it confused me!
2014-06-25 20:15:43 -04:00
SenseiKiwi
4192270ef3 Changes and Fixes to Rift Signature Variants
1. Changed hasEffect() override since we were overriding a deprecated
version.
2. Fixed a bug where we checked if a block could be edited before
deciding whether to change the Y coordinate of the rift to be placed.
Sometimes we would place the rift in a different block. This is the
result of sticking in support for special blocks like grass and snow
without considering the impact on surrounding code. It also contradicted
comments that specifically said special blocks were ignored...
3. Cleaned up the code for checking for special blocks.
4. Fixed a bug in loading NBT data. There were no null checks on
orientation data. If a Rift Signature or Stabilized Rift Signature had
been created in a version of DD before orientations were set up, then it
cause an exception when so much as looked at in later versions of DD.
5. Partially implemented free redirects for Stabilized Rift Signatures.
The check to determine if a redirect is being done is missing.
2014-06-25 20:13:03 -04:00
SenseiKiwi
0029d9dac0 Reduced Usage of Stable Fabric
1. Changed the crafting recipes for most DD items to use Ender Pearls
instead of Stable Fabric. The items that still use Stable Fabric are
Dimensional Doors, Golden Dimensional Doors, Rift Blades, and Stabilized
Rift Signatures. Steven had already made this change in another branch
but I'd like to push this out with several bug fixes. The SRS recipe is
different from his version - it's now just 4 Iron Ingots and a Stable
Fabric.
2. Change Stabilized Rift Signatures back to consuming Ender Pearls
instead of Stable Fabric.
2014-06-25 19:00:41 -04:00
SenseiKiwi
794310bd98 Fixed Max Stack Size of ItemGoldDoor
Changed the max stack size of ItemGoldDoor to 16 as it is for Vanilla
doors on some modpacks. Later versions of Vanilla have door stacking to
64 so this will need to change eventually.
2014-06-25 15:18:50 -04:00
SenseiKiwi
a4d0f39390 Minor Change
Cleaned up comments for BaseItemDoor.tryToPlaceDoor()
2014-06-25 15:08:30 -04:00
SenseiKiwi
e4e84644ac Changed Door Item Mapping Code
1. Changed EventHookContainer to remove a check against
BaseItemDoor.getDoorToPlace().  The checks performed there can be done
in BaseItemDoor.tryToPlaceDoor(), which removes the need for callers to
know more internal details about how doors are handled. I moved the
checks inside.
2. Renamed vanillaDoorMapping to doorItemMapping. It now maps dim door
items to themselves to remove the need for various checks we were
performing. Updated BaseItemDoor's constructor to reflect this change.
3. Removed BaseItemDoor.getDoorToPlace() and integrated its
functionality into BaseItemDoor.tryToPlaceDoor().
4. Changed BaseItemDoor.tryToPlaceDoor() so that it simply returns false
if a given item stack cannot be used to place any doors. We don't need
to check if the item is an ItemDoor or anything like that now.
2014-06-25 14:56:59 -04:00
SenseiKiwi
660ff4255e Code Cleaning
1. Cleaned up some spacing and unused imports in EventHookContainer.
Also changed an indirect reference to BaseItemDoor.trytoPlaceDoor() to a
direct reference seeing as the function is static and should be accessed
that way.
2. Renamed getDoortoItemMapping() to getDoorBlock(). The original named
had a minor capitalization mistake and implied that it would return a
mapping table or would associate doors to items. The function actually
associates items to door blocks.
2014-06-25 14:33:19 -04:00
SenseiKiwi
161da193ad Merge remote-tracking branch 'upstream/master' 2014-06-25 14:04:56 -04:00
SenseiKiwi
4d39d13703 Changes to Monolith Behavior
1. Stopped Monoliths from teleporting players while in Limbo. This was a
serious issue on some modpacks if players got unlucky.
2. Decreased the required Monolith aggro level to start spawning
particles around a target player. The required level was so high,
combined with the current Monolith speed, that players would hardly see
the particles.
3. Disabled Monolith sounds in Limbo. Some of the sounds were really
annoying in Limbo. Usually they only get to play for a moment before a
player is teleported, but since no teleports occur in Limbo and the area
is full of Monoliths, the constant noise is aggravating. It would also
drown out the background music.
2014-06-25 14:04:08 -04:00
StevenRS11
117ed69bf7 added dimdata schema 2014-06-20 13:46:36 -04:00
StevenRS11
0d53f6c029 Actually fix door crash 2014-05-31 06:43:28 -04:00
SenseiKiwi
f9331e4f2d Merge remote-tracking branch 'upstream/master' 2014-05-29 17:20:30 -04:00
StevenRS11
7da3b7fc62 Patched a door crash bug
thanks LClouds
2014-05-26 22:23:36 -04:00
StevenRS11
ac9b3d73e8 Various
Fixed bug in converting old saves
Started color work
2014-05-16 21:42:59 -04:00
SenseiKiwi
8d1028ccb5 Changes to CraftingManager
* Fixed a mistake in the crafting recipe for Golden Dim Doors
* Removed static import of fields from mod_pocketDim. There were already
qualified references to those fields in some areas. We should be
consistent.
2014-05-15 06:45:26 -04:00
StevenRS11
d020dd384b toString ftw 2014-05-15 05:53:28 -04:00
StevenRS11
8562456203 Merge pull request #162 from SenseiKiwi/master
Tweaked Monolith Aggro Rate
2014-05-06 03:48:03 -04:00
SenseiKiwi
af77f8b2dc Fighting with Git
Someday git won't randomly explode all over my face
2014-05-06 03:45:21 -04:00