Commit graph

23 commits

Author SHA1 Message Date
StevenRS11
9420b8edf2 Deleting dungeons is still buggy 2013-10-09 19:07:58 -04:00
StevenRS11
f47a9d8b99 Added orientation to linkdata and door regen 2013-09-30 00:21:52 -04:00
SenseiKiwi
1d1d0a767c Fixed Doors and Minor Dungeon Change
Fixed the regression bug that caused some of our doors to get placed in
the wrong direction. Changing doors to inherit from BaseDimDoor caused
BlockRotator to assume they weren't dimensional doors because it used
"instanceof DimensionalDoor" to check. Thanks for figuring it out,
Steven! ^_^

Also made a minor change to dungeon generation. We now check the game
rule doMobSpawning and don't spawn Monoliths from DungeonSchematic if
the value is false. This is useful for testing without Monoliths around.
We still do work to remove the portal frame blocks even if the mobs
aren't spawned.
2013-09-07 20:14:14 -04:00
SenseiKiwi
fd4b9b5086 Fixed Regression in DungeonSchematic
As part of the rewrite, I'd removed code related to replacing the
sandstone markers under dungeon exit doors, so the markers weren't being
replaced. Now that's working again.
2013-09-07 13:14:43 -04:00
SenseiKiwi
03660699cf Minor Changes
Cleaned up our code related to initializing dimensions. Removed
redundant instances of that code and instead created a function:
PocketManager.loadDimension() - to centralize all uses of that logic.
Added LinkTypes.REVERSE to represent links leading back out of pockets
through their entrances. That distinction might prove critical in the
future when we support resetting dungeons.
2013-09-05 21:03:11 -04:00
SenseiKiwi
b3847a62b7 Fixed More Bugs
1. Fixed mistakes in PocketBuilder that would cause dungeons to be
initialized as non-dungeon pockets. This restored Monolith spawning
around dungeons.
2. Fixed a bug in DungeonSchematic - returning links through entry doors
should work now.
3. Made minor changes to DungeonSchematic for clarity
2013-09-04 13:48:54 -04:00
SenseiKiwi
56ecb0cd9e Reorganized DimLink Code
Moved the DimLink code out of NewDimData in order to reduce clutter
inside that class and made it a separate class, except for functions
that should only be available for NewDimData. Deleted IDimLink and
changed all references to it to use DimLink instead. DimLink is now an
abstract class, which achieves the same encapsulation and protection we
had before by having DimLink implement IDimLink from within NewDimData.
NewDimData has a new class inside, InnerDimLink, which provides it
access to special functions that would be dangerous to expose. This is
the same mechanism used to protect NewDimData's dangerous functions.
These changes are in preparation for adding more code for packet
handling.
2013-09-02 11:47:12 -04:00
SenseiKiwi
62fed83e2f Started Rewriting Packet Handling
Started rewriting our packet handling code. Deleted PacketHandler in
favor of using sided (Server-, Client-) packet handlers to make it
easier to follow what's going on in our code. Added some event-based
handling of updates which greatly simplified signaling that data needs
to be sent, but it's not completely done yet.
2013-09-01 22:01:17 -04:00
SenseiKiwi
efa5b3eb4c Modified NewDimData and IDimLink
Modified how links are created so that the caller must specify a link
type when the link is created, rather than setting it later. This was
done to avoid having to send two link data packets following the way
links would be handled logically. Turns out this was good idea overall
for ensuring link integrity, because there was one case where I forgot
to set the link type after creating the link.
2013-09-01 10:50:20 -04:00
SenseiKiwi
9930068775 Fixed PocketBuilder and More
1. Changed DungeonSchematic to use an external instance of Random rather
than initializing its own.
2. Created the Pair class, a strongly-typed tuple that was needed in
PocketBuilder.
3. Added a missing calculation in NewDimData for setting the packDepth
field during dungeon initialization.
4. Finished code missing in PocketBuilder. Changes listed above were
needed for this.
2013-08-30 16:27:27 -04:00
SenseiKiwi
8e8346864e Fixed DungeonSchematic
Modified DungeonSchematic to use the new link and dimension classes.
2013-08-30 10:57:08 -04:00
SenseiKiwi
934dcfde3d Flipped a Table
Replaced several core classes from DD with new classes to enforce
integrity checks. Rewriting everything that depended on those classes is
a massive undertaking but it should simplify our code and prevent the
many bugs we've seen lately. The rewrite isn't done yet, just committing
my progress so far.
2013-08-29 02:14:24 -04:00
SenseiKiwi
dd9b1f0c65 Started Rewriting LinkData
Created NewLinkData and replaced references to the original LinkData.
Moved it to the mod_pocketDim.core package. Added Point4D, an immutable
point type for 3D integer coordinates with an added dimension ID.
2013-08-23 04:12:56 -04:00
StevenRS11
a1a9e39caa Minor fixes
Rift placement with /dd-rift is fixed
Signs rotate properly
consistent behavior for wooden dim doors in pockets and dungeons
2013-08-23 01:30:24 -04:00
SenseiKiwi
0e67596ca0 Progress on Implementing Dungeon Packs
1. Integrated support for dungeon pack config options into the code
(i.e. we actually DO what the settings specify)
2. Added random transitions from one dungeon type to another. Dungeons
might also begin with a non-default pack.
3. Fixed a config reading bug that caused settings to be ignored and
some invalid settings wouldn't trigger exceptions. Also fixed other
dungeon pack bugs.
2013-08-21 14:26:10 -04:00
SenseiKiwi
81bac7b7ff Added Support for More Metadata Rotations
Added support for rotating the metadata of powered tracks and detector
tracks. Also made a minor change to DungeonSchematic to protect its
internal state.
2013-08-02 14:46:47 -04:00
SenseiKiwi
b050c6c61b Improved Metadata Rotation Code
Simplified metadata rotation code by only having a single function that
rotates metadata by 90 degrees clockwise and applying it repeatedly for
180 and 270 degree rotations. Removed flipDoorMetadata() from dimHelper
and replaced all references to it with references to BlockRotator. This
makes all our rotations reference a single function. Replaced hardcoded
rotation in DungeonSchematic.

Added support for wood (tree trunk) and quartz pillar metadata
rotations.
2013-08-02 07:48:44 -04:00
SenseiKiwi
1dd9d802b0 Converted Schematic Doors
Converted the doors in our schematics into doors from DD. Also converted
mangled block IDs into Fabric of Reality and wiped all tile entities
from Steven's schematics to remove prefilled chests that had been
included somehow. Changed DungeonSchematic to expect mod doors now. This
means we can include Vanilla doors in our designs and they will not be
converted anymore.

This process was done by automatically re-exporting all of our dungeons
multiple times, so it serves as a good test that importing and exporting
are working properly. We confirmed by thorough testing that our
schematics load properly into WorldEdit. MCedit, unfortunately, does not
handle them right. We believe this is a bug in MCedit, NOT with us.
2013-08-01 23:36:28 -04:00
StevenRS11
b278af0c23 Changes to dimHelper
replaced dimHelper.dimList.get with dimHelper.instance.getDimData
added functions to make working with rifts easier
2013-07-31 19:34:08 -04:00
SenseiKiwi
0c8d012f50 Minor Change
Made a minor change to DungeonSchematic so that it replaces foreign mod
blocks with the standardized FoR ID on export. Previously it used the
Forge-assigned ID, but since that happens after ID standardization, it
could cause us to export non-standard IDs.
2013-07-30 18:27:40 -04:00
SenseiKiwi
766336a259 Fixed Door Bugs
Fixed the bugs that caused doors not to appear right in dungeons. First
there was a bug with filters that caused them not to replace blocks
properly. I made some changes to SchematicFilter and its derived classes
so that the implementations are a little more intuitive. That should
prevent those bugs in any future derived classes. Then doors wouldn't
rotate properly. DD was never designed to rotate dimensional doors. I
added code to BlockRotator for that and shifted some code from
DungeonHelper to BlockRotator. More coherence, less coupling!
2013-07-30 17:57:05 -04:00
SenseiKiwi
f4653d0522 Improved and Integrated DungeonSchematic
Improved DungeonSchematic to the point that it can replace
SchematicLoader as our method of loading dungeons. Some of the code was
copied over rather than refactored to save time. It's been subdivided so
make it much more readable. Also, we can reimplement portions of it as
WorldOperations later on further remove redudancy. Testing shows that
there is one problem left to fix: door blocks are not being set up
correctly at the moment. Rifts are being set up properly and attaching
doors to rifts will show that dungeons continue to generate fine.

Added classes to support DungeonSchematic and its additional filtering
logic on import and export. SpecialBlockFinder handles listing the
entrance, other doors in the dungeon, and end portal frames.
FillContainersOperation is a WorldOperation that fills chests and
dispensers. BlockRotator is a temporary class to hold
transformMetadata() and transformPoint() until we rewrite that code
later.

Stripped out most of the code from SchematicLoader to ensure it's no
longer used. The only remaining function sets up dungeon pockets. We can
phase it out in a later version so as not to delay our release. Removed
references to SchematicLoader in mod_pocketDim since it no longer needs
to be instantiated.
2013-07-30 13:58:14 -04:00
SenseiKiwi
877678c945 Created DungeonSchematic Class
Created DungeonSchematic, a class that extends Schematic and adds
DD-specific functionality such as methods for filtering the schematic's
block before importing and exporting. Testing confirms that
DungeonSchematic works well so far, although it still lacks critical
features.

Made some minor changes to Schematic and copied
SchematicLoader.setBlockDirectly(). I realized during testing that
setting blocks without using that function could cause problems. First,
it's possible that the blocks would not be placed if chunks weren't
created. Second, there are issues with blocks updating if we use World
to set them, even if block updates are disabled. That causes some
torches to break and other weird problems.

Added classes to support block filtering operations applied to
Schematic. These are used to implement ID standardization and removing
mod blocks when importing.
2013-07-29 09:58:47 -04:00