Commit graph

84 commits

Author SHA1 Message Date
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
SenseiKiwi
2b1d80f9f9 Fixed Config Loading Bug
Fixed a problem that caused bundled configs to not load sometimes.
2013-08-22 22:57:26 -04:00
SenseiKiwi
939ed771a8 Completed Dungeon Pack Implementation
Added code so that the mod loads dungeon packs stored in the custom
dungeons folder. Changed the code for loading bundled dungeons so that
they're loaded as dungeon packs. This means dungeon packs are now fully
integrated into the mod. The changes were tested and seem to be working
perfectly.
2013-08-22 02:25:26 -04:00
SenseiKiwi
f1bfac3e16 Minor Change
Moved the getDimDungeonPack() function from SchematicLoader to
DungeonHelper so that DungeonHelper.RuinsPack could be a private
variable.
2013-08-21 14:49:41 -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
acab06115a Progress on Implementing Dungeon Packs
Added code for parsing dungeon pack config files. The settings for our
built-in dungeons are now read from a file instead of being hardcoded.
One or two settings aren't being accessed yet and we still don't search
for other dungeon packs in the custom dungeon folder.  That'll come in
another commit.
2013-08-20 18:54:30 -04:00
SenseiKiwi
dc7289a048 Dungeon Selection Fix and Chain Config Change
Changed how Random is initialized in SchematicLoader to prevent issues
with dim doors in the same chunks leading to the same dungeon. The
selection seems much more varied now. Also changed the hardcoded config
for the default dungeon chains to the one we'll be using later (from a
file). For testing purposes.
2013-08-15 07:29:37 -04:00
SenseiKiwi
f372b9ccb5 Basic Configurable Dungeon Chains
Completed a basic version of configurable dungeon chains. Almost all of
the final funcionality is present. However, the configuration is
hardcoded at the moment, not read from a file. This was done for testing
purposes. I'll add reading from config files soon.

Dungeon packs are partially implemented. Built-in and custom dungeons
are currently thrown into the default pack, Ruins. The next step is to
generalize the dungeon registration code in DungeonHelper so that we can
detect dungeon packs, read their config files, and register dungeons
with their corresponding pack. dd-export will need to support packs as
well. dd-rift will have issues dealing with duplicate dungeon names
across packs, but this isn't a major concern and can be dealt with in
the long term.
2013-08-05 20:16:45 -04:00
SenseiKiwi
101e9e4ce6 Progress on Implementing Dungeon Packs
Completed enough of the implementation and integration to compile DD.
Some portions of the code are only for testing and will be removed
later. The configuration for default dungeons is hardcoded - we can
parse config files once we're certain that dungeon chains work. At the
moment, dungeons generate but it doesn't seem like the rules we set are
being followed properly.

Renamed OptimizedRule to DungeonChainRule, and renamed the old
DungeonChainRule to DungeonChainRuleDefinition, to match the role of
each class better. Added some hax to DungeonGenerator to get packs
integrated - the implementation will be much cleaner once the new save
format is done.
2013-08-05 09:48:49 -04:00
SenseiKiwi
e96fc02747 Progress on Implementing Dungeon Packs
Started implementing our support for dungeon packs. The code is not
usable yet and the mod is not functional at this stage. A few additional
changes should make it testable. A significant obstacle to implementing
dungeon packs easily is that DungeonGenerator doesn't have some
necessary information and shouldn't be modified. Even if it is modified,
old serialized instances wouldn't have the new fields initialized. I'm
having to create workarounds until we implement the new save format.

DungeonPack handles all of the logic of selecting a dungeon and
verifying whether its type is valid. It relies on DungeonChainRule and
OptimizedRule to check which dungeons should be generated next given a
list of the dungeons in a chain. DungeonType maps types in packs to ID
numbers and provides a reference to the pack that owns the type.
DungeonPackConfig will carry config information to be passed to the
DungeonPack constructor.
2013-08-04 19:27:34 -04:00
SenseiKiwi
0c7da8a54c Minor Improvements to DungeonHelper
Minor improvements to DungeonHelper. Cleaned up constants a bit and
added a new constant.
2013-08-02 04:54:24 -04:00
SenseiKiwi
0b9f8fa5d5 Improved DungeonHelper
Completed changes so that our code uses registerDungeon() (formerly
registerCustomDungeons() ) to register all dungeons, both bundled with
the mod and custom ones. Made some changes to the code to hide
implementation details from other classes. Also, I had some problems
with old dungeons being mixed into the renamed ones. I had to remove
fallingTNThall from the schematics folder and deleted the WIP folder
because I think we have completed versions of those schematics already.

Some of our dungeons have pre-filled chests and the contents are more
generous than our current loot system (e.g. ruinsO has a prefilled
chest). I'll have to wipe all the chests later.
2013-08-01 13:00:27 -04:00
SenseiKiwi
a174ad4b29 Fixed CommandCreateDungeonRift
Forgot to fix a reference to DungeonHelper in CommandCreateDungeonRift
during the last commit. Made some further improvements to DungeonHelper
to avoid exposing internal variables.
2013-08-01 00:05:08 -04:00
SenseiKiwi
5ddf2c636f Improvements to DungeonHelper
Removed hardcoded references to all our internal dungeons. The code will
be replaced by reading from a list in the next commit. Renamed
customDungeons to untaggedDungeons and removed registration of tagged
dungeons into that list. Now all tagged dungeons (custom and internal)
are listed in registeredDungeons. Fixed the comparator used to sort
dungeon names so that it sorts them case insensitively.
2013-07-31 23:56:26 -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
96c1b3d7a4 Fixed Vertical Dungeon Clipping
Added code to SchematicLoader to adjust the Y coordinate of the
destination link into a dungeon before the dungeon is created.
IMPORTANT: The code is commented out at the moment because it causes a
link-related NullPointerException. A link needs to be updated through
DimHelper but the code is hard to follow so I've decided to just not
touch it - Steven will have to do it.

The function adjustDestinationY() checks if the given entrance location
would place any portion of the dungeon outside the vertical bounds of
the world. If so, it corrects the location while moving it as little as
possible from its original place.

Also added some checks to make sure that any schematic we load has an
entrance door. Otherwise, load defaultBreak instead. And I cut down on
the absurd number of compiler warnings in dimHelper. <_< Stop accessing
static fields as instance fields!
2013-07-31 12:09:47 -04:00
SenseiKiwi
356bfe4bd0 Limited Sizes of Generated Dungeons
Added validation to SchematicLoader that prevents dungeons beyond
certain maximum dimensions from being loaded. Our current limits are the
same as the largest dungeon we could export. Rewrote
generateDungeonPocket() to handle that possible failure better.
2013-07-31 08:05:58 -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
SenseiKiwi
210c791af4 Created Schematic Class
Separated part of the dungeon-exporting logic into a new class:
Schematic. Also created a few classes to implement important operations.
Some parts of the original exporting logic are missing now, such as
mapping certain blocks to standard IDs. That will be reimplemented in
the future. Importing schematics is not supported yet. I need to test
what's done so far.
2013-07-27 06:52:30 -04:00
SenseiKiwi
1b8d2aed53 Removed dd-create Requirement for Exporting
Removed the code in DungeonHelper and CommandEndDungeonCreation that
would force the player to use "override" with when exporting dungeons
that DD did not recognized as having been built in custom dungeon
pockets. This restriction is no longer necessary now that we don't need
pockets with standardized orientations or Eternal Fabric boundaries.
2013-07-26 01:57:18 -04:00
SenseiKiwi
84cfa9904c Fixed Export Height Bug
Fixed a bug in DungeonHelper that could cause dungeons to get clipped
during export if they extend past Y = 127. We used
world.getActualHeight() to obtain the height of the pocket, which should
be 256, but getActualHeight() returns 128 for dimensions with no sky.
Pocket dimensions are set to have no sky, so this becomes an issue.
2013-07-24 20:17:56 -04:00
StevenRS11
3050dc9d1f Chnaged dungeon 2013-07-18 14:30:21 -04:00
StevenRS11
c0ac76cdfe Added dungeons and fixed monolith placement bug 2013-07-18 01:20:12 -04:00
SenseiKiwi
71b9ce263a Added New Dungeons
Added 12 new dungeons to the mod. Integrated them to
registerBaseDungeons() so that they should generate like all the other
base dungeons.
2013-07-17 01:45:41 -04:00
SenseiKiwi
1ac934b5e4 Added Support for Importing Tile Entities
Added code to SchematicLoader so that we can import tile entities. Empty
chests and dispensers will still be filled as before.
2013-07-15 16:58:44 -04:00
SenseiKiwi
7583df430c Minor Change
Removed import of BlockContainer from DungeonHelper.
2013-07-15 04:42:20 -04:00
SenseiKiwi
d21f29ec2c Minor Change to Tile Entity Exporting
Rewrote the code that changes the position of a tile entity to be
expressed in the schematic coordinate system. The new code should be
equivalent but easier to understand.
2013-07-15 04:38:51 -04:00
SenseiKiwi
8cc8f50f34 Added Support for Exporting Tile Entities
Added support for exporting tile entities as part of custom dungeons.
I've produced a schematic as a test that shows items are exported
properly and they're recognized in MCedit. I still need to add support
for loading tile entities in imported schematics.
2013-07-15 04:15:58 -04:00
SenseiKiwi
203580bbbf Changed Dungeon Export to use MC NBT Classes
Changed DungeonHelper.exportDungeon() to use Minecraft's NBT tag classes
instead of using JNBT. The implementation is actually slightly simpler
than our original JNBT version. I also fixed a bug in the way the
extremes of the bounding box search were calculated that caused yEnd to
have an incorrect value. Exporting works properly now. Confirmed with
tests.
2013-07-15 03:29:15 -04:00
SenseiKiwi
5756796218 Removed the JNBT Package and Classes
Removed the JNBT package and classes. I'm going to try rewriting
DungeonHelper to export dungeons using Minecraft's standard NBT classes.
2013-07-15 02:32:34 -04:00
SenseiKiwi
7dba7683b3 Progress on Tile Entity Export Support
Committing some minor code before making major changes.
2013-07-15 01:59:02 -04:00
SenseiKiwi
404ae3f80d Minor Change
Fixed DungeonHelper.exportDungeon() to have proper name. I'd changed the
name before to track where the function was being used in our code.
2013-07-15 01:58:01 -04:00
SenseiKiwi
90b463b54d Standardized Exported Block IDs
Standardized exported block IDs for fabric of reality and permafabric
blocks. Now we should always export the same block IDs.
2013-07-15 00:54:53 -04:00
SenseiKiwi
d23198c4fa Fixed Selection of Bounds for Custom Dungeons
Fixed the selection of boundaries for custom dungeons. The code had a
bug that would clip off a portion of dungeons during exporting. Also,
permafabric is not used to mark the edges of the dungeon anymore. That
means dungeons can contain permafabric now without getting cut off, and
the permafabric shells will be included as part of the export.
2013-07-15 00:47:32 -04:00
StevenRS11
4508c2fd74 Added creative tab 2013-07-13 14:13:01 -04:00
StevenRS11
314b2dee04 Added method to return dungeons already generated. 2013-07-12 23:40:21 -04:00
StevenRS11
c444515907 Flipped east/west rotation 2013-06-27 01:03:09 -04:00
SenseiKiwi
bc2745a596 Partial Overhaul of Commands
Made progress on overhauling and prettifying our commands. There are
still more changes to be done for this to be functional. I need to do an
intermediate commit because I want to merge in recent changes by Steven.
2013-06-25 13:55:13 -04:00
SenseiKiwi
82b8c93c8b Minor Change to DungeonHelper
Minor change to DungeonHelper. Added the dash character to the
characters allowed in schematic names.
2013-06-22 19:14:17 -04:00
SenseiKiwi
bbb39da808 Fixed Bugs in DungeonHelper
1. Added converting dungeon type names to lowercase before adding them
to dungeonTypeMapping (a HashMap that associates dungeon type strings
with their lists). Keeping the original casing was causing a
NullPointerException when the HashMap returned null and we expected to
receive a non-null list.
2. Added code to strip out the file extension of a schematic in
validateSchematicName(). The extension was getting dragged along with
the dungeon's weight, which would cause parsing to fail and the name was
considered invalid. This means that none of the custom dungeons were
being registered for generation since the system saw them as badly
tagged. They also wouldn't generate Monoliths even if tagged as closed
because we would ignore the tags.
3. Changed a comparison for the "open" tag to be case insensitive.
4. Minor changes
2013-06-22 14:27:59 -04:00
SenseiKiwi
248f14971e Fixed Empty Dungeon Guide Bug
Fixed the bug that caused "How_to_add_dungeons.txt" to be copied as an
empty file. The reason was very subtle. Also moved the file to a
different directory.
2013-06-20 04:47:16 -04:00
SenseiKiwi
cac45814a9 Merge remote-tracking branch 'upstream/master' into R1.4.0-improvements 2013-06-18 22:43:15 -04:00
SenseiKiwi
6393c240d6 Fixed minor bug
Fixed a mistake with the schematic paths of somethingBroke and defaultUp
- they were written incorrectly and so they would never load properly.
2013-06-18 22:39:03 -04:00
StevenRS11
77965d7d0d Patched bug with dungeon selection on old worlds 2013-06-18 18:08:19 -04:00
SenseiKiwi
ecaa90a438 Partially Overhauled Commands
Partially overhauled our command classes. Added DDCommandBase - it
extends CommandBase and acts as a new base class for our commands. It
removes a little redundancy in our code and provides increased
convenience. Removed the static fields for our commands in
mod_pocketDim. There was no point in keeping them when nothing was using
them. Changed in-game command names to be shorter yet relevant.
Converted all commands to singletons so proper instances can be
retrieved if necessary. Migrated some of the custom dungeon start/ending
logic to DungeonHelper and made customDungeonStatus private. Except for
data objects, we shouldn't be exposing state variables like that without
any kind of checks. I've rewritten the code in some commands but it's
been quite tiring. Still need to fix up lots of things.
2013-06-18 10:23:31 -04:00
SenseiKiwi
438b251d8f Optimized Weighted Random Dungeon Selection
Optimized the selection of random dungeons with weights applied. We now
have a class called WeightedContainer for taping into Minecraft's
weighted selection code without having to extend the WeightedRandomItem
class. Using that, we no longer need to keep a list with duplicate
dungeons to achieve weighted selection, so I removed that variable.
2013-06-17 22:26:39 -04:00
SenseiKiwi
b9f95a284a Added a comment
Just added a comment in DungeonHelper.
2013-06-17 06:34:35 -04:00
SenseiKiwi
30960acffa Fixed Tutorial Listing Bug and Improved Listing
Fixed the bug that caused the dungeon creation tutorial to be listed as
a schematic. We were listing all files in the custom schematic directory
as a schematic, even though that file wasn't. I added filtering so that
we only look at files that end with ".schematic". Also improved dungeon
listing by sorting the name list in alphabetical order. That makes the
list much easier to read through.
2013-06-17 06:31:53 -04:00