Commit graph

396 commits

Author SHA1 Message Date
SenseiKiwi
43d5d6ea51 Minor Change
Minor change. Changes comments in LimboDecay slightly so that they act
as Javadoc comments instead. That was my original intention.
2013-07-25 21:47:56 -04:00
SenseiKiwi
d923e98942 Reimplemented Limbo Decay
Reimplemented Limbo Decay in two forms. Firstly, Unraveled Fabric
accepts random ticks now and has a 50% chance of searching the 6 blocks
against its faces for blocks to decay. The average time for this decay
to occur is about 2 minutes and 17 seconds. The decay progresses a
little slowly because of having to go through stages. We might want to
consider decaying straight into Unraveled Fabric, or at least having
fewer stages. This approach is better than randomly decaying isolated
blocks because it looks like decay is spreading from the Unraveled
Fabric.

Secondly, every tick, we pick a random block from each active section in
Limbo and turn it into Unraveled Fabric immediately. Note that a section
is a 16x16x16 block cube inside a chunk. This is "fast decay", and it's
meant to stop players from avoiding Limbo decay by building floating
structures. It's not immediately obvious if you place a single block,
but if you build a 5x5 block platform, the average time for some block
to get converted drops to about 8 seconds, and it spreads from there.

Most of the logic for this is in a new class: LimboDecay. It's worth
studying whether this new implementation affects Minecraft's
performance. I'm not completely sure whether that would be an issue. The
frequency of either decay type can be decreased to improve performance.
2013-07-25 17:25:43 -04:00
SenseiKiwi
9da6304dc9 Reorganized Code in CommonTickHandler
Reorganized code in CommonTickHandler. Should be a little more readable
now. This is in preparation for reimplementing Limbo decay.
2013-07-25 01:38:58 -04:00
SenseiKiwi
98162f2839 Removed Limbo Decay
Removed the code associated with Limbo decay from EventHookContainer,
LimboBlock, and CommonTickHandler. DimHelper still has blocksToDecay
since removing it could cause deserialization failures. However, nothing
should actually use that list. I also removed several unused or
redundant methods (e.g. overriding methods and putting in exactly the
same code as in the super class), fixed indentation and renamed cryptic
variables. We should have a rule against allowing cryptic variable names
like "par2", even if they're inherited from Forge. I'll implement proper
limbo decay in the next commit.
2013-07-25 00:12:13 -04:00
SenseiKiwi
272b125282 Minor Change
Added a note on a strange condition in EventHookContainer.
2013-07-24 23:31:15 -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
SenseiKiwi
eb9c8822d9 Fixed NullPointerException in yCoordHelper
I believe I've fixed the cause of a NullPointerException that some
players have been experiencing. It seems to have been caused by
unregistered block IDs being present in Limbo. Possibly because people
removed mods and they had generated structures in Limbo. Or the players
had placed blocks and then removed the mods, or changed block IDs
around.

This fixes issue #47.
2013-07-24 15:34:21 -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
8be0c9f1d2 Merge remote-tracking branch 'upstream/master' 2013-07-19 07:24:35 -04:00
SenseiKiwi
0b8a81ef6d Fixed Explosion Resistance Bug
Fixed Ancient Fabric and Eternal Fabric being vulnerable to explosions.
I also noticed that a lot of DD blocks have unusual stats. I'm not sure
whether those stats were assigned intentionally or simply because of
copying and pasting code, but the values are certainly counterintuitive
when you consider some of the block materials.
2013-07-19 07:24:11 -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
StevenRS11
3654c10af1 finally 2013-07-17 03:49:39 -04:00
StevenRS11
54e8168bde fixing texture 2013-07-17 03:42:11 -04:00
StevenRS11
216c99e3e5 Merge pull request #43 from SenseiKiwi/master
Added New Dungeons and Fixed Various Minor Bugs
2013-07-17 00:02:10 -07:00
StevenRS11
c6989555a0 Merge pull request #42 from Unrepentant-Atheist/patch-1
Update mod_pocketDim.java
2013-07-16 22:58:43 -07: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
bd8a62b522 Removed setTickRandomly(true)
Removed setTickRandomly(true) from BlockDimWall and BlockDimWallPerm. It
was invoked in their constructors but no longer necessary.
2013-07-16 23:57:45 -04:00
SenseiKiwi
a887dfc819 Fixed Ancient Fabric Replacement Bug
Fixed a bug in BlockDimWall that would allow players to replace Ancient
Fabric by right clicking on it with a block in-hand, in the same way as
Fabric of Reality can be replaced. That would've defeated their purpose.
2013-07-16 23:37:00 -04:00
SenseiKiwi
71adfa2358 Fixed Fabric of Reality Replacement Bug
Fixed the bug in BlockDimWall that would cause Fabric of Reality to
replace itself when you right-clicked to place FoR against an FoR
surface. This happened because we considered FoR valid for replacing FoR
since it's a cube solid. Now we have an extra check to prevent that. It
was a waste of blocks to have them sort of eat each other up! Also
cleaned up some of the code in BlockDimWall.
2013-07-16 18:39:11 -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
f132153cf4 Renamed Blocks and Minor Changes
Renamed block 1973:1 to Ancient Fabric. Renamed block 220 to Eternal
Fabric. I assigned new names so that we didn't need to use the long ones
we had before (e.g. "Fabric of Reality Permanent/Pushable"). Also
removed unused imports from various classes along the way.
2013-07-16 17:52:26 -04:00
SenseiKiwi
6598618370 Merge remote-tracking branch 'upstream/master' into R1.4.0-improvements 2013-07-16 17:20:09 -04:00
StevenRS11
ea1ea8a265 fixed some naming 2013-07-16 17:14:56 -04:00
SenseiKiwi
b6e0a5131e Merge remote-tracking branch 'upstream/master' into R1.4.0-improvements 2013-07-16 17:01:45 -04:00
SenseiKiwi
ab05db40fe Additional Fixes
Removed unused import from DDProperties. Changed argument lists of
CommandDeleteRifts, CommandDeleteAllLinks, and
CommandDeleteDimensionData to read "???" since we want to get this
update out and those commands are used infrequently. We'll fix them to
have proper information for the next update.
2013-07-16 17:00:25 -04:00
StevenRS11
26c16db59c renamed dungeons pending changes to loading 2013-07-16 16:59:22 -04:00
SenseiKiwi
f97b40f2c5 Minor Style Changes and Fixes
Made some minor changes such as removing unused imports and fixing up
code to remove warnings. Stop calling static methods as if they were
instance methods!!! @_@
2013-07-16 16:54:48 -04:00
SenseiKiwi
103287461e Merge remote-tracking branch 'upstream/master' into R1.4.0-improvements 2013-07-16 16:43:04 -04:00
Unrepentant-Atheist
495aa19a73 Update mod_pocketDim.java 2013-07-16 11:30:29 +02:00
StevenRS11
db9bb02b43 FoR changes
Added a metaData block to FoR, meta 1 acts like permafabric but can be
pushed with pistons. Fixed a bug where permafabric could be pushed by
pistons.
2013-07-16 03:00:57 -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
StevenRS11
c2acfdfd1b Merge branch 'master' of https://github.com/StevenRS11/DimDoors 2013-07-15 18:15:22 -04:00
StevenRS11
a24aefb522 changes to sound 2013-07-15 18:15:10 -04:00
SenseiKiwi
f350b0d17c Merge remote-tracking branch 'upstream/master' into R1.4.0-improvements 2013-07-15 17:03:03 -04:00
SenseiKiwi
3e096c0074 Minor Change
Removed a comment from Point3D. We don't need to cache hashes since
HashMap does so internally.
2013-07-15 17:00:09 -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
888e6fe590 Fixed Bug in CommandEndDungeonCreation
Fixed a simple bug that caused dd-export to ask the user to use
'override' even though it was already being used.
2013-07-15 12:56:32 -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
StevenRS11
38f4555adb Rift blade is sword, added sounds 2013-07-15 02:45:25 -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
SenseiKiwi
df452e930f Merge remote-tracking branch 'upstream/master' into R1.4.0-improvements 2013-07-14 23:32:53 -04:00
StevenRS11
ec2156fce1 derp 2013-07-13 14:15:04 -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
d6e7fbbde5 Reworked dimension population
other mods shouldnt attempt to generate in pockets/limbo now. Expect
pockets to gen 40x faster on hexxit
2013-07-11 23:58:59 -04:00
StevenRS11
33169dc2fb Renamed printAllLinkData and limbo decay 2013-07-11 20:42:57 -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
1b9ba092a7 Merge branch 'master' of https://github.com/StevenRS11/DimDoors 2013-07-04 23:28:17 -04:00
StevenRS11
f489158a78 orientation fix attempt
Works only if .schematic faces north
2013-07-04 23:28:09 -04:00
StevenRS11
08c35d5183 Merge pull request #36 from nallar/patch-1
Actually log the error in onTickInGame, instead of printing a not-very-descriptive message.
2013-07-04 18:47:39 -07:00
StevenRS11
545c42cd07 removed debug 2013-07-02 23:51:12 -04:00
Ross Allan
e400794630 Actually log the error in onTickInGame, instead of printing a not-very-descriptive message.
Signed-off-by: Ross Allan <rallanpcl@gmail.com>
2013-06-30 20:53:02 +01: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
70dabe5c5c Merge remote-tracking branch 'upstream/master' into R1.4.0-improvements 2013-06-26 23:54:27 -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
StevenRS11
b1e18b564e Made it prettier 2013-06-26 22:28:57 -04:00
StevenRS11
1895633608 Added rotation helper class 2013-06-26 22:22:02 -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
SenseiKiwi
6e3c93fa17 Temporary Fix to Commands
Temporarily patched up CommandDeleteAllLinks,
CommandDeleteDimensionData, and CommandDeleteRifts so they'll compile.
I'll be fixing some things for Steven and I'll come back to those
classes to finish overhauling them.
2013-06-25 23:24:21 -04:00
SenseiKiwi
9e0fb946f2 Merge remote-tracking branch 'upstream/master' into R1.4.0-improvements 2013-06-25 23:18:17 -04:00
StevenRS11
a499ca4213 rewrote schematicLoader 2013-06-25 22:10:15 -04:00
SenseiKiwi
ad0e2cbe61 Improved CommandPruneDimensions
Improved CommandPruneDimensions. Cleaned up the code and improved
performance by using a HashSet instead of an ArrayList to list dimension
reachability. Added an optional argument that sets whether we should
delete the folders of pruned dimensions.
2013-06-25 20:54:58 -04:00
SenseiKiwi
d15f372c59 Improved and Renamed CommandRegenPocket
Renamed CommandRegenPocket to CommandResetDungeons. Changed command name
accordingly. Added a message for the user listing the number of dungeons
that were reset. Modified DimHelper slightly to add support for this.
Added error condition if user specifies arguments for the command.
2013-06-25 14:28:11 -04:00
SenseiKiwi
e0ccb59d15 Merge remote-tracking branch 'upstream/master' into R1.4.0-improvements 2013-06-25 13:55:34 -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
StevenRS11
60972eab21 Prevented 'overworld not loaded' crash, temp fix 2013-06-25 09:15:19 -04:00
StevenRS11
5b53399432 removed regen command pending schematicLoader 2013-06-25 00:00:58 -04:00
StevenRS11
78aefb1547 Fixed rift doors not going away. 2013-06-24 20:08:08 -04:00
StevenRS11
06a8abbf74 Added regen dungeon command & removed hasMark 2013-06-24 01:40:56 -04:00
StevenRS11
8bbd1384c5 finished changes to monolith spawning 2013-06-24 00:34:21 -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
ea74f712fd Re-worked monolith spawning code
Looks from the top of the world down now, should be more consistent.
2013-06-23 22:34:53 -04:00
SenseiKiwi
7a90dcb28b Improved PocketGenerator
Improved code in PocketGenerator. Restricted Monolith generation to the
chunk in which populate() is being applied. We should not be generating
Monoliths outside that chunk. Changed condition that would exit the
function if the next available space for a Monolith was above Y = 245.
Exiting the function at that point made no sense.

I've realized that this placement algorithm has probably been patched up
several times and that's resulted in nonsensical code. For instance, the
loop continues as long as you continue finding higher points to place
Monoliths. That would suggest you intended to make columns of them. But
since the loop chooses random columns on each iteration goes back to Y =
0, you're really just jumping around and placing Monoliths in random
places, while using irrelevant checks to decide whether to continue. I
really recommend coming up with a different algorithm. I haven't
replaced it completely in case it would break something.
2013-06-23 16:17:04 -04:00
SenseiKiwi
1ca11f4df3 Removed Recursion from PocketGenerator
Rewrote PocketGenerator.populate() to remove the recursive call to
itself.
2013-06-23 03:03:40 -04:00
SenseiKiwi
ffcb3aa74a Minor Change
Completed renaming pocketGenerator as PocketGenerator.
2013-06-23 02:54:28 -04:00
SenseiKiwi
c6e6ff6db2 Minor Change
Just need to make an intermediate commit for renaming PocketGenerator.
Technical issues...
2013-06-23 02:53:10 -04:00
SenseiKiwi
0a6f6c9615 Cleaned up PocketGenerator
Cleaned up some of the code in PocketGenerator. Seeded the generation of
Monoliths as a function of the world seed. All of our randomized
selections should be functions of the world seed so people can exchange
seeds with cool DD features. I will rename the file to have proper
capitalization in the next commit. Then I have to fix Monolith spawning.

Also, don't use recursion as a way to loop functions if you could simply
have a loop. I'm referring to the way PocketGenerator.populate() calls
itself. Completely unnecessary.
2013-06-23 02:49:25 -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
58b72b3b5a Added temporary debug prints to copyfile
Added temporary debug prints to copyfile
2013-06-20 03:31:40 -04:00
SenseiKiwi
7e76ccebfb Added Rift Blade Rift Creation Setting
Added a property in our config that enables or disables the Rift Blade's
ability to create new rifts. It can still open existing rifts even if
that ability is disabled. I tested that to be certain. If the ability is
disabled, the Rift Blade blocks on right-click instead of charging like
a bow.
2013-06-18 23:04:36 -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
a628f3c63b Fixed Bug in RiftGenerator
Fixed a small bug. DDProperties.WorldRiftGenerationEnabled is supposed
to control whether rifts and gateways generate outside of Limbo. I
assume that rifts and gateways are always supposed to generate in Limbo
given the wording of that description. However, if the flag was set to
false, we would also disable rift generation in Limbo. I've fixed this
by ignoring that flag if we detect that the chunk is in Limbo.
2013-06-18 13:34:03 -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
45e039573b Renamed Command Classes, Deleted Unused Class
Renamed some of the command classes to change "Dim" to "Dimension". I'm
a firm believer in writing most things out except when it would be
absurd. Also deleted CommandPrintDungeonData because it didn't do
anything. We can always add it again if we want it.
2013-06-18 06:50:10 -04:00
SenseiKiwi
e37312e733 Trivial changes
Trivial changes.
2013-06-18 02:27:36 -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
3b88d3a116 Cleaned up ItemStableFabric
Cleaned up the indentation of ItemStableFabric and corrected some faulty
String comparisons.
2013-06-17 05:53:11 -04:00
SenseiKiwi
654a479692 Improved Gateway and Rift Generation
Added checks for the material that a gateway is being built upon. Now
gateways no longer generate on top of trees. Combined with multiple
generation attempts, there is a good chance that they will find a gap
between trees to generate at ground level. I also added checks to stop
gateways and rifts from generating on top of the Nether's bedrock.
2013-06-17 05:40:35 -04:00
SenseiKiwi
e7b064e3cb Fixed Gen Directionality Bug and Minor Tweak
I fixed a subtle bug in RiftGenerator. The code for picking random
coordinates on the surface of a chunk would subtract a random amount
from the coordinate of the chunk's corner. Unfortunately, subtracting
meant that we would almost always generate coordinates OUTSIDE the
intended chunk. The correct calculation was to add, not subtract. This
meant that if you walked in a direction in which our gateways were
generated outside of existing chunks, then their data would be lost and
no gateways would generate!

To reproduce this bug, max out the chance of generating gateways and fly
in the direction that decreases X and Z. You must fly into new chunks.
After passing the gateways produced when you spawn (if this is a new
world) you'll see that gateways don't generate on the landscape.
However, if you change directions, they'll begin generating again.

In addition to fixing that bug, I also tweaked all the block setting
calls in RiftGenerator so that they'll trigger block updates and send
update packets to the client. I think triggering block updates will
prevent unusual problems with floating sand, gravel, etc.
2013-06-17 03:38:10 -04:00
SenseiKiwi
4ceace1b47 Added retrying on Rift Gateway generation
Added a loop that allows RiftGenerator to retry generating a gateway if
it picks an invalid location for it. It has a limited number of tries
before it gives up and doesn't generate a gateway. I haven't added the
logic for avoiding generating on top of trees, but that'll be easy to
add now.
2013-06-17 03:20:00 -04:00
StevenRS11
c4665e0737 Fixed dungeon entrance not updating client. 2013-06-16 22:10:52 -04:00
StevenRS11
8e771d4047 tweaked generation of the platform a bit 2013-06-16 16:03:10 -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
b2f5c4ea4e Overhauled RiftGenerator
Overhauled RIftGenerator. The code is significantly more readable now.
It's commented and much more compact. I also removed all fields from
RiftGenerator - they were unnecessary and using them increased the risk
of buggy code. Made the code rely solely on the Random instance provided
by MC, meaning our rifts and gateways will be tied to the world seed.
Tweaked the code slightly so that clusters of rifts and gateways can
never generate in the same chunk. This was previously possible, although
highly unlikely. It's a work of art now. <3
2013-06-16 14:36:32 -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
697b0da59f Fixed Configuration and Rift Generation Bugs
Although fields were created in DDProperties for Monolith spawning and
Rift generation, they were mislabeled as reading the "World Rift
Generation Enabled" property. I gave them proper names. I also changed
the fields and names to be more intuitive and rewrote the descriptions.
For instance, "MonolithSpawnDensity" is a misnomer because as density
increases, there should be more Monoliths, not less. Now the properties
clearly state how they affect a feature. I rewrote the conditions that
used each property to correspond with those simplified descriptions and
gave the properties default values that will match the generation rates
seen before.

I also made the rift generation code less cryptic and fixed a bug; there
was a check that compared if a dimension was a pocket dimension by its
name to prevent rift generation. That name check was wrong - it would
never work. Now we check if the provider is an instance of
pocketProvider. That will continue working even if we change the way
that pocket dimensions are named.
2013-06-16 09:57:51 -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
a95b282814 Cleaned references in mod_pocketDim
Cleaned references in mod_pocketDim
2013-06-16 05:18:17 -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
af555bbac8 Merge remote-tracking branch 'upstream/master' into R1.4.0-improvements 2013-06-16 01:30:50 -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
StevenRS11
cb9c996861 monolith spawn and NPE in SchematicLoader fixes 2013-06-16 00:32:10 -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
SenseiKiwi
84e430abfd Improved DungeonHelper
I was able to infer that HashMap schematic should have generic
parameters <String, Tag> and changed the declaration accordingly. All
generic collections in DungeonHelper are now parameterized properly.
2013-06-15 08:13:50 -04:00
SenseiKiwi
172e3e3af1 Cleaned up and tweaked DungeonHelper
Cleaned up the indentation and empty lines in DungeonHelper. Set
metadataFlipList and metadataNextList to have generic type Integer,
since they're used to store block IDs. Whenever possible, we should
always be using parameterized collections instead of leaving their types
unspecified. I'd like to fix up the schematic HashMap in the future -
unless it's necessary, we shouldn't be storing values of various types
in that collection. Strongly typed variables or a class with the
appropriate fields would be much cleaner.
2013-06-15 08:07:33 -04:00
SenseiKiwi
4e8b8deab7 Formatted DungeonGenerator
Changed the formatting in DungeonGenerator. Autocorrected indentation
and removed extra empty lines to improve readability. None of the
variables were changed since that would break compability with previous
serialized instances.
2013-06-15 07:50:00 -04:00
SenseiKiwi
4c23e5c7b8 Minor change to SchematicLoader
Changed SchematicLoader to use DDLoot.DungeonChestInfo instead of
requesting a reference to the same data through ChestGenHooks. Exactly
the same data is being retrieved, but ChestGenHooks retrieves it by
performing a lookup on a map relating loot categories to loot info, so
it's slightly slower. No point in doing that if we have access to the
reference directly.
2013-06-15 07:24:28 -04:00
SenseiKiwi
21d94b7c66 Tweaked loot generation
Decreased the weight of DD items very slightly to make them a little
more rare. Added a section to DDLoot.mergeCategories() that searches for
the enchanted book loot and fixes its weight to 3 (instead of the usual
1). This makes enchanted books slightly more common. I confirmed that
books are actually spawning in loot chests. There is the possibility
that there is a built-in chance of an enchanted book taking up a chest
slot but not actually generating anything.
2013-06-15 06:32:30 -04:00
StevenRS11
d75de7c2e0 oknow 2013-06-15 05:34:37 -04:00
StevenRS11
9c33393d89 release 2013-06-15 05:34:36 -04:00
StevenRS11
1f4f38cfe3 more monolith spawning 2013-06-15 05:34:35 -04:00
StevenRS11
4a58f793a9 oknow 2013-06-15 04:30:46 -04:00
StevenRS11
7ebcfb6c20 release 2013-06-15 04:19:08 -04:00
StevenRS11
7bdce8d2be Merge branch 'master' of https://github.com/StevenRS11/DimDoors 2013-06-15 03:09:52 -04:00