Commit graph

227 commits

Author SHA1 Message Date
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