Commit graph

65 commits

Author SHA1 Message Date
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
SenseiKiwi
17c9118126 Fixed Dungeon Listing and Formatting Bugs
Added a workaround so that the dungeon list produced by
CommandAddDungeonRift does not have repeated names. Also cleaned up the
code a bit - it's a mess in there. Part of the rewrite eliminated the
bug that caused some dungeon names to be preceded by a backslash (or
slash). I've noticed a different bug now - the dungeon tutorial file is
being included in the list of dungeons. I'll be fixing that in the next
commit.
2013-06-17 06:18:15 -04:00
SenseiKiwi
cf2246061c Trivial Changes
Made trivial changes to DungeonHelper. Just some spacing and a note to
check something in the future. Need to commit to change branches.
2013-06-16 14:40:26 -04:00
SenseiKiwi
8dce8c1c26 Renamed all singleton create() to initialize()
Renamed the create() function of DDProperties and DungeonHelper to
initialize(). Why? Because it was bugging me. <.< That is all.
2013-06-16 12:06:21 -04:00
SenseiKiwi
f542941074 Replaced Hashtable with HashMap
Replaced all instances of Hashtable in our code with HashMap. I had
never given that much thought until Steven mentioned it. HashMap is a
better alternative for our code.
2013-06-16 11:06:08 -04:00
SenseiKiwi
63be7fefc1 Tweaked Dungeon Tutorial Copy Code
Tweaked the code that copies the dungeon export tutorial. I'm not sure
it worked all the time before. It didn't seem quite right. I've
confirmed it's working better now. Also cleaned up copyfile a little.
2013-06-16 10:54:03 -04:00
SenseiKiwi
61297c3a3a Improved DungeonHelper
Separated exportDungeon() from registerCustomDungeon() - exporting a
dungeon no longer automatically registers it. Also changed
exportDungeon() so that it returns a boolean indicating success or
failure, instead of an instance of DungeonGenerator that was never being
used. I modified CommandEndDungeonCreation so that it can warn you if
exporting the dungeon failed (if exportDungeon() returned false), and
also, to register the dungeon after it's exported since it's no longer
automatic.
2013-06-16 05:59:53 -04:00
SenseiKiwi
256384b455 Merging upstream changes
Merging upstream changes
2013-06-16 04:56:27 -04:00
StevenRS11
5e107f37f9 a few last tweaks 2013-06-16 03:40:46 -04:00
StevenRS11
cd4679c8fd configurable rift gen and monolith spawn density 2013-06-16 02:59:02 -04:00
SenseiKiwi
1bb8ddc1c4 Merging in upstream changes 2013-06-16 02:46:39 -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
SenseiKiwi
8e200da01b Fixed minor bug
Fixed a bug with an uninitialized variable in DungeonHelper. Oops!
2013-06-16 01:30:13 -04:00
SenseiKiwi
d2259c3f5d Reintegrated initialization code for DungeonHelper
I had previously removed the function calls in mod_pocketDim to migrate
them to DungeonHelper. Completed the migration now.
2013-06-16 01:13:06 -04:00
SenseiKiwi
f56893018d Changed DungeonHelper into a singleton
Changed DungeonHelper into a singleton. Changed code in other classes to
interface with it properly.
2013-06-16 01:00:05 -04:00
SenseiKiwi
9828bd7f40 Fixed duplicate custom dungeon listing
Removed a line in CommandEndDungeonCreation that inserted a new dungeon
directly into DungeonHelper.customDungeons. This had a chance of causing
a duplicate listing. registerCustomDungeon() was already being invoked
before and if reading tags from the file name failed, the dungeon would
get added twice. This could explain some of the buggy dungeon listing
that would appear during testing.
2013-06-15 11:30:05 -04:00
SenseiKiwi
86f0cd7d21 Improved DungeonHelper.registerCustomDungeon()
Changed the function to use a Hashtable mapping dungeon types to their
respective lists so that it wouldn't be necessary to hardcode a
condition for each type. The code is much shorter now and we can add new
types with ease. The next stage will be to remove
weightedDungeonGetList, if possible, so that we don't have to construct
a list with duplicates just to have weights. The loop that repeatedly
inserted dungeons into that list has been removed anyway, but it
shouldn't affect anything since custom dungeon integration was broken
and weights were being ignored.
2013-06-15 11:21:49 -04:00
SenseiKiwi
1e2dedaafe Overhauling DungeonHelper
I changed the name filter for schematic names from
CommandEndDungeonCreation to DungeonHelper, and renamed it to
NamePattern. I also rewrote most of registerCustomDungeon() to be much
more concise. The changes are incomplete but I'm making an intermediate
commit. The aim is to change DungeonHelper into a proper singleton and
to eliminate the clunky sections that manually map dungeon categories to
their corresponding lists. Instead, I'll use data structures to
implement that far more efficiently.
2013-06-15 10:25:50 -04:00
SenseiKiwi
51969793a5 Fixed minor bug and cleaned up DungeonHelper
Set various lists of DungeonGenerators to private - there was no need to
make them public fields. While cleaning up the code before, I
accidentally erased the default constructor, which handled loading a
reference to DDProperties. I've put the code back in so that the class
works correctly.
2013-06-15 08:46:28 -04:00