Commit graph

65 commits

Author SHA1 Message Date
StevenRS11
03163de4dd various fixes
Fixed rifts not moving correctly when moving dungeons to stay inside
world bounds
Regular pockets stay in world bounds.
RiftRegenerator no longer NPEs
Fixes #48, #63
2013-08-01 18:01:42 -04:00
SenseiKiwi
a081419855 Progress on Vertical Dungeon Clipping (broken)
Changed SchematicLoader to use new dimHelper functions to move links
around. This should have allowed us to shift dungeons safely.
Unfortunately, Minecraft still crashes, so the link functions aren't
working as advertised. Please figure out what's going on. >_< The code
is done, it's just link issues that prevent it from working.
2013-08-01 13:37:33 -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
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
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
3a6b22c7cc Renamed Classes
Renamed MobObelisk to MobMonolith. Renamed LimboSkyProvider and
PocketProvider to have Xs at the ends of their names. This is temporary
so that I can change the name's capitalization. Windows considers the
names the same because it's file naming is case insensitive.
2013-07-26 05:30:59 -04:00
SenseiKiwi
7044d80457 Added Support for Hopper Metadata Rotation
Added code for SchematicLoader so that hoppers will rotate properly.
This was probably not considered an issue before we had support for tile
entity exports and imports. Now it's critical that we support hoppers.
There are other blocks that are still not supported - we should really
fix this in the future so that all blocks will rotate. The code for this
is overly complicated - we should look into a simpler method.
2013-07-19 09:28:54 -04:00
SenseiKiwi
d805d63c0a Fixed Metadata Issue in SchematicLoader
I modified the way SchematicLoader handles blocks with metadata.
Previously, we would always copy metadata over without additional
checks. If we converted a mod block into Fabric of Reality, metadata
would have no effect because FoR did not have subtypes. Now that FoR has
subtypes, loading metadata blindly could cause unexpected effects, such
as generating Ancient Fabric instead of FoR. I changed the code so that
we only count a block as "changed" if we change its block ID and we
don't want to preserve the original metadata. In that case, the metadata
is set to 0.
2013-07-16 18:06:27 -04:00
SenseiKiwi
c4f0a16af8 Minor Change to SchematicLoader
Changed transformMetadata() from a public instance function to a private
static function. I was curious as to whether it was being used by code
outside SchematicLoader. The code compiles so it must be local-only. In
the future, when we switch from using this function to the rotation
class, the compiler will warn us that this function is no longer being
used. Then we'll remember to remove it.
2013-07-16 17:54:38 -04:00
SenseiKiwi
f2f0abc8d9 Minor Change
Removed a comment from SchematicLoader.transformPoint() that is no
longer relevant. It refers to counterclockwise rotations even though our
rotations are commented as clockwise now.
2013-07-15 21:38:52 -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
a713dcd2a3 Minor Change
Added a reminder to remove a debug print.
2013-07-09 15:41:39 -04:00
SenseiKiwi
63782c0fef Added Support for Arbitrary Entrance Directions
Changed SchematicLoader so that schematics that have entrances that are
not facing North will still be rotated properly. This involves a
workaround for transformMetadata() since it assumes schematics are
always saved "facing" North.

I've tested this and it's working perfectly, with one exception. If you
create a rift with dd-rift to a dungeon that wasn't saved pointing
North, the rifts sometimes appear beside the player, instead of in the
block where the player's head is. Sometimes you'll appear in the dungeon
facing the right way. Other times, you'll appear inside a wall adjacent
to the entrance or near the entrance facing the wrong way. I have not
managed to narrow down why this happens.
2013-07-09 03:47:28 -04:00
SenseiKiwi
efe5da2604 Overhauled SchematicLoader (again)
Rotations in SchematicLoader are understandable now. I changed all the
code to use transformPoint() and made sure that the rotations in there
are correct. Testing shows that rooms are being generated correctly. I
also edited portions of the code for clarity and removed some debug
prints. The loading process now allows permafabric to generate - it was
previously converted into regular fabric of reality.  For the moment,
the code is stuck to assume that the entry direction is North. I'll
remove that constraint in the next commit.
2013-07-09 00:50:06 -04:00
SenseiKiwi
c3c3611764 Minor Improvements and Debugging Tweaks
Minor improvements to the readability and performance of
SchematicLoader. Added a little temporary code for debugging purposes.
2013-07-07 19:59:04 -04:00
StevenRS11
f489158a78 orientation fix attempt
Works only if .schematic faces north
2013-07-04 23:28:09 -04:00
StevenRS11
545c42cd07 removed debug 2013-07-02 23:51:12 -04:00
StevenRS11
aa2d369f3e Reimplemented wooden warp door gen 2013-06-30 00:24:44 -04:00
StevenRS11
c444515907 Flipped east/west rotation 2013-06-27 01:03:09 -04:00
SenseiKiwi
77b3dba7be Partially Fixed Rotation Bugs
It turns out my earlier commits didn't completely fix things because
certain implementation details were missing. I had assumed they were
done. Also, some of the information I had regarding the default
schematic orientation was wrong. This commit remedies most of those
problems with a robust rotation implementation. However, I haven't added
the code for linking Warp Doors yet, and there is a bug with tile
entities getting reversed in East/West oriented rooms. Not sure why
that's happening.
2013-06-26 23:54:06 -04:00
SenseiKiwi
949ae5707d Minor Fix
Fixed variable initialization to keep the compiler happy.
2013-06-26 01:19:28 -04:00
SenseiKiwi
6c64b111de Renamed Variable
Renamed incomingLink as "entrance". There!
2013-06-26 01:16:29 -04:00
SenseiKiwi
b0edafa81e Fixed Rotation in SchematicLoader
It turns out that rotation hadn't been implemented in the code I moved
during my last commit. I've changed things slightly to implement
rotation. I also renamed some coordinate variables to prevent confusion.
2013-06-26 01:13:27 -04:00
SenseiKiwi
471114415b Fixed Rotation in SchematicLoader
Fixed reference to CommandRegenPocket - should be CommandResetDungeons.
Autofixed indentation in SchematicLoader. I wanted to commit that change
before doing any more code changes but I forgot. Then I fixed the code
that calculates the coordinate offsets so our dungeons rotate right. It
was pretty simple - all I had to do was move the xCooe and zCooe
calculations into the loops so they're recalculated to account for
rotation. I rearranged the loops for optimal performance.
2013-06-26 00:45:20 -04:00
StevenRS11
a499ca4213 rewrote schematicLoader 2013-06-25 22:10:15 -04:00
StevenRS11
06a8abbf74 Added regen dungeon command & removed hasMark 2013-06-24 01:40:56 -04:00
StevenRS11
e847794e8d fixed save killing change, awaiting further fix 2013-06-24 00:11:14 -04:00
StevenRS11
d5caa918c8 monolith spawning via end portal frame blocks 2013-06-23 23:49:54 -04:00
StevenRS11
77965d7d0d Patched bug with dungeon selection on old worlds 2013-06-18 18:08:19 -04:00
StevenRS11
cd4679c8fd configurable rift gen and monolith spawn density 2013-06-16 02:59:02 -04:00
StevenRS11
0752c032d3 merged SenseiKiwi changes 2013-06-16 01:50:23 -04:00
StevenRS11
a2eb4cf524 Fixed limbo return, schematic crash 2013-06-16 01:44:05 -04:00
StevenRS11
cb9c996861 monolith spawn and NPE in SchematicLoader fixes 2013-06-16 00:32:10 -04:00
StevenRS11
7ebcfb6c20 release 2013-06-15 04:19:08 -04:00
SenseiKiwi
b1130d0cc6 Overhauled loot generation
Dimensional dungeon loot chests are now registered with Forge. Other
mods can tap into our chests and our own generation is cleaner. The list
of items in our chests is generated in DDLoot.
2013-06-14 15:22:22 -04:00
StevenRS11
5f5569e9b9 fixed chest crash and mobelisk spawns 2013-06-14 04:58:48 -04:00
StevenRS11
078ee999be Merging changes 2013-06-14 01:53:30 -04:00
SenseiKiwi
b11354767d Overhauled configuration properties
Moved all configuration variables from mod_pocketDim to DDProperties
(formerly DimDoorsConfig). Changed property names to be clearer in
config file, modified some comments, and generally cleaned up the config
file. Fixed some missing properties and variables that were reading from
the wrong properties. Modified the order in which mod_pocketDim
instantiated some of its static fields so that they would load after
properties are read. Almost all classes load after properties are read.
Fixed indentation across various files and replaced references to
properties in mod_pocketDim with references to DDProperties.
2013-06-13 19:01:54 -04:00
StevenRS11
ebf35a056a Release canidate 2013-06-13 16:44:17 -04:00
StevenRS11
558f2915b9 fixed upgrade crash 2013-06-13 15:44:11 -04:00
StevenRS11
b388a00e05 redid commands, added more rotation support. 2013-06-12 17:59:34 -04:00
StevenRS11
2c09434e4c importing TE 2013-06-12 00:42:24 -04:00
StevenRS11
eee6f11154 working on block rotation 2013-06-11 15:43:27 -04:00
StevenRS11
bd1c1d0118 finished update, starting testing builds 2013-06-10 17:03:52 -04:00
StevenRS11
fa15c13d37 finished dungeon export basic implementation 2013-06-09 17:23:36 -04:00
StevenRS11
4858a69be5 Export function added 2013-06-04 08:52:06 -04:00
StevenRS11
b97eab46b5 rebuilt how rifts get dungeon data assigned to them 2013-06-03 20:56:15 -04:00
StevenRS11
a8ac17f81b fixed dungeon gen 2013-06-02 23:49:47 -04:00
StevenRS11
004d06ab7d more work on import 2013-06-02 09:57:05 -04:00