Commit graph

936 commits

Author SHA1 Message Date
SenseiKiwi
f0c1d2b700 Merge remote-tracking branch 'upstream/master' 2013-07-31 23:23:47 -04:00
SenseiKiwi
89e2f4d8b6 Reorganized Schematics
Removed untagged schematics and replaced them with the tagged
schematics. Moved two schematics that said NOT DONE into a "wip"
subfolder. Moved somethingBroke into a "core" subfolder. All remaining
schematics were placed in a "ruins" subfolder in preparation for the new
dungeon packs system. I did my best to ensure that all of the old
schematics had been copied and tagged, but it's possible I might have
missed one or two. I also copied in my new dungeons. This commit
temporarily breaks the mod until the new file names and locations are
referenced.
2013-07-31 23:22:33 -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
StevenRS11
7190a4ac6d Merge pull request #59 from SenseiKiwi/master
Fixed MCedit 1.7.1 Support
2013-07-31 14:24:26 -07:00
SenseiKiwi
c83d622ceb Fixed MCedit 1.7.1 Support
Made a minor change to Schematic so that MCedit will load our schematics
properly.
2013-07-31 16:56:42 -04:00
SenseiKiwi
02e8325f30 Merge remote-tracking branch 'upstream/master' 2013-07-31 16:15:29 -04:00
SenseiKiwi
27cfd444a9 Minor Change
Added explanation of mysterious RiftGenerator condition.
2013-07-31 16:15:13 -04:00
StevenRS11
c92e5b2096 Merge pull request #58 from SenseiKiwi/master
Added Support for GenerateStructures
2013-07-31 12:43:38 -07:00
StevenRS11
9f039f3851 Merge pull request #57 from SenseiKiwi/ProgressOnUpdate
Progress to Next Update
2013-07-31 12:34:39 -07:00
SenseiKiwi
a4793944b3 Added Support for GenerateStructures
We now check whether structure generation is allowed. This can be
configured on servers and when creating single-player worlds. If set to
false, Rift Gateways will not generate. Rift clusters still generate.
That was an intentional feature - we could make the setting disable
those as well if we want.
2013-07-31 14:25:24 -04:00
SenseiKiwi
371b5ce30f Added Exception on Bad Terrain Block IDs
DDProperties will now throw an exception that should crash Minecraft if
the user tries to use invalid block IDs for worldgen blocks. Should save
everyone some suffering.
2013-07-31 12:24:10 -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
StevenRS11
f7ad55eea0 fixed a dungeon 2013-07-31 00:03:58 -04:00
StevenRS11
80968f9abf Fixed falling damage persisting after teleport 2013-07-30 20:19:00 -04:00
StevenRS11
c87e572136 Fixed /dd-rift orientation funkyness. 2013-07-30 20:15:55 -04:00
StevenRS11
9c3013899f Merge pull request #56 from SenseiKiwi/master
Overhauled Schematic Importing and Exporting
2013-07-30 15:29:38 -07:00
SenseiKiwi
0c8d012f50 Minor Change
Made a minor change to DungeonSchematic so that it replaces foreign mod
blocks with the standardized FoR ID on export. Previously it used the
Forge-assigned ID, but since that happens after ID standardization, it
could cause us to export non-standard IDs.
2013-07-30 18:27:40 -04:00
SenseiKiwi
9f728dbd6c Merged Upstream Changes 2013-07-30 18:11:33 -04:00
StevenRS11
b4a4c52784 Merge branch 'master' of https://github.com/StevenRS11/DimDoors 2013-07-30 17:57:06 -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
StevenRS11
d747c96c08 Fixed rift rotation bug & added teleport command
Moved the selection of the dungeon to when the player first enters the
door, not when the rift is created.
2013-07-30 17:56:59 -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
8b64165e2e Improvements to Schematic
Fixed bugs and made minor changes to Schematic. I've tested that it
works properly now. It still needs to perform additional DD-specific
functions and must be integrated to dungeon importing.
2013-07-28 23:02:56 -04:00
SenseiKiwi
77efb63a5f Improved Schematic Class
Improved the Schematic class. Added support for reading schematic files.
That functionality still needs to be integrated and tested. Made minor
changes to WorldOperation and its derived classes. Also fixed a few bugs
in Schematic's export functions that were found during testing. The
exporting code still doesn't do all the changes (e.g. block
standardization) that had been implemented before.
2013-07-27 17:29:55 -04:00
StevenRS11
a5665aad02 Merge pull request #55 from SenseiKiwi/RiftRegenNPEFix
Fixed NPE in RiftRegenerator
2013-07-27 09:11:03 -07: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
edef4ec5b5 Fixed NPE in RiftRegenerator
Fixed a NullPointerException in RiftRegenerator. I had forgotten to
initialize the properties field for use in the class.
2013-07-26 22:50:05 -04:00
StevenRS11
0edbf1f14d Merge pull request #53 from SenseiKiwi/master
Various Changes, Support for doMobSpawning, Overhauled CommonTickHandler
2013-07-26 12:38:46 -07:00
StevenRS11
0d3db7d35a Merge pull request #52 from SenseiKiwi/1.4.1fixes
Fixed NPE in yCoordHelper, Other Bugs, Reimplemented Limbo Decay
2013-07-26 12:32:37 -07:00
SenseiKiwi
a766589eb0 Finished Renaming Classes
Removed the Xs from the ends of LimboSkyProvider and PocketProvider. Now
their names are properly capitalized.
2013-07-26 05:31:59 -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
687a75f4d5 Overhauled Tick Sending by CommonTickHandler
Overhauled the way in which CommonTickHandler triggers tick-based
actions such as Limbo decay, spawning Monoliths, and regenerating rifts.
Now CommonTickHandler implements an interface called IRegularTickSender,
which indicates that it will periodically call on classes that implement
IRegulatTickReceiver to perform some task. I added classes for each
regularly scheduled task we were performing: MonolithSpawner and
RiftRegenerator, plus converted LimboDecay to a normal class instead of
a static class.  Modified several classes so that they have access to
the MonolithSpawner instance to request MonolithSpawning when needed.
This improves the structure of our code and gets us away from the way we
did things before, which was accessing a public static list inside
CommonTickHandler from other classes and adding arrays to specify chunk
coordinates. We should not be exposing the internal state of classes
like that! And we should be using clearly defined objects to pass
information.
2013-07-26 05:15:44 -04:00
SenseiKiwi
bfc532da1f Renamed and Moved Files
Moved CommonTickHandler into the ticking package in preparation for the
next change. Renamed CommandStartDungeonCreation to CommandCreatePocket,
since creation pockets of variable sizes will be its future role now
that it's not strictly necessary for exporting. Renamed
CommandEndDungeonCreation to CommandExportDungeon, since we no longer
have a dungeon creation process like before.
2013-07-26 02:09:14 -04:00
SenseiKiwi
03b727881a Minor Change
Minor change. Renamed all the functions in LimboDecay to begin with
lowercase letters, as is the usual style for Java development. It
slipped my mind for some reason. Uppercase starting letters is the usual
style for C# development.
2013-07-26 01:58:35 -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
960f9af1a8 Added Support for doMobSpawning Game Rule
Added support for the doMobSpawning game rule. Jaitsu requested this so
that he could disable Monoliths while testing the mod. I think it's a
fair idea - you can't disable Monoliths without also disabling every
other mob except the animals.
2013-07-26 01:09:46 -04:00
SenseiKiwi
984755f920 Reduced Frequency of Fast Limbo Decay Operations
Added an interval to CommonTickHandler so that fast decay operations are
performed less frequency. The previous rate was unnecessarily fast. This
will also reduce the performance impact of fast decay considerably,
although testers did not report any noticeable performance decreases.
2013-07-25 23:54:30 -04:00
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
StevenRS11
9290781094 Merge pull request #44 from SenseiKiwi/master
Fixed Explosion Resistance Bug and Hopper Metadata Rotation
2013-07-19 09:00:07 -07: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